(()=>{"use strict";var t={d:(e,a)=>{for(var s in a)t.o(a,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:a[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,{TextParser:()=>P});var a={};t.r(a),t.d(a,{TextMacrosMethods:()=>L});var s={};t.r(s),t.d(s,{TextBaseConfiguration:()=>z,TextMacrosConfiguration:()=>Q});const o=("undefined"!=typeof window?window:global).MathJax._.components.global,r=(o.GLOBAL,o.isObject,o.combineConfig,o.combineDefaults,o.combineWithMathJax),n=(o.MathJax,MathJax._.input.tex.HandlerTypes),i=n.ConfigurationType,c=n.HandlerType,l=MathJax._.input.tex.Configuration,h=l.Configuration,p=(l.ConfigurationHandler,l.ParserConfiguration),m=MathJax._.input.tex.ParseOptions.default,u=MathJax._.input.tex.Tags,d=(u.Label,u.TagInfo,u.AbstractTags,u.NoTags,u.AllTags,u.TagsFactory),x=MathJax._.input.tex.base.BaseItems,M=x.StartItem,g=x.StopItem,S=(x.OpenItem,x.CloseItem,x.NullItem,x.PrimeItem,x.SubsupItem,x.OverItem,x.LeftItem,x.Middle,x.RightItem,x.BreakItem,x.BeginItem,x.EndItem,x.StyleItem),A=(x.PositionItem,x.CellItem,x.MmlItem),f=(x.FnItem,x.NotItem,x.NonscriptItem,x.DotsItem,x.ArrayItem,x.EqnArrayItem,x.MstyleItem,x.EquationItem,MathJax._.input.tex.TexParser.default),k=MathJax._.input.tex.TexError.default,T=MathJax._.input.tex.ParseUtil,C=(T.KeyValueDef,T.KeyValueTypes,T.ParseUtil),b=MathJax._.core.MmlTree.MmlNode,v=(b.TEXCLASS,b.TEXCLASSNAMES,b.MATHVARIANTS,b.indentAttributes,b.AbstractMmlNode),O=(b.AbstractMmlTokenNode,b.AbstractMmlLayoutNode,b.AbstractMmlBaseNode,b.AbstractMmlEmptyNode,b.TextNode,b.XMLNode,MathJax._.input.tex.NodeUtil.default);class P extends f{get texParser(){return this.configuration.packageData.get("textmacros").texParser}get tags(){return this.texParser.tags}constructor(t,e,a,s){super(t,e,a),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,a]of Object.entries(this.configuration.nodeLists))for(const s of a)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=C.internalText(this,this.text,t?{mathvariant:t}:{});this.text="",this.Push(e)}}Push(t){if(this.text&&this.saveText(),t instanceof g)return super.Push(t);t instanceof S?this.stack.env.mathcolor=this.stack.env.color:t instanceof v&&(this.addAttributes(t),this.nodes.push(t))}PushMath(t){const e=this.stack.env;for(const a of["mathsize","mathcolor"])e[a]&&!t.attributes.hasExplicit(a)&&(t.isToken||t.isKind("mstyle")||(t=this.create("node","mstyle",[t])),O.setAttribute(t,a,e[a]));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 a of["mathsize","mathcolor","mathvariant"])e[a]&&!t.attributes.hasExplicit(a)&&O.setAttribute(t,a,e[a])}ParseTextArg(t,e){const a=this.GetArgument(t);return e=Object.assign(Object.assign({},this.stack.env),e),new P(a,e,this.configuration).mml()}ParseArg(t){return new P(this.GetArgument(t),this.stack.env,this.configuration).mml()}Error(t,e,...a){throw new k(t,e,...a)}}const I=MathJax._.util.Retries,y=(I.handleRetriesFor,I.retryAfter),R=MathJax._.input.tex.base.BaseMethods,E=(R.splitAlignArray,R.default),L={Comment(t,e){for(;t.i":[L.Spacer,w.mediummathspace],";":[L.Spacer,w.thickmathspace],"!":[L.Spacer,w.negativethinmathspace],enspace:[L.Spacer,.5],quad:[L.Spacer,1],qquad:[L.Spacer,2],thinspace:[L.Spacer,w.thinmathspace],negthinspace:[L.Spacer,w.negativethinmathspace],hskip:L.Hskip,hspace:L.Hskip,kern:L.Hskip,mskip:L.Hskip,mspace:L.Hskip,mkern:L.Hskip,rule:L.rule,Rule:[L.Rule],Space:[L.Rule,"blank"],color:L.CheckAutoload,textcolor:L.CheckAutoload,colorbox:L.CheckAutoload,fcolorbox:L.CheckAutoload,href:L.CheckAutoload,style:L.CheckAutoload,class:L.CheckAutoload,data:L.CheckAutoload,cssId:L.CheckAutoload,unicode:L.CheckAutoload,U:L.CheckAutoload,char:L.CheckAutoload,ref:[L.HandleRef,!1],eqref:[L.HandleRef,!0],underline:[L.UnderOver,"2015"],llap:L.Lap,rlap:L.Lap,phantom:L.Phantom,vphantom:[L.Phantom,1,0],hphantom:[L.Phantom,0,1],smash:L.Smash,mmlToken:L.MmlToken});const z=h.create("text-base",{[i.PARSER]:"text",[i.PRIORITY]:1,[i.HANDLER]:{[c.CHARACTER]:["command","text-special"],[c.MACRO]:["text-macros"]},[i.FALLBACK]:{[c.CHARACTER]:(t,e)=>{t.text+=e},[c.MACRO]:(t,e)=>{const a=t.texParser,s=a.lookup(c.MACRO,e);s&&s._func!==L.Macro&&t.Error("MathMacro","%1 is only supported in math mode","\\"+e),a.parse(c.MACRO,[t,e])}},[i.ITEMS]:{[M.prototype.kind]:M,[g.prototype.kind]:g,[A.prototype.kind]:A,[S.prototype.kind]:S}});function B(t,e,a,s){const o=t.configuration.packageData.get("textmacros");return t instanceof P||(o.texParser=t),o.parseOptions.clear(),[new P(e,s?{mathvariant:s}:{},o.parseOptions,a).mml()]}const Q=h.create("textmacros",{[i.PRIORITY]:1,[i.CONFIG]:(t,e)=>{const a=new p(e.parseOptions.options.textmacros.packages,["tex","text"]);a.init();const s=new m(a,[]);s.options=e.parseOptions.options,a.config(e),d.addTags(a.tags),s.tags=d.getDefault(),s.tags.configuration=s,s.packageData=e.parseOptions.packageData,s.packageData.set("textmacros",{textConf:a,parseOptions:s,jax:e,texParser:null}),s.options.internalMath=B},[i.PREPROCESSORS]:[t=>{const e=t.data.packageData.get("textmacros");e.parseOptions.nodeFactory.setMmlFactory(e.jax.mmlFactory)}],[i.OPTIONS]:{textmacros:{packages:["text-base"]}}});MathJax.loader&&MathJax.loader.checkVersion("[tex]/textmacros","4.0.0","tex-extension"),r({_:{input:{tex:{textmacros:{TextMacrosConfiguration:s,TextMacrosMethods:a,TextParser:e}}}}})})();