diff --git a/paige/node_modules/.package-lock.json b/paige/node_modules/.package-lock.json index 67c7577a..9cb18f61 100644 --- a/paige/node_modules/.package-lock.json +++ b/paige/node_modules/.package-lock.json @@ -55,9 +55,9 @@ } }, "node_modules/katex": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.8.tgz", - "integrity": "sha512-ftuDnJbcbOckGY11OO+zg3OofESlbR5DRl2cmN8HeWeeFIV7wTXvAOx8kEjZjobhA+9wh2fbKeO6cdcA9Mnovg==", + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.10.tgz", + "integrity": "sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==", "funding": [ "https://opencollective.com/katex", "https://github.com/sponsors/katex" diff --git a/paige/node_modules/katex/README.md b/paige/node_modules/katex/README.md index 25d89faa..88e5df8f 100644 --- a/paige/node_modules/katex/README.md +++ b/paige/node_modules/katex/README.md @@ -37,13 +37,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)! - + - + - ... diff --git a/paige/node_modules/katex/contrib/copy-tex/README.md b/paige/node_modules/katex/contrib/copy-tex/README.md index 333cbc35..f1a7d885 100644 --- a/paige/node_modules/katex/contrib/copy-tex/README.md +++ b/paige/node_modules/katex/contrib/copy-tex/README.md @@ -18,7 +18,7 @@ This extension isn't part of KaTeX proper, so the script should be separately included in the page. ```html - + ``` (Note that, as of KaTeX 0.16.0, there is no longer a corresponding CSS file.) @@ -35,5 +35,5 @@ statement with `require('katex/contrib/copy-tex/katex2tex.js')`. ECMAScript module is also available: ```html - + ``` diff --git a/paige/node_modules/katex/contrib/mathtex-script-type/README.md b/paige/node_modules/katex/contrib/mathtex-script-type/README.md index 1557ec0a..4270d4af 100644 --- a/paige/node_modules/katex/contrib/mathtex-script-type/README.md +++ b/paige/node_modules/katex/contrib/mathtex-script-type/README.md @@ -11,7 +11,7 @@ included in the page, in addition to KaTeX. Load the extension by adding the following line to your HTML file. ```html - + ``` You can download the script and use it locally, or from a local KaTeX installation instead. @@ -23,9 +23,9 @@ Then, in the body, we use a `math/tex` script to typeset the equation `x+\sqrt{1 - - - + + + @@ -35,4 +35,4 @@ Then, in the body, we use a `math/tex` script to typeset the equation `x+\sqrt{1 ECMAScript module is also available: ```html - + diff --git a/paige/node_modules/katex/contrib/mhchem/README.md b/paige/node_modules/katex/contrib/mhchem/README.md index a210dfaf..75c1fd39 100644 --- a/paige/node_modules/katex/contrib/mhchem/README.md +++ b/paige/node_modules/katex/contrib/mhchem/README.md @@ -7,7 +7,7 @@ This extension adds to KaTeX the `\ce` and `\pu` functions from the [mhchem](htt This extension isn't part of core KaTeX, so the script should be separately included. Write the following line into the HTML page's ``. Place it *after* the line that calls `katex.js`, and if you make use of the [auto-render](https://katex.org/docs/autorender.html) extension, place it *before* the line that calls `auto-render.js`. ```html - + ``` If you remove the `defer` attribute from this tag, then you must also remove the `defer` attribute from the ` + - ... diff --git a/paige/node_modules/katex/dist/contrib/auto-render.js b/paige/node_modules/katex/dist/contrib/auto-render.js index 0ec4f69f..d02b742a 100644 --- a/paige/node_modules/katex/dist/contrib/auto-render.js +++ b/paige/node_modules/katex/dist/contrib/auto-render.js @@ -90,15 +90,15 @@ var external_katex_ = __webpack_require__(771); var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_); ;// CONCATENATED MODULE: ./contrib/auto-render/splitAtDelimiters.js /* eslint no-constant-condition:0 */ -var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) { +const findEndOfMath = function (delimiter, text, startIndex) { // Adapted from // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx - var index = startIndex; - var braceLevel = 0; - var delimLength = delimiter.length; + let index = startIndex; + let braceLevel = 0; + const delimLength = delimiter.length; while (index < text.length) { - var character = text[index]; + const character = text[index]; if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) { return index; @@ -116,18 +116,16 @@ var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) { return -1; }; -var escapeRegex = function escapeRegex(string) { +const escapeRegex = function (string) { return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); }; -var amsRegex = /^\\begin{/; +const amsRegex = /^\\begin{/; -var splitAtDelimiters = function splitAtDelimiters(text, delimiters) { - var index; - var data = []; - var regexLeft = new RegExp("(" + delimiters.map(function (x) { - return escapeRegex(x.left); - }).join("|") + ")"); +const splitAtDelimiters = function (text, delimiters) { + let index; + const data = []; + const regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")"); while (true) { index = text.search(regexLeft); @@ -145,21 +143,19 @@ var splitAtDelimiters = function splitAtDelimiters(text, delimiters) { } // ... so this always succeeds: - var i = delimiters.findIndex(function (delim) { - return text.startsWith(delim.left); - }); + const i = delimiters.findIndex(delim => text.startsWith(delim.left)); index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length); if (index === -1) { break; } - var rawData = text.slice(0, index + delimiters[i].right.length); - var math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index); + const rawData = text.slice(0, index + delimiters[i].right.length); + const math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index); data.push({ type: "math", data: math, - rawData: rawData, + rawData, display: delimiters[i].display }); text = text.slice(index + delimiters[i].right.length); @@ -184,8 +180,8 @@ var splitAtDelimiters = function splitAtDelimiters(text, delimiters) { * API, we should copy it before mutating. */ -var renderMathInText = function renderMathInText(text, optionsCopy) { - var data = auto_render_splitAtDelimiters(text, optionsCopy.delimiters); +const renderMathInText = function (text, optionsCopy) { + const data = auto_render_splitAtDelimiters(text, optionsCopy.delimiters); if (data.length === 1 && data[0].type === 'text') { // There is no formula in the text. @@ -194,14 +190,14 @@ var renderMathInText = function renderMathInText(text, optionsCopy) { return null; } - var fragment = document.createDocumentFragment(); + const fragment = document.createDocumentFragment(); - for (var i = 0; i < data.length; i++) { + for (let i = 0; i < data.length; i++) { if (data[i].type === "text") { fragment.appendChild(document.createTextNode(data[i].data)); } else { - var span = document.createElement("span"); - var math = data[i].data; // Override any display mode defined in the settings with that + const span = document.createElement("span"); + let math = data[i].data; // Override any display mode defined in the settings with that // defined by the text itself optionsCopy.displayMode = data[i].display; @@ -229,18 +225,18 @@ var renderMathInText = function renderMathInText(text, optionsCopy) { return fragment; }; -var renderElem = function renderElem(elem, optionsCopy) { - for (var i = 0; i < elem.childNodes.length; i++) { - var childNode = elem.childNodes[i]; +const renderElem = function (elem, optionsCopy) { + for (let i = 0; i < elem.childNodes.length; i++) { + const childNode = elem.childNodes[i]; if (childNode.nodeType === 3) { // Text node // Concatenate all sibling text nodes. // Webkit browsers split very large text nodes into smaller ones, // so the delimiters may be split across different nodes. - var textContentConcat = childNode.textContent; - var sibling = childNode.nextSibling; - var nSiblings = 0; + let textContentConcat = childNode.textContent; + let sibling = childNode.nextSibling; + let nSiblings = 0; while (sibling && sibling.nodeType === Node.TEXT_NODE) { textContentConcat += sibling.textContent; @@ -248,11 +244,11 @@ var renderElem = function renderElem(elem, optionsCopy) { nSiblings++; } - var frag = renderMathInText(textContentConcat, optionsCopy); + const frag = renderMathInText(textContentConcat, optionsCopy); if (frag) { // Remove extra text nodes - for (var j = 0; j < nSiblings; j++) { + for (let j = 0; j < nSiblings; j++) { childNode.nextSibling.remove(); } @@ -264,30 +260,26 @@ var renderElem = function renderElem(elem, optionsCopy) { i += nSiblings; } } else if (childNode.nodeType === 1) { - (function () { - // Element node - var className = ' ' + childNode.className + ' '; - var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(function (x) { - return className.indexOf(' ' + x + ' ') === -1; - }); + // Element node + const className = ' ' + childNode.className + ' '; + const shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(x => className.indexOf(' ' + x + ' ') === -1); - if (shouldRender) { - renderElem(childNode, optionsCopy); - } - })(); + if (shouldRender) { + renderElem(childNode, optionsCopy); + } } // Otherwise, it's something else, and ignore it. } }; -var renderMathInElement = function renderMathInElement(elem, options) { +const renderMathInElement = function (elem, options) { if (!elem) { throw new Error("No element provided to render"); } - var optionsCopy = {}; // Object.assign(optionsCopy, option) + const optionsCopy = {}; // Object.assign(optionsCopy, option) - for (var option in options) { + for (const option in options) { if (options.hasOwnProperty(option)) { optionsCopy[option] = options[option]; } diff --git a/paige/node_modules/katex/dist/contrib/auto-render.min.js b/paige/node_modules/katex/dist/contrib/auto-render.min.js index 74f07c2f..46d62af2 100644 --- a/paige/node_modules/katex/dist/contrib/auto-render.min.js +++ b/paige/node_modules/katex/dist/contrib/auto-render.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;ae.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;r=e.search(a),-1!==r;){r>0&&(o.push({type:"text",data:e.slice(0,r)}),e=e.slice(r));const a=t.findIndex((t=>e.startsWith(t.left)));if(r=n(t[a].right,e,t[a].left.length),-1===r)break;const l=e.slice(0,r+t[a].right.length),s=i.test(l)?l:e.slice(t[a].left.length,r);o.push({type:"math",data:s,rawData:l,display:t[a].display}),e=e.slice(r+t[a].right.length)}return""!==e&&o.push({type:"text",data:e}),o};const l=function(e,n){const r=a(e,n.delimiters);if(1===r.length&&"text"===r[0].type)return null;const o=document.createDocumentFragment();for(let e=0;e-1===e.indexOf(" "+t+" ")))&&s(r,t)}}};var d=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},s(e,n)}}(),o=o.default}()})); \ No newline at end of file diff --git a/paige/node_modules/katex/dist/contrib/copy-tex.js b/paige/node_modules/katex/dist/contrib/copy-tex.js index 2897f1e9..8cfa7d68 100644 --- a/paige/node_modules/katex/dist/contrib/copy-tex.js +++ b/paige/node_modules/katex/dist/contrib/copy-tex.js @@ -14,7 +14,7 @@ var __webpack_exports__ = {}; ;// CONCATENATED MODULE: ./contrib/copy-tex/katex2tex.js // Set these to how you want inline and display math to be delimited. -var defaultCopyDelimiters = { +const defaultCopyDelimiters = { inline: ['$', '$'], // alternative: ['\(', '\)'] display: ['$$', '$$'] // alternative: ['\[', '\]'] @@ -30,10 +30,10 @@ function katexReplaceWithTex(fragment, copyDelimiters) { // Remove .katex-html blocks that are preceded by .katex-mathml blocks // (which will get replaced below). - var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html'); + const katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html'); - for (var i = 0; i < katexHtml.length; i++) { - var element = katexHtml[i]; + for (let i = 0; i < katexHtml.length; i++) { + const element = katexHtml[i]; if (element.remove) { element.remove(); @@ -44,18 +44,17 @@ function katexReplaceWithTex(fragment, copyDelimiters) { // descendant, with inline delimiters. - var katexMathml = fragment.querySelectorAll('.katex-mathml'); + const katexMathml = fragment.querySelectorAll('.katex-mathml'); - for (var _i = 0; _i < katexMathml.length; _i++) { - var _element = katexMathml[_i]; - - var texSource = _element.querySelector('annotation'); + for (let i = 0; i < katexMathml.length; i++) { + const element = katexMathml[i]; + const texSource = element.querySelector('annotation'); if (texSource) { - if (_element.replaceWith) { - _element.replaceWith(texSource); - } else if (_element.parentNode) { - _element.parentNode.replaceChild(texSource, _element); + if (element.replaceWith) { + element.replaceWith(texSource); + } else if (element.parentNode) { + element.parentNode.replaceChild(texSource, element); } texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1]; @@ -63,11 +62,11 @@ function katexReplaceWithTex(fragment, copyDelimiters) { } // Switch display math to display delimiters. - var displays = fragment.querySelectorAll('.katex-display annotation'); + const displays = fragment.querySelectorAll('.katex-display annotation'); - for (var _i2 = 0; _i2 < displays.length; _i2++) { - var _element2 = displays[_i2]; - _element2.innerHTML = copyDelimiters.display[0] + _element2.innerHTML.substr(copyDelimiters.inline[0].length, _element2.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1]; + for (let i = 0; i < displays.length; i++) { + const element = displays[i]; + element.innerHTML = copyDelimiters.display[0] + element.innerHTML.substr(copyDelimiters.inline[0].length, element.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1]; } return fragment; @@ -79,43 +78,41 @@ function katexReplaceWithTex(fragment, copyDelimiters) { function closestKatex(node) { // If node is a Text Node, for example, go up to containing Element, // where we can apply the `closest` method. - var element = node instanceof Element ? node : node.parentElement; + const element = node instanceof Element ? node : node.parentElement; return element && element.closest('.katex'); } // Global copy handler to modify behavior on/within .katex elements. document.addEventListener('copy', function (event) { - var selection = window.getSelection(); + const selection = window.getSelection(); if (selection.isCollapsed || !event.clipboardData) { return; // default action OK if selection is empty or unchangeable } - var clipboardData = event.clipboardData; - var range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula. + const clipboardData = event.clipboardData; + const range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula. - var startKatex = closestKatex(range.startContainer); + const startKatex = closestKatex(range.startContainer); if (startKatex) { range.setStartBefore(startKatex); } // Similarly, when end point is within a formula, expand to entire formula. - var endKatex = closestKatex(range.endContainer); + const endKatex = closestKatex(range.endContainer); if (endKatex) { range.setEndAfter(endKatex); } - var fragment = range.cloneContents(); + const fragment = range.cloneContents(); if (!fragment.querySelector('.katex-mathml')) { return; // default action OK if no .katex-mathml elements } - var htmlContents = Array.prototype.map.call(fragment.childNodes, function (el) { - return el instanceof Text ? el.textContent : el.outerHTML; - }).join(''); // Preserve usual HTML copy/paste behavior. + const htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join(''); // Preserve usual HTML copy/paste behavior. clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version. diff --git a/paige/node_modules/katex/dist/contrib/copy-tex.min.js b/paige/node_modules/katex/dist/contrib/copy-tex.min.js index 5a1ec34d..a826f4f5 100644 --- a/paige/node_modules/katex/dist/contrib/copy-tex.min.js +++ b/paige/node_modules/katex/dist/contrib/copy-tex.min.js @@ -1 +1 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={},t={inline:["$","$"],display:["$$","$$"]};var n=function(e,n){void 0===n&&(n=t);for(var r=e.querySelectorAll(".katex-mathml + .katex-html"),a=0;ae instanceof Text?e.textContent:e.outerHTML)).join("");r.setData("text/html",c),r.setData("text/plain",n(s).textContent),e.preventDefault()})),e=e.default}()})); \ No newline at end of file diff --git a/paige/node_modules/katex/dist/contrib/mathtex-script-type.js b/paige/node_modules/katex/dist/contrib/mathtex-script-type.js index d82c41d8..48ce856d 100644 --- a/paige/node_modules/katex/dist/contrib/mathtex-script-type.js +++ b/paige/node_modules/katex/dist/contrib/mathtex-script-type.js @@ -82,15 +82,15 @@ var __webpack_exports__ = {}; /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(771); /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__); -var scripts = document.body.getElementsByTagName("script"); +let scripts = document.body.getElementsByTagName("script"); scripts = Array.prototype.slice.call(scripts); scripts.forEach(function (script) { if (!script.type || !script.type.match(/math\/tex/i)) { return -1; } - var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null; - var katexElement = document.createElement(display ? "div" : "span"); + const display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null; + const katexElement = document.createElement(display ? "div" : "span"); katexElement.setAttribute("class", display ? "equation" : "inline-equation"); try { diff --git a/paige/node_modules/katex/dist/contrib/mathtex-script-type.min.js b/paige/node_modules/katex/dist/contrib/mathtex-script-type.min.js index af028303..8ff1413c 100644 --- a/paige/node_modules/katex/dist/contrib/mathtex-script-type.min.js +++ b/paige/node_modules/katex/dist/contrib/mathtex-script-type.min.js @@ -1 +1 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var r="object"==typeof exports?t(require("katex")):t(e.katex);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o,i,a,u={};return o=n(771),i=n.n(o),a=document.body.getElementsByTagName("script"),(a=Array.prototype.slice.call(a)).forEach((function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;var t=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(t?"div":"span");r.setAttribute("class",t?"equation":"inline-equation");try{i().render(e.text,r,{displayMode:t})}catch(t){r.textContent=e.text}e.parentNode.replaceChild(r,e)})),u=u.default}()})); \ No newline at end of file +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var n="object"==typeof exports?t(require("katex")):t(e.katex);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){var e=r(771),t=r.n(e);let n=document.body.getElementsByTagName("script");n=Array.prototype.slice.call(n),n.forEach((function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;const n=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(n?"div":"span");r.setAttribute("class",n?"equation":"inline-equation");try{t().render(e.text,r,{displayMode:n})}catch(t){r.textContent=e.text}e.parentNode.replaceChild(r,e)}))}(),o=o.default}()})); \ No newline at end of file diff --git a/paige/node_modules/katex/dist/contrib/mhchem.js b/paige/node_modules/katex/dist/contrib/mhchem.js index 8b491316..531c1734 100644 --- a/paige/node_modules/katex/dist/contrib/mhchem.js +++ b/paige/node_modules/katex/dist/contrib/mhchem.js @@ -151,7 +151,7 @@ katex__WEBPACK_IMPORTED_MODULE_0___default().__defineMacro("\\tripledash", "{\\v // It takes the argument to \ce or \pu and returns the corresponding TeX string. // -var chemParse = function chemParse(tokens, stateMachine) { +var chemParse = function (tokens, stateMachine) { // Recreate the argument string from KaTeX's array of tokens. var str = ""; var expectedLoc = tokens.length && tokens[tokens.length - 1].loc.start; @@ -183,7 +183,7 @@ var mhchemParser = { // Call like // go("H2O"); // - go: function go(input, stateMachine) { + go: function (input, stateMachine) { if (!input) { return []; } @@ -315,7 +315,7 @@ var mhchemParser = { } } }, - concatArray: function concatArray(a, b) { + concatArray: function (a, b) { if (b) { if (Array.isArray(b)) { for (var iB = 0; iB < b.length; iB++) { @@ -351,7 +351,7 @@ var mhchemParser = { 'digits': /^[0-9]+/, '-9.,9': /^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/, '-9.,9 no missing 0': /^[+\-]?[0-9]+(?:[.,][0-9]+)?/, - '(-)(9.,9)(e)(99)': function e99(input) { + '(-)(9.,9)(e)(99)': function (input) { var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/); if (m && m[0]) { @@ -363,7 +363,7 @@ var mhchemParser = { return null; }, - '(-)(9)^(-9)': function _(input) { + '(-)(9)^(-9)': function (input) { var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/); if (m && m[0]) { @@ -375,7 +375,7 @@ var mhchemParser = { return null; }, - 'state of aggregation $': function stateOfAggregation$(input) { + 'state of aggregation $': function (input) { // ... or crystal system var a = mhchemParser.patterns.findObserveGroups(input, "", /^\([a-z]{1,3}(?=[\),])/, ")", ""); // (aq), (aq,$\infty$), (aq, sat) @@ -404,51 +404,51 @@ var mhchemParser = { '. ': /^([.\u22C5\u00B7\u2022])\s*/, '...': /^\.\.\.(?=$|[^.])/, '* ': /^([*])\s*/, - '^{(...)}': function _(input) { + '^{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^{", "", "", "}"); }, - '^($...$)': function $$(input) { + '^($...$)': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^", "$", "$", ""); }, '^a': /^\^([0-9]+|[^\\_])/, - '^\\x{}{}': function x(input) { + '^\\x{}{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true); }, - '^\\x{}': function x(input) { + '^\\x{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", ""); }, '^\\x': /^\^(\\[a-zA-Z]+)\s*/, '^(-1)': /^\^(-?\d+)/, '\'': /^'/, - '_{(...)}': function _(input) { + '_{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_{", "", "", "}"); }, - '_($...$)': function _$$(input) { + '_($...$)': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_", "$", "$", ""); }, '_9': /^_([+\-]?[0-9]+|[^\\])/, - '_\\x{}{}': function _X(input) { + '_\\x{}{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true); }, - '_\\x{}': function _X(input) { + '_\\x{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", ""); }, '_\\x': /^_(\\[a-zA-Z]+)\s*/, '^_': /^(?:\^(?=_)|\_(?=\^)|[\^_]$)/, '{}': /^\{\}/, - '{...}': function _(input) { + '{...}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", "{", "}", ""); }, - '{(...)}': function _(input) { + '{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "{", "", "", "}"); }, - '$...$': function $$(input) { + '$...$': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", "$", "$", ""); }, - '${(...)}$': function $$(input) { + '${(...)}$': function (input) { return mhchemParser.patterns.findObserveGroups(input, "${", "", "", "}$"); }, - '$(...)$': function $$(input) { + '$(...)$': function (input) { return mhchemParser.patterns.findObserveGroups(input, "$", "", "", "$"); }, '=<>': /^[=<>]/, @@ -462,21 +462,21 @@ var mhchemParser = { 'pm-operator': /^(?:\\pm|\$\\pm\$|\+-|\+\/-)/, 'operator': /^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/, 'arrowUpDown': /^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/, - '\\bond{(...)}': function bond(input) { + '\\bond{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\bond{", "", "", "}"); }, '->': /^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/, 'CMT': /^[CMT](?=\[)/, - '[(...)]': function _(input) { + '[(...)]': function (input) { return mhchemParser.patterns.findObserveGroups(input, "[", "", "", "]"); }, '1st-level escape': /^(&|\\\\|\\hline)\s*/, '\\,': /^(?:\\[,\ ;:])/, // \\x - but output no space before - '\\x{}{}': function x(input) { + '\\x{}{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true); }, - '\\x{}': function x(input) { + '\\x{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", ""); }, '\\ca': /^\\ca(?:\s+|(?![a-zA-Z]))/, @@ -484,28 +484,28 @@ var mhchemParser = { 'orbital': /^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/, // only those with numbers in front, because the others will be formatted correctly anyway 'others': /^[\/~|]/, - '\\frac{(...)}': function frac(input) { + '\\frac{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\frac{", "", "", "}", "{", "", "", "}"); }, - '\\overset{(...)}': function overset(input) { + '\\overset{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\overset{", "", "", "}", "{", "", "", "}"); }, - "\\underset{(...)}": function underset(input) { + '\\underset{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\underset{", "", "", "}", "{", "", "", "}"); }, - "\\underbrace{(...)}": function underbrace(input) { + '\\underbrace{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\underbrace{", "", "", "}_", "{", "", "", "}"); }, - '\\color{(...)}0': function color0(input) { + '\\color{(...)}0': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}"); }, - '\\color{(...)}{(...)}1': function color1(input) { + '\\color{(...)}{(...)}1': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}", "{", "", "", "}"); }, - '\\color(...){(...)}2': function color2(input) { + '\\color(...){(...)}2': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\color", "\\", "", /^(?=\{)/, "{", "", "", "}"); }, - '\\ce{(...)}': function ce(input) { + '\\ce{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\ce{", "", "", "}"); }, 'oxidation$': /^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/, @@ -513,7 +513,7 @@ var mhchemParser = { // 0 could be oxidation or charge 'roman numeral': /^[IVX]+/, '1/2$': /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/, - 'amount': function amount(input) { + 'amount': function (input) { var match; // e.g. 2, 0.5, 1/2, -2, n/2, +; $a$ could be added later in parsing match = input.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/); @@ -541,11 +541,11 @@ var mhchemParser = { return null; }, - 'amount2': function amount2(input) { + 'amount2': function (input) { return this['amount'](input); }, '(KV letters),': /^(?:[A-Z][a-z]{0,2}|i)(?=,)/, - 'formula$': function formula$(input) { + 'formula$': function (input) { if (input.match(/^\([a-z]+\)$/)) { return null; } // state of aggregation = no formula @@ -567,9 +567,9 @@ var mhchemParser = { '//': /^\s*(\/\/)\s*/, '*': /^\s*[*.]\s*/ }, - findObserveGroups: function findObserveGroups(input, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) { + findObserveGroups: function (input, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) { /** @type {{(input: string, pattern: string | RegExp): string | string[] | null;}} */ - var _match = function _match(input, pattern) { + var _match = function (input, pattern) { if (typeof pattern === "string") { if (input.indexOf(pattern) !== 0) { return null; @@ -589,7 +589,7 @@ var mhchemParser = { /** @type {{(input: string, i: number, endChars: string | RegExp): {endMatchBegin: number, endMatchEnd: number} | null;}} */ - var _findObserveGroups = function _findObserveGroups(input, i, endChars) { + var _findObserveGroups = function (input, i, endChars) { var braces = 0; while (i < input.length) { @@ -669,7 +669,7 @@ var mhchemParser = { // e.g. match("a", input) will look for the regexp called "a" and see if it matches // returns null or {match_:"a", remainder:"bc"} // - match_: function match_(m, input) { + match_: function (m, input) { var pattern = mhchemParser.patterns.patterns[m]; if (pattern === undefined) { @@ -705,88 +705,88 @@ var mhchemParser = { // Generic state machine actions // actions: { - 'a=': function a(buffer, m) { + 'a=': function (buffer, m) { buffer.a = (buffer.a || "") + m; }, - 'b=': function b(buffer, m) { + 'b=': function (buffer, m) { buffer.b = (buffer.b || "") + m; }, - 'p=': function p(buffer, m) { + 'p=': function (buffer, m) { buffer.p = (buffer.p || "") + m; }, - 'o=': function o(buffer, m) { + 'o=': function (buffer, m) { buffer.o = (buffer.o || "") + m; }, - 'q=': function q(buffer, m) { + 'q=': function (buffer, m) { buffer.q = (buffer.q || "") + m; }, - 'd=': function d(buffer, m) { + 'd=': function (buffer, m) { buffer.d = (buffer.d || "") + m; }, - 'rm=': function rm(buffer, m) { + 'rm=': function (buffer, m) { buffer.rm = (buffer.rm || "") + m; }, - 'text=': function text(buffer, m) { + 'text=': function (buffer, m) { buffer.text_ = (buffer.text_ || "") + m; }, - 'insert': function insert(buffer, m, a) { + 'insert': function (buffer, m, a) { return { type_: a }; }, - 'insert+p1': function insertP1(buffer, m, a) { + 'insert+p1': function (buffer, m, a) { return { type_: a, p1: m }; }, - 'insert+p1+p2': function insertP1P2(buffer, m, a) { + 'insert+p1+p2': function (buffer, m, a) { return { type_: a, p1: m[0], p2: m[1] }; }, - 'copy': function copy(buffer, m) { + 'copy': function (buffer, m) { return m; }, - 'rm': function rm(buffer, m) { + 'rm': function (buffer, m) { return { type_: 'rm', p1: m || "" }; }, - 'text': function text(buffer, m) { + 'text': function (buffer, m) { return mhchemParser.go(m, 'text'); }, - '{text}': function text(buffer, m) { + '{text}': function (buffer, m) { var ret = ["{"]; mhchemParser.concatArray(ret, mhchemParser.go(m, 'text')); ret.push("}"); return ret; }, - 'tex-math': function texMath(buffer, m) { + 'tex-math': function (buffer, m) { return mhchemParser.go(m, 'tex-math'); }, - 'tex-math tight': function texMathTight(buffer, m) { + 'tex-math tight': function (buffer, m) { return mhchemParser.go(m, 'tex-math tight'); }, - 'bond': function bond(buffer, m, k) { + 'bond': function (buffer, m, k) { return { type_: 'bond', kind_: k || m }; }, - 'color0-output': function color0Output(buffer, m) { + 'color0-output': function (buffer, m) { return { type_: 'color0', color: m[0] }; }, - 'ce': function ce(buffer, m) { + 'ce': function (buffer, m) { return mhchemParser.go(m); }, - '1/2': function _(buffer, m) { + '1/2': function (buffer, m) { /** @type {ParserOutput[]} */ var ret = []; @@ -813,7 +813,7 @@ var mhchemParser = { return ret; }, - '9,9': function _(buffer, m) { + '9,9': function (buffer, m) { return mhchemParser.go(m, '9,9'); } }, @@ -822,7 +822,7 @@ var mhchemParser = { // convert { 'letter': { 'state': { action_: 'output' } } } to { 'state' => [ { pattern: 'letter', task: { action_: [{type_: 'output'}] } } ] } // with expansion of 'a|b' to 'a' and 'b' (at 2 places) // - createTransitions: function createTransitions(o) { + createTransitions: function (o) { var pattern, state; /** @type {string[]} */ @@ -1458,7 +1458,7 @@ mhchemParser.stateMachines = { nextState: '3' } }, - "\\underset{(...)}": { + '\\underset{(...)}': { '*': { action_: [{ type_: 'output', @@ -1467,7 +1467,7 @@ mhchemParser.stateMachines = { nextState: '3' } }, - "\\underbrace{(...)}": { + '\\underbrace{(...)}': { '*': { action_: [{ type_: 'output', @@ -1553,7 +1553,7 @@ mhchemParser.stateMachines = { } }), actions: { - 'o after d': function oAfterD(buffer, m) { + 'o after d': function (buffer, m) { var ret; if ((buffer.d || "").match(/^[0-9]+$/)) { @@ -1568,11 +1568,11 @@ mhchemParser.stateMachines = { mhchemParser.actions['o='](buffer, m); return ret; }, - 'd= kv': function dKv(buffer, m) { + 'd= kv': function (buffer, m) { buffer.d = m; buffer.dType = 'kv'; }, - 'charge or bond': function chargeOrBond(buffer, m) { + 'charge or bond': function (buffer, m) { if (buffer['beginsWithBond']) { /** @type {ParserOutput[]} */ var ret = []; @@ -1583,7 +1583,7 @@ mhchemParser.stateMachines = { buffer.d = m; } }, - '- after o/d': function afterOD(buffer, m, isAfterD) { + '- after o/d': function (buffer, m, isAfterD) { var c1 = mhchemParser.patterns.match_('orbital', buffer.o || ""); var c2 = mhchemParser.patterns.match_('one lowercase greek letter $', buffer.o || ""); var c3 = mhchemParser.patterns.match_('one lowercase latin letter $', buffer.o || ""); @@ -1617,35 +1617,35 @@ mhchemParser.stateMachines = { return ret; }, - 'a to o': function aToO(buffer) { + 'a to o': function (buffer) { buffer.o = buffer.a; buffer.a = undefined; }, - 'sb=true': function sbTrue(buffer) { + 'sb=true': function (buffer) { buffer.sb = true; }, - 'sb=false': function sbFalse(buffer) { + 'sb=false': function (buffer) { buffer.sb = false; }, - 'beginsWithBond=true': function beginsWithBondTrue(buffer) { + 'beginsWithBond=true': function (buffer) { buffer['beginsWithBond'] = true; }, - 'beginsWithBond=false': function beginsWithBondFalse(buffer) { + 'beginsWithBond=false': function (buffer) { buffer['beginsWithBond'] = false; }, - 'parenthesisLevel++': function parenthesisLevel(buffer) { + 'parenthesisLevel++': function (buffer) { buffer['parenthesisLevel']++; }, - 'parenthesisLevel--': function parenthesisLevel(buffer) { + 'parenthesisLevel--': function (buffer) { buffer['parenthesisLevel']--; }, - 'state of aggregation': function stateOfAggregation(buffer, m) { + 'state of aggregation': function (buffer, m) { return { type_: 'state of aggregation', p1: mhchemParser.go(m, 'o') }; }, - 'comma': function comma(buffer, m) { + 'comma': function (buffer, m) { var a = m.replace(/\s*$/, ''); var withSpace = a !== m; @@ -1661,7 +1661,7 @@ mhchemParser.stateMachines = { }; } }, - 'output': function output(buffer, m, entityFollows) { + 'output': function (buffer, m, entityFollows) { // entityFollows: // undefined = if we have nothing else to output, also ignore the just read space (buffer.sb) // 1 = an entity follows, never omit the space if there was one just read before (can only apply to state 1) @@ -1756,63 +1756,63 @@ mhchemParser.stateMachines = { return ret; }, - 'oxidation-output': function oxidationOutput(buffer, m) { + 'oxidation-output': function (buffer, m) { var ret = ["{"]; mhchemParser.concatArray(ret, mhchemParser.go(m, 'oxidation')); ret.push("}"); return ret; }, - 'frac-output': function fracOutput(buffer, m) { + 'frac-output': function (buffer, m) { return { type_: 'frac-ce', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) }; }, - 'overset-output': function oversetOutput(buffer, m) { + 'overset-output': function (buffer, m) { return { type_: 'overset', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) }; }, - 'underset-output': function undersetOutput(buffer, m) { + 'underset-output': function (buffer, m) { return { type_: 'underset', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) }; }, - 'underbrace-output': function underbraceOutput(buffer, m) { + 'underbrace-output': function (buffer, m) { return { type_: 'underbrace', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) }; }, - 'color-output': function colorOutput(buffer, m) { + 'color-output': function (buffer, m) { return { type_: 'color', color1: m[0], color2: mhchemParser.go(m[1]) }; }, - 'r=': function r(buffer, m) { + 'r=': function (buffer, m) { buffer.r = m; }, - 'rdt=': function rdt(buffer, m) { + 'rdt=': function (buffer, m) { buffer.rdt = m; }, - 'rd=': function rd(buffer, m) { + 'rd=': function (buffer, m) { buffer.rd = m; }, - 'rqt=': function rqt(buffer, m) { + 'rqt=': function (buffer, m) { buffer.rqt = m; }, - 'rq=': function rq(buffer, m) { + 'rq=': function (buffer, m) { buffer.rq = m; }, - 'operator': function operator(buffer, m, p1) { + 'operator': function (buffer, m, p1) { return { type_: 'operator', kind_: p1 || m @@ -1944,7 +1944,7 @@ mhchemParser.stateMachines = { } }), actions: { - 'output': function output(buffer) { + 'output': function (buffer) { if (buffer.text_) { /** @type {ParserOutput} */ var ret = { @@ -2060,13 +2060,13 @@ mhchemParser.stateMachines = { } }), actions: { - 'state of aggregation': function stateOfAggregation(buffer, m) { + 'state of aggregation': function (buffer, m) { return { type_: 'state of aggregation subscript', p1: mhchemParser.go(m, 'o') }; }, - 'color-output': function colorOutput(buffer, m) { + 'color-output': function (buffer, m) { return { type_: 'color', color1: m[0], @@ -2174,7 +2174,7 @@ mhchemParser.stateMachines = { } }), actions: { - 'color-output': function colorOutput(buffer, m) { + 'color-output': function (buffer, m) { return { type_: 'color', color1: m[0], @@ -2205,7 +2205,7 @@ mhchemParser.stateMachines = { } }), actions: { - 'roman-numeral': function romanNumeral(buffer, m) { + 'roman-numeral': function (buffer, m) { return { type_: 'roman numeral', p1: m || "" @@ -2237,7 +2237,7 @@ mhchemParser.stateMachines = { } }), actions: { - 'output': function output(buffer) { + 'output': function (buffer) { if (buffer.o) { /** @type {ParserOutput} */ var ret = { @@ -2283,10 +2283,10 @@ mhchemParser.stateMachines = { } }), actions: { - 'tight operator': function tightOperator(buffer, m) { + 'tight operator': function (buffer, m) { buffer.o = (buffer.o || "") + "{" + m + "}"; }, - 'output': function output(buffer) { + 'output': function (buffer) { if (buffer.o) { /** @type {ParserOutput} */ var ret = { @@ -2320,7 +2320,7 @@ mhchemParser.stateMachines = { } }), actions: { - 'comma': function comma() { + 'comma': function () { return { type_: 'commaDecimal' }; @@ -2407,7 +2407,7 @@ mhchemParser.stateMachines = { } }), actions: { - 'enumber': function enumber(buffer, m) { + 'enumber': function (buffer, m) { /** @type {ParserOutput[]} */ var ret = []; @@ -2451,7 +2451,7 @@ mhchemParser.stateMachines = { return ret; }, - 'number^': function number(buffer, m) { + 'number^': function (buffer, m) { /** @type {ParserOutput[]} */ var ret = []; @@ -2465,18 +2465,18 @@ mhchemParser.stateMachines = { ret.push("^{" + m[2] + "}"); return ret; }, - 'operator': function operator(buffer, m, p1) { + 'operator': function (buffer, m, p1) { return { type_: 'operator', kind_: p1 || m }; }, - 'space': function space() { + 'space': function () { return { type_: 'pu-space-1' }; }, - 'output': function output(buffer) { + 'output': function (buffer) { /** @type {ParserOutput | ParserOutput[]} */ var ret; var md = mhchemParser.patterns.match_('{(...)}', buffer.d || ""); @@ -2586,20 +2586,20 @@ mhchemParser.stateMachines = { } }), actions: { - 'cdot': function cdot() { + 'cdot': function () { return { type_: 'tight cdot' }; }, - '^(-1)': function _(buffer, m) { + '^(-1)': function (buffer, m) { buffer.rm += "^{" + m + "}"; }, - 'space': function space() { + 'space': function () { return { type_: 'pu-space-2' }; }, - 'output': function output(buffer) { + 'output': function (buffer) { /** @type {ParserOutput | ParserOutput[]} */ var ret = []; @@ -2653,12 +2653,12 @@ mhchemParser.stateMachines = { } }), actions: { - 'comma': function comma() { + 'comma': function () { return { type_: 'commaDecimal' }; }, - 'output-0': function output0(buffer) { + 'output-0': function (buffer) { /** @type {ParserOutput[]} */ var ret = []; buffer.text_ = buffer.text_ || ""; @@ -2689,7 +2689,7 @@ mhchemParser.stateMachines = { return ret; }, - 'output-o': function outputO(buffer) { + 'output-o': function (buffer) { /** @type {ParserOutput[]} */ var ret = []; buffer.text_ = buffer.text_ || ""; @@ -2725,7 +2725,7 @@ mhchemParser.stateMachines = { /** @type {Texify} */ var texify = { - go: function go(input, isInner) { + go: function (input, isInner) { // (recursive, max 4 levels) if (!input) { return ""; @@ -2754,14 +2754,14 @@ var texify = { return res; }, - _goInner: function _goInner(input) { + _goInner: function (input) { if (!input) { return input; } return texify.go(input, true); }, - _go2: function _go2(buf) { + _go2: function (buf) { /** @type {undefined | string} */ var res; @@ -3052,7 +3052,7 @@ var texify = { assertString(res); return res; }, - _getArrow: function _getArrow(a) { + _getArrow: function (a) { switch (a) { case "->": return "rightarrow"; @@ -3089,7 +3089,7 @@ var texify = { throw ["MhchemBugT", "mhchem bug T. Please report."]; } }, - _getBond: function _getBond(a) { + _getBond: function (a) { switch (a) { case "-": return "{-}"; @@ -3147,7 +3147,7 @@ var texify = { throw ["MhchemBugT", "mhchem bug T. Please report."]; } }, - _getOperator: function _getOperator(a) { + _getOperator: function (a) { switch (a) { case "+": return " {}+{} "; diff --git a/paige/node_modules/katex/dist/contrib/render-a11y-string.js b/paige/node_modules/katex/dist/contrib/render-a11y-string.js index 7db8452f..8f7d669f 100644 --- a/paige/node_modules/katex/dist/contrib/render-a11y-string.js +++ b/paige/node_modules/katex/dist/contrib/render-a11y-string.js @@ -100,7 +100,7 @@ var __webpack_exports__ = {}; // included in the build. // $FlowIgnore: we import the types directly anyways -var stringMap = { +const stringMap = { "(": "left parenthesis", ")": "right parenthesis", "[": "open bracket", @@ -173,22 +173,22 @@ var stringMap = { "\\hat": "hat", "\\acute": "acute" }; -var powerMap = { +const powerMap = { "prime": "prime", "degree": "degrees", "circle": "degrees", "2": "squared", "3": "cubed" }; -var openMap = { +const openMap = { "|": "open vertical bar", ".": "" }; -var closeMap = { +const closeMap = { "|": "close vertical bar", ".": "" }; -var binMap = { +const binMap = { "+": "plus", "-": "minus", "\\pm": "plus minus", @@ -200,7 +200,7 @@ var binMap = { "\\circ": "circle", "\\bullet": "bullet" }; -var relMap = { +const relMap = { "=": "equals", "\\approx": "approximately equals", "≠": "does not equal", @@ -216,7 +216,7 @@ var relMap = { "\\Rightarrow": "right arrow", ":": "colon" }; -var accentUnderMap = { +const accentUnderMap = { "\\underleftarrow": "left arrow", "\\underrightarrow": "right arrow", "\\underleftrightarrow": "left-right arrow", @@ -225,12 +225,12 @@ var accentUnderMap = { "\\utilde": "tilde" }; -var buildString = function buildString(str, type, a11yStrings) { +const buildString = (str, type, a11yStrings) => { if (!str) { return; } - var ret; + let ret; if (type === "open") { ret = str in openMap ? openMap[str] : stringMap[str] || str; @@ -258,18 +258,18 @@ var buildString = function buildString(str, type, a11yStrings) { } }; -var buildRegion = function buildRegion(a11yStrings, callback) { - var regionStrings = []; +const buildRegion = (a11yStrings, callback) => { + const regionStrings = []; a11yStrings.push(regionStrings); callback(regionStrings); }; -var handleObject = function handleObject(tree, a11yStrings, atomType) { +const handleObject = (tree, a11yStrings, atomType) => { // Everything else is assumed to be an object... switch (tree.type) { case "accent": { - buildRegion(a11yStrings, function (a11yStrings) { + buildRegion(a11yStrings, a11yStrings => { buildA11yStrings(tree.base, a11yStrings, atomType); a11yStrings.push("with"); buildString(tree.label, "normal", a11yStrings); @@ -280,7 +280,7 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { case "accentUnder": { - buildRegion(a11yStrings, function (a11yStrings) { + buildRegion(a11yStrings, a11yStrings => { buildA11yStrings(tree.base, a11yStrings, atomType); a11yStrings.push("with"); buildString(accentUnderMap[tree.label], "normal", a11yStrings); @@ -297,7 +297,9 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { case "atom": { - var text = tree.text; + const { + text + } = tree; switch (tree.family) { case "bin": @@ -349,8 +351,8 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { case "color": { - var color = tree.color.replace(/katex-/, ""); - buildRegion(a11yStrings, function (regionStrings) { + const color = tree.color.replace(/katex-/, ""); + buildRegion(a11yStrings, regionStrings => { regionStrings.push("start color " + color); buildA11yStrings(tree.body, regionStrings, atomType); regionStrings.push("end color " + color); @@ -376,10 +378,12 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { case "genfrac": { - buildRegion(a11yStrings, function (regionStrings) { + buildRegion(a11yStrings, regionStrings => { // genfrac can have unbalanced delimiters - var leftDelim = tree.leftDelim, - rightDelim = tree.rightDelim; // NOTE: Not sure if this is a safe assumption + const { + leftDelim, + rightDelim + } = tree; // NOTE: Not sure if this is a safe assumption // hasBarLine true -> fraction, false -> binomial if (tree.hasBarLine) { @@ -418,7 +422,7 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { case "leftright": { - buildRegion(a11yStrings, function (regionStrings) { + buildRegion(a11yStrings, regionStrings => { buildString(tree.left, "open", regionStrings); buildA11yStrings(tree.body, regionStrings, atomType); buildString(tree.right, "close", regionStrings); @@ -446,8 +450,10 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { case "op": { - var body = tree.body, - name = tree.name; + const { + body, + name + } = tree; if (body) { buildA11yStrings(body, a11yStrings, atomType); @@ -526,12 +532,14 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { case "sqrt": { - buildRegion(a11yStrings, function (regionStrings) { - var body = tree.body, - index = tree.index; + buildRegion(a11yStrings, regionStrings => { + const { + body, + index + } = tree; if (index) { - var indexString = flatten(buildA11yStrings(index, [], atomType)).join(","); + const indexString = flatten(buildA11yStrings(index, [], atomType)).join(","); if (indexString === "3") { regionStrings.push("cube root of"); @@ -556,10 +564,12 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { case "supsub": { - var base = tree.base, - sub = tree.sub, - sup = tree.sup; - var isLog = false; + const { + base, + sub, + sup + } = tree; + let isLog = false; if (base) { buildA11yStrings(base, a11yStrings, atomType); @@ -567,7 +577,7 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { } if (sub) { - var regionName = isLog ? "base" : "subscript"; + const regionName = isLog ? "base" : "subscript"; buildRegion(a11yStrings, function (regionStrings) { regionStrings.push("start " + regionName); buildA11yStrings(sub, regionStrings, atomType); @@ -577,7 +587,7 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { if (sup) { buildRegion(a11yStrings, function (regionStrings) { - var supString = flatten(buildA11yStrings(sup, [], atomType)).join(","); + const supString = flatten(buildA11yStrings(sup, [], atomType)).join(","); if (supString in powerMap) { regionStrings.push(powerMap[supString]); @@ -792,10 +802,9 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { { // \neq and \ne are macros so we let "htmlmathml" render the mathmal // side of things and extract the text from that. - var _atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass + const atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass - - buildA11yStrings(tree.body, a11yStrings, _atomType); + buildA11yStrings(tree.body, a11yStrings, atomType); break; } @@ -837,13 +846,13 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) { } }; -var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) { +const buildA11yStrings = function (tree, a11yStrings, atomType) { if (a11yStrings === void 0) { a11yStrings = []; } if (tree instanceof Array) { - for (var i = 0; i < tree.length; i++) { + for (let i = 0; i < tree.length; i++) { buildA11yStrings(tree[i], a11yStrings, atomType); } } else { @@ -853,8 +862,8 @@ var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) { return a11yStrings; }; -var flatten = function flatten(array) { - var result = []; +const flatten = function (array) { + let result = []; array.forEach(function (item) { if (item instanceof Array) { result = result.concat(flatten(item)); @@ -865,10 +874,10 @@ var flatten = function flatten(array) { return result; }; -var renderA11yString = function renderA11yString(text, settings) { - var tree = katex__WEBPACK_IMPORTED_MODULE_0___default().__parse(text, settings); +const renderA11yString = function (text, settings) { + const tree = katex__WEBPACK_IMPORTED_MODULE_0___default().__parse(text, settings); - var a11yStrings = buildA11yStrings(tree, [], "normal"); + const a11yStrings = buildA11yStrings(tree, [], "normal"); return flatten(a11yStrings).join(", "); }; diff --git a/paige/node_modules/katex/dist/contrib/render-a11y-string.min.js b/paige/node_modules/katex/dist/contrib/render-a11y-string.min.js index 3539b88b..8bd1cd28 100644 --- a/paige/node_modules/katex/dist/contrib/render-a11y-string.min.js +++ b/paige/node_modules/katex/dist/contrib/render-a11y-string.min.js @@ -1 +1 @@ -!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],r);else{var a="object"==typeof exports?r(require("katex")):r(e.katex);for(var t in a)("object"==typeof exports?exports:e)[t]=a[t]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var r={771:function(r){r.exports=e}},a={};function t(e){var o=a[e];if(void 0!==o)return o.exports;var n=a[e]={exports:{}};return r[e](n,n.exports,t),n.exports}t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,{a:r}),r},t.d=function(e,r){for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var o,n,s,i,l,c,u,p,d,h,b,m,f,w,g={};return o=t(771),n=t.n(o),s={"(":"left parenthesis",")":"right parenthesis","[":"open bracket","]":"close bracket","\\{":"left brace","\\}":"right brace","\\lvert":"open vertical bar","\\rvert":"close vertical bar","|":"vertical bar","\\uparrow":"up arrow","\\Uparrow":"up arrow","\\downarrow":"down arrow","\\Downarrow":"down arrow","\\updownarrow":"up down arrow","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow","\\langle":"open angle","\\rangle":"close angle","\\lfloor":"open floor","\\rfloor":"close floor","\\int":"integral","\\intop":"integral","\\lim":"limit","\\ln":"natural log","\\log":"log","\\sin":"sine","\\cos":"cosine","\\tan":"tangent","\\cot":"cotangent","\\sum":"sum","/":"slash",",":"comma",".":"point","-":"negative","+":"plus","~":"tilde",":":"colon","?":"question mark","'":"apostrophe","\\%":"percent"," ":"space","\\ ":"space","\\$":"dollar sign","\\angle":"angle","\\degree":"degree","\\circ":"circle","\\vec":"vector","\\triangle":"triangle","\\pi":"pi","\\prime":"prime","\\infty":"infinity","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\omega":"omega","\\theta":"theta","\\sigma":"sigma","\\lambda":"lambda","\\tau":"tau","\\Delta":"delta","\\delta":"delta","\\mu":"mu","\\rho":"rho","\\nabla":"del","\\ell":"ell","\\ldots":"dots","\\hat":"hat","\\acute":"acute"},i={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},l={"|":"open vertical bar",".":""},c={"|":"close vertical bar",".":""},u={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},p={"=":"equals","\\approx":"approximately equals","\u2260":"does not equal","\\geq":"is greater than or equal to","\\ge":"is greater than or equal to","\\leq":"is less than or equal to","\\le":"is less than or equal to",">":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},d={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},h=function(e,r,a){var t;e&&(/^\d+$/.test(t="open"===r?e in l?l[e]:s[e]||e:"close"===r?e in c?c[e]:s[e]||e:"bin"===r?u[e]||e:"rel"===r?p[e]||e:s[e]||e)&&a.length>0&&/^\d+$/.test(a[a.length-1])?a[a.length-1]+=t:t&&a.push(t))},b=function(e,r){var a=[];e.push(a),r(a)},m=function(e,r,a){switch(e.type){case"accent":b(r,(function(r){f(e.base,r,a),r.push("with"),h(e.label,"normal",r),r.push("on top")}));break;case"accentUnder":b(r,(function(r){f(e.base,r,a),r.push("with"),h(d[e.label],"normal",r),r.push("underneath")}));break;case"accent-token":case"color-token":case"kern":case"leftright-right":case"size":case"infix":case"internal":break;case"atom":var t=e.text;switch(e.family){case"bin":h(t,"bin",r);break;case"close":h(t,"close",r);break;case"inner":h(e.text,"inner",r);break;case"open":h(t,"open",r);break;case"punct":h(t,"punct",r);break;case"rel":h(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break;case"color":var o=e.color.replace(/katex-/,"");b(r,(function(r){r.push("start color "+o),f(e.body,r,a),r.push("end color "+o)}));break;case"delimsizing":e.delim&&"."!==e.delim&&h(e.delim,"normal",r);break;case"genfrac":b(r,(function(r){var t=e.leftDelim,o=e.rightDelim;e.hasBarLine?(r.push("start fraction"),t&&h(t,"open",r),f(e.numer,r,a),r.push("divided by"),f(e.denom,r,a),o&&h(o,"close",r),r.push("end fraction")):(r.push("start binomial"),t&&h(t,"open",r),f(e.numer,r,a),r.push("over"),f(e.denom,r,a),o&&h(o,"close",r),r.push("end binomial"))}));break;case"hbox":case"lap":case"ordgroup":case"raisebox":case"sizing":case"styling":case"smash":case"vcenter":case"operatorname":case"font":case"html":f(e.body,r,a);break;case"leftright":b(r,(function(r){h(e.left,"open",r),f(e.body,r,a),h(e.right,"close",r)}));break;case"mathord":h(e.text,"normal",r);break;case"op":var n=e.body,s=e.name;n?f(n,r,a):s&&h(s,"normal",r);break;case"op-token":case"textord":h(e.text,a,r);break;case"overline":b(r,(function(r){r.push("start overline"),f(e.body,r,a),r.push("end overline")}));break;case"pmb":r.push("bold");break;case"phantom":r.push("empty space");break;case"rule":r.push("rectangle");break;case"spacing":r.push("space");break;case"sqrt":b(r,(function(r){var t=e.body,o=e.index;if(o)return"3"===w(f(o,[],a)).join(",")?(r.push("cube root of"),f(t,r,a),void r.push("end cube root")):(r.push("root"),r.push("start index"),f(o,r,a),void r.push("end index"));r.push("square root of"),f(t,r,a),r.push("end square root")}));break;case"supsub":var l=e.base,c=e.sub,u=e.sup,p=!1;if(l&&(f(l,r,a),p="op"===l.type&&"\\log"===l.name),c){var m=p?"base":"subscript";b(r,(function(e){e.push("start "+m),f(c,e,a),e.push("end "+m)}))}u&&b(r,(function(e){var r=w(f(u,[],a)).join(",");r in i?e.push(i[r]):(e.push("start superscript"),f(u,e,a),e.push("end superscript"))}));break;case"text":if("\\textbf"===e.font){b(r,(function(r){r.push("start bold text"),f(e.body,r,a),r.push("end bold text")}));break}b(r,(function(r){r.push("start text"),f(e.body,r,a),r.push("end text")}));break;case"enclose":if(/cancel/.test(e.label)){b(r,(function(r){r.push("start cancel"),f(e.body,r,a),r.push("end cancel")}));break}if(/box/.test(e.label)){b(r,(function(r){r.push("start box"),f(e.body,r,a),r.push("end box")}));break}if(/sout/.test(e.label)){b(r,(function(r){r.push("start strikeout"),f(e.body,r,a),r.push("end strikeout")}));break}if(/phase/.test(e.label)){b(r,(function(r){r.push("start phase angle"),f(e.body,r,a),r.push("end phase angle")}));break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"hphantom":throw new Error("KaTeX-a11y: hphantom not implemented yet");case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":h("start verbatim","normal",r),h(e.body,"normal",r),h("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":h("start "+e.label.slice(1),"normal",r),f(e.base,r,a),h("end "+e.label.slice(1),"normal",r);break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":b(r,(function(r){r.push("start underline"),f(e.body,r,a),r.push("end underline")}));break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"cdlabel":throw new Error("KaTeX-a11y: cdlabel not implemented yet");case"cdlabelparent":throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");case"mclass":var g=e.mclass.slice(1);f(e.body,r,g);break;case"mathchoice":f(e.text,r,a);break;case"htmlmathml":f(e.mathml,r,a);break;case"middle":h(e.delim,a,r);break;default:throw e.type,new Error("KaTeX a11y un-recognized type: "+e.type)}},f=function e(r,a,t){if(void 0===a&&(a=[]),r instanceof Array)for(var o=0;o":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},u={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},p=(e,r,a)=>{if(!e)return;let o;o="open"===r?e in s?s[e]:t[e]||e:"close"===r?e in l?l[e]:t[e]||e:"bin"===r?i[e]||e:"rel"===r?c[e]||e:t[e]||e,/^\d+$/.test(o)&&a.length>0&&/^\d+$/.test(a[a.length-1])?a[a.length-1]+=o:o&&a.push(o)},d=(e,r)=>{const t=[];e.push(t),r(t)},h=function(e,r,t){if(void 0===r&&(r=[]),e instanceof Array)for(let a=0;a{switch(e.type){case"accent":d(r,(r=>{h(e.base,r,t),r.push("with"),p(e.label,"normal",r),r.push("on top")}));break;case"accentUnder":d(r,(r=>{h(e.base,r,t),r.push("with"),p(u[e.label],"normal",r),r.push("underneath")}));break;case"accent-token":case"color-token":case"kern":case"leftright-right":case"size":case"infix":case"internal":break;case"atom":{const{text:t}=e;switch(e.family){case"bin":p(t,"bin",r);break;case"close":p(t,"close",r);break;case"inner":p(e.text,"inner",r);break;case"open":p(t,"open",r);break;case"punct":p(t,"punct",r);break;case"rel":p(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break}case"color":{const a=e.color.replace(/katex-/,"");d(r,(r=>{r.push("start color "+a),h(e.body,r,t),r.push("end color "+a)}));break}case"delimsizing":e.delim&&"."!==e.delim&&p(e.delim,"normal",r);break;case"genfrac":d(r,(r=>{const{leftDelim:a,rightDelim:o}=e;e.hasBarLine?(r.push("start fraction"),a&&p(a,"open",r),h(e.numer,r,t),r.push("divided by"),h(e.denom,r,t),o&&p(o,"close",r),r.push("end fraction")):(r.push("start binomial"),a&&p(a,"open",r),h(e.numer,r,t),r.push("over"),h(e.denom,r,t),o&&p(o,"close",r),r.push("end binomial"))}));break;case"hbox":case"lap":case"ordgroup":case"raisebox":case"sizing":case"styling":case"smash":case"vcenter":case"operatorname":case"font":case"html":h(e.body,r,t);break;case"leftright":d(r,(r=>{p(e.left,"open",r),h(e.body,r,t),p(e.right,"close",r)}));break;case"mathord":p(e.text,"normal",r);break;case"op":{const{body:a,name:o}=e;a?h(a,r,t):o&&p(o,"normal",r);break}case"op-token":case"textord":p(e.text,t,r);break;case"overline":d(r,(function(r){r.push("start overline"),h(e.body,r,t),r.push("end overline")}));break;case"pmb":r.push("bold");break;case"phantom":r.push("empty space");break;case"rule":r.push("rectangle");break;case"spacing":r.push("space");break;case"sqrt":d(r,(r=>{const{body:a,index:o}=e;if(o)return"3"===b(h(o,[],t)).join(",")?(r.push("cube root of"),h(a,r,t),void r.push("end cube root")):(r.push("root"),r.push("start index"),h(o,r,t),void r.push("end index"));r.push("square root of"),h(a,r,t),r.push("end square root")}));break;case"supsub":{const{base:a,sub:o,sup:s}=e;let l=!1;if(a&&(h(a,r,t),l="op"===a.type&&"\\log"===a.name),o){const e=l?"base":"subscript";d(r,(function(r){r.push("start "+e),h(o,r,t),r.push("end "+e)}))}s&&d(r,(function(e){const r=b(h(s,[],t)).join(",");r in n?e.push(n[r]):(e.push("start superscript"),h(s,e,t),e.push("end superscript"))}));break}case"text":if("\\textbf"===e.font){d(r,(function(r){r.push("start bold text"),h(e.body,r,t),r.push("end bold text")}));break}d(r,(function(r){r.push("start text"),h(e.body,r,t),r.push("end text")}));break;case"enclose":if(/cancel/.test(e.label)){d(r,(function(r){r.push("start cancel"),h(e.body,r,t),r.push("end cancel")}));break}if(/box/.test(e.label)){d(r,(function(r){r.push("start box"),h(e.body,r,t),r.push("end box")}));break}if(/sout/.test(e.label)){d(r,(function(r){r.push("start strikeout"),h(e.body,r,t),r.push("end strikeout")}));break}if(/phase/.test(e.label)){d(r,(function(r){r.push("start phase angle"),h(e.body,r,t),r.push("end phase angle")}));break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"hphantom":throw new Error("KaTeX-a11y: hphantom not implemented yet");case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":p("start verbatim","normal",r),p(e.body,"normal",r),p("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":p("start "+e.label.slice(1),"normal",r),h(e.base,r,t),p("end "+e.label.slice(1),"normal",r);break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":d(r,(function(r){r.push("start underline"),h(e.body,r,t),r.push("end underline")}));break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"cdlabel":throw new Error("KaTeX-a11y: cdlabel not implemented yet");case"cdlabelparent":throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");case"mclass":{const t=e.mclass.slice(1);h(e.body,r,t);break}case"mathchoice":h(e.text,r,t);break;case"htmlmathml":h(e.mathml,r,t);break;case"middle":p(e.delim,t,r);break;default:throw e.type,new Error("KaTeX a11y un-recognized type: "+e.type)}})(e,r,t);return r},b=function(e){let r=[];return e.forEach((function(e){e instanceof Array?r=r.concat(b(e)):r.push(e)})),r};o.default=function(e,t){const a=r().__parse(e,t),o=h(a,[],"normal");return b(o).join(", ")}}(),o=o.default}()})); \ No newline at end of file diff --git a/paige/node_modules/katex/dist/katex.css b/paige/node_modules/katex/dist/katex.css index 375c79a1..4b1bb686 100644 --- a/paige/node_modules/katex/dist/katex.css +++ b/paige/node_modules/katex/dist/katex.css @@ -132,7 +132,7 @@ border-color: currentColor; } .katex .katex-version::after { - content: "0.16.8"; + content: "0.16.10"; } .katex .katex-mathml { /* Accessibility hack to only show to screen readers @@ -211,6 +211,11 @@ .katex .textfrak { font-family: KaTeX_Fraktur; } +.katex .mathboldfrak, +.katex .textboldfrak { + font-family: KaTeX_Fraktur; + font-weight: bold; +} .katex .mathtt { font-family: KaTeX_Typewriter; } diff --git a/paige/node_modules/katex/dist/katex.js b/paige/node_modules/katex/dist/katex.js index 8abf72d2..50760c4c 100644 --- a/paige/node_modules/katex/dist/katex.js +++ b/paige/node_modules/katex/dist/katex.js @@ -50,73 +50,76 @@ __webpack_require__.d(__webpack_exports__, { * If possible, a caller should provide a Token or ParseNode with information * about where in the source string the problem occurred. */ -var ParseError = // Error start position based on passed-in Token or ParseNode. -// Length of affected text based on passed-in Token or ParseNode. -// The underlying error message without any context added. -function ParseError(message, // The error message -token // An object providing position information -) { - this.name = void 0; - this.position = void 0; - this.length = void 0; - this.rawMessage = void 0; - var error = "KaTeX parse error: " + message; - var start; - var end; - var loc = token && token.loc; +class ParseError { + // Error start position based on passed-in Token or ParseNode. + // Length of affected text based on passed-in Token or ParseNode. + // The underlying error message without any context added. + constructor(message, // The error message + token // An object providing position information + ) { + this.name = void 0; + this.position = void 0; + this.length = void 0; + this.rawMessage = void 0; + let error = "KaTeX parse error: " + message; + let start; + let end; + const loc = token && token.loc; - if (loc && loc.start <= loc.end) { - // If we have the input and a position, make the error a bit fancier - // Get the input - var input = loc.lexer.input; // Prepend some information + if (loc && loc.start <= loc.end) { + // If we have the input and a position, make the error a bit fancier + // Get the input + const input = loc.lexer.input; // Prepend some information - start = loc.start; - end = loc.end; + start = loc.start; + end = loc.end; - if (start === input.length) { - error += " at end of input: "; - } else { - error += " at position " + (start + 1) + ": "; - } // Underline token in question using combining underscores + if (start === input.length) { + error += " at end of input: "; + } else { + error += " at position " + (start + 1) + ": "; + } // Underline token in question using combining underscores - var underlined = input.slice(start, end).replace(/[^]/g, "$&\u0332"); // Extract some context from the input and add it to the error + const underlined = input.slice(start, end).replace(/[^]/g, "$&\u0332"); // Extract some context from the input and add it to the error - var left; + let left; - if (start > 15) { - left = "…" + input.slice(start - 15, start); - } else { - left = input.slice(0, start); + if (start > 15) { + left = "…" + input.slice(start - 15, start); + } else { + left = input.slice(0, start); + } + + let right; + + if (end + 15 < input.length) { + right = input.slice(end, end + 15) + "…"; + } else { + right = input.slice(end); + } + + error += left + underlined + right; + } // Some hackery to make ParseError a prototype of Error + // See http://stackoverflow.com/a/8460753 + // $FlowFixMe + + + const self = new Error(error); + self.name = "ParseError"; // $FlowFixMe + + self.__proto__ = ParseError.prototype; + self.position = start; + + if (start != null && end != null) { + self.length = end - start; } - var right; - - if (end + 15 < input.length) { - right = input.slice(end, end + 15) + "…"; - } else { - right = input.slice(end); - } - - error += left + underlined + right; - } // Some hackery to make ParseError a prototype of Error - // See http://stackoverflow.com/a/8460753 - // $FlowFixMe - - - var self = new Error(error); - self.name = "ParseError"; // $FlowFixMe - - self.__proto__ = ParseError.prototype; - self.position = start; - - if (start != null && end != null) { - self.length = end - start; + self.rawMessage = message; + return self; } - self.rawMessage = message; - return self; -}; // $FlowFixMe More hackery +} // $FlowFixMe More hackery ParseError.prototype.__proto__ = Error.prototype; @@ -130,7 +133,7 @@ ParseError.prototype.__proto__ = Error.prototype; /** * Return whether an element is contained in a list */ -var contains = function contains(list, elem) { +const contains = function (list, elem) { return list.indexOf(elem) !== -1; }; /** @@ -139,33 +142,31 @@ var contains = function contains(list, elem) { */ -var deflt = function deflt(setting, defaultIfUndefined) { +const deflt = function (setting, defaultIfUndefined) { return setting === undefined ? defaultIfUndefined : setting; }; // hyphenate and escape adapted from Facebook's React under Apache 2 license -var uppercase = /([A-Z])/g; +const uppercase = /([A-Z])/g; -var hyphenate = function hyphenate(str) { +const hyphenate = function (str) { return str.replace(uppercase, "-$1").toLowerCase(); }; -var ESCAPE_LOOKUP = { +const ESCAPE_LOOKUP = { "&": "&", ">": ">", "<": "<", "\"": """, "'": "'" }; -var ESCAPE_REGEX = /[&><"']/g; +const ESCAPE_REGEX = /[&><"']/g; /** * Escapes text to prevent scripting attacks. */ function utils_escape(text) { - return String(text).replace(ESCAPE_REGEX, function (match) { - return ESCAPE_LOOKUP[match]; - }); + return String(text).replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]); } /** * Sometimes we want to pull out the innermost element of a group. In most @@ -174,7 +175,7 @@ function utils_escape(text) { */ -var getBaseElem = function getBaseElem(group) { +const getBaseElem = function (group) { if (group.type === "ordgroup") { if (group.body.length === 1) { return getBaseElem(group.body[0]); @@ -200,13 +201,13 @@ var getBaseElem = function getBaseElem(group) { */ -var isCharacterBox = function isCharacterBox(group) { - var baseElem = getBaseElem(group); // These are all they types of groups which hold single characters +const isCharacterBox = function (group) { + const baseElem = getBaseElem(group); // These are all they types of groups which hold single characters return baseElem.type === "mathord" || baseElem.type === "textord" || baseElem.type === "atom"; }; -var assert = function assert(value) { +const assert = function (value) { if (!value) { throw new Error('Expected non-null, but got ' + String(value)); } @@ -215,21 +216,43 @@ var assert = function assert(value) { }; /** * Return the protocol of a URL, or "_relative" if the URL does not specify a - * protocol (and thus is relative). + * protocol (and thus is relative), or `null` if URL has invalid protocol + * (so should be outright rejected). */ -var protocolFromUrl = function protocolFromUrl(url) { - var protocol = /^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(url); - return protocol != null ? protocol[1] : "_relative"; +const protocolFromUrl = function (url) { + // Check for possible leading protocol. + // https://url.spec.whatwg.org/#url-parsing strips leading whitespace + // (U+20) or C0 control (U+00-U+1F) characters. + // eslint-disable-next-line no-control-regex + const protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(url); + + if (!protocol) { + return "_relative"; + } // Reject weird colons + + + if (protocol[2] !== ":") { + return null; + } // Reject invalid characters in scheme according to + // https://datatracker.ietf.org/doc/html/rfc3986#section-3.1 + + + if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) { + return null; + } // Lowercase the protocol + + + return protocol[1].toLowerCase(); }; /* harmony default export */ var utils = ({ - contains: contains, - deflt: deflt, + contains, + deflt, escape: utils_escape, - hyphenate: hyphenate, - getBaseElem: getBaseElem, - isCharacterBox: isCharacterBox, - protocolFromUrl: protocolFromUrl + hyphenate, + getBaseElem, + isCharacterBox, + protocolFromUrl }); ;// CONCATENATED MODULE: ./src/Settings.js /* eslint no-console:0 */ @@ -244,7 +267,7 @@ var protocolFromUrl = function protocolFromUrl(url) { // TODO: automatically generate documentation // TODO: check all properties on Settings exist // TODO: check the type of a property on Settings matches -var SETTINGS_SCHEMA = { +const SETTINGS_SCHEMA = { displayMode: { type: "boolean", description: "Render math in display mode, which puts the math in " + "display style (so \\int and \\sum are large, for example), and " + "centers the math on the page on its own line.", @@ -276,16 +299,14 @@ var SETTINGS_SCHEMA = { default: "#cc0000", cli: "-c, --error-color ", cliDescription: "A color string given in the format 'rgb' or 'rrggbb' " + "(no #). This option determines the color of errors rendered by the " + "-t option.", - cliProcessor: function cliProcessor(color) { - return "#" + color; - } + cliProcessor: color => "#" + color }, macros: { type: "object", cli: "-m, --macro ", cliDescription: "Define custom macro of the form '\\foo:expansion' (use " + "multiple -m arguments for multiple macros).", cliDefault: [], - cliProcessor: function cliProcessor(def, defs) { + cliProcessor: (def, defs) => { defs.push(def); return defs; } @@ -293,9 +314,7 @@ var SETTINGS_SCHEMA = { minRuleThickness: { type: "number", description: "Specifies a minimum thickness, in ems, for fraction lines," + " `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, " + "`\\hdashline`, `\\underline`, `\\overline`, and the borders of " + "`\\fbox`, `\\boxed`, and `\\fcolorbox`.", - processor: function processor(t) { - return Math.max(0, t); - }, + processor: t => Math.max(0, t), cli: "--min-rule-thickness ", cliProcessor: parseFloat }, @@ -321,9 +340,7 @@ var SETTINGS_SCHEMA = { type: "number", default: Infinity, description: "If non-zero, all user-specified sizes, e.g. in " + "\\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, " + "elements and spaces can be arbitrarily large", - processor: function processor(s) { - return Math.max(0, s); - }, + processor: s => Math.max(0, s), cli: "-s, --max-size ", cliProcessor: parseInt }, @@ -331,13 +348,9 @@ var SETTINGS_SCHEMA = { type: "number", default: 1000, description: "Limit the number of macro expansions to the specified " + "number, to prevent e.g. infinite macro loops. If set to Infinity, " + "the macro expander will try to fully expand as in LaTeX.", - processor: function processor(n) { - return Math.max(0, n); - }, + processor: n => Math.max(0, n), cli: "-e, --max-expand ", - cliProcessor: function cliProcessor(n) { - return n === "Infinity" ? Infinity : parseInt(n); - } + cliProcessor: n => n === "Infinity" ? Infinity : parseInt(n) }, globalGroup: { type: "boolean", @@ -350,8 +363,8 @@ function getDefaultValue(schema) { return schema.default; } - var type = schema.type; - var defaultType = Array.isArray(type) ? type[0] : type; + const type = schema.type; + const defaultType = Array.isArray(type) ? type[0] : type; if (typeof defaultType !== 'string') { return defaultType.enum[0]; @@ -383,8 +396,8 @@ function getDefaultValue(schema) { */ -var Settings = /*#__PURE__*/function () { - function Settings(options) { +class Settings { + constructor(options) { this.displayMode = void 0; this.output = void 0; this.leqno = void 0; @@ -402,10 +415,10 @@ var Settings = /*#__PURE__*/function () { // allow null options options = options || {}; - for (var prop in SETTINGS_SCHEMA) { + for (const prop in SETTINGS_SCHEMA) { if (SETTINGS_SCHEMA.hasOwnProperty(prop)) { // $FlowFixMe - var schema = SETTINGS_SCHEMA[prop]; // TODO: validate options + const schema = SETTINGS_SCHEMA[prop]; // TODO: validate options // $FlowFixMe this[prop] = options[prop] !== undefined ? schema.processor ? schema.processor(options[prop]) : options[prop] : getDefaultValue(schema); @@ -418,10 +431,8 @@ var Settings = /*#__PURE__*/function () { */ - var _proto = Settings.prototype; - - _proto.reportNonstrict = function reportNonstrict(errorCode, errorMsg, token) { - var strict = this.strict; + reportNonstrict(errorCode, errorMsg, token) { + let strict = this.strict; if (typeof strict === "function") { // Allow return value of strict function to be boolean or string @@ -448,10 +459,10 @@ var Settings = /*#__PURE__*/function () { * "warn" prints a warning and returns `false`. * This is for the second category of `errorCode`s listed in the README. */ - ; - _proto.useStrictBehavior = function useStrictBehavior(errorCode, errorMsg, token) { - var strict = this.strict; + + useStrictBehavior(errorCode, errorMsg, token) { + let strict = this.strict; if (typeof strict === "function") { // Allow return value of strict function to be boolean or string @@ -486,21 +497,24 @@ var Settings = /*#__PURE__*/function () { * If `context` has a `url` field, a `protocol` field will automatically * get added by this function (changing the specified object). */ - ; - _proto.isTrusted = function isTrusted(context) { + + isTrusted(context) { if (context.url && !context.protocol) { - context.protocol = utils.protocolFromUrl(context.url); + const protocol = utils.protocolFromUrl(context.url); + + if (protocol == null) { + return false; + } + + context.protocol = protocol; } - var trust = typeof this.trust === "function" ? this.trust(context) : this.trust; + const trust = typeof this.trust === "function" ? this.trust(context) : this.trust; return Boolean(trust); - }; - - return Settings; -}(); - + } +} ;// CONCATENATED MODULE: ./src/Style.js /** * This file contains information and classes for the various kinds of styles @@ -514,8 +528,8 @@ var Settings = /*#__PURE__*/function () { * The main style class. Contains a unique id for the style, a size (which is * the same for cramped and uncramped version of a style), and a cramped flag. */ -var Style = /*#__PURE__*/function () { - function Style(id, size, cramped) { +class Style { + constructor(id, size, cramped) { this.id = void 0; this.size = void 0; this.cramped = void 0; @@ -528,86 +542,83 @@ var Style = /*#__PURE__*/function () { */ - var _proto = Style.prototype; - - _proto.sup = function sup() { - return styles[_sup[this.id]]; + sup() { + return styles[sup[this.id]]; } /** * Get the style of a subscript given a base in the current style. */ - ; - _proto.sub = function sub() { - return styles[_sub[this.id]]; + + sub() { + return styles[sub[this.id]]; } /** * Get the style of a fraction numerator given the fraction in the current * style. */ - ; - _proto.fracNum = function fracNum() { - return styles[_fracNum[this.id]]; + + fracNum() { + return styles[fracNum[this.id]]; } /** * Get the style of a fraction denominator given the fraction in the current * style. */ - ; - _proto.fracDen = function fracDen() { - return styles[_fracDen[this.id]]; + + fracDen() { + return styles[fracDen[this.id]]; } /** * Get the cramped version of a style (in particular, cramping a cramped style * doesn't change the style). */ - ; - _proto.cramp = function cramp() { - return styles[_cramp[this.id]]; + + cramp() { + return styles[cramp[this.id]]; } /** * Get a text or display version of this style. */ - ; - _proto.text = function text() { - return styles[_text[this.id]]; + + text() { + return styles[Style_text[this.id]]; } /** * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle) */ - ; - _proto.isTight = function isTight() { + + isTight() { return this.size >= 2; - }; + } - return Style; -}(); // Export an interface for type checking, but don't expose the implementation. +} // Export an interface for type checking, but don't expose the implementation. // This way, no more styles can be generated. // IDs of the different styles -var D = 0; -var Dc = 1; -var T = 2; -var Tc = 3; -var S = 4; -var Sc = 5; -var SS = 6; -var SSc = 7; // Instances of the different styles +const D = 0; +const Dc = 1; +const T = 2; +const Tc = 3; +const S = 4; +const Sc = 5; +const SS = 6; +const SSc = 7; // Instances of the different styles -var styles = [new Style(D, 0, false), new Style(Dc, 0, true), new Style(T, 1, false), new Style(Tc, 1, true), new Style(S, 2, false), new Style(Sc, 2, true), new Style(SS, 3, false), new Style(SSc, 3, true)]; // Lookup tables for switching from one style to another +const styles = [new Style(D, 0, false), new Style(Dc, 0, true), new Style(T, 1, false), new Style(Tc, 1, true), new Style(S, 2, false), new Style(Sc, 2, true), new Style(SS, 3, false), new Style(SSc, 3, true)]; // Lookup tables for switching from one style to another -var _sup = [S, Sc, S, Sc, SS, SSc, SS, SSc]; -var _sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc]; -var _fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc]; -var _fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc]; -var _cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc]; -var _text = [D, Dc, T, Tc, T, Tc, T, Tc]; // We only export some of the styles. +const sup = [S, Sc, S, Sc, SS, SSc, SS, SSc]; +const sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc]; +const fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc]; +const fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc]; +const cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc]; +const Style_text = [D, Dc, T, Tc, T, Tc, T, Tc]; // We only export some of the styles. /* harmony default export */ var src_Style = ({ DISPLAY: styles[D], @@ -633,7 +644,7 @@ var _text = [D, Dc, T, Tc, T, Tc, T, Tc]; // We only export some of the styles. * Unicode block data for the families of scripts we support in \text{}. * Scripts only need to appear here if they do not have font metrics. */ -var scriptData = [{ +const scriptData = [{ // Latin characters beyond the Latin-1 characters we have metrics for. // Needed for Czech, Hungarian and Turkish text, for example. name: 'latin', @@ -691,11 +702,11 @@ var scriptData = [{ */ function scriptFromCodepoint(codepoint) { - for (var i = 0; i < scriptData.length; i++) { - var script = scriptData[i]; + for (let i = 0; i < scriptData.length; i++) { + const script = scriptData[i]; - for (var _i = 0; _i < script.blocks.length; _i++) { - var block = script.blocks[_i]; + for (let i = 0; i < script.blocks.length; i++) { + const block = script.blocks[i]; if (codepoint >= block[0] && codepoint <= block[1]) { return script.name; @@ -710,12 +721,8 @@ function scriptFromCodepoint(codepoint) { * This is an optimization to make supportedCodepoint() fast. */ -var allBlocks = []; -scriptData.forEach(function (s) { - return s.blocks.forEach(function (b) { - return allBlocks.push.apply(allBlocks, b); - }); -}); +const allBlocks = []; +scriptData.forEach(s => s.blocks.forEach(b => allBlocks.push(...b))); /** * Given a codepoint, return true if it falls within one of the * scripts or script families defined above and false otherwise. @@ -726,7 +733,7 @@ scriptData.forEach(function (s) { */ function supportedCodepoint(codepoint) { - for (var i = 0; i < allBlocks.length; i += 2) { + for (let i = 0; i < allBlocks.length; i += 2) { if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) { return true; } @@ -740,7 +747,7 @@ function supportedCodepoint(codepoint) { * It's a storehouse of path geometry for SVG images. */ // In all paths below, the viewBox-to-em scale is 1000:1. -var hLinePad = 80; // padding above a sqrt vinculum. Prevents image cropping. +const hLinePad = 80; // padding above a sqrt vinculum. Prevents image cropping. // The vinculum of a \sqrt can be made thicker by a KaTeX rendering option. // Think of variable extraVinculum as two detours in the SVG path. // The detour begins at the lower left of the area labeled extraVinculum below. @@ -760,50 +767,50 @@ var hLinePad = 80; // padding above a sqrt vinculum. Prevents image cropping. / / surd */ -var sqrtMain = function sqrtMain(extraVinculum, hLinePad) { +const sqrtMain = function (extraVinculum, hLinePad) { // sqrtMain path geometry is from glyph U221A in the font KaTeX Main return "M95," + (622 + extraVinculum + hLinePad) + "\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl" + extraVinculum / 2.075 + " -" + extraVinculum + "\nc5.3,-9.3,12,-14,20,-14\nH400000v" + (40 + extraVinculum) + "H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM" + (834 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z"; }; -var sqrtSize1 = function sqrtSize1(extraVinculum, hLinePad) { +const sqrtSize1 = function (extraVinculum, hLinePad) { // size1 is from glyph U221A in the font KaTeX_Size1-Regular return "M263," + (601 + extraVinculum + hLinePad) + "c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl" + extraVinculum / 2.084 + " -" + extraVinculum + "\nc4.7,-7.3,11,-11,19,-11\nH40000v" + (40 + extraVinculum) + "H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z"; }; -var sqrtSize2 = function sqrtSize2(extraVinculum, hLinePad) { +const sqrtSize2 = function (extraVinculum, hLinePad) { // size2 is from glyph U221A in the font KaTeX_Size2-Regular return "M983 " + (10 + extraVinculum + hLinePad) + "\nl" + extraVinculum / 3.13 + " -" + extraVinculum + "\nc4,-6.7,10,-10,18,-10 H400000v" + (40 + extraVinculum) + "\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z"; }; -var sqrtSize3 = function sqrtSize3(extraVinculum, hLinePad) { +const sqrtSize3 = function (extraVinculum, hLinePad) { // size3 is from glyph U221A in the font KaTeX_Size3-Regular return "M424," + (2398 + extraVinculum + hLinePad) + "\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl" + extraVinculum / 4.223 + " -" + extraVinculum + "c4,-6.7,10,-10,18,-10 H400000\nv" + (40 + extraVinculum) + "H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M" + (1001 + extraVinculum) + " " + hLinePad + "\nh400000v" + (40 + extraVinculum) + "h-400000z"; }; -var sqrtSize4 = function sqrtSize4(extraVinculum, hLinePad) { +const sqrtSize4 = function (extraVinculum, hLinePad) { // size4 is from glyph U221A in the font KaTeX_Size4-Regular return "M473," + (2713 + extraVinculum + hLinePad) + "\nc339.3,-1799.3,509.3,-2700,510,-2702 l" + extraVinculum / 5.298 + " -" + extraVinculum + "\nc3.3,-7.3,9.3,-11,18,-11 H400000v" + (40 + extraVinculum) + "H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "H1017.7z"; }; -var phasePath = function phasePath(y) { - var x = y / 2; // x coordinate at top of angle +const phasePath = function (y) { + const x = y / 2; // x coordinate at top of angle return "M400000 " + y + " H0 L" + x + " 0 l65 45 L145 " + (y - 80) + " H400000z"; }; -var sqrtTall = function sqrtTall(extraVinculum, hLinePad, viewBoxHeight) { +const sqrtTall = function (extraVinculum, hLinePad, viewBoxHeight) { // sqrtTall is from glyph U23B7 in the font KaTeX_Size4-Regular // One path edge has a variable length. It runs vertically from the vinculum // to a point near (14 units) the bottom of the surd. The vinculum // is normally 40 units thick. So the length of the line in question is: - var vertSegment = viewBoxHeight - 54 - hLinePad - extraVinculum; + const vertSegment = viewBoxHeight - 54 - hLinePad - extraVinculum; return "M702 " + (extraVinculum + hLinePad) + "H400000" + (40 + extraVinculum) + "\nH742v" + vertSegment + "l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 " + hLinePad + "H400000v" + (40 + extraVinculum) + "H742z"; }; -var sqrtPath = function sqrtPath(size, extraVinculum, viewBoxHeight) { +const sqrtPath = function (size, extraVinculum, viewBoxHeight) { extraVinculum = 1000 * extraVinculum; // Convert from document ems to viewBox. - var path = ""; + let path = ""; switch (size) { case "sqrtMain": @@ -832,10 +839,10 @@ var sqrtPath = function sqrtPath(size, extraVinculum, viewBoxHeight) { return path; }; -var innerPath = function innerPath(name, height) { +const innerPath = function (name, height) { // The inner part of stretchy tall delimiters switch (name) { - case "\u239C": + case "\u239c": return "M291 0 H417 V" + height + " H291z M291 0 H417 V" + height + " H291z"; case "\u2223": @@ -844,19 +851,19 @@ var innerPath = function innerPath(name, height) { case "\u2225": return "M145 0 H188 V" + height + " H145z M145 0 H188 V" + height + " H145z" + ("M367 0 H410 V" + height + " H367z M367 0 H410 V" + height + " H367z"); - case "\u239F": + case "\u239f": return "M457 0 H583 V" + height + " H457z M457 0 H583 V" + height + " H457z"; - case "\u23A2": + case "\u23a2": return "M319 0 H403 V" + height + " H319z M319 0 H403 V" + height + " H319z"; - case "\u23A5": + case "\u23a5": return "M263 0 H347 V" + height + " H263z M263 0 H347 V" + height + " H263z"; - case "\u23AA": + case "\u23aa": return "M384 0 H504 V" + height + " H384z M384 0 H504 V" + height + " H384z"; - case "\u23D0": + case "\u23d0": return "M312 0 H355 V" + height + " H312z M312 0 H355 V" + height + " H312z"; case "\u2016": @@ -866,7 +873,7 @@ var innerPath = function innerPath(name, height) { return ""; } }; -var path = { +const path = { // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main doubleleftarrow: "M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z", // doublerightarrow is from glyph U+21D2 in font KaTeX Main @@ -944,7 +951,7 @@ var path = { shortbaraboveleftharpoon: "M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z", shortrightharpoonabovebar: "M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z" }; -var tallDelim = function tallDelim(label, midHeight) { +const tallDelim = function (label, midHeight) { switch (label) { case "lbrack": return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v" + midHeight + " v1759 h84z"; @@ -989,10 +996,10 @@ var tallDelim = function tallDelim(label, midHeight) { * placed into the DOM doesn't have any representation itself. It only contains * children and doesn't have any DOM node properties. */ -var DocumentFragment = /*#__PURE__*/function () { +class DocumentFragment { // HtmlDomNode // Never used; needed for satisfying interface. - function DocumentFragment(children) { + constructor(children) { this.children = void 0; this.classes = void 0; this.height = void 0; @@ -1007,30 +1014,28 @@ var DocumentFragment = /*#__PURE__*/function () { this.style = {}; } - var _proto = DocumentFragment.prototype; - - _proto.hasClass = function hasClass(className) { + hasClass(className) { return utils.contains(this.classes, className); } /** Convert the fragment into a node. */ - ; - _proto.toNode = function toNode() { - var frag = document.createDocumentFragment(); - for (var i = 0; i < this.children.length; i++) { + toNode() { + const frag = document.createDocumentFragment(); + + for (let i = 0; i < this.children.length; i++) { frag.appendChild(this.children[i].toNode()); } return frag; } /** Convert the fragment into HTML markup. */ - ; - _proto.toMarkup = function toMarkup() { - var markup = ""; // Simply concatenate the markup for the children together. - for (var i = 0; i < this.children.length; i++) { + toMarkup() { + let markup = ""; // Simply concatenate the markup for the children together. + + for (let i = 0; i < this.children.length; i++) { markup += this.children[i].toMarkup(); } @@ -1040,21 +1045,18 @@ var DocumentFragment = /*#__PURE__*/function () { * Converts the math node into a string, similar to innerText. Applies to * MathDomNode's only. */ - ; - _proto.toText = function toText() { + + toText() { // To avoid this, we would subclass documentFragment separately for // MathML, but polyfills for subclassing is expensive per PR 1469. // $FlowFixMe: Only works for ChildType = MathDomNode. - var toText = function toText(child) { - return child.toText(); - }; + const toText = child => child.toText(); return this.children.map(toText).join(""); - }; + } - return DocumentFragment; -}(); +} ;// CONCATENATED MODULE: ./src/fontMetricsData.js // This file is GENERATED by buildMetrics.sh. DO NOT MODIFY. /* harmony default export */ var fontMetricsData = ({ @@ -3165,7 +3167,7 @@ var DocumentFragment = /*#__PURE__*/function () { // // The output of each of these commands is quite lengthy. The only part we // care about is the FONTDIMEN section. Each value is measured in EMs. -var sigmasAndXis = { +const sigmasAndXis = { slant: [0.250, 0.250, 0.250], // sigma1 space: [0.000, 0.000, 0.000], @@ -3259,7 +3261,7 @@ var sigmasAndXis = { // the fraction bar or root line from intersecting the glyph. // TODO(kevinb) allow union of multiple glyph metrics for better accuracy. -var extraCharacterMap = { +const extraCharacterMap = { // Latin-1 'Å': 'A', 'Ð': 'D', @@ -3354,8 +3356,8 @@ function getCharacterMetrics(character, font, mode) { throw new Error("Font metrics not found for font: " + font + "."); } - var ch = character.charCodeAt(0); - var metrics = fontMetricsData[font][ch]; + let ch = character.charCodeAt(0); + let metrics = fontMetricsData[font][ch]; if (!metrics && character[0] in extraCharacterMap) { ch = extraCharacterMap[character[0]].charCodeAt(0); @@ -3386,13 +3388,13 @@ function getCharacterMetrics(character, font, mode) { }; } } -var fontMetricsBySizeIndex = {}; +const fontMetricsBySizeIndex = {}; /** * Get the font metrics for a given size. */ function getGlobalMetrics(size) { - var sizeIndex; + let sizeIndex; if (size >= 5) { sizeIndex = 0; @@ -3403,11 +3405,11 @@ function getGlobalMetrics(size) { } if (!fontMetricsBySizeIndex[sizeIndex]) { - var metrics = fontMetricsBySizeIndex[sizeIndex] = { + const metrics = fontMetricsBySizeIndex[sizeIndex] = { cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18 }; - for (var key in sigmasAndXis) { + for (const key in sigmasAndXis) { if (sigmasAndXis.hasOwnProperty(key)) { metrics[key] = sigmasAndXis[key][sizeIndex]; } @@ -3424,7 +3426,7 @@ function getGlobalMetrics(size) { * `.reset` functions. */ -var sizeStyleMap = [// Each element contains [textsize, scriptsize, scriptscriptsize]. +const sizeStyleMap = [// Each element contains [textsize, scriptsize, scriptscriptsize]. // The size mappings are taken from TeX with \normalsize=10pt. [1, 1, 1], // size1: [5, 5, 5] \tiny [2, 1, 1], // size2: [6, 5, 5] @@ -3438,11 +3440,11 @@ var sizeStyleMap = [// Each element contains [textsize, scriptsize, scriptscript [10, 8, 7], // size10: [20.74, 14.4, 12] \huge [11, 10, 9] // size11: [24.88, 20.74, 17.28] \HUGE ]; -var sizeMultipliers = [// fontMetrics.js:getGlobalMetrics also uses size indexes, so if +const sizeMultipliers = [// fontMetrics.js:getGlobalMetrics also uses size indexes, so if // you change size indexes, change that function. 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.44, 1.728, 2.074, 2.488]; -var sizeAtStyle = function sizeAtStyle(size, style) { +const sizeAtStyle = function (size, style) { return style.size < 2 ? size : sizeStyleMap[size - 1][style.size - 1]; }; // In these types, "" (empty string) means "no change". @@ -3454,7 +3456,7 @@ var sizeAtStyle = function sizeAtStyle(size, style) { * Options objects should not be modified. To create a new Options with * different properties, call a `.having*` method. */ -var Options = /*#__PURE__*/function () { +class Options { // A font family applies to a group of fonts (i.e. SansSerif), while a font // represents a specific font (i.e. SansSerif Bold). // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm @@ -3462,7 +3464,7 @@ var Options = /*#__PURE__*/function () { /** * The base size index. */ - function Options(data) { + constructor(data) { this.style = void 0; this.color = void 0; this.size = void 0; @@ -3496,10 +3498,8 @@ var Options = /*#__PURE__*/function () { */ - var _proto = Options.prototype; - - _proto.extend = function extend(extension) { - var data = { + extend(extension) { + const data = { style: this.style, size: this.size, textSize: this.textSize, @@ -3513,7 +3513,7 @@ var Options = /*#__PURE__*/function () { minRuleThickness: this.minRuleThickness }; - for (var key in extension) { + for (const key in extension) { if (extension.hasOwnProperty(key)) { data[key] = extension[key]; } @@ -3525,9 +3525,9 @@ var Options = /*#__PURE__*/function () { * Return an options object with the given style. If `this.style === style`, * returns `this`. */ - ; - _proto.havingStyle = function havingStyle(style) { + + havingStyle(style) { if (this.style === style) { return this; } else { @@ -3541,18 +3541,18 @@ var Options = /*#__PURE__*/function () { * Return an options object with a cramped version of the current style. If * the current style is cramped, returns `this`. */ - ; - _proto.havingCrampedStyle = function havingCrampedStyle() { + + havingCrampedStyle() { return this.havingStyle(this.style.cramp()); } /** * Return an options object with the given size and in at least `\textstyle`. * Returns `this` if appropriate. */ - ; - _proto.havingSize = function havingSize(size) { + + havingSize(size) { if (this.size === size && this.textSize === size) { return this; } else { @@ -3568,11 +3568,11 @@ var Options = /*#__PURE__*/function () { * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted, * changes to at least `\textstyle`. */ - ; - _proto.havingBaseStyle = function havingBaseStyle(style) { + + havingBaseStyle(style) { style = style || this.style.text(); - var wantSize = sizeAtStyle(Options.BASESIZE, style); + const wantSize = sizeAtStyle(Options.BASESIZE, style); if (this.size === wantSize && this.textSize === Options.BASESIZE && this.style === style) { return this; @@ -3587,10 +3587,10 @@ var Options = /*#__PURE__*/function () { * Remove the effect of sizing changes such as \Huge. * Keep the effect of the current style, such as \scriptstyle. */ - ; - _proto.havingBaseSizing = function havingBaseSizing() { - var size; + + havingBaseSizing() { + let size; switch (this.style.id) { case 4: @@ -3618,9 +3618,9 @@ var Options = /*#__PURE__*/function () { /** * Create a new options object with the given color. */ - ; - _proto.withColor = function withColor(color) { + + withColor(color) { return this.extend({ color: color }); @@ -3628,9 +3628,9 @@ var Options = /*#__PURE__*/function () { /** * Create a new options object with "phantom" set to true. */ - ; - _proto.withPhantom = function withPhantom() { + + withPhantom() { return this.extend({ phantom: true }); @@ -3639,43 +3639,43 @@ var Options = /*#__PURE__*/function () { * Creates a new options object with the given math font or old text font. * @type {[type]} */ - ; - _proto.withFont = function withFont(font) { + + withFont(font) { return this.extend({ - font: font + font }); } /** * Create a new options objects with the given fontFamily. */ - ; - _proto.withTextFontFamily = function withTextFontFamily(fontFamily) { + + withTextFontFamily(fontFamily) { return this.extend({ - fontFamily: fontFamily, + fontFamily, font: "" }); } /** * Creates a new options object with the given font weight */ - ; - _proto.withTextFontWeight = function withTextFontWeight(fontWeight) { + + withTextFontWeight(fontWeight) { return this.extend({ - fontWeight: fontWeight, + fontWeight, font: "" }); } /** * Creates a new options object with the given font weight */ - ; - _proto.withTextFontShape = function withTextFontShape(fontShape) { + + withTextFontShape(fontShape) { return this.extend({ - fontShape: fontShape, + fontShape, font: "" }); } @@ -3683,9 +3683,9 @@ var Options = /*#__PURE__*/function () { * Return the CSS sizing classes required to switch from enclosing options * `oldOptions` to `this`. Returns an array of classes. */ - ; - _proto.sizingClasses = function sizingClasses(oldOptions) { + + sizingClasses(oldOptions) { if (oldOptions.size !== this.size) { return ["sizing", "reset-size" + oldOptions.size, "size" + this.size]; } else { @@ -3696,9 +3696,9 @@ var Options = /*#__PURE__*/function () { * Return the CSS sizing classes required to switch to the base size. Like * `this.havingSize(BASESIZE).sizingClasses(this)`. */ - ; - _proto.baseSizingClasses = function baseSizingClasses() { + + baseSizingClasses() { if (this.size !== Options.BASESIZE) { return ["sizing", "reset-size" + this.size, "size" + Options.BASESIZE]; } else { @@ -3708,9 +3708,9 @@ var Options = /*#__PURE__*/function () { /** * Return the font metrics for this size. */ - ; - _proto.fontMetrics = function fontMetrics() { + + fontMetrics() { if (!this._fontMetrics) { this._fontMetrics = getGlobalMetrics(this.size); } @@ -3720,18 +3720,17 @@ var Options = /*#__PURE__*/function () { /** * Gets the CSS color of the current options object */ - ; - _proto.getColor = function getColor() { + + getColor() { if (this.phantom) { return "transparent"; } else { return this.color; } - }; + } - return Options; -}(); +} Options.BASESIZE = 6; /* harmony default export */ var src_Options = (Options); @@ -3746,7 +3745,7 @@ Options.BASESIZE = 6; // into pts. Dividing the result by ptPerEm gives the number of ems // *assuming* a font size of ptPerEm (normal size, normal style). -var ptPerUnit = { +const ptPerUnit = { // https://en.wikibooks.org/wiki/LaTeX/Lengths and // https://tex.stackexchange.com/a/8263 "pt": 1, @@ -3776,7 +3775,7 @@ var ptPerUnit = { }; // Dictionary of relative units, for fast validity testing. -var relativeUnit = { +const relativeUnit = { "ex": true, "em": true, "mu": true @@ -3786,7 +3785,7 @@ var relativeUnit = { * Determine whether the specified unit (either a string defining the unit * or a "size" parse node containing a unit field) is valid. */ -var validUnit = function validUnit(unit) { +const validUnit = function (unit) { if (typeof unit !== "string") { unit = unit.unit; } @@ -3799,8 +3798,8 @@ var validUnit = function validUnit(unit) { * current style/scale. `options` gives the current options. */ -var calculateSize = function calculateSize(sizeValue, options) { - var scale; +const calculateSize = function (sizeValue, options) { + let scale; if (sizeValue.unit in ptPerUnit) { // Absolute units @@ -3813,7 +3812,7 @@ var calculateSize = function calculateSize(sizeValue, options) { } else { // Other relative units always refer to the *textstyle* font // in the current size. - var unitOptions; + let unitOptions; if (options.style.isTight()) { // isTight() means current style is script/scriptscript. @@ -3849,7 +3848,7 @@ var calculateSize = function calculateSize(sizeValue, options) { * https://github.com/KaTeX/KaTeX/pull/2460. */ -var makeEm = function makeEm(n) { +const makeEm = function (n) { return +n.toFixed(4) + "em"; }; ;// CONCATENATED MODULE: ./src/domTree.js @@ -3875,13 +3874,11 @@ var makeEm = function makeEm(n) { * Create an HTML className based on a list of classes. In addition to joining * with spaces, we also remove empty classes. */ -var createClass = function createClass(classes) { - return classes.filter(function (cls) { - return cls; - }).join(" "); +const createClass = function (classes) { + return classes.filter(cls => cls).join(" "); }; -var initNode = function initNode(classes, options, style) { +const initNode = function (classes, options, style) { this.classes = classes || []; this.attributes = {}; this.height = 0; @@ -3894,7 +3891,7 @@ var initNode = function initNode(classes, options, style) { this.classes.push("mtight"); } - var color = options.getColor(); + const color = options.getColor(); if (color) { this.style.color = color; @@ -3906,12 +3903,12 @@ var initNode = function initNode(classes, options, style) { */ -var _toNode = function toNode(tagName) { - var node = document.createElement(tagName); // Apply the class +const toNode = function (tagName) { + const node = document.createElement(tagName); // Apply the class node.className = createClass(this.classes); // Apply inline styles - for (var style in this.style) { + for (const style in this.style) { if (this.style.hasOwnProperty(style)) { // $FlowFixMe Flow doesn't seem to understand span.style's type. node.style[style] = this.style[style]; @@ -3919,14 +3916,14 @@ var _toNode = function toNode(tagName) { } // Apply attributes - for (var attr in this.attributes) { + for (const attr in this.attributes) { if (this.attributes.hasOwnProperty(attr)) { node.setAttribute(attr, this.attributes[attr]); } } // Append the children, also as HTML nodes - for (var i = 0; i < this.children.length; i++) { + for (let i = 0; i < this.children.length; i++) { node.appendChild(this.children[i].toNode()); } @@ -3937,16 +3934,16 @@ var _toNode = function toNode(tagName) { */ -var _toMarkup = function toMarkup(tagName) { - var markup = "<" + tagName; // Add the class +const toMarkup = function (tagName) { + let markup = "<" + tagName; // Add the class if (this.classes.length) { markup += " class=\"" + utils.escape(createClass(this.classes)) + "\""; } - var styles = ""; // Add the styles, after hyphenation + let styles = ""; // Add the styles, after hyphenation - for (var style in this.style) { + for (const style in this.style) { if (this.style.hasOwnProperty(style)) { styles += utils.hyphenate(style) + ":" + this.style[style] + ";"; } @@ -3957,7 +3954,7 @@ var _toMarkup = function toMarkup(tagName) { } // Add the attributes - for (var attr in this.attributes) { + for (const attr in this.attributes) { if (this.attributes.hasOwnProperty(attr)) { markup += " " + attr + "=\"" + utils.escape(this.attributes[attr]) + "\""; } @@ -3965,7 +3962,7 @@ var _toMarkup = function toMarkup(tagName) { markup += ">"; // Add the markup of the children, also as markup - for (var i = 0; i < this.children.length; i++) { + for (let i = 0; i < this.children.length; i++) { markup += this.children[i].toMarkup(); } @@ -3989,8 +3986,8 @@ var _toMarkup = function toMarkup(tagName) { * otherwise. This typesafety is important when HTML builders access a span's * children. */ -var Span = /*#__PURE__*/function () { - function Span(classes, children, options, style) { +class Span { + constructor(classes, children, options, style) { this.children = void 0; this.attributes = void 0; this.classes = void 0; @@ -4009,33 +4006,30 @@ var Span = /*#__PURE__*/function () { */ - var _proto = Span.prototype; - - _proto.setAttribute = function setAttribute(attribute, value) { + setAttribute(attribute, value) { this.attributes[attribute] = value; - }; + } - _proto.hasClass = function hasClass(className) { + hasClass(className) { return utils.contains(this.classes, className); - }; + } - _proto.toNode = function toNode() { - return _toNode.call(this, "span"); - }; + toNode() { + return toNode.call(this, "span"); + } - _proto.toMarkup = function toMarkup() { - return _toMarkup.call(this, "span"); - }; + toMarkup() { + return toMarkup.call(this, "span"); + } - return Span; -}(); +} /** * This node represents an anchor () element with a hyperlink. See `span` * for further details. */ -var Anchor = /*#__PURE__*/function () { - function Anchor(href, classes, children, options) { +class Anchor { + constructor(href, classes, children, options) { this.children = void 0; this.attributes = void 0; this.classes = void 0; @@ -4048,32 +4042,29 @@ var Anchor = /*#__PURE__*/function () { this.setAttribute('href', href); } - var _proto2 = Anchor.prototype; - - _proto2.setAttribute = function setAttribute(attribute, value) { + setAttribute(attribute, value) { this.attributes[attribute] = value; - }; + } - _proto2.hasClass = function hasClass(className) { + hasClass(className) { return utils.contains(this.classes, className); - }; + } - _proto2.toNode = function toNode() { - return _toNode.call(this, "a"); - }; + toNode() { + return toNode.call(this, "a"); + } - _proto2.toMarkup = function toMarkup() { - return _toMarkup.call(this, "a"); - }; + toMarkup() { + return toMarkup.call(this, "a"); + } - return Anchor; -}(); +} /** * This node represents an image embed () element. */ -var Img = /*#__PURE__*/function () { - function Img(src, alt, style) { +class Img { + constructor(src, alt, style) { this.src = void 0; this.alt = void 0; this.classes = void 0; @@ -4087,19 +4078,17 @@ var Img = /*#__PURE__*/function () { this.style = style; } - var _proto3 = Img.prototype; - - _proto3.hasClass = function hasClass(className) { + hasClass(className) { return utils.contains(this.classes, className); - }; + } - _proto3.toNode = function toNode() { - var node = document.createElement("img"); + toNode() { + const node = document.createElement("img"); node.src = this.src; node.alt = this.alt; node.className = "mord"; // Apply inline styles - for (var style in this.style) { + for (const style in this.style) { if (this.style.hasOwnProperty(style)) { // $FlowFixMe node.style[style] = this.style[style]; @@ -4107,14 +4096,14 @@ var Img = /*#__PURE__*/function () { } return node; - }; + } - _proto3.toMarkup = function toMarkup() { - var markup = "" + this.alt + " 0) { span = document.createElement("span"); @@ -4207,7 +4193,7 @@ var SymbolNode = /*#__PURE__*/function () { span.className = createClass(this.classes); } - for (var style in this.style) { + for (const style in this.style) { if (this.style.hasOwnProperty(style)) { span = span || document.createElement("span"); // $FlowFixMe Flow doesn't seem to understand span.style's type. @@ -4225,13 +4211,13 @@ var SymbolNode = /*#__PURE__*/function () { /** * Creates markup for a symbol node. */ - ; - _proto4.toMarkup = function toMarkup() { + + toMarkup() { // TODO(alpert): More duplication than I'd like from // span.prototype.toMarkup and symbolNode.prototype.toNode... - var needsSpan = false; - var markup = " 0) { styles += "margin-right:" + this.italic + "em;"; } - for (var style in this.style) { + for (const style in this.style) { if (this.style.hasOwnProperty(style)) { styles += utils.hyphenate(style) + ":" + this.style[style] + ";"; } @@ -4257,7 +4243,7 @@ var SymbolNode = /*#__PURE__*/function () { markup += " style=\"" + utils.escape(styles) + "\""; } - var escaped = utils.escape(this.text); + const escaped = utils.escape(this.text); if (needsSpan) { markup += ">"; @@ -4267,75 +4253,69 @@ var SymbolNode = /*#__PURE__*/function () { } else { return escaped; } - }; + } - return SymbolNode; -}(); +} /** * SVG nodes are used to render stretchy wide elements. */ -var SvgNode = /*#__PURE__*/function () { - function SvgNode(children, attributes) { +class SvgNode { + constructor(children, attributes) { this.children = void 0; this.attributes = void 0; this.children = children || []; this.attributes = attributes || {}; } - var _proto5 = SvgNode.prototype; + toNode() { + const svgNS = "http://www.w3.org/2000/svg"; + const node = document.createElementNS(svgNS, "svg"); // Apply attributes - _proto5.toNode = function toNode() { - var svgNS = "http://www.w3.org/2000/svg"; - var node = document.createElementNS(svgNS, "svg"); // Apply attributes - - for (var attr in this.attributes) { + for (const attr in this.attributes) { if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { node.setAttribute(attr, this.attributes[attr]); } } - for (var i = 0; i < this.children.length; i++) { + for (let i = 0; i < this.children.length; i++) { node.appendChild(this.children[i].toNode()); } return node; - }; + } - _proto5.toMarkup = function toMarkup() { - var markup = ""; + return ""; } else { - return ""; + return ""; } - }; + } - return PathNode; -}(); -var LineNode = /*#__PURE__*/function () { - function LineNode(attributes) { +} +class LineNode { + constructor(attributes) { this.attributes = void 0; this.attributes = attributes || {}; } - var _proto7 = LineNode.prototype; + toNode() { + const svgNS = "http://www.w3.org/2000/svg"; + const node = document.createElementNS(svgNS, "line"); // Apply attributes - _proto7.toNode = function toNode() { - var svgNS = "http://www.w3.org/2000/svg"; - var node = document.createElementNS(svgNS, "line"); // Apply attributes - - for (var attr in this.attributes) { + for (const attr in this.attributes) { if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { node.setAttribute(attr, this.attributes[attr]); } } return node; - }; + } - _proto7.toMarkup = function toMarkup() { - var markup = "", "\\gt", true); defineSymbol(math, main, rel, "\u2208", "\\in", true); -defineSymbol(math, main, rel, "\uE020", "\\@not"); +defineSymbol(math, main, rel, "\ue020", "\\@not"); defineSymbol(math, main, rel, "\u2282", "\\subset", true); defineSymbol(math, main, rel, "\u2283", "\\supset", true); defineSymbol(math, main, rel, "\u2286", "\\subseteq", true); defineSymbol(math, main, rel, "\u2287", "\\supseteq", true); defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq", true); defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq", true); -defineSymbol(math, main, rel, "\u22A8", "\\models"); +defineSymbol(math, main, rel, "\u22a8", "\\models"); defineSymbol(math, main, rel, "\u2190", "\\leftarrow", true); defineSymbol(math, main, rel, "\u2264", "\\le"); defineSymbol(math, main, rel, "\u2264", "\\leq", true); @@ -4959,34 +4935,34 @@ defineSymbol(math, main, rel, "\u2192", "\\rightarrow", true); defineSymbol(math, main, rel, "\u2192", "\\to"); defineSymbol(math, ams, rel, "\u2271", "\\ngeq", true); defineSymbol(math, ams, rel, "\u2270", "\\nleq", true); -defineSymbol(math, main, spacing, "\xA0", "\\ "); -defineSymbol(math, main, spacing, "\xA0", "\\space"); // Ref: LaTeX Source 2e: \DeclareRobustCommand{\nobreakspace}{% +defineSymbol(math, main, spacing, "\u00a0", "\\ "); +defineSymbol(math, main, spacing, "\u00a0", "\\space"); // Ref: LaTeX Source 2e: \DeclareRobustCommand{\nobreakspace}{% -defineSymbol(math, main, spacing, "\xA0", "\\nobreakspace"); -defineSymbol(symbols_text, main, spacing, "\xA0", "\\ "); -defineSymbol(symbols_text, main, spacing, "\xA0", " "); -defineSymbol(symbols_text, main, spacing, "\xA0", "\\space"); -defineSymbol(symbols_text, main, spacing, "\xA0", "\\nobreakspace"); +defineSymbol(math, main, spacing, "\u00a0", "\\nobreakspace"); +defineSymbol(symbols_text, main, spacing, "\u00a0", "\\ "); +defineSymbol(symbols_text, main, spacing, "\u00a0", " "); +defineSymbol(symbols_text, main, spacing, "\u00a0", "\\space"); +defineSymbol(symbols_text, main, spacing, "\u00a0", "\\nobreakspace"); defineSymbol(math, main, spacing, null, "\\nobreak"); defineSymbol(math, main, spacing, null, "\\allowbreak"); defineSymbol(math, main, punct, ",", ","); defineSymbol(math, main, punct, ";", ";"); -defineSymbol(math, ams, bin, "\u22BC", "\\barwedge", true); -defineSymbol(math, ams, bin, "\u22BB", "\\veebar", true); +defineSymbol(math, ams, bin, "\u22bc", "\\barwedge", true); +defineSymbol(math, ams, bin, "\u22bb", "\\veebar", true); defineSymbol(math, main, bin, "\u2299", "\\odot", true); defineSymbol(math, main, bin, "\u2295", "\\oplus", true); defineSymbol(math, main, bin, "\u2297", "\\otimes", true); defineSymbol(math, main, textord, "\u2202", "\\partial", true); defineSymbol(math, main, bin, "\u2298", "\\oslash", true); -defineSymbol(math, ams, bin, "\u229A", "\\circledcirc", true); -defineSymbol(math, ams, bin, "\u22A1", "\\boxdot", true); -defineSymbol(math, main, bin, "\u25B3", "\\bigtriangleup"); -defineSymbol(math, main, bin, "\u25BD", "\\bigtriangledown"); +defineSymbol(math, ams, bin, "\u229a", "\\circledcirc", true); +defineSymbol(math, ams, bin, "\u22a1", "\\boxdot", true); +defineSymbol(math, main, bin, "\u25b3", "\\bigtriangleup"); +defineSymbol(math, main, bin, "\u25bd", "\\bigtriangledown"); defineSymbol(math, main, bin, "\u2020", "\\dagger"); -defineSymbol(math, main, bin, "\u22C4", "\\diamond"); -defineSymbol(math, main, bin, "\u22C6", "\\star"); -defineSymbol(math, main, bin, "\u25C3", "\\triangleleft"); -defineSymbol(math, main, bin, "\u25B9", "\\triangleright"); +defineSymbol(math, main, bin, "\u22c4", "\\diamond"); +defineSymbol(math, main, bin, "\u22c6", "\\star"); +defineSymbol(math, main, bin, "\u25c3", "\\triangleleft"); +defineSymbol(math, main, bin, "\u25b9", "\\triangleright"); defineSymbol(math, main, symbols_open, "{", "\\{"); defineSymbol(symbols_text, main, textord, "{", "\\{"); defineSymbol(symbols_text, main, textord, "{", "\\textbraceleft"); @@ -5005,8 +4981,8 @@ defineSymbol(symbols_text, main, textord, "<", "\\textless", true); // in T1 fon defineSymbol(symbols_text, main, textord, ">", "\\textgreater", true); // in T1 fontenc -defineSymbol(math, main, symbols_open, "\u230A", "\\lfloor", true); -defineSymbol(math, main, symbols_close, "\u230B", "\\rfloor", true); +defineSymbol(math, main, symbols_open, "\u230a", "\\lfloor", true); +defineSymbol(math, main, symbols_close, "\u230b", "\\rfloor", true); defineSymbol(math, main, symbols_open, "\u2308", "\\lceil", true); defineSymbol(math, main, symbols_close, "\u2309", "\\rceil", true); defineSymbol(math, main, textord, "\\", "\\backslash"); @@ -5021,92 +4997,92 @@ defineSymbol(symbols_text, main, textord, "~", "\\textasciitilde"); defineSymbol(symbols_text, main, textord, "\\", "\\textbackslash"); defineSymbol(symbols_text, main, textord, "^", "\\textasciicircum"); defineSymbol(math, main, rel, "\u2191", "\\uparrow", true); -defineSymbol(math, main, rel, "\u21D1", "\\Uparrow", true); +defineSymbol(math, main, rel, "\u21d1", "\\Uparrow", true); defineSymbol(math, main, rel, "\u2193", "\\downarrow", true); -defineSymbol(math, main, rel, "\u21D3", "\\Downarrow", true); +defineSymbol(math, main, rel, "\u21d3", "\\Downarrow", true); defineSymbol(math, main, rel, "\u2195", "\\updownarrow", true); -defineSymbol(math, main, rel, "\u21D5", "\\Updownarrow", true); +defineSymbol(math, main, rel, "\u21d5", "\\Updownarrow", true); defineSymbol(math, main, op, "\u2210", "\\coprod"); -defineSymbol(math, main, op, "\u22C1", "\\bigvee"); -defineSymbol(math, main, op, "\u22C0", "\\bigwedge"); -defineSymbol(math, main, op, "\u2A04", "\\biguplus"); -defineSymbol(math, main, op, "\u22C2", "\\bigcap"); -defineSymbol(math, main, op, "\u22C3", "\\bigcup"); -defineSymbol(math, main, op, "\u222B", "\\int"); -defineSymbol(math, main, op, "\u222B", "\\intop"); -defineSymbol(math, main, op, "\u222C", "\\iint"); -defineSymbol(math, main, op, "\u222D", "\\iiint"); -defineSymbol(math, main, op, "\u220F", "\\prod"); +defineSymbol(math, main, op, "\u22c1", "\\bigvee"); +defineSymbol(math, main, op, "\u22c0", "\\bigwedge"); +defineSymbol(math, main, op, "\u2a04", "\\biguplus"); +defineSymbol(math, main, op, "\u22c2", "\\bigcap"); +defineSymbol(math, main, op, "\u22c3", "\\bigcup"); +defineSymbol(math, main, op, "\u222b", "\\int"); +defineSymbol(math, main, op, "\u222b", "\\intop"); +defineSymbol(math, main, op, "\u222c", "\\iint"); +defineSymbol(math, main, op, "\u222d", "\\iiint"); +defineSymbol(math, main, op, "\u220f", "\\prod"); defineSymbol(math, main, op, "\u2211", "\\sum"); -defineSymbol(math, main, op, "\u2A02", "\\bigotimes"); -defineSymbol(math, main, op, "\u2A01", "\\bigoplus"); -defineSymbol(math, main, op, "\u2A00", "\\bigodot"); -defineSymbol(math, main, op, "\u222E", "\\oint"); -defineSymbol(math, main, op, "\u222F", "\\oiint"); +defineSymbol(math, main, op, "\u2a02", "\\bigotimes"); +defineSymbol(math, main, op, "\u2a01", "\\bigoplus"); +defineSymbol(math, main, op, "\u2a00", "\\bigodot"); +defineSymbol(math, main, op, "\u222e", "\\oint"); +defineSymbol(math, main, op, "\u222f", "\\oiint"); defineSymbol(math, main, op, "\u2230", "\\oiiint"); -defineSymbol(math, main, op, "\u2A06", "\\bigsqcup"); -defineSymbol(math, main, op, "\u222B", "\\smallint"); +defineSymbol(math, main, op, "\u2a06", "\\bigsqcup"); +defineSymbol(math, main, op, "\u222b", "\\smallint"); defineSymbol(symbols_text, main, inner, "\u2026", "\\textellipsis"); defineSymbol(math, main, inner, "\u2026", "\\mathellipsis"); defineSymbol(symbols_text, main, inner, "\u2026", "\\ldots", true); defineSymbol(math, main, inner, "\u2026", "\\ldots", true); -defineSymbol(math, main, inner, "\u22EF", "\\@cdots", true); -defineSymbol(math, main, inner, "\u22F1", "\\ddots", true); -defineSymbol(math, main, textord, "\u22EE", "\\varvdots"); // \vdots is a macro +defineSymbol(math, main, inner, "\u22ef", "\\@cdots", true); +defineSymbol(math, main, inner, "\u22f1", "\\ddots", true); +defineSymbol(math, main, textord, "\u22ee", "\\varvdots"); // \vdots is a macro -defineSymbol(math, main, accent, "\u02CA", "\\acute"); -defineSymbol(math, main, accent, "\u02CB", "\\grave"); -defineSymbol(math, main, accent, "\xA8", "\\ddot"); -defineSymbol(math, main, accent, "~", "\\tilde"); -defineSymbol(math, main, accent, "\u02C9", "\\bar"); -defineSymbol(math, main, accent, "\u02D8", "\\breve"); -defineSymbol(math, main, accent, "\u02C7", "\\check"); -defineSymbol(math, main, accent, "^", "\\hat"); -defineSymbol(math, main, accent, "\u20D7", "\\vec"); -defineSymbol(math, main, accent, "\u02D9", "\\dot"); -defineSymbol(math, main, accent, "\u02DA", "\\mathring"); // \imath and \jmath should be invariant to \mathrm, \mathbf, etc., so use PUA +defineSymbol(math, main, accent, "\u02ca", "\\acute"); +defineSymbol(math, main, accent, "\u02cb", "\\grave"); +defineSymbol(math, main, accent, "\u00a8", "\\ddot"); +defineSymbol(math, main, accent, "\u007e", "\\tilde"); +defineSymbol(math, main, accent, "\u02c9", "\\bar"); +defineSymbol(math, main, accent, "\u02d8", "\\breve"); +defineSymbol(math, main, accent, "\u02c7", "\\check"); +defineSymbol(math, main, accent, "\u005e", "\\hat"); +defineSymbol(math, main, accent, "\u20d7", "\\vec"); +defineSymbol(math, main, accent, "\u02d9", "\\dot"); +defineSymbol(math, main, accent, "\u02da", "\\mathring"); // \imath and \jmath should be invariant to \mathrm, \mathbf, etc., so use PUA -defineSymbol(math, main, mathord, "\uE131", "\\@imath"); -defineSymbol(math, main, mathord, "\uE237", "\\@jmath"); +defineSymbol(math, main, mathord, "\ue131", "\\@imath"); +defineSymbol(math, main, mathord, "\ue237", "\\@jmath"); defineSymbol(math, main, textord, "\u0131", "\u0131"); defineSymbol(math, main, textord, "\u0237", "\u0237"); defineSymbol(symbols_text, main, textord, "\u0131", "\\i", true); defineSymbol(symbols_text, main, textord, "\u0237", "\\j", true); -defineSymbol(symbols_text, main, textord, "\xDF", "\\ss", true); -defineSymbol(symbols_text, main, textord, "\xE6", "\\ae", true); +defineSymbol(symbols_text, main, textord, "\u00df", "\\ss", true); +defineSymbol(symbols_text, main, textord, "\u00e6", "\\ae", true); defineSymbol(symbols_text, main, textord, "\u0153", "\\oe", true); -defineSymbol(symbols_text, main, textord, "\xF8", "\\o", true); -defineSymbol(symbols_text, main, textord, "\xC6", "\\AE", true); +defineSymbol(symbols_text, main, textord, "\u00f8", "\\o", true); +defineSymbol(symbols_text, main, textord, "\u00c6", "\\AE", true); defineSymbol(symbols_text, main, textord, "\u0152", "\\OE", true); -defineSymbol(symbols_text, main, textord, "\xD8", "\\O", true); -defineSymbol(symbols_text, main, accent, "\u02CA", "\\'"); // acute +defineSymbol(symbols_text, main, textord, "\u00d8", "\\O", true); +defineSymbol(symbols_text, main, accent, "\u02ca", "\\'"); // acute -defineSymbol(symbols_text, main, accent, "\u02CB", "\\`"); // grave +defineSymbol(symbols_text, main, accent, "\u02cb", "\\`"); // grave -defineSymbol(symbols_text, main, accent, "\u02C6", "\\^"); // circumflex +defineSymbol(symbols_text, main, accent, "\u02c6", "\\^"); // circumflex -defineSymbol(symbols_text, main, accent, "\u02DC", "\\~"); // tilde +defineSymbol(symbols_text, main, accent, "\u02dc", "\\~"); // tilde -defineSymbol(symbols_text, main, accent, "\u02C9", "\\="); // macron +defineSymbol(symbols_text, main, accent, "\u02c9", "\\="); // macron -defineSymbol(symbols_text, main, accent, "\u02D8", "\\u"); // breve +defineSymbol(symbols_text, main, accent, "\u02d8", "\\u"); // breve -defineSymbol(symbols_text, main, accent, "\u02D9", "\\."); // dot above +defineSymbol(symbols_text, main, accent, "\u02d9", "\\."); // dot above -defineSymbol(symbols_text, main, accent, "\xB8", "\\c"); // cedilla +defineSymbol(symbols_text, main, accent, "\u00b8", "\\c"); // cedilla -defineSymbol(symbols_text, main, accent, "\u02DA", "\\r"); // ring above +defineSymbol(symbols_text, main, accent, "\u02da", "\\r"); // ring above -defineSymbol(symbols_text, main, accent, "\u02C7", "\\v"); // caron +defineSymbol(symbols_text, main, accent, "\u02c7", "\\v"); // caron -defineSymbol(symbols_text, main, accent, "\xA8", '\\"'); // diaresis +defineSymbol(symbols_text, main, accent, "\u00a8", '\\"'); // diaresis -defineSymbol(symbols_text, main, accent, "\u02DD", "\\H"); // double acute +defineSymbol(symbols_text, main, accent, "\u02dd", "\\H"); // double acute -defineSymbol(symbols_text, main, accent, "\u25EF", "\\textcircled"); // \bigcirc glyph +defineSymbol(symbols_text, main, accent, "\u25ef", "\\textcircled"); // \bigcirc glyph // These ligatures are detected and created in Parser.js's `formLigatures`. -var ligatures = { +const ligatures = { "--": true, "---": true, "``": true, @@ -5120,49 +5096,47 @@ defineSymbol(symbols_text, main, textord, "\u2018", "`", true); defineSymbol(symbols_text, main, textord, "\u2018", "\\textquoteleft"); defineSymbol(symbols_text, main, textord, "\u2019", "'", true); defineSymbol(symbols_text, main, textord, "\u2019", "\\textquoteright"); -defineSymbol(symbols_text, main, textord, "\u201C", "``", true); -defineSymbol(symbols_text, main, textord, "\u201C", "\\textquotedblleft"); -defineSymbol(symbols_text, main, textord, "\u201D", "''", true); -defineSymbol(symbols_text, main, textord, "\u201D", "\\textquotedblright"); // \degree from gensymb package +defineSymbol(symbols_text, main, textord, "\u201c", "``", true); +defineSymbol(symbols_text, main, textord, "\u201c", "\\textquotedblleft"); +defineSymbol(symbols_text, main, textord, "\u201d", "''", true); +defineSymbol(symbols_text, main, textord, "\u201d", "\\textquotedblright"); // \degree from gensymb package -defineSymbol(math, main, textord, "\xB0", "\\degree", true); -defineSymbol(symbols_text, main, textord, "\xB0", "\\degree"); // \textdegree from inputenc package +defineSymbol(math, main, textord, "\u00b0", "\\degree", true); +defineSymbol(symbols_text, main, textord, "\u00b0", "\\degree"); // \textdegree from inputenc package -defineSymbol(symbols_text, main, textord, "\xB0", "\\textdegree", true); // TODO: In LaTeX, \pounds can generate a different character in text and math +defineSymbol(symbols_text, main, textord, "\u00b0", "\\textdegree", true); // TODO: In LaTeX, \pounds can generate a different character in text and math // mode, but among our fonts, only Main-Regular defines this character "163". -defineSymbol(math, main, textord, "\xA3", "\\pounds"); -defineSymbol(math, main, textord, "\xA3", "\\mathsterling", true); -defineSymbol(symbols_text, main, textord, "\xA3", "\\pounds"); -defineSymbol(symbols_text, main, textord, "\xA3", "\\textsterling", true); +defineSymbol(math, main, textord, "\u00a3", "\\pounds"); +defineSymbol(math, main, textord, "\u00a3", "\\mathsterling", true); +defineSymbol(symbols_text, main, textord, "\u00a3", "\\pounds"); +defineSymbol(symbols_text, main, textord, "\u00a3", "\\textsterling", true); defineSymbol(math, ams, textord, "\u2720", "\\maltese"); defineSymbol(symbols_text, ams, textord, "\u2720", "\\maltese"); // There are lots of symbols which are the same, so we add them in afterwards. // All of these are textords in math mode -var mathTextSymbols = "0123456789/@.\""; +const mathTextSymbols = "0123456789/@.\""; -for (var i = 0; i < mathTextSymbols.length; i++) { - var ch = mathTextSymbols.charAt(i); +for (let i = 0; i < mathTextSymbols.length; i++) { + const ch = mathTextSymbols.charAt(i); defineSymbol(math, main, textord, ch, ch); } // All of these are textords in text mode -var textSymbols = "0123456789!@*()-=+\";:?/.,"; +const textSymbols = "0123456789!@*()-=+\";:?/.,"; -for (var _i = 0; _i < textSymbols.length; _i++) { - var _ch = textSymbols.charAt(_i); - - defineSymbol(symbols_text, main, textord, _ch, _ch); +for (let i = 0; i < textSymbols.length; i++) { + const ch = textSymbols.charAt(i); + defineSymbol(symbols_text, main, textord, ch, ch); } // All of these are textords in text mode, and mathords in math mode -var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -for (var _i2 = 0; _i2 < letters.length; _i2++) { - var _ch2 = letters.charAt(_i2); - - defineSymbol(math, main, mathord, _ch2, _ch2); - defineSymbol(symbols_text, main, textord, _ch2, _ch2); +for (let i = 0; i < letters.length; i++) { + const ch = letters.charAt(i); + defineSymbol(math, main, mathord, ch, ch); + defineSymbol(symbols_text, main, textord, ch, ch); } // Blackboard bold and script letters in Unicode range @@ -5189,58 +5163,61 @@ defineSymbol(symbols_text, main, mathord, "h", "\u210E"); // The next loop loads // Some editors do not deal well with wide characters. So don't write the // string into this file. Instead, create the string from the surrogate pair. -var wideChar = ""; +let wideChar = ""; -for (var _i3 = 0; _i3 < letters.length; _i3++) { - var _ch3 = letters.charAt(_i3); // The hex numbers in the next line are a surrogate pair. +for (let i = 0; i < letters.length; i++) { + const ch = letters.charAt(i); // The hex numbers in the next line are a surrogate pair. // 0xD835 is the high surrogate for all letters in the range we support. // 0xDC00 is the low surrogate for bold A. + wideChar = String.fromCharCode(0xD835, 0xDC00 + i); // A-Z a-z bold - wideChar = String.fromCharCode(0xD835, 0xDC00 + _i3); // A-Z a-z bold + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDC34 + i); // A-Z a-z italic - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDC34 + _i3); // A-Z a-z italic + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDC68 + i); // A-Z a-z bold italic - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDC68 + _i3); // A-Z a-z bold italic + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDD04 + i); // A-Z a-z Fractur - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDD04 + _i3); // A-Z a-z Fractur + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDD6C + i); // A-Z a-z bold Fractur - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDDA0 + _i3); // A-Z a-z sans-serif + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDDA0 + i); // A-Z a-z sans-serif - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDDD4 + _i3); // A-Z a-z sans bold + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDDD4 + i); // A-Z a-z sans bold - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDE08 + _i3); // A-Z a-z sans italic + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDE08 + i); // A-Z a-z sans italic - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDE70 + _i3); // A-Z a-z monospace + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDE70 + i); // A-Z a-z monospace - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); - if (_i3 < 26) { + if (i < 26) { // KaTeX fonts have only capital letters for blackboard bold and script. // See exception for k below. - wideChar = String.fromCharCode(0xD835, 0xDD38 + _i3); // A-Z double struck + wideChar = String.fromCharCode(0xD835, 0xDD38 + i); // A-Z double struck - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDC9C + _i3); // A-Z script + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDC9C + i); // A-Z script - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(symbols_text, main, textord, _ch3, wideChar); + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); } // TODO: Add bold script when it is supported by a KaTeX font. } // "k" is the only double struck lower case letter in the KaTeX fonts. @@ -5251,38 +5228,36 @@ wideChar = String.fromCharCode(0xD835, 0xDD5C); // k double struck defineSymbol(math, main, mathord, "k", wideChar); defineSymbol(symbols_text, main, textord, "k", wideChar); // Next, some wide character numerals -for (var _i4 = 0; _i4 < 10; _i4++) { - var _ch4 = _i4.toString(); +for (let i = 0; i < 10; i++) { + const ch = i.toString(); + wideChar = String.fromCharCode(0xD835, 0xDFCE + i); // 0-9 bold - wideChar = String.fromCharCode(0xD835, 0xDFCE + _i4); // 0-9 bold + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDFE2 + i); // 0-9 sans serif - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(symbols_text, main, textord, _ch4, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDFE2 + _i4); // 0-9 sans serif + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDFEC + i); // 0-9 bold sans - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(symbols_text, main, textord, _ch4, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDFEC + _i4); // 0-9 bold sans + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDFF6 + i); // 0-9 monospace - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(symbols_text, main, textord, _ch4, wideChar); - wideChar = String.fromCharCode(0xD835, 0xDFF6 + _i4); // 0-9 monospace - - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(symbols_text, main, textord, _ch4, wideChar); + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(symbols_text, main, textord, ch, wideChar); } // We add these Latin-1 letters as symbols for backwards-compatibility, // but they are not actually in the font, nor are they supported by the // Unicode accent mechanism, so they fall back to Times font and look ugly. // TODO(edemaine): Fix this. -var extraLatin = "\xD0\xDE\xFE"; +const extraLatin = "\u00d0\u00de\u00fe"; -for (var _i5 = 0; _i5 < extraLatin.length; _i5++) { - var _ch5 = extraLatin.charAt(_i5); - - defineSymbol(math, main, mathord, _ch5, _ch5); - defineSymbol(symbols_text, main, textord, _ch5, _ch5); +for (let i = 0; i < extraLatin.length; i++) { + const ch = extraLatin.charAt(i); + defineSymbol(math, main, mathord, ch, ch); + defineSymbol(symbols_text, main, textord, ch, ch); } ;// CONCATENATED MODULE: ./src/wide-character.js /** @@ -5303,7 +5278,7 @@ for (var _i5 = 0; _i5 < extraLatin.length; _i5++) { * * The font name, so that KaTeX can get font metrics. */ -var wideLatinLetterData = [["mathbf", "textbf", "Main-Bold"], // A-Z bold upright +const wideLatinLetterData = [["mathbf", "textbf", "Main-Bold"], // A-Z bold upright ["mathbf", "textbf", "Main-Bold"], // a-z bold upright ["mathnormal", "textit", "Math-Italic"], // A-Z italic ["mathnormal", "textit", "Math-Italic"], // a-z italic @@ -5319,8 +5294,9 @@ var wideLatinLetterData = [["mathbf", "textbf", "Main-Bold"], // A-Z bold uprigh ["mathfrak", "textfrak", "Fraktur-Regular"], // a-z Fraktur ["mathbb", "textbb", "AMS-Regular"], // A-Z double-struck ["mathbb", "textbb", "AMS-Regular"], // k double-struck -["", "", ""], // A-Z bold Fraktur No font metrics -["", "", ""], // a-z bold Fraktur. No font. +// Note that we are using a bold font, but font metrics for regular Fraktur. +["mathboldfrak", "textboldfrak", "Fraktur-Regular"], // A-Z bold Fraktur +["mathboldfrak", "textboldfrak", "Fraktur-Regular"], // a-z bold Fraktur ["mathsf", "textsf", "SansSerif-Regular"], // A-Z sans-serif ["mathsf", "textsf", "SansSerif-Regular"], // a-z sans-serif ["mathboldsf", "textboldsf", "SansSerif-Bold"], // A-Z bold sans-serif @@ -5332,31 +5308,30 @@ var wideLatinLetterData = [["mathbf", "textbf", "Main-Bold"], // A-Z bold uprigh ["mathtt", "texttt", "Typewriter-Regular"], // A-Z monospace ["mathtt", "texttt", "Typewriter-Regular"] // a-z monospace ]; -var wideNumeralData = [["mathbf", "textbf", "Main-Bold"], // 0-9 bold +const wideNumeralData = [["mathbf", "textbf", "Main-Bold"], // 0-9 bold ["", "", ""], // 0-9 double-struck. No KaTeX font. ["mathsf", "textsf", "SansSerif-Regular"], // 0-9 sans-serif ["mathboldsf", "textboldsf", "SansSerif-Bold"], // 0-9 bold sans-serif ["mathtt", "texttt", "Typewriter-Regular"] // 0-9 monospace ]; -var wideCharacterFont = function wideCharacterFont(wideChar, mode) { +const wideCharacterFont = function (wideChar, mode) { // IE doesn't support codePointAt(). So work with the surrogate pair. - var H = wideChar.charCodeAt(0); // high surrogate + const H = wideChar.charCodeAt(0); // high surrogate - var L = wideChar.charCodeAt(1); // low surrogate + const L = wideChar.charCodeAt(1); // low surrogate - var codePoint = (H - 0xD800) * 0x400 + (L - 0xDC00) + 0x10000; - var j = mode === "math" ? 0 : 1; // column index for CSS class. + const codePoint = (H - 0xD800) * 0x400 + (L - 0xDC00) + 0x10000; + const j = mode === "math" ? 0 : 1; // column index for CSS class. if (0x1D400 <= codePoint && codePoint < 0x1D6A4) { // wideLatinLetterData contains exactly 26 chars on each row. // So we can calculate the relevant row. No traverse necessary. - var i = Math.floor((codePoint - 0x1D400) / 26); + const i = Math.floor((codePoint - 0x1D400) / 26); return [wideLatinLetterData[i][2], wideLatinLetterData[i][j]]; } else if (0x1D7CE <= codePoint && codePoint <= 0x1D7FF) { // Numerals, ten per row. - var _i = Math.floor((codePoint - 0x1D7CE) / 10); - - return [wideNumeralData[_i][2], wideNumeralData[_i][j]]; + const i = Math.floor((codePoint - 0x1D7CE) / 10); + return [wideNumeralData[i][2], wideNumeralData[i][j]]; } else if (codePoint === 0x1D6A5 || codePoint === 0x1D6A6) { // dotless i or j return [wideLatinLetterData[0][2], wideLatinLetterData[0][j]]; @@ -5386,7 +5361,7 @@ var wideCharacterFont = function wideCharacterFont(wideChar, mode) { * Looks up the given symbol in fontMetrics, after applying any symbol * replacements defined in symbol.js */ -var lookupSymbol = function lookupSymbol(value, // TODO(#963): Use a union type for this. +const lookupSymbol = function (value, // TODO(#963): Use a union type for this. fontName, mode) { // Replace the value with its replaced value from symbol.js if (src_symbols[mode][value] && src_symbols[mode][value].replace) { @@ -5410,14 +5385,14 @@ fontName, mode) { */ -var makeSymbol = function makeSymbol(value, fontName, mode, options, classes) { - var lookup = lookupSymbol(value, fontName, mode); - var metrics = lookup.metrics; +const makeSymbol = function (value, fontName, mode, options, classes) { + const lookup = lookupSymbol(value, fontName, mode); + const metrics = lookup.metrics; value = lookup.value; - var symbolNode; + let symbolNode; if (metrics) { - var italic = metrics.italic; + let italic = metrics.italic; if (mode === "text" || options && options.font === "mathit") { italic = 0; @@ -5437,7 +5412,7 @@ var makeSymbol = function makeSymbol(value, fontName, mode, options, classes) { symbolNode.classes.push("mtight"); } - var color = options.getColor(); + const color = options.getColor(); if (color) { symbolNode.style.color = color; @@ -5452,7 +5427,7 @@ var makeSymbol = function makeSymbol(value, fontName, mode, options, classes) { */ -var mathsym = function mathsym(value, mode, options, classes) { +const mathsym = function (value, mode, options, classes) { if (classes === void 0) { classes = []; } @@ -5480,7 +5455,7 @@ var mathsym = function mathsym(value, mode, options, classes) { */ -var boldsymbol = function boldsymbol(value, mode, options, classes, type) { +const boldsymbol = function (value, mode, options, classes, type) { if (type !== "textord" && lookupSymbol(value, "Math-BoldItalic", mode).metrics) { return { fontName: "Math-BoldItalic", @@ -5500,27 +5475,29 @@ var boldsymbol = function boldsymbol(value, mode, options, classes, type) { */ -var makeOrd = function makeOrd(group, options, type) { - var mode = group.mode; - var text = group.text; - var classes = ["mord"]; // Math mode or Old font (i.e. \rm) +const makeOrd = function (group, options, type) { + const mode = group.mode; + const text = group.text; + const classes = ["mord"]; // Math mode or Old font (i.e. \rm) - var isFont = mode === "math" || mode === "text" && options.font; - var fontOrFamily = isFont ? options.font : options.fontFamily; + const isFont = mode === "math" || mode === "text" && options.font; + const fontOrFamily = isFont ? options.font : options.fontFamily; + let wideFontName = ""; + let wideFontClass = ""; if (text.charCodeAt(0) === 0xD835) { - // surrogate pairs get special treatment - var _wideCharacterFont = wideCharacterFont(text, mode), - wideFontName = _wideCharacterFont[0], - wideFontClass = _wideCharacterFont[1]; + [wideFontName, wideFontClass] = wideCharacterFont(text, mode); + } + if (wideFontName.length > 0) { + // surrogate pairs get special treatment return makeSymbol(text, wideFontName, mode, options, classes.concat(wideFontClass)); } else if (fontOrFamily) { - var fontName; - var fontClasses; + let fontName; + let fontClasses; if (fontOrFamily === "boldsymbol") { - var fontData = boldsymbol(text, mode, options, classes, type); + const fontData = boldsymbol(text, mode, options, classes, type); fontName = fontData.fontName; fontClasses = [fontData.fontClass]; } else if (isFont) { @@ -5535,9 +5512,9 @@ var makeOrd = function makeOrd(group, options, type) { return makeSymbol(text, fontName, mode, options, classes.concat(fontClasses)); } else if (ligatures.hasOwnProperty(text) && fontName.slice(0, 10) === "Typewriter") { // Deconstruct ligatures in monospace fonts (\texttt, \tt). - var parts = []; + const parts = []; - for (var i = 0; i < text.length; i++) { + for (let i = 0; i < text.length; i++) { parts.push(makeSymbol(text[i], fontName, mode, options, classes.concat(fontClasses))); } @@ -5549,22 +5526,19 @@ var makeOrd = function makeOrd(group, options, type) { if (type === "mathord") { return makeSymbol(text, "Math-Italic", mode, options, classes.concat(["mathnormal"])); } else if (type === "textord") { - var font = src_symbols[mode][text] && src_symbols[mode][text].font; + const font = src_symbols[mode][text] && src_symbols[mode][text].font; if (font === "ams") { - var _fontName = retrieveTextFontName("amsrm", options.fontWeight, options.fontShape); - - return makeSymbol(text, _fontName, mode, options, classes.concat("amsrm", options.fontWeight, options.fontShape)); + const fontName = retrieveTextFontName("amsrm", options.fontWeight, options.fontShape); + return makeSymbol(text, fontName, mode, options, classes.concat("amsrm", options.fontWeight, options.fontShape)); } else if (font === "main" || !font) { - var _fontName2 = retrieveTextFontName("textrm", options.fontWeight, options.fontShape); - - return makeSymbol(text, _fontName2, mode, options, classes.concat(options.fontWeight, options.fontShape)); + const fontName = retrieveTextFontName("textrm", options.fontWeight, options.fontShape); + return makeSymbol(text, fontName, mode, options, classes.concat(options.fontWeight, options.fontShape)); } else { // fonts added by plugins - var _fontName3 = retrieveTextFontName(font, options.fontWeight, options.fontShape); // We add font name as a css class + const fontName = retrieveTextFontName(font, options.fontWeight, options.fontShape); // We add font name as a css class - - return makeSymbol(text, _fontName3, mode, options, classes.concat(_fontName3, options.fontWeight, options.fontShape)); + return makeSymbol(text, fontName, mode, options, classes.concat(fontName, options.fontWeight, options.fontShape)); } } else { throw new Error("unexpected type: " + type + " in makeOrd"); @@ -5576,7 +5550,7 @@ var makeOrd = function makeOrd(group, options, type) { */ -var canCombine = function canCombine(prev, next) { +const canCombine = (prev, next) => { if (createClass(prev.classes) !== createClass(next.classes) || prev.skew !== next.skew || prev.maxFontSize !== next.maxFontSize) { return false; } // If prev and next both are just "mbin"s or "mord"s we don't combine them @@ -5584,21 +5558,21 @@ var canCombine = function canCombine(prev, next) { if (prev.classes.length === 1) { - var cls = prev.classes[0]; + const cls = prev.classes[0]; if (cls === "mbin" || cls === "mord") { return false; } } - for (var style in prev.style) { + for (const style in prev.style) { if (prev.style.hasOwnProperty(style) && prev.style[style] !== next.style[style]) { return false; } } - for (var _style in next.style) { - if (next.style.hasOwnProperty(_style) && prev.style[_style] !== next.style[_style]) { + for (const style in next.style) { + if (next.style.hasOwnProperty(style) && prev.style[style] !== next.style[style]) { return false; } } @@ -5611,10 +5585,10 @@ var canCombine = function canCombine(prev, next) { */ -var tryCombineChars = function tryCombineChars(chars) { - for (var i = 0; i < chars.length - 1; i++) { - var prev = chars[i]; - var next = chars[i + 1]; +const tryCombineChars = chars => { + for (let i = 0; i < chars.length - 1; i++) { + const prev = chars[i]; + const next = chars[i + 1]; if (prev instanceof SymbolNode && next instanceof SymbolNode && canCombine(prev, next)) { prev.text += next.text; @@ -5637,13 +5611,13 @@ var tryCombineChars = function tryCombineChars(chars) { */ -var sizeElementFromChildren = function sizeElementFromChildren(elem) { - var height = 0; - var depth = 0; - var maxFontSize = 0; +const sizeElementFromChildren = function (elem) { + let height = 0; + let depth = 0; + let maxFontSize = 0; - for (var i = 0; i < elem.children.length; i++) { - var child = elem.children[i]; + for (let i = 0; i < elem.children.length; i++) { + const child = elem.children[i]; if (child.height > height) { height = child.height; @@ -5672,20 +5646,18 @@ var sizeElementFromChildren = function sizeElementFromChildren(elem) { */ -var makeSpan = function makeSpan(classes, children, options, style) { - var span = new Span(classes, children, options, style); +const makeSpan = function (classes, children, options, style) { + const span = new Span(classes, children, options, style); sizeElementFromChildren(span); return span; }; // SVG one is simpler -- doesn't require height, depth, max-font setting. // This is also a separate method for typesafety. -var makeSvgSpan = function makeSvgSpan(classes, children, options, style) { - return new Span(classes, children, options, style); -}; +const makeSvgSpan = (classes, children, options, style) => new Span(classes, children, options, style); -var makeLineSpan = function makeLineSpan(className, options, thickness) { - var line = makeSpan([className], [], options); +const makeLineSpan = function (className, options, thickness) { + const line = makeSpan([className], [], options); line.height = Math.max(thickness || options.fontMetrics().defaultRuleThickness, options.minRuleThickness); line.style.borderBottomWidth = makeEm(line.height); line.maxFontSize = 1.0; @@ -5697,8 +5669,8 @@ var makeLineSpan = function makeLineSpan(className, options, thickness) { */ -var makeAnchor = function makeAnchor(href, classes, children, options) { - var anchor = new Anchor(href, classes, children, options); +const makeAnchor = function (href, classes, children, options) { + const anchor = new Anchor(href, classes, children, options); sizeElementFromChildren(anchor); return anchor; }; @@ -5707,8 +5679,8 @@ var makeAnchor = function makeAnchor(href, classes, children, options) { */ -var makeFragment = function makeFragment(children) { - var fragment = new DocumentFragment(children); +const makeFragment = function (children) { + const fragment = new DocumentFragment(children); sizeElementFromChildren(fragment); return fragment; }; @@ -5718,7 +5690,7 @@ var makeFragment = function makeFragment(children) { */ -var wrapFragment = function wrapFragment(group, options) { +const wrapFragment = function (group, options) { if (group instanceof DocumentFragment) { return makeSpan([], [group], options); } @@ -5731,42 +5703,41 @@ var wrapFragment = function wrapFragment(group, options) { // // This helper function for makeVList makes it easier to enforce type safety by // allowing early exits (returns) in the logic. -var getVListChildrenAndDepth = function getVListChildrenAndDepth(params) { +const getVListChildrenAndDepth = function (params) { if (params.positionType === "individualShift") { - var oldChildren = params.children; - var children = [oldChildren[0]]; // Add in kerns to the list of params.children to get each element to be + const oldChildren = params.children; + const children = [oldChildren[0]]; // Add in kerns to the list of params.children to get each element to be // shifted to the correct specified shift - var _depth = -oldChildren[0].shift - oldChildren[0].elem.depth; + const depth = -oldChildren[0].shift - oldChildren[0].elem.depth; + let currPos = depth; - var currPos = _depth; - - for (var i = 1; i < oldChildren.length; i++) { - var diff = -oldChildren[i].shift - currPos - oldChildren[i].elem.depth; - var size = diff - (oldChildren[i - 1].elem.height + oldChildren[i - 1].elem.depth); + for (let i = 1; i < oldChildren.length; i++) { + const diff = -oldChildren[i].shift - currPos - oldChildren[i].elem.depth; + const size = diff - (oldChildren[i - 1].elem.height + oldChildren[i - 1].elem.depth); currPos = currPos + diff; children.push({ type: "kern", - size: size + size }); children.push(oldChildren[i]); } return { - children: children, - depth: _depth + children, + depth }; } - var depth; + let depth; if (params.positionType === "top") { // We always start at the bottom, so calculate the bottom by adding up // all the sizes - var bottom = params.positionData; + let bottom = params.positionData; - for (var _i = 0; _i < params.children.length; _i++) { - var child = params.children[_i]; + for (let i = 0; i < params.children.length; i++) { + const child = params.children[i]; bottom -= child.type === "kern" ? child.size : child.elem.height + child.elem.depth; } @@ -5774,7 +5745,7 @@ var getVListChildrenAndDepth = function getVListChildrenAndDepth(params) { } else if (params.positionType === "bottom") { depth = -params.positionData; } else { - var firstChild = params.children[0]; + const firstChild = params.children[0]; if (firstChild.type !== "elem") { throw new Error('First child must have type "elem".'); @@ -5791,7 +5762,7 @@ var getVListChildrenAndDepth = function getVListChildrenAndDepth(params) { return { children: params.children, - depth: depth + depth }; }; /** @@ -5802,10 +5773,11 @@ var getVListChildrenAndDepth = function getVListChildrenAndDepth(params) { */ -var makeVList = function makeVList(params, options) { - var _getVListChildrenAndD = getVListChildrenAndDepth(params), - children = _getVListChildrenAndD.children, - depth = _getVListChildrenAndD.depth; // Create a strut that is taller than any list item. The strut is added to +const makeVList = function (params, options) { + const { + children, + depth + } = getVListChildrenAndDepth(params); // Create a strut that is taller than any list item. The strut is added to // each item, where it will determine the item's baseline. Since it has // `overflow:hidden`, the strut's top edge will sit on the item's line box's // top edge and the strut's bottom edge will sit on the item's baseline, @@ -5813,49 +5785,48 @@ var makeVList = function makeVList(params, options) { // be positioned precisely without worrying about font ascent and // line-height. + let pstrutSize = 0; - var pstrutSize = 0; - - for (var i = 0; i < children.length; i++) { - var child = children[i]; + for (let i = 0; i < children.length; i++) { + const child = children[i]; if (child.type === "elem") { - var elem = child.elem; + const elem = child.elem; pstrutSize = Math.max(pstrutSize, elem.maxFontSize, elem.height); } } pstrutSize += 2; - var pstrut = makeSpan(["pstrut"], []); + const pstrut = makeSpan(["pstrut"], []); pstrut.style.height = makeEm(pstrutSize); // Create a new list of actual children at the correct offsets - var realChildren = []; - var minPos = depth; - var maxPos = depth; - var currPos = depth; + const realChildren = []; + let minPos = depth; + let maxPos = depth; + let currPos = depth; - for (var _i2 = 0; _i2 < children.length; _i2++) { - var _child = children[_i2]; + for (let i = 0; i < children.length; i++) { + const child = children[i]; - if (_child.type === "kern") { - currPos += _child.size; + if (child.type === "kern") { + currPos += child.size; } else { - var _elem = _child.elem; - var classes = _child.wrapperClasses || []; - var style = _child.wrapperStyle || {}; - var childWrap = makeSpan(classes, [pstrut, _elem], undefined, style); - childWrap.style.top = makeEm(-pstrutSize - currPos - _elem.depth); + const elem = child.elem; + const classes = child.wrapperClasses || []; + const style = child.wrapperStyle || {}; + const childWrap = makeSpan(classes, [pstrut, elem], undefined, style); + childWrap.style.top = makeEm(-pstrutSize - currPos - elem.depth); - if (_child.marginLeft) { - childWrap.style.marginLeft = _child.marginLeft; + if (child.marginLeft) { + childWrap.style.marginLeft = child.marginLeft; } - if (_child.marginRight) { - childWrap.style.marginRight = _child.marginRight; + if (child.marginRight) { + childWrap.style.marginRight = child.marginRight; } realChildren.push(childWrap); - currPos += _elem.height + _elem.depth; + currPos += elem.height + elem.depth; } minPos = Math.min(minPos, currPos); @@ -5865,10 +5836,10 @@ var makeVList = function makeVList(params, options) { // without overly expanding the containing line-box. - var vlist = makeSpan(["vlist"], realChildren); + const vlist = makeSpan(["vlist"], realChildren); vlist.style.height = makeEm(maxPos); // A second row is used if necessary to represent the vlist's depth. - var rows; + let rows; if (minPos < 0) { // We will define depth in an empty span with display: table-cell. @@ -5876,18 +5847,18 @@ var makeVList = function makeVList(params, options) { // contenteditable mode only, treats that span as if it contains some // text content. And that min-height over-rides our desired height. // So we put another empty span inside the depth strut span. - var emptySpan = makeSpan([], []); - var depthStrut = makeSpan(["vlist"], [emptySpan]); + const emptySpan = makeSpan([], []); + const depthStrut = makeSpan(["vlist"], [emptySpan]); depthStrut.style.height = makeEm(-minPos); // Safari wants the first row to have inline content; otherwise it // puts the bottom of the *second* row on the baseline. - var topStrut = makeSpan(["vlist-s"], [new SymbolNode("\u200B")]); + const topStrut = makeSpan(["vlist-s"], [new SymbolNode("\u200b")]); rows = [makeSpan(["vlist-r"], [vlist, topStrut]), makeSpan(["vlist-r"], [depthStrut])]; } else { rows = [makeSpan(["vlist-r"], [vlist])]; } - var vtable = makeSpan(["vlist-t"], rows); + const vtable = makeSpan(["vlist-t"], rows); if (rows.length === 2) { vtable.classes.push("vlist-t2"); @@ -5901,17 +5872,17 @@ var makeVList = function makeVList(params, options) { // static space between elements in a horizontal layout. -var makeGlue = function makeGlue(measurement, options) { +const makeGlue = (measurement, options) => { // Make an empty span for the space - var rule = makeSpan(["mspace"], [], options); - var size = calculateSize(measurement, options); + const rule = makeSpan(["mspace"], [], options); + const size = calculateSize(measurement, options); rule.style.marginRight = makeEm(size); return rule; }; // Takes font options, and returns the appropriate fontLookup name -var retrieveTextFontName = function retrieveTextFontName(fontFamily, fontWeight, fontShape) { - var baseFontName = ""; +const retrieveTextFontName = function (fontFamily, fontWeight, fontShape) { + let baseFontName = ""; switch (fontFamily) { case "amsrm": @@ -5935,7 +5906,7 @@ var retrieveTextFontName = function retrieveTextFontName(fontFamily, fontWeight, // use fonts added by a plugin } - var fontStylesName; + let fontStylesName; if (fontWeight === "textbf" && fontShape === "textit") { fontStylesName = "BoldItalic"; @@ -5957,7 +5928,7 @@ var retrieveTextFontName = function retrieveTextFontName(fontFamily, fontWeight, // A map between tex font commands an MathML mathvariant attribute values -var fontMap = { +const fontMap = { // styles "mathbf": { variant: "bold", @@ -6008,7 +5979,7 @@ var fontMap = { fontName: "Typewriter-Regular" } }; -var svgData = { +const svgData = { // path, width, height vec: ["vec", 0.471, 0.714], // values from the font glyph @@ -6019,14 +5990,11 @@ var svgData = { oiiintSize2: ["oiiintSize2", 1.98, 0.659] }; -var staticSvg = function staticSvg(value, options) { +const staticSvg = function (value, options) { // Create a span with inline SVG for the element. - var _svgData$value = svgData[value], - pathName = _svgData$value[0], - width = _svgData$value[1], - height = _svgData$value[2]; - var path = new PathNode(pathName); - var svgNode = new SvgNode([path], { + const [pathName, width, height] = svgData[value]; + const path = new PathNode(pathName); + const svgNode = new SvgNode([path], { "width": makeEm(width), "height": makeEm(height), // Override CSS rule `.katex svg { width: 100% }` @@ -6034,7 +6002,7 @@ var staticSvg = function staticSvg(value, options) { "viewBox": "0 0 " + 1000 * width + " " + 1000 * height, "preserveAspectRatio": "xMinYMin" }); - var span = makeSvgSpan(["overlay"], [svgNode], options); + const span = makeSvgSpan(["overlay"], [svgNode], options); span.height = height; span.style.height = makeEm(height); span.style.width = makeEm(width); @@ -6042,35 +6010,35 @@ var staticSvg = function staticSvg(value, options) { }; /* harmony default export */ var buildCommon = ({ - fontMap: fontMap, - makeSymbol: makeSymbol, - mathsym: mathsym, - makeSpan: makeSpan, - makeSvgSpan: makeSvgSpan, - makeLineSpan: makeLineSpan, - makeAnchor: makeAnchor, - makeFragment: makeFragment, - wrapFragment: wrapFragment, - makeVList: makeVList, - makeOrd: makeOrd, - makeGlue: makeGlue, - staticSvg: staticSvg, - svgData: svgData, - tryCombineChars: tryCombineChars + fontMap, + makeSymbol, + mathsym, + makeSpan, + makeSvgSpan, + makeLineSpan, + makeAnchor, + makeFragment, + wrapFragment, + makeVList, + makeOrd, + makeGlue, + staticSvg, + svgData, + tryCombineChars }); ;// CONCATENATED MODULE: ./src/spacingData.js /** * Describes spaces between different classes of atoms. */ -var thinspace = { +const thinspace = { number: 3, unit: "mu" }; -var mediumspace = { +const mediumspace = { number: 4, unit: "mu" }; -var thickspace = { +const thickspace = { number: 5, unit: "mu" }; // Making the type below exact with all optional fields doesn't work due to @@ -6080,7 +6048,7 @@ var thickspace = { // above. // Spacing relationships for display and text styles -var spacings = { +const spacings = { mord: { mop: thinspace, mbin: mediumspace, @@ -6132,7 +6100,7 @@ var spacings = { } }; // Spacing relationships for script and scriptscript styles -var tightSpacings = { +const tightSpacings = { mord: { mop: thinspace }, @@ -6172,29 +6140,31 @@ var tightSpacings = { * `functions.js` just exports this same dictionary again and makes it public. * `Parser.js` requires this dictionary. */ -var _functions = {}; +const _functions = {}; /** * All HTML builders. Should be only used in the `define*` and the `build*ML` * functions. */ -var _htmlGroupBuilders = {}; +const _htmlGroupBuilders = {}; /** * All MathML builders. Should be only used in the `define*` and the `build*ML` * functions. */ -var _mathmlGroupBuilders = {}; +const _mathmlGroupBuilders = {}; function defineFunction(_ref) { - var type = _ref.type, - names = _ref.names, - props = _ref.props, - handler = _ref.handler, - htmlBuilder = _ref.htmlBuilder, - mathmlBuilder = _ref.mathmlBuilder; + let { + type, + names, + props, + handler, + htmlBuilder, + mathmlBuilder + } = _ref; // Set default values of functions - var data = { - type: type, + const data = { + type, numArgs: props.numArgs, argTypes: props.argTypes, allowedInArgument: !!props.allowedInArgument, @@ -6206,7 +6176,7 @@ function defineFunction(_ref) { handler: handler }; - for (var i = 0; i < names.length; ++i) { + for (let i = 0; i < names.length; ++i) { _functions[names[i]] = data; } @@ -6227,28 +6197,32 @@ function defineFunction(_ref) { */ function defineFunctionBuilders(_ref2) { - var type = _ref2.type, - htmlBuilder = _ref2.htmlBuilder, - mathmlBuilder = _ref2.mathmlBuilder; + let { + type, + htmlBuilder, + mathmlBuilder + } = _ref2; defineFunction({ - type: type, + type, names: [], props: { numArgs: 0 }, - handler: function handler() { + + handler() { throw new Error('Should never be called.'); }, - htmlBuilder: htmlBuilder, - mathmlBuilder: mathmlBuilder + + htmlBuilder, + mathmlBuilder }); } -var normalizeArgument = function normalizeArgument(arg) { +const normalizeArgument = function (arg) { return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg; }; // Since the corresponding buildHTML/buildMathML function expects a // list of elements, we normalize for different kinds of arguments -var ordargument = function ordargument(arg) { +const ordargument = function (arg) { return arg.type === "ordgroup" ? arg.body : [arg]; }; ;// CONCATENATED MODULE: ./src/buildHTML.js @@ -6267,19 +6241,19 @@ var ordargument = function ordargument(arg) { -var buildHTML_makeSpan = buildCommon.makeSpan; // Binary atoms (first class `mbin`) change into ordinary atoms (`mord`) +const buildHTML_makeSpan = buildCommon.makeSpan; // Binary atoms (first class `mbin`) change into ordinary atoms (`mord`) // depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6, // and the text before Rule 19. -var binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"]; -var binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"]; -var styleMap = { +const binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"]; +const binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"]; +const styleMap = { "display": src_Style.DISPLAY, "text": src_Style.TEXT, "script": src_Style.SCRIPT, "scriptscript": src_Style.SCRIPTSCRIPT }; -var DomEnum = { +const DomEnum = { mord: "mord", mop: "mop", mbin: "mbin", @@ -6298,20 +6272,20 @@ var DomEnum = { * a partial group (e.g. one created by \color). `surrounding` is an array * consisting type of nodes that will be added to the left and right. */ -var buildExpression = function buildExpression(expression, options, isRealGroup, surrounding) { +const buildExpression = function (expression, options, isRealGroup, surrounding) { if (surrounding === void 0) { surrounding = [null, null]; } // Parse expressions into `groups`. - var groups = []; + const groups = []; - for (var i = 0; i < expression.length; i++) { - var output = buildGroup(expression[i], options); + for (let i = 0; i < expression.length; i++) { + const output = buildGroup(expression[i], options); if (output instanceof DocumentFragment) { - var children = output.children; - groups.push.apply(groups, children); + const children = output.children; + groups.push(...children); } else { groups.push(output); } @@ -6325,10 +6299,10 @@ var buildExpression = function buildExpression(expression, options, isRealGroup, return groups; } - var glueOptions = options; + let glueOptions = options; if (expression.length === 1) { - var node = expression[0]; + const node = expression[0]; if (node.type === "sizing") { glueOptions = options.havingSize(node.size); @@ -6340,17 +6314,17 @@ var buildExpression = function buildExpression(expression, options, isRealGroup, // or "rightmost", respectively, is used to indicate it. - var dummyPrev = buildHTML_makeSpan([surrounding[0] || "leftmost"], [], options); - var dummyNext = buildHTML_makeSpan([surrounding[1] || "rightmost"], [], options); // TODO: These code assumes that a node's math class is the first element + const dummyPrev = buildHTML_makeSpan([surrounding[0] || "leftmost"], [], options); + const dummyNext = buildHTML_makeSpan([surrounding[1] || "rightmost"], [], options); // TODO: These code assumes that a node's math class is the first element // of its `classes` array. A later cleanup should ensure this, for // instance by changing the signature of `makeSpan`. // Before determining what spaces to insert, perform bin cancellation. // Binary operators change to ordinary symbols in some contexts. - var isRoot = isRealGroup === "root"; - traverseNonSpaceNodes(groups, function (node, prev) { - var prevType = prev.classes[0]; - var type = node.classes[0]; + const isRoot = isRealGroup === "root"; + traverseNonSpaceNodes(groups, (node, prev) => { + const prevType = prev.classes[0]; + const type = node.classes[0]; if (prevType === "mbin" && utils.contains(binRightCanceller, type)) { prev.classes[0] = "mord"; @@ -6360,11 +6334,11 @@ var buildExpression = function buildExpression(expression, options, isRealGroup, }, { node: dummyPrev }, dummyNext, isRoot); - traverseNonSpaceNodes(groups, function (node, prev) { - var prevType = getTypeOfDomTree(prev); - var type = getTypeOfDomTree(node); // 'mtight' indicates that the node is script or scriptscript style. + traverseNonSpaceNodes(groups, (node, prev) => { + const prevType = getTypeOfDomTree(prev); + const type = getTypeOfDomTree(node); // 'mtight' indicates that the node is script or scriptscript style. - var space = prevType && type ? node.hasClass("mtight") ? tightSpacings[prevType][type] : spacings[prevType][type] : null; + const space = prevType && type ? node.hasClass("mtight") ? tightSpacings[prevType][type] : spacings[prevType][type] : null; if (space) { // Insert glue (spacing) after the `prev`. @@ -6380,17 +6354,17 @@ var buildExpression = function buildExpression(expression, options, isRealGroup, // function to insert after it. `next` is a node that will be added to the right. // Used for bin cancellation and inserting spacings. -var traverseNonSpaceNodes = function traverseNonSpaceNodes(nodes, callback, prev, next, isRoot) { +const traverseNonSpaceNodes = function (nodes, callback, prev, next, isRoot) { if (next) { // temporarily append the right node, if exists nodes.push(next); } - var i = 0; + let i = 0; for (; i < nodes.length; i++) { - var node = nodes[i]; - var partialGroup = checkPartialGroup(node); + const node = nodes[i]; + const partialGroup = checkPartialGroup(node); if (partialGroup) { // Recursive DFS @@ -6401,10 +6375,10 @@ var traverseNonSpaceNodes = function traverseNonSpaceNodes(nodes, callback, prev // spacing should go between atoms of different classes - var nonspace = !node.hasClass("mspace"); + const nonspace = !node.hasClass("mspace"); if (nonspace) { - var result = callback(node, prev.node); + const result = callback(node, prev.node); if (result) { if (prev.insertAfter) { @@ -6423,12 +6397,10 @@ var traverseNonSpaceNodes = function traverseNonSpaceNodes(nodes, callback, prev prev.node = buildHTML_makeSpan(["leftmost"]); // treat like beginning of line } - prev.insertAfter = function (index) { - return function (n) { - nodes.splice(index + 1, 0, n); - i++; - }; - }(i); + prev.insertAfter = (index => n => { + nodes.splice(index + 1, 0, n); + i++; + })(i); } if (next) { @@ -6437,7 +6409,7 @@ var traverseNonSpaceNodes = function traverseNonSpaceNodes(nodes, callback, prev }; // Check if given node is a partial group, i.e., does not affect spacing around. -var checkPartialGroup = function checkPartialGroup(node) { +const checkPartialGroup = function (node) { if (node instanceof DocumentFragment || node instanceof Anchor || node instanceof Span && node.hasClass("enclosing")) { return node; } @@ -6446,11 +6418,11 @@ var checkPartialGroup = function checkPartialGroup(node) { }; // Return the outermost node of a domTree. -var getOutermostNode = function getOutermostNode(node, side) { - var partialGroup = checkPartialGroup(node); +const getOutermostNode = function (node, side) { + const partialGroup = checkPartialGroup(node); if (partialGroup) { - var children = partialGroup.children; + const children = partialGroup.children; if (children.length) { if (side === "right") { @@ -6466,7 +6438,7 @@ var getOutermostNode = function getOutermostNode(node, side) { // If `side` is given, it will get the type of the outermost node at given side. -var getTypeOfDomTree = function getTypeOfDomTree(node, side) { +const getTypeOfDomTree = function (node, side) { if (!node) { return null; } @@ -6479,8 +6451,8 @@ var getTypeOfDomTree = function getTypeOfDomTree(node, side) { return DomEnum[node.classes[0]] || null; }; -var makeNullDelimiter = function makeNullDelimiter(options, classes) { - var moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses()); +const makeNullDelimiter = function (options, classes) { + const moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses()); return buildHTML_makeSpan(classes.concat(moreClasses)); }; /** @@ -6489,7 +6461,7 @@ var makeNullDelimiter = function makeNullDelimiter(options, classes) { * between parents and children. */ -var buildGroup = function buildGroup(group, options, baseOptions) { +const buildGroup = function (group, options, baseOptions) { if (!group) { return buildHTML_makeSpan(); } @@ -6497,12 +6469,12 @@ var buildGroup = function buildGroup(group, options, baseOptions) { if (_htmlGroupBuilders[group.type]) { // Call the groupBuilders function // $FlowFixMe - var groupNode = _htmlGroupBuilders[group.type](group, options); // If the size changed between the parent and the current group, account + let groupNode = _htmlGroupBuilders[group.type](group, options); // If the size changed between the parent and the current group, account // for that size difference. if (baseOptions && options.size !== baseOptions.size) { groupNode = buildHTML_makeSpan(options.sizingClasses(baseOptions), [groupNode], options); - var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; + const multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; groupNode.height *= multiplier; groupNode.depth *= multiplier; } @@ -6521,11 +6493,11 @@ var buildGroup = function buildGroup(group, options, baseOptions) { function buildHTMLUnbreakable(children, options) { // Compute height and depth of this chunk. - var body = buildHTML_makeSpan(["base"], children, options); // Add strut, which ensures that the top of the HTML element falls at + const body = buildHTML_makeSpan(["base"], children, options); // Add strut, which ensures that the top of the HTML element falls at // the height of the expression, and the bottom of the HTML element // falls at the depth of the expression. - var strut = buildHTML_makeSpan(["strut"]); + const strut = buildHTML_makeSpan(["strut"]); strut.style.height = makeEm(body.height + body.depth); if (body.depth) { @@ -6543,7 +6515,7 @@ function buildHTMLUnbreakable(children, options) { function buildHTML(tree, options) { // Strip off outer tag wrapper for processing below. - var tag = null; + let tag = null; if (tree.length === 1 && tree[0].type === "tag") { tag = tree[0].tag; @@ -6551,30 +6523,30 @@ function buildHTML(tree, options) { } // Build the expression contained in the tree - var expression = buildExpression(tree, options, "root"); - var eqnNum; + const expression = buildExpression(tree, options, "root"); + let eqnNum; if (expression.length === 2 && expression[1].hasClass("tag")) { // An environment with automatic equation numbers, e.g. {gather}. eqnNum = expression.pop(); } - var children = []; // Create one base node for each chunk between potential line breaks. + const children = []; // Create one base node for each chunk between potential line breaks. // The TeXBook [p.173] says "A formula will be broken only after a // relation symbol like $=$ or $<$ or $\rightarrow$, or after a binary // operation symbol like $+$ or $-$ or $\times$, where the relation or // binary operation is on the ``outer level'' of the formula (i.e., not // enclosed in {...} and not part of an \over construction)." - var parts = []; + let parts = []; - for (var i = 0; i < expression.length; i++) { + for (let i = 0; i < expression.length; i++) { parts.push(expression[i]); if (expression[i].hasClass("mbin") || expression[i].hasClass("mrel") || expression[i].hasClass("allowbreak")) { // Put any post-operator glue on same line as operator. // Watch for \nobreak along the way, and stop at \newline. - var nobreak = false; + let nobreak = false; while (i < expression.length - 1 && expression[i + 1].hasClass("mspace") && !expression[i + 1].hasClass("newline")) { i++; @@ -6609,7 +6581,7 @@ function buildHTML(tree, options) { } // Now, if there was a tag, build it too and append it as a final child. - var tagChild; + let tagChild; if (tag) { tagChild = buildHTMLUnbreakable(buildExpression(tag, options, true)); @@ -6619,12 +6591,12 @@ function buildHTML(tree, options) { children.push(eqnNum); } - var htmlNode = buildHTML_makeSpan(["katex-html"], children); + const htmlNode = buildHTML_makeSpan(["katex-html"], children); htmlNode.setAttribute("aria-hidden", "true"); // Adjust the strut of the tag to be the maximum height of all children // (the height of the enclosing htmlNode) for proper vertical alignment. if (tagChild) { - var strut = tagChild.children[0]; + const strut = tagChild.children[0]; strut.style.height = makeEm(htmlNode.height + htmlNode.depth); if (htmlNode.depth) { @@ -6657,8 +6629,8 @@ function newDocumentFragment(children) { * `"mspace"`, corresponding to `` and `` tags). */ -var MathNode = /*#__PURE__*/function () { - function MathNode(type, children, classes) { +class MathNode { + constructor(type, children, classes) { this.type = void 0; this.attributes = void 0; this.children = void 0; @@ -6674,28 +6646,26 @@ var MathNode = /*#__PURE__*/function () { */ - var _proto = MathNode.prototype; - - _proto.setAttribute = function setAttribute(name, value) { + setAttribute(name, value) { this.attributes[name] = value; } /** * Gets an attribute on a MathML node. */ - ; - _proto.getAttribute = function getAttribute(name) { + + getAttribute(name) { return this.attributes[name]; } /** * Converts the math node into a MathML-namespaced DOM element. */ - ; - _proto.toNode = function toNode() { - var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type); - for (var attr in this.attributes) { + toNode() { + const node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type); + + for (const attr in this.attributes) { if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { node.setAttribute(attr, this.attributes[attr]); } @@ -6705,7 +6675,7 @@ var MathNode = /*#__PURE__*/function () { node.className = createClass(this.classes); } - for (var i = 0; i < this.children.length; i++) { + for (let i = 0; i < this.children.length; i++) { node.appendChild(this.children[i].toNode()); } @@ -6714,12 +6684,12 @@ var MathNode = /*#__PURE__*/function () { /** * Converts the math node into an HTML markup string. */ - ; - _proto.toMarkup = function toMarkup() { - var markup = "<" + this.type; // Add the attributes - for (var attr in this.attributes) { + toMarkup() { + let markup = "<" + this.type; // Add the attributes + + for (const attr in this.attributes) { if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { markup += " " + attr + "=\""; markup += utils.escape(this.attributes[attr]); @@ -6733,7 +6703,7 @@ var MathNode = /*#__PURE__*/function () { markup += ">"; - for (var i = 0; i < this.children.length; i++) { + for (let i = 0; i < this.children.length; i++) { markup += this.children[i].toMarkup(); } @@ -6743,22 +6713,19 @@ var MathNode = /*#__PURE__*/function () { /** * Converts the math node into a string, similar to innerText, but escaped. */ - ; - _proto.toText = function toText() { - return this.children.map(function (child) { - return child.toText(); - }).join(""); - }; - return MathNode; -}(); + toText() { + return this.children.map(child => child.toText()).join(""); + } + +} /** * This node represents a piece of text. */ -var TextNode = /*#__PURE__*/function () { - function TextNode(text) { +class TextNode { + constructor(text) { this.text = void 0; this.text = text; } @@ -6767,42 +6734,39 @@ var TextNode = /*#__PURE__*/function () { */ - var _proto2 = TextNode.prototype; - - _proto2.toNode = function toNode() { + toNode() { return document.createTextNode(this.text); } /** * Converts the text node into escaped HTML markup * (representing the text itself). */ - ; - _proto2.toMarkup = function toMarkup() { + + toMarkup() { return utils.escape(this.toText()); } /** * Converts the text node into a string * (representing the text itself). */ - ; - _proto2.toText = function toText() { + + toText() { return this.text; - }; + } - return TextNode; -}(); +} /** * This node represents a space, but may render as or as text, * depending on the width. */ -var SpaceNode = /*#__PURE__*/function () { +class SpaceNode { /** * Create a Space node with width given in CSS ems. */ - function SpaceNode(width) { + constructor(width) { this.width = void 0; this.character = void 0; this.width = width; // See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html @@ -6811,19 +6775,19 @@ var SpaceNode = /*#__PURE__*/function () { // make the latter via document.createTextNode. if (width >= 0.05555 && width <= 0.05556) { - this.character = "\u200A"; //   + this.character = "\u200a"; //   } else if (width >= 0.1666 && width <= 0.1667) { this.character = "\u2009"; //   } else if (width >= 0.2222 && width <= 0.2223) { this.character = "\u2005"; //   } else if (width >= 0.2777 && width <= 0.2778) { - this.character = "\u2005\u200A"; //    + this.character = "\u2005\u200a"; //    } else if (width >= -0.05556 && width <= -0.05555) { - this.character = "\u200A\u2063"; // ​ + this.character = "\u200a\u2063"; // ​ } else if (width >= -0.1667 && width <= -0.1666) { this.character = "\u2009\u2063"; // ​ } else if (width >= -0.2223 && width <= -0.2222) { - this.character = "\u205F\u2063"; // ​ + this.character = "\u205f\u2063"; // ​ } else if (width >= -0.2778 && width <= -0.2777) { this.character = "\u2005\u2063"; // ​ } else { @@ -6835,13 +6799,11 @@ var SpaceNode = /*#__PURE__*/function () { */ - var _proto3 = SpaceNode.prototype; - - _proto3.toNode = function toNode() { + toNode() { if (this.character) { return document.createTextNode(this.character); } else { - var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace"); + const node = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace"); node.setAttribute("width", makeEm(this.width)); return node; } @@ -6849,9 +6811,9 @@ var SpaceNode = /*#__PURE__*/function () { /** * Converts the math node into an HTML markup string. */ - ; - _proto3.toMarkup = function toMarkup() { + + toMarkup() { if (this.character) { return "" + this.character + ""; } else { @@ -6861,24 +6823,23 @@ var SpaceNode = /*#__PURE__*/function () { /** * Converts the math node into a string, similar to innerText. */ - ; - _proto3.toText = function toText() { + + toText() { if (this.character) { return this.character; } else { return " "; } - }; + } - return SpaceNode; -}(); +} /* harmony default export */ var mathMLTree = ({ - MathNode: MathNode, - TextNode: TextNode, - SpaceNode: SpaceNode, - newDocumentFragment: newDocumentFragment + MathNode, + TextNode, + SpaceNode, + newDocumentFragment }); ;// CONCATENATED MODULE: ./src/buildMathML.js /** @@ -6899,7 +6860,7 @@ var SpaceNode = /*#__PURE__*/function () { * Takes a symbol and converts it into a MathML text node after performing * optional replacement from symbols.js. */ -var makeText = function makeText(text, mode, options) { +const makeText = function (text, mode, options) { if (src_symbols[mode][text] && src_symbols[mode][text].replace && text.charCodeAt(0) !== 0xD835 && !(ligatures.hasOwnProperty(text) && options && (options.fontFamily && options.fontFamily.slice(4, 6) === "tt" || options.font && options.font.slice(4, 6) === "tt"))) { text = src_symbols[mode][text].replace; } @@ -6911,7 +6872,7 @@ var makeText = function makeText(text, mode, options) { * unless the array has length 1. Always returns a single node. */ -var makeRow = function makeRow(body) { +const makeRow = function (body) { if (body.length === 1) { return body[0]; } else { @@ -6922,7 +6883,7 @@ var makeRow = function makeRow(body) { * Returns the math variant as a string or null if none is required. */ -var getVariant = function getVariant(group, options) { +const getVariant = function (group, options) { // Handle \text... font specifiers as best we can. // MathML has a limited list of allowable mathvariant specifiers; see // https://www.w3.org/TR/MathML3/chapter3.html#presm.commatt @@ -6946,13 +6907,13 @@ var getVariant = function getVariant(group, options) { return "bold"; } - var font = options.font; + const font = options.font; if (!font || font === "mathnormal") { return null; } - var mode = group.mode; + const mode = group.mode; if (font === "mathit") { return "italic"; @@ -6973,7 +6934,7 @@ var getVariant = function getVariant(group, options) { return "monospace"; } - var text = group.text; + let text = group.text; if (utils.contains(["\\imath", "\\jmath"], text)) { return null; @@ -6983,7 +6944,7 @@ var getVariant = function getVariant(group, options) { text = src_symbols[mode][text].replace; } - var fontName = buildCommon.fontMap[font].fontName; + const fontName = buildCommon.fontMap[font].fontName; if (getCharacterMetrics(text, fontName, mode)) { return buildCommon.fontMap[font].variant; @@ -6997,9 +6958,9 @@ var getVariant = function getVariant(group, options) { * tag. */ -var buildMathML_buildExpression = function buildExpression(expression, options, isOrdgroup) { +const buildMathML_buildExpression = function (expression, options, isOrdgroup) { if (expression.length === 1) { - var group = buildMathML_buildGroup(expression[0], options); + const group = buildMathML_buildGroup(expression[0], options); if (isOrdgroup && group instanceof MathNode && group.type === "mo") { // When TeX writers want to suppress spacing on an operator, @@ -7011,53 +6972,44 @@ var buildMathML_buildExpression = function buildExpression(expression, options, return [group]; } - var groups = []; - var lastGroup; + const groups = []; + let lastGroup; - for (var i = 0; i < expression.length; i++) { - var _group = buildMathML_buildGroup(expression[i], options); + for (let i = 0; i < expression.length; i++) { + const group = buildMathML_buildGroup(expression[i], options); - if (_group instanceof MathNode && lastGroup instanceof MathNode) { + if (group instanceof MathNode && lastGroup instanceof MathNode) { // Concatenate adjacent s - if (_group.type === 'mtext' && lastGroup.type === 'mtext' && _group.getAttribute('mathvariant') === lastGroup.getAttribute('mathvariant')) { - var _lastGroup$children; - - (_lastGroup$children = lastGroup.children).push.apply(_lastGroup$children, _group.children); - + if (group.type === 'mtext' && lastGroup.type === 'mtext' && group.getAttribute('mathvariant') === lastGroup.getAttribute('mathvariant')) { + lastGroup.children.push(...group.children); continue; // Concatenate adjacent s - } else if (_group.type === 'mn' && lastGroup.type === 'mn') { - var _lastGroup$children2; - - (_lastGroup$children2 = lastGroup.children).push.apply(_lastGroup$children2, _group.children); - + } else if (group.type === 'mn' && lastGroup.type === 'mn') { + lastGroup.children.push(...group.children); continue; // Concatenate ... followed by . - } else if (_group.type === 'mi' && _group.children.length === 1 && lastGroup.type === 'mn') { - var child = _group.children[0]; + } else if (group.type === 'mi' && group.children.length === 1 && lastGroup.type === 'mn') { + const child = group.children[0]; if (child instanceof TextNode && child.text === '.') { - var _lastGroup$children3; - - (_lastGroup$children3 = lastGroup.children).push.apply(_lastGroup$children3, _group.children); - + lastGroup.children.push(...group.children); continue; } } else if (lastGroup.type === 'mi' && lastGroup.children.length === 1) { - var lastChild = lastGroup.children[0]; + const lastChild = lastGroup.children[0]; - if (lastChild instanceof TextNode && lastChild.text === "\u0338" && (_group.type === 'mo' || _group.type === 'mi' || _group.type === 'mn')) { - var _child = _group.children[0]; + if (lastChild instanceof TextNode && lastChild.text === '\u0338' && (group.type === 'mo' || group.type === 'mi' || group.type === 'mn')) { + const child = group.children[0]; - if (_child instanceof TextNode && _child.text.length > 0) { + if (child instanceof TextNode && child.text.length > 0) { // Overlay with combining character long solidus - _child.text = _child.text.slice(0, 1) + "\u0338" + _child.text.slice(1); + child.text = child.text.slice(0, 1) + "\u0338" + child.text.slice(1); groups.pop(); } } } } - groups.push(_group); - lastGroup = _group; + groups.push(group); + lastGroup = group; } return groups; @@ -7067,7 +7019,7 @@ var buildMathML_buildExpression = function buildExpression(expression, options, * if there's more than one. Returns a single node instead of an array. */ -var buildExpressionRow = function buildExpressionRow(expression, options, isOrdgroup) { +const buildExpressionRow = function (expression, options, isOrdgroup) { return makeRow(buildMathML_buildExpression(expression, options, isOrdgroup)); }; /** @@ -7075,7 +7027,7 @@ var buildExpressionRow = function buildExpressionRow(expression, options, isOrdg * on it to produce a MathML node. */ -var buildMathML_buildGroup = function buildGroup(group, options) { +const buildMathML_buildGroup = function (group, options) { if (!group) { return new mathMLTree.MathNode("mrow"); } @@ -7083,7 +7035,7 @@ var buildMathML_buildGroup = function buildGroup(group, options) { if (_mathmlGroupBuilders[group.type]) { // Call the groupBuilders function // $FlowFixMe - var result = _mathmlGroupBuilders[group.type](group, options); // $FlowFixMe + const result = _mathmlGroupBuilders[group.type](group, options); // $FlowFixMe return result; } else { @@ -7100,14 +7052,14 @@ var buildMathML_buildGroup = function buildGroup(group, options) { */ function buildMathML(tree, texExpression, options, isDisplayMode, forMathmlOnly) { - var expression = buildMathML_buildExpression(tree, options); // TODO: Make a pass thru the MathML similar to buildHTML.traverseNonSpaceNodes + const expression = buildMathML_buildExpression(tree, options); // TODO: Make a pass thru the MathML similar to buildHTML.traverseNonSpaceNodes // and add spacing nodes. This is necessary only adjacent to math operators // like \sin or \lim or to subsup elements that contain math operators. // MathML takes care of the other spacing issues. // Wrap up the expression in an mrow so it is presented in the semantics // tag correctly, unless it's a single or . - var wrapper; + let wrapper; if (expression.length === 1 && expression[0] instanceof MathNode && utils.contains(["mrow", "mtable"], expression[0].type)) { wrapper = expression[0]; @@ -7116,10 +7068,10 @@ function buildMathML(tree, texExpression, options, isDisplayMode, forMathmlOnly) } // Build a TeX annotation of the source - var annotation = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(texExpression)]); + const annotation = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(texExpression)]); annotation.setAttribute("encoding", "application/x-tex"); - var semantics = new mathMLTree.MathNode("semantics", [wrapper, annotation]); - var math = new mathMLTree.MathNode("math", [semantics]); + const semantics = new mathMLTree.MathNode("semantics", [wrapper, annotation]); + const math = new mathMLTree.MathNode("math", [semantics]); math.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"); if (isDisplayMode) { @@ -7130,7 +7082,7 @@ function buildMathML(tree, texExpression, options, isDisplayMode, forMathmlOnly) // of span are expected to have more fields in `buildHtml` contexts. - var wrapperClass = forMathmlOnly ? "katex" : "katex-mathml"; // $FlowFixMe + const wrapperClass = forMathmlOnly ? "katex" : "katex-mathml"; // $FlowFixMe return buildCommon.makeSpan([wrapperClass], [math]); } @@ -7142,7 +7094,7 @@ function buildMathML(tree, texExpression, options, isDisplayMode, forMathmlOnly) -var optionsFromSettings = function optionsFromSettings(settings) { +const optionsFromSettings = function (settings) { return new src_Options({ style: settings.displayMode ? src_Style.DISPLAY : src_Style.TEXT, maxSize: settings.maxSize, @@ -7150,9 +7102,9 @@ var optionsFromSettings = function optionsFromSettings(settings) { }); }; -var displayWrap = function displayWrap(node, settings) { +const displayWrap = function (node, settings) { if (settings.displayMode) { - var classes = ["katex-display"]; + const classes = ["katex-display"]; if (settings.leqno) { classes.push("leqno"); @@ -7168,29 +7120,27 @@ var displayWrap = function displayWrap(node, settings) { return node; }; -var buildTree = function buildTree(tree, expression, settings) { - var options = optionsFromSettings(settings); - var katexNode; +const buildTree = function (tree, expression, settings) { + const options = optionsFromSettings(settings); + let katexNode; if (settings.output === "mathml") { return buildMathML(tree, expression, options, settings.displayMode, true); } else if (settings.output === "html") { - var htmlNode = buildHTML(tree, options); + const htmlNode = buildHTML(tree, options); katexNode = buildCommon.makeSpan(["katex"], [htmlNode]); } else { - var mathMLNode = buildMathML(tree, expression, options, settings.displayMode, false); - - var _htmlNode = buildHTML(tree, options); - - katexNode = buildCommon.makeSpan(["katex"], [mathMLNode, _htmlNode]); + const mathMLNode = buildMathML(tree, expression, options, settings.displayMode, false); + const htmlNode = buildHTML(tree, options); + katexNode = buildCommon.makeSpan(["katex"], [mathMLNode, htmlNode]); } return displayWrap(katexNode, settings); }; -var buildHTMLTree = function buildHTMLTree(tree, expression, settings) { - var options = optionsFromSettings(settings); - var htmlNode = buildHTML(tree, options); - var katexNode = buildCommon.makeSpan(["katex"], [htmlNode]); +const buildHTMLTree = function (tree, expression, settings) { + const options = optionsFromSettings(settings); + const htmlNode = buildHTML(tree, options); + const katexNode = buildCommon.makeSpan(["katex"], [htmlNode]); return displayWrap(katexNode, settings); }; /* harmony default export */ var src_buildTree = ((/* unused pure expression or super */ null && (buildTree))); @@ -7205,7 +7155,7 @@ var buildHTMLTree = function buildHTMLTree(tree, expression, settings) { -var stretchyCodePoint = { +const stretchyCodePoint = { widehat: "^", widecheck: "ˇ", widetilde: "~", @@ -7216,44 +7166,44 @@ var stretchyCodePoint = { overrightarrow: "\u2192", underrightarrow: "\u2192", xrightarrow: "\u2192", - underbrace: "\u23DF", - overbrace: "\u23DE", - overgroup: "\u23E0", - undergroup: "\u23E1", + underbrace: "\u23df", + overbrace: "\u23de", + overgroup: "\u23e0", + undergroup: "\u23e1", overleftrightarrow: "\u2194", underleftrightarrow: "\u2194", xleftrightarrow: "\u2194", - Overrightarrow: "\u21D2", - xRightarrow: "\u21D2", - overleftharpoon: "\u21BC", - xleftharpoonup: "\u21BC", - overrightharpoon: "\u21C0", - xrightharpoonup: "\u21C0", - xLeftarrow: "\u21D0", - xLeftrightarrow: "\u21D4", - xhookleftarrow: "\u21A9", - xhookrightarrow: "\u21AA", - xmapsto: "\u21A6", - xrightharpoondown: "\u21C1", - xleftharpoondown: "\u21BD", - xrightleftharpoons: "\u21CC", - xleftrightharpoons: "\u21CB", - xtwoheadleftarrow: "\u219E", - xtwoheadrightarrow: "\u21A0", + Overrightarrow: "\u21d2", + xRightarrow: "\u21d2", + overleftharpoon: "\u21bc", + xleftharpoonup: "\u21bc", + overrightharpoon: "\u21c0", + xrightharpoonup: "\u21c0", + xLeftarrow: "\u21d0", + xLeftrightarrow: "\u21d4", + xhookleftarrow: "\u21a9", + xhookrightarrow: "\u21aa", + xmapsto: "\u21a6", + xrightharpoondown: "\u21c1", + xleftharpoondown: "\u21bd", + xrightleftharpoons: "\u21cc", + xleftrightharpoons: "\u21cb", + xtwoheadleftarrow: "\u219e", + xtwoheadrightarrow: "\u21a0", xlongequal: "=", - xtofrom: "\u21C4", - xrightleftarrows: "\u21C4", - xrightequilibrium: "\u21CC", + xtofrom: "\u21c4", + xrightleftarrows: "\u21c4", + xrightequilibrium: "\u21cc", // Not a perfect match. - xleftequilibrium: "\u21CB", + xleftequilibrium: "\u21cb", // None better available. "\\cdrightarrow": "\u2192", "\\cdleftarrow": "\u2190", "\\cdlongequal": "=" }; -var mathMLnode = function mathMLnode(label) { - var node = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[label.replace(/^\\/, '')])]); +const mathMLnode = function (label) { + const node = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[label.replace(/^\\/, '')])]); node.setAttribute("stretchy", "true"); return node; }; // Many of the KaTeX SVG images have been adapted from glyphs in KaTeX fonts. @@ -7294,7 +7244,7 @@ var mathMLnode = function mathMLnode(label) { // corresponds to 0.522 em inside the document. -var katexImagesData = { +const katexImagesData = { // path(s), minWidth, height, align overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"], overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"], @@ -7343,7 +7293,7 @@ var katexImagesData = { xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716] }; -var groupLength = function groupLength(arg) { +const groupLength = function (arg) { if (arg.type === "ordgroup") { return arg.body.length; } else { @@ -7351,82 +7301,77 @@ var groupLength = function groupLength(arg) { } }; -var svgSpan = function svgSpan(group, options) { +const svgSpan = function (group, options) { // Create a span with inline SVG for the element. function buildSvgSpan_() { - var viewBoxWidth = 400000; // default + let viewBoxWidth = 400000; // default - var label = group.label.slice(1); + const label = group.label.slice(1); if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], label)) { // Each type in the `if` statement corresponds to one of the ParseNode // types below. This narrowing is required to access `grp.base`. // $FlowFixMe - var grp = group; // There are four SVG images available for each function. + const grp = group; // There are four SVG images available for each function. // Choose a taller image when there are more characters. - var numChars = groupLength(grp.base); - var viewBoxHeight; - var pathName; - - var _height; + const numChars = groupLength(grp.base); + let viewBoxHeight; + let pathName; + let height; if (numChars > 5) { if (label === "widehat" || label === "widecheck") { viewBoxHeight = 420; viewBoxWidth = 2364; - _height = 0.42; + height = 0.42; pathName = label + "4"; } else { viewBoxHeight = 312; viewBoxWidth = 2340; - _height = 0.34; + height = 0.34; pathName = "tilde4"; } } else { - var imgIndex = [1, 1, 2, 2, 3, 3][numChars]; + const imgIndex = [1, 1, 2, 2, 3, 3][numChars]; if (label === "widehat" || label === "widecheck") { viewBoxWidth = [0, 1062, 2364, 2364, 2364][imgIndex]; viewBoxHeight = [0, 239, 300, 360, 420][imgIndex]; - _height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex]; + height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex]; pathName = label + imgIndex; } else { viewBoxWidth = [0, 600, 1033, 2339, 2340][imgIndex]; viewBoxHeight = [0, 260, 286, 306, 312][imgIndex]; - _height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex]; + height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex]; pathName = "tilde" + imgIndex; } } - var path = new PathNode(pathName); - var svgNode = new SvgNode([path], { + const path = new PathNode(pathName); + const svgNode = new SvgNode([path], { "width": "100%", - "height": makeEm(_height), + "height": makeEm(height), "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight, "preserveAspectRatio": "none" }); return { span: buildCommon.makeSvgSpan([], [svgNode], options), minWidth: 0, - height: _height + height }; } else { - var spans = []; - var data = katexImagesData[label]; - var paths = data[0], - _minWidth = data[1], - _viewBoxHeight = data[2]; - - var _height2 = _viewBoxHeight / 1000; - - var numSvgChildren = paths.length; - var widthClasses; - var aligns; + const spans = []; + const data = katexImagesData[label]; + const [paths, minWidth, viewBoxHeight] = data; + const height = viewBoxHeight / 1000; + const numSvgChildren = paths.length; + let widthClasses; + let aligns; if (numSvgChildren === 1) { // $FlowFixMe: All these cases must be of the 4-tuple type. - var align1 = data[3]; + const align1 = data[3]; widthClasses = ["hide-tail"]; aligns = [align1]; } else if (numSvgChildren === 2) { @@ -7439,46 +7384,44 @@ var svgSpan = function svgSpan(group, options) { throw new Error("Correct katexImagesData or update code here to support\n " + numSvgChildren + " children."); } - for (var i = 0; i < numSvgChildren; i++) { - var _path = new PathNode(paths[i]); - - var _svgNode = new SvgNode([_path], { + for (let i = 0; i < numSvgChildren; i++) { + const path = new PathNode(paths[i]); + const svgNode = new SvgNode([path], { "width": "400em", - "height": makeEm(_height2), - "viewBox": "0 0 " + viewBoxWidth + " " + _viewBoxHeight, + "height": makeEm(height), + "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight, "preserveAspectRatio": aligns[i] + " slice" }); - - var _span = buildCommon.makeSvgSpan([widthClasses[i]], [_svgNode], options); + const span = buildCommon.makeSvgSpan([widthClasses[i]], [svgNode], options); if (numSvgChildren === 1) { return { - span: _span, - minWidth: _minWidth, - height: _height2 + span, + minWidth, + height }; } else { - _span.style.height = makeEm(_height2); - spans.push(_span); + span.style.height = makeEm(height); + spans.push(span); } } return { span: buildCommon.makeSpan(["stretchy"], spans, options), - minWidth: _minWidth, - height: _height2 + minWidth, + height }; } } // buildSvgSpan_() - var _buildSvgSpan_ = buildSvgSpan_(), - span = _buildSvgSpan_.span, - minWidth = _buildSvgSpan_.minWidth, - height = _buildSvgSpan_.height; // Note that we are returning span.depth = 0. + const { + span, + minWidth, + height + } = buildSvgSpan_(); // Note that we are returning span.depth = 0. // Any adjustments relative to the baseline must be done in buildHTML. - span.height = height; span.style.height = makeEm(height); @@ -7489,16 +7432,16 @@ var svgSpan = function svgSpan(group, options) { return span; }; -var encloseSpan = function encloseSpan(inner, label, topPad, bottomPad, options) { +const encloseSpan = function (inner, label, topPad, bottomPad, options) { // Return an image span for \cancel, \bcancel, \xcancel, \fbox, or \angl - var img; - var totalHeight = inner.height + inner.depth + topPad + bottomPad; + let img; + const totalHeight = inner.height + inner.depth + topPad + bottomPad; if (/fbox|color|angl/.test(label)) { img = buildCommon.makeSpan(["stretchy", label], [], options); if (label === "fbox") { - var color = options.color && options.getColor(); + const color = options.color && options.getColor(); if (color) { img.style.borderColor = color; @@ -7508,7 +7451,7 @@ var encloseSpan = function encloseSpan(inner, label, topPad, bottomPad, options) // \cancel, \bcancel, or \xcancel // Since \cancel's SVG is inline and it omits the viewBox attribute, // its stroke-width will not vary with span area. - var lines = []; + const lines = []; if (/^[bx]cancel$/.test(label)) { lines.push(new LineNode({ @@ -7530,7 +7473,7 @@ var encloseSpan = function encloseSpan(inner, label, topPad, bottomPad, options) })); } - var svgNode = new SvgNode(lines, { + const svgNode = new SvgNode(lines, { "width": "100%", "height": makeEm(totalHeight) }); @@ -7543,9 +7486,9 @@ var encloseSpan = function encloseSpan(inner, label, topPad, bottomPad, options) }; /* harmony default export */ var stretchy = ({ - encloseSpan: encloseSpan, - mathMLnode: mathMLnode, - svgSpan: svgSpan + encloseSpan, + mathMLnode, + svgSpan }); ;// CONCATENATED MODULE: ./src/parseNode.js @@ -7568,7 +7511,7 @@ function assertNodeType(node, type) { */ function assertSymbolNodeType(node) { - var typedNode = checkSymbolNodeType(node); + const typedNode = checkSymbolNodeType(node); if (!typedNode) { throw new Error("Expected node of symbol group type, but got " + (node ? "node of type " + node.type : String(node))); @@ -7602,11 +7545,11 @@ function checkSymbolNodeType(node) { // NOTE: Unlike most `htmlBuilder`s, this one handles not only "accent", but // also "supsub" since an accent can affect super/subscripting. -var htmlBuilder = function htmlBuilder(grp, options) { +const htmlBuilder = (grp, options) => { // Accents are handled in the TeXbook pg. 443, rule 12. - var base; - var group; - var supSubGroup; + let base; + let group; + let supSubGroup; if (grp && grp.type === "supsub") { // If our base is a character box, and we have superscripts and @@ -7633,22 +7576,22 @@ var htmlBuilder = function htmlBuilder(grp, options) { } // Build the base group - var body = buildGroup(base, options.havingCrampedStyle()); // Does the accent need to shift for the skew of a character? + const body = buildGroup(base, options.havingCrampedStyle()); // Does the accent need to shift for the skew of a character? - var mustShift = group.isShifty && utils.isCharacterBox(base); // Calculate the skew of the accent. This is based on the line "If the + const mustShift = group.isShifty && utils.isCharacterBox(base); // Calculate the skew of the accent. This is based on the line "If the // nucleus is not a single character, let s = 0; otherwise set s to the // kern amount for the nucleus followed by the \skewchar of its font." // Note that our skew metrics are just the kern between each character // and the skewchar. - var skew = 0; + let skew = 0; if (mustShift) { // If the base is a character box, then we want the skew of the // innermost character. To do that, we find the innermost character: - var baseChar = utils.getBaseElem(base); // Then, we render its group to get the symbol inside it + const baseChar = utils.getBaseElem(base); // Then, we render its group to get the symbol inside it - var baseGroup = buildGroup(baseChar, options.havingCrampedStyle()); // Finally, we pull the skew off of the symbol. + const baseGroup = buildGroup(baseChar, options.havingCrampedStyle()); // Finally, we pull the skew off of the symbol. skew = assertSymbolDomNode(baseGroup).skew; // Note that we now throw away baseGroup, because the layers we // removed with getBaseElem might contain things like \color which @@ -7656,15 +7599,15 @@ var htmlBuilder = function htmlBuilder(grp, options) { // TODO(emily): Find a better way to get the skew } - var accentBelow = group.label === "\\c"; // calculate the amount of space between the body and the accent + const accentBelow = group.label === "\\c"; // calculate the amount of space between the body and the accent - var clearance = accentBelow ? body.height + body.depth : Math.min(body.height, options.fontMetrics().xHeight); // Build the accent + let clearance = accentBelow ? body.height + body.depth : Math.min(body.height, options.fontMetrics().xHeight); // Build the accent - var accentBody; + let accentBody; if (!group.isStretchy) { - var accent; - var width; + let accent; + let width; if (group.label === "\\vec") { // Before version 0.9, \vec used the combining font glyph U+20D7. @@ -7694,7 +7637,7 @@ var htmlBuilder = function htmlBuilder(grp, options) { // at least the width of the accent, and overlap directly onto the // character without any vertical offset. - var accentFull = group.label === "\\textcircled"; + const accentFull = group.label === "\\textcircled"; if (accentFull) { accentBody.classes.push('accent-full'); @@ -7702,7 +7645,7 @@ var htmlBuilder = function htmlBuilder(grp, options) { } // Shift the accent over by the skew. - var left = skew; // CSS defines `.katex .accent .accent-body:not(.accent-full) { width: 0 }` + let left = skew; // CSS defines `.katex .accent .accent-body:not(.accent-full) { width: 0 }` // so that the accent doesn't contribute to the bounding box. // We need to shift the character by its width (effectively half // its width) to compensate. @@ -7750,7 +7693,7 @@ var htmlBuilder = function htmlBuilder(grp, options) { }, options); } - var accentWrap = buildCommon.makeSpan(["mord", "accent"], [accentBody], options); + const accentWrap = buildCommon.makeSpan(["mord", "accent"], [accentBody], options); if (supSubGroup) { // Here, we replace the "base" child of the supsub with our newly @@ -7767,16 +7710,14 @@ var htmlBuilder = function htmlBuilder(grp, options) { } }; -var mathmlBuilder = function mathmlBuilder(group, options) { - var accentNode = group.isStretchy ? stretchy.mathMLnode(group.label) : new mathMLTree.MathNode("mo", [makeText(group.label, group.mode)]); - var node = new mathMLTree.MathNode("mover", [buildMathML_buildGroup(group.base, options), accentNode]); +const mathmlBuilder = (group, options) => { + const accentNode = group.isStretchy ? stretchy.mathMLnode(group.label) : new mathMLTree.MathNode("mo", [makeText(group.label, group.mode)]); + const node = new mathMLTree.MathNode("mover", [buildMathML_buildGroup(group.base, options), accentNode]); node.setAttribute("accent", "true"); return node; }; -var NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map(function (accent) { - return "\\" + accent; -}).join("|")); // Accents +const NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map(accent => "\\" + accent).join("|")); // Accents defineFunction({ type: "accent", @@ -7784,10 +7725,10 @@ defineFunction({ props: { numArgs: 1 }, - handler: function handler(context, args) { - var base = normalizeArgument(args[0]); - var isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName); - var isShifty = !isStretchy || context.funcName === "\\widehat" || context.funcName === "\\widetilde" || context.funcName === "\\widecheck"; + handler: (context, args) => { + const base = normalizeArgument(args[0]); + const isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName); + const isShifty = !isStretchy || context.funcName === "\\widehat" || context.funcName === "\\widetilde" || context.funcName === "\\widecheck"; return { type: "accent", mode: context.parser.mode, @@ -7797,8 +7738,8 @@ defineFunction({ base: base }; }, - htmlBuilder: htmlBuilder, - mathmlBuilder: mathmlBuilder + htmlBuilder, + mathmlBuilder }); // Text-mode accents defineFunction({ @@ -7811,9 +7752,9 @@ defineFunction({ // unless in strict mode argTypes: ["primitive"] }, - handler: function handler(context, args) { - var base = args[0]; - var mode = context.parser.mode; + handler: (context, args) => { + const base = args[0]; + let mode = context.parser.mode; if (mode === "math") { context.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + context.funcName + " works only in text mode"); @@ -7829,8 +7770,8 @@ defineFunction({ base: base }; }, - htmlBuilder: htmlBuilder, - mathmlBuilder: mathmlBuilder + htmlBuilder, + mathmlBuilder }); ;// CONCATENATED MODULE: ./src/functions/accentunder.js // Horizontal overlap functions @@ -7846,10 +7787,12 @@ defineFunction({ props: { numArgs: 1 }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var base = args[0]; + handler: (_ref, args) => { + let { + parser, + funcName + } = _ref; + const base = args[0]; return { type: "accentUnder", mode: parser.mode, @@ -7857,13 +7800,13 @@ defineFunction({ base: base }; }, - htmlBuilder: function htmlBuilder(group, options) { + htmlBuilder: (group, options) => { // Treat under accents much like underlines. - var innerGroup = buildGroup(group.base, options); - var accentBody = stretchy.svgSpan(group, options); - var kern = group.label === "\\utilde" ? 0.12 : 0; // Generate the vlist, with the appropriate kerns + const innerGroup = buildGroup(group.base, options); + const accentBody = stretchy.svgSpan(group, options); + const kern = group.label === "\\utilde" ? 0.12 : 0; // Generate the vlist, with the appropriate kerns - var vlist = buildCommon.makeVList({ + const vlist = buildCommon.makeVList({ positionType: "top", positionData: innerGroup.height, children: [{ @@ -7880,9 +7823,9 @@ defineFunction({ }, options); return buildCommon.makeSpan(["mord", "accentunder"], [vlist], options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var accentNode = stretchy.mathMLnode(group.label); - var node = new mathMLTree.MathNode("munder", [buildMathML_buildGroup(group.base, options), accentNode]); + mathmlBuilder: (group, options) => { + const accentNode = stretchy.mathMLnode(group.label); + const node = new mathMLTree.MathNode("munder", [buildMathML_buildGroup(group.base, options), accentNode]); node.setAttribute("accentunder", "true"); return node; } @@ -7896,8 +7839,8 @@ defineFunction({ // Helper function -var paddedNode = function paddedNode(group) { - var node = new mathMLTree.MathNode("mpadded", group ? [group] : []); +const paddedNode = group => { + const node = new mathMLTree.MathNode("mpadded", group ? [group] : []); node.setAttribute("width", "+0.6em"); node.setAttribute("lspace", "0.3em"); return node; @@ -7914,9 +7857,12 @@ defineFunction({ numArgs: 1, numOptionalArgs: 1 }, - handler: function handler(_ref, args, optArgs) { - var parser = _ref.parser, - funcName = _ref.funcName; + + handler(_ref, args, optArgs) { + let { + parser, + funcName + } = _ref; return { type: "xArrow", mode: parser.mode, @@ -7925,19 +7871,20 @@ defineFunction({ below: optArgs[0] }; }, + // Flow is unable to correctly infer the type of `group`, even though it's // unambiguously determined from the passed-in `type` above. - htmlBuilder: function htmlBuilder(group, options) { - var style = options.style; // Build the argument groups in the appropriate style. + htmlBuilder(group, options) { + const style = options.style; // Build the argument groups in the appropriate style. // Ref: amsmath.dtx: \hbox{$\scriptstyle\mkern#3mu{#6}\mkern#4mu$}% // Some groups can return document fragments. Handle those by wrapping // them in a span. - var newOptions = options.havingStyle(style.sup()); - var upperGroup = buildCommon.wrapFragment(buildGroup(group.body, newOptions, options), options); - var arrowPrefix = group.label.slice(0, 2) === "\\x" ? "x" : "cd"; + let newOptions = options.havingStyle(style.sup()); + const upperGroup = buildCommon.wrapFragment(buildGroup(group.body, newOptions, options), options); + const arrowPrefix = group.label.slice(0, 2) === "\\x" ? "x" : "cd"; upperGroup.classes.push(arrowPrefix + "-arrow-pad"); - var lowerGroup; + let lowerGroup; if (group.below) { // Build the lower group @@ -7946,22 +7893,22 @@ defineFunction({ lowerGroup.classes.push(arrowPrefix + "-arrow-pad"); } - var arrowBody = stretchy.svgSpan(group, options); // Re shift: Note that stretchy.svgSpan returned arrowBody.depth = 0. + const arrowBody = stretchy.svgSpan(group, options); // Re shift: Note that stretchy.svgSpan returned arrowBody.depth = 0. // The point we want on the math axis is at 0.5 * arrowBody.height. - var arrowShift = -options.fontMetrics().axisHeight + 0.5 * arrowBody.height; // 2 mu kern. Ref: amsmath.dtx: #7\if0#2\else\mkern#2mu\fi + const arrowShift = -options.fontMetrics().axisHeight + 0.5 * arrowBody.height; // 2 mu kern. Ref: amsmath.dtx: #7\if0#2\else\mkern#2mu\fi - var upperShift = -options.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111; // 0.111 em = 2 mu + let upperShift = -options.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111; // 0.111 em = 2 mu if (upperGroup.depth > 0.25 || group.label === "\\xleftequilibrium") { upperShift -= upperGroup.depth; // shift up if depth encroaches } // Generate the vlist - var vlist; + let vlist; if (lowerGroup) { - var lowerShift = -options.fontMetrics().axisHeight + lowerGroup.height + 0.5 * arrowBody.height + 0.111; + const lowerShift = -options.fontMetrics().axisHeight + lowerGroup.height + 0.5 * arrowBody.height + 0.111; vlist = buildCommon.makeVList({ positionType: "individualShift", children: [{ @@ -7997,24 +7944,24 @@ defineFunction({ vlist.children[0].children[0].children[1].classes.push("svg-align"); return buildCommon.makeSpan(["mrel", "x-arrow"], [vlist], options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var arrowNode = stretchy.mathMLnode(group.label); + + mathmlBuilder(group, options) { + const arrowNode = stretchy.mathMLnode(group.label); arrowNode.setAttribute("minsize", group.label.charAt(0) === "x" ? "1.75em" : "3.0em"); - var node; + let node; if (group.body) { - var upperNode = paddedNode(buildMathML_buildGroup(group.body, options)); + const upperNode = paddedNode(buildMathML_buildGroup(group.body, options)); if (group.below) { - var lowerNode = paddedNode(buildMathML_buildGroup(group.below, options)); + const lowerNode = paddedNode(buildMathML_buildGroup(group.below, options)); node = new mathMLTree.MathNode("munderover", [arrowNode, lowerNode, upperNode]); } else { node = new mathMLTree.MathNode("mover", [arrowNode, upperNode]); } } else if (group.below) { - var _lowerNode = paddedNode(buildMathML_buildGroup(group.below, options)); - - node = new mathMLTree.MathNode("munder", [arrowNode, _lowerNode]); + const lowerNode = paddedNode(buildMathML_buildGroup(group.below, options)); + node = new mathMLTree.MathNode("munder", [arrowNode, lowerNode]); } else { // This should never happen. // Parser.js throws an error if there is no argument. @@ -8024,6 +7971,7 @@ defineFunction({ return node; } + }); ;// CONCATENATED MODULE: ./src/functions/mclass.js @@ -8032,16 +7980,16 @@ defineFunction({ -var mclass_makeSpan = buildCommon.makeSpan; +const mclass_makeSpan = buildCommon.makeSpan; function mclass_htmlBuilder(group, options) { - var elements = buildExpression(group.body, options, true); + const elements = buildExpression(group.body, options, true); return mclass_makeSpan([group.mclass], elements, options); } function mclass_mathmlBuilder(group, options) { - var node; - var inner = buildMathML_buildExpression(group.body, options); + let node; + const inner = buildMathML_buildExpression(group.body, options); if (group.mclass === "minner") { node = new mathMLTree.MathNode("mpadded", inner); @@ -8092,10 +8040,13 @@ defineFunction({ numArgs: 1, primitive: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var body = args[0]; + + handler(_ref, args) { + let { + parser, + funcName + } = _ref; + const body = args[0]; return { type: "mclass", mode: parser.mode, @@ -8105,15 +8056,16 @@ defineFunction({ isCharacterBox: utils.isCharacterBox(body) }; }, + htmlBuilder: mclass_htmlBuilder, mathmlBuilder: mclass_mathmlBuilder }); -var binrelClass = function binrelClass(arg) { +const binrelClass = arg => { // \binrel@ spacing varies with (bin|rel|ord) of the atom in the argument. // (by rendering separately and with {}s before and after, and measuring // the change in spacing). We'll do roughly the same by detecting the // atom type directly. - var atom = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg; + const atom = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg; if (atom.type === "atom" && (atom.family === "bin" || atom.family === "rel")) { return "m" + atom.family; @@ -8129,8 +8081,11 @@ defineFunction({ props: { numArgs: 2 }, - handler: function handler(_ref2, args) { - var parser = _ref2.parser; + + handler(_ref2, args) { + let { + parser + } = _ref2; return { type: "mclass", mode: parser.mode, @@ -8139,6 +8094,7 @@ defineFunction({ isCharacterBox: utils.isCharacterBox(args[1]) }; } + }); // Build a relation or stacked op by placing one symbol on top of another defineFunction({ @@ -8147,12 +8103,15 @@ defineFunction({ props: { numArgs: 2 }, - handler: function handler(_ref3, args) { - var parser = _ref3.parser, - funcName = _ref3.funcName; - var baseArg = args[1]; - var shiftedArg = args[0]; - var mclass; + + handler(_ref3, args) { + let { + parser, + funcName + } = _ref3; + const baseArg = args[1]; + const shiftedArg = args[0]; + let mclass; if (funcName !== "\\stackrel") { // LaTeX applies \binrel spacing to \overset and \underset. @@ -8161,7 +8120,7 @@ defineFunction({ mclass = "mrel"; // for \stackrel } - var baseOp = { + const baseOp = { type: "op", mode: baseArg.mode, limits: true, @@ -8171,7 +8130,7 @@ defineFunction({ suppressBaseShift: funcName !== "\\stackrel", body: ordargument(baseArg) }; - var supsub = { + const supsub = { type: "supsub", mode: shiftedArg.mode, base: baseOp, @@ -8181,11 +8140,12 @@ defineFunction({ return { type: "mclass", mode: parser.mode, - mclass: mclass, + mclass, body: [supsub], isCharacterBox: utils.isCharacterBox(supsub) }; }, + htmlBuilder: mclass_htmlBuilder, mathmlBuilder: mclass_mathmlBuilder }); @@ -8207,8 +8167,11 @@ defineFunction({ numArgs: 1, allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser; + + handler(_ref, args) { + let { + parser + } = _ref; return { type: "pmb", mode: parser.mode, @@ -8216,19 +8179,22 @@ defineFunction({ body: ordargument(args[0]) }; }, - htmlBuilder: function htmlBuilder(group, options) { - var elements = buildExpression(group.body, options, true); - var node = buildCommon.makeSpan([group.mclass], elements, options); + + htmlBuilder(group, options) { + const elements = buildExpression(group.body, options, true); + const node = buildCommon.makeSpan([group.mclass], elements, options); node.style.textShadow = "0.02em 0.01em 0.04px"; return node; }, - mathmlBuilder: function mathmlBuilder(group, style) { - var inner = buildMathML_buildExpression(group.body, style); // Wrap with an element. - var node = new mathMLTree.MathNode("mstyle", inner); + mathmlBuilder(group, style) { + const inner = buildMathML_buildExpression(group.body, style); // Wrap with an element. + + const node = new mathMLTree.MathNode("mstyle", inner); node.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"); return node; } + }); ;// CONCATENATED MODULE: ./src/environments/cd.js @@ -8239,7 +8205,7 @@ defineFunction({ -var cdArrowFunctionName = { +const cdArrowFunctionName = { ">": "\\\\cdrightarrow", "<": "\\\\cdleftarrow", "=": "\\\\cdlongequal", @@ -8249,7 +8215,7 @@ var cdArrowFunctionName = { ".": "no arrow" }; -var newCell = function newCell() { +const newCell = () => { // Create an empty cell, to be filled below with parse nodes. // The parseTree from this module must be constructed like the // one created by parseArray(), so an empty CD cell must @@ -8263,18 +8229,18 @@ var newCell = function newCell() { }; }; -var isStartOfArrow = function isStartOfArrow(node) { +const isStartOfArrow = node => { return node.type === "textord" && node.text === "@"; }; -var isLabelEnd = function isLabelEnd(node, endChar) { +const isLabelEnd = (node, endChar) => { return (node.type === "mathord" || node.type === "atom") && node.text === endChar; }; function cdArrow(arrowChar, labels, parser) { // Return a parse tree of an arrow and its labels. // This acts in a way similar to a macro expansion. - var funcName = cdArrowFunctionName[arrowChar]; + const funcName = cdArrowFunctionName[arrowChar]; switch (funcName) { case "\\\\cdrightarrow": @@ -8284,16 +8250,16 @@ function cdArrow(arrowChar, labels, parser) { case "\\uparrow": case "\\downarrow": { - var leftLabel = parser.callFunction("\\\\cdleft", [labels[0]], []); - var bareArrow = { + const leftLabel = parser.callFunction("\\\\cdleft", [labels[0]], []); + const bareArrow = { type: "atom", text: funcName, mode: "math", family: "rel" }; - var sizedArrow = parser.callFunction("\\Big", [bareArrow], []); - var rightLabel = parser.callFunction("\\\\cdright", [labels[1]], []); - var arrowGroup = { + const sizedArrow = parser.callFunction("\\Big", [bareArrow], []); + const rightLabel = parser.callFunction("\\\\cdright", [labels[1]], []); + const arrowGroup = { type: "ordgroup", mode: "math", body: [leftLabel, sizedArrow, rightLabel] @@ -8306,7 +8272,7 @@ function cdArrow(arrowChar, labels, parser) { case "\\Vert": { - var arrow = { + const arrow = { type: "textord", text: "\\Vert", mode: "math" @@ -8325,7 +8291,7 @@ function cdArrow(arrowChar, labels, parser) { function parseCD(parser) { // Get the array's parse nodes with \\ temporarily mapped to \cr. - var parsedRows = []; + const parsedRows = []; parser.gullet.beginGroup(); parser.gullet.macros.set("\\cr", "\\\\\\relax"); parser.gullet.beginGroup(); @@ -8336,7 +8302,7 @@ function parseCD(parser) { parsedRows.push(parser.parseExpression(false, "\\\\")); parser.gullet.endGroup(); parser.gullet.beginGroup(); - var next = parser.fetch().text; + const next = parser.fetch().text; if (next === "&" || next === "\\\\") { parser.consume(); @@ -8351,16 +8317,16 @@ function parseCD(parser) { } } - var row = []; - var body = [row]; // Loop thru the parse nodes. Collect them into cells and arrows. + let row = []; + const body = [row]; // Loop thru the parse nodes. Collect them into cells and arrows. - for (var i = 0; i < parsedRows.length; i++) { + for (let i = 0; i < parsedRows.length; i++) { // Start a new row. - var rowNodes = parsedRows[i]; // Create the first cell. + const rowNodes = parsedRows[i]; // Create the first cell. - var cell = newCell(); + let cell = newCell(); - for (var j = 0; j < rowNodes.length; j++) { + for (let j = 0; j < rowNodes.length; j++) { if (!isStartOfArrow(rowNodes[j])) { // If a parseNode is not an arrow, it goes into a cell. cell.body.push(rowNodes[j]); @@ -8371,9 +8337,9 @@ function parseCD(parser) { // The character after "@" defines the arrow type. j += 1; - var arrowChar = assertSymbolNodeType(rowNodes[j]).text; // Create two empty label nodes. We may or may not use them. + const arrowChar = assertSymbolNodeType(rowNodes[j]).text; // Create two empty label nodes. We may or may not use them. - var labels = new Array(2); + const labels = new Array(2); labels[0] = { type: "ordgroup", mode: "math", @@ -8392,10 +8358,10 @@ function parseCD(parser) { // two optional labels. E.g. the right-point arrow syntax is // really: @>{optional label}>{optional label}> // Collect parseNodes into labels. - for (var labelNum = 0; labelNum < 2; labelNum++) { - var inLabel = true; + for (let labelNum = 0; labelNum < 2; labelNum++) { + let inLabel = true; - for (var k = j + 1; k < rowNodes.length; k++) { + for (let k = j + 1; k < rowNodes.length; k++) { if (isLabelEnd(rowNodes[k], arrowChar)) { inLabel = false; j = k; @@ -8419,10 +8385,10 @@ function parseCD(parser) { } // Now join the arrow to its labels. - var arrow = cdArrow(arrowChar, labels, parser); // Wrap the arrow in ParseNode<"styling">. + const arrow = cdArrow(arrowChar, labels, parser); // Wrap the arrow in ParseNode<"styling">. // This is done to match parseArray() behavior. - var wrappedArrow = { + const wrappedArrow = { type: "styling", body: [arrow], mode: "math", @@ -8456,7 +8422,7 @@ function parseCD(parser) { parser.gullet.endGroup(); // define column separation. - var cols = new Array(body[0].length).fill({ + const cols = new Array(body[0].length).fill({ type: "align", align: "c", pregap: 0.25, @@ -8467,11 +8433,11 @@ function parseCD(parser) { return { type: "array", mode: "math", - body: body, + body, arraystretch: 1, addJot: true, rowGaps: [null], - cols: cols, + cols, colSeparationType: "CD", hLinesBeforeRow: new Array(body.length + 1).fill([]) }; @@ -8487,9 +8453,12 @@ defineFunction({ props: { numArgs: 1 }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; + + handler(_ref, args) { + let { + parser, + funcName + } = _ref; return { type: "cdlabel", mode: parser.mode, @@ -8497,9 +8466,10 @@ defineFunction({ label: args[0] }; }, - htmlBuilder: function htmlBuilder(group, options) { - var newOptions = options.havingStyle(options.style.sup()); - var label = buildCommon.wrapFragment(buildGroup(group.label, newOptions, options), options); + + htmlBuilder(group, options) { + const newOptions = options.havingStyle(options.style.sup()); + const label = buildCommon.wrapFragment(buildGroup(group.label, newOptions, options), options); label.classes.push("cd-label-" + group.side); label.style.bottom = makeEm(0.8 - label.depth); // Zero out label height & depth, so vertical align of arrow is set // by the arrow height, not by the label. @@ -8508,8 +8478,9 @@ defineFunction({ label.depth = 0; return label; }, - mathmlBuilder: function mathmlBuilder(group, options) { - var label = new mathMLTree.MathNode("mrow", [buildMathML_buildGroup(group.label, options)]); + + mathmlBuilder(group, options) { + let label = new mathMLTree.MathNode("mrow", [buildMathML_buildGroup(group.label, options)]); label = new mathMLTree.MathNode("mpadded", [label]); label.setAttribute("width", "0"); @@ -8525,6 +8496,7 @@ defineFunction({ label.setAttribute("scriptlevel", "1"); return label; } + }); defineFunction({ type: "cdlabelparent", @@ -8532,25 +8504,31 @@ defineFunction({ props: { numArgs: 1 }, - handler: function handler(_ref2, args) { - var parser = _ref2.parser; + + handler(_ref2, args) { + let { + parser + } = _ref2; return { type: "cdlabelparent", mode: parser.mode, fragment: args[0] }; }, - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { // Wrap the vertical arrow and its labels. // The parent gets position: relative. The child gets position: absolute. // So CSS can locate the label correctly. - var parent = buildCommon.wrapFragment(buildGroup(group.fragment, options), options); + const parent = buildCommon.wrapFragment(buildGroup(group.fragment, options), options); parent.classes.push("cd-vert-arrow"); return parent; }, - mathmlBuilder: function mathmlBuilder(group, options) { + + mathmlBuilder(group, options) { return new mathMLTree.MathNode("mrow", [buildMathML_buildGroup(group.fragment, options)]); } + }); ;// CONCATENATED MODULE: ./src/functions/char.js @@ -8566,19 +8544,22 @@ defineFunction({ numArgs: 1, allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser; - var arg = assertNodeType(args[0], "ordgroup"); - var group = arg.body; - var number = ""; - for (var i = 0; i < group.length; i++) { - var node = assertNodeType(group[i], "textord"); + handler(_ref, args) { + let { + parser + } = _ref; + const arg = assertNodeType(args[0], "ordgroup"); + const group = arg.body; + let number = ""; + + for (let i = 0; i < group.length; i++) { + const node = assertNodeType(group[i], "textord"); number += node.text; } - var code = parseInt(number); - var text; + let code = parseInt(number); + let text; if (isNaN(code)) { throw new src_ParseError("\\@char has non-numeric argument " + number); // If we drop IE support, the following code could be replaced with @@ -8599,6 +8580,7 @@ defineFunction({ text: text }; } + }); ;// CONCATENATED MODULE: ./src/functions/color.js @@ -8608,8 +8590,8 @@ defineFunction({ -var color_htmlBuilder = function htmlBuilder(group, options) { - var elements = buildExpression(group.body, options.withColor(group.color), false); // \color isn't supposed to affect the type of the elements it contains. +const color_htmlBuilder = (group, options) => { + const elements = buildExpression(group.body, options.withColor(group.color), false); // \color isn't supposed to affect the type of the elements it contains. // To accomplish this, we wrap the results in a fragment, so the inner // elements will be able to directly interact with their neighbors. For // example, `\color{red}{2 +} 3` has the same spacing as `2 + 3` @@ -8617,9 +8599,9 @@ var color_htmlBuilder = function htmlBuilder(group, options) { return buildCommon.makeFragment(elements); }; -var color_mathmlBuilder = function mathmlBuilder(group, options) { - var inner = buildMathML_buildExpression(group.body, options.withColor(group.color)); - var node = new mathMLTree.MathNode("mstyle", inner); +const color_mathmlBuilder = (group, options) => { + const inner = buildMathML_buildExpression(group.body, options.withColor(group.color)); + const node = new mathMLTree.MathNode("mstyle", inner); node.setAttribute("mathcolor", group.color); return node; }; @@ -8632,17 +8614,21 @@ defineFunction({ allowedInText: true, argTypes: ["color", "original"] }, - handler: function handler(_ref, args) { - var parser = _ref.parser; - var color = assertNodeType(args[0], "color-token").color; - var body = args[1]; + + handler(_ref, args) { + let { + parser + } = _ref; + const color = assertNodeType(args[0], "color-token").color; + const body = args[1]; return { type: "color", mode: parser.mode, - color: color, + color, body: ordargument(body) }; }, + htmlBuilder: color_htmlBuilder, mathmlBuilder: color_mathmlBuilder }); @@ -8654,24 +8640,28 @@ defineFunction({ allowedInText: true, argTypes: ["color"] }, - handler: function handler(_ref2, args) { - var parser = _ref2.parser, - breakOnTokenText = _ref2.breakOnTokenText; - var color = assertNodeType(args[0], "color-token").color; // Set macro \current@color in current namespace to store the current + + handler(_ref2, args) { + let { + parser, + breakOnTokenText + } = _ref2; + const color = assertNodeType(args[0], "color-token").color; // Set macro \current@color in current namespace to store the current // color, mimicking the behavior of color.sty. // This is currently used just to correctly color a \right // that follows a \color command. parser.gullet.macros.set("\\current@color", color); // Parse out the implicit body that should be colored. - var body = parser.parseExpression(true, breakOnTokenText); + const body = parser.parseExpression(true, breakOnTokenText); return { type: "color", mode: parser.mode, - color: color, - body: body + color, + body }; }, + htmlBuilder: color_htmlBuilder, mathmlBuilder: color_mathmlBuilder }); @@ -8691,21 +8681,25 @@ defineFunction({ numOptionalArgs: 0, allowedInText: true }, - handler: function handler(_ref, args, optArgs) { - var parser = _ref.parser; - var size = parser.gullet.future().text === "[" ? parser.parseSizeGroup(true) : null; - var newLine = !parser.settings.displayMode || !parser.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline " + "does nothing in display mode"); + + handler(_ref, args, optArgs) { + let { + parser + } = _ref; + const size = parser.gullet.future().text === "[" ? parser.parseSizeGroup(true) : null; + const newLine = !parser.settings.displayMode || !parser.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline " + "does nothing in display mode"); return { type: "cr", mode: parser.mode, - newLine: newLine, + newLine, size: size && assertNodeType(size, "size").value }; }, + // The following builders are called only at the top level, // not within tabular/array environments. - htmlBuilder: function htmlBuilder(group, options) { - var span = buildCommon.makeSpan(["mspace"], [], options); + htmlBuilder(group, options) { + const span = buildCommon.makeSpan(["mspace"], [], options); if (group.newLine) { span.classes.push("newline"); @@ -8717,8 +8711,9 @@ defineFunction({ return span; }, - mathmlBuilder: function mathmlBuilder(group, options) { - var node = new mathMLTree.MathNode("mspace"); + + mathmlBuilder(group, options) { + const node = new mathMLTree.MathNode("mspace"); if (group.newLine) { node.setAttribute("linebreak", "newline"); @@ -8730,12 +8725,13 @@ defineFunction({ return node; } + }); ;// CONCATENATED MODULE: ./src/functions/def.js -var globalMap = { +const globalMap = { "\\global": "\\global", "\\long": "\\\\globallong", "\\\\globallong": "\\\\globallong", @@ -8747,8 +8743,8 @@ var globalMap = { "\\futurelet": "\\\\globalfuture" }; -var checkControlSequence = function checkControlSequence(tok) { - var name = tok.text; +const checkControlSequence = tok => { + const name = tok.text; if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) { throw new src_ParseError("Expected a control sequence", tok); @@ -8757,8 +8753,8 @@ var checkControlSequence = function checkControlSequence(tok) { return name; }; -var getRHS = function getRHS(parser) { - var tok = parser.gullet.popToken(); +const getRHS = parser => { + let tok = parser.gullet.popToken(); if (tok.text === "=") { // consume optional equals @@ -8773,8 +8769,8 @@ var getRHS = function getRHS(parser) { return tok; }; -var letCommand = function letCommand(parser, name, tok, global) { - var macro = parser.gullet.macros.get(tok.text); +const letCommand = (parser, name, tok, global) => { + let macro = parser.gullet.macros.get(tok.text); if (macro == null) { // don't expand it later even if a macro with the same name is defined @@ -8803,11 +8799,14 @@ defineFunction({ numArgs: 0, allowedInText: true }, - handler: function handler(_ref) { - var parser = _ref.parser, - funcName = _ref.funcName; + + handler(_ref) { + let { + parser, + funcName + } = _ref; parser.consumeSpaces(); - var token = parser.fetch(); + const token = parser.fetch(); if (globalMap[token.text]) { // KaTeX doesn't have \par, so ignore \long @@ -8820,6 +8819,7 @@ defineFunction({ throw new src_ParseError("Invalid token after macro prefix", token); } + }); // Basic support for macro definitions: \def, \gdef, \edef, \xdef // -> // -> \def|\gdef|\edef|\xdef @@ -8833,19 +8833,22 @@ defineFunction({ allowedInText: true, primitive: true }, - handler: function handler(_ref2) { - var parser = _ref2.parser, - funcName = _ref2.funcName; - var tok = parser.gullet.popToken(); - var name = tok.text; + + handler(_ref2) { + let { + parser, + funcName + } = _ref2; + let tok = parser.gullet.popToken(); + const name = tok.text; if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) { throw new src_ParseError("Expected a control sequence", tok); } - var numArgs = 0; - var insert; - var delimiters = [[]]; // contains no braces + let numArgs = 0; + let insert; + const delimiters = [[]]; // contains no braces while (parser.gullet.future().text !== "{") { tok = parser.gullet.popToken(); @@ -8883,8 +8886,9 @@ defineFunction({ } // replacement text, enclosed in '{' and '}' and properly nested - var _parser$gullet$consum = parser.gullet.consumeArg(), - tokens = _parser$gullet$consum.tokens; + let { + tokens + } = parser.gullet.consumeArg(); if (insert) { tokens.unshift(insert); @@ -8897,15 +8901,16 @@ defineFunction({ parser.gullet.macros.set(name, { - tokens: tokens, - numArgs: numArgs, - delimiters: delimiters + tokens, + numArgs, + delimiters }, funcName === globalMap[funcName]); return { type: "internal", mode: parser.mode }; } + }); // -> // -> \futurelet // | \let @@ -8920,18 +8925,22 @@ defineFunction({ allowedInText: true, primitive: true }, - handler: function handler(_ref3) { - var parser = _ref3.parser, - funcName = _ref3.funcName; - var name = checkControlSequence(parser.gullet.popToken()); + + handler(_ref3) { + let { + parser, + funcName + } = _ref3; + const name = checkControlSequence(parser.gullet.popToken()); parser.gullet.consumeSpaces(); - var tok = getRHS(parser); + const tok = getRHS(parser); letCommand(parser, name, tok, funcName === "\\\\globallet"); return { type: "internal", mode: parser.mode }; } + }); // ref: https://www.tug.org/TUGboat/tb09-3/tb22bechtolsheim.pdf defineFunction({ @@ -8943,12 +8952,15 @@ defineFunction({ allowedInText: true, primitive: true }, - handler: function handler(_ref4) { - var parser = _ref4.parser, - funcName = _ref4.funcName; - var name = checkControlSequence(parser.gullet.popToken()); - var middle = parser.gullet.popToken(); - var tok = parser.gullet.popToken(); + + handler(_ref4) { + let { + parser, + funcName + } = _ref4; + const name = checkControlSequence(parser.gullet.popToken()); + const middle = parser.gullet.popToken(); + const tok = parser.gullet.popToken(); letCommand(parser, name, tok, funcName === "\\\\globalfuture"); parser.gullet.pushToken(tok); parser.gullet.pushToken(middle); @@ -8957,6 +8969,7 @@ defineFunction({ mode: parser.mode }; } + }); ;// CONCATENATED MODULE: ./src/delimiter.js /** @@ -8995,9 +9008,9 @@ defineFunction({ * Get the metrics for a given symbol and font, after transformation (i.e. * after following replacement from symbols.js) */ -var getMetrics = function getMetrics(symbol, font, mode) { - var replace = src_symbols.math[symbol] && src_symbols.math[symbol].replace; - var metrics = getCharacterMetrics(replace || symbol, font, mode); +const getMetrics = function (symbol, font, mode) { + const replace = src_symbols.math[symbol] && src_symbols.math[symbol].replace; + const metrics = getCharacterMetrics(replace || symbol, font, mode); if (!metrics) { throw new Error("Unsupported symbol " + symbol + " and font size " + font + "."); @@ -9011,19 +9024,19 @@ var getMetrics = function getMetrics(symbol, font, mode) { */ -var styleWrap = function styleWrap(delim, toStyle, options, classes) { - var newOptions = options.havingBaseStyle(toStyle); - var span = buildCommon.makeSpan(classes.concat(newOptions.sizingClasses(options)), [delim], options); - var delimSizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier; +const styleWrap = function (delim, toStyle, options, classes) { + const newOptions = options.havingBaseStyle(toStyle); + const span = buildCommon.makeSpan(classes.concat(newOptions.sizingClasses(options)), [delim], options); + const delimSizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier; span.height *= delimSizeMultiplier; span.depth *= delimSizeMultiplier; span.maxFontSize = newOptions.sizeMultiplier; return span; }; -var centerSpan = function centerSpan(span, options, style) { - var newOptions = options.havingBaseStyle(style); - var shift = (1 - options.sizeMultiplier / newOptions.sizeMultiplier) * options.fontMetrics().axisHeight; +const centerSpan = function (span, options, style) { + const newOptions = options.havingBaseStyle(style); + const shift = (1 - options.sizeMultiplier / newOptions.sizeMultiplier) * options.fontMetrics().axisHeight; span.classes.push("delimcenter"); span.style.top = makeEm(shift); span.height -= shift; @@ -9036,9 +9049,9 @@ var centerSpan = function centerSpan(span, options, style) { */ -var makeSmallDelim = function makeSmallDelim(delim, style, center, options, mode, classes) { - var text = buildCommon.makeSymbol(delim, "Main-Regular", mode, options); - var span = styleWrap(text, style, options, classes); +const makeSmallDelim = function (delim, style, center, options, mode, classes) { + const text = buildCommon.makeSymbol(delim, "Main-Regular", mode, options); + const span = styleWrap(text, style, options, classes); if (center) { centerSpan(span, options, style); @@ -9051,7 +9064,7 @@ var makeSmallDelim = function makeSmallDelim(delim, style, center, options, mode */ -var mathrmSize = function mathrmSize(value, size, mode, options) { +const mathrmSize = function (value, size, mode, options) { return buildCommon.makeSymbol(value, "Size" + size + "-Regular", mode, options); }; /** @@ -9060,9 +9073,9 @@ var mathrmSize = function mathrmSize(value, size, mode, options) { */ -var makeLargeDelim = function makeLargeDelim(delim, size, center, options, mode, classes) { - var inner = mathrmSize(delim, size, mode, options); - var span = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + size], [inner], options), src_Style.TEXT, options, classes); +const makeLargeDelim = function (delim, size, center, options, mode, classes) { + const inner = mathrmSize(delim, size, mode, options); + const span = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + size], [inner], options), src_Style.TEXT, options, classes); if (center) { centerSpan(span, options, src_Style.TEXT); @@ -9076,8 +9089,8 @@ var makeLargeDelim = function makeLargeDelim(delim, size, center, options, mode, */ -var makeGlyphSpan = function makeGlyphSpan(symbol, font, mode) { - var sizeClass; // Apply the correct CSS class to choose the right font. +const makeGlyphSpan = function (symbol, font, mode) { + let sizeClass; // Apply the correct CSS class to choose the right font. if (font === "Size1-Regular") { sizeClass = "delim-size1"; @@ -9087,7 +9100,7 @@ var makeGlyphSpan = function makeGlyphSpan(symbol, font, mode) { sizeClass = "delim-size4"; } - var corner = buildCommon.makeSpan(["delimsizinginner", sizeClass], [buildCommon.makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]); // Since this will be passed into `makeVList` in the end, wrap the element + const corner = buildCommon.makeSpan(["delimsizinginner", sizeClass], [buildCommon.makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]); // Since this will be passed into `makeVList` in the end, wrap the element // in the appropriate tag that VList uses. return { @@ -9096,11 +9109,11 @@ var makeGlyphSpan = function makeGlyphSpan(symbol, font, mode) { }; }; -var makeInner = function makeInner(ch, height, options) { +const makeInner = function (ch, height, options) { // Create a span with inline SVG for the inner part of a tall stacked delimiter. - var width = fontMetricsData["Size4-Regular"][ch.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][ch.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][ch.charCodeAt(0)][4]; - var path = new PathNode("inner", innerPath(ch, Math.round(1000 * height))); - var svgNode = new SvgNode([path], { + const width = fontMetricsData["Size4-Regular"][ch.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][ch.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][ch.charCodeAt(0)][4]; + const path = new PathNode("inner", innerPath(ch, Math.round(1000 * height))); + const svgNode = new SvgNode([path], { "width": makeEm(width), "height": makeEm(height), // Override CSS rule `.katex svg { width: 100% }` @@ -9108,7 +9121,7 @@ var makeInner = function makeInner(ch, height, options) { "viewBox": "0 0 " + 1000 * width + " " + Math.round(1000 * height), "preserveAspectRatio": "xMinYMin" }); - var span = buildCommon.makeSvgSpan([], [svgNode], options); + const span = buildCommon.makeSvgSpan([], [svgNode], options); span.height = height; span.style.height = makeEm(height); span.style.width = makeEm(width); @@ -9119,45 +9132,45 @@ var makeInner = function makeInner(ch, height, options) { }; // Helpers for makeStackedDelim -var lapInEms = 0.008; -var lap = { +const lapInEms = 0.008; +const lap = { type: "kern", size: -1 * lapInEms }; -var verts = ["|", "\\lvert", "\\rvert", "\\vert"]; -var doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"]; +const verts = ["|", "\\lvert", "\\rvert", "\\vert"]; +const doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"]; /** * Make a stacked delimiter out of a given delimiter, with the total height at * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook. */ -var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, options, mode, classes) { +const makeStackedDelim = function (delim, heightTotal, center, options, mode, classes) { // There are four parts, the top, an optional middle, a repeated part, and a // bottom. - var top; - var middle; - var repeat; - var bottom; - var svgLabel = ""; - var viewBoxWidth = 0; + let top; + let middle; + let repeat; + let bottom; + let svgLabel = ""; + let viewBoxWidth = 0; top = repeat = bottom = delim; middle = null; // Also keep track of what font the delimiters are in - var font = "Size1-Regular"; // We set the parts and font based on the symbol. Note that we use + let font = "Size1-Regular"; // We set the parts and font based on the symbol. Note that we use // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the // repeats of the arrows if (delim === "\\uparrow") { - repeat = bottom = "\u23D0"; + repeat = bottom = "\u23d0"; } else if (delim === "\\Uparrow") { repeat = bottom = "\u2016"; } else if (delim === "\\downarrow") { - top = repeat = "\u23D0"; + top = repeat = "\u23d0"; } else if (delim === "\\Downarrow") { top = repeat = "\u2016"; } else if (delim === "\\updownarrow") { top = "\\uparrow"; - repeat = "\u23D0"; + repeat = "\u23d0"; bottom = "\\downarrow"; } else if (delim === "\\Updownarrow") { top = "\\Uparrow"; @@ -9172,145 +9185,145 @@ var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, opt svgLabel = "doublevert"; viewBoxWidth = 556; } else if (delim === "[" || delim === "\\lbrack") { - top = "\u23A1"; - repeat = "\u23A2"; - bottom = "\u23A3"; + top = "\u23a1"; + repeat = "\u23a2"; + bottom = "\u23a3"; font = "Size4-Regular"; svgLabel = "lbrack"; viewBoxWidth = 667; } else if (delim === "]" || delim === "\\rbrack") { - top = "\u23A4"; - repeat = "\u23A5"; - bottom = "\u23A6"; + top = "\u23a4"; + repeat = "\u23a5"; + bottom = "\u23a6"; font = "Size4-Regular"; svgLabel = "rbrack"; viewBoxWidth = 667; - } else if (delim === "\\lfloor" || delim === "\u230A") { - repeat = top = "\u23A2"; - bottom = "\u23A3"; + } else if (delim === "\\lfloor" || delim === "\u230a") { + repeat = top = "\u23a2"; + bottom = "\u23a3"; font = "Size4-Regular"; svgLabel = "lfloor"; viewBoxWidth = 667; } else if (delim === "\\lceil" || delim === "\u2308") { - top = "\u23A1"; - repeat = bottom = "\u23A2"; + top = "\u23a1"; + repeat = bottom = "\u23a2"; font = "Size4-Regular"; svgLabel = "lceil"; viewBoxWidth = 667; - } else if (delim === "\\rfloor" || delim === "\u230B") { - repeat = top = "\u23A5"; - bottom = "\u23A6"; + } else if (delim === "\\rfloor" || delim === "\u230b") { + repeat = top = "\u23a5"; + bottom = "\u23a6"; font = "Size4-Regular"; svgLabel = "rfloor"; viewBoxWidth = 667; } else if (delim === "\\rceil" || delim === "\u2309") { - top = "\u23A4"; - repeat = bottom = "\u23A5"; + top = "\u23a4"; + repeat = bottom = "\u23a5"; font = "Size4-Regular"; svgLabel = "rceil"; viewBoxWidth = 667; } else if (delim === "(" || delim === "\\lparen") { - top = "\u239B"; - repeat = "\u239C"; - bottom = "\u239D"; + top = "\u239b"; + repeat = "\u239c"; + bottom = "\u239d"; font = "Size4-Regular"; svgLabel = "lparen"; viewBoxWidth = 875; } else if (delim === ")" || delim === "\\rparen") { - top = "\u239E"; - repeat = "\u239F"; - bottom = "\u23A0"; + top = "\u239e"; + repeat = "\u239f"; + bottom = "\u23a0"; font = "Size4-Regular"; svgLabel = "rparen"; viewBoxWidth = 875; } else if (delim === "\\{" || delim === "\\lbrace") { - top = "\u23A7"; - middle = "\u23A8"; - bottom = "\u23A9"; - repeat = "\u23AA"; + top = "\u23a7"; + middle = "\u23a8"; + bottom = "\u23a9"; + repeat = "\u23aa"; font = "Size4-Regular"; } else if (delim === "\\}" || delim === "\\rbrace") { - top = "\u23AB"; - middle = "\u23AC"; - bottom = "\u23AD"; - repeat = "\u23AA"; + top = "\u23ab"; + middle = "\u23ac"; + bottom = "\u23ad"; + repeat = "\u23aa"; font = "Size4-Regular"; - } else if (delim === "\\lgroup" || delim === "\u27EE") { - top = "\u23A7"; - bottom = "\u23A9"; - repeat = "\u23AA"; + } else if (delim === "\\lgroup" || delim === "\u27ee") { + top = "\u23a7"; + bottom = "\u23a9"; + repeat = "\u23aa"; font = "Size4-Regular"; - } else if (delim === "\\rgroup" || delim === "\u27EF") { - top = "\u23AB"; - bottom = "\u23AD"; - repeat = "\u23AA"; + } else if (delim === "\\rgroup" || delim === "\u27ef") { + top = "\u23ab"; + bottom = "\u23ad"; + repeat = "\u23aa"; font = "Size4-Regular"; - } else if (delim === "\\lmoustache" || delim === "\u23B0") { - top = "\u23A7"; - bottom = "\u23AD"; - repeat = "\u23AA"; + } else if (delim === "\\lmoustache" || delim === "\u23b0") { + top = "\u23a7"; + bottom = "\u23ad"; + repeat = "\u23aa"; font = "Size4-Regular"; - } else if (delim === "\\rmoustache" || delim === "\u23B1") { - top = "\u23AB"; - bottom = "\u23A9"; - repeat = "\u23AA"; + } else if (delim === "\\rmoustache" || delim === "\u23b1") { + top = "\u23ab"; + bottom = "\u23a9"; + repeat = "\u23aa"; font = "Size4-Regular"; } // Get the metrics of the four sections - var topMetrics = getMetrics(top, font, mode); - var topHeightTotal = topMetrics.height + topMetrics.depth; - var repeatMetrics = getMetrics(repeat, font, mode); - var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth; - var bottomMetrics = getMetrics(bottom, font, mode); - var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth; - var middleHeightTotal = 0; - var middleFactor = 1; + const topMetrics = getMetrics(top, font, mode); + const topHeightTotal = topMetrics.height + topMetrics.depth; + const repeatMetrics = getMetrics(repeat, font, mode); + const repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth; + const bottomMetrics = getMetrics(bottom, font, mode); + const bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth; + let middleHeightTotal = 0; + let middleFactor = 1; if (middle !== null) { - var middleMetrics = getMetrics(middle, font, mode); + const middleMetrics = getMetrics(middle, font, mode); middleHeightTotal = middleMetrics.height + middleMetrics.depth; middleFactor = 2; // repeat symmetrically above and below middle } // Calculate the minimal height that the delimiter can have. // It is at least the size of the top, bottom, and optional middle combined. - var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal; // Compute the number of copies of the repeat symbol we will need + const minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal; // Compute the number of copies of the repeat symbol we will need - var repeatCount = Math.max(0, Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal))); // Compute the total height of the delimiter including all the symbols + const repeatCount = Math.max(0, Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal))); // Compute the total height of the delimiter including all the symbols - var realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal; // The center of the delimiter is placed at the center of the axis. Note + const realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal; // The center of the delimiter is placed at the center of the axis. Note // that in this context, "center" means that the delimiter should be // centered around the axis in the current style, while normally it is // centered around the axis in textstyle. - var axisHeight = options.fontMetrics().axisHeight; + let axisHeight = options.fontMetrics().axisHeight; if (center) { axisHeight *= options.sizeMultiplier; } // Calculate the depth - var depth = realHeightTotal / 2 - axisHeight; // Now, we start building the pieces that will go into the vlist + const depth = realHeightTotal / 2 - axisHeight; // Now, we start building the pieces that will go into the vlist // Keep a list of the pieces of the stacked delimiter - var stack = []; + const stack = []; if (svgLabel.length > 0) { // Instead of stacking glyphs, create a single SVG. // This evades browser problems with imprecise positioning of spans. - var midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal; - var viewBoxHeight = Math.round(realHeightTotal * 1000); - var pathStr = tallDelim(svgLabel, Math.round(midHeight * 1000)); - var path = new PathNode(svgLabel, pathStr); - var width = (viewBoxWidth / 1000).toFixed(3) + "em"; - var height = (viewBoxHeight / 1000).toFixed(3) + "em"; - var svg = new SvgNode([path], { + const midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal; + const viewBoxHeight = Math.round(realHeightTotal * 1000); + const pathStr = tallDelim(svgLabel, Math.round(midHeight * 1000)); + const path = new PathNode(svgLabel, pathStr); + const width = (viewBoxWidth / 1000).toFixed(3) + "em"; + const height = (viewBoxHeight / 1000).toFixed(3) + "em"; + const svg = new SvgNode([path], { "width": width, "height": height, "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight }); - var wrapper = buildCommon.makeSvgSpan([], [svg], options); + const wrapper = buildCommon.makeSvgSpan([], [svg], options); wrapper.height = viewBoxHeight / 1000; wrapper.style.width = width; wrapper.style.height = height; @@ -9327,19 +9340,18 @@ var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, opt if (middle === null) { // The middle section will be an SVG. Make it an extra 0.016em tall. // We'll overlap by 0.008em at top and bottom. - var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms; + const innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms; stack.push(makeInner(repeat, innerHeight, options)); } else { // When there is a middle bit, we need the middle part and two repeated // sections - var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms; - - stack.push(makeInner(repeat, _innerHeight, options)); // Now insert the middle of the brace. + const innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms; + stack.push(makeInner(repeat, innerHeight, options)); // Now insert the middle of the brace. stack.push(lap); stack.push(makeGlyphSpan(middle, font, mode)); stack.push(lap); - stack.push(makeInner(repeat, _innerHeight, options)); + stack.push(makeInner(repeat, innerHeight, options)); } // Add the top symbol @@ -9348,8 +9360,8 @@ var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, opt } // Finally, build the vlist - var newOptions = options.havingBaseStyle(src_Style.TEXT); - var inner = buildCommon.makeVList({ + const newOptions = options.havingBaseStyle(src_Style.TEXT); + const inner = buildCommon.makeVList({ positionType: "bottom", positionData: depth, children: stack @@ -9359,14 +9371,14 @@ var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, opt // That keeps browser span height rounding error from pinching the line. -var vbPad = 80; // padding above the surd, measured inside the viewBox. +const vbPad = 80; // padding above the surd, measured inside the viewBox. -var emPad = 0.08; // padding, in ems, measured in the document. +const emPad = 0.08; // padding, in ems, measured in the document. -var sqrtSvg = function sqrtSvg(sqrtName, height, viewBoxHeight, extraVinculum, options) { - var path = sqrtPath(sqrtName, extraVinculum, viewBoxHeight); - var pathNode = new PathNode(sqrtName, path); - var svg = new SvgNode([pathNode], { +const sqrtSvg = function (sqrtName, height, viewBoxHeight, extraVinculum, options) { + const path = sqrtPath(sqrtName, extraVinculum, viewBoxHeight); + const pathNode = new PathNode(sqrtName, path); + const svg = new SvgNode([pathNode], { // Note: 1000:1 ratio of viewBox to document em width. "width": "400em", "height": makeEm(height), @@ -9380,23 +9392,23 @@ var sqrtSvg = function sqrtSvg(sqrtName, height, viewBoxHeight, extraVinculum, o */ -var makeSqrtImage = function makeSqrtImage(height, options) { +const makeSqrtImage = function (height, options) { // Define a newOptions that removes the effect of size changes such as \Huge. // We don't pick different a height surd for \Huge. For it, we scale up. - var newOptions = options.havingBaseSizing(); // Pick the desired surd glyph from a sequence of surds. + const newOptions = options.havingBaseSizing(); // Pick the desired surd glyph from a sequence of surds. - var delim = traverseSequence("\\surd", height * newOptions.sizeMultiplier, stackLargeDelimiterSequence, newOptions); - var sizeMultiplier = newOptions.sizeMultiplier; // default + const delim = traverseSequence("\\surd", height * newOptions.sizeMultiplier, stackLargeDelimiterSequence, newOptions); + let sizeMultiplier = newOptions.sizeMultiplier; // default // The standard sqrt SVGs each have a 0.04em thick vinculum. // If Settings.minRuleThickness is larger than that, we add extraVinculum. - var extraVinculum = Math.max(0, options.minRuleThickness - options.fontMetrics().sqrtRuleThickness); // Create a span containing an SVG image of a sqrt symbol. + const extraVinculum = Math.max(0, options.minRuleThickness - options.fontMetrics().sqrtRuleThickness); // Create a span containing an SVG image of a sqrt symbol. - var span; - var spanHeight = 0; - var texHeight = 0; - var viewBoxHeight = 0; - var advanceWidth; // We create viewBoxes with 80 units of "padding" above each surd. + let span; + let spanHeight = 0; + let texHeight = 0; + let viewBoxHeight = 0; + let advanceWidth; // We create viewBoxes with 80 units of "padding" above each surd. // Then browser rounding error on the parent span height will not // encroach on the ink of the vinculum. But that padding is not // included in the TeX-like `height` used for calculation of @@ -9440,8 +9452,8 @@ var makeSqrtImage = function makeSqrtImage(height, options) { span.height = texHeight; span.style.height = makeEm(spanHeight); return { - span: span, - advanceWidth: advanceWidth, + span, + advanceWidth, // Calculate the actual line width. // This actually should depend on the chosen font -- e.g. \boldmath // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and @@ -9452,24 +9464,24 @@ var makeSqrtImage = function makeSqrtImage(height, options) { // too large -var stackLargeDelimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230A", "\u230B", "\\lceil", "\\rceil", "\u2308", "\u2309", "\\surd"]; // delimiters that always stack +const stackLargeDelimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230a", "\u230b", "\\lceil", "\\rceil", "\u2308", "\u2309", "\\surd"]; // delimiters that always stack -var stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27EE", "\u27EF", "\\lmoustache", "\\rmoustache", "\u23B0", "\u23B1"]; // and delimiters that never stack +const stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27ee", "\u27ef", "\\lmoustache", "\\rmoustache", "\u23b0", "\u23b1"]; // and delimiters that never stack -var stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"]; // Metrics of the different sizes. Found by looking at TeX's output of +const stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"]; // Metrics of the different sizes. Found by looking at TeX's output of // $\bigl| // \Bigl| \biggl| \Biggl| \showlists$ // Used to create stacked delimiters of appropriate sizes in makeSizedDelim. -var sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0]; +const sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0]; /** * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4. */ -var makeSizedDelim = function makeSizedDelim(delim, size, options, mode, classes) { +const makeSizedDelim = function (delim, size, options, mode, classes) { // < and > turn into \langle and \rangle in delimiters - if (delim === "<" || delim === "\\lt" || delim === "\u27E8") { + if (delim === "<" || delim === "\\lt" || delim === "\u27e8") { delim = "\\langle"; - } else if (delim === ">" || delim === "\\gt" || delim === "\u27E9") { + } else if (delim === ">" || delim === "\\gt" || delim === "\u27e9") { delim = "\\rangle"; } // Sized delimiters are never centered. @@ -9496,7 +9508,7 @@ var makeSizedDelim = function makeSizedDelim(delim, size, options, mode, classes // Delimiters that never stack try small delimiters and large delimiters only -var stackNeverDelimiterSequence = [{ +const stackNeverDelimiterSequence = [{ type: "small", style: src_Style.SCRIPTSCRIPT }, { @@ -9519,7 +9531,7 @@ var stackNeverDelimiterSequence = [{ size: 4 }]; // Delimiters that always stack try the small delimiters first, then stack -var stackAlwaysDelimiterSequence = [{ +const stackAlwaysDelimiterSequence = [{ type: "small", style: src_Style.SCRIPTSCRIPT }, { @@ -9533,7 +9545,7 @@ var stackAlwaysDelimiterSequence = [{ }]; // Delimiters that stack when large try the small and then large delimiters, and // stack afterwards -var stackLargeDelimiterSequence = [{ +const stackLargeDelimiterSequence = [{ type: "small", style: src_Style.SCRIPTSCRIPT }, { @@ -9562,7 +9574,7 @@ var stackLargeDelimiterSequence = [{ * TODO(#963) Use more specific font family return type once that is introduced. */ -var delimTypeToFont = function delimTypeToFont(type) { +const delimTypeToFont = function (type) { if (type.type === "small") { return "Main-Regular"; } else if (type.type === "large") { @@ -9579,25 +9591,25 @@ var delimTypeToFont = function delimTypeToFont(type) { */ -var traverseSequence = function traverseSequence(delim, height, sequence, options) { +const traverseSequence = function (delim, height, sequence, options) { // Here, we choose the index we should start at in the sequences. In smaller // sizes (which correspond to larger numbers in style.size) we start earlier // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2 - var start = Math.min(2, 3 - options.style.size); + const start = Math.min(2, 3 - options.style.size); - for (var i = start; i < sequence.length; i++) { + for (let i = start; i < sequence.length; i++) { if (sequence[i].type === "stack") { // This is always the last delimiter, so we just break the loop now. break; } - var metrics = getMetrics(delim, delimTypeToFont(sequence[i]), "math"); - var heightDepth = metrics.height + metrics.depth; // Small delimiters are scaled down versions of the same font, so we + const metrics = getMetrics(delim, delimTypeToFont(sequence[i]), "math"); + let heightDepth = metrics.height + metrics.depth; // Small delimiters are scaled down versions of the same font, so we // account for the style change size. if (sequence[i].type === "small") { - var newOptions = options.havingBaseStyle(sequence[i].style); + const newOptions = options.havingBaseStyle(sequence[i].style); heightDepth *= newOptions.sizeMultiplier; } // Check if the delimiter at this size works for the given height. @@ -9616,15 +9628,15 @@ var traverseSequence = function traverseSequence(delim, height, sequence, option */ -var makeCustomSizedDelim = function makeCustomSizedDelim(delim, height, center, options, mode, classes) { - if (delim === "<" || delim === "\\lt" || delim === "\u27E8") { +const makeCustomSizedDelim = function (delim, height, center, options, mode, classes) { + if (delim === "<" || delim === "\\lt" || delim === "\u27e8") { delim = "\\langle"; - } else if (delim === ">" || delim === "\\gt" || delim === "\u27E9") { + } else if (delim === ">" || delim === "\\gt" || delim === "\u27e9") { delim = "\\rangle"; } // Decide what sequence to use - var sequence; + let sequence; if (utils.contains(stackNeverDelimiters, delim)) { sequence = stackNeverDelimiterSequence; @@ -9635,7 +9647,7 @@ var makeCustomSizedDelim = function makeCustomSizedDelim(delim, height, center, } // Look through the sequence - var delimType = traverseSequence(delim, height, sequence, options); // Get the delimiter from font glyphs. + const delimType = traverseSequence(delim, height, sequence, options); // Get the delimiter from font glyphs. // Depending on the sequence element we decided on, call the // appropriate function. @@ -9655,14 +9667,14 @@ var makeCustomSizedDelim = function makeCustomSizedDelim(delim, height, center, */ -var makeLeftRightDelim = function makeLeftRightDelim(delim, height, depth, options, mode, classes) { +const makeLeftRightDelim = function (delim, height, depth, options, mode, classes) { // We always center \left/\right delimiters, so the axis is always shifted - var axisHeight = options.fontMetrics().axisHeight * options.sizeMultiplier; // Taken from TeX source, tex.web, function make_left_right + const axisHeight = options.fontMetrics().axisHeight * options.sizeMultiplier; // Taken from TeX source, tex.web, function make_left_right - var delimiterFactor = 901; - var delimiterExtend = 5.0 / options.fontMetrics().ptPerEm; - var maxDistFromAxis = Math.max(height - axisHeight, depth + axisHeight); - var totalHeight = Math.max( // In real TeX, calculations are done using integral values which are + const delimiterFactor = 901; + const delimiterExtend = 5.0 / options.fontMetrics().ptPerEm; + const maxDistFromAxis = Math.max(height - axisHeight, depth + axisHeight); + const totalHeight = Math.max( // In real TeX, calculations are done using integral values which are // 65536 per pt, or 655360 per em. So, the division here truncates in // TeX but doesn't here, producing different results. If we wanted to // exactly match TeX's calculation, we could do @@ -9696,7 +9708,7 @@ var makeLeftRightDelim = function makeLeftRightDelim(delim, height, depth, optio // Extra data needed for the delimiter handler down below -var delimiterSizes = { +const delimiterSizes = { "\\bigl": { mclass: "mopen", size: 1 @@ -9762,11 +9774,11 @@ var delimiterSizes = { size: 4 } }; -var delimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230A", "\u230B", "\\lceil", "\\rceil", "\u2308", "\u2309", "<", ">", "\\langle", "\u27E8", "\\rangle", "\u27E9", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27EE", "\u27EF", "\\lmoustache", "\\rmoustache", "\u23B0", "\u23B1", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."]; +const delimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230a", "\u230b", "\\lceil", "\\rceil", "\u2308", "\u2309", "<", ">", "\\langle", "\u27e8", "\\rangle", "\u27e9", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27ee", "\u27ef", "\\lmoustache", "\\rmoustache", "\u23b0", "\u23b1", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."]; // Delimiter functions function checkDelimiter(delim, context) { - var symDelim = checkSymbolNodeType(delim); + const symDelim = checkSymbolNodeType(delim); if (symDelim && utils.contains(delimiters, symDelim.text)) { return symDelim; @@ -9784,8 +9796,8 @@ defineFunction({ numArgs: 1, argTypes: ["primitive"] }, - handler: function handler(context, args) { - var delim = checkDelimiter(args[0], context); + handler: (context, args) => { + const delim = checkDelimiter(args[0], context); return { type: "delimsizing", mode: context.parser.mode, @@ -9794,7 +9806,7 @@ defineFunction({ delim: delim.text }; }, - htmlBuilder: function htmlBuilder(group, options) { + htmlBuilder: (group, options) => { if (group.delim === ".") { // Empty delimiters still count as elements, even though they don't // show anything. @@ -9804,14 +9816,14 @@ defineFunction({ return delimiter.sizedDelim(group.delim, group.size, options, group.mode, [group.mclass]); }, - mathmlBuilder: function mathmlBuilder(group) { - var children = []; + mathmlBuilder: group => { + const children = []; if (group.delim !== ".") { children.push(makeText(group.delim, group.mode)); } - var node = new mathMLTree.MathNode("mo", children); + const node = new mathMLTree.MathNode("mo", children); if (group.mclass === "mopen" || group.mclass === "mclose") { // Only some of the delimsizing functions act as fences, and they @@ -9824,7 +9836,7 @@ defineFunction({ } node.setAttribute("stretchy", "true"); - var size = makeEm(delimiter.sizeToMaxHeight[group.size]); + const size = makeEm(delimiter.sizeToMaxHeight[group.size]); node.setAttribute("minsize", size); node.setAttribute("maxsize", size); return node; @@ -9844,11 +9856,11 @@ defineFunction({ numArgs: 1, primitive: true }, - handler: function handler(context, args) { + handler: (context, args) => { // \left case below triggers parsing of \right in // `const right = parser.parseFunction();` // uses this return value. - var color = context.parser.gullet.macros.get("\\current@color"); + const color = context.parser.gullet.macros.get("\\current@color"); if (color && typeof color !== "string") { throw new src_ParseError("\\current@color set to non-string in \\right"); @@ -9858,7 +9870,7 @@ defineFunction({ type: "leftright-right", mode: context.parser.mode, delim: checkDelimiter(args[0], context).text, - color: color // undefined if not set via \color + color // undefined if not set via \color }; } @@ -9870,35 +9882,35 @@ defineFunction({ numArgs: 1, primitive: true }, - handler: function handler(context, args) { - var delim = checkDelimiter(args[0], context); - var parser = context.parser; // Parse out the implicit body + handler: (context, args) => { + const delim = checkDelimiter(args[0], context); + const parser = context.parser; // Parse out the implicit body ++parser.leftrightDepth; // parseExpression stops before '\\right' - var body = parser.parseExpression(false); + const body = parser.parseExpression(false); --parser.leftrightDepth; // Check the next token parser.expect("\\right", false); - var right = assertNodeType(parser.parseFunction(), "leftright-right"); + const right = assertNodeType(parser.parseFunction(), "leftright-right"); return { type: "leftright", mode: parser.mode, - body: body, + body, left: delim.text, right: right.delim, rightColor: right.color }; }, - htmlBuilder: function htmlBuilder(group, options) { + htmlBuilder: (group, options) => { assertParsed(group); // Build the inner expression - var inner = buildExpression(group.body, options, true, ["mopen", "mclose"]); - var innerHeight = 0; - var innerDepth = 0; - var hadMiddle = false; // Calculate its height and depth + const inner = buildExpression(group.body, options, true, ["mopen", "mclose"]); + let innerHeight = 0; + let innerDepth = 0; + let hadMiddle = false; // Calculate its height and depth - for (var i = 0; i < inner.length; i++) { + for (let i = 0; i < inner.length; i++) { // Property `isMiddle` not defined on `span`. See comment in // "middle"'s htmlBuilder. // $FlowFixMe @@ -9915,7 +9927,7 @@ defineFunction({ innerHeight *= options.sizeMultiplier; innerDepth *= options.sizeMultiplier; - var leftDelim; + let leftDelim; if (group.left === ".") { // Empty delimiters in \left and \right make null delimiter spaces. @@ -9930,26 +9942,26 @@ defineFunction({ inner.unshift(leftDelim); // Handle middle delimiters if (hadMiddle) { - for (var _i = 1; _i < inner.length; _i++) { - var middleDelim = inner[_i]; // Property `isMiddle` not defined on `span`. See comment in + for (let i = 1; i < inner.length; i++) { + const middleDelim = inner[i]; // Property `isMiddle` not defined on `span`. See comment in // "middle"'s htmlBuilder. // $FlowFixMe - var isMiddle = middleDelim.isMiddle; + const isMiddle = middleDelim.isMiddle; if (isMiddle) { // Apply the options that were active when \middle was called - inner[_i] = delimiter.leftRightDelim(isMiddle.delim, innerHeight, innerDepth, isMiddle.options, group.mode, []); + inner[i] = delimiter.leftRightDelim(isMiddle.delim, innerHeight, innerDepth, isMiddle.options, group.mode, []); } } } - var rightDelim; // Same for the right delimiter, but using color specified by \color + let rightDelim; // Same for the right delimiter, but using color specified by \color if (group.right === ".") { rightDelim = makeNullDelimiter(options, ["mclose"]); } else { - var colorOptions = group.rightColor ? options.withColor(group.rightColor) : options; + const colorOptions = group.rightColor ? options.withColor(group.rightColor) : options; rightDelim = delimiter.leftRightDelim(group.right, innerHeight, innerDepth, colorOptions, group.mode, ["mclose"]); } // Add it to the end of the expression. @@ -9957,18 +9969,18 @@ defineFunction({ inner.push(rightDelim); return buildCommon.makeSpan(["minner"], inner, options); }, - mathmlBuilder: function mathmlBuilder(group, options) { + mathmlBuilder: (group, options) => { assertParsed(group); - var inner = buildMathML_buildExpression(group.body, options); + const inner = buildMathML_buildExpression(group.body, options); if (group.left !== ".") { - var leftNode = new mathMLTree.MathNode("mo", [makeText(group.left, group.mode)]); + const leftNode = new mathMLTree.MathNode("mo", [makeText(group.left, group.mode)]); leftNode.setAttribute("fence", "true"); inner.unshift(leftNode); } if (group.right !== ".") { - var rightNode = new mathMLTree.MathNode("mo", [makeText(group.right, group.mode)]); + const rightNode = new mathMLTree.MathNode("mo", [makeText(group.right, group.mode)]); rightNode.setAttribute("fence", "true"); if (group.rightColor) { @@ -9988,8 +10000,8 @@ defineFunction({ numArgs: 1, primitive: true }, - handler: function handler(context, args) { - var delim = checkDelimiter(args[0], context); + handler: (context, args) => { + const delim = checkDelimiter(args[0], context); if (!context.parser.leftrightDepth) { throw new src_ParseError("\\middle without preceding \\left", delim); @@ -10001,16 +10013,16 @@ defineFunction({ delim: delim.text }; }, - htmlBuilder: function htmlBuilder(group, options) { - var middleDelim; + htmlBuilder: (group, options) => { + let middleDelim; if (group.delim === ".") { middleDelim = makeNullDelimiter(options, []); } else { middleDelim = delimiter.sizedDelim(group.delim, 1, options, group.mode, []); - var isMiddle = { + const isMiddle = { delim: group.delim, - options: options + options }; // Property `isMiddle` not defined on `span`. It is only used in // this file above. // TODO: Fix this violation of the `span` type and possibly rename @@ -10022,13 +10034,13 @@ defineFunction({ return middleDelim; }, - mathmlBuilder: function mathmlBuilder(group, options) { + mathmlBuilder: (group, options) => { // A Firefox \middle will stretch a character vertically only if it // is in the fence part of the operator dictionary at: // https://www.w3.org/TR/MathML3/appendixc.html. // So we need to avoid U+2223 and use plain "|" instead. - var textNode = group.delim === "\\vert" || group.delim === "|" ? makeText("|", "text") : makeText(group.delim, group.mode); - var middleNode = new mathMLTree.MathNode("mo", [textNode]); + const textNode = group.delim === "\\vert" || group.delim === "|" ? makeText("|", "text") : makeText(group.delim, group.mode); + const middleNode = new mathMLTree.MathNode("mo", [textNode]); middleNode.setAttribute("fence", "true"); // MathML gives 5/18em spacing to each element. // \middle should get delimiter spacing instead. @@ -10050,21 +10062,21 @@ defineFunction({ -var enclose_htmlBuilder = function htmlBuilder(group, options) { +const enclose_htmlBuilder = (group, options) => { // \cancel, \bcancel, \xcancel, \sout, \fbox, \colorbox, \fcolorbox, \phase // Some groups can return document fragments. Handle those by wrapping // them in a span. - var inner = buildCommon.wrapFragment(buildGroup(group.body, options), options); - var label = group.label.slice(1); - var scale = options.sizeMultiplier; - var img; - var imgShift = 0; // In the LaTeX cancel package, line geometry is slightly different + const inner = buildCommon.wrapFragment(buildGroup(group.body, options), options); + const label = group.label.slice(1); + let scale = options.sizeMultiplier; + let img; + let imgShift = 0; // In the LaTeX cancel package, line geometry is slightly different // depending on whether the subject is wider than it is tall, or vice versa. // We don't know the width of a group, so as a proxy, we test if // the subject is a single character. This captures most of the // subjects that should get the "tall" treatment. - var isSingleChar = utils.isCharacterBox(group.body); + const isSingleChar = utils.isCharacterBox(group.body); if (label === "sout") { img = buildCommon.makeSpan(["stretchy", "sout"]); @@ -10072,24 +10084,24 @@ var enclose_htmlBuilder = function htmlBuilder(group, options) { imgShift = -0.5 * options.fontMetrics().xHeight; } else if (label === "phase") { // Set a couple of dimensions from the steinmetz package. - var lineWeight = calculateSize({ + const lineWeight = calculateSize({ number: 0.6, unit: "pt" }, options); - var clearance = calculateSize({ + const clearance = calculateSize({ number: 0.35, unit: "ex" }, options); // Prevent size changes like \Huge from affecting line thickness - var newOptions = options.havingBaseSizing(); + const newOptions = options.havingBaseSizing(); scale = scale / newOptions.sizeMultiplier; - var angleHeight = inner.height + inner.depth + lineWeight + clearance; // Reserve a left pad for the angle. + const angleHeight = inner.height + inner.depth + lineWeight + clearance; // Reserve a left pad for the angle. inner.style.paddingLeft = makeEm(angleHeight / 2 + lineWeight); // Create an SVG - var viewBoxHeight = Math.floor(1000 * angleHeight * scale); - var path = phasePath(viewBoxHeight); - var svgNode = new SvgNode([new PathNode("phase", path)], { + const viewBoxHeight = Math.floor(1000 * angleHeight * scale); + const path = phasePath(viewBoxHeight); + const svgNode = new SvgNode([new PathNode("phase", path)], { "width": "400em", "height": makeEm(viewBoxHeight / 1000), "viewBox": "0 0 400000 " + viewBoxHeight, @@ -10112,9 +10124,9 @@ var enclose_htmlBuilder = function htmlBuilder(group, options) { } // Add vertical padding - var topPad = 0; - var bottomPad = 0; - var ruleThickness = 0; // ref: cancel package: \advance\totalheight2\p@ % "+2" + let topPad = 0; + let bottomPad = 0; + let ruleThickness = 0; // ref: cancel package: \advance\totalheight2\p@ % "+2" if (/box/.test(label)) { ruleThickness = Math.max(options.fontMetrics().fboxrule, // default @@ -10153,7 +10165,7 @@ var enclose_htmlBuilder = function htmlBuilder(group, options) { } } - var vlist; + let vlist; if (group.backgroundColor) { vlist = buildCommon.makeVList({ @@ -10170,7 +10182,7 @@ var enclose_htmlBuilder = function htmlBuilder(group, options) { }] }, options); } else { - var classes = /cancel|phase/.test(label) ? ["svg-align"] : []; + const classes = /cancel|phase/.test(label) ? ["svg-align"] : []; vlist = buildCommon.makeVList({ positionType: "individualShift", children: [// Write the \cancel stroke on top of inner. @@ -10202,9 +10214,9 @@ var enclose_htmlBuilder = function htmlBuilder(group, options) { } }; -var enclose_mathmlBuilder = function mathmlBuilder(group, options) { - var fboxsep = 0; - var node = new mathMLTree.MathNode(group.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildMathML_buildGroup(group.body, options)]); +const enclose_mathmlBuilder = (group, options) => { + let fboxsep = 0; + const node = new mathMLTree.MathNode(group.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildMathML_buildGroup(group.body, options)]); switch (group.label) { case "\\cancel": @@ -10243,7 +10255,7 @@ var enclose_mathmlBuilder = function mathmlBuilder(group, options) { node.setAttribute("voffset", fboxsep + "pt"); if (group.label === "\\fcolorbox") { - var thk = Math.max(options.fontMetrics().fboxrule, // default + const thk = Math.max(options.fontMetrics().fboxrule, // default options.minRuleThickness // user override ); node.setAttribute("style", "border: " + thk + "em solid " + String(group.borderColor)); @@ -10271,19 +10283,23 @@ defineFunction({ allowedInText: true, argTypes: ["color", "text"] }, - handler: function handler(_ref, args, optArgs) { - var parser = _ref.parser, - funcName = _ref.funcName; - var color = assertNodeType(args[0], "color-token").color; - var body = args[1]; + + handler(_ref, args, optArgs) { + let { + parser, + funcName + } = _ref; + const color = assertNodeType(args[0], "color-token").color; + const body = args[1]; return { type: "enclose", mode: parser.mode, label: funcName, backgroundColor: color, - body: body + body }; }, + htmlBuilder: enclose_htmlBuilder, mathmlBuilder: enclose_mathmlBuilder }); @@ -10295,21 +10311,25 @@ defineFunction({ allowedInText: true, argTypes: ["color", "color", "text"] }, - handler: function handler(_ref2, args, optArgs) { - var parser = _ref2.parser, - funcName = _ref2.funcName; - var borderColor = assertNodeType(args[0], "color-token").color; - var backgroundColor = assertNodeType(args[1], "color-token").color; - var body = args[2]; + + handler(_ref2, args, optArgs) { + let { + parser, + funcName + } = _ref2; + const borderColor = assertNodeType(args[0], "color-token").color; + const backgroundColor = assertNodeType(args[1], "color-token").color; + const body = args[2]; return { type: "enclose", mode: parser.mode, label: funcName, - backgroundColor: backgroundColor, - borderColor: borderColor, - body: body + backgroundColor, + borderColor, + body }; }, + htmlBuilder: enclose_htmlBuilder, mathmlBuilder: enclose_mathmlBuilder }); @@ -10321,8 +10341,11 @@ defineFunction({ argTypes: ["hbox"], allowedInText: true }, - handler: function handler(_ref3, args) { - var parser = _ref3.parser; + + handler(_ref3, args) { + let { + parser + } = _ref3; return { type: "enclose", mode: parser.mode, @@ -10330,6 +10353,7 @@ defineFunction({ body: args[0] }; } + }); defineFunction({ type: "enclose", @@ -10337,17 +10361,21 @@ defineFunction({ props: { numArgs: 1 }, - handler: function handler(_ref4, args) { - var parser = _ref4.parser, - funcName = _ref4.funcName; - var body = args[0]; + + handler(_ref4, args) { + let { + parser, + funcName + } = _ref4; + const body = args[0]; return { type: "enclose", mode: parser.mode, label: funcName, - body: body + body }; }, + htmlBuilder: enclose_htmlBuilder, mathmlBuilder: enclose_mathmlBuilder }); @@ -10359,8 +10387,11 @@ defineFunction({ argTypes: ["hbox"], allowedInText: false }, - handler: function handler(_ref5, args) { - var parser = _ref5.parser; + + handler(_ref5, args) { + let { + parser + } = _ref5; return { type: "enclose", mode: parser.mode, @@ -10368,6 +10399,7 @@ defineFunction({ body: args[0] }; } + }); ;// CONCATENATED MODULE: ./src/defineEnvironment.js @@ -10377,24 +10409,26 @@ defineFunction({ * `environments.js` exports this same dictionary again and makes it public. * `Parser.js` requires this dictionary via `environments.js`. */ -var _environments = {}; +const _environments = {}; function defineEnvironment(_ref) { - var type = _ref.type, - names = _ref.names, - props = _ref.props, - handler = _ref.handler, - htmlBuilder = _ref.htmlBuilder, - mathmlBuilder = _ref.mathmlBuilder; + let { + type, + names, + props, + handler, + htmlBuilder, + mathmlBuilder + } = _ref; // Set default values of environments. - var data = { - type: type, + const data = { + type, numArgs: props.numArgs || 0, allowedInText: false, numOptionalArgs: 0, - handler: handler + handler }; - for (var i = 0; i < names.length; ++i) { + for (let i = 0; i < names.length; ++i) { // TODO: The value type of _environments should be a type union of all // possible `EnvSpec<>` possibilities instead of `EnvSpec<*>`, which is // an existential type. @@ -10417,7 +10451,7 @@ function defineEnvironment(_ref) { * `macros.js` exports this same dictionary again and makes it public. * `Parser.js` requires this dictionary via `macros.js`. */ -var _macros = {}; // This function might one day accept an additional argument and do more things. +const _macros = {}; // This function might one day accept an additional argument and do more things. function defineMacro(name, body) { _macros[name] = body; @@ -10427,12 +10461,12 @@ function defineMacro(name, body) { * Lexing or parsing positional information for error reporting. * This object is immutable. */ -var SourceLocation = /*#__PURE__*/function () { +class SourceLocation { // The + prefix indicates that these fields aren't writeable // Lexer holding the input string. // Start offset, zero-based inclusive. // End offset, zero-based exclusive. - function SourceLocation(lexer, start, end) { + constructor(lexer, start, end) { this.lexer = void 0; this.start = void 0; this.end = void 0; @@ -10450,7 +10484,7 @@ var SourceLocation = /*#__PURE__*/function () { */ - SourceLocation.range = function range(first, second) { + static range(first, second) { if (!second) { return first && first.loc; } else if (!first || !first.loc || !second.loc || first.loc.lexer !== second.loc.lexer) { @@ -10458,12 +10492,9 @@ var SourceLocation = /*#__PURE__*/function () { } else { return new SourceLocation(first.loc.lexer, first.loc.start, second.loc.end); } - }; - - return SourceLocation; -}(); - + } +} ;// CONCATENATED MODULE: ./src/Token.js /** @@ -10484,10 +10515,10 @@ var SourceLocation = /*#__PURE__*/function () { * tokens if appropriate. Not providing available position information may * lead to degraded error reporting, though. */ -var Token = /*#__PURE__*/function () { +class Token { // don't expand the token // used in \noexpand - function Token(text, // the text of this token + constructor(text, // the text of this token loc) { this.text = void 0; this.loc = void 0; @@ -10502,16 +10533,13 @@ var Token = /*#__PURE__*/function () { */ - var _proto = Token.prototype; - - _proto.range = function range(endToken, // last token of the range, inclusive + range(endToken, // last token of the range, inclusive text // the text of the newly constructed token ) { return new Token(text, SourceLocation.range(this, endToken)); - }; + } - return Token; -}(); +} ;// CONCATENATED MODULE: ./src/environments/array.js @@ -10533,9 +10561,9 @@ var Token = /*#__PURE__*/function () { function getHLines(parser) { // Return an array. The array length = number of hlines. // Each element in the array tells if the line is dashed. - var hlineInfo = []; + const hlineInfo = []; parser.consumeSpaces(); - var nxt = parser.fetch().text; + let nxt = parser.fetch().text; if (nxt === "\\relax") { // \relax is an artifact of the \cr macro below @@ -10554,8 +10582,8 @@ function getHLines(parser) { return hlineInfo; } -var validateAmsEnvironmentContext = function validateAmsEnvironmentContext(context) { - var settings = context.parser.settings; +const validateAmsEnvironmentContext = context => { + const settings = context.parser.settings; if (!settings.displayMode) { throw new src_ParseError("{" + context.envName + "} can be used only in" + " display mode."); @@ -10582,16 +10610,18 @@ function getAutoTag(name) { function parseArray(parser, _ref, style) { - var hskipBeforeAndAfter = _ref.hskipBeforeAndAfter, - addJot = _ref.addJot, - cols = _ref.cols, - arraystretch = _ref.arraystretch, - colSeparationType = _ref.colSeparationType, - autoTag = _ref.autoTag, - singleRow = _ref.singleRow, - emptySingleRow = _ref.emptySingleRow, - maxNumCols = _ref.maxNumCols, - leqno = _ref.leqno; + let { + hskipBeforeAndAfter, + addJot, + cols, + arraystretch, + colSeparationType, + autoTag, + singleRow, + emptySingleRow, + maxNumCols, + leqno + } = _ref; parser.gullet.beginGroup(); if (!singleRow) { @@ -10602,7 +10632,7 @@ function parseArray(parser, _ref, style) { if (!arraystretch) { - var stretch = parser.gullet.expandMacroAsText("\\arraystretch"); + const stretch = parser.gullet.expandMacroAsText("\\arraystretch"); if (stretch == null) { // Default \arraystretch from lttab.dtx @@ -10618,11 +10648,11 @@ function parseArray(parser, _ref, style) { parser.gullet.beginGroup(); - var row = []; - var body = [row]; - var rowGaps = []; - var hLinesBeforeRow = []; - var tags = autoTag != null ? [] : undefined; // amsmath uses \global\@eqnswtrue and \global\@eqnswfalse to represent + let row = []; + const body = [row]; + const rowGaps = []; + const hLinesBeforeRow = []; + const tags = autoTag != null ? [] : undefined; // amsmath uses \global\@eqnswtrue and \global\@eqnswfalse to represent // whether this row should have an equation number. Simulate this with // a \@eqnsw macro set to 1 or 0. @@ -10650,7 +10680,7 @@ function parseArray(parser, _ref, style) { while (true) { // eslint-disable-line no-constant-condition // Parse each cell in its own group (namespace) - var cell = parser.parseExpression(false, singleRow ? "\\end" : "\\\\"); + let cell = parser.parseExpression(false, singleRow ? "\\end" : "\\\\"); parser.gullet.endGroup(); parser.gullet.beginGroup(); cell = { @@ -10663,13 +10693,13 @@ function parseArray(parser, _ref, style) { cell = { type: "styling", mode: parser.mode, - style: style, + style, body: [cell] }; } row.push(cell); - var next = parser.fetch().text; + const next = parser.fetch().text; if (next === "&") { if (maxNumCols && row.length === maxNumCols) { @@ -10700,7 +10730,7 @@ function parseArray(parser, _ref, style) { break; } else if (next === "\\\\") { parser.consume(); - var size = void 0; // \def\Let@{\let\\\math@cr} + let size; // \def\Let@{\let\\\math@cr} // \def\math@cr{...\math@cr@} // \def\math@cr@{\new@ifnextchar[\math@cr@@{\math@cr@@[\z@]}} // \def\math@cr@@[#1]{...\math@cr@@@...} @@ -10729,16 +10759,16 @@ function parseArray(parser, _ref, style) { return { type: "array", mode: parser.mode, - addJot: addJot, - arraystretch: arraystretch, - body: body, - cols: cols, - rowGaps: rowGaps, - hskipBeforeAndAfter: hskipBeforeAndAfter, - hLinesBeforeRow: hLinesBeforeRow, - colSeparationType: colSeparationType, - tags: tags, - leqno: leqno + addJot, + arraystretch, + body, + cols, + rowGaps, + hskipBeforeAndAfter, + hLinesBeforeRow, + colSeparationType, + tags, + leqno }; } // Decides on a style for cells in an array according to whether the given // environment name starts with the letter 'd'. @@ -10752,20 +10782,20 @@ function dCellStyle(envName) { } } -var array_htmlBuilder = function htmlBuilder(group, options) { - var r; - var c; - var nr = group.body.length; - var hLinesBeforeRow = group.hLinesBeforeRow; - var nc = 0; - var body = new Array(nr); - var hlines = []; - var ruleThickness = Math.max( // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em. +const array_htmlBuilder = function (group, options) { + let r; + let c; + const nr = group.body.length; + const hLinesBeforeRow = group.hLinesBeforeRow; + let nc = 0; + let body = new Array(nr); + const hlines = []; + const ruleThickness = Math.max( // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em. options.fontMetrics().arrayRuleWidth, options.minRuleThickness // User override. ); // Horizontal spacing - var pt = 1 / options.fontMetrics().ptPerEm; - var arraycolsep = 5 * pt; // default value, i.e. \arraycolsep in article.cls + const pt = 1 / options.fontMetrics().ptPerEm; + let arraycolsep = 5 * pt; // default value, i.e. \arraycolsep in article.cls if (group.colSeparationType && group.colSeparationType === "small") { // We're in a {smallmatrix}. Default column space is \thickspace, @@ -10773,28 +10803,28 @@ var array_htmlBuilder = function htmlBuilder(group, options) { // But that needs adjustment because LaTeX applies \scriptstyle to the // entire array, including the colspace, but this function applies // \scriptstyle only inside each element. - var localMultiplier = options.havingStyle(src_Style.SCRIPT).sizeMultiplier; + const localMultiplier = options.havingStyle(src_Style.SCRIPT).sizeMultiplier; arraycolsep = 0.2778 * (localMultiplier / options.sizeMultiplier); } // Vertical spacing - var baselineskip = group.colSeparationType === "CD" ? calculateSize({ + const baselineskip = group.colSeparationType === "CD" ? calculateSize({ number: 3, unit: "ex" }, options) : 12 * pt; // see size10.clo // Default \jot from ltmath.dtx // TODO(edemaine): allow overriding \jot via \setlength (#687) - var jot = 3 * pt; - var arrayskip = group.arraystretch * baselineskip; - var arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and + const jot = 3 * pt; + const arrayskip = group.arraystretch * baselineskip; + const arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and - var arstrutDepth = 0.3 * arrayskip; // \@arstrutbox in lttab.dtx + const arstrutDepth = 0.3 * arrayskip; // \@arstrutbox in lttab.dtx - var totalHeight = 0; // Set a position for \hline(s) at the top of the array, if any. + let totalHeight = 0; // Set a position for \hline(s) at the top of the array, if any. function setHLinePos(hlinesInGap) { - for (var i = 0; i < hlinesInGap.length; ++i) { + for (let i = 0; i < hlinesInGap.length; ++i) { if (i > 0) { totalHeight += 0.25; } @@ -10809,19 +10839,19 @@ var array_htmlBuilder = function htmlBuilder(group, options) { setHLinePos(hLinesBeforeRow[0]); for (r = 0; r < group.body.length; ++r) { - var inrow = group.body[r]; - var height = arstrutHeight; // \@array adds an \@arstrut + const inrow = group.body[r]; + let height = arstrutHeight; // \@array adds an \@arstrut - var depth = arstrutDepth; // to each tow (via the template) + let depth = arstrutDepth; // to each tow (via the template) if (nc < inrow.length) { nc = inrow.length; } - var outrow = new Array(inrow.length); + const outrow = new Array(inrow.length); for (c = 0; c < inrow.length; ++c) { - var elt = buildGroup(inrow[c], options); + const elt = buildGroup(inrow[c], options); if (depth < elt.depth) { depth = elt.depth; @@ -10834,8 +10864,8 @@ var array_htmlBuilder = function htmlBuilder(group, options) { outrow[c] = elt; } - var rowGap = group.rowGaps[r]; - var gap = 0; + const rowGap = group.rowGaps[r]; + let gap = 0; if (rowGap) { gap = calculateSize(rowGap, options); @@ -10870,23 +10900,21 @@ var array_htmlBuilder = function htmlBuilder(group, options) { setHLinePos(hLinesBeforeRow[r + 1]); } - var offset = totalHeight / 2 + options.fontMetrics().axisHeight; - var colDescriptions = group.cols || []; - var cols = []; - var colSep; - var colDescrNum; - var tagSpans = []; + const offset = totalHeight / 2 + options.fontMetrics().axisHeight; + const colDescriptions = group.cols || []; + const cols = []; + let colSep; + let colDescrNum; + const tagSpans = []; - if (group.tags && group.tags.some(function (tag) { - return tag; - })) { + if (group.tags && group.tags.some(tag => tag)) { // An environment with manual tags and/or automatic equation numbers. // Create node(s), the latter of which trigger CSS counter increment. for (r = 0; r < nr; ++r) { - var rw = body[r]; - var shift = rw.pos - offset; - var tag = group.tags[r]; - var tagSpan = void 0; + const rw = body[r]; + const shift = rw.pos - offset; + const tag = group.tags[r]; + let tagSpan; if (tag === true) { // automatic numbering @@ -10904,7 +10932,7 @@ var array_htmlBuilder = function htmlBuilder(group, options) { tagSpans.push({ type: "elem", elem: tagSpan, - shift: shift + shift }); } } @@ -10912,8 +10940,8 @@ var array_htmlBuilder = function htmlBuilder(group, options) { for (c = 0, colDescrNum = 0; // Continue while either there are more columns or more column // descriptions, so trailing separators don't get lost. c < nc || colDescrNum < colDescriptions.length; ++c, ++colDescrNum) { - var colDescr = colDescriptions[colDescrNum] || {}; - var firstSeparator = true; + let colDescr = colDescriptions[colDescrNum] || {}; + let firstSeparator = true; while (colDescr.type === "separator") { // If there is more than one separator in a row, add a space @@ -10925,17 +10953,16 @@ var array_htmlBuilder = function htmlBuilder(group, options) { } if (colDescr.separator === "|" || colDescr.separator === ":") { - var lineType = colDescr.separator === "|" ? "solid" : "dashed"; - var separator = buildCommon.makeSpan(["vertical-separator"], [], options); + const lineType = colDescr.separator === "|" ? "solid" : "dashed"; + const separator = buildCommon.makeSpan(["vertical-separator"], [], options); separator.style.height = makeEm(totalHeight); separator.style.borderRightWidth = makeEm(ruleThickness); separator.style.borderRightStyle = lineType; separator.style.margin = "0 " + makeEm(-ruleThickness / 2); + const shift = totalHeight - offset; - var _shift = totalHeight - offset; - - if (_shift) { - separator.style.verticalAlign = makeEm(-_shift); + if (shift) { + separator.style.verticalAlign = makeEm(-shift); } cols.push(separator); @@ -10952,7 +10979,7 @@ var array_htmlBuilder = function htmlBuilder(group, options) { continue; } - var sepwidth = void 0; + let sepwidth; if (c > 0 || group.hskipBeforeAndAfter) { sepwidth = utils.deflt(colDescr.pregap, arraycolsep); @@ -10964,24 +10991,23 @@ var array_htmlBuilder = function htmlBuilder(group, options) { } } - var col = []; + let col = []; for (r = 0; r < nr; ++r) { - var row = body[r]; - var elem = row[c]; + const row = body[r]; + const elem = row[c]; if (!elem) { continue; } - var _shift2 = row.pos - offset; - + const shift = row.pos - offset; elem.depth = row.depth; elem.height = row.height; col.push({ type: "elem", elem: elem, - shift: _shift2 + shift: shift }); } @@ -11006,17 +11032,17 @@ var array_htmlBuilder = function htmlBuilder(group, options) { body = buildCommon.makeSpan(["mtable"], cols); // Add \hline(s), if any. if (hlines.length > 0) { - var line = buildCommon.makeLineSpan("hline", options, ruleThickness); - var dashes = buildCommon.makeLineSpan("hdashline", options, ruleThickness); - var vListElems = [{ + const line = buildCommon.makeLineSpan("hline", options, ruleThickness); + const dashes = buildCommon.makeLineSpan("hdashline", options, ruleThickness); + const vListElems = [{ type: "elem", elem: body, shift: 0 }]; while (hlines.length > 0) { - var hline = hlines.pop(); - var lineShift = hline.pos - offset; + const hline = hlines.pop(); + const lineShift = hline.pos - offset; if (hline.isDashed) { vListElems.push({ @@ -11042,7 +11068,7 @@ var array_htmlBuilder = function htmlBuilder(group, options) { if (tagSpans.length === 0) { return buildCommon.makeSpan(["mord"], [body], options); } else { - var eqnNumCol = buildCommon.makeVList({ + let eqnNumCol = buildCommon.makeVList({ positionType: "individualShift", children: tagSpans }, options); @@ -11051,22 +11077,22 @@ var array_htmlBuilder = function htmlBuilder(group, options) { } }; -var alignMap = { +const alignMap = { c: "center ", l: "left ", r: "right " }; -var array_mathmlBuilder = function mathmlBuilder(group, options) { - var tbl = []; - var glue = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]); - var tag = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]); +const array_mathmlBuilder = function (group, options) { + const tbl = []; + const glue = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]); + const tag = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]); - for (var i = 0; i < group.body.length; i++) { - var rw = group.body[i]; - var row = []; + for (let i = 0; i < group.body.length; i++) { + const rw = group.body[i]; + const row = []; - for (var j = 0; j < rw.length; j++) { + for (let j = 0; j < rw.length; j++) { row.push(new mathMLTree.MathNode("mtd", [buildMathML_buildGroup(rw[j], options)])); } @@ -11084,7 +11110,7 @@ var array_mathmlBuilder = function mathmlBuilder(group, options) { tbl.push(new mathMLTree.MathNode("mtr", row)); } - var table = new mathMLTree.MathNode("mtable", tbl); // Set column alignment, row spacing, column spacing, and + let table = new mathMLTree.MathNode("mtable", tbl); // Set column alignment, row spacing, column spacing, and // array lines by setting attributes on the table element. // Set the row spacing. In MathML, we specify a gap distance. // We do not use rowGap[] because MathML automatically increases @@ -11095,21 +11121,21 @@ var array_mathmlBuilder = function mathmlBuilder(group, options) { // The 0.16 and 0.09 values are found empirically. They produce an array // similar to LaTeX and in which content does not interfere with \hlines. - var gap = group.arraystretch === 0.5 ? 0.1 // {smallmatrix}, {subarray} + const gap = group.arraystretch === 0.5 ? 0.1 // {smallmatrix}, {subarray} : 0.16 + group.arraystretch - 1 + (group.addJot ? 0.09 : 0); table.setAttribute("rowspacing", makeEm(gap)); // MathML table lines go only between cells. // To place a line on an edge we'll use , if necessary. - var menclose = ""; - var align = ""; + let menclose = ""; + let align = ""; if (group.cols && group.cols.length > 0) { // Find column alignment, column spacing, and vertical lines. - var cols = group.cols; - var columnLines = ""; - var prevTypeWasAlign = false; - var iStart = 0; - var iEnd = cols.length; + const cols = group.cols; + let columnLines = ""; + let prevTypeWasAlign = false; + let iStart = 0; + let iEnd = cols.length; if (cols[0].type === "separator") { menclose += "top "; @@ -11121,20 +11147,20 @@ var array_mathmlBuilder = function mathmlBuilder(group, options) { iEnd -= 1; } - for (var _i = iStart; _i < iEnd; _i++) { - if (cols[_i].type === "align") { - align += alignMap[cols[_i].align]; + for (let i = iStart; i < iEnd; i++) { + if (cols[i].type === "align") { + align += alignMap[cols[i].align]; if (prevTypeWasAlign) { columnLines += "none "; } prevTypeWasAlign = true; - } else if (cols[_i].type === "separator") { + } else if (cols[i].type === "separator") { // MathML accepts only single lines between cells. // So we read only the first of consecutive separators. if (prevTypeWasAlign) { - columnLines += cols[_i].separator === "|" ? "solid " : "dashed "; + columnLines += cols[i].separator === "|" ? "solid " : "dashed "; prevTypeWasAlign = false; } } @@ -11149,12 +11175,11 @@ var array_mathmlBuilder = function mathmlBuilder(group, options) { if (group.colSeparationType === "align") { - var _cols = group.cols || []; + const cols = group.cols || []; + let spacing = ""; - var spacing = ""; - - for (var _i2 = 1; _i2 < _cols.length; _i2++) { - spacing += _i2 % 2 ? "0em " : "1em "; + for (let i = 1; i < cols.length; i++) { + spacing += i % 2 ? "0em " : "1em "; } table.setAttribute("columnspacing", spacing.trim()); @@ -11169,14 +11194,14 @@ var array_mathmlBuilder = function mathmlBuilder(group, options) { } // Address \hline and \hdashline - var rowLines = ""; - var hlines = group.hLinesBeforeRow; + let rowLines = ""; + const hlines = group.hLinesBeforeRow; menclose += hlines[0].length > 0 ? "left " : ""; menclose += hlines[hlines.length - 1].length > 0 ? "right " : ""; - for (var _i3 = 1; _i3 < hlines.length - 1; _i3++) { - rowLines += hlines[_i3].length === 0 ? "none " // MathML accepts only a single line between rows. Read one element. - : hlines[_i3][0] ? "dashed " : "solid "; + for (let i = 1; i < hlines.length - 1; i++) { + rowLines += hlines[i].length === 0 ? "none " // MathML accepts only a single line between rows. Read one element. + : hlines[i][0] ? "dashed " : "solid "; } if (/[sd]/.test(rowLines)) { @@ -11198,16 +11223,16 @@ var array_mathmlBuilder = function mathmlBuilder(group, options) { }; // Convenience function for align, align*, aligned, alignat, alignat*, alignedat. -var alignedHandler = function alignedHandler(context, args) { +const alignedHandler = function (context, args) { if (context.envName.indexOf("ed") === -1) { validateAmsEnvironmentContext(context); } - var cols = []; - var separationType = context.envName.indexOf("at") > -1 ? "alignat" : "align"; - var isSplit = context.envName === "split"; - var res = parseArray(context.parser, { - cols: cols, + const cols = []; + const separationType = context.envName.indexOf("at") > -1 ? "alignat" : "align"; + const isSplit = context.envName === "split"; + const res = parseArray(context.parser, { + cols, addJot: true, autoTag: isSplit ? undefined : getAutoTag(context.envName), emptySingleRow: true, @@ -11224,19 +11249,19 @@ var alignedHandler = function alignedHandler(context, args) { // cell in each row (starting with second cell) so that operators become // binary. This behavior is implemented in amsmath's \start@aligned. - var numMaths; - var numCols = 0; - var emptyGroup = { + let numMaths; + let numCols = 0; + const emptyGroup = { type: "ordgroup", mode: context.mode, body: [] }; if (args[0] && args[0].type === "ordgroup") { - var arg0 = ""; + let arg0 = ""; - for (var i = 0; i < args[0].body.length; i++) { - var textord = assertNodeType(args[0].body[i], "textord"); + for (let i = 0; i < args[0].body.length; i++) { + const textord = assertNodeType(args[0].body[i], "textord"); arg0 += textord.text; } @@ -11244,18 +11269,18 @@ var alignedHandler = function alignedHandler(context, args) { numCols = numMaths * 2; } - var isAligned = !numCols; + const isAligned = !numCols; res.body.forEach(function (row) { - for (var _i4 = 1; _i4 < row.length; _i4 += 2) { + for (let i = 1; i < row.length; i += 2) { // Modify ordgroup node within styling node - var styling = assertNodeType(row[_i4], "styling"); - var ordgroup = assertNodeType(styling.body[0], "ordgroup"); + const styling = assertNodeType(row[i], "styling"); + const ordgroup = assertNodeType(styling.body[0], "ordgroup"); ordgroup.body.unshift(emptyGroup); } if (!isAligned) { // Case 1 - var curMaths = row.length / 2; + const curMaths = row.length / 2; if (numMaths < curMaths) { throw new src_ParseError("Too many math in a row: " + ("expected " + numMaths + ", but got " + curMaths), row[0]); @@ -11268,18 +11293,18 @@ var alignedHandler = function alignedHandler(context, args) { // In aligned mode, we add one \qquad between columns; // otherwise we add nothing. - for (var _i5 = 0; _i5 < numCols; ++_i5) { - var align = "r"; - var pregap = 0; + for (let i = 0; i < numCols; ++i) { + let align = "r"; + let pregap = 0; - if (_i5 % 2 === 1) { + if (i % 2 === 1) { align = "l"; - } else if (_i5 > 0 && isAligned) { + } else if (i > 0 && isAligned) { // "aligned" mode. pregap = 1; // add one \quad } - cols[_i5] = { + cols[i] = { type: "align", align: align, pregap: pregap, @@ -11301,16 +11326,17 @@ defineEnvironment({ props: { numArgs: 1 }, - handler: function handler(context, args) { + + handler(context, args) { // Since no types are specified above, the two possibilities are // - The argument is wrapped in {} or [], in which case Parser's // parseGroup() returns an "ordgroup" wrapping some symbol node. // - The argument is a bare symbol node. - var symNode = checkSymbolNodeType(args[0]); - var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body; - var cols = colalign.map(function (nde) { - var node = assertSymbolNodeType(nde); - var ca = node.text; + const symNode = checkSymbolNodeType(args[0]); + const colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body; + const cols = colalign.map(function (nde) { + const node = assertSymbolNodeType(nde); + const ca = node.text; if ("lcr".indexOf(ca) !== -1) { return { @@ -11331,14 +11357,15 @@ defineEnvironment({ throw new src_ParseError("Unknown column alignment: " + ca, nde); }); - var res = { - cols: cols, + const res = { + cols, hskipBeforeAndAfter: true, // \@preamble in lttab.dtx maxNumCols: cols.length }; return parseArray(context.parser, res, dCellStyle(context.envName)); }, + htmlBuilder: array_htmlBuilder, mathmlBuilder: array_mathmlBuilder }); // The matrix environments of amsmath builds on the array environment @@ -11352,8 +11379,9 @@ defineEnvironment({ props: { numArgs: 0 }, - handler: function handler(context) { - var delimiters = { + + handler(context) { + const delimiters = { "matrix": null, "pmatrix": ["(", ")"], "bmatrix": ["[", "]"], @@ -11362,8 +11390,8 @@ defineEnvironment({ "Vmatrix": ["\\Vert", "\\Vert"] }[context.envName.replace("*", "")]; // \hskip -\arraycolsep in amsmath - var colAlign = "c"; - var payload = { + let colAlign = "c"; + const payload = { hskipBeforeAndAfter: false, cols: [{ type: "align", @@ -11374,7 +11402,7 @@ defineEnvironment({ if (context.envName.charAt(context.envName.length - 1) === "*") { // It's one of the mathtools starred functions. // Parse the optional alignment argument. - var parser = context.parser; + const parser = context.parser; parser.consumeSpaces(); if (parser.fetch().text === "[") { @@ -11397,11 +11425,9 @@ defineEnvironment({ } } - var res = parseArray(context.parser, payload, dCellStyle(context.envName)); // Populate cols with the correct number of column alignment specs. + const res = parseArray(context.parser, payload, dCellStyle(context.envName)); // Populate cols with the correct number of column alignment specs. - var numCols = Math.max.apply(Math, [0].concat(res.body.map(function (row) { - return row.length; - }))); + const numCols = Math.max(0, ...res.body.map(row => row.length)); res.cols = new Array(numCols).fill({ type: "align", align: colAlign @@ -11416,6 +11442,7 @@ defineEnvironment({ } : res; }, + htmlBuilder: array_htmlBuilder, mathmlBuilder: array_mathmlBuilder }); @@ -11425,14 +11452,16 @@ defineEnvironment({ props: { numArgs: 0 }, - handler: function handler(context) { - var payload = { + + handler(context) { + const payload = { arraystretch: 0.5 }; - var res = parseArray(context.parser, payload, "script"); + const res = parseArray(context.parser, payload, "script"); res.colSeparationType = "small"; return res; }, + htmlBuilder: array_htmlBuilder, mathmlBuilder: array_mathmlBuilder }); @@ -11442,13 +11471,14 @@ defineEnvironment({ props: { numArgs: 1 }, - handler: function handler(context, args) { + + handler(context, args) { // Parsing of {subarray} is similar to {array} - var symNode = checkSymbolNodeType(args[0]); - var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body; - var cols = colalign.map(function (nde) { - var node = assertSymbolNodeType(nde); - var ca = node.text; // {subarray} only recognizes "l" & "c" + const symNode = checkSymbolNodeType(args[0]); + const colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body; + const cols = colalign.map(function (nde) { + const node = assertSymbolNodeType(nde); + const ca = node.text; // {subarray} only recognizes "l" & "c" if ("lc".indexOf(ca) !== -1) { return { @@ -11464,8 +11494,8 @@ defineEnvironment({ throw new src_ParseError("{subarray} can contain only one column"); } - var res = { - cols: cols, + let res = { + cols, hskipBeforeAndAfter: false, arraystretch: 0.5 }; @@ -11477,6 +11507,7 @@ defineEnvironment({ return res; }, + htmlBuilder: array_htmlBuilder, mathmlBuilder: array_mathmlBuilder }); // A cases environment (in amsmath.sty) is almost equivalent to @@ -11492,8 +11523,9 @@ defineEnvironment({ props: { numArgs: 0 }, - handler: function handler(context) { - var payload = { + + handler(context) { + const payload = { arraystretch: 1.2, cols: [{ type: "align", @@ -11513,7 +11545,7 @@ defineEnvironment({ postgap: 0 }] }; - var res = parseArray(context.parser, payload, dCellStyle(context.envName)); + const res = parseArray(context.parser, payload, dCellStyle(context.envName)); return { type: "leftright", mode: context.mode, @@ -11523,6 +11555,7 @@ defineEnvironment({ rightColor: undefined }; }, + htmlBuilder: array_htmlBuilder, mathmlBuilder: array_mathmlBuilder }); // In the align environment, one uses ampersands, &, to specify number of @@ -11551,12 +11584,13 @@ defineEnvironment({ props: { numArgs: 0 }, - handler: function handler(context) { + + handler(context) { if (utils.contains(["gather", "gather*"], context.envName)) { validateAmsEnvironmentContext(context); } - var res = { + const res = { cols: [{ type: "align", align: "c" @@ -11569,6 +11603,7 @@ defineEnvironment({ }; return parseArray(context.parser, res, "display"); }, + htmlBuilder: array_htmlBuilder, mathmlBuilder: array_mathmlBuilder }); // alignat environment is like an align environment, but one must explicitly @@ -11591,9 +11626,10 @@ defineEnvironment({ props: { numArgs: 0 }, - handler: function handler(context) { + + handler(context) { validateAmsEnvironmentContext(context); - var res = { + const res = { autoTag: getAutoTag(context.envName), emptySingleRow: true, singleRow: true, @@ -11602,6 +11638,7 @@ defineEnvironment({ }; return parseArray(context.parser, res, "display"); }, + htmlBuilder: array_htmlBuilder, mathmlBuilder: array_mathmlBuilder }); @@ -11611,10 +11648,12 @@ defineEnvironment({ props: { numArgs: 0 }, - handler: function handler(context) { + + handler(context) { validateAmsEnvironmentContext(context); return parseCD(context.parser); }, + htmlBuilder: array_htmlBuilder, mathmlBuilder: array_mathmlBuilder }); @@ -11630,13 +11669,15 @@ defineFunction({ allowedInText: true, allowedInMath: true }, - handler: function handler(context, args) { + + handler(context, args) { throw new src_ParseError(context.funcName + " valid only within array environment"); } + }); ;// CONCATENATED MODULE: ./src/environments.js -var environments = _environments; +const environments = _environments; /* harmony default export */ var src_environments = (environments); // All environment definitions should be imported below @@ -11654,18 +11695,21 @@ defineFunction({ numArgs: 1, argTypes: ["text"] }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var nameGroup = args[0]; + + handler(_ref, args) { + let { + parser, + funcName + } = _ref; + const nameGroup = args[0]; if (nameGroup.type !== "ordgroup") { throw new src_ParseError("Invalid environment name", nameGroup); } - var envName = ""; + let envName = ""; - for (var i = 0; i < nameGroup.body.length; ++i) { + for (let i = 0; i < nameGroup.body.length; ++i) { envName += assertNodeType(nameGroup.body[i], "textord").text; } @@ -11677,21 +11721,20 @@ defineFunction({ // be made available to the begin and end methods using properties. - var env = src_environments[envName]; - - var _parser$parseArgument = parser.parseArguments("\\begin{" + envName + "}", env), - _args = _parser$parseArgument.args, - optArgs = _parser$parseArgument.optArgs; - - var context = { + const env = src_environments[envName]; + const { + args, + optArgs + } = parser.parseArguments("\\begin{" + envName + "}", env); + const context = { mode: parser.mode, - envName: envName, - parser: parser + envName, + parser }; - var result = env.handler(context, _args, optArgs); + const result = env.handler(context, args, optArgs); parser.expect("\\end", false); - var endNameToken = parser.nextToken; - var end = assertNodeType(parser.parseFunction(), "environment"); + const endNameToken = parser.nextToken; + const end = assertNodeType(parser.parseFunction(), "environment"); if (end.name !== envName) { throw new src_ParseError("Mismatch: \\begin{" + envName + "} matched by \\end{" + end.name + "}", endNameToken); @@ -11705,9 +11748,10 @@ defineFunction({ type: "environment", mode: parser.mode, name: envName, - nameGroup: nameGroup + nameGroup }; } + }); ;// CONCATENATED MODULE: ./src/functions/font.js // TODO(kevinb): implement \\sl and \\sc @@ -11717,19 +11761,19 @@ defineFunction({ -var font_htmlBuilder = function htmlBuilder(group, options) { - var font = group.font; - var newOptions = options.withFont(font); +const font_htmlBuilder = (group, options) => { + const font = group.font; + const newOptions = options.withFont(font); return buildGroup(group.body, newOptions); }; -var font_mathmlBuilder = function mathmlBuilder(group, options) { - var font = group.font; - var newOptions = options.withFont(font); +const font_mathmlBuilder = (group, options) => { + const font = group.font; + const newOptions = options.withFont(font); return buildMathML_buildGroup(group.body, newOptions); }; -var fontAliases = { +const fontAliases = { "\\Bbb": "\\mathbb", "\\bold": "\\mathbf", "\\frak": "\\mathfrak", @@ -11745,11 +11789,13 @@ defineFunction({ numArgs: 1, allowedInArgument: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var body = normalizeArgument(args[0]); - var func = funcName; + handler: (_ref, args) => { + let { + parser, + funcName + } = _ref; + const body = normalizeArgument(args[0]); + let func = funcName; if (func in fontAliases) { func = fontAliases[func]; @@ -11759,7 +11805,7 @@ defineFunction({ type: "font", mode: parser.mode, font: func.slice(1), - body: body + body }; }, htmlBuilder: font_htmlBuilder, @@ -11771,10 +11817,12 @@ defineFunction({ props: { numArgs: 1 }, - handler: function handler(_ref2, args) { - var parser = _ref2.parser; - var body = args[0]; - var isCharacterBox = utils.isCharacterBox(body); // amsbsy.sty's \boldsymbol uses \binrel spacing to inherit the + handler: (_ref2, args) => { + let { + parser + } = _ref2; + const body = args[0]; + const isCharacterBox = utils.isCharacterBox(body); // amsbsy.sty's \boldsymbol uses \binrel spacing to inherit the // argument's bin|rel|ord status return { @@ -11785,7 +11833,7 @@ defineFunction({ type: "font", mode: parser.mode, font: "boldsymbol", - body: body + body }], isCharacterBox: isCharacterBox }; @@ -11799,13 +11847,17 @@ defineFunction({ numArgs: 0, allowedInText: true }, - handler: function handler(_ref3, args) { - var parser = _ref3.parser, - funcName = _ref3.funcName, - breakOnTokenText = _ref3.breakOnTokenText; - var mode = parser.mode; - var body = parser.parseExpression(true, breakOnTokenText); - var style = "math" + funcName.slice(1); + handler: (_ref3, args) => { + let { + parser, + funcName, + breakOnTokenText + } = _ref3; + const { + mode + } = parser; + const body = parser.parseExpression(true, breakOnTokenText); + const style = "math" + funcName.slice(1); return { type: "font", mode: mode, @@ -11813,7 +11865,7 @@ defineFunction({ body: { type: "ordgroup", mode: parser.mode, - body: body + body } }; }, @@ -11832,10 +11884,10 @@ defineFunction({ -var adjustStyle = function adjustStyle(size, originalStyle) { +const adjustStyle = (size, originalStyle) => { // Figure out what style this fraction should be in based on the // function used - var style = originalStyle; + let style = originalStyle; if (size === "display") { // Get display style as a default. @@ -11853,29 +11905,29 @@ var adjustStyle = function adjustStyle(size, originalStyle) { return style; }; -var genfrac_htmlBuilder = function htmlBuilder(group, options) { +const genfrac_htmlBuilder = (group, options) => { // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e). - var style = adjustStyle(group.size, options.style); - var nstyle = style.fracNum(); - var dstyle = style.fracDen(); - var newOptions; + const style = adjustStyle(group.size, options.style); + const nstyle = style.fracNum(); + const dstyle = style.fracDen(); + let newOptions; newOptions = options.havingStyle(nstyle); - var numerm = buildGroup(group.numer, newOptions, options); + const numerm = buildGroup(group.numer, newOptions, options); if (group.continued) { // \cfrac inserts a \strut into the numerator. // Get \strut dimensions from TeXbook page 353. - var hStrut = 8.5 / options.fontMetrics().ptPerEm; - var dStrut = 3.5 / options.fontMetrics().ptPerEm; + const hStrut = 8.5 / options.fontMetrics().ptPerEm; + const dStrut = 3.5 / options.fontMetrics().ptPerEm; numerm.height = numerm.height < hStrut ? hStrut : numerm.height; numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth; } newOptions = options.havingStyle(dstyle); - var denomm = buildGroup(group.denom, newOptions, options); - var rule; - var ruleWidth; - var ruleSpacing; + const denomm = buildGroup(group.denom, newOptions, options); + let rule; + let ruleWidth; + let ruleSpacing; if (group.hasBarLine) { if (group.barSize) { @@ -11894,9 +11946,9 @@ var genfrac_htmlBuilder = function htmlBuilder(group, options) { } // Rule 15b - var numShift; - var clearance; - var denomShift; + let numShift; + let clearance; + let denomShift; if (style.size === src_Style.DISPLAY.size || group.size === "display") { numShift = options.fontMetrics().num1; @@ -11920,11 +11972,11 @@ var genfrac_htmlBuilder = function htmlBuilder(group, options) { denomShift = options.fontMetrics().denom2; } - var frac; + let frac; if (!rule) { // Rule 15c - var candidateClearance = numShift - numerm.depth - (denomm.height - denomShift); + const candidateClearance = numShift - numerm.depth - (denomm.height - denomShift); if (candidateClearance < clearance) { numShift += 0.5 * (clearance - candidateClearance); @@ -11945,7 +11997,7 @@ var genfrac_htmlBuilder = function htmlBuilder(group, options) { }, options); } else { // Rule 15d - var axisHeight = options.fontMetrics().axisHeight; + const axisHeight = options.fontMetrics().axisHeight; if (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth) < clearance) { numShift += clearance - (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth)); @@ -11955,7 +12007,7 @@ var genfrac_htmlBuilder = function htmlBuilder(group, options) { denomShift += clearance - (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift)); } - var midShift = -(axisHeight - 0.5 * ruleWidth); + const midShift = -(axisHeight - 0.5 * ruleWidth); frac = buildCommon.makeVList({ positionType: "individualShift", children: [{ @@ -11980,7 +12032,7 @@ var genfrac_htmlBuilder = function htmlBuilder(group, options) { frac.height *= newOptions.sizeMultiplier / options.sizeMultiplier; frac.depth *= newOptions.sizeMultiplier / options.sizeMultiplier; // Rule 15e - var delimSize; + let delimSize; if (style.size === src_Style.DISPLAY.size) { delimSize = options.fontMetrics().delim1; @@ -11990,8 +12042,8 @@ var genfrac_htmlBuilder = function htmlBuilder(group, options) { delimSize = options.fontMetrics().delim2; } - var leftDelim; - var rightDelim; + let leftDelim; + let rightDelim; if (group.leftDelim == null) { leftDelim = makeNullDelimiter(options, ["mopen"]); @@ -12010,30 +12062,30 @@ var genfrac_htmlBuilder = function htmlBuilder(group, options) { return buildCommon.makeSpan(["mord"].concat(newOptions.sizingClasses(options)), [leftDelim, buildCommon.makeSpan(["mfrac"], [frac]), rightDelim], options); }; -var genfrac_mathmlBuilder = function mathmlBuilder(group, options) { - var node = new mathMLTree.MathNode("mfrac", [buildMathML_buildGroup(group.numer, options), buildMathML_buildGroup(group.denom, options)]); +const genfrac_mathmlBuilder = (group, options) => { + let node = new mathMLTree.MathNode("mfrac", [buildMathML_buildGroup(group.numer, options), buildMathML_buildGroup(group.denom, options)]); if (!group.hasBarLine) { node.setAttribute("linethickness", "0px"); } else if (group.barSize) { - var ruleWidth = calculateSize(group.barSize, options); + const ruleWidth = calculateSize(group.barSize, options); node.setAttribute("linethickness", makeEm(ruleWidth)); } - var style = adjustStyle(group.size, options.style); + const style = adjustStyle(group.size, options.style); if (style.size !== options.style.size) { node = new mathMLTree.MathNode("mstyle", [node]); - var isDisplay = style.size === src_Style.DISPLAY.size ? "true" : "false"; + const isDisplay = style.size === src_Style.DISPLAY.size ? "true" : "false"; node.setAttribute("displaystyle", isDisplay); node.setAttribute("scriptlevel", "0"); } if (group.leftDelim != null || group.rightDelim != null) { - var withDelims = []; + const withDelims = []; if (group.leftDelim != null) { - var leftOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group.leftDelim.replace("\\", ""))]); + const leftOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group.leftDelim.replace("\\", ""))]); leftOp.setAttribute("fence", "true"); withDelims.push(leftOp); } @@ -12041,7 +12093,7 @@ var genfrac_mathmlBuilder = function mathmlBuilder(group, options) { withDelims.push(node); if (group.rightDelim != null) { - var rightOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group.rightDelim.replace("\\", ""))]); + const rightOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group.rightDelim.replace("\\", ""))]); rightOp.setAttribute("fence", "true"); withDelims.push(rightOp); } @@ -12061,15 +12113,17 @@ defineFunction({ numArgs: 2, allowedInArgument: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var numer = args[0]; - var denom = args[1]; - var hasBarLine; - var leftDelim = null; - var rightDelim = null; - var size = "auto"; + handler: (_ref, args) => { + let { + parser, + funcName + } = _ref; + const numer = args[0]; + const denom = args[1]; + let hasBarLine; + let leftDelim = null; + let rightDelim = null; + let size = "auto"; switch (funcName) { case "\\dfrac": @@ -12122,12 +12176,12 @@ defineFunction({ type: "genfrac", mode: parser.mode, continued: false, - numer: numer, - denom: denom, - hasBarLine: hasBarLine, - leftDelim: leftDelim, - rightDelim: rightDelim, - size: size, + numer, + denom, + hasBarLine, + leftDelim, + rightDelim, + size, barSize: null }; }, @@ -12140,17 +12194,19 @@ defineFunction({ props: { numArgs: 2 }, - handler: function handler(_ref2, args) { - var parser = _ref2.parser, - funcName = _ref2.funcName; - var numer = args[0]; - var denom = args[1]; + handler: (_ref2, args) => { + let { + parser, + funcName + } = _ref2; + const numer = args[0]; + const denom = args[1]; return { type: "genfrac", mode: parser.mode, continued: true, - numer: numer, - denom: denom, + numer, + denom, hasBarLine: true, leftDelim: null, rightDelim: null, @@ -12168,11 +12224,14 @@ defineFunction({ numArgs: 0, infix: true }, - handler: function handler(_ref3) { - var parser = _ref3.parser, - funcName = _ref3.funcName, - token = _ref3.token; - var replaceWith; + + handler(_ref3) { + let { + parser, + funcName, + token + } = _ref3; + let replaceWith; switch (funcName) { case "\\over": @@ -12202,15 +12261,16 @@ defineFunction({ return { type: "infix", mode: parser.mode, - replaceWith: replaceWith, - token: token + replaceWith, + token }; } -}); -var stylArray = ["display", "text", "script", "scriptscript"]; -var delimFromValue = function delimFromValue(delimString) { - var delim = null; +}); +const stylArray = ["display", "text", "script", "scriptscript"]; + +const delimFromValue = function (delimString) { + let delim = null; if (delimString.length > 0) { delim = delimString; @@ -12228,18 +12288,21 @@ defineFunction({ allowedInArgument: true, argTypes: ["math", "math", "size", "text", "math", "math"] }, - handler: function handler(_ref4, args) { - var parser = _ref4.parser; - var numer = args[4]; - var denom = args[5]; // Look into the parse nodes to get the desired delimiters. - var leftNode = normalizeArgument(args[0]); - var leftDelim = leftNode.type === "atom" && leftNode.family === "open" ? delimFromValue(leftNode.text) : null; - var rightNode = normalizeArgument(args[1]); - var rightDelim = rightNode.type === "atom" && rightNode.family === "close" ? delimFromValue(rightNode.text) : null; - var barNode = assertNodeType(args[2], "size"); - var hasBarLine; - var barSize = null; + handler(_ref4, args) { + let { + parser + } = _ref4; + const numer = args[4]; + const denom = args[5]; // Look into the parse nodes to get the desired delimiters. + + const leftNode = normalizeArgument(args[0]); + const leftDelim = leftNode.type === "atom" && leftNode.family === "open" ? delimFromValue(leftNode.text) : null; + const rightNode = normalizeArgument(args[1]); + const rightDelim = rightNode.type === "atom" && rightNode.family === "close" ? delimFromValue(rightNode.text) : null; + const barNode = assertNodeType(args[2], "size"); + let hasBarLine; + let barSize = null; if (barNode.isBlank) { // \genfrac acts differently than \above. @@ -12252,12 +12315,12 @@ defineFunction({ } // Find out if we want displaystyle, textstyle, etc. - var size = "auto"; - var styl = args[3]; + let size = "auto"; + let styl = args[3]; if (styl.type === "ordgroup") { if (styl.body.length > 0) { - var textOrd = assertNodeType(styl.body[0], "textord"); + const textOrd = assertNodeType(styl.body[0], "textord"); size = stylArray[Number(textOrd.text)]; } } else { @@ -12268,16 +12331,17 @@ defineFunction({ return { type: "genfrac", mode: parser.mode, - numer: numer, - denom: denom, + numer, + denom, continued: false, - hasBarLine: hasBarLine, - barSize: barSize, - leftDelim: leftDelim, - rightDelim: rightDelim, - size: size + hasBarLine, + barSize, + leftDelim, + rightDelim, + size }; }, + htmlBuilder: genfrac_htmlBuilder, mathmlBuilder: genfrac_mathmlBuilder }); // \above is an infix fraction that also defines a fraction bar size. @@ -12290,18 +12354,22 @@ defineFunction({ argTypes: ["size"], infix: true }, - handler: function handler(_ref5, args) { - var parser = _ref5.parser, - funcName = _ref5.funcName, - token = _ref5.token; + + handler(_ref5, args) { + let { + parser, + funcName, + token + } = _ref5; return { type: "infix", mode: parser.mode, replaceWith: "\\\\abovefrac", size: assertNodeType(args[0], "size").value, - token: token + token }; } + }); defineFunction({ type: "genfrac", @@ -12310,21 +12378,23 @@ defineFunction({ numArgs: 3, argTypes: ["math", "size", "math"] }, - handler: function handler(_ref6, args) { - var parser = _ref6.parser, - funcName = _ref6.funcName; - var numer = args[0]; - var barSize = assert(assertNodeType(args[1], "infix").size); - var denom = args[2]; - var hasBarLine = barSize.number > 0; + handler: (_ref6, args) => { + let { + parser, + funcName + } = _ref6; + const numer = args[0]; + const barSize = assert(assertNodeType(args[1], "infix").size); + const denom = args[2]; + const hasBarLine = barSize.number > 0; return { type: "genfrac", mode: parser.mode, - numer: numer, - denom: denom, + numer, + denom, continued: false, - hasBarLine: hasBarLine, - barSize: barSize, + hasBarLine, + barSize, leftDelim: null, rightDelim: null, size: "auto" @@ -12344,11 +12414,11 @@ defineFunction({ // NOTE: Unlike most `htmlBuilder`s, this one handles not only "horizBrace", but // also "supsub" since an over/underbrace can affect super/subscripting. -var horizBrace_htmlBuilder = function htmlBuilder(grp, options) { - var style = options.style; // Pull out the `ParseNode<"horizBrace">` if `grp` is a "supsub" node. +const horizBrace_htmlBuilder = (grp, options) => { + const style = options.style; // Pull out the `ParseNode<"horizBrace">` if `grp` is a "supsub" node. - var supSubGroup; - var group; + let supSubGroup; + let group; if (grp.type === "supsub") { // Ref: LaTeX source2e: }}}}\limits} @@ -12361,12 +12431,12 @@ var horizBrace_htmlBuilder = function htmlBuilder(grp, options) { } // Build the base group - var body = buildGroup(group.base, options.havingBaseStyle(src_Style.DISPLAY)); // Create the stretchy element + const body = buildGroup(group.base, options.havingBaseStyle(src_Style.DISPLAY)); // Create the stretchy element - var braceBody = stretchy.svgSpan(group, options); // Generate the vlist, with the appropriate kerns ┏━━━━━━━━┓ + const braceBody = stretchy.svgSpan(group, options); // Generate the vlist, with the appropriate kerns ┏━━━━━━━━┓ // This first vlist contains the content and the brace: equation - var vlist; + let vlist; if (group.isOver) { vlist = buildCommon.makeVList({ @@ -12411,7 +12481,7 @@ var horizBrace_htmlBuilder = function htmlBuilder(grp, options) { // note long note long note // ┏━━━━━━━━┓ or ┏━━━┓ not ┏━━━━━━━━━┓ // equation eqn eqn - var vSpan = buildCommon.makeSpan(["mord", group.isOver ? "mover" : "munder"], [vlist], options); + const vSpan = buildCommon.makeSpan(["mord", group.isOver ? "mover" : "munder"], [vlist], options); if (group.isOver) { vlist = buildCommon.makeVList({ @@ -12448,8 +12518,8 @@ var horizBrace_htmlBuilder = function htmlBuilder(grp, options) { return buildCommon.makeSpan(["mord", group.isOver ? "mover" : "munder"], [vlist], options); }; -var horizBrace_mathmlBuilder = function mathmlBuilder(group, options) { - var accentNode = stretchy.mathMLnode(group.label); +const horizBrace_mathmlBuilder = (group, options) => { + const accentNode = stretchy.mathMLnode(group.label); return new mathMLTree.MathNode(group.isOver ? "mover" : "munder", [buildMathML_buildGroup(group.base, options), accentNode]); }; // Horizontal stretchy braces @@ -12460,9 +12530,12 @@ defineFunction({ props: { numArgs: 1 }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; + + handler(_ref, args) { + let { + parser, + funcName + } = _ref; return { type: "horizBrace", mode: parser.mode, @@ -12471,6 +12544,7 @@ defineFunction({ base: args[0] }; }, + htmlBuilder: horizBrace_htmlBuilder, mathmlBuilder: horizBrace_mathmlBuilder }); @@ -12489,10 +12563,12 @@ defineFunction({ argTypes: ["url", "original"], allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser; - var body = args[1]; - var href = assertNodeType(args[0], "url").url; + handler: (_ref, args) => { + let { + parser + } = _ref; + const body = args[1]; + const href = assertNodeType(args[0], "url").url; if (!parser.settings.isTrusted({ command: "\\href", @@ -12504,16 +12580,16 @@ defineFunction({ return { type: "href", mode: parser.mode, - href: href, + href, body: ordargument(body) }; }, - htmlBuilder: function htmlBuilder(group, options) { - var elements = buildExpression(group.body, options, false); + htmlBuilder: (group, options) => { + const elements = buildExpression(group.body, options, false); return buildCommon.makeAnchor(group.href, [], elements, options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var math = buildExpressionRow(group.body, options); + mathmlBuilder: (group, options) => { + let math = buildExpressionRow(group.body, options); if (!(math instanceof MathNode)) { math = new MathNode("mrow", [math]); @@ -12531,9 +12607,11 @@ defineFunction({ argTypes: ["url"], allowedInText: true }, - handler: function handler(_ref2, args) { - var parser = _ref2.parser; - var href = assertNodeType(args[0], "url").url; + handler: (_ref2, args) => { + let { + parser + } = _ref2; + const href = assertNodeType(args[0], "url").url; if (!parser.settings.isTrusted({ command: "\\url", @@ -12542,10 +12620,10 @@ defineFunction({ return parser.formatUnsupportedCmd("\\url"); } - var chars = []; + const chars = []; - for (var i = 0; i < href.length; i++) { - var c = href[i]; + for (let i = 0; i < href.length; i++) { + let c = href[i]; if (c === "~") { c = "\\textasciitilde"; @@ -12558,7 +12636,7 @@ defineFunction({ }); } - var body = { + const body = { type: "text", mode: parser.mode, font: "\\texttt", @@ -12567,7 +12645,7 @@ defineFunction({ return { type: "href", mode: parser.mode, - href: href, + href, body: ordargument(body) }; } @@ -12591,21 +12669,27 @@ defineFunction({ allowedInText: true, primitive: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser; + + handler(_ref, args) { + let { + parser + } = _ref; return { type: "hbox", mode: parser.mode, body: ordargument(args[0]) }; }, - htmlBuilder: function htmlBuilder(group, options) { - var elements = buildExpression(group.body, options, false); + + htmlBuilder(group, options) { + const elements = buildExpression(group.body, options, false); return buildCommon.makeFragment(elements); }, - mathmlBuilder: function mathmlBuilder(group, options) { + + mathmlBuilder(group, options) { return new mathMLTree.MathNode("mrow", buildMathML_buildExpression(group.body, options)); } + }); ;// CONCATENATED MODULE: ./src/functions/html.js @@ -12622,19 +12706,21 @@ defineFunction({ argTypes: ["raw", "original"], allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName, - token = _ref.token; - var value = assertNodeType(args[0], "raw").string; - var body = args[1]; + handler: (_ref, args) => { + let { + parser, + funcName, + token + } = _ref; + const value = assertNodeType(args[0], "raw").string; + const body = args[1]; if (parser.settings.strict) { parser.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode"); } - var trustContext; - var attributes = {}; + let trustContext; + const attributes = {}; switch (funcName) { case "\\htmlClass": @@ -12663,10 +12749,10 @@ defineFunction({ case "\\htmlData": { - var data = value.split(","); + const data = value.split(","); - for (var i = 0; i < data.length; i++) { - var keyVal = data[i].split("="); + for (let i = 0; i < data.length; i++) { + const keyVal = data[i].split("="); if (keyVal.length !== 2) { throw new src_ParseError("Error parsing key-value for \\htmlData"); @@ -12677,7 +12763,7 @@ defineFunction({ trustContext = { command: "\\htmlData", - attributes: attributes + attributes }; break; } @@ -12693,21 +12779,21 @@ defineFunction({ return { type: "html", mode: parser.mode, - attributes: attributes, + attributes, body: ordargument(body) }; }, - htmlBuilder: function htmlBuilder(group, options) { - var elements = buildExpression(group.body, options, false); - var classes = ["enclosing"]; + htmlBuilder: (group, options) => { + const elements = buildExpression(group.body, options, false); + const classes = ["enclosing"]; if (group.attributes.class) { - classes.push.apply(classes, group.attributes.class.trim().split(/\s+/)); + classes.push(...group.attributes.class.trim().split(/\s+/)); } - var span = buildCommon.makeSpan(classes, elements, options); + const span = buildCommon.makeSpan(classes, elements, options); - for (var attr in group.attributes) { + for (const attr in group.attributes) { if (attr !== "class" && group.attributes.hasOwnProperty(attr)) { span.setAttribute(attr, group.attributes[attr]); } @@ -12715,7 +12801,7 @@ defineFunction({ return span; }, - mathmlBuilder: function mathmlBuilder(group, options) { + mathmlBuilder: (group, options) => { return buildExpressionRow(group.body, options); } }); @@ -12731,8 +12817,10 @@ defineFunction({ numArgs: 2, allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser; + handler: (_ref, args) => { + let { + parser + } = _ref; return { type: "htmlmathml", mode: parser.mode, @@ -12740,11 +12828,11 @@ defineFunction({ mathml: ordargument(args[1]) }; }, - htmlBuilder: function htmlBuilder(group, options) { - var elements = buildExpression(group.html, options, false); + htmlBuilder: (group, options) => { + const elements = buildExpression(group.html, options, false); return buildCommon.makeFragment(elements); }, - mathmlBuilder: function mathmlBuilder(group, options) { + mathmlBuilder: (group, options) => { return buildExpressionRow(group.mathml, options); } }); @@ -12756,7 +12844,7 @@ defineFunction({ -var sizeData = function sizeData(str) { +const sizeData = function (str) { if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(str)) { // str is a number with no unit specified. // default unit is bp, per graphix package. @@ -12765,13 +12853,13 @@ var sizeData = function sizeData(str) { unit: "bp" }; } else { - var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(str); + const match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(str); if (!match) { throw new src_ParseError("Invalid size: '" + str + "' in \\includegraphics"); } - var data = { + const data = { number: +(match[1] + match[2]), // sign + magnitude, cast to number unit: match[3] @@ -12794,33 +12882,35 @@ defineFunction({ argTypes: ["raw", "url"], allowedInText: false }, - handler: function handler(_ref, args, optArgs) { - var parser = _ref.parser; - var width = { + handler: (_ref, args, optArgs) => { + let { + parser + } = _ref; + let width = { number: 0, unit: "em" }; - var height = { + let height = { number: 0.9, unit: "em" }; // sorta character sized. - var totalheight = { + let totalheight = { number: 0, unit: "em" }; - var alt = ""; + let alt = ""; if (optArgs[0]) { - var attributeStr = assertNodeType(optArgs[0], "raw").string; // Parser.js does not parse key/value pairs. We get a string. + const attributeStr = assertNodeType(optArgs[0], "raw").string; // Parser.js does not parse key/value pairs. We get a string. - var attributes = attributeStr.split(","); + const attributes = attributeStr.split(","); - for (var i = 0; i < attributes.length; i++) { - var keyVal = attributes[i].split("="); + for (let i = 0; i < attributes.length; i++) { + const keyVal = attributes[i].split("="); if (keyVal.length === 2) { - var str = keyVal[1].trim(); + const str = keyVal[1].trim(); switch (keyVal[0].trim()) { case "alt": @@ -12846,7 +12936,7 @@ defineFunction({ } } - var src = assertNodeType(args[0], "url").url; + const src = assertNodeType(args[0], "url").url; if (alt === "") { // No alt given. Use the file name. Strip away the path. @@ -12872,21 +12962,21 @@ defineFunction({ src: src }; }, - htmlBuilder: function htmlBuilder(group, options) { - var height = calculateSize(group.height, options); - var depth = 0; + htmlBuilder: (group, options) => { + const height = calculateSize(group.height, options); + let depth = 0; if (group.totalheight.number > 0) { depth = calculateSize(group.totalheight, options) - height; } - var width = 0; + let width = 0; if (group.width.number > 0) { width = calculateSize(group.width, options); } - var style = { + const style = { height: makeEm(height + depth) }; @@ -12898,16 +12988,16 @@ defineFunction({ style.verticalAlign = makeEm(-depth); } - var node = new Img(group.src, group.alt, style); + const node = new Img(group.src, group.alt, style); node.height = height; node.depth = depth; return node; }, - mathmlBuilder: function mathmlBuilder(group, options) { - var node = new mathMLTree.MathNode("mglyph", []); + mathmlBuilder: (group, options) => { + const node = new mathMLTree.MathNode("mglyph", []); node.setAttribute("alt", group.alt); - var height = calculateSize(group.height, options); - var depth = 0; + const height = calculateSize(group.height, options); + let depth = 0; if (group.totalheight.number > 0) { depth = calculateSize(group.totalheight, options) - height; @@ -12917,7 +13007,7 @@ defineFunction({ node.setAttribute("height", makeEm(height + depth)); if (group.width.number > 0) { - var width = calculateSize(group.width, options); + const width = calculateSize(group.width, options); node.setAttribute("width", makeEm(width)); } @@ -12942,15 +13032,18 @@ defineFunction({ primitive: true, allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var size = assertNodeType(args[0], "size"); + + handler(_ref, args) { + let { + parser, + funcName + } = _ref; + const size = assertNodeType(args[0], "size"); if (parser.settings.strict) { - var mathFunction = funcName[1] === 'm'; // \mkern, \mskip + const mathFunction = funcName[1] === 'm'; // \mkern, \mskip - var muUnit = size.value.unit === 'mu'; + const muUnit = size.value.unit === 'mu'; if (mathFunction) { if (!muUnit) { @@ -12974,13 +13067,16 @@ defineFunction({ dimension: size.value }; }, - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { return buildCommon.makeGlue(group.dimension, options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var dimension = calculateSize(group.dimension, options); + + mathmlBuilder(group, options) { + const dimension = calculateSize(group.dimension, options); return new mathMLTree.SpaceNode(dimension); } + }); ;// CONCATENATED MODULE: ./src/functions/lap.js // Horizontal overlap functions @@ -12997,20 +13093,22 @@ defineFunction({ numArgs: 1, allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var body = args[0]; + handler: (_ref, args) => { + let { + parser, + funcName + } = _ref; + const body = args[0]; return { type: "lap", mode: parser.mode, alignment: funcName.slice(5), - body: body + body }; }, - htmlBuilder: function htmlBuilder(group, options) { + htmlBuilder: (group, options) => { // mathllap, mathrlap, mathclap - var inner; + let inner; if (group.alignment === "clap") { // ref: https://www.math.lsu.edu/~aperlis/publications/mathclap/ @@ -13021,14 +13119,14 @@ defineFunction({ inner = buildCommon.makeSpan(["inner"], [buildGroup(group.body, options)]); } - var fix = buildCommon.makeSpan(["fix"], []); - var node = buildCommon.makeSpan([group.alignment], [inner, fix], options); // At this point, we have correctly set horizontal alignment of the + const fix = buildCommon.makeSpan(["fix"], []); + let node = buildCommon.makeSpan([group.alignment], [inner, fix], options); // At this point, we have correctly set horizontal alignment of the // two items involved in the lap. // Next, use a strut to set the height of the HTML bounding box. // Otherwise, a tall argument may be misplaced. // This code resolved issue #1153 - var strut = buildCommon.makeSpan(["strut"]); + const strut = buildCommon.makeSpan(["strut"]); strut.style.height = makeEm(node.height + node.depth); if (node.depth) { @@ -13041,12 +13139,12 @@ defineFunction({ node = buildCommon.makeSpan(["thinbox"], [node], options); return buildCommon.makeSpan(["mord", "vbox"], [node], options); }, - mathmlBuilder: function mathmlBuilder(group, options) { + mathmlBuilder: (group, options) => { // mathllap, mathrlap, mathclap - var node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]); + const node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]); if (group.alignment !== "rlap") { - var offset = group.alignment === "llap" ? "-1" : "-0.5"; + const offset = group.alignment === "llap" ? "-1" : "-0.5"; node.setAttribute("lspace", offset + "width"); } @@ -13066,22 +13164,26 @@ defineFunction({ allowedInText: true, allowedInMath: false }, - handler: function handler(_ref, args) { - var funcName = _ref.funcName, - parser = _ref.parser; - var outerMode = parser.mode; + + handler(_ref, args) { + let { + funcName, + parser + } = _ref; + const outerMode = parser.mode; parser.switchMode("math"); - var close = funcName === "\\(" ? "\\)" : "$"; - var body = parser.parseExpression(false, close); + const close = funcName === "\\(" ? "\\)" : "$"; + const body = parser.parseExpression(false, close); parser.expect(close); parser.switchMode(outerMode); return { type: "styling", mode: parser.mode, style: "text", - body: body + body }; } + }); // Check for extra closing math delimiters defineFunction({ @@ -13093,9 +13195,11 @@ defineFunction({ allowedInText: true, allowedInMath: false }, - handler: function handler(context, args) { + + handler(context, args) { throw new src_ParseError("Mismatched " + context.funcName); } + }); ;// CONCATENATED MODULE: ./src/functions/mathchoice.js @@ -13104,7 +13208,7 @@ defineFunction({ -var chooseMathStyle = function chooseMathStyle(group, options) { +const chooseMathStyle = (group, options) => { switch (options.style.size) { case src_Style.DISPLAY.size: return group.display; @@ -13130,8 +13234,10 @@ defineFunction({ numArgs: 4, primitive: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser; + handler: (_ref, args) => { + let { + parser + } = _ref; return { type: "mathchoice", mode: parser.mode, @@ -13141,13 +13247,13 @@ defineFunction({ scriptscript: ordargument(args[3]) }; }, - htmlBuilder: function htmlBuilder(group, options) { - var body = chooseMathStyle(group, options); - var elements = buildExpression(body, options, false); + htmlBuilder: (group, options) => { + const body = chooseMathStyle(group, options); + const elements = buildExpression(body, options, false); return buildCommon.makeFragment(elements); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var body = chooseMathStyle(group, options); + mathmlBuilder: (group, options) => { + const body = chooseMathStyle(group, options); return buildExpressionRow(body, options); } }); @@ -13157,36 +13263,35 @@ defineFunction({ // For an operator with limits, assemble the base, sup, and sub into a span. -var assembleSupSub = function assembleSupSub(base, supGroup, subGroup, options, style, slant, baseShift) { +const assembleSupSub = (base, supGroup, subGroup, options, style, slant, baseShift) => { base = buildCommon.makeSpan([], [base]); - var subIsSingleCharacter = subGroup && utils.isCharacterBox(subGroup); - var sub; - var sup; // We manually have to handle the superscripts and subscripts. This, + const subIsSingleCharacter = subGroup && utils.isCharacterBox(subGroup); + let sub; + let sup; // We manually have to handle the superscripts and subscripts. This, // aside from the kern calculations, is copied from supsub. if (supGroup) { - var elem = buildGroup(supGroup, options.havingStyle(style.sup()), options); + const elem = buildGroup(supGroup, options.havingStyle(style.sup()), options); sup = { - elem: elem, + elem, kern: Math.max(options.fontMetrics().bigOpSpacing1, options.fontMetrics().bigOpSpacing3 - elem.depth) }; } if (subGroup) { - var _elem = buildGroup(subGroup, options.havingStyle(style.sub()), options); - + const elem = buildGroup(subGroup, options.havingStyle(style.sub()), options); sub = { - elem: _elem, - kern: Math.max(options.fontMetrics().bigOpSpacing2, options.fontMetrics().bigOpSpacing4 - _elem.height) + elem, + kern: Math.max(options.fontMetrics().bigOpSpacing2, options.fontMetrics().bigOpSpacing4 - elem.height) }; } // Build the final group as a vlist of the possible subscript, base, // and possible superscript. - var finalGroup; + let finalGroup; if (sup && sub) { - var bottom = options.fontMetrics().bigOpSpacing5 + sub.elem.height + sub.elem.depth + sub.kern + base.depth + baseShift; + const bottom = options.fontMetrics().bigOpSpacing5 + sub.elem.height + sub.elem.depth + sub.kern + base.depth + baseShift; finalGroup = buildCommon.makeVList({ positionType: "bottom", positionData: bottom, @@ -13216,7 +13321,7 @@ var assembleSupSub = function assembleSupSub(base, supGroup, subGroup, options, }] }, options); } else if (sub) { - var top = base.height - baseShift; // Shift the limits by the slant of the symbol. Note + const top = base.height - baseShift; // Shift the limits by the slant of the symbol. Note // that we are supposed to shift the limits by 1/2 of the slant, // but since we are centering the limits adding a full slant of // margin will shift by 1/2 that. @@ -13240,11 +13345,10 @@ var assembleSupSub = function assembleSupSub(base, supGroup, subGroup, options, }] }, options); } else if (sup) { - var _bottom = base.depth + baseShift; - + const bottom = base.depth + baseShift; finalGroup = buildCommon.makeVList({ positionType: "bottom", - positionData: _bottom, + positionData: bottom, children: [{ type: "elem", elem: base @@ -13267,12 +13371,12 @@ var assembleSupSub = function assembleSupSub(base, supGroup, subGroup, options, return base; } - var parts = [finalGroup]; + const parts = [finalGroup]; if (sub && slant !== 0 && !subIsSingleCharacter) { // A negative margin-left was applied to the lower limit. // Avoid an overlap by placing a spacer on the left on the group. - var spacer = buildCommon.makeSpan(["mspace"], [], options); + const spacer = buildCommon.makeSpan(["mspace"], [], options); spacer.style.marginRight = makeEm(slant); parts.unshift(spacer); } @@ -13293,15 +13397,15 @@ var assembleSupSub = function assembleSupSub(base, supGroup, subGroup, options, // Most operators have a large successor symbol, but these don't. -var noSuccessor = ["\\smallint"]; // NOTE: Unlike most `htmlBuilder`s, this one handles not only "op", but also +const noSuccessor = ["\\smallint"]; // NOTE: Unlike most `htmlBuilder`s, this one handles not only "op", but also // "supsub" since some of them (like \int) can affect super/subscripting. -var op_htmlBuilder = function htmlBuilder(grp, options) { +const op_htmlBuilder = (grp, options) => { // Operators are handled in the TeXbook pg. 443-444, rule 13(a). - var supGroup; - var subGroup; - var hasLimits = false; - var group; + let supGroup; + let subGroup; + let hasLimits = false; + let group; if (grp.type === "supsub") { // If we have limits, supsub will pass us its group to handle. Pull @@ -13315,20 +13419,20 @@ var op_htmlBuilder = function htmlBuilder(grp, options) { group = assertNodeType(grp, "op"); } - var style = options.style; - var large = false; + const style = options.style; + let large = false; if (style.size === src_Style.DISPLAY.size && group.symbol && !utils.contains(noSuccessor, group.name)) { // Most symbol operators get larger in displaystyle (rule 13) large = true; } - var base; + let base; if (group.symbol) { // If this is a symbol, create the symbol. - var fontName = large ? "Size2-Regular" : "Size1-Regular"; - var stash = ""; + const fontName = large ? "Size2-Regular" : "Size1-Regular"; + let stash = ""; if (group.name === "\\oiint" || group.name === "\\oiiint") { // No font glyphs yet, so use a glyph w/o the oval. @@ -13342,8 +13446,8 @@ var op_htmlBuilder = function htmlBuilder(grp, options) { if (stash.length > 0) { // We're in \oiint or \oiiint. Overlay the oval. // TODO: When font glyphs are available, delete this code. - var italic = base.italic; - var oval = buildCommon.staticSvg(stash + "Size" + (large ? "2" : "1"), options); + const italic = base.italic; + const oval = buildCommon.staticSvg(stash + "Size" + (large ? "2" : "1"), options); base = buildCommon.makeVList({ positionType: "individualShift", children: [{ @@ -13363,7 +13467,7 @@ var op_htmlBuilder = function htmlBuilder(grp, options) { } } else if (group.body) { // If this is a list, compose that list. - var inner = buildExpression(group.body, options, true); + const inner = buildExpression(group.body, options, true); if (inner.length === 1 && inner[0] instanceof SymbolNode) { base = inner[0]; @@ -13374,9 +13478,9 @@ var op_htmlBuilder = function htmlBuilder(grp, options) { } else { // Otherwise, this is a text operator. Build the text from the // operator's name. - var output = []; + const output = []; - for (var i = 1; i < group.name.length; i++) { + for (let i = 1; i < group.name.length; i++) { output.push(buildCommon.mathsym(group.name[i], group.mode, options)); } @@ -13384,8 +13488,8 @@ var op_htmlBuilder = function htmlBuilder(grp, options) { } // If content of op is a single symbol, shift it vertically. - var baseShift = 0; - var slant = 0; + let baseShift = 0; + let slant = 0; if ((base instanceof SymbolNode || group.name === "\\oiint" || group.name === "\\oiiint") && !group.suppressBaseShift) { // We suppress the shift of the base of \overset and \underset. Otherwise, @@ -13412,8 +13516,8 @@ var op_htmlBuilder = function htmlBuilder(grp, options) { } }; -var op_mathmlBuilder = function mathmlBuilder(group, options) { - var node; +const op_mathmlBuilder = (group, options) => { + let node; if (group.symbol) { // This is a symbol. Just add the symbol. @@ -13431,7 +13535,7 @@ var op_mathmlBuilder = function mathmlBuilder(group, options) { node = new MathNode("mi", [new TextNode(group.name.slice(1))]); // Append an . // ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4 - var operator = new MathNode("mo", [makeText("\u2061", "text")]); + const operator = new MathNode("mo", [makeText("\u2061", "text")]); if (group.parentIsSupSub) { node = new MathNode("mrow", [node, operator]); @@ -13443,30 +13547,32 @@ var op_mathmlBuilder = function mathmlBuilder(group, options) { return node; }; -var singleCharBigOps = { +const singleCharBigOps = { "\u220F": "\\prod", "\u2210": "\\coprod", "\u2211": "\\sum", - "\u22C0": "\\bigwedge", - "\u22C1": "\\bigvee", - "\u22C2": "\\bigcap", - "\u22C3": "\\bigcup", - "\u2A00": "\\bigodot", - "\u2A01": "\\bigoplus", - "\u2A02": "\\bigotimes", - "\u2A04": "\\biguplus", - "\u2A06": "\\bigsqcup" + "\u22c0": "\\bigwedge", + "\u22c1": "\\bigvee", + "\u22c2": "\\bigcap", + "\u22c3": "\\bigcup", + "\u2a00": "\\bigodot", + "\u2a01": "\\bigoplus", + "\u2a02": "\\bigotimes", + "\u2a04": "\\biguplus", + "\u2a06": "\\bigsqcup" }; defineFunction({ type: "op", - names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "\u220F", "\u2210", "\u2211", "\u22C0", "\u22C1", "\u22C2", "\u22C3", "\u2A00", "\u2A01", "\u2A02", "\u2A04", "\u2A06"], + names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "\u220F", "\u2210", "\u2211", "\u22c0", "\u22c1", "\u22c2", "\u22c3", "\u2a00", "\u2a01", "\u2a02", "\u2a04", "\u2a06"], props: { numArgs: 0 }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var fName = funcName; + handler: (_ref, args) => { + let { + parser, + funcName + } = _ref; + let fName = funcName; if (fName.length === 1) { fName = singleCharBigOps[fName]; @@ -13493,9 +13599,11 @@ defineFunction({ numArgs: 1, primitive: true }, - handler: function handler(_ref2, args) { - var parser = _ref2.parser; - var body = args[0]; + handler: (_ref2, args) => { + let { + parser + } = _ref2; + const body = args[0]; return { type: "op", mode: parser.mode, @@ -13511,12 +13619,12 @@ defineFunction({ // displaystyle, and whether they are symbols and should grow in // displaystyle. These four groups cover the four possible choices. -var singleCharIntegrals = { - "\u222B": "\\int", - "\u222C": "\\iint", - "\u222D": "\\iiint", - "\u222E": "\\oint", - "\u222F": "\\oiint", +const singleCharIntegrals = { + "\u222b": "\\int", + "\u222c": "\\iint", + "\u222d": "\\iiint", + "\u222e": "\\oint", + "\u222f": "\\oiint", "\u2230": "\\oiiint" }; // No limits, not symbols @@ -13526,9 +13634,12 @@ defineFunction({ props: { numArgs: 0 }, - handler: function handler(_ref3) { - var parser = _ref3.parser, - funcName = _ref3.funcName; + + handler(_ref3) { + let { + parser, + funcName + } = _ref3; return { type: "op", mode: parser.mode, @@ -13538,6 +13649,7 @@ defineFunction({ name: funcName }; }, + htmlBuilder: op_htmlBuilder, mathmlBuilder: op_mathmlBuilder }); // Limits, not symbols @@ -13548,9 +13660,12 @@ defineFunction({ props: { numArgs: 0 }, - handler: function handler(_ref4) { - var parser = _ref4.parser, - funcName = _ref4.funcName; + + handler(_ref4) { + let { + parser, + funcName + } = _ref4; return { type: "op", mode: parser.mode, @@ -13560,20 +13675,24 @@ defineFunction({ name: funcName }; }, + htmlBuilder: op_htmlBuilder, mathmlBuilder: op_mathmlBuilder }); // No limits, symbols defineFunction({ type: "op", - names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "\u222B", "\u222C", "\u222D", "\u222E", "\u222F", "\u2230"], + names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "\u222b", "\u222c", "\u222d", "\u222e", "\u222f", "\u2230"], props: { numArgs: 0 }, - handler: function handler(_ref5) { - var parser = _ref5.parser, - funcName = _ref5.funcName; - var fName = funcName; + + handler(_ref5) { + let { + parser, + funcName + } = _ref5; + let fName = funcName; if (fName.length === 1) { fName = singleCharIntegrals[fName]; @@ -13588,6 +13707,7 @@ defineFunction({ name: fName }; }, + htmlBuilder: op_htmlBuilder, mathmlBuilder: op_mathmlBuilder }); @@ -13604,12 +13724,12 @@ defineFunction({ // NOTE: Unlike most `htmlBuilder`s, this one handles not only // "operatorname", but also "supsub" since \operatorname* can // affect super/subscripting. -var operatorname_htmlBuilder = function htmlBuilder(grp, options) { +const operatorname_htmlBuilder = (grp, options) => { // Operators are handled in the TeXbook pg. 443-444, rule 13(a). - var supGroup; - var subGroup; - var hasLimits = false; - var group; + let supGroup; + let subGroup; + let hasLimits = false; + let group; if (grp.type === "supsub") { // If we have limits, supsub will pass us its group to handle. Pull @@ -13623,12 +13743,12 @@ var operatorname_htmlBuilder = function htmlBuilder(grp, options) { group = assertNodeType(grp, "operatorname"); } - var base; + let base; if (group.body.length > 0) { - var body = group.body.map(function (child) { + const body = group.body.map(child => { // $FlowFixMe: Check if the node has a string `text` property. - var childText = child.text; + const childText = child.text; if (typeof childText === "string") { return { @@ -13641,10 +13761,10 @@ var operatorname_htmlBuilder = function htmlBuilder(grp, options) { } }); // Consolidate function names into symbol characters. - var expression = buildExpression(body, options.withFont("mathrm"), true); + const expression = buildExpression(body, options.withFont("mathrm"), true); - for (var i = 0; i < expression.length; i++) { - var child = expression[i]; + for (let i = 0; i < expression.length; i++) { + const child = expression[i]; if (child instanceof SymbolNode) { // Per amsopn package, @@ -13665,14 +13785,14 @@ var operatorname_htmlBuilder = function htmlBuilder(grp, options) { } }; -var operatorname_mathmlBuilder = function mathmlBuilder(group, options) { +const operatorname_mathmlBuilder = (group, options) => { // The steps taken here are similar to the html version. - var expression = buildMathML_buildExpression(group.body, options.withFont("mathrm")); // Is expression a string or has it something like a fraction? + let expression = buildMathML_buildExpression(group.body, options.withFont("mathrm")); // Is expression a string or has it something like a fraction? - var isAllString = true; // default + let isAllString = true; // default - for (var i = 0; i < expression.length; i++) { - var node = expression[i]; + for (let i = 0; i < expression.length; i++) { + const node = expression[i]; if (node instanceof mathMLTree.SpaceNode) {// Do nothing } else if (node instanceof mathMLTree.MathNode) { @@ -13687,7 +13807,7 @@ var operatorname_mathmlBuilder = function mathmlBuilder(group, options) { case "mo": { - var child = node.children[0]; + const child = node.children[0]; if (node.children.length === 1 && child instanceof mathMLTree.TextNode) { child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*"); @@ -13708,17 +13828,15 @@ var operatorname_mathmlBuilder = function mathmlBuilder(group, options) { if (isAllString) { // Write a single TextNode instead of multiple nested tags. - var word = expression.map(function (node) { - return node.toText(); - }).join(""); + const word = expression.map(node => node.toText()).join(""); expression = [new mathMLTree.TextNode(word)]; } - var identifier = new mathMLTree.MathNode("mi", expression); + const identifier = new mathMLTree.MathNode("mi", expression); identifier.setAttribute("mathvariant", "normal"); // \u2061 is the same as ⁡ // ref: https://www.w3schools.com/charsets/ref_html_entities_a.asp - var operator = new mathMLTree.MathNode("mo", [makeText("\u2061", "text")]); + const operator = new mathMLTree.MathNode("mo", [makeText("\u2061", "text")]); if (group.parentIsSupSub) { return new mathMLTree.MathNode("mrow", [identifier, operator]); @@ -13735,10 +13853,12 @@ defineFunction({ props: { numArgs: 1 }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var body = args[0]; + handler: (_ref, args) => { + let { + parser, + funcName + } = _ref; + const body = args[0]; return { type: "operatorname", mode: parser.mode, @@ -13759,16 +13879,19 @@ defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@" defineFunctionBuilders({ type: "ordgroup", - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { if (group.semisimple) { return buildCommon.makeFragment(buildExpression(group.body, options, false)); } return buildCommon.makeSpan(["mord"], buildExpression(group.body, options, true), options); }, - mathmlBuilder: function mathmlBuilder(group, options) { + + mathmlBuilder(group, options) { return buildExpressionRow(group.body, options, true); } + }); ;// CONCATENATED MODULE: ./src/functions/overline.js @@ -13782,24 +13905,28 @@ defineFunction({ props: { numArgs: 1 }, - handler: function handler(_ref, args) { - var parser = _ref.parser; - var body = args[0]; + + handler(_ref, args) { + let { + parser + } = _ref; + const body = args[0]; return { type: "overline", mode: parser.mode, - body: body + body }; }, - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { // Overlines are handled in the TeXbook pg 443, Rule 9. // Build the inner group in the cramped style. - var innerGroup = buildGroup(group.body, options.havingCrampedStyle()); // Create the line above the body + const innerGroup = buildGroup(group.body, options.havingCrampedStyle()); // Create the line above the body - var line = buildCommon.makeLineSpan("overline-line", options); // Generate the vlist, with the appropriate kerns + const line = buildCommon.makeLineSpan("overline-line", options); // Generate the vlist, with the appropriate kerns - var defaultRuleThickness = options.fontMetrics().defaultRuleThickness; - var vlist = buildCommon.makeVList({ + const defaultRuleThickness = options.fontMetrics().defaultRuleThickness; + const vlist = buildCommon.makeVList({ positionType: "firstBaseline", children: [{ type: "elem", @@ -13817,13 +13944,15 @@ defineFunction({ }, options); return buildCommon.makeSpan(["mord", "overline"], [vlist], options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203E")]); + + mathmlBuilder(group, options) { + const operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203e")]); operator.setAttribute("stretchy", "true"); - var node = new mathMLTree.MathNode("mover", [buildMathML_buildGroup(group.body, options), operator]); + const node = new mathMLTree.MathNode("mover", [buildMathML_buildGroup(group.body, options), operator]); node.setAttribute("accent", "true"); return node; } + }); ;// CONCATENATED MODULE: ./src/functions/phantom.js @@ -13838,23 +13967,25 @@ defineFunction({ numArgs: 1, allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser; - var body = args[0]; + handler: (_ref, args) => { + let { + parser + } = _ref; + const body = args[0]; return { type: "phantom", mode: parser.mode, body: ordargument(body) }; }, - htmlBuilder: function htmlBuilder(group, options) { - var elements = buildExpression(group.body, options.withPhantom(), false); // \phantom isn't supposed to affect the elements it contains. + htmlBuilder: (group, options) => { + const elements = buildExpression(group.body, options.withPhantom(), false); // \phantom isn't supposed to affect the elements it contains. // See "color" for more details. return buildCommon.makeFragment(elements); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var inner = buildMathML_buildExpression(group.body, options); + mathmlBuilder: (group, options) => { + const inner = buildMathML_buildExpression(group.body, options); return new mathMLTree.MathNode("mphantom", inner); } }); @@ -13865,22 +13996,24 @@ defineFunction({ numArgs: 1, allowedInText: true }, - handler: function handler(_ref2, args) { - var parser = _ref2.parser; - var body = args[0]; + handler: (_ref2, args) => { + let { + parser + } = _ref2; + const body = args[0]; return { type: "hphantom", mode: parser.mode, - body: body + body }; }, - htmlBuilder: function htmlBuilder(group, options) { - var node = buildCommon.makeSpan([], [buildGroup(group.body, options.withPhantom())]); + htmlBuilder: (group, options) => { + let node = buildCommon.makeSpan([], [buildGroup(group.body, options.withPhantom())]); node.height = 0; node.depth = 0; if (node.children) { - for (var i = 0; i < node.children.length; i++) { + for (let i = 0; i < node.children.length; i++) { node.children[i].height = 0; node.children[i].depth = 0; } @@ -13897,10 +14030,10 @@ defineFunction({ return buildCommon.makeSpan(["mord"], [node], options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var inner = buildMathML_buildExpression(ordargument(group.body), options); - var phantom = new mathMLTree.MathNode("mphantom", inner); - var node = new mathMLTree.MathNode("mpadded", [phantom]); + mathmlBuilder: (group, options) => { + const inner = buildMathML_buildExpression(ordargument(group.body), options); + const phantom = new mathMLTree.MathNode("mphantom", inner); + const node = new mathMLTree.MathNode("mpadded", [phantom]); node.setAttribute("height", "0px"); node.setAttribute("depth", "0px"); return node; @@ -13913,24 +14046,26 @@ defineFunction({ numArgs: 1, allowedInText: true }, - handler: function handler(_ref3, args) { - var parser = _ref3.parser; - var body = args[0]; + handler: (_ref3, args) => { + let { + parser + } = _ref3; + const body = args[0]; return { type: "vphantom", mode: parser.mode, - body: body + body }; }, - htmlBuilder: function htmlBuilder(group, options) { - var inner = buildCommon.makeSpan(["inner"], [buildGroup(group.body, options.withPhantom())]); - var fix = buildCommon.makeSpan(["fix"], []); + htmlBuilder: (group, options) => { + const inner = buildCommon.makeSpan(["inner"], [buildGroup(group.body, options.withPhantom())]); + const fix = buildCommon.makeSpan(["fix"], []); return buildCommon.makeSpan(["mord", "rlap"], [inner, fix], options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var inner = buildMathML_buildExpression(ordargument(group.body), options); - var phantom = new mathMLTree.MathNode("mphantom", inner); - var node = new mathMLTree.MathNode("mpadded", [phantom]); + mathmlBuilder: (group, options) => { + const inner = buildMathML_buildExpression(ordargument(group.body), options); + const phantom = new mathMLTree.MathNode("mphantom", inner); + const node = new mathMLTree.MathNode("mpadded", [phantom]); node.setAttribute("width", "0px"); return node; } @@ -13952,20 +14087,24 @@ defineFunction({ argTypes: ["size", "hbox"], allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser; - var amount = assertNodeType(args[0], "size").value; - var body = args[1]; + + handler(_ref, args) { + let { + parser + } = _ref; + const amount = assertNodeType(args[0], "size").value; + const body = args[1]; return { type: "raisebox", mode: parser.mode, dy: amount, - body: body + body }; }, - htmlBuilder: function htmlBuilder(group, options) { - var body = buildGroup(group.body, options); - var dy = calculateSize(group.dy, options); + + htmlBuilder(group, options) { + const body = buildGroup(group.body, options); + const dy = calculateSize(group.dy, options); return buildCommon.makeVList({ positionType: "shift", positionData: -dy, @@ -13975,12 +14114,14 @@ defineFunction({ }] }, options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]); - var dy = group.dy.number + group.dy.unit; + + mathmlBuilder(group, options) { + const node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]); + const dy = group.dy.number + group.dy.unit; node.setAttribute("voffset", dy); return node; } + }); ;// CONCATENATED MODULE: ./src/functions/relax.js @@ -13991,13 +14132,17 @@ defineFunction({ numArgs: 0, allowedInText: true }, - handler: function handler(_ref) { - var parser = _ref.parser; + + handler(_ref) { + let { + parser + } = _ref; return { type: "internal", mode: parser.mode }; } + }); ;// CONCATENATED MODULE: ./src/functions/rule.js @@ -14013,11 +14158,14 @@ defineFunction({ numOptionalArgs: 1, argTypes: ["size", "size", "size"] }, - handler: function handler(_ref, args, optArgs) { - var parser = _ref.parser; - var shift = optArgs[0]; - var width = assertNodeType(args[0], "size"); - var height = assertNodeType(args[1], "size"); + + handler(_ref, args, optArgs) { + let { + parser + } = _ref; + const shift = optArgs[0]; + const width = assertNodeType(args[0], "size"); + const height = assertNodeType(args[1], "size"); return { type: "rule", mode: parser.mode, @@ -14026,13 +14174,14 @@ defineFunction({ height: height.value }; }, - htmlBuilder: function htmlBuilder(group, options) { - // Make an empty span for the rule - var rule = buildCommon.makeSpan(["mord", "rule"], [], options); // Calculate the shift, width, and height of the rule, and account for units - var width = calculateSize(group.width, options); - var height = calculateSize(group.height, options); - var shift = group.shift ? calculateSize(group.shift, options) : 0; // Style the rule to the right size + htmlBuilder(group, options) { + // Make an empty span for the rule + const rule = buildCommon.makeSpan(["mord", "rule"], [], options); // Calculate the shift, width, and height of the rule, and account for units + + const width = calculateSize(group.width, options); + const height = calculateSize(group.height, options); + const shift = group.shift ? calculateSize(group.shift, options) : 0; // Style the rule to the right size rule.style.borderRightWidth = makeEm(width); rule.style.borderTopWidth = makeEm(height); @@ -14047,16 +14196,17 @@ defineFunction({ rule.maxFontSize = height * 1.125 * options.sizeMultiplier; return rule; }, - mathmlBuilder: function mathmlBuilder(group, options) { - var width = calculateSize(group.width, options); - var height = calculateSize(group.height, options); - var shift = group.shift ? calculateSize(group.shift, options) : 0; - var color = options.color && options.getColor() || "black"; - var rule = new mathMLTree.MathNode("mspace"); + + mathmlBuilder(group, options) { + const width = calculateSize(group.width, options); + const height = calculateSize(group.height, options); + const shift = group.shift ? calculateSize(group.shift, options) : 0; + const color = options.color && options.getColor() || "black"; + const rule = new mathMLTree.MathNode("mspace"); rule.setAttribute("mathbackground", color); rule.setAttribute("width", makeEm(width)); rule.setAttribute("height", makeEm(height)); - var wrapper = new mathMLTree.MathNode("mpadded", [rule]); + const wrapper = new mathMLTree.MathNode("mpadded", [rule]); if (shift >= 0) { wrapper.setAttribute("height", makeEm(shift)); @@ -14068,6 +14218,7 @@ defineFunction({ wrapper.setAttribute("voffset", makeEm(shift)); return wrapper; } + }); ;// CONCATENATED MODULE: ./src/functions/sizing.js @@ -14077,12 +14228,12 @@ defineFunction({ function sizingGroup(value, options, baseOptions) { - var inner = buildExpression(value, options, false); - var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; // Add size-resetting classes to the inner list and set maxFontSize + const inner = buildExpression(value, options, false); + const multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; // Add size-resetting classes to the inner list and set maxFontSize // manually. Handle nested size changes. - for (var i = 0; i < inner.length; i++) { - var pos = inner[i].classes.indexOf("sizing"); + for (let i = 0; i < inner.length; i++) { + const pos = inner[i].classes.indexOf("sizing"); if (pos < 0) { Array.prototype.push.apply(inner[i].classes, options.sizingClasses(baseOptions)); @@ -14099,12 +14250,12 @@ function sizingGroup(value, options, baseOptions) { return buildCommon.makeFragment(inner); } -var sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"]; -var sizing_htmlBuilder = function htmlBuilder(group, options) { +const sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"]; +const sizing_htmlBuilder = (group, options) => { // Handle sizing operators like \Huge. Real TeX doesn't actually allow // these functions inside of math expressions, so we do some special // handling. - var newOptions = options.havingSize(group.size); + const newOptions = options.havingSize(group.size); return sizingGroup(group.body, newOptions, options); }; defineFunction({ @@ -14114,24 +14265,26 @@ defineFunction({ numArgs: 0, allowedInText: true }, - handler: function handler(_ref, args) { - var breakOnTokenText = _ref.breakOnTokenText, - funcName = _ref.funcName, - parser = _ref.parser; - var body = parser.parseExpression(false, breakOnTokenText); + handler: (_ref, args) => { + let { + breakOnTokenText, + funcName, + parser + } = _ref; + const body = parser.parseExpression(false, breakOnTokenText); return { type: "sizing", mode: parser.mode, // Figure out what size to use based on the list of functions above size: sizeFuncs.indexOf(funcName) + 1, - body: body + body }; }, htmlBuilder: sizing_htmlBuilder, - mathmlBuilder: function mathmlBuilder(group, options) { - var newOptions = options.havingSize(group.size); - var inner = buildMathML_buildExpression(group.body, newOptions); - var node = new mathMLTree.MathNode("mstyle", inner); // TODO(emily): This doesn't produce the correct size for nested size + mathmlBuilder: (group, options) => { + const newOptions = options.havingSize(group.size); + const inner = buildMathML_buildExpression(group.body, newOptions); + const node = new mathMLTree.MathNode("mstyle", inner); // TODO(emily): This doesn't produce the correct size for nested size // changes, because we don't keep state of what style we're currently // in, so we can't reset the size to normal before changing it. Now // that we're passing an options parameter we should be able to fix @@ -14157,20 +14310,22 @@ defineFunction({ numOptionalArgs: 1, allowedInText: true }, - handler: function handler(_ref, args, optArgs) { - var parser = _ref.parser; - var smashHeight = false; - var smashDepth = false; - var tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup"); + handler: (_ref, args, optArgs) => { + let { + parser + } = _ref; + let smashHeight = false; + let smashDepth = false; + const tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup"); if (tbArg) { // Optional [tb] argument is engaged. // ref: amsmath: \renewcommand{\smash}[1][tb]{% // def\mb@t{\ht}\def\mb@b{\dp}\def\mb@tb{\ht\z@\z@\dp}% - var letter = ""; + let letter = ""; - for (var i = 0; i < tbArg.body.length; ++i) { - var node = tbArg.body[i]; // $FlowFixMe: Not every node type has a `text` property. + for (let i = 0; i < tbArg.body.length; ++i) { + const node = tbArg.body[i]; // $FlowFixMe: Not every node type has a `text` property. letter = node.text; @@ -14189,17 +14344,17 @@ defineFunction({ smashDepth = true; } - var body = args[0]; + const body = args[0]; return { type: "smash", mode: parser.mode, - body: body, - smashHeight: smashHeight, - smashDepth: smashDepth + body, + smashHeight, + smashDepth }; }, - htmlBuilder: function htmlBuilder(group, options) { - var node = buildCommon.makeSpan([], [buildGroup(group.body, options)]); + htmlBuilder: (group, options) => { + const node = buildCommon.makeSpan([], [buildGroup(group.body, options)]); if (!group.smashHeight && !group.smashDepth) { return node; @@ -14209,7 +14364,7 @@ defineFunction({ node.height = 0; // In order to influence makeVList, we have to reset the children. if (node.children) { - for (var i = 0; i < node.children.length; i++) { + for (let i = 0; i < node.children.length; i++) { node.children[i].height = 0; } } @@ -14219,8 +14374,8 @@ defineFunction({ node.depth = 0; if (node.children) { - for (var _i = 0; _i < node.children.length; _i++) { - node.children[_i].depth = 0; + for (let i = 0; i < node.children.length; i++) { + node.children[i].depth = 0; } } } // At this point, we've reset the TeX-like height and depth values. @@ -14229,7 +14384,7 @@ defineFunction({ // from acting on that line height. So we'll call makeVList now. - var smashedNode = buildCommon.makeVList({ + const smashedNode = buildCommon.makeVList({ positionType: "firstBaseline", children: [{ type: "elem", @@ -14239,8 +14394,8 @@ defineFunction({ return buildCommon.makeSpan(["mord"], [smashedNode], options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]); + mathmlBuilder: (group, options) => { + const node = new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]); if (group.smashHeight) { node.setAttribute("height", "0px"); @@ -14269,22 +14424,26 @@ defineFunction({ numArgs: 1, numOptionalArgs: 1 }, - handler: function handler(_ref, args, optArgs) { - var parser = _ref.parser; - var index = optArgs[0]; - var body = args[0]; + + handler(_ref, args, optArgs) { + let { + parser + } = _ref; + const index = optArgs[0]; + const body = args[0]; return { type: "sqrt", mode: parser.mode, - body: body, - index: index + body, + index }; }, - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { // Square roots are handled in the TeXbook pg. 443, Rule 11. // First, we do the same steps as in overline to build the inner group // and line - var inner = buildGroup(group.body, options.havingCrampedStyle()); + let inner = buildGroup(group.body, options.havingCrampedStyle()); if (inner.height === 0) { // Render a small surd. @@ -14295,34 +14454,34 @@ defineFunction({ inner = buildCommon.wrapFragment(inner, options); // Calculate the minimum size for the \surd delimiter - var metrics = options.fontMetrics(); - var theta = metrics.defaultRuleThickness; - var phi = theta; + const metrics = options.fontMetrics(); + const theta = metrics.defaultRuleThickness; + let phi = theta; if (options.style.id < src_Style.TEXT.id) { phi = options.fontMetrics().xHeight; } // Calculate the clearance between the body and line - var lineClearance = theta + phi / 4; - var minDelimiterHeight = inner.height + inner.depth + lineClearance + theta; // Create a sqrt SVG of the required minimum size + let lineClearance = theta + phi / 4; + const minDelimiterHeight = inner.height + inner.depth + lineClearance + theta; // Create a sqrt SVG of the required minimum size - var _delimiter$sqrtImage = delimiter.sqrtImage(minDelimiterHeight, options), - img = _delimiter$sqrtImage.span, - ruleWidth = _delimiter$sqrtImage.ruleWidth, - advanceWidth = _delimiter$sqrtImage.advanceWidth; - - var delimDepth = img.height - ruleWidth; // Adjust the clearance based on the delimiter size + const { + span: img, + ruleWidth, + advanceWidth + } = delimiter.sqrtImage(minDelimiterHeight, options); + const delimDepth = img.height - ruleWidth; // Adjust the clearance based on the delimiter size if (delimDepth > inner.height + inner.depth + lineClearance) { lineClearance = (lineClearance + delimDepth - inner.height - inner.depth) / 2; } // Shift the sqrt image - var imgShift = img.height - inner.height - lineClearance - ruleWidth; + const imgShift = img.height - inner.height - lineClearance - ruleWidth; inner.style.paddingLeft = makeEm(advanceWidth); // Overlay the image and the argument. - var body = buildCommon.makeVList({ + const body = buildCommon.makeVList({ positionType: "firstBaseline", children: [{ type: "elem", @@ -14345,13 +14504,13 @@ defineFunction({ } else { // Handle the optional root index // The index is always in scriptscript style - var newOptions = options.havingStyle(src_Style.SCRIPTSCRIPT); - var rootm = buildGroup(group.index, newOptions, options); // The amount the index is shifted by. This is taken from the TeX + const newOptions = options.havingStyle(src_Style.SCRIPTSCRIPT); + const rootm = buildGroup(group.index, newOptions, options); // The amount the index is shifted by. This is taken from the TeX // source, in the definition of `\r@@t`. - var toShift = 0.6 * (body.height - body.depth); // Build a VList with the superscript shifted up correctly + const toShift = 0.6 * (body.height - body.depth); // Build a VList with the superscript shifted up correctly - var rootVList = buildCommon.makeVList({ + const rootVList = buildCommon.makeVList({ positionType: "shift", positionData: -toShift, children: [{ @@ -14361,15 +14520,19 @@ defineFunction({ }, options); // Add a class surrounding it so we can add on the appropriate // kerning - var rootVListWrap = buildCommon.makeSpan(["root"], [rootVList]); + const rootVListWrap = buildCommon.makeSpan(["root"], [rootVList]); return buildCommon.makeSpan(["mord", "sqrt"], [rootVListWrap, body], options); } }, - mathmlBuilder: function mathmlBuilder(group, options) { - var body = group.body, - index = group.index; + + mathmlBuilder(group, options) { + const { + body, + index + } = group; return index ? new mathMLTree.MathNode("mroot", [buildMathML_buildGroup(body, options), buildMathML_buildGroup(index, options)]) : new mathMLTree.MathNode("msqrt", [buildMathML_buildGroup(body, options)]); } + }); ;// CONCATENATED MODULE: ./src/functions/styling.js @@ -14377,7 +14540,7 @@ defineFunction({ -var styling_styleMap = { +const styling_styleMap = { "display": src_Style.DISPLAY, "text": src_Style.TEXT, "script": src_Style.SCRIPT, @@ -14391,48 +14554,54 @@ defineFunction({ allowedInText: true, primitive: true }, - handler: function handler(_ref, args) { - var breakOnTokenText = _ref.breakOnTokenText, - funcName = _ref.funcName, - parser = _ref.parser; + + handler(_ref, args) { + let { + breakOnTokenText, + funcName, + parser + } = _ref; // parse out the implicit body - var body = parser.parseExpression(true, breakOnTokenText); // TODO: Refactor to avoid duplicating styleMap in multiple places (e.g. + const body = parser.parseExpression(true, breakOnTokenText); // TODO: Refactor to avoid duplicating styleMap in multiple places (e.g. // here and in buildHTML and de-dupe the enumeration of all the styles). // $FlowFixMe: The names above exactly match the styles. - var style = funcName.slice(1, funcName.length - 5); + const style = funcName.slice(1, funcName.length - 5); return { type: "styling", mode: parser.mode, // Figure out what style to use by pulling out the style from // the function name - style: style, - body: body + style, + body }; }, - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { // Style changes are handled in the TeXbook on pg. 442, Rule 3. - var newStyle = styling_styleMap[group.style]; - var newOptions = options.havingStyle(newStyle).withFont(''); + const newStyle = styling_styleMap[group.style]; + const newOptions = options.havingStyle(newStyle).withFont(''); return sizingGroup(group.body, newOptions, options); }, - mathmlBuilder: function mathmlBuilder(group, options) { + + mathmlBuilder(group, options) { // Figure out what style we're changing to. - var newStyle = styling_styleMap[group.style]; - var newOptions = options.havingStyle(newStyle); - var inner = buildMathML_buildExpression(group.body, newOptions); - var node = new mathMLTree.MathNode("mstyle", inner); - var styleAttributes = { + const newStyle = styling_styleMap[group.style]; + const newOptions = options.havingStyle(newStyle); + const inner = buildMathML_buildExpression(group.body, newOptions); + const node = new mathMLTree.MathNode("mstyle", inner); + const styleAttributes = { "display": ["0", "true"], "text": ["0", "false"], "script": ["1", "false"], "scriptscript": ["2", "false"] }; - var attr = styleAttributes[group.style]; + const attr = styleAttributes[group.style]; node.setAttribute("scriptlevel", attr[0]); node.setAttribute("displaystyle", attr[1]); return node; } + }); ;// CONCATENATED MODULE: ./src/functions/supsub.js @@ -14456,24 +14625,23 @@ defineFunction({ * its inner element should handle the superscripts and subscripts instead of * handling them itself. */ -var htmlBuilderDelegate = function htmlBuilderDelegate(group, options) { - var base = group.base; +const htmlBuilderDelegate = function (group, options) { + const base = group.base; if (!base) { return null; } else if (base.type === "op") { // Operators handle supsubs differently when they have limits // (e.g. `\displaystyle\sum_2^3`) - var delegate = base.limits && (options.style.size === src_Style.DISPLAY.size || base.alwaysHandleSupSub); + const delegate = base.limits && (options.style.size === src_Style.DISPLAY.size || base.alwaysHandleSupSub); return delegate ? op_htmlBuilder : null; } else if (base.type === "operatorname") { - var _delegate = base.alwaysHandleSupSub && (options.style.size === src_Style.DISPLAY.size || base.limits); - - return _delegate ? operatorname_htmlBuilder : null; + const delegate = base.alwaysHandleSupSub && (options.style.size === src_Style.DISPLAY.size || base.limits); + return delegate ? operatorname_htmlBuilder : null; } else if (base.type === "accent") { return utils.isCharacterBox(base.base) ? htmlBuilder : null; } else if (base.type === "horizBrace") { - var isSup = !group.sub; + const isSup = !group.sub; return isSup === base.isOver ? horizBrace_htmlBuilder : null; } else { return null; @@ -14484,31 +14652,34 @@ var htmlBuilderDelegate = function htmlBuilderDelegate(group, options) { defineFunctionBuilders({ type: "supsub", - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { // Superscript and subscripts are handled in the TeXbook on page // 445-446, rules 18(a-f). // Here is where we defer to the inner group if it should handle // superscripts and subscripts itself. - var builderDelegate = htmlBuilderDelegate(group, options); + const builderDelegate = htmlBuilderDelegate(group, options); if (builderDelegate) { return builderDelegate(group, options); } - var valueBase = group.base, - valueSup = group.sup, - valueSub = group.sub; - var base = buildGroup(valueBase, options); - var supm; - var subm; - var metrics = options.fontMetrics(); // Rule 18a + const { + base: valueBase, + sup: valueSup, + sub: valueSub + } = group; + const base = buildGroup(valueBase, options); + let supm; + let subm; + const metrics = options.fontMetrics(); // Rule 18a - var supShift = 0; - var subShift = 0; - var isCharacterBox = valueBase && utils.isCharacterBox(valueBase); + let supShift = 0; + let subShift = 0; + const isCharacterBox = valueBase && utils.isCharacterBox(valueBase); if (valueSup) { - var newOptions = options.havingStyle(options.style.sup()); + const newOptions = options.havingStyle(options.style.sup()); supm = buildGroup(valueSup, newOptions, options); if (!isCharacterBox) { @@ -14517,17 +14688,16 @@ defineFunctionBuilders({ } if (valueSub) { - var _newOptions = options.havingStyle(options.style.sub()); - - subm = buildGroup(valueSub, _newOptions, options); + const newOptions = options.havingStyle(options.style.sub()); + subm = buildGroup(valueSub, newOptions, options); if (!isCharacterBox) { - subShift = base.depth + _newOptions.fontMetrics().subDrop * _newOptions.sizeMultiplier / options.sizeMultiplier; + subShift = base.depth + newOptions.fontMetrics().subDrop * newOptions.sizeMultiplier / options.sizeMultiplier; } } // Rule 18c - var minSupShift; + let minSupShift; if (options.style === src_Style.DISPLAY) { minSupShift = metrics.sup1; @@ -14539,15 +14709,15 @@ defineFunctionBuilders({ // appropriately for use as the marginRight. - var multiplier = options.sizeMultiplier; - var marginRight = makeEm(0.5 / metrics.ptPerEm / multiplier); - var marginLeft = null; + const multiplier = options.sizeMultiplier; + const marginRight = makeEm(0.5 / metrics.ptPerEm / multiplier); + let marginLeft = null; if (subm) { // Subscripts shouldn't be shifted by the base's italic correction. // Account for that by shifting the subscript back the appropriate // amount. Note we only do this when the base is a single symbol. - var isOiint = group.base && group.base.type === "op" && group.base.name && (group.base.name === "\\oiint" || group.base.name === "\\oiiint"); + const isOiint = group.base && group.base.type === "op" && group.base.name && (group.base.name === "\\oiint" || group.base.name === "\\oiiint"); if (base instanceof SymbolNode || isOiint) { // $FlowFixMe @@ -14555,18 +14725,18 @@ defineFunctionBuilders({ } } - var supsub; + let supsub; if (supm && subm) { supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight); subShift = Math.max(subShift, metrics.sub2); - var ruleWidth = metrics.defaultRuleThickness; // Rule 18e + const ruleWidth = metrics.defaultRuleThickness; // Rule 18e - var maxWidth = 4 * ruleWidth; + const maxWidth = 4 * ruleWidth; if (supShift - supm.depth - (subm.height - subShift) < maxWidth) { subShift = maxWidth - (supShift - supm.depth) + subm.height; - var psi = 0.8 * metrics.xHeight - (supShift - supm.depth); + const psi = 0.8 * metrics.xHeight - (supShift - supm.depth); if (psi > 0) { supShift += psi; @@ -14574,17 +14744,17 @@ defineFunctionBuilders({ } } - var vlistElem = [{ + const vlistElem = [{ type: "elem", elem: subm, shift: subShift, - marginRight: marginRight, - marginLeft: marginLeft + marginRight, + marginLeft }, { type: "elem", elem: supm, shift: -supShift, - marginRight: marginRight + marginRight }]; supsub = buildCommon.makeVList({ positionType: "individualShift", @@ -14593,16 +14763,16 @@ defineFunctionBuilders({ } else if (subm) { // Rule 18b subShift = Math.max(subShift, metrics.sub1, subm.height - 0.8 * metrics.xHeight); - var _vlistElem = [{ + const vlistElem = [{ type: "elem", elem: subm, - marginLeft: marginLeft, - marginRight: marginRight + marginLeft, + marginRight }]; supsub = buildCommon.makeVList({ positionType: "shift", positionData: subShift, - children: _vlistElem + children: vlistElem }, options); } else if (supm) { // Rule 18c, d @@ -14613,7 +14783,7 @@ defineFunctionBuilders({ children: [{ type: "elem", elem: supm, - marginRight: marginRight + marginRight }] }, options); } else { @@ -14621,14 +14791,15 @@ defineFunctionBuilders({ } // Wrap the supsub vlist in a span.msupsub to reset text-align. - var mclass = getTypeOfDomTree(base, "right") || "mord"; + const mclass = getTypeOfDomTree(base, "right") || "mord"; return buildCommon.makeSpan([mclass], [base, buildCommon.makeSpan(["msupsub"], [supsub])], options); }, - mathmlBuilder: function mathmlBuilder(group, options) { + + mathmlBuilder(group, options) { // Is the inner group a relevant horizonal brace? - var isBrace = false; - var isOver; - var isSup; + let isBrace = false; + let isOver; + let isSup; if (group.base && group.base.type === "horizBrace") { isSup = !!group.sup; @@ -14643,7 +14814,7 @@ defineFunctionBuilders({ group.base.parentIsSupSub = true; } - var children = [buildMathML_buildGroup(group.base, options)]; + const children = [buildMathML_buildGroup(group.base, options)]; if (group.sub) { children.push(buildMathML_buildGroup(group.sub, options)); @@ -14653,12 +14824,12 @@ defineFunctionBuilders({ children.push(buildMathML_buildGroup(group.sup, options)); } - var nodeType; + let nodeType; if (isBrace) { nodeType = isOver ? "mover" : "munder"; } else if (!group.sub) { - var base = group.base; + const base = group.base; if (base && base.type === "op" && base.limits && (options.style === src_Style.DISPLAY || base.alwaysHandleSupSub)) { nodeType = "mover"; @@ -14668,21 +14839,21 @@ defineFunctionBuilders({ nodeType = "msup"; } } else if (!group.sup) { - var _base = group.base; + const base = group.base; - if (_base && _base.type === "op" && _base.limits && (options.style === src_Style.DISPLAY || _base.alwaysHandleSupSub)) { + if (base && base.type === "op" && base.limits && (options.style === src_Style.DISPLAY || base.alwaysHandleSupSub)) { nodeType = "munder"; - } else if (_base && _base.type === "operatorname" && _base.alwaysHandleSupSub && (_base.limits || options.style === src_Style.DISPLAY)) { + } else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (base.limits || options.style === src_Style.DISPLAY)) { nodeType = "munder"; } else { nodeType = "msub"; } } else { - var _base2 = group.base; + const base = group.base; - if (_base2 && _base2.type === "op" && _base2.limits && options.style === src_Style.DISPLAY) { + if (base && base.type === "op" && base.limits && options.style === src_Style.DISPLAY) { nodeType = "munderover"; - } else if (_base2 && _base2.type === "operatorname" && _base2.alwaysHandleSupSub && (options.style === src_Style.DISPLAY || _base2.limits)) { + } else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (options.style === src_Style.DISPLAY || base.limits)) { nodeType = "munderover"; } else { nodeType = "msubsup"; @@ -14691,6 +14862,7 @@ defineFunctionBuilders({ return new mathMLTree.MathNode(nodeType, children); } + }); ;// CONCATENATED MODULE: ./src/functions/symbolsOp.js @@ -14700,14 +14872,16 @@ defineFunctionBuilders({ defineFunctionBuilders({ type: "atom", - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { return buildCommon.mathsym(group.text, group.mode, options, ["m" + group.family]); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var node = new mathMLTree.MathNode("mo", [makeText(group.text, group.mode)]); + + mathmlBuilder(group, options) { + const node = new mathMLTree.MathNode("mo", [makeText(group.text, group.mode)]); if (group.family === "bin") { - var variant = getVariant(group, options); + const variant = getVariant(group, options); if (variant === "bold-italic") { node.setAttribute("mathvariant", variant); @@ -14722,6 +14896,7 @@ defineFunctionBuilders({ return node; } + }); ;// CONCATENATED MODULE: ./src/functions/symbolsOrd.js @@ -14730,19 +14905,21 @@ defineFunctionBuilders({ // "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in // src/symbols.js. -var defaultVariant = { +const defaultVariant = { "mi": "italic", "mn": "normal", "mtext": "normal" }; defineFunctionBuilders({ type: "mathord", - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { return buildCommon.makeOrd(group, options, "mathord"); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var node = new mathMLTree.MathNode("mi", [makeText(group.text, group.mode, options)]); - var variant = getVariant(group, options) || "italic"; + + mathmlBuilder(group, options) { + const node = new mathMLTree.MathNode("mi", [makeText(group.text, group.mode, options)]); + const variant = getVariant(group, options) || "italic"; if (variant !== defaultVariant[node.type]) { node.setAttribute("mathvariant", variant); @@ -14750,16 +14927,19 @@ defineFunctionBuilders({ return node; } + }); defineFunctionBuilders({ type: "textord", - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { return buildCommon.makeOrd(group, options, "textord"); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var text = makeText(group.text, group.mode, options); - var variant = getVariant(group, options) || "normal"; - var node; + + mathmlBuilder(group, options) { + const text = makeText(group.text, group.mode, options); + const variant = getVariant(group, options) || "normal"; + let node; if (group.mode === 'text') { node = new mathMLTree.MathNode("mtext", [text]); @@ -14777,6 +14957,7 @@ defineFunctionBuilders({ return node; } + }); ;// CONCATENATED MODULE: ./src/functions/symbolsSpacing.js @@ -14784,7 +14965,7 @@ defineFunctionBuilders({ // A map of CSS-based spacing functions to their CSS class. -var cssSpace = { +const cssSpace = { "\\nobreak": "nobreak", "\\allowbreak": "allowbreak" }; // A lookup table to determine whether a spacing function/symbol should be @@ -14793,7 +14974,7 @@ var cssSpace = { // the associated value may have a `className` specifying an extra CSS class // to add to the created `span`. -var regularSpace = { +const regularSpace = { " ": {}, "\\ ": {}, "~": { @@ -14808,14 +14989,15 @@ var regularSpace = { defineFunctionBuilders({ type: "spacing", - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { if (regularSpace.hasOwnProperty(group.text)) { - var className = regularSpace[group.text].className || ""; // Spaces are generated by adding an actual space. Each of these + const className = regularSpace[group.text].className || ""; // Spaces are generated by adding an actual space. Each of these // things has an entry in the symbols table, so these will be turned // into appropriate outputs. if (group.mode === "text") { - var ord = buildCommon.makeOrd(group, options, "textord"); + const ord = buildCommon.makeOrd(group, options, "textord"); ord.classes.push(className); return ord; } else { @@ -14828,11 +15010,12 @@ defineFunctionBuilders({ throw new src_ParseError("Unknown type of space \"" + group.text + "\""); } }, - mathmlBuilder: function mathmlBuilder(group, options) { - var node; + + mathmlBuilder(group, options) { + let node; if (regularSpace.hasOwnProperty(group.text)) { - node = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode("\xA0")]); + node = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode("\u00a0")]); } else if (cssSpace.hasOwnProperty(group.text)) { // CSS-based MathML spaces (\nobreak, \allowbreak) are ignored return new mathMLTree.MathNode("mspace"); @@ -14842,22 +15025,24 @@ defineFunctionBuilders({ return node; } + }); ;// CONCATENATED MODULE: ./src/functions/tag.js -var pad = function pad() { - var padNode = new mathMLTree.MathNode("mtd", []); +const pad = () => { + const padNode = new mathMLTree.MathNode("mtd", []); padNode.setAttribute("width", "50%"); return padNode; }; defineFunctionBuilders({ type: "tag", - mathmlBuilder: function mathmlBuilder(group, options) { - var table = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mtr", [pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group.body, options)]), pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group.tag, options)])])]); + + mathmlBuilder(group, options) { + const table = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mtr", [pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group.body, options)]), pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group.tag, options)])])]); table.setAttribute("width", "100%"); return table; // TODO: Left-aligned tags. // Currently, the group and options passed here do not contain @@ -14867,6 +15052,7 @@ defineFunctionBuilders({ // in MathML if browsers supported . Since they don't, we // need to rewrite the way this function is called. } + }); ;// CONCATENATED MODULE: ./src/functions/text.js @@ -14874,24 +15060,24 @@ defineFunctionBuilders({ // Non-mathy text, possibly in a font -var textFontFamilies = { +const textFontFamilies = { "\\text": undefined, "\\textrm": "textrm", "\\textsf": "textsf", "\\texttt": "texttt", "\\textnormal": "textrm" }; -var textFontWeights = { +const textFontWeights = { "\\textbf": "textbf", "\\textmd": "textmd" }; -var textFontShapes = { +const textFontShapes = { "\\textit": "textit", "\\textup": "textup" }; -var optionsWithFont = function optionsWithFont(group, options) { - var font = group.font; // Checks if the argument is a font family or a font style. +const optionsWithFont = (group, options) => { + const font = group.font; // Checks if the argument is a font family or a font style. if (!font) { return options; @@ -14916,10 +15102,13 @@ defineFunction({ allowedInArgument: true, allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser, - funcName = _ref.funcName; - var body = args[0]; + + handler(_ref, args) { + let { + parser, + funcName + } = _ref; + const body = args[0]; return { type: "text", mode: parser.mode, @@ -14927,15 +15116,18 @@ defineFunction({ font: funcName }; }, - htmlBuilder: function htmlBuilder(group, options) { - var newOptions = optionsWithFont(group, options); - var inner = buildExpression(group.body, newOptions, true); + + htmlBuilder(group, options) { + const newOptions = optionsWithFont(group, options); + const inner = buildExpression(group.body, newOptions, true); return buildCommon.makeSpan(["mord", "text"], inner, newOptions); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var newOptions = optionsWithFont(group, options); + + mathmlBuilder(group, options) { + const newOptions = optionsWithFont(group, options); return buildExpressionRow(group.body, newOptions); } + }); ;// CONCATENATED MODULE: ./src/functions/underline.js @@ -14950,23 +15142,27 @@ defineFunction({ numArgs: 1, allowedInText: true }, - handler: function handler(_ref, args) { - var parser = _ref.parser; + + handler(_ref, args) { + let { + parser + } = _ref; return { type: "underline", mode: parser.mode, body: args[0] }; }, - htmlBuilder: function htmlBuilder(group, options) { + + htmlBuilder(group, options) { // Underlines are handled in the TeXbook pg 443, Rule 10. // Build the inner group. - var innerGroup = buildGroup(group.body, options); // Create the line to go below the body + const innerGroup = buildGroup(group.body, options); // Create the line to go below the body - var line = buildCommon.makeLineSpan("underline-line", options); // Generate the vlist, with the appropriate kerns + const line = buildCommon.makeLineSpan("underline-line", options); // Generate the vlist, with the appropriate kerns - var defaultRuleThickness = options.fontMetrics().defaultRuleThickness; - var vlist = buildCommon.makeVList({ + const defaultRuleThickness = options.fontMetrics().defaultRuleThickness; + const vlist = buildCommon.makeVList({ positionType: "top", positionData: innerGroup.height, children: [{ @@ -14985,13 +15181,15 @@ defineFunction({ }, options); return buildCommon.makeSpan(["mord", "underline"], [vlist], options); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203E")]); + + mathmlBuilder(group, options) { + const operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203e")]); operator.setAttribute("stretchy", "true"); - var node = new mathMLTree.MathNode("munder", [buildMathML_buildGroup(group.body, options), operator]); + const node = new mathMLTree.MathNode("munder", [buildMathML_buildGroup(group.body, options), operator]); node.setAttribute("accentunder", "true"); return node; } + }); ;// CONCATENATED MODULE: ./src/functions/vcenter.js @@ -15009,18 +15207,22 @@ defineFunction({ // In LaTeX, \vcenter can act only on a box. allowedInText: false }, - handler: function handler(_ref, args) { - var parser = _ref.parser; + + handler(_ref, args) { + let { + parser + } = _ref; return { type: "vcenter", mode: parser.mode, body: args[0] }; }, - htmlBuilder: function htmlBuilder(group, options) { - var body = buildGroup(group.body, options); - var axisHeight = options.fontMetrics().axisHeight; - var dy = 0.5 * (body.height - axisHeight - (body.depth + axisHeight)); + + htmlBuilder(group, options) { + const body = buildGroup(group.body, options); + const axisHeight = options.fontMetrics().axisHeight; + const dy = 0.5 * (body.height - axisHeight - (body.depth + axisHeight)); return buildCommon.makeVList({ positionType: "shift", positionData: dy, @@ -15030,12 +15232,14 @@ defineFunction({ }] }, options); }, - mathmlBuilder: function mathmlBuilder(group, options) { + + mathmlBuilder(group, options) { // There is no way to do this in MathML. // Write a class as a breadcrumb in case some post-processor wants // to perform a vcenter adjustment. return new mathMLTree.MathNode("mpadded", [buildMathML_buildGroup(group.body, options)], ["vcenter"]); } + }); ;// CONCATENATED MODULE: ./src/functions/verb.js @@ -15049,21 +15253,23 @@ defineFunction({ numArgs: 0, allowedInText: true }, - handler: function handler(context, args, optArgs) { + + handler(context, args, optArgs) { // \verb and \verb* are dealt with directly in Parser.js. // If we end up here, it's because of a failure to match the two delimiters // in the regex in Lexer.js. LaTeX raises the following error when \verb is // terminated by end of line (or file). throw new src_ParseError("\\verb ended by end of line instead of matching delimiter"); }, - htmlBuilder: function htmlBuilder(group, options) { - var text = makeVerb(group); - var body = []; // \verb enters text mode and therefore is sized like \textstyle - var newOptions = options.havingStyle(options.style.text()); + htmlBuilder(group, options) { + const text = makeVerb(group); + const body = []; // \verb enters text mode and therefore is sized like \textstyle - for (var i = 0; i < text.length; i++) { - var c = text[i]; + const newOptions = options.havingStyle(options.style.text()); + + for (let i = 0; i < text.length; i++) { + let c = text[i]; if (c === '~') { c = '\\textasciitilde'; @@ -15074,12 +15280,14 @@ defineFunction({ return buildCommon.makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options)), buildCommon.tryCombineChars(body), newOptions); }, - mathmlBuilder: function mathmlBuilder(group, options) { - var text = new mathMLTree.TextNode(makeVerb(group)); - var node = new mathMLTree.MathNode("mtext", [text]); + + mathmlBuilder(group, options) { + const text = new mathMLTree.TextNode(makeVerb(group)); + const node = new mathMLTree.MathNode("mtext", [text]); node.setAttribute("mathvariant", "monospace"); return node; } + }); /** * Converts verb group into body string. @@ -15088,13 +15296,11 @@ defineFunction({ * \verb replaces each space with a no-break space \xA0 */ -var makeVerb = function makeVerb(group) { - return group.body.replace(/ /g, group.star ? "\u2423" : '\xA0'); -}; +const makeVerb = group => group.body.replace(/ /g, group.star ? '\u2423' : '\xA0'); ;// CONCATENATED MODULE: ./src/functions.js /** Include this to ensure that all functions are defined. */ -var functions = _functions; +const functions = _functions; /* harmony default export */ var src_functions = (functions); // TODO(kevinb): have functions return an object and call defineFunction with // that object in this file instead of relying on side-effects. @@ -15184,14 +15390,14 @@ var functions = _functions; * If there is no matching function or symbol definition, the Parser will * still reject the input. */ -var spaceRegexString = "[ \r\n\t]"; -var controlWordRegexString = "\\\\[a-zA-Z@]+"; -var controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]"; -var controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*"; -var controlSpaceRegexString = "\\\\(\n|[ \r\t]+\n?)[ \r\t]*"; -var combiningDiacriticalMarkString = "[\u0300-\u036F]"; -var combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$"); -var tokenRegexString = "(" + spaceRegexString + "+)|" + ( // whitespace +const spaceRegexString = "[ \r\n\t]"; +const controlWordRegexString = "\\\\[a-zA-Z@]+"; +const controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]"; +const controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*"; +const controlSpaceRegexString = "\\\\(\n|[ \r\t]+\n?)[ \r\t]*"; +const combiningDiacriticalMarkString = "[\u0300-\u036f]"; +const combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$"); +const tokenRegexString = "(" + spaceRegexString + "+)|" + ( // whitespace controlSpaceRegexString + "|") + // \whitespace "([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + ( // single codepoint combiningDiacriticalMarkString + "*") + // ...plus accents @@ -15204,10 +15410,10 @@ combiningDiacriticalMarkString + "*") + // ...plus accents /** Main Lexer class */ -var Lexer = /*#__PURE__*/function () { +class Lexer { // Category codes. The lexer only supports comment characters (14) for now. // MacroExpander additionally distinguishes active (13). - function Lexer(input, settings) { + constructor(input, settings) { this.input = void 0; this.settings = void 0; this.tokenRegex = void 0; @@ -15224,35 +15430,33 @@ var Lexer = /*#__PURE__*/function () { }; } - var _proto = Lexer.prototype; - - _proto.setCatcode = function setCatcode(char, code) { + setCatcode(char, code) { this.catcodes[char] = code; } /** * This function lexes a single token. */ - ; - _proto.lex = function lex() { - var input = this.input; - var pos = this.tokenRegex.lastIndex; + + lex() { + const input = this.input; + const pos = this.tokenRegex.lastIndex; if (pos === input.length) { return new Token("EOF", new SourceLocation(this, pos, pos)); } - var match = this.tokenRegex.exec(input); + const match = this.tokenRegex.exec(input); if (match === null || match.index !== pos) { throw new src_ParseError("Unexpected character: '" + input[pos] + "'", new Token(input[pos], new SourceLocation(this, pos, pos + 1))); } - var text = match[6] || match[3] || (match[2] ? "\\ " : " "); + const text = match[6] || match[3] || (match[2] ? "\\ " : " "); if (this.catcodes[text] === 14) { // comment character - var nlIndex = input.indexOf('\n', this.tokenRegex.lastIndex); + const nlIndex = input.indexOf('\n', this.tokenRegex.lastIndex); if (nlIndex === -1) { this.tokenRegex.lastIndex = input.length; // EOF @@ -15266,12 +15470,9 @@ var Lexer = /*#__PURE__*/function () { } return new Token(text, new SourceLocation(this, pos, this.tokenRegex.lastIndex)); - }; - - return Lexer; -}(); - + } +} ;// CONCATENATED MODULE: ./src/Namespace.js /** * A `Namespace` refers to a space of nameable things like macros or lengths, @@ -15281,15 +15482,14 @@ var Lexer = /*#__PURE__*/function () { * `set` takes time proportional to the depth of group nesting. */ - -var Namespace = /*#__PURE__*/function () { +class Namespace { /** * Both arguments are optional. The first argument is an object of * built-in mappings which never change. The second argument is an object * of initial (global-level) mappings, which will constantly change * according to any global/top-level `set`s done. */ - function Namespace(builtins, globalMacros) { + constructor(builtins, globalMacros) { if (builtins === void 0) { builtins = {}; } @@ -15310,24 +15510,22 @@ var Namespace = /*#__PURE__*/function () { */ - var _proto = Namespace.prototype; - - _proto.beginGroup = function beginGroup() { + beginGroup() { this.undefStack.push({}); } /** * End current nested group, restoring values before the group began. */ - ; - _proto.endGroup = function endGroup() { + + endGroup() { if (this.undefStack.length === 0) { throw new src_ParseError("Unbalanced namespace destruction: attempt " + "to pop global namespace; please report this as a bug"); } - var undefs = this.undefStack.pop(); + const undefs = this.undefStack.pop(); - for (var undef in undefs) { + for (const undef in undefs) { if (undefs.hasOwnProperty(undef)) { if (undefs[undef] == null) { delete this.current[undef]; @@ -15341,9 +15539,9 @@ var Namespace = /*#__PURE__*/function () { * Ends all currently nested groups (if any), restoring values before the * groups began. Useful in case of an error in the middle of parsing. */ - ; - _proto.endGroups = function endGroups() { + + endGroups() { while (this.undefStack.length > 0) { this.endGroup(); } @@ -15352,9 +15550,9 @@ var Namespace = /*#__PURE__*/function () { * Detect whether `name` has a definition. Equivalent to * `get(name) != null`. */ - ; - _proto.has = function has(name) { + + has(name) { return this.current.hasOwnProperty(name) || this.builtins.hasOwnProperty(name); } /** @@ -15365,9 +15563,9 @@ var Namespace = /*#__PURE__*/function () { * to `false` in JavaScript. Use `if (namespace.get(...) != null)` or * `if (namespace.has(...))`. */ - ; - _proto.get = function get(name) { + + get(name) { if (this.current.hasOwnProperty(name)) { return this.current[name]; } else { @@ -15381,9 +15579,9 @@ var Namespace = /*#__PURE__*/function () { * operation at every level, so takes time linear in their number. * A value of undefined means to delete existing definitions. */ - ; - _proto.set = function set(name, value, global) { + + set(name, value, global) { if (global === void 0) { global = false; } @@ -15393,7 +15591,7 @@ var Namespace = /*#__PURE__*/function () { // by destroying any undos currently scheduled for this name, // and adding an undo with the *new* value (in case it later gets // locally reset within this environment). - for (var i = 0; i < this.undefStack.length; i++) { + for (let i = 0; i < this.undefStack.length; i++) { delete this.undefStack[i][name]; } @@ -15404,7 +15602,7 @@ var Namespace = /*#__PURE__*/function () { // Undo this set at end of this group (possibly to `undefined`), // unless an undo is already in place, in which case that older // value is the correct one. - var top = this.undefStack[this.undefStack.length - 1]; + const top = this.undefStack[this.undefStack.length - 1]; if (top && !top.hasOwnProperty(name)) { top[name] = this.current[name]; @@ -15416,12 +15614,9 @@ var Namespace = /*#__PURE__*/function () { } else { this.current[name] = value; } - }; - - return Namespace; -}(); - + } +} ;// CONCATENATED MODULE: ./src/macros.js /** * Predefined macros for KaTeX. @@ -15429,7 +15624,7 @@ var Namespace = /*#__PURE__*/function () { */ // Export global macros object from defineMacro -var macros = _macros; +const macros = _macros; /* harmony default export */ var src_macros = (macros); @@ -15443,7 +15638,7 @@ defineMacro("\\noexpand", function (context) { // The expansion is the token itself; but that token is interpreted // as if its meaning were ‘\relax’ if it is a control sequence that // would ordinarily be expanded by TeX’s expansion rules. - var t = context.popToken(); + const t = context.popToken(); if (context.isExpandable(t.text)) { t.noexpand = true; @@ -15461,7 +15656,7 @@ defineMacro("\\expandafter", function (context) { // token that comes after t (and possibly more tokens, if that token // has an argument), replacing it by its expansion. Finally TeX puts // t back in front of that expansion. - var t = context.popToken(); + const t = context.popToken(); context.expandOnce(true); // expand only an expandable token return { @@ -15472,7 +15667,7 @@ defineMacro("\\expandafter", function (context) { // TeX source: \long\def\@firstoftwo#1#2{#1} defineMacro("\\@firstoftwo", function (context) { - var args = context.consumeArgs(2); + const args = context.consumeArgs(2); return { tokens: args[0], numArgs: 0 @@ -15481,7 +15676,7 @@ defineMacro("\\@firstoftwo", function (context) { // TeX source: \long\def\@secondoftwo#1#2{#2} defineMacro("\\@secondoftwo", function (context) { - var args = context.consumeArgs(2); + const args = context.consumeArgs(2); return { tokens: args[1], numArgs: 0 @@ -15492,10 +15687,10 @@ defineMacro("\\@secondoftwo", function (context) { // the macro expands to #2; otherwise, it expands to #3. defineMacro("\\@ifnextchar", function (context) { - var args = context.consumeArgs(3); // symbol, if, else + const args = context.consumeArgs(3); // symbol, if, else context.consumeSpaces(); - var nextToken = context.future(); + const nextToken = context.future(); if (args[0].length === 1 && args[0][0].text === nextToken.text) { return { @@ -15516,7 +15711,7 @@ defineMacro("\\@ifnextchar", function (context) { defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}"); // LaTeX's \TextOrMath{#1}{#2} expands to #1 in text mode, #2 in math mode defineMacro("\\TextOrMath", function (context) { - var args = context.consumeArgs(2); + const args = context.consumeArgs(2); if (context.mode === 'text') { return { @@ -15531,7 +15726,7 @@ defineMacro("\\TextOrMath", function (context) { } }); // Lookup table for parsing numbers in base 8 through 16 -var digitToNumber = { +const digitToNumber = { "0": 0, "1": 1, "2": 2, @@ -15565,9 +15760,9 @@ var digitToNumber = { // calls to a function \@char dealt with in the Parser. defineMacro("\\char", function (context) { - var token = context.popToken(); - var base; - var number = ''; + let token = context.popToken(); + let base; + let number = ''; if (token.text === "'") { base = 8; @@ -15597,7 +15792,7 @@ defineMacro("\\char", function (context) { throw new src_ParseError("Invalid base-" + base + " digit " + token.text); } - var digit; + let digit; while ((digit = digitToNumber[context.future().text]) != null && digit < base) { number *= base; @@ -15611,15 +15806,15 @@ defineMacro("\\char", function (context) { // \renewcommand{\macro}[args]{definition} // TODO: Optional arguments: \newcommand{\macro}[args][default]{definition} -var newcommand = function newcommand(context, existsOK, nonexistsOK) { - var arg = context.consumeArg().tokens; +const newcommand = (context, existsOK, nonexistsOK) => { + let arg = context.consumeArg().tokens; if (arg.length !== 1) { throw new src_ParseError("\\newcommand's first argument must be a macro name"); } - var name = arg[0].text; - var exists = context.isDefined(name); + const name = arg[0].text; + const exists = context.isDefined(name); if (exists && !existsOK) { throw new src_ParseError("\\newcommand{" + name + "} attempting to redefine " + (name + "; use \\renewcommand")); @@ -15629,12 +15824,12 @@ var newcommand = function newcommand(context, existsOK, nonexistsOK) { throw new src_ParseError("\\renewcommand{" + name + "} when command " + name + " " + "does not yet exist; use \\newcommand"); } - var numArgs = 0; + let numArgs = 0; arg = context.consumeArg().tokens; if (arg.length === 1 && arg[0].text === "[") { - var argText = ''; - var token = context.expandNextToken(); + let argText = ''; + let token = context.expandNextToken(); while (token.text !== "]" && token.text !== "EOF") { // TODO: Should properly expand arg, e.g., ignore {}s @@ -15653,40 +15848,30 @@ var newcommand = function newcommand(context, existsOK, nonexistsOK) { context.macros.set(name, { tokens: arg, - numArgs: numArgs + numArgs }); return ''; }; -defineMacro("\\newcommand", function (context) { - return newcommand(context, false, true); -}); -defineMacro("\\renewcommand", function (context) { - return newcommand(context, true, false); -}); -defineMacro("\\providecommand", function (context) { - return newcommand(context, true, true); -}); // terminal (console) tools +defineMacro("\\newcommand", context => newcommand(context, false, true)); +defineMacro("\\renewcommand", context => newcommand(context, true, false)); +defineMacro("\\providecommand", context => newcommand(context, true, true)); // terminal (console) tools -defineMacro("\\message", function (context) { - var arg = context.consumeArgs(1)[0]; // eslint-disable-next-line no-console +defineMacro("\\message", context => { + const arg = context.consumeArgs(1)[0]; // eslint-disable-next-line no-console - console.log(arg.reverse().map(function (token) { - return token.text; - }).join("")); + console.log(arg.reverse().map(token => token.text).join("")); return ''; }); -defineMacro("\\errmessage", function (context) { - var arg = context.consumeArgs(1)[0]; // eslint-disable-next-line no-console +defineMacro("\\errmessage", context => { + const arg = context.consumeArgs(1)[0]; // eslint-disable-next-line no-console - console.error(arg.reverse().map(function (token) { - return token.text; - }).join("")); + console.error(arg.reverse().map(token => token.text).join("")); return ''; }); -defineMacro("\\show", function (context) { - var tok = context.popToken(); - var name = tok.text; // eslint-disable-next-line no-console +defineMacro("\\show", context => { + const tok = context.popToken(); + const name = tok.text; // eslint-disable-next-line no-console console.log(tok, context.macros.get(name), src_functions[name], src_symbols.math[name], src_symbols.text[name]); return ''; @@ -15735,7 +15920,7 @@ defineMacro("\\Bbbk", "\\Bbb{k}"); // Unicode middle dot // The KaTeX fonts do not contain U+00B7. Instead, \cdotp displays // the dot at U+22C5 and gives it punct spacing. -defineMacro("\xB7", "\\cdotp"); // \llap and \rlap render their contents in text mode +defineMacro("\u00b7", "\\cdotp"); // \llap and \rlap render their contents in text mode defineMacro("\\llap", "\\mathllap{\\textrm{#1}}"); defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}"); @@ -15776,8 +15961,8 @@ defineMacro("\u231C", "\\ulcorner"); defineMacro("\u231D", "\\urcorner"); defineMacro("\u231E", "\\llcorner"); defineMacro("\u231F", "\\lrcorner"); -defineMacro("\xA9", "\\copyright"); -defineMacro("\xAE", "\\textregistered"); +defineMacro("\u00A9", "\\copyright"); +defineMacro("\u00AE", "\\textregistered"); defineMacro("\uFE0F", "\\textregistered"); // The KaTeX fonts have corners at codepoints that don't match Unicode. // For MathML purposes, use the Unicode code point. @@ -15792,7 +15977,7 @@ defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}"); // The zero-width rule gets us an equivalent to the vertical 6pt kern. defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}"); -defineMacro("\u22EE", "\\vdots"); ////////////////////////////////////////////////////////////////////// +defineMacro("\u22ee", "\\vdots"); ////////////////////////////////////////////////////////////////////// // amsmath.sty // http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf // Italic Greek capital letters. AMS defines these with \DeclareMathSymbol, @@ -15823,7 +16008,7 @@ defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;"); defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;"); defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); // AMSMath's automatic \dots, based on \mdots@@ macro. -var dotsByToken = { +const dotsByToken = { ',': '\\dotsc', '\\not': '\\dotsb', // \keybin@ checks for the following: @@ -15884,8 +16069,8 @@ defineMacro("\\dots", function (context) { // (in text mode), and it's unlikely we'd see any of the math commands // that affect the behavior of \dots when in text mode. So fine for now // (until we support \ifmmode ... \else ... \fi). - var thedots = '\\dotso'; - var next = context.expandAfterFuture().text; + let thedots = '\\dotso'; + const next = context.expandAfterFuture().text; if (next in dotsByToken) { thedots = dotsByToken[next]; @@ -15899,7 +16084,7 @@ defineMacro("\\dots", function (context) { return thedots; }); -var spaceAfterDots = { +const spaceAfterDots = { // \rightdelim@ checks for the following: ')': true, ']': true, @@ -15924,7 +16109,7 @@ var spaceAfterDots = { ',': true }; defineMacro("\\dotso", function (context) { - var next = context.future().text; + const next = context.future().text; if (next in spaceAfterDots) { return "\\ldots\\,"; @@ -15933,7 +16118,7 @@ defineMacro("\\dotso", function (context) { } }); defineMacro("\\dotsc", function (context) { - var next = context.future().text; // \dotsc uses \extra@ but not \extrap@, instead specially checking for + const next = context.future().text; // \dotsc uses \extra@ but not \extrap@, instead specially checking for // ';' and '.', but doesn't check for ','. if (next in spaceAfterDots && next !== ',') { @@ -15943,7 +16128,7 @@ defineMacro("\\dotsc", function (context) { } }); defineMacro("\\cdots", function (context) { - var next = context.future().text; + const next = context.future().text; if (next in spaceAfterDots) { return "\\@cdots\\,"; @@ -16007,7 +16192,7 @@ defineMacro("\\qquad", "\\hskip2em\\relax"); // \tag@in@display form of \tag defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren"); defineMacro("\\tag@paren", "\\tag@literal{({#1})}"); -defineMacro("\\tag@literal", function (context) { +defineMacro("\\tag@literal", context => { if (context.macros.get("\\df@tag")) { throw new src_ParseError("Multiple \\tag"); } @@ -16052,7 +16237,7 @@ defineMacro("\\TeX", "\\textrm{\\html@mathml{" + "T\\kern-.1667em\\raisebox{-.5e // We compute the corresponding \raisebox when A is rendered in \normalsize // \scriptstyle, which has a scale factor of 0.7 (see Options.js). -var latexRaiseA = makeEm(fontMetricsData["Main-Regular"]["T".charCodeAt(0)][1] - 0.7 * fontMetricsData["Main-Regular"]["A".charCodeAt(0)][1]); +const latexRaiseA = makeEm(fontMetricsData["Main-Regular"]["T".charCodeAt(0)][1] - 0.7 * fontMetricsData["Main-Regular"]["A".charCodeAt(0)][1]); defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}"); // New KaTeX logo based on tweaking LaTeX logo defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}"); // \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace} @@ -16165,11 +16350,11 @@ defineMacro("\\jmath", "\\html@mathml{\\@jmath}{\u0237}"); ///////////////////// // The stmaryrd and semantic packages render the next four items by calling a // glyph. Those glyphs do not exist in the KaTeX fonts. Hence the macros. -defineMacro("\\llbracket", "\\html@mathml{" + "\\mathopen{[\\mkern-3.2mu[}}" + "{\\mathopen{\\char`\u27E6}}"); -defineMacro("\\rrbracket", "\\html@mathml{" + "\\mathclose{]\\mkern-3.2mu]}}" + "{\\mathclose{\\char`\u27E7}}"); -defineMacro("\u27E6", "\\llbracket"); // blackboard bold [ +defineMacro("\\llbracket", "\\html@mathml{" + "\\mathopen{[\\mkern-3.2mu[}}" + "{\\mathopen{\\char`\u27e6}}"); +defineMacro("\\rrbracket", "\\html@mathml{" + "\\mathclose{]\\mkern-3.2mu]}}" + "{\\mathclose{\\char`\u27e7}}"); +defineMacro("\u27e6", "\\llbracket"); // blackboard bold [ -defineMacro("\u27E7", "\\rrbracket"); // blackboard bold ] +defineMacro("\u27e7", "\\rrbracket"); // blackboard bold ] defineMacro("\\lBrace", "\\html@mathml{" + "\\mathopen{\\{\\mkern-3.2mu[}}" + "{\\mathopen{\\char`\u2983}}"); defineMacro("\\rBrace", "\\html@mathml{" + "\\mathclose{]\\mkern-3.2mu\\}}}" + "{\\mathclose{\\char`\u2984}}"); @@ -16268,60 +16453,57 @@ defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}"); defineMacro("\\Bra", "\\left\\langle#1\\right|"); defineMacro("\\Ket", "\\left|#1\\right\\rangle"); -var braketHelper = function braketHelper(one) { - return function (context) { - var left = context.consumeArg().tokens; - var middle = context.consumeArg().tokens; - var middleDouble = context.consumeArg().tokens; - var right = context.consumeArg().tokens; - var oldMiddle = context.macros.get("|"); - var oldMiddleDouble = context.macros.get("\\|"); - context.macros.beginGroup(); +const braketHelper = one => context => { + const left = context.consumeArg().tokens; + const middle = context.consumeArg().tokens; + const middleDouble = context.consumeArg().tokens; + const right = context.consumeArg().tokens; + const oldMiddle = context.macros.get("|"); + const oldMiddleDouble = context.macros.get("\\|"); + context.macros.beginGroup(); - var midMacro = function midMacro(double) { - return function (context) { - if (one) { - // Only modify the first instance of | or \| - context.macros.set("|", oldMiddle); + const midMacro = double => context => { + if (one) { + // Only modify the first instance of | or \| + context.macros.set("|", oldMiddle); - if (middleDouble.length) { - context.macros.set("\\|", oldMiddleDouble); - } - } - - var doubled = double; - - if (!double && middleDouble.length) { - // Mimic \@ifnextchar - var nextToken = context.future(); - - if (nextToken.text === "|") { - context.popToken(); - doubled = true; - } - } - - return { - tokens: doubled ? middleDouble : middle, - numArgs: 0 - }; - }; - }; - - context.macros.set("|", midMacro(false)); - - if (middleDouble.length) { - context.macros.set("\\|", midMacro(true)); + if (middleDouble.length) { + context.macros.set("\\|", oldMiddleDouble); + } + } + + let doubled = double; + + if (!double && middleDouble.length) { + // Mimic \@ifnextchar + const nextToken = context.future(); + + if (nextToken.text === "|") { + context.popToken(); + doubled = true; + } } - var arg = context.consumeArg().tokens; - var expanded = context.expandTokens([].concat(right, arg, left)); - context.macros.endGroup(); return { - tokens: expanded.reverse(), + tokens: doubled ? middleDouble : middle, numArgs: 0 }; }; + + context.macros.set("|", midMacro(false)); + + if (middleDouble.length) { + context.macros.set("\\|", midMacro(true)); + } + + const arg = context.consumeArg().tokens; + const expanded = context.expandTokens([...right, ...arg, ...left // reversed + ]); + context.macros.endGroup(); + return { + tokens: expanded.reverse(), + numArgs: 0 + }; }; defineMacro("\\bra@ket", braketHelper(false)); @@ -16404,7 +16586,7 @@ defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}"); // List of commands that act like macros but aren't defined as a macro, // function, or symbol. Used in `isDefined`. -var implicitCommands = { +const implicitCommands = { "^": true, // Parser.js "_": true, @@ -16414,9 +16596,8 @@ var implicitCommands = { "\\nolimits": true // Parser.js }; - -var MacroExpander = /*#__PURE__*/function () { - function MacroExpander(input, settings, mode) { +class MacroExpander { + constructor(input, settings, mode) { this.settings = void 0; this.expansionCount = void 0; this.lexer = void 0; @@ -16437,51 +16618,49 @@ var MacroExpander = /*#__PURE__*/function () { */ - var _proto = MacroExpander.prototype; - - _proto.feed = function feed(input) { + feed(input) { this.lexer = new Lexer(input, this.settings); } /** * Switches between "text" and "math" modes. */ - ; - _proto.switchMode = function switchMode(newMode) { + + switchMode(newMode) { this.mode = newMode; } /** * Start a new group nesting within all namespaces. */ - ; - _proto.beginGroup = function beginGroup() { + + beginGroup() { this.macros.beginGroup(); } /** * End current group nesting within all namespaces. */ - ; - _proto.endGroup = function endGroup() { + + endGroup() { this.macros.endGroup(); } /** * Ends all currently nested groups (if any), restoring values before the * groups began. Useful in case of an error in the middle of parsing. */ - ; - _proto.endGroups = function endGroups() { + + endGroups() { this.macros.endGroups(); } /** * Returns the topmost token on the stack, without expanding it. * Similar in behavior to TeX's `\futurelet`. */ - ; - _proto.future = function future() { + + future() { if (this.stack.length === 0) { this.pushToken(this.lexer.lex()); } @@ -16491,9 +16670,9 @@ var MacroExpander = /*#__PURE__*/function () { /** * Remove and return the next unexpanded token. */ - ; - _proto.popToken = function popToken() { + + popToken() { this.future(); // ensure non-empty stack return this.stack.pop(); @@ -16502,31 +16681,29 @@ var MacroExpander = /*#__PURE__*/function () { * Add a given token to the token stack. In particular, this get be used * to put back a token returned from one of the other methods. */ - ; - _proto.pushToken = function pushToken(token) { + + pushToken(token) { this.stack.push(token); } /** * Append an array of tokens to the token stack. */ - ; - _proto.pushTokens = function pushTokens(tokens) { - var _this$stack; - (_this$stack = this.stack).push.apply(_this$stack, tokens); + pushTokens(tokens) { + this.stack.push(...tokens); } /** * Find an macro argument without expanding tokens and append the array of * tokens to the token stack. Uses Token as a container for the result. */ - ; - _proto.scanArgument = function scanArgument(isOptional) { - var start; - var end; - var tokens; + + scanArgument(isOptional) { + let start; + let end; + let tokens; if (isOptional) { this.consumeSpaces(); // \@ifnextchar gobbles any space following it @@ -16537,16 +16714,16 @@ var MacroExpander = /*#__PURE__*/function () { start = this.popToken(); // don't include [ in tokens - var _this$consumeArg = this.consumeArg(["]"]); - - tokens = _this$consumeArg.tokens; - end = _this$consumeArg.end; + ({ + tokens, + end + } = this.consumeArg(["]"])); } else { - var _this$consumeArg2 = this.consumeArg(); - - tokens = _this$consumeArg2.tokens; - start = _this$consumeArg2.start; - end = _this$consumeArg2.end; + ({ + tokens, + start, + end + } = this.consumeArg()); } // indicate the end of an argument @@ -16557,11 +16734,11 @@ var MacroExpander = /*#__PURE__*/function () { /** * Consume all following space tokens, without expansion. */ - ; - _proto.consumeSpaces = function consumeSpaces() { + + consumeSpaces() { for (;;) { - var token = this.future(); + const token = this.future(); if (token.text === " ") { this.stack.pop(); @@ -16574,17 +16751,17 @@ var MacroExpander = /*#__PURE__*/function () { * Consume an argument from the token stream, and return the resulting array * of tokens and start/end token. */ - ; - _proto.consumeArg = function consumeArg(delims) { + + consumeArg(delims) { // The argument for a delimited parameter is the shortest (possibly // empty) sequence of tokens with properly nested {...} groups that is // followed ... by this particular list of non-parameter tokens. // The argument for an undelimited parameter is the next nonblank // token, unless that token is ‘{’, when the argument will be the // entire {...} group that follows. - var tokens = []; - var isDelimited = delims && delims.length > 0; + const tokens = []; + const isDelimited = delims && delims.length > 0; if (!isDelimited) { // Ignore spaces between arguments. As the TeXbook says: @@ -16594,10 +16771,10 @@ var MacroExpander = /*#__PURE__*/function () { this.consumeSpaces(); } - var start = this.future(); - var tok; - var depth = 0; - var match = 0; + const start = this.future(); + let tok; + let depth = 0; + let match = 0; do { tok = this.popToken(); @@ -16640,8 +16817,8 @@ var MacroExpander = /*#__PURE__*/function () { tokens.reverse(); // to fit in with stack order return { - tokens: tokens, - start: start, + tokens, + start, end: tok }; } @@ -16649,18 +16826,18 @@ var MacroExpander = /*#__PURE__*/function () { * Consume the specified number of (delimited) arguments from the token * stream and return the resulting array of arguments. */ - ; - _proto.consumeArgs = function consumeArgs(numArgs, delimiters) { + + consumeArgs(numArgs, delimiters) { if (delimiters) { if (delimiters.length !== numArgs + 1) { throw new src_ParseError("The length of delimiters doesn't match the number of args!"); } - var delims = delimiters[0]; + const delims = delimiters[0]; - for (var i = 0; i < delims.length; i++) { - var tok = this.popToken(); + for (let i = 0; i < delims.length; i++) { + const tok = this.popToken(); if (delims[i] !== tok.text) { throw new src_ParseError("Use of the macro doesn't match its definition", tok); @@ -16668,14 +16845,27 @@ var MacroExpander = /*#__PURE__*/function () { } } - var args = []; + const args = []; - for (var _i = 0; _i < numArgs; _i++) { - args.push(this.consumeArg(delimiters && delimiters[_i + 1]).tokens); + for (let i = 0; i < numArgs; i++) { + args.push(this.consumeArg(delimiters && delimiters[i + 1]).tokens); } return args; } + /** + * Increment `expansionCount` by the specified amount. + * Throw an error if it exceeds `maxExpand`. + */ + + + countExpansion(amount) { + this.expansionCount += amount; + + if (this.expansionCount > this.settings.maxExpand) { + throw new src_ParseError("Too many expansions: infinite loop or " + "need to increase maxExpand setting"); + } + } /** * Expand the next token only once if possible. * @@ -16695,12 +16885,12 @@ var MacroExpander = /*#__PURE__*/function () { * If expandableOnly, only expandable tokens are expanded and * an undefined control sequence results in an error. */ - ; - _proto.expandOnce = function expandOnce(expandableOnly) { - var topToken = this.popToken(); - var name = topToken.text; - var expansion = !topToken.noexpand ? this._getExpansion(name) : null; + + expandOnce(expandableOnly) { + const topToken = this.popToken(); + const name = topToken.text; + const expansion = !topToken.noexpand ? this._getExpansion(name) : null; if (expansion == null || expandableOnly && expansion.unexpandable) { if (expandableOnly && expansion == null && name[0] === "\\" && !this.isDefined(name)) { @@ -16711,21 +16901,16 @@ var MacroExpander = /*#__PURE__*/function () { return false; } - this.expansionCount++; - - if (this.expansionCount > this.settings.maxExpand) { - throw new src_ParseError("Too many expansions: infinite loop or " + "need to increase maxExpand setting"); - } - - var tokens = expansion.tokens; - var args = this.consumeArgs(expansion.numArgs, expansion.delimiters); + this.countExpansion(1); + let tokens = expansion.tokens; + const args = this.consumeArgs(expansion.numArgs, expansion.delimiters); if (expansion.numArgs) { // paste arguments in place of the placeholders tokens = tokens.slice(); // make a shallow copy - for (var i = tokens.length - 1; i >= 0; --i) { - var tok = tokens[i]; + for (let i = tokens.length - 1; i >= 0; --i) { + let tok = tokens[i]; if (tok.text === "#") { if (i === 0) { @@ -16738,10 +16923,8 @@ var MacroExpander = /*#__PURE__*/function () { // ## → # tokens.splice(i + 1, 1); // drop first # } else if (/^[1-9]$/.test(tok.text)) { - var _tokens; - // replace the placeholder with the indicated argument - (_tokens = tokens).splice.apply(_tokens, [i, 2].concat(args[+tok.text - 1])); + tokens.splice(i, 2, ...args[+tok.text - 1]); } else { throw new src_ParseError("Not a valid argument number", tok); } @@ -16759,22 +16942,22 @@ var MacroExpander = /*#__PURE__*/function () { * Similar in behavior to TeX's `\expandafter\futurelet`. * Equivalent to expandOnce() followed by future(). */ - ; - _proto.expandAfterFuture = function expandAfterFuture() { + + expandAfterFuture() { this.expandOnce(); return this.future(); } /** * Recursively expand first token, then return first non-expandable token. */ - ; - _proto.expandNextToken = function expandNextToken() { + + expandNextToken() { for (;;) { if (this.expandOnce() === false) { // fully expanded - var token = this.stack.pop(); // the token after \noexpand is interpreted as if its meaning + const token = this.stack.pop(); // the token after \noexpand is interpreted as if its meaning // were ‘\relax’ if (token.treatAsRelax) { @@ -16793,9 +16976,9 @@ var MacroExpander = /*#__PURE__*/function () { * Fully expand the given macro name and return the resulting list of * tokens, or return `undefined` if no such macro is defined. */ - ; - _proto.expandMacro = function expandMacro(name) { + + expandMacro(name) { return this.macros.has(name) ? this.expandTokens([new Token(name)]) : undefined; } /** @@ -16803,18 +16986,18 @@ var MacroExpander = /*#__PURE__*/function () { * tokens. Note that the input tokens are in reverse order, but the * output tokens are in forward order. */ - ; - _proto.expandTokens = function expandTokens(tokens) { - var output = []; - var oldStackLength = this.stack.length; + + expandTokens(tokens) { + const output = []; + const oldStackLength = this.stack.length; this.pushTokens(tokens); while (this.stack.length > oldStackLength) { // Expand only expandable tokens if (this.expandOnce(true) === false) { // fully expanded - var token = this.stack.pop(); + const token = this.stack.pop(); if (token.treatAsRelax) { // the expansion of \noexpand is the token itself @@ -16824,23 +17007,24 @@ var MacroExpander = /*#__PURE__*/function () { output.push(token); } - } + } // Count all of these tokens as additional expansions, to prevent + // exponential blowup from linearly many \edef's. + + this.countExpansion(output.length); return output; } /** * Fully expand the given macro name and return the result as a string, * or return `undefined` if no such macro is defined. */ - ; - _proto.expandMacroAsText = function expandMacroAsText(name) { - var tokens = this.expandMacro(name); + + expandMacroAsText(name) { + const tokens = this.expandMacro(name); if (tokens) { - return tokens.map(function (token) { - return token.text; - }).join(""); + return tokens.map(token => token.text).join(""); } else { return tokens; } @@ -16849,10 +17033,10 @@ var MacroExpander = /*#__PURE__*/function () { * Returns the expanded macro as a reversed array of tokens and a macro * argument count. Or returns `null` if no such macro. */ - ; - _proto._getExpansion = function _getExpansion(name) { - var definition = this.macros.get(name); + + _getExpansion(name) { + const definition = this.macros.get(name); if (definition == null) { // mainly checking for undefined here @@ -16862,29 +17046,29 @@ var MacroExpander = /*#__PURE__*/function () { if (name.length === 1) { - var catcode = this.lexer.catcodes[name]; + const catcode = this.lexer.catcodes[name]; if (catcode != null && catcode !== 13) { return; } } - var expansion = typeof definition === "function" ? definition(this) : definition; + const expansion = typeof definition === "function" ? definition(this) : definition; if (typeof expansion === "string") { - var numArgs = 0; + let numArgs = 0; if (expansion.indexOf("#") !== -1) { - var stripped = expansion.replace(/##/g, ""); + const stripped = expansion.replace(/##/g, ""); while (stripped.indexOf("#" + (numArgs + 1)) !== -1) { ++numArgs; } } - var bodyLexer = new Lexer(expansion, this.settings); - var tokens = []; - var tok = bodyLexer.lex(); + const bodyLexer = new Lexer(expansion, this.settings); + const tokens = []; + let tok = bodyLexer.lex(); while (tok.text !== "EOF") { tokens.push(tok); @@ -16893,9 +17077,9 @@ var MacroExpander = /*#__PURE__*/function () { tokens.reverse(); // to fit in with stack using push and pop - var expanded = { - tokens: tokens, - numArgs: numArgs + const expanded = { + tokens, + numArgs }; return expanded; } @@ -16908,29 +17092,26 @@ var MacroExpander = /*#__PURE__*/function () { * a function, a symbol, or one of the special commands listed in * `implicitCommands`. */ - ; - _proto.isDefined = function isDefined(name) { + + isDefined(name) { return this.macros.has(name) || src_functions.hasOwnProperty(name) || src_symbols.math.hasOwnProperty(name) || src_symbols.text.hasOwnProperty(name) || implicitCommands.hasOwnProperty(name); } /** * Determine whether a command is expandable. */ - ; - _proto.isExpandable = function isExpandable(name) { - var macro = this.macros.get(name); + + isExpandable(name) { + const macro = this.macros.get(name); return macro != null ? typeof macro === "string" || typeof macro === "function" || !macro.unexpandable : src_functions.hasOwnProperty(name) && !src_functions[name].primitive; - }; - - return MacroExpander; -}(); - + } +} ;// CONCATENATED MODULE: ./src/unicodeSupOrSub.js // Helpers for Parser.js handling of Unicode (sub|super)script characters. -var unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/; -var uSubsAndSups = Object.freeze({ +const unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/; +const uSubsAndSups = Object.freeze({ '₊': '+', '₋': '-', '₌': '=', @@ -16946,28 +17127,28 @@ var uSubsAndSups = Object.freeze({ '₇': '7', '₈': '8', '₉': '9', - "\u2090": 'a', - "\u2091": 'e', - "\u2095": 'h', - "\u1D62": 'i', - "\u2C7C": 'j', - "\u2096": 'k', - "\u2097": 'l', - "\u2098": 'm', - "\u2099": 'n', - "\u2092": 'o', - "\u209A": 'p', - "\u1D63": 'r', - "\u209B": 's', - "\u209C": 't', - "\u1D64": 'u', - "\u1D65": 'v', - "\u2093": 'x', - "\u1D66": 'β', - "\u1D67": 'γ', - "\u1D68": 'ρ', - "\u1D69": "\u03D5", - "\u1D6A": 'χ', + '\u2090': 'a', + '\u2091': 'e', + '\u2095': 'h', + '\u1D62': 'i', + '\u2C7C': 'j', + '\u2096': 'k', + '\u2097': 'l', + '\u2098': 'm', + '\u2099': 'n', + '\u2092': 'o', + '\u209A': 'p', + '\u1D63': 'r', + '\u209B': 's', + '\u209C': 't', + '\u1D64': 'u', + '\u1D65': 'v', + '\u2093': 'x', + '\u1D66': 'β', + '\u1D67': 'γ', + '\u1D68': 'ρ', + '\u1D69': '\u03d5', + '\u1D6A': 'χ', '⁺': '+', '⁻': '-', '⁼': '=', @@ -16983,56 +17164,56 @@ var uSubsAndSups = Object.freeze({ '⁷': '7', '⁸': '8', '⁹': '9', - "\u1D2C": 'A', - "\u1D2E": 'B', - "\u1D30": 'D', - "\u1D31": 'E', - "\u1D33": 'G', - "\u1D34": 'H', - "\u1D35": 'I', - "\u1D36": 'J', - "\u1D37": 'K', - "\u1D38": 'L', - "\u1D39": 'M', - "\u1D3A": 'N', - "\u1D3C": 'O', - "\u1D3E": 'P', - "\u1D3F": 'R', - "\u1D40": 'T', - "\u1D41": 'U', - "\u2C7D": 'V', - "\u1D42": 'W', - "\u1D43": 'a', - "\u1D47": 'b', - "\u1D9C": 'c', - "\u1D48": 'd', - "\u1D49": 'e', - "\u1DA0": 'f', - "\u1D4D": 'g', - "\u02B0": 'h', - "\u2071": 'i', - "\u02B2": 'j', - "\u1D4F": 'k', - "\u02E1": 'l', - "\u1D50": 'm', - "\u207F": 'n', - "\u1D52": 'o', - "\u1D56": 'p', - "\u02B3": 'r', - "\u02E2": 's', - "\u1D57": 't', - "\u1D58": 'u', - "\u1D5B": 'v', - "\u02B7": 'w', - "\u02E3": 'x', - "\u02B8": 'y', - "\u1DBB": 'z', - "\u1D5D": 'β', - "\u1D5E": 'γ', - "\u1D5F": 'δ', - "\u1D60": "\u03D5", - "\u1D61": 'χ', - "\u1DBF": 'θ' + '\u1D2C': 'A', + '\u1D2E': 'B', + '\u1D30': 'D', + '\u1D31': 'E', + '\u1D33': 'G', + '\u1D34': 'H', + '\u1D35': 'I', + '\u1D36': 'J', + '\u1D37': 'K', + '\u1D38': 'L', + '\u1D39': 'M', + '\u1D3A': 'N', + '\u1D3C': 'O', + '\u1D3E': 'P', + '\u1D3F': 'R', + '\u1D40': 'T', + '\u1D41': 'U', + '\u2C7D': 'V', + '\u1D42': 'W', + '\u1D43': 'a', + '\u1D47': 'b', + '\u1D9C': 'c', + '\u1D48': 'd', + '\u1D49': 'e', + '\u1DA0': 'f', + '\u1D4D': 'g', + '\u02B0': 'h', + '\u2071': 'i', + '\u02B2': 'j', + '\u1D4F': 'k', + '\u02E1': 'l', + '\u1D50': 'm', + '\u207F': 'n', + '\u1D52': 'o', + '\u1D56': 'p', + '\u02B3': 'r', + '\u02E2': 's', + '\u1D57': 't', + '\u1D58': 'u', + '\u1D5B': 'v', + '\u02B7': 'w', + '\u02E3': 'x', + '\u02B8': 'y', + '\u1DBB': 'z', + '\u1D5D': 'β', + '\u1D5E': 'γ', + '\u1D5F': 'δ', + '\u1D60': '\u03d5', + '\u1D61': 'χ', + '\u1DBF': 'θ' }); ;// CONCATENATED MODULE: ./src/Parser.js /* eslint no-constant-condition:0 */ @@ -17048,7 +17229,7 @@ var uSubsAndSups = Object.freeze({ // Pre-evaluate both modules as unicodeSymbols require String.normalize() -var unicodeAccents = { +const unicodeAccents = { "́": { "text": "\\'", "math": "\\acute" @@ -17096,7 +17277,7 @@ var unicodeAccents = { "text": "\\c" } }; -var unicodeSymbols = { +const unicodeSymbols = { "á": "á", "à": "à", "ä": "ä", @@ -17472,8 +17653,8 @@ var unicodeSymbols = { * * The functions return ParseNodes. */ -var Parser = /*#__PURE__*/function () { - function Parser(input, settings) { +class Parser { + constructor(input, settings) { this.mode = void 0; this.gullet = void 0; this.settings = void 0; @@ -17495,9 +17676,7 @@ var Parser = /*#__PURE__*/function () { */ - var _proto = Parser.prototype; - - _proto.expect = function expect(text, consume) { + expect(text, consume) { if (consume === void 0) { consume = true; } @@ -17513,9 +17692,9 @@ var Parser = /*#__PURE__*/function () { /** * Discards the current lookahead token, considering it consumed. */ - ; - _proto.consume = function consume() { + + consume() { this.nextToken = null; } /** @@ -17523,9 +17702,9 @@ var Parser = /*#__PURE__*/function () { * beginning, or if the previous lookahead token was consume()d), * fetch the next token as the new lookahead token and return it. */ - ; - _proto.fetch = function fetch() { + + fetch() { if (this.nextToken == null) { this.nextToken = this.gullet.expandNextToken(); } @@ -17535,18 +17714,18 @@ var Parser = /*#__PURE__*/function () { /** * Switches between "text" and "math" modes. */ - ; - _proto.switchMode = function switchMode(newMode) { + + switchMode(newMode) { this.mode = newMode; this.gullet.switchMode(newMode); } /** * Main parsing function, which parses an entire input. */ - ; - _proto.parse = function parse() { + + parse() { if (!this.settings.globalGroup) { // Create a group namespace for the math expression. // (LaTeX creates a new group for every $...$, $$...$$, \[...\].) @@ -17562,7 +17741,7 @@ var Parser = /*#__PURE__*/function () { try { // Try to parse the input - var parse = this.parseExpression(false); // If we succeeded, make sure there's an EOF at the end + const parse = this.parseExpression(false); // If we succeeded, make sure there's an EOF at the end this.expect("EOF"); // End the group namespace for the expression @@ -17579,21 +17758,21 @@ var Parser = /*#__PURE__*/function () { * Fully parse a separate sequence of tokens as a separate job. * Tokens should be specified in reverse order, as in a MacroDefinition. */ - ; - _proto.subparse = function subparse(tokens) { + + subparse(tokens) { // Save the next token from the current job. - var oldToken = this.nextToken; + const oldToken = this.nextToken; this.consume(); // Run the new job, terminating it with an excess '}' this.gullet.pushToken(new Token("}")); this.gullet.pushTokens(tokens); - var parse = this.parseExpression(false); + const parse = this.parseExpression(false); this.expect("}"); // Restore the next token from the current job. this.nextToken = oldToken; return parse; - }; + } /** * Parses an "expression", which is a list of atoms. @@ -17606,8 +17785,8 @@ var Parser = /*#__PURE__*/function () { * with, or `null` if something else should end the * expression. */ - _proto.parseExpression = function parseExpression(breakOnInfix, breakOnTokenText) { - var body = []; // Keep adding atoms to the body until we can't parse any more atoms (either + parseExpression(breakOnInfix, breakOnTokenText) { + const body = []; // Keep adding atoms to the body until we can't parse any more atoms (either // we reached the end, a }, or a \right) while (true) { @@ -17616,7 +17795,7 @@ var Parser = /*#__PURE__*/function () { this.consumeSpaces(); } - var lex = this.fetch(); + const lex = this.fetch(); if (Parser.endOfExpression.indexOf(lex.text) !== -1) { break; @@ -17630,7 +17809,7 @@ var Parser = /*#__PURE__*/function () { break; } - var atom = this.parseAtom(breakOnTokenText); + const atom = this.parseAtom(breakOnTokenText); if (!atom) { break; @@ -17654,13 +17833,13 @@ var Parser = /*#__PURE__*/function () { * There can only be one infix operator per group. If there's more than one * then the expression is ambiguous. This can be resolved by adding {}. */ - ; - _proto.handleInfixNodes = function handleInfixNodes(body) { - var overIndex = -1; - var funcName; - for (var i = 0; i < body.length; i++) { + handleInfixNodes(body) { + let overIndex = -1; + let funcName; + + for (let i = 0; i < body.length; i++) { if (body[i].type === "infix") { if (overIndex !== -1) { throw new src_ParseError("only one infix operator per group", body[i].token); @@ -17672,10 +17851,10 @@ var Parser = /*#__PURE__*/function () { } if (overIndex !== -1 && funcName) { - var numerNode; - var denomNode; - var numerBody = body.slice(0, overIndex); - var denomBody = body.slice(overIndex + 1); + let numerNode; + let denomNode; + const numerBody = body.slice(0, overIndex); + const denomBody = body.slice(overIndex + 1); if (numerBody.length === 1 && numerBody[0].type === "ordgroup") { numerNode = numerBody[0]; @@ -17697,7 +17876,7 @@ var Parser = /*#__PURE__*/function () { }; } - var node; + let node; if (funcName === "\\\\abovefrac") { node = this.callFunction(funcName, [numerNode, body[overIndex], denomNode], []); @@ -17713,16 +17892,16 @@ var Parser = /*#__PURE__*/function () { /** * Handle a subscript or superscript with nice errors. */ - ; - _proto.handleSupSubscript = function handleSupSubscript(name // For error reporting. + + handleSupSubscript(name // For error reporting. ) { - var symbolToken = this.fetch(); - var symbol = symbolToken.text; + const symbolToken = this.fetch(); + const symbol = symbolToken.text; this.consume(); this.consumeSpaces(); // ignore spaces before sup/subscript argument - var group = this.parseGroup(name); + const group = this.parseGroup(name); if (!group) { throw new src_ParseError("Expected group after '" + symbol + "'", symbolToken); @@ -17734,12 +17913,12 @@ var Parser = /*#__PURE__*/function () { * Converts the textual input of an unsupported command into a text node * contained within a color node whose color is determined by errorColor */ - ; - _proto.formatUnsupportedCmd = function formatUnsupportedCmd(text) { - var textordArray = []; - for (var i = 0; i < text.length; i++) { + formatUnsupportedCmd(text) { + const textordArray = []; + + for (let i = 0; i < text.length; i++) { textordArray.push({ type: "textord", mode: "text", @@ -17747,12 +17926,12 @@ var Parser = /*#__PURE__*/function () { }); } - var textNode = { + const textNode = { type: "text", mode: this.mode, body: textordArray }; - var colorNode = { + const colorNode = { type: "color", mode: this.mode, color: this.settings.errorColor, @@ -17763,31 +17942,31 @@ var Parser = /*#__PURE__*/function () { /** * Parses a group with optional super/subscripts. */ - ; - _proto.parseAtom = function parseAtom(breakOnTokenText) { + + parseAtom(breakOnTokenText) { // The body of an atom is an implicit group, so that things like // \left(x\right)^2 work correctly. - var base = this.parseGroup("atom", breakOnTokenText); // In text mode, we don't have superscripts or subscripts + const base = this.parseGroup("atom", breakOnTokenText); // In text mode, we don't have superscripts or subscripts if (this.mode === "text") { return base; } // Note that base may be empty (i.e. null) at this point. - var superscript; - var subscript; + let superscript; + let subscript; while (true) { // Guaranteed in math mode, so eat any spaces first. this.consumeSpaces(); // Lex the first token - var lex = this.fetch(); + const lex = this.fetch(); if (lex.text === "\\limits" || lex.text === "\\nolimits") { // We got a limit control if (base && base.type === "op") { - var limits = lex.text === "\\limits"; + const limits = lex.text === "\\limits"; base.limits = limits; base.alwaysHandleSupSub = true; } else if (base && base.type === "operatorname") { @@ -17819,13 +17998,13 @@ var Parser = /*#__PURE__*/function () { throw new src_ParseError("Double superscript", lex); } - var prime = { + const prime = { type: "textord", mode: this.mode, text: "\\prime" }; // Many primes can be grouped together, so we handle this here - var primes = [prime]; + const primes = [prime]; this.consume(); // Keep lexing tokens until we get something that's not a prime while (this.fetch().text === "'") { @@ -17851,12 +18030,13 @@ var Parser = /*#__PURE__*/function () { // We treat these similarly to the unicode-math package. // So we render a string of Unicode (sub|super)scripts the // same as a (sub|super)script of regular characters. - var str = uSubsAndSups[lex.text]; - var isSub = unicodeSubRegEx.test(lex.text); + const isSub = unicodeSubRegEx.test(lex.text); + const subsupTokens = []; + subsupTokens.push(new Token(uSubsAndSups[lex.text])); this.consume(); // Continue fetching tokens to fill out the string. while (true) { - var token = this.fetch().text; + const token = this.fetch().text; if (!uSubsAndSups[token]) { break; @@ -17866,24 +18046,24 @@ var Parser = /*#__PURE__*/function () { break; } + subsupTokens.unshift(new Token(uSubsAndSups[token])); this.consume(); - str += uSubsAndSups[token]; } // Now create a (sub|super)script. - var body = new Parser(str, this.settings).parse(); + const body = this.subparse(subsupTokens); if (isSub) { subscript = { type: "ordgroup", mode: "math", - body: body + body }; } else { superscript = { type: "ordgroup", mode: "math", - body: body + body }; } } else { @@ -17911,13 +18091,13 @@ var Parser = /*#__PURE__*/function () { /** * Parses an entire function, including its base and all of its arguments. */ - ; - _proto.parseFunction = function parseFunction(breakOnTokenText, name // For determining its context + + parseFunction(breakOnTokenText, name // For determining its context ) { - var token = this.fetch(); - var func = token.text; - var funcData = src_functions[func]; + const token = this.fetch(); + const func = token.text; + const funcData = src_functions[func]; if (!funcData) { return null; @@ -17933,25 +18113,25 @@ var Parser = /*#__PURE__*/function () { throw new src_ParseError("Can't use function '" + func + "' in math mode", token); } - var _this$parseArguments = this.parseArguments(func, funcData), - args = _this$parseArguments.args, - optArgs = _this$parseArguments.optArgs; - + const { + args, + optArgs + } = this.parseArguments(func, funcData); return this.callFunction(func, args, optArgs, token, breakOnTokenText); } /** * Call a function handler with a suitable context and arguments. */ - ; - _proto.callFunction = function callFunction(name, args, optArgs, token, breakOnTokenText) { - var context = { + + callFunction(name, args, optArgs, token, breakOnTokenText) { + const context = { funcName: name, parser: this, - token: token, - breakOnTokenText: breakOnTokenText + token, + breakOnTokenText }; - var func = src_functions[name]; + const func = src_functions[name]; if (func && func.handler) { return func.handler(context, args, optArgs); @@ -17962,11 +18142,11 @@ var Parser = /*#__PURE__*/function () { /** * Parses the arguments of a function or environment */ - ; - _proto.parseArguments = function parseArguments(func, // Should look like "\name" or "\begin{name}". + + parseArguments(func, // Should look like "\name" or "\begin{name}". funcData) { - var totalArgs = funcData.numArgs + funcData.numOptionalArgs; + const totalArgs = funcData.numArgs + funcData.numOptionalArgs; if (totalArgs === 0) { return { @@ -17975,19 +18155,19 @@ var Parser = /*#__PURE__*/function () { }; } - var args = []; - var optArgs = []; + const args = []; + const optArgs = []; - for (var i = 0; i < totalArgs; i++) { - var argType = funcData.argTypes && funcData.argTypes[i]; - var isOptional = i < funcData.numOptionalArgs; + for (let i = 0; i < totalArgs; i++) { + let argType = funcData.argTypes && funcData.argTypes[i]; + const isOptional = i < funcData.numOptionalArgs; if (funcData.primitive && argType == null || // \sqrt expands into primitive if optional argument doesn't exist funcData.type === "sqrt" && i === 1 && optArgs[0] == null) { argType = "primitive"; } - var arg = this.parseGroupOfType("argument to '" + func + "'", argType, isOptional); + const arg = this.parseGroupOfType("argument to '" + func + "'", argType, isOptional); if (isOptional) { optArgs.push(arg); @@ -18000,16 +18180,16 @@ var Parser = /*#__PURE__*/function () { } return { - args: args, - optArgs: optArgs + args, + optArgs }; } /** * Parses a group when the mode is changing. */ - ; - _proto.parseGroupOfType = function parseGroupOfType(name, type, optional) { + + parseGroupOfType(name, type, optional) { switch (type) { case "color": return this.parseColorGroup(optional); @@ -18028,7 +18208,7 @@ var Parser = /*#__PURE__*/function () { { // hbox argument type wraps the argument in the equivalent of // \hbox, which is like \text but switching to \textstyle size. - var group = this.parseArgumentGroup(optional, "text"); + const group = this.parseArgumentGroup(optional, "text"); return group != null ? { type: "styling", mode: group.mode, @@ -18040,7 +18220,7 @@ var Parser = /*#__PURE__*/function () { case "raw": { - var token = this.parseStringGroup("raw", optional); + const token = this.parseStringGroup("raw", optional); return token != null ? { type: "raw", mode: "text", @@ -18054,13 +18234,13 @@ var Parser = /*#__PURE__*/function () { throw new src_ParseError("A primitive argument cannot be optional"); } - var _group = this.parseGroup(name); + const group = this.parseGroup(name); - if (_group == null) { + if (group == null) { throw new src_ParseError("Expected group as " + name, this.fetch()); } - return _group; + return group; } case "original": @@ -18075,9 +18255,9 @@ var Parser = /*#__PURE__*/function () { /** * Discard any space tokens, fetching the next non-space token. */ - ; - _proto.consumeSpaces = function consumeSpaces() { + + consumeSpaces() { while (this.fetch().text === " ") { this.consume(); } @@ -18086,18 +18266,18 @@ var Parser = /*#__PURE__*/function () { * Parses a group, essentially returning the string formed by the * brace-enclosed tokens plus some position information. */ - ; - _proto.parseStringGroup = function parseStringGroup(modeName, // Used to describe the mode in error messages. + + parseStringGroup(modeName, // Used to describe the mode in error messages. optional) { - var argToken = this.gullet.scanArgument(optional); + const argToken = this.gullet.scanArgument(optional); if (argToken == null) { return null; } - var str = ""; - var nextToken; + let str = ""; + let nextToken; while ((nextToken = this.fetch()).text !== "EOF") { str += nextToken.text; @@ -18114,14 +18294,14 @@ var Parser = /*#__PURE__*/function () { * whose concatenated strings match `regex`. Returns the string * formed by the tokens plus some position information. */ - ; - _proto.parseRegexGroup = function parseRegexGroup(regex, modeName // Used to describe the mode in error messages. + + parseRegexGroup(regex, modeName // Used to describe the mode in error messages. ) { - var firstToken = this.fetch(); - var lastToken = firstToken; - var str = ""; - var nextToken; + const firstToken = this.fetch(); + let lastToken = firstToken; + let str = ""; + let nextToken; while ((nextToken = this.fetch()).text !== "EOF" && regex.test(str + nextToken.text)) { lastToken = nextToken; @@ -18138,22 +18318,22 @@ var Parser = /*#__PURE__*/function () { /** * Parses a color description. */ - ; - _proto.parseColorGroup = function parseColorGroup(optional) { - var res = this.parseStringGroup("color", optional); + + parseColorGroup(optional) { + const res = this.parseStringGroup("color", optional); if (res == null) { return null; } - var match = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(res.text); + const match = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(res.text); if (!match) { throw new src_ParseError("Invalid color: '" + res.text + "'", res); } - var color = match[0]; + let color = match[0]; if (/^[0-9a-f]{6}$/i.test(color)) { // We allow a 6-digit HTML color spec without a leading "#". @@ -18165,17 +18345,17 @@ var Parser = /*#__PURE__*/function () { return { type: "color-token", mode: this.mode, - color: color + color }; } /** * Parses a size specification, consisting of magnitude and unit. */ - ; - _proto.parseSizeGroup = function parseSizeGroup(optional) { - var res; - var isBlank = false; // don't expand before parseStringGroup + + parseSizeGroup(optional) { + let res; + let isBlank = false; // don't expand before parseStringGroup this.gullet.consumeSpaces(); @@ -18198,13 +18378,13 @@ var Parser = /*#__PURE__*/function () { isBlank = true; // This is here specifically for \genfrac } - var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text); + const match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text); if (!match) { throw new src_ParseError("Invalid size: '" + res.text + "'", res); } - var data = { + const data = { number: +(match[1] + match[2]), // sign + magnitude, cast to number unit: match[3] @@ -18218,21 +18398,21 @@ var Parser = /*#__PURE__*/function () { type: "size", mode: this.mode, value: data, - isBlank: isBlank + isBlank }; } /** * Parses an URL, checking escaped letters and allowed protocols, * and setting the catcode of % as an active character (as in \hyperref). */ - ; - _proto.parseUrlGroup = function parseUrlGroup(optional) { + + parseUrlGroup(optional) { this.gullet.lexer.setCatcode("%", 13); // active character this.gullet.lexer.setCatcode("~", 12); // other character - var res = this.parseStringGroup("url", optional); + const res = this.parseStringGroup("url", optional); this.gullet.lexer.setCatcode("%", 14); // comment character this.gullet.lexer.setCatcode("~", 13); // active character @@ -18245,26 +18425,26 @@ var Parser = /*#__PURE__*/function () { // replace backslashes with forward slashes. - var url = res.text.replace(/\\([#$%&~_^{}])/g, '$1'); + const url = res.text.replace(/\\([#$%&~_^{}])/g, '$1'); return { type: "url", mode: this.mode, - url: url + url }; } /** * Parses an argument with the mode specified. */ - ; - _proto.parseArgumentGroup = function parseArgumentGroup(optional, mode) { - var argToken = this.gullet.scanArgument(optional); + + parseArgumentGroup(optional, mode) { + const argToken = this.gullet.scanArgument(optional); if (argToken == null) { return null; } - var outerMode = this.mode; + const outerMode = this.mode; if (mode) { // Switch to specified mode @@ -18272,12 +18452,12 @@ var Parser = /*#__PURE__*/function () { } this.gullet.beginGroup(); - var expression = this.parseExpression(false, "EOF"); // TODO: find an alternative way to denote the end + const expression = this.parseExpression(false, "EOF"); // TODO: find an alternative way to denote the end this.expect("EOF"); // expect the end of the argument this.gullet.endGroup(); - var result = { + const result = { type: "ordgroup", mode: this.mode, loc: argToken.loc, @@ -18297,21 +18477,21 @@ var Parser = /*#__PURE__*/function () { * that starts at the current position, and ends right before a higher explicit * group ends, or at EOF. */ - ; - _proto.parseGroup = function parseGroup(name, // For error reporting. + + parseGroup(name, // For error reporting. breakOnTokenText) { - var firstToken = this.fetch(); - var text = firstToken.text; - var result; // Try to parse an open brace or \begingroup + const firstToken = this.fetch(); + const text = firstToken.text; + let result; // Try to parse an open brace or \begingroup if (text === "{" || text === "\\begingroup") { this.consume(); - var groupEnd = text === "{" ? "}" : "\\endgroup"; + const groupEnd = text === "{" ? "}" : "\\endgroup"; this.gullet.beginGroup(); // If we get a brace, parse an expression - var expression = this.parseExpression(false, groupEnd); - var lastToken = this.fetch(); + const expression = this.parseExpression(false, groupEnd); + const lastToken = this.fetch(); this.expect(groupEnd); // Check that we got a matching closing brace this.gullet.endGroup(); @@ -18351,15 +18531,15 @@ var Parser = /*#__PURE__*/function () { * characters in its value. The representation is still ASCII source. * The group will be modified in place. */ - ; - _proto.formLigatures = function formLigatures(group) { - var n = group.length - 1; - for (var i = 0; i < n; ++i) { - var a = group[i]; // $FlowFixMe: Not every node type has a `text` property. + formLigatures(group) { + let n = group.length - 1; - var v = a.text; + for (let i = 0; i < n; ++i) { + const a = group[i]; // $FlowFixMe: Not every node type has a `text` property. + + const v = a.text; if (v === "-" && group[i + 1].text === "-") { if (i + 1 < n && group[i + 2].text === "-") { @@ -18396,16 +18576,16 @@ var Parser = /*#__PURE__*/function () { * Parse a single symbol out of the string. Here, we handle single character * symbols and special functions like \verb. */ - ; - _proto.parseSymbol = function parseSymbol() { - var nucleus = this.fetch(); - var text = nucleus.text; + + parseSymbol() { + const nucleus = this.fetch(); + let text = nucleus.text; if (/^\\verb[^a-zA-Z]/.test(text)) { this.consume(); - var arg = text.slice(5); - var star = arg.charAt(0) === "*"; + let arg = text.slice(5); + const star = arg.charAt(0) === "*"; if (star) { arg = arg.slice(1); @@ -18423,7 +18603,7 @@ var Parser = /*#__PURE__*/function () { type: "verb", mode: "text", body: arg, - star: star + star }; } // At this point, we should have a symbol, possibly with accents. // First expand any accented base symbol according to unicodeSymbols. @@ -18439,47 +18619,47 @@ var Parser = /*#__PURE__*/function () { } // Strip off any combining characters - var match = combiningDiacriticalMarksEndRegex.exec(text); + const match = combiningDiacriticalMarksEndRegex.exec(text); if (match) { text = text.substring(0, match.index); if (text === 'i') { - text = "\u0131"; // dotless i, in math and text mode + text = '\u0131'; // dotless i, in math and text mode } else if (text === 'j') { - text = "\u0237"; // dotless j, in math and text mode + text = '\u0237'; // dotless j, in math and text mode } } // Recognize base symbol - var symbol; + let symbol; if (src_symbols[this.mode][text]) { if (this.settings.strict && this.mode === 'math' && extraLatin.indexOf(text) >= 0) { this.settings.reportNonstrict("unicodeTextInMathMode", "Latin-1/Unicode text character \"" + text[0] + "\" used in " + "math mode", nucleus); } - var group = src_symbols[this.mode][text].group; - var loc = SourceLocation.range(nucleus); - var s; + const group = src_symbols[this.mode][text].group; + const loc = SourceLocation.range(nucleus); + let s; if (ATOMS.hasOwnProperty(group)) { // $FlowFixMe - var family = group; + const family = group; s = { type: "atom", mode: this.mode, - family: family, - loc: loc, - text: text + family, + loc, + text }; } else { // $FlowFixMe s = { type: group, mode: this.mode, - loc: loc, - text: text + loc, + text }; } // $FlowFixMe @@ -18506,7 +18686,7 @@ var Parser = /*#__PURE__*/function () { type: "textord", mode: "text", loc: SourceLocation.range(nucleus), - text: text + text }; } else { return null; // EOF, ^, _, {, }, etc. @@ -18515,14 +18695,14 @@ var Parser = /*#__PURE__*/function () { this.consume(); // Transform combining characters into accents if (match) { - for (var i = 0; i < match[0].length; i++) { - var accent = match[0][i]; + for (let i = 0; i < match[0].length; i++) { + const accent = match[0][i]; if (!unicodeAccents[accent]) { throw new src_ParseError("Unknown accent ' " + accent + "'", nucleus); } - var command = unicodeAccents[accent][this.mode] || unicodeAccents[accent].text; + const command = unicodeAccents[accent][this.mode] || unicodeAccents[accent].text; if (!command) { throw new src_ParseError("Accent " + accent + " unsupported in " + this.mode + " mode", nucleus); @@ -18543,13 +18723,10 @@ var Parser = /*#__PURE__*/function () { return symbol; - }; - - return Parser; -}(); + } +} Parser.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"]; - ;// CONCATENATED MODULE: ./src/parseTree.js /** * Provides a single function for parsing an expression using a Parser @@ -18562,15 +18739,15 @@ Parser.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"]; /** * Parses an expression using a Parser, then returns the parsed result. */ -var parseTree = function parseTree(toParse, settings) { +const parseTree = function (toParse, settings) { if (!(typeof toParse === 'string' || toParse instanceof String)) { throw new TypeError('KaTeX can only parse string typed expression'); } - var parser = new Parser(toParse, settings); // Blank out any \df@tag to avoid spurious "Duplicate \tag" errors + const parser = new Parser(toParse, settings); // Blank out any \df@tag to avoid spurious "Duplicate \tag" errors delete parser.gullet.macros.current["\\df@tag"]; - var tree = parser.parse(); // Prevent a color definition from persisting between calls to katex.render(). + let tree = parser.parse(); // Prevent a color definition from persisting between calls to katex.render(). delete parser.gullet.macros.current["\\current@color"]; delete parser.gullet.macros.current["\\color"]; // If the input used \tag, it will set the \df@tag macro to the tag. @@ -18618,9 +18795,9 @@ var parseTree = function parseTree(toParse, settings) { * Parse and build an expression, and place that expression in the DOM node * given. */ -var render = function render(expression, baseNode, options) { +let render = function (expression, baseNode, options) { baseNode.textContent = ""; - var node = renderToDomTree(expression, options).toNode(); + const node = renderToDomTree(expression, options).toNode(); baseNode.appendChild(node); }; // KaTeX's styles don't work properly in quirks mode. Print out an error, and // disable rendering. @@ -18630,7 +18807,7 @@ if (typeof document !== "undefined") { if (document.compatMode !== "CSS1Compat") { typeof console !== "undefined" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your " + "website has a suitable doctype."); - render = function render() { + render = function () { throw new src_ParseError("KaTeX doesn't work in quirks mode."); }; } @@ -18640,8 +18817,8 @@ if (typeof document !== "undefined") { */ -var renderToString = function renderToString(expression, options) { - var markup = renderToDomTree(expression, options).toMarkup(); +const renderToString = function (expression, options) { + const markup = renderToDomTree(expression, options).toMarkup(); return markup; }; /** @@ -18649,8 +18826,8 @@ var renderToString = function renderToString(expression, options) { */ -var generateParseTree = function generateParseTree(expression, options) { - var settings = new Settings(options); +const generateParseTree = function (expression, options) { + const settings = new Settings(options); return src_parseTree(expression, settings); }; /** @@ -18660,12 +18837,12 @@ var generateParseTree = function generateParseTree(expression, options) { */ -var renderError = function renderError(error, expression, options) { +const renderError = function (error, expression, options) { if (options.throwOnError || !(error instanceof src_ParseError)) { throw error; } - var node = buildCommon.makeSpan(["katex-error"], [new SymbolNode(expression)]); + const node = buildCommon.makeSpan(["katex-error"], [new SymbolNode(expression)]); node.setAttribute("title", error.toString()); node.setAttribute("style", "color:" + options.errorColor); return node; @@ -18676,11 +18853,11 @@ var renderError = function renderError(error, expression, options) { */ -var renderToDomTree = function renderToDomTree(expression, options) { - var settings = new Settings(options); +const renderToDomTree = function (expression, options) { + const settings = new Settings(options); try { - var tree = src_parseTree(expression, settings); + const tree = src_parseTree(expression, settings); return buildTree(tree, expression, settings); } catch (error) { return renderError(error, expression, settings); @@ -18692,11 +18869,11 @@ var renderToDomTree = function renderToDomTree(expression, options) { */ -var renderToHTMLTree = function renderToHTMLTree(expression, options) { - var settings = new Settings(options); +const renderToHTMLTree = function (expression, options) { + const settings = new Settings(options); try { - var tree = src_parseTree(expression, settings); + const tree = src_parseTree(expression, settings); return buildHTMLTree(tree, expression, settings); } catch (error) { return renderError(error, expression, settings); @@ -18707,19 +18884,19 @@ var renderToHTMLTree = function renderToHTMLTree(expression, options) { /** * Current KaTeX version */ - version: "0.16.8", + version: "0.16.10", /** * Renders the given LaTeX into an HTML+MathML combination, and adds * it as a child to the specified DOM node. */ - render: render, + render, /** * Renders the given LaTeX into an HTML+MathML combination string, * for sending to the client. */ - renderToString: renderToString, + renderToString, /** * KaTeX error, usually during parsing. diff --git a/paige/node_modules/katex/dist/katex.min.css b/paige/node_modules/katex/dist/katex.min.css index 3d27397c..b5337aae 100644 --- a/paige/node_modules/katex/dist/katex.min.css +++ b/paige/node_modules/katex/dist/katex.min.css @@ -1 +1 @@ -@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{text-rendering:auto;font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.8"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} +@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.10"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} diff --git a/paige/node_modules/katex/dist/katex.min.js b/paige/node_modules/katex/dist/katex.min.js index f5cd23aa..e701cfde 100644 --- a/paige/node_modules/katex/dist/katex.min.js +++ b/paige/node_modules/katex/dist/katex.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return na}});var r=function e(t,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,a,i="KaTeX parse error: "+t,o=r&&r.loc;if(o&&o.start<=o.end){var s=o.lexer.input;n=o.start,a=o.end,n===s.length?i+=" at end of input: ":i+=" at position "+(n+1)+": ";var l=s.slice(n,a).replace(/[^]/g,"$&\u0332");i+=(n>15?"\u2026"+s.slice(n-15,n):s.slice(0,n))+l+(a+15":">","<":"<",'"':""","'":"'"},o=/[&><"']/g;var s=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},l={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(o,(function(e){return i[e]}))},hyphenate:function(e){return e.replace(a,"-$1").toLowerCase()},getBaseElem:s,isCharacterBox:function(e){var t=s(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},h={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:function(e){return"#"+e}},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:function(e,t){return t.push(e),t}},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:function(e){return Math.max(0,e)},cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:function(e){return Math.max(0,e)},cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:function(e){return Math.max(0,e)},cli:"-e, --max-expand ",cliProcessor:function(e){return"Infinity"===e?1/0:parseInt(e)}},globalGroup:{type:"boolean",cli:!1}};function c(e){if(e.default)return e.default;var t=e.type,r=Array.isArray(t)?t[0]:t;if("string"!=typeof r)return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}var m=function(){function e(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},h)if(h.hasOwnProperty(t)){var r=h[t];this[t]=void 0!==e[t]?r.processor?r.processor(e[t]):e[t]:c(r)}}var t=e.prototype;return t.reportNonstrict=function(e,t,r){var a=this.strict;if("function"==typeof a&&(a=a(e,t,r)),a&&"ignore"!==a){if(!0===a||"error"===a)throw new n("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",r);"warn"===a?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+a+"': "+t+" ["+e+"]")}},t.useStrictBehavior=function(e,t,r){var n=this.strict;if("function"==typeof n)try{n=n(e,t,r)}catch(e){n="error"}return!(!n||"ignore"===n)&&(!0===n||"error"===n||("warn"===n?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]"),!1)))},t.isTrusted=function(e){e.url&&!e.protocol&&(e.protocol=l.protocolFromUrl(e.url));var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)},e}(),u=function(){function e(e,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=r}var t=e.prototype;return t.sup=function(){return p[d[this.id]]},t.sub=function(){return p[f[this.id]]},t.fracNum=function(){return p[g[this.id]]},t.fracDen=function(){return p[v[this.id]]},t.cramp=function(){return p[b[this.id]]},t.text=function(){return p[y[this.id]]},t.isTight=function(){return this.size>=2},e}(),p=[new u(0,0,!1),new u(1,0,!0),new u(2,1,!1),new u(3,1,!0),new u(4,2,!1),new u(5,2,!0),new u(6,3,!1),new u(7,3,!0)],d=[4,5,4,5,6,7,6,7],f=[5,5,5,5,7,7,7,7],g=[2,3,4,5,6,7,6,7],v=[3,3,5,5,7,7,7,7],b=[1,1,3,3,5,5,7,7],y=[0,1,2,3,2,3,2,3],x={DISPLAY:p[0],TEXT:p[2],SCRIPT:p[4],SCRIPTSCRIPT:p[6]},w=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var k=[];function S(e){for(var t=0;t=k[t]&&e<=k[t+1])return!0;return!1}w.forEach((function(e){return e.blocks.forEach((function(e){return k.push.apply(k,e)}))}));var M=80,z={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},A=function(){function e(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var t=e.prototype;return t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){for(var e=document.createDocumentFragment(),t=0;t=5?0:e>=3?1:2]){var r=q[t]={cssEmPerMu:B.quad[t]/18};for(var n in B)B.hasOwnProperty(n)&&(r[n]=B[n][t])}return q[t]}(this.size)),this._fontMetrics},t.getColor=function(){return this.phantom?"transparent":this.color},e}();O.BASESIZE=6;var E=O,L={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},D={ex:!0,em:!0,mu:!0},V=function(e){return"string"!=typeof e&&(e=e.unit),e in L||e in D||"ex"===e},P=function(e,t){var r;if(e.unit in L)r=L[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)r=t.fontMetrics().cssEmPerMu;else{var a;if(a=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)r=a.fontMetrics().xHeight;else{if("em"!==e.unit)throw new n("Invalid unit: '"+e.unit+"'");r=a.fontMetrics().quad}a!==t&&(r*=a.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*r,t.maxSize)},F=function(e){return+e.toFixed(4)+"em"},G=function(e){return e.filter((function(e){return e})).join(" ")},U=function(e,t,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},Y=function(e){var t=document.createElement(e);for(var r in t.className=G(this.classes),this.style)this.style.hasOwnProperty(r)&&(t.style[r]=this.style[r]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&t.setAttribute(n,this.attributes[n]);for(var a=0;a"},W=function(){function e(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,U.call(this,e,r,n),this.children=t||[]}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){return Y.call(this,"span")},t.toMarkup=function(){return X.call(this,"span")},e}(),_=function(){function e(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,U.call(this,t,n),this.children=r||[],this.setAttribute("href",e)}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){return Y.call(this,"a")},t.toMarkup=function(){return X.call(this,"a")},e}(),j=function(){function e(e,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=r}var t=e.prototype;return t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e},t.toMarkup=function(){var e=""+this.alt+"=a[0]&&e<=a[1])return r.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[\xee\xef\xed\xec]/.test(this.text)&&(this.text=$[this.text])}var t=e.prototype;return t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){var e=document.createTextNode(this.text),t=null;for(var r in this.italic>0&&((t=document.createElement("span")).style.marginRight=F(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=G(this.classes)),this.style)this.style.hasOwnProperty(r)&&((t=t||document.createElement("span")).style[r]=this.style[r]);return t?(t.appendChild(e),t):e},t.toMarkup=function(){var e=!1,t="0&&(r+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(n)&&(r+=l.hyphenate(n)+":"+this.style[n]+";");r&&(e=!0,t+=' style="'+l.escape(r)+'"');var a=l.escape(this.text);return e?(t+=">",t+=a,t+=""):a},e}(),K=function(){function e(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var r=0;r":""},e}(),Q=function(){function e(e){this.attributes=void 0,this.attributes=e||{}}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e},t.toMarkup=function(){var e="","\\gt",!0),ie(oe,le,be,"\u2208","\\in",!0),ie(oe,le,be,"\ue020","\\@not"),ie(oe,le,be,"\u2282","\\subset",!0),ie(oe,le,be,"\u2283","\\supset",!0),ie(oe,le,be,"\u2286","\\subseteq",!0),ie(oe,le,be,"\u2287","\\supseteq",!0),ie(oe,he,be,"\u2288","\\nsubseteq",!0),ie(oe,he,be,"\u2289","\\nsupseteq",!0),ie(oe,le,be,"\u22a8","\\models"),ie(oe,le,be,"\u2190","\\leftarrow",!0),ie(oe,le,be,"\u2264","\\le"),ie(oe,le,be,"\u2264","\\leq",!0),ie(oe,le,be,"<","\\lt",!0),ie(oe,le,be,"\u2192","\\rightarrow",!0),ie(oe,le,be,"\u2192","\\to"),ie(oe,he,be,"\u2271","\\ngeq",!0),ie(oe,he,be,"\u2270","\\nleq",!0),ie(oe,le,ye,"\xa0","\\ "),ie(oe,le,ye,"\xa0","\\space"),ie(oe,le,ye,"\xa0","\\nobreakspace"),ie(se,le,ye,"\xa0","\\ "),ie(se,le,ye,"\xa0"," "),ie(se,le,ye,"\xa0","\\space"),ie(se,le,ye,"\xa0","\\nobreakspace"),ie(oe,le,ye,null,"\\nobreak"),ie(oe,le,ye,null,"\\allowbreak"),ie(oe,le,ve,",",","),ie(oe,le,ve,";",";"),ie(oe,he,me,"\u22bc","\\barwedge",!0),ie(oe,he,me,"\u22bb","\\veebar",!0),ie(oe,le,me,"\u2299","\\odot",!0),ie(oe,le,me,"\u2295","\\oplus",!0),ie(oe,le,me,"\u2297","\\otimes",!0),ie(oe,le,xe,"\u2202","\\partial",!0),ie(oe,le,me,"\u2298","\\oslash",!0),ie(oe,he,me,"\u229a","\\circledcirc",!0),ie(oe,he,me,"\u22a1","\\boxdot",!0),ie(oe,le,me,"\u25b3","\\bigtriangleup"),ie(oe,le,me,"\u25bd","\\bigtriangledown"),ie(oe,le,me,"\u2020","\\dagger"),ie(oe,le,me,"\u22c4","\\diamond"),ie(oe,le,me,"\u22c6","\\star"),ie(oe,le,me,"\u25c3","\\triangleleft"),ie(oe,le,me,"\u25b9","\\triangleright"),ie(oe,le,ge,"{","\\{"),ie(se,le,xe,"{","\\{"),ie(se,le,xe,"{","\\textbraceleft"),ie(oe,le,ue,"}","\\}"),ie(se,le,xe,"}","\\}"),ie(se,le,xe,"}","\\textbraceright"),ie(oe,le,ge,"{","\\lbrace"),ie(oe,le,ue,"}","\\rbrace"),ie(oe,le,ge,"[","\\lbrack",!0),ie(se,le,xe,"[","\\lbrack",!0),ie(oe,le,ue,"]","\\rbrack",!0),ie(se,le,xe,"]","\\rbrack",!0),ie(oe,le,ge,"(","\\lparen",!0),ie(oe,le,ue,")","\\rparen",!0),ie(se,le,xe,"<","\\textless",!0),ie(se,le,xe,">","\\textgreater",!0),ie(oe,le,ge,"\u230a","\\lfloor",!0),ie(oe,le,ue,"\u230b","\\rfloor",!0),ie(oe,le,ge,"\u2308","\\lceil",!0),ie(oe,le,ue,"\u2309","\\rceil",!0),ie(oe,le,xe,"\\","\\backslash"),ie(oe,le,xe,"\u2223","|"),ie(oe,le,xe,"\u2223","\\vert"),ie(se,le,xe,"|","\\textbar",!0),ie(oe,le,xe,"\u2225","\\|"),ie(oe,le,xe,"\u2225","\\Vert"),ie(se,le,xe,"\u2225","\\textbardbl"),ie(se,le,xe,"~","\\textasciitilde"),ie(se,le,xe,"\\","\\textbackslash"),ie(se,le,xe,"^","\\textasciicircum"),ie(oe,le,be,"\u2191","\\uparrow",!0),ie(oe,le,be,"\u21d1","\\Uparrow",!0),ie(oe,le,be,"\u2193","\\downarrow",!0),ie(oe,le,be,"\u21d3","\\Downarrow",!0),ie(oe,le,be,"\u2195","\\updownarrow",!0),ie(oe,le,be,"\u21d5","\\Updownarrow",!0),ie(oe,le,fe,"\u2210","\\coprod"),ie(oe,le,fe,"\u22c1","\\bigvee"),ie(oe,le,fe,"\u22c0","\\bigwedge"),ie(oe,le,fe,"\u2a04","\\biguplus"),ie(oe,le,fe,"\u22c2","\\bigcap"),ie(oe,le,fe,"\u22c3","\\bigcup"),ie(oe,le,fe,"\u222b","\\int"),ie(oe,le,fe,"\u222b","\\intop"),ie(oe,le,fe,"\u222c","\\iint"),ie(oe,le,fe,"\u222d","\\iiint"),ie(oe,le,fe,"\u220f","\\prod"),ie(oe,le,fe,"\u2211","\\sum"),ie(oe,le,fe,"\u2a02","\\bigotimes"),ie(oe,le,fe,"\u2a01","\\bigoplus"),ie(oe,le,fe,"\u2a00","\\bigodot"),ie(oe,le,fe,"\u222e","\\oint"),ie(oe,le,fe,"\u222f","\\oiint"),ie(oe,le,fe,"\u2230","\\oiiint"),ie(oe,le,fe,"\u2a06","\\bigsqcup"),ie(oe,le,fe,"\u222b","\\smallint"),ie(se,le,pe,"\u2026","\\textellipsis"),ie(oe,le,pe,"\u2026","\\mathellipsis"),ie(se,le,pe,"\u2026","\\ldots",!0),ie(oe,le,pe,"\u2026","\\ldots",!0),ie(oe,le,pe,"\u22ef","\\@cdots",!0),ie(oe,le,pe,"\u22f1","\\ddots",!0),ie(oe,le,xe,"\u22ee","\\varvdots"),ie(oe,le,ce,"\u02ca","\\acute"),ie(oe,le,ce,"\u02cb","\\grave"),ie(oe,le,ce,"\xa8","\\ddot"),ie(oe,le,ce,"~","\\tilde"),ie(oe,le,ce,"\u02c9","\\bar"),ie(oe,le,ce,"\u02d8","\\breve"),ie(oe,le,ce,"\u02c7","\\check"),ie(oe,le,ce,"^","\\hat"),ie(oe,le,ce,"\u20d7","\\vec"),ie(oe,le,ce,"\u02d9","\\dot"),ie(oe,le,ce,"\u02da","\\mathring"),ie(oe,le,de,"\ue131","\\@imath"),ie(oe,le,de,"\ue237","\\@jmath"),ie(oe,le,xe,"\u0131","\u0131"),ie(oe,le,xe,"\u0237","\u0237"),ie(se,le,xe,"\u0131","\\i",!0),ie(se,le,xe,"\u0237","\\j",!0),ie(se,le,xe,"\xdf","\\ss",!0),ie(se,le,xe,"\xe6","\\ae",!0),ie(se,le,xe,"\u0153","\\oe",!0),ie(se,le,xe,"\xf8","\\o",!0),ie(se,le,xe,"\xc6","\\AE",!0),ie(se,le,xe,"\u0152","\\OE",!0),ie(se,le,xe,"\xd8","\\O",!0),ie(se,le,ce,"\u02ca","\\'"),ie(se,le,ce,"\u02cb","\\`"),ie(se,le,ce,"\u02c6","\\^"),ie(se,le,ce,"\u02dc","\\~"),ie(se,le,ce,"\u02c9","\\="),ie(se,le,ce,"\u02d8","\\u"),ie(se,le,ce,"\u02d9","\\."),ie(se,le,ce,"\xb8","\\c"),ie(se,le,ce,"\u02da","\\r"),ie(se,le,ce,"\u02c7","\\v"),ie(se,le,ce,"\xa8",'\\"'),ie(se,le,ce,"\u02dd","\\H"),ie(se,le,ce,"\u25ef","\\textcircled");var we={"--":!0,"---":!0,"``":!0,"''":!0};ie(se,le,xe,"\u2013","--",!0),ie(se,le,xe,"\u2013","\\textendash"),ie(se,le,xe,"\u2014","---",!0),ie(se,le,xe,"\u2014","\\textemdash"),ie(se,le,xe,"\u2018","`",!0),ie(se,le,xe,"\u2018","\\textquoteleft"),ie(se,le,xe,"\u2019","'",!0),ie(se,le,xe,"\u2019","\\textquoteright"),ie(se,le,xe,"\u201c","``",!0),ie(se,le,xe,"\u201c","\\textquotedblleft"),ie(se,le,xe,"\u201d","''",!0),ie(se,le,xe,"\u201d","\\textquotedblright"),ie(oe,le,xe,"\xb0","\\degree",!0),ie(se,le,xe,"\xb0","\\degree"),ie(se,le,xe,"\xb0","\\textdegree",!0),ie(oe,le,xe,"\xa3","\\pounds"),ie(oe,le,xe,"\xa3","\\mathsterling",!0),ie(se,le,xe,"\xa3","\\pounds"),ie(se,le,xe,"\xa3","\\textsterling",!0),ie(oe,he,xe,"\u2720","\\maltese"),ie(se,he,xe,"\u2720","\\maltese");for(var ke='0123456789/@."',Se=0;Set&&(t=i.height),i.depth>r&&(r=i.depth),i.maxFontSize>n&&(n=i.maxFontSize)}e.height=t,e.depth=r,e.maxFontSize=n},Xe=function(e,t,r,n){var a=new W(e,t,r,n);return Ye(a),a},We=function(e,t,r,n){return new W(e,t,r,n)},_e=function(e){var t=new A(e);return Ye(t),t},je=function(e,t,r){var n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}return n+"-"+("textbf"===t&&"textit"===r?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},$e={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Ze={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Ke={fontMap:$e,makeSymbol:Ge,mathsym:function(e,t,r,n){return void 0===n&&(n=[]),"boldsymbol"===r.font&&Fe(e,"Main-Bold",t).metrics?Ge(e,"Main-Bold",t,r,n.concat(["mathbf"])):"\\"===e||"main"===ae[t][e].font?Ge(e,"Main-Regular",t,r,n):Ge(e,"AMS-Regular",t,r,n.concat(["amsrm"]))},makeSpan:Xe,makeSvgSpan:We,makeLineSpan:function(e,t,r){var n=Xe([e],[],t);return n.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=F(n.height),n.maxFontSize=1,n},makeAnchor:function(e,t,r,n){var a=new _(e,t,r,n);return Ye(a),a},makeFragment:_e,wrapFragment:function(e,t){return e instanceof A?Xe([],[e],t):e},makeVList:function(e,t){for(var r=function(e){if("individualShift"===e.positionType){for(var t=e.children,r=[t[0]],n=-t[0].shift-t[0].elem.depth,a=n,i=1;i0&&(o.push(kt(s,t)),s=[]),o.push(a[l]));s.length>0&&o.push(kt(s,t)),r?((i=kt(ft(r,t,!0))).classes=["tag"],o.push(i)):n&&o.push(n);var c=ct(["katex-html"],o);if(c.setAttribute("aria-hidden","true"),i){var m=i.children[0];m.style.height=F(c.height+c.depth),c.depth&&(m.style.verticalAlign=F(-c.depth))}return c}function Mt(e){return new A(e)}var zt=function(){function e(e,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=r||[]}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.getAttribute=function(e){return this.attributes[e]},t.toNode=function(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=G(this.classes));for(var r=0;r0&&(e+=' class ="'+l.escape(G(this.classes))+'"'),e+=">";for(var r=0;r"},t.toText=function(){return this.children.map((function(e){return e.toText()})).join("")},e}(),At=function(){function e(e){this.text=void 0,this.text=e}var t=e.prototype;return t.toNode=function(){return document.createTextNode(this.text)},t.toMarkup=function(){return l.escape(this.toText())},t.toText=function(){return this.text},e}(),Tt={MathNode:zt,TextNode:At,SpaceNode:function(){function e(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?"\u200a":e>=.1666&&e<=.1667?"\u2009":e>=.2222&&e<=.2223?"\u2005":e>=.2777&&e<=.2778?"\u2005\u200a":e>=-.05556&&e<=-.05555?"\u200a\u2063":e>=-.1667&&e<=-.1666?"\u2009\u2063":e>=-.2223&&e<=-.2222?"\u205f\u2063":e>=-.2778&&e<=-.2777?"\u2005\u2063":null}var t=e.prototype;return t.toNode=function(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",F(this.width)),e},t.toMarkup=function(){return this.character?""+this.character+"":''},t.toText=function(){return this.character?this.character:" "},e}(),newDocumentFragment:Mt},Bt=function(e,t,r){return!ae[t][e]||!ae[t][e].replace||55349===e.charCodeAt(0)||we.hasOwnProperty(e)&&r&&(r.fontFamily&&"tt"===r.fontFamily.slice(4,6)||r.font&&"tt"===r.font.slice(4,6))||(e=ae[t][e].replace),new Tt.TextNode(e)},Ct=function(e){return 1===e.length?e[0]:new Tt.MathNode("mrow",e)},Nt=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var r=t.font;if(!r||"mathnormal"===r)return null;var n=e.mode;if("mathit"===r)return"italic";if("boldsymbol"===r)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===r)return"bold";if("mathbb"===r)return"double-struck";if("mathfrak"===r)return"fraktur";if("mathscr"===r||"mathcal"===r)return"script";if("mathsf"===r)return"sans-serif";if("mathtt"===r)return"monospace";var a=e.text;return l.contains(["\\imath","\\jmath"],a)?null:(ae[n][a]&&ae[n][a].replace&&(a=ae[n][a].replace),N(a,Ke.fontMap[r].fontName,n)?Ke.fontMap[r].variant:null)},qt=function(e,t,r){if(1===e.length){var n=Rt(e[0],t);return r&&n instanceof zt&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var a,i=[],o=0;o0&&(p.text=p.text.slice(0,1)+"\u0338"+p.text.slice(1),i.pop())}}}i.push(s),a=s}return i},It=function(e,t,r){return Ct(qt(e,t,r))},Rt=function(e,t){if(!e)return new Tt.MathNode("mrow");if(it[e.type])return it[e.type](e,t);throw new n("Got group of unknown type: '"+e.type+"'")};function Ht(e,t,r,n,a){var i,o=qt(e,r);i=1===o.length&&o[0]instanceof zt&&l.contains(["mrow","mtable"],o[0].type)?o[0]:new Tt.MathNode("mrow",o);var s=new Tt.MathNode("annotation",[new Tt.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var h=new Tt.MathNode("semantics",[i,s]),c=new Tt.MathNode("math",[h]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var m=a?"katex":"katex-mathml";return Ke.makeSpan([m],[c])}var Ot=function(e){return new E({style:e.displayMode?x.DISPLAY:x.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Et=function(e,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),e=Ke.makeSpan(r,[e])}return e},Lt=function(e,t,r){var n,a=Ot(r);if("mathml"===r.output)return Ht(e,t,a,r.displayMode,!0);if("html"===r.output){var i=St(e,a);n=Ke.makeSpan(["katex"],[i])}else{var o=Ht(e,t,a,r.displayMode,!1),s=St(e,a);n=Ke.makeSpan(["katex"],[o,s])}return Et(n,r)},Dt={widehat:"^",widecheck:"\u02c7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23df",overbrace:"\u23de",overgroup:"\u23e0",undergroup:"\u23e1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21d2",xRightarrow:"\u21d2",overleftharpoon:"\u21bc",xleftharpoonup:"\u21bc",overrightharpoon:"\u21c0",xrightharpoonup:"\u21c0",xLeftarrow:"\u21d0",xLeftrightarrow:"\u21d4",xhookleftarrow:"\u21a9",xhookrightarrow:"\u21aa",xmapsto:"\u21a6",xrightharpoondown:"\u21c1",xleftharpoondown:"\u21bd",xrightleftharpoons:"\u21cc",xleftrightharpoons:"\u21cb",xtwoheadleftarrow:"\u219e",xtwoheadrightarrow:"\u21a0",xlongequal:"=",xtofrom:"\u21c4",xrightleftarrows:"\u21c4",xrightequilibrium:"\u21cc",xleftequilibrium:"\u21cb","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Vt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Pt=function(e,t,r,n,a){var i,o=e.height+e.depth+r+n;if(/fbox|color|angl/.test(t)){if(i=Ke.makeSpan(["stretchy",t],[],a),"fbox"===t){var s=a.color&&a.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new Q({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Q({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new K(l,{width:"100%",height:F(o)});i=Ke.makeSvgSpan([],[h],a)}return i.height=o,i.style.height=F(o),i},Ft=function(e){var t=new Tt.MathNode("mo",[new Tt.TextNode(Dt[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Gt=function(e,t){var r=function(){var r=4e5,n=e.label.slice(1);if(l.contains(["widehat","widecheck","widetilde","utilde"],n)){var a,i,o,s="ordgroup"===(d=e.base).type?d.body.length:1;if(s>5)"widehat"===n||"widecheck"===n?(a=420,r=2364,o=.42,i=n+"4"):(a=312,r=2340,o=.34,i="tilde4");else{var h=[1,1,2,2,3,3][s];"widehat"===n||"widecheck"===n?(r=[0,1062,2364,2364,2364][h],a=[0,239,300,360,420][h],o=[0,.24,.3,.3,.36,.42][h],i=n+h):(r=[0,600,1033,2339,2340][h],a=[0,260,286,306,312][h],o=[0,.26,.286,.3,.306,.34][h],i="tilde"+h)}var c=new J(i),m=new K([c],{width:"100%",height:F(o),viewBox:"0 0 "+r+" "+a,preserveAspectRatio:"none"});return{span:Ke.makeSvgSpan([],[m],t),minWidth:0,height:o}}var u,p,d,f=[],g=Vt[n],v=g[0],b=g[1],y=g[2],x=y/1e3,w=v.length;if(1===w)u=["hide-tail"],p=[g[3]];else if(2===w)u=["halfarrow-left","halfarrow-right"],p=["xMinYMin","xMaxYMin"];else{if(3!==w)throw new Error("Correct katexImagesData or update code here to support\n "+w+" children.");u=["brace-left","brace-center","brace-right"],p=["xMinYMin","xMidYMin","xMaxYMin"]}for(var k=0;k0&&(n.style.minWidth=F(a)),n};function Ut(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Yt(e){var t=Xt(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Xt(e){return e&&("atom"===e.type||re.hasOwnProperty(e.type))?e:null}var Wt=function(e,t){var r,n,a;e&&"supsub"===e.type?(r=(n=Ut(e.base,"accent")).base,e.base=r,a=function(e){if(e instanceof W)return e;throw new Error("Expected span but got "+String(e)+".")}(wt(e,t)),e.base=n):r=(n=Ut(e,"accent")).base;var i=wt(r,t.havingCrampedStyle()),o=0;if(n.isShifty&&l.isCharacterBox(r)){var s=l.getBaseElem(r);o=ee(wt(s,t.havingCrampedStyle())).skew}var h,c="\\c"===n.label,m=c?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight);if(n.isStretchy)h=Gt(n,t),h=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+F(2*o)+")",marginLeft:F(2*o)}:void 0}]},t);else{var u,p;"\\vec"===n.label?(u=Ke.staticSvg("vec",t),p=Ke.svgData.vec[1]):((u=ee(u=Ke.makeOrd({mode:n.mode,text:n.label},t,"textord"))).italic=0,p=u.width,c&&(m+=u.depth)),h=Ke.makeSpan(["accent-body"],[u]);var d="\\textcircled"===n.label;d&&(h.classes.push("accent-full"),m=i.height);var f=o;d||(f-=p/2),h.style.left=F(f),"\\textcircled"===n.label&&(h.style.top=".2em"),h=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-m},{type:"elem",elem:h}]},t)}var g=Ke.makeSpan(["mord","accent"],[h],t);return a?(a.children[0]=g,a.height=Math.max(g.height,a.height),a.classes[0]="mord",a):g},_t=function(e,t){var r=e.isStretchy?Ft(e.label):new Tt.MathNode("mo",[Bt(e.label,e.mode)]),n=new Tt.MathNode("mover",[Rt(e.base,t),r]);return n.setAttribute("accent","true"),n},jt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((function(e){return"\\"+e})).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(e,t){var r=lt(t[0]),n=!jt.test(e.funcName),a=!n||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:a,base:r}},htmlBuilder:Wt,mathmlBuilder:_t}),ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:function(e,t){var r=t[0],n=e.parser.mode;return"math"===n&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:Wt,mathmlBuilder:_t}),ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:a}},htmlBuilder:function(e,t){var r=wt(e.base,t),n=Gt(e,t),a="\\utilde"===e.label?.12:0,i=Ke.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:r}]},t);return Ke.makeSpan(["mord","accentunder"],[i],t)},mathmlBuilder:function(e,t){var r=Ft(e.label),n=new Tt.MathNode("munder",[Rt(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});var $t=function(e){var t=new Tt.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler:function(e,t,r){var n=e.parser,a=e.funcName;return{type:"xArrow",mode:n.mode,label:a,body:t[0],below:r[0]}},htmlBuilder:function(e,t){var r,n=t.style,a=t.havingStyle(n.sup()),i=Ke.wrapFragment(wt(e.body,a,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";i.classes.push(o+"-arrow-pad"),e.below&&(a=t.havingStyle(n.sub()),(r=Ke.wrapFragment(wt(e.below,a,t),t)).classes.push(o+"-arrow-pad"));var s,l=Gt(e,t),h=-t.fontMetrics().axisHeight+.5*l.height,c=-t.fontMetrics().axisHeight-.5*l.height-.111;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(c-=i.depth),r){var m=-t.fontMetrics().axisHeight+r.height+.5*l.height+.111;s=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:l,shift:h},{type:"elem",elem:r,shift:m}]},t)}else s=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:l,shift:h}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),Ke.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder:function(e,t){var r,n=Ft(e.label);if(n.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var a=$t(Rt(e.body,t));if(e.below){var i=$t(Rt(e.below,t));r=new Tt.MathNode("munderover",[n,i,a])}else r=new Tt.MathNode("mover",[n,a])}else if(e.below){var o=$t(Rt(e.below,t));r=new Tt.MathNode("munder",[n,o])}else r=$t(),r=new Tt.MathNode("mover",[n,r]);return r}});var Zt=Ke.makeSpan;function Kt(e,t){var r=ft(e.body,t,!0);return Zt([e.mclass],r,t)}function Jt(e,t){var r,n=qt(e.body,t);return"minner"===e.mclass?r=new Tt.MathNode("mpadded",n):"mord"===e.mclass?e.isCharacterBox?(r=n[0]).type="mi":r=new Tt.MathNode("mi",n):(e.isCharacterBox?(r=n[0]).type="mo":r=new Tt.MathNode("mo",n),"mbin"===e.mclass?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):"mpunct"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0em"):"minner"===e.mclass&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:ht(a),isCharacterBox:l.isCharacterBox(a)}},htmlBuilder:Kt,mathmlBuilder:Jt});var Qt=function(e){var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(e,t){return{type:"mclass",mode:e.parser.mode,mclass:Qt(t[0]),body:ht(t[1]),isCharacterBox:l.isCharacterBox(t[1])}}}),ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(e,t){var r,n=e.parser,a=e.funcName,i=t[1],o=t[0];r="\\stackrel"!==a?Qt(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==a,body:ht(i)},h={type:"supsub",mode:o.mode,base:s,sup:"\\underset"===a?null:o,sub:"\\underset"===a?o:null};return{type:"mclass",mode:n.mode,mclass:r,body:[h],isCharacterBox:l.isCharacterBox(h)}},htmlBuilder:Kt,mathmlBuilder:Jt}),ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){return{type:"pmb",mode:e.parser.mode,mclass:Qt(t[0]),body:ht(t[0])}},htmlBuilder:function(e,t){var r=ft(e.body,t,!0),n=Ke.makeSpan([e.mclass],r,t);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder:function(e,t){var r=qt(e.body,t),n=new Tt.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var er={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},tr=function(e){return"textord"===e.type&&"@"===e.text};function rr(e,t,r){var n=er[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var a={type:"atom",text:n,mode:"math",family:"rel"},i={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[t[0]],[]),r.callFunction("\\Big",[a],[]),r.callFunction("\\\\cdright",[t[1]],[])]};return r.callFunction("\\\\cdparent",[i],[]);case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return r.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder:function(e,t){var r=t.havingStyle(t.style.sup()),n=Ke.wrapFragment(wt(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=F(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mrow",[Rt(e.label,t)]);return(r=new Tt.MathNode("mpadded",[r])).setAttribute("width","0"),"left"===e.side&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),(r=new Tt.MathNode("mstyle",[r])).setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler:function(e,t){return{type:"cdlabelparent",mode:e.parser.mode,fragment:t[0]}},htmlBuilder:function(e,t){var r=Ke.wrapFragment(wt(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder:function(e,t){return new Tt.MathNode("mrow",[Rt(e.fragment,t)])}}),ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){for(var r=e.parser,a=Ut(t[0],"ordgroup").body,i="",o=0;o=1114111)throw new n("\\@char with invalid code point "+i);return l<=65535?s=String.fromCharCode(l):(l-=65536,s=String.fromCharCode(55296+(l>>10),56320+(1023&l))),{type:"textord",mode:r.mode,text:s}}});var nr=function(e,t){var r=ft(e.body,t.withColor(e.color),!1);return Ke.makeFragment(r)},ar=function(e,t){var r=qt(e.body,t.withColor(e.color)),n=new Tt.MathNode("mstyle",r);return n.setAttribute("mathcolor",e.color),n};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler:function(e,t){var r=e.parser,n=Ut(t[0],"color-token").color,a=t[1];return{type:"color",mode:r.mode,color:n,body:ht(a)}},htmlBuilder:nr,mathmlBuilder:ar}),ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler:function(e,t){var r=e.parser,n=e.breakOnTokenText,a=Ut(t[0],"color-token").color;r.gullet.macros.set("\\current@color",a);var i=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:a,body:i}},htmlBuilder:nr,mathmlBuilder:ar}),ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler:function(e,t,r){var n=e.parser,a="["===n.gullet.future().text?n.parseSizeGroup(!0):null,i=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:i,size:a&&Ut(a,"size").value}},htmlBuilder:function(e,t){var r=Ke.makeSpan(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=F(P(e.size,t)))),r},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",F(P(e.size,t)))),r}});var ir={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},or=function(e){var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new n("Expected a control sequence",e);return t},sr=function(e,t,r,n){var a=e.gullet.macros.get(r.text);null==a&&(r.noexpand=!0,a={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,a,n)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler:function(e){var t=e.parser,r=e.funcName;t.consumeSpaces();var a=t.fetch();if(ir[a.text])return"\\global"!==r&&"\\\\globallong"!==r||(a.text=ir[a.text]),Ut(t.parseFunction(),"internal");throw new n("Invalid token after macro prefix",a)}}),ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,a=t.gullet.popToken(),i=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new n("Expected a control sequence",a);for(var o,s=0,l=[[]];"{"!==t.gullet.future().text;)if("#"===(a=t.gullet.popToken()).text){if("{"===t.gullet.future().text){o=t.gullet.future(),l[s].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new n('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==s+1)throw new n('Argument number "'+a.text+'" out of order');s++,l.push([])}else{if("EOF"===a.text)throw new n("Expected a macro definition");l[s].push(a.text)}var h=t.gullet.consumeArg().tokens;return o&&h.unshift(o),"\\edef"!==r&&"\\xdef"!==r||(h=t.gullet.expandTokens(h)).reverse(),t.gullet.macros.set(i,{tokens:h,numArgs:s,delimiters:l},r===ir[r]),{type:"internal",mode:t.mode}}}),ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,n=or(t.gullet.popToken());t.gullet.consumeSpaces();var a=function(e){var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t}(t);return sr(t,n,a,"\\\\globallet"===r),{type:"internal",mode:t.mode}}}),ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,n=or(t.gullet.popToken()),a=t.gullet.popToken(),i=t.gullet.popToken();return sr(t,n,i,"\\\\globalfuture"===r),t.gullet.pushToken(i),t.gullet.pushToken(a),{type:"internal",mode:t.mode}}});var lr=function(e,t,r){var n=N(ae.math[e]&&ae.math[e].replace||e,t,r);if(!n)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return n},hr=function(e,t,r,n){var a=r.havingBaseStyle(t),i=Ke.makeSpan(n.concat(a.sizingClasses(r)),[e],r),o=a.sizeMultiplier/r.sizeMultiplier;return i.height*=o,i.depth*=o,i.maxFontSize=a.sizeMultiplier,i},cr=function(e,t,r){var n=t.havingBaseStyle(r),a=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=F(a),e.height-=a,e.depth+=a},mr=function(e,t,r,n,a,i){var o=function(e,t,r,n){return Ke.makeSymbol(e,"Size"+t+"-Regular",r,n)}(e,t,a,n),s=hr(Ke.makeSpan(["delimsizing","size"+t],[o],n),x.TEXT,n,i);return r&&cr(s,n,x.TEXT),s},ur=function(e,t,r){var n;return n="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Ke.makeSpan(["delimsizinginner",n],[Ke.makeSpan([],[Ke.makeSymbol(e,t,r)])])}},pr=function(e,t,r){var n=T["Size4-Regular"][e.charCodeAt(0)]?T["Size4-Regular"][e.charCodeAt(0)][4]:T["Size1-Regular"][e.charCodeAt(0)][4],a=new J("inner",function(e,t){switch(e){case"\u239c":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"\u2223":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"\u2225":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"\u239f":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"\u23a2":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"\u23a5":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"\u23aa":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"\u23d0":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"\u2016":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),i=new K([a],{width:F(n),height:F(t),style:"width:"+F(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=Ke.makeSvgSpan([],[i],r);return o.height=t,o.style.height=F(t),o.style.width=F(n),{type:"elem",elem:o}},dr={type:"kern",size:-.008},fr=["|","\\lvert","\\rvert","\\vert"],gr=["\\|","\\lVert","\\rVert","\\Vert"],vr=function(e,t,r,n,a,i){var o,s,h,c,m="",u=0;o=h=c=e,s=null;var p="Size1-Regular";"\\uparrow"===e?h=c="\u23d0":"\\Uparrow"===e?h=c="\u2016":"\\downarrow"===e?o=h="\u23d0":"\\Downarrow"===e?o=h="\u2016":"\\updownarrow"===e?(o="\\uparrow",h="\u23d0",c="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",h="\u2016",c="\\Downarrow"):l.contains(fr,e)?(h="\u2223",m="vert",u=333):l.contains(gr,e)?(h="\u2225",m="doublevert",u=556):"["===e||"\\lbrack"===e?(o="\u23a1",h="\u23a2",c="\u23a3",p="Size4-Regular",m="lbrack",u=667):"]"===e||"\\rbrack"===e?(o="\u23a4",h="\u23a5",c="\u23a6",p="Size4-Regular",m="rbrack",u=667):"\\lfloor"===e||"\u230a"===e?(h=o="\u23a2",c="\u23a3",p="Size4-Regular",m="lfloor",u=667):"\\lceil"===e||"\u2308"===e?(o="\u23a1",h=c="\u23a2",p="Size4-Regular",m="lceil",u=667):"\\rfloor"===e||"\u230b"===e?(h=o="\u23a5",c="\u23a6",p="Size4-Regular",m="rfloor",u=667):"\\rceil"===e||"\u2309"===e?(o="\u23a4",h=c="\u23a5",p="Size4-Regular",m="rceil",u=667):"("===e||"\\lparen"===e?(o="\u239b",h="\u239c",c="\u239d",p="Size4-Regular",m="lparen",u=875):")"===e||"\\rparen"===e?(o="\u239e",h="\u239f",c="\u23a0",p="Size4-Regular",m="rparen",u=875):"\\{"===e||"\\lbrace"===e?(o="\u23a7",s="\u23a8",c="\u23a9",h="\u23aa",p="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="\u23ab",s="\u23ac",c="\u23ad",h="\u23aa",p="Size4-Regular"):"\\lgroup"===e||"\u27ee"===e?(o="\u23a7",c="\u23a9",h="\u23aa",p="Size4-Regular"):"\\rgroup"===e||"\u27ef"===e?(o="\u23ab",c="\u23ad",h="\u23aa",p="Size4-Regular"):"\\lmoustache"===e||"\u23b0"===e?(o="\u23a7",c="\u23ad",h="\u23aa",p="Size4-Regular"):"\\rmoustache"!==e&&"\u23b1"!==e||(o="\u23ab",c="\u23a9",h="\u23aa",p="Size4-Regular");var d=lr(o,p,a),f=d.height+d.depth,g=lr(h,p,a),v=g.height+g.depth,b=lr(c,p,a),y=b.height+b.depth,w=0,k=1;if(null!==s){var S=lr(s,p,a);w=S.height+S.depth,k=2}var M=f+y+w,z=M+Math.max(0,Math.ceil((t-M)/(k*v)))*k*v,A=n.fontMetrics().axisHeight;r&&(A*=n.sizeMultiplier);var T=z/2-A,B=[];if(m.length>0){var C=z-f-y,N=Math.round(1e3*z),q=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(m,Math.round(1e3*C)),I=new J(m,q),R=(u/1e3).toFixed(3)+"em",H=(N/1e3).toFixed(3)+"em",O=new K([I],{width:R,height:H,viewBox:"0 0 "+u+" "+N}),E=Ke.makeSvgSpan([],[O],n);E.height=N/1e3,E.style.width=R,E.style.height=H,B.push({type:"elem",elem:E})}else{if(B.push(ur(c,p,a)),B.push(dr),null===s){var L=z-f-y+.016;B.push(pr(h,L,n))}else{var D=(z-f-y-w)/2+.016;B.push(pr(h,D,n)),B.push(dr),B.push(ur(s,p,a)),B.push(dr),B.push(pr(h,D,n))}B.push(dr),B.push(ur(o,p,a))}var V=n.havingBaseStyle(x.TEXT),P=Ke.makeVList({positionType:"bottom",positionData:T,children:B},V);return hr(Ke.makeSpan(["delimsizing","mult"],[P],V),x.TEXT,n,i)},br=.08,yr=function(e,t,r,n,a){var i=function(e,t,r){t*=1e3;var n="";switch(e){case"sqrtMain":n=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize1":n=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize2":n=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize3":n=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize4":n=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,M);break;case"sqrtTall":n=function(e,t,r){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(r-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,M,r)}return n}(e,n,r),o=new J(e,i),s=new K([o],{width:"400em",height:F(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ke.makeSvgSpan(["hide-tail"],[s],a)},xr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","\\surd"],wr=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1"],kr=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Sr=[0,1.2,1.8,2.4,3],Mr=[{type:"small",style:x.SCRIPTSCRIPT},{type:"small",style:x.SCRIPT},{type:"small",style:x.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],zr=[{type:"small",style:x.SCRIPTSCRIPT},{type:"small",style:x.SCRIPT},{type:"small",style:x.TEXT},{type:"stack"}],Ar=[{type:"small",style:x.SCRIPTSCRIPT},{type:"small",style:x.SCRIPT},{type:"small",style:x.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Tr=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Br=function(e,t,r,n){for(var a=Math.min(2,3-n.style.size);at)return r[a]}return r[r.length-1]},Cr=function(e,t,r,n,a,i){var o;"<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),o=l.contains(kr,e)?Mr:l.contains(xr,e)?Ar:zr;var s=Br(e,t,o,n);return"small"===s.type?function(e,t,r,n,a,i){var o=Ke.makeSymbol(e,"Main-Regular",a,n),s=hr(o,t,n,i);return r&&cr(s,n,t),s}(e,s.style,r,n,a,i):"large"===s.type?mr(e,s.size,r,n,a,i):vr(e,t,r,n,a,i)},Nr={sqrtImage:function(e,t){var r,n,a=t.havingBaseSizing(),i=Br("\\surd",e*a.sizeMultiplier,Ar,a),o=a.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,h=0,c=0;return"small"===i.type?(e<1?o=1:e<1.4&&(o=.7),h=(1+s)/o,(r=yr("sqrtMain",l=(1+s+br)/o,c=1e3+1e3*s+80,s,t)).style.minWidth="0.853em",n=.833/o):"large"===i.type?(c=1080*Sr[i.size],h=(Sr[i.size]+s)/o,l=(Sr[i.size]+s+br)/o,(r=yr("sqrtSize"+i.size,l,c,s,t)).style.minWidth="1.02em",n=1/o):(l=e+s+br,h=e+s,c=Math.floor(1e3*e+s)+80,(r=yr("sqrtTall",l,c,s,t)).style.minWidth="0.742em",n=1.056),r.height=h,r.style.height=F(l),{span:r,advanceWidth:n,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*o}},sizedDelim:function(e,t,r,a,i){if("<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),l.contains(xr,e)||l.contains(kr,e))return mr(e,t,!1,r,a,i);if(l.contains(wr,e))return vr(e,Sr[t],!1,r,a,i);throw new n("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Sr,customSizedDelim:Cr,leftRightDelim:function(e,t,r,n,a,i){var o=n.fontMetrics().axisHeight*n.sizeMultiplier,s=5/n.fontMetrics().ptPerEm,l=Math.max(t-o,r+o),h=Math.max(l/500*901,2*l-s);return Cr(e,h,!0,n,a,i)}},qr={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Ir=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27e8","\\rangle","\u27e9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Rr(e,t){var r=Xt(e);if(r&&l.contains(Ir,r.text))return r;throw new n(r?"Invalid delimiter '"+r.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Hr(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:function(e,t){var r=Rr(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:qr[e.funcName].size,mclass:qr[e.funcName].mclass,delim:r.text}},htmlBuilder:function(e,t){return"."===e.delim?Ke.makeSpan([e.mclass]):Nr.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass])},mathmlBuilder:function(e){var t=[];"."!==e.delim&&t.push(Bt(e.delim,e.mode));var r=new Tt.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=F(Nr.sizeToMaxHeight[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}}),ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=e.parser.gullet.macros.get("\\current@color");if(r&&"string"!=typeof r)throw new n("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Rr(t[0],e).text,color:r}}}),ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=Rr(t[0],e),n=e.parser;++n.leftrightDepth;var a=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var i=Ut(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:a,left:r.text,right:i.delim,rightColor:i.color}},htmlBuilder:function(e,t){Hr(e);for(var r,n,a=ft(e.body,t,!0,["mopen","mclose"]),i=0,o=0,s=!1,l=0;l-1?"mpadded":"menclose",[Rt(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),"\\fcolorbox"===e.label){var a=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+a+"em solid "+String(e.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler:function(e,t,r){var n=e.parser,a=e.funcName,i=Ut(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:n.mode,label:a,backgroundColor:i,body:o}},htmlBuilder:Or,mathmlBuilder:Er}),ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler:function(e,t,r){var n=e.parser,a=e.funcName,i=Ut(t[0],"color-token").color,o=Ut(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:n.mode,label:a,backgroundColor:o,borderColor:i,body:s}},htmlBuilder:Or,mathmlBuilder:Er}),ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(e,t){return{type:"enclose",mode:e.parser.mode,label:"\\fbox",body:t[0]}}}),ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"enclose",mode:r.mode,label:n,body:a}},htmlBuilder:Or,mathmlBuilder:Er}),ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler:function(e,t){return{type:"enclose",mode:e.parser.mode,label:"\\angl",body:t[0]}}});var Lr={};function Dr(e){for(var t=e.type,r=e.names,n=e.props,a=e.handler,i=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:a},l=0;l1||!m)&&g.pop(),b.length0&&(y+=.25),c.push({pos:y,isDashed:e[t]})}for(w(o[0]),r=0;r0&&(M<(B+=b)&&(M=B),B=0),e.addJot&&(M+=f),z.height=S,z.depth=M,y+=S,z.pos=y,y+=M+B,h[r]=z,w(o[r+1])}var C,N,q=y/2+t.fontMetrics().axisHeight,I=e.cols||[],R=[],H=[];if(e.tags&&e.tags.some((function(e){return e})))for(r=0;r=s)){var W=void 0;(a>0||e.hskipBeforeAndAfter)&&0!==(W=l.deflt(V.pregap,p))&&((C=Ke.makeSpan(["arraycolsep"],[])).style.width=F(W),R.push(C));var _=[];for(r=0;r0){for(var K=Ke.makeLineSpan("hline",t,m),J=Ke.makeLineSpan("hdashline",t,m),Q=[{type:"elem",elem:h,shift:0}];c.length>0;){var ee=c.pop(),te=ee.pos-q;ee.isDashed?Q.push({type:"elem",elem:J,shift:te}):Q.push({type:"elem",elem:K,shift:te})}h=Ke.makeVList({positionType:"individualShift",children:Q},t)}if(0===H.length)return Ke.makeSpan(["mord"],[h],t);var re=Ke.makeVList({positionType:"individualShift",children:H},t);return re=Ke.makeSpan(["tag"],[re],t),Ke.makeFragment([h,re])},$r={c:"center ",l:"left ",r:"right "},Zr=function(e,t){for(var r=[],n=new Tt.MathNode("mtd",[],["mtr-glue"]),a=new Tt.MathNode("mtd",[],["mml-eqn-num"]),i=0;i0){var p=e.cols,d="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(m+="top ",g=1),"separator"===p[p.length-1].type&&(m+="bottom ",v-=1);for(var b=g;b0?"left ":"",m+=S[S.length-1].length>0?"right ":"";for(var M=1;M-1?"alignat":"align",o="split"===e.envName,s=Wr(e.parser,{cols:a,addJot:!0,autoTag:o?void 0:Xr(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:o?2:void 0,leqno:e.parser.settings.leqno},"display"),l=0,h={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",m=0;m0&&u&&(f=1),a[p]={type:"align",align:d,pregap:f,postgap:0}}return s.colSeparationType=u?"align":"alignat",s};Dr({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(e,t){var r=(Xt(t[0])?[t[0]]:Ut(t[0],"ordgroup").body).map((function(e){var t=Yt(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new n("Unknown column alignment: "+t,e)})),a={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return Wr(e.parser,a,_r(e.envName))},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler:function(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],r="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,-1==="lcr".indexOf(r))throw new n("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),a.cols=[{type:"align",align:r}]}}var o=Wr(e.parser,a,_r(e.envName)),s=Math.max.apply(Math,[0].concat(o.body.map((function(e){return e.length}))));return o.cols=new Array(s).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(e){var t=Wr(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["subarray"],props:{numArgs:1},handler:function(e,t){var r=(Xt(t[0])?[t[0]]:Ut(t[0],"ordgroup").body).map((function(e){var t=Yt(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new n("Unknown column alignment: "+t,e)}));if(r.length>1)throw new n("{subarray} can contain only one column");var a={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5};if((a=Wr(e.parser,a,"script")).body.length>0&&a.body[0].length>1)throw new n("{subarray} can contain only one column");return a},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler:function(e){var t=Wr(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},_r(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Kr,htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler:function(e){l.contains(["gather","gather*"],e.envName)&&Yr(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Xr(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Wr(e.parser,t,"display")},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Kr,htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler:function(e){Yr(e);var t={autoTag:Xr(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Wr(e.parser,t,"display")},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["CD"],props:{numArgs:0},handler:function(e){return Yr(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var r=e.fetch().text;if("&"!==r&&"\\\\"!==r){if("\\end"===r){0===t[t.length-1].length&&t.pop();break}throw new n("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var a,i,o=[],s=[o],l=0;l-1);else{if(!("<>AV".indexOf(u)>-1))throw new n('Expected one of "<>AV=|." after @',h[m]);for(var d=0;d<2;d++){for(var f=!0,g=m+1;g=x.SCRIPT.id?r.text():x.DISPLAY:"text"===e&&r.size===x.DISPLAY.size?r=x.TEXT:"script"===e?r=x.SCRIPT:"scriptscript"===e&&(r=x.SCRIPTSCRIPT),r},nn=function(e,t){var r,n=rn(e.size,t.style),a=n.fracNum(),i=n.fracDen();r=t.havingStyle(a);var o=wt(e.numer,r,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?3*m:7*m,d=t.fontMetrics().denom1):(c>0?(u=t.fontMetrics().num2,p=m):(u=t.fontMetrics().num3,p=3*m),d=t.fontMetrics().denom2),h){var w=t.fontMetrics().axisHeight;u-o.depth-(w+.5*c)0&&(t="."===(t=e)?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler:function(e,t){var r,n=e.parser,a=t[4],i=t[5],o=lt(t[0]),s="atom"===o.type&&"open"===o.family?sn(o.text):null,l=lt(t[1]),h="atom"===l.type&&"close"===l.family?sn(l.text):null,c=Ut(t[2],"size"),m=null;r=!!c.isBlank||(m=c.value).number>0;var u="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var d=Ut(p.body[0],"textord");u=on[Number(d.text)]}}else p=Ut(p,"textord"),u=on[Number(p.text)];return{type:"genfrac",mode:n.mode,numer:a,denom:i,continued:!1,hasBarLine:r,barSize:m,leftDelim:s,rightDelim:h,size:u}},htmlBuilder:nn,mathmlBuilder:an}),ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(e,t){var r=e.parser,n=(e.funcName,e.token);return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Ut(t[0],"size").value,token:n}}}),ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(e,t){var r=e.parser,n=(e.funcName,t[0]),a=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Ut(t[1],"infix").size),i=t[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:nn,mathmlBuilder:an});var ln=function(e,t){var r,n,a=t.style;"supsub"===e.type?(r=e.sup?wt(e.sup,t.havingStyle(a.sup()),t):wt(e.sub,t.havingStyle(a.sub()),t),n=Ut(e.base,"horizBrace")):n=Ut(e,"horizBrace");var i,o=wt(n.base,t.havingBaseStyle(x.DISPLAY)),s=Gt(n,t);if(n.isOver?(i=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=Ke.makeVList({positionType:"bottom",positionData:o.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),r){var l=Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t);i=n.isOver?Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},t):Ke.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t)};ot({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:ln,mathmlBuilder:function(e,t){var r=Ft(e.label);return new Tt.MathNode(e.isOver?"mover":"munder",[Rt(e.base,t),r])}}),ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=t[1],a=Ut(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:r.mode,href:a,body:ht(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:function(e,t){var r=ft(e.body,t,!1);return Ke.makeAnchor(e.href,[],r,t)},mathmlBuilder:function(e,t){var r=It(e.body,t);return r instanceof zt||(r=new zt("mrow",[r])),r.setAttribute("href",e.href),r}}),ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=Ut(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var a=[],i=0;i0&&(n=P(e.totalheight,t)-r);var a=0;e.width.number>0&&(a=P(e.width,t));var i={height:F(r+n)};a>0&&(i.width=F(a)),n>0&&(i.verticalAlign=F(-n));var o=new j(e.src,e.alt,i);return o.height=r,o.depth=n,o},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mglyph",[]);r.setAttribute("alt",e.alt);var n=P(e.height,t),a=0;if(e.totalheight.number>0&&(a=P(e.totalheight,t)-n,r.setAttribute("valign",F(-a))),r.setAttribute("height",F(n+a)),e.width.number>0){var i=P(e.width,t);r.setAttribute("width",F(i))}return r.setAttribute("src",e.src),r}}),ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=Ut(t[0],"size");if(r.settings.strict){var i="m"===n[1],o="mu"===a.value.unit;i?(o||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+a.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:a.value}},htmlBuilder:function(e,t){return Ke.makeGlue(e.dimension,t)},mathmlBuilder:function(e,t){var r=P(e.dimension,t);return new Tt.SpaceNode(r)}}),ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:a}},htmlBuilder:function(e,t){var r;"clap"===e.alignment?(r=Ke.makeSpan([],[wt(e.body,t)]),r=Ke.makeSpan(["inner"],[r],t)):r=Ke.makeSpan(["inner"],[wt(e.body,t)]);var n=Ke.makeSpan(["fix"],[]),a=Ke.makeSpan([e.alignment],[r,n],t),i=Ke.makeSpan(["strut"]);return i.style.height=F(a.height+a.depth),a.depth&&(i.style.verticalAlign=F(-a.depth)),a.children.unshift(i),a=Ke.makeSpan(["thinbox"],[a],t),Ke.makeSpan(["mord","vbox"],[a],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mpadded",[Rt(e.body,t)]);if("rlap"!==e.alignment){var n="llap"===e.alignment?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){var r=e.funcName,n=e.parser,a=n.mode;n.switchMode("math");var i="\\("===r?"\\)":"$",o=n.parseExpression(!1,i);return n.expect(i),n.switchMode(a),{type:"styling",mode:n.mode,style:"text",body:o}}}),ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){throw new n("Mismatched "+e.funcName)}});var cn=function(e,t){switch(t.style.size){case x.DISPLAY.size:return e.display;case x.TEXT.size:return e.text;case x.SCRIPT.size:return e.script;case x.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:function(e,t){return{type:"mathchoice",mode:e.parser.mode,display:ht(t[0]),text:ht(t[1]),script:ht(t[2]),scriptscript:ht(t[3])}},htmlBuilder:function(e,t){var r=cn(e,t),n=ft(r,t,!1);return Ke.makeFragment(n)},mathmlBuilder:function(e,t){var r=cn(e,t);return It(r,t)}});var mn=function(e,t,r,n,a,i,o){e=Ke.makeSpan([],[e]);var s,h,c,m=r&&l.isCharacterBox(r);if(t){var u=wt(t,n.havingStyle(a.sup()),n);h={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(r){var p=wt(r,n.havingStyle(a.sub()),n);s={elem:p,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-p.height)}}if(h&&s){var d=n.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+o;c=Ke.makeVList({positionType:"bottom",positionData:d,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:F(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:F(i)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(s){var f=e.height-o;c=Ke.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:F(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},n)}else{if(!h)return e;var g=e.depth+o;c=Ke.makeVList({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:F(i)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}var v=[c];if(s&&0!==i&&!m){var b=Ke.makeSpan(["mspace"],[],n);b.style.marginRight=F(i),v.unshift(b)}return Ke.makeSpan(["mop","op-limits"],v,n)},un=["\\smallint"],pn=function(e,t){var r,n,a,i=!1;"supsub"===e.type?(r=e.sup,n=e.sub,a=Ut(e.base,"op"),i=!0):a=Ut(e,"op");var o,s=t.style,h=!1;if(s.size===x.DISPLAY.size&&a.symbol&&!l.contains(un,a.name)&&(h=!0),a.symbol){var c=h?"Size2-Regular":"Size1-Regular",m="";if("\\oiint"!==a.name&&"\\oiiint"!==a.name||(m=a.name.slice(1),a.name="oiint"===m?"\\iint":"\\iiint"),o=Ke.makeSymbol(a.name,c,"math",t,["mop","op-symbol",h?"large-op":"small-op"]),m.length>0){var u=o.italic,p=Ke.staticSvg(m+"Size"+(h?"2":"1"),t);o=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:p,shift:h?.08:0}]},t),a.name="\\"+m,o.classes.unshift("mop"),o.italic=u}}else if(a.body){var d=ft(a.body,t,!0);1===d.length&&d[0]instanceof Z?(o=d[0]).classes[0]="mop":o=Ke.makeSpan(["mop"],d,t)}else{for(var f=[],g=1;g0){for(var s=a.body.map((function(e){var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=ft(s,t.withFont("mathrm"),!0),h=0;h=0?s.setAttribute("height",F(a)):(s.setAttribute("height",F(a)),s.setAttribute("depth",F(-a))),s.setAttribute("voffset",F(a)),s}});var yn=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];ot({type:"sizing",names:yn,props:{numArgs:0,allowedInText:!0},handler:function(e,t){var r=e.breakOnTokenText,n=e.funcName,a=e.parser,i=a.parseExpression(!1,r);return{type:"sizing",mode:a.mode,size:yn.indexOf(n)+1,body:i}},htmlBuilder:function(e,t){var r=t.havingSize(e.size);return bn(e.body,r,t)},mathmlBuilder:function(e,t){var r=t.havingSize(e.size),n=qt(e.body,r),a=new Tt.MathNode("mstyle",n);return a.setAttribute("mathsize",F(r.sizeMultiplier)),a}}),ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(e,t,r){var n=e.parser,a=!1,i=!1,o=r[0]&&Ut(r[0],"ordgroup");if(o)for(var s="",l=0;lr.height+r.depth+i&&(i=(i+m-r.height-r.depth)/2);var u=l.height-r.height-i-h;r.style.paddingLeft=F(c);var p=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+u)},{type:"elem",elem:l},{type:"kern",size:h}]},t);if(e.index){var d=t.havingStyle(x.SCRIPTSCRIPT),f=wt(e.index,d,t),g=.6*(p.height-p.depth),v=Ke.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f}]},t),b=Ke.makeSpan(["root"],[v]);return Ke.makeSpan(["mord","sqrt"],[b,p],t)}return Ke.makeSpan(["mord","sqrt"],[p],t)},mathmlBuilder:function(e,t){var r=e.body,n=e.index;return n?new Tt.MathNode("mroot",[Rt(r,t),Rt(n,t)]):new Tt.MathNode("msqrt",[Rt(r,t)])}});var xn={display:x.DISPLAY,text:x.TEXT,script:x.SCRIPT,scriptscript:x.SCRIPTSCRIPT};ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e,t){var r=e.breakOnTokenText,n=e.funcName,a=e.parser,i=a.parseExpression(!0,r),o=n.slice(1,n.length-5);return{type:"styling",mode:a.mode,style:o,body:i}},htmlBuilder:function(e,t){var r=xn[e.style],n=t.havingStyle(r).withFont("");return bn(e.body,n,t)},mathmlBuilder:function(e,t){var r=xn[e.style],n=t.havingStyle(r),a=qt(e.body,n),i=new Tt.MathNode("mstyle",a),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var wn=function(e,t){var r=e.base;return r?"op"===r.type?r.limits&&(t.style.size===x.DISPLAY.size||r.alwaysHandleSupSub)?pn:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(t.style.size===x.DISPLAY.size||r.limits)?vn:null:"accent"===r.type?l.isCharacterBox(r.base)?Wt:null:"horizBrace"===r.type&&!e.sub===r.isOver?ln:null:null};st({type:"supsub",htmlBuilder:function(e,t){var r=wn(e,t);if(r)return r(e,t);var n,a,i,o=e.base,s=e.sup,h=e.sub,c=wt(o,t),m=t.fontMetrics(),u=0,p=0,d=o&&l.isCharacterBox(o);if(s){var f=t.havingStyle(t.style.sup());n=wt(s,f,t),d||(u=c.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(h){var g=t.havingStyle(t.style.sub());a=wt(h,g,t),d||(p=c.depth+g.fontMetrics().subDrop*g.sizeMultiplier/t.sizeMultiplier)}i=t.style===x.DISPLAY?m.sup1:t.style.cramped?m.sup3:m.sup2;var v,b=t.sizeMultiplier,y=F(.5/m.ptPerEm/b),w=null;if(a){var k=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Z||k)&&(w=F(-c.italic))}if(n&&a){u=Math.max(u,i,n.depth+.25*m.xHeight),p=Math.max(p,m.sub2);var S=4*m.defaultRuleThickness;if(u-n.depth-(a.height-p)0&&(u+=M,p-=M)}var z=[{type:"elem",elem:a,shift:p,marginRight:y,marginLeft:w},{type:"elem",elem:n,shift:-u,marginRight:y}];v=Ke.makeVList({positionType:"individualShift",children:z},t)}else if(a){p=Math.max(p,m.sub1,a.height-.8*m.xHeight);var A=[{type:"elem",elem:a,marginLeft:w,marginRight:y}];v=Ke.makeVList({positionType:"shift",positionData:p,children:A},t)}else{if(!n)throw new Error("supsub must have either sup or sub.");u=Math.max(u,i,n.depth+.25*m.xHeight),v=Ke.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:n,marginRight:y}]},t)}var T=yt(c,"right")||"mord";return Ke.makeSpan([T],[c,Ke.makeSpan(["msupsub"],[v])],t)},mathmlBuilder:function(e,t){var r,n=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(n=!0,r=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var a,i=[Rt(e.base,t)];if(e.sub&&i.push(Rt(e.sub,t)),e.sup&&i.push(Rt(e.sup,t)),n)a=r?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;a=o&&"op"===o.type&&o.limits&&t.style===x.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===x.DISPLAY||o.limits)?"munderover":"msubsup"}else{var s=e.base;a=s&&"op"===s.type&&s.limits&&(t.style===x.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===x.DISPLAY)?"munder":"msub"}else{var l=e.base;a=l&&"op"===l.type&&l.limits&&(t.style===x.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===x.DISPLAY)?"mover":"msup"}return new Tt.MathNode(a,i)}}),st({type:"atom",htmlBuilder:function(e,t){return Ke.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[Bt(e.text,e.mode)]);if("bin"===e.family){var n=Nt(e,t);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===e.family?r.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||r.setAttribute("stretchy","false");return r}});var kn={mi:"italic",mn:"normal",mtext:"normal"};st({type:"mathord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"mathord")},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mi",[Bt(e.text,e.mode,t)]),n=Nt(e,t)||"italic";return n!==kn[r.type]&&r.setAttribute("mathvariant",n),r}}),st({type:"textord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"textord")},mathmlBuilder:function(e,t){var r,n=Bt(e.text,e.mode,t),a=Nt(e,t)||"normal";return r="text"===e.mode?new Tt.MathNode("mtext",[n]):/[0-9]/.test(e.text)?new Tt.MathNode("mn",[n]):"\\prime"===e.text?new Tt.MathNode("mo",[n]):new Tt.MathNode("mi",[n]),a!==kn[r.type]&&r.setAttribute("mathvariant",a),r}});var Sn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Mn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};st({type:"spacing",htmlBuilder:function(e,t){if(Mn.hasOwnProperty(e.text)){var r=Mn[e.text].className||"";if("text"===e.mode){var a=Ke.makeOrd(e,t,"textord");return a.classes.push(r),a}return Ke.makeSpan(["mspace",r],[Ke.mathsym(e.text,e.mode,t)],t)}if(Sn.hasOwnProperty(e.text))return Ke.makeSpan(["mspace",Sn[e.text]],[],t);throw new n('Unknown type of space "'+e.text+'"')},mathmlBuilder:function(e,t){if(!Mn.hasOwnProperty(e.text)){if(Sn.hasOwnProperty(e.text))return new Tt.MathNode("mspace");throw new n('Unknown type of space "'+e.text+'"')}return new Tt.MathNode("mtext",[new Tt.TextNode("\xa0")])}});var zn=function(){var e=new Tt.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};st({type:"tag",mathmlBuilder:function(e,t){var r=new Tt.MathNode("mtable",[new Tt.MathNode("mtr",[zn(),new Tt.MathNode("mtd",[It(e.body,t)]),zn(),new Tt.MathNode("mtd",[It(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});var An={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Tn={"\\textbf":"textbf","\\textmd":"textmd"},Bn={"\\textit":"textit","\\textup":"textup"},Cn=function(e,t){var r=e.font;return r?An[r]?t.withTextFontFamily(An[r]):Tn[r]?t.withTextFontWeight(Tn[r]):t.withTextFontShape(Bn[r]):t};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"text",mode:r.mode,body:ht(a),font:n}},htmlBuilder:function(e,t){var r=Cn(e,t),n=ft(e.body,r,!0);return Ke.makeSpan(["mord","text"],n,r)},mathmlBuilder:function(e,t){var r=Cn(e,t);return It(e.body,r)}}),ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){return{type:"underline",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=Ke.makeLineSpan("underline-line",t),a=t.fontMetrics().defaultRuleThickness,i=Ke.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:a},{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r}]},t);return Ke.makeSpan(["mord","underline"],[i],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[new Tt.TextNode("\u203e")]);r.setAttribute("stretchy","true");var n=new Tt.MathNode("munder",[Rt(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler:function(e,t){return{type:"vcenter",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=t.fontMetrics().axisHeight,a=.5*(r.height-n-(r.depth+n));return Ke.makeVList({positionType:"shift",positionData:a,children:[{type:"elem",elem:r}]},t)},mathmlBuilder:function(e,t){return new Tt.MathNode("mpadded",[Rt(e.body,t)],["vcenter"])}}),ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(e,t,r){throw new n("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(e,t){for(var r=Nn(e),n=[],a=t.havingStyle(t.style.text()),i=0;i0;)this.endGroup()},t.has=function(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)},t.get=function(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]},t.set=function(e,t,r){if(void 0===r&&(r=!1),r){for(var n=0;n0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t},e}(),Vn=Vr;Pr("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),Pr("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),Pr("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),Pr("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),Pr("\\@ifnextchar",(function(e){var t=e.consumeArgs(3);e.consumeSpaces();var r=e.future();return 1===t[0].length&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),Pr("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Pr("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var Pn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Pr("\\char",(function(e){var t,r=e.popToken(),a="";if("'"===r.text)t=8,r=e.popToken();else if('"'===r.text)t=16,r=e.popToken();else if("`"===r.text)if("\\"===(r=e.popToken()).text[0])a=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new n("\\char` missing argument");a=r.text.charCodeAt(0)}else t=10;if(t){if(null==(a=Pn[r.text])||a>=t)throw new n("Invalid base-"+t+" digit "+r.text);for(var i;null!=(i=Pn[e.future().text])&&i":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Pr("\\dots",(function(e){var t="\\dotso",r=e.expandAfterFuture().text;return r in Gn?t=Gn[r]:("\\not"===r.slice(0,4)||r in ae.math&&l.contains(["bin","rel"],ae.math[r].group))&&(t="\\dotsb"),t}));var Un={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Pr("\\dotso",(function(e){return e.future().text in Un?"\\ldots\\,":"\\ldots"})),Pr("\\dotsc",(function(e){var t=e.future().text;return t in Un&&","!==t?"\\ldots\\,":"\\ldots"})),Pr("\\cdots",(function(e){return e.future().text in Un?"\\@cdots\\,":"\\@cdots"})),Pr("\\dotsb","\\cdots"),Pr("\\dotsm","\\cdots"),Pr("\\dotsi","\\!\\cdots"),Pr("\\dotsx","\\ldots\\,"),Pr("\\DOTSI","\\relax"),Pr("\\DOTSB","\\relax"),Pr("\\DOTSX","\\relax"),Pr("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Pr("\\,","\\tmspace+{3mu}{.1667em}"),Pr("\\thinspace","\\,"),Pr("\\>","\\mskip{4mu}"),Pr("\\:","\\tmspace+{4mu}{.2222em}"),Pr("\\medspace","\\:"),Pr("\\;","\\tmspace+{5mu}{.2777em}"),Pr("\\thickspace","\\;"),Pr("\\!","\\tmspace-{3mu}{.1667em}"),Pr("\\negthinspace","\\!"),Pr("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Pr("\\negthickspace","\\tmspace-{5mu}{.277em}"),Pr("\\enspace","\\kern.5em "),Pr("\\enskip","\\hskip.5em\\relax"),Pr("\\quad","\\hskip1em\\relax"),Pr("\\qquad","\\hskip2em\\relax"),Pr("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Pr("\\tag@paren","\\tag@literal{({#1})}"),Pr("\\tag@literal",(function(e){if(e.macros.get("\\df@tag"))throw new n("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),Pr("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Pr("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Pr("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Pr("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Pr("\\newline","\\\\\\relax"),Pr("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Yn=F(T["Main-Regular"]["T".charCodeAt(0)][1]-.7*T["Main-Regular"]["A".charCodeAt(0)][1]);Pr("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Yn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Pr("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Yn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Pr("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Pr("\\@hspace","\\hskip #1\\relax"),Pr("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Pr("\\ordinarycolon",":"),Pr("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Pr("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Pr("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Pr("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Pr("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Pr("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Pr("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Pr("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Pr("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Pr("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Pr("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Pr("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Pr("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Pr("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Pr("\u2237","\\dblcolon"),Pr("\u2239","\\eqcolon"),Pr("\u2254","\\coloneqq"),Pr("\u2255","\\eqqcolon"),Pr("\u2a74","\\Coloneqq"),Pr("\\ratio","\\vcentcolon"),Pr("\\coloncolon","\\dblcolon"),Pr("\\colonequals","\\coloneqq"),Pr("\\coloncolonequals","\\Coloneqq"),Pr("\\equalscolon","\\eqqcolon"),Pr("\\equalscoloncolon","\\Eqqcolon"),Pr("\\colonminus","\\coloneq"),Pr("\\coloncolonminus","\\Coloneq"),Pr("\\minuscolon","\\eqcolon"),Pr("\\minuscoloncolon","\\Eqcolon"),Pr("\\coloncolonapprox","\\Colonapprox"),Pr("\\coloncolonsim","\\Colonsim"),Pr("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Pr("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Pr("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Pr("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Pr("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220c}}"),Pr("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Pr("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Pr("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Pr("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Pr("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Pr("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Pr("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Pr("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Pr("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),Pr("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),Pr("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),Pr("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),Pr("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),Pr("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),Pr("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),Pr("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),Pr("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),Pr("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),Pr("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228a}"),Pr("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2acb}"),Pr("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228b}"),Pr("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2acc}"),Pr("\\imath","\\html@mathml{\\@imath}{\u0131}"),Pr("\\jmath","\\html@mathml{\\@jmath}{\u0237}"),Pr("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27e6}}"),Pr("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27e7}}"),Pr("\u27e6","\\llbracket"),Pr("\u27e7","\\rrbracket"),Pr("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),Pr("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),Pr("\u2983","\\lBrace"),Pr("\u2984","\\rBrace"),Pr("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29b5}}"),Pr("\u29b5","\\minuso"),Pr("\\darr","\\downarrow"),Pr("\\dArr","\\Downarrow"),Pr("\\Darr","\\Downarrow"),Pr("\\lang","\\langle"),Pr("\\rang","\\rangle"),Pr("\\uarr","\\uparrow"),Pr("\\uArr","\\Uparrow"),Pr("\\Uarr","\\Uparrow"),Pr("\\N","\\mathbb{N}"),Pr("\\R","\\mathbb{R}"),Pr("\\Z","\\mathbb{Z}"),Pr("\\alef","\\aleph"),Pr("\\alefsym","\\aleph"),Pr("\\Alpha","\\mathrm{A}"),Pr("\\Beta","\\mathrm{B}"),Pr("\\bull","\\bullet"),Pr("\\Chi","\\mathrm{X}"),Pr("\\clubs","\\clubsuit"),Pr("\\cnums","\\mathbb{C}"),Pr("\\Complex","\\mathbb{C}"),Pr("\\Dagger","\\ddagger"),Pr("\\diamonds","\\diamondsuit"),Pr("\\empty","\\emptyset"),Pr("\\Epsilon","\\mathrm{E}"),Pr("\\Eta","\\mathrm{H}"),Pr("\\exist","\\exists"),Pr("\\harr","\\leftrightarrow"),Pr("\\hArr","\\Leftrightarrow"),Pr("\\Harr","\\Leftrightarrow"),Pr("\\hearts","\\heartsuit"),Pr("\\image","\\Im"),Pr("\\infin","\\infty"),Pr("\\Iota","\\mathrm{I}"),Pr("\\isin","\\in"),Pr("\\Kappa","\\mathrm{K}"),Pr("\\larr","\\leftarrow"),Pr("\\lArr","\\Leftarrow"),Pr("\\Larr","\\Leftarrow"),Pr("\\lrarr","\\leftrightarrow"),Pr("\\lrArr","\\Leftrightarrow"),Pr("\\Lrarr","\\Leftrightarrow"),Pr("\\Mu","\\mathrm{M}"),Pr("\\natnums","\\mathbb{N}"),Pr("\\Nu","\\mathrm{N}"),Pr("\\Omicron","\\mathrm{O}"),Pr("\\plusmn","\\pm"),Pr("\\rarr","\\rightarrow"),Pr("\\rArr","\\Rightarrow"),Pr("\\Rarr","\\Rightarrow"),Pr("\\real","\\Re"),Pr("\\reals","\\mathbb{R}"),Pr("\\Reals","\\mathbb{R}"),Pr("\\Rho","\\mathrm{P}"),Pr("\\sdot","\\cdot"),Pr("\\sect","\\S"),Pr("\\spades","\\spadesuit"),Pr("\\sub","\\subset"),Pr("\\sube","\\subseteq"),Pr("\\supe","\\supseteq"),Pr("\\Tau","\\mathrm{T}"),Pr("\\thetasym","\\vartheta"),Pr("\\weierp","\\wp"),Pr("\\Zeta","\\mathrm{Z}"),Pr("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Pr("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Pr("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Pr("\\bra","\\mathinner{\\langle{#1}|}"),Pr("\\ket","\\mathinner{|{#1}\\rangle}"),Pr("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Pr("\\Bra","\\left\\langle#1\\right|"),Pr("\\Ket","\\left|#1\\right\\rangle");var Xn=function(e){return function(t){var r=t.consumeArg().tokens,n=t.consumeArg().tokens,a=t.consumeArg().tokens,i=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=function(t){return function(r){e&&(r.macros.set("|",o),a.length&&r.macros.set("\\|",s));var i=t;!t&&a.length&&("|"===r.future().text&&(r.popToken(),i=!0));return{tokens:i?a:n,numArgs:0}}};t.macros.set("|",l(!1)),a.length&&t.macros.set("\\|",l(!0));var h=t.consumeArg().tokens,c=t.expandTokens([].concat(i,h,r));return t.macros.endGroup(),{tokens:c.reverse(),numArgs:0}}};Pr("\\bra@ket",Xn(!1)),Pr("\\bra@set",Xn(!0)),Pr("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Pr("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Pr("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Pr("\\angln","{\\angl n}"),Pr("\\blue","\\textcolor{##6495ed}{#1}"),Pr("\\orange","\\textcolor{##ffa500}{#1}"),Pr("\\pink","\\textcolor{##ff00af}{#1}"),Pr("\\red","\\textcolor{##df0030}{#1}"),Pr("\\green","\\textcolor{##28ae7b}{#1}"),Pr("\\gray","\\textcolor{gray}{#1}"),Pr("\\purple","\\textcolor{##9d38bd}{#1}"),Pr("\\blueA","\\textcolor{##ccfaff}{#1}"),Pr("\\blueB","\\textcolor{##80f6ff}{#1}"),Pr("\\blueC","\\textcolor{##63d9ea}{#1}"),Pr("\\blueD","\\textcolor{##11accd}{#1}"),Pr("\\blueE","\\textcolor{##0c7f99}{#1}"),Pr("\\tealA","\\textcolor{##94fff5}{#1}"),Pr("\\tealB","\\textcolor{##26edd5}{#1}"),Pr("\\tealC","\\textcolor{##01d1c1}{#1}"),Pr("\\tealD","\\textcolor{##01a995}{#1}"),Pr("\\tealE","\\textcolor{##208170}{#1}"),Pr("\\greenA","\\textcolor{##b6ffb0}{#1}"),Pr("\\greenB","\\textcolor{##8af281}{#1}"),Pr("\\greenC","\\textcolor{##74cf70}{#1}"),Pr("\\greenD","\\textcolor{##1fab54}{#1}"),Pr("\\greenE","\\textcolor{##0d923f}{#1}"),Pr("\\goldA","\\textcolor{##ffd0a9}{#1}"),Pr("\\goldB","\\textcolor{##ffbb71}{#1}"),Pr("\\goldC","\\textcolor{##ff9c39}{#1}"),Pr("\\goldD","\\textcolor{##e07d10}{#1}"),Pr("\\goldE","\\textcolor{##a75a05}{#1}"),Pr("\\redA","\\textcolor{##fca9a9}{#1}"),Pr("\\redB","\\textcolor{##ff8482}{#1}"),Pr("\\redC","\\textcolor{##f9685d}{#1}"),Pr("\\redD","\\textcolor{##e84d39}{#1}"),Pr("\\redE","\\textcolor{##bc2612}{#1}"),Pr("\\maroonA","\\textcolor{##ffbde0}{#1}"),Pr("\\maroonB","\\textcolor{##ff92c6}{#1}"),Pr("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Pr("\\maroonD","\\textcolor{##ca337c}{#1}"),Pr("\\maroonE","\\textcolor{##9e034e}{#1}"),Pr("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Pr("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Pr("\\purpleC","\\textcolor{##aa87ff}{#1}"),Pr("\\purpleD","\\textcolor{##7854ab}{#1}"),Pr("\\purpleE","\\textcolor{##543b78}{#1}"),Pr("\\mintA","\\textcolor{##f5f9e8}{#1}"),Pr("\\mintB","\\textcolor{##edf2df}{#1}"),Pr("\\mintC","\\textcolor{##e0e5cc}{#1}"),Pr("\\grayA","\\textcolor{##f6f7f7}{#1}"),Pr("\\grayB","\\textcolor{##f0f1f2}{#1}"),Pr("\\grayC","\\textcolor{##e3e5e6}{#1}"),Pr("\\grayD","\\textcolor{##d6d8da}{#1}"),Pr("\\grayE","\\textcolor{##babec2}{#1}"),Pr("\\grayF","\\textcolor{##888d93}{#1}"),Pr("\\grayG","\\textcolor{##626569}{#1}"),Pr("\\grayH","\\textcolor{##3b3e40}{#1}"),Pr("\\grayI","\\textcolor{##21242c}{#1}"),Pr("\\kaBlue","\\textcolor{##314453}{#1}"),Pr("\\kaGreen","\\textcolor{##71B307}{#1}");var Wn={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},_n=function(){function e(e,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Dn(Vn,t.macros),this.mode=r,this.stack=[]}var t=e.prototype;return t.feed=function(e){this.lexer=new Ln(e,this.settings)},t.switchMode=function(e){this.mode=e},t.beginGroup=function(){this.macros.beginGroup()},t.endGroup=function(){this.macros.endGroup()},t.endGroups=function(){this.macros.endGroups()},t.future=function(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},t.popToken=function(){return this.future(),this.stack.pop()},t.pushToken=function(e){this.stack.push(e)},t.pushTokens=function(e){var t;(t=this.stack).push.apply(t,e)},t.scanArgument=function(e){var t,r,n;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken();var a=this.consumeArg(["]"]);n=a.tokens,r=a.end}else{var i=this.consumeArg();n=i.tokens,t=i.start,r=i.end}return this.pushToken(new Gr("EOF",r.loc)),this.pushTokens(n),t.range(r,"")},t.consumeSpaces=function(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}},t.consumeArg=function(e){var t=[],r=e&&e.length>0;r||this.consumeSpaces();var a,i=this.future(),o=0,s=0;do{if(a=this.popToken(),t.push(a),"{"===a.text)++o;else if("}"===a.text){if(-1===--o)throw new n("Extra }",a)}else if("EOF"===a.text)throw new n("Unexpected end of input in a macro argument, expected '"+(e&&r?e[s]:"}")+"'",a);if(e&&r)if((0===o||1===o&&"{"===e[s])&&a.text===e[s]){if(++s===e.length){t.splice(-s,s);break}}else s=0}while(0!==o||r);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:a}},t.consumeArgs=function(e,t){if(t){if(t.length!==e+1)throw new n("The length of delimiters doesn't match the number of args!");for(var r=t[0],a=0;athis.settings.maxExpand)throw new n("Too many expansions: infinite loop or need to increase maxExpand setting");var i=a.tokens,o=this.consumeArgs(a.numArgs,a.delimiters);if(a.numArgs)for(var s=(i=i.slice()).length-1;s>=0;--s){var l=i[s];if("#"===l.text){if(0===s)throw new n("Incomplete placeholder at end of macro body",l);if("#"===(l=i[--s]).text)i.splice(s+1,1);else{if(!/^[1-9]$/.test(l.text))throw new n("Not a valid argument number",l);var h;(h=i).splice.apply(h,[s,2].concat(o[+l.text-1]))}}}return this.pushTokens(i),i.length},t.expandAfterFuture=function(){return this.expandOnce(),this.future()},t.expandNextToken=function(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error},t.expandMacro=function(e){return this.macros.has(e)?this.expandTokens([new Gr(e)]):void 0},t.expandTokens=function(e){var t=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(!1===this.expandOnce(!0)){var n=this.stack.pop();n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),t.push(n)}return t},t.expandMacroAsText=function(e){var t=this.expandMacro(e);return t?t.map((function(e){return e.text})).join(""):t},t._getExpansion=function(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var r=this.lexer.catcodes[e];if(null!=r&&13!==r)return}var n="function"==typeof t?t(this):t;if("string"==typeof n){var a=0;if(-1!==n.indexOf("#"))for(var i=n.replace(/##/g,"");-1!==i.indexOf("#"+(a+1));)++a;for(var o=new Ln(n,this.settings),s=[],l=o.lex();"EOF"!==l.text;)s.push(l),l=o.lex();return s.reverse(),{tokens:s,numArgs:a}}return n},t.isDefined=function(e){return this.macros.has(e)||qn.hasOwnProperty(e)||ae.math.hasOwnProperty(e)||ae.text.hasOwnProperty(e)||Wn.hasOwnProperty(e)},t.isExpandable=function(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:qn.hasOwnProperty(e)&&!qn[e].primitive},e}(),jn=/^[\u208a\u208b\u208c\u208d\u208e\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u2090\u2091\u2095\u1d62\u2c7c\u2096\u2097\u2098\u2099\u2092\u209a\u1d63\u209b\u209c\u1d64\u1d65\u2093\u1d66\u1d67\u1d68\u1d69\u1d6a]/,$n=Object.freeze({"\u208a":"+","\u208b":"-","\u208c":"=","\u208d":"(","\u208e":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1d62":"i","\u2c7c":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209a":"p","\u1d63":"r","\u209b":"s","\u209c":"t","\u1d64":"u","\u1d65":"v","\u2093":"x","\u1d66":"\u03b2","\u1d67":"\u03b3","\u1d68":"\u03c1","\u1d69":"\u03d5","\u1d6a":"\u03c7","\u207a":"+","\u207b":"-","\u207c":"=","\u207d":"(","\u207e":")","\u2070":"0","\xb9":"1","\xb2":"2","\xb3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1d2c":"A","\u1d2e":"B","\u1d30":"D","\u1d31":"E","\u1d33":"G","\u1d34":"H","\u1d35":"I","\u1d36":"J","\u1d37":"K","\u1d38":"L","\u1d39":"M","\u1d3a":"N","\u1d3c":"O","\u1d3e":"P","\u1d3f":"R","\u1d40":"T","\u1d41":"U","\u2c7d":"V","\u1d42":"W","\u1d43":"a","\u1d47":"b","\u1d9c":"c","\u1d48":"d","\u1d49":"e","\u1da0":"f","\u1d4d":"g","\u02b0":"h","\u2071":"i","\u02b2":"j","\u1d4f":"k","\u02e1":"l","\u1d50":"m","\u207f":"n","\u1d52":"o","\u1d56":"p","\u02b3":"r","\u02e2":"s","\u1d57":"t","\u1d58":"u","\u1d5b":"v","\u02b7":"w","\u02e3":"x","\u02b8":"y","\u1dbb":"z","\u1d5d":"\u03b2","\u1d5e":"\u03b3","\u1d5f":"\u03b4","\u1d60":"\u03d5","\u1d61":"\u03c7","\u1dbf":"\u03b8"}),Zn={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030c":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030a":{text:"\\r",math:"\\mathring"},"\u030b":{text:"\\H"},"\u0327":{text:"\\c"}},Kn={"\xe1":"a\u0301","\xe0":"a\u0300","\xe4":"a\u0308","\u01df":"a\u0308\u0304","\xe3":"a\u0303","\u0101":"a\u0304","\u0103":"a\u0306","\u1eaf":"a\u0306\u0301","\u1eb1":"a\u0306\u0300","\u1eb5":"a\u0306\u0303","\u01ce":"a\u030c","\xe2":"a\u0302","\u1ea5":"a\u0302\u0301","\u1ea7":"a\u0302\u0300","\u1eab":"a\u0302\u0303","\u0227":"a\u0307","\u01e1":"a\u0307\u0304","\xe5":"a\u030a","\u01fb":"a\u030a\u0301","\u1e03":"b\u0307","\u0107":"c\u0301","\u1e09":"c\u0327\u0301","\u010d":"c\u030c","\u0109":"c\u0302","\u010b":"c\u0307","\xe7":"c\u0327","\u010f":"d\u030c","\u1e0b":"d\u0307","\u1e11":"d\u0327","\xe9":"e\u0301","\xe8":"e\u0300","\xeb":"e\u0308","\u1ebd":"e\u0303","\u0113":"e\u0304","\u1e17":"e\u0304\u0301","\u1e15":"e\u0304\u0300","\u0115":"e\u0306","\u1e1d":"e\u0327\u0306","\u011b":"e\u030c","\xea":"e\u0302","\u1ebf":"e\u0302\u0301","\u1ec1":"e\u0302\u0300","\u1ec5":"e\u0302\u0303","\u0117":"e\u0307","\u0229":"e\u0327","\u1e1f":"f\u0307","\u01f5":"g\u0301","\u1e21":"g\u0304","\u011f":"g\u0306","\u01e7":"g\u030c","\u011d":"g\u0302","\u0121":"g\u0307","\u0123":"g\u0327","\u1e27":"h\u0308","\u021f":"h\u030c","\u0125":"h\u0302","\u1e23":"h\u0307","\u1e29":"h\u0327","\xed":"i\u0301","\xec":"i\u0300","\xef":"i\u0308","\u1e2f":"i\u0308\u0301","\u0129":"i\u0303","\u012b":"i\u0304","\u012d":"i\u0306","\u01d0":"i\u030c","\xee":"i\u0302","\u01f0":"j\u030c","\u0135":"j\u0302","\u1e31":"k\u0301","\u01e9":"k\u030c","\u0137":"k\u0327","\u013a":"l\u0301","\u013e":"l\u030c","\u013c":"l\u0327","\u1e3f":"m\u0301","\u1e41":"m\u0307","\u0144":"n\u0301","\u01f9":"n\u0300","\xf1":"n\u0303","\u0148":"n\u030c","\u1e45":"n\u0307","\u0146":"n\u0327","\xf3":"o\u0301","\xf2":"o\u0300","\xf6":"o\u0308","\u022b":"o\u0308\u0304","\xf5":"o\u0303","\u1e4d":"o\u0303\u0301","\u1e4f":"o\u0303\u0308","\u022d":"o\u0303\u0304","\u014d":"o\u0304","\u1e53":"o\u0304\u0301","\u1e51":"o\u0304\u0300","\u014f":"o\u0306","\u01d2":"o\u030c","\xf4":"o\u0302","\u1ed1":"o\u0302\u0301","\u1ed3":"o\u0302\u0300","\u1ed7":"o\u0302\u0303","\u022f":"o\u0307","\u0231":"o\u0307\u0304","\u0151":"o\u030b","\u1e55":"p\u0301","\u1e57":"p\u0307","\u0155":"r\u0301","\u0159":"r\u030c","\u1e59":"r\u0307","\u0157":"r\u0327","\u015b":"s\u0301","\u1e65":"s\u0301\u0307","\u0161":"s\u030c","\u1e67":"s\u030c\u0307","\u015d":"s\u0302","\u1e61":"s\u0307","\u015f":"s\u0327","\u1e97":"t\u0308","\u0165":"t\u030c","\u1e6b":"t\u0307","\u0163":"t\u0327","\xfa":"u\u0301","\xf9":"u\u0300","\xfc":"u\u0308","\u01d8":"u\u0308\u0301","\u01dc":"u\u0308\u0300","\u01d6":"u\u0308\u0304","\u01da":"u\u0308\u030c","\u0169":"u\u0303","\u1e79":"u\u0303\u0301","\u016b":"u\u0304","\u1e7b":"u\u0304\u0308","\u016d":"u\u0306","\u01d4":"u\u030c","\xfb":"u\u0302","\u016f":"u\u030a","\u0171":"u\u030b","\u1e7d":"v\u0303","\u1e83":"w\u0301","\u1e81":"w\u0300","\u1e85":"w\u0308","\u0175":"w\u0302","\u1e87":"w\u0307","\u1e98":"w\u030a","\u1e8d":"x\u0308","\u1e8b":"x\u0307","\xfd":"y\u0301","\u1ef3":"y\u0300","\xff":"y\u0308","\u1ef9":"y\u0303","\u0233":"y\u0304","\u0177":"y\u0302","\u1e8f":"y\u0307","\u1e99":"y\u030a","\u017a":"z\u0301","\u017e":"z\u030c","\u1e91":"z\u0302","\u017c":"z\u0307","\xc1":"A\u0301","\xc0":"A\u0300","\xc4":"A\u0308","\u01de":"A\u0308\u0304","\xc3":"A\u0303","\u0100":"A\u0304","\u0102":"A\u0306","\u1eae":"A\u0306\u0301","\u1eb0":"A\u0306\u0300","\u1eb4":"A\u0306\u0303","\u01cd":"A\u030c","\xc2":"A\u0302","\u1ea4":"A\u0302\u0301","\u1ea6":"A\u0302\u0300","\u1eaa":"A\u0302\u0303","\u0226":"A\u0307","\u01e0":"A\u0307\u0304","\xc5":"A\u030a","\u01fa":"A\u030a\u0301","\u1e02":"B\u0307","\u0106":"C\u0301","\u1e08":"C\u0327\u0301","\u010c":"C\u030c","\u0108":"C\u0302","\u010a":"C\u0307","\xc7":"C\u0327","\u010e":"D\u030c","\u1e0a":"D\u0307","\u1e10":"D\u0327","\xc9":"E\u0301","\xc8":"E\u0300","\xcb":"E\u0308","\u1ebc":"E\u0303","\u0112":"E\u0304","\u1e16":"E\u0304\u0301","\u1e14":"E\u0304\u0300","\u0114":"E\u0306","\u1e1c":"E\u0327\u0306","\u011a":"E\u030c","\xca":"E\u0302","\u1ebe":"E\u0302\u0301","\u1ec0":"E\u0302\u0300","\u1ec4":"E\u0302\u0303","\u0116":"E\u0307","\u0228":"E\u0327","\u1e1e":"F\u0307","\u01f4":"G\u0301","\u1e20":"G\u0304","\u011e":"G\u0306","\u01e6":"G\u030c","\u011c":"G\u0302","\u0120":"G\u0307","\u0122":"G\u0327","\u1e26":"H\u0308","\u021e":"H\u030c","\u0124":"H\u0302","\u1e22":"H\u0307","\u1e28":"H\u0327","\xcd":"I\u0301","\xcc":"I\u0300","\xcf":"I\u0308","\u1e2e":"I\u0308\u0301","\u0128":"I\u0303","\u012a":"I\u0304","\u012c":"I\u0306","\u01cf":"I\u030c","\xce":"I\u0302","\u0130":"I\u0307","\u0134":"J\u0302","\u1e30":"K\u0301","\u01e8":"K\u030c","\u0136":"K\u0327","\u0139":"L\u0301","\u013d":"L\u030c","\u013b":"L\u0327","\u1e3e":"M\u0301","\u1e40":"M\u0307","\u0143":"N\u0301","\u01f8":"N\u0300","\xd1":"N\u0303","\u0147":"N\u030c","\u1e44":"N\u0307","\u0145":"N\u0327","\xd3":"O\u0301","\xd2":"O\u0300","\xd6":"O\u0308","\u022a":"O\u0308\u0304","\xd5":"O\u0303","\u1e4c":"O\u0303\u0301","\u1e4e":"O\u0303\u0308","\u022c":"O\u0303\u0304","\u014c":"O\u0304","\u1e52":"O\u0304\u0301","\u1e50":"O\u0304\u0300","\u014e":"O\u0306","\u01d1":"O\u030c","\xd4":"O\u0302","\u1ed0":"O\u0302\u0301","\u1ed2":"O\u0302\u0300","\u1ed6":"O\u0302\u0303","\u022e":"O\u0307","\u0230":"O\u0307\u0304","\u0150":"O\u030b","\u1e54":"P\u0301","\u1e56":"P\u0307","\u0154":"R\u0301","\u0158":"R\u030c","\u1e58":"R\u0307","\u0156":"R\u0327","\u015a":"S\u0301","\u1e64":"S\u0301\u0307","\u0160":"S\u030c","\u1e66":"S\u030c\u0307","\u015c":"S\u0302","\u1e60":"S\u0307","\u015e":"S\u0327","\u0164":"T\u030c","\u1e6a":"T\u0307","\u0162":"T\u0327","\xda":"U\u0301","\xd9":"U\u0300","\xdc":"U\u0308","\u01d7":"U\u0308\u0301","\u01db":"U\u0308\u0300","\u01d5":"U\u0308\u0304","\u01d9":"U\u0308\u030c","\u0168":"U\u0303","\u1e78":"U\u0303\u0301","\u016a":"U\u0304","\u1e7a":"U\u0304\u0308","\u016c":"U\u0306","\u01d3":"U\u030c","\xdb":"U\u0302","\u016e":"U\u030a","\u0170":"U\u030b","\u1e7c":"V\u0303","\u1e82":"W\u0301","\u1e80":"W\u0300","\u1e84":"W\u0308","\u0174":"W\u0302","\u1e86":"W\u0307","\u1e8c":"X\u0308","\u1e8a":"X\u0307","\xdd":"Y\u0301","\u1ef2":"Y\u0300","\u0178":"Y\u0308","\u1ef8":"Y\u0303","\u0232":"Y\u0304","\u0176":"Y\u0302","\u1e8e":"Y\u0307","\u0179":"Z\u0301","\u017d":"Z\u030c","\u1e90":"Z\u0302","\u017b":"Z\u0307","\u03ac":"\u03b1\u0301","\u1f70":"\u03b1\u0300","\u1fb1":"\u03b1\u0304","\u1fb0":"\u03b1\u0306","\u03ad":"\u03b5\u0301","\u1f72":"\u03b5\u0300","\u03ae":"\u03b7\u0301","\u1f74":"\u03b7\u0300","\u03af":"\u03b9\u0301","\u1f76":"\u03b9\u0300","\u03ca":"\u03b9\u0308","\u0390":"\u03b9\u0308\u0301","\u1fd2":"\u03b9\u0308\u0300","\u1fd1":"\u03b9\u0304","\u1fd0":"\u03b9\u0306","\u03cc":"\u03bf\u0301","\u1f78":"\u03bf\u0300","\u03cd":"\u03c5\u0301","\u1f7a":"\u03c5\u0300","\u03cb":"\u03c5\u0308","\u03b0":"\u03c5\u0308\u0301","\u1fe2":"\u03c5\u0308\u0300","\u1fe1":"\u03c5\u0304","\u1fe0":"\u03c5\u0306","\u03ce":"\u03c9\u0301","\u1f7c":"\u03c9\u0300","\u038e":"\u03a5\u0301","\u1fea":"\u03a5\u0300","\u03ab":"\u03a5\u0308","\u1fe9":"\u03a5\u0304","\u1fe8":"\u03a5\u0306","\u038f":"\u03a9\u0301","\u1ffa":"\u03a9\u0300"},Jn=function(){function e(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new _n(e,t,this.mode),this.settings=t,this.leftrightDepth=0}var t=e.prototype;return t.expect=function(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new n("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()},t.consume=function(){this.nextToken=null},t.fetch=function(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},t.switchMode=function(e){this.mode=e,this.gullet.switchMode(e)},t.parse=function(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}},t.subparse=function(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Gr("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r},t.parseExpression=function(t,r){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var a=this.fetch();if(-1!==e.endOfExpression.indexOf(a.text))break;if(r&&a.text===r)break;if(t&&qn[a.text]&&qn[a.text].infix)break;var i=this.parseAtom(r);if(!i)break;"internal"!==i.type&&n.push(i)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)},t.handleInfixNodes=function(e){for(var t,r=-1,a=0;a=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var s,l=ae[this.mode][t].group,h=Fr.range(e);if(te.hasOwnProperty(l)){var c=l;s={type:"atom",mode:this.mode,family:c,loc:h,text:t}}else s={type:l,mode:this.mode,loc:h,text:t};i=s}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(S(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),i={type:"textord",mode:"text",loc:Fr.range(e),text:t}}if(this.consume(),o)for(var m=0;m15?"\u2026"+e.slice(n-15,n):e.slice(0,n),a=o+15":">","<":"<",'"':""","'":"'"},i=/[&><"']/g;const a=function(e){return"ordgroup"===e.type||"color"===e.type?1===e.body.length?a(e.body[0]):e:"font"===e.type?a(e.body):e};var l={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(i,(e=>s[e]))},hyphenate:function(e){return e.replace(o,"-$1").toLowerCase()},getBaseElem:a,isCharacterBox:function(e){const t=a(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){const t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}};const h={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function c(e){if(e.default)return e.default;const t=e.type,r=Array.isArray(t)?t[0]:t;if("string"!=typeof r)return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class m{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(const t in h)if(h.hasOwnProperty(t)){const r=h[t];this[t]=void 0!==e[t]?r.processor?r.processor(e[t]):e[t]:c(r)}}reportNonstrict(e,t,r){let o=this.strict;if("function"==typeof o&&(o=o(e,t,r)),o&&"ignore"!==o){if(!0===o||"error"===o)throw new n("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",r);"warn"===o?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+o+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,r){let n=this.strict;if("function"==typeof n)try{n=n(e,t,r)}catch(e){n="error"}return!(!n||"ignore"===n)&&(!0===n||"error"===n||("warn"===n?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if(e.url&&!e.protocol){const t=l.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}const t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class p{constructor(e,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=r}sup(){return u[d[this.id]]}sub(){return u[g[this.id]]}fracNum(){return u[f[this.id]]}fracDen(){return u[b[this.id]]}cramp(){return u[y[this.id]]}text(){return u[x[this.id]]}isTight(){return this.size>=2}}const u=[new p(0,0,!1),new p(1,0,!0),new p(2,1,!1),new p(3,1,!0),new p(4,2,!1),new p(5,2,!0),new p(6,3,!1),new p(7,3,!0)],d=[4,5,4,5,6,7,6,7],g=[5,5,5,5,7,7,7,7],f=[2,3,4,5,6,7,6,7],b=[3,3,5,5,7,7,7,7],y=[1,1,3,3,5,5,7,7],x=[0,1,2,3,2,3,2,3];var w={DISPLAY:u[0],TEXT:u[2],SCRIPT:u[4],SCRIPTSCRIPT:u[6]};const v=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];const k=[];function S(e){for(let t=0;t=k[t]&&e<=k[t+1])return!0;return!1}v.forEach((e=>e.blocks.forEach((e=>k.push(...e)))));const M=80,z={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class A{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return l.contains(this.classes,e)}toNode(){const e=document.createDocumentFragment();for(let t=0;te.toText())).join("")}}var T={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}};const B={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},C={"\xc5":"A","\xd0":"D","\xde":"o","\xe5":"a","\xf0":"d","\xfe":"o","\u0410":"A","\u0411":"B","\u0412":"B","\u0413":"F","\u0414":"A","\u0415":"E","\u0416":"K","\u0417":"3","\u0418":"N","\u0419":"N","\u041a":"K","\u041b":"N","\u041c":"M","\u041d":"H","\u041e":"O","\u041f":"N","\u0420":"P","\u0421":"C","\u0422":"T","\u0423":"y","\u0424":"O","\u0425":"X","\u0426":"U","\u0427":"h","\u0428":"W","\u0429":"W","\u042a":"B","\u042b":"X","\u042c":"B","\u042d":"3","\u042e":"X","\u042f":"R","\u0430":"a","\u0431":"b","\u0432":"a","\u0433":"r","\u0434":"y","\u0435":"e","\u0436":"m","\u0437":"e","\u0438":"n","\u0439":"n","\u043a":"n","\u043b":"n","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"n","\u0440":"p","\u0441":"c","\u0442":"o","\u0443":"y","\u0444":"b","\u0445":"x","\u0446":"n","\u0447":"n","\u0448":"w","\u0449":"w","\u044a":"a","\u044b":"m","\u044c":"a","\u044d":"e","\u044e":"m","\u044f":"r"};function N(e,t,r){if(!T[t])throw new Error("Font metrics not found for font: "+t+".");let n=e.charCodeAt(0),o=T[t][n];if(!o&&e[0]in C&&(n=C[e[0]].charCodeAt(0),o=T[t][n]),o||"text"!==r||S(n)&&(o=T[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}const q={};const I=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],R=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],H=function(e,t){return t.size<2?e:I[e-1][t.size-1]};class O{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||O.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=R[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){const t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return new O(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:H(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:R[e-1]})}havingBaseStyle(e){e=e||this.style.text();const t=H(O.BASESIZE,e);return this.size===t&&this.textSize===O.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){let e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==O.BASESIZE?["sizing","reset-size"+this.size,"size"+O.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){let t;if(t=e>=5?0:e>=3?1:2,!q[t]){const e=q[t]={cssEmPerMu:B.quad[t]/18};for(const r in B)B.hasOwnProperty(r)&&(e[r]=B[r][t])}return q[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}O.BASESIZE=6;var E=O;const L={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},D={ex:!0,em:!0,mu:!0},V=function(e){return"string"!=typeof e&&(e=e.unit),e in L||e in D||"ex"===e},P=function(e,t){let r;if(e.unit in L)r=L[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)r=t.fontMetrics().cssEmPerMu;else{let o;if(o=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)r=o.fontMetrics().xHeight;else{if("em"!==e.unit)throw new n("Invalid unit: '"+e.unit+"'");r=o.fontMetrics().quad}o!==t&&(r*=o.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*r,t.maxSize)},F=function(e){return+e.toFixed(4)+"em"},G=function(e){return e.filter((e=>e)).join(" ")},U=function(e,t,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");const e=t.getColor();e&&(this.style.color=e)}},Y=function(e){const t=document.createElement(e);t.className=G(this.classes);for(const e in this.style)this.style.hasOwnProperty(e)&&(t.style[e]=this.style[e]);for(const e in this.attributes)this.attributes.hasOwnProperty(e)&&t.setAttribute(e,this.attributes[e]);for(let e=0;e",t};class W{constructor(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,U.call(this,e,r,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return l.contains(this.classes,e)}toNode(){return Y.call(this,"span")}toMarkup(){return X.call(this,"span")}}class _{constructor(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,U.call(this,t,n),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return l.contains(this.classes,e)}toNode(){return Y.call(this,"a")}toMarkup(){return X.call(this,"a")}}class j{constructor(e,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=r}hasClass(e){return l.contains(this.classes,e)}toNode(){const e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(const t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){let e=''+l.escape(this.alt)+'=n[0]&&e<=n[1])return r.name}}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[\xee\xef\xed\xec]/.test(this.text)&&(this.text=$[this.text])}hasClass(e){return l.contains(this.classes,e)}toNode(){const e=document.createTextNode(this.text);let t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=F(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=G(this.classes));for(const e in this.style)this.style.hasOwnProperty(e)&&(t=t||document.createElement("span"),t.style[e]=this.style[e]);return t?(t.appendChild(e),t):e}toMarkup(){let e=!1,t="0&&(r+="margin-right:"+this.italic+"em;");for(const e in this.style)this.style.hasOwnProperty(e)&&(r+=l.hyphenate(e)+":"+this.style[e]+";");r&&(e=!0,t+=' style="'+l.escape(r)+'"');const n=l.escape(this.text);return e?(t+=">",t+=n,t+="",t):n}}class K{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(let t=0;t':''}}class Q{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){const e=document.createElementNS("http://www.w3.org/2000/svg","line");for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){let e="","\\gt",!0),se(ie,le,ye,"\u2208","\\in",!0),se(ie,le,ye,"\ue020","\\@not"),se(ie,le,ye,"\u2282","\\subset",!0),se(ie,le,ye,"\u2283","\\supset",!0),se(ie,le,ye,"\u2286","\\subseteq",!0),se(ie,le,ye,"\u2287","\\supseteq",!0),se(ie,he,ye,"\u2288","\\nsubseteq",!0),se(ie,he,ye,"\u2289","\\nsupseteq",!0),se(ie,le,ye,"\u22a8","\\models"),se(ie,le,ye,"\u2190","\\leftarrow",!0),se(ie,le,ye,"\u2264","\\le"),se(ie,le,ye,"\u2264","\\leq",!0),se(ie,le,ye,"<","\\lt",!0),se(ie,le,ye,"\u2192","\\rightarrow",!0),se(ie,le,ye,"\u2192","\\to"),se(ie,he,ye,"\u2271","\\ngeq",!0),se(ie,he,ye,"\u2270","\\nleq",!0),se(ie,le,xe,"\xa0","\\ "),se(ie,le,xe,"\xa0","\\space"),se(ie,le,xe,"\xa0","\\nobreakspace"),se(ae,le,xe,"\xa0","\\ "),se(ae,le,xe,"\xa0"," "),se(ae,le,xe,"\xa0","\\space"),se(ae,le,xe,"\xa0","\\nobreakspace"),se(ie,le,xe,null,"\\nobreak"),se(ie,le,xe,null,"\\allowbreak"),se(ie,le,be,",",","),se(ie,le,be,";",";"),se(ie,he,me,"\u22bc","\\barwedge",!0),se(ie,he,me,"\u22bb","\\veebar",!0),se(ie,le,me,"\u2299","\\odot",!0),se(ie,le,me,"\u2295","\\oplus",!0),se(ie,le,me,"\u2297","\\otimes",!0),se(ie,le,we,"\u2202","\\partial",!0),se(ie,le,me,"\u2298","\\oslash",!0),se(ie,he,me,"\u229a","\\circledcirc",!0),se(ie,he,me,"\u22a1","\\boxdot",!0),se(ie,le,me,"\u25b3","\\bigtriangleup"),se(ie,le,me,"\u25bd","\\bigtriangledown"),se(ie,le,me,"\u2020","\\dagger"),se(ie,le,me,"\u22c4","\\diamond"),se(ie,le,me,"\u22c6","\\star"),se(ie,le,me,"\u25c3","\\triangleleft"),se(ie,le,me,"\u25b9","\\triangleright"),se(ie,le,fe,"{","\\{"),se(ae,le,we,"{","\\{"),se(ae,le,we,"{","\\textbraceleft"),se(ie,le,pe,"}","\\}"),se(ae,le,we,"}","\\}"),se(ae,le,we,"}","\\textbraceright"),se(ie,le,fe,"{","\\lbrace"),se(ie,le,pe,"}","\\rbrace"),se(ie,le,fe,"[","\\lbrack",!0),se(ae,le,we,"[","\\lbrack",!0),se(ie,le,pe,"]","\\rbrack",!0),se(ae,le,we,"]","\\rbrack",!0),se(ie,le,fe,"(","\\lparen",!0),se(ie,le,pe,")","\\rparen",!0),se(ae,le,we,"<","\\textless",!0),se(ae,le,we,">","\\textgreater",!0),se(ie,le,fe,"\u230a","\\lfloor",!0),se(ie,le,pe,"\u230b","\\rfloor",!0),se(ie,le,fe,"\u2308","\\lceil",!0),se(ie,le,pe,"\u2309","\\rceil",!0),se(ie,le,we,"\\","\\backslash"),se(ie,le,we,"\u2223","|"),se(ie,le,we,"\u2223","\\vert"),se(ae,le,we,"|","\\textbar",!0),se(ie,le,we,"\u2225","\\|"),se(ie,le,we,"\u2225","\\Vert"),se(ae,le,we,"\u2225","\\textbardbl"),se(ae,le,we,"~","\\textasciitilde"),se(ae,le,we,"\\","\\textbackslash"),se(ae,le,we,"^","\\textasciicircum"),se(ie,le,ye,"\u2191","\\uparrow",!0),se(ie,le,ye,"\u21d1","\\Uparrow",!0),se(ie,le,ye,"\u2193","\\downarrow",!0),se(ie,le,ye,"\u21d3","\\Downarrow",!0),se(ie,le,ye,"\u2195","\\updownarrow",!0),se(ie,le,ye,"\u21d5","\\Updownarrow",!0),se(ie,le,ge,"\u2210","\\coprod"),se(ie,le,ge,"\u22c1","\\bigvee"),se(ie,le,ge,"\u22c0","\\bigwedge"),se(ie,le,ge,"\u2a04","\\biguplus"),se(ie,le,ge,"\u22c2","\\bigcap"),se(ie,le,ge,"\u22c3","\\bigcup"),se(ie,le,ge,"\u222b","\\int"),se(ie,le,ge,"\u222b","\\intop"),se(ie,le,ge,"\u222c","\\iint"),se(ie,le,ge,"\u222d","\\iiint"),se(ie,le,ge,"\u220f","\\prod"),se(ie,le,ge,"\u2211","\\sum"),se(ie,le,ge,"\u2a02","\\bigotimes"),se(ie,le,ge,"\u2a01","\\bigoplus"),se(ie,le,ge,"\u2a00","\\bigodot"),se(ie,le,ge,"\u222e","\\oint"),se(ie,le,ge,"\u222f","\\oiint"),se(ie,le,ge,"\u2230","\\oiiint"),se(ie,le,ge,"\u2a06","\\bigsqcup"),se(ie,le,ge,"\u222b","\\smallint"),se(ae,le,ue,"\u2026","\\textellipsis"),se(ie,le,ue,"\u2026","\\mathellipsis"),se(ae,le,ue,"\u2026","\\ldots",!0),se(ie,le,ue,"\u2026","\\ldots",!0),se(ie,le,ue,"\u22ef","\\@cdots",!0),se(ie,le,ue,"\u22f1","\\ddots",!0),se(ie,le,we,"\u22ee","\\varvdots"),se(ie,le,ce,"\u02ca","\\acute"),se(ie,le,ce,"\u02cb","\\grave"),se(ie,le,ce,"\xa8","\\ddot"),se(ie,le,ce,"~","\\tilde"),se(ie,le,ce,"\u02c9","\\bar"),se(ie,le,ce,"\u02d8","\\breve"),se(ie,le,ce,"\u02c7","\\check"),se(ie,le,ce,"^","\\hat"),se(ie,le,ce,"\u20d7","\\vec"),se(ie,le,ce,"\u02d9","\\dot"),se(ie,le,ce,"\u02da","\\mathring"),se(ie,le,de,"\ue131","\\@imath"),se(ie,le,de,"\ue237","\\@jmath"),se(ie,le,we,"\u0131","\u0131"),se(ie,le,we,"\u0237","\u0237"),se(ae,le,we,"\u0131","\\i",!0),se(ae,le,we,"\u0237","\\j",!0),se(ae,le,we,"\xdf","\\ss",!0),se(ae,le,we,"\xe6","\\ae",!0),se(ae,le,we,"\u0153","\\oe",!0),se(ae,le,we,"\xf8","\\o",!0),se(ae,le,we,"\xc6","\\AE",!0),se(ae,le,we,"\u0152","\\OE",!0),se(ae,le,we,"\xd8","\\O",!0),se(ae,le,ce,"\u02ca","\\'"),se(ae,le,ce,"\u02cb","\\`"),se(ae,le,ce,"\u02c6","\\^"),se(ae,le,ce,"\u02dc","\\~"),se(ae,le,ce,"\u02c9","\\="),se(ae,le,ce,"\u02d8","\\u"),se(ae,le,ce,"\u02d9","\\."),se(ae,le,ce,"\xb8","\\c"),se(ae,le,ce,"\u02da","\\r"),se(ae,le,ce,"\u02c7","\\v"),se(ae,le,ce,"\xa8",'\\"'),se(ae,le,ce,"\u02dd","\\H"),se(ae,le,ce,"\u25ef","\\textcircled");const ve={"--":!0,"---":!0,"``":!0,"''":!0};se(ae,le,we,"\u2013","--",!0),se(ae,le,we,"\u2013","\\textendash"),se(ae,le,we,"\u2014","---",!0),se(ae,le,we,"\u2014","\\textemdash"),se(ae,le,we,"\u2018","`",!0),se(ae,le,we,"\u2018","\\textquoteleft"),se(ae,le,we,"\u2019","'",!0),se(ae,le,we,"\u2019","\\textquoteright"),se(ae,le,we,"\u201c","``",!0),se(ae,le,we,"\u201c","\\textquotedblleft"),se(ae,le,we,"\u201d","''",!0),se(ae,le,we,"\u201d","\\textquotedblright"),se(ie,le,we,"\xb0","\\degree",!0),se(ae,le,we,"\xb0","\\degree"),se(ae,le,we,"\xb0","\\textdegree",!0),se(ie,le,we,"\xa3","\\pounds"),se(ie,le,we,"\xa3","\\mathsterling",!0),se(ae,le,we,"\xa3","\\pounds"),se(ae,le,we,"\xa3","\\textsterling",!0),se(ie,he,we,"\u2720","\\maltese"),se(ae,he,we,"\u2720","\\maltese");const ke='0123456789/@."';for(let e=0;e{if(G(e.classes)!==G(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){const t=e.classes[0];if("mbin"===t||"mord"===t)return!1}for(const r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(const r in t.style)if(t.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;return!0},Ie=function(e){let t=0,r=0,n=0;for(let o=0;ot&&(t=s.height),s.depth>r&&(r=s.depth),s.maxFontSize>n&&(n=s.maxFontSize)}e.height=t,e.depth=r,e.maxFontSize=n},Re=function(e,t,r,n){const o=new W(e,t,r,n);return Ie(o),o},He=(e,t,r,n)=>new W(e,t,r,n),Oe=function(e){const t=new A(e);return Ie(t),t},Ee=function(e,t,r){let n,o="";switch(e){case"amsrm":o="AMS";break;case"textrm":o="Main";break;case"textsf":o="SansSerif";break;case"texttt":o="Typewriter";break;default:o=e}return n="textbf"===t&&"textit"===r?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular",o+"-"+n},Le={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},De={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]};var Ve={fontMap:Le,makeSymbol:Ne,mathsym:function(e,t,r,n){return void 0===n&&(n=[]),"boldsymbol"===r.font&&Ce(e,"Main-Bold",t).metrics?Ne(e,"Main-Bold",t,r,n.concat(["mathbf"])):"\\"===e||"main"===oe[t][e].font?Ne(e,"Main-Regular",t,r,n):Ne(e,"AMS-Regular",t,r,n.concat(["amsrm"]))},makeSpan:Re,makeSvgSpan:He,makeLineSpan:function(e,t,r){const n=Re([e],[],t);return n.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=F(n.height),n.maxFontSize=1,n},makeAnchor:function(e,t,r,n){const o=new _(e,t,r,n);return Ie(o),o},makeFragment:Oe,wrapFragment:function(e,t){return e instanceof A?Re([],[e],t):e},makeVList:function(e,t){const{children:r,depth:n}=function(e){if("individualShift"===e.positionType){const t=e.children,r=[t[0]],n=-t[0].shift-t[0].elem.depth;let o=n;for(let e=1;e0)return Ne(s,h,o,t,i.concat(c));if(l){let e,n;if("boldsymbol"===l){const t=function(e,t,r,n,o){return"textord"!==o&&Ce(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(s,o,0,0,r);e=t.fontName,n=[t.fontClass]}else a?(e=Le[l].fontName,n=[l]):(e=Ee(l,t.fontWeight,t.fontShape),n=[l,t.fontWeight,t.fontShape]);if(Ce(s,e,o).metrics)return Ne(s,e,o,t,i.concat(n));if(ve.hasOwnProperty(s)&&"Typewriter"===e.slice(0,10)){const r=[];for(let a=0;a{const r=Re(["mspace"],[],t),n=P(e,t);return r.style.marginRight=F(n),r},staticSvg:function(e,t){const[r,n,o]=De[e],s=new J(r),i=new K([s],{width:F(n),height:F(o),style:"width:"+F(n),viewBox:"0 0 "+1e3*n+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),a=He(["overlay"],[i],t);return a.height=o,a.style.height=F(o),a.style.width=F(n),a},svgData:De,tryCombineChars:e=>{for(let t=0;t{const r=t.classes[0],n=e.classes[0];"mbin"===r&&l.contains(et,n)?t.classes[0]="mord":"mbin"===n&&l.contains(Qe,r)&&(e.classes[0]="mord")}),{node:i},a,h),ot(o,((e,t)=>{const r=at(t),n=at(e),o=r&&n?e.hasClass("mtight")?Ye[r][n]:Ue[r][n]:null;if(o)return Ve.makeGlue(o,s)}),{node:i},a,h),o},ot=function(e,t,r,n,o){n&&e.push(n);let s=0;for(;sr=>{e.splice(t+1,0,r),s++})(s)}n&&e.pop()},st=function(e){return e instanceof A||e instanceof _||e instanceof W&&e.hasClass("enclosing")?e:null},it=function(e,t){const r=st(e);if(r){const e=r.children;if(e.length){if("right"===t)return it(e[e.length-1],"right");if("left"===t)return it(e[0],"left")}}return e},at=function(e,t){return e?(t&&(e=it(e,t)),rt[e.classes[0]]||null):null},lt=function(e,t){const r=["nulldelimiter"].concat(e.baseSizingClasses());return Je(t.concat(r))},ht=function(e,t,r){if(!e)return Je();if(We[e.type]){let n=We[e.type](e,t);if(r&&t.size!==r.size){n=Je(t.sizingClasses(r),[n],t);const e=t.sizeMultiplier/r.sizeMultiplier;n.height*=e,n.depth*=e}return n}throw new n("Got group of unknown type: '"+e.type+"'")};function ct(e,t){const r=Je(["base"],e,t),n=Je(["strut"]);return n.style.height=F(r.height+r.depth),r.depth&&(n.style.verticalAlign=F(-r.depth)),r.children.unshift(n),r}function mt(e,t){let r=null;1===e.length&&"tag"===e[0].type&&(r=e[0].tag,e=e[0].body);const n=nt(e,t,"root");let o;2===n.length&&n[1].hasClass("tag")&&(o=n.pop());const s=[];let i,a=[];for(let e=0;e0&&(s.push(ct(a,t)),a=[]),s.push(n[e]));a.length>0&&s.push(ct(a,t)),r?(i=ct(nt(r,t,!0)),i.classes=["tag"],s.push(i)):o&&s.push(o);const l=Je(["katex-html"],s);if(l.setAttribute("aria-hidden","true"),i){const e=i.children[0];e.style.height=F(l.height+l.depth),l.depth&&(e.style.verticalAlign=F(-l.depth))}return l}function pt(e){return new A(e)}class ut{constructor(e,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){const e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=G(this.classes));for(let t=0;t0&&(e+=' class ="'+l.escape(G(this.classes))+'"'),e+=">";for(let t=0;t",e}toText(){return this.children.map((e=>e.toText())).join("")}}class dt{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return l.escape(this.toText())}toText(){return this.text}}var gt={MathNode:ut,TextNode:dt,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?"\u200a":e>=.1666&&e<=.1667?"\u2009":e>=.2222&&e<=.2223?"\u2005":e>=.2777&&e<=.2778?"\u2005\u200a":e>=-.05556&&e<=-.05555?"\u200a\u2063":e>=-.1667&&e<=-.1666?"\u2009\u2063":e>=-.2223&&e<=-.2222?"\u205f\u2063":e>=-.2778&&e<=-.2777?"\u2005\u2063":null}toNode(){if(this.character)return document.createTextNode(this.character);{const e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",F(this.width)),e}}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}},newDocumentFragment:pt};const ft=function(e,t,r){return!oe[t][e]||!oe[t][e].replace||55349===e.charCodeAt(0)||ve.hasOwnProperty(e)&&r&&(r.fontFamily&&"tt"===r.fontFamily.slice(4,6)||r.font&&"tt"===r.font.slice(4,6))||(e=oe[t][e].replace),new gt.TextNode(e)},bt=function(e){return 1===e.length?e[0]:new gt.MathNode("mrow",e)},yt=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";const r=t.font;if(!r||"mathnormal"===r)return null;const n=e.mode;if("mathit"===r)return"italic";if("boldsymbol"===r)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===r)return"bold";if("mathbb"===r)return"double-struck";if("mathfrak"===r)return"fraktur";if("mathscr"===r||"mathcal"===r)return"script";if("mathsf"===r)return"sans-serif";if("mathtt"===r)return"monospace";let o=e.text;if(l.contains(["\\imath","\\jmath"],o))return null;oe[n][o]&&oe[n][o].replace&&(o=oe[n][o].replace);return N(o,Ve.fontMap[r].fontName,n)?Ve.fontMap[r].variant:null},xt=function(e,t,r){if(1===e.length){const n=vt(e[0],t);return r&&n instanceof ut&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}const n=[];let o;for(let r=0;r0&&(e.text=e.text.slice(0,1)+"\u0338"+e.text.slice(1),n.pop())}}}n.push(s),o=s}return n},wt=function(e,t,r){return bt(xt(e,t,r))},vt=function(e,t){if(!e)return new gt.MathNode("mrow");if(_e[e.type]){return _e[e.type](e,t)}throw new n("Got group of unknown type: '"+e.type+"'")};function kt(e,t,r,n,o){const s=xt(e,r);let i;i=1===s.length&&s[0]instanceof ut&&l.contains(["mrow","mtable"],s[0].type)?s[0]:new gt.MathNode("mrow",s);const a=new gt.MathNode("annotation",[new gt.TextNode(t)]);a.setAttribute("encoding","application/x-tex");const h=new gt.MathNode("semantics",[i,a]),c=new gt.MathNode("math",[h]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");const m=o?"katex":"katex-mathml";return Ve.makeSpan([m],[c])}const St=function(e){return new E({style:e.displayMode?w.DISPLAY:w.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Mt=function(e,t){if(t.displayMode){const r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),e=Ve.makeSpan(r,[e])}return e},zt=function(e,t,r){const n=St(r);let o;if("mathml"===r.output)return kt(e,t,n,r.displayMode,!0);if("html"===r.output){const t=mt(e,n);o=Ve.makeSpan(["katex"],[t])}else{const s=kt(e,t,n,r.displayMode,!1),i=mt(e,n);o=Ve.makeSpan(["katex"],[s,i])}return Mt(o,r)};const At={widehat:"^",widecheck:"\u02c7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23df",overbrace:"\u23de",overgroup:"\u23e0",undergroup:"\u23e1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21d2",xRightarrow:"\u21d2",overleftharpoon:"\u21bc",xleftharpoonup:"\u21bc",overrightharpoon:"\u21c0",xrightharpoonup:"\u21c0",xLeftarrow:"\u21d0",xLeftrightarrow:"\u21d4",xhookleftarrow:"\u21a9",xhookrightarrow:"\u21aa",xmapsto:"\u21a6",xrightharpoondown:"\u21c1",xleftharpoondown:"\u21bd",xrightleftharpoons:"\u21cc",xleftrightharpoons:"\u21cb",xtwoheadleftarrow:"\u219e",xtwoheadrightarrow:"\u21a0",xlongequal:"=",xtofrom:"\u21c4",xrightleftarrows:"\u21c4",xrightequilibrium:"\u21cc",xleftequilibrium:"\u21cb","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Tt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]};var Bt=function(e,t,r,n,o){let s;const i=e.height+e.depth+r+n;if(/fbox|color|angl/.test(t)){if(s=Ve.makeSpan(["stretchy",t],[],o),"fbox"===t){const e=o.color&&o.getColor();e&&(s.style.borderColor=e)}}else{const e=[];/^[bx]cancel$/.test(t)&&e.push(new Q({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&e.push(new Q({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));const r=new K(e,{width:"100%",height:F(i)});s=Ve.makeSvgSpan([],[r],o)}return s.height=i,s.style.height=F(i),s},Ct=function(e){const t=new gt.MathNode("mo",[new gt.TextNode(At[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Nt=function(e,t){const{span:r,minWidth:n,height:o}=function(){let r=4e5;const n=e.label.slice(1);if(l.contains(["widehat","widecheck","widetilde","utilde"],n)){const s="ordgroup"===(o=e.base).type?o.body.length:1;let i,a,l;if(s>5)"widehat"===n||"widecheck"===n?(i=420,r=2364,l=.42,a=n+"4"):(i=312,r=2340,l=.34,a="tilde4");else{const e=[1,1,2,2,3,3][s];"widehat"===n||"widecheck"===n?(r=[0,1062,2364,2364,2364][e],i=[0,239,300,360,420][e],l=[0,.24,.3,.3,.36,.42][e],a=n+e):(r=[0,600,1033,2339,2340][e],i=[0,260,286,306,312][e],l=[0,.26,.286,.3,.306,.34][e],a="tilde"+e)}const h=new J(a),c=new K([h],{width:"100%",height:F(l),viewBox:"0 0 "+r+" "+i,preserveAspectRatio:"none"});return{span:Ve.makeSvgSpan([],[c],t),minWidth:0,height:l}}{const e=[],o=Tt[n],[s,i,a]=o,l=a/1e3,h=s.length;let c,m;if(1===h){c=["hide-tail"],m=[o[3]]}else if(2===h)c=["halfarrow-left","halfarrow-right"],m=["xMinYMin","xMaxYMin"];else{if(3!==h)throw new Error("Correct katexImagesData or update code here to support\n "+h+" children.");c=["brace-left","brace-center","brace-right"],m=["xMinYMin","xMidYMin","xMaxYMin"]}for(let n=0;n0&&(r.style.minWidth=F(n)),r};function qt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function It(e){const t=Rt(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Rt(e){return e&&("atom"===e.type||re.hasOwnProperty(e.type))?e:null}const Ht=(e,t)=>{let r,n,o;e&&"supsub"===e.type?(n=qt(e.base,"accent"),r=n.base,e.base=r,o=function(e){if(e instanceof W)return e;throw new Error("Expected span but got "+String(e)+".")}(ht(e,t)),e.base=n):(n=qt(e,"accent"),r=n.base);const s=ht(r,t.havingCrampedStyle());let i=0;if(n.isShifty&&l.isCharacterBox(r)){const e=l.getBaseElem(r);i=ee(ht(e,t.havingCrampedStyle())).skew}const a="\\c"===n.label;let h,c=a?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(n.isStretchy)h=Nt(n,t),h=Ve.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:i>0?{width:"calc(100% - "+F(2*i)+")",marginLeft:F(2*i)}:void 0}]},t);else{let e,r;"\\vec"===n.label?(e=Ve.staticSvg("vec",t),r=Ve.svgData.vec[1]):(e=Ve.makeOrd({mode:n.mode,text:n.label},t,"textord"),e=ee(e),e.italic=0,r=e.width,a&&(c+=e.depth)),h=Ve.makeSpan(["accent-body"],[e]);const o="\\textcircled"===n.label;o&&(h.classes.push("accent-full"),c=s.height);let l=i;o||(l-=r/2),h.style.left=F(l),"\\textcircled"===n.label&&(h.style.top=".2em"),h=Ve.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-c},{type:"elem",elem:h}]},t)}const m=Ve.makeSpan(["mord","accent"],[h],t);return o?(o.children[0]=m,o.height=Math.max(m.height,o.height),o.classes[0]="mord",o):m},Ot=(e,t)=>{const r=e.isStretchy?Ct(e.label):new gt.MathNode("mo",[ft(e.label,e.mode)]),n=new gt.MathNode("mover",[vt(e.base,t),r]);return n.setAttribute("accent","true"),n},Et=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));je({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{const r=Ze(t[0]),n=!Et.test(e.funcName),o=!n||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:o,base:r}},htmlBuilder:Ht,mathmlBuilder:Ot}),je({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{const r=t[0];let n=e.parser.mode;return"math"===n&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:Ht,mathmlBuilder:Ot}),je({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:o}},htmlBuilder:(e,t)=>{const r=ht(e.base,t),n=Nt(e,t),o="\\utilde"===e.label?.12:0,s=Ve.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:r}]},t);return Ve.makeSpan(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{const r=Ct(e.label),n=new gt.MathNode("munder",[vt(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});const Lt=e=>{const t=new gt.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};je({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){let{parser:n,funcName:o}=e;return{type:"xArrow",mode:n.mode,label:o,body:t[0],below:r[0]}},htmlBuilder(e,t){const r=t.style;let n=t.havingStyle(r.sup());const o=Ve.wrapFragment(ht(e.body,n,t),t),s="\\x"===e.label.slice(0,2)?"x":"cd";let i;o.classes.push(s+"-arrow-pad"),e.below&&(n=t.havingStyle(r.sub()),i=Ve.wrapFragment(ht(e.below,n,t),t),i.classes.push(s+"-arrow-pad"));const a=Nt(e,t),l=-t.fontMetrics().axisHeight+.5*a.height;let h,c=-t.fontMetrics().axisHeight-.5*a.height-.111;if((o.depth>.25||"\\xleftequilibrium"===e.label)&&(c-=o.depth),i){const e=-t.fontMetrics().axisHeight+i.height+.5*a.height+.111;h=Ve.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:a,shift:l},{type:"elem",elem:i,shift:e}]},t)}else h=Ve.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:a,shift:l}]},t);return h.children[0].children[0].children[1].classes.push("svg-align"),Ve.makeSpan(["mrel","x-arrow"],[h],t)},mathmlBuilder(e,t){const r=Ct(e.label);let n;if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){const o=Lt(vt(e.body,t));if(e.below){const s=Lt(vt(e.below,t));n=new gt.MathNode("munderover",[r,s,o])}else n=new gt.MathNode("mover",[r,o])}else if(e.below){const o=Lt(vt(e.below,t));n=new gt.MathNode("munder",[r,o])}else n=Lt(),n=new gt.MathNode("mover",[r,n]);return n}});const Dt=Ve.makeSpan;function Vt(e,t){const r=nt(e.body,t,!0);return Dt([e.mclass],r,t)}function Pt(e,t){let r;const n=xt(e.body,t);return"minner"===e.mclass?r=new gt.MathNode("mpadded",n):"mord"===e.mclass?e.isCharacterBox?(r=n[0],r.type="mi"):r=new gt.MathNode("mi",n):(e.isCharacterBox?(r=n[0],r.type="mo"):r=new gt.MathNode("mo",n),"mbin"===e.mclass?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):"mpunct"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0em"):"minner"===e.mclass&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}je({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){let{parser:r,funcName:n}=e;const o=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Ke(o),isCharacterBox:l.isCharacterBox(o)}},htmlBuilder:Vt,mathmlBuilder:Pt});const Ft=e=>{const t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};je({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){let{parser:r}=e;return{type:"mclass",mode:r.mode,mclass:Ft(t[0]),body:Ke(t[1]),isCharacterBox:l.isCharacterBox(t[1])}}}),je({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){let{parser:r,funcName:n}=e;const o=t[1],s=t[0];let i;i="\\stackrel"!==n?Ft(o):"mrel";const a={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==n,body:Ke(o)},h={type:"supsub",mode:s.mode,base:a,sup:"\\underset"===n?null:s,sub:"\\underset"===n?s:null};return{type:"mclass",mode:r.mode,mclass:i,body:[h],isCharacterBox:l.isCharacterBox(h)}},htmlBuilder:Vt,mathmlBuilder:Pt}),je({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r}=e;return{type:"pmb",mode:r.mode,mclass:Ft(t[0]),body:Ke(t[0])}},htmlBuilder(e,t){const r=nt(e.body,t,!0),n=Ve.makeSpan([e.mclass],r,t);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(e,t){const r=xt(e.body,t),n=new gt.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});const Gt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Ut=e=>"textord"===e.type&&"@"===e.text;function Yt(e,t,r){const n=Gt[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{const e={type:"atom",text:n,mode:"math",family:"rel"},o={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[t[0]],[]),r.callFunction("\\Big",[e],[]),r.callFunction("\\\\cdright",[t[1]],[])]};return r.callFunction("\\\\cdparent",[o],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{const e={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[e],[])}default:return{type:"textord",text:" ",mode:"math"}}}je({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){let{parser:r,funcName:n}=e;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder(e,t){const r=t.havingStyle(t.style.sup()),n=Ve.wrapFragment(ht(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=F(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(e,t){let r=new gt.MathNode("mrow",[vt(e.label,t)]);return r=new gt.MathNode("mpadded",[r]),r.setAttribute("width","0"),"left"===e.side&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new gt.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),je({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){let{parser:r}=e;return{type:"cdlabelparent",mode:r.mode,fragment:t[0]}},htmlBuilder(e,t){const r=Ve.wrapFragment(ht(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(e,t){return new gt.MathNode("mrow",[vt(e.fragment,t)])}}),je({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r}=e;const o=qt(t[0],"ordgroup").body;let s="";for(let e=0;e=1114111)throw new n("\\@char with invalid code point "+s);return a<=65535?i=String.fromCharCode(a):(a-=65536,i=String.fromCharCode(55296+(a>>10),56320+(1023&a))),{type:"textord",mode:r.mode,text:i}}});const Xt=(e,t)=>{const r=nt(e.body,t.withColor(e.color),!1);return Ve.makeFragment(r)},Wt=(e,t)=>{const r=xt(e.body,t.withColor(e.color)),n=new gt.MathNode("mstyle",r);return n.setAttribute("mathcolor",e.color),n};je({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){let{parser:r}=e;const n=qt(t[0],"color-token").color,o=t[1];return{type:"color",mode:r.mode,color:n,body:Ke(o)}},htmlBuilder:Xt,mathmlBuilder:Wt}),je({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){let{parser:r,breakOnTokenText:n}=e;const o=qt(t[0],"color-token").color;r.gullet.macros.set("\\current@color",o);const s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:o,body:s}},htmlBuilder:Xt,mathmlBuilder:Wt}),je({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,r){let{parser:n}=e;const o="["===n.gullet.future().text?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:o&&qt(o,"size").value}},htmlBuilder(e,t){const r=Ve.makeSpan(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=F(P(e.size,t)))),r},mathmlBuilder(e,t){const r=new gt.MathNode("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",F(P(e.size,t)))),r}});const _t={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},jt=e=>{const t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new n("Expected a control sequence",e);return t},$t=(e,t,r,n)=>{let o=e.gullet.macros.get(r.text);null==o&&(r.noexpand=!0,o={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,o,n)};je({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){let{parser:t,funcName:r}=e;t.consumeSpaces();const o=t.fetch();if(_t[o.text])return"\\global"!==r&&"\\\\globallong"!==r||(o.text=_t[o.text]),qt(t.parseFunction(),"internal");throw new n("Invalid token after macro prefix",o)}}),je({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:r}=e,o=t.gullet.popToken();const s=o.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new n("Expected a control sequence",o);let i,a=0;const l=[[]];for(;"{"!==t.gullet.future().text;)if(o=t.gullet.popToken(),"#"===o.text){if("{"===t.gullet.future().text){i=t.gullet.future(),l[a].push("{");break}if(o=t.gullet.popToken(),!/^[1-9]$/.test(o.text))throw new n('Invalid argument number "'+o.text+'"');if(parseInt(o.text)!==a+1)throw new n('Argument number "'+o.text+'" out of order');a++,l.push([])}else{if("EOF"===o.text)throw new n("Expected a macro definition");l[a].push(o.text)}let{tokens:h}=t.gullet.consumeArg();return i&&h.unshift(i),"\\edef"!==r&&"\\xdef"!==r||(h=t.gullet.expandTokens(h),h.reverse()),t.gullet.macros.set(s,{tokens:h,numArgs:a,delimiters:l},r===_t[r]),{type:"internal",mode:t.mode}}}),je({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:r}=e;const n=jt(t.gullet.popToken());t.gullet.consumeSpaces();const o=(e=>{let t=e.gullet.popToken();return"="===t.text&&(t=e.gullet.popToken()," "===t.text&&(t=e.gullet.popToken())),t})(t);return $t(t,n,o,"\\\\globallet"===r),{type:"internal",mode:t.mode}}}),je({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:r}=e;const n=jt(t.gullet.popToken()),o=t.gullet.popToken(),s=t.gullet.popToken();return $t(t,n,s,"\\\\globalfuture"===r),t.gullet.pushToken(s),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});const Zt=function(e,t,r){const n=N(oe.math[e]&&oe.math[e].replace||e,t,r);if(!n)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return n},Kt=function(e,t,r,n){const o=r.havingBaseStyle(t),s=Ve.makeSpan(n.concat(o.sizingClasses(r)),[e],r),i=o.sizeMultiplier/r.sizeMultiplier;return s.height*=i,s.depth*=i,s.maxFontSize=o.sizeMultiplier,s},Jt=function(e,t,r){const n=t.havingBaseStyle(r),o=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=F(o),e.height-=o,e.depth+=o},Qt=function(e,t,r,n,o,s){const i=function(e,t,r,n){return Ve.makeSymbol(e,"Size"+t+"-Regular",r,n)}(e,t,o,n),a=Kt(Ve.makeSpan(["delimsizing","size"+t],[i],n),w.TEXT,n,s);return r&&Jt(a,n,w.TEXT),a},er=function(e,t,r){let n;n="Size1-Regular"===t?"delim-size1":"delim-size4";return{type:"elem",elem:Ve.makeSpan(["delimsizinginner",n],[Ve.makeSpan([],[Ve.makeSymbol(e,t,r)])])}},tr=function(e,t,r){const n=T["Size4-Regular"][e.charCodeAt(0)]?T["Size4-Regular"][e.charCodeAt(0)][4]:T["Size1-Regular"][e.charCodeAt(0)][4],o=new J("inner",function(e,t){switch(e){case"\u239c":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"\u2223":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"\u2225":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"\u239f":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"\u23a2":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"\u23a5":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"\u23aa":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"\u23d0":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"\u2016":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),s=new K([o],{width:F(n),height:F(t),style:"width:"+F(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),i=Ve.makeSvgSpan([],[s],r);return i.height=t,i.style.height=F(t),i.style.width=F(n),{type:"elem",elem:i}},rr={type:"kern",size:-.008},nr=["|","\\lvert","\\rvert","\\vert"],or=["\\|","\\lVert","\\rVert","\\Vert"],sr=function(e,t,r,n,o,s){let i,a,h,c,m="",p=0;i=h=c=e,a=null;let u="Size1-Regular";"\\uparrow"===e?h=c="\u23d0":"\\Uparrow"===e?h=c="\u2016":"\\downarrow"===e?i=h="\u23d0":"\\Downarrow"===e?i=h="\u2016":"\\updownarrow"===e?(i="\\uparrow",h="\u23d0",c="\\downarrow"):"\\Updownarrow"===e?(i="\\Uparrow",h="\u2016",c="\\Downarrow"):l.contains(nr,e)?(h="\u2223",m="vert",p=333):l.contains(or,e)?(h="\u2225",m="doublevert",p=556):"["===e||"\\lbrack"===e?(i="\u23a1",h="\u23a2",c="\u23a3",u="Size4-Regular",m="lbrack",p=667):"]"===e||"\\rbrack"===e?(i="\u23a4",h="\u23a5",c="\u23a6",u="Size4-Regular",m="rbrack",p=667):"\\lfloor"===e||"\u230a"===e?(h=i="\u23a2",c="\u23a3",u="Size4-Regular",m="lfloor",p=667):"\\lceil"===e||"\u2308"===e?(i="\u23a1",h=c="\u23a2",u="Size4-Regular",m="lceil",p=667):"\\rfloor"===e||"\u230b"===e?(h=i="\u23a5",c="\u23a6",u="Size4-Regular",m="rfloor",p=667):"\\rceil"===e||"\u2309"===e?(i="\u23a4",h=c="\u23a5",u="Size4-Regular",m="rceil",p=667):"("===e||"\\lparen"===e?(i="\u239b",h="\u239c",c="\u239d",u="Size4-Regular",m="lparen",p=875):")"===e||"\\rparen"===e?(i="\u239e",h="\u239f",c="\u23a0",u="Size4-Regular",m="rparen",p=875):"\\{"===e||"\\lbrace"===e?(i="\u23a7",a="\u23a8",c="\u23a9",h="\u23aa",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(i="\u23ab",a="\u23ac",c="\u23ad",h="\u23aa",u="Size4-Regular"):"\\lgroup"===e||"\u27ee"===e?(i="\u23a7",c="\u23a9",h="\u23aa",u="Size4-Regular"):"\\rgroup"===e||"\u27ef"===e?(i="\u23ab",c="\u23ad",h="\u23aa",u="Size4-Regular"):"\\lmoustache"===e||"\u23b0"===e?(i="\u23a7",c="\u23ad",h="\u23aa",u="Size4-Regular"):"\\rmoustache"!==e&&"\u23b1"!==e||(i="\u23ab",c="\u23a9",h="\u23aa",u="Size4-Regular");const d=Zt(i,u,o),g=d.height+d.depth,f=Zt(h,u,o),b=f.height+f.depth,y=Zt(c,u,o),x=y.height+y.depth;let v=0,k=1;if(null!==a){const e=Zt(a,u,o);v=e.height+e.depth,k=2}const S=g+x+v,M=S+Math.max(0,Math.ceil((t-S)/(k*b)))*k*b;let z=n.fontMetrics().axisHeight;r&&(z*=n.sizeMultiplier);const A=M/2-z,T=[];if(m.length>0){const e=M-g-x,t=Math.round(1e3*M),r=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(m,Math.round(1e3*e)),o=new J(m,r),s=(p/1e3).toFixed(3)+"em",i=(t/1e3).toFixed(3)+"em",a=new K([o],{width:s,height:i,viewBox:"0 0 "+p+" "+t}),l=Ve.makeSvgSpan([],[a],n);l.height=t/1e3,l.style.width=s,l.style.height=i,T.push({type:"elem",elem:l})}else{if(T.push(er(c,u,o)),T.push(rr),null===a){const e=M-g-x+.016;T.push(tr(h,e,n))}else{const e=(M-g-x-v)/2+.016;T.push(tr(h,e,n)),T.push(rr),T.push(er(a,u,o)),T.push(rr),T.push(tr(h,e,n))}T.push(rr),T.push(er(i,u,o))}const B=n.havingBaseStyle(w.TEXT),C=Ve.makeVList({positionType:"bottom",positionData:A,children:T},B);return Kt(Ve.makeSpan(["delimsizing","mult"],[C],B),w.TEXT,n,s)},ir=.08,ar=function(e,t,r,n,o){const s=function(e,t,r){t*=1e3;let n="";switch(e){case"sqrtMain":n=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize1":n=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize2":n=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize3":n=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize4":n=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,M);break;case"sqrtTall":n=function(e,t,r){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(r-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,M,r)}return n}(e,n,r),i=new J(e,s),a=new K([i],{width:"400em",height:F(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ve.makeSvgSpan(["hide-tail"],[a],o)},lr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","\\surd"],hr=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1"],cr=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],mr=[0,1.2,1.8,2.4,3],pr=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ur=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"stack"}],dr=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],gr=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},fr=function(e,t,r,n){for(let o=Math.min(2,3-n.style.size);ot)return r[o]}return r[r.length-1]},br=function(e,t,r,n,o,s){let i;"<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),i=l.contains(cr,e)?pr:l.contains(lr,e)?dr:ur;const a=fr(e,t,i,n);return"small"===a.type?function(e,t,r,n,o,s){const i=Ve.makeSymbol(e,"Main-Regular",o,n),a=Kt(i,t,n,s);return r&&Jt(a,n,t),a}(e,a.style,r,n,o,s):"large"===a.type?Qt(e,a.size,r,n,o,s):sr(e,t,r,n,o,s)};var yr={sqrtImage:function(e,t){const r=t.havingBaseSizing(),n=fr("\\surd",e*r.sizeMultiplier,dr,r);let o=r.sizeMultiplier;const s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness);let i,a,l=0,h=0,c=0;return"small"===n.type?(c=1e3+1e3*s+80,e<1?o=1:e<1.4&&(o=.7),l=(1+s+ir)/o,h=(1+s)/o,i=ar("sqrtMain",l,c,s,t),i.style.minWidth="0.853em",a=.833/o):"large"===n.type?(c=1080*mr[n.size],h=(mr[n.size]+s)/o,l=(mr[n.size]+s+ir)/o,i=ar("sqrtSize"+n.size,l,c,s,t),i.style.minWidth="1.02em",a=1/o):(l=e+s+ir,h=e+s,c=Math.floor(1e3*e+s)+80,i=ar("sqrtTall",l,c,s,t),i.style.minWidth="0.742em",a=1.056),i.height=h,i.style.height=F(l),{span:i,advanceWidth:a,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*o}},sizedDelim:function(e,t,r,o,s){if("<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),l.contains(lr,e)||l.contains(cr,e))return Qt(e,t,!1,r,o,s);if(l.contains(hr,e))return sr(e,mr[t],!1,r,o,s);throw new n("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:mr,customSizedDelim:br,leftRightDelim:function(e,t,r,n,o,s){const i=n.fontMetrics().axisHeight*n.sizeMultiplier,a=5/n.fontMetrics().ptPerEm,l=Math.max(t-i,r+i),h=Math.max(l/500*901,2*l-a);return br(e,h,!0,n,o,s)}};const xr={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},wr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27e8","\\rangle","\u27e9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function vr(e,t){const r=Rt(e);if(r&&l.contains(wr,r.text))return r;throw new n(r?"Invalid delimiter '"+r.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function kr(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}je({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{const r=vr(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:xr[e.funcName].size,mclass:xr[e.funcName].mclass,delim:r.text}},htmlBuilder:(e,t)=>"."===e.delim?Ve.makeSpan([e.mclass]):yr.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{const t=[];"."!==e.delim&&t.push(ft(e.delim,e.mode));const r=new gt.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");const n=F(yr.sizeToMaxHeight[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}}),je({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{const r=e.parser.gullet.macros.get("\\current@color");if(r&&"string"!=typeof r)throw new n("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:vr(t[0],e).text,color:r}}}),je({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{const r=vr(t[0],e),n=e.parser;++n.leftrightDepth;const o=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);const s=qt(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:o,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{kr(e);const r=nt(e.body,t,!0,["mopen","mclose"]);let n,o,s=0,i=0,a=!1;for(let e=0;e{kr(e);const r=xt(e.body,t);if("."!==e.left){const t=new gt.MathNode("mo",[ft(e.left,e.mode)]);t.setAttribute("fence","true"),r.unshift(t)}if("."!==e.right){const t=new gt.MathNode("mo",[ft(e.right,e.mode)]);t.setAttribute("fence","true"),e.rightColor&&t.setAttribute("mathcolor",e.rightColor),r.push(t)}return bt(r)}}),je({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{const r=vr(t[0],e);if(!e.parser.leftrightDepth)throw new n("\\middle without preceding \\left",r);return{type:"middle",mode:e.parser.mode,delim:r.text}},htmlBuilder:(e,t)=>{let r;if("."===e.delim)r=lt(t,[]);else{r=yr.sizedDelim(e.delim,1,t,e.mode,[]);const n={delim:e.delim,options:t};r.isMiddle=n}return r},mathmlBuilder:(e,t)=>{const r="\\vert"===e.delim||"|"===e.delim?ft("|","text"):ft(e.delim,e.mode),n=new gt.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});const Sr=(e,t)=>{const r=Ve.wrapFragment(ht(e.body,t),t),n=e.label.slice(1);let o,s=t.sizeMultiplier,i=0;const a=l.isCharacterBox(e.body);if("sout"===n)o=Ve.makeSpan(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/s,i=-.5*t.fontMetrics().xHeight;else if("phase"===n){const e=P({number:.6,unit:"pt"},t),n=P({number:.35,unit:"ex"},t);s/=t.havingBaseSizing().sizeMultiplier;const a=r.height+r.depth+e+n;r.style.paddingLeft=F(a/2+e);const l=Math.floor(1e3*a*s),c="M400000 "+(h=l)+" H0 L"+h/2+" 0 l65 45 L145 "+(h-80)+" H400000z",m=new K([new J("phase",c)],{width:"400em",height:F(l/1e3),viewBox:"0 0 400000 "+l,preserveAspectRatio:"xMinYMin slice"});o=Ve.makeSvgSpan(["hide-tail"],[m],t),o.style.height=F(a),i=r.depth+e+n}else{/cancel/.test(n)?a||r.classes.push("cancel-pad"):"angl"===n?r.classes.push("anglpad"):r.classes.push("boxpad");let s=0,l=0,h=0;/box/.test(n)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),s=t.fontMetrics().fboxsep+("colorbox"===n?0:h),l=s):"angl"===n?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s=4*h,l=Math.max(0,.25-r.depth)):(s=a?.2:0,l=s),o=Bt(r,n,s,l,t),/fbox|boxed|fcolorbox/.test(n)?(o.style.borderStyle="solid",o.style.borderWidth=F(h)):"angl"===n&&.049!==h&&(o.style.borderTopWidth=F(h),o.style.borderRightWidth=F(h)),i=r.depth+l,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var h;let c;if(e.backgroundColor)c=Ve.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:i},{type:"elem",elem:r,shift:0}]},t);else{const e=/cancel|phase/.test(n)?["svg-align"]:[];c=Ve.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:o,shift:i,wrapperClasses:e}]},t)}return/cancel/.test(n)&&(c.height=r.height,c.depth=r.depth),/cancel/.test(n)&&!a?Ve.makeSpan(["mord","cancel-lap"],[c],t):Ve.makeSpan(["mord"],[c],t)},Mr=(e,t)=>{let r=0;const n=new gt.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[vt(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),"\\fcolorbox"===e.label){const r=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+r+"em solid "+String(e.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};je({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,r){let{parser:n,funcName:o}=e;const s=qt(t[0],"color-token").color,i=t[1];return{type:"enclose",mode:n.mode,label:o,backgroundColor:s,body:i}},htmlBuilder:Sr,mathmlBuilder:Mr}),je({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,r){let{parser:n,funcName:o}=e;const s=qt(t[0],"color-token").color,i=qt(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:n.mode,label:o,backgroundColor:i,borderColor:s,body:a}},htmlBuilder:Sr,mathmlBuilder:Mr}),je({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){let{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\fbox",body:t[0]}}}),je({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){let{parser:r,funcName:n}=e;const o=t[0];return{type:"enclose",mode:r.mode,label:n,body:o}},htmlBuilder:Sr,mathmlBuilder:Mr}),je({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){let{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\angl",body:t[0]}}});const zr={};function Ar(e){let{type:t,names:r,props:n,handler:o,htmlBuilder:s,mathmlBuilder:i}=e;const a={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:o};for(let e=0;e{if(!e.parser.settings.displayMode)throw new n("{"+e.envName+"} can be used only in display mode.")};function Rr(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Hr(e,t,r){let{hskipBeforeAndAfter:o,addJot:s,cols:i,arraystretch:a,colSeparationType:l,autoTag:h,singleRow:c,emptySingleRow:m,maxNumCols:p,leqno:u}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){const t=e.gullet.expandMacroAsText("\\arraystretch");if(null==t)a=1;else if(a=parseFloat(t),!a||a<0)throw new n("Invalid \\arraystretch: "+t)}e.gullet.beginGroup();let d=[];const g=[d],f=[],b=[],y=null!=h?[]:void 0;function x(){h&&e.gullet.macros.set("\\@eqnsw","1",!0)}function w(){y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new Nr("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(h)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(x(),b.push(qr(e));;){let t=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),t={type:"ordgroup",mode:e.mode,body:t},r&&(t={type:"styling",mode:e.mode,style:r,body:[t]}),d.push(t);const o=e.fetch().text;if("&"===o){if(p&&d.length===p){if(c||l)throw new n("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===o){w(),1===d.length&&"styling"===t.type&&0===t.body[0].body.length&&(g.length>1||!m)&&g.pop(),b.length0&&(x+=.25),c.push({pos:x,isDashed:e[t]})}for(v(i[0]),r=0;r0&&(p+=y,le)))for(r=0;r=a)continue;(o>0||e.hskipBeforeAndAfter)&&(i=l.deflt(c.pregap,u),0!==i&&(z=Ve.makeSpan(["arraycolsep"],[]),z.style.width=F(i),M.push(z)));let d=[];for(r=0;r0){const e=Ve.makeLineSpan("hline",t,m),r=Ve.makeLineSpan("hdashline",t,m),n=[{type:"elem",elem:h,shift:0}];for(;c.length>0;){const t=c.pop(),o=t.pos-k;t.isDashed?n.push({type:"elem",elem:r,shift:o}):n.push({type:"elem",elem:e,shift:o})}h=Ve.makeVList({positionType:"individualShift",children:n},t)}if(0===T.length)return Ve.makeSpan(["mord"],[h],t);{let e=Ve.makeVList({positionType:"individualShift",children:T},t);return e=Ve.makeSpan(["tag"],[e],t),Ve.makeFragment([h,e])}},Lr={c:"center ",l:"left ",r:"right "},Dr=function(e,t){const r=[],n=new gt.MathNode("mtd",[],["mtr-glue"]),o=new gt.MathNode("mtd",[],["mml-eqn-num"]);for(let s=0;s0){const t=e.cols;let r="",n=!1,o=0,i=t.length;"separator"===t[0].type&&(a+="top ",o=1),"separator"===t[t.length-1].type&&(a+="bottom ",i-=1);for(let e=o;e0?"left ":"",a+=c[c.length-1].length>0?"right ":"";for(let e=1;e-1?"alignat":"align",s="split"===e.envName,i=Hr(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:Rr(e.envName),emptySingleRow:!0,colSeparationType:o,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display");let a,l=0;const h={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){let e="";for(let r=0;r0&&c&&(n=1),r[e]={type:"align",align:t,pregap:n,postgap:0}}return i.colSeparationType=c?"align":"alignat",i};Ar({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){const r=(Rt(t[0])?[t[0]]:qt(t[0],"ordgroup").body).map((function(e){const t=It(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new n("Unknown column alignment: "+t,e)})),o={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return Hr(e.parser,o,Or(e.envName))},htmlBuilder:Er,mathmlBuilder:Dr}),Ar({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){const t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")];let r="c";const o={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if("*"===e.envName.charAt(e.envName.length-1)){const t=e.parser;if(t.consumeSpaces(),"["===t.fetch().text){if(t.consume(),t.consumeSpaces(),r=t.fetch().text,-1==="lcr".indexOf(r))throw new n("Expected l or c or r",t.nextToken);t.consume(),t.consumeSpaces(),t.expect("]"),t.consume(),o.cols=[{type:"align",align:r}]}}const s=Hr(e.parser,o,Or(e.envName)),i=Math.max(0,...s.body.map((e=>e.length)));return s.cols=new Array(i).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:Er,mathmlBuilder:Dr}),Ar({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){const t=Hr(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Er,mathmlBuilder:Dr}),Ar({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){const r=(Rt(t[0])?[t[0]]:qt(t[0],"ordgroup").body).map((function(e){const t=It(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new n("Unknown column alignment: "+t,e)}));if(r.length>1)throw new n("{subarray} can contain only one column");let o={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5};if(o=Hr(e.parser,o,"script"),o.body.length>0&&o.body[0].length>1)throw new n("{subarray} can contain only one column");return o},htmlBuilder:Er,mathmlBuilder:Dr}),Ar({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){const t=Hr(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Or(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Er,mathmlBuilder:Dr}),Ar({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Vr,htmlBuilder:Er,mathmlBuilder:Dr}),Ar({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){l.contains(["gather","gather*"],e.envName)&&Ir(e);const t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Rr(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Hr(e.parser,t,"display")},htmlBuilder:Er,mathmlBuilder:Dr}),Ar({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Vr,htmlBuilder:Er,mathmlBuilder:Dr}),Ar({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ir(e);const t={autoTag:Rr(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Hr(e.parser,t,"display")},htmlBuilder:Er,mathmlBuilder:Dr}),Ar({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Ir(e),function(e){const t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();const r=e.fetch().text;if("&"!==r&&"\\\\"!==r){if("\\end"===r){0===t[t.length-1].length&&t.pop();break}throw new n("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}let r=[];const o=[r];for(let a=0;a-1);else{if(!("<>AV".indexOf(o)>-1))throw new n('Expected one of "<>AV=|." after @',l[t]);for(let e=0;e<2;e++){let r=!0;for(let h=t+1;h{const r=e.font,n=t.withFont(r);return ht(e.body,n)},Gr=(e,t)=>{const r=e.font,n=t.withFont(r);return vt(e.body,n)},Ur={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};je({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=Ze(t[0]);let s=n;return s in Ur&&(s=Ur[s]),{type:"font",mode:r.mode,font:s.slice(1),body:o}},htmlBuilder:Fr,mathmlBuilder:Gr}),je({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{let{parser:r}=e;const n=t[0],o=l.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:Ft(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:o}}}),je({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{let{parser:r,funcName:n,breakOnTokenText:o}=e;const{mode:s}=r,i=r.parseExpression(!0,o);return{type:"font",mode:s,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:i}}},htmlBuilder:Fr,mathmlBuilder:Gr});const Yr=(e,t)=>{let r=t;return"display"===e?r=r.id>=w.SCRIPT.id?r.text():w.DISPLAY:"text"===e&&r.size===w.DISPLAY.size?r=w.TEXT:"script"===e?r=w.SCRIPT:"scriptscript"===e&&(r=w.SCRIPTSCRIPT),r},Xr=(e,t)=>{const r=Yr(e.size,t.style),n=r.fracNum(),o=r.fracDen();let s;s=t.havingStyle(n);const i=ht(e.numer,s,t);if(e.continued){const e=8.5/t.fontMetrics().ptPerEm,r=3.5/t.fontMetrics().ptPerEm;i.height=i.height0?3*c:7*c,u=t.fontMetrics().denom1):(h>0?(m=t.fontMetrics().num2,p=c):(m=t.fontMetrics().num3,p=3*c),u=t.fontMetrics().denom2),l){const e=t.fontMetrics().axisHeight;m-i.depth-(e+.5*h){let r=new gt.MathNode("mfrac",[vt(e.numer,t),vt(e.denom,t)]);if(e.hasBarLine){if(e.barSize){const n=P(e.barSize,t);r.setAttribute("linethickness",F(n))}}else r.setAttribute("linethickness","0px");const n=Yr(e.size,t.style);if(n.size!==t.style.size){r=new gt.MathNode("mstyle",[r]);const e=n.size===w.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",e),r.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){const t=[];if(null!=e.leftDelim){const r=new gt.MathNode("mo",[new gt.TextNode(e.leftDelim.replace("\\",""))]);r.setAttribute("fence","true"),t.push(r)}if(t.push(r),null!=e.rightDelim){const r=new gt.MathNode("mo",[new gt.TextNode(e.rightDelim.replace("\\",""))]);r.setAttribute("fence","true"),t.push(r)}return bt(t)}return r};je({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0],s=t[1];let i,a=null,l=null,h="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":i=!0;break;case"\\\\atopfrac":i=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i=!1,a="(",l=")";break;case"\\\\bracefrac":i=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":i=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":h="display";break;case"\\tfrac":case"\\tbinom":h="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:o,denom:s,hasBarLine:i,leftDelim:a,rightDelim:l,size:h,barSize:null}},htmlBuilder:Xr,mathmlBuilder:Wr}),je({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0],s=t[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:o,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),je({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){let t,{parser:r,funcName:n,token:o}=e;switch(n){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:r.mode,replaceWith:t,token:o}}});const _r=["display","text","script","scriptscript"],jr=function(e){let t=null;return e.length>0&&(t=e,t="."===t?null:t),t};je({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){let{parser:r}=e;const n=t[4],o=t[5],s=Ze(t[0]),i="atom"===s.type&&"open"===s.family?jr(s.text):null,a=Ze(t[1]),l="atom"===a.type&&"close"===a.family?jr(a.text):null,h=qt(t[2],"size");let c,m=null;h.isBlank?c=!0:(m=h.value,c=m.number>0);let p="auto",u=t[3];if("ordgroup"===u.type){if(u.body.length>0){const e=qt(u.body[0],"textord");p=_r[Number(e.text)]}}else u=qt(u,"textord"),p=_r[Number(u.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:o,continued:!1,hasBarLine:c,barSize:m,leftDelim:i,rightDelim:l,size:p}},htmlBuilder:Xr,mathmlBuilder:Wr}),je({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){let{parser:r,funcName:n,token:o}=e;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:qt(t[0],"size").value,token:o}}}),je({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0],s=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(qt(t[1],"infix").size),i=t[2],a=s.number>0;return{type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Xr,mathmlBuilder:Wr});const $r=(e,t)=>{const r=t.style;let n,o;"supsub"===e.type?(n=e.sup?ht(e.sup,t.havingStyle(r.sup()),t):ht(e.sub,t.havingStyle(r.sub()),t),o=qt(e.base,"horizBrace")):o=qt(e,"horizBrace");const s=ht(o.base,t.havingBaseStyle(w.DISPLAY)),i=Nt(o,t);let a;if(o.isOver?(a=Ve.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:i}]},t),a.children[0].children[0].children[1].classes.push("svg-align")):(a=Ve.makeVList({positionType:"bottom",positionData:s.depth+.1+i.height,children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:s}]},t),a.children[0].children[0].children[0].classes.push("svg-align")),n){const e=Ve.makeSpan(["mord",o.isOver?"mover":"munder"],[a],t);a=o.isOver?Ve.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:e},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Ve.makeVList({positionType:"bottom",positionData:e.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:e}]},t)}return Ve.makeSpan(["mord",o.isOver?"mover":"munder"],[a],t)};je({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){let{parser:r,funcName:n}=e;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:$r,mathmlBuilder:(e,t)=>{const r=Ct(e.label);return new gt.MathNode(e.isOver?"mover":"munder",[vt(e.base,t),r])}}),je({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[1],o=qt(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:r.mode,href:o,body:Ke(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{const r=nt(e.body,t,!1);return Ve.makeAnchor(e.href,[],r,t)},mathmlBuilder:(e,t)=>{let r=wt(e.body,t);return r instanceof ut||(r=new ut("mrow",[r])),r.setAttribute("href",e.href),r}}),je({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=qt(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");const o=[];for(let e=0;e{let{parser:r,funcName:o,token:s}=e;const i=qt(t[0],"raw").string,a=t[1];let l;r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");const h={};switch(o){case"\\htmlClass":h.class=i,l={command:"\\htmlClass",class:i};break;case"\\htmlId":h.id=i,l={command:"\\htmlId",id:i};break;case"\\htmlStyle":h.style=i,l={command:"\\htmlStyle",style:i};break;case"\\htmlData":{const e=i.split(",");for(let t=0;t{const r=nt(e.body,t,!1),n=["enclosing"];e.attributes.class&&n.push(...e.attributes.class.trim().split(/\s+/));const o=Ve.makeSpan(n,r,t);for(const t in e.attributes)"class"!==t&&e.attributes.hasOwnProperty(t)&&o.setAttribute(t,e.attributes[t]);return o},mathmlBuilder:(e,t)=>wt(e.body,t)}),je({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;return{type:"htmlmathml",mode:r.mode,html:Ke(t[0]),mathml:Ke(t[1])}},htmlBuilder:(e,t)=>{const r=nt(e.html,t,!1);return Ve.makeFragment(r)},mathmlBuilder:(e,t)=>wt(e.mathml,t)});const Zr=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};{const t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new n("Invalid size: '"+e+"' in \\includegraphics");const r={number:+(t[1]+t[2]),unit:t[3]};if(!V(r))throw new n("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r}};je({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,r)=>{let{parser:o}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},l="";if(r[0]){const e=qt(r[0],"raw").string.split(",");for(let t=0;t{const r=P(e.height,t);let n=0;e.totalheight.number>0&&(n=P(e.totalheight,t)-r);let o=0;e.width.number>0&&(o=P(e.width,t));const s={height:F(r+n)};o>0&&(s.width=F(o)),n>0&&(s.verticalAlign=F(-n));const i=new j(e.src,e.alt,s);return i.height=r,i.depth=n,i},mathmlBuilder:(e,t)=>{const r=new gt.MathNode("mglyph",[]);r.setAttribute("alt",e.alt);const n=P(e.height,t);let o=0;if(e.totalheight.number>0&&(o=P(e.totalheight,t)-n,r.setAttribute("valign",F(-o))),r.setAttribute("height",F(n+o)),e.width.number>0){const n=P(e.width,t);r.setAttribute("width",F(n))}return r.setAttribute("src",e.src),r}}),je({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){let{parser:r,funcName:n}=e;const o=qt(t[0],"size");if(r.settings.strict){const e="m"===n[1],t="mu"===o.value.unit;e?(t||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+o.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):t&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:o.value}},htmlBuilder(e,t){return Ve.makeGlue(e.dimension,t)},mathmlBuilder(e,t){const r=P(e.dimension,t);return new gt.SpaceNode(r)}}),je({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:o}},htmlBuilder:(e,t)=>{let r;"clap"===e.alignment?(r=Ve.makeSpan([],[ht(e.body,t)]),r=Ve.makeSpan(["inner"],[r],t)):r=Ve.makeSpan(["inner"],[ht(e.body,t)]);const n=Ve.makeSpan(["fix"],[]);let o=Ve.makeSpan([e.alignment],[r,n],t);const s=Ve.makeSpan(["strut"]);return s.style.height=F(o.height+o.depth),o.depth&&(s.style.verticalAlign=F(-o.depth)),o.children.unshift(s),o=Ve.makeSpan(["thinbox"],[o],t),Ve.makeSpan(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{const r=new gt.MathNode("mpadded",[vt(e.body,t)]);if("rlap"!==e.alignment){const t="llap"===e.alignment?"-1":"-0.5";r.setAttribute("lspace",t+"width")}return r.setAttribute("width","0px"),r}}),je({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){let{funcName:r,parser:n}=e;const o=n.mode;n.switchMode("math");const s="\\("===r?"\\)":"$",i=n.parseExpression(!1,s);return n.expect(s),n.switchMode(o),{type:"styling",mode:n.mode,style:"text",body:i}}}),je({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new n("Mismatched "+e.funcName)}});const Kr=(e,t)=>{switch(t.style.size){case w.DISPLAY.size:return e.display;case w.TEXT.size:return e.text;case w.SCRIPT.size:return e.script;case w.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};je({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{let{parser:r}=e;return{type:"mathchoice",mode:r.mode,display:Ke(t[0]),text:Ke(t[1]),script:Ke(t[2]),scriptscript:Ke(t[3])}},htmlBuilder:(e,t)=>{const r=Kr(e,t),n=nt(r,t,!1);return Ve.makeFragment(n)},mathmlBuilder:(e,t)=>{const r=Kr(e,t);return wt(r,t)}});const Jr=(e,t,r,n,o,s,i)=>{e=Ve.makeSpan([],[e]);const a=r&&l.isCharacterBox(r);let h,c,m;if(t){const e=ht(t,n.havingStyle(o.sup()),n);c={elem:e,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-e.depth)}}if(r){const e=ht(r,n.havingStyle(o.sub()),n);h={elem:e,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-e.height)}}if(c&&h){const t=n.fontMetrics().bigOpSpacing5+h.elem.height+h.elem.depth+h.kern+e.depth+i;m=Ve.makeVList({positionType:"bottom",positionData:t,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:F(-s)},{type:"kern",size:h.kern},{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:F(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(h){const t=e.height-i;m=Ve.makeVList({positionType:"top",positionData:t,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:F(-s)},{type:"kern",size:h.kern},{type:"elem",elem:e}]},n)}else{if(!c)return e;{const t=e.depth+i;m=Ve.makeVList({positionType:"bottom",positionData:t,children:[{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:F(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}}const p=[m];if(h&&0!==s&&!a){const e=Ve.makeSpan(["mspace"],[],n);e.style.marginRight=F(s),p.unshift(e)}return Ve.makeSpan(["mop","op-limits"],p,n)},Qr=["\\smallint"],en=(e,t)=>{let r,n,o,s=!1;"supsub"===e.type?(r=e.sup,n=e.sub,o=qt(e.base,"op"),s=!0):o=qt(e,"op");const i=t.style;let a,h=!1;if(i.size===w.DISPLAY.size&&o.symbol&&!l.contains(Qr,o.name)&&(h=!0),o.symbol){const e=h?"Size2-Regular":"Size1-Regular";let r="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(r=o.name.slice(1),o.name="oiint"===r?"\\iint":"\\iiint"),a=Ve.makeSymbol(o.name,e,"math",t,["mop","op-symbol",h?"large-op":"small-op"]),r.length>0){const e=a.italic,n=Ve.staticSvg(r+"Size"+(h?"2":"1"),t);a=Ve.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:n,shift:h?.08:0}]},t),o.name="\\"+r,a.classes.unshift("mop"),a.italic=e}}else if(o.body){const e=nt(o.body,t,!0);1===e.length&&e[0]instanceof Z?(a=e[0],a.classes[0]="mop"):a=Ve.makeSpan(["mop"],e,t)}else{const e=[];for(let r=1;r{let r;if(e.symbol)r=new ut("mo",[ft(e.name,e.mode)]),l.contains(Qr,e.name)&&r.setAttribute("largeop","false");else if(e.body)r=new ut("mo",xt(e.body,t));else{r=new ut("mi",[new dt(e.name.slice(1))]);const t=new ut("mo",[ft("\u2061","text")]);r=e.parentIsSupSub?new ut("mrow",[r,t]):pt([r,t])}return r},rn={"\u220f":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22c0":"\\bigwedge","\u22c1":"\\bigvee","\u22c2":"\\bigcap","\u22c3":"\\bigcup","\u2a00":"\\bigodot","\u2a01":"\\bigoplus","\u2a02":"\\bigotimes","\u2a04":"\\biguplus","\u2a06":"\\bigsqcup"};je({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220f","\u2210","\u2211","\u22c0","\u22c1","\u22c2","\u22c3","\u2a00","\u2a01","\u2a02","\u2a04","\u2a06"],props:{numArgs:0},handler:(e,t)=>{let{parser:r,funcName:n}=e,o=n;return 1===o.length&&(o=rn[o]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:en,mathmlBuilder:tn}),je({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ke(n)}},htmlBuilder:en,mathmlBuilder:tn});const nn={"\u222b":"\\int","\u222c":"\\iint","\u222d":"\\iiint","\u222e":"\\oint","\u222f":"\\oiint","\u2230":"\\oiiint"};je({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){let{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:en,mathmlBuilder:tn}),je({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){let{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:en,mathmlBuilder:tn}),je({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222b","\u222c","\u222d","\u222e","\u222f","\u2230"],props:{numArgs:0},handler(e){let{parser:t,funcName:r}=e,n=r;return 1===n.length&&(n=nn[n]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:en,mathmlBuilder:tn});const on=(e,t)=>{let r,n,o,s,i=!1;if("supsub"===e.type?(r=e.sup,n=e.sub,o=qt(e.base,"operatorname"),i=!0):o=qt(e,"operatorname"),o.body.length>0){const e=o.body.map((e=>{const t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),r=nt(e,t.withFont("mathrm"),!0);for(let e=0;e{let{parser:r,funcName:n}=e;const o=t[0];return{type:"operatorname",mode:r.mode,body:Ke(o),alwaysHandleSupSub:"\\operatornamewithlimits"===n,limits:!1,parentIsSupSub:!1}},htmlBuilder:on,mathmlBuilder:(e,t)=>{let r=xt(e.body,t.withFont("mathrm")),n=!0;for(let e=0;ee.toText())).join("");r=[new gt.TextNode(e)]}const o=new gt.MathNode("mi",r);o.setAttribute("mathvariant","normal");const s=new gt.MathNode("mo",[ft("\u2061","text")]);return e.parentIsSupSub?new gt.MathNode("mrow",[o,s]):gt.newDocumentFragment([o,s])}}),Br("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),$e({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Ve.makeFragment(nt(e.body,t,!1)):Ve.makeSpan(["mord"],nt(e.body,t,!0),t)},mathmlBuilder(e,t){return wt(e.body,t,!0)}}),je({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){let{parser:r}=e;const n=t[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(e,t){const r=ht(e.body,t.havingCrampedStyle()),n=Ve.makeLineSpan("overline-line",t),o=t.fontMetrics().defaultRuleThickness,s=Ve.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n},{type:"kern",size:o}]},t);return Ve.makeSpan(["mord","overline"],[s],t)},mathmlBuilder(e,t){const r=new gt.MathNode("mo",[new gt.TextNode("\u203e")]);r.setAttribute("stretchy","true");const n=new gt.MathNode("mover",[vt(e.body,t),r]);return n.setAttribute("accent","true"),n}}),je({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"phantom",mode:r.mode,body:Ke(n)}},htmlBuilder:(e,t)=>{const r=nt(e.body,t.withPhantom(),!1);return Ve.makeFragment(r)},mathmlBuilder:(e,t)=>{const r=xt(e.body,t);return new gt.MathNode("mphantom",r)}}),je({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:(e,t)=>{let r=Ve.makeSpan([],[ht(e.body,t.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(let e=0;e{const r=xt(Ke(e.body),t),n=new gt.MathNode("mphantom",r),o=new gt.MathNode("mpadded",[n]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),je({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(e,t)=>{const r=Ve.makeSpan(["inner"],[ht(e.body,t.withPhantom())]),n=Ve.makeSpan(["fix"],[]);return Ve.makeSpan(["mord","rlap"],[r,n],t)},mathmlBuilder:(e,t)=>{const r=xt(Ke(e.body),t),n=new gt.MathNode("mphantom",r),o=new gt.MathNode("mpadded",[n]);return o.setAttribute("width","0px"),o}}),je({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){let{parser:r}=e;const n=qt(t[0],"size").value,o=t[1];return{type:"raisebox",mode:r.mode,dy:n,body:o}},htmlBuilder(e,t){const r=ht(e.body,t),n=P(e.dy,t);return Ve.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},t)},mathmlBuilder(e,t){const r=new gt.MathNode("mpadded",[vt(e.body,t)]),n=e.dy.number+e.dy.unit;return r.setAttribute("voffset",n),r}}),je({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){let{parser:t}=e;return{type:"internal",mode:t.mode}}}),je({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,r){let{parser:n}=e;const o=r[0],s=qt(t[0],"size"),i=qt(t[1],"size");return{type:"rule",mode:n.mode,shift:o&&qt(o,"size").value,width:s.value,height:i.value}},htmlBuilder(e,t){const r=Ve.makeSpan(["mord","rule"],[],t),n=P(e.width,t),o=P(e.height,t),s=e.shift?P(e.shift,t):0;return r.style.borderRightWidth=F(n),r.style.borderTopWidth=F(o),r.style.bottom=F(s),r.width=n,r.height=o+s,r.depth=-s,r.maxFontSize=1.125*o*t.sizeMultiplier,r},mathmlBuilder(e,t){const r=P(e.width,t),n=P(e.height,t),o=e.shift?P(e.shift,t):0,s=t.color&&t.getColor()||"black",i=new gt.MathNode("mspace");i.setAttribute("mathbackground",s),i.setAttribute("width",F(r)),i.setAttribute("height",F(n));const a=new gt.MathNode("mpadded",[i]);return o>=0?a.setAttribute("height",F(o)):(a.setAttribute("height",F(o)),a.setAttribute("depth",F(-o))),a.setAttribute("voffset",F(o)),a}});const an=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];je({type:"sizing",names:an,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{let{breakOnTokenText:r,funcName:n,parser:o}=e;const s=o.parseExpression(!1,r);return{type:"sizing",mode:o.mode,size:an.indexOf(n)+1,body:s}},htmlBuilder:(e,t)=>{const r=t.havingSize(e.size);return sn(e.body,r,t)},mathmlBuilder:(e,t)=>{const r=t.havingSize(e.size),n=xt(e.body,r),o=new gt.MathNode("mstyle",n);return o.setAttribute("mathsize",F(r.sizeMultiplier)),o}}),je({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,r)=>{let{parser:n}=e,o=!1,s=!1;const i=r[0]&&qt(r[0],"ordgroup");if(i){let e="";for(let t=0;t{const r=Ve.makeSpan([],[ht(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return r;if(e.smashHeight&&(r.height=0,r.children))for(let e=0;e{const r=new gt.MathNode("mpadded",[vt(e.body,t)]);return e.smashHeight&&r.setAttribute("height","0px"),e.smashDepth&&r.setAttribute("depth","0px"),r}}),je({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){let{parser:n}=e;const o=r[0],s=t[0];return{type:"sqrt",mode:n.mode,body:s,index:o}},htmlBuilder(e,t){let r=ht(e.body,t.havingCrampedStyle());0===r.height&&(r.height=t.fontMetrics().xHeight),r=Ve.wrapFragment(r,t);const n=t.fontMetrics().defaultRuleThickness;let o=n;t.style.idr.height+r.depth+s&&(s=(s+c-r.height-r.depth)/2);const m=a.height-r.height-s-l;r.style.paddingLeft=F(h);const p=Ve.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+m)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){const r=t.havingStyle(w.SCRIPTSCRIPT),n=ht(e.index,r,t),o=.6*(p.height-p.depth),s=Ve.makeVList({positionType:"shift",positionData:-o,children:[{type:"elem",elem:n}]},t),i=Ve.makeSpan(["root"],[s]);return Ve.makeSpan(["mord","sqrt"],[i,p],t)}return Ve.makeSpan(["mord","sqrt"],[p],t)},mathmlBuilder(e,t){const{body:r,index:n}=e;return n?new gt.MathNode("mroot",[vt(r,t),vt(n,t)]):new gt.MathNode("msqrt",[vt(r,t)])}});const ln={display:w.DISPLAY,text:w.TEXT,script:w.SCRIPT,scriptscript:w.SCRIPTSCRIPT};je({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){let{breakOnTokenText:r,funcName:n,parser:o}=e;const s=o.parseExpression(!0,r),i=n.slice(1,n.length-5);return{type:"styling",mode:o.mode,style:i,body:s}},htmlBuilder(e,t){const r=ln[e.style],n=t.havingStyle(r).withFont("");return sn(e.body,n,t)},mathmlBuilder(e,t){const r=ln[e.style],n=t.havingStyle(r),o=xt(e.body,n),s=new gt.MathNode("mstyle",o),i={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return s.setAttribute("scriptlevel",i[0]),s.setAttribute("displaystyle",i[1]),s}});$e({type:"supsub",htmlBuilder(e,t){const r=function(e,t){const r=e.base;if(r)return"op"===r.type?r.limits&&(t.style.size===w.DISPLAY.size||r.alwaysHandleSupSub)?en:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(t.style.size===w.DISPLAY.size||r.limits)?on:null:"accent"===r.type?l.isCharacterBox(r.base)?Ht:null:"horizBrace"===r.type&&!e.sub===r.isOver?$r:null;return null}(e,t);if(r)return r(e,t);const{base:n,sup:o,sub:s}=e,i=ht(n,t);let a,h;const c=t.fontMetrics();let m=0,p=0;const u=n&&l.isCharacterBox(n);if(o){const e=t.havingStyle(t.style.sup());a=ht(o,e,t),u||(m=i.height-e.fontMetrics().supDrop*e.sizeMultiplier/t.sizeMultiplier)}if(s){const e=t.havingStyle(t.style.sub());h=ht(s,e,t),u||(p=i.depth+e.fontMetrics().subDrop*e.sizeMultiplier/t.sizeMultiplier)}let d;d=t.style===w.DISPLAY?c.sup1:t.style.cramped?c.sup3:c.sup2;const g=t.sizeMultiplier,f=F(.5/c.ptPerEm/g);let b,y=null;if(h){const t=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(i instanceof Z||t)&&(y=F(-i.italic))}if(a&&h){m=Math.max(m,d,a.depth+.25*c.xHeight),p=Math.max(p,c.sub2);const e=4*c.defaultRuleThickness;if(m-a.depth-(h.height-p)0&&(m+=t,p-=t)}const r=[{type:"elem",elem:h,shift:p,marginRight:f,marginLeft:y},{type:"elem",elem:a,shift:-m,marginRight:f}];b=Ve.makeVList({positionType:"individualShift",children:r},t)}else if(h){p=Math.max(p,c.sub1,h.height-.8*c.xHeight);const e=[{type:"elem",elem:h,marginLeft:y,marginRight:f}];b=Ve.makeVList({positionType:"shift",positionData:p,children:e},t)}else{if(!a)throw new Error("supsub must have either sup or sub.");m=Math.max(m,d,a.depth+.25*c.xHeight),b=Ve.makeVList({positionType:"shift",positionData:-m,children:[{type:"elem",elem:a,marginRight:f}]},t)}const x=at(i,"right")||"mord";return Ve.makeSpan([x],[i,Ve.makeSpan(["msupsub"],[b])],t)},mathmlBuilder(e,t){let r,n,o=!1;e.base&&"horizBrace"===e.base.type&&(n=!!e.sup,n===e.base.isOver&&(o=!0,r=e.base.isOver)),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);const s=[vt(e.base,t)];let i;if(e.sub&&s.push(vt(e.sub,t)),e.sup&&s.push(vt(e.sup,t)),o)i=r?"mover":"munder";else if(e.sub)if(e.sup){const r=e.base;i=r&&"op"===r.type&&r.limits&&t.style===w.DISPLAY||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(t.style===w.DISPLAY||r.limits)?"munderover":"msubsup"}else{const r=e.base;i=r&&"op"===r.type&&r.limits&&(t.style===w.DISPLAY||r.alwaysHandleSupSub)||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(r.limits||t.style===w.DISPLAY)?"munder":"msub"}else{const r=e.base;i=r&&"op"===r.type&&r.limits&&(t.style===w.DISPLAY||r.alwaysHandleSupSub)||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(r.limits||t.style===w.DISPLAY)?"mover":"msup"}return new gt.MathNode(i,s)}}),$e({type:"atom",htmlBuilder(e,t){return Ve.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){const r=new gt.MathNode("mo",[ft(e.text,e.mode)]);if("bin"===e.family){const n=yt(e,t);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===e.family?r.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||r.setAttribute("stretchy","false");return r}});const hn={mi:"italic",mn:"normal",mtext:"normal"};$e({type:"mathord",htmlBuilder(e,t){return Ve.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){const r=new gt.MathNode("mi",[ft(e.text,e.mode,t)]),n=yt(e,t)||"italic";return n!==hn[r.type]&&r.setAttribute("mathvariant",n),r}}),$e({type:"textord",htmlBuilder(e,t){return Ve.makeOrd(e,t,"textord")},mathmlBuilder(e,t){const r=ft(e.text,e.mode,t),n=yt(e,t)||"normal";let o;return o="text"===e.mode?new gt.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new gt.MathNode("mn",[r]):"\\prime"===e.text?new gt.MathNode("mo",[r]):new gt.MathNode("mi",[r]),n!==hn[o.type]&&o.setAttribute("mathvariant",n),o}});const cn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},mn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};$e({type:"spacing",htmlBuilder(e,t){if(mn.hasOwnProperty(e.text)){const r=mn[e.text].className||"";if("text"===e.mode){const n=Ve.makeOrd(e,t,"textord");return n.classes.push(r),n}return Ve.makeSpan(["mspace",r],[Ve.mathsym(e.text,e.mode,t)],t)}if(cn.hasOwnProperty(e.text))return Ve.makeSpan(["mspace",cn[e.text]],[],t);throw new n('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){let r;if(!mn.hasOwnProperty(e.text)){if(cn.hasOwnProperty(e.text))return new gt.MathNode("mspace");throw new n('Unknown type of space "'+e.text+'"')}return r=new gt.MathNode("mtext",[new gt.TextNode("\xa0")]),r}});const pn=()=>{const e=new gt.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};$e({type:"tag",mathmlBuilder(e,t){const r=new gt.MathNode("mtable",[new gt.MathNode("mtr",[pn(),new gt.MathNode("mtd",[wt(e.body,t)]),pn(),new gt.MathNode("mtd",[wt(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});const un={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},dn={"\\textbf":"textbf","\\textmd":"textmd"},gn={"\\textit":"textit","\\textup":"textup"},fn=(e,t)=>{const r=e.font;return r?un[r]?t.withTextFontFamily(un[r]):dn[r]?t.withTextFontWeight(dn[r]):t.withTextFontShape(gn[r]):t};je({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){let{parser:r,funcName:n}=e;const o=t[0];return{type:"text",mode:r.mode,body:Ke(o),font:n}},htmlBuilder(e,t){const r=fn(e,t),n=nt(e.body,r,!0);return Ve.makeSpan(["mord","text"],n,r)},mathmlBuilder(e,t){const r=fn(e,t);return wt(e.body,r)}}),je({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r}=e;return{type:"underline",mode:r.mode,body:t[0]}},htmlBuilder(e,t){const r=ht(e.body,t),n=Ve.makeLineSpan("underline-line",t),o=t.fontMetrics().defaultRuleThickness,s=Ve.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:o},{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r}]},t);return Ve.makeSpan(["mord","underline"],[s],t)},mathmlBuilder(e,t){const r=new gt.MathNode("mo",[new gt.TextNode("\u203e")]);r.setAttribute("stretchy","true");const n=new gt.MathNode("munder",[vt(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),je({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){let{parser:r}=e;return{type:"vcenter",mode:r.mode,body:t[0]}},htmlBuilder(e,t){const r=ht(e.body,t),n=t.fontMetrics().axisHeight,o=.5*(r.height-n-(r.depth+n));return Ve.makeVList({positionType:"shift",positionData:o,children:[{type:"elem",elem:r}]},t)},mathmlBuilder(e,t){return new gt.MathNode("mpadded",[vt(e.body,t)],["vcenter"])}}),je({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,r){throw new n("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){const r=bn(e),n=[],o=t.havingStyle(t.style.text());for(let t=0;te.body.replace(/ /g,e.star?"\u2423":"\xa0");var yn=Xe;const xn="[ \r\n\t]",wn="(\\\\[a-zA-Z@]+)"+xn+"*",vn="[\u0300-\u036f]",kn=new RegExp(vn+"+$"),Sn="("+xn+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-\u2027\u202a-\ud7ff\uf900-\uffff]"+vn+"*|[\ud800-\udbff][\udc00-\udfff]"+vn+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+wn+"|\\\\[^\ud800-\udfff])";class Mn{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Sn,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){const e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Nr("EOF",new Cr(this,t,t));const r=this.tokenRegex.exec(e);if(null===r||r.index!==t)throw new n("Unexpected character: '"+e[t]+"'",new Nr(e[t],new Cr(this,t,t+1)));const o=r[6]||r[3]||(r[2]?"\\ ":" ");if(14===this.catcodes[o]){const t=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===t?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=t+1,this.lex()}return new Nr(o,new Cr(this,t,this.tokenRegex.lastIndex))}}class zn{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new n("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");const e=this.undefStack.pop();for(const t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,r){if(void 0===r&&(r=!1),r){for(let t=0;t0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{const t=this.undefStack[this.undefStack.length-1];t&&!t.hasOwnProperty(e)&&(t[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var An=Tr;Br("\\noexpand",(function(e){const t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),Br("\\expandafter",(function(e){const t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),Br("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),Br("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),Br("\\@ifnextchar",(function(e){const t=e.consumeArgs(3);e.consumeSpaces();const r=e.future();return 1===t[0].length&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),Br("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Br("\\TextOrMath",(function(e){const t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));const Tn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Br("\\char",(function(e){let t,r=e.popToken(),o="";if("'"===r.text)t=8,r=e.popToken();else if('"'===r.text)t=16,r=e.popToken();else if("`"===r.text)if(r=e.popToken(),"\\"===r.text[0])o=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new n("\\char` missing argument");o=r.text.charCodeAt(0)}else t=10;if(t){if(o=Tn[r.text],null==o||o>=t)throw new n("Invalid base-"+t+" digit "+r.text);let s;for(;null!=(s=Tn[e.future().text])&&s{let o=e.consumeArg().tokens;if(1!==o.length)throw new n("\\newcommand's first argument must be a macro name");const s=o[0].text,i=e.isDefined(s);if(i&&!t)throw new n("\\newcommand{"+s+"} attempting to redefine "+s+"; use \\renewcommand");if(!i&&!r)throw new n("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");let a=0;if(o=e.consumeArg().tokens,1===o.length&&"["===o[0].text){let t="",r=e.expandNextToken();for(;"]"!==r.text&&"EOF"!==r.text;)t+=r.text,r=e.expandNextToken();if(!t.match(/^\s*[0-9]+\s*$/))throw new n("Invalid number of arguments: "+t);a=parseInt(t),o=e.consumeArg().tokens}return e.macros.set(s,{tokens:o,numArgs:a}),""};Br("\\newcommand",(e=>Bn(e,!1,!0))),Br("\\renewcommand",(e=>Bn(e,!0,!1))),Br("\\providecommand",(e=>Bn(e,!0,!0))),Br("\\message",(e=>{const t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),Br("\\errmessage",(e=>{const t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),Br("\\show",(e=>{const t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),yn[r],oe.math[r],oe.text[r]),""})),Br("\\bgroup","{"),Br("\\egroup","}"),Br("~","\\nobreakspace"),Br("\\lq","`"),Br("\\rq","'"),Br("\\aa","\\r a"),Br("\\AA","\\r A"),Br("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xa9}"),Br("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Br("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xae}"),Br("\u212c","\\mathscr{B}"),Br("\u2130","\\mathscr{E}"),Br("\u2131","\\mathscr{F}"),Br("\u210b","\\mathscr{H}"),Br("\u2110","\\mathscr{I}"),Br("\u2112","\\mathscr{L}"),Br("\u2133","\\mathscr{M}"),Br("\u211b","\\mathscr{R}"),Br("\u212d","\\mathfrak{C}"),Br("\u210c","\\mathfrak{H}"),Br("\u2128","\\mathfrak{Z}"),Br("\\Bbbk","\\Bbb{k}"),Br("\xb7","\\cdotp"),Br("\\llap","\\mathllap{\\textrm{#1}}"),Br("\\rlap","\\mathrlap{\\textrm{#1}}"),Br("\\clap","\\mathclap{\\textrm{#1}}"),Br("\\mathstrut","\\vphantom{(}"),Br("\\underbar","\\underline{\\text{#1}}"),Br("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Br("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),Br("\\ne","\\neq"),Br("\u2260","\\neq"),Br("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),Br("\u2209","\\notin"),Br("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),Br("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),Br("\u225a","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225a}}"),Br("\u225b","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225b}}"),Br("\u225d","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225d}}"),Br("\u225e","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225e}}"),Br("\u225f","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225f}}"),Br("\u27c2","\\perp"),Br("\u203c","\\mathclose{!\\mkern-0.8mu!}"),Br("\u220c","\\notni"),Br("\u231c","\\ulcorner"),Br("\u231d","\\urcorner"),Br("\u231e","\\llcorner"),Br("\u231f","\\lrcorner"),Br("\xa9","\\copyright"),Br("\xae","\\textregistered"),Br("\ufe0f","\\textregistered"),Br("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Br("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Br("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Br("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Br("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),Br("\u22ee","\\vdots"),Br("\\varGamma","\\mathit{\\Gamma}"),Br("\\varDelta","\\mathit{\\Delta}"),Br("\\varTheta","\\mathit{\\Theta}"),Br("\\varLambda","\\mathit{\\Lambda}"),Br("\\varXi","\\mathit{\\Xi}"),Br("\\varPi","\\mathit{\\Pi}"),Br("\\varSigma","\\mathit{\\Sigma}"),Br("\\varUpsilon","\\mathit{\\Upsilon}"),Br("\\varPhi","\\mathit{\\Phi}"),Br("\\varPsi","\\mathit{\\Psi}"),Br("\\varOmega","\\mathit{\\Omega}"),Br("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Br("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Br("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Br("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Br("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Br("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");const Cn={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Br("\\dots",(function(e){let t="\\dotso";const r=e.expandAfterFuture().text;return r in Cn?t=Cn[r]:("\\not"===r.slice(0,4)||r in oe.math&&l.contains(["bin","rel"],oe.math[r].group))&&(t="\\dotsb"),t}));const Nn={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Br("\\dotso",(function(e){return e.future().text in Nn?"\\ldots\\,":"\\ldots"})),Br("\\dotsc",(function(e){const t=e.future().text;return t in Nn&&","!==t?"\\ldots\\,":"\\ldots"})),Br("\\cdots",(function(e){return e.future().text in Nn?"\\@cdots\\,":"\\@cdots"})),Br("\\dotsb","\\cdots"),Br("\\dotsm","\\cdots"),Br("\\dotsi","\\!\\cdots"),Br("\\dotsx","\\ldots\\,"),Br("\\DOTSI","\\relax"),Br("\\DOTSB","\\relax"),Br("\\DOTSX","\\relax"),Br("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Br("\\,","\\tmspace+{3mu}{.1667em}"),Br("\\thinspace","\\,"),Br("\\>","\\mskip{4mu}"),Br("\\:","\\tmspace+{4mu}{.2222em}"),Br("\\medspace","\\:"),Br("\\;","\\tmspace+{5mu}{.2777em}"),Br("\\thickspace","\\;"),Br("\\!","\\tmspace-{3mu}{.1667em}"),Br("\\negthinspace","\\!"),Br("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Br("\\negthickspace","\\tmspace-{5mu}{.277em}"),Br("\\enspace","\\kern.5em "),Br("\\enskip","\\hskip.5em\\relax"),Br("\\quad","\\hskip1em\\relax"),Br("\\qquad","\\hskip2em\\relax"),Br("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Br("\\tag@paren","\\tag@literal{({#1})}"),Br("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new n("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),Br("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Br("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Br("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Br("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Br("\\newline","\\\\\\relax"),Br("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");const qn=F(T["Main-Regular"]["T".charCodeAt(0)][1]-.7*T["Main-Regular"]["A".charCodeAt(0)][1]);Br("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+qn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Br("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+qn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Br("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Br("\\@hspace","\\hskip #1\\relax"),Br("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Br("\\ordinarycolon",":"),Br("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Br("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Br("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Br("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Br("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Br("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Br("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Br("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Br("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Br("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Br("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Br("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Br("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Br("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Br("\u2237","\\dblcolon"),Br("\u2239","\\eqcolon"),Br("\u2254","\\coloneqq"),Br("\u2255","\\eqqcolon"),Br("\u2a74","\\Coloneqq"),Br("\\ratio","\\vcentcolon"),Br("\\coloncolon","\\dblcolon"),Br("\\colonequals","\\coloneqq"),Br("\\coloncolonequals","\\Coloneqq"),Br("\\equalscolon","\\eqqcolon"),Br("\\equalscoloncolon","\\Eqqcolon"),Br("\\colonminus","\\coloneq"),Br("\\coloncolonminus","\\Coloneq"),Br("\\minuscolon","\\eqcolon"),Br("\\minuscoloncolon","\\Eqcolon"),Br("\\coloncolonapprox","\\Colonapprox"),Br("\\coloncolonsim","\\Colonsim"),Br("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Br("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Br("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Br("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Br("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220c}}"),Br("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Br("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Br("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Br("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Br("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Br("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Br("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Br("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Br("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),Br("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),Br("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),Br("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),Br("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),Br("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),Br("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),Br("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),Br("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),Br("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),Br("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228a}"),Br("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2acb}"),Br("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228b}"),Br("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2acc}"),Br("\\imath","\\html@mathml{\\@imath}{\u0131}"),Br("\\jmath","\\html@mathml{\\@jmath}{\u0237}"),Br("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27e6}}"),Br("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27e7}}"),Br("\u27e6","\\llbracket"),Br("\u27e7","\\rrbracket"),Br("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),Br("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),Br("\u2983","\\lBrace"),Br("\u2984","\\rBrace"),Br("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29b5}}"),Br("\u29b5","\\minuso"),Br("\\darr","\\downarrow"),Br("\\dArr","\\Downarrow"),Br("\\Darr","\\Downarrow"),Br("\\lang","\\langle"),Br("\\rang","\\rangle"),Br("\\uarr","\\uparrow"),Br("\\uArr","\\Uparrow"),Br("\\Uarr","\\Uparrow"),Br("\\N","\\mathbb{N}"),Br("\\R","\\mathbb{R}"),Br("\\Z","\\mathbb{Z}"),Br("\\alef","\\aleph"),Br("\\alefsym","\\aleph"),Br("\\Alpha","\\mathrm{A}"),Br("\\Beta","\\mathrm{B}"),Br("\\bull","\\bullet"),Br("\\Chi","\\mathrm{X}"),Br("\\clubs","\\clubsuit"),Br("\\cnums","\\mathbb{C}"),Br("\\Complex","\\mathbb{C}"),Br("\\Dagger","\\ddagger"),Br("\\diamonds","\\diamondsuit"),Br("\\empty","\\emptyset"),Br("\\Epsilon","\\mathrm{E}"),Br("\\Eta","\\mathrm{H}"),Br("\\exist","\\exists"),Br("\\harr","\\leftrightarrow"),Br("\\hArr","\\Leftrightarrow"),Br("\\Harr","\\Leftrightarrow"),Br("\\hearts","\\heartsuit"),Br("\\image","\\Im"),Br("\\infin","\\infty"),Br("\\Iota","\\mathrm{I}"),Br("\\isin","\\in"),Br("\\Kappa","\\mathrm{K}"),Br("\\larr","\\leftarrow"),Br("\\lArr","\\Leftarrow"),Br("\\Larr","\\Leftarrow"),Br("\\lrarr","\\leftrightarrow"),Br("\\lrArr","\\Leftrightarrow"),Br("\\Lrarr","\\Leftrightarrow"),Br("\\Mu","\\mathrm{M}"),Br("\\natnums","\\mathbb{N}"),Br("\\Nu","\\mathrm{N}"),Br("\\Omicron","\\mathrm{O}"),Br("\\plusmn","\\pm"),Br("\\rarr","\\rightarrow"),Br("\\rArr","\\Rightarrow"),Br("\\Rarr","\\Rightarrow"),Br("\\real","\\Re"),Br("\\reals","\\mathbb{R}"),Br("\\Reals","\\mathbb{R}"),Br("\\Rho","\\mathrm{P}"),Br("\\sdot","\\cdot"),Br("\\sect","\\S"),Br("\\spades","\\spadesuit"),Br("\\sub","\\subset"),Br("\\sube","\\subseteq"),Br("\\supe","\\supseteq"),Br("\\Tau","\\mathrm{T}"),Br("\\thetasym","\\vartheta"),Br("\\weierp","\\wp"),Br("\\Zeta","\\mathrm{Z}"),Br("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Br("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Br("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Br("\\bra","\\mathinner{\\langle{#1}|}"),Br("\\ket","\\mathinner{|{#1}\\rangle}"),Br("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Br("\\Bra","\\left\\langle#1\\right|"),Br("\\Ket","\\left|#1\\right\\rangle");const In=e=>t=>{const r=t.consumeArg().tokens,n=t.consumeArg().tokens,o=t.consumeArg().tokens,s=t.consumeArg().tokens,i=t.macros.get("|"),a=t.macros.get("\\|");t.macros.beginGroup();const l=t=>r=>{e&&(r.macros.set("|",i),o.length&&r.macros.set("\\|",a));let s=t;if(!t&&o.length){"|"===r.future().text&&(r.popToken(),s=!0)}return{tokens:s?o:n,numArgs:0}};t.macros.set("|",l(!1)),o.length&&t.macros.set("\\|",l(!0));const h=t.consumeArg().tokens,c=t.expandTokens([...s,...h,...r]);return t.macros.endGroup(),{tokens:c.reverse(),numArgs:0}};Br("\\bra@ket",In(!1)),Br("\\bra@set",In(!0)),Br("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Br("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Br("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Br("\\angln","{\\angl n}"),Br("\\blue","\\textcolor{##6495ed}{#1}"),Br("\\orange","\\textcolor{##ffa500}{#1}"),Br("\\pink","\\textcolor{##ff00af}{#1}"),Br("\\red","\\textcolor{##df0030}{#1}"),Br("\\green","\\textcolor{##28ae7b}{#1}"),Br("\\gray","\\textcolor{gray}{#1}"),Br("\\purple","\\textcolor{##9d38bd}{#1}"),Br("\\blueA","\\textcolor{##ccfaff}{#1}"),Br("\\blueB","\\textcolor{##80f6ff}{#1}"),Br("\\blueC","\\textcolor{##63d9ea}{#1}"),Br("\\blueD","\\textcolor{##11accd}{#1}"),Br("\\blueE","\\textcolor{##0c7f99}{#1}"),Br("\\tealA","\\textcolor{##94fff5}{#1}"),Br("\\tealB","\\textcolor{##26edd5}{#1}"),Br("\\tealC","\\textcolor{##01d1c1}{#1}"),Br("\\tealD","\\textcolor{##01a995}{#1}"),Br("\\tealE","\\textcolor{##208170}{#1}"),Br("\\greenA","\\textcolor{##b6ffb0}{#1}"),Br("\\greenB","\\textcolor{##8af281}{#1}"),Br("\\greenC","\\textcolor{##74cf70}{#1}"),Br("\\greenD","\\textcolor{##1fab54}{#1}"),Br("\\greenE","\\textcolor{##0d923f}{#1}"),Br("\\goldA","\\textcolor{##ffd0a9}{#1}"),Br("\\goldB","\\textcolor{##ffbb71}{#1}"),Br("\\goldC","\\textcolor{##ff9c39}{#1}"),Br("\\goldD","\\textcolor{##e07d10}{#1}"),Br("\\goldE","\\textcolor{##a75a05}{#1}"),Br("\\redA","\\textcolor{##fca9a9}{#1}"),Br("\\redB","\\textcolor{##ff8482}{#1}"),Br("\\redC","\\textcolor{##f9685d}{#1}"),Br("\\redD","\\textcolor{##e84d39}{#1}"),Br("\\redE","\\textcolor{##bc2612}{#1}"),Br("\\maroonA","\\textcolor{##ffbde0}{#1}"),Br("\\maroonB","\\textcolor{##ff92c6}{#1}"),Br("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Br("\\maroonD","\\textcolor{##ca337c}{#1}"),Br("\\maroonE","\\textcolor{##9e034e}{#1}"),Br("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Br("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Br("\\purpleC","\\textcolor{##aa87ff}{#1}"),Br("\\purpleD","\\textcolor{##7854ab}{#1}"),Br("\\purpleE","\\textcolor{##543b78}{#1}"),Br("\\mintA","\\textcolor{##f5f9e8}{#1}"),Br("\\mintB","\\textcolor{##edf2df}{#1}"),Br("\\mintC","\\textcolor{##e0e5cc}{#1}"),Br("\\grayA","\\textcolor{##f6f7f7}{#1}"),Br("\\grayB","\\textcolor{##f0f1f2}{#1}"),Br("\\grayC","\\textcolor{##e3e5e6}{#1}"),Br("\\grayD","\\textcolor{##d6d8da}{#1}"),Br("\\grayE","\\textcolor{##babec2}{#1}"),Br("\\grayF","\\textcolor{##888d93}{#1}"),Br("\\grayG","\\textcolor{##626569}{#1}"),Br("\\grayH","\\textcolor{##3b3e40}{#1}"),Br("\\grayI","\\textcolor{##21242c}{#1}"),Br("\\kaBlue","\\textcolor{##314453}{#1}"),Br("\\kaGreen","\\textcolor{##71B307}{#1}");const Rn={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Hn{constructor(e,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new zn(An,t.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new Mn(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){let t,r,n;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:n,end:r}=this.consumeArg(["]"]))}else({tokens:n,start:t,end:r}=this.consumeArg());return this.pushToken(new Nr("EOF",r.loc)),this.pushTokens(n),t.range(r,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){const t=[],r=e&&e.length>0;r||this.consumeSpaces();const o=this.future();let s,i=0,a=0;do{if(s=this.popToken(),t.push(s),"{"===s.text)++i;else if("}"===s.text){if(--i,-1===i)throw new n("Extra }",s)}else if("EOF"===s.text)throw new n("Unexpected end of input in a macro argument, expected '"+(e&&r?e[a]:"}")+"'",s);if(e&&r)if((0===i||1===i&&"{"===e[a])&&s.text===e[a]){if(++a,a===e.length){t.splice(-a,a);break}}else a=0}while(0!==i||r);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new n("The length of delimiters doesn't match the number of args!");const r=t[0];for(let e=0;ethis.settings.maxExpand)throw new n("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){const t=this.popToken(),r=t.text,o=t.noexpand?null:this._getExpansion(r);if(null==o||e&&o.unexpandable){if(e&&null==o&&"\\"===r[0]&&!this.isDefined(r))throw new n("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);let s=o.tokens;const i=this.consumeArgs(o.numArgs,o.delimiters);if(o.numArgs){s=s.slice();for(let e=s.length-1;e>=0;--e){let t=s[e];if("#"===t.text){if(0===e)throw new n("Incomplete placeholder at end of macro body",t);if(t=s[--e],"#"===t.text)s.splice(e+1,1);else{if(!/^[1-9]$/.test(t.text))throw new n("Not a valid argument number",t);s.splice(e,2,...i[+t.text-1])}}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){const e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Nr(e)]):void 0}expandTokens(e){const t=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(!1===this.expandOnce(!0)){const e=this.stack.pop();e.treatAsRelax&&(e.noexpand=!1,e.treatAsRelax=!1),t.push(e)}return this.countExpansion(t.length),t}expandMacroAsText(e){const t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){const t=this.macros.get(e);if(null==t)return t;if(1===e.length){const t=this.lexer.catcodes[e];if(null!=t&&13!==t)return}const r="function"==typeof t?t(this):t;if("string"==typeof r){let e=0;if(-1!==r.indexOf("#")){const t=r.replace(/##/g,"");for(;-1!==t.indexOf("#"+(e+1));)++e}const t=new Mn(r,this.settings),n=[];let o=t.lex();for(;"EOF"!==o.text;)n.push(o),o=t.lex();n.reverse();return{tokens:n,numArgs:e}}return r}isDefined(e){return this.macros.has(e)||yn.hasOwnProperty(e)||oe.math.hasOwnProperty(e)||oe.text.hasOwnProperty(e)||Rn.hasOwnProperty(e)}isExpandable(e){const t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:yn.hasOwnProperty(e)&&!yn[e].primitive}}const On=/^[\u208a\u208b\u208c\u208d\u208e\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u2090\u2091\u2095\u1d62\u2c7c\u2096\u2097\u2098\u2099\u2092\u209a\u1d63\u209b\u209c\u1d64\u1d65\u2093\u1d66\u1d67\u1d68\u1d69\u1d6a]/,En=Object.freeze({"\u208a":"+","\u208b":"-","\u208c":"=","\u208d":"(","\u208e":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1d62":"i","\u2c7c":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209a":"p","\u1d63":"r","\u209b":"s","\u209c":"t","\u1d64":"u","\u1d65":"v","\u2093":"x","\u1d66":"\u03b2","\u1d67":"\u03b3","\u1d68":"\u03c1","\u1d69":"\u03d5","\u1d6a":"\u03c7","\u207a":"+","\u207b":"-","\u207c":"=","\u207d":"(","\u207e":")","\u2070":"0","\xb9":"1","\xb2":"2","\xb3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1d2c":"A","\u1d2e":"B","\u1d30":"D","\u1d31":"E","\u1d33":"G","\u1d34":"H","\u1d35":"I","\u1d36":"J","\u1d37":"K","\u1d38":"L","\u1d39":"M","\u1d3a":"N","\u1d3c":"O","\u1d3e":"P","\u1d3f":"R","\u1d40":"T","\u1d41":"U","\u2c7d":"V","\u1d42":"W","\u1d43":"a","\u1d47":"b","\u1d9c":"c","\u1d48":"d","\u1d49":"e","\u1da0":"f","\u1d4d":"g","\u02b0":"h","\u2071":"i","\u02b2":"j","\u1d4f":"k","\u02e1":"l","\u1d50":"m","\u207f":"n","\u1d52":"o","\u1d56":"p","\u02b3":"r","\u02e2":"s","\u1d57":"t","\u1d58":"u","\u1d5b":"v","\u02b7":"w","\u02e3":"x","\u02b8":"y","\u1dbb":"z","\u1d5d":"\u03b2","\u1d5e":"\u03b3","\u1d5f":"\u03b4","\u1d60":"\u03d5","\u1d61":"\u03c7","\u1dbf":"\u03b8"}),Ln={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030c":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030a":{text:"\\r",math:"\\mathring"},"\u030b":{text:"\\H"},"\u0327":{text:"\\c"}},Dn={"\xe1":"a\u0301","\xe0":"a\u0300","\xe4":"a\u0308","\u01df":"a\u0308\u0304","\xe3":"a\u0303","\u0101":"a\u0304","\u0103":"a\u0306","\u1eaf":"a\u0306\u0301","\u1eb1":"a\u0306\u0300","\u1eb5":"a\u0306\u0303","\u01ce":"a\u030c","\xe2":"a\u0302","\u1ea5":"a\u0302\u0301","\u1ea7":"a\u0302\u0300","\u1eab":"a\u0302\u0303","\u0227":"a\u0307","\u01e1":"a\u0307\u0304","\xe5":"a\u030a","\u01fb":"a\u030a\u0301","\u1e03":"b\u0307","\u0107":"c\u0301","\u1e09":"c\u0327\u0301","\u010d":"c\u030c","\u0109":"c\u0302","\u010b":"c\u0307","\xe7":"c\u0327","\u010f":"d\u030c","\u1e0b":"d\u0307","\u1e11":"d\u0327","\xe9":"e\u0301","\xe8":"e\u0300","\xeb":"e\u0308","\u1ebd":"e\u0303","\u0113":"e\u0304","\u1e17":"e\u0304\u0301","\u1e15":"e\u0304\u0300","\u0115":"e\u0306","\u1e1d":"e\u0327\u0306","\u011b":"e\u030c","\xea":"e\u0302","\u1ebf":"e\u0302\u0301","\u1ec1":"e\u0302\u0300","\u1ec5":"e\u0302\u0303","\u0117":"e\u0307","\u0229":"e\u0327","\u1e1f":"f\u0307","\u01f5":"g\u0301","\u1e21":"g\u0304","\u011f":"g\u0306","\u01e7":"g\u030c","\u011d":"g\u0302","\u0121":"g\u0307","\u0123":"g\u0327","\u1e27":"h\u0308","\u021f":"h\u030c","\u0125":"h\u0302","\u1e23":"h\u0307","\u1e29":"h\u0327","\xed":"i\u0301","\xec":"i\u0300","\xef":"i\u0308","\u1e2f":"i\u0308\u0301","\u0129":"i\u0303","\u012b":"i\u0304","\u012d":"i\u0306","\u01d0":"i\u030c","\xee":"i\u0302","\u01f0":"j\u030c","\u0135":"j\u0302","\u1e31":"k\u0301","\u01e9":"k\u030c","\u0137":"k\u0327","\u013a":"l\u0301","\u013e":"l\u030c","\u013c":"l\u0327","\u1e3f":"m\u0301","\u1e41":"m\u0307","\u0144":"n\u0301","\u01f9":"n\u0300","\xf1":"n\u0303","\u0148":"n\u030c","\u1e45":"n\u0307","\u0146":"n\u0327","\xf3":"o\u0301","\xf2":"o\u0300","\xf6":"o\u0308","\u022b":"o\u0308\u0304","\xf5":"o\u0303","\u1e4d":"o\u0303\u0301","\u1e4f":"o\u0303\u0308","\u022d":"o\u0303\u0304","\u014d":"o\u0304","\u1e53":"o\u0304\u0301","\u1e51":"o\u0304\u0300","\u014f":"o\u0306","\u01d2":"o\u030c","\xf4":"o\u0302","\u1ed1":"o\u0302\u0301","\u1ed3":"o\u0302\u0300","\u1ed7":"o\u0302\u0303","\u022f":"o\u0307","\u0231":"o\u0307\u0304","\u0151":"o\u030b","\u1e55":"p\u0301","\u1e57":"p\u0307","\u0155":"r\u0301","\u0159":"r\u030c","\u1e59":"r\u0307","\u0157":"r\u0327","\u015b":"s\u0301","\u1e65":"s\u0301\u0307","\u0161":"s\u030c","\u1e67":"s\u030c\u0307","\u015d":"s\u0302","\u1e61":"s\u0307","\u015f":"s\u0327","\u1e97":"t\u0308","\u0165":"t\u030c","\u1e6b":"t\u0307","\u0163":"t\u0327","\xfa":"u\u0301","\xf9":"u\u0300","\xfc":"u\u0308","\u01d8":"u\u0308\u0301","\u01dc":"u\u0308\u0300","\u01d6":"u\u0308\u0304","\u01da":"u\u0308\u030c","\u0169":"u\u0303","\u1e79":"u\u0303\u0301","\u016b":"u\u0304","\u1e7b":"u\u0304\u0308","\u016d":"u\u0306","\u01d4":"u\u030c","\xfb":"u\u0302","\u016f":"u\u030a","\u0171":"u\u030b","\u1e7d":"v\u0303","\u1e83":"w\u0301","\u1e81":"w\u0300","\u1e85":"w\u0308","\u0175":"w\u0302","\u1e87":"w\u0307","\u1e98":"w\u030a","\u1e8d":"x\u0308","\u1e8b":"x\u0307","\xfd":"y\u0301","\u1ef3":"y\u0300","\xff":"y\u0308","\u1ef9":"y\u0303","\u0233":"y\u0304","\u0177":"y\u0302","\u1e8f":"y\u0307","\u1e99":"y\u030a","\u017a":"z\u0301","\u017e":"z\u030c","\u1e91":"z\u0302","\u017c":"z\u0307","\xc1":"A\u0301","\xc0":"A\u0300","\xc4":"A\u0308","\u01de":"A\u0308\u0304","\xc3":"A\u0303","\u0100":"A\u0304","\u0102":"A\u0306","\u1eae":"A\u0306\u0301","\u1eb0":"A\u0306\u0300","\u1eb4":"A\u0306\u0303","\u01cd":"A\u030c","\xc2":"A\u0302","\u1ea4":"A\u0302\u0301","\u1ea6":"A\u0302\u0300","\u1eaa":"A\u0302\u0303","\u0226":"A\u0307","\u01e0":"A\u0307\u0304","\xc5":"A\u030a","\u01fa":"A\u030a\u0301","\u1e02":"B\u0307","\u0106":"C\u0301","\u1e08":"C\u0327\u0301","\u010c":"C\u030c","\u0108":"C\u0302","\u010a":"C\u0307","\xc7":"C\u0327","\u010e":"D\u030c","\u1e0a":"D\u0307","\u1e10":"D\u0327","\xc9":"E\u0301","\xc8":"E\u0300","\xcb":"E\u0308","\u1ebc":"E\u0303","\u0112":"E\u0304","\u1e16":"E\u0304\u0301","\u1e14":"E\u0304\u0300","\u0114":"E\u0306","\u1e1c":"E\u0327\u0306","\u011a":"E\u030c","\xca":"E\u0302","\u1ebe":"E\u0302\u0301","\u1ec0":"E\u0302\u0300","\u1ec4":"E\u0302\u0303","\u0116":"E\u0307","\u0228":"E\u0327","\u1e1e":"F\u0307","\u01f4":"G\u0301","\u1e20":"G\u0304","\u011e":"G\u0306","\u01e6":"G\u030c","\u011c":"G\u0302","\u0120":"G\u0307","\u0122":"G\u0327","\u1e26":"H\u0308","\u021e":"H\u030c","\u0124":"H\u0302","\u1e22":"H\u0307","\u1e28":"H\u0327","\xcd":"I\u0301","\xcc":"I\u0300","\xcf":"I\u0308","\u1e2e":"I\u0308\u0301","\u0128":"I\u0303","\u012a":"I\u0304","\u012c":"I\u0306","\u01cf":"I\u030c","\xce":"I\u0302","\u0130":"I\u0307","\u0134":"J\u0302","\u1e30":"K\u0301","\u01e8":"K\u030c","\u0136":"K\u0327","\u0139":"L\u0301","\u013d":"L\u030c","\u013b":"L\u0327","\u1e3e":"M\u0301","\u1e40":"M\u0307","\u0143":"N\u0301","\u01f8":"N\u0300","\xd1":"N\u0303","\u0147":"N\u030c","\u1e44":"N\u0307","\u0145":"N\u0327","\xd3":"O\u0301","\xd2":"O\u0300","\xd6":"O\u0308","\u022a":"O\u0308\u0304","\xd5":"O\u0303","\u1e4c":"O\u0303\u0301","\u1e4e":"O\u0303\u0308","\u022c":"O\u0303\u0304","\u014c":"O\u0304","\u1e52":"O\u0304\u0301","\u1e50":"O\u0304\u0300","\u014e":"O\u0306","\u01d1":"O\u030c","\xd4":"O\u0302","\u1ed0":"O\u0302\u0301","\u1ed2":"O\u0302\u0300","\u1ed6":"O\u0302\u0303","\u022e":"O\u0307","\u0230":"O\u0307\u0304","\u0150":"O\u030b","\u1e54":"P\u0301","\u1e56":"P\u0307","\u0154":"R\u0301","\u0158":"R\u030c","\u1e58":"R\u0307","\u0156":"R\u0327","\u015a":"S\u0301","\u1e64":"S\u0301\u0307","\u0160":"S\u030c","\u1e66":"S\u030c\u0307","\u015c":"S\u0302","\u1e60":"S\u0307","\u015e":"S\u0327","\u0164":"T\u030c","\u1e6a":"T\u0307","\u0162":"T\u0327","\xda":"U\u0301","\xd9":"U\u0300","\xdc":"U\u0308","\u01d7":"U\u0308\u0301","\u01db":"U\u0308\u0300","\u01d5":"U\u0308\u0304","\u01d9":"U\u0308\u030c","\u0168":"U\u0303","\u1e78":"U\u0303\u0301","\u016a":"U\u0304","\u1e7a":"U\u0304\u0308","\u016c":"U\u0306","\u01d3":"U\u030c","\xdb":"U\u0302","\u016e":"U\u030a","\u0170":"U\u030b","\u1e7c":"V\u0303","\u1e82":"W\u0301","\u1e80":"W\u0300","\u1e84":"W\u0308","\u0174":"W\u0302","\u1e86":"W\u0307","\u1e8c":"X\u0308","\u1e8a":"X\u0307","\xdd":"Y\u0301","\u1ef2":"Y\u0300","\u0178":"Y\u0308","\u1ef8":"Y\u0303","\u0232":"Y\u0304","\u0176":"Y\u0302","\u1e8e":"Y\u0307","\u0179":"Z\u0301","\u017d":"Z\u030c","\u1e90":"Z\u0302","\u017b":"Z\u0307","\u03ac":"\u03b1\u0301","\u1f70":"\u03b1\u0300","\u1fb1":"\u03b1\u0304","\u1fb0":"\u03b1\u0306","\u03ad":"\u03b5\u0301","\u1f72":"\u03b5\u0300","\u03ae":"\u03b7\u0301","\u1f74":"\u03b7\u0300","\u03af":"\u03b9\u0301","\u1f76":"\u03b9\u0300","\u03ca":"\u03b9\u0308","\u0390":"\u03b9\u0308\u0301","\u1fd2":"\u03b9\u0308\u0300","\u1fd1":"\u03b9\u0304","\u1fd0":"\u03b9\u0306","\u03cc":"\u03bf\u0301","\u1f78":"\u03bf\u0300","\u03cd":"\u03c5\u0301","\u1f7a":"\u03c5\u0300","\u03cb":"\u03c5\u0308","\u03b0":"\u03c5\u0308\u0301","\u1fe2":"\u03c5\u0308\u0300","\u1fe1":"\u03c5\u0304","\u1fe0":"\u03c5\u0306","\u03ce":"\u03c9\u0301","\u1f7c":"\u03c9\u0300","\u038e":"\u03a5\u0301","\u1fea":"\u03a5\u0300","\u03ab":"\u03a5\u0308","\u1fe9":"\u03a5\u0304","\u1fe8":"\u03a5\u0306","\u038f":"\u03a9\u0301","\u1ffa":"\u03a9\u0300"};class Vn{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Hn(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new n("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{const e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){const t=this.nextToken;this.consume(),this.gullet.pushToken(new Nr("}")),this.gullet.pushTokens(e);const r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(e,t){const r=[];for(;;){"math"===this.mode&&this.consumeSpaces();const n=this.fetch();if(-1!==Vn.endOfExpression.indexOf(n.text))break;if(t&&n.text===t)break;if(e&&yn[n.text]&&yn[n.text].infix)break;const o=this.parseAtom(t);if(!o)break;"internal"!==o.type&&r.push(o)}return"text"===this.mode&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){let t,r=-1;for(let o=0;o=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);const r=oe[this.mode][t].group,n=Cr.range(e);let s;if(te.hasOwnProperty(r)){const e=r;s={type:"atom",mode:this.mode,family:e,loc:n,text:t}}else s={type:r,mode:this.mode,loc:n,text:t};o=s}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(S(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:Cr.range(e),text:t}}if(this.consume(),r)for(let t=0;t"; + return ""; } else { - return ""; + return ""; } } @@ -4343,7 +4371,7 @@ class LineNode { for (var attr in this.attributes) { if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { - markup += " " + attr + "='" + this.attributes[attr] + "'"; + markup += " " + attr + "=\"" + utils.escape(this.attributes[attr]) + "\""; } } @@ -4545,7 +4573,7 @@ defineSymbol(math, main, rel, "\u21c1", "\\rightharpoondown", true); defineSymbol(math, main, rel, "\u2196", "\\nwarrow", true); defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons", true); // AMS Negated Binary Relations -defineSymbol(math, ams, rel, "\u226e", "\\nless", true); // Symbol names preceeded by "@" each have a corresponding macro. +defineSymbol(math, ams, rel, "\u226e", "\\nless", true); // Symbol names preceded by "@" each have a corresponding macro. defineSymbol(math, ams, rel, "\ue010", "\\@nleqslant"); defineSymbol(math, ams, rel, "\ue011", "\\@nleqq"); @@ -5170,6 +5198,10 @@ for (var _i3 = 0; _i3 < letters.length; _i3++) { defineSymbol(text, main, textord, _ch3, wideChar); wideChar = String.fromCharCode(0xD835, 0xDD04 + _i3); // A-Z a-z Fractur + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDD6C + _i3); // A-Z a-z bold Fractur + defineSymbol(math, main, mathord, _ch3, wideChar); defineSymbol(text, main, textord, _ch3, wideChar); wideChar = String.fromCharCode(0xD835, 0xDDA0 + _i3); // A-Z a-z sans-serif @@ -5277,8 +5309,9 @@ var wideLatinLetterData = [["mathbf", "textbf", "Main-Bold"], // A-Z bold uprigh ["mathfrak", "textfrak", "Fraktur-Regular"], // a-z Fraktur ["mathbb", "textbb", "AMS-Regular"], // A-Z double-struck ["mathbb", "textbb", "AMS-Regular"], // k double-struck -["", "", ""], // A-Z bold Fraktur No font metrics -["", "", ""], // a-z bold Fraktur. No font. +// Note that we are using a bold font, but font metrics for regular Fraktur. +["mathboldfrak", "textboldfrak", "Fraktur-Regular"], // A-Z bold Fraktur +["mathboldfrak", "textboldfrak", "Fraktur-Regular"], // a-z bold Fraktur ["mathsf", "textsf", "SansSerif-Regular"], // A-Z sans-serif ["mathsf", "textsf", "SansSerif-Regular"], // a-z sans-serif ["mathboldsf", "textboldsf", "SansSerif-Bold"], // A-Z bold sans-serif @@ -5454,10 +5487,15 @@ var makeOrd = function makeOrd(group, options, type) { var isFont = mode === "math" || mode === "text" && options.font; var fontOrFamily = isFont ? options.font : options.fontFamily; + var wideFontName = ""; + var wideFontClass = ""; if (text.charCodeAt(0) === 0xD835) { + [wideFontName, wideFontClass] = wideCharacterFont(text, mode); + } + + if (wideFontName.length > 0) { // surrogate pairs get special treatment - var [wideFontName, wideFontClass] = wideCharacterFont(text, mode); return makeSymbol(text, wideFontName, mode, options, classes.concat(wideFontClass)); } else if (fontOrFamily) { var fontName; @@ -16324,6 +16362,19 @@ class MacroExpander { return args; } + /** + * Increment `expansionCount` by the specified amount. + * Throw an error if it exceeds `maxExpand`. + */ + + + countExpansion(amount) { + this.expansionCount += amount; + + if (this.expansionCount > this.settings.maxExpand) { + throw new ParseError("Too many expansions: infinite loop or " + "need to increase maxExpand setting"); + } + } /** * Expand the next token only once if possible. * @@ -16359,12 +16410,7 @@ class MacroExpander { return false; } - this.expansionCount++; - - if (this.expansionCount > this.settings.maxExpand) { - throw new ParseError("Too many expansions: infinite loop or " + "need to increase maxExpand setting"); - } - + this.countExpansion(1); var tokens = expansion.tokens; var args = this.consumeArgs(expansion.numArgs, expansion.delimiters); @@ -16470,8 +16516,11 @@ class MacroExpander { output.push(token); } - } + } // Count all of these tokens as additional expansions, to prevent + // exponential blowup from linearly many \edef's. + + this.countExpansion(output.length); return output; } /** @@ -17479,8 +17528,9 @@ class Parser { // We treat these similarly to the unicode-math package. // So we render a string of Unicode (sub|super)scripts the // same as a (sub|super)script of regular characters. - var str = uSubsAndSups[lex.text]; var isSub = unicodeSubRegEx.test(lex.text); + var subsupTokens = []; + subsupTokens.push(new Token(uSubsAndSups[lex.text])); this.consume(); // Continue fetching tokens to fill out the string. while (true) { @@ -17494,12 +17544,12 @@ class Parser { break; } + subsupTokens.unshift(new Token(uSubsAndSups[token])); this.consume(); - str += uSubsAndSups[token]; } // Now create a (sub|super)script. - var body = new Parser(str, this.settings).parse(); + var body = this.subparse(subsupTokens); if (isSub) { subscript = { @@ -18309,7 +18359,7 @@ var katex = { /** * Current KaTeX version */ - version: "0.16.8", + version: "0.16.10", /** * Renders the given LaTeX into an HTML+MathML combination, and adds diff --git a/paige/node_modules/katex/package.json b/paige/node_modules/katex/package.json index 74e99f79..de07ed4c 100644 --- a/paige/node_modules/katex/package.json +++ b/paige/node_modules/katex/package.json @@ -1,6 +1,6 @@ { "name": "katex", - "version": "0.16.8", + "version": "0.16.10", "description": "Fast math typesetting for the web.", "main": "dist/katex.js", "exports": { @@ -47,7 +47,7 @@ "dist/" ], "license": "MIT", - "packageManager": "yarn@3.2.2", + "packageManager": "yarn@4.1.1", "devDependencies": { "@babel/core": "^7.18.13", "@babel/eslint-parser": "^7.18.9", diff --git a/paige/node_modules/katex/src/MacroExpander.js b/paige/node_modules/katex/src/MacroExpander.js index 08532fd6..18dadc3d 100644 --- a/paige/node_modules/katex/src/MacroExpander.js +++ b/paige/node_modules/katex/src/MacroExpander.js @@ -245,6 +245,18 @@ export default class MacroExpander implements MacroContextInterface { return args; } + /** + * Increment `expansionCount` by the specified amount. + * Throw an error if it exceeds `maxExpand`. + */ + countExpansion(amount: number): void { + this.expansionCount += amount; + if (this.expansionCount > this.settings.maxExpand) { + throw new ParseError("Too many expansions: infinite loop or " + + "need to increase maxExpand setting"); + } + } + /** * Expand the next token only once if possible. * @@ -276,11 +288,7 @@ export default class MacroExpander implements MacroContextInterface { this.pushToken(topToken); return false; } - this.expansionCount++; - if (this.expansionCount > this.settings.maxExpand) { - throw new ParseError("Too many expansions: infinite loop or " + - "need to increase maxExpand setting"); - } + this.countExpansion(1); let tokens = expansion.tokens; const args = this.consumeArgs(expansion.numArgs, expansion.delimiters); if (expansion.numArgs) { @@ -375,6 +383,9 @@ export default class MacroExpander implements MacroContextInterface { output.push(token); } } + // Count all of these tokens as additional expansions, to prevent + // exponential blowup from linearly many \edef's. + this.countExpansion(output.length); return output; } diff --git a/paige/node_modules/katex/src/Parser.js b/paige/node_modules/katex/src/Parser.js index 936246e7..0e002b3b 100644 --- a/paige/node_modules/katex/src/Parser.js +++ b/paige/node_modules/katex/src/Parser.js @@ -405,19 +405,20 @@ export default class Parser { // We treat these similarly to the unicode-math package. // So we render a string of Unicode (sub|super)scripts the // same as a (sub|super)script of regular characters. - let str = uSubsAndSups[lex.text]; const isSub = unicodeSubRegEx.test(lex.text); + const subsupTokens = []; + subsupTokens.push(new Token(uSubsAndSups[lex.text])); this.consume(); // Continue fetching tokens to fill out the string. while (true) { const token = this.fetch().text; if (!(uSubsAndSups[token])) { break; } if (unicodeSubRegEx.test(token) !== isSub) { break; } + subsupTokens.unshift(new Token(uSubsAndSups[token])); this.consume(); - str += uSubsAndSups[token]; } // Now create a (sub|super)script. - const body = (new Parser(str, this.settings)).parse(); + const body = this.subparse(subsupTokens); if (isSub) { subscript = {type: "ordgroup", mode: "math", body}; } else { diff --git a/paige/node_modules/katex/src/Settings.js b/paige/node_modules/katex/src/Settings.js index 9c5336a3..304a7d1e 100644 --- a/paige/node_modules/katex/src/Settings.js +++ b/paige/node_modules/katex/src/Settings.js @@ -346,7 +346,11 @@ export default class Settings { */ isTrusted(context: AnyTrustContext): boolean { if (context.url && !context.protocol) { - context.protocol = utils.protocolFromUrl(context.url); + const protocol = utils.protocolFromUrl(context.url); + if (protocol == null) { + return false; + } + context.protocol = protocol; } const trust = typeof this.trust === "function" ? this.trust(context) diff --git a/paige/node_modules/katex/src/buildCommon.js b/paige/node_modules/katex/src/buildCommon.js index 5f0bbae6..4c8ab98d 100644 --- a/paige/node_modules/katex/src/buildCommon.js +++ b/paige/node_modules/katex/src/buildCommon.js @@ -165,9 +165,13 @@ const makeOrd = function( // Math mode or Old font (i.e. \rm) const isFont = mode === "math" || (mode === "text" && options.font); const fontOrFamily = isFont ? options.font : options.fontFamily; + let wideFontName = ""; + let wideFontClass = ""; if (text.charCodeAt(0) === 0xD835) { + [wideFontName, wideFontClass] = wideCharacterFont(text, mode); + } + if (wideFontName.length > 0) { // surrogate pairs get special treatment - const [wideFontName, wideFontClass] = wideCharacterFont(text, mode); return makeSymbol(text, wideFontName, mode, options, classes.concat(wideFontClass)); } else if (fontOrFamily) { diff --git a/paige/node_modules/katex/src/domTree.js b/paige/node_modules/katex/src/domTree.js index 6b4e5f16..4ace3d12 100644 --- a/paige/node_modules/katex/src/domTree.js +++ b/paige/node_modules/katex/src/domTree.js @@ -315,7 +315,8 @@ export class Img implements VirtualNode { } toMarkup(): string { - let markup = `${this.alt}`; + return ``; } else { - return ``; + return ``; } } } @@ -586,7 +587,7 @@ export class LineNode implements VirtualNode { for (const attr in this.attributes) { if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { - markup += ` ${attr}='${this.attributes[attr]}'`; + markup += ` ${attr}="${utils.escape(this.attributes[attr])}"`; } } diff --git a/paige/node_modules/katex/src/katex.less b/paige/node_modules/katex/src/katex.less index cbe878a6..fdce45be 100644 --- a/paige/node_modules/katex/src/katex.less +++ b/paige/node_modules/katex/src/katex.less @@ -129,6 +129,12 @@ font-family: KaTeX_Fraktur; } + .mathboldfrak, + .textboldfrak { + font-family: KaTeX_Fraktur; + font-weight: bold; + } + .mathtt { font-family: KaTeX_Typewriter; } diff --git a/paige/node_modules/katex/src/symbols.js b/paige/node_modules/katex/src/symbols.js index ae495801..dfaf1224 100644 --- a/paige/node_modules/katex/src/symbols.js +++ b/paige/node_modules/katex/src/symbols.js @@ -204,7 +204,7 @@ defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons", true); // AMS Negated Binary Relations defineSymbol(math, ams, rel, "\u226e", "\\nless", true); -// Symbol names preceeded by "@" each have a corresponding macro. +// Symbol names preceded by "@" each have a corresponding macro. defineSymbol(math, ams, rel, "\ue010", "\\@nleqslant"); defineSymbol(math, ams, rel, "\ue011", "\\@nleqq"); defineSymbol(math, ams, rel, "\u2a87", "\\lneq", true); @@ -816,6 +816,10 @@ for (let i = 0; i < letters.length; i++) { defineSymbol(math, main, mathord, ch, wideChar); defineSymbol(text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDD6C + i); // A-Z a-z bold Fractur + defineSymbol(math, main, mathord, ch, wideChar); + defineSymbol(text, main, textord, ch, wideChar); + wideChar = String.fromCharCode(0xD835, 0xDDA0 + i); // A-Z a-z sans-serif defineSymbol(math, main, mathord, ch, wideChar); defineSymbol(text, main, textord, ch, wideChar); diff --git a/paige/node_modules/katex/src/utils.js b/paige/node_modules/katex/src/utils.js index 534c0f58..dfb197cf 100644 --- a/paige/node_modules/katex/src/utils.js +++ b/paige/node_modules/katex/src/utils.js @@ -93,11 +93,30 @@ export const assert = function(value: ?T): T { /** * Return the protocol of a URL, or "_relative" if the URL does not specify a - * protocol (and thus is relative). + * protocol (and thus is relative), or `null` if URL has invalid protocol + * (so should be outright rejected). */ -export const protocolFromUrl = function(url: string): string { - const protocol = /^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(url); - return (protocol != null ? protocol[1] : "_relative"); +export const protocolFromUrl = function(url: string): string | null { + // Check for possible leading protocol. + // https://url.spec.whatwg.org/#url-parsing strips leading whitespace + // (U+20) or C0 control (U+00-U+1F) characters. + // eslint-disable-next-line no-control-regex + const protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i + .exec(url); + if (!protocol) { + return "_relative"; + } + // Reject weird colons + if (protocol[2] !== ":") { + return null; + } + // Reject invalid characters in scheme according to + // https://datatracker.ietf.org/doc/html/rfc3986#section-3.1 + if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) { + return null; + } + // Lowercase the protocol + return protocol[1].toLowerCase(); }; export default { diff --git a/paige/node_modules/katex/src/wide-character.js b/paige/node_modules/katex/src/wide-character.js index f9e680d7..af5335c5 100644 --- a/paige/node_modules/katex/src/wide-character.js +++ b/paige/node_modules/katex/src/wide-character.js @@ -45,8 +45,9 @@ const wideLatinLetterData: Array<[string, string, string]> = [ ["mathbb", "textbb", "AMS-Regular"], // A-Z double-struck ["mathbb", "textbb", "AMS-Regular"], // k double-struck - ["", "", ""], // A-Z bold Fraktur No font metrics - ["", "", ""], // a-z bold Fraktur. No font. + // Note that we are using a bold font, but font metrics for regular Fraktur. + ["mathboldfrak", "textboldfrak", "Fraktur-Regular"], // A-Z bold Fraktur + ["mathboldfrak", "textboldfrak", "Fraktur-Regular"], // a-z bold Fraktur ["mathsf", "textsf", "SansSerif-Regular"], // A-Z sans-serif ["mathsf", "textsf", "SansSerif-Regular"], // a-z sans-serif diff --git a/paige/package-lock.json b/paige/package-lock.json index 309e52a4..8345e038 100644 --- a/paige/package-lock.json +++ b/paige/package-lock.json @@ -7,7 +7,7 @@ "dependencies": { "bootstrap": "^5.3.2", "bootstrap-icons": "^1.11.0", - "katex": "^0.16.7" + "katex": "^0.16.10" } }, "node_modules/@popperjs/core": { @@ -62,9 +62,9 @@ } }, "node_modules/katex": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.8.tgz", - "integrity": "sha512-ftuDnJbcbOckGY11OO+zg3OofESlbR5DRl2cmN8HeWeeFIV7wTXvAOx8kEjZjobhA+9wh2fbKeO6cdcA9Mnovg==", + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.10.tgz", + "integrity": "sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==", "funding": [ "https://opencollective.com/katex", "https://github.com/sponsors/katex" diff --git a/paige/package.json b/paige/package.json index 4c57684f..2f1aab41 100644 --- a/paige/package.json +++ b/paige/package.json @@ -2,6 +2,6 @@ "dependencies": { "bootstrap": "^5.3.2", "bootstrap-icons": "^1.11.0", - "katex": "^0.16.8" + "katex": "^0.16.10" } }