97 lines
198 KiB
JavaScript
97 lines
198 KiB
JavaScript
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=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`},d=function(e){return+e.toFixed(4)},f=`acegıȷmnopqrsuvwxyzαγεηικμνοπρςστυχωϕ𝐚𝐜𝐞𝐠𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐮𝐯𝐰𝐱𝐲𝐳`,p=class{constructor(e){e||={},this.displayMode=t(e.displayMode,!1),this.annotate=t(e.annotate,!1),this.leqno=t(e.leqno,!1),this.throwOnError=t(e.throwOnError,!1),this.errorColor=t(e.errorColor,`#b22222`),this.macros=e.macros||{},this.wrap=t(e.wrap,`none`),this.xml=t(e.xml,!1),this.colorIsTextColor=t(e.colorIsTextColor,!1),this.strict=t(e.strict,!1),this.trust=t(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,t(e.maxExpand,1e3)),this.wrapDelimiterPairs=!0}isTrusted(e){if(e.url&&!e.protocol){let t=u(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},m={},h={};function g({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)m[t[e]]=a;e&&i&&(h[e]=i)}function _({type:e,mathmlBuilder:t}){g({type:e,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},mathmlBuilder:t})}var v=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},y=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(``)}},te=function(e){return e.filter(e=>e).join(` `)},ne=function(e,t){this.classes=e||[],this.attributes={},this.style=t||{}},re=function(e){let t=document.createElement(e);t.className=te(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},ie=function(e){let t=`<${e}`;this.classes.length&&(t+=` class="${o(te(this.classes))}"`);let n=``;for(let e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(n+=`${r(e)}:${this.style[e]};`);n&&(t+=` style="${n}"`);for(let e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=` ${e}="${o(this.attributes[e])}"`);t+=`>`;for(let e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t+=`</${e}>`,t},ae=class{constructor(e,t,n){ne.call(this,e,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}toNode(){return re.call(this,`span`)}toMarkup(){return ie.call(this,`span`)}},oe=class{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return o(this.text)}},se=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=te(this.classes));for(let t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){let e=`<a href='${o(this.href)}'`;this.classes.length>0&&(e+=` class="${o(te(this.classes))}"`),e+=`>`;for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e+=`</a>`,e}},ce=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+=`${r(e)}:${this.style[e]};`);return t&&(e+=` style="${o(t)}"`),e+=`>`,e}};function b(e){return new ee(e)}var x=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=te(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+=o(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class="${o(te(this.classes))}"`);let t=``;for(let e in this.style)Object.prototype.hasOwnProperty.call(this.style,e)&&(t+=`${r(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(``)}},S=class{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return o(this.toText())}toText(){return this.text}},le=e=>{let t;return e.length===1&&e[0].type===`mrow`?(t=e.pop(),t.type=`mstyle`):t=new x(`mstyle`,e),t},ue=e=>{let t=0;if(e.body&&Array.isArray(e.body))for(let n of e.body)t+=ue(n);else if(e.body)t+=ue(e.body);else if(e.type===`supsub`)t+=ue(e.base),e.sub&&(t+=.7*ue(e.sub)),e.sup&&(t+=.7*ue(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},de={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,wideparen:`⏜`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,overbracket:`⎴`,underbracket:`⎵`,overgroup:`⏠`,overparen:`⏜`,undergroup:`⏡`,underparen:`⏝`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xrightleftarrows:`⇄`,xtofrom:`⇄`,xleftrightharpoons:`⇋`,xrightleftharpoons:`⇌`,yields:`→`,yieldsLeft:`←`,mesomerism:`↔`,longrightharpoonup:`⇀`,longleftharpoondown:`↽`,eqrightharpoonup:`⇀`,eqleftharpoondown:`↽`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`,yieldsLeftRight:`⇄`,chemequilibrium:`⇌`},fe=function(e){let t=new x(`mo`,[new S(de[e.slice(1)])]);return t.setAttribute(`stretchy`,`true`),t},pe=[`\\widetilde`,`\\widehat`,`\\widecheck`,`\\utilde`],me=e=>{let t=fe(e.label);if(pe.includes(e.label)){let n=ue(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},he={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ge={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},C={math:{},text:{}};function w(e,t,n,r,i){C[e][r]={group:t,replace:n},i&&n&&(C[e][n]=C[e][r])}var T=`math`,E=`text`,D=`accent-token`,O=`bin`,k=`close`,A=`inner`,j=`mathord`,M=`op-token`,N=`open`,_e=`punct`,P=`rel`,F=`spacing`,I=`textord`;w(T,P,`≡`,`\\equiv`,!0),w(T,P,`≺`,`\\prec`,!0),w(T,P,`≻`,`\\succ`,!0),w(T,P,`∼`,`\\sim`,!0),w(T,P,`⟂`,`\\perp`,!0),w(T,P,`⪯`,`\\preceq`,!0),w(T,P,`⪰`,`\\succeq`,!0),w(T,P,`≃`,`\\simeq`,!0),w(T,P,`≌`,`\\backcong`,!0),w(T,P,`|`,`\\mid`,!0),w(T,P,`≪`,`\\ll`,!0),w(T,P,`≫`,`\\gg`,!0),w(T,P,`≍`,`\\asymp`,!0),w(T,P,`∥`,`\\parallel`),w(T,P,`⌣`,`\\smile`,!0),w(T,P,`⊑`,`\\sqsubseteq`,!0),w(T,P,`⊒`,`\\sqsupseteq`,!0),w(T,P,`≐`,`\\doteq`,!0),w(T,P,`⌢`,`\\frown`,!0),w(T,P,`∋`,`\\ni`,!0),w(T,P,`∌`,`\\notni`,!0),w(T,P,`∝`,`\\propto`,!0),w(T,P,`⊢`,`\\vdash`,!0),w(T,P,`⊣`,`\\dashv`,!0),w(T,P,`∋`,`\\owns`),w(T,P,`≘`,`\\arceq`,!0),w(T,P,`≙`,`\\wedgeq`,!0),w(T,P,`≚`,`\\veeeq`,!0),w(T,P,`≛`,`\\stareq`,!0),w(T,P,`≝`,`\\eqdef`,!0),w(T,P,`≞`,`\\measeq`,!0),w(T,P,`≟`,`\\questeq`,!0),w(T,P,`≠`,`\\ne`,!0),w(T,P,`≠`,`\\neq`),w(T,P,`⩵`,`\\eqeq`,!0),w(T,P,`⩶`,`\\eqeqeq`,!0),w(T,P,`∷`,`\\dblcolon`,!0),w(T,P,`≔`,`\\coloneqq`,!0),w(T,P,`≕`,`\\eqqcolon`,!0),w(T,P,`∹`,`\\eqcolon`,!0),w(T,P,`⩴`,`\\Coloneqq`,!0),w(T,_e,`.`,`\\ldotp`),w(T,_e,`·`,`\\cdotp`),w(T,I,`#`,`\\#`),w(E,I,`#`,`\\#`),w(T,I,`&`,`\\&`),w(E,I,`&`,`\\&`),w(T,I,`ℵ`,`\\aleph`,!0),w(T,I,`∀`,`\\forall`,!0),w(T,I,`ℏ`,`\\hbar`,!0),w(T,I,`∃`,`\\exists`,!0),w(T,N,`∇`,`\\nabla`,!0),w(T,I,`♭`,`\\flat`,!0),w(T,I,`ℓ`,`\\ell`,!0),w(T,I,`♮`,`\\natural`,!0),w(T,I,`Å`,`\\Angstrom`,!0),w(E,I,`Å`,`\\Angstrom`,!0),w(T,I,`♣`,`\\clubsuit`,!0),w(T,I,`♧`,`\\varclubsuit`,!0),w(T,I,`℘`,`\\wp`,!0),w(T,I,`♯`,`\\sharp`,!0),w(T,I,`♢`,`\\diamondsuit`,!0),w(T,I,`♦`,`\\vardiamondsuit`,!0),w(T,I,`ℜ`,`\\Re`,!0),w(T,I,`♡`,`\\heartsuit`,!0),w(T,I,`♥`,`\\varheartsuit`,!0),w(T,I,`ℑ`,`\\Im`,!0),w(T,I,`♠`,`\\spadesuit`,!0),w(T,I,`♤`,`\\varspadesuit`,!0),w(T,I,`♀`,`\\female`,!0),w(T,I,`♂`,`\\male`,!0),w(T,I,`§`,`\\S`,!0),w(E,I,`§`,`\\S`),w(T,I,`¶`,`\\P`,!0),w(E,I,`¶`,`\\P`),w(E,I,`☺`,`\\smiley`,!0),w(T,I,`☺`,`\\smiley`,!0),w(T,I,`†`,`\\dag`),w(E,I,`†`,`\\dag`),w(E,I,`†`,`\\textdagger`),w(T,I,`‡`,`\\ddag`),w(E,I,`‡`,`\\ddag`),w(E,I,`‡`,`\\textdaggerdbl`),w(T,k,`⎱`,`\\rmoustache`,!0),w(T,N,`⎰`,`\\lmoustache`,!0),w(T,k,`⟯`,`\\rgroup`,!0),w(T,N,`⟮`,`\\lgroup`,!0),w(T,O,`∓`,`\\mp`,!0),w(T,O,`⊖`,`\\ominus`,!0),w(T,O,`⊎`,`\\uplus`,!0),w(T,O,`⊓`,`\\sqcap`,!0),w(T,O,`∗`,`\\ast`),w(T,O,`⊔`,`\\sqcup`,!0),w(T,O,`◯`,`\\bigcirc`,!0),w(T,O,`∙`,`\\bullet`,!0),w(T,O,`‡`,`\\ddagger`),w(T,O,`≀`,`\\wr`,!0),w(T,O,`⨿`,`\\amalg`),w(T,O,`&`,`\\And`),w(T,O,`⫽`,`\\sslash`,!0),w(T,P,`⟵`,`\\longleftarrow`,!0),w(T,P,`⇐`,`\\Leftarrow`,!0),w(T,P,`⟸`,`\\Longleftarrow`,!0),w(T,P,`⟶`,`\\longrightarrow`,!0),w(T,P,`⇒`,`\\Rightarrow`,!0),w(T,P,`⟹`,`\\Longrightarrow`,!0),w(T,P,`↔`,`\\leftrightarrow`,!0),w(T,P,`⟷`,`\\longleftrightarrow`,!0),w(T,P,`⇔`,`\\Leftrightarrow`,!0),w(T,P,`⟺`,`\\Longleftrightarrow`,!0),w(T,P,`↤`,`\\mapsfrom`,!0),w(T,P,`↦`,`\\mapsto`,!0),w(T,P,`⟼`,`\\longmapsto`,!0),w(T,P,`↗`,`\\nearrow`,!0),w(T,P,`↩`,`\\hookleftarrow`,!0),w(T,P,`↪`,`\\hookrightarrow`,!0),w(T,P,`↘`,`\\searrow`,!0),w(T,P,`↼`,`\\leftharpoonup`,!0),w(T,P,`⇀`,`\\rightharpoonup`,!0),w(T,P,`↙`,`\\swarrow`,!0),w(T,P,`↽`,`\\leftharpoondown`,!0),w(T,P,`⇁`,`\\rightharpoondown`,!0),w(T,P,`↖`,`\\nwarrow`,!0),w(T,P,`⇌`,`\\rightleftharpoons`,!0),w(T,j,`↯`,`\\lightning`,!0),w(T,j,`∎`,`\\QED`,!0),w(T,j,`‰`,`\\permil`,!0),w(E,I,`‰`,`\\permil`),w(T,j,`☉`,`\\astrosun`,!0),w(T,j,`☼`,`\\sun`,!0),w(T,j,`☾`,`\\leftmoon`,!0),w(T,j,`☽`,`\\rightmoon`,!0),w(T,j,`⊕`,`\\Earth`),w(T,P,`≮`,`\\nless`,!0),w(T,P,`⪇`,`\\lneq`,!0),w(T,P,`≨`,`\\lneqq`,!0),w(T,P,`≨︀`,`\\lvertneqq`),w(T,P,`⋦`,`\\lnsim`,!0),w(T,P,`⪉`,`\\lnapprox`,!0),w(T,P,`⊀`,`\\nprec`,!0),w(T,P,`⋠`,`\\npreceq`,!0),w(T,P,`⋨`,`\\precnsim`,!0),w(T,P,`⪹`,`\\precnapprox`,!0),w(T,P,`≁`,`\\nsim`,!0),w(T,P,`∤`,`\\nmid`,!0),w(T,P,`∤`,`\\nshortmid`),w(T,P,`⊬`,`\\nvdash`,!0),w(T,P,`⊭`,`\\nvDash`,!0),w(T,P,`⋪`,`\\ntriangleleft`),w(T,P,`⋬`,`\\ntrianglelefteq`,!0),w(T,P,`⊄`,`\\nsubset`,!0),w(T,P,`⊅`,`\\nsupset`,!0),w(T,P,`⊊`,`\\subsetneq`,!0),w(T,P,`⊊︀`,`\\varsubsetneq`),w(T,P,`⫋`,`\\subsetneqq`,!0),w(T,P,`⫋︀`,`\\varsubsetneqq`),w(T,P,`≯`,`\\ngtr`,!0),w(T,P,`⪈`,`\\gneq`,!0),w(T,P,`≩`,`\\gneqq`,!0),w(T,P,`≩︀`,`\\gvertneqq`),w(T,P,`⋧`,`\\gnsim`,!0),w(T,P,`⪊`,`\\gnapprox`,!0),w(T,P,`⊁`,`\\nsucc`,!0),w(T,P,`⋡`,`\\nsucceq`,!0),w(T,P,`⋩`,`\\succnsim`,!0),w(T,P,`⪺`,`\\succnapprox`,!0),w(T,P,`≆`,`\\ncong`,!0),w(T,P,`∦`,`\\nparallel`,!0),w(T,P,`∦`,`\\nshortparallel`),w(T,P,`⊯`,`\\nVDash`,!0),w(T,P,`⋫`,`\\ntriangleright`),w(T,P,`⋭`,`\\ntrianglerighteq`,!0),w(T,P,`⊋`,`\\supsetneq`,!0),w(T,P,`⊋`,`\\varsupsetneq`),w(T,P,`⫌`,`\\supsetneqq`,!0),w(T,P,`⫌︀`,`\\varsupsetneqq`),w(T,P,`⊮`,`\\nVdash`,!0),w(T,P,`⪵`,`\\precneqq`,!0),w(T,P,`⪶`,`\\succneqq`,!0),w(T,O,`⊴`,`\\unlhd`),w(T,O,`⊵`,`\\unrhd`),w(T,P,`↚`,`\\nleftarrow`,!0),w(T,P,`↛`,`\\nrightarrow`,!0),w(T,P,`⇍`,`\\nLeftarrow`,!0),w(T,P,`⇏`,`\\nRightarrow`,!0),w(T,P,`↮`,`\\nleftrightarrow`,!0),w(T,P,`⇎`,`\\nLeftrightarrow`,!0),w(T,P,`△`,`\\vartriangle`),w(T,I,`ℏ`,`\\hslash`),w(T,I,`▽`,`\\triangledown`),w(T,I,`◊`,`\\lozenge`),w(T,I,`Ⓢ`,`\\circledS`),w(T,I,`®`,`\\circledR`,!0),w(E,I,`®`,`\\circledR`),w(E,I,`®`,`\\textregistered`),w(T,I,`∡`,`\\measuredangle`,!0),w(T,I,`∄`,`\\nexists`),w(T,I,`℧`,`\\mho`),w(T,I,`Ⅎ`,`\\Finv`,!0),w(T,I,`⅁`,`\\Game`,!0),w(T,I,`‵`,`\\backprime`),w(T,I,`‶`,`\\backdprime`),w(T,I,`‷`,`\\backtrprime`),w(T,I,`▲`,`\\blacktriangle`),w(T,I,`▼`,`\\blacktriangledown`),w(T,I,`■`,`\\blacksquare`),w(T,I,`⧫`,`\\blacklozenge`),w(T,I,`★`,`\\bigstar`),w(T,I,`∢`,`\\sphericalangle`,!0),w(T,I,`∁`,`\\complement`,!0),w(T,I,`╱`,`\\diagup`),w(T,I,`╲`,`\\diagdown`),w(T,I,`□`,`\\square`),w(T,I,`□`,`\\Box`),w(T,I,`◊`,`\\Diamond`),w(T,I,`¥`,`\\yen`,!0),w(E,I,`¥`,`\\yen`,!0),w(T,I,`✓`,`\\checkmark`,!0),w(E,I,`✓`,`\\checkmark`),w(T,I,`✗`,`\\ballotx`,!0),w(E,I,`✗`,`\\ballotx`),w(E,I,`•`,`\\textbullet`),w(T,I,`ℶ`,`\\beth`,!0),w(T,I,`ℸ`,`\\daleth`,!0),w(T,I,`ℷ`,`\\gimel`,!0),w(T,I,`ϝ`,`\\digamma`,!0),w(T,I,`ϰ`,`\\varkappa`),w(T,N,`⌜`,`\\ulcorner`,!0),w(T,k,`⌝`,`\\urcorner`,!0),w(T,N,`⌞`,`\\llcorner`,!0),w(T,k,`⌟`,`\\lrcorner`,!0),w(T,P,`≦`,`\\leqq`,!0),w(T,P,`⩽`,`\\leqslant`,!0),w(T,P,`⪕`,`\\eqslantless`,!0),w(T,P,`≲`,`\\lesssim`,!0),w(T,P,`⪅`,`\\lessapprox`,!0),w(T,P,`≊`,`\\approxeq`,!0),w(T,O,`⋖`,`\\lessdot`),w(T,P,`⋘`,`\\lll`,!0),w(T,P,`≶`,`\\lessgtr`,!0),w(T,P,`⋚`,`\\lesseqgtr`,!0),w(T,P,`⪋`,`\\lesseqqgtr`,!0),w(T,P,`≑`,`\\doteqdot`),w(T,P,`≓`,`\\risingdotseq`,!0),w(T,P,`≒`,`\\fallingdotseq`,!0),w(T,P,`∽`,`\\backsim`,!0),w(T,P,`⋍`,`\\backsimeq`,!0),w(T,P,`⫅`,`\\subseteqq`,!0),w(T,P,`⋐`,`\\Subset`,!0),w(T,P,`⊏`,`\\sqsubset`,!0),w(T,P,`≼`,`\\preccurlyeq`,!0),w(T,P,`⋞`,`\\curlyeqprec`,!0),w(T,P,`≾`,`\\precsim`,!0),w(T,P,`⪷`,`\\precapprox`,!0),w(T,P,`⊲`,`\\vartriangleleft`),w(T,P,`⊴`,`\\trianglelefteq`),w(T,P,`⊨`,`\\vDash`,!0),w(T,P,`⊫`,`\\VDash`,!0),w(T,P,`⊪`,`\\Vvdash`,!0),w(T,P,`⌣`,`\\smallsmile`),w(T,P,`⌢`,`\\smallfrown`),w(T,P,`≏`,`\\bumpeq`,!0),w(T,P,`≎`,`\\Bumpeq`,!0),w(T,P,`≧`,`\\geqq`,!0),w(T,P,`⩾`,`\\geqslant`,!0),w(T,P,`⪖`,`\\eqslantgtr`,!0),w(T,P,`≳`,`\\gtrsim`,!0),w(T,P,`⪆`,`\\gtrapprox`,!0),w(T,O,`⋗`,`\\gtrdot`),w(T,P,`⋙`,`\\ggg`,!0),w(T,P,`≷`,`\\gtrless`,!0),w(T,P,`⋛`,`\\gtreqless`,!0),w(T,P,`⪌`,`\\gtreqqless`,!0),w(T,P,`≖`,`\\eqcirc`,!0),w(T,P,`≗`,`\\circeq`,!0),w(T,P,`≜`,`\\triangleq`,!0),w(T,P,`∼`,`\\thicksim`),w(T,P,`≈`,`\\thickapprox`),w(T,P,`⫆`,`\\supseteqq`,!0),w(T,P,`⋑`,`\\Supset`,!0),w(T,P,`⊐`,`\\sqsupset`,!0),w(T,P,`≽`,`\\succcurlyeq`,!0),w(T,P,`⋟`,`\\curlyeqsucc`,!0),w(T,P,`≿`,`\\succsim`,!0),w(T,P,`⪸`,`\\succapprox`,!0),w(T,P,`⊳`,`\\vartriangleright`),w(T,P,`⊵`,`\\trianglerighteq`),w(T,P,`⊩`,`\\Vdash`,!0),w(T,P,`∣`,`\\shortmid`),w(T,P,`∥`,`\\shortparallel`),w(T,P,`≬`,`\\between`,!0),w(T,P,`⋔`,`\\pitchfork`,!0),w(T,P,`∝`,`\\varpropto`),w(T,P,`◀`,`\\blacktriangleleft`),w(T,P,`∴`,`\\therefore`,!0),w(T,P,`∍`,`\\backepsilon`),w(T,P,`▶`,`\\blacktriangleright`),w(T,P,`∵`,`\\because`,!0),w(T,P,`⋘`,`\\llless`),w(T,P,`⋙`,`\\gggtr`),w(T,O,`⊲`,`\\lhd`),w(T,O,`⊳`,`\\rhd`),w(T,P,`≂`,`\\eqsim`,!0),w(T,P,`≑`,`\\Doteq`,!0),w(T,P,`⥽`,`\\strictif`,!0),w(T,P,`⥼`,`\\strictfi`,!0),w(T,O,`∔`,`\\dotplus`,!0),w(T,O,`∖`,`\\smallsetminus`),w(T,O,`⋒`,`\\Cap`,!0),w(T,O,`⋓`,`\\Cup`,!0),w(T,O,`⩞`,`\\doublebarwedge`,!0),w(T,O,`⊟`,`\\boxminus`,!0),w(T,O,`⊞`,`\\boxplus`,!0),w(T,O,`⧄`,`\\boxslash`,!0),w(T,O,`⋇`,`\\divideontimes`,!0),w(T,O,`⋉`,`\\ltimes`,!0),w(T,O,`⋊`,`\\rtimes`,!0),w(T,O,`⋋`,`\\leftthreetimes`,!0),w(T,O,`⋌`,`\\rightthreetimes`,!0),w(T,O,`⋏`,`\\curlywedge`,!0),w(T,O,`⋎`,`\\curlyvee`,!0),w(T,O,`⊝`,`\\circleddash`,!0),w(T,O,`⊛`,`\\circledast`,!0),w(T,O,`⊺`,`\\intercal`,!0),w(T,O,`⋒`,`\\doublecap`),w(T,O,`⋓`,`\\doublecup`),w(T,O,`⊠`,`\\boxtimes`,!0),w(T,O,`⋈`,`\\bowtie`,!0),w(T,O,`⋈`,`\\Join`),w(T,O,`⟕`,`\\leftouterjoin`,!0),w(T,O,`⟖`,`\\rightouterjoin`,!0),w(T,O,`⟗`,`\\fullouterjoin`,!0),w(T,O,`∸`,`\\dotminus`,!0),w(T,O,`⟑`,`\\wedgedot`,!0),w(T,O,`⟇`,`\\veedot`,!0),w(T,O,`⩢`,`\\doublebarvee`,!0),w(T,O,`⩣`,`\\veedoublebar`,!0),w(T,O,`⩟`,`\\wedgebar`,!0),w(T,O,`⩠`,`\\wedgedoublebar`,!0),w(T,O,`⩔`,`\\Vee`,!0),w(T,O,`⩓`,`\\Wedge`,!0),w(T,O,`⩃`,`\\barcap`,!0),w(T,O,`⩂`,`\\barcup`,!0),w(T,O,`⩈`,`\\capbarcup`,!0),w(T,O,`⩀`,`\\capdot`,!0),w(T,O,`⩇`,`\\capovercup`,!0),w(T,O,`⩆`,`\\cupovercap`,!0),w(T,O,`⩍`,`\\closedvarcap`,!0),w(T,O,`⩌`,`\\closedvarcup`,!0),w(T,O,`⨪`,`\\minusdot`,!0),w(T,O,`⨫`,`\\minusfdots`,!0),w(T,O,`⨬`,`\\minusrdots`,!0),w(T,O,`⊻`,`\\Xor`,!0),w(T,O,`⊼`,`\\Nand`,!0),w(T,O,`⊽`,`\\Nor`,!0),w(T,O,`⊽`,`\\barvee`),w(T,O,`⫴`,`\\interleave`,!0),w(T,O,`⧢`,`\\shuffle`,!0),w(T,O,`⫶`,`\\threedotcolon`,!0),w(T,O,`⦂`,`\\typecolon`,!0),w(T,O,`∾`,`\\invlazys`,!0),w(T,O,`⩋`,`\\twocaps`,!0),w(T,O,`⩊`,`\\twocups`,!0),w(T,O,`⩎`,`\\Sqcap`,!0),w(T,O,`⩏`,`\\Sqcup`,!0),w(T,O,`⩖`,`\\veeonvee`,!0),w(T,O,`⩕`,`\\wedgeonwedge`,!0),w(T,O,`⧗`,`\\blackhourglass`,!0),w(T,O,`⧆`,`\\boxast`,!0),w(T,O,`⧈`,`\\boxbox`,!0),w(T,O,`⧇`,`\\boxcircle`,!0),w(T,O,`⊜`,`\\circledequal`,!0),w(T,O,`⦷`,`\\circledparallel`,!0),w(T,O,`⦶`,`\\circledvert`,!0),w(T,O,`⦵`,`\\circlehbar`,!0),w(T,O,`⟡`,`\\concavediamond`,!0),w(T,O,`⟢`,`\\concavediamondtickleft`,!0),w(T,O,`⟣`,`\\concavediamondtickright`,!0),w(T,O,`⋄`,`\\diamond`,!0),w(T,O,`⧖`,`\\hourglass`,!0),w(T,O,`⟠`,`\\lozengeminus`,!0),w(T,O,`⌽`,`\\obar`,!0),w(T,O,`⦸`,`\\obslash`,!0),w(T,O,`⨸`,`\\odiv`,!0),w(T,O,`⧁`,`\\ogreaterthan`,!0),w(T,O,`⧀`,`\\olessthan`,!0),w(T,O,`⦹`,`\\operp`,!0),w(T,O,`⨷`,`\\Otimes`,!0),w(T,O,`⨶`,`\\otimeshat`,!0),w(T,O,`⋆`,`\\star`,!0),w(T,O,`△`,`\\triangle`,!0),w(T,O,`⨺`,`\\triangleminus`,!0),w(T,O,`⨹`,`\\triangleplus`,!0),w(T,O,`⨻`,`\\triangletimes`,!0),w(T,O,`⟤`,`\\whitesquaretickleft`,!0),w(T,O,`⟥`,`\\whitesquaretickright`,!0),w(T,O,`⨳`,`\\smashtimes`,!0),w(T,P,`⇢`,`\\dashrightarrow`,!0),w(T,P,`⇠`,`\\dashleftarrow`,!0),w(T,P,`⇇`,`\\leftleftarrows`,!0),w(T,P,`⇆`,`\\leftrightarrows`,!0),w(T,P,`⇚`,`\\Lleftarrow`,!0),w(T,P,`↞`,`\\twoheadleftarrow`,!0),w(T,P,`↢`,`\\leftarrowtail`,!0),w(T,P,`↫`,`\\looparrowleft`,!0),w(T,P,`⇋`,`\\leftrightharpoons`,!0),w(T,P,`↶`,`\\curvearrowleft`,!0),w(T,P,`↺`,`\\circlearrowleft`,!0),w(T,P,`↰`,`\\Lsh`,!0),w(T,P,`⇈`,`\\upuparrows`,!0),w(T,P,`↿`,`\\upharpoonleft`,!0),w(T,P,`⇃`,`\\downharpoonleft`,!0),w(T,P,`⊶`,`\\origof`,!0),w(T,P,`⊷`,`\\imageof`,!0),w(T,P,`⊸`,`\\multimap`,!0),w(T,P,`↭`,`\\leftrightsquigarrow`,!0),w(T,P,`⇉`,`\\rightrightarrows`,!0),w(T,P,`⇄`,`\\rightleftarrows`,!0),w(T,P,`↠`,`\\twoheadrightarrow`,!0),w(T,P,`↣`,`\\rightarrowtail`,!0),w(T,P,`↬`,`\\looparrowright`,!0),w(T,P,`↷`,`\\curvearrowright`,!0),w(T,P,`↻`,`\\circlearrowright`,!0),w(T,P,`↱`,`\\Rsh`,!0),w(T,P,`⇊`,`\\downdownarrows`,!0),w(T,P,`↾`,`\\upharpoonright`,!0),w(T,P,`⇂`,`\\downharpoonright`,!0),w(T,P,`⇝`,`\\rightsquigarrow`,!0),w(T,P,`⇝`,`\\leadsto`),w(T,P,`⇛`,`\\Rrightarrow`,!0),w(T,P,`↾`,`\\restriction`),w(T,I,`‘`,"`"),w(T,I,`$`,`\\$`),w(E,I,`$`,`\\$`),w(E,I,`$`,`\\textdollar`),w(T,I,`¢`,`\\cent`),w(E,I,`¢`,`\\cent`),w(T,I,`%`,`\\%`),w(E,I,`%`,`\\%`),w(T,I,`_`,`\\_`),w(E,I,`_`,`\\_`),w(E,I,`_`,`\\textunderscore`),w(E,I,`␣`,`\\textvisiblespace`,!0),w(T,I,`∠`,`\\angle`,!0),w(T,I,`∞`,`\\infty`,!0),w(T,I,`′`,`\\prime`),w(T,I,`″`,`\\dprime`),w(T,I,`‴`,`\\trprime`),w(T,I,`⁗`,`\\qprime`),w(T,I,`△`,`\\triangle`),w(E,I,`Α`,`\\Alpha`,!0),w(E,I,`Β`,`\\Beta`,!0),w(E,I,`Γ`,`\\Gamma`,!0),w(E,I,`Δ`,`\\Delta`,!0),w(E,I,`Ε`,`\\Epsilon`,!0),w(E,I,`Ζ`,`\\Zeta`,!0),w(E,I,`Η`,`\\Eta`,!0),w(E,I,`Θ`,`\\Theta`,!0),w(E,I,`Ι`,`\\Iota`,!0),w(E,I,`Κ`,`\\Kappa`,!0),w(E,I,`Λ`,`\\Lambda`,!0),w(E,I,`Μ`,`\\Mu`,!0),w(E,I,`Ν`,`\\Nu`,!0),w(E,I,`Ξ`,`\\Xi`,!0),w(E,I,`Ο`,`\\Omicron`,!0),w(E,I,`Π`,`\\Pi`,!0),w(E,I,`Ρ`,`\\Rho`,!0),w(E,I,`Σ`,`\\Sigma`,!0),w(E,I,`Τ`,`\\Tau`,!0),w(E,I,`Υ`,`\\Upsilon`,!0),w(E,I,`Φ`,`\\Phi`,!0),w(E,I,`Χ`,`\\Chi`,!0),w(E,I,`Ψ`,`\\Psi`,!0),w(E,I,`Ω`,`\\Omega`,!0),w(T,j,`Α`,`\\Alpha`,!0),w(T,j,`Β`,`\\Beta`,!0),w(T,j,`Γ`,`\\Gamma`,!0),w(T,j,`Δ`,`\\Delta`,!0),w(T,j,`Ε`,`\\Epsilon`,!0),w(T,j,`Ζ`,`\\Zeta`,!0),w(T,j,`Η`,`\\Eta`,!0),w(T,j,`Θ`,`\\Theta`,!0),w(T,j,`Ι`,`\\Iota`,!0),w(T,j,`Κ`,`\\Kappa`,!0),w(T,j,`Λ`,`\\Lambda`,!0),w(T,j,`Μ`,`\\Mu`,!0),w(T,j,`Ν`,`\\Nu`,!0),w(T,j,`Ξ`,`\\Xi`,!0),w(T,j,`Ο`,`\\Omicron`,!0),w(T,j,`Π`,`\\Pi`,!0),w(T,j,`Ρ`,`\\Rho`,!0),w(T,j,`Σ`,`\\Sigma`,!0),w(T,j,`Τ`,`\\Tau`,!0),w(T,j,`Υ`,`\\Upsilon`,!0),w(T,j,`Φ`,`\\Phi`,!0),w(T,j,`Χ`,`\\Chi`,!0),w(T,j,`Ψ`,`\\Psi`,!0),w(T,j,`Ω`,`\\Omega`,!0),w(T,N,`¬`,`\\neg`,!0),w(T,N,`¬`,`\\lnot`),w(T,I,`⊤`,`\\top`),w(T,I,`⊥`,`\\bot`),w(T,I,`∅`,`\\emptyset`),w(T,I,`⌀`,`\\varnothing`),w(T,j,`α`,`\\alpha`,!0),w(T,j,`β`,`\\beta`,!0),w(T,j,`γ`,`\\gamma`,!0),w(T,j,`δ`,`\\delta`,!0),w(T,j,`ϵ`,`\\epsilon`,!0),w(T,j,`ζ`,`\\zeta`,!0),w(T,j,`η`,`\\eta`,!0),w(T,j,`θ`,`\\theta`,!0),w(T,j,`ι`,`\\iota`,!0),w(T,j,`κ`,`\\kappa`,!0),w(T,j,`λ`,`\\lambda`,!0),w(T,j,`μ`,`\\mu`,!0),w(T,j,`ν`,`\\nu`,!0),w(T,j,`ξ`,`\\xi`,!0),w(T,j,`ο`,`\\omicron`,!0),w(T,j,`π`,`\\pi`,!0),w(T,j,`ρ`,`\\rho`,!0),w(T,j,`σ`,`\\sigma`,!0),w(T,j,`τ`,`\\tau`,!0),w(T,j,`υ`,`\\upsilon`,!0),w(T,j,`ϕ`,`\\phi`,!0),w(T,j,`χ`,`\\chi`,!0),w(T,j,`ψ`,`\\psi`,!0),w(T,j,`ω`,`\\omega`,!0),w(T,j,`ε`,`\\varepsilon`,!0),w(T,j,`ϑ`,`\\vartheta`,!0),w(T,j,`ϖ`,`\\varpi`,!0),w(T,j,`ϱ`,`\\varrho`,!0),w(T,j,`ς`,`\\varsigma`,!0),w(T,j,`φ`,`\\varphi`,!0),w(T,j,`Ϙ`,`\\Coppa`,!0),w(T,j,`ϙ`,`\\coppa`,!0),w(T,j,`ϙ`,`\\varcoppa`,!0),w(T,j,`Ϟ`,`\\Koppa`,!0),w(T,j,`ϟ`,`\\koppa`,!0),w(T,j,`Ϡ`,`\\Sampi`,!0),w(T,j,`ϡ`,`\\sampi`,!0),w(T,j,`Ϛ`,`\\Stigma`,!0),w(T,j,`ϛ`,`\\stigma`,!0),w(T,j,`⫫`,`\\Bot`),w(T,I,`ð`,`\\eth`,!0),w(E,I,`ð`,`ð`),w(T,I,`Å`,`\\AA`),w(E,I,`Å`,`\\AA`,!0),w(T,I,`Æ`,`\\AE`,!0),w(E,I,`Æ`,`\\AE`,!0),w(T,I,`Ð`,`\\DH`,!0),w(E,I,`Ð`,`\\DH`,!0),w(T,I,`Þ`,`\\TH`,!0),w(E,I,`Þ`,`\\TH`,!0),w(T,I,`ß`,`\\ss`,!0),w(E,I,`ß`,`\\ss`,!0),w(T,I,`å`,`\\aa`),w(E,I,`å`,`\\aa`,!0),w(T,I,`æ`,`\\ae`,!0),w(E,I,`æ`,`\\ae`,!0),w(T,I,`ð`,`\\dh`),w(E,I,`ð`,`\\dh`,!0),w(T,I,`þ`,`\\th`,!0),w(E,I,`þ`,`\\th`,!0),w(T,I,`Đ`,`\\DJ`,!0),w(E,I,`Đ`,`\\DJ`,!0),w(T,I,`đ`,`\\dj`,!0),w(E,I,`đ`,`\\dj`,!0),w(T,I,`Ł`,`\\L`,!0),w(E,I,`Ł`,`\\L`,!0),w(T,I,`Ł`,`\\l`,!0),w(E,I,`Ł`,`\\l`,!0),w(T,I,`Ŋ`,`\\NG`,!0),w(E,I,`Ŋ`,`\\NG`,!0),w(T,I,`ŋ`,`\\ng`,!0),w(E,I,`ŋ`,`\\ng`,!0),w(T,I,`Œ`,`\\OE`,!0),w(E,I,`Œ`,`\\OE`,!0),w(T,I,`œ`,`\\oe`,!0),w(E,I,`œ`,`\\oe`,!0),w(T,O,`∗`,`∗`,!0),w(T,O,`+`,`+`),w(T,O,`∗`,`*`),w(T,O,`⁄`,`/`,!0),w(T,O,`⁄`,`⁄`),w(T,O,`−`,`-`,!0),w(T,O,`⋅`,`\\cdot`,!0),w(T,O,`∘`,`\\circ`,!0),w(T,O,`÷`,`\\div`,!0),w(T,O,`±`,`\\pm`,!0),w(T,O,`×`,`\\times`,!0),w(T,O,`∩`,`\\cap`,!0),w(T,O,`∪`,`\\cup`,!0),w(T,O,`∖`,`\\setminus`,!0),w(T,O,`∧`,`\\land`),w(T,O,`∨`,`\\lor`),w(T,O,`∧`,`\\wedge`,!0),w(T,O,`∨`,`\\vee`,!0),w(T,N,`⟦`,`\\llbracket`,!0),w(T,k,`⟧`,`\\rrbracket`,!0),w(T,N,`⟨`,`\\langle`,!0),w(T,N,`⟪`,`\\lAngle`,!0),w(T,N,`⦉`,`\\llangle`,!0),w(T,N,`|`,`\\lvert`),w(T,N,`‖`,`\\lVert`,!0),w(T,I,`!`,`\\oc`),w(T,I,`?`,`\\wn`),w(T,I,`↓`,`\\shpos`),w(T,I,`↕`,`\\shift`),w(T,I,`↑`,`\\shneg`),w(T,k,`?`,`?`),w(T,k,`!`,`!`),w(T,k,`‼`,`‼`),w(T,k,`⟩`,`\\rangle`,!0),w(T,k,`⟫`,`\\rAngle`,!0),w(T,k,`⦊`,`\\rrangle`,!0),w(T,k,`|`,`\\rvert`),w(T,k,`‖`,`\\rVert`),w(T,N,`⦃`,`\\lBrace`,!0),w(T,k,`⦄`,`\\rBrace`,!0),w(T,P,`=`,`\\equal`,!0),w(T,P,`:`,`:`),w(T,P,`≈`,`\\approx`,!0),w(T,P,`≅`,`\\cong`,!0),w(T,P,`≥`,`\\ge`),w(T,P,`≥`,`\\geq`,!0),w(T,P,`←`,`\\gets`),w(T,P,`>`,`\\gt`,!0),w(T,P,`∈`,`\\in`,!0),w(T,P,`∉`,`\\notin`,!0),w(T,P,``,`\\@not`),w(T,P,`⊂`,`\\subset`,!0),w(T,P,`⊃`,`\\supset`,!0),w(T,P,`⊆`,`\\subseteq`,!0),w(T,P,`⊇`,`\\supseteq`,!0),w(T,P,`⊈`,`\\nsubseteq`,!0),w(T,P,`⊈`,`\\nsubseteqq`),w(T,P,`⊉`,`\\nsupseteq`,!0),w(T,P,`⊉`,`\\nsupseteqq`),w(T,P,`⊨`,`\\models`),w(T,P,`←`,`\\leftarrow`,!0),w(T,P,`≤`,`\\le`),w(T,P,`≤`,`\\leq`,!0),w(T,P,`<`,`\\lt`,!0),w(T,P,`→`,`\\rightarrow`,!0),w(T,P,`→`,`\\to`),w(T,P,`≱`,`\\ngeq`,!0),w(T,P,`≱`,`\\ngeqq`),w(T,P,`≱`,`\\ngeqslant`),w(T,P,`≰`,`\\nleq`,!0),w(T,P,`≰`,`\\nleqq`),w(T,P,`≰`,`\\nleqslant`),w(T,P,`⫫`,`\\Perp`,!0),w(T,F,`\xA0`,`\\ `),w(T,F,`\xA0`,`\\space`),w(T,F,`\xA0`,`\\nobreakspace`),w(E,F,`\xA0`,`\\ `),w(E,F,`\xA0`,` `),w(E,F,`\xA0`,`\\space`),w(E,F,`\xA0`,`\\nobreakspace`),w(T,F,null,`\\nobreak`),w(T,F,null,`\\allowbreak`),w(T,_e,`,`,`,`),w(E,_e,`:`,`:`),w(T,_e,`;`,`;`),w(T,O,`⊼`,`\\barwedge`),w(T,O,`⊻`,`\\veebar`),w(T,O,`⊙`,`\\odot`,!0),w(T,O,`⊕︎`,`\\oplus`),w(T,O,`⊗`,`\\otimes`,!0),w(T,I,`∂`,`\\partial`,!0),w(T,O,`⊘`,`\\oslash`,!0),w(T,O,`⊚`,`\\circledcirc`,!0),w(T,O,`⊡`,`\\boxdot`,!0),w(T,O,`△`,`\\bigtriangleup`),w(T,O,`▽`,`\\bigtriangledown`),w(T,O,`†`,`\\dagger`),w(T,O,`⋄`,`\\diamond`),w(T,O,`◃`,`\\triangleleft`),w(T,O,`▹`,`\\triangleright`),w(T,N,`{`,`\\{`),w(E,I,`{`,`\\{`),w(E,I,`{`,`\\textbraceleft`),w(T,k,`}`,`\\}`),w(E,I,`}`,`\\}`),w(E,I,`}`,`\\textbraceright`),w(T,N,`{`,`\\lbrace`),w(T,k,`}`,`\\rbrace`),w(T,N,`[`,`\\lbrack`,!0),w(E,I,`[`,`\\lbrack`,!0),w(T,k,`]`,`\\rbrack`,!0),w(E,I,`]`,`\\rbrack`,!0),w(T,N,`(`,`\\lparen`,!0),w(T,k,`)`,`\\rparen`,!0),w(T,N,`⦇`,`\\llparenthesis`,!0),w(T,k,`⦈`,`\\rrparenthesis`,!0),w(E,I,`<`,`\\textless`,!0),w(E,I,`>`,`\\textgreater`,!0),w(T,N,`⌊`,`\\lfloor`,!0),w(T,k,`⌋`,`\\rfloor`,!0),w(T,N,`⌈`,`\\lceil`,!0),w(T,k,`⌉`,`\\rceil`,!0),w(T,I,`\\`,`\\backslash`),w(T,I,`|`,`|`),w(T,I,`|`,`\\vert`),w(E,I,`|`,`\\textbar`,!0),w(T,I,`‖`,`\\|`),w(T,I,`‖`,`\\Vert`),w(E,I,`‖`,`\\textbardbl`),w(E,I,`~`,`\\textasciitilde`),w(E,I,`\\`,`\\textbackslash`),w(E,I,`^`,`\\textasciicircum`),w(T,P,`↑`,`\\uparrow`,!0),w(T,P,`⇑`,`\\Uparrow`,!0),w(T,P,`↓`,`\\downarrow`,!0),w(T,P,`⇓`,`\\Downarrow`,!0),w(T,P,`↕`,`\\updownarrow`,!0),w(T,P,`⇕`,`\\Updownarrow`,!0),w(T,M,`∐`,`\\coprod`),w(T,M,`⋁`,`\\bigvee`),w(T,M,`⋀`,`\\bigwedge`),w(T,M,`⨄`,`\\biguplus`),w(T,M,`⨄`,`\\bigcupplus`),w(T,M,`⨃`,`\\bigcupdot`),w(T,M,`⨇`,`\\bigdoublevee`),w(T,M,`⨈`,`\\bigdoublewedge`),w(T,M,`⋂`,`\\bigcap`),w(T,M,`⋃`,`\\bigcup`),w(T,M,`∫`,`\\int`),w(T,M,`∫`,`\\intop`),w(T,M,`∬`,`\\iint`),w(T,M,`∭`,`\\iiint`),w(T,M,`∏`,`\\prod`),w(T,M,`∑`,`\\sum`),w(T,M,`⨂`,`\\bigotimes`),w(T,M,`⨁`,`\\bigoplus`),w(T,M,`⨀`,`\\bigodot`),w(T,M,`⨉`,`\\bigtimes`),w(T,M,`∮`,`\\oint`),w(T,M,`∯`,`\\oiint`),w(T,M,`∰`,`\\oiiint`),w(T,M,`∱`,`\\intclockwise`),w(T,M,`∲`,`\\varointclockwise`),w(T,M,`⨌`,`\\iiiint`),w(T,M,`⨍`,`\\intbar`),w(T,M,`⨎`,`\\intBar`),w(T,M,`⨏`,`\\fint`),w(T,M,`⨒`,`\\rppolint`),w(T,M,`⨓`,`\\scpolint`),w(T,M,`⨕`,`\\pointint`),w(T,M,`⨖`,`\\sqint`),w(T,M,`⨗`,`\\intlarhk`),w(T,M,`⨘`,`\\intx`),w(T,M,`⨙`,`\\intcap`),w(T,M,`⨚`,`\\intcup`),w(T,M,`⨅`,`\\bigsqcap`),w(T,M,`⨆`,`\\bigsqcup`),w(T,M,`∫`,`\\smallint`),w(E,A,`…`,`\\textellipsis`),w(T,A,`…`,`\\mathellipsis`),w(E,A,`…`,`\\ldots`,!0),w(T,A,`…`,`\\ldots`,!0),w(T,A,`⋰`,`\\iddots`,!0),w(T,A,`⋯`,`\\@cdots`,!0),w(T,A,`⋱`,`\\ddots`,!0),w(T,I,`⋮`,`\\varvdots`),w(E,I,`⋮`,`\\varvdots`),w(T,D,`´`,`\\acute`),w(T,D,"`",`\\grave`),w(T,D,`¨`,`\\ddot`),w(T,D,`…`,`\\dddot`),w(T,D,`….`,`\\ddddot`),w(T,D,`~`,`\\tilde`),w(T,D,`‾`,`\\bar`),w(T,D,`˘`,`\\breve`),w(T,D,`ˇ`,`\\check`),w(T,D,`^`,`\\hat`),w(T,D,`→`,`\\vec`),w(T,D,`˙`,`\\dot`),w(T,D,`˚`,`\\mathring`),w(T,j,`ı`,`\\imath`,!0),w(T,j,`ȷ`,`\\jmath`,!0),w(T,I,`ı`,`ı`),w(T,I,`ȷ`,`ȷ`),w(E,I,`ı`,`\\i`,!0),w(E,I,`ȷ`,`\\j`,!0),w(E,I,`ø`,`\\o`,!0),w(T,j,`ø`,`\\o`,!0),w(E,I,`Ø`,`\\O`,!0),w(T,j,`Ø`,`\\O`,!0),w(E,D,`ˊ`,`\\'`),w(E,D,`ˋ`,"\\`"),w(E,D,`ˆ`,`\\^`),w(E,D,`~`,`\\~`),w(E,D,`ˉ`,`\\=`),w(E,D,`˘`,`\\u`),w(E,D,`˙`,`\\.`),w(E,D,`¸`,`\\c`),w(E,D,`˚`,`\\r`),w(E,D,`ˇ`,`\\v`),w(E,D,`¨`,`\\"`),w(E,D,`˝`,`\\H`),w(T,D,`ˊ`,`\\'`),w(T,D,`ˋ`,"\\`"),w(T,D,`ˆ`,`\\^`),w(T,D,`~`,`\\~`),w(T,D,`ˉ`,`\\=`),w(T,D,`˘`,`\\u`),w(T,D,`˙`,`\\.`),w(T,D,`¸`,`\\c`),w(T,D,`˚`,`\\r`),w(T,D,`ˇ`,`\\v`),w(T,D,`¨`,`\\"`),w(T,D,`˝`,`\\H`);var ve={"--":!0,"---":!0,"``":!0,"''":!0};w(E,I,`–`,`--`,!0),w(E,I,`–`,`\\textendash`),w(E,I,`—`,`---`,!0),w(E,I,`—`,`\\textemdash`),w(E,I,`‘`,"`",!0),w(E,I,`‘`,`\\textquoteleft`),w(E,I,`’`,`'`,!0),w(E,I,`’`,`\\textquoteright`),w(E,I,`“`,"``",!0),w(E,I,`“`,`\\textquotedblleft`),w(E,I,`”`,`''`,!0),w(E,I,`”`,`\\textquotedblright`),w(T,I,`°`,`\\degree`,!0),w(E,I,`°`,`\\degree`),w(E,I,`°`,`\\textdegree`,!0),w(T,I,`£`,`\\pounds`),w(T,I,`£`,`\\mathsterling`,!0),w(E,I,`£`,`\\pounds`),w(E,I,`£`,`\\textsterling`,!0),w(T,I,`✠`,`\\maltese`),w(E,I,`✠`,`\\maltese`),w(T,I,`€`,`\\euro`,!0),w(E,I,`€`,`\\euro`,!0),w(E,I,`€`,`\\texteuro`),w(T,I,`©`,`\\copyright`,!0),w(E,I,`©`,`\\textcopyright`),w(T,I,`⌀`,`\\diameter`,!0),w(E,I,`⌀`,`\\diameter`),w(T,I,`𝛤`,`\\varGamma`),w(T,I,`𝛥`,`\\varDelta`),w(T,I,`𝛩`,`\\varTheta`),w(T,I,`𝛬`,`\\varLambda`),w(T,I,`𝛯`,`\\varXi`),w(T,I,`𝛱`,`\\varPi`),w(T,I,`𝛴`,`\\varSigma`),w(T,I,`𝛶`,`\\varUpsilon`),w(T,I,`𝛷`,`\\varPhi`),w(T,I,`𝛹`,`\\varPsi`),w(T,I,`𝛺`,`\\varOmega`),w(E,I,`𝛤`,`\\varGamma`),w(E,I,`𝛥`,`\\varDelta`),w(E,I,`𝛩`,`\\varTheta`),w(E,I,`𝛬`,`\\varLambda`),w(E,I,`𝛯`,`\\varXi`),w(E,I,`𝛱`,`\\varPi`),w(E,I,`𝛴`,`\\varSigma`),w(E,I,`𝛶`,`\\varUpsilon`),w(E,I,`𝛷`,`\\varPhi`),w(E,I,`𝛹`,`\\varPsi`),w(E,I,`𝛺`,`\\varOmega`);var ye=`0123456789/@."`;for(let e=0;e<ye.length;e++){let t=ye.charAt(e);w(T,I,t,t)}var be=`0123456789!@*()-=+";:?/.,`;for(let e=0;e<be.length;e++){let t=be.charAt(e);w(E,I,t,t)}var xe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`;for(let e=0;e<xe.length;e++){let t=xe.charAt(e);w(T,j,t,t),w(E,I,t,t)}var Se=`ÇÐÞçþℂℍℕℙℚℝℤℎℏℊℋℌℐℑℒℓ℘ℛℜℬℰℱℳℭℨ`;for(let e=0;e<Se.length;e++){let t=Se.charAt(e);w(T,j,t,t),w(E,I,t,t)}var L=``;for(let e=0;e<xe.length;e++){L=String.fromCharCode(55349,56320+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,56372+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,56424+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,56580+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,56736+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,56788+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,56840+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,56944+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,56632+e),w(T,j,L,L),w(E,I,L,L);let t=xe.charAt(e);L=String.fromCharCode(55349,56476+e),w(T,j,t,L),w(E,I,t,L)}for(let e=0;e<10;e++)L=String.fromCharCode(55349,57294+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,57314+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,57324+e),w(T,j,L,L),w(E,I,L,L),L=String.fromCharCode(55349,57334+e),w(T,j,L,L),w(E,I,L,L);function Ce(e,t,n){let r=[],i=[],a=[],o=0,s=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 x(`mrow`,a)),i.push(n),a=[];let e=new x(`mtd`,i);e.style.textAlign=`left`,r.push(new x(`mtr`,[e])),i=[],s+=1;continue}if(a.push(n),n.type&&n.type===`mo`&&n.children.length===1&&!(n.attributes.form&&n.attributes.form===`prefix`)&&!Object.prototype.hasOwnProperty.call(n.attributes,`movablelimits`)){let r=n.children[0].text;if(t===`=`&&r===`=`){if(o+=1,o>1){a.pop();let e=new x(`mrow`,a);i.push(e),a=[n]}}else if(t===`tex`){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 x(`mrow`,a);i.push(e),a=[]}}}s+=1}if(a.length>0){let e=new x(`mrow`,a);i.push(e)}if(r.length>0){let e=new x(`mtd`,i);e.style.textAlign=`left`;let t=new x(`mtr`,[e]);r.push(t);let a=new x(`mtable`,r);return n||(a.setAttribute(`columnalign`,`left`),a.setAttribute(`rowspacing`,`0em`)),a}return b(i)}var R=function(e,t,n){return C[t][e]&&C[t][e].replace&&e.charCodeAt(0)!==55349&&!(Object.prototype.hasOwnProperty.call(ve,e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=C[t][e].replace),new S(e)},we=(e,t)=>{if(e.children.length===0||e.children[e.children.length-1].type!==`mtext`){let n=new x(`mtext`,[new S(t.children[0].text)]);e.children.push(n)}else e.children[e.children.length-1].children[0].text+=t.children[0].text},Te=e=>{if(e.type!==`mrow`&&e.type!==`mstyle`||e.children.length===0)return e;let t=new x(`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)we(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];we(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},Ee=function(e,t=!1){if(e.length===1&&!(e[0]instanceof ee))return e[0];if(!t){e[0]instanceof x&&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 x&&e[t].type===`mo`&&!e[t].attributes.fence&&(e[t].attributes.lspace=`0em`,e[t].attributes.rspace=`0em`)}return new x(`mrow`,e)};function De(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){let t=e.children[0];return t instanceof S&&t.text===`.`}else if(e.type===`mtext`&&e.children.length===1){let t=e.children[0];return t instanceof S&&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 S&&t.text===`,`}else return!1}var Oe=(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},ke=e=>e.type===`atom`&&e.family===`rel`||e.type===`mclass`&&e.mclass===`mrel`,z=function(e,t,n=!1){if(!n&&e.length===1){let n=V(e[0],t);return n instanceof x&&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(V(e[n],t));for(let t=0;t<i.length;t++){let n=i[t];if(t<e.length-1&&ke(e[t])&&ke(e[t+1])&&n.setAttribute(`rspace`,`0em`),t>0&&ke(e[t])&&ke(e[t-1])&&n.setAttribute(`lspace`,`0em`),n.type===`mn`&&a&&a.type===`mn`){a.children.push(...n.children);continue}else if(De(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`&&Oe(e,t)){a.children.push(...n.children);continue}else if(n.type===`mn`&&De(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`||De(a))){let e=n.children[0];e instanceof x&&e.type===`mn`&&a&&(e.children=[...a.children,...e.children],r.pop())}r.push(n),a=n}return r},B=function(e,t,n=!1){return Ee(z(e,t,n),n)},V=function(t,n){if(!t)return new x(`mrow`);if(h[t.type])return h[t.type](t,n);throw new e(`Got group of unknown type: '`+t.type+`'`)},Ae=e=>new x(`mtd`,[],[],{padding:`0`,width:`50%`}),je=[`mrow`,`mtd`,`mtable`,`mtr`],Me=e=>{for(let t of e.children)if(t.type&&je.includes(t.type)){if(t.classes&&t.classes[0]===`tml-label`)return t.label;{let e=Me(t);if(e)return e}}else if(!t.type){let e=Me(t);if(e)return e}},Ne=(e,t,n,r)=>{t=B(t[0].body,n),t=Te(t),t.classes.push(`tml-tag`);let i=Me(e);e=new x(`mtd`,[e]);let a=[Ae(),e,Ae()];a[r?0:2].children.push(t);let o=new x(`mtr`,a,[`tml-tageqn`]);i&&o.setAttribute(`id`,i);let s=new x(`mtable`,[o]);return s.style.width=`100%`,s.setAttribute(`displaystyle`,`true`),s};function Pe(e,t,n,r){let i=null;e.length===1&&e[0].type===`tag`&&(i=e[0].tag,e=e[0].body);let a=z(e,n);if(a.length===1&&a[0]instanceof se)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 x?a[0]:Ce(a,o,r.displayMode);if(i&&(c=Ne(c,i,n,r.leqno)),r.annotate){let e=new x(`annotation`,[new S(t)]);e.setAttribute(`encoding`,`application/x-tex`),c=new x(`semantics`,[c,e])}let l=new x(`math`,[c]);return r.xml&&l.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r.displayMode&&(l.setAttribute(`display`,`block`),l.style.display=`block math`,l.classes=[`tml-display`]),l}var Fe=`DHKLUcegorsuvxyzΠΥΨαδηιμνοτυχϵ`,Ie=`BCEGIMNOPQRSTXZlpqtwΓΘΞΣΦΩβεζθξρςφψϑϕϱ`,Le=`AFJdfΔΛ`,Re=(e,t)=>{let n=e.isStretchy?me(e):new x(`mo`,[R(e.label,e.mode)]);e.isStretchy||n.setAttribute(`stretchy`,`false`),e.label!==`\\vec`&&(n.style.mathDepth=`0`);let r=e.label===`\\c`?`munder`:`mover`,i=Be.has(e.label);if(r===`mover`&&e.mode===`math`&&!e.isStretchy&&e.base.text&&e.base.text.length===1){let t=e.base.text,r=e.label===`\\vec`,a=r===`\\vec`?`-vec`:``;r&&n.classes.push(`tml-vec`);let o=r?`-vec`:i?`-acc`:``;Fe.indexOf(t)>-1?(n.classes.push(`chr-sml${a}`),n.classes.push(`wbk-sml${o}`)):Ie.indexOf(t)>-1?(n.classes.push(`chr-med${a}`),n.classes.push(`wbk-med${o}`)):Le.indexOf(t)>-1?(n.classes.push(`chr-lrg${a}`),n.classes.push(`wbk-lrg${o}`)):r?n.classes.push(`wbk-vec`):i&&n.classes.push(`wbk-acc`)}else i&&n.classes.push(`wbk-acc`);return new x(r,[V(e.base,t),n])},ze=new Set([`\\acute`,`\\check`,`\\grave`,`\\ddot`,`\\dddot`,`\\ddddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`]),Be=new Set([`\\acute`,`\\bar`,`\\breve`,`\\check`,`\\dot`,`\\ddot`,`\\grave`,`\\hat`,`\\mathring`,"\\`",`\\'`,`\\^`,`\\=`,`\\u`,`\\.`,`\\"`,`\\r`,`\\H`,`\\v`]),Ve={"\\`":`̀`,"\\'":`́`,"\\^":`̂`,"\\~":`̃`,"\\=":`̄`,"\\u":`̆`,"\\.":`̇`,'\\"':`̈`,"\\r":`̊`,"\\H":`̋`,"\\v":`̌`,"\\c":`̧`};g({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=v(t[0]),r=!ze.has(e.funcName);return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,base:n}},mathmlBuilder:Re}),g({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\c`,`\\u`,`\\.`,`\\"`,`\\r`,`\\H`,`\\v`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{let n=v(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 Ve&&f.indexOf(n.text)>-1?{type:`textord`,mode:`text`,text:n.text+Ve[e.funcName]}:e.funcName===`\\c`&&r===`text`&&n.text&&n.text.length===1?{type:`textord`,mode:`text`,text:n.text+`̧`}:{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,base:n}},mathmlBuilder:Re}),g({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=me(e);return n.style[`math-depth`]=0,new x(`munder`,[V(e.base,t),n])}});var He={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},Ue=[`em`,`ex`,`mu`,`pt`,`mm`,`cm`,`in`,`px`,`bp`,`pc`,`dd`,`cc`,`nd`,`nc`,`sp`],We=function(e){return typeof e!=`string`&&(e=e.unit),Ue.indexOf(e)>-1},Ge=e=>[1,.7,.5][Math.max(e-1,0)],H=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*He[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/Ge(n.level),n.maxSize[0]),{number:d(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*He[i],n.maxSize[1]),{number:d(r),unit:`pt`};case`mu`:return r=Math.min(r/18,n.maxSize[0]),{number:d(r),unit:`em`};default:throw new e(`Invalid unit: '`+i+`'`)}},U=e=>{let t=new x(`mspace`);return t.setAttribute(`width`,e+`em`),t},Ke=(e,t=.3,n=0,r=!1)=>{if(e==null&&n===0)return U(t);let i=e?[e]:[];if(t!==0&&i.unshift(U(t)),n>0&&i.push(U(n)),r){let e=new x(`mpadded`,i);return e.setAttribute(`height`,`0.1px`),e}else return new x(`mrow`,i)},qe=(e,t)=>Number(e)/Ge(t),Je=(e,t,n,r)=>{let i=fe(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=qe(o,s.level),l=qe(o,3),u=Ke(null,c.toFixed(4),0),d=Ke(null,l.toFixed(4),0),f=qe(a?0:.3,s.level).toFixed(4),p,m,h=t&&t.body&&(t.body.body||t.body.length>0);if(h){let n=V(t,s);n=Ke(n,f,f,e===`\\\\cdrightarrow`||e===`\\\\cdleftarrow`),p=new x(`mover`,[n,d])}let g=n&&n.body&&(n.body.body||n.body.length>0);if(g){let e=V(n,s);e=Ke(e,f,f),m=new x(`munder`,[e,d])}let _;return _=!h&&!g?new x(`mover`,[i,u]):h&&g?new x(`munderover`,[i,m,p]):h?new x(`mover`,[i,p]):new x(`munder`,[i,m]),o===`3.0`&&(_.style.height=`1em`),_.setAttribute(`accent`,`false`),_};g({type:`xArrow`,names:`\\xleftarrow.\\xrightarrow.\\xLeftarrow.\\xRightarrow.\\xleftrightarrow.\\xLeftrightarrow.\\xhookleftarrow.\\xhookrightarrow.\\xmapsto.\\xrightharpoondown.\\xrightharpoonup.\\xleftharpoondown.\\xleftharpoonup.\\xlongequal.\\xtwoheadrightarrow.\\xtwoheadleftarrow.\\xtofrom.\\xleftrightharpoons.\\xrightleftharpoons.\\yields.\\yieldsLeft.\\mesomerism.\\longrightharpoonup.\\longleftharpoondown.\\yieldsLeftRight.\\chemequilibrium.\\\\cdrightarrow.\\\\cdleftarrow.\\\\cdlongequal`.split(`.`),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=[Je(e.name,e.body,e.below,t)];return n.unshift(U(.2778)),n.push(U(.2778)),new x(`mrow`,n)}});var Ye={"\\equilibriumRight":[`\\longrightharpoonup`,`\\eqleftharpoondown`],"\\equilibriumLeft":[`\\eqrightharpoonup`,`\\longleftharpoondown`]};g({type:`stackedArrow`,names:[`\\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=Ye[e.name][0],r=Ye[e.name][1],i=Je(n,e.body,e.upperArrowBelow,t),a=Je(r,e.lowerArrowBody,e.below,t),o,s=new x(`mpadded`,[i]);if(s.setAttribute(`voffset`,`0.3em`),s.setAttribute(`height`,`+0.3em`),s.setAttribute(`depth`,`-0.3em`),e.name===`\\equilibriumLeft`){let e=new x(`mpadded`,[a]);e.setAttribute(`width`,`0.5em`),o=new x(`mpadded`,[U(.2778),e,s,U(.2778)])}else s.setAttribute(`width`,e.name===`\\equilibriumRight`?`0.5em`:`0`),o=new x(`mpadded`,[U(.2778),s,a,U(.2778)]);return o.setAttribute(`voffset`,`-0.18em`),o.setAttribute(`height`,`-0.18em`),o.setAttribute(`depth`,`+0.18em`),o}});var Xe={};function W({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)Xe[t[e]]=a;i&&(h[e]=i)}function G(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 Ze(e){let t=Qe(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type ${e.type}`:String(e)));return t}function Qe(e){return e&&(e.type===`atom`||e.type===`delimiter`||Object.prototype.hasOwnProperty.call(ge,e.type))?e:null}var $e={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},et=()=>({type:`styling`,body:[],mode:`math`,scriptLevel:`display`}),tt=e=>e.type===`textord`&&e.text===`@`,nt=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function rt(e,t,n){let r=$e[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 it(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=et();for(let n=0;n<o.length;n++)if(!tt(o[n]))s.body.push(o[n]);else{r.push(s),n+=1;let i=Ze(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(nt(o[s],i)){r=!1,n=s;break}if(tt(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=rt(i,a,t);r.push(c),s=et()}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([])}}g({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 x(`mrow`,t);let n=V(e.label,t);e.side===`left`&&n.classes.push(`tml-shift-left`);let r=new x(`mtd`,[n]);r.style.padding=`0`;let i=new x(`mpadded`,[new x(`mtable`,[new x(`mtr`,[r])])]);return i.setAttribute(`width`,`0.1px`),i.setAttribute(`displaystyle`,`false`),i.setAttribute(`scriptlevel`,`1`),i}}),g({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 x(`mrow`,[V(e.fragment,t)])}});var at=e=>({type:`ordgroup`,mode:`math`,body:e,semisimple:!0}),ot=(e,t)=>({type:t,mode:`math`,body:at(e)}),st=(e,t)=>{let n=e.body;n[0].shift();let r=Array(n.length-1).fill().map(()=>[]);for(let e=1;e<n.length;e++){r[e-1].push(n[e].shift());let t=[];for(let r=0;r<n[e].length;r++)t.push(n[e][r]);r[e-1].push(ot(t,`vphantom`))}let i=Array(n.length).fill().map(()=>[]);for(let e=0;e<n[0].length;e++)i[0].push(n[0][e]);for(let e=1;e<n.length;e++)for(let t=0;t<n[0].length;t++)i[e].push(ot(n[e][t].body,`hphantom`));for(let e=0;e<n[0].length;e++)n[0][e]=ot(n[0][e].body,`hphantom`);let a={type:`array`,mode:`math`,body:r,cols:[{type:`align`,align:`c`}],rowGaps:Array(r.length-1).fill(null),hLinesBeforeRow:Array(r.length+1).fill().map(()=>[]),envClasses:[],scriptLevel:`text`,arraystretch:1,labels:Array(r.length).fill(``),arraycolsep:{number:.04,unit:`em`}},o={type:`styling`,mode:`math`,scriptLevel:`text`,body:[{type:`array`,mode:`math`,body:i,cols:Array(i.length).fill({type:`align`,align:`c`}),rowGaps:Array(i.length-1).fill(null),hLinesBeforeRow:Array(i.length+1).fill().map(()=>[]),envClasses:[],scriptLevel:`text`,arraystretch:1,labels:Array(i.length).fill(``),arraycolsep:null}]};return at([a,{type:`supsub`,mode:`math`,stack:!0,base:{type:`op`,mode:`math`,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!0,symbol:!1,suppressBaseShift:!0,body:[{type:`leftright`,mode:`math`,body:[e],left:t?t[0]:`(`,right:t?t[1]:`)`,rightColor:void 0}]},sup:o,sub:null}])},K=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}},q=class e{constructor(e,t){this.text=e,this.loc=t}range(t,n){return new e(n,K.range(this,t))}},J={DISPLAY:0,TEXT:1,SCRIPT:2,SCRIPTSCRIPT:3},ct={};function Y(e,t){ct[e]=t}var lt=ct;Y(`\\noexpand`,function(e){let t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Y(`\\expandafter`,function(e){let t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Y(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Y(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Y(`\\@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}}),Y(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),Y(`\\TextOrMath`,function(e){let t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var ut=e=>{let t=``;for(let n=e.length-1;n>-1;n--)t+=e[n].text;return t},dt={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},ft=e=>{let t=e.future().text;return t===`EOF`?[null,``]:[dt[t.charAt(0)],t]},pt=(e,t,n)=>{for(let r=1;r<t.length;r++){let i=dt[t.charAt(r)];e*=n,e+=i}return e};Y(`\\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=dt[a.charAt(0)],i==null||i>=r)throw new e(`Invalid base-${r} digit ${n.text}`);i=pt(i,a,r);let o;for([o,a]=ft(t);o!=null&&o<r;)i*=r,i+=o,i=pt(i,a,r),t.popToken(),[o,a]=ft(t)}return`\\@char{${i}}`});function mt(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}Y(`\\surd`,`\\sqrt{\\vphantom{|}}`),Y(`⊕`,`\\oplus`),Y(`\\long`,``),Y(`\\bgroup`,`{`),Y(`\\egroup`,`}`),Y(`~`,`\\nobreakspace`),Y(`\\lq`,"`"),Y(`\\rq`,`'`),Y(`\\aa`,`\\r a`),Y(`\\Bbbk`,`\\Bbb{k}`),Y(`\\mathstrut`,`\\vphantom{(}`),Y(`\\underbar`,`\\underline{\\text{#1}}`),Y(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),Y(`⋮`,`\\vdots`),Y(`\\arraystretch`,`1`),Y(`\\arraycolsep`,`6pt`),Y(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),Y(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),Y(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),Y(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`);var ht={",":`\\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`,"\\DOTSX":`\\dotsx`};Y(`\\dots`,function(e){let t=`\\dotso`,n=e.expandAfterFuture().text;return n in ht?t=ht[n]:(n.slice(0,4)===`\\not`||n in C.math&&[`bin`,`rel`].includes(C.math[n].group))&&(t=`\\dotsb`),t});var gt={")":!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};Y(`\\dotso`,function(e){return e.future().text in gt?`\\ldots\\,`:`\\ldots`}),Y(`\\dotsc`,function(e){let t=e.future().text;return t in gt&&t!==`,`?`\\ldots\\,`:`\\ldots`}),Y(`\\cdots`,function(e){return e.future().text in gt?`\\@cdots\\,`:`\\@cdots`}),Y(`\\dotsb`,`\\cdots`),Y(`\\dotsm`,`\\cdots`),Y(`\\dotsi`,`\\!\\cdots`),Y(`\\idotsint`,`\\int\\!\\cdots\\!\\int`),Y(`\\dotsx`,`\\ldots\\,`),Y(`\\DOTSI`,`\\relax`),Y(`\\DOTSB`,`\\relax`),Y(`\\DOTSX`,`\\relax`),Y(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),Y(`\\,`,`{\\tmspace+{3mu}{.1667em}}`),Y(`\\thinspace`,`\\,`),Y(`\\>`,`\\mskip{4mu}`),Y(`\\:`,`{\\tmspace+{4mu}{.2222em}}`),Y(`\\medspace`,`\\:`),Y(`\\;`,`{\\tmspace+{5mu}{.2777em}}`),Y(`\\thickspace`,`\\;`),Y(`\\!`,`{\\tmspace-{3mu}{.1667em}}`),Y(`\\negthinspace`,`\\!`),Y(`\\negmedspace`,`{\\tmspace-{4mu}{.2222em}}`),Y(`\\negthickspace`,`{\\tmspace-{5mu}{.277em}}`),Y(`\\enspace`,`\\kern.5em `),Y(`\\enskip`,`\\hskip.5em\\relax`),Y(`\\quad`,`\\hskip1em\\relax`),Y(`\\qquad`,`\\hskip2em\\relax`),Y(`\\AA`,`\\TextOrMath{\\Angstrom}{\\mathring{A}}\\relax`),Y(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),Y(`\\tag@paren`,`\\tag@literal{({#1})}`),Y(`\\tag@literal`,t=>{if(t.macros.get(`\\df@tag`))throw new e(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),Y(`\\notag`,`\\nonumber`),Y(`\\nonumber`,`\\gdef\\@eqnsw{0}`),Y(`\\bmod`,`\\mathbin{\\text{mod}}`),Y(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),Y(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),Y(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),Y(`\\newline`,`\\\\\\relax`),Y(`\\TeX`,`\\textrm{T}\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125em\\textrm{X}`),Y(`\\LaTeX`,`\\textrm{L}\\kern-.35em\\raisebox{0.2em}{\\scriptstyle A}\\kern-.15em\\TeX`),Y(`\\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}}`),Y(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),Y(`\\@hspace`,`\\hskip #1\\relax`),Y(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),Y(`\\colon`,`\\mathpunct{\\char"3a}`),Y(`\\prescript`,`\\pres@cript{_{#1}^{#2}}{}{#3}`),Y(`\\ordinarycolon`,`\\char"3a`),Y(`\\vcentcolon`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}}`),Y(`\\coloneq`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2212}`),Y(`\\Coloneq`,`\\mathrel{\\char"2237\\char"2212}`),Y(`\\Eqqcolon`,`\\mathrel{\\char"3d\\char"2237}`),Y(`\\Eqcolon`,`\\mathrel{\\char"2212\\char"2237}`),Y(`\\colonapprox`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2248}`),Y(`\\Colonapprox`,`\\mathrel{\\char"2237\\char"2248}`),Y(`\\colonsim`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}`),Y(`\\Colonsim`,`\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}`),Y(`\\ratio`,`\\vcentcolon`),Y(`\\coloncolon`,`\\dblcolon`),Y(`\\colonequals`,`\\coloneqq`),Y(`\\coloncolonequals`,`\\Coloneqq`),Y(`\\equalscolon`,`\\eqqcolon`),Y(`\\equalscoloncolon`,`\\Eqqcolon`),Y(`\\colonminus`,`\\coloneq`),Y(`\\coloncolonminus`,`\\Coloneq`),Y(`\\minuscolon`,`\\eqcolon`),Y(`\\minuscoloncolon`,`\\Eqcolon`),Y(`\\coloncolonapprox`,`\\Colonapprox`),Y(`\\coloncolonsim`,`\\Colonsim`),Y(`\\notni`,"\\mathrel{\\char`∌}"),Y(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),Y(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),Y(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),Y(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),Y(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{\\text{lim}}}`),Y(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{\\text{lim}}}`),Y(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{\\text{lim}}}`),Y(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{\\text{lim}}}`),Y(`\\centerdot`,`{\\medspace\\rule{0.167em}{0.189em}\\medspace}`),Y(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),Y(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),Y(`\\plim`,`\\DOTSB\\operatorname*{plim}`),Y(`\\leftmodels`,`\\mathop{\\reflectbox{$\\models$}}`),Y(`\\bra`,`\\mathinner{\\langle{#1}|}`),Y(`\\ket`,`\\mathinner{|{#1}\\rangle}`),Y(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),Y(`\\Bra`,`\\left\\langle#1\\right|`),Y(`\\Ket`,`\\left|#1\\right\\rangle`);var _t=(e,t)=>{let n=`}\\,\\middle${t[0]===`|`?`\\vert`:`\\Vert`}\\,{`;return e.slice(0,t.index)+n+e.slice(t.index+t[0].length)};Y(`\\Braket`,function(e){let t=mt(e),n=/\|\||\||\\\|/g,r;for(;(r=n.exec(t))!==null;)t=_t(t,r);return`\\left\\langle{`+t+`}\\right\\rangle`}),Y(`\\Set`,function(e){let t=mt(e),n=/\|\||\||\\\|/.exec(t);return n&&(t=_t(t,n)),`\\left\\{\\:{`+t+`}\\:\\right\\}`}),Y(`\\set`,function(e){return`\\{{`+mt(e).replace(/\|/,`}\\mid{`)+`}\\}`}),Y(`\\angln`,`{\\angl n}`),Y(`\\odv`,`\\@ifstar\\odv@next\\odv@numerator`),Y(`\\odv@numerator`,`\\frac{\\mathrm{d}#1}{\\mathrm{d}#2}`),Y(`\\odv@next`,`\\frac{\\mathrm{d}}{\\mathrm{d}#2}#1`),Y(`\\pdv`,`\\@ifstar\\pdv@next\\pdv@numerator`);var vt=e=>{let t=e[0][0].text,n=ut(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(/\\,$/,``)]};Y(`\\pdv@numerator`,function(e){let[t,n,r]=vt(e.consumeArgs(2));return`\\frac{${n} ${t}}{${r}}`}),Y(`\\pdv@next`,function(e){let[t,n,r]=vt(e.consumeArgs(2));return`\\frac{${n}}{${r}} ${t}`}),Y(`\\upalpha`,`\\up@greek{\\alpha}`),Y(`\\upbeta`,`\\up@greek{\\beta}`),Y(`\\upgamma`,`\\up@greek{\\gamma}`),Y(`\\updelta`,`\\up@greek{\\delta}`),Y(`\\upepsilon`,`\\up@greek{\\epsilon}`),Y(`\\upzeta`,`\\up@greek{\\zeta}`),Y(`\\upeta`,`\\up@greek{\\eta}`),Y(`\\uptheta`,`\\up@greek{\\theta}`),Y(`\\upiota`,`\\up@greek{\\iota}`),Y(`\\upkappa`,`\\up@greek{\\kappa}`),Y(`\\uplambda`,`\\up@greek{\\lambda}`),Y(`\\upmu`,`\\up@greek{\\mu}`),Y(`\\upnu`,`\\up@greek{\\nu}`),Y(`\\upxi`,`\\up@greek{\\xi}`),Y(`\\upomicron`,`\\up@greek{\\omicron}`),Y(`\\uppi`,`\\up@greek{\\pi}`),Y(`\\upalpha`,`\\up@greek{\\alpha}`),Y(`\\uprho`,`\\up@greek{\\rho}`),Y(`\\upsigma`,`\\up@greek{\\sigma}`),Y(`\\uptau`,`\\up@greek{\\tau}`),Y(`\\upupsilon`,`\\up@greek{\\upsilon}`),Y(`\\upphi`,`\\up@greek{\\phi}`),Y(`\\upchi`,`\\up@greek{\\chi}`),Y(`\\uppsi`,`\\up@greek{\\psi}`),Y(`\\upomega`,`\\up@greek{\\omega}`),Y(`\\invamp`,`\\mathbin{\\char"214b}`),Y(`\\parr`,`\\mathbin{\\char"214b}`),Y(`\\upand`,`\\mathbin{\\char"214b}`),Y(`\\with`,`\\mathbin{\\char"26}`),Y(`\\multimapinv`,`\\mathrel{\\char"27dc}`),Y(`\\multimapboth`,`\\mathrel{\\char"29df}`),Y(`\\scoh`,`{\\mkern5mu\\char"2322\\mkern5mu}`),Y(`\\sincoh`,`{\\mkern5mu\\char"2323\\mkern5mu}`),Y(`\\coh`,`{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2322}}}
|
||
{\\smash{\\lower4mu{\\char"2323}}}\\mkern5mu}`),Y(`\\incoh`,`{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2323}}}
|
||
{\\smash{\\lower4mu{\\char"2322}}}\\mkern5mu}`),Y(`\\standardstate`,"\\text{\\tiny\\char`⦵}"),Y(`\\ce`,function(e){return yt(e.consumeArgs(1)[0],`ce`)}),Y(`\\pu`,function(e){return yt(e.consumeArgs(1)[0],`pu`)}),Y(`\\uniDash`,`{\\rule{0.672em}{0.06em}}`),Y(`\\triDash`,`{\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}}`),Y(`\\tripleDash`,`\\kern0.075em\\raise0.25em{\\triDash}\\kern0.075em`),Y(`\\tripleDashOverLine`,`\\kern0.075em\\mathrlap{\\raise0.125em{\\uniDash}}\\raise0.34em{\\triDash}\\kern0.075em`),Y(`\\tripleDashOverDoubleLine`,`\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\triDash}}\\raise0.27em{\\uniDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em`),Y(`\\tripleDashBetweenDoubleLine`,`\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\uniDash}}\\raise0.27em{\\triDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em`);var yt=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 Z.go(X.go(n,t))},X={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=X.stateMachines[t],c=s.transitions[n]||s.transitions[`*`];iterateTransitions:for(var l=0;l<c.length;l++){var u=X.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(X.actions[d.action_[f].type_])p=X.actions[d.action_[f].type_](r,u.match_,d.action_[f].option);else throw[`MhchemBugA`,`mhchem bug A. Please report. (`+d.action_[f].type_+`)`];X.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=X.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 X.patterns.findObserveGroups(e,`^{`,``,``,`}`)},"^($...$)":function(e){return X.patterns.findObserveGroups(e,`^`,`$`,`$`,``)},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return X.patterns.findObserveGroups(e,`^`,/^\\[a-zA-Z]+\{/,`}`,``,``,`{`,`}`,``,!0)},"^\\x{}":function(e){return X.patterns.findObserveGroups(e,`^`,/^\\[a-zA-Z]+\{/,`}`,``)},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return X.patterns.findObserveGroups(e,`_{`,``,``,`}`)},"_($...$)":function(e){return X.patterns.findObserveGroups(e,`_`,`$`,`$`,``)},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return X.patterns.findObserveGroups(e,`_`,/^\\[a-zA-Z]+\{/,`}`,``,``,`{`,`}`,``,!0)},"_\\x{}":function(e){return X.patterns.findObserveGroups(e,`_`,/^\\[a-zA-Z]+\{/,`}`,``)},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return X.patterns.findObserveGroups(e,``,`{`,`}`,``)},"{(...)}":function(e){return X.patterns.findObserveGroups(e,`{`,``,``,`}`)},"$...$":function(e){return X.patterns.findObserveGroups(e,``,`$`,`$`,``)},"${(...)}$":function(e){return X.patterns.findObserveGroups(e,"${",``,``,`}$`)},"$(...)$":function(e){return X.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 X.patterns.findObserveGroups(e,`\\bond{`,``,``,`}`)},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return X.patterns.findObserveGroups(e,`[`,``,``,`]`)},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return X.patterns.findObserveGroups(e,``,/^\\[a-zA-Z]+\{/,`}`,``,``,`{`,`}`,``,!0)},"\\x{}":function(e){return X.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 X.patterns.findObserveGroups(e,`\\frac{`,``,``,`}`,`{`,``,``,`}`)},"\\overset{(...)}":function(e){return X.patterns.findObserveGroups(e,`\\overset{`,``,``,`}`,`{`,``,``,`}`)},"\\underset{(...)}":function(e){return X.patterns.findObserveGroups(e,`\\underset{`,``,``,`}`,`{`,``,``,`}`)},"\\underbrace{(...)}":function(e){return X.patterns.findObserveGroups(e,`\\underbrace{`,``,``,`}_`,`{`,``,``,`}`)},"\\color{(...)}0":function(e){return X.patterns.findObserveGroups(e,`\\color{`,``,``,`}`)},"\\color{(...)}{(...)}1":function(e){return X.patterns.findObserveGroups(e,`\\color{`,``,``,`}`,`{`,``,``,`}`)},"\\color(...){(...)}2":function(e){return X.patterns.findObserveGroups(e,`\\color`,`\\`,``,/^(?=\{)/,`{`,``,``,`}`)},"\\ce{(...)}":function(e){return X.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=X.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=X.patterns.patterns[e];if(n===void 0)throw[`MhchemBugP`,`mhchem bug P. Please report. (`+e+`)`];if(typeof n==`function`)return X.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 X.go(t,`text`)},"{text}":function(e,t){var n=[`{`];return X.concatArray(n,X.go(t,`text`)),n.push(`}`),n},"tex-math":function(e,t){return X.go(t,`tex-math`)},"tex-math tight":function(e,t){return X.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 X.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 X.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:{}};X.stateMachines={ce:{transitions:X.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 X.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 X.concatArray(n,this.output(e)),X.concatArray(n,X.actions.bond(e,t,`-`)),n}else e.d=t},"- after o/d":function(e,t,n){var r=X.patterns.match_(`orbital`,e.o||``),i=X.patterns.match_(`one lowercase greek letter $`,e.o||``),a=X.patterns.match_(`one lowercase latin letter $`,e.o||``),o=X.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?(X.concatArray(c,this.output(e)),c.push({type_:`hyphen`})):(r=X.patterns.match_(`digits`,e.d||``),n&&r&&r.remainder===``?(X.concatArray(c,X.actions[`d=`](e,t)),X.concatArray(c,this.output(e))):(X.concatArray(c,this.output(e)),X.concatArray(c,X.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:X.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`&&X.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:X.go(e.a,`a`),b:X.go(e.b,`bd`),p:X.go(e.p,`pq`),o:X.go(e.o,`o`),q:X.go(e.q,`pq`),d:X.go(e.d,e.dType===`oxidation`?`oxidation`:`bd`),dType:e.dType}));else{var i=e.rdt===`M`?X.go(e.rd,`tex-math`):e.rdt===`T`?[{type_:`text`,p1:e.rd||``}]:X.go(e.rd),a=e.rqt===`M`?X.go(e.rq,`tex-math`):e.rqt===`T`?[{type_:`text`,p1:e.rq||``}]:X.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 X.concatArray(n,X.go(t,`oxidation`)),n.push(`}`),n},"frac-output":function(e,t){return{type_:`frac-ce`,p1:X.go(t[0]),p2:X.go(t[1])}},"overset-output":function(e,t){return{type_:`overset`,p1:X.go(t[0]),p2:X.go(t[1])}},"underset-output":function(e,t){return{type_:`underset`,p1:X.go(t[0]),p2:X.go(t[1])}},"underbrace-output":function(e,t){return{type_:`underbrace`,p1:X.go(t[0]),p2:X.go(t[1])}},"color-output":function(e,t){return{type_:`color`,color1:t[0],color2:X.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:X.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:X.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:X.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:X.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:X.go(t,`o`)}},"color-output":function(e,t){return{type_:`color`,color1:t[0],color2:X.go(t[1],`pq`)}}}},bd:{transitions:X.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:X.go(t[1],`bd`)}}}},oxidation:{transitions:X.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:X.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:X.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:X.createTransitions({empty:{"*":{}},",":{"*":{action_:`comma`}},else:{"*":{action_:`copy`}}}),actions:{comma:function(){return{type_:`commaDecimal`}}}},pu:{transitions:X.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]&&(X.concatArray(n,X.go(t[1],`pu-9,9`)),t[2]&&(t[2].match(/[,.]/)?X.concatArray(n,X.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]),X.concatArray(n,X.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=X.patterns.match_(`{(...)}`,e.d||``);n&&n.remainder===``&&(e.d=n.match_);var r=X.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:X.go(e.d,`pu`),q:X.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_:`/`}),X.concatArray(t,i.q))}else t=X.go(e.d,`pu-2`);for(var a in e)delete e[a];return t}}},"pu-2":{transitions:X.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=X.patterns.match_(`{(...)}`,e.rm||``);t=n&&n.remainder===``?X.go(n.match_,`pu`):{type_:`rm`,p1:e.rm}}for(var r in e)delete e[r];return t}}},"pu-9,9":{transitions:X.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 Z={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+=Z._go2(a),a.type_===`1st-level escape`&&(r=!0))}return!t&&!r&&n&&(n=`{`+n+`}`),n},_goInner:function(e){return e&&Z.go(e,!0)},_go2:function(e){var t;switch(e.type_){case`chemfive`:t=``;var n={a:Z._goInner(e.a),b:Z._goInner(e.b),p:Z._goInner(e.p),o:Z._goInner(e.o),q:Z._goInner(e.q),d:Z._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 `+Z._goInner(e.p1);break;case`state of aggregation subscript`:t=`\\mskip1mu `+Z._goInner(e.p1);break;case`bond`:if(t=Z._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{`+Z._goInner(e.p1)+`}{`+Z._goInner(e.p2)+`}`;t=`\\mathchoice{\\textstyle`+i+`}{`+i+`}{`+i+`}{`+i+`}`;break;case`tex-math`:t=e.p1+` `;break;case`frac-ce`:t=`\\frac{`+Z._goInner(e.p1)+`}{`+Z._goInner(e.p2)+`}`;break;case`overset`:t=`\\overset{`+Z._goInner(e.p1)+`}{`+Z._goInner(e.p2)+`}`;break;case`underset`:t=`\\underset{`+Z._goInner(e.p1)+`}{`+Z._goInner(e.p2)+`}`;break;case`underbrace`:t=`\\underbrace{`+Z._goInner(e.p1)+`}_{`+Z._goInner(e.p2)+`}`;break;case`color`:t=`{\\color{`+e.color1+`}{`+Z._goInner(e.color2)+`}}`;break;case`color0`:t=`\\color{`+e.color+`}`;break;case`arrow`:var a={rd:Z._goInner(e.rd),rq:Z._goInner(e.rq)},o=Z._getArrow(e.r);a.rq&&(o+=`[{\\rm `+a.rq+`}]`),a.rd?o+=`{\\rm `+a.rd+`}`:o+=`{}`,t=o;break;case`operator`:t=Z._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`\\chemequilibrium`;case`⇌`:return`\\chemequilibrium`;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.`]}}};Y(`\\darr`,`\\downarrow`),Y(`\\dArr`,`\\Downarrow`),Y(`\\Darr`,`\\Downarrow`),Y(`\\lang`,`\\langle`),Y(`\\rang`,`\\rangle`),Y(`\\uarr`,`\\uparrow`),Y(`\\uArr`,`\\Uparrow`),Y(`\\Uarr`,`\\Uparrow`),Y(`\\N`,`\\mathbb{N}`),Y(`\\R`,`\\mathbb{R}`),Y(`\\Z`,`\\mathbb{Z}`),Y(`\\alef`,`\\aleph`),Y(`\\alefsym`,`\\aleph`),Y(`\\bull`,`\\bullet`),Y(`\\clubs`,`\\clubsuit`),Y(`\\cnums`,`\\mathbb{C}`),Y(`\\Complex`,`\\mathbb{C}`),Y(`\\Dagger`,`\\ddagger`),Y(`\\diamonds`,`\\diamondsuit`),Y(`\\empty`,`\\emptyset`),Y(`\\exist`,`\\exists`),Y(`\\harr`,`\\leftrightarrow`),Y(`\\hArr`,`\\Leftrightarrow`),Y(`\\Harr`,`\\Leftrightarrow`),Y(`\\hearts`,`\\heartsuit`),Y(`\\image`,`\\Im`),Y(`\\infin`,`\\infty`),Y(`\\isin`,`\\in`),Y(`\\larr`,`\\leftarrow`),Y(`\\lArr`,`\\Leftarrow`),Y(`\\Larr`,`\\Leftarrow`),Y(`\\lrarr`,`\\leftrightarrow`),Y(`\\lrArr`,`\\Leftrightarrow`),Y(`\\Lrarr`,`\\Leftrightarrow`),Y(`\\natnums`,`\\mathbb{N}`),Y(`\\plusmn`,`\\pm`),Y(`\\rarr`,`\\rightarrow`),Y(`\\rArr`,`\\Rightarrow`),Y(`\\Rarr`,`\\Rightarrow`),Y(`\\real`,`\\Re`),Y(`\\reals`,`\\mathbb{R}`),Y(`\\Reals`,`\\mathbb{R}`),Y(`\\sdot`,`\\cdot`),Y(`\\sect`,`\\S`),Y(`\\spades`,`\\spadesuit`),Y(`\\sub`,`\\subset`),Y(`\\sube`,`\\subseteq`),Y(`\\supe`,`\\supseteq`),Y(`\\thetasym`,`\\vartheta`),Y(`\\weierp`,`\\wp`),Y(`\\quantity`,`{\\left\\{ #1 \\right\\}}`),Y(`\\qty`,`{\\left\\{ #1 \\right\\}}`),Y(`\\pqty`,`{\\left( #1 \\right)}`),Y(`\\bqty`,`{\\left[ #1 \\right]}`),Y(`\\vqty`,`{\\left\\vert #1 \\right\\vert}`),Y(`\\Bqty`,`{\\left\\{ #1 \\right\\}}`),Y(`\\absolutevalue`,`{\\left\\vert #1 \\right\\vert}`),Y(`\\abs`,`{\\left\\vert #1 \\right\\vert}`),Y(`\\norm`,`{\\left\\Vert #1 \\right\\Vert}`),Y(`\\evaluated`,`{\\left.#1 \\right\\vert}`),Y(`\\eval`,`{\\left.#1 \\right\\vert}`),Y(`\\order`,`{\\mathcal{O} \\left( #1 \\right)}`),Y(`\\commutator`,`{\\left[ #1 , #2 \\right]}`),Y(`\\comm`,`{\\left[ #1 , #2 \\right]}`),Y(`\\anticommutator`,`{\\left\\{ #1 , #2 \\right\\}}`),Y(`\\acomm`,`{\\left\\{ #1 , #2 \\right\\}}`),Y(`\\poissonbracket`,`{\\left\\{ #1 , #2 \\right\\}}`),Y(`\\pb`,`{\\left\\{ #1 , #2 \\right\\}}`),Y(`\\vectorbold`,`{\\boldsymbol{ #1 }}`),Y(`\\vb`,`{\\boldsymbol{ #1 }}`),Y(`\\vectorarrow`,`{\\vec{\\boldsymbol{ #1 }}}`),Y(`\\va`,`{\\vec{\\boldsymbol{ #1 }}}`),Y(`\\vectorunit`,`{{\\boldsymbol{\\hat{ #1 }}}}`),Y(`\\vu`,`{{\\boldsymbol{\\hat{ #1 }}}}`),Y(`\\dotproduct`,`\\mathbin{\\boldsymbol\\cdot}`),Y(`\\vdot`,`{\\boldsymbol\\cdot}`),Y(`\\crossproduct`,`\\mathbin{\\boldsymbol\\times}`),Y(`\\cross`,`\\mathbin{\\boldsymbol\\times}`),Y(`\\cp`,`\\mathbin{\\boldsymbol\\times}`),Y(`\\gradient`,`{\\boldsymbol\\nabla}`),Y(`\\grad`,`{\\boldsymbol\\nabla}`),Y(`\\divergence`,`{\\grad\\vdot}`),Y(`\\curl`,`{\\grad\\cross}`),Y(`\\laplacian`,`\\nabla^2`),Y(`\\tr`,`{\\operatorname{tr}}`),Y(`\\Tr`,`{\\operatorname{Tr}}`),Y(`\\rank`,`{\\operatorname{rank}}`),Y(`\\erf`,`{\\operatorname{erf}}`),Y(`\\Res`,`{\\operatorname{Res}}`),Y(`\\principalvalue`,`{\\mathcal{P}}`),Y(`\\pv`,`{\\mathcal{P}}`),Y(`\\PV`,`{\\operatorname{P.V.}}`),Y(`\\qqtext`,`{\\quad\\text{ #1 }\\quad}`),Y(`\\qq`,`{\\quad\\text{ #1 }\\quad}`),Y(`\\qcomma`,`{\\text{,}\\quad}`),Y(`\\qc`,`{\\text{,}\\quad}`),Y(`\\qcc`,`{\\quad\\text{c.c.}\\quad}`),Y(`\\qif`,`{\\quad\\text{if}\\quad}`),Y(`\\qthen`,`{\\quad\\text{then}\\quad}`),Y(`\\qelse`,`{\\quad\\text{else}\\quad}`),Y(`\\qotherwise`,`{\\quad\\text{otherwise}\\quad}`),Y(`\\qunless`,`{\\quad\\text{unless}\\quad}`),Y(`\\qgiven`,`{\\quad\\text{given}\\quad}`),Y(`\\qusing`,`{\\quad\\text{using}\\quad}`),Y(`\\qassume`,`{\\quad\\text{assume}\\quad}`),Y(`\\qsince`,`{\\quad\\text{since}\\quad}`),Y(`\\qlet`,`{\\quad\\text{let}\\quad}`),Y(`\\qfor`,`{\\quad\\text{for}\\quad}`),Y(`\\qall`,`{\\quad\\text{all}\\quad}`),Y(`\\qeven`,`{\\quad\\text{even}\\quad}`),Y(`\\qodd`,`{\\quad\\text{odd}\\quad}`),Y(`\\qinteger`,`{\\quad\\text{integer}\\quad}`),Y(`\\qand`,`{\\quad\\text{and}\\quad}`),Y(`\\qor`,`{\\quad\\text{or}\\quad}`),Y(`\\qas`,`{\\quad\\text{as}\\quad}`),Y(`\\qin`,`{\\quad\\text{in}\\quad}`),Y(`\\differential`,`{\\text{d}}`),Y(`\\dd`,`{\\text{d}}`),Y(`\\derivative`,`{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}`),Y(`\\dv`,`{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}`),Y(`\\partialderivative`,`{\\frac{\\partial{ #1 }}{\\partial{ #2 }}}`),Y(`\\variation`,`{\\delta}`),Y(`\\var`,`{\\delta}`),Y(`\\functionalderivative`,`{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}`),Y(`\\fdv`,`{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}`),Y(`\\innerproduct`,`{\\left\\langle {#1} \\mid { #2} \\right\\rangle}`),Y(`\\outerproduct`,`{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}`),Y(`\\dyad`,`{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}`),Y(`\\ketbra`,`{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}`),Y(`\\op`,`{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}`),Y(`\\expectationvalue`,`{\\left\\langle {#1 } \\right\\rangle}`),Y(`\\expval`,`{\\left\\langle {#1 } \\right\\rangle}`),Y(`\\ev`,`{\\left\\langle {#1 } \\right\\rangle}`),Y(`\\matrixelement`,`{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}`),Y(`\\matrixel`,`{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}`),Y(`\\mel`,`{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}`);function bt(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 xt=t=>{if(!t.parser.settings.displayMode)throw new e(`{${t.envName}} can be used only in display mode.`)},St=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/,Ct=e=>{let t=e.get(`\\arraystretch`);typeof t!=`string`&&(t=ut(t.tokens)),t=isNaN(t)?null:Number(t);let n=e.get(`\\arraycolsep`);typeof n!=`string`&&(n=ut(n.tokens));let r=St.exec(n),i=r?{number:+(r[1]+r[2]),unit:r[3]}:null;return[t,i]},wt=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 Tt(e){if(e.indexOf(`ed`)===-1)return e.indexOf(`*`)===-1}function Q(t,{cols:n,envClasses:r,autoTag:i,singleRow:a,emptySingleRow:o,maxNumCols:s,leqno:c,arraystretch:l,arraycolsep:u},d){let f=r&&r.includes(`bordermatrix`)?`}`:`\\end`;t.gullet.beginGroup(),a||t.gullet.macros.set(`\\cr`,`\\\\\\relax`),t.gullet.beginGroup();let p=[],m=[p],h=[],g=[],_=[],v=i==null?void 0:[];function y(){i&&t.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function ee(){v&&(t.gullet.macros.get(`\\df@tag`)?(v.push(t.subparse([new q(`\\df@tag`)])),t.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!i&&t.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(bt(t));;){let n=t.parseExpression(!1,a?`\\end`:`\\\\`);t.gullet.endGroup(),t.gullet.beginGroup(),n={type:`ordgroup`,mode:t.mode,body:n,semisimple:!0},p.push(n);let i=t.fetch().text;if(i===`&`){if(s&&p.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===f){ee(),p.length===1&&n.body.length===0&&(m.length>1||!o)&&m.pop(),g.push(wt(n.body)),_.length<m.length+1&&_.push([]);break}else if(i===`\\\\`){t.consume();let e;t.gullet.future().text!==` `&&(e=t.parseSizeGroup(!0)),h.push(e?e.value:null),ee(),g.push(wt(n.body)),_.push(bt(t)),p=[],m.push(p),y()}else throw new e(`Expected & or \\\\ or \\cr or `+f,t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:`array`,mode:t.mode,body:m,cols:n,rowGaps:h,hLinesBeforeRow:_,envClasses:r,autoTag:i,scriptLevel:d,tags:v,labels:g,leqno:c,arraystretch:l,arraycolsep:u}}function Et(e){return e.slice(0,1)===`d`?`display`:`text`}var Dt={c:`center `,l:`left `,r:`right `},Ot=e=>{let t=new x(`mtd`,[]);return t.style={padding:`0`,width:`50%`},e.envClasses.includes(`multline`)&&(t.style.width=`7.5%`),t},$=function(e,t){let n=[],r=e.body.length,i=e.hLinesBeforeRow,a=e.tags&&e.tags.some(e=>e);for(let o=0;o<r;o++){let s=e.body[o],c=[],l=e.scriptLevel===`text`?J.TEXT:e.scriptLevel===`script`?J.SCRIPT:J.DISPLAY;for(let n=0;n<s.length;n++){let i=new x(`mtd`,[V(s[n],t.withLevel(l))]);if(e.envClasses.includes(`multline`)){let e=o===0?`left`:o===r-1?`right`:`center`;e!==`center`&&i.classes.push(`tml-`+e)}c.push(i)}let u=e.body[0].length;for(let e=0;e<u-s.length;e++)c.push(new x(`mtd`,[],[],t));if(a){let n=e.tags[o],r;n===!0?r=new x(`mtext`,[new ae([`tml-eqn`])]):n===!1?r=new x(`mtext`,[],[]):(r=B(n[0].body,t.withLevel(l),!0),r=Te(r),r.classes=[`tml-tag`]),r&&(c.unshift(Ot(e)),c.push(Ot(e)),e.leqno?c[0].children.push(r):c[c.length-1].children.push(r))}let d=new x(`mtr`,c,[]),f=e.labels.shift();f&&e.tags&&e.tags[o]&&(d.setAttribute(`id`,f),Array.isArray(e.tags[o])&&d.classes.push(`tml-tageqn`)),o===0&&i[0].length>0&&(i[0].length===2?d.children.forEach(e=>{e.style.borderTop=`0.15em double`}):d.children.forEach(e=>{e.style.borderTop=i[0][0]?`0.06em dashed`:`0.06em solid`})),i[o+1].length>0&&(i[o+1].length===2?d.children.forEach(e=>{e.style.borderBottom=`0.15em double`}):d.children.forEach(e=>{e.style.borderBottom=i[o+1][0]?`0.06em dashed`:`0.06em solid`}));let p=!0;for(let e=0;e<d.children.length;e++){let t=d.children[e].children[0];if(!(t&&t.type===`mpadded`&&t.attributes.height===`0px`)){p=!1;break}}if(p)for(let e=0;e<d.children.length;e++)d.children[e].style.display=`block`,d.children[e].style.height=`0`,d.children[e].style.paddingTop=`0`,d.children[e].style.paddingBottom=`0`;n.push(d)}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 o,s;if(e.envClasses.length>0&&(o=e.envClasses.includes(`abut`)||e.envClasses.includes(`cases`)?`0`:e.envClasses.includes(`small`)?`0.1389`:e.envClasses.includes(`cd`)?`0.25`:`0.4`,s=`em`),e.arraycolsep){let n=H(e.arraycolsep,t);o=n.number.toFixed(4),s=n.unit}if(o){let t=n.length===0?0:n[0].children.length,r=(n,r)=>n===0&&r===0||n===t-1&&r===1?`0`:e.envClasses[0]===`align`?r===1?`0`:a?n%2?`1`:`0`:n%2?`0`:`1`:o;for(let e=0;e<n.length;e++)for(let t=0;t<n[e].children.length;t++)n[e].children[t].style.paddingLeft=`${r(t,0)}${s}`,n[e].children[t].style.paddingRight=`${r(t,1)}${s}`}if(e.envClasses.length===0)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`);if(e.envClasses.length>0){let t=e.envClasses.includes(`align`)||e.envClasses.includes(`alignat`);for(let r=0;r<n.length;r++){let i=n[r];if(t){for(let e=0;e<i.children.length;e++)i.children[e].classes=[`tml-`+(e%2?`left`:`right`)];if(a){let t=e.leqno?0:i.children.length-1;i.children[t].classes=[]}}if(i.children.length>1&&e.envClasses.includes(`cases`)&&(i.children[1].style.paddingLeft=`1em`),e.envClasses.includes(`cases`)||e.envClasses.includes(`subarray`))for(let e of i.children)e.classes.push(`tml-left`)}}let c=new x(`mtable`,n);if(e.envClasses.length>0&&(e.envClasses.includes(`jot`)?c.classes.push(`tml-jot`):e.envClasses.includes(`small`)&&c.classes.push(`tml-small`)),e.scriptLevel===`display`&&c.setAttribute(`displaystyle`,`true`),(e.autoTag||e.envClasses.includes(`multline`))&&(c.style.width=`100%`),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 c.children)t.children[0].style.borderLeft=e}let o=a?0:-1;for(let e=r;e<i;e++)if(t[e].type===`align`){let r=Dt[t[e].align];o+=1;for(let e of c.children)r.trim()!==`center`&&o<e.children.length&&(e.children[o].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 c.children)o<e.children.length&&(e.children[o].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 c.children)t.children[t.children.length-1].style.borderRight=e,t.children[t.children.length-1].style.paddingRight=`0.4em`}}return e.envClasses.includes(`small`)&&(c=new x(`mstyle`,[c]),c.setAttribute(`scriptlevel`,`1`)),c},kt=function(t,n){t.envName.indexOf(`ed`)===-1&&xt(t);let r=t.envName===`split`,i=[],a=Q(t.parser,{cols:i,emptySingleRow:!0,autoTag:r?void 0:Tt(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=G(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};W({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(t,n){let r=(Qe(n[0])?[n[0]]:G(n[0],`ordgroup`).body).map(function(t){let n=Ze(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]=Ct(t.parser.gullet.macros),o={cols:r,envClasses:[`array`],maxNumCols:r.length,arraystretch:i,arraycolsep:a};return Q(t.parser,o,Et(t.envName))},mathmlBuilder:$}),W({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=Q(t.parser,i,`text`);a.cols=a.body.length>0?Array(a.body[0].length).fill({type:`align`,align:r}):[];let[o,s]=Ct(t.parser.gullet.macros);return a.arraystretch=o,s&&!(s===6&&s===`pt`)&&(a.arraycolsep=s),n?{type:`leftright`,mode:t.mode,body:[a],left:n[0],right:n[1],rightColor:void 0}:a},mathmlBuilder:$}),W({type:`array`,names:[`bordermatrix`],props:{numArgs:0},handler(e){let t=Q(e.parser,{cols:[],envClasses:[`bordermatrix`]},`text`);return t.cols=t.body.length>0?Array(t.body[0].length).fill({type:`align`,align:`c`}):[],t.envClasses=[],t.arraystretch=1,e.envName===`matrix`?t:st(t,e.delimiters)},mathmlBuilder:$}),W({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){return Q(e.parser,{envClasses:[`small`]},`script`)},mathmlBuilder:$}),W({type:`array`,names:[`subarray`],props:{numArgs:1},handler(t,n){let r=(Qe(n[0])?[n[0]]:G(n[0],`ordgroup`).body).map(function(t){let n=Ze(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=Q(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:$}),W({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){let t=Q(e.parser,{cols:[],envClasses:[`cases`]},Et(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:$}),W({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:kt,mathmlBuilder:$}),W({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:kt,mathmlBuilder:$}),W({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){e.envName!==`gathered`&&xt(e);let t={cols:[],envClasses:[`abut`,`jot`],autoTag:Tt(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Q(e.parser,t,`display`)},mathmlBuilder:$}),W({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){xt(e);let t={autoTag:Tt(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,envClasses:[`align`],leqno:e.parser.settings.leqno};return Q(e.parser,t,`display`)},mathmlBuilder:$}),W({type:`array`,names:[`multline`,`multline*`],props:{numArgs:0},handler(e){xt(e);let t={autoTag:e.envName===`multline`,maxNumCols:1,envClasses:[`jot`,`multline`],leqno:e.parser.settings.leqno};return Q(e.parser,t,`display`)},mathmlBuilder:$}),W({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return xt(e),it(e.parser)},mathmlBuilder:$}),g({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 At=Xe;g({type:`bordermatrix`,names:[`\\bordermatrix`,`\\matrix`],props:{numArgs:0,numOptionalArgs:1},handler:({parser:e,funcName:t},n,r)=>{let i=[`(`,`)`];if(t===`\\bordermatrix`&&r[0]&&r[0].body){let e=r[0].body;e.length===2&&e[0].type===`atom`&&e[1].type===`atom`&&e[0].family===`open`&&e[1].family===`close`&&(i=[e[0].text,e[1].text])}e.consumeSpaces(),e.consume();let a=At.bordermatrix,o={mode:e.mode,envName:t.slice(1),delimiters:i,parser:e},s=a.handler(o);return e.expect(`}`,!0),s}}),g({type:`cancelto`,names:[`\\cancelto`],props:{numArgs:2},handler({parser:e},t){let n=t[0],r=t[1];return{type:`cancelto`,mode:e.mode,body:r,to:n,isCharacterBox:c(r)}},mathmlBuilder(e,t){let n=new x(`mrow`,[V(e.body,t)],[`ff-narrow`]),r=new x(`mphantom`,[V(e.body,t)]),i=new x(`mrow`,[r],[`tml-cancelto`]);i.style.color=t.color,e.isCharacterBox&&f.indexOf(e.body.body[0].text)>-1&&(i.style.left=`0.1em`,i.style.width=`90%`);let a=new x(`mrow`,[n,i],[`menclose`]);if(!e.isCharacterBox||/[f∫∑]/.test(e.body.body[0].text))r.style.paddingRight=`0.2em`;else{r.style.padding=`0.5ex 0.1em 0 0`;let e=new x(`mspace`,[]);e.setAttribute(`height`,`0.85em`),n.children.push(e)}let o;if(e.isCharacterBox)o=new x(`mspace`,[]),o.setAttribute(`height`,`1em`);else{let n=new x(`mpadded`,[V(e.body,t)]);n.setAttribute(`width`,`0.1px`),o=new x(`mphantom`,[n])}let s=V(e.to,t);s.style.color=t.color;let c=new x(`mpadded`,[s]);if(!e.isCharacterBox||/[f∫∑]/.test(e.body.body[0].text)){let e=new x(`mspace`,[]);e.setAttribute(`width`,`0.2em`),c.children.unshift(e)}c.setAttribute(`width`,`0.1px`);let l=new x(`mover`,[o,c]),u=new x(`mrow`,[],[`ff-nudge-left`]);return b([Ee([a,l]),u])}}),g({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler({parser:t,token:n},r){let i=G(r[0],`ordgroup`).body,a=``;for(let e=0;e<i.length;e++){let t=G(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 jt=/^(#[a-f0-9]{3}|#?[a-f0-9]{6})$/i,Mt=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i,Nt=/^ *\d{1,3} *(?:, *\d{1,3} *){2}$/,Pt=/^ *[10](?:\.\d*)? *(?:, *[10](?:\.\d*)? *){2}$/,Ft=/^[a-f0-9]{6}$/i,It=e=>{let t=e.toString(16);return t.length===1&&(t=`0`+t),t},Lt=JSON.parse(`{
|
||
"Apricot": "#ffb484",
|
||
"Aquamarine": "#08b4bc",
|
||
"Bittersweet": "#c84c14",
|
||
"blue": "#0000FF",
|
||
"Blue": "#303494",
|
||
"BlueGreen": "#08b4bc",
|
||
"BlueViolet": "#503c94",
|
||
"BrickRed": "#b8341c",
|
||
"brown": "#BF8040",
|
||
"Brown": "#802404",
|
||
"BurntOrange": "#f8941c",
|
||
"CadetBlue": "#78749c",
|
||
"CarnationPink": "#f884b4",
|
||
"Cerulean": "#08a4e4",
|
||
"CornflowerBlue": "#40ace4",
|
||
"cyan": "#00FFFF",
|
||
"Cyan": "#08acec",
|
||
"Dandelion": "#ffbc44",
|
||
"darkgray": "#404040",
|
||
"DarkOrchid": "#a8548c",
|
||
"Emerald": "#08ac9c",
|
||
"ForestGreen": "#089c54",
|
||
"Fuchsia": "#90348c",
|
||
"Goldenrod": "#ffdc44",
|
||
"gray": "#808080",
|
||
"Gray": "#98949c",
|
||
"green": "#00FF00",
|
||
"Green": "#08a44c",
|
||
"GreenYellow": "#e0e474",
|
||
"JungleGreen": "#08ac9c",
|
||
"Lavender": "#f89cc4",
|
||
"lightgray": "#c0c0c0",
|
||
"lime": "#BFFF00",
|
||
"LimeGreen": "#90c43c",
|
||
"magenta": "#FF00FF",
|
||
"Magenta": "#f0048c",
|
||
"Mahogany": "#b0341c",
|
||
"Maroon": "#b03434",
|
||
"Melon": "#f89c7c",
|
||
"MidnightBlue": "#086494",
|
||
"Mulberry": "#b03c94",
|
||
"NavyBlue": "#086cbc",
|
||
"olive": "#7F7F00",
|
||
"OliveGreen": "#407c34",
|
||
"orange": "#FF8000",
|
||
"Orange": "#f8843c",
|
||
"OrangeRed": "#f0145c",
|
||
"Orchid": "#b074ac",
|
||
"Peach": "#f8945c",
|
||
"Periwinkle": "#8074bc",
|
||
"PineGreen": "#088c74",
|
||
"pink": "#ff7f7f",
|
||
"Plum": "#98248c",
|
||
"ProcessBlue": "#08b4ec",
|
||
"purple": "#BF0040",
|
||
"Purple": "#a0449c",
|
||
"RawSienna": "#983c04",
|
||
"red": "#ff0000",
|
||
"Red": "#f01c24",
|
||
"RedOrange": "#f86434",
|
||
"RedViolet": "#a0246c",
|
||
"Rhodamine": "#f0549c",
|
||
"Royallue": "#0874bc",
|
||
"RoyalPurple": "#683c9c",
|
||
"RubineRed": "#f0047c",
|
||
"Salmon": "#f8948c",
|
||
"SeaGreen": "#30bc9c",
|
||
"Sepia": "#701404",
|
||
"SkyBlue": "#48c4dc",
|
||
"SpringGreen": "#c8dc64",
|
||
"Tan": "#e09c74",
|
||
"teal": "#007F7F",
|
||
"TealBlue": "#08acb4",
|
||
"Thistle": "#d884b4",
|
||
"Turquoise": "#08b4cc",
|
||
"violet": "#800080",
|
||
"Violet": "#60449c",
|
||
"VioletRed": "#f054a4",
|
||
"WildStrawberry": "#f0246c",
|
||
"yellow": "#FFFF00",
|
||
"Yellow": "#fff404",
|
||
"YellowGreen": "#98cc6c",
|
||
"YellowOrange": "#ffa41c"
|
||
}`),Rt=(t,n)=>{let r=``;if(t===`HTML`){if(!jt.test(n))throw new e(`Invalid HTML input.`);r=n}else if(t===`RGB`){if(!Nt.test(n))throw new e(`Invalid RGB input.`);n.split(`,`).map(e=>{r+=It(Number(e.trim()))})}else{if(!Pt.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+=It(Number((n*255).toFixed(0)))})}return r.charAt(0)!==`#`&&(r=`#`+r),r},zt=(t,n,r)=>{let i=`\\\\color@${t}`;if(!Mt.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:Lt[t]&&(t=Lt[t])),t)},Bt=(e,t)=>{let n=z(e.body,t.withColor(e.color));return n.length===0&&n.push(new x(`mrow`)),n=n.map(t=>(t.style.color=e.color,t)),b(n)};g({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]&&G(r[0],`raw`).string,a=``;if(i){let e=G(n[0],`raw`).string;a=Rt(i,e)}else a=zt(G(n[0],`raw`).string,e.gullet.macros,t);let o=n[1];return{type:`color`,mode:e.mode,color:a,isTextColor:!0,body:y(o)}},mathmlBuilder:Bt}),g({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]&&G(i[0],`raw`).string,o=``;if(a){let e=G(r[0],`raw`).string;o=Rt(a,e)}else o=zt(G(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:Bt}),g({type:`color`,names:[`\\definecolor`],props:{numArgs:3,allowedInText:!0,argTypes:[`raw`,`raw`,`raw`]},handler({parser:t,funcName:n,token:r},i){let a=G(i[0],`raw`).string;if(!/^[A-Za-z]+$/.test(a))throw new e(`Color name must be latin letters.`,r);let o=G(i[1],`raw`).string;if(![`HTML`,`RGB`,`rgb`].includes(o))throw new e(`Color model must be HTML, RGB, or rgb.`,r);let s=G(i[2],`raw`).string,c=Rt(o,s);return t.gullet.macros.set(`\\\\color@${a}`,{tokens:[{text:c}],numArgs:0}),{type:`internal`,mode:t.mode}}}),g({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&&G(r,`size`).value}},mathmlBuilder(e,t){let n=new x(`mo`);if(e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size)){let r=H(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`},Ht=t=>{let n=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new e(`Expected a control sequence`,t);return n},Ut=e=>{let t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},Wt=(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)};g({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]),G(t.parseFunction(),`internal`);throw new e(`Invalid token after macro prefix`,r)}}),g({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}}}),g({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n=Ht(e.gullet.popToken());return e.gullet.consumeSpaces(),Wt(e,n,Ut(e),t===`\\\\globallet`),{type:`internal`,mode:e.mode}}}),g({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let n=Ht(e.gullet.popToken()),r=e.gullet.popToken(),i=e.gullet.popToken();return Wt(e,n,i,t===`\\\\globalfuture`),e.gullet.pushToken(i),e.gullet.pushToken(r),{type:`internal`,mode:e.mode}}}),g({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=Ht(t.gullet.popToken()),t.gullet.popToken()):r=Ht(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 Gt={"\\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}},Kt={"(":`)`,"\\lparen":`\\rparen`,"[":`]`,"\\lbrack":`\\rbrack`,"\\{":`\\}`,"\\lbrace":`\\rbrace`,"⦇":`⦈`,"\\llparenthesis":`\\rrparenthesis`,"\\lfloor":`\\rfloor`,"⌊":`⌋`,"\\lceil":`\\rceil`,"⌈":`⌉`,"\\langle":`\\rangle`,"⟨":`⟩`,"\\lAngle":`\\rAngle`,"⟪":`⟫`,"\\llangle":`\\rrangle`,"⦉":`⦊`,"\\lvert":`\\rvert`,"\\lVert":`\\rVert`,"\\lgroup":`\\rgroup`,"⟮":`⟯`,"\\lmoustache":`\\rmoustache`,"⎰":`⎱`,"\\llbracket":`\\rrbracket`,"⟦":`⟧`,"\\lBrace":`\\rBrace`,"⦃":`⦄`},qt=new Set(Object.keys(Kt));new Set(Object.values(Kt));var Jt=new Set(`(,\\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(`,`)),Yt=new Set([`}`,`\\left`,`\\middle`,`\\right`]),Xt=e=>e.length>0&&(Jt.has(e)||Gt[e]||Yt.has(e)),Zt=[0,1.2,1.8,2.4,3];function Qt(t,n){t.type===`ordgroup`&&t.body.length===1&&(t=t.body[0]);let r=Qe(t);if(r&&Jt.has(r.text))return(r.text===`<`||r.text===`\\lt`)&&(r.text=`⟨`),(r.text===`>`||r.text===`\\gt`)&&(r.text=`⟩`),r;throw r?new e(`Invalid delimiter '${r.text}' after '${n.funcName}'`,t):new e(`Invalid delimiter type '${t.type}'`,t)}var $t=new Set([`/`,`\\`,`\\backslash`,`∖`,`\\vert`,`|`]),en=(e,t,n,r)=>{let i=new x(`mo`,[R(e===`.`?``:e,t)]);return i.setAttribute(`fence`,`true`),i.setAttribute(`form`,n),i.setAttribute(`stretchy`,r?`true`:`false`),i};g({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=Qt(t[0],e),r={type:`delimsizing`,mode:e.parser.mode,size:Gt[e.funcName].size,mclass:Gt[e.funcName].mclass,delim:n.text},i=e.parser.fetch().text;return i!==`^`&&i!==`_`?r:{type:`ordgroup`,mode:`math`,body:[r,{type:`ordgroup`,mode:`math`,body:[]}]}},mathmlBuilder:e=>{let t=[],n=e.delim===`.`?``:e.delim;t.push(R(n,e.mode));let r=new x(`mo`,t);return e.mclass===`mopen`||e.mclass===`mclose`?r.setAttribute(`fence`,`true`):r.setAttribute(`fence`,`false`),($t.has(n)||n.indexOf(`arrow`)>-1)&&r.setAttribute(`stretchy`,`true`),r.setAttribute(`symmetric`,`true`),r.setAttribute(`minsize`,Zt[e.size]+`em`),r.setAttribute(`maxsize`,Zt[e.size]+`em`),r}});function tn(e){if(!e.body)throw Error(`Bug: The delim ParseNode wasn't fully parsed.`)}g({type:`leftright-right`,names:[`\\right`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>({type:`leftright-right`,mode:e.parser.mode,delim:Qt(t[0],e).text})}),g({type:`leftright`,names:[`\\left`],props:{numArgs:1,argTypes:[`primitive`]},handler:(t,n)=>{let r=Qt(n[0],t),i=t.parser;++i.leftrightDepth;let a=i.parseExpression(!1,`\\right`,!0),o=i.fetch();for(;o.text===`\\middle`;){i.consume();let t=i.fetch().text;if(!C.math[t])throw new e(`Invalid delimiter '${t}' after '\\middle'`);Qt({type:`atom`,mode:`math`,text:t},{funcName:`\\middle`}),a.push({type:`middle`,mode:`math`,delim:t}),i.consume(),a=a.concat(i.parseExpression(!1,`\\right`,!0)),o=i.fetch()}--i.leftrightDepth,i.expect(`\\right`,!1);let s=G(i.parseFunction(),`leftright-right`);return{type:`leftright`,mode:i.mode,body:a,left:r.text,right:s.delim,isStretchy:!0}},mathmlBuilder:(e,t)=>{tn(e);let n=z(e.body,t),r=en(e.left,e.mode,`prefix`,!0);n.unshift(r);let i=en(e.right,e.mode,`postfix`,!0);if(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),Ee(n)}}),g({type:`delimiter`,names:Array.from(qt),props:{numArgs:0,allowedInText:!0,allowedInMath:!0,allowedInArgument:!0},handler:({parser:t,funcName:n,token:r})=>{if(t.mode===`text`)return{type:`textord`,mode:`text`,text:n,loc:r.loc};if(!t.settings.wrapDelimiterPairs)return{type:`atom`,mode:`math`,family:`open`,loc:r.loc,text:n};let i=Kt[n],a=t.parseExpression(!1,i,!1);if(t.fetch().text!==i)throw new e(`Unmatched delimiter`);return t.consume(),{type:`delimiter`,mode:t.mode,body:a,left:n,right:i}},mathmlBuilder:(e,t)=>{tn(e);let n=z(e.body,t),r=en(e.left,e.mode,`prefix`,!1);n.unshift(r);let i=en(e.right,e.mode,`postfix`,!1);if(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),Ee(n)}}),g({type:`middle`,names:[`\\middle`],props:{numArgs:1,argTypes:[`primitive`]},handler:(t,n)=>{let r=Qt(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=>{let t=new x(`mo`,[R(e.delim,e.mode)]);return t.setAttribute(`fence`,`true`),e.delim.indexOf(`arrow`)>-1&&t.setAttribute(`stretchy`,`true`),t.setAttribute(`form`,`prefix`),t.setAttribute(`lspace`,`0.05em`),t.setAttribute(`rspace`,`0.05em`),t}});var nn=[`\\boxed`,`\\fcolorbox`,`\\colorbox`],rn=(e,t)=>{let n=new x(nn.includes(e.label)?`mrow`:`menclose`,[V(e.body,t)]);switch(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 x(`mrow`,[],[`tml-cancel`,`upstrike`]));break;case`\\bcancel`:n.setAttribute(`notation`,`downdiagonalstrike`),n.children.push(new x(`mrow`,[],[`tml-cancel`,`downstrike`]));break;case`\\sout`:n.setAttribute(`notation`,`horizontalstrike`),n.children.push(new x(`mrow`,[],[`tml-cancel`,`sout`]));break;case`\\xcancel`:n.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`),n.children.push(new x(`mrow`,[],[`tml-cancel`,`tml-xcancel`]));break;case`\\longdiv`:n.setAttribute(`notation`,`longdiv`),n.classes.push(`longdiv-top`),n.children.push(new x(`mrow`,[],[`longdiv-arc`]));break;case`\\phase`:n.setAttribute(`notation`,`phasorangle`),n.classes.push(`phasor-bottom`),n.children.push(new x(`mrow`,[],[`phasor-angle`]));break;case`\\textcircled`:n.setAttribute(`notation`,`circle`),n.classes.push(`circle-pad`),n.children.push(new x(`mrow`,[],[`textcircle`]));break;case`\\angl`:n.setAttribute(`notation`,`actuarial`),n.classes.push(`actuarial`);break;case`\\boxed`:n.style.padding=`3pt`,n.style.border=`1px solid`,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`:n.style.padding=`0.3em`,e.label===`\\fcolorbox`&&(n.style.border=`0.0667em solid `+String(e.borderColor));break}return e.backgroundColor&&n.setAttribute(`mathbackground`,e.backgroundColor),n};g({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]&&G(r[0],`raw`).string,a=``;if(i){let e=G(n[0],`raw`).string;a=Rt(i,e)}else a=zt(G(n[0],`raw`).string,e.gullet.macros);let o=n[1];return{type:`enclose`,mode:e.mode,label:t,backgroundColor:a,body:o}},mathmlBuilder:rn}),g({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]&&G(r[0],`raw`).string,a=``,o;if(i){let e=G(n[0],`raw`).string,t=G(n[0],`raw`).string;a=Rt(i,e),o=Rt(i,t)}else a=zt(G(n[0],`raw`).string,e.gullet.macros),o=zt(G(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:rn}),g({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]}}}),g({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:rn}),g({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:rn}),g({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:rn}),g({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+=G(i.body[e],`textord`).text;if(n===`\\begin`){if(!Object.prototype.hasOwnProperty.call(At,a))throw new e(`No such environment: `+a,i);let n=At[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=G(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}}}),g({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 x(`mrow`)}}),g({type:`noTag`,names:[`\\env@notag`],props:{numArgs:0},handler({parser:e}){return{type:`noTag`,mode:e.mode}},mathmlBuilder(e,t){return new x(`mrow`)}});var an=(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},on=(e,t)=>{let n=e.font,r=t.withFont(n),i=V(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(an(e,n)){let e=i.children[0].children[0].children?i.children[0].children[0]:i.children[0];delete e.attributes.mathvariant;for(let t=1;t<i.children.length;t++)e.children[0].text+=i.children[t].children[0].children?i.children[t].children[0].children[0].text:i.children[t].children[0].text;let t=new x(`mpadded`,[e]);return t.setAttribute(`lspace`,`0`),t}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]);return o.attributes.mathvariant&&o.attributes.mathvariant===`normal`?new x(`mrow`,[new x(`mtext`,new S(``)),o]):o},sn={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`,"\\bm":`\\boldsymbol`};g({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=v(n[0]),i=t;return i in sn&&(i=sn[i]),{type:`font`,mode:e.mode,font:i.slice(1),body:r}},mathmlBuilder:on}),g({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:on});var cn=[`display`,`text`,`script`,`scriptscript`],ln={auto:-1,display:0,text:0,script:1,scriptscript:2},un=(e,t)=>{let n=t;if(e===`display`){let e=n.level>=J.SCRIPT?J.TEXT:J.DISPLAY;n=n.withLevel(e)}else e===`text`&&n.level===J.DISPLAY?n=n.withLevel(J.TEXT):e===`auto`?n=n.incrementLevel():e===`script`?n=n.withLevel(J.SCRIPT):e===`scriptscript`&&(n=n.withLevel(J.SCRIPTSCRIPT));return n},dn=(e,t)=>{t=un(e.scriptLevel,t);let n=V(e.numer,t),r=V(e.denom,t);t.level===3&&(n.style.mathDepth=`2`,n.setAttribute(`scriptlevel`,`2`),r.style.mathDepth=`2`,r.setAttribute(`scriptlevel`,`2`));let i=new x(`mfrac`,[n,r]);if(!e.hasBarLine)i.setAttribute(`linethickness`,`0px`);else if(e.barSize){let n=H(e.barSize,t);i.setAttribute(`linethickness`,n.number+n.unit)}if(e.leftDelim!=null||e.rightDelim!=null){let t=[];if(e.leftDelim!=null){let n=new x(`mo`,[new S(e.leftDelim.replace(`\\`,``))]);n.setAttribute(`fence`,`true`),t.push(n)}if(t.push(i),e.rightDelim!=null){let n=new x(`mo`,[new S(e.rightDelim.replace(`\\`,``))]);n.setAttribute(`fence`,`true`),t.push(n)}i=Ee(t)}return e.scriptLevel!==`auto`&&(i=new x(`mstyle`,[i]),i.setAttribute(`displaystyle`,String(e.scriptLevel===`display`)),i.setAttribute(`scriptlevel`,ln[e.scriptLevel])),i};g({type:`genfrac`,names:[`\\cfrac`,`\\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`\\cfrac`: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`)}return t===`\\cfrac`||t.startsWith(`\\d`)?c=`display`:t.startsWith(`\\t`)&&(c=`text`),{type:`genfrac`,mode:e.mode,continued:!1,numer:r,denom:i,hasBarLine:a,leftDelim:o,rightDelim:s,scriptLevel:c,barSize:null}},mathmlBuilder:dn}),g({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 fn=function(e){let t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};g({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=v(t[0]),a=i.type===`atom`&&i.family===`open`?fn(i.text):null,o=v(t[1]),s=o.type===`atom`&&o.family===`close`?fn(o.text):null,c=G(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=G(f.body[0],`textord`);d=cn[Number(e.text)]}}else f=G(f,`textord`),d=cn[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:dn}),g({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:G(r[0],`size`).value,token:n}}}),g({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:({parser:e,funcName:t},n)=>{let r=n[0],i=l(G(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:dn}),g({type:`hbox`,names:[`\\hbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInArgument:!0,allowedInText:!1},handler({parser:e},t){return{type:`hbox`,mode:e.mode,body:y(t[0])}},mathmlBuilder(e,t){let n=t.withLevel(J.TEXT);return Te(B(e.body,n))}}),g({type:`horizBracket`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],props:{numArgs:1},handler({parser:e,funcName:t},n){return{type:`horizBracket`,mode:e.mode,label:t,isOver:/^\\over/.test(t),base:n[0]}},mathmlBuilder:(e,t)=>{let n=fe(e.label);return n.style[`math-depth`]=0,new x(e.isOver?`mover`:`munder`,[V(e.base,t),n])}}),g({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=G(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:y(o)}},mathmlBuilder:(e,t)=>{let n=B(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 pn=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(!We(r))throw new e(`Invalid unit: '`+r.unit+`' in \\includegraphics.`);return r}};g({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=G(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=pn(t);break;case`height`:o=pn(t);break;case`totalheight`:s=pn(t);break;default:throw new e(`Invalid key: '`+r[0]+`' in \\includegraphics.`)}}}}let l=G(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=H(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=H(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 ce(e.src,e.alt,a);return o.height=n,o.depth=r,new x(`mtext`,[o])}}),g({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=G(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=H(e.dimension,t),r=n.number>0&&n.unit===`em`?mn(n.number):``;if(e.mode===`text`&&r.length>0)return new x(`mtext`,[new S(r)]);if(n.number>=0){let e=new x(`mspace`);return e.setAttribute(`width`,n.number+n.unit),e}else{let e=new x(`mrow`);return e.style.marginLeft=n.number+n.unit,e}}});var mn=function(e){return e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?` `:``},hn=/[^A-Za-z_0-9-]/g;g({type:`label`,names:[`\\label`],props:{numArgs:1,argTypes:[`raw`]},handler({parser:e},t){return{type:`label`,mode:e.mode,string:t[0].string.replace(hn,``)}},mathmlBuilder(e,t){let n=new x(`mrow`,[],[`tml-label`]);return e.string.length>0&&n.setLabel(e.string),n}});var gn=[`\\clap`,`\\llap`,`\\rlap`];g({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`,`\\clap`,`\\llap`,`\\rlap`],props:{numArgs:1,allowedInText:!0},handler:({parser:t,funcName:n,token:r},i)=>{if(gn.includes(n)){if(t.settings.strict&&t.mode!==`text`)throw new e(`{${n}} can be used only in text mode.
|
||
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;e.alignment===`llap`&&(n=new x(`mpadded`,[new x(`mphantom`,z(y(e.body),t))]),n.setAttribute(`width`,`0.1px`));let r=V(e.body,t),i;if(e.alignment===`llap`?(r.style.position=`absolute`,r.style.right=`0`,r.style.bottom=`0`,i=new x(`mpadded`,[n,r])):i=new x(`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`,`0.1px`),i}}),g({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}}}),g({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,n){throw new e(`Mismatched ${t.funcName}`,n)}});var _n=(e,t)=>{switch(t.level){case J.DISPLAY:return e.display;case J.TEXT:return e.text;case J.SCRIPT:return e.script;case J.SCRIPTSCRIPT:return e.scriptscript;default:return e.text}};g({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:({parser:e},t)=>({type:`mathchoice`,mode:e.mode,display:y(t[0]),text:y(t[1]),script:y(t[2]),scriptscript:y(t[3])}),mathmlBuilder:(e,t)=>B(_n(e,t),t)});var vn=[`text`,`textord`,`mathord`,`atom`];function yn(e,t){let n,r=z(e.body,t);if(e.mclass===`minner`)n=new x(`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 x(`mi`,r);else{n=new x(`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 x(`mrow`,r);let i=t.level<2;n.type===`mrow`?i&&(e.mclass===`mbin`?(n.children.unshift(U(.2222)),n.children.push(U(.2222))):e.mclass===`mrel`?(n.children.unshift(U(.2778)),n.children.push(U(.2778))):e.mclass===`mpunct`?n.children.push(U(.1667)):e.mclass===`minner`&&(n.children.unshift(U(.0556)),n.children.push(U(.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}g({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=c(r),a=!0,o={type:`mathord`,text:``,mode:e.mode},s=r.body?r.body:[r];for(let t of s)if(vn.includes(t.type))C[e.mode][t.text]?o.text+=C[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 a&&t===`\\mathord`&&o.type===`mathord`&&o.text.length>1?o:{type:`mclass`,mode:e.mode,mclass:`m`+t.slice(5),body:y(a?o:r),isCharacterBox:i,mustPromote:a}},mathmlBuilder:yn});var bn=e=>{let t=e.type===`ordgroup`&&e.body.length&&e.body.length===1?e.body[0]:e;if(t.type===`atom`){let n=e.body.length>0&&e.body[0].text&&C.math[e.body[0].text]?C.math[e.body[0].text].group:t.family;return n===`bin`||n===`rel`?`m`+n:`mord`}else return`mord`};g({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler({parser:e},t){return{type:`mclass`,mode:e.mode,mclass:bn(t[0]),body:y(t[1]),isCharacterBox:c(t[1])}}}),g({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler({parser:e,funcName:t},n){let r=n[1],i=n[0],a;a=t===`\\stackrel`?`mrel`:bn(r);let o={type:a===`mrel`||a===`mbin`?`op`:`ordgroup`,mode:r.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:t!==`\\stackrel`,body:y(r)};return{type:`supsub`,mode:i.mode,stack:!0,base:o,sup:t===`\\underset`?null:i,sub:t===`\\underset`?i:null}},mathmlBuilder:yn});var xn=(e,t,n)=>{if(!e)return n;let r=V(e,t);return r.type===`mrow`&&r.children.length===0?n:r};g({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=V(e.base,t),r=new x(`mprescripts`),i=new x(`none`),a=[],o=xn(e.prescripts.sub,t,i),s=xn(e.prescripts.sup,t,i);return e.isSideset&&(o.setAttribute(`style`,`text-align: left;`),s.setAttribute(`style`,`text-align: left;`)),a=e.postscripts?[n,xn(e.postscripts.sub,t,i),xn(e.postscripts.sup,t,i),r,o,s]:[n,r,o,s],new x(`mmultiscripts`,a)}}),g({type:`not`,names:[`\\not`],props:{numArgs:1,primitive:!0,allowedInText:!1},handler({parser:e},t){let n=c(t[0]),r;return n?(r=y(t[0]),r[0].text.charAt(0)===`\\`&&(r[0].text=C.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?z(e.body,t,!0)[0]:B(e.body,t)}});var Sn=[`textord`,`mathord`,`atom`],Cn=[`\\smallint`],wn=[`textord`,`mathord`,`ordgroup`,`close`,`leftright`,`font`],Tn=e=>{e.attributes.lspace=`0.1667em`,e.attributes.rspace=`0.1667em`},En=(e,t)=>{let n;if(e.symbol)n=new x(`mo`,[R(e.name,e.mode)]),Cn.includes(e.name)?n.setAttribute(`largeop`,`false`):n.setAttribute(`movablelimits`,`false`),e.fromMathOp&&Tn(n);else if(e.body)n=new x(`mo`,z(e.body,t)),e.fromMathOp&&Tn(n);else if(n=new x(`mi`,[new S(e.name.slice(1))]),!e.parentIsSupSub){let t=new x(`mo`,[R(``,`text`)]),r=[n,t];if(e.needsLeadingSpace){let e=new x(`mspace`);e.setAttribute(`width`,`0.1667em`),r.unshift(e)}if(!e.isFollowedByDelimiter){let e=new x(`mspace`);e.setAttribute(`width`,`0.1667em`),r.push(e)}n=new x(`mrow`,r)}return n},Dn={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨅":`\\bigsqcap`,"⨆":`\\bigsqcup`,"⨃":`\\bigcupdot`,"⨇":`\\bigdoublevee`,"⨈":`\\bigdoublewedge`,"⨉":`\\bigtimes`};g({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=Dn[r]),{type:`op`,mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!0,stack:!1,name:r}},mathmlBuilder:En}),g({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&&Sn.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:y(n)}},mathmlBuilder:En});var On={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`,"∱":`\\intclockwise`,"∲":`\\varointclockwise`,"⨌":`\\iiiint`,"⨍":`\\intbar`,"⨎":`\\intBar`,"⨏":`\\fint`,"⨒":`\\rppolint`,"⨓":`\\scpolint`,"⨕":`\\pointint`,"⨖":`\\sqint`,"⨗":`\\intlarhk`,"⨘":`\\intx`,"⨙":`\\intcap`,"⨚":`\\intcup`};g({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:Xt(r),needsLeadingSpace:n.length>0&&wn.includes(n),name:t}},mathmlBuilder:En}),g({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:Xt(r),needsLeadingSpace:n.length>0&&wn.includes(n),name:t}},mathmlBuilder:En}),g({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,allowedInArgument:!0},handler({parser:e,funcName:t}){let n=t;return n.length===1&&(n=On[n]),{type:`op`,mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,stack:!1,name:n}},mathmlBuilder:En}),g({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:y(r),alwaysHandleSupSub:t===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1,isFollowedByDelimiter:Xt(a),needsLeadingSpace:i.length>0&&wn.includes(i)}},mathmlBuilder:(e,t)=>{let n=z(e.body,t.withFont(`mathrm`)),r=!0;for(let e=0;e<n.length;e++){let t=n[e];if(t instanceof x)switch(((t.type===`mrow`||t.type===`mpadded`)&&t.children.length===1&&t.children[0]instanceof x||t.type===`mrow`&&t.children.length===2&&t.children[0]instanceof x&&t.children[1]instanceof x&&t.children[1].type===`mspace`&&!t.children[1].attributes.width&&t.children[1].children.length===0)&&(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=mn(Number(i));a===``?r=!1:n[e]=new x(`mtext`,[new S(a)])}break;case`mo`:{let e=t.children[0];t.children.length===1&&e instanceof S?e.text=e.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break}default:r=!1}else r=!1}if(r)n=[new S(n.map(e=>e.toText()).join(``))];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 x(`mrow`,n);{let e=new x(`mo`,[R(``,`text`)]);return b([n[0],e])}}let i;if(r?(i=new x(`mi`,n),n[0].text.length===1&&i.setAttribute(`mathvariant`,`normal`)):i=new x(`mrow`,n),!e.parentIsSupSub){let t=new x(`mo`,[R(``,`text`)]),n=[i,t];if(e.needsLeadingSpace){let e=new x(`mspace`);e.setAttribute(`width`,`0.1667em`),n.unshift(e)}if(!e.isFollowedByDelimiter){let e=new x(`mspace`);e.setAttribute(`width`,`0.1667em`),n.push(e)}return b(n)}return i}}),Y(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),_({type:`ordgroup`,mathmlBuilder(e,t){return B(e.body,t,e.semisimple)}}),g({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:({parser:e},t)=>{let n=t[0];return{type:`phantom`,mode:e.mode,body:y(n)}},mathmlBuilder:(e,t)=>new x(`mphantom`,z(e.body,t))}),g({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=new x(`mpadded`,[new x(`mphantom`,z(y(e.body),t))]);return n.setAttribute(`height`,`0px`),n.setAttribute(`depth`,`0px`),n}}),g({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=new x(`mpadded`,[new x(`mphantom`,z(y(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),g({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler({parser:e},t){return{type:`pmb`,mode:e.mode,body:y(t[0])}},mathmlBuilder(e,t){let n=le(z(e.body,t));return n.setAttribute(`style`,`font-weight:bold`),n}});var kn=(e,t)=>{let n=t.withLevel(J.TEXT),r=new x(`mpadded`,[V(e.body,n)]),i=H(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};g({type:`raise`,names:[`\\raise`,`\\lower`],props:{numArgs:2,argTypes:[`size`,`primitive`],primitive:!0},handler({parser:e,funcName:t},n){let r=G(n[0],`size`).value;t===`\\lower`&&(r.number*=-1);let i=n[1];return{type:`raise`,mode:e.mode,dy:r,body:i}},mathmlBuilder:kn}),g({type:`raise`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler({parser:e,funcName:t},n){let r=G(n[0],`size`).value,i=n[1];return{type:`raise`,mode:e.mode,dy:r,body:i}},mathmlBuilder:kn}),g({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(hn,``)}},mathmlBuilder(e,t){let n=e.funcName===`\\ref`?[`tml-ref`]:[`tml-ref`,`tml-eqref`];return new se(`#`+e.string,n,null)}}),g({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=V(e.body,t);return n.style.transform=`scaleX(-1)`,n}}),g({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler({parser:e}){return{type:`internal`,mode:e.mode}}}),g({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=G(t[0],`size`),a=G(t[1],`size`);return{type:`rule`,mode:e.mode,shift:r&&G(r,`size`).value,width:i.value,height:a.value}},mathmlBuilder(e,t){let n=H(e.width,t),r=H(e.height,t),i=e.shift?H(e.shift,t):{number:0,unit:`em`},a=t.color&&t.getColor()||`black`,o=new x(`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 x(`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 An=/^[0-9]$/,jn={0:`₀`,1:`₁`,2:`₂`,3:`₃`,4:`₄`,5:`₅`,6:`₆`,7:`₇`,8:`₈`,9:`₉`},Mn={0:`⁰`,1:`¹`,2:`²`,3:`³`,4:`⁴`,5:`⁵`,6:`⁶`,7:`⁷`,8:`⁸`,9:`⁹`};g({type:`sfrac`,names:[`\\sfrac`],props:{numArgs:2,allowedInText:!0,allowedInMath:!0},handler({parser:t},n){let r=``;for(let t of n[0].body){if(t.type!==`textord`||!An.test(t.text))throw new e(`Numerator must be an integer.`,t);r+=t.text}let i=``;for(let t of n[1].body){if(t.type!==`textord`||!An.test(t.text))throw new e(`Denominator must be an integer.`,t);i+=t.text}return{type:`sfrac`,mode:t.mode,numerator:r,denominator:i}},mathmlBuilder(e,t){let n=e.numerator.split(``).map(e=>Mn[e]).join(``),r=e.denominator.split(``).map(e=>jn[e]).join(``);return new x(`mn`,[new S(n+`⁄`+r,e.mode,t)],[`special-fraction`])}});var Nn={"\\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};g({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(Nn[e.funcName]),r=le(z(e.body,n)),i=(Nn[e.funcName]/t.fontSize).toFixed(4);return r.setAttribute(`mathsize`,i+`em`),r}}),g({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:({parser:e},t,n)=>{let r=!1,i=!1,a=n[0]&&G(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 x(`mpadded`,[V(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}});var Pn=`a.c.e.ı.m.n.o.r.s.u.v.w.x.z.α.ε.ι.κ.ν.ο.π.σ.τ.υ.ω.\\alpha.\\epsilon.\\iota.\\kappa.\\nu.\\omega.\\pi.\\tau.\\omega`.split(`.`);g({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler({parser:e},t,n){let r=n[0],i=t[0];return i.body&&i.body.length===1&&i.body[0].text&&Pn.includes(i.body[0].text)&&i.body.push({type:`rule`,mode:`math`,shift:null,width:{number:0,unit:`pt`},height:{number:.5,unit:`em`}}),{type:`sqrt`,mode:e.mode,body:i,index:r}},mathmlBuilder(e,t){let{body:n,index:r}=e;return r?new x(`mroot`,[V(n,t),V(r,t.incrementLevel())]):new x(`msqrt`,[V(n,t)])}});var Fn={display:0,text:1,script:2,scriptscript:3},In={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]};g({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(Fn[e.scriptLevel]),r=le(z(e.body,n)),i=In[e.scriptLevel];return r.setAttribute(`scriptlevel`,i[0]),r.setAttribute(`displaystyle`,i[1]),r}});var Ln=/^m(over|under|underover)$/,Rn=`DHKLUcegorsuvxyzΠΥΨαδηιμνοτυχϵ`,zn=`BCEFGIMNOPQRSTXZlpqtwΓΘΞΣΦΩβεζθξρςφψϑϕϱ`,Bn=`AJdfΔΛ`;_({type:`supsub`,mathmlBuilder(e,t){let n=!1,r,i,a=!1,o=!1,s=!1;e.base&&e.base.type===`horizBracket`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&!e.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.stack&&e.base.body.length===1?[V(e.base.body[0],t)]:[V(e.base,t)],l=t.inSubOrSup();if(e.sub){let n=V(e.sub,l);t.level===3&&n.setAttribute(`scriptlevel`,`2`),c.push(n)}if(e.sup){let n=V(e.sup,l);if(t.level===3&&n.setAttribute(`scriptlevel`,`2`),e.base&&e.base.text&&e.base.text.length===1){let t=e.base.text;Rn.indexOf(t)>-1?n.classes.push(`tml-sml-pad`):zn.indexOf(t)>-1?n.classes.push(`tml-med-pad`):Bn.indexOf(t)>-1&&n.classes.push(`tml-lrg-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===J.DISPLAY||n.alwaysHandleSupSub)||n&&n.type===`operatorname`&&n.alwaysHandleSupSub&&(n.limits||t.level===J.DISPLAY)?`mover`:`msup`}else if(e.sup){let n=e.base;u=n&&(n.type===`op`&&n.limits||n.type===`multiscript`)&&(t.level===J.DISPLAY||n.alwaysHandleSupSub)||n&&n.type===`operatorname`&&n.alwaysHandleSupSub&&(t.level===J.DISPLAY||n.limits)?`munderover`:`msubsup`}else{let n=e.base;u=e.stack||n&&n.type===`op`&&n.limits&&(t.level===J.DISPLAY||n.alwaysHandleSupSub)||n&&n.type===`operatorname`&&n.alwaysHandleSupSub&&(n.limits||t.level===J.DISPLAY)?`munder`:`msub`}let d=new x(u,c);if(a){let e=new x(`mo`,[R(``,`text`)]);if(s){let t=new x(`mspace`);t.setAttribute(`width`,`0.1667em`),d=b([t,d,e])}else d=b([d,e]);if(o){let e=new x(`mspace`);e.setAttribute(`width`,`0.1667em`),d.children.push(e)}}else Ln.test(u)&&(d=new x(`mrow`,[d]));return d}});var Vn=[`\\shortmid`,`\\nshortmid`,`\\shortparallel`,`\\nshortparallel`,`\\smallsetminus`],Hn=[`\\Rsh`,`\\Lsh`,`\\restriction`],Un=e=>{if(e.length===1){let t=e.codePointAt(0);return 8591<t&&t<8704}return e.indexOf(`arrow`)>-1||e.indexOf(`harpoon`)>-1||Hn.includes(e)};_({type:`atom`,mathmlBuilder(e,t){let n=new x(`mo`,[R(e.text,e.mode)]);if(e.family===`punct`)n.setAttribute(`separator`,`true`);else if(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`));else if(e.text===`\\mid`)n.setAttribute(`lspace`,`0.22em`),n.setAttribute(`rspace`,`0.22em`),n.setAttribute(`stretchy`,`false`);else if(e.family===`rel`&&Un(e.text))n.setAttribute(`stretchy`,`false`);else if(Vn.includes(e.text))n.setAttribute(`mathsize`,`70%`);else if(e.text===`:`)n.attributes.lspace=`0.2222em`,n.attributes.rspace=`0.2222em`;else if(e.needsSpacing)return e.family===`bin`?new x(`mrow`,[U(.222),n,U(.222)]):new x(`mrow`,[U(.2778),n,U(.2778)]);return n}});var Wn={mathbf:`bold`,mathrm:`normal`,textit:`italic`,mathit:`italic`,mathnormal:`italic`,mathbb:`double-struck`,mathcal:`script`,mathfrak:`fraktur`,mathscr:`script`,mathsf:`sans-serif`,mathtt:`monospace`},Gn=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 C[r][i]&&C[r][i].replace&&(i=C[r][i].replace),Object.prototype.hasOwnProperty.call(Wn,n)?Wn[n]:null},Kn=Object.freeze({B:8426,E:8427,F:8427,H:8387,I:8391,L:8390,M:8422,R:8393,e:8394,g:8355,o:8389}),qn=Object.freeze({C:8426,H:8388,I:8392,R:8394,Z:8398}),Jn=Object.freeze({C:8383,H:8389,N:8391,P:8393,Q:8393,R:8395,Z:8394}),Yn=Object.freeze({ϵ:119527,ϑ:119564,ϰ:119534,φ:119577,ϱ:119535,ϖ:119563}),Xn=Object.freeze({ϵ:119643,ϑ:119680,ϰ:119650,φ:119693,ϱ:119651,ϖ:119679}),Zn=Object.freeze({ϵ:119701,ϑ:119738,ϰ:119708,φ:119751,ϱ:119709,ϖ:119737}),Qn=Object.freeze({ϵ:119759,ϑ:119796,ϰ:119766,φ:119809,ϱ:119767,ϖ:119795}),$n=Object.freeze({upperCaseLatin:{normal:e=>0,bold:e=>119743,italic:e=>119795,"bold-italic":e=>119847,script:e=>Kn[e]||119899,"script-bold":e=>119951,fraktur:e=>qn[e]||120003,"fraktur-bold":e=>120107,"double-struck":e=>Jn[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=>Kn[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=>Yn[e]||-51,italic:e=>0,"bold-italic":e=>Xn[e]||58,script:e=>0,"script-bold":e=>0,fraktur:e=>0,"fraktur-bold":e=>0,"double-struck":e=>0,"sans-serif":e=>Zn[e]||116,"sans-serif-bold":e=>Zn[e]||116,"sans-serif-italic":e=>0,"sans-serif-bold-italic":e=>Qn[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}}),er=(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||Yn[e]?`varGreek`:47<n&&n<58?`numeral`:`other`;return r===`other`?e:String.fromCodePoint(n+$n[r][t](e))},tr=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:`ᴢ`}),nr=/^\d(?:[\d,.]*\d)?$/,rr=/[A-Ba-z]/,ir=new Set([`\\prime`,`\\dprime`,`\\trprime`,`\\qprime`,`\\backprime`,`\\backdprime`,`\\backtrprime`]),ar=(e,t,n)=>{let r=new x(`mstyle`,[new x(n,[e])]);return r.style[`font-style`]=`italic`,r.style[`font-family`]=`Cambria, 'Times New Roman', serif`,t===`bold-italic`&&(r.style[`font-weight`]=`bold`),r};_({type:`mathord`,mathmlBuilder(e,t){let n=R(e.text,e.mode,t),r=n.text.codePointAt(0),i=912<r&&r<938?`normal`:`italic`,a=Gn(e,t)||i;if(a===`script`)return n.text=er(n.text,a),new x(`mi`,[n],[t.font]);a!==`italic`&&(n.text=er(n.text,a));let o=new x(`mi`,[n]);if(a===`normal`&&(o.setAttribute(`mathvariant`,`normal`),n.text.length===1)){let e=new x(`mspace`,[]);o=new x(`mrow`,[o,e])}return o}}),_({type:`textord`,mathmlBuilder(e,t){let n=e.text,r=n.codePointAt(0);t.fontFamily===`textsc`&&96<r&&r<123&&(n=tr[n]);let i=R(n,e.mode,t),a=Gn(e,t)||`normal`,o;if(nr.test(e.text)){let t=e.mode===`text`?`mtext`:`mn`;if(a===`italic`||a===`bold-italic`)return ar(i,a,t);a!==`normal`&&(i.text=i.text.split(``).map(e=>er(e,a)).join(``)),o=new x(t,[i])}else if(e.mode===`text`)a!==`normal`&&(i.text=er(i.text,a)),o=new x(`mtext`,[i]);else if(ir.has(e.text))o=new x(`mo`,[i]),o.classes.push(`tml-prime`);else{let e=i.text;a!==`italic`&&(i.text=er(i.text,a)),o=new x(`mi`,[i]),i.text===e&&rr.test(e)&&o.setAttribute(`mathvariant`,`italic`)}return o}});var or={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},sr={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};_({type:`spacing`,mathmlBuilder(t,n){let r;if(Object.prototype.hasOwnProperty.call(sr,t.text))r=new x(`mtext`,[new S(`\xA0`)]);else if(Object.prototype.hasOwnProperty.call(or,t.text))r=new x(`mo`),t.text===`\\nobreak`&&r.setAttribute(`linebreak`,`nobreak`);else throw new e(`Unknown type of space "${t.text}"`);return r}}),_({type:`tag`});var cr={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`,"\\textsc":`textsc`},lr={"\\textbf":`textbf`,"\\textmd":`textmd`},ur={"\\textit":`textit`,"\\textup":`textup`},dr=(e,t)=>{let n=e.font;return n?cr[n]?t.withTextFontFamily(cr[n]):lr[n]?t.withTextFontWeight(lr[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(ur[n]):t};g({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:y(r),font:t}},mathmlBuilder(e,t){let n=dr(e,t);return Te(B(e.body,n))}}),g({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 x(`mtd`,[V(e.body,t)]);return n.style.padding=`0`,new x(`mtable`,[new x(`mtr`,[n])])}}),g({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 x(`mtext`,[new S(fr(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var fr=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),pr=m,mr=`[ \r
|
||
]`,hr=`\\\\[a-zA-Z@]+`,gr=`\\\\[^\ud800-\udfff]`,_r=`(${hr})${mr}*`,vr=`\\\\(
|
||
|[ \r ]+
|
||
?)[ \r ]*`,yr=`[̀-ͯ]`,br=RegExp(`${yr}+$`),xr=`(${mr}+)|${vr}|([!-\\[\\]-‧-豈-]${yr}*|[�d800-�dbff][�dc00-�dfff]${yr}*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|${_r}|${gr})`,Sr=class{constructor(e,t){this.input=e,this.settings=t,this.tokenRegex=new RegExp(xr,`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 q(`EOF`,new K(this,n,n));let r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new e(`Unexpected character: '${t[n]}'`,new q(t[n],new K(this,n,n+1)));let i=r[6]||r[3]||(r[2]?`\\ `:` `);if(this.catcodes[i]===14){let n=t.indexOf(`
|
||
`,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 q(i,new K(this,n,this.tokenRegex.lastIndex))}},Cr=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}},wr={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Tr=class{constructor(e,t,n){this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Cr(lt,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Sr(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 q(`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 q(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 Sr(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(pr,e)||Object.prototype.hasOwnProperty.call(C.math,e)||Object.prototype.hasOwnProperty.call(C.text,e)||Object.prototype.hasOwnProperty.call(wr,e)}isExpandable(e){let t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(pr,e)&&!pr[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},Er=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Dr=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`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),Or=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`}),kr={"́":{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`}},Ar={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ď:`ď`,ḋ:`ḋ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ĺ:`ĺ`,ľ:`ľ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ď:`Ď`,Ḋ:`Ḋ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ť:`Ť`,Ṫ:`Ṫ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},jr=[`bin`,`op`,`open`,`punct`,`rel`],Mr=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/,Nr=/^ *\\text/,Pr=class t{constructor(e,t,n=!1){this.mode=`math`,this.gullet=new Tr(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 q(`}`)),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&&pr[a.text]&&pr[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;do i=this.parseGroup(t);while(i.type&&i.type===`internal`);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(n&&n.type===`internal`||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(Dr[t.text]){let e=Er.test(t.text),n=[];for(n.push(new q(Dr[t.text])),this.consume();;){let t=this.fetch().text;if(!Dr[t]||Er.test(t)!==e)break;n.unshift(new q(Dr[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:Xt(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=pr[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=pr[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=Mr.exec(n.text);if(!i)throw new e(`Invalid size: '`+n.text+`'`,n);let a={number:+(i[1]+i[2]),unit:i[3]};if(!We(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(t,n){let r=this.fetch(),i=r.text;if(t===`argument to '\\left'`)return this.parseSymbol();let a;if(i===`{`||i===`\\begingroup`||i===`\\toggle`){this.consume();let e=i===`{`?`}`:i===`\\begingroup`?`\\endgroup`:`\\endtoggle`;this.gullet.beginGroup();let t=this.parseExpression(!1,e),n=this.fetch();this.expect(e),this.gullet.endGroup(),a={type:n.text===`\\endtoggle`?`toggle`:`ordgroup`,mode:this.mode,loc:K.range(r,n),body:t,semisimple:i===`\\begingroup`||void 0}}else if(a=this.parseFunction(n,t)||this.parseSymbol(),a==null&&i[0]===`\\`&&!Object.prototype.hasOwnProperty.call(wr,i)){if(this.settings.throwOnError)throw new e(`Unsupported function name: `+i,r);a=this.formatUnsupportedCmd(i),this.consume()}return a}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:K.range(r,e[n+2]),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:K.range(r,e[n+1]),text:`--`}),--t)),(i===`'`||i==="`")&&e[n+1].text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:K.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 --
|
||
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(Ar,n[0])&&this.mode===`math`&&!C[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=Ar[n[0]]+n.slice(1)}let r=this.mode===`math`?br.exec(n):null;r&&(n=n.substring(0,r.index),n===`i`?n=`ı`:n===`j`&&(n=`ȷ`));let i;if(C[this.mode][n]){let e=C[this.mode][n].group;e===`bin`&&(jr.includes(this.prevAtomType)||this.prevAtomType===``)&&(e=`open`);let r=K.range(t),a;if(Object.prototype.hasOwnProperty.call(he,e)){let t=e;a={type:`atom`,mode:this.mode,family:t,loc:r,text:n},(t===`rel`||t===`bin`)&&this.prevAtomType===`text`&&Nr.test(r.lexer.input.slice(r.end))&&(a.needsSpacing=!0)}else{if(Or[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:Or[n]}}}a={type:e,mode:this.mode,loc:r,text:n}}i=a}else if(n.charCodeAt(0)>=128||br.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:K.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(!kr[a])throw new e(`Unknown accent ' ${a}'`,t);let o=kr[a][this.mode]||kr[a].text;if(!o)throw new e(`Accent ${a} unsupported in ${this.mode} mode`,t);i={type:`accent`,mode:this.mode,loc:K.range(t),label:o,isStretchy:!1,base:i}}return i}},Fr=function(t,n){if(!(typeof t==`string`||t instanceof String))throw TypeError(`Temml can only parse string typed expression`);let r,i;try{i=new Pr(t,n),delete i.gullet.macros.current[`\\df@tag`],r=i.parse()}catch(e){if(e.toString()===`ParseError: Unmatched delimiter`)n.wrapDelimiterPairs=!1,i=new Pr(t,n),delete i.gullet.macros.current[`\\df@tag`],r=i.parse();else throw e}if(!(r.length>0&&r[0].type&&r[0].type===`array`&&r[0].addEqnNum)&&i.gullet.macros.get(`\\df@tag`)){if(!n.displayMode)throw new e(`\\tag works only in display mode`);i.gullet.feed(`\\df@tag`),r=[{type:`tag`,mode:`text`,body:r,tag:i.parse()}]}return r},Ir=[2,2,3,3],Lr=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:Ir[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}},Rr=`0.13.02`;function zr(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.textContent=``,e.appendChild(i)})}var Br=function(e,t,n){let r=n,i=0,a=e.length;for(;r<t.length;){let n=t[r];if(i<=0&&t.slice(r,r+a)===e)return r;n===`\\`?r++:n===`{`?i++:n===`}`&&i--,r++}return-1},Vr=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)},Hr=/^\\(?:begin|(?:eq)?ref){/,Ur=function(e,t){let n,r=[],i=RegExp(`(`+t.map(e=>Vr(e.left)).join(`|`)+`)`);for(;n=e.search(i),n!==-1;){n>0&&(r.push({type:`text`,data:e.slice(0,n)}),e=e.slice(n));let i=t.findIndex(t=>e.startsWith(t.left));if(n=Br(t[i].right,e,t[i].left.length),n===-1)break;let a=e.slice(0,n+t[i].right.length),o=Hr.test(a)?a:e.slice(t[i].left.length,n);r.push({type:`math`,data:o,rawData:a,display:t[i].display}),e=e.slice(n+t[i].right.length)}return e!==``&&r.push({type:`text`,data:e}),r},Wr=[{left:`$$`,right:`$$`,display:!0},{left:`\\(`,right:`\\)`,display:!1},{left:`\\begin{equation}`,right:`\\end{equation}`,display:!0},{left:`\\begin{equation*}`,right:`\\end{equation*}`,display:!0},{left:`\\begin{align}`,right:`\\end{align}`,display:!0},{left:`\\begin{align*}`,right:`\\end{align*}`,display:!0},{left:`\\begin{alignat}`,right:`\\end{alignat}`,display:!0},{left:`\\begin{alignat*}`,right:`\\end{alignat*}`,display:!0},{left:`\\begin{gather}`,right:`\\end{gather}`,display:!0},{left:`\\begin{gather*}`,right:`\\end{gather*}`,display:!0},{left:`\\begin{CD}`,right:`\\end{CD}`,display:!0},{left:`\\ref{`,right:`}`,display:!1},{left:`\\eqref{`,right:`}`,display:!1},{left:`\\[`,right:`\\]`,display:!0}],Gr={$:[{left:`$$`,right:`$$`,display:!0},{left:"$`",right:"`$",display:!1},{left:`$`,right:`$`,display:!1}],"(":[{left:`\\[`,right:`\\]`,display:!0},{left:`\\(`,right:`\\)`,display:!1}]},Kr=[{left:`\\begin{equation}`,right:`\\end{equation}`,display:!0},{left:`\\begin{equation*}`,right:`\\end{equation*}`,display:!0},{left:`\\begin{align}`,right:`\\end{align}`,display:!0},{left:`\\begin{align*}`,right:`\\end{align*}`,display:!0},{left:`\\begin{alignat}`,right:`\\end{alignat}`,display:!0},{left:`\\begin{alignat*}`,right:`\\end{alignat*}`,display:!0},{left:`\\begin{gather}`,right:`\\end{gather}`,display:!0},{left:`\\begin{gather*}`,right:`\\end{gather*}`,display:!0},{left:`\\begin{CD}`,right:`\\end{CD}`,display:!0},{left:`\\ref{`,right:`}`,display:!1},{left:`\\eqref{`,right:`}`,display:!1}],qr=e=>e===`$`||e===`(`?Gr[e]:e===`$+`||e===`(+`?Gr[e.slice(0,1)].concat(Kr):e===`ams`?Kr:e===`all`?Gr[`(`].concat(Gr.$).concat(Kr):Wr,Jr=function(t,n){let r=Ur(t,n.delimiters);if(r.length===1&&r[0].type===`text`)return null;let i=document.createDocumentFragment();for(let t=0;t<r.length;t++)if(r[t].type===`text`)i.appendChild(document.createTextNode(r[t].data));else{let a=document.createElement(`span`),o=r[t].data;n.displayMode=r[t].display;try{n.preProcess&&(o=n.preProcess(o)),temml.render(o,a,n)}catch(a){if(!(a instanceof e))throw a;n.errorCallback("Temml auto-render: Failed to parse `"+r[t].data+"` with ",a),i.appendChild(document.createTextNode(r[t].rawData));continue}i.appendChild(a)}return i},Yr=function(e,t){for(let n=0;n<e.childNodes.length;n++){let r=e.childNodes[n];if(r.nodeType===3){let i=Jr(r.textContent,t);i&&(n+=i.childNodes.length-1,e.replaceChild(i,r))}else if(r.nodeType===1){let e=` `+r.className+` `;t.ignoredTags.indexOf(r.nodeName.toLowerCase())===-1&&t.ignoredClasses.every(t=>e.indexOf(` `+t+` `)===-1)&&Yr(r,t)}}},Xr=function(e,t){if(!e)throw Error(`No element provided to render`);let n={};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);n.fences?n.delimiters=qr(n.fences):n.delimiters=n.delimiters||Wr,n.ignoredTags=n.ignoredTags||[`script`,`noscript`,`style`,`textarea`,`pre`,`code`,`option`],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},Yr(e,n),zr(e)},Zr=function(e,t,n={}){t.textContent=``;let r=t.tagName.toLowerCase()===`math`;r&&(n.wrap=`none`);let i=ni(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.`),Zr=function(){throw new e(`Temml doesn't work in quirks mode.`)});var Qr=function(e,t){return ni(e,t).toMarkup()},$r=function(e,t){return Fr(e,new p(t))},ei=function(e,t){let n=new p(t);if(n.macros={},!(typeof e==`string`||e instanceof String))throw TypeError(`Temml can only parse string typed expression`);let r=new Pr(e,n,!0);return delete r.gullet.macros.current[`\\df@tag`],r.parse()},ti=function(t,n,r){if(r.throwOnError||!(t instanceof e))throw t;let i=new ae([`temml-error`],[new oe(n+`
|
||
|
||
`+t.toString())]);return i.style.color=r.errorColor,i.style.whiteSpace=`pre-line`,i},ni=function(e,t){let n=new p(t);try{return Pe(Fr(e,n),e,new Lr({level:n.displayMode?J.DISPLAY:J.TEXT,maxSize:n.maxSize}),n)}catch(t){return ti(t,e,n)}},ri={version:Rr,render:Zr,renderToString:Qr,renderMathInElement:Xr,postProcess:zr,ParseError:e,definePreamble:ei,__parse:$r,__renderToMathMLTree:ni,__defineSymbol:w,__defineMacro:Y};export{ri as default};
|
||
//# sourceMappingURL=temml-BKKuir3p.js.map
|