(()=>{"use strict";var e={d:(t,s)=>{for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{CasesBeginItem:()=>C,CasesConfiguration:()=>E,CasesMethods:()=>T,CasesTags:()=>P});const s=("undefined"!=typeof window?window:e.g).MathJax._.components.global,a=(s.GLOBAL,s.isObject,s.combineConfig,s.combineDefaults,s.combineWithMathJax),n=(s.MathJax,MathJax._.input.tex.HandlerTypes),r=n.ConfigurationType,o=n.HandlerType,i=MathJax._.input.tex.Configuration,u=i.Configuration,c=(i.ConfigurationHandler,i.ParserConfiguration,MathJax._.input.tex.TokenMap),m=(c.parseResult,c.AbstractTokenMap,c.RegExpMap,c.AbstractParseMap,c.CharacterMap,c.DelimiterMap,c.MacroMap),l=(c.CommandMap,c.EnvironmentMap),p=MathJax._.input.tex.ParseUtil,h=(p.KeyValueDef,p.KeyValueTypes,p.ParseUtil),g=MathJax._.input.tex.base.BaseMethods,f=(g.splitAlignArray,g.default),d=MathJax._.input.tex.TexError.default,y=MathJax._.input.tex.base.BaseItems,b=(y.StartItem,y.StopItem,y.OpenItem,y.CloseItem,y.NullItem,y.PrimeItem,y.SubsupItem,y.OverItem,y.LeftItem,y.Middle,y.RightItem,y.BreakItem,y.BeginItem),x=(y.EndItem,y.StyleItem,y.PositionItem,y.CellItem,y.MmlItem,y.FnItem,y.NotItem,y.NonscriptItem,y.DotsItem,y.ArrayItem,y.EqnArrayItem,y.MstyleItem,y.EquationItem,MathJax._.input.tex.ams.AmsConfiguration),M=x.AmsTags,I=(x.AmsConfiguration,MathJax._.input.tex.empheq.EmpheqUtil.EmpheqUtil);class C extends b{get kind(){return"cases-begin"}checkItem(e){return e.isKind("end")&&e.getName()===this.getName()&&this.getProperty("end")?(this.setProperty("end",!1),[[],!0]):super.checkItem(e)}}class P extends M{constructor(){super(...arguments),this.subcounter=0}start(e,t,s){this.subcounter=0,super.start(e,t,s)}autoTag(){null==this.currentTag.tag&&("subnumcases"===this.currentTag.env?(0===this.subcounter&&this.counter++,this.subcounter++,this.tag(this.formatNumber(this.counter,this.subcounter),!1)):("numcases-left"!==this.currentTag.env&&this.counter++,this.tag(this.formatNumber(this.counter),!1)))}formatNumber(e,t=null){return e.toString()+(null===t?"":String.fromCharCode(96+t))}}const T={NumCases(e,t){if(e.stack.env.closing===t.getName()){delete e.stack.env.closing,e.Push(e.itemFactory.create("end").setProperty("name",t.getName()));const s=e.stack.Top(),a=s.Last,n=h.copyNode(a,e),r=s.getProperty("left");return I.left(a,n,r+"\\mmlToken{mo}{\\U{7B}}\\,",e,"numcases-left"),e.Push(e.itemFactory.create("end").setProperty("name",t.getName())),null}{const s=e.GetArgument("\\begin{"+t.getName()+"}");t.setProperty("left",s);const a=f.EqnArray(e,t,!0,!0,"ll","tt");return a.arraydef.displaystyle=!1,a.arraydef.rowspacing=".2em",a.setProperty("numCases",!0),e.Push(t),a}},Entry(e,t){if(!e.stack.Top().getProperty("numCases"))return f.Entry(e,t);e.Push(e.itemFactory.create("cell").setProperties({isEntry:!0,name:t}));const s=e.string;let a=0,n=e.i;const r=s.length;for(;n<r;){const e=s.charAt(n);if("{"===e)a++,n++;else if("}"===e){if(0===a)break;a--,n++}else{if("&"===e&&0===a)throw new d("ExtraCasesAlignTab","Extra alignment tab in text for numcase environment");if("\\"===e&&0===a){const e=(s.slice(n+1).match(/^[a-z]+|./i)||[])[0];if("\\"===e||"cr"===e||"end"===e||"label"===e||void 0===e)break;n+=e.length}else n++}}const o=s.substring(e.i,n).replace(/^\s*/,"");return e.PushAll(h.internalMath(e,o,0)),e.i=n,null},environment(e,t,s,a){const n=e.itemFactory.create("cases-begin").setProperties({name:t,end:!0});e.Push(s(e,n,...a))}};new l("cases-env",T.environment,{numcases:[T.NumCases,"cases"],subnumcases:[T.NumCases,"cases"]}),new m("cases-macros",{"&":T.Entry});const E=u.create("cases",{[r.HANDLER]:{[o.ENVIRONMENT]:["cases-env"],[o.CHARACTER]:["cases-macros"]},[r.ITEMS]:{[C.prototype.kind]:C},[r.TAGS]:{cases:P}});MathJax.loader&&MathJax.loader.checkVersion("[tex]/cases","4.1.2","tex-extension"),a({_:{input:{tex:{cases:{CasesConfiguration:t}}}}})})();