@skaldapp/runtime 3.1.13 → 3.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +1 -1
- package/dist/assets/esprima-BR6CEG77.js +8 -0
- package/dist/assets/index-BySeHTX_.js +117 -0
- package/dist/assets/index-bYpYaqOv.css +1 -0
- package/dist/assets/markdown-DYNJ6Ntg.js +16 -0
- package/dist/assets/ofetch-XPJe_o5P.js +1 -0
- package/dist/assets/rolldown-runtime-Bhmf7a9N.js +1 -0
- package/dist/assets/sucrase-D9elb1_L.js +135 -0
- package/dist/assets/temml-Cn806M5Y.css +1 -0
- package/dist/assets/temml-gzcK8DTU.js +94 -0
- package/dist/assets/unocss-TrzabPxA.js +423 -0
- package/dist/assets/vue-BFE4yC8G.js +173 -0
- package/dist/index.html +11 -8
- package/package.json +7 -9
- package/dist/assets/index-W5ZzOxGj.js +0 -7
- package/dist/assets/index-X9Kt6xMm.css +0 -1
- package/dist/assets/markdown-yGb7k3A8.js +0 -1
- package/dist/assets/ofetch-xbea4qKc.js +0 -1
- package/dist/assets/sucrase-D8pz8hBV.js +0 -1
- package/dist/assets/traeblain-B2MaFYm5.js +0 -1
- package/dist/assets/unocss-ermFjJsI.js +0 -1
- package/dist/assets/vue-B2aV9V09.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Temml;src:url(./Temml-CCjoacWt.woff2)format("woff2");font-weight:400;font-style:normal}math{font-size-adjust:none;text-indent:0;text-transform:none;letter-spacing:normal;word-wrap:normal;font-feature-settings:"dtls" off;direction:ltr;font-family:Cambria Math,STIXTwoMath-Regular,NotoSansMath-Regular,math;font-style:normal;font-weight:400;line-height:normal}math *{border-color:currentColor}math.tml-display{width:100%;display:block}.mathcal{font-feature-settings:"ss01"}math .mathscr,mo.tml-prime{font-family:Temml}mfrac>:nth-child(2),msqrt,mover>:first-child{math-shift:compact}.menclose{padding:.5ex 0;display:inline-block;position:relative}.tml-cancelto{background-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><defs><marker id='a' markerHeight='5' markerUnits='strokeWidth' markerWidth='7' orient='auto' refX='7' refY='2.5'><path fill='currentColor' d='m0 0 7 2.5L0 5z'/></marker></defs><line x2='100%' y1='100%' stroke='currentColor' stroke-width='.06em' marker-end='url(%23a)' vector-effect='non-scaling-stroke'/></svg>");padding:.5ex 0;display:inline-block;position:absolute;top:0;left:0}@supports ((-moz-appearance:none)){.tml-vec{transform:scale(.75)}.ff-narrow{width:0}.ff-nudge-left{margin-left:-.2em}}@supports not ((-moz-appearance:none)){mo.tml-prime{font-family:Temml}.tml-sml-pad{padding-left:.05em}.tml-med-pad{padding-left:.1em}.tml-lrg-pad{padding-left:.15em}}@supports ((-webkit-backdrop-filter:blur(1px))){.wbk-acc{transform:translateY(.431em)}.wbk-sml{transform:translate(.07em)}.wbk-sml-acc{transform:translate(.07em,.431em)}.wbk-sml-vec{transform:scale(.75)translate(.07em)}.wbk-med{transform:translate(.14em)}.wbk-med-acc{transform:translate(.14em,.431em)}.wbk-med-vec{transform:scale(.75)translate(.14em)}.wbk-lrg{transform:translate(.21em)}.wbk-lrg-acc{transform:translate(.21em,.431em)}.wbk-lrg-vec{transform:scale(.75)translate(.21em)}}menclose{-webkit-print-color-adjust:exact;print-color-adjust:exact}.tml-right{text-align:right}.tml-left{text-align:left}.tml-shift-left{margin-left:-200%}@supports (not ((-webkit-backdrop-filter:blur(1px)))) and (not ((-moz-appearance:none))){.chr-sml{transform:translate(.07em)}.chr-sml-vec{transform:scale(.75)translate(.07em)}.chr-med{transform:translate(.14em)}.chr-med-vec{transform:scale(.75)translate(.14em)}.chr-lrg{transform:translate(.21em)}.chr-lrg-vec{transform:scale(.75)translate(.21em)}.tml-shift-left{margin-left:-100%}menclose{padding:.5ex 0;position:relative}.tml-overline{border-top:.065em solid;padding:.1em 0 0}.tml-underline{border-bottom:.065em solid;padding:0 0 .1em}.tml-cancel{background-color:currentColor;width:100%;height:100%;display:inline-block;position:absolute;bottom:0;left:.5px}.upstrike{clip-path:polygon(.05em 100%,0 calc(100% - .05em),calc(100% - .05em) 0,100% .05em)}.downstrike{clip-path:polygon(0 .05em,.05em 0,100% calc(100% - .05em),calc(100% - .05em) 100%)}.sout{clip-path:polygon(0 calc(55% + .0333em),0 calc(55% - .0333em),100% calc(55% - .0333em),100% calc(55% + .0333em))}.tml-xcancel{background:linear-gradient(to top left,#0000 0% calc(50% - .06em),#000 50%,#0000 calc(50% + .06em) 100%),linear-gradient(to top right,#0000 0% calc(50% - .06em),#000 50%,#0000 calc(50% + .06em) 100%)}.longdiv-top{border-top:.067em solid;padding:.1em .2em .2em .433em}.longdiv-arc{clip-path:inset(0 0 0 .4em);box-sizing:border-box;border:.067em solid;border-radius:70%;width:.7em;position:absolute;top:0;bottom:.1em;left:-.4em;transform:translateY(-.067em)}.menclose{text-align:left;display:inline-block;position:relative}.phasor-bottom{border-bottom:.067em solid;padding:.2em .2em .1em .6em}.phasor-angle{aspect-ratio:.5;clip-path:polygon(.05em 100%,0 calc(100% - .05em),calc(100% - .05em) 0,100% .05em);background-color:currentColor;height:100%;display:inline-block;position:absolute;bottom:-.04em;left:.5px}.tml-fbox{border:1px solid;padding:3pt}.circle-pad{padding:.267em}.textcircle{border:.067em solid;border-radius:50%;position:absolute;inset:0}.actuarial{border-style:solid;border-width:.08em .08em 0 0;margin-right:.03889em;padding:.03889em .03889em 0}.tml-crooked-2{transform:scale(2,1.1)}.tml-crooked-3{transform:scale(3,1.3)}.tml-crooked-4{transform:scale(4,1.4)}.tml-right{text-align:-webkit-right}.tml-left{text-align:-webkit-left}}.special-fraction{font-family:STIX TWO,Times New Roman,Times,Tinos,serif}math{flex-wrap:wrap;align-items:baseline;display:inline-flex}math>mrow{padding:.5ex 0}mtable.tml-jot mtd{padding-top:.7ex;padding-bottom:.7ex}mtable.tml-small mtd{padding-top:.35ex;padding-bottom:.35ex}@-moz-document url-prefix(){math{display:inline}math>mrow{padding:0}mtd,mtable.tml-small mtd{padding-top:0;padding-bottom:0}mtable.tml-jot mtd{padding-top:.2ex;padding-bottom:0.ex}}.tml-eqn:before{counter-increment:tmlEqnNo;content:"(" counter(tmlEqnNo) ")"}body{counter-reset:tmlEqnNo}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var e=class e{constructor(t,n){let r=` `+t,i,a=n&&n.loc;if(a&&a.start<=a.end){let e=a.lexer.input;i=a.start;let t=a.end;i===e.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;let n=e.slice(i,t).replace(/[^]/g,`$&̲`),o;o=i>15?`…`+e.slice(i-15,i):e.slice(0,i);let s;s=t+15<e.length?e.slice(t,t+15)+`…`:e.slice(t),r+=o+n+s}let o=Error(r);return o.name=`ParseError`,o.__proto__=e.prototype,o.position=i,o}};e.prototype.__proto__=Error.prototype;var t=function(e,t){return e===void 0?t:e},n=/([A-Z])/g,r=function(e){return e.replace(n,`-$1`).toLowerCase()},i={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},a=/[&><"']/g;function o(e){return String(e).replace(a,e=>i[e])}var s=function(e){return e.type===`ordgroup`||e.type===`color`?e.body.length===1?s(e.body[0]):e:e.type===`font`?s(e.body):e},c=function(e){let t=s(e);return t.type===`mathord`||t.type===`textord`||t.type===`atom`},l=function(e){if(!e)throw Error(`Expected non-null, but got `+String(e));return e},u={deflt:t,escape:o,hyphenate:r,getBaseElem:s,isCharacterBox:c,protocolFromUrl:function(e){let t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},round:function(e){return+e.toFixed(4)}},d=class{constructor(e){e||={},this.displayMode=u.deflt(e.displayMode,!1),this.annotate=u.deflt(e.annotate,!1),this.leqno=u.deflt(e.leqno,!1),this.throwOnError=u.deflt(e.throwOnError,!1),this.errorColor=u.deflt(e.errorColor,`#b22222`),this.macros=e.macros||{},this.wrap=u.deflt(e.wrap,`tex`),this.xml=u.deflt(e.xml,!1),this.colorIsTextColor=u.deflt(e.colorIsTextColor,!1),this.strict=u.deflt(e.strict,!1),this.trust=u.deflt(e.trust,!1),this.maxSize=e.maxSize===void 0?[1/0,1/0]:Array.isArray(e.maxSize)?e.maxSize:[1/0,1/0],this.maxExpand=Math.max(0,u.deflt(e.maxExpand,1e3))}isTrusted(e){if(e.url&&!e.protocol){let t=u.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},f={},p={};function m({type:e,names:t,props:n,handler:r,mathmlBuilder:i}){let a={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:r};for(let e=0;e<t.length;++e)f[t[e]]=a;e&&i&&(p[e]=i)}function h({type:e,mathmlBuilder:t}){m({type:e,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},mathmlBuilder:t})}var g=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},_=function(e){return e.type===`ordgroup`?e.body:[e]},ee=class{constructor(e){this.children=e,this.classes=[],this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){let e=document.createDocumentFragment();for(let t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){let e=``;for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>e.toText()).join(``)}},v=function(e){return e.filter(e=>e).join(` `)},te=function(e,t){this.classes=e||[],this.attributes={},this.style=t||{}},ne=function(e){let t=document.createElement(e);t.className=v(this.classes);for(let e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(t.style[e]=this.style[e]);for(let e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);for(let e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t},re=function(e){let t=`<${e}`;this.classes.length&&(t+=` class="${u.escape(v(this.classes))}"`);let n=``;for(let e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(n+=`${u.hyphenate(e)}:${this.style[e]};`);n&&(t+=` style="${n}"`);for(let e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=` ${e}="${u.escape(this.attributes[e])}"`);t+=`>`;for(let e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t+=`</${e}>`,t},ie=class{constructor(e,t,n){te.call(this,e,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}toNode(){return ne.call(this,`span`)}toMarkup(){return re.call(this,`span`)}},ae=class{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return u.escape(this.text)}},oe=class{constructor(e,t,n){this.href=e,this.classes=t,this.children=n||[]}toNode(){let e=document.createElement(`a`);e.setAttribute(`href`,this.href),this.classes.length>0&&(e.className=v(this.classes));for(let t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){let e=`<a href='${u.escape(this.href)}'`;this.classes.length>0&&(e+=` class="${u.escape(v(this.classes))}"`),e+=`>`;for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e+=`</a>`,e}},se=class{constructor(e,t,n){this.alt=t,this.src=e,this.classes=[`mord`],this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){let e=document.createElement(`img`);e.src=this.src,e.alt=this.alt,e.className=`mord`;for(let t in this.style)Object.prototype.hasOwnProperty.call(this.style,t)&&(e.style[t]=this.style[t]);return e}toMarkup(){let e=`<img src='${this.src}' alt='${this.alt}'`,t=``;for(let e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(t+=`${u.hyphenate(e)}:${this.style[e]};`);return t&&(e+=` style="${u.escape(t)}"`),e+=`>`,e}};function ce(e){return new ee(e)}var y=class{constructor(e,t,n,r){this.type=e,this.attributes={},this.children=t||[],this.classes=n||[],this.style=r||{},this.label=``}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}setLabel(e){this.label=e}toNode(){let e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(let t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=v(this.classes));for(let t in this.style)Object.prototype.hasOwnProperty.call(this.style,t)&&(e.style[t]=this.style[t]);for(let t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){let e=`<`+this.type;for(let t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=u.escape(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class="${u.escape(v(this.classes))}"`);let t=``;for(let e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(t+=`${u.hyphenate(e)}:${this.style[e]};`);t&&(e+=` style="${t}"`),e+=`>`;for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},le=class{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return u.escape(this.toText())}toText(){return this.text}},ue=e=>{let t;return e.length===1&&e[0].type===`mrow`?(t=e.pop(),t.type=`mstyle`):t=new y(`mstyle`,e),t},b={MathNode:y,TextNode:le,newDocumentFragment:ce},de=e=>{let t=0;if(e.body)for(let n of e.body)t+=de(n);else if(e.type===`supsub`)t+=de(e.base),e.sub&&(t+=.7*de(e.sub)),e.sup&&(t+=.7*de(e.sup));else if(e.type===`mathord`||e.type===`textord`)for(let n of e.text.split(``)){let e=n.codePointAt(0);96<e&&e<123||944<e&&e<970?t+=.56:47<e&&e<58?t+=.5:t+=.92}else t+=1;return t},fe={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,wideparen:`⏜`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,overgroup:`⏠`,overparen:`⏜`,undergroup:`⏡`,underparen:`⏝`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xrightleftarrows:`⇄`,yields:`→`,yieldsLeft:`←`,mesomerism:`↔`,longrightharpoonup:`⇀`,longleftharpoondown:`↽`,eqrightharpoonup:`⇀`,eqleftharpoondown:`↽`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},pe=function(e){let t=new b.TextNode(fe[e.slice(1)]),n=new b.MathNode(`mo`,[t]);return n.setAttribute(`stretchy`,`true`),n},me=[`\\widetilde`,`\\widehat`,`\\widecheck`,`\\utilde`],he={mathMLnode:pe,accentNode:e=>{let t=pe(e.label);if(me.includes(e.label)){let n=de(e.base);1<n&&n<1.6?t.classes.push(`tml-crooked-2`):1.6<=n&&n<2.5?t.classes.push(`tml-crooked-3`):2.5<=n&&t.classes.push(`tml-crooked-4`)}return t}},ge={bin:1,close:1,inner:1,open:1,punct:1,rel:1},_e={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},x={math:{},text:{}};function S(e,t,n,r,i){x[e][r]={group:t,replace:n},i&&n&&(x[e][n]=x[e][r])}var C=`math`,w=`text`,T=`accent-token`,E=`bin`,D=`close`,O=`inner`,k=`mathord`,A=`op-token`,j=`open`,ve=`punct`,M=`rel`,N=`spacing`,P=`textord`;S(C,M,`≡`,`\\equiv`,!0),S(C,M,`≺`,`\\prec`,!0),S(C,M,`≻`,`\\succ`,!0),S(C,M,`∼`,`\\sim`,!0),S(C,M,`⟂`,`\\perp`,!0),S(C,M,`⪯`,`\\preceq`,!0),S(C,M,`⪰`,`\\succeq`,!0),S(C,M,`≃`,`\\simeq`,!0),S(C,M,`≌`,`\\backcong`,!0),S(C,M,`|`,`\\mid`,!0),S(C,M,`≪`,`\\ll`,!0),S(C,M,`≫`,`\\gg`,!0),S(C,M,`≍`,`\\asymp`,!0),S(C,M,`∥`,`\\parallel`),S(C,M,`⌣`,`\\smile`,!0),S(C,M,`⊑`,`\\sqsubseteq`,!0),S(C,M,`⊒`,`\\sqsupseteq`,!0),S(C,M,`≐`,`\\doteq`,!0),S(C,M,`⌢`,`\\frown`,!0),S(C,M,`∋`,`\\ni`,!0),S(C,M,`∌`,`\\notni`,!0),S(C,M,`∝`,`\\propto`,!0),S(C,M,`⊢`,`\\vdash`,!0),S(C,M,`⊣`,`\\dashv`,!0),S(C,M,`∋`,`\\owns`),S(C,M,`≘`,`\\arceq`,!0),S(C,M,`≙`,`\\wedgeq`,!0),S(C,M,`≚`,`\\veeeq`,!0),S(C,M,`≛`,`\\stareq`,!0),S(C,M,`≝`,`\\eqdef`,!0),S(C,M,`≞`,`\\measeq`,!0),S(C,M,`≟`,`\\questeq`,!0),S(C,M,`≠`,`\\ne`,!0),S(C,M,`≠`,`\\neq`),S(C,M,`⩵`,`\\eqeq`,!0),S(C,M,`⩶`,`\\eqeqeq`,!0),S(C,M,`∷`,`\\dblcolon`,!0),S(C,M,`≔`,`\\coloneqq`,!0),S(C,M,`≕`,`\\eqqcolon`,!0),S(C,M,`∹`,`\\eqcolon`,!0),S(C,M,`⩴`,`\\Coloneqq`,!0),S(C,ve,`.`,`\\ldotp`),S(C,ve,`·`,`\\cdotp`),S(C,P,`#`,`\\#`),S(w,P,`#`,`\\#`),S(C,P,`&`,`\\&`),S(w,P,`&`,`\\&`),S(C,P,`ℵ`,`\\aleph`,!0),S(C,P,`∀`,`\\forall`,!0),S(C,P,`ℏ`,`\\hbar`,!0),S(C,P,`∃`,`\\exists`,!0),S(C,E,`∇`,`\\nabla`,!0),S(C,P,`♭`,`\\flat`,!0),S(C,P,`ℓ`,`\\ell`,!0),S(C,P,`♮`,`\\natural`,!0),S(C,P,`Å`,`\\Angstrom`,!0),S(w,P,`Å`,`\\Angstrom`,!0),S(C,P,`♣`,`\\clubsuit`,!0),S(C,P,`♧`,`\\varclubsuit`,!0),S(C,P,`℘`,`\\wp`,!0),S(C,P,`♯`,`\\sharp`,!0),S(C,P,`♢`,`\\diamondsuit`,!0),S(C,P,`♦`,`\\vardiamondsuit`,!0),S(C,P,`ℜ`,`\\Re`,!0),S(C,P,`♡`,`\\heartsuit`,!0),S(C,P,`♥`,`\\varheartsuit`,!0),S(C,P,`ℑ`,`\\Im`,!0),S(C,P,`♠`,`\\spadesuit`,!0),S(C,P,`♤`,`\\varspadesuit`,!0),S(C,P,`♀`,`\\female`,!0),S(C,P,`♂`,`\\male`,!0),S(C,P,`§`,`\\S`,!0),S(w,P,`§`,`\\S`),S(C,P,`¶`,`\\P`,!0),S(w,P,`¶`,`\\P`),S(w,P,`☺`,`\\smiley`,!0),S(C,P,`☺`,`\\smiley`,!0),S(C,P,`†`,`\\dag`),S(w,P,`†`,`\\dag`),S(w,P,`†`,`\\textdagger`),S(C,P,`‡`,`\\ddag`),S(w,P,`‡`,`\\ddag`),S(w,P,`‡`,`\\textdaggerdbl`),S(C,D,`⎱`,`\\rmoustache`,!0),S(C,j,`⎰`,`\\lmoustache`,!0),S(C,D,`⟯`,`\\rgroup`,!0),S(C,j,`⟮`,`\\lgroup`,!0),S(C,E,`∓`,`\\mp`,!0),S(C,E,`⊖`,`\\ominus`,!0),S(C,E,`⊎`,`\\uplus`,!0),S(C,E,`⊓`,`\\sqcap`,!0),S(C,E,`∗`,`\\ast`),S(C,E,`⊔`,`\\sqcup`,!0),S(C,E,`◯`,`\\bigcirc`,!0),S(C,E,`∙`,`\\bullet`,!0),S(C,E,`‡`,`\\ddagger`),S(C,E,`≀`,`\\wr`,!0),S(C,E,`⨿`,`\\amalg`),S(C,E,`&`,`\\And`),S(C,E,`⫽`,`\\sslash`,!0),S(C,M,`⟵`,`\\longleftarrow`,!0),S(C,M,`⇐`,`\\Leftarrow`,!0),S(C,M,`⟸`,`\\Longleftarrow`,!0),S(C,M,`⟶`,`\\longrightarrow`,!0),S(C,M,`⇒`,`\\Rightarrow`,!0),S(C,M,`⟹`,`\\Longrightarrow`,!0),S(C,M,`↔`,`\\leftrightarrow`,!0),S(C,M,`⟷`,`\\longleftrightarrow`,!0),S(C,M,`⇔`,`\\Leftrightarrow`,!0),S(C,M,`⟺`,`\\Longleftrightarrow`,!0),S(C,M,`↤`,`\\mapsfrom`,!0),S(C,M,`↦`,`\\mapsto`,!0),S(C,M,`⟼`,`\\longmapsto`,!0),S(C,M,`↗`,`\\nearrow`,!0),S(C,M,`↩`,`\\hookleftarrow`,!0),S(C,M,`↪`,`\\hookrightarrow`,!0),S(C,M,`↘`,`\\searrow`,!0),S(C,M,`↼`,`\\leftharpoonup`,!0),S(C,M,`⇀`,`\\rightharpoonup`,!0),S(C,M,`↙`,`\\swarrow`,!0),S(C,M,`↽`,`\\leftharpoondown`,!0),S(C,M,`⇁`,`\\rightharpoondown`,!0),S(C,M,`↖`,`\\nwarrow`,!0),S(C,M,`⇌`,`\\rightleftharpoons`,!0),S(C,k,`↯`,`\\lightning`,!0),S(C,k,`∎`,`\\QED`,!0),S(C,k,`‰`,`\\permil`,!0),S(w,P,`‰`,`\\permil`),S(C,k,`☉`,`\\astrosun`,!0),S(C,k,`☼`,`\\sun`,!0),S(C,k,`☾`,`\\leftmoon`,!0),S(C,k,`☽`,`\\rightmoon`,!0),S(C,k,`⊕`,`\\Earth`),S(C,M,`≮`,`\\nless`,!0),S(C,M,`⪇`,`\\lneq`,!0),S(C,M,`≨`,`\\lneqq`,!0),S(C,M,`≨︀`,`\\lvertneqq`),S(C,M,`⋦`,`\\lnsim`,!0),S(C,M,`⪉`,`\\lnapprox`,!0),S(C,M,`⊀`,`\\nprec`,!0),S(C,M,`⋠`,`\\npreceq`,!0),S(C,M,`⋨`,`\\precnsim`,!0),S(C,M,`⪹`,`\\precnapprox`,!0),S(C,M,`≁`,`\\nsim`,!0),S(C,M,`∤`,`\\nmid`,!0),S(C,M,`∤`,`\\nshortmid`),S(C,M,`⊬`,`\\nvdash`,!0),S(C,M,`⊭`,`\\nvDash`,!0),S(C,M,`⋪`,`\\ntriangleleft`),S(C,M,`⋬`,`\\ntrianglelefteq`,!0),S(C,M,`⊄`,`\\nsubset`,!0),S(C,M,`⊅`,`\\nsupset`,!0),S(C,M,`⊊`,`\\subsetneq`,!0),S(C,M,`⊊︀`,`\\varsubsetneq`),S(C,M,`⫋`,`\\subsetneqq`,!0),S(C,M,`⫋︀`,`\\varsubsetneqq`),S(C,M,`≯`,`\\ngtr`,!0),S(C,M,`⪈`,`\\gneq`,!0),S(C,M,`≩`,`\\gneqq`,!0),S(C,M,`≩︀`,`\\gvertneqq`),S(C,M,`⋧`,`\\gnsim`,!0),S(C,M,`⪊`,`\\gnapprox`,!0),S(C,M,`⊁`,`\\nsucc`,!0),S(C,M,`⋡`,`\\nsucceq`,!0),S(C,M,`⋩`,`\\succnsim`,!0),S(C,M,`⪺`,`\\succnapprox`,!0),S(C,M,`≆`,`\\ncong`,!0),S(C,M,`∦`,`\\nparallel`,!0),S(C,M,`∦`,`\\nshortparallel`),S(C,M,`⊯`,`\\nVDash`,!0),S(C,M,`⋫`,`\\ntriangleright`),S(C,M,`⋭`,`\\ntrianglerighteq`,!0),S(C,M,`⊋`,`\\supsetneq`,!0),S(C,M,`⊋`,`\\varsupsetneq`),S(C,M,`⫌`,`\\supsetneqq`,!0),S(C,M,`⫌︀`,`\\varsupsetneqq`),S(C,M,`⊮`,`\\nVdash`,!0),S(C,M,`⪵`,`\\precneqq`,!0),S(C,M,`⪶`,`\\succneqq`,!0),S(C,E,`⊴`,`\\unlhd`),S(C,E,`⊵`,`\\unrhd`),S(C,M,`↚`,`\\nleftarrow`,!0),S(C,M,`↛`,`\\nrightarrow`,!0),S(C,M,`⇍`,`\\nLeftarrow`,!0),S(C,M,`⇏`,`\\nRightarrow`,!0),S(C,M,`↮`,`\\nleftrightarrow`,!0),S(C,M,`⇎`,`\\nLeftrightarrow`,!0),S(C,M,`△`,`\\vartriangle`),S(C,P,`ℏ`,`\\hslash`),S(C,P,`▽`,`\\triangledown`),S(C,P,`◊`,`\\lozenge`),S(C,P,`Ⓢ`,`\\circledS`),S(C,P,`®`,`\\circledR`,!0),S(w,P,`®`,`\\circledR`),S(w,P,`®`,`\\textregistered`),S(C,P,`∡`,`\\measuredangle`,!0),S(C,P,`∄`,`\\nexists`),S(C,P,`℧`,`\\mho`),S(C,P,`Ⅎ`,`\\Finv`,!0),S(C,P,`⅁`,`\\Game`,!0),S(C,P,`‵`,`\\backprime`),S(C,P,`‶`,`\\backdprime`),S(C,P,`‷`,`\\backtrprime`),S(C,P,`▲`,`\\blacktriangle`),S(C,P,`▼`,`\\blacktriangledown`),S(C,P,`■`,`\\blacksquare`),S(C,P,`⧫`,`\\blacklozenge`),S(C,P,`★`,`\\bigstar`),S(C,P,`∢`,`\\sphericalangle`,!0),S(C,P,`∁`,`\\complement`,!0),S(C,P,`ð`,`\\eth`,!0),S(w,P,`ð`,`ð`),S(C,P,`╱`,`\\diagup`),S(C,P,`╲`,`\\diagdown`),S(C,P,`□`,`\\square`),S(C,P,`□`,`\\Box`),S(C,P,`◊`,`\\Diamond`),S(C,P,`¥`,`\\yen`,!0),S(w,P,`¥`,`\\yen`,!0),S(C,P,`✓`,`\\checkmark`,!0),S(w,P,`✓`,`\\checkmark`),S(C,P,`✗`,`\\ballotx`,!0),S(w,P,`✗`,`\\ballotx`),S(w,P,`•`,`\\textbullet`),S(C,P,`ℶ`,`\\beth`,!0),S(C,P,`ℸ`,`\\daleth`,!0),S(C,P,`ℷ`,`\\gimel`,!0),S(C,P,`ϝ`,`\\digamma`,!0),S(C,P,`ϰ`,`\\varkappa`),S(C,j,`⌜`,`\\ulcorner`,!0),S(C,D,`⌝`,`\\urcorner`,!0),S(C,j,`⌞`,`\\llcorner`,!0),S(C,D,`⌟`,`\\lrcorner`,!0),S(C,M,`≦`,`\\leqq`,!0),S(C,M,`⩽`,`\\leqslant`,!0),S(C,M,`⪕`,`\\eqslantless`,!0),S(C,M,`≲`,`\\lesssim`,!0),S(C,M,`⪅`,`\\lessapprox`,!0),S(C,M,`≊`,`\\approxeq`,!0),S(C,E,`⋖`,`\\lessdot`),S(C,M,`⋘`,`\\lll`,!0),S(C,M,`≶`,`\\lessgtr`,!0),S(C,M,`⋚`,`\\lesseqgtr`,!0),S(C,M,`⪋`,`\\lesseqqgtr`,!0),S(C,M,`≑`,`\\doteqdot`),S(C,M,`≓`,`\\risingdotseq`,!0),S(C,M,`≒`,`\\fallingdotseq`,!0),S(C,M,`∽`,`\\backsim`,!0),S(C,M,`⋍`,`\\backsimeq`,!0),S(C,M,`⫅`,`\\subseteqq`,!0),S(C,M,`⋐`,`\\Subset`,!0),S(C,M,`⊏`,`\\sqsubset`,!0),S(C,M,`≼`,`\\preccurlyeq`,!0),S(C,M,`⋞`,`\\curlyeqprec`,!0),S(C,M,`≾`,`\\precsim`,!0),S(C,M,`⪷`,`\\precapprox`,!0),S(C,M,`⊲`,`\\vartriangleleft`),S(C,M,`⊴`,`\\trianglelefteq`),S(C,M,`⊨`,`\\vDash`,!0),S(C,M,`⊫`,`\\VDash`,!0),S(C,M,`⊪`,`\\Vvdash`,!0),S(C,M,`⌣`,`\\smallsmile`),S(C,M,`⌢`,`\\smallfrown`),S(C,M,`≏`,`\\bumpeq`,!0),S(C,M,`≎`,`\\Bumpeq`,!0),S(C,M,`≧`,`\\geqq`,!0),S(C,M,`⩾`,`\\geqslant`,!0),S(C,M,`⪖`,`\\eqslantgtr`,!0),S(C,M,`≳`,`\\gtrsim`,!0),S(C,M,`⪆`,`\\gtrapprox`,!0),S(C,E,`⋗`,`\\gtrdot`),S(C,M,`⋙`,`\\ggg`,!0),S(C,M,`≷`,`\\gtrless`,!0),S(C,M,`⋛`,`\\gtreqless`,!0),S(C,M,`⪌`,`\\gtreqqless`,!0),S(C,M,`≖`,`\\eqcirc`,!0),S(C,M,`≗`,`\\circeq`,!0),S(C,M,`≜`,`\\triangleq`,!0),S(C,M,`∼`,`\\thicksim`),S(C,M,`≈`,`\\thickapprox`),S(C,M,`⫆`,`\\supseteqq`,!0),S(C,M,`⋑`,`\\Supset`,!0),S(C,M,`⊐`,`\\sqsupset`,!0),S(C,M,`≽`,`\\succcurlyeq`,!0),S(C,M,`⋟`,`\\curlyeqsucc`,!0),S(C,M,`≿`,`\\succsim`,!0),S(C,M,`⪸`,`\\succapprox`,!0),S(C,M,`⊳`,`\\vartriangleright`),S(C,M,`⊵`,`\\trianglerighteq`),S(C,M,`⊩`,`\\Vdash`,!0),S(C,M,`∣`,`\\shortmid`),S(C,M,`∥`,`\\shortparallel`),S(C,M,`≬`,`\\between`,!0),S(C,M,`⋔`,`\\pitchfork`,!0),S(C,M,`∝`,`\\varpropto`),S(C,M,`◀`,`\\blacktriangleleft`),S(C,M,`∴`,`\\therefore`,!0),S(C,M,`∍`,`\\backepsilon`),S(C,M,`▶`,`\\blacktriangleright`),S(C,M,`∵`,`\\because`,!0),S(C,M,`⋘`,`\\llless`),S(C,M,`⋙`,`\\gggtr`),S(C,E,`⊲`,`\\lhd`),S(C,E,`⊳`,`\\rhd`),S(C,M,`≂`,`\\eqsim`,!0),S(C,M,`≑`,`\\Doteq`,!0),S(C,M,`⥽`,`\\strictif`,!0),S(C,M,`⥼`,`\\strictfi`,!0),S(C,E,`∔`,`\\dotplus`,!0),S(C,E,`∖`,`\\smallsetminus`),S(C,E,`⋒`,`\\Cap`,!0),S(C,E,`⋓`,`\\Cup`,!0),S(C,E,`⩞`,`\\doublebarwedge`,!0),S(C,E,`⊟`,`\\boxminus`,!0),S(C,E,`⊞`,`\\boxplus`,!0),S(C,E,`⧄`,`\\boxslash`,!0),S(C,E,`⋇`,`\\divideontimes`,!0),S(C,E,`⋉`,`\\ltimes`,!0),S(C,E,`⋊`,`\\rtimes`,!0),S(C,E,`⋋`,`\\leftthreetimes`,!0),S(C,E,`⋌`,`\\rightthreetimes`,!0),S(C,E,`⋏`,`\\curlywedge`,!0),S(C,E,`⋎`,`\\curlyvee`,!0),S(C,E,`⊝`,`\\circleddash`,!0),S(C,E,`⊛`,`\\circledast`,!0),S(C,E,`⊺`,`\\intercal`,!0),S(C,E,`⋒`,`\\doublecap`),S(C,E,`⋓`,`\\doublecup`),S(C,E,`⊠`,`\\boxtimes`,!0),S(C,E,`⋈`,`\\bowtie`,!0),S(C,E,`⋈`,`\\Join`),S(C,E,`⟕`,`\\leftouterjoin`,!0),S(C,E,`⟖`,`\\rightouterjoin`,!0),S(C,E,`⟗`,`\\fullouterjoin`,!0),S(C,E,`∸`,`\\dotminus`,!0),S(C,E,`⟑`,`\\wedgedot`,!0),S(C,E,`⟇`,`\\veedot`,!0),S(C,E,`⩢`,`\\doublebarvee`,!0),S(C,E,`⩣`,`\\veedoublebar`,!0),S(C,E,`⩟`,`\\wedgebar`,!0),S(C,E,`⩠`,`\\wedgedoublebar`,!0),S(C,E,`⩔`,`\\Vee`,!0),S(C,E,`⩓`,`\\Wedge`,!0),S(C,E,`⩃`,`\\barcap`,!0),S(C,E,`⩂`,`\\barcup`,!0),S(C,E,`⩈`,`\\capbarcup`,!0),S(C,E,`⩀`,`\\capdot`,!0),S(C,E,`⩇`,`\\capovercup`,!0),S(C,E,`⩆`,`\\cupovercap`,!0),S(C,E,`⩍`,`\\closedvarcap`,!0),S(C,E,`⩌`,`\\closedvarcup`,!0),S(C,E,`⨪`,`\\minusdot`,!0),S(C,E,`⨫`,`\\minusfdots`,!0),S(C,E,`⨬`,`\\minusrdots`,!0),S(C,E,`⊻`,`\\Xor`,!0),S(C,E,`⊼`,`\\Nand`,!0),S(C,E,`⊽`,`\\Nor`,!0),S(C,E,`⊽`,`\\barvee`),S(C,E,`⫴`,`\\interleave`,!0),S(C,E,`⧢`,`\\shuffle`,!0),S(C,E,`⫶`,`\\threedotcolon`,!0),S(C,E,`⦂`,`\\typecolon`,!0),S(C,E,`∾`,`\\invlazys`,!0),S(C,E,`⩋`,`\\twocaps`,!0),S(C,E,`⩊`,`\\twocups`,!0),S(C,E,`⩎`,`\\Sqcap`,!0),S(C,E,`⩏`,`\\Sqcup`,!0),S(C,E,`⩖`,`\\veeonvee`,!0),S(C,E,`⩕`,`\\wedgeonwedge`,!0),S(C,E,`⧗`,`\\blackhourglass`,!0),S(C,E,`⧆`,`\\boxast`,!0),S(C,E,`⧈`,`\\boxbox`,!0),S(C,E,`⧇`,`\\boxcircle`,!0),S(C,E,`⊜`,`\\circledequal`,!0),S(C,E,`⦷`,`\\circledparallel`,!0),S(C,E,`⦶`,`\\circledvert`,!0),S(C,E,`⦵`,`\\circlehbar`,!0),S(C,E,`⟡`,`\\concavediamond`,!0),S(C,E,`⟢`,`\\concavediamondtickleft`,!0),S(C,E,`⟣`,`\\concavediamondtickright`,!0),S(C,E,`⋄`,`\\diamond`,!0),S(C,E,`⧖`,`\\hourglass`,!0),S(C,E,`⟠`,`\\lozengeminus`,!0),S(C,E,`⌽`,`\\obar`,!0),S(C,E,`⦸`,`\\obslash`,!0),S(C,E,`⨸`,`\\odiv`,!0),S(C,E,`⧁`,`\\ogreaterthan`,!0),S(C,E,`⧀`,`\\olessthan`,!0),S(C,E,`⦹`,`\\operp`,!0),S(C,E,`⨷`,`\\Otimes`,!0),S(C,E,`⨶`,`\\otimeshat`,!0),S(C,E,`⋆`,`\\star`,!0),S(C,E,`△`,`\\triangle`,!0),S(C,E,`⨺`,`\\triangleminus`,!0),S(C,E,`⨹`,`\\triangleplus`,!0),S(C,E,`⨻`,`\\triangletimes`,!0),S(C,E,`⟤`,`\\whitesquaretickleft`,!0),S(C,E,`⟥`,`\\whitesquaretickright`,!0),S(C,E,`⨳`,`\\smashtimes`,!0),S(C,M,`⇢`,`\\dashrightarrow`,!0),S(C,M,`⇠`,`\\dashleftarrow`,!0),S(C,M,`⇇`,`\\leftleftarrows`,!0),S(C,M,`⇆`,`\\leftrightarrows`,!0),S(C,M,`⇚`,`\\Lleftarrow`,!0),S(C,M,`↞`,`\\twoheadleftarrow`,!0),S(C,M,`↢`,`\\leftarrowtail`,!0),S(C,M,`↫`,`\\looparrowleft`,!0),S(C,M,`⇋`,`\\leftrightharpoons`,!0),S(C,M,`↶`,`\\curvearrowleft`,!0),S(C,M,`↺`,`\\circlearrowleft`,!0),S(C,M,`↰`,`\\Lsh`,!0),S(C,M,`⇈`,`\\upuparrows`,!0),S(C,M,`↿`,`\\upharpoonleft`,!0),S(C,M,`⇃`,`\\downharpoonleft`,!0),S(C,M,`⊶`,`\\origof`,!0),S(C,M,`⊷`,`\\imageof`,!0),S(C,M,`⊸`,`\\multimap`,!0),S(C,M,`↭`,`\\leftrightsquigarrow`,!0),S(C,M,`⇉`,`\\rightrightarrows`,!0),S(C,M,`⇄`,`\\rightleftarrows`,!0),S(C,M,`↠`,`\\twoheadrightarrow`,!0),S(C,M,`↣`,`\\rightarrowtail`,!0),S(C,M,`↬`,`\\looparrowright`,!0),S(C,M,`↷`,`\\curvearrowright`,!0),S(C,M,`↻`,`\\circlearrowright`,!0),S(C,M,`↱`,`\\Rsh`,!0),S(C,M,`⇊`,`\\downdownarrows`,!0),S(C,M,`↾`,`\\upharpoonright`,!0),S(C,M,`⇂`,`\\downharpoonright`,!0),S(C,M,`⇝`,`\\rightsquigarrow`,!0),S(C,M,`⇝`,`\\leadsto`),S(C,M,`⇛`,`\\Rrightarrow`,!0),S(C,M,`↾`,`\\restriction`),S(C,P,`‘`,"`"),S(C,P,`$`,`\\$`),S(w,P,`$`,`\\$`),S(w,P,`$`,`\\textdollar`),S(C,P,`¢`,`\\cent`),S(w,P,`¢`,`\\cent`),S(C,P,`%`,`\\%`),S(w,P,`%`,`\\%`),S(C,P,`_`,`\\_`),S(w,P,`_`,`\\_`),S(w,P,`_`,`\\textunderscore`),S(w,P,`␣`,`\\textvisiblespace`,!0),S(C,P,`∠`,`\\angle`,!0),S(C,P,`∞`,`\\infty`,!0),S(C,P,`′`,`\\prime`),S(C,P,`″`,`\\dprime`),S(C,P,`‴`,`\\trprime`),S(C,P,`⁗`,`\\qprime`),S(C,P,`△`,`\\triangle`),S(w,P,`Α`,`\\Alpha`,!0),S(w,P,`Β`,`\\Beta`,!0),S(w,P,`Γ`,`\\Gamma`,!0),S(w,P,`Δ`,`\\Delta`,!0),S(w,P,`Ε`,`\\Epsilon`,!0),S(w,P,`Ζ`,`\\Zeta`,!0),S(w,P,`Η`,`\\Eta`,!0),S(w,P,`Θ`,`\\Theta`,!0),S(w,P,`Ι`,`\\Iota`,!0),S(w,P,`Κ`,`\\Kappa`,!0),S(w,P,`Λ`,`\\Lambda`,!0),S(w,P,`Μ`,`\\Mu`,!0),S(w,P,`Ν`,`\\Nu`,!0),S(w,P,`Ξ`,`\\Xi`,!0),S(w,P,`Ο`,`\\Omicron`,!0),S(w,P,`Π`,`\\Pi`,!0),S(w,P,`Ρ`,`\\Rho`,!0),S(w,P,`Σ`,`\\Sigma`,!0),S(w,P,`Τ`,`\\Tau`,!0),S(w,P,`Υ`,`\\Upsilon`,!0),S(w,P,`Φ`,`\\Phi`,!0),S(w,P,`Χ`,`\\Chi`,!0),S(w,P,`Ψ`,`\\Psi`,!0),S(w,P,`Ω`,`\\Omega`,!0),S(C,k,`Α`,`\\Alpha`,!0),S(C,k,`Β`,`\\Beta`,!0),S(C,k,`Γ`,`\\Gamma`,!0),S(C,k,`Δ`,`\\Delta`,!0),S(C,k,`Ε`,`\\Epsilon`,!0),S(C,k,`Ζ`,`\\Zeta`,!0),S(C,k,`Η`,`\\Eta`,!0),S(C,k,`Θ`,`\\Theta`,!0),S(C,k,`Ι`,`\\Iota`,!0),S(C,k,`Κ`,`\\Kappa`,!0),S(C,k,`Λ`,`\\Lambda`,!0),S(C,k,`Μ`,`\\Mu`,!0),S(C,k,`Ν`,`\\Nu`,!0),S(C,k,`Ξ`,`\\Xi`,!0),S(C,k,`Ο`,`\\Omicron`,!0),S(C,k,`Π`,`\\Pi`,!0),S(C,k,`Ρ`,`\\Rho`,!0),S(C,k,`Σ`,`\\Sigma`,!0),S(C,k,`Τ`,`\\Tau`,!0),S(C,k,`Υ`,`\\Upsilon`,!0),S(C,k,`Φ`,`\\Phi`,!0),S(C,k,`Χ`,`\\Chi`,!0),S(C,k,`Ψ`,`\\Psi`,!0),S(C,k,`Ω`,`\\Omega`,!0),S(C,j,`¬`,`\\neg`,!0),S(C,j,`¬`,`\\lnot`),S(C,P,`⊤`,`\\top`),S(C,P,`⊥`,`\\bot`),S(C,P,`∅`,`\\emptyset`),S(C,P,`⌀`,`\\varnothing`),S(C,k,`α`,`\\alpha`,!0),S(C,k,`β`,`\\beta`,!0),S(C,k,`γ`,`\\gamma`,!0),S(C,k,`δ`,`\\delta`,!0),S(C,k,`ϵ`,`\\epsilon`,!0),S(C,k,`ζ`,`\\zeta`,!0),S(C,k,`η`,`\\eta`,!0),S(C,k,`θ`,`\\theta`,!0),S(C,k,`ι`,`\\iota`,!0),S(C,k,`κ`,`\\kappa`,!0),S(C,k,`λ`,`\\lambda`,!0),S(C,k,`μ`,`\\mu`,!0),S(C,k,`ν`,`\\nu`,!0),S(C,k,`ξ`,`\\xi`,!0),S(C,k,`ο`,`\\omicron`,!0),S(C,k,`π`,`\\pi`,!0),S(C,k,`ρ`,`\\rho`,!0),S(C,k,`σ`,`\\sigma`,!0),S(C,k,`τ`,`\\tau`,!0),S(C,k,`υ`,`\\upsilon`,!0),S(C,k,`ϕ`,`\\phi`,!0),S(C,k,`χ`,`\\chi`,!0),S(C,k,`ψ`,`\\psi`,!0),S(C,k,`ω`,`\\omega`,!0),S(C,k,`ε`,`\\varepsilon`,!0),S(C,k,`ϑ`,`\\vartheta`,!0),S(C,k,`ϖ`,`\\varpi`,!0),S(C,k,`ϱ`,`\\varrho`,!0),S(C,k,`ς`,`\\varsigma`,!0),S(C,k,`φ`,`\\varphi`,!0),S(C,k,`Ϙ`,`\\Coppa`,!0),S(C,k,`ϙ`,`\\coppa`,!0),S(C,k,`ϙ`,`\\varcoppa`,!0),S(C,k,`Ϟ`,`\\Koppa`,!0),S(C,k,`ϟ`,`\\koppa`,!0),S(C,k,`Ϡ`,`\\Sampi`,!0),S(C,k,`ϡ`,`\\sampi`,!0),S(C,k,`Ϛ`,`\\Stigma`,!0),S(C,k,`ϛ`,`\\stigma`,!0),S(C,k,`⫫`,`\\Bot`),S(C,E,`∗`,`∗`,!0),S(C,E,`+`,`+`),S(C,E,`∗`,`*`),S(C,E,`⁄`,`/`,!0),S(C,E,`⁄`,`⁄`),S(C,E,`−`,`-`,!0),S(C,E,`⋅`,`\\cdot`,!0),S(C,E,`∘`,`\\circ`,!0),S(C,E,`÷`,`\\div`,!0),S(C,E,`±`,`\\pm`,!0),S(C,E,`×`,`\\times`,!0),S(C,E,`∩`,`\\cap`,!0),S(C,E,`∪`,`\\cup`,!0),S(C,E,`∖`,`\\setminus`,!0),S(C,E,`∧`,`\\land`),S(C,E,`∨`,`\\lor`),S(C,E,`∧`,`\\wedge`,!0),S(C,E,`∨`,`\\vee`,!0),S(C,j,`⟦`,`\\llbracket`,!0),S(C,D,`⟧`,`\\rrbracket`,!0),S(C,j,`⟨`,`\\langle`,!0),S(C,j,`⟪`,`\\lAngle`,!0),S(C,j,`⦉`,`\\llangle`,!0),S(C,j,`|`,`\\lvert`),S(C,j,`‖`,`\\lVert`,!0),S(C,P,`!`,`\\oc`),S(C,P,`?`,`\\wn`),S(C,P,`↓`,`\\shpos`),S(C,P,`↕`,`\\shift`),S(C,P,`↑`,`\\shneg`),S(C,D,`?`,`?`),S(C,D,`!`,`!`),S(C,D,`‼`,`‼`),S(C,D,`⟩`,`\\rangle`,!0),S(C,D,`⟫`,`\\rAngle`,!0),S(C,D,`⦊`,`\\rrangle`,!0),S(C,D,`|`,`\\rvert`),S(C,D,`‖`,`\\rVert`),S(C,j,`⦃`,`\\lBrace`,!0),S(C,D,`⦄`,`\\rBrace`,!0),S(C,M,`=`,`\\equal`,!0),S(C,M,`:`,`:`),S(C,M,`≈`,`\\approx`,!0),S(C,M,`≅`,`\\cong`,!0),S(C,M,`≥`,`\\ge`),S(C,M,`≥`,`\\geq`,!0),S(C,M,`←`,`\\gets`),S(C,M,`>`,`\\gt`,!0),S(C,M,`∈`,`\\in`,!0),S(C,M,`∉`,`\\notin`,!0),S(C,M,``,`\\@not`),S(C,M,`⊂`,`\\subset`,!0),S(C,M,`⊃`,`\\supset`,!0),S(C,M,`⊆`,`\\subseteq`,!0),S(C,M,`⊇`,`\\supseteq`,!0),S(C,M,`⊈`,`\\nsubseteq`,!0),S(C,M,`⊈`,`\\nsubseteqq`),S(C,M,`⊉`,`\\nsupseteq`,!0),S(C,M,`⊉`,`\\nsupseteqq`),S(C,M,`⊨`,`\\models`),S(C,M,`←`,`\\leftarrow`,!0),S(C,M,`≤`,`\\le`),S(C,M,`≤`,`\\leq`,!0),S(C,M,`<`,`\\lt`,!0),S(C,M,`→`,`\\rightarrow`,!0),S(C,M,`→`,`\\to`),S(C,M,`≱`,`\\ngeq`,!0),S(C,M,`≱`,`\\ngeqq`),S(C,M,`≱`,`\\ngeqslant`),S(C,M,`≰`,`\\nleq`,!0),S(C,M,`≰`,`\\nleqq`),S(C,M,`≰`,`\\nleqslant`),S(C,M,`⫫`,`\\Perp`,!0),S(C,N,`\xA0`,`\\ `),S(C,N,`\xA0`,`\\space`),S(C,N,`\xA0`,`\\nobreakspace`),S(w,N,`\xA0`,`\\ `),S(w,N,`\xA0`,` `),S(w,N,`\xA0`,`\\space`),S(w,N,`\xA0`,`\\nobreakspace`),S(C,N,null,`\\nobreak`),S(C,N,null,`\\allowbreak`),S(C,ve,`,`,`,`),S(w,ve,`:`,`:`),S(C,ve,`;`,`;`),S(C,E,`⊼`,`\\barwedge`),S(C,E,`⊻`,`\\veebar`),S(C,E,`⊙`,`\\odot`,!0),S(C,E,`⊕︎`,`\\oplus`),S(C,E,`⊗`,`\\otimes`,!0),S(C,P,`∂`,`\\partial`,!0),S(C,E,`⊘`,`\\oslash`,!0),S(C,E,`⊚`,`\\circledcirc`,!0),S(C,E,`⊡`,`\\boxdot`,!0),S(C,E,`△`,`\\bigtriangleup`),S(C,E,`▽`,`\\bigtriangledown`),S(C,E,`†`,`\\dagger`),S(C,E,`⋄`,`\\diamond`),S(C,E,`◃`,`\\triangleleft`),S(C,E,`▹`,`\\triangleright`),S(C,j,`{`,`\\{`),S(w,P,`{`,`\\{`),S(w,P,`{`,`\\textbraceleft`),S(C,D,`}`,`\\}`),S(w,P,`}`,`\\}`),S(w,P,`}`,`\\textbraceright`),S(C,j,`{`,`\\lbrace`),S(C,D,`}`,`\\rbrace`),S(C,j,`[`,`\\lbrack`,!0),S(w,P,`[`,`\\lbrack`,!0),S(C,D,`]`,`\\rbrack`,!0),S(w,P,`]`,`\\rbrack`,!0),S(C,j,`(`,`\\lparen`,!0),S(C,D,`)`,`\\rparen`,!0),S(C,j,`⦇`,`\\llparenthesis`,!0),S(C,D,`⦈`,`\\rrparenthesis`,!0),S(w,P,`<`,`\\textless`,!0),S(w,P,`>`,`\\textgreater`,!0),S(C,j,`⌊`,`\\lfloor`,!0),S(C,D,`⌋`,`\\rfloor`,!0),S(C,j,`⌈`,`\\lceil`,!0),S(C,D,`⌉`,`\\rceil`,!0),S(C,P,`\\`,`\\backslash`),S(C,P,`|`,`|`),S(C,P,`|`,`\\vert`),S(w,P,`|`,`\\textbar`,!0),S(C,P,`‖`,`\\|`),S(C,P,`‖`,`\\Vert`),S(w,P,`‖`,`\\textbardbl`),S(w,P,`~`,`\\textasciitilde`),S(w,P,`\\`,`\\textbackslash`),S(w,P,`^`,`\\textasciicircum`),S(C,M,`↑`,`\\uparrow`,!0),S(C,M,`⇑`,`\\Uparrow`,!0),S(C,M,`↓`,`\\downarrow`,!0),S(C,M,`⇓`,`\\Downarrow`,!0),S(C,M,`↕`,`\\updownarrow`,!0),S(C,M,`⇕`,`\\Updownarrow`,!0),S(C,A,`∐`,`\\coprod`),S(C,A,`⋁`,`\\bigvee`),S(C,A,`⋀`,`\\bigwedge`),S(C,A,`⨄`,`\\biguplus`),S(C,A,`⨄`,`\\bigcupplus`),S(C,A,`⨃`,`\\bigcupdot`),S(C,A,`⨇`,`\\bigdoublevee`),S(C,A,`⨈`,`\\bigdoublewedge`),S(C,A,`⋂`,`\\bigcap`),S(C,A,`⋃`,`\\bigcup`),S(C,A,`∫`,`\\int`),S(C,A,`∫`,`\\intop`),S(C,A,`∬`,`\\iint`),S(C,A,`∭`,`\\iiint`),S(C,A,`∏`,`\\prod`),S(C,A,`∑`,`\\sum`),S(C,A,`⨂`,`\\bigotimes`),S(C,A,`⨁`,`\\bigoplus`),S(C,A,`⨀`,`\\bigodot`),S(C,A,`⨉`,`\\bigtimes`),S(C,A,`∮`,`\\oint`),S(C,A,`∯`,`\\oiint`),S(C,A,`∰`,`\\oiiint`),S(C,A,`∱`,`\\intclockwise`),S(C,A,`∲`,`\\varointclockwise`),S(C,A,`⨌`,`\\iiiint`),S(C,A,`⨍`,`\\intbar`),S(C,A,`⨎`,`\\intBar`),S(C,A,`⨏`,`\\fint`),S(C,A,`⨒`,`\\rppolint`),S(C,A,`⨓`,`\\scpolint`),S(C,A,`⨕`,`\\pointint`),S(C,A,`⨖`,`\\sqint`),S(C,A,`⨗`,`\\intlarhk`),S(C,A,`⨘`,`\\intx`),S(C,A,`⨙`,`\\intcap`),S(C,A,`⨚`,`\\intcup`),S(C,A,`⨅`,`\\bigsqcap`),S(C,A,`⨆`,`\\bigsqcup`),S(C,A,`∫`,`\\smallint`),S(w,O,`…`,`\\textellipsis`),S(C,O,`…`,`\\mathellipsis`),S(w,O,`…`,`\\ldots`,!0),S(C,O,`…`,`\\ldots`,!0),S(C,O,`⋰`,`\\iddots`,!0),S(C,O,`⋯`,`\\@cdots`,!0),S(C,O,`⋱`,`\\ddots`,!0),S(C,P,`⋮`,`\\varvdots`),S(w,P,`⋮`,`\\varvdots`),S(C,T,`ˊ`,`\\acute`),S(C,T,"`",`\\grave`),S(C,T,`¨`,`\\ddot`),S(C,T,`…`,`\\dddot`),S(C,T,`….`,`\\ddddot`),S(C,T,`~`,`\\tilde`),S(C,T,`‾`,`\\bar`),S(C,T,`˘`,`\\breve`),S(C,T,`ˇ`,`\\check`),S(C,T,`^`,`\\hat`),S(C,T,`→`,`\\vec`),S(C,T,`˙`,`\\dot`),S(C,T,`˚`,`\\mathring`),S(C,k,`ı`,`\\imath`,!0),S(C,k,`ȷ`,`\\jmath`,!0),S(C,P,`ı`,`ı`),S(C,P,`ȷ`,`ȷ`),S(w,P,`ı`,`\\i`,!0),S(w,P,`ȷ`,`\\j`,!0),S(w,P,`ß`,`\\ss`,!0),S(w,P,`æ`,`\\ae`,!0),S(w,P,`œ`,`\\oe`,!0),S(w,P,`ø`,`\\o`,!0),S(C,k,`ø`,`\\o`,!0),S(w,P,`Æ`,`\\AE`,!0),S(w,P,`Œ`,`\\OE`,!0),S(w,P,`Ø`,`\\O`,!0),S(C,k,`Ø`,`\\O`,!0),S(w,T,`ˊ`,`\\'`),S(w,T,`ˋ`,"\\`"),S(w,T,`ˆ`,`\\^`),S(w,T,`˜`,`\\~`),S(w,T,`ˉ`,`\\=`),S(w,T,`˘`,`\\u`),S(w,T,`˙`,`\\.`),S(w,T,`¸`,`\\c`),S(w,T,`˚`,`\\r`),S(w,T,`ˇ`,`\\v`),S(w,T,`¨`,`\\"`),S(w,T,`˝`,`\\H`),S(C,T,`ˊ`,`\\'`),S(C,T,`ˋ`,"\\`"),S(C,T,`ˆ`,`\\^`),S(C,T,`˜`,`\\~`),S(C,T,`ˉ`,`\\=`),S(C,T,`˘`,`\\u`),S(C,T,`˙`,`\\.`),S(C,T,`¸`,`\\c`),S(C,T,`˚`,`\\r`),S(C,T,`ˇ`,`\\v`),S(C,T,`¨`,`\\"`),S(C,T,`˝`,`\\H`);var ye={"--":!0,"---":!0,"``":!0,"''":!0};S(w,P,`–`,`--`,!0),S(w,P,`–`,`\\textendash`),S(w,P,`—`,`---`,!0),S(w,P,`—`,`\\textemdash`),S(w,P,`‘`,"`",!0),S(w,P,`‘`,`\\textquoteleft`),S(w,P,`’`,`'`,!0),S(w,P,`’`,`\\textquoteright`),S(w,P,`“`,"``",!0),S(w,P,`“`,`\\textquotedblleft`),S(w,P,`”`,`''`,!0),S(w,P,`”`,`\\textquotedblright`),S(C,P,`°`,`\\degree`,!0),S(w,P,`°`,`\\degree`),S(w,P,`°`,`\\textdegree`,!0),S(C,P,`£`,`\\pounds`),S(C,P,`£`,`\\mathsterling`,!0),S(w,P,`£`,`\\pounds`),S(w,P,`£`,`\\textsterling`,!0),S(C,P,`✠`,`\\maltese`),S(w,P,`✠`,`\\maltese`),S(C,P,`€`,`\\euro`,!0),S(w,P,`€`,`\\euro`,!0),S(w,P,`€`,`\\texteuro`),S(C,P,`©`,`\\copyright`,!0),S(w,P,`©`,`\\textcopyright`),S(C,P,`⌀`,`\\diameter`,!0),S(w,P,`⌀`,`\\diameter`),S(C,P,`𝛤`,`\\varGamma`),S(C,P,`𝛥`,`\\varDelta`),S(C,P,`𝛩`,`\\varTheta`),S(C,P,`𝛬`,`\\varLambda`),S(C,P,`𝛯`,`\\varXi`),S(C,P,`𝛱`,`\\varPi`),S(C,P,`𝛴`,`\\varSigma`),S(C,P,`𝛶`,`\\varUpsilon`),S(C,P,`𝛷`,`\\varPhi`),S(C,P,`𝛹`,`\\varPsi`),S(C,P,`𝛺`,`\\varOmega`),S(w,P,`𝛤`,`\\varGamma`),S(w,P,`𝛥`,`\\varDelta`),S(w,P,`𝛩`,`\\varTheta`),S(w,P,`𝛬`,`\\varLambda`),S(w,P,`𝛯`,`\\varXi`),S(w,P,`𝛱`,`\\varPi`),S(w,P,`𝛴`,`\\varSigma`),S(w,P,`𝛶`,`\\varUpsilon`),S(w,P,`𝛷`,`\\varPhi`),S(w,P,`𝛹`,`\\varPsi`),S(w,P,`𝛺`,`\\varOmega`);var be=`0123456789/@."`;for(let e=0;e<14;e++){let t=be.charAt(e);S(C,P,t,t)}var xe=`0123456789!@*()-=+";:?/.,`;for(let e=0;e<25;e++){let t=xe.charAt(e);S(w,P,t,t)}var Se=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`;for(let e=0;e<52;e++){let t=Se.charAt(e);S(C,k,t,t),S(w,P,t,t)}var Ce=`ÇÐÞçþℂℍℕℙℚℝℤℎℏℊℋℌℐℑℒℓ℘ℛℜℬℰℱℳℭℨ`;for(let e=0;e<30;e++){let t=Ce.charAt(e);S(C,k,t,t),S(w,P,t,t)}var F=``;for(let e=0;e<52;e++){F=String.fromCharCode(55349,56320+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,56372+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,56424+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,56580+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,56736+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,56788+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,56840+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,56944+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,56632+e),S(C,k,F,F),S(w,P,F,F);let t=Se.charAt(e);F=String.fromCharCode(55349,56476+e),S(C,k,t,F),S(w,P,t,F)}for(let e=0;e<10;e++)F=String.fromCharCode(55349,57294+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,57314+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,57324+e),S(C,k,F,F),S(w,P,F,F),F=String.fromCharCode(55349,57334+e),S(C,k,F,F),S(w,P,F,F);var we=`([{⌊⌈⟨⟮⎰⟦⦃`,Te=`)]}⌋⌉⟩⟯⎱⟦⦄`;function Ee(e,t,n){let r=[],i=[],a=[],o=0,s=0,c=0;for(;s<e.length;){for(;e[s]instanceof ee;)e.splice(s,1,...e[s].children);let n=e[s];if(n.attributes&&n.attributes.linebreak&&n.attributes.linebreak===`newline`){a.length>0&&i.push(new b.MathNode(`mrow`,a)),i.push(n),a=[];let e=new b.MathNode(`mtd`,i);e.style.textAlign=`left`,r.push(new b.MathNode(`mtr`,[e])),i=[],s+=1;continue}if(a.push(n),n.type&&n.type===`mo`&&n.children.length===1&&!Object.hasOwn(n.attributes,`movablelimits`)){let r=n.children[0].text;if(we.indexOf(r)>-1)c+=1;else if(Te.indexOf(r)>-1)--c;else if(c===0&&t===`=`&&r===`=`){if(o+=1,o>1){a.pop();let e=new b.MathNode(`mrow`,a);i.push(e),a=[n]}}else if(c===0&&t===`tex`&&r!==`∇`){let t=s<e.length-1?e[s+1]:null,n=!0;if(!(t&&t.type===`mtext`&&t.attributes.linebreak&&t.attributes.linebreak===`nobreak`))for(let t=s+1;t<e.length;t++){let r=e[t];if(r.type&&r.type===`mspace`&&!(r.attributes.linebreak&&r.attributes.linebreak===`newline`))a.push(r),s+=1,r.attributes&&r.attributes.linebreak&&r.attributes.linebreak===`nobreak`&&(n=!1);else break}if(n){let e=new b.MathNode(`mrow`,a);i.push(e),a=[]}}}s+=1}if(a.length>0){let e=new b.MathNode(`mrow`,a);i.push(e)}if(r.length>0){let e=new b.MathNode(`mtd`,i);e.style.textAlign=`left`;let t=new b.MathNode(`mtr`,[e]);r.push(t);let a=new b.MathNode(`mtable`,r);return n||(a.setAttribute(`columnalign`,`left`),a.setAttribute(`rowspacing`,`0em`)),a}return b.newDocumentFragment(i)}var I=function(e,t,n){return x[t][e]&&x[t][e].replace&&e.charCodeAt(0)!==55349&&!(Object.prototype.hasOwnProperty.call(ye,e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=x[t][e].replace),new b.TextNode(e)},De=(e,t)=>{if(e.children.length===0||e.children[e.children.length-1].type!==`mtext`){let n=new b.MathNode(`mtext`,[new b.TextNode(t.children[0].text)]);e.children.push(n)}else e.children[e.children.length-1].children[0].text+=t.children[0].text},Oe=e=>{if(e.type!==`mrow`&&e.type!==`mstyle`||e.children.length===0)return e;let t=new b.MathNode(`mrow`);for(let n=0;n<e.children.length;n++){let r=e.children[n];if(r.type===`mtext`&&Object.keys(r.attributes).length===0)De(t,r);else if(r.type===`mrow`){let e=!0;for(let t=0;t<r.children.length;t++)if(r.children[t].type!==`mtext`||Object.keys(r.attributes).length!==0){e=!1;break}if(e)for(let e=0;e<r.children.length;e++){let n=r.children[e];De(t,n)}else t.children.push(r)}else t.children.push(r)}for(let n=0;n<t.children.length;n++)if(t.children[n].type===`mtext`){let r=t.children[n];r.children[0].text.charAt(0)===` `&&(r.children[0].text=`\xA0`+r.children[0].text.slice(1));let i=r.children[0].text.length;i>0&&r.children[0].text.charAt(i-1)===` `&&(r.children[0].text=r.children[0].text.slice(0,-1)+`\xA0`);for(let[t,n]of Object.entries(e.attributes))r.attributes[t]=n}return t.children.length===1&&t.children[0].type===`mtext`?t.children[0]:t},ke=function(e,t=!1){if(e.length===1&&!(e[0]instanceof ee))return e[0];if(!t){e[0]instanceof y&&e[0].type===`mo`&&!e[0].attributes.fence&&(e[0].attributes.lspace=`0em`,e[0].attributes.rspace=`0em`);let t=e.length-1;e[t]instanceof y&&e[t].type===`mo`&&!e[t].attributes.fence&&(e[t].attributes.lspace=`0em`,e[t].attributes.rspace=`0em`)}return new b.MathNode(`mrow`,e)};function Ae(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){let t=e.children[0];return t instanceof le&&t.text===`.`}else if(e.type===`mtext`&&e.children.length===1){let t=e.children[0];return t instanceof le&&t.text===` `}else if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){let t=e.children[0];return t instanceof le&&t.text===`,`}else return!1}var je=(e,t)=>{let n=e[t],r=e[t+1];return n.type===`atom`&&n.text===`,`&&n.loc&&r.loc&&n.loc.end===r.loc.start},Me=e=>e.type===`atom`&&e.family===`rel`||e.type===`mclass`&&e.mclass===`mrel`,L=function(e,t,n=!1){if(!n&&e.length===1){let n=z(e[0],t);return n instanceof y&&n.type===`mo`&&(n.setAttribute(`lspace`,`0em`),n.setAttribute(`rspace`,`0em`)),[n]}let r=[],i=[],a;for(let n=0;n<e.length;n++)i.push(z(e[n],t));for(let t=0;t<i.length;t++){let n=i[t];if(t<e.length-1&&Me(e[t])&&Me(e[t+1])&&n.setAttribute(`rspace`,`0em`),t>0&&Me(e[t])&&Me(e[t-1])&&n.setAttribute(`lspace`,`0em`),n.type===`mn`&&a&&a.type===`mn`){a.children.push(...n.children);continue}else if(Ae(n)&&a&&a.type===`mn`){a.children.push(...n.children);continue}else if(a&&a.type===`mn`&&t<i.length-1&&i[t+1].type===`mn`&&je(e,t)){a.children.push(...n.children);continue}else if(n.type===`mn`&&Ae(a))n.children=[...a.children,...n.children],r.pop();else if((n.type===`msup`||n.type===`msub`)&&n.children.length>=1&&a&&(a.type===`mn`||Ae(a))){let e=n.children[0];e instanceof y&&e.type===`mn`&&a&&(e.children=[...a.children,...e.children],r.pop())}r.push(n),a=n}return r},R=function(e,t,n=!1){return ke(L(e,t,n),n)},z=function(t,n){if(!t)return new b.MathNode(`mrow`);if(p[t.type])return p[t.type](t,n);throw new e(`Got group of unknown type: '`+t.type+`'`)},Ne=e=>new b.MathNode(`mtd`,[],[],{padding:`0`,width:`50%`}),Pe=[`mrow`,`mtd`,`mtable`,`mtr`],Fe=e=>{for(let t of e.children)if(t.type&&Pe.includes(t.type)){if(t.classes&&t.classes[0]===`tml-label`)return t.label;{let e=Fe(t);if(e)return e}}else if(!t.type){let e=Fe(t);if(e)return e}},Ie=(e,t,n,r)=>{t=R(t[0].body,n),t=Oe(t),t.classes.push(`tml-tag`);let i=Fe(e);e=new b.MathNode(`mtd`,[e]);let a=[Ne(),e,Ne()];a[r?0:2].classes.push(r?`tml-left`:`tml-right`),a[r?0:2].children.push(t);let o=new b.MathNode(`mtr`,a,[`tml-tageqn`]);i&&o.setAttribute(`id`,i);let s=new b.MathNode(`mtable`,[o]);return s.style.width=`100%`,s.setAttribute(`displaystyle`,`true`),s};function Le(e,t,n,r){let i=null;e.length===1&&e[0].type===`tag`&&(i=e[0].tag,e=e[0].body);let a=L(e,n);if(a.length===1&&a[0]instanceof oe)return a[0];let o=r.displayMode||r.annotate?`none`:r.wrap,s=a.length===0?null:a[0],c=a.length===1&&i===null&&s instanceof y?a[0]:Ee(a,o,r.displayMode);if(i&&(c=Ie(c,i,n,r.leqno)),r.annotate){let e=new b.MathNode(`annotation`,[new b.TextNode(t)]);e.setAttribute(`encoding`,`application/x-tex`),c=new b.MathNode(`semantics`,[c,e])}let l=new b.MathNode(`math`,[c]);return r.xml&&l.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),c.style.width&&(l.style.width=`100%`),r.displayMode&&(l.setAttribute(`display`,`block`),l.style.display=`block math`,l.classes=[`tml-display`]),l}var Re=`acegıȷmnopqrsuvwxyzαγεηικμνοπρςστυχωϕ𝐚𝐜𝐞𝐠𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐮𝐯𝐰𝐱𝐲𝐳`,ze=`ABCDEFGHIJKLMNOPQRSTUVWXYZbdfhkltΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩβδλζφθψ𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙𝐛𝐝𝐟𝐡𝐤𝐥𝐭`,Be=new Set([`\\alpha`,`\\gamma`,`\\delta`,`\\epsilon`,`\\eta`,`\\iota`,`\\kappa`,`\\mu`,`\\nu`,`\\pi`,`\\rho`,`\\sigma`,`\\tau`,`\\upsilon`,`\\chi`,`\\psi`,`\\omega`,`\\imath`,`\\jmath`]),Ve=new Set([`\\Gamma`,`\\Delta`,`\\Sigma`,`\\Omega`,`\\beta`,`\\delta`,`\\lambda`,`\\theta`,`\\psi`]),He=(e,t)=>{let n=e.isStretchy?he.accentNode(e):new b.MathNode(`mo`,[I(e.label,e.mode)]);if(e.label===`\\vec`)n.style.transform=`scale(0.75) translate(10%, 30%)`;else if(n.style.mathStyle=`normal`,n.style.mathDepth=`0`,We.has(e.label)&&u.isCharacterBox(e.base)){let t=``,r=e.base.text;(Re.indexOf(r)>-1||Be.has(r))&&(t=`tml-xshift`),(ze.indexOf(r)>-1||Ve.has(r))&&(t=`tml-capshift`),t&&n.classes.push(t)}return e.isStretchy||n.setAttribute(`stretchy`,`false`),new b.MathNode(e.label===`\\c`?`munder`:`mover`,[z(e.base,t),n])},Ue=new Set([`\\acute`,`\\grave`,`\\ddot`,`\\dddot`,`\\ddddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`]),We=new Set([`\\acute`,`\\bar`,`\\breve`,`\\check`,`\\dot`,`\\ddot`,`\\grave`,`\\hat`,`\\mathring`,`\\'`,`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\r`,`\\H`,`\\v`]),Ge={"\\`":`̀`,"\\'":`́`,"\\^":`̂`,"\\~":`̃`,"\\=":`̄`,"\\u":`̆`,"\\.":`̇`,'\\"':`̈`,"\\r":`̊`,"\\H":`̋`,"\\v":`̌`};m({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\dddot`,`\\ddddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\overparen`,`\\widecheck`,`\\widehat`,`\\wideparen`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overleftharpoon`,`\\overrightharpoon`],props:{numArgs:1},handler:(e,t)=>{let n=g(t[0]),r=!Ue.has(e.funcName);return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,base:n}},mathmlBuilder:He}),m({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\c`,`\\u`,`\\.`,`\\"`,`\\r`,`\\H`,`\\v`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{let n=g(t[0]),r=e.parser.mode;return r===`math`&&e.parser.settings.strict&&console.log(`Temml parse error: Command ${e.funcName} is invalid in math mode.`),r===`text`&&n.text&&n.text.length===1&&e.funcName in Ge&&Re.indexOf(n.text)>-1?{type:`textord`,mode:`text`,text:n.text+Ge[e.funcName]}:{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,base:n}},mathmlBuilder:He}),m({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underparen`,`\\utilde`],props:{numArgs:1},handler:({parser:e,funcName:t},n)=>{let r=n[0];return{type:`accentUnder`,mode:e.mode,label:t,base:r}},mathmlBuilder:(e,t)=>{let n=he.accentNode(e);return n.style[`math-depth`]=0,new b.MathNode(`munder`,[z(e.base,t),n])}});var Ke={pt:800/803,pc:12*800/803,dd:1238/1157*800/803,cc:14856/1157*800/803,nd:685/642*800/803,nc:1370/107*800/803,sp:1/65536*800/803,mm:25.4/72,cm:2.54/72,in:1/72,px:96/72},qe=[`em`,`ex`,`mu`,`pt`,`mm`,`cm`,`in`,`px`,`bp`,`pc`,`dd`,`cc`,`nd`,`nc`,`sp`],Je=function(e){return typeof e!=`string`&&(e=e.unit),qe.indexOf(e)>-1},Ye=e=>[1,.7,.5][Math.max(e-1,0)],B=function(t,n){let r=t.number;if(n.maxSize[0]<0&&r>0)return{number:0,unit:`em`};let i=t.unit;switch(i){case`mm`:case`cm`:case`in`:case`px`:return r*Ke[i]>n.maxSize[1]?{number:n.maxSize[1],unit:`pt`}:{number:r,unit:i};case`em`:case`ex`:return i===`ex`&&(r*=.431),r=Math.min(r/Ye(n.level),n.maxSize[0]),{number:u.round(r),unit:`em`};case`bp`:return r>n.maxSize[1]&&(r=n.maxSize[1]),{number:r,unit:`pt`};case`pt`:case`pc`:case`dd`:case`cc`:case`nd`:case`nc`:case`sp`:return r=Math.min(r*Ke[i],n.maxSize[1]),{number:u.round(r),unit:`pt`};case`mu`:return r=Math.min(r/18,n.maxSize[0]),{number:u.round(r),unit:`em`};default:throw new e(`Invalid unit: '`+i+`'`)}},V=e=>{let t=new b.MathNode(`mspace`);return t.setAttribute(`width`,e+`em`),t},Xe=(e,t=.3,n=0,r=!1)=>{if(e==null&&n===0)return V(t);let i=e?[e]:[];if(t!==0&&i.unshift(V(t)),n>0&&i.push(V(n)),r){let e=new b.MathNode(`mpadded`,i);return e.setAttribute(`height`,`0`),e}else return new b.MathNode(`mrow`,i)},Ze=(e,t)=>Number(e)/Ye(t),Qe=(e,t,n,r)=>{let i=he.mathMLnode(e),a=e.slice(1,3)===`eq`,o=e.charAt(1)===`x`?`1.75`:e.slice(2,4)===`cd`?`3.0`:a?`1.0`:`2.0`;i.setAttribute(`lspace`,`0`),i.setAttribute(`rspace`,a?`0.5em`:`0`);let s=r.withLevel(r.level<2?2:3),c=Ze(o,s.level),l=Ze(o,3),u=Xe(null,c.toFixed(4),0),d=Xe(null,l.toFixed(4),0),f=Ze(a?0:.3,s.level).toFixed(4),p,m,h=t&&t.body&&(t.body.body||t.body.length>0);if(h){let n=z(t,s);n=Xe(n,f,f,e===`\\\\cdrightarrow`||e===`\\\\cdleftarrow`),p=new b.MathNode(`mover`,[n,d])}let g=n&&n.body&&(n.body.body||n.body.length>0);if(g){let e=z(n,s);e=Xe(e,f,f),m=new b.MathNode(`munder`,[e,d])}let _;return _=!h&&!g?new b.MathNode(`mover`,[i,u]):h&&g?new b.MathNode(`munderover`,[i,m,p]):h?new b.MathNode(`mover`,[i,p]):new b.MathNode(`munder`,[i,m]),o===`3.0`&&(_.style.height=`1em`),_.setAttribute(`accent`,`false`),_};m({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\yields`,`\\yieldsLeft`,`\\mesomerism`,`\\longrightharpoonup`,`\\longleftharpoondown`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],props:{numArgs:1,numOptionalArgs:1},handler({parser:e,funcName:t},n,r){return{type:`xArrow`,mode:e.mode,name:t,body:n[0],below:r[0]}},mathmlBuilder(e,t){let n=[Qe(e.name,e.body,e.below,t)];return n.unshift(V(.2778)),n.push(V(.2778)),new b.MathNode(`mrow`,n)}});var $e={"\\xtofrom":[`\\xrightarrow`,`\\xleftarrow`],"\\xleftrightharpoons":[`\\xleftharpoonup`,`\\xrightharpoondown`],"\\xrightleftharpoons":[`\\xrightharpoonup`,`\\xleftharpoondown`],"\\yieldsLeftRight":[`\\yields`,`\\yieldsLeft`],"\\equilibrium":[`\\longrightharpoonup`,`\\longleftharpoondown`],"\\equilibriumRight":[`\\longrightharpoonup`,`\\eqleftharpoondown`],"\\equilibriumLeft":[`\\eqrightharpoonup`,`\\longleftharpoondown`]};m({type:`stackedArrow`,names:[`\\xtofrom`,`\\xleftrightharpoons`,`\\xrightleftharpoons`,`\\yieldsLeftRight`,`\\equilibrium`,`\\equilibriumRight`,`\\equilibriumLeft`],props:{numArgs:1,numOptionalArgs:1},handler({parser:e,funcName:t},n,r){let i=n[0]?{type:`hphantom`,mode:e.mode,body:n[0]}:null,a=r[0]?{type:`hphantom`,mode:e.mode,body:r[0]}:null;return{type:`stackedArrow`,mode:e.mode,name:t,body:n[0],upperArrowBelow:a,lowerArrowBody:i,below:r[0]}},mathmlBuilder(e,t){let n=$e[e.name][0],r=$e[e.name][1],i=Qe(n,e.body,e.upperArrowBelow,t),a=Qe(r,e.lowerArrowBody,e.below,t),o,s=new b.MathNode(`mpadded`,[i]);if(s.setAttribute(`voffset`,`0.3em`),s.setAttribute(`height`,`+0.3em`),s.setAttribute(`depth`,`-0.3em`),e.name===`\\equilibriumLeft`){let e=new b.MathNode(`mpadded`,[a]);e.setAttribute(`width`,`0.5em`),o=new b.MathNode(`mpadded`,[V(.2778),e,s,V(.2778)])}else s.setAttribute(`width`,e.name===`\\equilibriumRight`?`0.5em`:`0`),o=new b.MathNode(`mpadded`,[V(.2778),s,a,V(.2778)]);return o.setAttribute(`voffset`,`-0.18em`),o.setAttribute(`height`,`-0.18em`),o.setAttribute(`depth`,`+0.18em`),o}});function H(e,t){if(!e||e.type!==t)throw Error(`Expected node of type ${t}, but got `+(e?`node of type ${e.type}`:String(e)));return e}function et(e){let t=tt(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type ${e.type}`:String(e)));return t}function tt(e){return e&&(e.type===`atom`||Object.prototype.hasOwnProperty.call(_e,e.type))?e:null}var nt={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},rt=()=>({type:`styling`,body:[],mode:`math`,scriptLevel:`display`}),it=e=>e.type===`textord`&&e.text===`@`,at=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function ot(e,t,n){let r=nt[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:{let e=n.callFunction(`\\\\cdleft`,[t[0]],[]),i={type:`atom`,text:r,mode:`math`,family:`rel`},a={type:`ordgroup`,mode:`math`,body:[e,n.callFunction(`\\Big`,[i],[]),n.callFunction(`\\\\cdright`,[t[1]],[])],semisimple:!0};return n.callFunction(`\\\\cdparent`,[a],[])}case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function st(t){let n=[];for(t.gullet.beginGroup(),t.gullet.macros.set(`\\cr`,`\\\\\\relax`),t.gullet.beginGroup();;){n.push(t.parseExpression(!1,`\\\\`)),t.gullet.endGroup(),t.gullet.beginGroup();let r=t.fetch().text;if(r===`&`||r===`\\\\`)t.consume();else if(r===`\\end`){n[n.length-1].length===0&&n.pop();break}else throw new e(`Expected \\\\ or \\cr or \\end`,t.nextToken)}let r=[],i=[r];for(let a=0;a<n.length;a++){let o=n[a],s=rt();for(let n=0;n<o.length;n++)if(!it(o[n]))s.body.push(o[n]);else{r.push(s),n+=1;let i=et(o[n]).text,a=[,,];if(a[0]={type:`ordgroup`,mode:`math`,body:[]},a[1]={type:`ordgroup`,mode:`math`,body:[]},!(`=|.`.indexOf(i)>-1))if(`<>AV`.indexOf(i)>-1)for(let t=0;t<2;t++){let r=!0;for(let s=n+1;s<o.length;s++){if(at(o[s],i)){r=!1,n=s;break}if(it(o[s]))throw new e(`Missing a `+i+` character to complete a CD arrow.`,o[s]);a[t].body.push(o[s])}if(r)throw new e(`Missing a `+i+` character to complete a CD arrow.`,o[n])}else throw new e(`Expected one of "<>AV=|." after @.`);let c=ot(i,a,t);r.push(c),s=rt()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return i.pop(),t.gullet.endGroup(),t.gullet.endGroup(),{type:`array`,mode:`math`,body:i,tags:null,labels:Array(i.length+1).fill(``),envClasses:[`jot`,`cd`],cols:[],hLinesBeforeRow:Array(i.length+1).fill([])}}m({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],props:{numArgs:1},handler({parser:e,funcName:t},n){return{type:`cdlabel`,mode:e.mode,side:t.slice(4),label:n[0]}},mathmlBuilder(e,t){if(e.label.body.length===0)return new b.MathNode(`mrow`,t);let n=new b.MathNode(`mtd`,[z(e.label,t)]);n.style.padding=`0`;let r=new b.MathNode(`mtr`,[n]),i=new b.MathNode(`mtable`,[r]),a=new b.MathNode(`mpadded`,[i]);return a.setAttribute(`width`,`0`),a.setAttribute(`displaystyle`,`false`),a.setAttribute(`scriptlevel`,`1`),e.side===`left`&&(a.style.display=`flex`,a.style.justifyContent=`flex-end`),a}}),m({type:`cdlabelparent`,names:[`\\\\cdparent`],props:{numArgs:1},handler({parser:e},t){return{type:`cdlabelparent`,mode:e.mode,fragment:t[0]}},mathmlBuilder(e,t){return new b.MathNode(`mrow`,[z(e.fragment,t)])}}),m({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler({parser:t,token:n},r){let i=H(r[0],`ordgroup`).body,a=``;for(let e=0;e<i.length;e++){let t=H(i[e],`textord`);a+=t.text}let o=parseInt(a);if(isNaN(o))throw new e(`\\@char has non-numeric argument ${a}`,n);return{type:`textord`,mode:t.mode,text:String.fromCodePoint(o)}}});var ct=/^(#[a-f0-9]{3}|#?[a-f0-9]{6})$/i,lt=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i,ut=/^ *\d{1,3} *(?:, *\d{1,3} *){2}$/,dt=/^ *[10](?:\.\d*)? *(?:, *[10](?:\.\d*)? *){2}$/,ft=/^[a-f0-9]{6}$/i,pt=e=>{let t=e.toString(16);return t.length===1&&(t=`0`+t),t},mt=JSON.parse(`{
|
|
2
|
+
"Apricot": "#ffb484",
|
|
3
|
+
"Aquamarine": "#08b4bc",
|
|
4
|
+
"Bittersweet": "#c84c14",
|
|
5
|
+
"blue": "#0000FF",
|
|
6
|
+
"Blue": "#303494",
|
|
7
|
+
"BlueGreen": "#08b4bc",
|
|
8
|
+
"BlueViolet": "#503c94",
|
|
9
|
+
"BrickRed": "#b8341c",
|
|
10
|
+
"brown": "#BF8040",
|
|
11
|
+
"Brown": "#802404",
|
|
12
|
+
"BurntOrange": "#f8941c",
|
|
13
|
+
"CadetBlue": "#78749c",
|
|
14
|
+
"CarnationPink": "#f884b4",
|
|
15
|
+
"Cerulean": "#08a4e4",
|
|
16
|
+
"CornflowerBlue": "#40ace4",
|
|
17
|
+
"cyan": "#00FFFF",
|
|
18
|
+
"Cyan": "#08acec",
|
|
19
|
+
"Dandelion": "#ffbc44",
|
|
20
|
+
"darkgray": "#404040",
|
|
21
|
+
"DarkOrchid": "#a8548c",
|
|
22
|
+
"Emerald": "#08ac9c",
|
|
23
|
+
"ForestGreen": "#089c54",
|
|
24
|
+
"Fuchsia": "#90348c",
|
|
25
|
+
"Goldenrod": "#ffdc44",
|
|
26
|
+
"gray": "#808080",
|
|
27
|
+
"Gray": "#98949c",
|
|
28
|
+
"green": "#00FF00",
|
|
29
|
+
"Green": "#08a44c",
|
|
30
|
+
"GreenYellow": "#e0e474",
|
|
31
|
+
"JungleGreen": "#08ac9c",
|
|
32
|
+
"Lavender": "#f89cc4",
|
|
33
|
+
"lightgray": "#c0c0c0",
|
|
34
|
+
"lime": "#BFFF00",
|
|
35
|
+
"LimeGreen": "#90c43c",
|
|
36
|
+
"magenta": "#FF00FF",
|
|
37
|
+
"Magenta": "#f0048c",
|
|
38
|
+
"Mahogany": "#b0341c",
|
|
39
|
+
"Maroon": "#b03434",
|
|
40
|
+
"Melon": "#f89c7c",
|
|
41
|
+
"MidnightBlue": "#086494",
|
|
42
|
+
"Mulberry": "#b03c94",
|
|
43
|
+
"NavyBlue": "#086cbc",
|
|
44
|
+
"olive": "#7F7F00",
|
|
45
|
+
"OliveGreen": "#407c34",
|
|
46
|
+
"orange": "#FF8000",
|
|
47
|
+
"Orange": "#f8843c",
|
|
48
|
+
"OrangeRed": "#f0145c",
|
|
49
|
+
"Orchid": "#b074ac",
|
|
50
|
+
"Peach": "#f8945c",
|
|
51
|
+
"Periwinkle": "#8074bc",
|
|
52
|
+
"PineGreen": "#088c74",
|
|
53
|
+
"pink": "#ff7f7f",
|
|
54
|
+
"Plum": "#98248c",
|
|
55
|
+
"ProcessBlue": "#08b4ec",
|
|
56
|
+
"purple": "#BF0040",
|
|
57
|
+
"Purple": "#a0449c",
|
|
58
|
+
"RawSienna": "#983c04",
|
|
59
|
+
"red": "#ff0000",
|
|
60
|
+
"Red": "#f01c24",
|
|
61
|
+
"RedOrange": "#f86434",
|
|
62
|
+
"RedViolet": "#a0246c",
|
|
63
|
+
"Rhodamine": "#f0549c",
|
|
64
|
+
"Royallue": "#0874bc",
|
|
65
|
+
"RoyalPurple": "#683c9c",
|
|
66
|
+
"RubineRed": "#f0047c",
|
|
67
|
+
"Salmon": "#f8948c",
|
|
68
|
+
"SeaGreen": "#30bc9c",
|
|
69
|
+
"Sepia": "#701404",
|
|
70
|
+
"SkyBlue": "#48c4dc",
|
|
71
|
+
"SpringGreen": "#c8dc64",
|
|
72
|
+
"Tan": "#e09c74",
|
|
73
|
+
"teal": "#007F7F",
|
|
74
|
+
"TealBlue": "#08acb4",
|
|
75
|
+
"Thistle": "#d884b4",
|
|
76
|
+
"Turquoise": "#08b4cc",
|
|
77
|
+
"violet": "#800080",
|
|
78
|
+
"Violet": "#60449c",
|
|
79
|
+
"VioletRed": "#f054a4",
|
|
80
|
+
"WildStrawberry": "#f0246c",
|
|
81
|
+
"yellow": "#FFFF00",
|
|
82
|
+
"Yellow": "#fff404",
|
|
83
|
+
"YellowGreen": "#98cc6c",
|
|
84
|
+
"YellowOrange": "#ffa41c"
|
|
85
|
+
}`),ht=(t,n)=>{let r=``;if(t===`HTML`){if(!ct.test(n))throw new e(`Invalid HTML input.`);r=n}else if(t===`RGB`){if(!ut.test(n))throw new e(`Invalid RGB input.`);n.split(`,`).map(e=>{r+=pt(Number(e.trim()))})}else{if(!dt.test(n))throw new e(`Invalid rbg input.`);n.split(`,`).map(t=>{let n=Number(t.trim());if(n>1)throw new e(`Color rgb input must be < 1.`);r+=pt(Number((n*255).toFixed(0)))})}return r.charAt(0)!==`#`&&(r=`#`+r),r},gt=(t,n,r)=>{let i=`\\\\color@${t}`;if(!lt.exec(t))throw new e(`Invalid color: '`+t+`'`,r);return ft.test(t)?`#`+t:(t.charAt(0)===`#`||(n.has(i)?t=n.get(i).tokens[0].text:mt[t]&&(t=mt[t])),t)},_t=(e,t)=>{let n=L(e.body,t.withColor(e.color));return n=n.map(t=>(t.style.color=e.color,t)),b.newDocumentFragment(n)};m({type:`color`,names:[`\\textcolor`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,argTypes:[`raw`,`raw`,`original`]},handler({parser:e,token:t},n,r){let i=r[0]&&H(r[0],`raw`).string,a=``;if(i){let e=H(n[0],`raw`).string;a=ht(i,e)}else a=gt(H(n[0],`raw`).string,e.gullet.macros,t);let o=n[1];return{type:`color`,mode:e.mode,color:a,isTextColor:!0,body:_(o)}},mathmlBuilder:_t}),m({type:`color`,names:[`\\color`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0,argTypes:[`raw`,`raw`]},handler({parser:e,breakOnTokenText:t,token:n},r,i){let a=i[0]&&H(i[0],`raw`).string,o=``;if(a){let e=H(r[0],`raw`).string;o=ht(a,e)}else o=gt(H(r[0],`raw`).string,e.gullet.macros,n);let s=e.parseExpression(!0,t,!0);return{type:`color`,mode:e.mode,color:o,isTextColor:!1,body:s}},mathmlBuilder:_t}),m({type:`color`,names:[`\\definecolor`],props:{numArgs:3,allowedInText:!0,argTypes:[`raw`,`raw`,`raw`]},handler({parser:t,funcName:n,token:r},i){let a=H(i[0],`raw`).string;if(!/^[A-Za-z]+$/.test(a))throw new e(`Color name must be latin letters.`,r);let o=H(i[1],`raw`).string;if(![`HTML`,`RGB`,`rgb`].includes(o))throw new e(`Color model must be HTML, RGB, or rgb.`,r);let s=H(i[2],`raw`).string,c=ht(o,s);return t.gullet.macros.set(`\\\\color@${a}`,{tokens:[{text:c}],numArgs:0}),{type:`internal`,mode:t.mode}}}),m({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler({parser:e},t,n){let r=e.gullet.future().text===`[`?e.parseSizeGroup(!0):null,i=!e.settings.displayMode;return{type:`cr`,mode:e.mode,newLine:i,size:r&&H(r,`size`).value}},mathmlBuilder(e,t){let n=new b.MathNode(`mo`);if(e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size)){let r=B(e.size,t);n.setAttribute(`height`,r.number+r.unit)}return n}});var vt={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},yt=t=>{let n=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new e(`Expected a control sequence`,t);return n},bt=e=>{let t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},xt=(e,t,n,r)=>{let i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};m({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],props:{numArgs:0,allowedInText:!0},handler({parser:t,funcName:n}){t.consumeSpaces();let r=t.fetch();if(vt[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=vt[r.text]),H(t.parseFunction(),`internal`);throw new e(`Invalid token after macro prefix`,r)}}),m({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:t,funcName:n}){let r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new e(`Expected a control sequence`,r);let a=0,o,s=[[]];for(;t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new e(`Invalid argument number "${r.text}"`);if(parseInt(r.text)!==a+1)throw new e(`Argument number "${r.text}" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new e(`Expected a macro definition`);else s[a].push(r.text);let{tokens:c}=t.gullet.consumeArg();if(o&&c.unshift(o),n===`\\edef`||n===`\\xdef`){if(c=t.gullet.expandTokens(c),c.length>t.gullet.settings.maxExpand)throw new e(`Too many expansions in an `+n);c.reverse()}return t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===vt[n]),{type:`internal`,mode:t.mode}}}),m({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n=yt(e.gullet.popToken());return e.gullet.consumeSpaces(),xt(e,n,bt(e),t===`\\\\globallet`),{type:`internal`,mode:e.mode}}}),m({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n=yt(e.gullet.popToken()),r=e.gullet.popToken(),i=e.gullet.popToken();return xt(e,n,i,t===`\\\\globalfuture`),e.gullet.pushToken(i),e.gullet.pushToken(r),{type:`internal`,mode:e.mode}}}),m({type:`internal`,names:[`\\newcommand`,`\\renewcommand`,`\\providecommand`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:t,funcName:n}){let r=``,i=t.gullet.popToken();i.text===`{`?(r=yt(t.gullet.popToken()),t.gullet.popToken()):r=yt(i);let a=t.gullet.isDefined(r);if(a&&n===`\\newcommand`)throw new e(`\\newcommand{${r}} attempting to redefine ${r}; use \\renewcommand`);if(!a&&n===`\\renewcommand`)throw new e(`\\renewcommand{${r}} when command ${r} does not yet exist; use \\newcommand`);let o=0;if(t.gullet.future().text===`[`){let n=t.gullet.popToken();if(n=t.gullet.popToken(),!/^[0-9]$/.test(n.text))throw new e(`Invalid number of arguments: "${n.text}"`);if(o=parseInt(n.text),n=t.gullet.popToken(),n.text!==`]`)throw new e(`Invalid argument "${n.text}"`)}let{tokens:s}=t.gullet.consumeArg();return n===`\\providecommand`&&t.gullet.macros.has(r)||t.gullet.macros.set(r,{tokens:s,numArgs:o}),{type:`internal`,mode:t.mode}}});var St={"\\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}},Ct=`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,⦇,\\llparenthesis,⦈,\\rrparenthesis,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lAngle,⟪,\\rAngle,⟫,\\llangle,⦉,\\rrangle,⦊,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,\\llbracket,\\rrbracket,⟦,⟦,\\lBrace,\\rBrace,⦃,⦄,/,\\backslash,|,\\vert,\\|,\\Vert,‖,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`),wt=[`}`,`\\left`,`\\middle`,`\\right`],Tt=e=>e.length>0&&(Ct.includes(e)||St[e]||wt.includes(e)),Et=[0,1.2,1.8,2.4,3];function Dt(t,n){let r=tt(t);if(r&&Ct.includes(r.text))return[`<`,`\\lt`].includes(r.text)&&(r.text=`⟨`),[`>`,`\\gt`].includes(r.text)&&(r.text=`⟩`),r;throw r?new e(`Invalid delimiter '${r.text}' after '${n.funcName}'`,t):new e(`Invalid delimiter type '${t.type}'`,t)}var Ot=[`/`,`\\`,`\\backslash`,`\\vert`,`|`];m({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)=>{let n=Dt(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:St[e.funcName].size,mclass:St[e.funcName].mclass,delim:n.text}},mathmlBuilder:e=>{let t=[];e.delim===`.`&&(e.delim=``),t.push(I(e.delim,e.mode));let n=new b.MathNode(`mo`,t);return e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),(Ot.includes(e.delim)||e.delim.indexOf(`arrow`)>-1)&&n.setAttribute(`stretchy`,`true`),n.setAttribute(`symmetric`,`true`),n.setAttribute(`minsize`,Et[e.size]+`em`),n.setAttribute(`maxsize`,Et[e.size]+`em`),n}});function kt(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}m({type:`leftright-right`,names:[`\\right`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>({type:`leftright-right`,mode:e.parser.mode,delim:Dt(t[0],e).text})}),m({type:`leftright`,names:[`\\left`],props:{numArgs:1,argTypes:[`primitive`]},handler:(t,n)=>{let r=Dt(n[0],t),i=t.parser;++i.leftrightDepth;let a=i.parseExpression(!1,null,!0),o=i.fetch();for(;o.text===`\\middle`;){i.consume();let t=i.fetch().text;if(!x.math[t])throw new e(`Invalid delimiter '${t}' after '\\middle'`);Dt({type:`atom`,mode:`math`,text:t},{funcName:`\\middle`}),a.push({type:`middle`,mode:`math`,delim:t}),i.consume(),a=a.concat(i.parseExpression(!1,null,!0)),o=i.fetch()}--i.leftrightDepth,i.expect(`\\right`,!1);let s=H(i.parseFunction(),`leftright-right`);return{type:`leftright`,mode:i.mode,body:a,left:r.text,right:s.delim}},mathmlBuilder:(e,t)=>{kt(e);let n=L(e.body,t);e.left===`.`&&(e.left=``);let r=new b.MathNode(`mo`,[I(e.left,e.mode)]);r.setAttribute(`fence`,`true`),r.setAttribute(`form`,`prefix`),(e.left===`/`||e.left===`\\`||e.left.indexOf(`arrow`)>-1)&&r.setAttribute(`stretchy`,`true`),n.unshift(r),e.right===`.`&&(e.right=``);let i=new b.MathNode(`mo`,[I(e.right,e.mode)]);if(i.setAttribute(`fence`,`true`),i.setAttribute(`form`,`postfix`),(e.right===`∖`||e.right.indexOf(`arrow`)>-1)&&i.setAttribute(`stretchy`,`true`),e.body.length>0){let t=e.body[e.body.length-1];t.type===`color`&&!t.isTextColor&&i.setAttribute(`mathcolor`,t.color)}return n.push(i),ke(n)}}),m({type:`middle`,names:[`\\middle`],props:{numArgs:1,argTypes:[`primitive`]},handler:(t,n)=>{let r=Dt(n[0],t);if(!t.parser.leftrightDepth)throw new e(`\\middle without preceding \\left`,r);return{type:`middle`,mode:t.parser.mode,delim:r.text}},mathmlBuilder:(e,t)=>{let n=I(e.delim,e.mode),r=new b.MathNode(`mo`,[n]);return r.setAttribute(`fence`,`true`),e.delim.indexOf(`arrow`)>-1&&r.setAttribute(`stretchy`,`true`),r.setAttribute(`form`,`prefix`),r.setAttribute(`lspace`,`0.05em`),r.setAttribute(`rspace`,`0.05em`),r}});var At=e=>{let t=new b.MathNode(`mspace`);return t.setAttribute(`width`,`3pt`),t},jt=(e,t)=>{let n;switch(n=e.label.indexOf(`colorbox`)>-1||e.label===`\\boxed`?new b.MathNode(`mrow`,[At(),z(e.body,t),At()]):new b.MathNode(`menclose`,[z(e.body,t)]),e.label){case`\\overline`:n.setAttribute(`notation`,`top`),n.classes.push(`tml-overline`);break;case`\\underline`:n.setAttribute(`notation`,`bottom`),n.classes.push(`tml-underline`);break;case`\\cancel`:n.setAttribute(`notation`,`updiagonalstrike`),n.children.push(new b.MathNode(`mrow`,[],[`tml-cancel`,`upstrike`]));break;case`\\bcancel`:n.setAttribute(`notation`,`downdiagonalstrike`),n.children.push(new b.MathNode(`mrow`,[],[`tml-cancel`,`downstrike`]));break;case`\\sout`:n.setAttribute(`notation`,`horizontalstrike`),n.children.push(new b.MathNode(`mrow`,[],[`tml-cancel`,`sout`]));break;case`\\xcancel`:n.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`),n.classes.push(`tml-xcancel`);break;case`\\longdiv`:n.setAttribute(`notation`,`longdiv`),n.classes.push(`longdiv-top`),n.children.push(new b.MathNode(`mrow`,[],[`longdiv-arc`]));break;case`\\phase`:n.setAttribute(`notation`,`phasorangle`),n.classes.push(`phasor-bottom`),n.children.push(new b.MathNode(`mrow`,[],[`phasor-angle`]));break;case`\\textcircled`:n.setAttribute(`notation`,`circle`),n.classes.push(`circle-pad`),n.children.push(new b.MathNode(`mrow`,[],[`textcircle`]));break;case`\\angl`:n.setAttribute(`notation`,`actuarial`),n.classes.push(`actuarial`);break;case`\\boxed`:n.setAttribute(`notation`,`box`),n.classes.push(`tml-box`),n.setAttribute(`scriptlevel`,`0`),n.setAttribute(`displaystyle`,`true`);break;case`\\fbox`:n.setAttribute(`notation`,`box`),n.classes.push(`tml-fbox`);break;case`\\fcolorbox`:case`\\colorbox`:{let t={padding:`3pt 0 3pt 0`};e.label===`\\fcolorbox`&&(t.border=`0.0667em solid `+String(e.borderColor)),n.style=t;break}}return e.backgroundColor&&n.setAttribute(`mathbackground`,e.backgroundColor),n};m({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,argTypes:[`raw`,`raw`,`text`]},handler({parser:e,funcName:t},n,r){let i=r[0]&&H(r[0],`raw`).string,a=``;if(i){let e=H(n[0],`raw`).string;a=ht(i,e)}else a=gt(H(n[0],`raw`).string,e.gullet.macros);let o=n[1];return{type:`enclose`,mode:e.mode,label:t,backgroundColor:a,body:o}},mathmlBuilder:jt}),m({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,numOptionalArgs:1,allowedInText:!0,argTypes:[`raw`,`raw`,`raw`,`text`]},handler({parser:e,funcName:t},n,r){let i=r[0]&&H(r[0],`raw`).string,a=``,o;if(i){let e=H(n[0],`raw`).string,t=H(n[0],`raw`).string;a=ht(i,e),o=ht(i,t)}else a=gt(H(n[0],`raw`).string,e.gullet.macros),o=gt(H(n[1],`raw`).string,e.gullet.macros);let s=n[2];return{type:`enclose`,mode:e.mode,label:t,backgroundColor:o,borderColor:a,body:s}},mathmlBuilder:jt}),m({type:`enclose`,names:[`\\fbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler({parser:e},t){return{type:`enclose`,mode:e.mode,label:`\\fbox`,body:t[0]}}}),m({type:`enclose`,names:[`\\angl`,`\\cancel`,`\\bcancel`,`\\xcancel`,`\\sout`,`\\overline`,`\\boxed`,`\\longdiv`,`\\phase`],props:{numArgs:1},handler({parser:e,funcName:t},n){let r=n[0];return{type:`enclose`,mode:e.mode,label:t,body:r}},mathmlBuilder:jt}),m({type:`enclose`,names:[`\\underline`],props:{numArgs:1,allowedInText:!0},handler({parser:e,funcName:t},n){let r=n[0];return{type:`enclose`,mode:e.mode,label:t,body:r}},mathmlBuilder:jt}),m({type:`enclose`,names:[`\\textcircled`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler({parser:e,funcName:t},n){let r=n[0];return{type:`enclose`,mode:e.mode,label:t,body:r}},mathmlBuilder:jt});var Mt={};function U({type:e,names:t,props:n,handler:r,mathmlBuilder:i}){let a={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:r};for(let e=0;e<t.length;++e)Mt[t[e]]=a;i&&(p[e]=i)}var W=class e{constructor(e,t,n){this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},G=class e{constructor(e,t){this.text=e,this.loc=t}range(t,n){return new e(n,W.range(this,t))}},K={DISPLAY:0,TEXT:1,SCRIPT:2,SCRIPTSCRIPT:3},Nt={};function q(e,t){Nt[e]=t}var Pt=Nt;q(`\\noexpand`,function(e){let t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),q(`\\expandafter`,function(e){let t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),q(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),q(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),q(`\\@ifnextchar`,function(e){let t=e.consumeArgs(3);e.consumeSpaces();let n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),q(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),q(`\\TextOrMath`,function(e){let t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Ft=e=>{let t=``;for(let n=e.length-1;n>-1;n--)t+=e[n].text;return t},It={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},Lt=e=>{let t=e.future().text;return t===`EOF`?[null,``]:[It[t.charAt(0)],t]},Rt=(e,t,n)=>{for(let r=1;r<t.length;r++){let i=It[t.charAt(r)];e*=n,e+=i}return e};q(`\\char`,function(t){let n=t.popToken(),r,i=``;if(n.text===`'`)r=8,n=t.popToken();else if(n.text===`"`)r=16,n=t.popToken();else if(n.text==="`")if(n=t.popToken(),n.text[0]===`\\`)i=n.text.charCodeAt(1);else if(n.text===`EOF`)throw new e("\\char` missing argument");else i=n.text.charCodeAt(0);else r=10;if(r){let a=n.text;if(i=It[a.charAt(0)],i==null||i>=r)throw new e(`Invalid base-${r} digit ${n.text}`);i=Rt(i,a,r);let o;for([o,a]=Lt(t);o!=null&&o<r;)i*=r,i+=o,i=Rt(i,a,r),t.popToken(),[o,a]=Lt(t)}return`\\@char{${i}}`});function zt(e){let t=e.consumeArgs(1)[0],n=``,r=t[t.length-1].loc.start;for(let e=t.length-1;e>=0;e--){let i=t[e].loc.start;i>r&&(n+=` `,r=i),n+=t[e].text,r+=t[e].text.length}return n}q(`\\surd`,`\\sqrt{\\vphantom{|}}`),q(`⊕`,`\\oplus`),q(`\\long`,``),q(`\\bgroup`,`{`),q(`\\egroup`,`}`),q(`~`,`\\nobreakspace`),q(`\\lq`,"`"),q(`\\rq`,`'`),q(`\\aa`,`\\r a`),q(`\\Bbbk`,`\\Bbb{k}`),q(`\\mathstrut`,`\\vphantom{(}`),q(`\\underbar`,`\\underline{\\text{#1}}`),q(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),q(`⋮`,`\\vdots`),q(`\\arraystretch`,`1`),q(`\\arraycolsep`,`6pt`),q(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),q(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),q(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),q(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`);var Bt={",":`\\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`,"\\bigsqcap":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\bigtimes":`\\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`};q(`\\dots`,function(e){let t=`\\dotso`,n=e.expandAfterFuture().text;return n in Bt?t=Bt[n]:(n.slice(0,4)===`\\not`||n in x.math&&[`bin`,`rel`].includes(x.math[n].group))&&(t=`\\dotsb`),t});var Vt={")":!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};q(`\\dotso`,function(e){return e.future().text in Vt?`\\ldots\\,`:`\\ldots`}),q(`\\dotsc`,function(e){let t=e.future().text;return t in Vt&&t!==`,`?`\\ldots\\,`:`\\ldots`}),q(`\\cdots`,function(e){return e.future().text in Vt?`\\@cdots\\,`:`\\@cdots`}),q(`\\dotsb`,`\\cdots`),q(`\\dotsm`,`\\cdots`),q(`\\dotsi`,`\\!\\cdots`),q(`\\idotsint`,`\\dotsi`),q(`\\dotsx`,`\\ldots\\,`),q(`\\DOTSI`,`\\relax`),q(`\\DOTSB`,`\\relax`),q(`\\DOTSX`,`\\relax`),q(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),q(`\\,`,`{\\tmspace+{3mu}{.1667em}}`),q(`\\thinspace`,`\\,`),q(`\\>`,`\\mskip{4mu}`),q(`\\:`,`{\\tmspace+{4mu}{.2222em}}`),q(`\\medspace`,`\\:`),q(`\\;`,`{\\tmspace+{5mu}{.2777em}}`),q(`\\thickspace`,`\\;`),q(`\\!`,`{\\tmspace-{3mu}{.1667em}}`),q(`\\negthinspace`,`\\!`),q(`\\negmedspace`,`{\\tmspace-{4mu}{.2222em}}`),q(`\\negthickspace`,`{\\tmspace-{5mu}{.277em}}`),q(`\\enspace`,`\\kern.5em `),q(`\\enskip`,`\\hskip.5em\\relax`),q(`\\quad`,`\\hskip1em\\relax`),q(`\\qquad`,`\\hskip2em\\relax`),q(`\\AA`,`\\TextOrMath{\\Angstrom}{\\mathring{A}}\\relax`),q(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),q(`\\tag@paren`,`\\tag@literal{({#1})}`),q(`\\tag@literal`,t=>{if(t.macros.get(`\\df@tag`))throw new e(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),q(`\\notag`,`\\nonumber`),q(`\\nonumber`,`\\gdef\\@eqnsw{0}`),q(`\\bmod`,`\\mathbin{\\text{mod}}`),q(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),q(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),q(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),q(`\\newline`,`\\\\\\relax`),q(`\\TeX`,`\\textrm{T}\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125em\\textrm{X}`),q(`\\LaTeX`,`\\textrm{L}\\kern-.35em\\raisebox{0.2em}{\\scriptstyle A}\\kern-.15em\\TeX`),q(`\\Temml`,`\\textrm{T}\\kern-0.2em\\lower{0.2em}{\\textrm{E}}\\kern-0.08em{\\textrm{M}\\kern-0.08em\\raise{0.2em}\\textrm{M}\\kern-0.08em\\textrm{L}}`),q(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),q(`\\@hspace`,`\\hskip #1\\relax`),q(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),q(`\\colon`,`\\mathpunct{\\char"3a}`),q(`\\prescript`,`\\pres@cript{_{#1}^{#2}}{}{#3}`),q(`\\ordinarycolon`,`\\char"3a`),q(`\\vcentcolon`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}}`),q(`\\coloneq`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2212}`),q(`\\Coloneq`,`\\mathrel{\\char"2237\\char"2212}`),q(`\\Eqqcolon`,`\\mathrel{\\char"3d\\char"2237}`),q(`\\Eqcolon`,`\\mathrel{\\char"2212\\char"2237}`),q(`\\colonapprox`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2248}`),q(`\\Colonapprox`,`\\mathrel{\\char"2237\\char"2248}`),q(`\\colonsim`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}`),q(`\\Colonsim`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}`),q(`\\ratio`,`\\vcentcolon`),q(`\\coloncolon`,`\\dblcolon`),q(`\\colonequals`,`\\coloneqq`),q(`\\coloncolonequals`,`\\Coloneqq`),q(`\\equalscolon`,`\\eqqcolon`),q(`\\equalscoloncolon`,`\\Eqqcolon`),q(`\\colonminus`,`\\coloneq`),q(`\\coloncolonminus`,`\\Coloneq`),q(`\\minuscolon`,`\\eqcolon`),q(`\\minuscoloncolon`,`\\Eqcolon`),q(`\\coloncolonapprox`,`\\Colonapprox`),q(`\\coloncolonsim`,`\\Colonsim`),q(`\\notni`,"\\mathrel{\\char`∌}"),q(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),q(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),q(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),q(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),q(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{\\text{lim}}}`),q(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{\\text{lim}}}`),q(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{\\text{lim}}}`),q(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{\\text{lim}}}`),q(`\\centerdot`,`{\\medspace\\rule{0.167em}{0.189em}\\medspace}`),q(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),q(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),q(`\\plim`,`\\DOTSB\\operatorname*{plim}`),q(`\\leftmodels`,`\\mathop{\\reflectbox{$\\models$}}`),q(`\\bra`,`\\mathinner{\\langle{#1}|}`),q(`\\ket`,`\\mathinner{|{#1}\\rangle}`),q(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),q(`\\Bra`,`\\left\\langle#1\\right|`),q(`\\Ket`,`\\left|#1\\right\\rangle`);var Ht=(e,t)=>{let n=`}\\,\\middle${t[0]===`|`?`\\vert`:`\\Vert`}\\,{`;return e.slice(0,t.index)+n+e.slice(t.index+t[0].length)};q(`\\Braket`,function(e){let t=zt(e),n=/\|\||\||\\\|/g,r;for(;(r=n.exec(t))!==null;)t=Ht(t,r);return`\\left\\langle{`+t+`}\\right\\rangle`}),q(`\\Set`,function(e){let t=zt(e),n=/\|\||\||\\\|/.exec(t);return n&&(t=Ht(t,n)),`\\left\\{\\:{`+t+`}\\:\\right\\}`}),q(`\\set`,function(e){return`\\{{`+zt(e).replace(/\|/,`}\\mid{`)+`}\\}`}),q(`\\angln`,`{\\angl n}`),q(`\\odv`,`\\@ifstar\\odv@next\\odv@numerator`),q(`\\odv@numerator`,`\\frac{\\mathrm{d}#1}{\\mathrm{d}#2}`),q(`\\odv@next`,`\\frac{\\mathrm{d}}{\\mathrm{d}#2}#1`),q(`\\pdv`,`\\@ifstar\\pdv@next\\pdv@numerator`);var Ut=e=>{let t=e[0][0].text,n=Ft(e[1]).split(`,`),r=String(n.length),i=r===`1`?`\\partial`:`\\partial^${r}`,a=``;return n.map(e=>{a+=`\\partial `+e.trim()+`\\,`}),[t,i,a.replace(/\\,$/,``)]};q(`\\pdv@numerator`,function(e){let[t,n,r]=Ut(e.consumeArgs(2));return`\\frac{${n} ${t}}{${r}}`}),q(`\\pdv@next`,function(e){let[t,n,r]=Ut(e.consumeArgs(2));return`\\frac{${n}}{${r}} ${t}`}),q(`\\upalpha`,`\\up@greek{\\alpha}`),q(`\\upbeta`,`\\up@greek{\\beta}`),q(`\\upgamma`,`\\up@greek{\\gamma}`),q(`\\updelta`,`\\up@greek{\\delta}`),q(`\\upepsilon`,`\\up@greek{\\epsilon}`),q(`\\upzeta`,`\\up@greek{\\zeta}`),q(`\\upeta`,`\\up@greek{\\eta}`),q(`\\uptheta`,`\\up@greek{\\theta}`),q(`\\upiota`,`\\up@greek{\\iota}`),q(`\\upkappa`,`\\up@greek{\\kappa}`),q(`\\uplambda`,`\\up@greek{\\lambda}`),q(`\\upmu`,`\\up@greek{\\mu}`),q(`\\upnu`,`\\up@greek{\\nu}`),q(`\\upxi`,`\\up@greek{\\xi}`),q(`\\upomicron`,`\\up@greek{\\omicron}`),q(`\\uppi`,`\\up@greek{\\pi}`),q(`\\upalpha`,`\\up@greek{\\alpha}`),q(`\\uprho`,`\\up@greek{\\rho}`),q(`\\upsigma`,`\\up@greek{\\sigma}`),q(`\\uptau`,`\\up@greek{\\tau}`),q(`\\upupsilon`,`\\up@greek{\\upsilon}`),q(`\\upphi`,`\\up@greek{\\phi}`),q(`\\upchi`,`\\up@greek{\\chi}`),q(`\\uppsi`,`\\up@greek{\\psi}`),q(`\\upomega`,`\\up@greek{\\omega}`),q(`\\invamp`,`\\mathbin{\\char"214b}`),q(`\\parr`,`\\mathbin{\\char"214b}`),q(`\\with`,`\\mathbin{\\char"26}`),q(`\\multimapinv`,`\\mathrel{\\char"27dc}`),q(`\\multimapboth`,`\\mathrel{\\char"29df}`),q(`\\scoh`,`{\\mkern5mu\\char"2322\\mkern5mu}`),q(`\\sincoh`,`{\\mkern5mu\\char"2323\\mkern5mu}`),q(`\\coh`,`{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2322}}}
|
|
86
|
+
{\\smash{\\lower4mu{\\char"2323}}}\\mkern5mu}`),q(`\\incoh`,`{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2323}}}
|
|
87
|
+
{\\smash{\\lower4mu{\\char"2322}}}\\mkern5mu}`),q(`\\standardstate`,"\\text{\\tiny\\char`⦵}"),q(`\\ce`,function(e){return Wt(e.consumeArgs(1)[0],`ce`)}),q(`\\pu`,function(e){return Wt(e.consumeArgs(1)[0],`pu`)}),q(`\\uniDash`,`{\\rule{0.672em}{0.06em}}`),q(`\\triDash`,`{\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}}`),q(`\\tripleDash`,`\\kern0.075em\\raise0.25em{\\triDash}\\kern0.075em`),q(`\\tripleDashOverLine`,`\\kern0.075em\\mathrlap{\\raise0.125em{\\uniDash}}\\raise0.34em{\\triDash}\\kern0.075em`),q(`\\tripleDashOverDoubleLine`,`\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\triDash}}\\raise0.27em{\\uniDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em`),q(`\\tripleDashBetweenDoubleLine`,`\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\uniDash}}\\raise0.27em{\\triDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em`);var Wt=function(e,t){for(var n=``,r=e.length&&e[e.length-1].loc.start,i=e.length-1;i>=0;i--)e[i].loc.start>r&&(n+=` `,r=e[i].loc.start),n+=e[i].text,r+=e[i].text.length;return Y.go(J.go(n,t))},J={go:function(e,t){if(!e)return[];t===void 0&&(t=`ce`);var n=`0`,r={};r.parenthesisLevel=0,e=e.replace(/\n/g,` `),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,`-`),e=e.replace(/[\u2026]/g,`...`);for(var i,a=10,o=[];;){i===e?a--:(a=10,i=e);var s=J.stateMachines[t],c=s.transitions[n]||s.transitions[`*`];iterateTransitions:for(var l=0;l<c.length;l++){var u=J.patterns.match_(c[l].pattern,e);if(u){for(var d=c[l].task,f=0;f<d.action_.length;f++){var p;if(s.actions[d.action_[f].type_])p=s.actions[d.action_[f].type_](r,u.match_,d.action_[f].option);else if(J.actions[d.action_[f].type_])p=J.actions[d.action_[f].type_](r,u.match_,d.action_[f].option);else throw[`MhchemBugA`,`mhchem bug A. Please report. (`+d.action_[f].type_+`)`];J.concatArray(o,p)}if(n=d.nextState||n,e.length>0){if(d.revisit||(e=u.remainder),!d.toContinue)break iterateTransitions}else return o}}if(a<=0)throw[`MhchemBugU`,`mhchem bug U. Please report.`]}},concatArray:function(e,t){if(t)if(Array.isArray(t))for(var n=0;n<t.length;n++)e.push(t[n]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,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(e){var t=e.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]+\}))?/);return t&&t[0]?{match_:t.splice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.splice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=J.patterns.findObserveGroups(e,``,/^\([a-z]{1,3}(?=[\),])/,`)`,``);if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var n=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return n?{match_:n[0],remainder:e.substr(n[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return J.patterns.findObserveGroups(e,`^{`,``,``,`}`)},"^($...$)":function(e){return J.patterns.findObserveGroups(e,`^`,`$`,`$`,``)},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return J.patterns.findObserveGroups(e,`^`,/^\\[a-zA-Z]+\{/,`}`,``,``,`{`,`}`,``,!0)},"^\\x{}":function(e){return J.patterns.findObserveGroups(e,`^`,/^\\[a-zA-Z]+\{/,`}`,``)},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return J.patterns.findObserveGroups(e,`_{`,``,``,`}`)},"_($...$)":function(e){return J.patterns.findObserveGroups(e,`_`,`$`,`$`,``)},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return J.patterns.findObserveGroups(e,`_`,/^\\[a-zA-Z]+\{/,`}`,``,``,`{`,`}`,``,!0)},"_\\x{}":function(e){return J.patterns.findObserveGroups(e,`_`,/^\\[a-zA-Z]+\{/,`}`,``)},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return J.patterns.findObserveGroups(e,``,`{`,`}`,``)},"{(...)}":function(e){return J.patterns.findObserveGroups(e,`{`,``,``,`}`)},"$...$":function(e){return J.patterns.findObserveGroups(e,``,`$`,`$`,``)},"${(...)}$":function(e){return J.patterns.findObserveGroups(e,"${",``,``,`}$`)},"$(...)$":function(e){return J.patterns.findObserveGroups(e,`$`,``,``,`$`)},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return J.patterns.findObserveGroups(e,`\\bond{`,``,``,`}`)},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return J.patterns.findObserveGroups(e,`[`,``,``,`]`)},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return J.patterns.findObserveGroups(e,``,/^\\[a-zA-Z]+\{/,`}`,``,``,`{`,`}`,``,!0)},"\\x{}":function(e){return J.patterns.findObserveGroups(e,``,/^\\[a-zA-Z]+\{/,`}`,``)},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return J.patterns.findObserveGroups(e,`\\frac{`,``,``,`}`,`{`,``,``,`}`)},"\\overset{(...)}":function(e){return J.patterns.findObserveGroups(e,`\\overset{`,``,``,`}`,`{`,``,``,`}`)},"\\underset{(...)}":function(e){return J.patterns.findObserveGroups(e,`\\underset{`,``,``,`}`,`{`,``,``,`}`)},"\\underbrace{(...)}":function(e){return J.patterns.findObserveGroups(e,`\\underbrace{`,``,``,`}_`,`{`,``,``,`}`)},"\\color{(...)}0":function(e){return J.patterns.findObserveGroups(e,`\\color{`,``,``,`}`)},"\\color{(...)}{(...)}1":function(e){return J.patterns.findObserveGroups(e,`\\color{`,``,``,`}`,`{`,``,``,`}`)},"\\color(...){(...)}2":function(e){return J.patterns.findObserveGroups(e,`\\color`,`\\`,``,/^(?=\{)/,`{`,``,``,`}`)},"\\ce{(...)}":function(e){return J.patterns.findObserveGroups(e,`\\ce{`,``,``,`}`)},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var t=e.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))/);if(t)return{match_:t[0],remainder:e.substr(t[0].length)};var n=J.patterns.findObserveGroups(e,``,`$`,`$`,``);return n&&(t=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),t)?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,n,r,i,a,o,s,c,l){var u=function(e,t){if(typeof t==`string`)return e.indexOf(t)===0?t:null;var n=e.match(t);return n?n[0]:null},d=function(e,t,n){for(var r=0;t<e.length;){var i=e.charAt(t),a=u(e.substr(t),n);if(a!==null&&r===0)return{endMatchBegin:t,endMatchEnd:t+a.length};if(i===`{`)r++;else if(i===`}`){if(r===0)throw[`ExtraCloseMissingOpen`,`Extra close brace or missing open brace`];r--}t++}return null},f=u(e,t);if(f===null||(e=e.substr(f.length),f=u(e,n),f===null))return null;var p=d(e,f.length,r||i);if(p===null)return null;var m=e.substring(0,r?p.endMatchEnd:p.endMatchBegin);if(a||o){var h=this.findObserveGroups(e.substr(p.endMatchEnd),a,o,s,c);if(h===null)return null;var g=[m,h.match_];return{match_:l?g.join(``):g,remainder:h.remainder}}else return{match_:m,remainder:e.substr(p.endMatchEnd)}},match_:function(e,t){var n=J.patterns.patterns[e];if(n===void 0)throw[`MhchemBugP`,`mhchem bug P. Please report. (`+e+`)`];if(typeof n==`function`)return J.patterns.patterns[e](t);var r=t.match(n);return r?{match_:r[2]?[r[1],r[2]]:r[1]?r[1]:r[0],remainder:t.substr(r[0].length)}:null}},actions:{"a=":function(e,t){e.a=(e.a||``)+t},"b=":function(e,t){e.b=(e.b||``)+t},"p=":function(e,t){e.p=(e.p||``)+t},"o=":function(e,t){e.o=(e.o||``)+t},"q=":function(e,t){e.q=(e.q||``)+t},"d=":function(e,t){e.d=(e.d||``)+t},"rm=":function(e,t){e.rm=(e.rm||``)+t},"text=":function(e,t){e.text_=(e.text_||``)+t},insert:function(e,t,n){return{type_:n}},"insert+p1":function(e,t,n){return{type_:n,p1:t}},"insert+p1+p2":function(e,t,n){return{type_:n,p1:t[0],p2:t[1]}},copy:function(e,t){return t},rm:function(e,t){return{type_:`rm`,p1:t||``}},text:function(e,t){return J.go(t,`text`)},"{text}":function(e,t){var n=[`{`];return J.concatArray(n,J.go(t,`text`)),n.push(`}`),n},"tex-math":function(e,t){return J.go(t,`tex-math`)},"tex-math tight":function(e,t){return J.go(t,`tex-math tight`)},bond:function(e,t,n){return{type_:`bond`,kind_:n||t}},"color0-output":function(e,t){return{type_:`color0`,color:t[0]}},ce:function(e,t){return J.go(t)},"1/2":function(e,t){var n=[];t.match(/^[+\-]/)&&(n.push(t.substr(0,1)),t=t.substr(1));var r=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return r[1]=r[1].replace(/\$/g,``),n.push({type_:`frac`,p1:r[1],p2:r[2]}),r[3]&&(r[3]=r[3].replace(/\$/g,``),n.push({type_:`tex-math`,p1:r[3]})),n},"9,9":function(e,t){return J.go(t,`9,9`)}},createTransitions:function(e){var t,n,r,i,a={};for(t in e)for(n in e[t])for(r=n.split(`|`),e[t][n].stateArray=r,i=0;i<r.length;i++)a[r[i]]=[];for(t in e)for(n in e[t])for(r=e[t][n].stateArray||[],i=0;i<r.length;i++){var o=e[t][n];if(o.action_){o.action_=[].concat(o.action_);for(var s=0;s<o.action_.length;s++)typeof o.action_[s]==`string`&&(o.action_[s]={type_:o.action_[s]})}else o.action_=[];for(var c=t.split(`|`),l=0;l<c.length;l++)if(r[i]===`*`)for(var u in a)a[u].push({pattern:c[l],task:o});else a[r[i]].push({pattern:c[l],task:o})}return a},stateMachines:{}};J.stateMachines={ce:{transitions:J.createTransitions({empty:{"*":{action_:`output`}},else:{"0|1|2":{action_:`beginsWithBond=false`,revisit:!0,toContinue:!0}},oxidation$:{0:{action_:`oxidation-output`}},CMT:{r:{action_:`rdt=`,nextState:`rt`},rd:{action_:`rqt=`,nextState:`rdt`}},arrowUpDown:{"0|1|2|as":{action_:[`sb=false`,`output`,`operator`],nextState:`1`}},uprightEntities:{"0|1|2":{action_:[`o=`,`output`],nextState:`1`}},orbital:{"0|1|2|3":{action_:`o=`,nextState:`o`}},"->":{"0|1|2|3":{action_:`r=`,nextState:`r`},"a|as":{action_:[`output`,`r=`],nextState:`r`},"*":{action_:[`output`,`r=`],nextState:`r`}},"+":{o:{action_:`d= kv`,nextState:`d`},"d|D":{action_:`d=`,nextState:`d`},q:{action_:`d=`,nextState:`qd`},"qd|qD":{action_:`d=`,nextState:`qd`},dq:{action_:[`output`,`d=`],nextState:`d`},3:{action_:[`sb=false`,`output`,`operator`],nextState:`0`}},amount:{"0|2":{action_:`a=`,nextState:`a`}},"pm-operator":{"0|1|2|a|as":{action_:[`sb=false`,`output`,{type_:`operator`,option:`\\pm`}],nextState:`0`}},operator:{"0|1|2|a|as":{action_:[`sb=false`,`output`,`operator`],nextState:`0`}},"-$":{"o|q":{action_:[`charge or bond`,`output`],nextState:`qd`},d:{action_:`d=`,nextState:`d`},D:{action_:[`output`,{type_:`bond`,option:`-`}],nextState:`3`},q:{action_:`d=`,nextState:`qd`},qd:{action_:`d=`,nextState:`qd`},"qD|dq":{action_:[`output`,{type_:`bond`,option:`-`}],nextState:`3`}},"-9":{"3|o":{action_:[`output`,{type_:`insert`,option:`hyphen`}],nextState:`3`}},"- orbital overlap":{o:{action_:[`output`,{type_:`insert`,option:`hyphen`}],nextState:`2`},d:{action_:[`output`,{type_:`insert`,option:`hyphen`}],nextState:`2`}},"-":{"0|1|2":{action_:[{type_:`output`,option:1},`beginsWithBond=true`,{type_:`bond`,option:`-`}],nextState:`3`},3:{action_:{type_:`bond`,option:`-`}},a:{action_:[`output`,{type_:`insert`,option:`hyphen`}],nextState:`2`},as:{action_:[{type_:`output`,option:2},{type_:`bond`,option:`-`}],nextState:`3`},b:{action_:`b=`},o:{action_:{type_:`- after o/d`,option:!1},nextState:`2`},q:{action_:{type_:`- after o/d`,option:!1},nextState:`2`},"d|qd|dq":{action_:{type_:`- after o/d`,option:!0},nextState:`2`},"D|qD|p":{action_:[`output`,{type_:`bond`,option:`-`}],nextState:`3`}},amount2:{"1|3":{action_:`a=`,nextState:`a`}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:`o=`,nextState:`o`},"q|dq":{action_:[`output`,`o=`],nextState:`o`},"d|D|qd|qD":{action_:`o after d`,nextState:`o`}},digits:{o:{action_:`q=`,nextState:`q`},"d|D":{action_:`q=`,nextState:`dq`},q:{action_:[`output`,`o=`],nextState:`o`},a:{action_:`o=`,nextState:`o`}},"space A":{"b|p|bp":{}},space:{a:{nextState:`as`},0:{action_:`sb=false`},"1|2":{action_:`sb=true`},"r|rt|rd|rdt|rdq":{action_:`output`,nextState:`0`},"*":{action_:[`output`,`sb=true`],nextState:`1`}},"1st-level escape":{"1|2":{action_:[`output`,{type_:`insert+p1`,option:`1st-level escape`}]},"*":{action_:[`output`,{type_:`insert+p1`,option:`1st-level escape`}],nextState:`0`}},"[(...)]":{"r|rt":{action_:`rd=`,nextState:`rd`},"rd|rdt":{action_:`rq=`,nextState:`rdq`}},"...":{"o|d|D|dq|qd|qD":{action_:[`output`,{type_:`bond`,option:`...`}],nextState:`3`},"*":{action_:[{type_:`output`,option:1},{type_:`insert`,option:`ellipsis`}],nextState:`1`}},". |* ":{"*":{action_:[`output`,{type_:`insert`,option:`addition compound`}],nextState:`1`}},"state of aggregation $":{"*":{action_:[`output`,`state of aggregation`],nextState:`1`}},"{[(":{"a|as|o":{action_:[`o=`,`output`,`parenthesisLevel++`],nextState:`2`},"0|1|2|3":{action_:[`o=`,`output`,`parenthesisLevel++`],nextState:`2`},"*":{action_:[`output`,`o=`,`output`,`parenthesisLevel++`],nextState:`2`}},")]}":{"0|1|2|3|b|p|bp|o":{action_:[`o=`,`parenthesisLevel--`],nextState:`o`},"a|as|d|D|q|qd|qD|dq":{action_:[`output`,`o=`,`parenthesisLevel--`],nextState:`o`}},", ":{"*":{action_:[`output`,`comma`],nextState:`0`}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:`b=`,nextState:`b`},p:{action_:`b=`,nextState:`bp`},"3|o":{action_:`d= kv`,nextState:`D`},q:{action_:`d=`,nextState:`qD`},"d|D|qd|qD|dq":{action_:[`output`,`d=`],nextState:`D`}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:`b=`,nextState:`b`},p:{action_:`b=`,nextState:`bp`},"3|o":{action_:`d= kv`,nextState:`d`},q:{action_:`d=`,nextState:`qd`},"d|qd|D|qD":{action_:`d=`},dq:{action_:[`output`,`d=`],nextState:`d`}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:[`output`,`q=`],nextState:`q`}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:`p=`,nextState:`p`},b:{action_:`p=`,nextState:`bp`},"3|o":{action_:`q=`,nextState:`q`},"d|D":{action_:`q=`,nextState:`dq`},"q|qd|qD|dq":{action_:[`output`,`q=`],nextState:`q`}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:`output`,option:2},`bond`],nextState:`3`}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:`output`,option:2},{type_:`bond`,option:`#`}],nextState:`3`}},"{}":{"*":{action_:{type_:`output`,option:1},nextState:`1`}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:`o=`,nextState:`o`},"o|d|D|q|qd|qD|dq":{action_:[`output`,`o=`],nextState:`o`}},"$...$":{a:{action_:`a=`},"0|1|2|3|as|b|p|bp|o":{action_:`o=`,nextState:`o`},"as|o":{action_:`o=`},"q|d|D|qd|qD|dq":{action_:[`output`,`o=`],nextState:`o`}},"\\bond{(...)}":{"*":{action_:[{type_:`output`,option:2},`bond`],nextState:`3`}},"\\frac{(...)}":{"*":{action_:[{type_:`output`,option:1},`frac-output`],nextState:`3`}},"\\overset{(...)}":{"*":{action_:[{type_:`output`,option:2},`overset-output`],nextState:`3`}},"\\underset{(...)}":{"*":{action_:[{type_:`output`,option:2},`underset-output`],nextState:`3`}},"\\underbrace{(...)}":{"*":{action_:[{type_:`output`,option:2},`underbrace-output`],nextState:`3`}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:`output`,option:2},`color-output`],nextState:`3`}},"\\color{(...)}0":{"*":{action_:[{type_:`output`,option:2},`color0-output`]}},"\\ce{(...)}":{"*":{action_:[{type_:`output`,option:2},`ce`],nextState:`3`}},"\\,":{"*":{action_:[{type_:`output`,option:1},`copy`],nextState:`1`}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:[`o=`,`output`],nextState:`3`},"*":{action_:[`output`,`o=`,`output`],nextState:`3`}},others:{"*":{action_:[{type_:`output`,option:1},`copy`],nextState:`3`}},else2:{a:{action_:`a to o`,nextState:`o`,revisit:!0},as:{action_:[`output`,`sb=true`],nextState:`1`,revisit:!0},"r|rt|rd|rdt|rdq":{action_:[`output`],nextState:`0`,revisit:!0},"*":{action_:[`output`,`copy`],nextState:`3`}}}),actions:{"o after d":function(e,t){var n;if((e.d||``).match(/^[0-9]+$/)){var r=e.d;e.d=void 0,n=this.output(e),e.b=r}else n=this.output(e);return J.actions[`o=`](e,t),n},"d= kv":function(e,t){e.d=t,e.dType=`kv`},"charge or bond":function(e,t){if(e.beginsWithBond){var n=[];return J.concatArray(n,this.output(e)),J.concatArray(n,J.actions.bond(e,t,`-`)),n}else e.d=t},"- after o/d":function(e,t,n){var r=J.patterns.match_(`orbital`,e.o||``),i=J.patterns.match_(`one lowercase greek letter $`,e.o||``),a=J.patterns.match_(`one lowercase latin letter $`,e.o||``),o=J.patterns.match_(`$one lowercase latin letter$ $`,e.o||``),s=t===`-`&&(r&&r.remainder===``||i||a||o);s&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!r&&a&&(e.o=`$`+e.o+`$`);var c=[];return s?(J.concatArray(c,this.output(e)),c.push({type_:`hyphen`})):(r=J.patterns.match_(`digits`,e.d||``),n&&r&&r.remainder===``?(J.concatArray(c,J.actions[`d=`](e,t)),J.concatArray(c,this.output(e))):(J.concatArray(c,this.output(e)),J.concatArray(c,J.actions.bond(e,t,`-`)))),c},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:`state of aggregation`,p1:J.go(t,`o`)}},comma:function(e,t){var n=t.replace(/\s*$/,``);return n!==t&&e.parenthesisLevel===0?{type_:`comma enumeration L`,p1:n}:{type_:`comma enumeration M`,p1:n}},output:function(e,t,n){var r;if(!e.r)r=[],!e.a&&!e.b&&!e.p&&!e.o&&!e.q&&!e.d&&!n||(e.sb&&r.push({type_:`entitySkip`}),!e.o&&!e.q&&!e.d&&!e.b&&!e.p&&n!==2?(e.o=e.a,e.a=void 0):!e.o&&!e.q&&!e.d&&(e.b||e.p)?(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):e.o&&e.dType===`kv`&&J.patterns.match_(`d-oxidation$`,e.d||``)?e.dType=`oxidation`:e.o&&e.dType===`kv`&&!e.q&&(e.dType=void 0),r.push({type_:`chemfive`,a:J.go(e.a,`a`),b:J.go(e.b,`bd`),p:J.go(e.p,`pq`),o:J.go(e.o,`o`),q:J.go(e.q,`pq`),d:J.go(e.d,e.dType===`oxidation`?`oxidation`:`bd`),dType:e.dType}));else{var i=e.rdt===`M`?J.go(e.rd,`tex-math`):e.rdt===`T`?[{type_:`text`,p1:e.rd||``}]:J.go(e.rd),a=e.rqt===`M`?J.go(e.rq,`tex-math`):e.rqt===`T`?[{type_:`text`,p1:e.rq||``}]:J.go(e.rq);r={type_:`arrow`,r:e.r,rd:i,rq:a}}for(var o in e)o!==`parenthesisLevel`&&o!==`beginsWithBond`&&delete e[o];return r},"oxidation-output":function(e,t){var n=[`{`];return J.concatArray(n,J.go(t,`oxidation`)),n.push(`}`),n},"frac-output":function(e,t){return{type_:`frac-ce`,p1:J.go(t[0]),p2:J.go(t[1])}},"overset-output":function(e,t){return{type_:`overset`,p1:J.go(t[0]),p2:J.go(t[1])}},"underset-output":function(e,t){return{type_:`underset`,p1:J.go(t[0]),p2:J.go(t[1])}},"underbrace-output":function(e,t){return{type_:`underbrace`,p1:J.go(t[0]),p2:J.go(t[1])}},"color-output":function(e,t){return{type_:`color`,color1:t[0],color2:J.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,n){return{type_:`operator`,kind_:n||t}}}},a:{transitions:J.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:`1/2`}},else:{0:{nextState:`1`,revisit:!0}},"$(...)$":{"*":{action_:`tex-math tight`,nextState:`1`}},",":{"*":{action_:{type_:`insert`,option:`commaDecimal`}}},else2:{"*":{action_:`copy`}}}),actions:{}},o:{transitions:J.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:`1/2`}},else:{0:{nextState:`1`,revisit:!0}},letters:{"*":{action_:`rm`}},"\\ca":{"*":{action_:{type_:`insert`,option:`circa`}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:`copy`}},"${(...)}$|$(...)$":{"*":{action_:`tex-math`}},"{(...)}":{"*":{action_:`{text}`}},else2:{"*":{action_:`copy`}}}),actions:{}},text:{transitions:J.createTransitions({empty:{"*":{action_:`output`}},"{...}":{"*":{action_:`text=`}},"${(...)}$|$(...)$":{"*":{action_:`tex-math`}},"\\greek":{"*":{action_:[`output`,`rm`]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:[`output`,`copy`]}},else:{"*":{action_:`text=`}}}),actions:{output:function(e){if(e.text_){var t={type_:`text`,p1:e.text_};for(var n in e)delete e[n];return t}}}},pq:{transitions:J.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:`state of aggregation`}},i$:{0:{nextState:`!f`,revisit:!0}},"(KV letters),":{0:{action_:`rm`,nextState:`0`}},formula$:{0:{nextState:`f`,revisit:!0}},"1/2$":{0:{action_:`1/2`}},else:{0:{nextState:`!f`,revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:`tex-math`}},"{(...)}":{"*":{action_:`text`}},"a-z":{f:{action_:`tex-math`}},letters:{"*":{action_:`rm`}},"-9.,9":{"*":{action_:`9,9`}},",":{"*":{action_:{type_:`insert+p1`,option:`comma enumeration S`}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:`color-output`}},"\\color{(...)}0":{"*":{action_:`color0-output`}},"\\ce{(...)}":{"*":{action_:`ce`}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:`copy`}},else2:{"*":{action_:`copy`}}}),actions:{"state of aggregation":function(e,t){return{type_:`state of aggregation subscript`,p1:J.go(t,`o`)}},"color-output":function(e,t){return{type_:`color`,color1:t[0],color2:J.go(t[1],`pq`)}}}},bd:{transitions:J.createTransitions({empty:{"*":{}},x$:{0:{nextState:`!f`,revisit:!0}},formula$:{0:{nextState:`f`,revisit:!0}},else:{0:{nextState:`!f`,revisit:!0}},"-9.,9 no missing 0":{"*":{action_:`9,9`}},".":{"*":{action_:{type_:`insert`,option:`electron dot`}}},"a-z":{f:{action_:`tex-math`}},x:{"*":{action_:{type_:`insert`,option:`KV x`}}},letters:{"*":{action_:`rm`}},"'":{"*":{action_:{type_:`insert`,option:`prime`}}},"${(...)}$|$(...)$":{"*":{action_:`tex-math`}},"{(...)}":{"*":{action_:`text`}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:`color-output`}},"\\color{(...)}0":{"*":{action_:`color0-output`}},"\\ce{(...)}":{"*":{action_:`ce`}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:`copy`}},else2:{"*":{action_:`copy`}}}),actions:{"color-output":function(e,t){return{type_:`color`,color1:t[0],color2:J.go(t[1],`bd`)}}}},oxidation:{transitions:J.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:`roman-numeral`}},"${(...)}$|$(...)$":{"*":{action_:`tex-math`}},else:{"*":{action_:`copy`}}}),actions:{"roman-numeral":function(e,t){return{type_:`roman numeral`,p1:t||``}}}},"tex-math":{transitions:J.createTransitions({empty:{"*":{action_:`output`}},"\\ce{(...)}":{"*":{action_:[`output`,`ce`]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:`o=`}},else:{"*":{action_:`o=`}}}),actions:{output:function(e){if(e.o){var t={type_:`tex-math`,p1:e.o};for(var n in e)delete e[n];return t}}}},"tex-math tight":{transitions:J.createTransitions({empty:{"*":{action_:`output`}},"\\ce{(...)}":{"*":{action_:[`output`,`ce`]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:`o=`}},"-|+":{"*":{action_:`tight operator`}},else:{"*":{action_:`o=`}}}),actions:{"tight operator":function(e,t){e.o=(e.o||``)+`{`+t+`}`},output:function(e){if(e.o){var t={type_:`tex-math`,p1:e.o};for(var n in e)delete e[n];return t}}}},"9,9":{transitions:J.createTransitions({empty:{"*":{}},",":{"*":{action_:`comma`}},else:{"*":{action_:`copy`}}}),actions:{comma:function(){return{type_:`commaDecimal`}}}},pu:{transitions:J.createTransitions({empty:{"*":{action_:`output`}},space$:{"*":{action_:[`output`,`space`]}},"{[(|)]}":{"0|a":{action_:`copy`}},"(-)(9)^(-9)":{0:{action_:`number^`,nextState:`a`}},"(-)(9.,9)(e)(99)":{0:{action_:`enumber`,nextState:`a`}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:`operator`,option:`\\pm`},nextState:`0`}},operator:{"0|a":{action_:`copy`,nextState:`0`}},"//":{d:{action_:`o=`,nextState:`/`}},"/":{d:{action_:`o=`,nextState:`/`}},"{...}|else":{"0|d":{action_:`d=`,nextState:`d`},a:{action_:[`space`,`d=`],nextState:`d`},"/|q":{action_:`q=`,nextState:`q`}}}),actions:{enumber:function(e,t){var n=[];return t[0]===`+-`||t[0]===`+/-`?n.push(`\\pm `):t[0]&&n.push(t[0]),t[1]&&(J.concatArray(n,J.go(t[1],`pu-9,9`)),t[2]&&(t[2].match(/[,.]/)?J.concatArray(n,J.go(t[2],`pu-9,9`)):n.push(t[2])),t[3]=t[4]||t[3],t[3]&&(t[3]=t[3].trim(),t[3]===`e`||t[3].substr(0,1)===`*`?n.push({type_:`cdot`}):n.push({type_:`times`}))),t[3]&&n.push(`10^{`+t[5]+`}`),n},"number^":function(e,t){var n=[];return t[0]===`+-`||t[0]===`+/-`?n.push(`\\pm `):t[0]&&n.push(t[0]),J.concatArray(n,J.go(t[1],`pu-9,9`)),n.push(`^{`+t[2]+`}`),n},operator:function(e,t,n){return{type_:`operator`,kind_:n||t}},space:function(){return{type_:`pu-space-1`}},output:function(e){var t,n=J.patterns.match_(`{(...)}`,e.d||``);n&&n.remainder===``&&(e.d=n.match_);var r=J.patterns.match_(`{(...)}`,e.q||``);if(r&&r.remainder===``&&(e.q=r.match_),e.d&&=(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,`{}^{\\circ}C`),e.d.replace(/\u00B0F|\^oF|\^{o}F/g,`{}^{\\circ}F`)),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,`{}^{\\circ}C`),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,`{}^{\\circ}F`);var i={d:J.go(e.d,`pu`),q:J.go(e.q,`pu`)};e.o===`//`?t={type_:`pu-frac`,p1:i.d,p2:i.q}:(t=i.d,i.d.length>1||i.q.length>1?t.push({type_:` / `}):t.push({type_:`/`}),J.concatArray(t,i.q))}else t=J.go(e.d,`pu-2`);for(var a in e)delete e[a];return t}}},"pu-2":{transitions:J.createTransitions({empty:{"*":{action_:`output`}},"*":{"*":{action_:[`output`,`cdot`],nextState:`0`}},"\\x":{"*":{action_:`rm=`}},space:{"*":{action_:[`output`,`space`],nextState:`0`}},"^{(...)}|^(-1)":{1:{action_:`^(-1)`}},"-9.,9":{0:{action_:`rm=`,nextState:`0`},1:{action_:`^(-1)`,nextState:`0`}},"{...}|else":{"*":{action_:`rm=`,nextState:`1`}}}),actions:{cdot:function(){return{type_:`tight cdot`}},"^(-1)":function(e,t){e.rm+=`^{`+t+`}`},space:function(){return{type_:`pu-space-2`}},output:function(e){var t=[];if(e.rm){var n=J.patterns.match_(`{(...)}`,e.rm||``);t=n&&n.remainder===``?J.go(n.match_,`pu`):{type_:`rm`,p1:e.rm}}for(var r in e)delete e[r];return t}}},"pu-9,9":{transitions:J.createTransitions({empty:{0:{action_:`output-0`},o:{action_:`output-o`}},",":{0:{action_:[`output-0`,`comma`],nextState:`o`}},".":{0:{action_:[`output-0`,`copy`],nextState:`o`}},else:{"*":{action_:`text=`}}}),actions:{comma:function(){return{type_:`commaDecimal`}},"output-0":function(e){var t=[];if(e.text_=e.text_||``,e.text_.length>4){var n=e.text_.length%3;n===0&&(n=3);for(var r=e.text_.length-3;r>0;r-=3)t.push(e.text_.substr(r,3)),t.push({type_:`1000 separator`});t.push(e.text_.substr(0,n)),t.reverse()}else t.push(e.text_);for(var i in e)delete e[i];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||``,e.text_.length>4){for(var n=e.text_.length-3,r=0;r<n;r+=3)t.push(e.text_.substr(r,3)),t.push({type_:`1000 separator`});t.push(e.text_.substr(r))}else t.push(e.text_);for(var i in e)delete e[i];return t}}}};var Y={go:function(e,t){if(!e)return``;for(var n=``,r=!1,i=0;i<e.length;i++){var a=e[i];typeof a==`string`?n+=a:(n+=Y._go2(a),a.type_===`1st-level escape`&&(r=!0))}return!t&&!r&&n&&(n=`{`+n+`}`),n},_goInner:function(e){return e&&Y.go(e,!0)},_go2:function(e){var t;switch(e.type_){case`chemfive`:t=``;var n={a:Y._goInner(e.a),b:Y._goInner(e.b),p:Y._goInner(e.p),o:Y._goInner(e.o),q:Y._goInner(e.q),d:Y._goInner(e.d)};n.a&&(n.a.match(/^[+\-]/)&&(n.a=`{`+n.a+`}`),t+=n.a+`\\,`),(n.b||n.p)&&(t+=`{\\vphantom{X}}`,t+=`^{\\hphantom{`+(n.b||``)+`}}_{\\hphantom{`+(n.p||``)+`}}`,t+=`{\\vphantom{X}}`,t+=`^{\\vphantom{2}\\mathllap{`+(n.b||``)+`}}`,t+=`_{\\vphantom{2}\\mathllap{`+(n.p||``)+`}}`),n.o&&(n.o.match(/^[+\-]/)&&(n.o=`{`+n.o+`}`),t+=n.o),e.dType===`kv`?((n.d||n.q)&&(t+=`{\\vphantom{X}}`),n.d&&(t+=`^{`+n.d+`}`),n.q&&(t+=`_{`+n.q+`}`)):e.dType===`oxidation`?(n.d&&(t+=`{\\vphantom{X}}`,t+=`^{`+n.d+`}`),n.q&&(t+=`{{}}`,t+=`_{`+n.q+`}`)):(n.q&&(t+=`{{}}`,t+=`_{`+n.q+`}`),n.d&&(t+=`{{}}`,t+=`^{`+n.d+`}`));break;case`rm`:t=`\\mathrm{`+e.p1+`}`;break;case`text`:e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(` `,`~`).replace(`-`,`\\text{-}`),t=`\\mathrm{`+e.p1+`}`):t=`\\text{`+e.p1+`}`;break;case`roman numeral`:t=`\\mathrm{`+e.p1+`}`;break;case`state of aggregation`:t=`\\mskip2mu `+Y._goInner(e.p1);break;case`state of aggregation subscript`:t=`\\mskip1mu `+Y._goInner(e.p1);break;case`bond`:if(t=Y._getBond(e.kind_),!t)throw[`MhchemErrorBond`,`mhchem Error. Unknown bond type (`+e.kind_+`)`];break;case`frac`:var r=`\\frac{`+e.p1+`}{`+e.p2+`}`;t=`\\mathchoice{\\textstyle`+r+`}{`+r+`}{`+r+`}{`+r+`}`;break;case`pu-frac`:var i=`\\frac{`+Y._goInner(e.p1)+`}{`+Y._goInner(e.p2)+`}`;t=`\\mathchoice{\\textstyle`+i+`}{`+i+`}{`+i+`}{`+i+`}`;break;case`tex-math`:t=e.p1+` `;break;case`frac-ce`:t=`\\frac{`+Y._goInner(e.p1)+`}{`+Y._goInner(e.p2)+`}`;break;case`overset`:t=`\\overset{`+Y._goInner(e.p1)+`}{`+Y._goInner(e.p2)+`}`;break;case`underset`:t=`\\underset{`+Y._goInner(e.p1)+`}{`+Y._goInner(e.p2)+`}`;break;case`underbrace`:t=`\\underbrace{`+Y._goInner(e.p1)+`}_{`+Y._goInner(e.p2)+`}`;break;case`color`:t=`{\\color{`+e.color1+`}{`+Y._goInner(e.color2)+`}}`;break;case`color0`:t=`\\color{`+e.color+`}`;break;case`arrow`:var a={rd:Y._goInner(e.rd),rq:Y._goInner(e.rq)},o=Y._getArrow(e.r);a.rq&&(o+=`[{\\rm `+a.rq+`}]`),a.rd?o+=`{\\rm `+a.rd+`}`:o+=`{}`,t=o;break;case`operator`:t=Y._getOperator(e.kind_);break;case`1st-level escape`:t=e.p1+` `;break;case`space`:t=` `;break;case`entitySkip`:t=`~`;break;case`pu-space-1`:t=`~`;break;case`pu-space-2`:t=`\\mkern3mu `;break;case`1000 separator`:t=`\\mkern2mu `;break;case`commaDecimal`:t=`{,}`;break;case`comma enumeration L`:t=`{`+e.p1+`}\\mkern6mu `;break;case`comma enumeration M`:t=`{`+e.p1+`}\\mkern3mu `;break;case`comma enumeration S`:t=`{`+e.p1+`}\\mkern1mu `;break;case`hyphen`:t=`\\text{-}`;break;case`addition compound`:t=`\\,{\\cdot}\\,`;break;case`electron dot`:t=`\\mkern1mu \\text{\\textbullet}\\mkern1mu `;break;case`KV x`:t=`{\\times}`;break;case`prime`:t=`\\prime `;break;case`cdot`:t=`\\cdot `;break;case`tight cdot`:t=`\\mkern1mu{\\cdot}\\mkern1mu `;break;case`times`:t=`\\times `;break;case`circa`:t=`{\\sim}`;break;case`^`:t=`uparrow`;break;case`v`:t=`downarrow`;break;case`ellipsis`:t=`\\ldots `;break;case`/`:t=`/`;break;case` / `:t=`\\,/\\,`;break;default:throw[`MhchemBugT`,`mhchem bug T. Please report.`]}return t},_getArrow:function(e){switch(e){case`->`:return`\\yields`;case`→`:return`\\yields`;case`⟶`:return`\\yields`;case`<-`:return`\\yieldsLeft`;case`<->`:return`\\mesomerism`;case`<-->`:return`\\yieldsLeftRight`;case`<=>`:return`\\equilibrium`;case`⇌`:return`\\equilibrium`;case`<=>>`:return`\\equilibriumRight`;case`<<=>`:return`\\equilibriumLeft`;default:throw[`MhchemBugT`,`mhchem bug T. Please report.`]}},_getBond:function(e){switch(e){case`-`:return`{-}`;case`1`:return`{-}`;case`=`:return`{=}`;case`2`:return`{=}`;case`#`:return`{\\equiv}`;case`3`:return`{\\equiv}`;case`~`:return`{\\tripleDash}`;case`~-`:return`{\\tripleDashOverLine}`;case`~=`:return`{\\tripleDashOverDoubleLine}`;case`~--`:return`{\\tripleDashOverDoubleLine}`;case`-~-`:return`{\\tripleDashBetweenDoubleLine}`;case`...`:return`{{\\cdot}{\\cdot}{\\cdot}}`;case`....`:return`{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}`;case`->`:return`{\\rightarrow}`;case`<-`:return`{\\leftarrow}`;case`<`:return`{<}`;case`>`:return`{>}`;default:throw[`MhchemBugT`,`mhchem bug T. Please report.`]}},_getOperator:function(e){switch(e){case`+`:return` {}+{} `;case`-`:return` {}-{} `;case`=`:return` {}={} `;case`<`:return` {}<{} `;case`>`:return` {}>{} `;case`<<`:return` {}\\ll{} `;case`>>`:return` {}\\gg{} `;case`\\pm`:return` {}\\pm{} `;case`\\approx`:return` {}\\approx{} `;case`$\\approx$`:return` {}\\approx{} `;case`v`:return` \\downarrow{} `;case`(v)`:return` \\downarrow{} `;case`^`:return` \\uparrow{} `;case`(^)`:return` \\uparrow{} `;default:throw[`MhchemBugT`,`mhchem bug T. Please report.`]}}};q(`\\darr`,`\\downarrow`),q(`\\dArr`,`\\Downarrow`),q(`\\Darr`,`\\Downarrow`),q(`\\lang`,`\\langle`),q(`\\rang`,`\\rangle`),q(`\\uarr`,`\\uparrow`),q(`\\uArr`,`\\Uparrow`),q(`\\Uarr`,`\\Uparrow`),q(`\\N`,`\\mathbb{N}`),q(`\\R`,`\\mathbb{R}`),q(`\\Z`,`\\mathbb{Z}`),q(`\\alef`,`\\aleph`),q(`\\alefsym`,`\\aleph`),q(`\\bull`,`\\bullet`),q(`\\clubs`,`\\clubsuit`),q(`\\cnums`,`\\mathbb{C}`),q(`\\Complex`,`\\mathbb{C}`),q(`\\Dagger`,`\\ddagger`),q(`\\diamonds`,`\\diamondsuit`),q(`\\empty`,`\\emptyset`),q(`\\exist`,`\\exists`),q(`\\harr`,`\\leftrightarrow`),q(`\\hArr`,`\\Leftrightarrow`),q(`\\Harr`,`\\Leftrightarrow`),q(`\\hearts`,`\\heartsuit`),q(`\\image`,`\\Im`),q(`\\infin`,`\\infty`),q(`\\isin`,`\\in`),q(`\\larr`,`\\leftarrow`),q(`\\lArr`,`\\Leftarrow`),q(`\\Larr`,`\\Leftarrow`),q(`\\lrarr`,`\\leftrightarrow`),q(`\\lrArr`,`\\Leftrightarrow`),q(`\\Lrarr`,`\\Leftrightarrow`),q(`\\natnums`,`\\mathbb{N}`),q(`\\plusmn`,`\\pm`),q(`\\rarr`,`\\rightarrow`),q(`\\rArr`,`\\Rightarrow`),q(`\\Rarr`,`\\Rightarrow`),q(`\\real`,`\\Re`),q(`\\reals`,`\\mathbb{R}`),q(`\\Reals`,`\\mathbb{R}`),q(`\\sdot`,`\\cdot`),q(`\\sect`,`\\S`),q(`\\spades`,`\\spadesuit`),q(`\\sub`,`\\subset`),q(`\\sube`,`\\subseteq`),q(`\\supe`,`\\supseteq`),q(`\\thetasym`,`\\vartheta`),q(`\\weierp`,`\\wp`),q(`\\quantity`,`{\\left\\{ #1 \\right\\}}`),q(`\\qty`,`{\\left\\{ #1 \\right\\}}`),q(`\\pqty`,`{\\left( #1 \\right)}`),q(`\\bqty`,`{\\left[ #1 \\right]}`),q(`\\vqty`,`{\\left\\vert #1 \\right\\vert}`),q(`\\Bqty`,`{\\left\\{ #1 \\right\\}}`),q(`\\absolutevalue`,`{\\left\\vert #1 \\right\\vert}`),q(`\\abs`,`{\\left\\vert #1 \\right\\vert}`),q(`\\norm`,`{\\left\\Vert #1 \\right\\Vert}`),q(`\\evaluated`,`{\\left.#1 \\right\\vert}`),q(`\\eval`,`{\\left.#1 \\right\\vert}`),q(`\\order`,`{\\mathcal{O} \\left( #1 \\right)}`),q(`\\commutator`,`{\\left[ #1 , #2 \\right]}`),q(`\\comm`,`{\\left[ #1 , #2 \\right]}`),q(`\\anticommutator`,`{\\left\\{ #1 , #2 \\right\\}}`),q(`\\acomm`,`{\\left\\{ #1 , #2 \\right\\}}`),q(`\\poissonbracket`,`{\\left\\{ #1 , #2 \\right\\}}`),q(`\\pb`,`{\\left\\{ #1 , #2 \\right\\}}`),q(`\\vectorbold`,`{\\boldsymbol{ #1 }}`),q(`\\vb`,`{\\boldsymbol{ #1 }}`),q(`\\vectorarrow`,`{\\vec{\\boldsymbol{ #1 }}}`),q(`\\va`,`{\\vec{\\boldsymbol{ #1 }}}`),q(`\\vectorunit`,`{{\\boldsymbol{\\hat{ #1 }}}}`),q(`\\vu`,`{{\\boldsymbol{\\hat{ #1 }}}}`),q(`\\dotproduct`,`\\mathbin{\\boldsymbol\\cdot}`),q(`\\vdot`,`{\\boldsymbol\\cdot}`),q(`\\crossproduct`,`\\mathbin{\\boldsymbol\\times}`),q(`\\cross`,`\\mathbin{\\boldsymbol\\times}`),q(`\\cp`,`\\mathbin{\\boldsymbol\\times}`),q(`\\gradient`,`{\\boldsymbol\\nabla}`),q(`\\grad`,`{\\boldsymbol\\nabla}`),q(`\\divergence`,`{\\grad\\vdot}`),q(`\\curl`,`{\\grad\\cross}`),q(`\\laplacian`,`\\nabla^2`),q(`\\tr`,`{\\operatorname{tr}}`),q(`\\Tr`,`{\\operatorname{Tr}}`),q(`\\rank`,`{\\operatorname{rank}}`),q(`\\erf`,`{\\operatorname{erf}}`),q(`\\Res`,`{\\operatorname{Res}}`),q(`\\principalvalue`,`{\\mathcal{P}}`),q(`\\pv`,`{\\mathcal{P}}`),q(`\\PV`,`{\\operatorname{P.V.}}`),q(`\\qqtext`,`{\\quad\\text{ #1 }\\quad}`),q(`\\qq`,`{\\quad\\text{ #1 }\\quad}`),q(`\\qcomma`,`{\\text{,}\\quad}`),q(`\\qc`,`{\\text{,}\\quad}`),q(`\\qcc`,`{\\quad\\text{c.c.}\\quad}`),q(`\\qif`,`{\\quad\\text{if}\\quad}`),q(`\\qthen`,`{\\quad\\text{then}\\quad}`),q(`\\qelse`,`{\\quad\\text{else}\\quad}`),q(`\\qotherwise`,`{\\quad\\text{otherwise}\\quad}`),q(`\\qunless`,`{\\quad\\text{unless}\\quad}`),q(`\\qgiven`,`{\\quad\\text{given}\\quad}`),q(`\\qusing`,`{\\quad\\text{using}\\quad}`),q(`\\qassume`,`{\\quad\\text{assume}\\quad}`),q(`\\qsince`,`{\\quad\\text{since}\\quad}`),q(`\\qlet`,`{\\quad\\text{let}\\quad}`),q(`\\qfor`,`{\\quad\\text{for}\\quad}`),q(`\\qall`,`{\\quad\\text{all}\\quad}`),q(`\\qeven`,`{\\quad\\text{even}\\quad}`),q(`\\qodd`,`{\\quad\\text{odd}\\quad}`),q(`\\qinteger`,`{\\quad\\text{integer}\\quad}`),q(`\\qand`,`{\\quad\\text{and}\\quad}`),q(`\\qor`,`{\\quad\\text{or}\\quad}`),q(`\\qas`,`{\\quad\\text{as}\\quad}`),q(`\\qin`,`{\\quad\\text{in}\\quad}`),q(`\\differential`,`{\\text{d}}`),q(`\\dd`,`{\\text{d}}`),q(`\\derivative`,`{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}`),q(`\\dv`,`{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}`),q(`\\partialderivative`,`{\\frac{\\partial{ #1 }}{\\partial{ #2 }}}`),q(`\\variation`,`{\\delta}`),q(`\\var`,`{\\delta}`),q(`\\functionalderivative`,`{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}`),q(`\\fdv`,`{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}`),q(`\\innerproduct`,`{\\left\\langle {#1} \\mid { #2} \\right\\rangle}`),q(`\\outerproduct`,`{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}`),q(`\\dyad`,`{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}`),q(`\\ketbra`,`{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}`),q(`\\op`,`{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}`),q(`\\expectationvalue`,`{\\left\\langle {#1 } \\right\\rangle}`),q(`\\expval`,`{\\left\\langle {#1 } \\right\\rangle}`),q(`\\ev`,`{\\left\\langle {#1 } \\right\\rangle}`),q(`\\matrixelement`,`{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}`),q(`\\matrixel`,`{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}`),q(`\\mel`,`{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}`);function Gt(e){let t=[];e.consumeSpaces();let n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var Kt=t=>{if(!t.parser.settings.displayMode)throw new e(`{${t.envName}} can be used only in display mode.`)},qt=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/,Jt=e=>{let t=e.get(`\\arraystretch`);typeof t!=`string`&&(t=Ft(t.tokens)),t=isNaN(t)?null:Number(t);let n=e.get(`\\arraycolsep`);typeof n!=`string`&&(n=Ft(n.tokens));let r=qt.exec(n),i=r?{number:+(r[1]+r[2]),unit:r[3]}:null;return[t,i]},Yt=t=>{let n=``;for(let r=0;r<t.length;r++)if(t[r].type===`label`){if(n)throw new e(`Multiple \\labels in one row`);n=t[r].string}return n};function Xt(e){if(e.indexOf(`ed`)===-1)return e.indexOf(`*`)===-1}function X(t,{cols:n,envClasses:r,autoTag:i,singleRow:a,emptySingleRow:o,maxNumCols:s,leqno:c,arraystretch:l,arraycolsep:u},d){t.gullet.beginGroup(),a||t.gullet.macros.set(`\\cr`,`\\\\\\relax`),t.gullet.beginGroup();let f=[],p=[f],m=[],h=[],g=[],_=i==null?void 0:[];function ee(){i&&t.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function v(){_&&(t.gullet.macros.get(`\\df@tag`)?(_.push(t.subparse([new G(`\\df@tag`)])),t.gullet.macros.set(`\\df@tag`,void 0,!0)):_.push(!!i&&t.gullet.macros.get(`\\@eqnsw`)===`1`))}for(ee(),g.push(Gt(t));;){let n=t.parseExpression(!1,a?`\\end`:`\\\\`);t.gullet.endGroup(),t.gullet.beginGroup(),n={type:`ordgroup`,mode:t.mode,body:n,semisimple:!0},f.push(n);let i=t.fetch().text;if(i===`&`){if(s&&f.length===s)if(r.includes(`array`)){if(t.settings.strict)throw new e(`Too few columns specified in the {array} column argument.`,t.nextToken)}else if(s===2)throw new e(`The split environment accepts no more than two columns`,t.nextToken);else throw new e(`The equation environment accepts only one column`,t.nextToken);t.consume()}else if(i===`\\end`){v(),f.length===1&&n.body.length===0&&(p.length>1||!o)&&p.pop(),h.push(Yt(n.body)),g.length<p.length+1&&g.push([]);break}else if(i===`\\\\`){t.consume();let e;t.gullet.future().text!==` `&&(e=t.parseSizeGroup(!0)),m.push(e?e.value:null),v(),h.push(Yt(n.body)),g.push(Gt(t)),f=[],p.push(f),ee()}else throw new e(`Expected & or \\\\ or \\cr or \\end`,t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:`array`,mode:t.mode,body:p,cols:n,rowGaps:m,hLinesBeforeRow:g,envClasses:r,autoTag:i,scriptLevel:d,tags:_,labels:h,leqno:c,arraystretch:l,arraycolsep:u}}function Zt(e){return e.slice(0,1)===`d`?`display`:`text`}var Qt={c:`center `,l:`left `,r:`right `},$t=e=>{let t=new b.MathNode(`mtd`,[]);return t.style={padding:`0`,width:`50%`},e.envClasses.includes(`multline`)&&(t.style.width=`7.5%`),t},Z=function(e,t){let n=[],r=e.body.length,i=e.hLinesBeforeRow;for(let a=0;a<r;a++){let o=e.body[a],s=[],c=e.scriptLevel===`text`?K.TEXT:e.scriptLevel===`script`?K.SCRIPT:K.DISPLAY;for(let n=0;n<o.length;n++){let i=new b.MathNode(`mtd`,[z(o[n],t.withLevel(c))]);if(e.envClasses.includes(`multline`)){let e=a===0?`left`:a===r-1?`right`:`center`;i.setAttribute(`columnalign`,e),e!==`center`&&i.classes.push(`tml-`+e)}s.push(i)}let l=e.body[0].length;for(let e=0;e<l-o.length;e++)s.push(new b.MathNode(`mtd`,[],t));if(e.autoTag){let n=e.tags[a],r;n===!0?r=new b.MathNode(`mtext`,[new ie([`tml-eqn`])]):n===!1?r=new b.MathNode(`mtext`,[],[]):(r=R(n[0].body,t.withLevel(c),!0),r=Oe(r),r.classes=[`tml-tag`]),r&&(s.unshift($t(e)),s.push($t(e)),e.leqno?(s[0].children.push(r),s[0].classes.push(`tml-left`)):(s[s.length-1].children.push(r),s[s.length-1].classes.push(`tml-right`)))}let u=new b.MathNode(`mtr`,s,[]),d=e.labels.shift();d&&e.tags&&e.tags[a]&&(u.setAttribute(`id`,d),Array.isArray(e.tags[a])&&u.classes.push(`tml-tageqn`)),a===0&&i[0].length>0&&(i[0].length===2?u.children.forEach(e=>{e.style.borderTop=`0.15em double`}):u.children.forEach(e=>{e.style.borderTop=i[0][0]?`0.06em dashed`:`0.06em solid`})),i[a+1].length>0&&(i[a+1].length===2?u.children.forEach(e=>{e.style.borderBottom=`0.15em double`}):u.children.forEach(e=>{e.style.borderBottom=i[a+1][0]?`0.06em dashed`:`0.06em solid`})),n.push(u)}if(e.envClasses.length>0){if(e.arraystretch&&e.arraystretch!==1){let t=String(1.4*e.arraystretch-.8)+`ex`;for(let e=0;e<n.length;e++)for(let r=0;r<n[e].children.length;r++)n[e].children[r].style.paddingTop=t,n[e].children[r].style.paddingBottom=t}let r=e.envClasses.includes(`abut`)||e.envClasses.includes(`cases`)?`0`:e.envClasses.includes(`small`)?`0.1389`:e.envClasses.includes(`cd`)?`0.25`:`0.4`,i=`em`;if(e.arraycolsep){let n=B(e.arraycolsep,t);r=n.number.toFixed(4),i=n.unit}let a=n.length===0?0:n[0].children.length,o=(t,n)=>t===0&&n===0||t===a-1&&n===1?`0`:e.envClasses[0]===`align`?n===1?`0`:e.autoTag?t%2?`1`:`0`:t%2?`0`:`1`:r;for(let e=0;e<n.length;e++)for(let t=0;t<n[e].children.length;t++)n[e].children[t].style.paddingLeft=`${o(t,0)}${i}`,n[e].children[t].style.paddingRight=`${o(t,1)}${i}`;let s=e.envClasses.includes(`align`)||e.envClasses.includes(`alignat`);for(let t=0;t<n.length;t++){let r=n[t];if(s){for(let e=0;e<r.children.length;e++)r.children[e].classes=[`tml-`+(e%2?`left`:`right`)];if(e.autoTag){let t=e.leqno?0:r.children.length-1;r.children[t].classes=[`tml-`+(e.leqno?`left`:`right`)]}}if(r.children.length>1&&e.envClasses.includes(`cases`)&&(r.children[1].style.paddingLeft=`1em`),e.envClasses.includes(`cases`)||e.envClasses.includes(`subarray`))for(let e of r.children)e.classes.push(`tml-left`)}}else for(let e=0;e<n.length;e++)n[e].children[0].style.paddingLeft=`0em`,n[e].children.length===n[0].children.length&&(n[e].children[n[e].children.length-1].style.paddingRight=`0em`);let a=new b.MathNode(`mtable`,n);e.envClasses.length>0&&(e.envClasses.includes(`jot`)?a.classes.push(`tml-jot`):e.envClasses.includes(`small`)&&a.classes.push(`tml-small`)),e.scriptLevel===`display`&&a.setAttribute(`displaystyle`,`true`),(e.autoTag||e.envClasses.includes(`multline`))&&(a.style.width=`100%`);let o=``;if(e.cols&&e.cols.length>0){let t=e.cols,n=!1,r=0,i=t.length;for(;t[r].type===`separator`;)r+=1;for(;t[i-1].type===`separator`;)--i;if(t[0].type===`separator`){let e=t[1].type===`separator`?`0.15em double`:t[0].separator===`|`?`0.06em solid `:`0.06em dashed `;for(let t of a.children)t.children[0].style.borderLeft=e}let s=e.autoTag?0:-1;for(let e=r;e<i;e++)if(t[e].type===`align`){let r=Qt[t[e].align];o+=r,s+=1;for(let e of a.children)r.trim()!==`center`&&s<e.children.length&&(e.children[s].classes=[`tml-`+r.trim()]);n=!0}else if(t[e].type===`separator`){if(n){let n=t[e+1].type===`separator`?`0.15em double`:t[e].separator===`|`?`0.06em solid`:`0.06em dashed`;for(let e of a.children)s<e.children.length&&(e.children[s].style.borderRight=n)}n=!1}if(t[t.length-1].type===`separator`){let e=t[t.length-2].type===`separator`?`0.15em double`:t[t.length-1].separator===`|`?`0.06em solid`:`0.06em dashed`;for(let t of a.children)t.children[t.children.length-1].style.borderRight=e,t.children[t.children.length-1].style.paddingRight=`0.4em`}}return e.autoTag&&(o=`left `+(o.length>0?o:`center `)+`right `),o&&a.setAttribute(`columnalign`,o.trim()),e.envClasses.includes(`small`)&&(a=new b.MathNode(`mstyle`,[a]),a.setAttribute(`scriptlevel`,`1`)),a},en=function(t,n){t.envName.indexOf(`ed`)===-1&&Kt(t);let r=t.envName===`split`,i=[],a=X(t.parser,{cols:i,emptySingleRow:!0,autoTag:r?void 0:Xt(t.envName),envClasses:[`abut`,`jot`],maxNumCols:t.envName===`split`?2:void 0,leqno:t.parser.settings.leqno},`display`),o,s=0,c=t.envName.indexOf(`at`)>-1;if(n[0]&&c){let t=``;for(let e=0;e<n[0].body.length;e++){let r=H(n[0].body[e],`textord`);t+=r.text}if(isNaN(t))throw new e(`The alignat enviroment requires a numeric first argument.`);o=Number(t),s=o*2}a.body.forEach(function(t){if(c){let n=t.length/2;if(o<n)throw new e(`Too many math in a row: expected ${o}, but got ${n}`,t[0])}else s<t.length&&(s=t.length)});for(let e=0;e<s;++e){let t=`r`;e%2==1&&(t=`l`),i[e]={type:`align`,align:t}}return t.envName===`split`||(c?a.envClasses.push(`alignat`):a.envClasses[0]=`align`),a};U({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(t,n){let r=(tt(n[0])?[n[0]]:H(n[0],`ordgroup`).body).map(function(t){let n=et(t).text;if(`lcr`.indexOf(n)!==-1)return{type:`align`,align:n};if(n===`|`)return{type:`separator`,separator:`|`};if(n===`:`)return{type:`separator`,separator:`:`};throw new e(`Unknown column alignment: `+n,t)}),[i,a]=Jt(t.parser.gullet.macros),o={cols:r,envClasses:[`array`],maxNumCols:r.length,arraystretch:i,arraycolsep:a};return X(t.parser,o,Zt(t.envName))},mathmlBuilder:Z}),U({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(t){let n={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[t.envName.replace(`*`,``)],r=`c`,i={envClasses:[],cols:[]};if(t.envName.charAt(t.envName.length-1)===`*`){let n=t.parser;if(n.consumeSpaces(),n.fetch().text===`[`){if(n.consume(),n.consumeSpaces(),r=n.fetch().text,`lcr`.indexOf(r)===-1)throw new e(`Expected l or c or r`,n.nextToken);n.consume(),n.consumeSpaces(),n.expect(`]`),n.consume(),i.cols=[]}}let a=X(t.parser,i,`text`);a.cols=Array(a.body[0].length).fill({type:`align`,align:r});let[o,s]=Jt(t.parser.gullet.macros);return n?{type:`leftright`,mode:t.mode,body:[a],left:n[0],right:n[1],rightColor:void 0,arraystretch:o,arraycolsep:s}:a},mathmlBuilder:Z}),U({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){let t=X(e.parser,{type:`small`},`script`);return t.envClasses=[`small`],t},mathmlBuilder:Z}),U({type:`array`,names:[`subarray`],props:{numArgs:1},handler(t,n){let r=(tt(n[0])?[n[0]]:H(n[0],`ordgroup`).body).map(function(t){let n=et(t).text;if(`lc`.indexOf(n)!==-1)return{type:`align`,align:n};throw new e(`Unknown column alignment: `+n,t)});if(r.length>1)throw new e(`{subarray} can contain only one column`);let i={cols:r,envClasses:[`small`]};if(i=X(t.parser,i,`script`),i.body.length>0&&i.body[0].length>1)throw new e(`{subarray} can contain only one column`);return i},mathmlBuilder:Z}),U({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){let t=X(e.parser,{cols:[],envClasses:[`cases`]},Zt(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}},mathmlBuilder:Z}),U({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:en,mathmlBuilder:Z}),U({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:en,mathmlBuilder:Z}),U({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){e.envName!==`gathered`&&Kt(e);let t={cols:[],envClasses:[`abut`,`jot`],autoTag:Xt(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return X(e.parser,t,`display`)},mathmlBuilder:Z}),U({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){Kt(e);let t={autoTag:Xt(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,envClasses:[`align`],leqno:e.parser.settings.leqno};return X(e.parser,t,`display`)},mathmlBuilder:Z}),U({type:`array`,names:[`multline`,`multline*`],props:{numArgs:0},handler(e){Kt(e);let t={autoTag:e.envName===`multline`,maxNumCols:1,envClasses:[`jot`,`multline`],leqno:e.parser.settings.leqno};return X(e.parser,t,`display`)},mathmlBuilder:Z}),U({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return Kt(e),st(e.parser)},mathmlBuilder:Z}),m({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,n){throw new e(`${t.funcName} valid only within array environment`)}});var tn=Mt;m({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler({parser:t,funcName:n},r){let i=r[0];if(i.type!==`ordgroup`)throw new e(`Invalid environment name`,i);let a=``;for(let e=0;e<i.body.length;++e)a+=H(i.body[e],`textord`).text;if(n===`\\begin`){if(!Object.prototype.hasOwnProperty.call(tn,a))throw new e(`No such environment: `+a,i);let n=tn[a],{args:r,optArgs:o}=t.parseArguments(`\\begin{`+a+`}`,n),s={mode:t.mode,envName:a,parser:t},c=n.handler(s,r,o);t.expect(`\\end`,!1);let l=t.nextToken,u=H(t.parseFunction(),`environment`);if(u.name!==a)throw new e(`Mismatch: \\begin{${a}} matched by \\end{${u.name}}`,l);return c}return{type:`environment`,mode:t.mode,name:a,nameGroup:i}}}),m({type:`envTag`,names:[`\\env@tag`],props:{numArgs:1,argTypes:[`math`]},handler({parser:e},t){return{type:`envTag`,mode:e.mode,body:t[0]}},mathmlBuilder(e,t){return new b.MathNode(`mrow`)}}),m({type:`noTag`,names:[`\\env@notag`],props:{numArgs:0},handler({parser:e}){return{type:`noTag`,mode:e.mode}},mathmlBuilder(e,t){return new b.MathNode(`mrow`)}});var nn=(e,t)=>{if(t!==`mathrm`||e.body.type!==`ordgroup`||e.body.body.length===1||e.body.body[0].type!==`mathord`)return!1;for(let t=1;t<e.body.body.length;t++){let n=e.body.body[t].type;if(!(n===`mathord`||n===`textord`&&!isNaN(e.body.body[t].text)))return!1}return!0},rn=(e,t)=>{let n=e.font,r=t.withFont(n),i=z(e.body,r);if(i.children.length===0)return i;if(n===`boldsymbol`&&[`mo`,`mpadded`,`mrow`].includes(i.type))return i.style.fontWeight=`bold`,i;if(nn(e,n)){let e=i.children[0].children[0];delete e.attributes.mathvariant;for(let t=1;t<i.children.length;t++)e.children[0].text+=i.children[t].type===`mn`?i.children[t].children[0].text:i.children[t].children[0].children[0].text;let t=new b.MathNode(`mtext`,new b.TextNode(``));return new b.MathNode(`mrow`,[t,e])}let a=i.children[0].type===`mo`;for(let e=1;e<i.children.length;e++)i.children[e].type===`mo`&&n===`boldsymbol`&&(i.children[e].style.fontWeight=`bold`),i.children[e].type!==`mi`&&(a=!1),(i.children[e].attributes&&i.children[e].attributes.mathvariant||``)!==`normal`&&(a=!1);if(!a)return i;let o=i.children[0];for(let e=1;e<i.children.length;e++)o.children.push(i.children[e].children[0]);if(o.attributes.mathvariant&&o.attributes.mathvariant===`normal`){let e=new b.MathNode(`mtext`,new b.TextNode(``));return new b.MathNode(`mrow`,[e,o])}return o},an={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`,"\\bm":`\\boldsymbol`};m({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\up@greek`,`\\boldsymbol`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathsfit`,`\\mathtt`,`\\Bbb`,`\\bm`,`\\bold`,`\\frak`],props:{numArgs:1,allowedInArgument:!0},handler:({parser:e,funcName:t},n)=>{let r=g(n[0]),i=t;return i in an&&(i=an[i]),{type:`font`,mode:e.mode,font:i.slice(1),body:r}},mathmlBuilder:rn}),m({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:({parser:e,funcName:t,breakOnTokenText:n},r)=>{let{mode:i}=e,a=e.parseExpression(!0,n,!0);return{type:`font`,mode:i,font:`math${t.slice(1)}`,body:{type:`ordgroup`,mode:e.mode,body:a}}},mathmlBuilder:rn});var on=[`display`,`text`,`script`,`scriptscript`],sn={auto:-1,display:0,text:0,script:1,scriptscript:2},cn=(e,t)=>{let n=e.scriptLevel===`auto`?t.incrementLevel():e.scriptLevel===`display`?t.withLevel(K.TEXT):e.scriptLevel===`text`?t.withLevel(K.SCRIPT):t.withLevel(K.SCRIPTSCRIPT),r=z(e.numer,n),i=z(e.denom,n);t.level===3&&(r.style.mathDepth=`2`,r.setAttribute(`scriptlevel`,`2`),i.style.mathDepth=`2`,i.setAttribute(`scriptlevel`,`2`));let a=new b.MathNode(`mfrac`,[r,i]);if(!e.hasBarLine)a.setAttribute(`linethickness`,`0px`);else if(e.barSize){let n=B(e.barSize,t);a.setAttribute(`linethickness`,n.number+n.unit)}if(e.leftDelim!=null||e.rightDelim!=null){let t=[];if(e.leftDelim!=null){let n=new b.MathNode(`mo`,[new b.TextNode(e.leftDelim.replace(`\\`,``))]);n.setAttribute(`fence`,`true`),t.push(n)}if(t.push(a),e.rightDelim!=null){let n=new b.MathNode(`mo`,[new b.TextNode(e.rightDelim.replace(`\\`,``))]);n.setAttribute(`fence`,`true`),t.push(n)}a=ke(t)}return e.scriptLevel!==`auto`&&(a=new b.MathNode(`mstyle`,[a]),a.setAttribute(`displaystyle`,String(e.scriptLevel===`display`)),a.setAttribute(`scriptlevel`,sn[e.scriptLevel])),a};m({type:`genfrac`,names:[`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],props:{numArgs:2,allowedInArgument:!0},handler:({parser:e,funcName:t},n)=>{let r=n[0],i=n[1],a=!1,o=null,s=null,c=`auto`;switch(t){case`\\dfrac`:case`\\frac`:case`\\tfrac`:a=!0;break;case`\\\\atopfrac`:a=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=`(`,s=`)`;break;case`\\\\bracefrac`:o=`\\{`,s=`\\}`;break;case`\\\\brackfrac`:o=`[`,s=`]`;break;default:throw Error(`Unrecognized genfrac command`)}switch(t){case`\\dfrac`:case`\\dbinom`:c=`display`;break;case`\\tfrac`:case`\\tbinom`:c=`text`;break}return{type:`genfrac`,mode:e.mode,continued:!1,numer:r,denom:i,hasBarLine:a,leftDelim:o,rightDelim:s,scriptLevel:c,barSize:null}},mathmlBuilder:cn}),m({type:`genfrac`,names:[`\\cfrac`],props:{numArgs:2},handler:({parser:e,funcName:t},n)=>{let r=n[0],i=n[1];return{type:`genfrac`,mode:e.mode,continued:!0,numer:r,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,scriptLevel:`display`,barSize:null}}}),m({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler({parser:e,funcName:t,token:n}){let r;switch(t){case`\\over`:r=`\\frac`;break;case`\\choose`:r=`\\binom`;break;case`\\atop`:r=`\\\\atopfrac`;break;case`\\brace`:r=`\\\\bracefrac`;break;case`\\brack`:r=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:e.mode,replaceWith:r,token:n}}});var ln=function(e){let t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};m({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler({parser:e},t){let n=t[4],r=t[5],i=g(t[0]),a=i.type===`atom`&&i.family===`open`?ln(i.text):null,o=g(t[1]),s=o.type===`atom`&&o.family===`close`?ln(o.text):null,c=H(t[2],`size`),l,u=null;c.isBlank?l=!0:(u=c.value,l=u.number>0);let d=`auto`,f=t[3];if(f.type===`ordgroup`){if(f.body.length>0){let e=H(f.body[0],`textord`);d=on[Number(e.text)]}}else f=H(f,`textord`),d=on[Number(f.text)];return{type:`genfrac`,mode:e.mode,numer:n,denom:r,continued:!1,hasBarLine:l,barSize:u,leftDelim:a,rightDelim:s,scriptLevel:d}},mathmlBuilder:cn}),m({type:`infix`,names:[`\\above`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler({parser:e,funcName:t,token:n},r){return{type:`infix`,mode:e.mode,replaceWith:`\\\\abovefrac`,barSize:H(r[0],`size`).value,token:n}}}),m({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:({parser:e,funcName:t},n)=>{let r=n[0],i=l(H(n[1],`infix`).barSize),a=n[2],o=i.number>0;return{type:`genfrac`,mode:e.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null,scriptLevel:`auto`}},mathmlBuilder:cn}),m({type:`hbox`,names:[`\\hbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInArgument:!0,allowedInText:!1},handler({parser:e},t){return{type:`hbox`,mode:e.mode,body:_(t[0])}},mathmlBuilder(e,t){let n=t.withLevel(K.TEXT);return Oe(R(e.body,n))}}),m({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`],props:{numArgs:1},handler({parser:e,funcName:t},n){return{type:`horizBrace`,mode:e.mode,label:t,isOver:/^\\over/.test(t),base:n[0]}},mathmlBuilder:(e,t)=>{let n=he.mathMLnode(e.label);return n.style[`math-depth`]=0,new b.MathNode(e.isOver?`mover`:`munder`,[z(e.base,t),n])}}),m({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:({parser:t,token:n},r)=>{let i=r[1],a=H(r[0],`url`).url;if(!t.settings.isTrusted({command:`\\href`,url:a}))throw new e(`Function "\\href" is not trusted`,n);return{type:`href`,mode:t.mode,href:a,body:_(i)}},mathmlBuilder:(e,t)=>{let n=new y(`math`,[R(e.body,t)]);return new oe(e.href,[],[n])}}),m({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:({parser:t,token:n},r)=>{let i=H(r[0],`url`).url;if(!t.settings.isTrusted({command:`\\url`,url:i}))throw new e(`Function "\\url" is not trusted`,n);let a=[];for(let e=0;e<i.length;e++){let t=i[e];t===`~`&&(t=`\\textasciitilde`),a.push({type:`textord`,mode:`text`,text:t})}let o={type:`text`,mode:t.mode,font:`\\texttt`,body:a};return{type:`href`,mode:t.mode,href:i,body:_(o)}}}),m({type:`html`,names:[`\\class`,`\\id`,`\\style`,`\\data`],props:{numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0},handler:({parser:t,funcName:n,token:r},i)=>{let a=H(i[0],`raw`).string,o=i[1];if(t.settings.strict)throw new e(`Function "${n}" is disabled in strict mode`,r);let s,c={};switch(n){case`\\class`:c.class=a,s={command:`\\class`,class:a};break;case`\\id`:c.id=a,s={command:`\\id`,id:a};break;case`\\style`:c.style=a,s={command:`\\style`,style:a};break;case`\\data`:{let t=a.split(`,`);for(let n=0;n<t.length;n++){let r=t[n].split(`=`);if(r.length!==2)throw new e(`Error parsing key-value for \\data`);c[`data-`+r[0].trim()]=r[1].trim()}s={command:`\\data`,attributes:c};break}default:throw Error(`Unrecognized html command`)}if(!t.settings.isTrusted(s))throw new e(`Function "${n}" is not trusted`,r);return{type:`html`,mode:t.mode,attributes:c,body:_(o)}},mathmlBuilder:(e,t)=>{let n=R(e.body,t),r=[];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/)),n.classes=r;for(let t in e.attributes)t!==`class`&&Object.prototype.hasOwnProperty.call(e.attributes,t)&&n.setAttribute(t,e.attributes[t]);return n}});var un=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:`bp`};{let n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new e(`Invalid size: '`+t+`' in \\includegraphics`);let r={number:+(n[1]+n[2]),unit:n[3]};if(!Je(r))throw new e(`Invalid unit: '`+r.unit+`' in \\includegraphics.`);return r}};m({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:({parser:t,token:n},r,i)=>{let a={number:0,unit:`em`},o={number:.9,unit:`em`},s={number:0,unit:`em`},c=``;if(i[0]){let t=H(i[0],`raw`).string.split(`,`);for(let n=0;n<t.length;n++){let r=t[n].split(`=`);if(r.length===2){let t=r[1].trim();switch(r[0].trim()){case`alt`:c=t;break;case`width`:a=un(t);break;case`height`:o=un(t);break;case`totalheight`:s=un(t);break;default:throw new e(`Invalid key: '`+r[0]+`' in \\includegraphics.`)}}}}let l=H(r[0],`url`).url;if(c===``&&(c=l,c=c.replace(/^.*[\\/]/,``),c=c.substring(0,c.lastIndexOf(`.`))),!t.settings.isTrusted({command:`\\includegraphics`,url:l}))throw new e(`Function "\\includegraphics" is not trusted`,n);return{type:`includegraphics`,mode:t.mode,alt:c,width:a,height:o,totalheight:s,src:l}},mathmlBuilder:(e,t)=>{let n=B(e.height,t),r={number:0,unit:`em`};e.totalheight.number>0&&e.totalheight.unit===n.unit&&e.totalheight.number>n.number&&(r.number=e.totalheight.number-n.number,r.unit=n.unit);let i=0;e.width.number>0&&(i=B(e.width,t));let a={height:n.number+r.number+`em`};i.number>0&&(a.width=i.number+i.unit),r.number>0&&(a.verticalAlign=-r.number+r.unit);let o=new se(e.src,e.alt,a);return o.height=n,o.depth=r,new b.MathNode(`mtext`,[o])}}),m({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler({parser:t,funcName:n,token:r},i){let a=H(i[0],`size`);if(t.settings.strict){let i=n[1]===`m`,o=a.value.unit===`mu`;if(i){if(!o)throw new e(`LaTeX's ${n} supports only mu units, not ${a.value.unit} units`,r);if(t.mode!==`math`)throw new e(`LaTeX's ${n} works only in math mode`,r)}else if(o)throw new e(`LaTeX's ${n} doesn't support mu units`,r)}return{type:`kern`,mode:t.mode,dimension:a.value}},mathmlBuilder(e,t){let n=B(e.dimension,t),r=n.unit===`em`?dn(n.number):``;if(e.mode===`text`&&r.length>0){let e=new b.TextNode(r);return new b.MathNode(`mtext`,[e])}else{let e=new b.MathNode(`mspace`);return e.setAttribute(`width`,n.number+n.unit),n.number<0&&(e.style.marginLeft=n.number+n.unit),e}}});var dn=function(e){return e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?` `:``},fn=/[^A-Za-z_0-9-]/g;m({type:`label`,names:[`\\label`],props:{numArgs:1,argTypes:[`raw`]},handler({parser:e},t){return{type:`label`,mode:e.mode,string:t[0].string.replace(fn,``)}},mathmlBuilder(e,t){let n=new b.MathNode(`mrow`,[],[`tml-label`]);return e.string.length>0&&n.setLabel(e.string),n}});var pn=[`\\clap`,`\\llap`,`\\rlap`];m({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`,`\\clap`,`\\llap`,`\\rlap`],props:{numArgs:1,allowedInText:!0},handler:({parser:t,funcName:n,token:r},i)=>{if(pn.includes(n)){if(t.settings.strict&&t.mode!==`text`)throw new e(`{${n}} can be used only in text mode.
|
|
88
|
+
Try \\math${n.slice(1)}`,r);n=n.slice(1)}else n=n.slice(5);let a=i[0];return{type:`lap`,mode:t.mode,alignment:n,body:a}},mathmlBuilder:(e,t)=>{let n;if(e.alignment===`llap`){let r=L(_(e.body),t),i=new b.MathNode(`mphantom`,r);n=new b.MathNode(`mpadded`,[i]),n.setAttribute(`width`,`0px`)}let r=z(e.body,t),i;if(e.alignment===`llap`?(r.style.position=`absolute`,r.style.right=`0`,r.style.bottom=`0`,i=new b.MathNode(`mpadded`,[n,r])):i=new b.MathNode(`mpadded`,[r]),e.alignment===`rlap`)e.body.body.length>0&&e.body.body[0].type===`genfrac`&&i.setAttribute(`lspace`,`0.16667em`);else{let t=e.alignment===`llap`?`-1`:`-0.5`;i.setAttribute(`lspace`,t+`width`),e.alignment===`llap`?i.style.position=`relative`:(i.style.display=`flex`,i.style.justifyContent=`center`)}return i.setAttribute(`width`,`0px`),i}}),m({type:`ordgroup`,names:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler({funcName:e,parser:t},n){let r=t.mode;t.switchMode(`math`);let i=e===`\\(`?`\\)`:`$`,a=t.parseExpression(!1,i);return t.expect(i),t.switchMode(r),{type:`ordgroup`,mode:t.mode,body:a}}}),m({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,n){throw new e(`Mismatched ${t.funcName}`,n)}});var mn=(e,t)=>{switch(t.level){case K.DISPLAY:return e.display;case K.TEXT:return e.text;case K.SCRIPT:return e.script;case K.SCRIPTSCRIPT:return e.scriptscript;default:return e.text}};m({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:({parser:e},t)=>({type:`mathchoice`,mode:e.mode,display:_(t[0]),text:_(t[1]),script:_(t[2]),scriptscript:_(t[3])}),mathmlBuilder:(e,t)=>R(mn(e,t),t)});var hn=[`text`,`textord`,`mathord`,`atom`],Q=e=>{let t=new b.MathNode(`mspace`);return t.setAttribute(`width`,e+`em`),t};function gn(e,t){let n,r=L(e.body,t);if(e.mclass===`minner`)n=new b.MathNode(`mpadded`,r);else if(e.mclass===`mord`)e.isCharacterBox||r[0].type===`mathord`?(n=r[0],n.type=`mi`,n.children.length===1&&n.children[0].text&&n.children[0].text===`∇`&&n.setAttribute(`mathvariant`,`normal`)):n=new b.MathNode(`mi`,r);else{n=new b.MathNode(`mrow`,r),e.mustPromote?(n=r[0],n.type=`mo`,e.isCharacterBox&&e.body[0].text&&/[A-Za-z]/.test(e.body[0].text)&&n.setAttribute(`mathvariant`,`italic`)):n=new b.MathNode(`mrow`,r);let i=t.level<2;n.type===`mrow`?i&&(e.mclass===`mbin`?(n.children.unshift(Q(.2222)),n.children.push(Q(.2222))):e.mclass===`mrel`?(n.children.unshift(Q(.2778)),n.children.push(Q(.2778))):e.mclass===`mpunct`?n.children.push(Q(.1667)):e.mclass===`minner`&&(n.children.unshift(Q(.0556)),n.children.push(Q(.0556)))):e.mclass===`mbin`?(n.attributes.lspace=i?`0.2222em`:`0`,n.attributes.rspace=i?`0.2222em`:`0`):e.mclass===`mrel`?(n.attributes.lspace=i?`0.2778em`:`0`,n.attributes.rspace=i?`0.2778em`:`0`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=i?`0.1667em`:`0`):e.mclass===`mopen`||e.mclass===`mclose`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`):e.mclass===`minner`&&i&&(n.attributes.lspace=`0.0556em`,n.attributes.width=`+0.1111em`),e.mclass===`mopen`||e.mclass===`mclose`||(delete n.attributes.stretchy,delete n.attributes.form)}return n}m({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler({parser:e,funcName:t},n){let r=n[0],i=u.isCharacterBox(r),a=!0,o={type:`mathord`,text:``,mode:e.mode},s=r.body?r.body:[r];for(let t of s)if(hn.includes(t.type))x[e.mode][t.text]?o.text+=x[e.mode][t.text].replace:t.text?o.text+=t.text:t.body&&t.body.map(e=>{o.text+=e.text});else{a=!1;break}return{type:`mclass`,mode:e.mode,mclass:`m`+t.slice(5),body:_(a?o:r),isCharacterBox:i,mustPromote:a}},mathmlBuilder:gn});var _n=e=>{let t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};m({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler({parser:e},t){return{type:`mclass`,mode:e.mode,mclass:_n(t[0]),body:_(t[1]),isCharacterBox:u.isCharacterBox(t[1])}}}),m({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler({parser:e,funcName:t},n){let r=n[1],i=n[0],a={type:`op`,mode:r.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,stack:!0,suppressBaseShift:t!==`\\stackrel`,body:_(r)};return{type:`supsub`,mode:i.mode,base:a,sup:t===`\\underset`?null:i,sub:t===`\\underset`?i:null}},mathmlBuilder:gn});var vn=(e,t,n)=>{if(!e)return n;let r=z(e,t);return r.type===`mrow`&&r.children.length===0?n:r};m({type:`multiscript`,names:[`\\sideset`,`\\pres@cript`],props:{numArgs:3},handler({parser:t,funcName:n,token:r},i){if(i[2].body.length===0)throw new e(n+`cannot parse an empty base.`);let a=i[2].body[0];if(t.settings.strict&&n===`\\sideset`&&!a.symbol)throw new e(`The base of \\sideset must be a big operator. Try \\prescript.`);if(i[0].body.length>0&&i[0].body[0].type!==`supsub`||i[1].body.length>0&&i[1].body[0].type!==`supsub`)throw new e(`\\sideset can parse only subscripts and superscripts in its first two arguments`,r);let o=i[0].body.length>0?i[0].body[0]:null,s=i[1].body.length>0?i[1].body[0]:null;return!o&&!s?a:o?{type:`multiscript`,mode:t.mode,isSideset:n===`\\sideset`,prescripts:o,postscripts:s,base:a}:{type:`styling`,mode:t.mode,scriptLevel:`text`,body:[{type:`supsub`,mode:t.mode,base:a,sup:s.sup,sub:s.sub}]}},mathmlBuilder(e,t){let n=z(e.base,t),r=new b.MathNode(`mprescripts`),i=new b.MathNode(`none`),a=[],o=vn(e.prescripts.sub,t,i),s=vn(e.prescripts.sup,t,i);return e.isSideset&&(o.setAttribute(`style`,`text-align: left;`),s.setAttribute(`style`,`text-align: left;`)),a=e.postscripts?[n,vn(e.postscripts.sub,t,i),vn(e.postscripts.sup,t,i),r,o,s]:[n,r,o,s],new b.MathNode(`mmultiscripts`,a)}}),m({type:`not`,names:[`\\not`],props:{numArgs:1,primitive:!0,allowedInText:!1},handler({parser:e},t){let n=u.isCharacterBox(t[0]),r;return n?(r=_(t[0]),r[0].text.charAt(0)===`\\`&&(r[0].text=x.math[r[0].text].replace),r[0].text=r[0].text.slice(0,1)+`̸`+r[0].text.slice(1)):r=[{type:`textord`,mode:`math`,text:`̸`},{type:`kern`,mode:`math`,dimension:{number:-.6,unit:`em`}},t[0]],{type:`not`,mode:e.mode,body:r,isCharacterBox:n}},mathmlBuilder(e,t){return e.isCharacterBox?L(e.body,t,!0)[0]:R(e.body,t)}});var yn=[`textord`,`mathord`,`atom`],bn=[`\\smallint`],xn=[`textord`,`mathord`,`ordgroup`,`close`,`leftright`,`font`],Sn=e=>{e.attributes.lspace=`0.1667em`,e.attributes.rspace=`0.1667em`},Cn=(e,t)=>{let n;if(e.symbol)n=new y(`mo`,[I(e.name,e.mode)]),bn.includes(e.name)?n.setAttribute(`largeop`,`false`):n.setAttribute(`movablelimits`,`false`),e.fromMathOp&&Sn(n);else if(e.body)n=new y(`mo`,L(e.body,t)),e.fromMathOp&&Sn(n);else if(n=new y(`mi`,[new le(e.name.slice(1))]),!e.parentIsSupSub){let t=new y(`mo`,[I(``,`text`)]),r=[n,t];if(e.needsLeadingSpace){let e=new y(`mspace`);e.setAttribute(`width`,`0.1667em`),r.unshift(e)}if(!e.isFollowedByDelimiter){let e=new y(`mspace`);e.setAttribute(`width`,`0.1667em`),r.push(e)}n=new y(`mrow`,r)}return n},wn={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨅":`\\bigsqcap`,"⨆":`\\bigsqcup`,"⨃":`\\bigcupdot`,"⨇":`\\bigdoublevee`,"⨈":`\\bigdoublewedge`,"⨉":`\\bigtimes`};m({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcupplus.\\bigcupdot.\\bigcap.\\bigcup.\\bigdoublevee.\\bigdoublewedge.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcap.\\bigsqcup.\\bigtimes.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),props:{numArgs:0},handler:({parser:e,funcName:t},n)=>{let r=t;return r.length===1&&(r=wn[r]),{type:`op`,mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!0,stack:!1,name:r}},mathmlBuilder:Cn}),m({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:({parser:e},t)=>{let n=t[0],r=n.body?n.body:[n],i=r.length===1&&yn.includes(r[0].type);return{type:`op`,mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:i,fromMathOp:!0,stack:!1,name:i?r[0].text:null,body:i?null:_(n)}},mathmlBuilder:Cn});var Tn={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`,"∱":`\\intclockwise`,"∲":`\\varointclockwise`,"⨌":`\\iiiint`,"⨍":`\\intbar`,"⨎":`\\intBar`,"⨏":`\\fint`,"⨒":`\\rppolint`,"⨓":`\\scpolint`,"⨕":`\\pointint`,"⨖":`\\sqint`,"⨗":`\\intlarhk`,"⨘":`\\intx`,"⨙":`\\intcap`,"⨚":`\\intcup`};m({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.\\sgn.\\tan.\\tanh.\\tg.\\th`.split(`.`),props:{numArgs:0},handler({parser:e,funcName:t}){let n=e.prevAtomType,r=e.gullet.future().text;return{type:`op`,mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,stack:!1,isFollowedByDelimiter:Tt(r),needsLeadingSpace:n.length>0&&xn.includes(n),name:t}},mathmlBuilder:Cn}),m({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],props:{numArgs:0},handler({parser:e,funcName:t}){let n=e.prevAtomType,r=e.gullet.future().text;return{type:`op`,mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,stack:!1,isFollowedByDelimiter:Tt(r),needsLeadingSpace:n.length>0&&xn.includes(n),name:t}},mathmlBuilder:Cn}),m({type:`op`,names:`\\int.\\iint.\\iiint.\\iiiint.\\oint.\\oiint.\\oiiint.\\intclockwise.\\varointclockwise.\\intbar.\\intBar.\\fint.\\rppolint.\\scpolint.\\pointint.\\sqint.\\intlarhk.\\intx.\\intcap.\\intcup.∫.∬.∭.∮.∯.∰.∱.∲.⨌.⨍.⨎.⨏.⨒.⨓.⨕.⨖.⨗.⨘.⨙.⨚`.split(`.`),props:{numArgs:0},handler({parser:e,funcName:t}){let n=t;return n.length===1&&(n=Tn[n]),{type:`op`,mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,stack:!1,name:n}},mathmlBuilder:Cn}),m({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],props:{numArgs:1,allowedInArgument:!0},handler:({parser:e,funcName:t},n)=>{let r=n[0],i=e.prevAtomType,a=e.gullet.future().text;return{type:`operatorname`,mode:e.mode,body:_(r),alwaysHandleSupSub:t===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1,isFollowedByDelimiter:Tt(a),needsLeadingSpace:i.length>0&&xn.includes(i)}},mathmlBuilder:(e,t)=>{let n=L(e.body,t.withFont(`mathrm`)),r=!0;for(let e=0;e<n.length;e++){let t=n[e];if(t instanceof b.MathNode)switch(t.type===`mrow`&&t.children.length===1&&t.children[0]instanceof b.MathNode&&(t=t.children[0]),t.type){case`mi`:case`mn`:case`ms`:case`mtext`:break;case`mspace`:if(t.attributes.width){let i=t.attributes.width.replace(`em`,``),a=dn(Number(i));a===``?r=!1:n[e]=new b.MathNode(`mtext`,[new b.TextNode(a)])}break;case`mo`:{let e=t.children[0];t.children.length===1&&e instanceof b.TextNode?e.text=e.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break}default:r=!1}else r=!1}if(r){let e=n.map(e=>e.toText()).join(``);n=[new b.TextNode(e)]}else if(n.length===1&&[`mover`,`munder`].includes(n[0].type)&&(n[0].children[0].type===`mi`||n[0].children[0].type===`mtext`)){if(n[0].children[0].type=`mi`,e.parentIsSupSub)return new b.MathNode(`mrow`,n);{let e=new b.MathNode(`mo`,[I(``,`text`)]);return b.newDocumentFragment([n[0],e])}}let i;if(r?(i=new b.MathNode(`mi`,n),n[0].text.length===1&&i.setAttribute(`mathvariant`,`normal`)):i=new b.MathNode(`mrow`,n),!e.parentIsSupSub){let t=new b.MathNode(`mo`,[I(``,`text`)]),n=[i,t];if(e.needsLeadingSpace){let e=new b.MathNode(`mspace`);e.setAttribute(`width`,`0.1667em`),n.unshift(e)}if(!e.isFollowedByDelimiter){let e=new b.MathNode(`mspace`);e.setAttribute(`width`,`0.1667em`),n.push(e)}return b.newDocumentFragment(n)}return i}}),q(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),h({type:`ordgroup`,mathmlBuilder(e,t){return R(e.body,t,e.semisimple)}}),m({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{let n=t[0];return{type:`phantom`,mode:e.mode,body:_(n)}},mathmlBuilder:(e,t)=>{let n=L(e.body,t);return new b.MathNode(`mphantom`,n)}}),m({type:`hphantom`,names:[`\\hphantom`],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{let n=t[0];return{type:`hphantom`,mode:e.mode,body:n}},mathmlBuilder:(e,t)=>{let n=L(_(e.body),t),r=new b.MathNode(`mphantom`,n),i=new b.MathNode(`mpadded`,[r]);return i.setAttribute(`height`,`0px`),i.setAttribute(`depth`,`0px`),i}}),m({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{let n=t[0];return{type:`vphantom`,mode:e.mode,body:n}},mathmlBuilder:(e,t)=>{let n=L(_(e.body),t),r=new b.MathNode(`mphantom`,n),i=new b.MathNode(`mpadded`,[r]);return i.setAttribute(`width`,`0px`),i}}),m({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler({parser:e},t){return{type:`pmb`,mode:e.mode,body:_(t[0])}},mathmlBuilder(e,t){let n=ue(L(e.body,t));return n.setAttribute(`style`,`font-weight:bold`),n}});var En=(e,t)=>{let n=t.withLevel(K.TEXT),r=new b.MathNode(`mpadded`,[z(e.body,n)]),i=B(e.dy,t);return r.setAttribute(`voffset`,i.number+i.unit),i.number>0?r.style.padding=i.number+i.unit+` 0 0 0`:r.style.padding=`0 0 `+Math.abs(i.number)+i.unit+` 0`,r};m({type:`raise`,names:[`\\raise`,`\\lower`],props:{numArgs:2,argTypes:[`size`,`primitive`],primitive:!0},handler({parser:e,funcName:t},n){let r=H(n[0],`size`).value;t===`\\lower`&&(r.number*=-1);let i=n[1];return{type:`raise`,mode:e.mode,dy:r,body:i}},mathmlBuilder:En}),m({type:`raise`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler({parser:e,funcName:t},n){let r=H(n[0],`size`).value,i=n[1];return{type:`raise`,mode:e.mode,dy:r,body:i}},mathmlBuilder:En}),m({type:`ref`,names:[`\\ref`,`\\eqref`],props:{numArgs:1,argTypes:[`raw`]},handler({parser:e,funcName:t},n){return{type:`ref`,mode:e.mode,funcName:t,string:n[0].string.replace(fn,``)}},mathmlBuilder(e,t){let n=e.funcName===`\\ref`?[`tml-ref`]:[`tml-ref`,`tml-eqref`];return new oe(`#`+e.string,n,null)}}),m({type:`reflect`,names:[`\\reflectbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler({parser:e},t){return{type:`reflect`,mode:e.mode,body:t[0]}},mathmlBuilder(e,t){let n=z(e.body,t);return n.style.transform=`scaleX(-1)`,n}}),m({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0},handler({parser:e}){return{type:`internal`,mode:e.mode}}}),m({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler({parser:e},t,n){let r=n[0],i=H(t[0],`size`),a=H(t[1],`size`);return{type:`rule`,mode:e.mode,shift:r&&H(r,`size`).value,width:i.value,height:a.value}},mathmlBuilder(e,t){let n=B(e.width,t),r=B(e.height,t),i=e.shift?B(e.shift,t):{number:0,unit:`em`},a=t.color&&t.getColor()||`black`,o=new b.MathNode(`mspace`);if(n.number>0&&r.number>0&&o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,n.number+n.unit),o.setAttribute(`height`,r.number+r.unit),i.number===0)return o;let s=new b.MathNode(`mpadded`,[o]);return i.number>=0?s.setAttribute(`height`,`+`+i.number+i.unit):(s.setAttribute(`height`,i.number+i.unit),s.setAttribute(`depth`,`+`+-i.number+i.unit)),s.setAttribute(`voffset`,i.number+i.unit),s}});var Dn={"\\tiny":.5,"\\sixptsize":.6,"\\Tiny":.6,"\\scriptsize":.7,"\\footnotesize":.8,"\\small":.9,"\\normalsize":1,"\\large":1.2,"\\Large":1.44,"\\LARGE":1.728,"\\huge":2.074,"\\Huge":2.488};m({type:`sizing`,names:[`\\tiny`,`\\sixptsize`,`\\Tiny`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`],props:{numArgs:0,allowedInText:!0},handler:({breakOnTokenText:e,funcName:t,parser:n},r)=>{n.settings.strict&&n.mode===`math`&&console.log(`Temml strict-mode warning: Command ${t} is invalid in math mode.`);let i=n.parseExpression(!1,e,!0);return{type:`sizing`,mode:n.mode,funcName:t,body:i}},mathmlBuilder:(e,t)=>{let n=t.withFontSize(Dn[e.funcName]),r=ue(L(e.body,n)),i=(Dn[e.funcName]/t.fontSize).toFixed(4);return r.setAttribute(`mathsize`,i+`em`),r}}),m({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:({parser:e},t,n)=>{let r=!1,i=!1,a=n[0]&&H(n[0],`ordgroup`);if(a){let e=``;for(let t=0;t<a.body.length;++t)if(e=a.body[t].text,e===`t`)r=!0;else if(e===`b`)i=!0;else{r=!1,i=!1;break}}else r=!0,i=!0;let o=t[0];return{type:`smash`,mode:e.mode,body:o,smashHeight:r,smashDepth:i}},mathmlBuilder:(e,t)=>{let n=new b.MathNode(`mpadded`,[z(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),m({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler({parser:e},t,n){let r=n[0],i=t[0];return{type:`sqrt`,mode:e.mode,body:i,index:r}},mathmlBuilder(e,t){let{body:n,index:r}=e;return r?new b.MathNode(`mroot`,[z(n,t),z(r,t.incrementLevel())]):new b.MathNode(`msqrt`,[z(n,t)])}});var On={display:0,text:1,script:2,scriptscript:3},kn={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]};m({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({breakOnTokenText:e,funcName:t,parser:n},r){let i=n.parseExpression(!0,e,!0),a=t.slice(1,t.length-5);return{type:`styling`,mode:n.mode,scriptLevel:a,body:i}},mathmlBuilder(e,t){let n=t.withLevel(On[e.scriptLevel]),r=ue(L(e.body,n)),i=kn[e.scriptLevel];return r.setAttribute(`scriptlevel`,i[0]),r.setAttribute(`displaystyle`,i[1]),r}});var An=/^m(over|under|underover)$/;h({type:`supsub`,mathmlBuilder(e,t){let n=!1,r,i,a=!1,o=!1,s=!1;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&!e.base.stack&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0,a=!e.base.symbol,o=a&&!e.isFollowedByDelimiter,s=e.base.needsLeadingSpace);let c=e.base&&e.base.stack?[z(e.base.body[0],t)]:[z(e.base,t)],l=t.inSubOrSup();if(e.sub){let n=z(e.sub,l);t.level===3&&n.setAttribute(`scriptlevel`,`2`),c.push(n)}if(e.sup){let n=z(e.sup,l);t.level===3&&n.setAttribute(`scriptlevel`,`2`);let r=n.type===`mrow`?n.children[0]:n;r&&r.type===`mo`&&r.classes.includes(`tml-prime`)&&e.base&&e.base.text&&`fF`.indexOf(e.base.text)>-1&&r.classes.push(`prime-pad`),c.push(n)}let u;if(n)u=r?`mover`:`munder`;else if(!e.sub){let n=e.base;u=n&&n.type===`op`&&n.limits&&(t.level===K.DISPLAY||n.alwaysHandleSupSub)||n&&n.type===`operatorname`&&n.alwaysHandleSupSub&&(n.limits||t.level===K.DISPLAY)?`mover`:`msup`}else if(e.sup){let n=e.base;u=n&&(n.type===`op`&&n.limits||n.type===`multiscript`)&&(t.level===K.DISPLAY||n.alwaysHandleSupSub)||n&&n.type===`operatorname`&&n.alwaysHandleSupSub&&(t.level===K.DISPLAY||n.limits)?`munderover`:`msubsup`}else{let n=e.base;u=n&&n.type===`op`&&n.limits&&(t.level===K.DISPLAY||n.alwaysHandleSupSub)||n&&n.type===`operatorname`&&n.alwaysHandleSupSub&&(n.limits||t.level===K.DISPLAY)?`munder`:`msub`}let d=new b.MathNode(u,c);if(a){let e=new b.MathNode(`mo`,[I(``,`text`)]);if(s){let t=new b.MathNode(`mspace`);t.setAttribute(`width`,`0.1667em`),d=b.newDocumentFragment([t,d,e])}else d=b.newDocumentFragment([d,e]);if(o){let e=new b.MathNode(`mspace`);e.setAttribute(`width`,`0.1667em`),d.children.push(e)}}else An.test(u)&&(d=new b.MathNode(`mrow`,[d]));return d}});var jn=[`\\shortmid`,`\\nshortmid`,`\\shortparallel`,`\\nshortparallel`,`\\smallsetminus`],Mn=[`\\Rsh`,`\\Lsh`,`\\restriction`],Nn=e=>{if(e.length===1){let t=e.codePointAt(0);return 8591<t&&t<8704}return e.indexOf(`arrow`)>-1||e.indexOf(`harpoon`)>-1||Mn.includes(e)};h({type:`atom`,mathmlBuilder(e,t){let n=new b.MathNode(`mo`,[I(e.text,e.mode)]);return e.family===`punct`?n.setAttribute(`separator`,`true`):e.family===`open`||e.family===`close`?e.family===`open`?(n.setAttribute(`form`,`prefix`),n.setAttribute(`stretchy`,`false`)):e.family===`close`&&(n.setAttribute(`form`,`postfix`),n.setAttribute(`stretchy`,`false`)):e.text===`\\mid`?(n.setAttribute(`lspace`,`0.22em`),n.setAttribute(`rspace`,`0.22em`),n.setAttribute(`stretchy`,`false`)):e.family===`rel`&&Nn(e.text)?n.setAttribute(`stretchy`,`false`):jn.includes(e.text)?n.setAttribute(`mathsize`,`70%`):e.text===`:`&&(n.attributes.lspace=`0.2222em`,n.attributes.rspace=`0.2222em`),n}});var Pn={mathbf:`bold`,mathrm:`normal`,textit:`italic`,mathit:`italic`,mathnormal:`italic`,mathbb:`double-struck`,mathcal:`script`,mathfrak:`fraktur`,mathscr:`script`,mathsf:`sans-serif`,mathtt:`monospace`},Fn=function(e,t){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsc`)return`normal`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`sans-serif-bold`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`;let n=t.font;if(!n||n===`mathnormal`)return null;let r=e.mode;switch(n){case`mathit`:return`italic`;case`mathrm`:{let t=e.text.codePointAt(0);return 939<t&&t<975?`italic`:`normal`}case`greekItalic`:return`italic`;case`up@greek`:return`normal`;case`boldsymbol`:case`mathboldsymbol`:return`bold-italic`;case`mathbf`:return`bold`;case`mathbb`:return`double-struck`;case`mathfrak`:return`fraktur`;case`mathscr`:case`mathcal`:return`script`;case`mathsf`:return`sans-serif`;case`mathsfit`:return`sans-serif-italic`;case`mathtt`:return`monospace`}let i=e.text;return x[r][i]&&x[r][i].replace&&(i=x[r][i].replace),Object.prototype.hasOwnProperty.call(Pn,n)?Pn[n]:null},In=Object.freeze({B:8426,E:8427,F:8427,H:8387,I:8391,L:8390,M:8422,R:8393,e:8394,g:8355,o:8389}),Ln=Object.freeze({C:8426,H:8388,I:8392,R:8394,Z:8398}),Rn=Object.freeze({C:8383,H:8389,N:8391,P:8393,Q:8393,R:8395,Z:8394}),zn=Object.freeze({ϵ:119527,ϑ:119564,ϰ:119534,φ:119577,ϱ:119535,ϖ:119563}),Bn=Object.freeze({ϵ:119643,ϑ:119680,ϰ:119650,φ:119693,ϱ:119651,ϖ:119679}),Vn=Object.freeze({ϵ:119701,ϑ:119738,ϰ:119708,φ:119751,ϱ:119709,ϖ:119737}),Hn=Object.freeze({ϵ:119759,ϑ:119796,ϰ:119766,φ:119809,ϱ:119767,ϖ:119795}),Un=Object.freeze({upperCaseLatin:{normal:e=>0,bold:e=>119743,italic:e=>119795,"bold-italic":e=>119847,script:e=>In[e]||119899,"script-bold":e=>119951,fraktur:e=>Ln[e]||120003,"fraktur-bold":e=>120107,"double-struck":e=>Rn[e]||120055,"sans-serif":e=>120159,"sans-serif-bold":e=>120211,"sans-serif-italic":e=>120263,"sans-serif-bold-italic":e=>120380,monospace:e=>120367},lowerCaseLatin:{normal:e=>0,bold:e=>119737,italic:e=>e===`h`?8358:119789,"bold-italic":e=>119841,script:e=>In[e]||119893,"script-bold":e=>119945,fraktur:e=>119997,"fraktur-bold":e=>120101,"double-struck":e=>120049,"sans-serif":e=>120153,"sans-serif-bold":e=>120205,"sans-serif-italic":e=>120257,"sans-serif-bold-italic":e=>120309,monospace:e=>120361},upperCaseGreek:{normal:e=>0,bold:e=>119575,italic:e=>119633,"bold-italic":e=>119575,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>119749,"sans-serif-bold":e=>119749,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>119807,monospace:e=>0},lowerCaseGreek:{normal:e=>0,bold:e=>119569,italic:e=>119627,"bold-italic":e=>e===`ϕ`?119678:119685,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>119743,"sans-serif-bold":e=>119743,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>119801,monospace:e=>0},varGreek:{normal:e=>0,bold:e=>zn[e]||-51,italic:e=>0,"bold-italic":e=>Bn[e]||58,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>Vn[e]||116,"sans-serif-bold":e=>Vn[e]||116,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>Hn[e]||174,monospace:e=>0},numeral:{normal:e=>0,bold:e=>120734,italic:e=>0,"bold-italic":e=>0,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>120744,"sans-serif":e=>120754,"sans-serif-bold":e=>120764,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>0,monospace:e=>120774}}),Wn=(e,t)=>{let n=e.codePointAt(0),r=64<n&&n<91?`upperCaseLatin`:96<n&&n<123?`lowerCaseLatin`:912<n&&n<938?`upperCaseGreek`:944<n&&n<970||e===`ϕ`?`lowerCaseGreek`:120545<n&&n<120572||zn[e]?`varGreek`:47<n&&n<58?`numeral`:`other`;return r===`other`?e:String.fromCodePoint(n+Un[r][t](e))},Gn=Object.freeze({a:`ᴀ`,b:`ʙ`,c:`ᴄ`,d:`ᴅ`,e:`ᴇ`,f:`ꜰ`,g:`ɢ`,h:`ʜ`,i:`ɪ`,j:`ᴊ`,k:`ᴋ`,l:`ʟ`,m:`ᴍ`,n:`ɴ`,o:`ᴏ`,p:`ᴘ`,q:`ǫ`,r:`ʀ`,s:`s`,t:`ᴛ`,u:`ᴜ`,v:`ᴠ`,w:`ᴡ`,x:`x`,y:`ʏ`,z:`ᴢ`}),Kn=/^\d(?:[\d,.]*\d)?$/,qn=/[A-Ba-z]/,Jn=new Set([`\\prime`,`\\dprime`,`\\trprime`,`\\qprime`,`\\backprime`,`\\backdprime`,`\\backtrprime`]),Yn=(e,t,n)=>{let r=new b.MathNode(n,[e]),i=new b.MathNode(`mstyle`,[r]);return i.style[`font-style`]=`italic`,i.style[`font-family`]=`Cambria, 'Times New Roman', serif`,t===`bold-italic`&&(i.style[`font-weight`]=`bold`),i};h({type:`mathord`,mathmlBuilder(e,t){let n=I(e.text,e.mode,t),r=n.text.codePointAt(0),i=912<r&&r<938?`normal`:`italic`,a=Fn(e,t)||i;if(a===`script`)return n.text=Wn(n.text,a),new b.MathNode(`mi`,[n],[t.font]);a!==`italic`&&(n.text=Wn(n.text,a));let o=new b.MathNode(`mi`,[n]);return a===`normal`&&(o.setAttribute(`mathvariant`,`normal`),n.text.length===1&&(o=new b.MathNode(`mrow`,[o]))),o}}),h({type:`textord`,mathmlBuilder(e,t){let n=e.text,r=n.codePointAt(0);t.fontFamily===`textsc`&&96<r&&r<123&&(n=Gn[n]);let i=I(n,e.mode,t),a=Fn(e,t)||`normal`,o;if(Kn.test(e.text)){let t=e.mode===`text`?`mtext`:`mn`;if(a===`italic`||a===`bold-italic`)return Yn(i,a,t);a!==`normal`&&(i.text=i.text.split(``).map(e=>Wn(e,a)).join(``)),o=new b.MathNode(t,[i])}else if(e.mode===`text`)a!==`normal`&&(i.text=Wn(i.text,a)),o=new b.MathNode(`mtext`,[i]);else if(Jn.has(e.text))o=new b.MathNode(`mo`,[i]),o.classes.push(`tml-prime`);else{let e=i.text;a!==`italic`&&(i.text=Wn(i.text,a)),o=new b.MathNode(`mi`,[i]),i.text===e&&qn.test(e)&&o.setAttribute(`mathvariant`,`italic`)}return o}});var Xn={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},Zn={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};h({type:`spacing`,mathmlBuilder(t,n){let r;if(Object.prototype.hasOwnProperty.call(Zn,t.text))r=new b.MathNode(`mtext`,[new b.TextNode(`\xA0`)]);else if(Object.prototype.hasOwnProperty.call(Xn,t.text))r=new b.MathNode(`mo`),t.text===`\\nobreak`&&r.setAttribute(`linebreak`,`nobreak`);else throw new e(`Unknown type of space "${t.text}"`);return r}}),h({type:`tag`});var Qn={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`,"\\textsc":`textsc`},$n={"\\textbf":`textbf`,"\\textmd":`textmd`},er={"\\textit":`textit`,"\\textup":`textup`},tr=(e,t)=>{let n=e.font;return n?Qn[n]?t.withTextFontFamily(Qn[n]):$n[n]?t.withTextFontWeight($n[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(er[n]):t};m({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textsc`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler({parser:e,funcName:t},n){let r=n[0];return{type:`text`,mode:e.mode,body:_(r),font:t}},mathmlBuilder(e,t){let n=tr(e,t);return Oe(R(e.body,n))}}),m({type:`vcenter`,names:[`\\vcenter`],props:{numArgs:1,argTypes:[`original`],allowedInText:!1},handler({parser:e},t){return{type:`vcenter`,mode:e.mode,body:t[0]}},mathmlBuilder(e,t){let n=new b.MathNode(`mtd`,[z(e.body,t)]);n.style.padding=`0`;let r=new b.MathNode(`mtr`,[n]);return new b.MathNode(`mtable`,[r])}}),m({type:`verb`,names:[`\\verb`],props:{numArgs:0,allowedInText:!0},handler(t,n,r){throw new e(`\\verb ended by end of line instead of matching delimiter`)},mathmlBuilder(e,t){let n=new b.TextNode(nr(e)),r=new b.MathNode(`mtext`,[n]);return r.setAttribute(`mathvariant`,`monospace`),r}});var nr=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),$=f,rr=`[ \r
|
|
89
|
+
]`,ir=`\\\\[a-zA-Z@]+`,ar=`\\\\[^\ud800-\udfff]`,or=`(${ir})${rr}*`,sr=`\\\\(
|
|
90
|
+
|[ \r ]+
|
|
91
|
+
?)[ \r ]*`,cr=`[̀-ͯ]`,lr=RegExp(`${cr}+$`),ur=`(${rr}+)|${sr}|([!-\\[\\]-‧-豈-]${cr}*|[�d800-�dbff][�dc00-�dfff]${cr}*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|${or}|${ar})`,dr=class{constructor(e,t){this.input=e,this.settings=t,this.tokenRegex=new RegExp(ur,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){let t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new G(`EOF`,new W(this,n,n));let r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new e(`Unexpected character: '${t[n]}'`,new G(t[n],new W(this,n,n+1)));let i=r[6]||r[3]||(r[2]?`\\ `:` `);if(this.catcodes[i]===14){let n=t.indexOf(`
|
|
92
|
+
`,this.tokenRegex.lastIndex);if(n===-1){if(this.tokenRegex.lastIndex=t.length,this.settings.strict)throw new e(`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode`)}else this.tokenRegex.lastIndex=n+1;return this.lex()}return new G(i,new W(this,n,this.tokenRegex.lastIndex))}},fr=class{constructor(e={},t={}){this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new e(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);let t=this.undefStack.pop();for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e]===void 0?delete this.current[e]:this.current[e]=t[e])}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){return Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:this.builtins[e]}set(e,t,n=!1){if(n){for(let t=0;t<this.undefStack.length;t++)delete this.undefStack[t][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{let t=this.undefStack[this.undefStack.length-1];t&&!Object.prototype.hasOwnProperty.call(t,e)&&(t[e]=this.current[e])}this.current[e]=t}},pr={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},mr=class{constructor(e,t,n){this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new fr(Pt,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new dr(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}future(){return this.stack.length===0&&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,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else ({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new G(`EOF`,n.loc)),this.pushTokens(r),t.range(n,``)}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(t){let n=[],r=t&&t.length>0;r||this.consumeSpaces();let i=this.future(),a,o=0,s=0;do{if(a=this.popToken(),n.push(a),a.text===`{`)++o;else if(a.text===`}`){if(--o,o===-1)throw new e(`Extra }`,a)}else if(a.text===`EOF`)throw new e(`Unexpected end of input in a macro argument, expected '`+(t&&r?t[s]:`}`)+`'`,a);if(t&&r)if((o===0||o===1&&t[s]===`{`)&&a.text===t[s]){if(++s,s===t.length){n.splice(-s,s);break}}else s=0}while(o!==0||r);return i.text===`{`&&n[n.length-1].text===`}`&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new e(`The length of delimiters doesn't match the number of args!`);let r=n[0];for(let t=0;t<r.length;t++){let n=this.popToken();if(r[t]!==n.text)throw new e(`Use of the macro doesn't match its definition`,n)}}let r=[];for(let e=0;e<t;e++)r.push(this.consumeArg(n&&n[e+1]).tokens);return r}expandOnce(t){let n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]===`\\`&&!this.isDefined(r))throw new e(`Undefined control sequence: `+r);return this.pushToken(n),!1}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new e(`Too many expansions: infinite loop or need to increase maxExpand setting`);let a=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(let t=a.length-1;t>=0;--t){let n=a[t];if(n.text===`#`){if(t===0)throw new e(`Incomplete placeholder at end of macro body`,n);if(n=a[--t],n.text===`#`)a.splice(t+1,1);else if(/^[1-9]$/.test(n.text))a.splice(t,2,...o[n.text-1]);else throw new e(`Not a valid argument number`,n)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){let e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}throw Error()}expandMacro(e){return this.macros.has(e)?this.expandTokens([new G(e)]):void 0}expandTokens(e){let t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){let e=this.stack.pop();e.treatAsRelax&&=(e.noexpand=!1,!1),t.push(e)}return t}expandMacroAsText(e){let t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){let t=this.macros.get(e);if(t==null)return t;if(e.length===1){let t=this.lexer.catcodes[e];if(t!=null&&t!==13)return}let n=typeof t==`function`?t(this):t;if(typeof n==`string`){let e=0;if(n.indexOf(`#`)!==-1){let t=n.replace(/##/g,``);for(;t.indexOf(`#`+(e+1))!==-1;)++e}let t=new dr(n,this.settings),r=[],i=t.lex();for(;i.text!==`EOF`;)r.push(i),i=t.lex();return r.reverse(),{tokens:r,numArgs:e}}return n}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call($,e)||Object.prototype.hasOwnProperty.call(x.math,e)||Object.prototype.hasOwnProperty.call(x.text,e)||Object.prototype.hasOwnProperty.call(pr,e)}isExpandable(e){let t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call($,e)&&!$[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},hr=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,gr=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),_r=Object.freeze({𝒜:`A`,ℬ:`B`,𝒞:`C`,𝒟:`D`,ℰ:`E`,ℱ:`F`,𝒢:`G`,ℋ:`H`,ℐ:`I`,𝒥:`J`,𝒦:`K`,ℒ:`L`,ℳ:`M`,𝒩:`N`,𝒪:`O`,𝒫:`P`,𝒬:`Q`,ℛ:`R`,𝒮:`S`,𝒯:`T`,𝒰:`U`,𝒱:`V`,𝒲:`W`,𝒳:`X`,𝒴:`Y`,𝒵:`Z`}),vr={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},yr={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ď:`ď`,ḋ:`ḋ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ĺ:`ĺ`,ľ:`ľ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ď:`Ď`,Ḋ:`Ḋ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ť:`Ť`,Ṫ:`Ṫ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},br=[`bin`,`op`,`open`,`punct`,`rel`],xr=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/,Sr=class t{constructor(e,t,n=!1){this.mode=`math`,this.gullet=new mr(e,t,this.mode),this.settings=t,this.isPreamble=n,this.leftrightDepth=0,this.prevAtomType=``}expect(t,n=!0){if(this.fetch().text!==t)throw new e(`Expected '${t}', got '${this.fetch().text}'`,this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);let e=this.parseExpression(!1);if(this.expect(`EOF`),this.isPreamble){let e=Object.create(null);return Object.entries(this.gullet.macros.current).forEach(([t,n])=>{e[t]=n}),this.gullet.endGroup(),e}let t=this.gullet.macros.get(`\\df@tag`);return this.gullet.endGroup(),t&&(this.gullet.macros.current[`\\df@tag`]=t),e}static get endOfExpression(){return[`}`,`\\endgroup`,`\\end`,`\\right`,`\\endtoggle`,`&`]}subparse(e){let t=this.nextToken;this.consume(),this.gullet.pushToken(new G(`}`)),this.gullet.pushTokens(e);let n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(e,n,r){let i=[];for(this.prevAtomType=``;;){this.mode===`math`&&this.consumeSpaces();let a=this.fetch();if(t.endOfExpression.indexOf(a.text)!==-1||n&&a.text===n||r&&a.text===`\\middle`||e&&$[a.text]&&$[a.text].infix)break;let o=this.parseAtom(n);if(!o)break;o.type!==`internal`&&(i.push(o),this.prevAtomType=o.type===`atom`?o.family:o.type)}return this.mode===`text`&&this.formLigatures(i),this.handleInfixNodes(i)}handleInfixNodes(t){let n=-1,r;for(let i=0;i<t.length;i++)if(t[i].type===`infix`){if(n!==-1)throw new e(`only one infix operator per group`,t[i].token);n=i,r=t[i].replaceWith}if(n!==-1&&r){let e,i,a=t.slice(0,n),o=t.slice(n+1);e=a.length===1&&a[0].type===`ordgroup`?a[0]:{type:`ordgroup`,mode:this.mode,body:a},i=o.length===1&&o[0].type===`ordgroup`?o[0]:{type:`ordgroup`,mode:this.mode,body:o};let s;return s=r===`\\\\abovefrac`?this.callFunction(r,[e,t[n],i],[]):this.callFunction(r,[e,i],[]),[s]}else return t}handleSupSubscript(t){let n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();let i=this.parseGroup(t);if(!i)throw new e(`Expected group after '`+r+`'`,n);return i}formatUnsupportedCmd(e){let t=[];for(let n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});let n={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[n]}}parseAtom(t){let n=this.parseGroup(`atom`,t);if(this.mode===`text`)return n;let r,i;for(;;){this.consumeSpaces();let t=this.fetch();if(t.text===`\\limits`||t.text===`\\nolimits`){if(n&&n.type===`op`)n.limits=t.text===`\\limits`,n.alwaysHandleSupSub=!0;else if(n&&n.type===`operatorname`)n.alwaysHandleSupSub&&(n.limits=t.text===`\\limits`);else throw new e(`Limit controls must follow a math operator`,t);this.consume()}else if(t.text===`^`){if(r)throw new e(`Double superscript`,t);r=this.handleSupSubscript(`superscript`)}else if(t.text===`_`){if(i)throw new e(`Double subscript`,t);i=this.handleSupSubscript(`subscript`)}else if(t.text===`'`){if(r)throw new e(`Double superscript`,t);let n={type:`textord`,mode:this.mode,text:`\\prime`},i=[n];for(this.consume();this.fetch().text===`'`;)i.push(n),this.consume();this.fetch().text===`^`&&i.push(this.handleSupSubscript(`superscript`)),r={type:`ordgroup`,mode:this.mode,body:i}}else if(gr[t.text]){let e=hr.test(t.text),n=[];for(n.push(new G(gr[t.text])),this.consume();;){let t=this.fetch().text;if(!gr[t]||hr.test(t)!==e)break;n.unshift(new G(gr[t])),this.consume()}let a=this.subparse(n);e?i={type:`ordgroup`,mode:`math`,body:a}:r={type:`ordgroup`,mode:`math`,body:a}}else break}if(r||i){if(n&&n.type===`multiscript`&&!n.postscripts)return n.postscripts={sup:r,sub:i},n;{let e=!n||n.type!==`op`&&n.type!==`operatorname`?void 0:Tt(this.nextToken.text);return{type:`supsub`,mode:this.mode,base:n,sup:r,sub:i,isFollowedByDelimiter:e}}}else return n}parseFunction(t,n){let r=this.fetch(),i=r.text,a=$[i];if(!a)return null;if(this.consume(),n&&n!==`atom`&&!a.allowedInArgument)throw new e(`Got function '`+i+`' with no arguments`+(n?` as `+n:``),r);if(this.mode===`text`&&!a.allowedInText)throw new e(`Can't use function '`+i+`' in text mode`,r);if(this.mode===`math`&&a.allowedInMath===!1)throw new e(`Can't use function '`+i+`' in math mode`,r);let o=this.prevAtomType,{args:s,optArgs:c}=this.parseArguments(i,a);return this.prevAtomType=o,this.callFunction(i,s,c,r,t)}callFunction(t,n,r,i,a){let o={funcName:t,parser:this,token:i,breakOnTokenText:a},s=$[t];if(s&&s.handler)return s.handler(o,n,r);throw new e(`No function handler for ${t}`)}parseArguments(t,n){let r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};let i=[],a=[];for(let o=0;o<r;o++){let r=n.argTypes&&n.argTypes[o],s=o<n.numOptionalArgs;(n.primitive&&r==null||n.type===`sqrt`&&o===1&&a[0]==null)&&(r=`primitive`);let c=this.parseGroupOfType(`argument to '${t}'`,r,s);if(s)a.push(c);else if(c!=null)i.push(c);else throw new e(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(t,n,r){switch(n){case`size`:return this.parseSizeGroup(r);case`url`:return this.parseUrlGroup(r);case`math`:case`text`:return this.parseArgumentGroup(r,n);case`hbox`:{let e=this.parseArgumentGroup(r,`text`);return e==null?null:{type:`styling`,mode:e.mode,body:[e],scriptLevel:`text`}}case`raw`:{let e=this.parseStringGroup(`raw`,r);return e==null?null:{type:`raw`,mode:`text`,string:e.text}}case`primitive`:{if(r)throw new e(`A primitive argument cannot be optional`);let n=this.parseGroup(t);if(n==null)throw new e(`Expected group as `+t,this.fetch());return n}case`original`:case null:case void 0:return this.parseArgumentGroup(r);default:throw new e(`Unknown group type as `+t,this.fetch())}}consumeSpaces(){for(;;){let e=this.fetch().text;if(e===` `||e===`\xA0`||e===`︎`)this.consume();else break}}parseStringGroup(e,t){let n=this.gullet.scanArgument(t);if(n==null)return null;let r=``,i;for(;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(t,n){let r=this.fetch(),i=r,a=``,o;for(;(o=this.fetch()).text!==`EOF`&&t.test(a+o.text);)i=o,a+=i.text,this.consume();if(a===``)throw new e(`Invalid `+n+`: '`+r.text+`'`,r);return r.range(i,a)}parseSizeGroup(t){let n,r=!1;if(this.gullet.consumeSpaces(),n=!t&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(`size`,t),!n)return null;!t&&n.text.length===0&&(n.text=`0pt`,r=!0);let i=xr.exec(n.text);if(!i)throw new e(`Invalid size: '`+n.text+`'`,n);let a={number:+(i[1]+i[2]),unit:i[3]};if(!Je(a))throw new e(`Invalid unit: '`+a.unit+`'`,n);return{type:`size`,mode:this.mode,value:a,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);let t=this.parseStringGroup(`url`,e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;let n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return n=t.text.replace(/{\u2044}/g,`/`),{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){let n=this.gullet.scanArgument(e);if(n==null)return null;let r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();let i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();let a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){let n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`||r===`\\toggle`){this.consume();let e=r===`{`?`}`:r===`\\begingroup`?`\\endgroup`:`\\endtoggle`;this.gullet.beginGroup();let t=this.parseExpression(!1,e),a=this.fetch();this.expect(e),this.gullet.endGroup(),i={type:a.text===`\\endtoggle`?`toggle`:`ordgroup`,mode:this.mode,loc:W.range(n,a),body:t,semisimple:r===`\\begingroup`||void 0}}else i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!Object.prototype.hasOwnProperty.call(pr,r)&&(i=this.formatUnsupportedCmd(r),this.consume());return i}formLigatures(e){let t=e.length-1;for(let n=0;n<t;++n){let r=e[n],i=r.text;i===`-`&&e[n+1].text===`-`&&(n+1<t&&e[n+2].text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:W.range(r,e[n+2]),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:W.range(r,e[n+1]),text:`--`}),--t)),(i===`'`||i==="`")&&e[n+1].text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:W.range(r,e[n+1]),text:i+i}),--t)}}parseSymbol(){let t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();let t=n.slice(5),r=t.charAt(0)===`*`;if(r&&(t=t.slice(1)),t.length<2||t.charAt(0)!==t.slice(-1))throw new e(`\\verb assertion failed --
|
|
93
|
+
please report what input caused this bug`);return t=t.slice(1,-1),{type:`verb`,mode:`text`,body:t,star:r}}if(Object.prototype.hasOwnProperty.call(yr,n[0])&&this.mode===`math`&&!x[this.mode][n[0]]){if(this.settings.strict&&this.mode===`math`)throw new e(`Accented Unicode text character "${n[0]}" used in math mode`,t);n=yr[n[0]]+n.slice(1)}let r=this.mode===`math`?lr.exec(n):null;r&&(n=n.substring(0,r.index),n===`i`?n=`ı`:n===`j`&&(n=`ȷ`));let i;if(x[this.mode][n]){let e=x[this.mode][n].group;e===`bin`&&br.includes(this.prevAtomType)&&(e=`open`);let r=W.range(t),a;if(Object.prototype.hasOwnProperty.call(ge,e)){let t=e;a={type:`atom`,mode:this.mode,family:t,loc:r,text:n}}else{if(_r[n]){this.consume();let e=this.fetch().text.charCodeAt(0),t=e===65025?`mathscr`:`mathcal`;return(e===65024||e===65025)&&this.consume(),{type:`font`,mode:`math`,font:t,body:{type:`mathord`,mode:`math`,loc:r,text:_r[n]}}}a={type:e,mode:this.mode,loc:r,text:n}}i=a}else if(n.charCodeAt(0)>=128||lr.exec(n)){if(this.settings.strict&&this.mode===`math`)throw new e(`Unicode text character "${n[0]}" used in math mode`,t);i={type:`textord`,mode:`text`,loc:W.range(t),text:n}}else return null;if(this.consume(),r)for(let n=0;n<r[0].length;n++){let a=r[0][n];if(!vr[a])throw new e(`Unknown accent ' ${a}'`,t);let o=vr[a][this.mode]||vr[a].text;if(!o)throw new e(`Accent ${a} unsupported in ${this.mode} mode`,t);i={type:`accent`,mode:this.mode,loc:W.range(t),label:o,isStretchy:!1,base:i}}return i}},Cr=function(t,n){if(!(typeof t==`string`||t instanceof String))throw TypeError(`Temml can only parse string typed expression`);let r=new Sr(t,n);delete r.gullet.macros.current[`\\df@tag`];let i=r.parse();if(!(i.length>0&&i[0].type&&i[0].type===`array`&&i[0].addEqnNum)&&r.gullet.macros.get(`\\df@tag`)){if(!n.displayMode)throw new e(`\\tag works only in display mode`);r.gullet.feed(`\\df@tag`),i=[{type:`tag`,mode:`text`,body:i,tag:r.parse()}]}return i},wr=[2,2,3,3],Tr=class e{constructor(e){this.level=e.level,this.color=e.color,this.font=e.font||``,this.fontFamily=e.fontFamily||``,this.fontSize=e.fontSize||1,this.fontWeight=e.fontWeight||``,this.fontShape=e.fontShape||``,this.maxSize=e.maxSize}extend(t){let n={level:this.level,color:this.color,font:this.font,fontFamily:this.fontFamily,fontSize:this.fontSize,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return new e(n)}withLevel(e){return this.extend({level:e})}incrementLevel(){return this.extend({level:Math.min(this.level+1,3)})}inSubOrSup(){return this.extend({level:wr[this.level]})}withColor(e){return this.extend({color:e})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withFontSize(e){return this.extend({fontSize:e})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}getColor(){return this.color}},Er=`0.10.34`;function Dr(e){let t={},n=0,r=document.getElementsByClassName(`tml-eqn`);for(let e of r)for(n+=1,e.setAttribute(`id`,`tml-eqn-`+String(n));e.tagName!==`mtable`;)if(e.getElementsByClassName(`tml-label`).length>0){let r=e.attributes.id.value;t[r]=String(n);break}else e=e.parentElement;let i=document.getElementsByClassName(`tml-tageqn`);for(let e of i)if(e.getElementsByClassName(`tml-label`).length>0){let n=e.getElementsByClassName(`tml-tag`);if(n.length>0){let r=e.attributes.id.value;t[r]=n[0].textContent}}[...e.getElementsByClassName(`tml-ref`)].forEach(e=>{let n=t[e.getAttribute(`href`).slice(1)];e.className.indexOf(`tml-eqref`)===-1?(n=n.replace(/^\(/,``),n=n.replace(/\)$/,``)):(n.charAt(0)!==`(`&&(n=`(`+n),n.slice(-1)!==`)`&&(n+=`)`));let r=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mtext`);r.appendChild(document.createTextNode(n));let i=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`math`);i.appendChild(r),e.appendChild(i)})}var Or=function(e,t,n={}){t.textContent=``;let r=t.tagName.toLowerCase()===`math`;r&&(n.wrap=`none`);let i=Nr(e,n);r||i.children.length>1?(t.textContent=``,i.children.forEach(e=>{t.appendChild(e.toNode())})):t.appendChild(i.toNode())};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: Temml doesn't work in quirks mode. Make sure your website has a suitable doctype.`),Or=function(){throw new e(`Temml doesn't work in quirks mode.`)});var kr=function(e,t){return Nr(e,t).toMarkup()},Ar=function(e,t){return Cr(e,new d(t))},jr=function(e,t){let n=new d(t);if(n.macros={},!(typeof e==`string`||e instanceof String))throw TypeError(`Temml can only parse string typed expression`);let r=new Sr(e,n,!0);return delete r.gullet.macros.current[`\\df@tag`],r.parse()},Mr=function(t,n,r){if(r.throwOnError||!(t instanceof e))throw t;let i=new ie([`temml-error`],[new ae(n+`
|
|
94
|
+
`+t.toString())]);return i.style.color=r.errorColor,i.style.whiteSpace=`pre-line`,i},Nr=function(e,t){let n=new d(t);try{return Le(Cr(e,n),e,new Tr({level:n.displayMode?K.DISPLAY:K.TEXT,maxSize:n.maxSize}),n)}catch(t){return Mr(t,e,n)}},Pr={version:Er,render:Or,renderToString:kr,postProcess:Dr,ParseError:e,definePreamble:jr,__parse:Ar,__renderToMathMLTree:Nr,__defineSymbol:S,__defineMacro:q};export{Pr as t};
|