Files
ALC27/mathjax/input/tex.js
2025-12-22 12:20:15 +08:00

1 line
145 KiB
JavaScript

(()=>{"use strict";var t={d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{FindTeX:()=>st});var r={};t.r(r),t.d(r,{default:()=>ht});var s={};t.r(s),t.d(s,{default:()=>ft});var n={};t.r(n),t.d(n,{ConfigurationType:()=>bt,HandlerType:()=>At});var i={};t.r(i),t.d(i,{UnitUtil:()=>vt});var a={};t.r(a),t.d(a,{default:()=>kt});var o={};t.r(o),t.d(o,{default:()=>Mt});var c={};t.r(c),t.d(c,{BaseItem:()=>Tt,MmlStack:()=>xt});var l={};t.r(l),t.d(l,{TexConstant:()=>Pt});var h={};t.r(h),t.d(h,{default:()=>Et});var m={};t.r(m),t.d(m,{default:()=>It});var u={};t.r(u),t.d(u,{NodeFactory:()=>Nt});var d={};t.r(d),t.d(d,{KeyValueDef:()=>Rt,KeyValueTypes:()=>Dt,ParseUtil:()=>qt});var g={};t.r(g),t.d(g,{ColumnParser:()=>_t});var p={};t.r(p),t.d(p,{default:()=>jt});var f={};t.r(f),t.d(f,{AbstractTags:()=>Xt,AllTags:()=>Vt,Label:()=>Kt,NoTags:()=>$t,TagInfo:()=>zt,TagsFactory:()=>Yt});var b={};t.r(b),t.d(b,{Macro:()=>Zt,Token:()=>Qt});var A={};t.r(A),t.d(A,{AbstractParseMap:()=>se,AbstractTokenMap:()=>ee,CharacterMap:()=>ne,CommandMap:()=>oe,DelimiterMap:()=>ie,EnvironmentMap:()=>ce,MacroMap:()=>ae,RegExpMap:()=>re,parseResult:()=>te});var y={};t.r(y),t.d(y,{MapHandler:()=>ue,SubHandler:()=>de,SubHandlers:()=>ge});var v={};t.r(v),t.d(v,{Configuration:()=>pe,ConfigurationHandler:()=>be,ParserConfiguration:()=>Ae});var k={};t.r(k),t.d(k,{ArrayItem:()=>je,BeginItem:()=>Le,BreakItem:()=>Ne,CellItem:()=>Be,CloseItem:()=>xe,DotsItem:()=>Ue,EndItem:()=>Fe,EqnArrayItem:()=>Ke,EquationItem:()=>Xe,FnItem:()=>qe,LeftItem:()=>Se,Middle:()=>Oe,MmlItem:()=>Ge,MstyleItem:()=>ze,NonscriptItem:()=>He,NotItem:()=>_e,NullItem:()=>Te,OpenItem:()=>Me,OverItem:()=>Ce,PositionItem:()=>De,PrimeItem:()=>Pe,RightItem:()=>Ie,StartItem:()=>ke,StopItem:()=>we,StyleItem:()=>Re,SubsupItem:()=>Ee});var w={};t.r(w),t.d(w,{default:()=>rr,splitAlignArray:()=>Ze});var M={};t.r(M),t.d(M,{default:()=>ir});var x={};t.r(x),t.d(x,{BaseConfiguration:()=>pr,BaseTags:()=>gr,Other:()=>dr});var T={};t.r(T),t.d(T,{TeX:()=>fr});var P={};t.r(P),t.d(P,{FlalignItem:()=>Ar,MultlineItem:()=>br});var E={};t.r(E),t.d(E,{NewcommandPriority:()=>vr,NewcommandTables:()=>yr,NewcommandUtil:()=>kr});var C={};t.r(C),t.d(C,{AmsMethods:()=>xr});var S={};t.r(S),t.d(S,{BeginEnvItem:()=>Tr});var O={};t.r(O),t.d(O,{default:()=>Er});var I={};t.r(I),t.d(I,{NewcommandConfig:()=>Cr,NewcommandConfiguration:()=>Sr});var N={};t.r(N),t.d(N,{AmsConfiguration:()=>Ir,AmsTags:()=>Or});var L={};t.r(L),t.d(L,{RequireConfiguration:()=>Xr,RequireLoad:()=>jr,RequireMethods:()=>Kr,options:()=>zr});var F={};t.r(F),t.d(F,{AutoloadConfiguration:()=>Wr});var R={};t.r(R),t.d(R,{ConfigMacrosConfiguration:()=>es});var D={};t.r(D),t.d(D,{NoUndefinedConfiguration:()=>rs});var B={};t.r(B),t.d(B,{TextParser:()=>ss});var G={};t.r(G),t.d(G,{TextMacrosMethods:()=>as});var q={};t.r(q),t.d(q,{TextBaseConfiguration:()=>cs,TextMacrosConfiguration:()=>hs});const _=("undefined"!=typeof window?window:global).MathJax._.components.global,H=(_.GLOBAL,_.isObject,_.combineConfig,_.combineDefaults,_.combineWithMathJax),U=(_.MathJax,MathJax._.core.InputJax.AbstractInputJax),j=MathJax._.util.Options,K=(j.isObject,j.APPEND,j.REMOVE,j.OPTIONS,j.Expandable,j.expandable),z=(j.makeArray,j.keys,j.copy,j.insert),X=j.defaultOptions,$=j.userOptions,V=(j.selectOptions,j.selectOptionsFromKeys,j.separateOptions),J=j.lookup,W=MathJax._.core.FindMath.AbstractFindMath,Y=MathJax._.util.string,Q=Y.sortLength,Z=Y.quotePattern,tt=(Y.unicodeChars,Y.unicodeString,Y.isPercent,Y.split,Y.replaceUnicode),et=(Y.toEntity,MathJax._.core.MathItem),rt=et.protoItem;et.AbstractMathItem,et.STATE,et.newState;class st extends W{constructor(t){super(t),this.getPatterns()}getPatterns(){const t=this.options,e=[],r=[],s=[];this.end={},this.env=this.sub=0;let n=1;t.inlineMath.forEach((t=>this.addPattern(e,t,!1))),t.displayMath.forEach((t=>this.addPattern(e,t,!0))),e.length&&r.push(e.sort(Q).join("|")),t.processEnvironments&&(r.push("\\\\begin\\s*\\{([^}]*)\\}"),this.env=n,n++),t.processEscapes&&s.push("\\\\([\\\\$])"),t.processRefs&&s.push("(\\\\(?:eq)?ref\\s*\\{[^}]*\\})"),s.length&&(r.push("("+s.join("|")+")"),this.sub=n),this.start=new RegExp(r.join("|"),"g"),this.hasPatterns=r.length>0}addPattern(t,e,r){const[s,n]=e;t.push(Z(s)),this.end[s]=[n,r,this.endPattern(n)]}endPattern(t,e){return new RegExp((e||Z(t))+"|\\\\(?:[a-zA-Z]|.)|[{}]","g")}findEnd(t,e,r,s){const[n,i,a]=s,o=a.lastIndex=r.index+r[0].length;let c,l=0;for(;c=a.exec(t);){if((c[1]||c[0])===n&&0===l)return rt(r[0],t.substring(o,c.index),c[0],e,r.index,c.index+c[0].length,i);"{"===c[0]?l++:"}"===c[0]&&l&&l--}return null}findMathInString(t,e,r){let s,n;for(this.start.lastIndex=0;s=this.start.exec(r);){if(void 0!==s[this.env]&&this.env){const t="\\\\end\\s*(\\{"+Z(s[this.env])+"\\})";n=this.findEnd(r,e,s,["{"+s[this.env]+"}",!0,this.endPattern(null,t)]),n&&(n.math=n.open+n.math+n.close,n.open=n.close="")}else if(void 0!==s[this.sub]&&this.sub){const t=s[this.sub],r=s.index+s[this.sub].length;n=2===t.length?rt("\\",t.substring(1),"",e,s.index,r):rt("",t,"",e,s.index,r,!1)}else n=this.findEnd(r,e,s,this.end[s[0]]);n&&(t.push(n),this.start.lastIndex=n.end.n)}}findMath(t){const e=[];if(this.hasPatterns)for(let r=0,s=t.length;r<s;r++)this.findMathInString(e,r,t[r]);return e}}st.OPTIONS={inlineMath:[["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0,processRefs:!0};const nt=MathJax._.core.MmlTree.MmlNode,it=nt.TEXCLASS,at=(nt.TEXCLASSNAMES,nt.MATHVARIANTS,nt.indentAttributes,nt.AbstractMmlNode),ot=(nt.AbstractMmlTokenNode,nt.AbstractMmlLayoutNode,nt.AbstractMmlBaseNode,nt.AbstractMmlEmptyNode),ct=(nt.TextNode,nt.XMLNode,MathJax._.core.MmlTree.MmlNodes.mo.MmlMo),lt={attrs:new Set(["autoOP","fnOP","movesupsub","subsupOK","texprimestyle","useHeight","variantForm","withDelims","mathaccent","open","close"]),createEntity:t=>String.fromCodePoint(parseInt(t,16)),getChildren:t=>t.childNodes,getText:t=>t.getText(),appendChildren(t,e){for(const r of e)t.appendChild(r)},setAttribute(t,e,r){t.attributes.set(e,r)},setProperty(t,e,r){t.setProperty(e,r)},setProperties(t,e){for(const r of Object.keys(e)){const s=e[r];"texClass"===r?(t.texClass=s,t.setProperty(r,s)):"movablelimits"===r?(t.setProperty("movablelimits",s),(t.isKind("mo")||t.isKind("mstyle"))&&t.attributes.set("movablelimits",s)):"inferred"===r||(lt.attrs.has(r)?t.setProperty(r,s):t.attributes.set(r,s))}},getProperty:(t,e)=>t.getProperty(e),getAttribute:(t,e)=>t.attributes.get(e),removeAttribute(t,e){t.attributes.unset(e)},removeProperties(t,...e){t.removeProperty(...e)},getChildAt:(t,e)=>t.childNodes[e],setChild(t,e,r){t.childNodes[e]=r,r&&(r.parent=t)},copyChildren(t,e){const r=t.childNodes;for(let t=0;t<r.length;t++)this.setChild(e,t,r[t])},copyAttributes(t,e){e.attributes=t.attributes,this.setProperties(e,t.getAllProperties())},isType:(t,e)=>t.isKind(e),isEmbellished:t=>t.isEmbellished,getTexClass:t=>t.texClass,getCoreMO:t=>t.coreMO(),isNode:t=>t instanceof at||t instanceof ot,isInferred:t=>t.isInferred,getForm(t){if(!t.isKind("mo"))return null;const e=t,r=e.getForms();for(const t of r){const r=this.getOp(e,t);if(r)return r}return null},getOp:(t,e="infix")=>ct.OPTABLE[e][t.getText()]||null,getMoAttribute(t,e){var r,s;if(!t.attributes.isSet(e))for(const n of["infix","postfix","prefix"]){const i=null===(s=null===(r=this.getOp(t,n))||void 0===r?void 0:r[3])||void 0===s?void 0:s[e];if(void 0!==i)return i}return t.attributes.get(e)}},ht=lt;function mt(t,e,r){const s=e.attributes,n=r.attributes;t.forEach((t=>{const e=n.getExplicit(t);null!=e&&s.set(t,e)}))}function ut(t,e){const r=(t,e)=>t.getExplicitNames().filter((r=>r!==e&&("stretchy"!==r||t.getExplicit("stretchy"))&&"data-latex"!==r&&"data-latex-item"!==r)),s=t.attributes,n=e.attributes,i=r(s,"lspace"),a=r(n,"rspace");if(i.length!==a.length)return!1;for(const t of i)if(s.getExplicit(t)!==n.getExplicit(t))return!1;return!0}function dt(t,e,r){const s=[];for(const n of t.getList("m"+e+r)){const i=n.childNodes;if(i[n[e]]&&i[n[r]])continue;const a=n.parent,o=i[n[e]]?t.nodeFactory.create("node","m"+e,[i[n.base],i[n[e]]]):t.nodeFactory.create("node","m"+r,[i[n.base],i[n[r]]]);ht.copyAttributes(n,o),a.replaceChild(o,n),s.push(n)}t.removeFromList("m"+e+r,s)}function gt(t,e,r){const s=[];for(const n of t.getList(e)){if(n.attributes.get("displaystyle"))continue;const e=n.childNodes[n.base],i=e.coreMO();if(e.getProperty("movablelimits")&&!i.attributes.hasExplicit("movablelimits")){const e=t.nodeFactory.create("node",r,n.childNodes);ht.copyAttributes(n,e),n.parent.replaceChild(e,n),s.push(n)}}t.removeFromList(e,s)}const pt={cleanStretchy(t){const e=t.data;for(const t of e.getList("fixStretchy"))if(ht.getProperty(t,"fixStretchy")){const r=ht.getForm(t);r&&r[3]&&r[3].stretchy&&ht.setAttribute(t,"stretchy",!1);const s=t.parent;if(!(ht.getTexClass(t)||r&&r[2])){const r=e.nodeFactory.create("node","TeXAtom",[t]);s.replaceChild(r,t),r.inheritAttributesFrom(t)}ht.removeProperties(t,"fixStretchy")}},cleanAttributes(t){t.data.root.walkTree(((t,e)=>{const r=t.attributes,s=new Set((r.get("mjx-keep-attrs")||"").split(/ /));r.unset("mjx-keep-attrs");for(const e of r.getExplicitNames())s.has(e)||r.get(e)!==t.attributes.getInherited(e)||r.unset(e)}),{})},combineRelations(t){const e=[];for(const r of t.data.getList("mo")){if(r.getProperty("relationsCombined")||!r.parent||r.parent&&!ht.isType(r.parent,"mrow")||ht.getTexClass(r)!==it.REL)continue;let t;const s=r.parent.childNodes,n=s.indexOf(r)+1,i=ht.getProperty(r,"variantForm");for(;n<s.length&&(t=s[n])&&ht.isType(t,"mo")&&ht.getTexClass(t)===it.REL;){if(i!==ht.getProperty(t,"variantForm")||!ut(r,t)){r.attributes.hasExplicit("rspace")||ht.setAttribute(r,"rspace","0pt"),t.attributes.hasExplicit("lspace")||ht.setAttribute(t,"lspace","0pt");break}ht.appendChildren(r,ht.getChildren(t)),mt(["stretchy","rspace"],r,t);for(const e of t.getPropertyNames())r.setProperty(e,t.getProperty(e));t.attributes.get("data-latex")&&r.attributes.set("data-latex",r.attributes.get("data-latex")+t.attributes.get("data-latex")),s.splice(n,1),e.push(t),t.parent=null,t.setProperty("relationsCombined",!0),r.setProperty("texClass",it.REL)}r.attributes.setInherited("form",r.getForms()[0])}t.data.removeFromList("mo",e)},cleanSubSup(t){const e=t.data;e.error||(dt(e,"sub","sup"),dt(e,"under","over"))},moveLimits(t){const e=t.data;gt(e,"munderover","msubsup"),gt(e,"munder","msub"),gt(e,"mover","msup")},setInherited(t){t.data.root.setInheritedAttributes({},t.math.display,0,!1)},checkScriptlevel(t){const e=t.data,r=[];for(const t of e.getList("mstyle")){if(1!==t.childNodes[0].childNodes.length)continue;const e=t.attributes;for(const t of["displaystyle","scriptlevel"])e.getExplicit(t)===e.getInherited(t)&&e.unset(t);const s=e.getExplicitNames();if(0===s.filter((t=>"data-latex"!==t.substring(0,10))).length){const n=t.childNodes[0].childNodes[0];s.forEach((t=>n.attributes.set(t,e.get(t)))),t.parent.replaceChild(n,t),r.push(t)}}e.removeFromList("mstyle",r)}},ft=pt;var bt,At;!function(t){t.HANDLER="handler",t.FALLBACK="fallback",t.ITEMS="items",t.TAGS="tags",t.OPTIONS="options",t.NODES="nodes",t.PREPROCESSORS="preprocessors",t.POSTPROCESSORS="postprocessors",t.INIT="init",t.CONFIG="config",t.PRIORITY="priority",t.PARSER="parser"}(bt||(bt={})),function(t){t.DELIMITER="delimiter",t.MACRO="macro",t.CHARACTER="character",t.ENVIRONMENT="environment"}(At||(At={}));const yt=7.2;const vt={UNIT_CASES:new class{constructor(t){this.num="([-+]?([.,]\\d+|\\d+([.,]\\d*)?))",this.unit="",this.dimenEnd=/./,this.dimenRest=/./,this.map=new Map(t),this.updateDimen()}updateDimen(){this.unit=`(${Array.from(this.map.keys()).join("|")})`,this.dimenEnd=RegExp("^\\s*"+this.num+"\\s*"+this.unit+"\\s*$"),this.dimenRest=RegExp("^\\s*"+this.num+"\\s*"+this.unit+" ?")}set(t,e){return this.map.set(t,e),this.updateDimen(),this}get(t){return this.map.get(t)||this.map.get("pt")}delete(t){return!!this.map.delete(t)&&(this.updateDimen(),!0)}}([["em",1],["ex",.43],["pt",.1],["pc",1.2],["px",.1],["in",yt],["cm",yt/2.54],["mm",yt/25.4],["mu",1/18]]),matchDimen(t,e=!1){const r=t.match(e?vt.UNIT_CASES.dimenRest:vt.UNIT_CASES.dimenEnd);return r?function([t,e,r]){return"mu"!==e?[t,e,r]:[vt.em(vt.UNIT_CASES.get(e)*parseFloat(t)).slice(0,-2),"em",r]}([r[1].replace(/,/,"."),r[4],r[0].length]):[null,null,0]},dimen2em(t){const[e,r]=vt.matchDimen(t),s=parseFloat(e||"1");return vt.UNIT_CASES.get(r)*s},em:t=>Math.abs(t)<6e-4?"0em":t.toFixed(3).replace(/\.?0+$/,"")+"em",trimSpaces(t){if("string"!=typeof t)return t;let e=t.trim();return e.match(/\\$/)&&t.match(/ $/)&&(e+=" "),e}};class kt{constructor(t,e,r){this._factory=t,this._env=e,this.global={},this.stack=[],this.global={isInner:r},this.stack=[this._factory.create("start",this.global)],e&&(this.stack[0].env=e),this.env=this.stack[0].env}set env(t){this._env=t}get env(){return this._env}Push(...t){for(const e of t){if(!e)continue;const t=ht.isNode(e)?this._factory.create("mml",e):e;t.global=this.global;const[r,s]=this.stack.length?this.Top().checkItem(t):[null,!0];s&&(r?(this.Pop(),this.Push(...r)):(t.isKind("null")||this.stack.push(t),t.env?(t.copyEnv&&Object.assign(t.env,this.env),this.env=t.env):t.env=this.env))}}Pop(){const t=this.stack.pop();return t.isOpen||delete t.env,this.env=this.stack.length?this.Top().env:{},t}Top(t=1){return this.stack.length<t?null:this.stack[this.stack.length-t]}Prev(t){const e=this.Top();return t?e.First:e.Pop()}get height(){return this.stack.length}toString(){return"stack[\n "+this.stack.join("\n ")+"\n]"}}class wt{static processString(t,e){const r=t.split(wt.pattern);for(let t=1,s=r.length;t<s;t+=2){let s=r[t].charAt(0);if(s>="0"&&s<="9")r[t]=e[parseInt(r[t],10)-1],"number"==typeof r[t]&&(r[t]=r[t].toString());else if("{"===s)if(s=r[t].substring(1),s>="0"&&s<="9")r[t]=e[parseInt(r[t].substring(1,r[t].length-1),10)-1],"number"==typeof r[t]&&(r[t]=r[t].toString());else{r[t].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/)&&(r[t]="%"+r[t])}}return r.join("")}constructor(t,e,...r){this.id=t,this.message=wt.processString(e,r)}}wt.pattern=/%(\d+|\{\d+\}|\{[a-z]+:%\d+(?:\|(?:%\{\d+\}|%.|[^}])*)+\}|.)/g;const Mt=wt;class xt{constructor(t){this._nodes=t,this.startStr="",this.startI=0,this.stopI=0}get nodes(){return this._nodes}Push(...t){this._nodes.push(...t)}Pop(){return this._nodes.pop()}get First(){return this._nodes[this.Size()-1]}set First(t){this._nodes[this.Size()-1]=t}get Last(){return this._nodes[0]}set Last(t){this._nodes[0]=t}Peek(t){return null==t&&(t=1),this._nodes.slice(this.Size()-t)}Size(){return this._nodes.length}Clear(){this._nodes=[]}toMml(t=!0,e){return 1!==this._nodes.length||e?this.create("node",t?"inferredMrow":"mrow",this._nodes,{}):this.First}create(t,...e){return this.factory.configuration.nodeFactory.create(t,...e)}}class Tt extends xt{constructor(t,...e){super(e),this.factory=t,this.global={},this._properties={},this.isOpen&&(this._env={})}get kind(){return"base"}get env(){return this._env}set env(t){this._env=t}get copyEnv(){return!0}getProperty(t){return this._properties[t]}setProperty(t,e){return this._properties[t]=e,this}get isOpen(){return!1}get isClose(){return!1}get isFinal(){return!1}isKind(t){return t===this.kind}checkItem(t){if(t.isKind("over")&&this.isOpen&&(t.setProperty("num",this.toMml(!1)),this.Clear()),t.isKind("cell")&&this.isOpen){if(t.getProperty("linebreak"))return Tt.fail;throw new Mt("Misplaced","Misplaced %1",t.getName())}if(t.isClose&&this.getErrors(t.kind)){const[e,r]=this.getErrors(t.kind);throw new Mt(e,r,t.getName())}return t.isFinal?(this.Push(t.First),Tt.fail):Tt.success}clearEnv(){for(const t of Object.keys(this.env))delete this.env[t]}setProperties(t){return Object.assign(this._properties,t),this}getName(){return this.getProperty("name")}toString(){return this.kind+"["+this.nodes.join("; ")+"]"}getErrors(t){return this.constructor.errors[t]||Tt.errors[t]}}Tt.fail=[null,!1],Tt.success=[null,!0],Tt.errors={end:["MissingBeginExtraEnd","Missing \\begin{%1} or extra \\end{%1}"],close:["ExtraCloseMissingOpen","Extra close brace or missing open brace"],right:["MissingLeftExtraRight","Missing \\left or extra \\right"],middle:["ExtraMiddle","Extra \\middle"]};const Pt={Variant:{NORMAL:"normal",BOLD:"bold",ITALIC:"italic",BOLDITALIC:"bold-italic",DOUBLESTRUCK:"double-struck",FRAKTUR:"fraktur",BOLDFRAKTUR:"bold-fraktur",SCRIPT:"script",BOLDSCRIPT:"bold-script",SANSSERIF:"sans-serif",BOLDSANSSERIF:"bold-sans-serif",SANSSERIFITALIC:"sans-serif-italic",SANSSERIFBOLDITALIC:"sans-serif-bold-italic",MONOSPACE:"monospace",INITIAL:"inital",TAILED:"tailed",LOOPED:"looped",STRETCHED:"stretched",CALLIGRAPHIC:"-tex-calligraphic",BOLDCALLIGRAPHIC:"-tex-bold-calligraphic",OLDSTYLE:"-tex-oldstyle",BOLDOLDSTYLE:"-tex-bold-oldstyle",MATHITALIC:"-tex-mathit"},Form:{PREFIX:"prefix",INFIX:"infix",POSTFIX:"postfix"},LineBreak:{AUTO:"auto",NEWLINE:"newline",NOBREAK:"nobreak",GOODBREAK:"goodbreak",BADBREAK:"badbreak"},LineBreakStyle:{BEFORE:"before",AFTER:"after",DUPLICATE:"duplicate",INFIXLINBREAKSTYLE:"infixlinebreakstyle"},IndentAlign:{LEFT:"left",CENTER:"center",RIGHT:"right",AUTO:"auto",ID:"id",INDENTALIGN:"indentalign"},IndentShift:{INDENTSHIFT:"indentshift"},LineThickness:{THIN:"thin",MEDIUM:"medium",THICK:"thick"},Notation:{LONGDIV:"longdiv",ACTUARIAL:"actuarial",PHASORANGLE:"phasorangle",RADICAL:"radical",BOX:"box",ROUNDEDBOX:"roundedbox",CIRCLE:"circle",LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom",UPDIAGONALSTRIKE:"updiagonalstrike",DOWNDIAGONALSTRIKE:"downdiagonalstrike",VERTICALSTRIKE:"verticalstrike",HORIZONTALSTRIKE:"horizontalstrike",NORTHEASTARROW:"northeastarrow",MADRUWB:"madruwb",UPDIAGONALARROW:"updiagonalarrow"},Align:{TOP:"top",BOTTOM:"bottom",CENTER:"center",BASELINE:"baseline",AXIS:"axis",LEFT:"left",RIGHT:"right"},Lines:{NONE:"none",SOLID:"solid",DASHED:"dashed"},Side:{LEFT:"left",RIGHT:"right",LEFTOVERLAP:"leftoverlap",RIGHTOVERLAP:"rightoverlap"},Width:{AUTO:"auto",FIT:"fit"},Actiontype:{TOGGLE:"toggle",STATUSLINE:"statusline",TOOLTIP:"tooltip",INPUT:"input"},Overflow:{LINBREAK:"linebreak",SCROLL:"scroll",ELIDE:"elide",TRUNCATE:"truncate",SCALE:"scale"},Unit:{EM:"em",EX:"ex",PX:"px",IN:"in",CM:"cm",MM:"mm",PT:"pt",PC:"pc"},Attr:{LATEX:"data-latex",LATEXITEM:"data-latex-item"}};class Et{constructor(t,e,r){this._string=t,this.configuration=r,this.macroCount=0,this.i=0,this.currentCS="",this.saveI=0;const s=Object.hasOwn(e,"isInner"),n=e.isInner;let i;if(delete e.isInner,e){i={};for(const t of Object.keys(e))i[t]=e[t]}this.configuration.pushParser(this),this.stack=new kt(this.itemFactory,i,!s||n),this.Parse(),this.Push(this.itemFactory.create("stop")),this.updateResult(this.string,this.i),this.stack.env=i}get options(){return this.configuration.options}get itemFactory(){return this.configuration.itemFactory}get tags(){return this.configuration.tags}set string(t){this._string=t}get string(){return this._string}parse(t,e){const r=this.saveI;this.saveI=this.i;const s=this.configuration.handlers.get(t).parse(e);return this.updateResult(e[1],r),this.saveI=r,s}lookup(t,e){return this.configuration.handlers.get(t).lookup(e)}contains(t,e){return this.configuration.handlers.get(t).contains(e)}toString(){let t="";for(const e of Array.from(this.configuration.handlers.keys()))t+=e+": "+this.configuration.handlers.get(e)+"\n";return t}Parse(){let t;for(;this.i<this.string.length;)t=this.getCodePoint(),this.i+=t.length,this.parse(At.CHARACTER,[this,t])}Push(t){t instanceof Tt&&(t.startI=this.saveI,t.stopI=this.i,t.startStr=this.string),t instanceof at&&t.isInferred?this.PushAll(t.childNodes):this.stack.Push(t)}PushAll(t){for(const e of t)this.stack.Push(e)}mml(){if(!this.stack.Top().isKind("mml"))return null;const t=this.stack.Top().First;return this.configuration.popParser(),t.attributes.set(Pt.Attr.LATEX,this.string),t}convertDelimiter(t){var e;const r=this.lookup(At.DELIMITER,t);return null!==(e=null==r?void 0:r.char)&&void 0!==e?e:null}getCodePoint(){const t=this.string.codePointAt(this.i);return void 0===t?"":String.fromCodePoint(t)}nextIsSpace(){return!!this.string.charAt(this.i).match(/\s/)}GetNext(){for(;this.nextIsSpace();)this.i++;return this.getCodePoint()}GetCS(){const t=this.string.slice(this.i).match(/^(([a-z]+) ?|[\uD800-\uDBFF].|.)/i);return t?(this.i+=t[0].length,t[2]||t[1]):(this.i++," ")}GetArgument(t,e=!1){switch(this.GetNext()){case"":if(!e)throw new Mt("MissingArgFor","Missing argument for %1",this.currentCS);return null;case"}":if(!e)throw new Mt("ExtraCloseMissingOpen","Extra close brace or missing open brace");return null;case"\\":return this.i++,"\\"+this.GetCS();case"{":{const t=++this.i;let e=1;for(;this.i<this.string.length;)switch(this.string.charAt(this.i++)){case"\\":this.i++;break;case"{":e++;break;case"}":if(0===--e)return this.string.slice(t,this.i-1)}throw new Mt("MissingCloseBrace","Missing close brace")}}const r=this.getCodePoint();return this.i+=r.length,r}GetBrackets(t,e,r=!1){if("["!==this.GetNext())return e;const s=++this.i;let n=0,i=0;for(;this.i<this.string.length;)switch(this.string.charAt(this.i++)){case"{":n++;break;case"\\":this.i++;break;case"}":if(n--<=0)throw new Mt("ExtraCloseLooking","Extra close brace while looking for %1","']'");break;case"[":0===n&&i++;break;case"]":if(0===n){if(!r||0===i)return this.string.slice(s,this.i-1);i--}}throw new Mt("MissingCloseBracket","Could not find closing ']' for argument to %1",this.currentCS)}GetDelimiter(t,e=!1){let r=this.GetNext();if(this.i+=r.length,this.i<=this.string.length&&("\\"===r?r+=this.GetCS():"{"===r&&e&&(this.i--,r=this.GetArgument(t).trim()),this.contains(At.DELIMITER,r)))return this.convertDelimiter(r);throw new Mt("MissingOrUnrecognizedDelim","Missing or unrecognized delimiter for %1",this.currentCS)}GetDimen(t){if("{"===this.GetNext()){const e=this.GetArgument(t),[r,s]=vt.matchDimen(e);if(r)return r+s}else{const t=this.string.slice(this.i),[e,r,s]=vt.matchDimen(t,!0);if(e)return this.i+=s,e+r}throw new Mt("MissingDimOrUnits","Missing dimension or its units for %1",this.currentCS)}GetUpTo(t,e){for(;this.nextIsSpace();)this.i++;const r=this.i;let s=0;for(;this.i<this.string.length;){const t=this.i;let n=this.GetNext();switch(this.i+=n.length,n){case"\\":n+=this.GetCS();break;case"{":s++;break;case"}":if(0===s)throw new Mt("ExtraCloseLooking","Extra close brace while looking for %1",e);s--}if(0===s&&n===e)return this.string.slice(r,t)}throw new Mt("TokenNotFoundForCommand","Could not find %1 for %2",e,this.currentCS)}ParseArg(t){return new Et(this.GetArgument(t),this.stack.env,this.configuration).mml()}ParseUpTo(t,e){return new Et(this.GetUpTo(t,e),this.stack.env,this.configuration).mml()}GetDelimiterArg(t){const e=vt.trimSpaces(this.GetArgument(t));if(""===e)return null;if(this.contains(At.DELIMITER,e))return e;throw new Mt("MissingOrUnrecognizedDelim","Missing or unrecognized delimiter for %1",this.currentCS)}GetStar(){const t="*"===this.GetNext();return t&&this.i++,t}create(t,...e){const r=this.configuration.nodeFactory.create(t,...e);return r.isToken&&r.attributes.hasExplicit("mathvariant")&&"-"===r.attributes.get("mathvariant").charAt(0)&&r.setProperty("ignore-variant",!0),r}updateResult(t,e){const r=this.stack.Prev(!0);if(!r)return;const s=r.attributes.get(Pt.Attr.LATEXITEM);if(void 0!==s)return void r.attributes.set(Pt.Attr.LATEX,s);let n=(e=e<this.saveI?this.saveI:e)!==this.i?this.string.slice(e,this.i):t;if(n=n.trim(),n)if("\\"===t&&(n="\\"+n),"^"!==r.attributes.get(Pt.Attr.LATEX)||"^"===n||"\\^"===n)if("_"!==r.attributes.get(Pt.Attr.LATEX)||"_"===n||"\\_"===n)"}"!==n?r.attributes.set(Pt.Attr.LATEX,n):this.composeBraces(r);else if(r.childNodes[1]&&("}"===n?this.composeBraces(r.childNodes[1]):r.childNodes[1].attributes.set(Pt.Attr.LATEX,n)),r.childNodes[2]){const t=r.childNodes[2].attributes.get(Pt.Attr.LATEX);this.composeLatex(r,`^${t}_`,0,1)}else this.composeLatex(r,"_",0,1);else if(r.childNodes[2]&&("}"===n?this.composeBraces(r.childNodes[2]):r.childNodes[2].attributes.set(Pt.Attr.LATEX,n)),r.childNodes[1]){const t=r.childNodes[1].attributes.get(Pt.Attr.LATEX);this.composeLatex(r,`_${t}^`,0,2)}else this.composeLatex(r,"^",0,2)}composeLatex(t,e,r,s){if(!t.childNodes[r]||!t.childNodes[s])return;const n=(t.childNodes[r].attributes.get(Pt.Attr.LATEX)||"")+e+t.childNodes[s].attributes.get(Pt.Attr.LATEX);t.attributes.set(Pt.Attr.LATEX,n)}composeBraces(t){const e=this.composeBracedContent(t);t.attributes.set(Pt.Attr.LATEX,`{${e}}`)}composeBracedContent(t){var e,r;const s=(null===(e=t.childNodes[0])||void 0===e?void 0:e.childNodes)||[];let n="";for(const t of s){const e=(null===(r=null==t?void 0:t.attributes)||void 0===r?void 0:r.get(Pt.Attr.LATEX))||"";e&&(n+=n&&n.match(/[a-zA-Z]$/)&&e.match(/^[a-zA-Z]/)?" "+e:e)}return n}}const Ct=MathJax._.core.Tree.Factory.AbstractFactory;class St extends Tt{}class Ot extends Ct{constructor(){super(...arguments),this.defaultKind="dummy",this.configuration=null}}Ot.DefaultStackItems={[St.prototype.kind]:St};const It=Ot;class Nt{constructor(){this.mmlFactory=null,this.factory={node:Nt.createNode,token:Nt.createToken,text:Nt.createText,error:Nt.createError}}static createNode(t,e,r=[],s={},n){const i=t.mmlFactory.create(e);return i.setChildren(r),n&&i.appendChild(n),ht.setProperties(i,s),i}static createToken(t,e,r={},s=""){const n=t.create("text",s);return t.create("node",e,[],r,n)}static createText(t,e){return null==e?null:t.mmlFactory.create("text").setText(e)}static createError(t,e){const r=t.create("text",e),s=t.create("node","mtext",[],{},r);return t.create("node","merror",[s],{"data-mjx-error":e})}setMmlFactory(t){this.mmlFactory=t}set(t,e){this.factory[t]=e}setCreators(t){for(const e in t)this.set(e,t[e])}create(t,...e){const r=(this.factory[t]||this.factory.node)(this,e[0],...e.slice(1));return"node"===t&&this.configuration.addNode(e[0],r),r}get(t){return this.factory[t]}}const Lt=MathJax._.util.Entities,Ft=(Lt.options,Lt.entities);Lt.add,Lt.remove,Lt.translate,Lt.numeric;class Rt{static oneof(...t){return new this("string",(e=>t.includes(e)),(t=>t))}constructor(t,e,r){this.name=t,this.verify=e,this.convert=r}}const Dt={boolean:new Rt("boolean",(t=>"true"===t||"false"===t),(t=>"true"===t)),number:new Rt("number",(t=>!!t.match(/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?$/)),(t=>parseFloat(t))),integer:new Rt("integer",(t=>!!t.match(/^[-+]?\d+$/)),(t=>parseInt(t))),string:new Rt("string",(t=>!0),(t=>t)),dimen:new Rt("dimen",(t=>null!==vt.matchDimen(t)[0]),(t=>t))};function Bt(t,e){if(0===e)return t.replace(/^\s+/,"").replace(/([^\\\s]|^)((?:\\\\)*(?:\\\s)?)?\s+$/,"$1$2");for(;e>0;)t=t.trim().slice(1,-1),e--;return t}function Gt(t,e,r=!1,s=!1){const n=t.length;let i=0,a="",o=0,c=0,l=!0;for(;o<n;){const s=t[o++];switch(s){case"\\":a+=s+(t[o++]||""),l=!1;continue;case" ":break;case"{":l&&c++,i++;break;case"}":if(!i)throw new Mt("ExtraCloseMissingOpen","Extra close brace or missing open brace");i--,l=!1;break;default:if(!i&&e.includes(s))return[Bt(a,r?Math.min(1,c):c),s,t.slice(o)];c>i&&(c=i),l=!1}a+=s}if(i)throw new Mt("ExtraOpenMissingClose","Extra open brace or missing close brace");return s&&c?["","",Bt(a,1)]:[Bt(a,r?Math.min(1,c):c),"",t.slice(o)]}const qt={cols:(...t)=>t.map((t=>vt.em(t))).join(" "),fenced(t,e,r,s,n="",i=""){const a=t.nodeFactory,o=a.create("node","mrow",[],{open:e,close:s,texClass:it.INNER});let c;if(n)c=new Et("\\"+n+"l"+e,t.parser.stack.env,t).mml();else{const t=a.create("text",e);c=a.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:it.OPEN},t)}if(ht.appendChildren(o,[c,r]),n)c=new Et("\\"+n+"r"+s,t.parser.stack.env,t).mml();else{const t=a.create("text",s);c=a.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:it.CLOSE},t)}return i&&c.attributes.set("mathcolor",i),ht.appendChildren(o,[c]),o},fixedFence(t,e,r,s){const n=t.nodeFactory.create("node","mrow",[],{open:e,close:s,texClass:it.ORD});return e&&ht.appendChildren(n,[qt.mathPalette(t,e,"l")]),ht.isType(r,"mrow")?ht.appendChildren(n,ht.getChildren(r)):ht.appendChildren(n,[r]),s&&ht.appendChildren(n,[qt.mathPalette(t,s,"r")]),n},mathPalette(t,e,r){"{"!==e&&"}"!==e||(e="\\"+e);const s="{\\big"+r+" "+e+"}";return new Et("\\mathchoice"+("{\\bigg"+r+" "+e+"}")+s+s+s,{},t).mml()},fixInitialMO(t,e){for(let r=0,s=e.length;r<s;r++){const s=e[r];if(s&&!ht.isType(s,"mspace")&&(!ht.isType(s,"TeXAtom")||ht.getChildren(s)[0]&&ht.getChildren(ht.getChildren(s)[0]).length)){if(ht.isEmbellished(s)||ht.isType(s,"TeXAtom")&&ht.getTexClass(s)===it.REL){const r=t.nodeFactory.create("node","mi");e.unshift(r)}break}}},internalMath(t,e,r,s){if(e=e.replace(/ +/g," "),t.configuration.options.internalMath)return t.configuration.options.internalMath(t,e,r,s);const n=s||t.stack.env.font,i=n?{mathvariant:n}:{};let a,o,c=[],l=0,h=0,m="",u=0;if(e.match(/\\?[${}\\]|\\\(|\\(?:eq)?ref\s*\{|\\U/)){for(;l<e.length;)if(a=e.charAt(l++),"$"===a)"$"===m&&0===u?(o=t.create("node","TeXAtom",[new Et(e.slice(h,l-1),{},t.configuration).mml()]),c.push(o),m="",h=l):""===m&&(h<l-1&&c.push(qt.internalText(t,e.slice(h,l-1),i)),m="$",h=l);else if("{"===a&&""!==m)u++;else if("}"===a)if("}"===m&&0===u){const r=new Et(e.slice(h,l),{},t.configuration).mml();o=t.create("node","TeXAtom",[r],i),c.push(o),m="",h=l}else""!==m&&u&&u--;else if("\\"===a)if(""===m&&e.substring(l).match(/^(eq)?ref\s*\{/)){const r=RegExp["$&"].length;h<l-1&&c.push(qt.internalText(t,e.slice(h,l-1),i)),m="}",h=l-1,l+=r}else if(a=e.charAt(l++),"("===a&&""===m)h<l-2&&c.push(qt.internalText(t,e.slice(h,l-2),i)),m=")",h=l;else if(")"===a&&")"===m&&0===u)o=t.create("node","TeXAtom",[new Et(e.slice(h,l-2),{},t.configuration).mml()]),c.push(o),m="",h=l;else if(a.match(/[${}\\]/)&&""===m)l--,e=e.substring(0,l-1)+e.substring(l);else if("U"===a){const t=e.substring(l).match(/^\s*(?:([0-9A-F])|\{\s*([0-9A-F]+)\s*\})/);if(!t)throw new Mt("BadRawUnicode","Argument to %1 must a hexadecimal number with 1 to 6 digits","\\U");const r=String.fromCodePoint(parseInt(t[1]||t[2],16));e=e.substring(0,l-2)+r+e.substring(l+t[0].length),l=l-2+r.length}if(""!==m)throw new Mt("MathNotTerminated","Math mode is not properly terminated")}return h<e.length&&c.push(qt.internalText(t,e.slice(h),i)),null!=r?c=[t.create("node","mstyle",c,{displaystyle:!1,scriptlevel:r})]:c.length>1&&(c=[t.create("node","mrow",c)]),c},internalText(t,e,r){e=e.replace(/\n+/g," ").replace(/^ +/,Ft.nbsp).replace(/ +$/,Ft.nbsp);const s=t.create("text",e);return t.create("node","mtext",[],r,s)},underOver(t,e,r,s,n){if(qt.checkMovableLimits(e),ht.isType(e,"munderover")&&ht.isEmbellished(e)){ht.setProperties(ht.getCoreMO(e),{lspace:0,rspace:0});const r=t.create("node","mo",[],{rspace:0});e=t.create("node","mrow",[r,e])}const i=t.create("node","munderover",[e]);ht.setChild(i,"over"===s?i.over:i.under,r);let a=i;return n&&(a=t.create("node","TeXAtom",[t.create("node","mstyle",[i],{displaystyle:!0,scriptlevel:0})],{texClass:it.OP,movesupsub:!0})),ht.setProperty(a,"subsupOK",!0),a},checkMovableLimits(t){const e=ht.isType(t,"mo")?ht.getForm(t):null;(ht.getProperty(t,"movablelimits")||e&&e[3]&&e[3].movablelimits)&&ht.setProperties(t,{movablelimits:!1})},setArrayAlign:(t,e,r)=>(r||(e=vt.trimSpaces(e||"")),"t"===e?t.arraydef.align="baseline 1":"b"===e?t.arraydef.align="baseline -1":"c"===e?t.arraydef.align="axis":e&&(r?(r.string=`[${e}]`+r.string.slice(r.i),r.i=0):t.arraydef.align=e),t),substituteArgs(t,e,r){let s="",n="",i=0;for(;i<r.length;){let a=r.charAt(i++);if("\\"===a)s+=a+r.charAt(i++);else if("#"===a)if(a=r.charAt(i++),"#"===a)s+=a;else{if(!a.match(/[1-9]/)||parseInt(a,10)>e.length)throw new Mt("IllegalMacroParam","Illegal macro parameter reference");n=qt.addArgs(t,qt.addArgs(t,n,s),e[parseInt(a,10)-1]),s=""}else s+=a}return qt.addArgs(t,n,s)},addArgs(t,e,r){if(r.match(/^[a-z]/i)&&e.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)&&(e+=" "),e.length+r.length>t.configuration.options.maxBuffer)throw new Mt("MaxBufferSize","MathJax internal buffer size exceeded; is there a recursive macro call?");return e+r},checkMaxMacros(t,e=!0){if(!(++t.macroCount<=t.configuration.options.maxMacros))throw e?new Mt("MaxMacroSub1","MathJax maximum macro substitution count exceeded; is here a recursive macro call?"):new Mt("MaxMacroSub2","MathJax maximum substitution count exceeded; is there a recursive latex environment?")},checkEqnEnv(t,e=!0){const r=t.stack.Top(),s=r.First;if(!(r.getProperty("nestable")&&e&&!s||r.getProperty("nestStart"))&&(!r.isKind("start")||s))throw new Mt("ErroneousNestingEq","Erroneous nesting of equation structures")},copyNode(t,e){const r=t.copy(),s=e.configuration;return r.walkTree((t=>{s.addNode(t.kind,t);const e=(t.getProperty("in-lists")||"").split(/,/);for(const r of e)r&&s.addNode(r,t)})),r},mmlFilterAttribute:(t,e,r)=>r,getFontDef(t){const e=t.stack.env.font;return e?{mathvariant:e}:{}},keyvalOptions(t,e=null,r=!1,s=!1){const n=function(t,e=!1){const r={};let s,n,i,a=t,o=!0;for(;a;)[n,s,a]=Gt(a,["=",","],e,o),o=!1,"="===s?([i,s,a]=Gt(a,[","],e),i="false"===i||"true"===i?JSON.parse(i):i,r[n]=i):n&&(r[n]=!0);return r}(t,s);if(e)for(const t of Object.keys(n))if(Object.hasOwn(e,t)){if(e[t]instanceof Rt){const r=e[t],s=String(n[t]);if(!r.verify(s))throw new Mt("InvalidValue","Value for key '%1' is not of the expected type",t);n[t]=r.convert(s)}}else{if(r)throw new Mt("InvalidOption","Invalid option: %1",t);delete n[t]}return n},isLatinOrGreekChar:t=>!!t.normalize("NFD").match(/[a-zA-Z\u0370-\u03F0]/)};class _t{constructor(){this.columnHandler={l:t=>t.calign[t.j++]="left",c:t=>t.calign[t.j++]="center",r:t=>t.calign[t.j++]="right",p:t=>this.getColumn(t,"top"),m:t=>this.getColumn(t,"middle"),b:t=>this.getColumn(t,"bottom"),w:t=>this.getColumn(t,"top",""),W:t=>this.getColumn(t,"top",""),"|":t=>this.addRule(t,"solid"),":":t=>this.addRule(t,"dashed"),">":t=>t.cstart[t.j]=(t.cstart[t.j]||"")+this.getBraces(t),"<":t=>t.cend[t.j-1]=(t.cend[t.j-1]||"")+this.getBraces(t),"@":t=>this.addAt(t,this.getBraces(t)),"!":t=>this.addBang(t,this.getBraces(t)),"*":t=>this.repeat(t),P:t=>this.macroColumn(t,">{$}p{#1}<{$}",1),M:t=>this.macroColumn(t,">{$}m{#1}<{$}",1),B:t=>this.macroColumn(t,">{$}b{#1}<{$}",1)," ":t=>{}},this.MAXCOLUMNS=1e4}process(t,e,r){const s={parser:t,template:e,i:0,j:0,c:"",cwidth:[],calign:[],cspace:[],clines:[],cstart:r.cstart,cend:r.cend,ralign:r.ralign,cextra:r.cextra};let n=0;for(;s.i<s.template.length;){if(n++>this.MAXCOLUMNS)throw new Mt("MaxColumns","Too many column specifiers (perhaps looping column definitions?)");const t=s.template.codePointAt(s.i),e=s.c=String.fromCodePoint(t);if(s.i+=e.length,!Object.hasOwn(this.columnHandler,e))throw new Mt("BadPreamToken","Illegal pream-token (%1)",e);this.columnHandler[e](s)}this.setColumnAlign(s,r),this.setColumnWidths(s,r),this.setColumnSpacing(s,r),this.setColumnLines(s,r),this.setPadding(s,r)}setColumnAlign(t,e){e.arraydef.columnalign=t.calign.join(" ")}setColumnWidths(t,e){if(!t.cwidth.length)return;const r=[...t.cwidth];r.length<t.calign.length&&r.push("auto"),e.arraydef.columnwidth=r.map((t=>t||"auto")).join(" ")}setColumnSpacing(t,e){if(!t.cspace.length)return;const r=[...t.cspace];r.length<t.calign.length&&r.push("1em"),e.arraydef.columnspacing=r.slice(1).map((t=>t||"1em")).join(" ")}setColumnLines(t,e){if(!t.clines.length)return;const r=[...t.clines];r[0]&&e.frame.push(["left",r[0]]),r.length>t.calign.length?e.frame.push(["right",r.pop()]):r.length<t.calign.length&&r.push("none"),r.length>1&&(e.arraydef.columnlines=r.slice(1).map((t=>t||"none")).join(" "))}setPadding(t,e){if(!t.cextra[0]&&!t.cextra[t.calign.length-1])return;const r=t.calign.length-1,s=t.cspace,n=t.cextra[r]?s[r]:null;e.arraydef["data-array-padding"]=`${s[0]||".5em"} ${n||".5em"}`}getColumn(t,e,r="left"){t.calign[t.j]=r||this.getAlign(t),t.cwidth[t.j]=this.getDimen(t),t.ralign[t.j]=[e,t.cwidth[t.j],t.calign[t.j]],t.j++}getDimen(t){const e=this.getBraces(t);if(!vt.matchDimen(e)[0])throw new Mt("MissingColumnDimOrUnits","Missing dimension or its units for %1 column declaration",t.c);return e}getAlign(t){const e=this.getBraces(t);return J(e.toLowerCase(),{l:"left",c:"center",r:"right"},"")}getBraces(t){for(;" "===t.template[t.i];)t.i++;if(t.i>=t.template.length)throw new Mt("MissingArgForColumn","Missing argument for %1 column declaration",t.c);if("{"!==t.template[t.i])return t.template[t.i++];const e=++t.i;let r=1;for(;t.i<t.template.length;)switch(t.template.charAt(t.i++)){case"\\":t.i++;break;case"{":r++;break;case"}":if(0===--r)return t.template.slice(e,t.i-1)}throw new Mt("MissingCloseBrace","Missing close brace")}macroColumn(t,e,r){const s=[];for(;r>0&&r--;)s.push(this.getBraces(t));t.template=qt.substituteArgs(t.parser,s,e)+t.template.slice(t.i),t.i=0}addRule(t,e){t.clines[t.j]&&this.addAt(t,"\\,"),t.clines[t.j]=e,"0"===t.cspace[t.j]&&(t.cstart[t.j]="\\hspace{.5em}")}addAt(t,e){const{cstart:r,cspace:s,j:n}=t;t.cextra[n]=!0,t.calign[n]="center",t.clines[n]&&(".5em"===s[n]?r[n-1]+="\\hspace{.25em}":s[n]||(t.cend[n-1]=(t.cend[n-1]||"")+"\\hspace{.5em}")),r[n]=e,s[n]="0",s[++t.j]="0"}addBang(t,e){const{cstart:r,cspace:s,j:n}=t;t.cextra[n]=!0,t.calign[n]="center",r[n]=("0"===s[n]&&t.clines[n]?"\\hspace{.25em}":"")+e,s[n]||(s[n]=".5em"),s[++t.j]=".5em"}repeat(t){const e=this.getBraces(t),r=this.getBraces(t),s=parseInt(e);if(String(s)!==e)throw new Mt("ColArgNotNum","First argument to %1 column specifier must be a number","*");t.template=new Array(s).fill(r).join("")+t.template.substring(t.i),t.i=0}}const Ht=Pt.Variant;class Ut{constructor(t,e=[]){this.options={},this.columnParser=new _t,this.packageData=new Map,this.parsers=[],this.root=null,this.nodeLists={},this.error=!1,this.handlers=t.handlers,this.nodeFactory=new Nt,this.nodeFactory.configuration=this,this.nodeFactory.setCreators(t.nodes),this.itemFactory=new It(t.items),this.itemFactory.configuration=this,X(this.options,...e),X(this.options,t.options),this.mathStyle=Ut.getVariant.get(this.options.mathStyle)||Ut.getVariant.get("TeX")}pushParser(t){this.parsers.unshift(t)}popParser(){this.parsers.shift()}get parser(){return this.parsers[0]}clear(){this.parsers=[],this.root=null,this.nodeLists={},this.error=!1,this.tags.resetTag()}addNode(t,e){let r=this.nodeLists[t];if(r||(r=this.nodeLists[t]=[]),r.push(e),e.kind!==t){const r=ht.getProperty(e,"in-lists")||"",s=(r?r.split(/,/):[]).concat(t).join(",");ht.setProperty(e,"in-lists",s)}}getList(t){const e=this.nodeLists[t]||[],r=[];for(const t of e)this.inTree(t)&&r.push(t);return this.nodeLists[t]=r,r}removeFromList(t,e){const r=this.nodeLists[t]||[];for(const t of e){const e=r.indexOf(t);e>=0&&r.splice(e,1)}}inTree(t){for(;t&&t!==this.root;)t=t.parent;return!!t}}Ut.getVariant=new Map([["TeX",(t,e)=>e&&t.match(/^[\u0391-\u03A9\u03F4]/)?Ht.NORMAL:""],["ISO",t=>Ht.ITALIC],["French",t=>t.normalize("NFD").match(/^[a-z]/)?Ht.ITALIC:Ht.NORMAL],["upright",t=>Ht.NORMAL]]);const jt=Ut;class Kt{constructor(t="???",e=""){this.tag=t,this.id=e}}class zt{constructor(t="",e=!1,r=!1,s=null,n="",i="",a=!1,o=""){this.env=t,this.taggable=e,this.defaultTags=r,this.tag=s,this.tagId=n,this.tagFormat=i,this.noTag=a,this.labelId=o}}class Xt{constructor(){this.counter=0,this.allCounter=0,this.configuration=null,this.ids={},this.allIds={},this.labels={},this.allLabels={},this.redo=!1,this.refUpdate=!1,this.currentTag=new zt,this.history=[],this.stack=[],this.enTag=function(t,e){const r=this.configuration.nodeFactory,s=r.create("node","mtd",[t]),n=r.create("node","mlabeledtr",[e,s]);return r.create("node","mtable",[n],{side:this.configuration.options.tagSide,minlabelspacing:this.configuration.options.tagIndent,displaystyle:!0})}}start(t,e,r){this.currentTag&&this.stack.push(this.currentTag);const s=this.label;this.currentTag=new zt(t,e,r),this.label=s}get env(){return this.currentTag.env}end(){this.history.push(this.currentTag);const t=this.label;this.currentTag=this.stack.pop(),t&&!this.label&&(this.label=t)}tag(t,e){this.currentTag.tag=t,this.currentTag.tagFormat=e?t:this.formatTag(t),this.currentTag.noTag=!1}notag(){this.tag("",!0),this.currentTag.noTag=!0}get noTag(){return this.currentTag.noTag}set label(t){this.currentTag.labelId=t}get label(){return this.currentTag.labelId}formatUrl(t,e){return e+"#"+encodeURIComponent(t)}formatTag(t){return"("+t+")"}formatRef(t){return this.formatTag(t)}formatId(t){return"mjx-eqn:"+t.replace(/\s/g,"_")}formatNumber(t){return t.toString()}autoTag(){null==this.currentTag.tag&&(this.counter++,this.tag(this.formatNumber(this.counter),!1))}clearTag(){this.tag(null,!0),this.currentTag.tagId=""}getTag(t=!1){if(t)return this.autoTag(),this.makeTag();const e=this.currentTag;return e.taggable&&!e.noTag&&(e.defaultTags&&this.autoTag(),e.tag)?this.makeTag():null}resetTag(){this.history=[],this.redo=!1,this.refUpdate=!1,this.clearTag()}reset(t=0){this.resetTag(),this.counter=this.allCounter=t,this.allLabels={},this.allIds={},this.label=""}startEquation(t){this.history=[],this.stack=[],this.clearTag(),this.currentTag=new zt("",void 0,void 0),this.labels={},this.ids={},this.counter=this.allCounter,this.redo=!1;const e=t.inputData.recompile;e&&(this.refUpdate=!0,this.counter=e.counter)}finishEquation(t){this.redo&&(t.inputData.recompile={state:t.state(),counter:this.allCounter}),this.refUpdate||(this.allCounter=this.counter),Object.assign(this.allIds,this.ids),Object.assign(this.allLabels,this.labels)}finalize(t,e){if(!e.display||this.currentTag.env||null==this.currentTag.tag)return t;const r=this.makeTag();return this.enTag(t,r)}makeId(){this.currentTag.tagId=this.formatId(this.configuration.options.useLabelIds&&this.label||this.currentTag.tag)}makeTag(){this.makeId(),this.label&&(this.labels[this.label]=new Kt(this.currentTag.tag,this.currentTag.tagId),this.label="");const t=new Et("\\text{"+this.currentTag.tagFormat+"}",{},this.configuration).mml();return this.configuration.nodeFactory.create("node","mtd",[t],{id:this.currentTag.tagId,rowalign:this.configuration.options.tagAlign})}}class $t extends Xt{autoTag(){}getTag(){return this.currentTag.tag?super.getTag():null}}class Vt extends Xt{finalize(t,e){if(!e.display||this.history.find((function(t){return t.taggable})))return t;const r=this.getTag(!0);return this.enTag(t,r)}}const Jt=new Map([["none",$t],["all",Vt]]);let Wt="none";const Yt={OPTIONS:{tags:Wt,tagSide:"right",tagIndent:"0.8em",useLabelIds:!0,ignoreDuplicateLabels:!1,tagAlign:"baseline"},add(t,e){Jt.set(t,e)},addTags(t){for(const e of Object.keys(t))Yt.add(e,t[e])},create(t){const e=Jt.get(t)||Jt.get(Wt);if(!e)throw Error("Unknown tags class");return new e},setDefault(t){Wt=t},getDefault:()=>Yt.create(Wt)};class Qt{constructor(t,e,r){this._token=t,this._char=e,this._attributes=r}get token(){return this._token}get char(){return this._char}get attributes(){return this._attributes}}class Zt{constructor(t,e,r=[]){this._token=t,this._func=e,this._args=r}get token(){return this._token}get func(){return this._func}get args(){return this._args}}function te(t){return void 0===t||t}class ee{constructor(t,e){this._name=t,this._parser=e,ue.register(this)}get name(){return this._name}parserFor(t){return this.contains(t)?this.parser:null}parse([t,e]){const r=this.parserFor(e),s=this.lookup(e);return r&&s?te(r(t,s)):null}set parser(t){this._parser=t}get parser(){return this._parser}}class re extends ee{constructor(t,e,r){super(t,e),this._regExp=r}contains(t){return this._regExp.test(t)}lookup(t){return this.contains(t)?t:null}}class se extends ee{constructor(){super(...arguments),this.map=new Map}lookup(t){return this.map.get(t)}contains(t){return this.map.has(t)}add(t,e){this.map.set(t,e)}remove(t){this.map.delete(t)}}class ne extends se{constructor(t,e,r){super(t,e);for(const t of Object.keys(r)){const e=r[t],[s,n]="string"==typeof e?[e,null]:e,i=new Qt(t,s,n);this.add(t,i)}}}class ie extends ne{parse([t,e]){return super.parse([t,"\\"+e])}}class ae extends se{constructor(t,e,r={}){super(t,null);const s=t=>"string"==typeof t?r[t]:t;for(const[t,r]of Object.entries(e)){let e,n;Array.isArray(r)?(e=s(r[0]),n=r.slice(1)):(e=s(r),n=[]);const i=new Zt(t,e,n);this.add(t,i)}}parserFor(t){const e=this.lookup(t);return e?e.func:null}parse([t,e]){const r=this.lookup(e),s=this.parserFor(e);return r&&s?te(s(t,r.token,...r.args)):null}}class oe extends ae{parse([t,e]){const r=this.lookup(e),s=this.parserFor(e);if(!r||!s)return null;const n=t.currentCS;t.currentCS="\\"+e;const i=s(t,"\\"+r.token,...r.args);return t.currentCS=n,te(i)}}class ce extends ae{constructor(t,e,r,s={}){super(t,r,s),this.parser=e}parse([t,e]){const r=this.lookup(e),s=this.parserFor(e);return r&&s?te(this.parser(t,r.token,s,r.args)):null}}const le=MathJax._.util.PrioritizedList.PrioritizedList,he=MathJax._.util.FunctionList.FunctionList,me=new Map,ue={register(t){me.set(t.name,t)},getMap:t=>me.get(t)};class de{constructor(){this._configuration=new le,this._fallback=new he}add(t,e,r=le.DEFAULTPRIORITY){for(const e of t.slice().reverse()){const t=ue.getMap(e);if(!t)return void this.warn(`Configuration '${e}' not found! Omitted.`);this._configuration.add(t,r)}e&&this._fallback.add(e,r)}remove(t,e=null){for(const e of t){const t=this.retrieve(e);t&&this._configuration.remove(t)}e&&this._fallback.remove(e)}parse(t){for(const{item:e}of this._configuration){const r=e.parse(t);if(r===de.FALLBACK)break;if(r)return r}const[e,r]=t;Array.from(this._fallback)[0].item(e,r)}lookup(t){const e=this.applicable(t);return e?e.lookup(t):null}contains(t){const e=this.applicable(t);return!(!e||e instanceof ne&&null===e.lookup(t).char)}toString(){const t=[];for(const{item:e}of this._configuration)t.push(e.name);return t.join(", ")}applicable(t){for(const{item:e}of this._configuration)if(e.contains(t))return e;return null}retrieve(t){for(const{item:e}of this._configuration)if(e.name===t)return e;return null}warn(t){console.log("TexParser Warning: "+t)}}de.FALLBACK=Symbol("fallback");class ge{constructor(){this.map=new Map}add(t,e,r=le.DEFAULTPRIORITY){for(const s of Object.keys(t)){const n=s;let i=this.get(n);i||(i=new de,this.set(n,i)),i.add(t[n],e[n],r)}}remove(t,e){for(const r of Object.keys(t)){const s=this.get(r);s&&s.remove(t[r],e[r])}}set(t,e){this.map.set(t,e)}get(t){return this.map.get(t)}retrieve(t){for(const e of this.map.values()){const r=e.retrieve(t);if(r)return r}return null}keys(){return this.map.keys()}}class pe{static makeProcessor(t,e){return Array.isArray(t)?t:[t,e]}static _create(t,e={}){var r;const s=null!==(r=e.priority)&&void 0!==r?r:le.DEFAULTPRIORITY,n=e.init?this.makeProcessor(e.init,s):null,i=e.config?this.makeProcessor(e.config,s):null,a=(e.preprocessors||[]).map((t=>this.makeProcessor(t,s))),o=(e.postprocessors||[]).map((t=>this.makeProcessor(t,s))),c=e.parser||"tex";return new pe(t,e[bt.HANDLER]||{},e[bt.FALLBACK]||{},e[bt.ITEMS]||{},e[bt.TAGS]||{},e[bt.OPTIONS]||{},e[bt.NODES]||{},a,o,n,i,s,c)}static create(t,e={}){const r=pe._create(t,e);return be.set(t,r),r}static local(t={}){return pe._create("",t)}constructor(t,e={},r={},s={},n={},i={},a={},o=[],c=[],l=null,h=null,m,u){this.name=t,this.handler=e,this.fallback=r,this.items=s,this.tags=n,this.options=i,this.nodes=a,this.preprocessors=o,this.postprocessors=c,this.initMethod=l,this.configMethod=h,this.priority=m,this.parser=u,this.handler=Object.assign({[At.CHARACTER]:[],[At.DELIMITER]:[],[At.MACRO]:[],[At.ENVIRONMENT]:[]},e)}get init(){return this.initMethod?this.initMethod[0]:null}get config(){return this.configMethod?this.configMethod[0]:null}}const fe=new Map,be={set(t,e){fe.set(t,e)},get:t=>fe.get(t),keys:()=>fe.keys()};class Ae{constructor(t,e=["tex"]){this.initMethod=new he,this.configMethod=new he,this.configurations=new le,this.parsers=[],this.handlers=new ge,this.items={},this.tags={},this.options={},this.nodes={},this.parsers=e;for(const e of t.slice().reverse())this.addPackage(e);for(const{item:t,priority:e}of this.configurations)this.append(t,e)}init(){this.initMethod.execute(this)}config(t){this.configMethod.execute(this,t);for(const e of this.configurations)this.addFilters(t,e.item)}addPackage(t){const e="string"==typeof t?t:t[0],r=this.getPackage(e);r&&this.configurations.add(r,"string"==typeof t?r.priority:t[1])}add(t,e,r={}){const s=this.getPackage(t);this.append(s),this.configurations.add(s,s.priority),this.init();const n=e.parseOptions;n.nodeFactory.setCreators(s.nodes);for(const t of Object.keys(s.items))n.itemFactory.setNodeClass(t,s.items[t]);Yt.addTags(s.tags),X(n.options,s.options),$(n.options,r),this.addFilters(e,s),s.config&&s.config(this,e)}getPackage(t){const e=be.get(t);if(e&&!this.parsers.includes(e.parser))throw Error(`Package '${t}' doesn't target the proper parser`);return e||this.warn(`Package '${t}' not found. Omitted.`),e}append(t,e){e=e||t.priority,t.initMethod&&this.initMethod.add(t.initMethod[0],t.initMethod[1]),t.configMethod&&this.configMethod.add(t.configMethod[0],t.configMethod[1]),this.handlers.add(t.handler,t.fallback,e),Object.assign(this.items,t.items),Object.assign(this.tags,t.tags),X(this.options,t.options),Object.assign(this.nodes,t.nodes)}addFilters(t,e){for(const[r,s]of e.preprocessors)t.preFilters.add(r,s);for(const[r,s]of e.postprocessors)t.postFilters.add(r,s)}warn(t){console.warn("MathJax Warning: "+t)}}const ye=MathJax._.util.Styles,ve=ye.TRBL;ye.WSC,ye.Styles;class ke extends Tt{constructor(t,e){super(t),this.global=e}get kind(){return"start"}get isOpen(){return!0}checkItem(t){if(t.isKind("stop")){let t=this.toMml();return this.global.isInner||(t=this.factory.configuration.tags.finalize(t,this.env)),[[this.factory.create("mml",t)],!0]}return super.checkItem(t)}}class we extends Tt{get kind(){return"stop"}get isClose(){return!0}}class Me extends Tt{get kind(){return"open"}get isOpen(){return!0}checkItem(t){if(t.isKind("close")){const e=this.toMml(),r=this.create("node","TeXAtom",[e]);return $e(r,t),[[this.factory.create("mml",r)],!0]}return super.checkItem(t)}}Me.errors=Object.assign(Object.create(Tt.errors),{stop:["ExtraOpenMissingClose","Extra open brace or missing close brace"]});class xe extends Tt{get kind(){return"close"}get isClose(){return!0}}class Te extends Tt{get kind(){return"null"}}class Pe extends Tt{get kind(){return"prime"}checkItem(t){const[e,r]=this.Peek(2),s=(ht.isType(e,"msubsup")||ht.isType(e,"msup"))&&!ht.getChildAt(e,e.sup),n=(ht.isType(e,"munderover")||ht.isType(e,"mover"))&&!ht.getChildAt(e,e.over)&&!ht.getProperty(e,"subsupOK");if(!s&&!n){return[[this.create("node",e.getProperty("movesupsub")?"mover":"msup",[e,r]),t],!0]}const i=s?e.sup:e.over;return ht.setChild(e,i,r),[[e,t],!0]}}class Ee extends Tt{get kind(){return"subsup"}checkItem(t){if(t.isKind("open")||t.isKind("left"))return Tt.success;const e=this.First,r=this.getProperty("position");if(t.isKind("mml")){if(this.getProperty("primes"))if(2!==r)ht.setChild(e,2,this.getProperty("primes"));else{ht.setProperty(this.getProperty("primes"),"variantForm",!0);const e=this.create("node","mrow",[this.getProperty("primes"),t.First]);t.First=e}ht.setChild(e,r,t.First),null!=this.getProperty("movesupsub")&&ht.setProperty(e,"movesupsub",this.getProperty("movesupsub"));return[[this.factory.create("mml",e)],!0]}super.checkItem(t);const s=this.getErrors(["","sub","sup"][r]);throw new Mt(s[0],s[1],...s.splice(2))}}Ee.errors=Object.assign(Object.create(Tt.errors),{stop:["MissingScript","Missing superscript or subscript argument"],sup:["MissingOpenForSup","Missing open brace for superscript"],sub:["MissingOpenForSub","Missing open brace for subscript"]});class Ce extends Tt{constructor(t){super(t),this.setProperty("name","\\over")}get kind(){return"over"}get isClose(){return!0}checkItem(t){if(t.isKind("over"))throw new Mt("AmbiguousUseOf","Ambiguous use of %1",t.getName());if(t.isClose){let e=this.create("node","mfrac",[this.getProperty("num"),this.toMml(!1)]);return null!=this.getProperty("thickness")&&ht.setAttribute(e,"linethickness",this.getProperty("thickness")),(this.getProperty("ldelim")||this.getProperty("rdelim"))&&(ht.setProperty(e,"withDelims",!0),e=qt.fixedFence(this.factory.configuration,this.getProperty("ldelim"),e,this.getProperty("rdelim"))),e.attributes.set(Pt.Attr.LATEXITEM,this.getProperty("name")),[[this.factory.create("mml",e),t],!0]}return super.checkItem(t)}toString(){return"over["+this.getProperty("num")+" / "+this.nodes.join("; ")+"]"}}class Se extends Tt{constructor(t,e){super(t),this.setProperty("delim",e)}get kind(){return"left"}get isOpen(){return!0}checkItem(t){if(t.isKind("right")){const e=qt.fenced(this.factory.configuration,this.getProperty("delim"),this.toMml(),t.getProperty("delim"),"",t.getProperty("color")),r=e.childNodes[0],s=e.childNodes[e.childNodes.length-1],n=this.factory.create("mml",e);return $e(r,this,"\\left"),$e(s,t,"\\right"),n.Peek()[0].attributes.set(Pt.Attr.LATEXITEM,"\\left"+t.startStr.slice(this.startI,t.stopI)),[[n],!0]}if(t.isKind("middle")){const e={stretchy:!0};t.getProperty("color")&&(e.mathcolor=t.getProperty("color"));const r=this.create("token","mo",e,t.getProperty("delim"));return $e(r,t,"\\middle"),this.Push(this.create("node","TeXAtom",[],{texClass:it.CLOSE}),r,this.create("node","TeXAtom",[],{texClass:it.OPEN})),this.env={},[[this],!0]}return super.checkItem(t)}}Se.errors=Object.assign(Object.create(Tt.errors),{stop:["ExtraLeftMissingRight","Extra \\left or missing \\right"]});class Oe extends Tt{constructor(t,e,r){super(t),this.setProperty("delim",e),r&&this.setProperty("color",r)}get kind(){return"middle"}get isClose(){return!0}}class Ie extends Tt{constructor(t,e,r){super(t),this.setProperty("delim",e),r&&this.setProperty("color",r)}get kind(){return"right"}get isClose(){return!0}}class Ne extends Tt{get kind(){return"break"}constructor(t,e,r){super(t),this.setProperty("linebreak",e),this.setProperty("insert",r)}checkItem(t){var e,r;const s=this.getProperty("linebreak");if(t.isKind("mml")){const n=t.First;if(n.isKind("mo")){if("after"!==((null===(r=null===(e=ht.getOp(n))||void 0===e?void 0:e[3])||void 0===r?void 0:r.linebreakstyle)||ht.getAttribute(n,"linebreakstyle")))return ht.setAttribute(n,"linebreak",s),[[t],!0];if(!this.getProperty("insert"))return[[t],!0]}}const n=this.create("token","mspace",{linebreak:s});return[[this.factory.create("mml",n),t],!0]}}class Le extends Tt{get kind(){return"begin"}get isOpen(){return!0}checkItem(t){if(t.isKind("end")){if(t.getName()!==this.getName())throw new Mt("EnvBadEnd","\\begin{%1} ended with \\end{%2}",this.getName(),t.getName());const e=this.toMml();return $e(e,t),[[this.factory.create("mml",e)],!0]}if(t.isKind("stop"))throw new Mt("EnvMissingEnd","Missing \\end{%1}",this.getName());return super.checkItem(t)}}class Fe extends Tt{get kind(){return"end"}get isClose(){return!0}}class Re extends Tt{get kind(){return"style"}checkItem(t){if(!t.isClose)return super.checkItem(t);const e=this.create("node","mstyle",this.nodes,this.getProperty("styles"));return[[this.factory.create("mml",e),t],!0]}}class De extends Tt{get kind(){return"position"}checkItem(t){if(t.isClose)throw new Mt("MissingBoxFor","Missing box for %1",this.getName());if(t.isFinal){let e=t.toMml();switch(this.getProperty("move")){case"vertical":return e=this.create("node","mpadded",[e],{height:this.getProperty("dh"),depth:this.getProperty("dd"),voffset:this.getProperty("dh")}),[[this.factory.create("mml",e)],!0];case"horizontal":return[[this.factory.create("mml",this.getProperty("left")),t,this.factory.create("mml",this.getProperty("right"))],!0]}}return super.checkItem(t)}}class Be extends Tt{get kind(){return"cell"}get isClose(){return!0}}class Ge extends Tt{get isFinal(){return!0}get kind(){return"mml"}}class qe extends Tt{get kind(){return"fn"}checkItem(t){const e=this.First;if(e){if(t.isOpen)return Tt.success;if(!t.isKind("fn")){let r=t.First;if(!t.isKind("mml")||!r)return[[e,t],!0];if(ht.isType(r,"mstyle")&&r.childNodes.length&&ht.isType(r.childNodes[0].childNodes[0],"mspace")||ht.isType(r,"mspace"))return[[e,t],!0];ht.isEmbellished(r)&&(r=ht.getCoreMO(r));const s=ht.getForm(r);if(null!=s&&[0,0,1,1,0,1,1,0,0,0][s[2]])return[[e,t],!0]}return[[e,this.create("token","mo",{texClass:it.NONE},Ft.ApplyFunction),t],!0]}return super.checkItem(t)}}class _e extends Tt{constructor(){super(...arguments),this.remap=ue.getMap("not_remap")}get kind(){return"not"}checkItem(t){let e,r,s;if(t.isKind("open")||t.isKind("left"))return Tt.success;if(t.isKind("mml")&&(ht.isType(t.First,"mo")||ht.isType(t.First,"mi")||ht.isType(t.First,"mtext"))&&(e=t.First,r=ht.getText(e),1===r.length&&!ht.getProperty(e,"movesupsub")&&1===ht.getChildren(e).length))return this.remap.contains(r)?(s=this.create("text",this.remap.lookup(r).char),ht.setChild(e,0,s)):(s=this.create("text","\u0338"),ht.appendChildren(e,[s])),[[t],!0];s=this.create("text","\u29f8");const n=this.create("node","mtext",[],{},s),i=this.create("node","mpadded",[n],{width:0});return e=this.create("node","TeXAtom",[i],{texClass:it.REL}),[[e,t],!0]}}class He extends Tt{get kind(){return"nonscript"}checkItem(t){if(t.isKind("mml")&&1===t.Size()){let e=t.First;if(e.isKind("mstyle")&&e.notParent&&(e=ht.getChildren(ht.getChildren(e)[0])[0]),e.isKind("mspace")){if(e!==t.First){const e=this.create("node","mrow",[t.Pop()]);t.Push(e)}this.factory.configuration.addNode("nonscript",t.First)}}return[[t],!0]}}class Ue extends Tt{get kind(){return"dots"}checkItem(t){if(t.isKind("open")||t.isKind("left"))return Tt.success;let e=this.getProperty("ldots");const r=t.First;if(t.isKind("mml")&&ht.isEmbellished(r)){const t=ht.getTexClass(ht.getCoreMO(r));t!==it.BIN&&t!==it.REL||(e=this.getProperty("cdots"))}return[[e,t],!0]}}class je extends Tt{constructor(){super(...arguments),this.table=[],this.row=[],this.frame=[],this.hfill=[],this.arraydef={},this.cstart=[],this.cend=[],this.cextra=[],this.atEnd=!1,this.ralign=[],this.breakAlign={cell:"",row:"",table:""},this.templateSubs=0}get kind(){return"array"}get isOpen(){return!0}get copyEnv(){return!1}checkItem(t){if(t.isClose&&!t.isKind("over")){if(t.getProperty("isEntry"))return this.EndEntry(),this.clearEnv(),this.StartEntry(),Tt.fail;if(t.getProperty("isCR"))return this.EndEntry(),this.EndRow(),this.clearEnv(),this.StartEntry(),Tt.fail;this.EndTable(),this.clearEnv();const e=this.factory.create("mml",this.createMml());if(this.getProperty("requireClose")){if(t.isKind("close"))return[[e],!0];throw new Mt("MissingCloseBrace","Missing close brace")}return[[e,t],!0]}return super.checkItem(t)}createMml(){const t=this.arraydef.scriptlevel;delete this.arraydef.scriptlevel;let e=this.create("node","mtable",this.table,this.arraydef);return t&&e.setProperty("smallmatrix",!0),this.breakAlign.table&&ht.setAttribute(e,"data-break-align",this.breakAlign.table),this.getProperty("arrayPadding")&&(ht.setAttribute(e,"data-frame-styles",""),ht.setAttribute(e,"framespacing",this.getProperty("arrayPadding"))),e=this.handleFrame(e),void 0!==t&&(e=this.create("node","mstyle",[e],{scriptlevel:t})),(this.getProperty("open")||this.getProperty("close"))&&(e=qt.fenced(this.factory.configuration,this.getProperty("open"),e,this.getProperty("close"))),e}handleFrame(t){if(!this.frame.length)return t;const e=new Map(this.frame),r=this.frame.reduce(((t,[,e])=>e===t?e:""),this.frame[0][1]);if(r){if(4===this.frame.length)return ht.setAttribute(t,"frame",r),ht.removeAttribute(t,"data-frame-styles"),t;if("solid"===r)return ht.setAttribute(t,"data-frame-styles",""),t=this.create("node","menclose",[t],{notation:Array.from(e.keys()).join(" "),"data-padding":0})}const s=ve.map((t=>e.get(t)||"none")).join(" ");return ht.setAttribute(t,"data-frame-styles",s),t}StartEntry(){const t=this.row.length;let e=this.cstart[t],r=this.cend[t];const s=this.ralign[t],n=this.cextra;if(!(e||r||s||n[t]||n[t+1]))return;let[i,a,o,c]=this.getEntry();if(!n[t]||this.atEnd&&!n[t+1]||(e+="&"),"&"!==o&&(c=!!a.trim()||!!(t||o&&"\\end"!==o.substring(0,4)),n[t+1]&&!n[t]&&(r=(r||"")+"&",this.atEnd=!0)),!c&&!i)return;const l=this.parser;if(c&&(e&&(a=qt.addArgs(l,e,a)),r&&(a=qt.addArgs(l,a,r)),s&&(a="\\text{"+a.trim()+"}"),(e||r||s)&&++this.templateSubs>l.configuration.options.maxTemplateSubtitutions))throw new Mt("MaxTemplateSubs","Maximum template substitutions exceeded; is there an invalid use of \\\\ in the template?");i&&(a=qt.addArgs(l,i,a)),l.string=qt.addArgs(l,a,l.string),l.i=0}getEntry(){const t=this.parser,e=/^([^]*?)([&{}]|\\\\|\\(?:begin|end)\s*\{array\}|\\cr|\\)/;let r,s=0,n=0,i=t.i;const a=["","","",!1];for(;null!==(r=t.string.slice(i).match(e));)switch(i+=r[0].length,r[2]){case"\\":i++;break;case"{":s++;break;case"}":if(!s)return a;s--;break;case"\\begin{array}":s||n++;break;case"\\end{array}":if(!s&&n){n--;break}default:{if(s||n)continue;i-=r[2].length;let e=t.string.slice(t.i,i).trim();const a=e.match(/^(?:\s*\\(?:h(?:dash)?line|hfil{1,3}|rowcolor\s*\{.*?\}))+/);return a&&(e=e.slice(a[0].length)),t.string=t.string.slice(i),t.i=0,[(null==a?void 0:a[0])||"",e,r[2],!0]}}return a}EndEntry(){const t=this.create("node","mtd",this.nodes);this.hfill.length&&(0===this.hfill[0]&&ht.setAttribute(t,"columnalign","right"),this.hfill[this.hfill.length-1]===this.Size()&&ht.setAttribute(t,"columnalign",ht.getAttribute(t,"columnalign")?"center":"left"));const e=this.ralign[this.row.length];if(e){const[r,s,n]=e,i=this.create("node","mpadded",t.childNodes[0].childNodes,{width:s,"data-overflow":"auto","data-align":n,"data-vertical-align":r});i.setProperty("vbox",r),t.childNodes[0].childNodes=[],t.appendChild(i)}else this.breakAlign.cell&&ht.setAttribute(t,"data-vertical-align",this.breakAlign.cell);this.breakAlign.cell="",this.row.push(t),this.Clear(),this.hfill=[]}EndRow(){let t="mtr";this.getProperty("isNumbered")&&3===this.row.length?(this.row.unshift(this.row.pop()),t="mlabeledtr"):this.getProperty("isLabeled")&&(t="mlabeledtr",this.setProperty("isLabeled",!1));const e=this.create("node",t,this.row);this.breakAlign.row&&(ht.setAttribute(e,"data-break-align",this.breakAlign.row),this.breakAlign.row=""),$e(e,this),this.table.push(e),this.row=[],this.atEnd=!1}EndTable(){(this.Size()||this.row.length)&&(this.EndEntry(),this.EndRow()),this.checkLines()}checkLines(){if(this.arraydef.rowlines){const t=this.arraydef.rowlines.split(/ /);t.length===this.table.length?(this.frame.push(["bottom",t.pop()]),t.length?this.arraydef.rowlines=t.join(" "):delete this.arraydef.rowlines):t.length<this.table.length-1&&(this.arraydef.rowlines+=" none")}if(this.getProperty("rowspacing")){const t=this.arraydef.rowspacing.split(/ /);for(;t.length<this.table.length;)t.push(this.getProperty("rowspacing")+"em");this.arraydef.rowspacing=t.join(" ")}}addRowSpacing(t){if(this.arraydef.rowspacing){const e=this.arraydef.rowspacing.split(/ /);if(!this.getProperty("rowspacing")){const t=vt.dimen2em(e[0]);this.setProperty("rowspacing",t)}const r=this.getProperty("rowspacing");for(;e.length<this.table.length;)e.push(vt.em(r));e[this.table.length-1]=vt.em(Math.max(0,r+vt.dimen2em(t))),this.arraydef.rowspacing=e.join(" ")}}}class Ke extends je{constructor(t,...e){super(t),this.maxrow=0,this.factory.configuration.tags.start(e[0],e[2],e[1])}get kind(){return"eqnarray"}EndEntry(){const t=this.arraydef.columnalign.split(/ /);"right"!==(this.row.length&&t.length?t[this.row.length%t.length]:"right")&&qt.fixInitialMO(this.factory.configuration,this.nodes),super.EndEntry()}EndRow(){this.row.length>this.maxrow&&(this.maxrow=this.row.length);const t=this.factory.configuration.tags.getTag();t&&(this.row=[t].concat(this.row),this.setProperty("isLabeled",!0)),this.factory.configuration.tags.clearTag(),super.EndRow()}EndTable(){super.EndTable(),this.factory.configuration.tags.end(),this.extendArray("columnalign",this.maxrow),this.extendArray("columnwidth",this.maxrow),this.extendArray("columnspacing",this.maxrow-1),this.extendArray("data-break-align",this.maxrow),this.addIndentshift()}extendArray(t,e){if(!this.arraydef[t])return;const r=this.arraydef[t].split(/ /),s=[...r];if(s.length>1){for(;s.length<e;)s.push(...r);this.arraydef[t]=s.slice(0,e).join(" ")}}addIndentshift(){const t=this.arraydef.columnalign.split(/ /);let e="";for(const r of t.keys()){if("left"===t[r]&&r>0){const t="center"===e?".7em":"2em";for(const e of this.table){const s=e.childNodes[e.isKind("mlabeledtr")?r+1:r];if(s){const e=this.create("node","mstyle",s.childNodes[0].childNodes,{indentshift:t});s.childNodes[0].childNodes=[],s.appendChild(e)}}}e=t[r]}}}class ze extends Le{get kind(){return"mstyle"}constructor(t,e,r){super(t),this.attrList=e,this.setProperty("name",r)}checkItem(t){if(t.isKind("end")&&t.getName()===this.getName()){return[[this.create("node","mstyle",[this.toMml()],this.attrList)],!0]}return super.checkItem(t)}}class Xe extends Tt{constructor(t,...e){super(t),this.factory.configuration.tags.start("equation",!0,e[0])}get kind(){return"equation"}get isOpen(){return!0}checkItem(t){if(t.isKind("end")){const e=this.toMml(),r=this.factory.configuration.tags.getTag();return this.factory.configuration.tags.end(),[[r?this.factory.configuration.tags.enTag(e,r):e,t],!0]}if(t.isKind("stop"))throw new Mt("EnvMissingEnd","Missing \\end{%1}",this.getName());return super.checkItem(t)}}function $e(t,e,r=""){const s=e.startStr.slice(e.startI,e.stopI);s&&(t.attributes.set(Pt.Attr.LATEXITEM,r?r+s:s),t.attributes.set(Pt.Attr.LATEX,r?r+s:s))}const Ve=MathJax._.util.lengths,Je=(Ve.BIGDIMEN,Ve.UNITS,Ve.RELUNITS,Ve.MATHSPACE),We=(Ve.length2em,Ve.percent,Ve.em),Ye=(Ve.px,1.2/.85),Qe={fontfamily:1,fontsize:1,fontweight:1,fontstyle:1,color:1,background:1,id:1,class:1,href:1,style:1};function Ze(t,e=1/0){const r=t.replace(/\s+/g,"").split("").map((t=>{const e={t:"top",b:"bottom",m:"middle",c:"center"}[t];if(!e)throw new Mt("BadBreakAlign","Invalid alignment character: %1",t);return e}));if(r.length>e)throw new Mt("TooManyAligns","Too many alignment characters: %1",t);return 1===e?r[0]:r.join(" ")}function tr(t,e){const r=t.stack.env,s=r.inRoot;r.inRoot=!0;const n=new Et(e,r,t.configuration);let i=n.mml();const a=n.stack.global;if(a.leftRoot||a.upRoot){const e={};a.leftRoot&&(e.width=a.leftRoot),a.upRoot&&(e.voffset=a.upRoot,e.height=a.upRoot),i=t.create("node","mpadded",[i],e)}return r.inRoot=s,i}const er={Open(t,e){t.Push(t.itemFactory.create("open"))},Close(t,e){t.Push(t.itemFactory.create("close"))},Bar(t,e){t.Push(t.create("token","mo",{stretchy:!1,texClass:it.ORD},e))},Tilde(t,e){t.Push(t.create("token","mtext",{},Ft.nbsp))},Space(t,e){},Superscript(t,e){let r,s;t.GetNext().match(/\d/)&&(t.string=t.string.substring(0,t.i+1)+" "+t.string.substring(t.i+1));const n=t.stack.Top();n.isKind("prime")?([s,r]=n.Peek(2),t.stack.Pop()):(s=t.stack.Prev(),s||(s=t.create("token","mi",{},"")));const i=ht.getProperty(s,"movesupsub");let a=ht.isType(s,"msubsup")?s.sup:s.over;if(ht.isType(s,"msubsup")&&!ht.isType(s,"msup")&&ht.getChildAt(s,s.sup)||ht.isType(s,"munderover")&&!ht.isType(s,"mover")&&ht.getChildAt(s,s.over)&&!ht.getProperty(s,"subsupOK"))throw new Mt("DoubleExponent","Double exponent: use braces to clarify");ht.isType(s,"msubsup")&&!ht.isType(s,"msup")||(i?((!ht.isType(s,"munderover")||ht.isType(s,"mover")||ht.getChildAt(s,s.over))&&(s=t.create("node","munderover",[s],{movesupsub:!0})),a=s.over):(s=t.create("node","msubsup",[s]),a=s.sup)),t.Push(t.itemFactory.create("subsup",s).setProperties({position:a,primes:r,movesupsub:i}))},Subscript(t,e){let r,s;t.GetNext().match(/\d/)&&(t.string=t.string.substring(0,t.i+1)+" "+t.string.substring(t.i+1));const n=t.stack.Top();n.isKind("prime")?([s,r]=n.Peek(2),t.stack.Pop()):(s=t.stack.Prev(),s||(s=t.create("token","mi",{},"")));const i=ht.getProperty(s,"movesupsub");let a=ht.isType(s,"msubsup")?s.sub:s.under;if(ht.isType(s,"msubsup")&&!ht.isType(s,"msup")&&ht.getChildAt(s,s.sub)||ht.isType(s,"munderover")&&!ht.isType(s,"mover")&&ht.getChildAt(s,s.under)&&!ht.getProperty(s,"subsupOK"))throw new Mt("DoubleSubscripts","Double subscripts: use braces to clarify");ht.isType(s,"msubsup")&&!ht.isType(s,"msup")||(i?((!ht.isType(s,"munderover")||ht.isType(s,"mover")||ht.getChildAt(s,s.under))&&(s=t.create("node","munderover",[s],{movesupsub:!0})),a=s.under):(s=t.create("node","msubsup",[s]),a=s.sub)),t.Push(t.itemFactory.create("subsup",s).setProperties({position:a,primes:r,movesupsub:i}))},Prime(t,e){let r=t.stack.Prev();if(r||(r=t.create("token","mi")),ht.isType(r,"msubsup")&&!ht.isType(r,"msup")&&ht.getChildAt(r,r.sup)||ht.isType(r,"munderover")&&!ht.isType(r,"mover")&&ht.getChildAt(r,r.over)&&!ht.getProperty(r,"subsupOK"))throw new Mt("DoubleExponentPrime","Prime causes double exponent: use braces to clarify");let s="";t.i--;do{s+=Ft.prime,t.i++,e=t.GetNext()}while("'"===e||e===Ft.rsquo);s=["","\u2032","\u2033","\u2034","\u2057"][s.length]||s;const n=t.create("token","mo",{variantForm:!0},s);t.Push(t.itemFactory.create("prime",r,n))},Comment(t,e){for(;t.i<t.string.length&&"\n"!==t.string.charAt(t.i);)t.i++},Hash(t,e){throw new Mt("CantUseHash1","You can't use 'macro parameter character #' in math mode")},MathFont(t,e,r,s=""){const n=t.GetArgument(e),i=new Et(n,Object.assign(Object.assign({multiLetterIdentifiers:t.options.identifierPattern},t.stack.env),{font:r,italicFont:s,noAutoOP:!0}),t.configuration).mml();t.Push(t.create("node","TeXAtom",[i]))},SetFont(t,e,r){t.stack.env.font=r,t.Push(t.itemFactory.create("null"))},SetStyle(t,e,r,s,n){t.stack.env.style=r,t.stack.env.level=n,t.Push(t.itemFactory.create("style").setProperty("styles",{displaystyle:s,scriptlevel:n}))},SetSize(t,e,r){t.stack.env.size=r,t.Push(t.itemFactory.create("style").setProperty("styles",{mathsize:We(r)}))},Spacer(t,e,r){const s=t.create("node","mspace",[],{width:We(r)}),n=t.create("node","mstyle",[s],{scriptlevel:0});t.Push(n)},DiscretionaryTimes(t,e){t.Push(t.create("token","mo",{linebreakmultchar:"\xd7"},"\u2062"))},AllowBreak(t,e){t.Push(t.create("token","mspace"))},Break(t,e){t.Push(t.create("token","mspace",{linebreak:Pt.LineBreak.NEWLINE}))},Linebreak(t,e,r){let s=!0;const n=t.stack.Prev(!0);if(n&&n.isKind("mo")){ht.getMoAttribute(n,"linebreakstyle")!==Pt.LineBreakStyle.BEFORE&&(n.attributes.set("linebreak",r),s=!1)}t.Push(t.itemFactory.create("break",r,s))},LeftRight(t,e){const r=e.substring(1);t.Push(t.itemFactory.create(r,t.GetDelimiter(e),t.stack.env.color))},NamedFn(t,e,r){r||(r=e.substring(1));const s=t.create("token","mi",{texClass:it.OP},r);t.Push(t.itemFactory.create("fn",s))},NamedOp(t,e,r){r||(r=e.substring(1)),r=r.replace(/&thinsp;/,"\u2006");const s=t.create("token","mo",{movablelimits:!0,movesupsub:!0,form:Pt.Form.PREFIX,texClass:it.OP},r);t.Push(s)},Limits(t,e,r){let s=t.stack.Prev(!0);if(!s||ht.getTexClass(ht.getCoreMO(s))!==it.OP&&null==ht.getProperty(s,"movesupsub"))throw new Mt("MisplacedLimits","%1 is allowed only on operators",t.currentCS);const n=t.stack.Top();let i;ht.isType(s,"munderover")&&!r?(i=t.create("node","msubsup"),ht.copyChildren(s,i),s=n.Last=i):ht.isType(s,"msubsup")&&r&&(i=t.create("node","munderover"),ht.copyChildren(s,i),s=n.Last=i),ht.setProperty(s,"movesupsub",!!r),ht.setProperties(ht.getCoreMO(s),{movablelimits:!1}),((ht.isType(s,"mo")?ht.getMoAttribute(s,"movableLimits"):ht.getAttribute(s,"movablelimits"))||ht.getProperty(s,"movablelimits"))&&ht.setProperties(s,{movablelimits:!1})},Over(t,e,r,s){const n=t.itemFactory.create("over").setProperty("name",t.currentCS);r||s?(n.setProperty("ldelim",r),n.setProperty("rdelim",s)):e.match(/withdelims$/)&&(n.setProperty("ldelim",t.GetDelimiter(e)),n.setProperty("rdelim",t.GetDelimiter(e))),e.match(/^\\above/)?n.setProperty("thickness",t.GetDimen(e)):(e.match(/^\\atop/)||r||s)&&n.setProperty("thickness",0),t.Push(n)},Frac(t,e){const r=t.ParseArg(e),s=t.ParseArg(e),n=t.create("node","mfrac",[r,s]);t.Push(n)},Sqrt(t,e){const r=t.GetBrackets(e);let s=t.GetArgument(e);"\\frac"===s&&(s+="{"+t.GetArgument(s)+"}{"+t.GetArgument(s)+"}");let n=new Et(s,t.stack.env,t.configuration).mml();n=r?t.create("node","mroot",[n,tr(t,r)]):t.create("node","msqrt",[n]),t.Push(n)},Root(t,e){const r=t.GetUpTo(e,"\\of"),s=t.ParseArg(e),n=t.create("node","mroot",[s,tr(t,r)]);t.Push(n)},MoveRoot(t,e,r){if(!t.stack.env.inRoot)throw new Mt("MisplacedMoveRoot","%1 can appear only within a root",t.currentCS);if(t.stack.global[r])throw new Mt("MultipleMoveRoot","Multiple use of %1",t.currentCS);let s=t.GetArgument(e);if(!s.match(/-?[0-9]+/))throw new Mt("IntegerArg","The argument to %1 must be an integer",t.currentCS);s=parseInt(s,10)/15+"em","-"!==s.substring(0,1)&&(s="+"+s),t.stack.global[r]=s},Accent(t,e,r,s){const n=t.ParseArg(e),i=Object.assign(Object.assign({},qt.getFontDef(t)),{accent:!0,mathaccent:void 0===s||s}),a=ht.createEntity(r),o=t.create("token","mo",i,a);ht.setAttribute(o,"stretchy",!!s);const c=ht.isEmbellished(n)?ht.getCoreMO(n):n;(ht.isType(c,"mo")||ht.getProperty(c,"movablelimits"))&&ht.setProperties(c,{movablelimits:!1});const l=t.create("node","munderover");ht.setChild(l,0,n),ht.setChild(l,1,null),ht.setChild(l,2,o);const h=t.create("node","TeXAtom",[l]);t.Push(h)},UnderOver(t,e,r,s){const n=ht.createEntity(r),i=t.create("token","mo",{stretchy:!0,accent:!0},n);n.match(ct.mathaccentsWithWidth)&&i.setProperty("mathaccent",!1);const a="o"===e.charAt(1)?"over":"under",o=t.ParseArg(e);t.Push(qt.underOver(t,o,i,a,s))},Overset(t,e){const r=t.ParseArg(e),s=t.ParseArg(e),n=r.coreMO(),i=n.isKind("mo")&&!0===ht.getMoAttribute(n,"accent");qt.checkMovableLimits(s);const a=t.create("node","mover",[s,r],{accent:i});t.Push(a)},Underset(t,e){const r=t.ParseArg(e),s=t.ParseArg(e),n=r.coreMO(),i=n.isKind("mo")&&!0===ht.getMoAttribute(n,"accent");qt.checkMovableLimits(s);const a=t.create("node","munder",[s,r],{accentunder:i});t.Push(a)},Overunderset(t,e){const r=t.ParseArg(e),s=t.ParseArg(e),n=t.ParseArg(e),i=r.coreMO(),a=s.coreMO(),o=i.isKind("mo")&&!0===ht.getMoAttribute(i,"accent"),c=a.isKind("mo")&&!0===ht.getMoAttribute(a,"accent");qt.checkMovableLimits(n);const l=t.create("node","munderover",[n,s,r],{accent:o,accentunder:c});t.Push(l)},TeXAtom(t,e,r){const s={texClass:r};let n,i;if(r===it.OP){s.movesupsub=s.movablelimits=!0;const r=t.GetArgument(e),a=r.match(/^\s*\\rm\s+([a-zA-Z0-9 ]+)$/);if(a)s.mathvariant=Pt.Variant.NORMAL,i=t.create("token","mi",s,a[1]);else{const e=new Et(r,t.stack.env,t.configuration).mml();i=t.create("node","TeXAtom",[e],s)}n=t.itemFactory.create("fn",i)}else n=t.create("node","TeXAtom",[t.ParseArg(e)],s);t.Push(n)},VBox(t,e,r){const s=new Et(t.GetArgument(e),t.stack.env,t.configuration),n={"data-vertical-align":r,texClass:it.ORD};s.stack.env.hsize&&(n.width=s.stack.env.hsize,n["data-overflow"]="linebreak");const i=t.create("node","mpadded",[s.mml()],n);i.setProperty("vbox",r),t.Push(i)},Hsize(t,e){"="===t.GetNext()&&t.i++,t.stack.env.hsize=t.GetDimen(e),t.Push(t.itemFactory.create("null"))},ParBox(t,e){const r=t.GetBrackets(e,"c"),s=t.GetDimen(e),n=qt.internalMath(t,t.GetArgument(e)),i=Ze(r,1),a=t.create("node","mpadded",n,{width:s,"data-overflow":"linebreak","data-vertical-align":i});a.setProperty("vbox",i),t.Push(a)},BreakAlign(t,e){const r=t.stack.Top();if(!(r instanceof je))throw new Mt("BreakNotInArray","%1 must be used in an alignment environment",t.currentCS);switch(t.GetArgument(e).trim()){case"c":if(r.First)throw new Mt("BreakFirstInEntry","%1 must be at the beginning of an alignment entry",t.currentCS+"{c}");r.breakAlign.cell=Ze(t.GetArgument(e),1);break;case"r":if(r.row.length||r.First)throw new Mt("BreakFirstInRow","%1 must be at the beginning of an alignment row",t.currentCS+"{r}");r.breakAlign.row=Ze(t.GetArgument(e));break;case"t":if(r.table.length||r.row.length||r.First)throw new Mt("BreakFirstInTable","%1 must be at the beginning of an alignment",t.currentCS+"{t}");r.breakAlign.table=Ze(t.GetArgument(e));break;default:throw new Mt("BreakType","First argument to %1 must be one of c, r, or t",t.currentCS)}},MmlToken(t,e){const r=t.GetArgument(e);let s=t.GetBrackets(e,"").replace(/^\s+/,"");const n=t.GetArgument(e),i={},a=[];let o;try{o=t.create("node",r)}catch(t){o=null}if(!o||!o.isToken)throw new Mt("NotMathMLToken","%1 is not a token element",r);for(;""!==s;){const e=s.match(/^([a-z]+)\s*=\s*('[^']*'|"[^"]*"|[^ ,]*)\s*,?\s*/i);if(!e)throw new Mt("InvalidMathMLAttr","Invalid MathML attribute: %1",s);if(!o.attributes.hasDefault(e[1])&&!Qe[e[1]])throw new Mt("UnknownAttrForElement","%1 is not a recognized attribute for %2",e[1],r);let n=qt.mmlFilterAttribute(t,e[1],e[2].replace(/^(['"])(.*)\1$/,"$2"));n&&("true"===n.toLowerCase()?n=!0:"false"===n.toLowerCase()&&(n=!1),i[e[1]]=n,a.push(e[1])),s=s.substring(e[0].length)}a.length&&(i["mjx-keep-attrs"]=a.join(" "));const c=t.create("text",tt(n));o.appendChild(c),ht.setProperties(o,i),t.Push(o)},Strut(t,e){const r=t.create("node","mrow"),s=t.create("node","mpadded",[r],{height:"8.6pt",depth:"3pt",width:0});t.Push(s)},Phantom(t,e,r,s){let n=t.create("node","mphantom",[t.ParseArg(e)]);(r||s)&&(n=t.create("node","mpadded",[n]),s&&(ht.setAttribute(n,"height",0),ht.setAttribute(n,"depth",0)),r&&ht.setAttribute(n,"width",0));const i=t.create("node","TeXAtom",[n]);t.Push(i)},Smash(t,e){const r=vt.trimSpaces(t.GetBrackets(e,"")),s=t.create("node","mpadded",[t.ParseArg(e)]);switch(r){case"b":ht.setAttribute(s,"depth",0);break;case"t":ht.setAttribute(s,"height",0);break;default:ht.setAttribute(s,"height",0),ht.setAttribute(s,"depth",0)}const n=t.create("node","TeXAtom",[s]);t.Push(n)},Lap(t,e){const r=t.create("node","mpadded",[t.ParseArg(e)],{width:0});"\\llap"===e&&ht.setAttribute(r,"lspace","-1width");const s=t.create("node","TeXAtom",[r]);t.Push(s)},RaiseLower(t,e){let r=t.GetDimen(e);const s=t.itemFactory.create("position").setProperties({name:t.currentCS,move:"vertical"});"-"===r.charAt(0)&&(r=r.slice(1),e="raise"===e.substring(1)?"\\lower":"\\raise"),"\\lower"===e?(s.setProperty("dh","-"+r),s.setProperty("dd","+"+r)):(s.setProperty("dh","+"+r),s.setProperty("dd","-"+r)),t.Push(s)},MoveLeftRight(t,e){let r=t.GetDimen(e),s="-"===r.charAt(0)?r.slice(1):"-"+r;if("\\moveleft"===e){const t=r;r=s,s=t}t.Push(t.itemFactory.create("position").setProperties({name:t.currentCS,move:"horizontal",left:t.create("node","mspace",[],{width:r}),right:t.create("node","mspace",[],{width:s})}))},Hskip(t,e,r=!1){const s=t.create("node","mspace",[],{width:t.GetDimen(e)});r&&ht.setAttribute(s,"linebreak","nobreak"),t.Push(s)},Nonscript(t,e){t.Push(t.itemFactory.create("nonscript"))},Rule(t,e,r){const s={width:t.GetDimen(e),height:t.GetDimen(e),depth:t.GetDimen(e)};"blank"!==r&&(s.mathbackground=t.stack.env.color||"black");const n=t.create("node","mspace",[],s);t.Push(n)},rule(t,e){const r=t.GetBrackets(e),s=t.GetDimen(e),n=t.GetDimen(e);let i=t.create("node","mspace",[],{width:s,height:n,mathbackground:t.stack.env.color||"black"});r&&(i=t.create("node","mpadded",[i],{voffset:r}),r.match(/^-/)?(ht.setAttribute(i,"height",r),ht.setAttribute(i,"depth","+"+r.substring(1))):ht.setAttribute(i,"height","+"+r)),t.Push(i)},MakeBig(t,e,r,s){const n=String(s*=Ye).replace(/(\.\d\d\d).+/,"$1")+"em",i=t.GetDelimiter(e,!0),a=t.create("token","mo",{minsize:n,maxsize:n,fence:!0,stretchy:!0,symmetric:!0},i),o=t.create("node","TeXAtom",[a],{texClass:r});t.Push(o)},BuildRel(t,e){const r=t.ParseUpTo(e,"\\over"),s=t.ParseArg(e),n=t.create("node","munderover");ht.setChild(n,0,s),ht.setChild(n,1,null),ht.setChild(n,2,r);const i=t.create("node","TeXAtom",[n],{texClass:it.REL});t.Push(i)},HBox(t,e,r,s){t.PushAll(qt.internalMath(t,t.GetArgument(e),r,s))},FBox(t,e){const r=qt.internalMath(t,t.GetArgument(e)),s=t.create("node","menclose",r,{notation:"box"});t.Push(s)},FrameBox(t,e){const r=t.GetBrackets(e),s=t.GetBrackets(e)||"c";let n=qt.internalMath(t,t.GetArgument(e));r&&(n=[t.create("node","mpadded",n,{width:r,"data-align":J(s,{l:"left",r:"right"},"center")})]);const i=t.create("node","TeXAtom",[t.create("node","menclose",n,{notation:"box"})],{texClass:it.ORD});t.Push(i)},MakeBox(t,e){const r=t.GetBrackets(e),s=t.GetBrackets(e,"c"),n=t.create("node","mpadded",qt.internalMath(t,t.GetArgument(e)));r&&ht.setAttribute(n,"width",r);const i=J(s.toLowerCase(),{c:"center",r:"right"},"");i&&ht.setAttribute(n,"data-align",i),s.toLowerCase()!==s&&ht.setAttribute(n,"data-overflow","linebreak"),t.Push(n)},Not(t,e){t.Push(t.itemFactory.create("not"))},Dots(t,e){const r=ht.createEntity("2026"),s=ht.createEntity("22EF"),n=t.create("token","mo",{stretchy:!1},r),i=t.create("token","mo",{stretchy:!1},s);t.Push(t.itemFactory.create("dots").setProperties({ldots:n,cdots:i}))},Matrix(t,e,r,s,n,i,a,o,c,l){const h=t.GetNext();if(""===h)throw new Mt("MissingArgFor","Missing argument for %1",t.currentCS);"{"===h?t.i++:(t.string=h+"}"+t.string.slice(t.i+1),t.i=0);const m=t.itemFactory.create("array").setProperty("requireClose",!0);!r&&n||m.setProperty("arrayPadding",".2em .125em"),m.arraydef={rowspacing:a||"4pt",columnspacing:i||"1em"},c&&m.setProperty("isCases",!0),l&&(m.setProperty("isNumbered",!0),m.arraydef.side=l),(r||s)&&(m.setProperty("open",r),m.setProperty("close",s)),"D"===o&&(m.arraydef.displaystyle=!0),null!=n&&(m.arraydef.columnalign=n),t.Push(m)},Entry(t,e){t.Push(t.itemFactory.create("cell").setProperties({isEntry:!0,name:e}));const r=t.stack.Top(),s=r.getProperty("casesEnv");if(!r.getProperty("isCases")&&!s)return;const n=t.string;let i=0,a=-1,o=t.i,c=n.length;const l=s?new RegExp(`^\\\\end\\s*\\{${s.replace(/\*/,"\\*")}\\}`):null;for(;o<c;){const e=n.charAt(o);if("{"===e)i++,o++;else if("}"===e)0===i?c=0:(i--,0===i&&a<0&&(a=o-t.i),o++);else{if("&"===e&&0===i)throw new Mt("ExtraAlignTab","Extra alignment tab in \\cases text");if("\\"===e){const t=n.substring(o);t.match(/^((\\cr)[^a-zA-Z]|\\\\)/)||l&&t.match(l)?c=0:o+=2}else o++}}const h=n.substring(t.i,o);if(!h.match(/^\s*\\text[^a-zA-Z]/)||a!==h.replace(/\s+$/,"").length-1){const e=qt.internalMath(t,vt.trimSpaces(h),0);t.PushAll(e),t.i=o}},Cr(t,e){t.Push(t.itemFactory.create("cell").setProperties({isCR:!0,name:e}))},CrLaTeX(t,e,r=!1){let s;if(!r&&("*"===t.string.charAt(t.i)&&t.i++,"["===t.string.charAt(t.i))){const r=t.GetBrackets(e,""),[n,i]=vt.matchDimen(r);if(r&&!n)throw new Mt("BracketMustBeDimension","Bracket argument to %1 must be a dimension",t.currentCS);s=n+i}t.Push(t.itemFactory.create("cell").setProperties({isCR:!0,name:e,linebreak:!0}));const n=t.stack.Top();let i;n instanceof je?s&&n.addRowSpacing(s):(i=t.create("node","mspace",[],{linebreak:Pt.LineBreak.NEWLINE}),s&&ht.setAttribute(i,"data-lineleading",s),t.Push(i))},HLine(t,e,r){null==r&&(r="solid");const s=t.stack.Top();if(!(s instanceof je)||s.Size())throw new Mt("Misplaced","Misplaced %1",t.currentCS);if(s.table.length){const t=s.arraydef.rowlines?s.arraydef.rowlines.split(/ /):[];for(;t.length<s.table.length;)t.push("none");t[s.table.length-1]=r,s.arraydef.rowlines=t.join(" ")}else s.frame.push(["top",r])},HFill(t,e){const r=t.stack.Top();if(!(r instanceof je))throw new Mt("UnsupportedHFill","Unsupported use of %1",t.currentCS);r.hfill.push(r.Size())},NewColumnType(t,e){const r=t.GetArgument(e),s=t.GetBrackets(e,"0"),n=t.GetArgument(e);if(1!==r.length)throw new Mt("BadColumnName","Column specifier must be exactly one character: %1",r);if(!s.match(/^\d+$/))throw new Mt("PositiveIntegerArg","Argument to %1 must be a positive integer",s);const i=t.configuration.columnParser;i.columnHandler[r]=t=>i.macroColumn(t,n,parseInt(s)),t.Push(t.itemFactory.create("null"))},BeginEnd(t,e){const r=t.GetArgument(e);if(r.match(/\\/))throw new Mt("InvalidEnv","Invalid environment name '%1'",r);const s=t.configuration.handlers.get(At.ENVIRONMENT).lookup(r);if(s&&"\\end"===e){if(!s.args[0]){const e=t.itemFactory.create("end").setProperty("name",r);return void t.Push(e)}t.stack.env.closing=r}qt.checkMaxMacros(t,!1),t.parse(At.ENVIRONMENT,[t,r])},Array(t,e,r,s,n,i,a,o,c){n||(n=t.GetArgument("\\begin{"+e.getName()+"}"));const l=t.itemFactory.create("array");return"array"===e.getName()&&l.setProperty("arrayPadding",".5em .125em"),l.parser=t,l.arraydef={columnspacing:i||"1em",rowspacing:a||"4pt"},t.configuration.columnParser.process(t,n,l),r&&l.setProperty("open",t.convertDelimiter(r)),s&&l.setProperty("close",t.convertDelimiter(s)),"'"===(o||"").charAt(1)&&(l.arraydef["data-cramped"]=!0,o=o.charAt(0)),"D"===o?l.arraydef.displaystyle=!0:o&&(l.arraydef.displaystyle=!1),l.arraydef.scriptlevel="S"===o?1:0,c&&(l.arraydef.useHeight=!1),t.Push(e),l.StartEntry(),l},AlignedArray(t,e,r=""){const s=t.GetBrackets("\\begin{"+e.getName()+"}"),n=er.Array(t,e,null,null,null,null,null,r);return qt.setArrayAlign(n,s)},IndentAlign(t,e){const r=`\\begin{${e.getName()}}`,s=t.GetBrackets(r,""),n=t.GetBrackets(r,""),i=t.GetBrackets(r,"");if(s&&!vt.matchDimen(s)[0]||n&&!vt.matchDimen(n)[0]||i&&!vt.matchDimen(i)[0])throw new Mt("BracketMustBeDimension","Bracket argument to %1 must be a dimension",r);const a=t.GetArgument(r);if(a&&!a.match(/^([lcr]{1,3})?$/))throw new Mt("BadAlignment","Alignment must be one to three copies of l, c, or r");const o=[...a].map((t=>({l:"left",c:"center",r:"right"}[t])));1===o.length&&o.push(o[0]);const c={};for(const[t,e]of[["indentshiftfirst",s],["indentshift",n||s],["indentshiftlast",i],["indentalignfirst",o[0]],["indentalign",o[1]],["indentalignlast",o[2]]])e&&(c[t]=e);t.Push(t.itemFactory.create("mstyle",c,e.getName()))},Equation:(t,e,r,s=!0)=>(t.configuration.mathItem.display=s,t.stack.env.display=s,qt.checkEqnEnv(t),t.Push(e),t.itemFactory.create("equation",r).setProperty("name",e.getName())),EqnArray(t,e,r,s,n,i,a){const o=e.getName(),c="gather"===o||"gather*"===o;s&&qt.checkEqnEnv(t,!c),t.Push(e),n=(n=n.replace(/[^clr]/g,"").split("").join(" ")).replace(/l/g,"left").replace(/r/g,"right").replace(/c/g,"center"),i=Ze(i);const l=t.itemFactory.create("eqnarray",o,r,s,t.stack.global);return l.arraydef={displaystyle:!0,columnalign:n,columnspacing:a||"1em",rowspacing:"3pt","data-break-align":i,side:t.options.tagSide,minlabelspacing:t.options.tagIndent},c&&l.setProperty("nestable",!0),l},HandleNoTag(t,e){t.tags.notag()},HandleLabel(t,e){const r=t.GetArgument(e);if(""!==r&&!t.tags.refUpdate){if(t.tags.label)throw new Mt("MultipleCommand","Multiple %1",t.currentCS);if(t.tags.label=r,(t.tags.allLabels[r]||t.tags.labels[r])&&!t.options.ignoreDuplicateLabels)throw new Mt("MultipleLabel","Label '%1' multiply defined",r);t.tags.labels[r]=new Kt}},HandleRef(t,e,r){const s=t.GetArgument(e);let n=t.tags.allLabels[s]||t.tags.labels[s];n||(t.tags.refUpdate||(t.tags.redo=!0),n=new Kt);let i=n.tag;r&&(i=t.tags.formatRef(i));const a=t.create("node","mrow",qt.internalMath(t,i),{href:t.tags.formatUrl(n.id,t.options.baseURL),class:"MathJax_ref"});t.Push(a)},Macro(t,e,r,s,n){if(s){const i=[];if(null!=n){const r=t.GetBrackets(e);i.push(null==r?n:r)}for(let r=i.length;r<s;r++)i.push(t.GetArgument(e));r=qt.substituteArgs(t,i,r)}t.string=qt.addArgs(t,r,t.string.slice(t.i)),t.i=0,qt.checkMaxMacros(t)},MathChoice(t,e){const r=t.ParseArg(e),s=t.ParseArg(e),n=t.ParseArg(e),i=t.ParseArg(e);t.Push(t.create("node","MathChoice",[r,s,n,i]))}},rr=er,sr=Pt.Variant,nr={variable(t,e){var r;const s=qt.getFontDef(t),n=t.stack.env;if(n.multiLetterIdentifiers&&""!==n.font&&(e=(null===(r=t.string.substring(t.i-1).match(n.multiLetterIdentifiers))||void 0===r?void 0:r[0])||e,t.i+=e.length-1,s.mathvariant===sr.NORMAL&&n.noAutoOP&&e.length>1&&(s.autoOP=!1)),!s.mathvariant&&qt.isLatinOrGreekChar(e)){const r=t.configuration.mathStyle(e);r&&(s.mathvariant=r)}const i=t.create("token","mi",s,e);t.Push(i)},digit(t,e){const r=t.configuration.options.numberPattern,s=t.string.slice(t.i-1).match(r),n=qt.getFontDef(t);if(!s)return!1;const i=t.create("token","mn",n,s[0].replace(/[{}]/g,""));return t.i+=s[0].length-1,t.Push(i),!0},controlSequence(t,e){const r=t.GetCS();t.parse(At.MACRO,[t,r])},lcGreek(t,e){const r={mathvariant:t.configuration.mathStyle(e.char)||sr.ITALIC},s=t.create("token","mi",r,e.char);t.Push(s)},ucGreek(t,e){const r={mathvariant:t.stack.env.font||t.configuration.mathStyle(e.char,!0)||sr.NORMAL},s=t.create("token","mi",r,e.char);t.Push(s)},mathchar0mi(t,e){const r=e.attributes||{mathvariant:sr.ITALIC},s=t.create("token","mi",r,e.char);t.Push(s)},mathchar0mo(t,e){const r=e.attributes||{};r.stretchy=!1;const s=t.create("token","mo",r,e.char);ht.setProperty(s,"fixStretchy",!0),t.configuration.addNode("fixStretchy",s),t.Push(s)},mathchar7(t,e){const r=e.attributes||{mathvariant:sr.NORMAL};t.stack.env.font&&(r.mathvariant=t.stack.env.font);const s=t.create("token","mi",r,e.char);t.Push(s)},delimiter(t,e){let r=e.attributes||{};r=Object.assign({fence:!1,stretchy:!1},r);const s=t.create("token","mo",r,e.char);t.Push(s)},environment(t,e,r,s){const n=t.itemFactory.create("begin").setProperty("name",e);t.Push(r(t,n,...s.slice(1)))}},ir=nr,ar=We(Je.thickmathspace),or=Pt.Variant;new re("letter",ir.variable,/[a-z]/i),new re("digit",ir.digit,/[0-9.,]/),new re("command",ir.controlSequence,/^\\/),new ae("special",{"{":rr.Open,"}":rr.Close,"~":rr.Tilde,"^":rr.Superscript,_:rr.Subscript,"|":rr.Bar," ":rr.Space,"\t":rr.Space,"\r":rr.Space,"\n":rr.Space,"'":rr.Prime,"%":rr.Comment,"&":rr.Entry,"#":rr.Hash,"\xa0":rr.Space,"\u2019":rr.Prime}),new ne("lcGreek",ir.lcGreek,{alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03f5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03d5",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",varepsilon:"\u03b5",vartheta:"\u03d1",varpi:"\u03d6",varrho:"\u03f1",varsigma:"\u03c2",varphi:"\u03c6"}),new ne("ucGreek",ir.ucGreek,{Gamma:"\u0393",Delta:"\u0394",Theta:"\u0398",Lambda:"\u039b",Xi:"\u039e",Pi:"\u03a0",Sigma:"\u03a3",Upsilon:"\u03a5",Phi:"\u03a6",Psi:"\u03a8",Omega:"\u03a9"}),new ne("mathchar0mi",ir.mathchar0mi,{AA:"\u212b",S:["\xa7",{mathvariant:or.NORMAL}],aleph:["\u2135",{mathvariant:or.NORMAL}],hbar:["\u210f",{variantForm:!0}],imath:"\u0131",jmath:"\u0237",ell:"\u2113",wp:["\u2118",{mathvariant:or.NORMAL}],Re:["\u211c",{mathvariant:or.NORMAL}],Im:["\u2111",{mathvariant:or.NORMAL}],partial:["\u2202",{mathvariant:or.ITALIC}],infty:["\u221e",{mathvariant:or.NORMAL}],prime:["\u2032",{variantForm:!0}],emptyset:["\u2205",{mathvariant:or.NORMAL}],nabla:["\u2207",{mathvariant:or.NORMAL}],top:["\u22a4",{mathvariant:or.NORMAL}],bot:["\u22a5",{mathvariant:or.NORMAL}],angle:["\u2220",{mathvariant:or.NORMAL}],triangle:["\u25b3",{mathvariant:or.NORMAL}],backslash:["\\",{mathvariant:or.NORMAL}],forall:["\u2200",{mathvariant:or.NORMAL}],exists:["\u2203",{mathvariant:or.NORMAL}],neg:["\xac",{mathvariant:or.NORMAL}],lnot:["\xac",{mathvariant:or.NORMAL}],flat:["\u266d",{mathvariant:or.NORMAL}],natural:["\u266e",{mathvariant:or.NORMAL}],sharp:["\u266f",{mathvariant:or.NORMAL}],clubsuit:["\u2663",{mathvariant:or.NORMAL}],diamondsuit:["\u2662",{mathvariant:or.NORMAL}],heartsuit:["\u2661",{mathvariant:or.NORMAL}],spadesuit:["\u2660",{mathvariant:or.NORMAL}]}),new ne("mathchar0mo",ir.mathchar0mo,{surd:"\u221a",coprod:["\u2210",{movesupsub:!0}],bigvee:["\u22c1",{movesupsub:!0}],bigwedge:["\u22c0",{movesupsub:!0}],biguplus:["\u2a04",{movesupsub:!0}],bigcap:["\u22c2",{movesupsub:!0}],bigcup:["\u22c3",{movesupsub:!0}],int:"\u222b",intop:["\u222b",{movesupsub:!0,movablelimits:!0}],iint:"\u222c",iiint:"\u222d",prod:["\u220f",{movesupsub:!0}],sum:["\u2211",{movesupsub:!0}],bigotimes:["\u2a02",{movesupsub:!0}],bigoplus:["\u2a01",{movesupsub:!0}],bigodot:["\u2a00",{movesupsub:!0}],oint:"\u222e",ointop:["\u222e",{movesupsub:!0,movablelimits:!0}],oiint:"\u222f",oiiint:"\u2230",bigsqcup:["\u2a06",{movesupsub:!0}],smallint:["\u222b",{largeop:!1}],triangleleft:"\u25c3",triangleright:"\u25b9",bigtriangleup:"\u25b3",bigtriangledown:"\u25bd",wedge:"\u2227",land:"\u2227",vee:"\u2228",lor:"\u2228",cap:"\u2229",cup:"\u222a",ddagger:"\u2021",dagger:"\u2020",sqcap:"\u2293",sqcup:"\u2294",uplus:"\u228e",amalg:"\u2a3f",diamond:"\u22c4",bullet:"\u2219",wr:"\u2240",div:"\xf7",odot:["\u2299",{largeop:!1}],oslash:["\u2298",{largeop:!1}],otimes:["\u2297",{largeop:!1}],ominus:["\u2296",{largeop:!1}],oplus:["\u2295",{largeop:!1}],mp:"\u2213",pm:"\xb1",circ:"\u2218",bigcirc:"\u25ef",setminus:"\u2216",cdot:"\u22c5",ast:"\u2217",times:"\xd7",star:"\u22c6",propto:"\u221d",sqsubseteq:"\u2291",sqsupseteq:"\u2292",parallel:"\u2225",mid:"\u2223",dashv:"\u22a3",vdash:"\u22a2",leq:"\u2264",le:"\u2264",geq:"\u2265",ge:"\u2265",lt:"<",gt:">",succ:"\u227b",prec:"\u227a",approx:"\u2248",succeq:"\u2ab0",preceq:"\u2aaf",supset:"\u2283",subset:"\u2282",supseteq:"\u2287",subseteq:"\u2286",in:"\u2208",ni:"\u220b",notin:"\u2209",owns:"\u220b",gg:"\u226b",ll:"\u226a",sim:"\u223c",simeq:"\u2243",perp:"\u27c2",equiv:"\u2261",asymp:"\u224d",smile:"\u2323",frown:"\u2322",ne:"\u2260",neq:"\u2260",cong:"\u2245",doteq:"\u2250",bowtie:"\u22c8",models:"\u22a7",notChar:"\u29f8",Leftrightarrow:"\u21d4",Leftarrow:"\u21d0",Rightarrow:"\u21d2",leftrightarrow:"\u2194",leftarrow:"\u2190",gets:"\u2190",rightarrow:"\u2192",to:["\u2192",{accent:!1}],mapsto:"\u21a6",leftharpoonup:"\u21bc",leftharpoondown:"\u21bd",rightharpoonup:"\u21c0",rightharpoondown:"\u21c1",nearrow:"\u2197",searrow:"\u2198",nwarrow:"\u2196",swarrow:"\u2199",rightleftharpoons:"\u21cc",hookrightarrow:"\u21aa",hookleftarrow:"\u21a9",longleftarrow:"\u27f5",Longleftarrow:"\u27f8",longrightarrow:"\u27f6",Longrightarrow:"\u27f9",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",ldots:"\u2026",cdots:"\u22ef",vdots:"\u22ee",ddots:"\u22f1",iddots:"\u22f0",dotsc:"\u2026",dotsb:"\u22ef",dotsm:"\u22ef",dotsi:"\u22ef",dotso:"\u2026",ldotp:[".",{texClass:it.PUNCT}],cdotp:["\u22c5",{texClass:it.PUNCT}],colon:[":",{texClass:it.PUNCT}]}),new ne("mathchar7",ir.mathchar7,{_:"_","#":"#",$:"$","%":"%","&":"&",And:"&"}),new ie("delimiter",ir.delimiter,{"(":"(",")":")","[":"[","]":"]","<":"\u27e8",">":"\u27e9","\\lt":"\u27e8","\\gt":"\u27e9","/":"/","|":["|",{texClass:it.ORD}],".":"","\\lmoustache":"\u23b0","\\rmoustache":"\u23b1","\\lgroup":"\u27ee","\\rgroup":"\u27ef","\\arrowvert":"\u23d0","\\Arrowvert":"\u2016","\\bracevert":"\u23aa","\\Vert":["\u2016",{texClass:it.ORD}],"\\|":["\u2016",{texClass:it.ORD}],"\\vert":["|",{texClass:it.ORD}],"\\uparrow":"\u2191","\\downarrow":"\u2193","\\updownarrow":"\u2195","\\Uparrow":"\u21d1","\\Downarrow":"\u21d3","\\Updownarrow":"\u21d5","\\backslash":"\\","\\rangle":"\u27e9","\\langle":"\u27e8","\\rbrace":"}","\\lbrace":"{","\\}":"}","\\{":"{","\\rceil":"\u2309","\\lceil":"\u2308","\\rfloor":"\u230b","\\lfloor":"\u230a","\\lbrack":"[","\\rbrack":"]"}),new oe("macros",{displaystyle:[rr.SetStyle,"D",!0,0],textstyle:[rr.SetStyle,"T",!1,0],scriptstyle:[rr.SetStyle,"S",!1,1],scriptscriptstyle:[rr.SetStyle,"SS",!1,2],rm:[rr.SetFont,or.NORMAL],mit:[rr.SetFont,or.ITALIC],oldstyle:[rr.SetFont,or.OLDSTYLE],cal:[rr.SetFont,or.CALLIGRAPHIC],it:[rr.SetFont,or.MATHITALIC],bf:[rr.SetFont,or.BOLD],sf:[rr.SetFont,or.SANSSERIF],tt:[rr.SetFont,or.MONOSPACE],frak:[rr.MathFont,or.FRAKTUR],Bbb:[rr.MathFont,or.DOUBLESTRUCK],mathrm:[rr.MathFont,or.NORMAL],mathup:[rr.MathFont,or.NORMAL],mathnormal:[rr.MathFont,""],mathbf:[rr.MathFont,or.BOLD],mathbfup:[rr.MathFont,or.BOLD],mathit:[rr.MathFont,or.MATHITALIC],mathbfit:[rr.MathFont,or.BOLDITALIC],mathbb:[rr.MathFont,or.DOUBLESTRUCK],mathfrak:[rr.MathFont,or.FRAKTUR],mathbffrak:[rr.MathFont,or.BOLDFRAKTUR],mathscr:[rr.MathFont,or.SCRIPT],mathbfscr:[rr.MathFont,or.BOLDSCRIPT],mathsf:[rr.MathFont,or.SANSSERIF],mathsfup:[rr.MathFont,or.SANSSERIF],mathbfsf:[rr.MathFont,or.BOLDSANSSERIF],mathbfsfup:[rr.MathFont,or.BOLDSANSSERIF],mathsfit:[rr.MathFont,or.SANSSERIFITALIC],mathbfsfit:[rr.MathFont,or.SANSSERIFBOLDITALIC],mathtt:[rr.MathFont,or.MONOSPACE],mathcal:[rr.MathFont,or.CALLIGRAPHIC],mathbfcal:[rr.MathFont,or.BOLDCALLIGRAPHIC],symrm:[rr.MathFont,or.NORMAL],symup:[rr.MathFont,or.NORMAL],symnormal:[rr.MathFont,""],symbf:[rr.MathFont,or.BOLD,or.BOLDITALIC],symbfup:[rr.MathFont,or.BOLD],symit:[rr.MathFont,or.ITALIC],symbfit:[rr.MathFont,or.BOLDITALIC],symbb:[rr.MathFont,or.DOUBLESTRUCK],symfrak:[rr.MathFont,or.FRAKTUR],symbffrak:[rr.MathFont,or.BOLDFRAKTUR],symscr:[rr.MathFont,or.SCRIPT],symbfscr:[rr.MathFont,or.BOLDSCRIPT],symsf:[rr.MathFont,or.SANSSERIF,or.SANSSERIFITALIC],symsfup:[rr.MathFont,or.SANSSERIF],symbfsf:[rr.MathFont,or.BOLDSANSSERIF],symbfsfup:[rr.MathFont,or.BOLDSANSSERIF],symsfit:[rr.MathFont,or.SANSSERIFITALIC],symbfsfit:[rr.MathFont,or.SANSSERIFBOLDITALIC],symtt:[rr.MathFont,or.MONOSPACE],symcal:[rr.MathFont,or.CALLIGRAPHIC],symbfcal:[rr.MathFont,or.BOLDCALLIGRAPHIC],textrm:[rr.HBox,null,or.NORMAL],textup:[rr.HBox,null,or.NORMAL],textnormal:[rr.HBox],textit:[rr.HBox,null,or.ITALIC],textbf:[rr.HBox,null,or.BOLD],textsf:[rr.HBox,null,or.SANSSERIF],texttt:[rr.HBox,null,or.MONOSPACE],tiny:[rr.SetSize,.5],Tiny:[rr.SetSize,.6],scriptsize:[rr.SetSize,.7],small:[rr.SetSize,.85],normalsize:[rr.SetSize,1],large:[rr.SetSize,1.2],Large:[rr.SetSize,1.44],LARGE:[rr.SetSize,1.73],huge:[rr.SetSize,2.07],Huge:[rr.SetSize,2.49],arcsin:rr.NamedFn,arccos:rr.NamedFn,arctan:rr.NamedFn,arg:rr.NamedFn,cos:rr.NamedFn,cosh:rr.NamedFn,cot:rr.NamedFn,coth:rr.NamedFn,csc:rr.NamedFn,deg:rr.NamedFn,det:rr.NamedOp,dim:rr.NamedFn,exp:rr.NamedFn,gcd:rr.NamedOp,hom:rr.NamedFn,inf:rr.NamedOp,ker:rr.NamedFn,lg:rr.NamedFn,lim:rr.NamedOp,liminf:[rr.NamedOp,"lim&thinsp;inf"],limsup:[rr.NamedOp,"lim&thinsp;sup"],ln:rr.NamedFn,log:rr.NamedFn,max:rr.NamedOp,min:rr.NamedOp,Pr:rr.NamedOp,sec:rr.NamedFn,sin:rr.NamedFn,sinh:rr.NamedFn,sup:rr.NamedOp,tan:rr.NamedFn,tanh:rr.NamedFn,limits:[rr.Limits,!0],nolimits:[rr.Limits,!1],overline:[rr.UnderOver,"2015"],underline:[rr.UnderOver,"2015"],overbrace:[rr.UnderOver,"23DE",!0],underbrace:[rr.UnderOver,"23DF",!0],overparen:[rr.UnderOver,"23DC"],underparen:[rr.UnderOver,"23DD"],overrightarrow:[rr.UnderOver,"2192"],underrightarrow:[rr.UnderOver,"2192"],overleftarrow:[rr.UnderOver,"2190"],underleftarrow:[rr.UnderOver,"2190"],overleftrightarrow:[rr.UnderOver,"2194"],underleftrightarrow:[rr.UnderOver,"2194"],overset:rr.Overset,underset:rr.Underset,overunderset:rr.Overunderset,stackrel:[rr.Macro,"\\mathrel{\\mathop{#2}\\limits^{#1}}",2],stackbin:[rr.Macro,"\\mathbin{\\mathop{#2}\\limits^{#1}}",2],over:rr.Over,overwithdelims:rr.Over,atop:rr.Over,atopwithdelims:rr.Over,above:rr.Over,abovewithdelims:rr.Over,brace:[rr.Over,"{","}"],brack:[rr.Over,"[","]"],choose:[rr.Over,"(",")"],frac:rr.Frac,sqrt:rr.Sqrt,root:rr.Root,uproot:[rr.MoveRoot,"upRoot"],leftroot:[rr.MoveRoot,"leftRoot"],left:rr.LeftRight,right:rr.LeftRight,middle:rr.LeftRight,llap:rr.Lap,rlap:rr.Lap,raise:rr.RaiseLower,lower:rr.RaiseLower,moveleft:rr.MoveLeftRight,moveright:rr.MoveLeftRight,",":[rr.Spacer,Je.thinmathspace],":":[rr.Spacer,Je.mediummathspace],">":[rr.Spacer,Je.mediummathspace],";":[rr.Spacer,Je.thickmathspace],"!":[rr.Spacer,Je.negativethinmathspace],enspace:[rr.Spacer,.5],quad:[rr.Spacer,1],qquad:[rr.Spacer,2],thinspace:[rr.Spacer,Je.thinmathspace],negthinspace:[rr.Spacer,Je.negativethinmathspace],"*":rr.DiscretionaryTimes,allowbreak:rr.AllowBreak,goodbreak:[rr.Linebreak,Pt.LineBreak.GOODBREAK],badbreak:[rr.Linebreak,Pt.LineBreak.BADBREAK],nobreak:[rr.Linebreak,Pt.LineBreak.NOBREAK],break:rr.Break,hskip:rr.Hskip,hspace:rr.Hskip,kern:[rr.Hskip,!0],mskip:rr.Hskip,mspace:rr.Hskip,mkern:[rr.Hskip,!0],rule:rr.rule,Rule:[rr.Rule],Space:[rr.Rule,"blank"],nonscript:rr.Nonscript,big:[rr.MakeBig,it.ORD,.85],Big:[rr.MakeBig,it.ORD,1.15],bigg:[rr.MakeBig,it.ORD,1.45],Bigg:[rr.MakeBig,it.ORD,1.75],bigl:[rr.MakeBig,it.OPEN,.85],Bigl:[rr.MakeBig,it.OPEN,1.15],biggl:[rr.MakeBig,it.OPEN,1.45],Biggl:[rr.MakeBig,it.OPEN,1.75],bigr:[rr.MakeBig,it.CLOSE,.85],Bigr:[rr.MakeBig,it.CLOSE,1.15],biggr:[rr.MakeBig,it.CLOSE,1.45],Biggr:[rr.MakeBig,it.CLOSE,1.75],bigm:[rr.MakeBig,it.REL,.85],Bigm:[rr.MakeBig,it.REL,1.15],biggm:[rr.MakeBig,it.REL,1.45],Biggm:[rr.MakeBig,it.REL,1.75],mathord:[rr.TeXAtom,it.ORD],mathop:[rr.TeXAtom,it.OP],mathopen:[rr.TeXAtom,it.OPEN],mathclose:[rr.TeXAtom,it.CLOSE],mathbin:[rr.TeXAtom,it.BIN],mathrel:[rr.TeXAtom,it.REL],mathpunct:[rr.TeXAtom,it.PUNCT],mathinner:[rr.TeXAtom,it.INNER],vtop:[rr.VBox,"top"],vcenter:[rr.VBox,"center"],vbox:[rr.VBox,"bottom"],hsize:rr.Hsize,parbox:rr.ParBox,breakAlign:rr.BreakAlign,buildrel:rr.BuildRel,hbox:[rr.HBox,0],text:rr.HBox,mbox:[rr.HBox,0],fbox:rr.FBox,boxed:[rr.Macro,"\\fbox{$\\displaystyle{#1}$}",1],framebox:rr.FrameBox,makebox:rr.MakeBox,strut:rr.Strut,mathstrut:[rr.Macro,"\\vphantom{(}"],phantom:rr.Phantom,vphantom:[rr.Phantom,1,0],hphantom:[rr.Phantom,0,1],smash:rr.Smash,acute:[rr.Accent,"00B4"],grave:[rr.Accent,"0060"],ddot:[rr.Accent,"00A8"],dddot:[rr.Accent,"20DB"],ddddot:[rr.Accent,"20DC"],tilde:[rr.Accent,"007E"],bar:[rr.Accent,"00AF"],breve:[rr.Accent,"02D8"],check:[rr.Accent,"02C7"],hat:[rr.Accent,"005E"],vec:[rr.Accent,"2192",!1],dot:[rr.Accent,"02D9"],widetilde:[rr.Accent,"007E",!0],widehat:[rr.Accent,"005E",!0],matrix:rr.Matrix,array:rr.Matrix,pmatrix:[rr.Matrix,"(",")"],cases:[rr.Matrix,"{","","left left",null,".2em",null,!0],eqalign:[rr.Matrix,null,null,"right left",ar,".5em","D"],displaylines:[rr.Matrix,null,null,"center",null,".5em","D"],cr:rr.Cr,"\\":rr.CrLaTeX,newline:[rr.CrLaTeX,!0],hline:rr.HLine,hdashline:[rr.HLine,"dashed"],eqalignno:[rr.Matrix,null,null,"right left",ar,".5em","D",null,"right"],leqalignno:[rr.Matrix,null,null,"right left",ar,".5em","D",null,"left"],hfill:rr.HFill,hfil:rr.HFill,hfilll:rr.HFill,bmod:[rr.Macro,'\\mmlToken{mo}[lspace="'+ar+'" rspace="'+ar+'"]{mod}'],pmod:[rr.Macro,"\\pod{\\mmlToken{mi}{mod}\\kern 6mu #1}",1],mod:[rr.Macro,"\\mathchoice{\\kern18mu}{\\kern12mu}{\\kern12mu}{\\kern12mu}\\mmlToken{mi}{mod}\\,\\,#1",1],pod:[rr.Macro,"\\mathchoice{\\kern18mu}{\\kern8mu}{\\kern8mu}{\\kern8mu}(#1)",1],iff:[rr.Macro,"\\;\\Longleftrightarrow\\;"],skew:[rr.Macro,"{{#2{#3\\mkern#1mu}\\mkern-#1mu}{}}",3],pmb:[rr.Macro,"\\rlap{#1}\\kern1px{#1}",1],TeX:[rr.Macro,"T\\kern-.14em\\lower.5ex{E}\\kern-.115em X"],LaTeX:[rr.Macro,"L\\kern-.325em\\raise.21em{\\scriptstyle{A}}\\kern-.17em\\TeX"],not:rr.Not,dots:rr.Dots,space:rr.Tilde,"\xa0":rr.Tilde," ":rr.Tilde,begin:rr.BeginEnd,end:rr.BeginEnd,label:rr.HandleLabel,ref:rr.HandleRef,nonumber:rr.HandleNoTag,newcolumntype:rr.NewColumnType,mathchoice:rr.MathChoice,mmlToken:rr.MmlToken}),new ce("environment",ir.environment,{displaymath:[rr.Equation,null,!1],math:[rr.Equation,null,!1,!1],array:[rr.AlignedArray],darray:[rr.AlignedArray,null,"D"],equation:[rr.Equation,null,!0],eqnarray:[rr.EqnArray,null,!0,!0,"rcl","bmt",qt.cols(0,Je.thickmathspace),".5em"],indentalign:[rr.IndentAlign]}),new ne("not_remap",null,{"\u2190":"\u219a","\u2192":"\u219b","\u2194":"\u21ae","\u21d0":"\u21cd","\u21d2":"\u21cf","\u21d4":"\u21ce","\u2208":"\u2209","\u220b":"\u220c","\u2223":"\u2224","\u2225":"\u2226","\u223c":"\u2241","~":"\u2241","\u2243":"\u2244","\u2245":"\u2247","\u2248":"\u2249","\u224d":"\u226d","=":"\u2260","\u2261":"\u2262","<":"\u226e",">":"\u226f","\u2264":"\u2270","\u2265":"\u2271","\u2272":"\u2274","\u2273":"\u2275","\u2276":"\u2278","\u2277":"\u2279","\u227a":"\u2280","\u227b":"\u2281","\u2282":"\u2284","\u2283":"\u2285","\u2286":"\u2288","\u2287":"\u2289","\u22a2":"\u22ac","\u22a8":"\u22ad","\u22a9":"\u22ae","\u22ab":"\u22af","\u227c":"\u22e0","\u227d":"\u22e1","\u2291":"\u22e2","\u2292":"\u22e3","\u22b2":"\u22ea","\u22b3":"\u22eb","\u22b4":"\u22ec","\u22b5":"\u22ed","\u2203":"\u2204"});const cr=MathJax._.core.MmlTree.OperatorDictionary,lr=(cr.OPDEF,cr.MO,cr.RANGES,cr.getRange),hr=(cr.MMLSPACING,cr.OPTABLE,MathJax._.util.context),mr=(hr.hasWindow,hr.context),ur=Pt.Variant;function dr(t,e){const r=t.stack.env.font,s=t.stack.env.italicFont,n=r?{mathvariant:r}:{},i=ue.getMap("remap").lookup(e),a=lr(e),o=a[3],c=t.create("token",o,n,i?i.char:e),l=qt.isLatinOrGreekChar(e)?t.configuration.mathStyle(e,!0)||s:"",h=a[4]||(r&&l===ur.NORMAL?"":l);h&&c.attributes.set("mathvariant",h),"mo"===o&&(ht.setProperty(c,"fixStretchy",!0),t.configuration.addNode("fixStretchy",c)),t.Push(c)}new ne("remap",null,{"-":"\u2212","*":"\u2217","`":"\u2018"});class gr extends Xt{}const pr=pe.create("base",{[bt.CONFIG]:function(t,e){const r=e.parseOptions.options;r.digits&&(r.numberPattern=r.digits),new re("digit",ir.digit,r.initialDigit),new re("letter",ir.variable,r.initialLetter);t.handlers.get(At.CHARACTER).add(["letter","digit"],null,4)},[bt.HANDLER]:{[At.CHARACTER]:["command","special"],[At.DELIMITER]:["delimiter"],[At.MACRO]:["delimiter","macros","lcGreek","ucGreek","mathchar0mi","mathchar0mo","mathchar7"],[At.ENVIRONMENT]:["environment"]},[bt.FALLBACK]:{[At.CHARACTER]:dr,[At.MACRO]:function(t,e){throw new Mt("UndefinedControlSequence","Undefined control sequence %1","\\"+e)},[At.ENVIRONMENT]:function(t,e){throw new Mt("UnknownEnv","Unknown environment '%1'",e)}},[bt.ITEMS]:{[ke.prototype.kind]:ke,[we.prototype.kind]:we,[Me.prototype.kind]:Me,[xe.prototype.kind]:xe,[Te.prototype.kind]:Te,[Pe.prototype.kind]:Pe,[Ee.prototype.kind]:Ee,[Ce.prototype.kind]:Ce,[Se.prototype.kind]:Se,[Oe.prototype.kind]:Oe,[Ie.prototype.kind]:Ie,[Ne.prototype.kind]:Ne,[Le.prototype.kind]:Le,[Fe.prototype.kind]:Fe,[Re.prototype.kind]:Re,[De.prototype.kind]:De,[Be.prototype.kind]:Be,[Ge.prototype.kind]:Ge,[qe.prototype.kind]:qe,[_e.prototype.kind]:_e,[He.prototype.kind]:He,[Ue.prototype.kind]:Ue,[je.prototype.kind]:je,[Ke.prototype.kind]:Ke,[Xe.prototype.kind]:Xe,[ze.prototype.kind]:ze},[bt.OPTIONS]:{maxMacros:1e3,digits:"",numberPattern:/^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)?|\.[0-9]+)/,initialDigit:/[0-9.,]/,identifierPattern:/^[a-zA-Z]+/,initialLetter:/[a-zA-Z]/,baseURL:mr.document&&0!==mr.document.getElementsByTagName("base").length?String(mr.document.location).replace(/#.*$/,""):""},[bt.TAGS]:{base:gr},[bt.POSTPROCESSORS]:[[function({data:t}){for(const e of t.getList("nonscript"))if(e.attributes.get("scriptlevel")>0){const r=e.parent;if(r.childNodes.splice(r.childIndex(e),1),t.removeFromList(e.kind,[e]),e.isKind("mrow")){const r=e.childNodes[0];t.removeFromList("mstyle",[r]),t.removeFromList("mspace",r.childNodes[0].childNodes)}}else e.isKind("mrow")&&(e.parent.replaceChild(e.childNodes[0],e),t.removeFromList("mrow",[e]))},-4]]});class fr extends U{static configure(t){const e=new Ae(t,["tex"]);return e.init(),e}static tags(t,e){Yt.addTags(e.tags),Yt.setDefault(t.options.tags),t.tags=Yt.getDefault(),t.tags.configuration=t}constructor(t={}){const[e,r,s]=V(t,fr.OPTIONS,st.OPTIONS);super(r),this.findTeX=this.options.FindTeX||new st(s);const n=this.options.packages,i=this.configuration=fr.configure(n),a=this._parseOptions=new jt(i,[this.options,Yt.OPTIONS]);$(a.options,e),i.config(this),fr.tags(a,i),this.postFilters.addList([[ft.cleanSubSup,-7],[ft.setInherited,-6],[ft.checkScriptlevel,-5],[ft.moveLimits,-4],[ft.cleanStretchy,-3],[ft.cleanAttributes,-2],[ft.combineRelations,-1]])}setMmlFactory(t){super.setMmlFactory(t),this._parseOptions.nodeFactory.setMmlFactory(t)}get parseOptions(){return this._parseOptions}reset(t=0){this.parseOptions.tags.reset(t)}compile(t,e){let r,s;this.parseOptions.clear(),this.parseOptions.mathItem=t,this.executeFilters(this.preFilters,t,e,this.parseOptions),this.latex=t.math,this.parseOptions.tags.startEquation(t);try{s=new Et(this.latex,{display:t.display,isInner:!1},this.parseOptions),r=s.mml()}catch(t){if(!(t instanceof Mt))throw t;this.parseOptions.error=!0,r=this.options.formatError(this,t)}return r=this.parseOptions.nodeFactory.create("node","math",[r]),r.attributes.set(Pt.Attr.LATEX,this.latex),t.display&&ht.setAttribute(r,"display","block"),this.parseOptions.tags.finishEquation(t),this.parseOptions.root=r,this.executeFilters(this.postFilters,t,e,this.parseOptions),s&&s.stack.env.hsize&&(ht.setAttribute(r,"maxwidth",s.stack.env.hsize),ht.setAttribute(r,"overflow","linebreak")),this.mathNode=this.parseOptions.root,this.mathNode}findMath(t){return this.findTeX.findMath(t)}formatError(t){const e=t.message.replace(/\n.*/,"");return this.parseOptions.nodeFactory.create("error",e,t.id,this.latex)}}fr.NAME="TeX",fr.OPTIONS=Object.assign(Object.assign({},U.OPTIONS),{FindTeX:null,packages:["base"],maxBuffer:5120,maxTemplateSubtitutions:1e4,mathStyle:"TeX",formatError:(t,e)=>t.formatError(e)});class br extends je{constructor(t,...e){super(t),this.factory.configuration.tags.start("multline",!0,e[0])}get kind(){return"multline"}EndEntry(){this.table.length&&qt.fixInitialMO(this.factory.configuration,this.nodes);const t=this.getProperty("shove"),e=this.create("node","mtd",this.nodes,t?{columnalign:t}:{});this.setProperty("shove",null),this.row.push(e),this.Clear()}EndRow(){if(1!==this.row.length)throw new Mt("MultlineRowsOneCol","The rows within the %1 environment must have exactly one column","multline");const t=this.create("node","mtr",this.row);this.table.push(t),this.row=[]}EndTable(){if(super.EndTable(),this.table.length){const t=this.table.length-1;let e=-1;ht.getAttribute(ht.getChildren(this.table[0])[0],"columnalign")||ht.setAttribute(ht.getChildren(this.table[0])[0],"columnalign",Pt.Align.LEFT),ht.getAttribute(ht.getChildren(this.table[t])[0],"columnalign")||ht.setAttribute(ht.getChildren(this.table[t])[0],"columnalign",Pt.Align.RIGHT);const r=this.factory.configuration.tags.getTag();if(r){e=this.arraydef.side===Pt.Align.LEFT?0:this.table.length-1;const t=this.table[e],s=this.create("node","mlabeledtr",[r].concat(ht.getChildren(t)));ht.copyAttributes(t,s),this.table[e]=s}}this.factory.configuration.tags.end()}}class Ar extends Ke{get kind(){return"flalign"}constructor(t,e,r,s,n){super(t),this.name=e,this.numbered=r,this.padded=s,this.center=n,this.factory.configuration.tags.start(e,r,r)}EndEntry(){super.EndEntry();const t=this.getProperty("xalignat");if(t&&this.row.length>t)throw new Mt("XalignOverflow","Extra %1 in row of %2","&",this.name)}EndRow(){let t;const e=this.row,r=this.getProperty("xalignat");for(;e.length<r;)e.push(this.create("node","mtd"));for(this.row=[],this.padded&&this.row.push(this.create("node","mtd"));t=e.shift();)this.row.push(t),t=e.shift(),t&&this.row.push(t),(e.length||this.padded)&&this.row.push(this.create("node","mtd"));this.row.length>this.maxrow&&(this.maxrow=this.row.length),super.EndRow();const s=this.table[this.table.length-1];if(this.getProperty("zeroWidthLabel")&&s.isKind("mlabeledtr")){const t=ht.getChildren(s)[0],e=this.factory.configuration.options.tagSide,r=Object.assign({width:0},"right"===e?{lspace:"-1width"}:{}),n=this.create("node","mpadded",ht.getChildren(t),r);t.setChildren([n])}}EndTable(){if(super.EndTable(),this.center&&this.maxrow<=2){delete this.arraydef.width,delete this.global.indentalign}}}var yr;!function(t){t.NEW_DELIMITER="new-Delimiter",t.NEW_COMMAND="new-Command",t.NEW_ENVIRONMENT="new-Environment"}(yr||(yr={}));const vr=-100,kr={GetCSname(t,e){if("\\"!==t.GetNext())throw new Mt("MissingCS","%1 must be followed by a control sequence",e);const r=vt.trimSpaces(t.GetArgument(e)).substring(1);return this.checkProtectedMacros(t,r),r},GetCsNameArgument(t,e){let r=vt.trimSpaces(t.GetArgument(e));if("\\"===r.charAt(0)&&(r=r.substring(1)),!r.match(/^(.|[a-z]+)$/i))throw new Mt("IllegalControlSequenceName","Illegal control sequence name for %1",e);return this.checkProtectedMacros(t,r),r},GetArgCount(t,e){let r=t.GetBrackets(e);if(r&&(r=vt.trimSpaces(r),!r.match(/^[0-9]+$/)))throw new Mt("IllegalParamNumber","Illegal number of parameters specified in %1",e);return r},GetTemplate(t,e,r){let s=t.GetNext();const n=[];let i=0,a=t.i;for(;t.i<t.string.length;){if(s=t.GetNext(),"#"===s){if(a!==t.i&&(n[i]=t.string.substring(a,t.i)),s=t.string.charAt(++t.i),!s.match(/^[1-9]$/))throw new Mt("CantUseHash2","Illegal use of # in template for %1",r);if(parseInt(s)!==++i)throw new Mt("SequentialParam","Parameters for %1 must be numbered sequentially",r);a=t.i+1}else if("{"===s)return a!==t.i&&(n[i]=t.string.substring(a,t.i)),n.length>0?[i.toString()].concat(n):i;t.i++}throw new Mt("MissingReplacementString","Missing replacement string for definition of %1",e)},GetParameter(t,e,r){if(null==r)return t.GetArgument(e);let s=t.i,n=0,i=!1;for(;t.i<t.string.length;){const a=t.string.charAt(t.i);if("{"===a)i=t.i===s,t.GetArgument(e),n=t.i-s;else{if(this.MatchParam(t,r))return i&&(s++,n-=2),t.string.substring(s,s+n);if("\\"===a){t.i++,n++,i=!1;const e=t.string.substring(t.i).match(/[a-z]+|./i);e&&(t.i+=e[0].length,n=t.i-s)}else t.i++,n++,i=!1}}throw new Mt("RunawayArgument","Runaway argument for %1?",e)},MatchParam:(t,e)=>t.string.substring(t.i,t.i+e.length)!==e||e.match(/\\[a-z]+$/i)&&t.string.charAt(t.i+e.length).match(/[a-z]/i)?0:(t.i+=e.length,1),checkGlobal:(t,e,r)=>t.stack.env.isGlobal?t.configuration.packageData.get("begingroup").stack.checkGlobal(e,r):r.map((e=>t.configuration.handlers.retrieve(e))),checkProtectedMacros(t,e){var r;if(null===(r=t.options.protectedMacros)||void 0===r?void 0:r.includes(e))throw new Mt("ProtectedMacro","The control sequence %1 can't be redefined",`\\${e}`)},addDelimiter(t,e,r,s){const n=e.substring(1);this.checkProtectedMacros(t,n);const[i,a]=kr.checkGlobal(t,[n,e],[yr.NEW_COMMAND,yr.NEW_DELIMITER]);n!==e&&i.remove(n),a.add(e,new Qt(e,r,s)),delete t.stack.env.isGlobal},addMacro(t,e,r,s,n=""){this.checkProtectedMacros(t,e);const i=kr.checkGlobal(t,[e],[yr.NEW_COMMAND])[0];this.undefineDelimiter(t,"\\"+e),i.add(e,new Zt(n||e,r,s)),delete t.stack.env.isGlobal},addEnvironment(t,e,r,s){kr.checkGlobal(t,[e],[yr.NEW_ENVIRONMENT])[0].add(e,new Zt(e,r,s)),delete t.stack.env.isGlobal},undefineMacro(t,e){const r=kr.checkGlobal(t,[e],[yr.NEW_COMMAND])[0];r.remove(e),t.configuration.handlers.get(At.MACRO).applicable(e)&&(r.add(e,new Zt(e,(()=>de.FALLBACK),[])),this.undefineDelimiter(t,"\\"+e)),delete t.stack.env.isGlobal},undefineDelimiter(t,e){const r=kr.checkGlobal(t,[e],[yr.NEW_DELIMITER])[0];r.remove(e),t.configuration.handlers.get(At.DELIMITER).applicable(e)&&r.add(e,new Qt(e,null,{})),delete t.stack.env.isGlobal}};function wr(t){if(!t||t.isInferred&&0===t.childNodes.length)return[null,null];if(t.isKind("msubsup")&&Mr(t))return[t,null];const e=ht.getChildAt(t,0);return t.isInferred&&e&&Mr(e)?(t.childNodes.splice(0,1),[e,t]):[null,t]}function Mr(t){const e=t.childNodes[0];return e&&e.isKind("mi")&&""===e.getText()}const xr={AmsEqnArray(t,e,r,s,n,i,a,o){const c=t.GetBrackets("\\begin{"+e.getName()+"}"),l=rr.EqnArray(t,e,r,s,n,i,a,o);return qt.setArrayAlign(l,c,t)},AlignAt(t,e,r,s){const n=e.getName();let i,a="",o="";const c=[];s||(i=t.GetBrackets("\\begin{"+n+"}"));const l=t.GetArgument("\\begin{"+n+"}");if(l.match(/[^0-9]/))throw new Mt("PositiveIntegerArg","Argument to %1 must be a positive integer","\\begin{"+n+"}");let h=parseInt(l,10);for(;h>0;)a+="rl",o+="bt",c.push("0em 0em"),h--;const m=c.join(" ");if(s)return xr.EqnArray(t,e,r,s,a,o,m);const u=xr.EqnArray(t,e,r,s,a,o,m);return qt.setArrayAlign(u,i,t)},Multline(t,e,r){qt.checkEqnEnv(t),t.Push(e);const s=t.options.ams.multlineIndent,n=t.itemFactory.create("multline",r,t.stack);return n.arraydef={displaystyle:!0,rowspacing:".5em",columnspacing:"100%",width:t.options.ams.multlineWidth,side:t.options.tagSide,minlabelspacing:t.options.tagIndent,"data-array-padding":`${s} ${s}`,"data-width-includes-label":!0},n},XalignAt(t,e,r,s){const n=t.GetArgument("\\begin{"+e.getName()+"}");if(n.match(/[^0-9]/))throw new Mt("PositiveIntegerArg","Argument to %1 must be a positive integer","\\begin{"+e.getName()+"}");const i=s?"crl":"rlc",a=s?"mbt":"btm",o=s?"fit auto auto":"auto auto fit",c=xr.FlalignArray(t,e,r,s,!1,i,a,o,!0);return c.setProperty("xalignat",2*parseInt(n)),c},FlalignArray(t,e,r,s,n,i,a,o,c=!1){qt.checkEqnEnv(t),t.Push(e),i=i.split("").join(" ").replace(/r/g,"right").replace(/l/g,"left").replace(/c/g,"center"),a=Ze(a);const l=t.itemFactory.create("flalign",e.getName(),r,s,n,t.stack);return l.arraydef={width:"100%",displaystyle:!0,columnalign:i,columnspacing:"0em",columnwidth:o,rowspacing:"3pt","data-break-align":a,side:t.options.tagSide,minlabelspacing:c?"0":t.options.tagIndent,"data-width-includes-label":!0},l.setProperty("zeroWidthLabel",c),l},HandleDeclareOp(t,e){const r=t.GetStar()?"*":"",s=kr.GetCsNameArgument(t,e),n=t.GetArgument(e);kr.addMacro(t,s,xr.Macro,[`\\operatorname${r}{${n}}`]),t.Push(t.itemFactory.create("null"))},HandleOperatorName(t,e){const r=t.GetStar(),s=vt.trimSpaces(t.GetArgument(e));let n=new Et(s,Object.assign(Object.assign({},t.stack.env),{font:Pt.Variant.NORMAL,multiLetterIdentifiers:t.options.ams.operatornamePattern,operatorLetters:!0}),t.configuration).mml();if(n.isKind("mi")||(n=t.create("node","TeXAtom",[n])),ht.setProperties(n,{movesupsub:r,movablelimits:!0,texClass:it.OP}),!r){const e=t.GetNext(),r=t.i;"\\"===e&&++t.i&&"limits"!==t.GetCS()&&(t.i=r)}t.Push(t.itemFactory.create("fn",n))},SideSet(t,e){const[r,s]=wr(t.ParseArg(e)),[n,i]=wr(t.ParseArg(e)),a=t.ParseArg(e);let o=a;r&&(s?r.replaceChild(t.create("node","mphantom",[t.create("node","mpadded",[qt.copyNode(a,t)],{width:0})]),ht.getChildAt(r,0)):(o=t.create("node","mmultiscripts",[a]),n&&ht.appendChildren(o,[ht.getChildAt(n,1)||t.create("node","none"),ht.getChildAt(n,2)||t.create("node","none")]),ht.setProperty(o,"scriptalign","left"),ht.appendChildren(o,[t.create("node","mprescripts"),ht.getChildAt(r,1)||t.create("node","none"),ht.getChildAt(r,2)||t.create("node","none")]))),n&&o===a&&(n.replaceChild(a,ht.getChildAt(n,0)),o=n);const c=t.create("node","TeXAtom",[],{texClass:it.OP,movesupsub:!0,movablelimits:!0});s&&(r&&c.appendChild(r),c.appendChild(s)),c.appendChild(o),i&&c.appendChild(i),t.Push(c)},operatorLetter:(t,e)=>!!t.stack.env.operatorLetters&&ir.variable(t,e),MultiIntegral(t,e,r){let s=t.GetNext();if("\\"===s){const n=t.i;s=t.GetArgument(e),t.i=n,"\\limits"===s&&(r="\\!\\!\\mathop{\\,\\,"+r+"}")}t.string=r+" "+t.string.slice(t.i),t.i=0},xArrow(t,e,r,s,n,i=0){const a={width:"+"+vt.em((s+n)/18),lspace:vt.em(s/18)},o=t.GetBrackets(e),c=t.ParseArg(e),l=t.create("node","mspace",[],{depth:".2em"});let h=t.create("token","mo",{stretchy:!0,texClass:it.REL},String.fromCodePoint(r));i&&h.attributes.set("minsize",vt.em(i)),h=t.create("node","mstyle",[h],{scriptlevel:0});const m=t.create("node","munderover",[h]);let u=t.create("node","mpadded",[c,l],a);if(ht.setAttribute(u,"voffset","-.2em"),ht.setAttribute(u,"height","-.2em"),ht.setChild(m,m.over,u),o){const e=new Et(o,t.stack.env,t.configuration).mml(),r=t.create("node","mspace",[],{height:".75em"});u=t.create("node","mpadded",[e,r],a),ht.setAttribute(u,"voffset",".15em"),ht.setAttribute(u,"depth","-.15em"),ht.setChild(m,m.under,u)}ht.setProperty(m,"subsupOK",!0),t.Push(m)},HandleShove(t,e,r){const s=t.stack.Top();if("multline"!==s.kind)throw new Mt("CommandOnlyAllowedInEnv","%1 only allowed in %2 environment",t.currentCS,"multline");if(s.Size())throw new Mt("CommandAtTheBeginingOfLine","%1 must come at the beginning of the line",t.currentCS);s.setProperty("shove",r)},CFrac(t,e){let r=vt.trimSpaces(t.GetBrackets(e,""));const s=t.GetArgument(e),n=t.GetArgument(e),i={l:Pt.Align.LEFT,r:Pt.Align.RIGHT,"":""},a=new Et("\\strut\\textstyle{"+s+"}",t.stack.env,t.configuration).mml(),o=new Et("\\strut\\textstyle{"+n+"}",t.stack.env,t.configuration).mml(),c=t.create("node","mfrac",[a,o]);if(r=i[r],null==r)throw new Mt("IllegalAlign","Illegal alignment specified in %1",t.currentCS);r&&ht.setProperties(c,{numalign:r,denomalign:r}),t.Push(c)},Genfrac(t,e,r,s,n,i){null==r&&(r=t.GetDelimiterArg(e)),null==s&&(s=t.GetDelimiterArg(e)),null==n&&(n=t.GetArgument(e)),null==i&&(i=vt.trimSpaces(t.GetArgument(e)));const a=t.ParseArg(e),o=t.ParseArg(e);let c=t.create("node","mfrac",[a,o]);if(""!==n&&ht.setAttribute(c,"linethickness",n),(r||s)&&(ht.setProperty(c,"withDelims",!0),c=qt.fixedFence(t.configuration,r,c,s)),""!==i){const e=parseInt(i,10),r=["D","T","S","SS"][e];if(null==r)throw new Mt("BadMathStyleFor","Bad math style for %1",t.currentCS);c=t.create("node","mstyle",[c]),"D"===r?ht.setProperties(c,{displaystyle:!0,scriptlevel:0}):ht.setProperties(c,{displaystyle:!1,scriptlevel:e-1})}t.Push(c)},HandleTag(t,e){if(!t.tags.currentTag.taggable&&t.tags.env)throw new Mt("CommandNotAllowedInEnv","%1 not allowed in %2 environment",t.currentCS,t.tags.env);if(t.tags.currentTag.tag)throw new Mt("MultipleCommand","Multiple %1",t.currentCS);const r=t.GetStar(),s=vt.trimSpaces(t.GetArgument(e));t.tags.tag(s,r),t.Push(t.itemFactory.create("null"))},HandleNoTag:rr.HandleNoTag,HandleRef:rr.HandleRef,Macro:rr.Macro,Accent:rr.Accent,Tilde:rr.Tilde,Array:rr.Array,Spacer:rr.Spacer,NamedOp:rr.NamedOp,EqnArray:rr.EqnArray,Equation:rr.Equation};new ne("AMSmath-mathchar0mo",ir.mathchar0mo,{iiiint:["\u2a0c",{texClass:it.OP}]}),new re("AMSmath-operatorLetter",xr.operatorLetter,/[-*]/i),new oe("AMSmath-macros",{mathring:[xr.Accent,"02DA"],nobreakspace:xr.Tilde,negmedspace:[xr.Spacer,Je.negativemediummathspace],negthickspace:[xr.Spacer,Je.negativethickmathspace],idotsint:[xr.MultiIntegral,"\\int\\cdots\\int"],dddot:[xr.Accent,"20DB"],ddddot:[xr.Accent,"20DC"],sideset:xr.SideSet,boxed:[xr.Macro,"\\fbox{$\\displaystyle{#1}$}",1],tag:xr.HandleTag,notag:xr.HandleNoTag,eqref:[xr.HandleRef,!0],substack:[xr.Macro,"\\begin{subarray}{c}#1\\end{subarray}",1],injlim:[xr.NamedOp,"inj&thinsp;lim"],projlim:[xr.NamedOp,"proj&thinsp;lim"],varliminf:[xr.Macro,"\\mathop{\\underline{\\mmlToken{mi}{lim}}}"],varlimsup:[xr.Macro,"\\mathop{\\overline{\\mmlToken{mi}{lim}}}"],varinjlim:[xr.Macro,"\\mathop{\\underrightarrow{\\mmlToken{mi}{lim}}}"],varprojlim:[xr.Macro,"\\mathop{\\underleftarrow{\\mmlToken{mi}{lim}}}"],DeclareMathOperator:xr.HandleDeclareOp,operatorname:xr.HandleOperatorName,genfrac:xr.Genfrac,frac:[xr.Genfrac,"","","",""],tfrac:[xr.Genfrac,"","","","1"],dfrac:[xr.Genfrac,"","","","0"],binom:[xr.Genfrac,"(",")","0",""],tbinom:[xr.Genfrac,"(",")","0","1"],dbinom:[xr.Genfrac,"(",")","0","0"],cfrac:xr.CFrac,shoveleft:[xr.HandleShove,Pt.Align.LEFT],shoveright:[xr.HandleShove,Pt.Align.RIGHT],xrightarrow:[xr.xArrow,8594,5,10],xleftarrow:[xr.xArrow,8592,10,5]}),new ce("AMSmath-environment",ir.environment,{"equation*":[xr.Equation,null,!1],"eqnarray*":[xr.EqnArray,null,!1,!0,"rcl","bmt",qt.cols(0,Je.thickmathspace),".5em"],align:[xr.EqnArray,null,!0,!0,"rl","bt",qt.cols(0,2)],"align*":[xr.EqnArray,null,!1,!0,"rl","bt",qt.cols(0,2)],multline:[xr.Multline,null,!0],"multline*":[xr.Multline,null,!1],split:[xr.EqnArray,null,!1,!1,"rl","bt",qt.cols(0)],gather:[xr.EqnArray,null,!0,!0,"c","m"],"gather*":[xr.EqnArray,null,!1,!0,"c","m"],alignat:[xr.AlignAt,null,!0,!0],"alignat*":[xr.AlignAt,null,!1,!0],alignedat:[xr.AlignAt,null,!1,!1],aligned:[xr.AmsEqnArray,null,null,null,"rl","bt",qt.cols(0,2),".5em","D"],gathered:[xr.AmsEqnArray,null,null,null,"c","m",null,".5em","D"],xalignat:[xr.XalignAt,null,!0,!0],"xalignat*":[xr.XalignAt,null,!1,!0],xxalignat:[xr.XalignAt,null,!1,!1],flalign:[xr.FlalignArray,null,!0,!1,!0,"rlc","btm","auto auto fit"],"flalign*":[xr.FlalignArray,null,!1,!1,!0,"rlc","btm","auto auto fit"],subarray:[xr.Array,null,null,null,null,qt.cols(0),"0.1em","S",!0],smallmatrix:[xr.Array,null,null,null,"c",qt.cols(1/3),".2em","S",!0],matrix:[xr.Array,null,null,null,"c"],pmatrix:[xr.Array,null,"(",")","c"],bmatrix:[xr.Array,null,"[","]","c"],Bmatrix:[xr.Array,null,"\\{","\\}","c"],vmatrix:[xr.Array,null,"\\vert","\\vert","c"],Vmatrix:[xr.Array,null,"\\Vert","\\Vert","c"],cases:[xr.Array,null,"\\{",".","ll",null,".2em","T"]}),new ie("AMSmath-delimiter",ir.delimiter,{"\\lvert":["|",{texClass:it.OPEN}],"\\rvert":["|",{texClass:it.CLOSE}],"\\lVert":["\u2016",{texClass:it.OPEN}],"\\rVert":["\u2016",{texClass:it.CLOSE}]}),new ne("AMSsymbols-mathchar0mi",ir.mathchar0mi,{digamma:"\u03dd",varkappa:"\u03f0",varGamma:["\u0393",{mathvariant:Pt.Variant.ITALIC}],varDelta:["\u0394",{mathvariant:Pt.Variant.ITALIC}],varTheta:["\u0398",{mathvariant:Pt.Variant.ITALIC}],varLambda:["\u039b",{mathvariant:Pt.Variant.ITALIC}],varXi:["\u039e",{mathvariant:Pt.Variant.ITALIC}],varPi:["\u03a0",{mathvariant:Pt.Variant.ITALIC}],varSigma:["\u03a3",{mathvariant:Pt.Variant.ITALIC}],varUpsilon:["\u03a5",{mathvariant:Pt.Variant.ITALIC}],varPhi:["\u03a6",{mathvariant:Pt.Variant.ITALIC}],varPsi:["\u03a8",{mathvariant:Pt.Variant.ITALIC}],varOmega:["\u03a9",{mathvariant:Pt.Variant.ITALIC}],beth:"\u2136",gimel:"\u2137",daleth:"\u2138",backprime:["\u2035",{variantForm:!0}],hslash:"\u210f",varnothing:["\u2205",{variantForm:!0}],blacktriangle:"\u25b4",triangledown:["\u25bd",{variantForm:!0}],blacktriangledown:"\u25be",square:"\u25fb",Box:"\u25fb",blacksquare:"\u25fc",lozenge:"\u25ca",Diamond:"\u25ca",blacklozenge:"\u29eb",circledS:["\u24c8",{mathvariant:Pt.Variant.NORMAL}],bigstar:"\u2605",sphericalangle:"\u2222",measuredangle:"\u2221",nexists:"\u2204",complement:"\u2201",mho:"\u2127",eth:["\xf0",{mathvariant:Pt.Variant.NORMAL}],Finv:"\u2132",diagup:"\u2571",Game:"\u2141",diagdown:"\u2572",Bbbk:["k",{mathvariant:Pt.Variant.DOUBLESTRUCK}],yen:"\xa5",circledR:"\xae",checkmark:"\u2713",maltese:"\u2720"}),new ne("AMSsymbols-mathchar0mo",ir.mathchar0mo,{dotplus:"\u2214",ltimes:"\u22c9",smallsetminus:["\u2216",{variantForm:!0}],rtimes:"\u22ca",Cap:"\u22d2",doublecap:"\u22d2",leftthreetimes:"\u22cb",Cup:"\u22d3",doublecup:"\u22d3",rightthreetimes:"\u22cc",barwedge:"\u22bc",curlywedge:"\u22cf",veebar:"\u22bb",curlyvee:"\u22ce",doublebarwedge:"\u2a5e",boxminus:"\u229f",circleddash:"\u229d",boxtimes:"\u22a0",circledast:"\u229b",boxdot:"\u22a1",circledcirc:"\u229a",boxplus:"\u229e",centerdot:["\u22c5",{variantForm:!0}],divideontimes:"\u22c7",intercal:"\u22ba",leqq:"\u2266",geqq:"\u2267",leqslant:"\u2a7d",geqslant:"\u2a7e",eqslantless:"\u2a95",eqslantgtr:"\u2a96",lesssim:"\u2272",gtrsim:"\u2273",lessapprox:"\u2a85",gtrapprox:"\u2a86",approxeq:"\u224a",lessdot:"\u22d6",gtrdot:"\u22d7",lll:"\u22d8",llless:"\u22d8",ggg:"\u22d9",gggtr:"\u22d9",lessgtr:"\u2276",gtrless:"\u2277",lesseqgtr:"\u22da",gtreqless:"\u22db",lesseqqgtr:"\u2a8b",gtreqqless:"\u2a8c",doteqdot:"\u2251",Doteq:"\u2251",eqcirc:"\u2256",risingdotseq:"\u2253",circeq:"\u2257",fallingdotseq:"\u2252",triangleq:"\u225c",backsim:"\u223d",thicksim:["\u223c",{variantForm:!0}],backsimeq:"\u22cd",thickapprox:["\u2248",{variantForm:!0}],subseteqq:"\u2ac5",supseteqq:"\u2ac6",Subset:"\u22d0",Supset:"\u22d1",sqsubset:"\u228f",sqsupset:"\u2290",preccurlyeq:"\u227c",succcurlyeq:"\u227d",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",precsim:"\u227e",succsim:"\u227f",precapprox:"\u2ab7",succapprox:"\u2ab8",vartriangleleft:"\u22b2",lhd:"\u22b2",vartriangleright:"\u22b3",rhd:"\u22b3",trianglelefteq:"\u22b4",unlhd:"\u22b4",trianglerighteq:"\u22b5",unrhd:"\u22b5",vDash:"\u22a8",Vdash:"\u22a9",Vvdash:"\u22aa",smallsmile:["\u2323",{variantForm:!0}],shortmid:["\u2223",{variantForm:!0}],smallfrown:["\u2322",{variantForm:!0}],shortparallel:["\u2225",{variantForm:!0}],bumpeq:"\u224f",between:"\u226c",Bumpeq:"\u224e",pitchfork:"\u22d4",varpropto:["\u221d",{variantForm:!0}],backepsilon:"\u220d",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",therefore:"\u2234",because:"\u2235",eqsim:"\u2242",vartriangle:["\u25b3",{variantForm:!0}],Join:"\u22c8",nless:"\u226e",ngtr:"\u226f",nleq:"\u2270",ngeq:"\u2271",nleqslant:["\u2a87",{variantForm:!0}],ngeqslant:["\u2a88",{variantForm:!0}],nleqq:["\u2270",{variantForm:!0}],ngeqq:["\u2271",{variantForm:!0}],lneq:"\u2a87",gneq:"\u2a88",lneqq:"\u2268",gneqq:"\u2269",lvertneqq:["\u2268",{variantForm:!0}],gvertneqq:["\u2269",{variantForm:!0}],lnsim:"\u22e6",gnsim:"\u22e7",lnapprox:"\u2a89",gnapprox:"\u2a8a",nprec:"\u2280",nsucc:"\u2281",npreceq:["\u22e0",{variantForm:!0}],nsucceq:["\u22e1",{variantForm:!0}],precneqq:"\u2ab5",succneqq:"\u2ab6",precnsim:"\u22e8",succnsim:"\u22e9",precnapprox:"\u2ab9",succnapprox:"\u2aba",nsim:"\u2241",ncong:"\u2247",nshortmid:["\u2224",{variantForm:!0}],nshortparallel:["\u2226",{variantForm:!0}],nmid:"\u2224",nparallel:"\u2226",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",ntriangleleft:"\u22ea",ntriangleright:"\u22eb",ntrianglelefteq:"\u22ec",ntrianglerighteq:"\u22ed",nsubseteq:"\u2288",nsupseteq:"\u2289",nsubseteqq:["\u2288",{variantForm:!0}],nsupseteqq:["\u2289",{variantForm:!0}],subsetneq:"\u228a",supsetneq:"\u228b",varsubsetneq:["\u228a",{variantForm:!0}],varsupsetneq:["\u228b",{variantForm:!0}],subsetneqq:"\u2acb",supsetneqq:"\u2acc",varsubsetneqq:["\u2acb",{variantForm:!0}],varsupsetneqq:["\u2acc",{variantForm:!0}],leftleftarrows:"\u21c7",rightrightarrows:"\u21c9",leftrightarrows:"\u21c6",rightleftarrows:"\u21c4",Lleftarrow:"\u21da",Rrightarrow:"\u21db",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",leftarrowtail:"\u21a2",rightarrowtail:"\u21a3",looparrowleft:"\u21ab",looparrowright:"\u21ac",leftrightharpoons:"\u21cb",rightleftharpoons:["\u21cc",{variantForm:!0}],curvearrowleft:"\u21b6",curvearrowright:"\u21b7",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",Lsh:"\u21b0",Rsh:"\u21b1",upuparrows:"\u21c8",downdownarrows:"\u21ca",upharpoonleft:"\u21bf",upharpoonright:"\u21be",downharpoonleft:"\u21c3",restriction:"\u21be",multimap:"\u22b8",downharpoonright:"\u21c2",leftrightsquigarrow:"\u21ad",rightsquigarrow:"\u21dd",leadsto:"\u21dd",dashrightarrow:"\u21e2",dashleftarrow:"\u21e0",nleftarrow:"\u219a",nrightarrow:"\u219b",nLeftarrow:"\u21cd",nRightarrow:"\u21cf",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce"}),new ie("AMSsymbols-delimiter",ir.delimiter,{"\\ulcorner":"\u231c","\\urcorner":"\u231d","\\llcorner":"\u231e","\\lrcorner":"\u231f"}),new oe("AMSsymbols-macros",{implies:[xr.Macro,"\\;\\Longrightarrow\\;"],impliedby:[xr.Macro,"\\;\\Longleftarrow\\;"]});class Tr extends Tt{get kind(){return"beginEnv"}get isOpen(){return!0}checkItem(t){if(t.isKind("end")){if(t.getName()!==this.getName())throw new Mt("EnvBadEnd","\\begin{%1} ended with \\end{%2}",this.getName(),t.getName());return[[this.factory.create("mml",this.toMml())],!0]}if(t.isKind("stop"))throw new Mt("EnvMissingEnd","Missing \\end{%1}",this.getName());return super.checkItem(t)}}const Pr={NewCommand(t,e){const r=kr.GetCsNameArgument(t,e),s=kr.GetArgCount(t,e),n=t.GetBrackets(e),i=t.GetArgument(e);kr.addMacro(t,r,Pr.Macro,[i,s,n]),t.Push(t.itemFactory.create("null"))},NewEnvironment(t,e){const r=vt.trimSpaces(t.GetArgument(e)),s=kr.GetArgCount(t,e),n=t.GetBrackets(e),i=t.GetArgument(e),a=t.GetArgument(e);kr.addEnvironment(t,r,Pr.BeginEnv,[!0,i,a,s,n]),t.Push(t.itemFactory.create("null"))},MacroDef(t,e){const r=kr.GetCSname(t,e),s=kr.GetTemplate(t,e,"\\"+r),n=t.GetArgument(e);s instanceof Array?kr.addMacro(t,r,Pr.MacroWithTemplate,[n].concat(s)):kr.addMacro(t,r,Pr.Macro,[n,s]),t.Push(t.itemFactory.create("null"))},Let(t,e){const r=kr.GetCSname(t,e);let s=t.GetNext();"="===s&&(t.i++,s=t.GetNext());const n=t.configuration.handlers;if(t.Push(t.itemFactory.create("null")),"\\"===s){if(r===(e=kr.GetCSname(t,e)))return;const s=n.get(At.MACRO).applicable(e);if(s instanceof ae){const n=s.lookup(e);return void kr.addMacro(t,r,n.func,n.args,n.token)}if(s instanceof ne&&!(s instanceof ie)){const n=s.lookup(e),i=t=>s.parser(t,n);return void kr.addMacro(t,r,i,[r,n.char])}const i=n.get(At.DELIMITER).lookup("\\"+e);return i?void kr.addDelimiter(t,"\\"+r,i.char,i.attributes):(kr.checkProtectedMacros(t,r),kr.undefineMacro(t,r),void kr.undefineDelimiter(t,"\\"+r))}t.i++;const i=n.get(At.DELIMITER).lookup(s);i?kr.addDelimiter(t,"\\"+r,i.char,i.attributes):kr.addMacro(t,r,Pr.Macro,[s])},MacroWithTemplate(t,e,r,s,...n){const i=parseInt(s,10);if(n.length){const s=[];if(t.GetNext(),n[0]&&!kr.MatchParam(t,n[0]))throw new Mt("MismatchUseDef","Use of %1 doesn't match its definition",e);if(i){for(let r=0;r<i;r++)s.push(kr.GetParameter(t,e,n[r+1]));r=qt.substituteArgs(t,s,r)}}t.string=qt.addArgs(t,r,t.string.slice(t.i)),t.i=0,qt.checkMaxMacros(t)},BeginEnv(t,e,r,s,n,i){const a=e.getName();if(t.stack.env.closing===a){delete t.stack.env.closing;if(t.stack.global.beginEnv&&(t.stack.global.beginEnv--,s)){const e=t.string.slice(t.i);t.string=qt.addArgs(t,t.string.substring(0,t.i),s),t.Parse(),t.string=e,t.i=0}return t.itemFactory.create("end").setProperty("name",a)}if(n){const e=[];if(null!=i){const r=t.GetBrackets(`\\begin{${a}}`);e.push(null==r?i:r)}for(let r=e.length;r<n;r++)e.push(t.GetArgument(`\\begin{${a}}`));r=qt.substituteArgs(t,e,r),s=qt.substituteArgs(t,[],s)}return t.string=qt.addArgs(t,r,t.string.slice(t.i)),t.i=0,t.stack.global.beginEnv=(t.stack.global.beginEnv||0)+1,t.itemFactory.create("beginEnv").setProperty("name",a)},Macro:rr.Macro},Er=Pr;function Cr(t,e){e.parseOptions.packageData.has("newcommand")||(e.parseOptions.packageData.set("newcommand",{}),new ie(yr.NEW_DELIMITER,ir.delimiter,{}),new oe(yr.NEW_COMMAND,{}),new ce(yr.NEW_ENVIRONMENT,ir.environment,{}),e.parseOptions.handlers.add({[At.CHARACTER]:[],[At.DELIMITER]:[yr.NEW_DELIMITER],[At.MACRO]:[yr.NEW_DELIMITER,yr.NEW_COMMAND],[At.ENVIRONMENT]:[yr.NEW_ENVIRONMENT]},{},vr))}new oe("Newcommand-macros",{newcommand:Er.NewCommand,renewcommand:Er.NewCommand,newenvironment:Er.NewEnvironment,renewenvironment:Er.NewEnvironment,def:Er.MacroDef,let:Er.Let});const Sr=pe.create("newcommand",{[bt.HANDLER]:{macro:["Newcommand-macros"]},[bt.ITEMS]:{[Tr.prototype.kind]:Tr},[bt.OPTIONS]:{maxMacros:1e3,protectedMacros:["begingroupSandbox"]},[bt.CONFIG]:Cr});class Or extends Xt{}const Ir=pe.create("ams",{[bt.HANDLER]:{[At.CHARACTER]:["AMSmath-operatorLetter"],[At.DELIMITER]:["AMSsymbols-delimiter","AMSmath-delimiter"],[At.MACRO]:["AMSsymbols-mathchar0mi","AMSsymbols-mathchar0mo","AMSsymbols-delimiter","AMSsymbols-macros","AMSmath-mathchar0mo","AMSmath-macros","AMSmath-delimiter"],[At.ENVIRONMENT]:["AMSmath-environment"]},[bt.ITEMS]:{[br.prototype.kind]:br,[Ar.prototype.kind]:Ar},[bt.TAGS]:{ams:Or},[bt.OPTIONS]:{multlineWidth:"",ams:{operatornamePattern:/^[-*a-zA-Z]+/,multlineWidth:"100%",multlineIndent:"1em"}},[bt.CONFIG]:Cr}),Nr=("undefined"!=typeof window?window:global).MathJax._.components.startup,Lr=(Nr.Startup,Nr.MathJax),Fr=(Nr.CONFIG,MathJax._.components.package),Rr=(Fr.PackageError,Fr.Package),Dr=("undefined"!=typeof window?window:global).MathJax._.components.loader,Br=(Dr.PathFilters,Dr.Loader),Gr=(Dr.MathJax,Dr.CONFIG),qr=MathJax._.mathjax.mathjax,_r=Lr.config;function Hr(t,e){const r=t.parseOptions.options.require,s=t.parseOptions.packageData.get("require").required,n=e.substring(r.prefix.length);if(!s.includes(n)){s.push(n);const r=function(t,e=[]){const r=t.parseOptions.options.require.prefix,s=[];for(const n of e)if(n.substring(0,r.length)===r)try{Hr(t,n)}catch(t){if(!t.retry)throw t;s.push(t.retry)}return s.length?Promise.all(s):null}(t,Gr.dependencies[e]);r?qr.retryAfter(r.then((()=>Ur(t,e,n)))):Ur(t,e,n)}}function Ur(t,e,r){const s=be.get(r);if(s){let n=_r[e]||{};s.options&&1===Object.keys(s.options).length&&s.options[r]&&(n={[r]:n}),t.configuration.add(r,t,n);const i=t.parseOptions.packageData.get("require").configured;s.preprocessors.length&&!i.has(r)&&(i.set(r,!0),qr.retryAfter(Promise.resolve()))}}function jr(t,e){var r,s;const n=t.options.require,i=n.allow,a=("["===e.substring(0,1)?"":n.prefix)+e;if(!(Object.hasOwn(i,a)?i[a]:Object.hasOwn(i,e)?i[e]:n.defaultAllow))throw new Mt("BadRequire",'Extension "%1" is not allowed to be loaded',a);const o=Rr.packages.get(a);if(o||qr.retryAfter(Br.load(a).catch((t=>{}))),o.hasFailed)throw new Mt("RequireFail",'Extension "%1" failed to load',e);const c=null===(r=Gr[a])||void 0===r?void 0:r.rendererExtensions,l=null===(s=Lr.startup.document)||void 0===s?void 0:s.menu;c&&l&&l.addRequiredExtensions(c),Hr(t.configuration.packageData.get("require").jax,a)}const Kr={Require(t,e){const r=t.GetArgument(e);if(r.match(/[^_a-zA-Z0-9]/)||""===r)throw new Mt("BadPackageName","Argument for %1 is not a valid package name",e);jr(t,r),t.Push(t.itemFactory.create("null"))}},zr={require:{allow:K({base:!1,autoload:!1,configmacros:!1,tagformat:!1,setoptions:!1,texhtml:!1}),defaultAllow:!0,prefix:"tex"}};new oe("require",{require:Kr.Require});const Xr=pe.create("require",{[bt.HANDLER]:{[At.MACRO]:["require"]},[bt.CONFIG]:function(t,e){e.parseOptions.packageData.set("require",{jax:e,required:[...e.options.packages],configured:new Map});const r=e.parseOptions.options.require,s=r.prefix;if(s.match(/[^_a-zA-Z0-9]/))throw Error("Illegal characters used in \\require prefix");Gr.paths[s]||(Gr.paths[s]="[mathjax]/input/tex/extensions"),r.prefix="["+s+"]/"},[bt.OPTIONS]:zr});function $r(t,e,r,s){if(Rr.packages.has(t.options.require.prefix+r)){const n=t.options.autoload[r],[i,a]=2===n.length&&Array.isArray(n[0])?n:[n,[]];for(const t of i)Vr.remove(t);for(const t of a)Jr.remove(t);t.string=(s?e+" ":"\\begin{"+e.slice(1)+"}")+t.string.slice(t.i),t.i=0}jr(t,r)}const Vr=new oe("autoload-macros",{}),Jr=new oe("autoload-environments",{}),Wr=pe.create("autoload",{[bt.HANDLER]:{[At.MACRO]:["autoload-macros"],[At.ENVIRONMENT]:["autoload-environments"]},[bt.OPTIONS]:{autoload:K({action:["toggle","mathtip","texttip"],amscd:[[],["CD"]],bbox:["bbox"],boldsymbol:["boldsymbol"],braket:["bra","ket","braket","set","Bra","Ket","Braket","Set","ketbra","Ketbra"],bussproofs:[[],["prooftree"]],cancel:["cancel","bcancel","xcancel","cancelto"],color:["color","definecolor","textcolor","colorbox","fcolorbox"],enclose:["enclose"],extpfeil:["xtwoheadrightarrow","xtwoheadleftarrow","xmapsto","xlongequal","xtofrom","Newextarrow"],html:["data","href","class","style","cssId"],mhchem:["ce","pu"],newcommand:["newcommand","renewcommand","newenvironment","renewenvironment","def","let"],unicode:["unicode","U","char"],verb:["verb"]})},[bt.CONFIG]:function(t,e){const r=e.parseOptions,s=r.handlers.get(At.MACRO),n=r.handlers.get(At.ENVIRONMENT),i=r.options.autoload;r.packageData.set("autoload",{Autoload:$r});for(const t of Object.keys(i)){const e=i[t],[r,a]=2===e.length&&Array.isArray(e[0])?e:[e,[]];for(const e of r)s.lookup(e)&&"color"!==e||Vr.add(e,new Zt(e,$r,[t,!0]));for(const e of a)n.lookup(e)||Jr.add(e,new Zt(e,$r,[t,!1]))}r.packageData.get("require")||Xr.config(t,e)},[bt.INIT]:function(t){t.options.require||X(t.options,Xr.options)},[bt.PRIORITY]:10}),Yr="configmacros-map",Qr="configmacros-active-map",Zr="configmacros-env-map";function ts(t,e,r){const s=r.parseOptions.handlers.retrieve(e),n=r.parseOptions.options[t];for(const t of Object.keys(n)){const e="string"==typeof n[t]?[n[t]]:n[t],r=Array.isArray(e[2])?new Zt(t,Er.MacroWithTemplate,e.slice(0,2).concat(e[2])):new Zt(t,Er.Macro,e);s.add(t,r)}}const es=pe.create("configmacros",{[bt.INIT]:function(t){new ae(Qr,{}),new oe(Yr,{}),new ce(Zr,ir.environment,{}),t.append(pe.local({handler:{[At.CHARACTER]:[Qr],[At.MACRO]:[Yr],[At.ENVIRONMENT]:[Zr]},priority:3}))},[bt.CONFIG]:function(t,e){!function(t){ts("active",Qr,t)}(e),function(t){ts("macros",Yr,t)}(e),function(t){const e=t.parseOptions.handlers.retrieve(Zr),r=t.parseOptions.options.environments;for(const t of Object.keys(r))e.add(t,new Zt(t,Er.BeginEnv,[!0].concat(r[t])))}(e)},[bt.ITEMS]:{[Tr.prototype.kind]:Tr},[bt.OPTIONS]:{active:K({}),macros:K({}),environments:K({})}});const rs=pe.create("noundefined",{[bt.FALLBACK]:{[At.MACRO]:function(t,e){const r=t.create("text","\\"+e),s=t.options.noundefined,n={};for(const t of["color","background","size"])s[t]&&(n["math"+t]=s[t]);t.Push(t.create("node","mtext",[],n,r))}},[bt.OPTIONS]:{noundefined:{color:"red",background:"",size:""}},[bt.PRIORITY]:3});class ss extends Et{get texParser(){return this.configuration.packageData.get("textmacros").texParser}get tags(){return this.texParser.tags}constructor(t,e,r,s){super(t,e,r),this.level=s}mml(){return this.copyLists(),this.configuration.popParser(),null!=this.level?this.create("node","mstyle",this.nodes,{displaystyle:!1,scriptlevel:this.level}):1===this.nodes.length?this.nodes[0]:this.create("node","mrow",this.nodes)}copyLists(){const t=this.texParser.configuration;for(const[e,r]of Object.entries(this.configuration.nodeLists))for(const s of r)t.addNode(e,s);this.configuration.nodeLists={}}Parse(){this.text="",this.nodes=[],this.envStack=[],super.Parse()}saveText(){if(this.text){const t=this.stack.env.mathvariant,e=qt.internalText(this,this.text,t?{mathvariant:t}:{});this.text="",this.Push(e)}}Push(t){if(this.text&&this.saveText(),t instanceof we)return super.Push(t);t instanceof Re?this.stack.env.mathcolor=this.stack.env.color:t instanceof at&&(this.addAttributes(t),this.nodes.push(t))}PushMath(t){const e=this.stack.env;for(const r of["mathsize","mathcolor"])e[r]&&!t.attributes.hasExplicit(r)&&(t.isToken||t.isKind("mstyle")||(t=this.create("node","mstyle",[t])),ht.setAttribute(t,r,e[r]));t.isInferred&&(t=this.create("node","mrow",t.childNodes)),t.isKind("TeXAtom")||(t=this.create("node","TeXAtom",[t])),this.nodes.push(t)}addAttributes(t){const e=this.stack.env;if(t.isToken)for(const r of["mathsize","mathcolor","mathvariant"])e[r]&&!t.attributes.hasExplicit(r)&&ht.setAttribute(t,r,e[r])}ParseTextArg(t,e){const r=this.GetArgument(t);return e=Object.assign(Object.assign({},this.stack.env),e),new ss(r,e,this.configuration).mml()}ParseArg(t){return new ss(this.GetArgument(t),this.stack.env,this.configuration).mml()}Error(t,e,...r){throw new Mt(t,e,...r)}}const ns=MathJax._.util.Retries,is=(ns.handleRetriesFor,ns.retryAfter),as={Comment(t,e){for(;t.i<t.string.length&&"\n"!==t.string.charAt(t.i);)t.i++;t.i++},Math(t,e){t.saveText();const r=t.i;let s,n,i=0;for(;n=t.GetNext();)switch(s=t.i++,n){case"\\":")"===t.GetCS()&&(n="\\(");case"$":if(0===i&&e===n){const e=t.texParser.configuration,n=new Et(t.string.substring(r,s),t.stack.env,e).mml();return void t.PushMath(n)}break;case"{":i++;break;case"}":0===i&&t.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace"),i--}t.Error("MathNotTerminated","Math mode is not properly terminated")},MathModeOnly(t,e){t.Error("MathModeOnly","'%1' allowed only in math mode",e)},Misplaced(t,e){t.Error("Misplaced","Misplaced '%1'",e)},OpenBrace(t,e){const r=t.stack.env;t.envStack.push(r),t.stack.env=Object.assign({},r)},CloseBrace(t,e){t.envStack.length?(t.saveText(),t.stack.env=t.envStack.pop()):t.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace")},OpenQuote(t,e){t.string.charAt(t.i)===e?(t.text+="\u201c",t.i++):t.text+="\u2018"},CloseQuote(t,e){t.string.charAt(t.i)===e?(t.text+="\u201d",t.i++):t.text+="\u2019"},Tilde(t,e){t.text+="\xa0"},Space(t,e){t.text+=" ",t.GetNext()},SelfQuote(t,e){t.text+=e.substring(1)},Insert(t,e,r){t.text+=r},Accent(t,e,r){const s=t.ParseArg(e),n=t.create("token","mo",{},r);t.addAttributes(n),t.Push(t.create("node","mover",[s,n]))},Emph(t,e){const r="-tex-mathit"===t.stack.env.mathvariant?"normal":"-tex-mathit";t.Push(t.ParseTextArg(e,{mathvariant:r}))},TextFont(t,e,r){t.saveText(),t.Push(t.ParseTextArg(e,{mathvariant:r}))},SetFont(t,e,r){t.saveText(),t.stack.env.mathvariant=r},SetSize(t,e,r){t.saveText(),t.stack.env.mathsize=r},CheckAutoload(t,e){const r=t.configuration.packageData.get("autoload"),s=t.texParser;e=e.slice(1);const n=s.lookup(At.MACRO,e);if(!n||r&&n._func===r.Autoload){if(s.parse(At.MACRO,[s,e]),!n)return;is(Promise.resolve())}s.parse(At.MACRO,[t,e])},Macro:rr.Macro,Spacer:rr.Spacer,Hskip:rr.Hskip,rule:rr.rule,Rule:rr.Rule,HandleRef:rr.HandleRef,UnderOver:rr.UnderOver,Lap:rr.Lap,Phantom:rr.Phantom,Smash:rr.Smash,MmlToken:rr.MmlToken},os=Pt.Variant;new ae("text-special",{$:as.Math,"%":as.Comment,"^":as.MathModeOnly,_:as.MathModeOnly,"&":as.Misplaced,"#":as.Misplaced,"~":as.Tilde," ":as.Space,"\t":as.Space,"\r":as.Space,"\n":as.Space,"\xa0":as.Tilde,"{":as.OpenBrace,"}":as.CloseBrace,"`":as.OpenQuote,"'":as.CloseQuote}),new oe("text-macros",{"(":as.Math,$:as.SelfQuote,_:as.SelfQuote,"%":as.SelfQuote,"{":as.SelfQuote,"}":as.SelfQuote," ":as.SelfQuote,"&":as.SelfQuote,"#":as.SelfQuote,"\\":[as.Macro,"$\\\\$"],"'":[as.Accent,"\xb4"],"\u2019":[as.Accent,"\xb4"],"`":[as.Accent,"`"],"\u2018":[as.Accent,"`"],"^":[as.Accent,"^"],'"':[as.Accent,"\xa8"],"~":[as.Accent,"~"],"=":[as.Accent,"\xaf"],".":[as.Accent,"\u02d9"],u:[as.Accent,"\u02d8"],v:[as.Accent,"\u02c7"],emph:as.Emph,rm:[as.SetFont,os.NORMAL],mit:[as.SetFont,os.ITALIC],oldstyle:[as.SetFont,os.OLDSTYLE],cal:[as.SetFont,os.CALLIGRAPHIC],it:[as.SetFont,"-tex-mathit"],bf:[as.SetFont,os.BOLD],sf:[as.SetFont,os.SANSSERIF],tt:[as.SetFont,os.MONOSPACE],frak:[as.TextFont,os.FRAKTUR],Bbb:[as.TextFont,os.DOUBLESTRUCK],tiny:[as.SetSize,.5],Tiny:[as.SetSize,.6],scriptsize:[as.SetSize,.7],small:[as.SetSize,.85],normalsize:[as.SetSize,1],large:[as.SetSize,1.2],Large:[as.SetSize,1.44],LARGE:[as.SetSize,1.73],huge:[as.SetSize,2.07],Huge:[as.SetSize,2.49],textnormal:[as.Macro,"{\\rm #1}",1],textup:[as.Macro,"{\\rm #1}",1],textrm:[as.Macro,"{\\rm #1}",1],textit:[as.Macro,"{\\it #1}",1],textbf:[as.Macro,"{\\bf #1}",1],textsf:[as.Macro,"{\\sf #1}",1],texttt:[as.Macro,"{\\tt #1}",1],dagger:[as.Insert,"\u2020"],ddagger:[as.Insert,"\u2021"],S:[as.Insert,"\xa7"],AA:[as.Insert,"\u212b"],ldots:[as.Insert,"\u2026"],vdots:[as.Insert,"\u22ee"],",":[as.Spacer,Je.thinmathspace],":":[as.Spacer,Je.mediummathspace],">":[as.Spacer,Je.mediummathspace],";":[as.Spacer,Je.thickmathspace],"!":[as.Spacer,Je.negativethinmathspace],enspace:[as.Spacer,.5],quad:[as.Spacer,1],qquad:[as.Spacer,2],thinspace:[as.Spacer,Je.thinmathspace],negthinspace:[as.Spacer,Je.negativethinmathspace],hskip:as.Hskip,hspace:as.Hskip,kern:as.Hskip,mskip:as.Hskip,mspace:as.Hskip,mkern:as.Hskip,rule:as.rule,Rule:[as.Rule],Space:[as.Rule,"blank"],color:as.CheckAutoload,textcolor:as.CheckAutoload,colorbox:as.CheckAutoload,fcolorbox:as.CheckAutoload,href:as.CheckAutoload,style:as.CheckAutoload,class:as.CheckAutoload,data:as.CheckAutoload,cssId:as.CheckAutoload,unicode:as.CheckAutoload,U:as.CheckAutoload,char:as.CheckAutoload,ref:[as.HandleRef,!1],eqref:[as.HandleRef,!0],underline:[as.UnderOver,"2015"],llap:as.Lap,rlap:as.Lap,phantom:as.Phantom,vphantom:[as.Phantom,1,0],hphantom:[as.Phantom,0,1],smash:as.Smash,mmlToken:as.MmlToken});const cs=pe.create("text-base",{[bt.PARSER]:"text",[bt.PRIORITY]:1,[bt.HANDLER]:{[At.CHARACTER]:["command","text-special"],[At.MACRO]:["text-macros"]},[bt.FALLBACK]:{[At.CHARACTER]:(t,e)=>{t.text+=e},[At.MACRO]:(t,e)=>{const r=t.texParser,s=r.lookup(At.MACRO,e);s&&s._func!==as.Macro&&t.Error("MathMacro","%1 is only supported in math mode","\\"+e),r.parse(At.MACRO,[t,e])}},[bt.ITEMS]:{[ke.prototype.kind]:ke,[we.prototype.kind]:we,[Ge.prototype.kind]:Ge,[Re.prototype.kind]:Re}});function ls(t,e,r,s){const n=t.configuration.packageData.get("textmacros");return t instanceof ss||(n.texParser=t),n.parseOptions.clear(),[new ss(e,s?{mathvariant:s}:{},n.parseOptions,r).mml()]}const hs=pe.create("textmacros",{[bt.PRIORITY]:1,[bt.CONFIG]:(t,e)=>{const r=new Ae(e.parseOptions.options.textmacros.packages,["tex","text"]);r.init();const s=new jt(r,[]);s.options=e.parseOptions.options,r.config(e),Yt.addTags(r.tags),s.tags=Yt.getDefault(),s.tags.configuration=s,s.packageData=e.parseOptions.packageData,s.packageData.set("textmacros",{textConf:r,parseOptions:s,jax:e,texParser:null}),s.options.internalMath=ls},[bt.PREPROCESSORS]:[t=>{const e=t.data.packageData.get("textmacros");e.parseOptions.nodeFactory.setMmlFactory(e.jax.mmlFactory)}],[bt.OPTIONS]:{textmacros:{packages:["text-base"]}}});MathJax.loader&&MathJax.loader.checkVersion("input/tex","4.0.0","input"),H({_:{input:{tex_ts:T,tex:{ColumnParser:g,Configuration:v,FilterUtil:s,FindTeX:e,HandlerTypes:n,MapHandler:y,NodeFactory:u,NodeUtil:r,ParseMethods:M,ParseOptions:p,ParseUtil:d,Stack:a,StackItem:c,StackItemFactory:m,Tags:f,TexConstants:l,TexError:o,TexParser:h,Token:b,TokenMap:A,UnitUtil:i,ams:{AmsConfiguration:N,AmsItems:P,AmsMethods:C},autoload:{AutoloadConfiguration:F},base:{BaseConfiguration:x,BaseItems:k,BaseMethods:w},configmacros:{ConfigMacrosConfiguration:R},newcommand:{NewcommandConfiguration:I,NewcommandItems:S,NewcommandMethods:O,NewcommandUtil:E},noundefined:{NoUndefinedConfiguration:D},require:{RequireConfiguration:L},textmacros:{TextMacrosConfiguration:q,TextMacrosMethods:G,TextParser:B}}}}}),Br.preLoaded("input/tex-base","[tex]/ams","[tex]/newcommand","[tex]/textmacros","[tex]/noundefined","[tex]/require","[tex]/autoload","[tex]/configmacros"),function(t=[],e=!0){if(MathJax.startup){e&&(MathJax.startup.registerConstructor("tex",MathJax._.input.tex_ts.TeX),MathJax.startup.useInput("tex")),MathJax.config.tex||(MathJax.config.tex={});let r=MathJax.config.tex.packages;MathJax.config.tex.packages=t,r&&(Array.isArray(r)&&(r={"[+]":r.filter((e=>!t.includes(e)))}),z(MathJax.config.tex,{packages:r}))}}(["base","ams","newcommand","textmacros","noundefined","require","autoload","configmacros"])})();