(()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},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,{DIRECTION:()=>Ft,H:()=>_t,V:()=>Gt});var s={};t.r(s),t.d(s,{DIRECTION:()=>Ft,FontData:()=>Qt,NOSTRETCH:()=>zt,mergeOptions:()=>Jt});var i={};t.r(i),t.d(i,{LineBBox:()=>Kt});var n={};t.r(n),t.d(n,{LinebreakVisitor:()=>te,Linebreaks:()=>Zt,NOBREAK:()=>Yt});var o={};t.r(o),t.d(o,{CommonOutputJax:()=>ue,FONTPATH:()=>ce});var r={};t.r(r),t.d(r,{ARROWDX:()=>me,ARROWX:()=>pe,ARROWY:()=>ge,CommonArrow:()=>je,CommonBorder:()=>De,CommonBorder2:()=>Oe,CommonDiagonalArrow:()=>Te,CommonDiagonalStrike:()=>We,PADDING:()=>xe,SOLID:()=>be,THICKNESS:()=>fe,arrowBBox:()=>Le,arrowBBoxHD:()=>Se,arrowBBoxW:()=>Ce,arrowDef:()=>Me,arrowHead:()=>we,diagonalArrowDef:()=>Ne,fullBBox:()=>ye,fullBorder:()=>ke,fullPadding:()=>ve,sideIndex:()=>Ae,sideNames:()=>Be});var a={};t.r(a),t.d(a,{CommonWrapper:()=>ze,SPACE:()=>He});var h={};t.r(h),t.d(h,{CommonWrapperFactory:()=>Qe});var d={};t.r(d),t.d(d,{CommonTeXAtomMixin:()=>Xe});var l={};t.r(l),t.d(l,{CommonTextNodeMixin:()=>Ue});var c={};t.r(c),t.d(c,{CommonXmlNodeMixin:()=>Ke});var u={};t.r(u),t.d(u,{CommonMactionMixin:()=>$e,TooltipData:()=>qe});var p={};t.r(p),t.d(p,{CommonMathMixin:()=>Ye});var m={};t.r(m),t.d(m,{CommonMencloseMixin:()=>Ze});var g={};t.r(g),t.d(g,{CommonMfencedMixin:()=>ts});var f={};t.r(f),t.d(f,{CommonMfracMixin:()=>es});var x={};t.r(x),t.d(x,{CommonMglyphMixin:()=>ss});var b={};t.r(b),t.d(b,{CommonMiMixin:()=>is});var A={};t.r(A),t.d(A,{CommonMmultiscriptsMixin:()=>rs,NextScript:()=>ns,ScriptNames:()=>os});var B={};t.r(B),t.d(B,{CommonMnMixin:()=>as});var y={};t.r(y),t.d(y,{CommonMoMixin:()=>hs});var v={};t.r(v),t.d(v,{CommonMpaddedMixin:()=>ds});var k={};t.r(k),t.d(k,{CommonMrootMixin:()=>ls});var w={};t.r(w),t.d(w,{CommonInferredMrowMixin:()=>us,CommonMrowMixin:()=>cs});var S={};t.r(S),t.d(S,{CommonMsMixin:()=>ps});var C={};t.r(C),t.d(C,{CommonMspaceMixin:()=>ms});var M={};t.r(M),t.d(M,{CommonMsqrtMixin:()=>gs});var N={};t.r(N),t.d(N,{CommonMsubMixin:()=>fs,CommonMsubsupMixin:()=>bs,CommonMsupMixin:()=>xs});var L={};t.r(L),t.d(L,{BREAK_BELOW:()=>vs,CommonMtableMixin:()=>ks});var D={};t.r(D),t.d(D,{CommonMtdMixin:()=>ws});var O={};t.r(O),t.d(O,{CommonMtextMixin:()=>Ss});var W={};t.r(W),t.d(W,{CommonMlabeledtrMixin:()=>Ms,CommonMtrMixin:()=>Cs});var T={};t.r(T),t.d(T,{CommonMoverMixin:()=>Ls,CommonMunderMixin:()=>Ns,CommonMunderoverMixin:()=>Ds});var j={};t.r(j),t.d(j,{CommonScriptbaseMixin:()=>Os});var E={};t.r(E),t.d(E,{CommonSemanticsMixin:()=>Ws});var V={};t.r(V),t.d(V,{SvgWrapper:()=>Ts});var P={};t.r(P),t.d(P,{ZeroFontDataUrl:()=>Es});var I={};t.r(I),t.d(I,{SvgMath:()=>Vs});var R={};t.r(R),t.d(R,{SvgInferredMrow:()=>Gs,SvgMrow:()=>Fs});var F={};t.r(F),t.d(F,{SvgMi:()=>Hs});var G={};t.r(G),t.d(G,{AddPaths:()=>Qs,DIRECTION:()=>Ft,FontData:()=>Qt,NOSTRETCH:()=>zt,SvgFontData:()=>Js,mergeOptions:()=>Jt});var _={};t.r(_),t.d(_,{SvgMo:()=>Us});var H={};t.r(H),t.d(H,{SvgMn:()=>qs});var z={};t.r(z),t.d(z,{SvgMs:()=>Ys});var J={};t.r(J),t.d(J,{SvgMtext:()=>ti});var Q={};t.r(Q),t.d(Q,{SvgMerror:()=>si});var X={};t.r(X),t.d(X,{SvgMspace:()=>oi});var U={};t.r(U),t.d(U,{SvgMpadded:()=>ai});var K={};t.r(K),t.d(K,{SvgMphantom:()=>di});var q={};t.r(q),t.d(q,{SvgMfrac:()=>ci});var $={};t.r($),t.d($,{SvgMsqrt:()=>pi});var Y={};t.r(Y),t.d(Y,{SvgMroot:()=>gi});var Z={};t.r(Z),t.d(Z,{SvgMfenced:()=>xi});var tt={};t.r(tt),t.d(tt,{SvgScriptbase:()=>bi});var et={};t.r(et),t.d(et,{SvgMsub:()=>ki,SvgMsubsup:()=>Si,SvgMsup:()=>wi});var st={};t.r(st),t.d(st,{SvgMover:()=>Oi,SvgMunder:()=>Di,SvgMunderover:()=>Wi});var it={};t.r(it),t.d(it,{AlignX:()=>Ei,SvgMmultiscripts:()=>Vi});var nt={};t.r(nt),t.d(nt,{SvgMtable:()=>Ii});var ot={};t.r(ot),t.d(ot,{SvgMlabeledtr:()=>Hi,SvgMtr:()=>_i});var rt={};t.r(rt),t.d(rt,{SvgMtd:()=>Ji});var at={};t.r(at),t.d(at,{SvgMaction:()=>Xi});var ht={};t.r(ht),t.d(ht,{ARROWDX:()=>me,ARROWX:()=>pe,ARROWY:()=>ge,Arrow:()=>nn,Border:()=>Zi,Border2:()=>tn,CommonArrow:()=>je,CommonBorder:()=>De,CommonBorder2:()=>Oe,CommonDiagonalArrow:()=>Te,CommonDiagonalStrike:()=>We,DiagonalArrow:()=>sn,DiagonalStrike:()=>en,PADDING:()=>xe,RenderLine:()=>Yi,SOLID:()=>be,THICKNESS:()=>fe,arrowBBox:()=>Le,arrowBBoxHD:()=>Se,arrowBBoxW:()=>Ce,arrowDef:()=>Me,arrowHead:()=>we,computeLineData:()=>Ki,diagonalArrowDef:()=>Ne,fullBBox:()=>ye,fullBorder:()=>ke,fullPadding:()=>ve,lineData:()=>qi,lineOffset:()=>$i,sideIndex:()=>Ae,sideNames:()=>Be});var dt={};t.r(dt),t.d(dt,{SvgMenclose:()=>on});var lt={};t.r(lt),t.d(lt,{SvgAnnotation:()=>cn,SvgAnnotationXML:()=>un,SvgSemantics:()=>ln,SvgXmlNode:()=>pn});var ct={};t.r(ct),t.d(ct,{SvgMglyph:()=>gn});var ut={};t.r(ut),t.d(ut,{SvgTeXAtom:()=>xn});var pt={};t.r(pt),t.d(pt,{SvgTextNode:()=>bn});var mt={};t.r(mt),t.d(mt,{SvgHtmlNode:()=>Bn});var gt={};t.r(gt),t.d(gt,{SvgWrappers:()=>yn});var ft={};t.r(ft),t.d(ft,{SvgWrapperFactory:()=>vn});var xt={};t.r(xt),t.d(xt,{FontCache:()=>kn});var bt={};t.r(bt),t.d(bt,{DefaultFont:()=>Sn,fontName:()=>wn});var At={};t.r(At),t.d(At,{SVG:()=>Nn,SVGNS:()=>Cn,XLINKNS:()=>Mn});const Bt=("undefined"!=typeof window?window:global).MathJax._.components.global,yt=(Bt.GLOBAL,Bt.isObject,Bt.combineConfig,Bt.combineDefaults),vt=Bt.combineWithMathJax,kt=(Bt.MathJax,MathJax._.core.OutputJax.AbstractOutputJax),wt=MathJax._.core.MathItem,St=(wt.protoItem,wt.AbstractMathItem,wt.STATE),Ct=(wt.newState,MathJax._.core.MmlTree.MmlNode),Mt=Ct.TEXCLASS,Nt=Ct.TEXCLASSNAMES,Lt=(Ct.MATHVARIANTS,Ct.indentAttributes,Ct.AbstractMmlNode,Ct.AbstractMmlTokenNode,Ct.AbstractMmlLayoutNode,Ct.AbstractMmlBaseNode,Ct.AbstractMmlEmptyNode,Ct.TextNode),Dt=Ct.XMLNode,Ot=MathJax._.mathjax.mathjax,Wt=MathJax._.util.Options,Tt=(Wt.isObject,Wt.APPEND,Wt.REMOVE,Wt.OPTIONS,Wt.Expandable,Wt.expandable,Wt.makeArray,Wt.keys,Wt.copy,Wt.insert,Wt.defaultOptions),jt=Wt.userOptions,Et=(Wt.selectOptions,Wt.selectOptionsFromKeys,Wt.separateOptions),Vt=Wt.lookup,Pt=MathJax._.util.AsyncLoad.asyncLoad,It=MathJax._.util.Retries,Rt=(It.handleRetriesFor,It.retryAfter),Ft={None:"",Vertical:"v",Horizontal:"h"},Gt=Ft.Vertical,_t=Ft.Horizontal;var Ht=function(t,e,s,i){return new(s||(s=Promise))((function(n,o){function r(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,a)}h((i=i.apply(t,e||[])).next())}))};const zt={dir:Ft.None};function Jt(t,e,s){return s?Tt(t,{[e]:s})[e]:t[e]}class Qt{get CLASS(){return this.constructor}static charOptions(t,e){const s=t[e];if(!Array.isArray(s))throw Error(`Character data hasn't been loaded for 0x${e.toString(16).toUpperCase()}`);return 3===s.length&&(s[3]={}),s[3]}static defineDynamicFiles(t,e=""){const s={};return(t||[]).forEach((([t,i,n])=>{s[t]={extension:e,file:t,variants:i,delimiters:n||[],promise:null,failed:!1,setup:e=>{s[t].failed=!0}}})),s}static dynamicSetup(t,e,s,i={},n=null){const o=t?this.dynamicExtensions.get(t):null;(t?o.files:this.dynamicFiles)[e].setup=e=>{Object.keys(s).forEach((t=>e.defineChars(t,s[t]))),e.defineDelimiters(i),t&&this.adjustDelimiters(e.delimiters,Object.keys(i),o.sizeN,o.stretchN),n&&e.addDynamicFontCss(n)}}static adjustDelimiters(t,e,s,i){e.forEach((e=>{const n=t[parseInt(e)];"dir"in n&&(n.variants&&(n.variants=this.adjustArrayIndices(n.variants,s)),n.stretchv&&(n.stretchv=this.adjustArrayIndices(n.stretchv,i)))}))}static adjustArrayIndices(t,e){return t.map((t=>t<0?e-1-t:t))}static addExtension(t,e=""){const s={name:t.name,prefix:e||`[${t.name}-extension]/${this.JAX.toLowerCase()}/dynamic`,files:this.defineDynamicFiles(t.ranges,t.name),sizeN:this.defaultSizeVariants.length,stretchN:this.defaultStretchVariants.length};this.dynamicExtensions.set(t.name,s);for(const[e,s]of[["options","OPTIONS"],["variants","defaultVariants"],["variantSmp","VariantSmp"],["cssFonts","defaultCssFonts"],["accentMap","defaultAccentMap"],["moMap","defaultMoMap"],["mnMap","defaultMnMap"],["parameters","defaultParams"],["chars","defaultChars"],["sizeVariants","defaultSizeVariants"],["stretchVariants","defaultStretchVariants"]])Jt(this,s,t[e]);t.delimiters&&(Object.assign(this.defaultDelimiters,t.delimiters),this.adjustDelimiters(this.defaultDelimiters,Object.keys(t.delimiters),s.sizeN,s.stretchN))}constructor(t=null){this.variant={},this.delimiters={},this.cssFontMap={},this.cssFontPrefix="",this.remapChars={},this.skewIcFactor=.75;const e=this.CLASS;this.options=jt(Tt({},e.OPTIONS),t),this.params=Object.assign({},e.defaultParams),this.sizeVariants=[...e.defaultSizeVariants],this.stretchVariants=[...e.defaultStretchVariants],this.defineCssFonts(e.defaultCssFonts),this.cssFamilyPrefix=e.defaultCssFamilyPrefix,this.createVariants(e.defaultVariants),this.defineDelimiters(e.defaultDelimiters),Object.keys(e.defaultChars).forEach((t=>this.defineChars(t,e.defaultChars[t]))),this.defineRemap("accent",e.defaultAccentMap),this.defineRemap("mo",e.defaultMoMap),this.defineRemap("mn",e.defaultMnMap),this.defineDynamicCharacters(e.dynamicFiles),e.dynamicExtensions.forEach((t=>this.defineDynamicCharacters(t.files)))}setOptions(t){Tt(this.options,t)}addExtension(t,e=""){const s=this.constructor.JAX.toLowerCase(),i={name:t.name,prefix:e||`[${t.name}-extension]/${s}/dynamic`,files:this.CLASS.defineDynamicFiles(t.ranges,e),sizeN:this.sizeVariants.length,stretchN:this.stretchVariants.length};this.CLASS.dynamicExtensions.set(t.name,i),Tt(this.options,t.options||{}),Tt(this.params,t.parameters||{}),Jt(this,"sizeVariants",t.sizeVariants),Jt(this,"stretchVariants",t.stretchVariants),Jt(this.constructor,"VariantSmp",t.variantSmp),this.defineCssFonts(Jt({cssFonts:{}},"cssFonts",t.cssFonts)),this.createVariants(Jt({variants:[]},"variants",t.variants)),t.delimiters&&(this.defineDelimiters(Jt({delimiters:{}},"delimiters",t.delimiters)),this.CLASS.adjustDelimiters(this.delimiters,Object.keys(t.delimiters),i.sizeN,i.stretchN));for(const e of Object.keys(t.chars||{}))this.defineChars(e,t.chars[e]);return this.defineRemap("accent",t.accentMap),this.defineRemap("mo",t.moMap),this.defineRemap("mn",t.mnMap),t.ranges&&this.defineDynamicCharacters(i.files),[]}get styles(){return this._styles}set styles(t){this._styles=t}createVariant(t,e=null,s=null){const i={linked:[],chars:Object.create(e?this.variant[e].chars:{})};this.variant[s]&&(Object.assign(i.chars,this.variant[s].chars),this.variant[s].linked.push(i.chars),i.chars=Object.create(i.chars)),this.remapSmpChars(i.chars,t),this.variant[t]=i}remapSmpChars(t,e){const s=this.CLASS;let i=s.VariantSmp[e];if("string"==typeof i&&(i=s.VariantSmp[i]),!i)return;const n=s.SmpRemap,o=[null,null,s.SmpRemapGreekU,s.SmpRemapGreekL];for(const[e,r,a]of s.SmpRanges){const s=i[e];if(s){for(let e=r;e<=a;e++){if(930===e)continue;const i=s+e-r;t[e]=this.smpChar(n[i]||i)}if(o[e])for(const i of Object.keys(o[e]).map((t=>parseInt(t))))t[i]=this.smpChar(s+o[e][i])}}const r=i[5]||{};for(const e of Object.keys(r))t[e]=this.smpChar(i[5][e])}smpChar(t){return[,,,{smp:t}]}createVariants(t){for(const e of t)this.createVariant(e[0],e[1],e[2])}defineChars(t,e){const s=this.variant[t];Object.assign(s.chars,e);for(const t of s.linked)Object.assign(t,e)}defineCssFonts(t){Object.assign(this.cssFontMap,t);for(const e of Object.keys(t))"unknown"===this.cssFontMap[e][0]&&(this.cssFontMap[e][0]=this.options.unknownFamily)}defineDelimiters(t){Object.assign(this.delimiters,t)}defineRemap(t,e){e&&(Object.hasOwn(this.remapChars,t)||(this.remapChars[t]={}),Object.assign(this.remapChars[t],e))}defineDynamicCharacters(t){for(const e of Object.keys(t)){const s=t[e];for(const t of Object.keys(s.variants))this.defineChars(t,this.flattenRanges(s.variants[t],s));this.defineDelimiters(this.flattenRanges(s.delimiters,s))}}flattenRanges(t,e){const s={};for(const i of t)if(Array.isArray(i))for(let t=i[0];t<=i[1];t++)s[t]=e;else s[i]=e;return s}dynamicFileName(t){const e=t.extension?this.CLASS.dynamicExtensions.get(t.extension).prefix:this.options.dynamicPrefix;return t.file.match(/^(?:[/[]|[a-z]+:\/\/|[a-z]:)/i)?t.file:e+"/"+t.file.replace(/(\.js)?$/,".js")}loadDynamicFile(t){return Ht(this,void 0,void 0,(function*(){return t.failed?Promise.reject(new Error(`dynamic file '${t.file}' failed to load`)):(t.promise||(t.promise=Pt(this.dynamicFileName(t)).catch((e=>{t.failed=!0,console.warn(e)}))),t.promise.then((()=>t.setup(this))))}))}loadDynamicFiles(){const t=this.CLASS.dynamicFiles,e=Object.keys(t).map((e=>this.loadDynamicFile(t[e])));for(const t of this.CLASS.dynamicExtensions.values())e.push(...Object.keys(t.files).map((e=>this.loadDynamicFile(t.files[e]))));return Promise.all(e)}loadDynamicFilesSync(){if(!Ot.asyncIsSynchronous)throw Error("MathJax(loadDynamicFilesSync): mathjax.asyncLoad must be specified and synchronous\n Try importing #js/../components/require.mjs and #js/util/asyncLoad/node.js");const t=this.CLASS.dynamicFiles;Object.keys(t).forEach((e=>this.loadDynamicFileSync(t[e])));for(const t of this.CLASS.dynamicExtensions.values())Object.keys(t.files).forEach((e=>this.loadDynamicFileSync(t.files[e])))}loadDynamicFileSync(t){if(!t.promise){t.promise=Promise.resolve();try{Ot.asyncLoad(this.dynamicFileName(t))}catch(e){t.failed=!0,console.warn(e)}t.setup(this)}}addDynamicFontCss(t,e){}getDelimiter(t){const e=this.delimiters[t];return e&&!("dir"in e)?(this.delimiters[t]=null,Rt(this.loadDynamicFile(e)),null):e}getSizeVariant(t,e){const s=this.getDelimiter(t);return s&&s.variants&&(e=s.variants[e]),this.sizeVariants[e]}getStretchVariant(t,e){const s=this.getDelimiter(t);return this.stretchVariants[s.stretchv?s.stretchv[e]:0]}getStretchVariants(t){return[0,1,2,3].map((e=>this.getStretchVariant(t,e)))}getChar(t,e){const s=this.variant[t].chars[e];if(s&&!Array.isArray(s)){const i=this.variant[t];return delete i.chars[e],i.linked.forEach((t=>delete t[e])),Rt(this.loadDynamicFile(s)),null}return s}getVariant(t){return this.variant[t]}getCssFont(t){return this.cssFontMap[t]||["serif",!1,!1]}getFamily(t){return this.cssFamilyPrefix?this.cssFamilyPrefix+", "+t:t}getRemappedChar(t,e){return(this.remapChars[t]||{})[e]}}Qt.OPTIONS={unknownFamily:"serif",dynamicPrefix:"."},Qt.JAX="common",Qt.NAME="",Qt.defaultVariants=[["normal"],["bold","normal"],["italic","normal"],["bold-italic","italic","bold"],["double-struck","bold"],["fraktur","normal"],["bold-fraktur","bold","fraktur"],["script","italic"],["bold-script","bold-italic","script"],["sans-serif","normal"],["bold-sans-serif","bold","sans-serif"],["sans-serif-italic","italic","sans-serif"],["sans-serif-bold-italic","bold-italic","bold-sans-serif"],["monospace","normal"],["-smallop","normal"],["-largeop","normal"],["-tex-calligraphic","italic"],["-tex-bold-calligraphic","bold-italic"],["-tex-oldstyle","normal"],["-tex-bold-oldstyle","bold"],["-tex-mathit","italic"],["-tex-variant","normal"]],Qt.defaultCssFonts={normal:["unknown",!1,!1],bold:["unknown",!1,!0],italic:["unknown",!0,!1],"bold-italic":["unknown",!0,!0],"double-struck":["unknown",!1,!0],fraktur:["unknown",!1,!1],"bold-fraktur":["unknown",!1,!0],script:["cursive",!1,!1],"bold-script":["cursive",!1,!0],"sans-serif":["sans-serif",!1,!1],"bold-sans-serif":["sans-serif",!1,!0],"sans-serif-italic":["sans-serif",!0,!1],"sans-serif-bold-italic":["sans-serif",!0,!0],monospace:["monospace",!1,!1],"-smallop":["unknown",!1,!1],"-largeop":["unknown",!1,!1],"-tex-calligraphic":["cursive",!0,!1],"-tex-bold-calligraphic":["cursive",!0,!0],"-tex-oldstyle":["unknown",!1,!1],"-tex-bold-oldstyle":["unknown",!1,!0],"-tex-mathit":["unknown",!0,!1],"-tex-variant":["unknown",!1,!1]},Qt.defaultCssFamilyPrefix="",Qt.VariantSmp={bold:[119808,119834,120488,120514,120782,{988:120778,989:120779}],italic:[119860,119886,120546,120572],"bold-italic":[119912,119938,120604,120630],script:[119964,119990],"bold-script":[120016,120042],fraktur:[120068,120094],"double-struck":[120120,120146,,,120792],"bold-fraktur":[120172,120198],"sans-serif":[120224,120250,,,120802],"bold-sans-serif":[120276,120302,120662,120688,120812],"sans-serif-italic":[120328,120354],"sans-serif-bold-italic":[120380,120406,120720,120746],monospace:[120432,120458,,,120822]},Qt.SmpRanges=[[0,65,90],[1,97,122],[2,913,937],[3,945,969],[4,48,57]],Qt.SmpRemap={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},Qt.SmpRemapGreekU={8711:25,1012:17},Qt.SmpRemapGreekL={977:27,981:29,982:31,1008:28,1009:30,1013:26,8706:25},Qt.defaultAccentMap={94:"\u02c6",126:"\u02dc",768:"\u02cb",769:"\u02ca",770:"\u02c6",771:"\u02dc",772:"\u02c9",774:"\u02d8",775:"\u02d9",776:"\xa8",778:"\u02da",780:"\u02c7",8594:"\u20d7"},Qt.defaultMoMap={45:"\u2212"},Qt.defaultMnMap={45:"\u2212"},Qt.defaultParams={x_height:.442,quad:1,num1:.676,num2:.394,num3:.444,denom1:.686,denom2:.345,sup1:.413,sup2:.363,sup3:.289,sub1:.15,sub2:.247,sup_drop:.386,sub_drop:.05,delim1:2.39,delim2:1,axis_height:.25,rule_thickness:.06,big_op_spacing1:.111,big_op_spacing2:.167,big_op_spacing3:.2,big_op_spacing4:.6,big_op_spacing5:.1,surd_height:.06,scriptspace:.05,nulldelimiterspace:.12,delimiterfactor:901,delimitershortfall:.3,rule_factor:1.25,min_rule_thickness:1.25,separation_factor:1.75,extra_ic:.033,extender_factor:.333},Qt.defaultDelimiters={},Qt.defaultChars={},Qt.defaultSizeVariants=[],Qt.defaultStretchVariants=[],Qt.dynamicFiles={},Qt.dynamicExtensions=new Map;const Xt=MathJax._.core.Tree.Visitor.AbstractVisitor,Ut=MathJax._.util.BBox.BBox;class Kt extends Ut{static from(t,e,s=null){const i=new this;return Object.assign(i,t),i.lineLeading=e,s&&(i.indentData=s),i}constructor(t,e=null){super(t),this.indentData=null,this.isFirst=!1,this.originalL=this.L,e&&(this.start=e)}append(t){this.isFirst&&(t.originalL+=t.L,t.L=0),t.indentData&&(this.indentData=t.indentData),this.lineLeading=t.lineLeading,super.append(t),this.isFirst=t.isFirst}copy(){const t=Kt.from(this,this.lineLeading);return t.indentData=this.indentData,t.lineLeading=this.lineLeading,t}getIndentData(t){let{indentalign:e,indentshift:s,indentalignfirst:i,indentshiftfirst:n,indentalignlast:o,indentshiftlast:r}=t.attributes.getAllAttributes();"indentalign"===i&&(i=t.attributes.getInherited("indentalign")),"indentshift"===n&&(n=t.attributes.getInherited("indentshift")),"indentalign"===o&&(o=e),"indentshift"===r&&(r=s),this.indentData=[[i,n],[e,s],[o,r]]}copyIndentData(t){return t.indentData.map((([t,e])=>[t,e]))}}const qt=MathJax._.core.MmlTree.OperatorDictionary,$t=(qt.OPDEF,qt.MO,qt.RANGES,qt.getRange,qt.MMLSPACING,qt.OPTABLE),Yt=1e6;class Zt extends Xt{breakToWidth(t,e){}}class te extends Zt{constructor(){super(...arguments),this.PENALTY={newline:t=>0,nobreak:t=>Yt,goodbreak:t=>t-200*this.state.depth,badbreak:t=>t+200*this.state.depth,auto:t=>t},this.FACTORS={depth:t=>t+800*this.state.depth,width:t=>t+Math.floor((this.state.width-this.state.w)/this.state.width*2500),tail:t=>t+Math.floor(this.state.width/Math.max(1e-4,this.state.mathLeft-this.state.w)*500),open:(t,e)=>{const s=e.node.prevClass;if(s===Mt.BIN||s===Mt.REL||s===Mt.OP)return t+5e3;const i=this.getPrevious(e);if(i&&("postfix"!==i.attributes.get("form")||"nobreak"===i.attributes.get("linebreak")))return t+5e3;const n=e.node.Parent;if((null==n?void 0:n.isKind("mmultiscripts"))&&e.node===this.getFirstToken(n)){if(!!n.childNodes.filter((t=>t.isKind("mprescripts"))).length)return Yt}return t-500},close:(t,e)=>{var s;const i=e.node.Parent;return!(null==i?void 0:i.isKind("msubsup"))||i.isKind("mmultiscripts")&&(null===(s=i.childNodes[1])||void 0===s?void 0:s.isKind("mprescripts"))||e.node!==this.getLastToken(i.childNodes[0])?t+500:Yt},space:(t,e)=>{const s=e;if(!s.canBreak)return Yt;const i=s.getBBox().w;return i<0?Yt:i<1?t:t-100*(i+4)},separator:t=>t+500,fuzz:t=>.99*t},this.TEXCLASS={[Mt.BIN]:t=>t-250,[Mt.REL]:t=>t-500}}breakToWidth(t,e){const s=this.state;this.state=this.createState(t),this.state.width=e;const i=t.breakCount;for(let s=0;s<=i;s++){(t.lineBBox[s]||t.getLineBBox(s)).w>e&&this.breakLineToWidth(t,s)}for(const[t,e]of this.state.breaks){if(null===e){const e=t.coreMO();e.setBreakStyle(e.node.attributes.get("linebreakstyle")||"before")}else t.setBreakAt(e);t.invalidateBBox()}this.state=s}createState(t){const e=t.getBBox().w;return{breaks:new Set,potential:[],width:0,w:0,prevWidth:0,prevBreak:null,depth:0,mathWidth:e,mathLeft:e}}breakLineToWidth(t,e){const s=this.state;s.potential=[],s.w=0,s.prevWidth=0,s.prevBreak=null,s.depth=0,this.visitNode(t,e)}addWidth(t,e=null){null===e&&(e=t.L+t.w+t.R),e&&(e*=t.rscale,this.state.w+=e,this.state.potential.length&&(this.state.potential[0][4]+=e),this.processBreak())}processBreak(){const t=this.state;for(;t.potential.length&&t.w>this.state.width;){const e=t.potential.pop(),[s,,i,n,o]=e;t.breaks.add(s),t.w=t.potential.reduce(((t,e)=>t+e[4]),n+o),t.prevBreak&&t.prevWidth+i<=t.width?(t.breaks.delete(t.prevBreak[0]),t.prevWidth+=i):t.prevWidth=i+n,t.potential.forEach((t=>t[2]-=i)),t.prevBreak=e,t.mathLeft-=i}}pushBreak(t,e,s,i){var n;const o=this.state;if(!(e>=Yt||0===o.w&&0===o.prevWidth)){for(;o.potential.length&&o.potential[0][1]>this.FACTORS.fuzz(e);){const t=o.potential.shift();o.potential.length&&(o.potential[0][4]+=t[4])}o.potential.unshift([[t,i],e,o.w-((null===(n=o.prevBreak)||void 0===n?void 0:n[3])||0),s,0])}}getBorderLR(t){var e;const s=t.styleData;if(!s)return[0,0];const i=(null===(e=null==s?void 0:s.border)||void 0===e?void 0:e.width)||[0,0,0,0],n=(null==s?void 0:s.padding)||[0,0,0,0];return[i[3]+n[3],i[1]+n[1]]}getFirstToken(t){return t.isToken?t:this.getFirstToken(t.childNodes[0])}getLastToken(t){return t.isToken?t:this.getLastToken(t.childNodes[t.childNodes.length-1])}visitNode(t,e){t&&(this.state.depth++,t.node.isEmbellished&&!t.node.isKind("mo")?this.visitEmbellishedOperator(t,e):super.visitNode(t,e),this.state.depth--)}visitDefault(t,e){var s;const i=t.getLineBBox(e);if(t.node.isToken||t.node.linebreakContainer||!(null===(s=t.childNodes)||void 0===s?void 0:s[0]))this.addWidth(i);else{const[s,n]=this.getBorderLR(t);0===e&&this.addWidth(i,i.L+s),this.visitNode(t.childNodes[0],e),e===t.breakCount&&this.addWidth(i,i.R+n)}}visitEmbellishedOperator(t,e){const s=t.coreMO(),i=Kt.from(t.getOuterBBox(),t.linebreakOptions.lineleading);i.getIndentData(s.node);const n=s.getBreakStyle(s.node.attributes.get("linebreakstyle")),o=s.processIndent("",i.indentData[1][1],"",i.indentData[0][1],this.state.width)[1],r=this.moPenalty(s);if("before"===n)this.pushBreak(t,r,o-i.L,null),this.addWidth(i);else{this.addWidth(i);const e=("after"===n?0:s.multChar?s.multChar.getBBox().w:i.w)+o;this.pushBreak(t,r,e,null)}}visitMoNode(t,e){const s=t,i=Kt.from(s.getOuterBBox(),s.linebreakOptions.lineleading);i.getIndentData(s.node);const n=s.getBreakStyle(s.node.attributes.get("linebreakstyle")),o=s.processIndent("",i.indentData[1][1],"",i.indentData[0][1],this.state.width)[1],r=this.moPenalty(s);if("before"===n)this.pushBreak(t,r,o-i.L,null),this.addWidth(i);else{this.addWidth(i);const e=("after"===n?0:s.multChar?s.multChar.getBBox().w:i.w)+o;this.pushBreak(t,r,e,null)}}moPenalty(t){const{linebreak:e,fence:s,form:i}=t.node.attributes.getList("linebreak","fence","form"),n=this.FACTORS;let o=n.tail(n.width(0));const r=s&&"prefix"===i||t.node.texClass===Mt.OPEN,a=s&&"postfix"===i||t.node.texClass===Mt.CLOSE;return r&&(o=n.open(o,t),this.state.depth++),a&&(o=n.close(o,t),this.state.depth--),o=(this.TEXCLASS[t.node.texClass]||(t=>t))(o),(this.PENALTY[e]||(t=>t))(n.depth(o))}getPrevious(t){let e=t.node,s=e.parent,i=s.childIndex(e);for(;s&&(s.notParent||s.isKind("mrow"))&&0===i;)e=s,s=e.parent,i=s.childIndex(e);if(!s||!i)return null;const n=s.childNodes[i-1];return n.isEmbellished?n.coreMO():null}visitMspaceNode(t,e){const s=t.getLineBBox(e),i=t;if(i.canBreak){const e=this.mspacePenalty(i);s.getIndentData(t.node);const n=t.processIndent("",s.indentData[1][1],"",s.indentData[0][1],this.state.width)[1];this.pushBreak(t,e,n-s.w,null)}this.addWidth(s)}mspacePenalty(t){const e=t.node.attributes.get("linebreak"),s=this.FACTORS,i=s.space(s.tail(s.width(0)),t);return(this.PENALTY[e]||(t=>t))(s.depth(i))}visitMtextNode(t,e){if(!t.getText().match(/ /))return void this.visitDefault(t,e);const s=t;s.clearBreakPoints();const i=s.textWidth(" "),n=t.getBBox(),[o,r]=this.getBorderLR(t);this.addWidth(n,n.L+o);const a=s.childNodes;for(const e of a.keys()){const o=a[e];if(o.node.isKind("text")){const r=o.node.getText().split(/ /),a=r.pop();for(const o of r.keys())this.addWidth(n,s.textWidth(r[o])),this.pushBreak(t,this.mtextPenalty(),-i,[e,o+1]),this.addWidth(n,i);this.addWidth(n,s.textWidth(a))}else this.addWidth(o.getBBox())}this.addWidth(n,n.R+r)}mtextPenalty(){const t=this.FACTORS;return t.depth(t.tail(t.width(0)))}visitMrowNode(t,e){const s=t.lineBBox[e]||t.getLineBBox(e),[i,n]=s.start||[0,0],[o,r]=s.end||[t.childNodes.length-1,0],[a,h]=this.getBorderLR(t);this.addWidth(s,s.L+a);for(let e=i;e<=o;e++)this.visitNode(t.childNodes[e],e===i?n:e===o?r:0);this.addWidth(s,s.R+h)}visitInferredMrowNode(t,e){this.state.depth--,this.visitMrowNode(t,e),this.state.depth++}visitMfracNode(t,e){const s=t;!s.node.attributes.get("bevelled")&&s.getOuterBBox().w>this.state.width&&(this.breakToWidth(s.childNodes[0],this.state.width),this.breakToWidth(s.childNodes[1],this.state.width)),this.visitDefault(t,e)}visitMsqrtNode(t,e){if(t.getOuterBBox().w>this.state.width){const e=t,s=e.childNodes[e.base];this.breakToWidth(s,this.state.width-e.rootWidth()),e.getStretchedSurd()}this.visitDefault(t,e)}visitMrootNode(t,e){this.visitMsqrtNode(t,e)}visitMsubNode(t,e){this.visitDefault(t,e);const s=t,i=s.getOffset()[0],n=s.scriptChild.getOuterBBox(),[o,r]=this.getBorderLR(t);this.addWidth(s.getLineBBox(e),i+o+n.rscale*n.w+s.font.params.scriptspace+r)}visitMsupNode(t,e){this.visitDefault(t,e);const s=t,i=s.getOffset()[0],n=s.scriptChild.getOuterBBox(),[o,r]=this.getBorderLR(t);this.addWidth(s.getLineBBox(e),i+o+n.rscale*n.w+s.font.params.scriptspace+r)}visitMsubsupNode(t,e){this.visitDefault(t,e);const s=t,i=s.subChild.getOuterBBox(),n=s.supChild.getOuterBBox(),o=s.getAdjustedIc(),r=Math.max(i.rscale*i.w,o+n.rscale*n.w)+s.font.params.scriptspace,[a,h]=this.getBorderLR(t);this.addWidth(t.getLineBBox(e),a+r+h)}visitMmultiscriptsNode(t,e){const s=t,i=s.scriptData;if(i.numPrescripts){const n=Math.max(i.psup.rscale*i.psup.w,i.psub.rscale*i.psub.w);this.addWidth(t.getLineBBox(e),n+s.font.params.scriptspace)}if(this.visitDefault(t,e),i.numScripts){const n=Math.max(i.sup.rscale*i.sup.w,i.sub.rscale*i.sub.w);this.addWidth(t.getLineBBox(e),n+s.font.params.scriptspace)}}visitMfencedNode(t,e){const s=t,i=t.getLineBBox(e),[n,o]=this.getBorderLR(t);0===e&&this.addWidth(i,i.L+n),this.visitNode(s.mrow,e),e===t.breakCount&&this.addWidth(i,i.R+o)}visitMactionNode(t,e){const s=t,i=t.getLineBBox(e),[n,o]=this.getBorderLR(t);0===e&&this.addWidth(i,i.L+n),this.visitNode(s.selected,e),e===t.breakCount&&this.addWidth(i,i.R+o)}}!function(){for(const t of Object.keys($t.postfix)){const e=$t.postfix[t][3];e&&e.fence&&(e.linebreakstyle="after")}$t.infix["\u2061"]=[...$t.infix["\u2061"]],$t.infix["\u2061"][3]={linebreak:"nobreak"}}();const ee=MathJax._.util.lengths,se=ee.BIGDIMEN,ie=(ee.UNITS,ee.RELUNITS,ee.MATHSPACE,ee.length2em),ne=ee.percent,oe=ee.em,re=ee.px,ae=MathJax._.util.Styles,he=ae.TRBL,de=(ae.WSC,ae.Styles),le=MathJax._.util.StyleJson.StyleJsonSheet,ce="@mathjax/%%FONT%%-font";class ue extends kt{get forceInlineBreaks(){return!1}constructor(t={},e=null,s=null){const[i,n]=t.fontData instanceof Qt?[t.fontData.constructor,t.fontData]:[t.fontData||s,null],[o,r]=Et(t,i.OPTIONS);super(o),this.factory=this.options.wrapperFactory||new e,this.factory.jax=this,this.styleJson=this.options.styleJson||new le,this.font=n||new i(r),this.font.setOptions({mathmlSpacing:this.options.mathmlSpacing}),this.unknownCache=new Map;const a=this.options.linebreaks.LinebreakVisitor||te;this.linebreaks=new a(this.factory)}setAdaptor(t){super.setAdaptor(t),"auto"===this.options.htmlHDW&&(this.options.htmlHDW=t.canMeasureNodes?"ignore":"force")}addExtension(t,e=""){return this.font.addExtension(t,e)}typeset(t,e){this.setDocument(e);const s=this.createNode();return this.toDOM(t,s,e),s}createNode(){const t=this.constructor.NAME;return this.html("mjx-container",{class:"MathJax",jax:t})}setScale(t,e){let s=this.getInitialScale()*this.options.scale;if("scale"===e.node.attributes.get("overflow")&&this.math.display){const t=e.getOuterBBox().w,i=this.math.metrics.containerWidth/this.pxPerEm;t>i&&t&&(s*=i/t)}1!==s&&this.adaptor.setStyle(t,"fontSize",ne(s))}getInitialScale(){return this.math.metrics.scale}toDOM(t,e,s=null){var i;this.setDocument(s),this.math=t,this.container=e,this.pxPerEm=t.metrics.ex/this.font.params.x_height,this.executeFilters(this.preFilters,t,s,e),this.nodeMap=new Map,t.root.attributes.getAllInherited().overflow=this.options.displayOverflow;const n=t.root.attributes.get("overflow");this.adaptor.setAttribute(e,"overflow",n);"linebreak"===n&&this.getLinebreakWidth();const o=this.options.linebreaks.inline&&!t.display;let r=!!t.root.getProperty("inlineMarked");!r||o&&this.forceInlineBreaks===t.root.getProperty("inlineForced")||(this.unmarkInlineBreaks(t.root),t.root.removeProperty("inlineMarked"),t.root.removeProperty("inlineForced"),r=!1),o&&!r&&(this.markInlineBreaks(null===(i=t.root.childNodes)||void 0===i?void 0:i[0]),t.root.setProperty("inlineMarked",!0),t.root.setProperty("inlineForced",this.forceInlineBreaks)),t.root.setTeXclass(null);const a=this.factory.wrap(t.root);this.setScale(e,a),this.processMath(a,e),this.nodeMap=null,this.executeFilters(this.postFilters,t,s,e)}getBBox(t,e){this.setDocument(e),this.math=t,t.root.setTeXclass(null),this.nodeMap=new Map;const s=this.factory.wrap(t.root).getOuterBBox();return this.nodeMap=null,s}getLinebreakWidth(){const t=this.math.metrics.containerWidth/this.pxPerEm,e=this.math.root.attributes.get("maxwidth")||this.options.linebreaks.width;this.containerWidth=ie(e,t,1,this.pxPerEm)}markInlineBreaks(t){if(!t)return;const e=this.forceInlineBreaks;let s=!1,i=!1,n="";for(const o of t.childNodes)if(n)i=this.markInlineBreak(i,e,n,t,o),n="",s=!1;else if(o.isEmbellished){if(o===t.childNodes[0])continue;const r=o.coreMO(),a=r.texClass,h=r.attributes.get("linebreak"),d=r.attributes.get("linebreakstyle");(a===Mt.BIN||a===Mt.REL||a===Mt.ORD&&r.hasSpacingAttributes()||"auto"!==h)&&"nobreak"!==h&&("before"===d?s&&"auto"===h||(i=this.markInlineBreak(i,e,h,t,o,r)):n=h),s="newline"===h&&"after"===d}else if(o.isKind("mspace")){const n=o.attributes.get("linebreak");"nobreak"!==n&&o.canBreak&&(i=this.markInlineBreak(i,e,n,t,o)),s="newline"===n}else s=!1,o.isKind("mstyle")&&!o.attributes.get("style")&&!o.attributes.hasExplicit("mathbackground")||o.isKind("semantics")?(this.markInlineBreaks(o.childNodes[0]),o.getProperty("process-breaks")&&(o.setProperty("inline-breaks",!0),o.childNodes[0].setProperty("inline-breaks",!0),t.parent.setProperty("process-breaks","true"))):o.isKind("mrow")&&o.attributes.get("data-semantic-added")&&(this.markInlineBreaks(o),o.getProperty("process-breaks")&&(o.setProperty("inline-breaks",!0),t.parent.setProperty("process-breaks","true")))}markInlineBreak(t,e,s,i,n,o=null){return n.setProperty("breakable",!0),e&&"newline"!==s?(n.setProperty("forcebreak",!0),null==o||o.setProperty("forcebreak",!0)):(n.removeProperty("forcebreak"),null==o||o.removeProperty("forcebreak"),"newline"===s&&n.setProperty("newline",!0)),t||(i.setProperty("process-breaks",!0),i.parent.setProperty("process-breaks",!0),t=!0),t}unmarkInlineBreaks(t){if(t&&(t.removeProperty("forcebreak"),t.removeProperty("breakable"),t.getProperty("process-breaks"))){t.removeProperty("process-breaks");for(const e of t.childNodes)this.unmarkInlineBreaks(e)}}getMetrics(t){this.setDocument(t);const e=this.adaptor,s=this.getMetricMaps(t);for(const i of t.math){const t=e.parent(i.start.node);if(i.state()new Array(4).fill(t.thickness+t.padding),ve=t=>new Array(4).fill(t.padding),ke=t=>new Array(4).fill(t.thickness),we=t=>Math.max(t.padding,t.thickness*(t.arrowhead.x+t.arrowhead.dx+1)),Se=(t,e)=>{if(t.childNodes[0]){const{h:s,d:i}=t.childNodes[0].getBBox();e[0]=e[2]=Math.max(0,t.thickness*t.arrowhead.y-(s+i)/2)}return e},Ce=(t,e)=>{if(t.childNodes[0]){const{w:s}=t.childNodes[0].getBBox();e[1]=e[3]=Math.max(0,t.thickness*t.arrowhead.y-s/2)}return e},Me={up:[-Math.PI/2,!1,!0,"verticalstrike"],down:[Math.PI/2,!1,!0,"verticakstrike"],right:[0,!1,!1,"horizontalstrike"],left:[Math.PI,!1,!1,"horizontalstrike"],updown:[Math.PI/2,!0,!0,"verticalstrike uparrow downarrow"],leftright:[0,!0,!1,"horizontalstrike leftarrow rightarrow"]},Ne={updiagonal:[-1,0,!1,"updiagonalstrike northeastarrow"],northeast:[-1,0,!1,"updiagonalstrike updiagonalarrow"],southeast:[1,0,!1,"downdiagonalstrike"],northwest:[1,Math.PI,!1,"downdiagonalstrike"],southwest:[-1,Math.PI,!1,"updiagonalstrike"],northeastsouthwest:[-1,0,!0,"updiagonalstrike northeastarrow updiagonalarrow southwestarrow"],northwestsoutheast:[1,0,!0,"downdiagonalstrike northwestarrow southeastarrow"]},Le={up:t=>Ce(t,[we(t),0,t.padding,0]),down:t=>Ce(t,[t.padding,0,we(t),0]),right:t=>Se(t,[0,we(t),0,t.padding]),left:t=>Se(t,[0,t.padding,0,we(t)]),updown:t=>Ce(t,[we(t),0,we(t),0]),leftright:t=>Se(t,[0,we(t),0,we(t)])},De=function(t){return e=>{const s=Ae[e];return[e,{renderer:t,bbox:t=>{const e=[0,0,0,0];return e[s]=t.thickness+t.padding,e},border:t=>{const e=[0,0,0,0];return e[s]=t.thickness,e}}]}},Oe=function(t){return(e,s,i)=>{const n=Ae[s],o=Ae[i];return[e,{renderer:t,bbox:t=>{const e=t.thickness+t.padding,s=[0,0,0,0];return s[n]=s[o]=e,s},border:t=>{const e=[0,0,0,0];return e[n]=e[o]=t.thickness,e},remove:s+" "+i}]}},We=function(t){return e=>{const s="mjx-"+e.charAt(0)+"strike";return[e+"diagonalstrike",{renderer:t(s),bbox:ye}]}},Te=function(t){return e=>{const[s,i,n,o]=Ne[e];return[e+"arrow",{renderer:(e,o)=>{const[r,a]=e.arrowAW(),h=e.arrow(a,s*(r-i),n);t(e,h)},bbox:t=>{const{a:e,x:s,y:i}=t.arrowData(),[n,o,r]=[t.arrowhead.x,t.arrowhead.y,t.arrowhead.dx],[a,h]=t.getArgMod(n+r,o),d=i+(a>e?t.thickness*h*Math.sin(a-e):0),l=s+(a>Math.PI/2-e?t.thickness*h*Math.sin(a+e-Math.PI/2):0);return[d,l,d,l]},remove:o}]}},je=function(t){return e=>{const[s,i,n,o]=Me[e];return[e+"arrow",{renderer:(e,o)=>{const{w:r,h:a,d:h}=e.getBBox(),[d,l]=n?[a+h,"X"]:[r,"Y"],c=e.getOffset(l),u=e.arrow(d,s,i,l,c);t(e,u)},bbox:Le[e],remove:o}]}},Ee=MathJax._.core.Tree.Wrapper.AbstractWrapper,Ve=MathJax._.util.string,Pe=(Ve.sortLength,Ve.quotePattern,Ve.unicodeChars),Ie=(Ve.unicodeString,Ve.isPercent),Re=Ve.split,Fe=(Ve.replaceUnicode,Ve.toEntity,2/18),Ge=5/18;function _e(t,e,s){return e?t?Fe:Ge:t?s{const s=this.wrap(t);return s.bbox.pwidth&&(e.notParent||e.isKind("math"))&&(this.bbox.pwidth=Ut.fullWidth),s}))}wrap(t,e=null){const s=this.factory.wrap(t,e||this);return e&&e.childNodes.push(s),this.jax.nodeMap.set(t,s),s}getBBox(t=!0){if(this.bboxComputed)return this.bbox;const e=t?this.bbox:Ut.zero();return this.computeBBox(e),this.bboxComputed=t,e}getOuterBBox(t=!0){var e;const s=this.getBBox(t);if(!this.styleData)return s;const i=this.styleData.padding,n=(null===(e=this.styleData.border)||void 0===e?void 0:e.width)||[0,0,0,0],o=s.copy();for(const[,t,e]of Ut.boxSides)o[e]+=i[t]+n[t];return o}getUnbrokenHD(){const t=this.breakCount+1;let e=0,s=0;for(let i=0;ie&&(e=t),n>s&&(s=n)}return[e,s]}computeBBox(t,e=!1){t.empty();for(const e of this.childNodes)t.append(e.getOuterBBox());t.clean(),this.fixesPWidth&&this.setChildPWidths(e)&&this.computeBBox(t,!0)}getLineBBox(t){if(!this.lineBBox[t]){const e=this.breakCount;if(e){const s=this.embellishedBBox(t)||this.computeLineBBox(t);this.lineBBox[t]=s,0===t&&(!this.node.isKind("mo")&&this.node.isEmbellished?s.originalL=this.getBBox().L:s.L=this.getBBox().L),t===e&&(s.R=this.getBBox().R)}else{const e=this.getOuterBBox();this.lineBBox[t]=Kt.from(e,this.linebreakOptions.lineleading)}}return this.lineBBox[t]}embellishedBBox(t){if(!this.node.isEmbellished||this.node.isKind("mo"))return null;const e=this.coreMO();return e.moLineBBox(t,e.embellishedBreakStyle,this.getOuterBBox())}computeLineBBox(t){return this.getChildLineBBox(this.childNodes[0],t)}getBreakNode(t){var e,s;if(!t.start)return[this,null];const[i,n]=t.start;if(this.node.isEmbellished)return[this,this.coreMO()];const o=(null===(s=null===(e=this.childNodes[0])||void 0===e?void 0:e.node)||void 0===s?void 0:s.isInferred)?this.childNodes[0].childNodes:this.childNodes;return this.node.isToken||!o[i]?[this,null]:o[i].getBreakNode(o[i].getLineBBox(n))}getChildLineBBox(t,e){const s=this.breakCount;let i=t.getLineBBox(e);return(this.styleData||this.bbox.L||this.bbox.R)&&(i=i.copy()),this.addMiddleBorders(i),0===e?(i.L+=this.bbox.L,this.addLeftBorders(i)):e===s&&(i.R+=this.bbox.R,this.addRightBorders(i)),i}addLeftBorders(t){var e;if(!this.styleData)return;const s=this.styleData.border,i=this.styleData.padding;t.w+=((null===(e=null==s?void 0:s.width)||void 0===e?void 0:e[3])||0)+((null==i?void 0:i[3])||0)}addMiddleBorders(t){var e,s;if(!this.styleData)return;const i=this.styleData.border,n=this.styleData.padding;t.h+=((null===(e=null==i?void 0:i.width)||void 0===e?void 0:e[0])||0)+((null==n?void 0:n[0])||0),t.d+=((null===(s=null==i?void 0:i.width)||void 0===s?void 0:s[2])||0)+((null==n?void 0:n[2])||0)}addRightBorders(t){var e;if(!this.styleData)return;const s=this.styleData.border,i=this.styleData.padding;t.w+=((null===(e=null==s?void 0:s.width)||void 0===e?void 0:e[1])||0)+((null==i?void 0:i[1])||0)}setChildPWidths(t,e=null,s=!0){if(t)return!1;s&&(this.bbox.pwidth="");let i=!1;for(const n of this.childNodes){const o=n.getBBox();o.pwidth&&n.setChildPWidths(t,null===e?o.w:e,s)&&(i=!0)}return i}breakToWidth(t){}invalidateBBox(t=!0){(this.bboxComputed||this._breakCount>=0)&&(this.bboxComputed=!1,this.lineBBox=[],this._breakCount=-1,this.parent&&t&&this.parent.invalidateBBox())}copySkewIC(t){var e,s,i;const n=this.childNodes[0];(null===(e=null==n?void 0:n.bbox)||void 0===e?void 0:e.sk)&&(t.sk=n.bbox.sk),(null===(s=null==n?void 0:n.bbox)||void 0===s?void 0:s.dx)&&(t.dx=n.bbox.dx);const o=this.childNodes[this.childNodes.length-1];(null===(i=null==o?void 0:o.bbox)||void 0===i?void 0:i.ic)&&(t.ic=o.bbox.ic,t.w+=t.ic)}getStyles(){const t=this.node.attributes.getExplicit("style");if(!t)return;const e=this.styles=new de(t);for(let t=0,s=ze.removeStyles.length;t600?"bold":"normal"),s.family?e=this.explicitVariant(s.family,s.weight,s.style):(this.node.getProperty("variantForm")&&(e="-tex-variant"),e=(ze.BOLDVARIANTS[s.weight]||{})[e]||e,e=(ze.ITALICVARIANTS[s.style]||{})[e]||e)}this.variant=e}explicitVariant(t,e,s){let i=this.styles;return i||(i=this.styles=new de),i.set("fontFamily",t),e&&i.set("fontWeight",e),s&&i.set("fontStyle",s),"-explicitFont"}getScale(){let t=1;const e=this.parent,s=e?e.bbox.scale:1,i=this.node.attributes,n=Math.min(i.get("scriptlevel"),2);let o=i.get("fontsize"),r=this.node.isToken||this.node.isKind("mstyle")?i.get("mathsize"):i.getInherited("mathsize");if(0!==n&&(t=Math.pow(i.get("scriptsizemultiplier"),n)),this.removedStyles&&this.removedStyles.fontSize&&!o&&(o=this.removedStyles.fontSize),o&&!i.hasExplicit("mathsize")&&(r=o),"1"!==r&&(t*=this.length2em(r,1,1)),0!==n){const e=this.length2em(i.get("scriptminsize"),.4,1);t0;if(this.bbox.L=o.isSet("lspace")?Math.max(0,this.length2em(o.get("lspace"))):_e(r,n,t.lspace),this.bbox.R=o.isSet("rspace")?Math.max(0,this.length2em(o.get("rspace"))):_e(r,n,t.rspace),!i)return;const a=s.childNodes[i-1];if(!a.isEmbellished)return;const h=this.jax.nodeMap.get(a).getBBox();h.R&&(this.bbox.L=Math.max(0,this.bbox.L-h.R))}getTeXSpacing(t,e){if(!e){const t=this.node.texSpacing();t&&(this.bbox.L=this.length2em(t))}if(t||e){const t=this.node.coreMO().attributes;t.isSet("lspace")&&(this.bbox.L=Math.max(0,this.length2em(t.get("lspace")))),t.isSet("rspace")&&(this.bbox.R=Math.max(0,this.length2em(t.get("rspace"))))}}isTopEmbellished(){return this.node.isEmbellished&&!(this.node.parent&&this.node.parent.isEmbellished)}core(){return this.jax.nodeMap.get(this.node.core())}coreMO(){return this.jax.nodeMap.get(this.node.coreMO())}coreRScale(){let t=this.bbox.rscale,e=this.coreMO();for(;e!==this&&e;)t*=e.bbox.rscale,e=e.parent;return t}getRScale(){let t=1,e=this;for(;e;)t*=e.bbox.rscale,e=e.parent;return t}getText(){let t="";if(this.node.isToken)for(const e of this.node.childNodes)e instanceof Lt&&(t+=e.getText());return t}canStretch(t){if(this.stretch=zt,this.node.isEmbellished){const e=this.core();e&&e.node!==this.node&&e.canStretch(t)&&(this.stretch=e.stretch)}return this.stretch.dir!==Ft.None}getAlignShift(){let{indentalign:t,indentshift:e,indentalignfirst:s,indentshiftfirst:i}=this.node.attributes.getAllAttributes();return"indentalign"!==s&&(t=s),"indentshift"!==i&&(e=i),this.processIndent(t,e)}processIndent(t,e,s="",i="",n=this.metrics.containerWidth){if(!this.jax.math.display)return["left",0];s&&"auto"!==s||(s=this.jax.math.root.getProperty("inlineMarked")?"left":this.jax.options.displayAlign),i&&"auto"!==i||(i=this.jax.math.root.getProperty("inlineMarked")?"0":this.jax.options.displayIndent),"auto"===t&&(t=s),"auto"===e&&(e=i,"right"!==t||e.match(/^\s*0[a-z]*\s*$/)||(e=("-"+e.trim()).replace(/^--/,"")));return[t,this.length2em(e,n)]}getAlignX(t,e,s){return"right"===s?t-(e.w+e.R)*e.rscale:"left"===s?e.L*e.rscale:(t-e.w*e.rscale)/2}getAlignY(t,e,s,i,n){return"top"===n?t-s:"bottom"===n?i-e:"center"===n?(t-s-(e-i))/2:0}getWrapWidth(t){return this.childNodes[t].getBBox().w}getChildAlign(t){return"left"}percent(t){return ne(t)}em(t){return oe(t)}px(t,e=-se){return re(t,e,this.metrics.em)}length2em(t,e=1,s=null){null===s&&(s=this.bbox.scale);const i=this.font.params.rule_thickness,n=Vt(t,{medium:1,thin:2/3,thick:5/3},0);return n?n*i:ie(t,e,s,this.jax.pxPerEm)}unicodeChars(t,e=this.variant){let s=Pe(t);const i=this.font.getVariant(e);if(i&&i.chars){const t=i.chars;s=s.map((e=>{var s,i;return(null===(i=null===(s=t[e])||void 0===s?void 0:s[3])||void 0===i?void 0:i.smp)||e}))}return s}remapChars(t){return t}mmlText(t){return this.node.factory.create("text").setText(t)}mmlNode(t,e={},s=[]){return this.node.factory.create(t,e,s)}createMo(t){const e=this.node.factory,s=e.create("text").setText(t),i=e.create("mo",{stretchy:!0},[s]);i.inheritAttributesFrom(this.node),i.parent=this.node.parent;const n=this.wrap(i);return n.parent=this,n}getVariantChar(t,e){const s=this.font.getChar(t,e)||[0,0,0,{unknown:!0}];return 3===s.length&&(s[3]={}),s}html(t,e={},s=[]){return this.jax.html(t,e,s)}}ze.kind="unknown",ze.styles={},ze.removeStyles=["fontSize","fontFamily","fontWeight","fontStyle","fontVariant","font"],ze.skipAttributes={fontfamily:!0,fontsize:!0,fontweight:!0,fontstyle:!0,color:!0,background:!0,class:!0,href:!0,style:!0,xmlns:!0},ze.BOLDVARIANTS={bold:{normal:"bold",italic:"bold-italic",fraktur:"bold-fraktur",script:"bold-script","sans-serif":"bold-sans-serif","sans-serif-italic":"sans-serif-bold-italic"},normal:{bold:"normal","bold-italic":"italic","bold-fraktur":"fraktur","bold-script":"script","bold-sans-serif":"sans-serif","sans-serif-bold-italic":"sans-serif-italic"}},ze.ITALICVARIANTS={italic:{normal:"italic",bold:"bold-italic","sans-serif":"sans-serif-italic","bold-sans-serif":"sans-serif-bold-italic"},normal:{italic:"normal","bold-italic":"bold","sans-serif-italic":"sans-serif","sans-serif-bold-italic":"bold-sans-serif"}};const Je=MathJax._.core.Tree.WrapperFactory.AbstractWrapperFactory;class Qe extends Je{constructor(){super(...arguments),this.jax=null}get Wrappers(){return this.node}}function Xe(t){return class extends t{computeBBox(t,e=!1){super.computeBBox(t,e),this.childNodes[0]&&this.childNodes[0].bbox.ic&&(t.ic=this.childNodes[0].bbox.ic)}}}function Ue(t){return class extends t{remappedText(t,e){const s=this.parent.stretch.c;return s?[s]:this.parent.remapChars(this.unicodeChars(t,e))}computeBBox(t,e=!1){const s=this.parent.variant,i=this.node.getText();if("-explicitFont"===s){const e=this.jax.getFontData(this.parent.styles),{w:n,h:o,d:r}=this.jax.measureText(i,s,e);t.h=o,t.d=r,t.w=n}else{const e=this.remappedText(i,s);let n="";t.empty();for(let i=0;i1&&(t.sk=0),t.clean()}}addUtextBBox(t,e,s){if(e){const{h:i,d:n,w:o}=this.jax.measureText(e,s);this.updateBBox(t,i,n,o)}return""}updateBBox(t,e,s,i){t.w+=i,e>t.h&&(t.h=e),s>t.d&&(t.d=s)}getStyles(){}getVariant(){}getScale(){}getSpace(){}}}function Ke(t){class e extends t{constructor(t,e,s=null){super(t,e,s),this.rscale=this.getRScale()}computeBBox(t,e=!1){const s=this.node.getXML(),i=this.getHDW(s,"use","force"),{h:n,d:o,w:r}=i?this.splitHDW(i):this.measureXmlNode(s);t.w=r,t.h=n,t.d=o}getHTML(){let t=this.adaptor.clone(this.node.getXML());const e=this.getFontStyles();return(this.getHDW(t,"force")||1!==this.jax.options.scale)&&(t=this.addHDW(t,e)),this.html("mjx-html",{variant:this.parent.variant,style:e},[t])}getHDW(t,e,s=e){const i=this.jax.options.htmlHDW,n=this.adaptor.getAttribute(t,"data-mjx-hdw");return!n||i!==e&&i!==s?null:n}splitHDW(t){const e=1/this.metrics.scale,[s,i,n]=Re(t).map((t=>this.length2em(t||"0")*e));return{h:s,d:i,w:n}}getFontStyles(){var t;const e=this.adaptor,s=this.metrics;return{"font-family":(null===(t=this.parent.styles)||void 0===t?void 0:t.get("font-family"))||s.family||e.fontFamily(e.parent(this.jax.math.start.node))||"initial","font-size":this.jax.fixed(s.em*this.rscale)+"px"}}measureXmlNode(t){const e=this.adaptor,s=this.html("mjx-xml-block",{style:{display:"inline-block"}},[e.clone(t)]),i=this.html("mjx-baseline",{style:{display:"inline-block",width:0,height:0}}),n=this.getFontStyles(),o=this.html("mjx-measure-xml",{style:n},[i,s]),r=this.jax.container;e.append(e.parent(this.jax.math.start.node),r),e.append(r,o);const a=this.metrics,h=a.em*a.scale*this.rscale,{left:d,right:l,bottom:c,top:u}=e.nodeBBox(s),p=(l-d)/h,m=(e.nodeBBox(i).top-u)/h,g=(c-u)/h-m;return e.remove(r),e.remove(o),{w:p,h:m,d:g}}getStyles(){}getScale(){}getVariant(){}}return e.autoStyle=!1,e.styles={"mjx-measure-xml":{position:"absolute",left:0,top:0,display:"inline-block","line-height":"normal","white-space":"normal"},"mjx-html":{display:"inline-block","line-height":"normal","text-align":"initial","white-space":"initial"},"mjx-html-holder":{display:"block",position:"absolute",top:0,left:0,bottom:0,right:0}},e}Qe.defaultNodes={};const qe={dx:".2em",dy:".1em",postDelay:600,clearDelay:100,hoverTimer:new Map,clearTimer:new Map,stopTimers:(t,e)=>{e.clearTimer.has(t)&&(clearTimeout(e.clearTimer.get(t)),e.clearTimer.delete(t)),e.hoverTimer.has(t)&&(clearTimeout(e.hoverTimer.get(t)),e.hoverTimer.delete(t))}};function $e(t){return class extends t{get selected(){const t=this.node.attributes.get("selection"),e=Math.max(1,Math.min(this.childNodes.length,t))-1;return this.childNodes[e]||this.wrap(this.node.selected)}getParameters(){const t=this.node.attributes.get("data-offsets"),[e,s]=Re(t||"");this.tipDx=this.length2em(e||qe.dx),this.tipDy=this.length2em(s||qe.dy)}constructor(t,e,s=null){super(t,e,s);const i=this.constructor.actions,n=this.node.attributes.get("actiontype"),[o,r]=i.get(n)||[(t,e)=>{},{}];this.action=o,this.data=r,this.getParameters()}computeBBox(t,e=!1){t.updateFrom(this.selected.getOuterBBox()),this.selected.setChildPWidths(e)}get breakCount(){return this.node.isEmbellished?this.selected.coreMO().embellishedBreakCount:this.selected.breakCount}computeLineBBox(t){return this.getChildLineBBox(this.selected,t)}}}function Ye(t){return class extends t{getWrapWidth(t){return this.parent?this.getBBox().w:this.metrics.containerWidth/this.jax.pxPerEm}computeBBox(t,e=!1){super.computeBBox(t,e);const s=this.node.attributes;if(!this.parent&&this.jax.math.display&&"linebreak"===s.get("overflow")){const e=this.containerWidth;t.w>e&&this.childNodes[0].breakToWidth(e),t.updateFrom(this.childNodes[0].getBBox())}}}}function Ze(t){return class extends t{getParameters(){const t=this.node.attributes,e=t.get("data-padding");void 0!==e&&(this.padding=this.length2em(e,xe));const s=t.get("data-thickness");void 0!==s&&(this.thickness=this.length2em(s,fe));const i=t.get("data-arrowhead");if(void 0!==i){const[t,e,s]=Re(i);this.arrowhead={x:t?parseFloat(t):pe,y:e?parseFloat(e):ge,dx:s?parseFloat(s):me}}}getNotations(){const t=this.constructor.notations;for(const e of Re(this.node.attributes.get("notation"))){const s=t.get(e);s&&(this.notations[e]=s,s.renderChild&&(this.renderChild=s.renderer))}}removeRedundantNotations(){for(const t of Object.keys(this.notations))if(this.notations[t]){const e=this.notations[t].remove||"";for(const t of e.split(/ /))delete this.notations[t]}}initializeNotations(){for(const t of Object.keys(this.notations)){const e=this.notations[t].init;e&&e(this)}}getBBoxExtenders(){const t=[0,0,0,0];for(const e of Object.keys(this.notations))this.maximizeEntries(t,this.notations[e].bbox(this));return t}getPadding(){const t=[0,0,0,0];for(const e of Object.keys(this.notations)){const s=this.notations[e].border;s&&this.maximizeEntries(t,s(this))}return[0,1,2,3].map((e=>this.TRBL[e]-t[e]))}maximizeEntries(t,e){for(let s=0;s.001?o:0}getArgMod(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}arrow(t,e,s,i="",n=0){return null}arrowData(){const[t,e]=[this.padding,this.thickness],s=e*(this.arrowhead.x+Math.max(1,this.arrowhead.dx)),{h:i,d:n,w:o}=this.childNodes[0].getBBox(),r=i+n,a=Math.sqrt(r*r+o*o),h=Math.max(t,s*o/a),d=Math.max(t,s*r/a),[l,c]=this.getArgMod(o+2*h,r+2*d);return{a:l,W:c,x:h,y:d}}arrowAW(){const{h:t,d:e,w:s}=this.childNodes[0].getBBox(),[i,n,o,r]=this.TRBL;return this.getArgMod(r+s+n,i+t+e+o)}createMsqrt(t){const e=this.node.factory.create("msqrt");e.inheritAttributesFrom(this.node),e.childNodes[0]=t.node;const s=this.wrap(e);return s.parent=this,s}sqrtTRBL(){const t=this.msqrt.getBBox(),e=this.msqrt.childNodes[0].getBBox();return[t.h-e.h,0,t.d-e.d,t.w-e.w]}constructor(t,e,s=null){super(t,e,s),this.notations={},this.renderChild=null,this.msqrt=null,this.padding=xe,this.thickness=fe,this.arrowhead={x:pe,y:ge,dx:me},this.TRBL=[0,0,0,0],this.getParameters(),this.getNotations(),this.removeRedundantNotations(),this.initializeNotations(),this.TRBL=this.getBBoxExtenders()}computeBBox(t,e=!1){const[s,i,n,o]=this.TRBL,r=this.childNodes[0].getBBox();t.combine(r,o,0),t.h+=s,t.d+=n,t.w+=i,this.setChildPWidths(e)}}}function ts(t){return class extends t{createMrow(){const t=this.node.factory.create("inferredMrow");t.inheritAttributesFrom(this.node),this.mrow=this.wrap(t),this.mrow.parent=this}addMrowChildren(){const t=this.node,e=this.mrow;this.addMo(t.open),this.childNodes.length&&e.childNodes.push(this.childNodes[0]);let s=0;for(const i of this.childNodes.slice(1))this.addMo(t.separators[s++]),e.childNodes.push(i);this.addMo(t.close),e.stretchChildren()}addMo(t){if(!t)return;const e=this.wrap(t);this.mrow.childNodes.push(e),e.parent=this.mrow}constructor(t,e,s=null){super(t,e,s),this.mrow=null,this.createMrow(),this.addMrowChildren()}computeBBox(t,e=!1){t.updateFrom(this.mrow.getOuterBBox()),this.setChildPWidths(e)}get breakCount(){return this.mrow.breakCount}computeLineBBox(t){return this.mrow.getLineBBox(t)}}}function es(t){return class extends t{getFractionBBox(t,e,s){const i=this.childNodes[0].getOuterBBox(),n=this.childNodes[1].getOuterBBox(),o=this.font.params.axis_height,{T:r,u:a,v:h}=this.getTUV(e,s);t.combine(i,0,o+r+Math.max(i.d*i.rscale,a)),t.combine(n,0,o-r-Math.max(n.h*n.rscale,h)),t.w+=2*this.pad+.2}getTUV(t,e){const s=this.font.params,i=s.axis_height,n=(t?3.5:1.5)*e;return{T:(t?3.5:1.5)*e,u:(t?s.num1:s.num2)-i-n,v:(t?s.denom1:s.denom2)+i-n}}getAtopBBox(t,e){const{u:s,v:i,nbox:n,dbox:o}=this.getUVQ(e);t.combine(n,0,s),t.combine(o,0,-i),t.w+=2*this.pad}getUVQ(t){const e=this.childNodes[0].getOuterBBox(),s=this.childNodes[1].getOuterBBox(),i=this.font.params;let[n,o]=t?[i.num1,i.denom1]:[i.num3,i.denom2];const r=(t?7:3)*i.rule_thickness;let a=n-e.d*e.scale-(s.h*s.scale-o);return ae.length&&e.push(Ut.empty())}combineBBoxLists(t,e,s,i){for(let n=0;nt.h&&(t.h=r),a>t.d&&(t.d=a),d>e.h&&(e.h=d),l>e.d&&(e.d=l)}}getScaledWHD(t){const{w:e,h:s,d:i,rscale:n}=t;return[e*n,s*n,i*n]}getCombinedUV(){const t=this.scriptData,e=this.combinePrePost(t.sub,t.psub),s=this.combinePrePost(t.sup,t.psup);return this.getUVQ(e,s)}addPrescripts(t,e,s){const i=this.scriptData;if(i.numPrescripts){const n=this.font.params.scriptspace;t.combine(i.psup,n,e),t.combine(i.psub,n,s)}return t}addPostscripts(t,e,s){const i=this.scriptData;if(i.numScripts){const n=t.w;t.combine(i.sup,n,e),t.combine(i.sub,n,s),t.w+=this.font.params.scriptspace}return t}constructor(...t){super(...t),this.scriptData=null,this.firstPrescript=0,this.getScriptData()}appendScripts(t){t.empty();const[e,s]=this.getCombinedUV();return this.addPrescripts(t,e,s),t.append(this.scriptData.base),this.addPostscripts(t,e,s),t.clean(),t}computeLineBBox(t){const e=this.baseChild.breakCount,s=this.baseChild.getLineBBox(t).copy();let i=s;const[n,o]=this.getCombinedUV();return 0===t?(i=Kt.from(this.addPrescripts(Ut.zero(),n,o),this.linebreakOptions.lineleading),i.append(s),this.addLeftBorders(i),i.L=this.bbox.L):t===e&&(i=this.addPostscripts(i,n,o),this.addRightBorders(i),i.R=this.bbox.R),this.addMiddleBorders(i),i}getUVQ(t,e){if(!this.UVQ){let[s,i,n]=[0,0,0];0===t.w?s=this.getU():0===e.w?s=-this.getV():[s,i,n]=super.getUVQ(t,e),this.UVQ=[s,i,n]}return this.UVQ}}}function as(t){return class extends t{remapChars(t){if(t.length){const e=this.font.getRemappedChar("mn",t[0]);if(e){const s=this.unicodeChars(e,this.variant);1===s.length?t[0]=s[0]:t=s.concat(t.slice(1))}}return t}}}function hs(t){return class extends t{get breakCount(){return this.breakStyle?1:0}get embellishedBreakCount(){return this.embellishedBreakStyle?1:0}get embellishedBreakStyle(){return this.breakStyle||this.getBreakStyle()}protoBBox(t){const e=this.stretch.dir!==Ft.None;e&&null===this.size&&this.getStretchedVariant([0]),e&&this.size<0||(super.computeBBox(t),0!==t.w||!this.node.attributes.hasExplicit("fence")||""!==this.node.getText()||this.node.texClass!==Mt.OPEN&&this.node.texClass!==Mt.CLOSE||this.jax.options.mathmlSpacing||(t.R=this.font.params.nulldelimiterspace),this.copySkewIC(t))}getAccentOffset(){const t=Ut.empty();return this.protoBBox(t),-t.w/2}getCenterOffset(t=null){return t||(t=Ut.empty(),super.computeBBox(t)),(t.h+t.d)/2+this.font.params.axis_height-t.h}getStretchedVariant(t,e=!1){if(this.stretch.dir!==Ft.None){let s=this.getWH(t);const i=this.getSize("minsize",0),n=this.getSize("maxsize",1/0),o=this.node.getProperty("mathaccent");s=Math.max(i,Math.min(n,s));const r=this.font.params.delimiterfactor/1e3,a=this.font.params.delimitershortfall,h=i||e?s:o?Math.min(s/r,s+a):Math.max(s*r,s-a),d=this.stretch,l=d.c||this.getText().codePointAt(0);let c=0;if(d.sizes)for(const t of d.sizes){if(t>=h)return o&&c&&c--,void this.setDelimSize(l,c);c++}d.stretch?(this.size=-1,this.invalidateBBox(),this.getStretchBBox(t,this.checkExtendedHeight(s,d),d)):this.setDelimSize(l,c-1)}}setDelimSize(t,e){const s=this.stretch;this.variant=this.font.getSizeVariant(t,e),this.size=e;const i=s.schar&&s.schar[Math.min(e,s.schar.length-1)]||t;this.stretch=Object.assign(Object.assign({},s),{c:i}),this.childNodes[0].invalidateBBox()}getSize(t,e){const s=this.node.attributes;return s.isSet(t)&&(e=this.length2em(s.get(t),1,1)),e}getWH(t){if(0===t.length)return 0;if(1===t.length)return t[0];const[e,s]=t,i=this.font.params.axis_height;return this.node.attributes.get("symmetric")?2*Math.max(e-i,s+i):e+s}getStretchBBox(t,e,s){Object.hasOwn(s,"min")&&s.min>e&&(e=s.min);let[i,n,o]=s.HDW;if(this.stretch.dir===Ft.Vertical)[i,n]=this.getBaseline(t,e,s);else if(o=e,this.stretch.hd&&!this.jax.options.mathmlSpacing){const t=this.font.params.extender_factor;i=i*(1-t)+this.stretch.hd[0]*t,n=n*(1-t)+this.stretch.hd[1]*t}this.bbox.h=i,this.bbox.d=n,this.bbox.w=o}getBaseline(t,e,s){const i=2===t.length&&t[0]+t[1]===e,n=this.node.attributes.get("symmetric"),[o,r]=i?t:[e,0];let[a,h]=[o+r,0];if(n){const t=this.font.params.axis_height;i&&(a=2*Math.max(o-t,r+t)),h=a/2-t}else if(i)h=r;else{const[t,e]=s.HDW||[.75,.25];h=e*(a/(t+e))}return[a-h,h]}checkExtendedHeight(t,e){if(e.fullExt){const[s,i]=e.fullExt;t=i+Math.ceil(Math.max(0,t-i)/s)*s}return t}setBreakStyle(t=""){if(this.breakStyle=this.node.parent.isEmbellished&&!t?"":this.getBreakStyle(t),this.breakCount&&this.multChar){const t=this.parent.node.childIndex(this.node),e=this.parent.node.childNodes[t+1];e&&e.setTeXclass(this.multChar.node)}}getBreakStyle(t=""){const e=this.node.attributes;let s=t||("newline"===e.get("linebreak")||this.node.getProperty("forcebreak")?e.get("linebreakstyle"):"");return"infixlinebreakstyle"===s&&(s=e.get(s)),s}getMultChar(){const t=this.node.attributes.get("linebreakmultchar");t&&"\u2062"===this.getText()&&"\u2062"!==t&&(this.multChar=this.createMo(t))}constructor(t,e,s=null){super(t,e,s),this.size=null,this.isAccent=this.node.isAccent,this.getMultChar(),this.setBreakStyle()}computeBBox(t,e=!1){if(this.protoBBox(t),this.node.attributes.get("symmetric")&&this.stretch.dir!==Ft.Horizontal){const e=this.getCenterOffset(t);t.h+=e,t.d-=e}this.node.getProperty("mathaccent")&&(this.stretch.dir===Ft.None||this.size>=0)&&(t.w=0)}computeLineBBox(t){return this.moLineBBox(t,this.breakStyle)}moLineBBox(t,e,s=null){const i=this.node.attributes.get("lineleading"),n=this.length2em(i,this.linebreakOptions.lineleading);if(0===t&&"before"===e){const t=Kt.from(Ut.zero(),n);return t.originalL=this.bbox.L,this.bbox.L=0,t}let o=Kt.from(s||this.getOuterBBox(),n);return 1===t&&("after"===e?(o.w=o.h=o.d=0,o.isFirst=!0,this.bbox.R=0):"duplicate"===e?o.L=0:this.multChar&&(o=Kt.from(this.multChar.getOuterBBox(),n)),o.getIndentData(this.node)),o}canStretch(t){if(this.stretch.dir!==Ft.None)return this.stretch.dir===t;if(!this.node.attributes.get("stretchy"))return!1;const e=this.getText();if(1!==Array.from(e).length)return!1;const s=this.font.getDelimiter(e.codePointAt(0));return this.stretch=s&&s.dir===t?s:zt,this.stretch.dir!==Ft.None}getVariant(){this.node.attributes.get("largeop")?this.variant=this.node.attributes.get("displaystyle")?"-largeop":"-smallop":this.node.attributes.hasExplicit("mathvariant")||!1!==this.node.getProperty("pseudoscript")?super.getVariant():this.variant="-tex-variant"}remapChars(t){const e=this.node.getProperty("primes");if(e)return Pe(e);if(1===t.length){const e=this.node.coreParent().parent,s=this.isAccent&&!e.isKind("mrow")?"accent":"mo",i=this.font.getRemappedChar(s,t[0]);i&&(t=this.unicodeChars(i,this.variant))}return t}}}function ds(t){return class extends t{getDimens(){const t=this.node.attributes.getList("width","height","depth","lspace","voffset"),e=this.childNodes[0].getOuterBBox();let{w:s,h:i,d:n}=e;const o=s,r=i,a=n;let h=0,d=0,l=0;""!==t.width&&(s=this.dimen(t.width,e,"w",0)),""!==t.height&&(i=this.dimen(t.height,e,"h",0)),""!==t.depth&&(n=this.dimen(t.depth,e,"d",0)),""!==t.voffset&&(d=this.dimen(t.voffset,e)),""!==t.lspace&&(h=this.dimen(t.lspace,e));const c=this.node.attributes.get("data-align");return c&&(l=this.getAlignX(s,e,c)),[r,a,o,i-r,n-a,s-o,h,d,l]}dimen(t,e,s="",i=null){const n=(t=String(t)).match(/width|height|depth/),o=n?e[n[0].charAt(0)]:s?e[s]:0;let r=this.length2em(t,o)||0;return t.match(/^[-+]/)&&s&&(r+=o),null!=i&&(r=Math.max(i,r)),r}setBBoxDimens(t){const[e,s,i,n,o,r]=this.getDimens();t.w=i+r,t.h=e+n,t.d=s+o}computeBBox(t,e=!1){this.setBBoxDimens(t);if(this.childNodes[0].getOuterBBox().w>t.w){const e=this.node.attributes.get("data-overflow");("linebreak"===e||"auto"===e&&"linebreak"===this.jax.math.root.attributes.get("overflow"))&&(this.childNodes[0].breakToWidth(t.w),this.setBBoxDimens(t))}this.setChildPWidths(e,t.w)}getWrapWidth(t){return this.getBBox().w}getChildAlign(t){return this.node.attributes.get("data-align")||"left"}}}function ls(t){return class extends t{get root(){return 1}combineRootBBox(t,e,s){const i=this.childNodes[this.root].getOuterBBox(),n=this.getRootDimens(e,s)[1];t.combine(i,0,n)}getRootDimens(t,e){const s=this.surd,i=this.childNodes[this.root].getOuterBBox(),n=(s.size<0?.5:.6)*t.w,{w:o,rscale:r}=i,a=Math.max(o,n/r),h=Math.max(0,a-o);return[a*r-n,this.rootHeight(i,t,s.size,e),h]}rootHeight(t,e,s,i){const n=e.h+e.d;return(s<0?1.9:.55*n)-(n-i)+Math.max(0,t.d*t.rscale)}rootWidth(){const t=this.childNodes[this.root].getOuterBBox();return.4+t.w*t.rscale}}}function cs(t){return class extends t{stretchChildren(){const t=[];for(const e of this.childNodes)e.canStretch(Ft.Vertical)&&t.push(e);const e=t.length,s=this.childNodes.length;if(e&&s>1){let i=0,n=0;const o=e>1&&e===s;for(const t of this.childNodes){const e=t.stretch.dir===Ft.None;if(o||e){const e=t.getBBox().rscale;let[s,o]=t.getUnbrokenHD();s*=e,o*=e,s>i&&(i=s),o>n&&(n=o)}}for(const e of t){const t=e.coreRScale();e.coreMO().getStretchedVariant([i/t,n/t])}}}get fixesPWidth(){return!1}get breakCount(){return this._breakCount<0&&(this._breakCount=this.childNodes.length?this.childNodes.reduce(((t,e)=>t+e.breakCount),0):0),this._breakCount}breakTop(t,e){const s=this;return this.isStack?this.parent.breakTop(s,s):s}constructor(t,e,s=null){super(t,e,s),this.dh=0;const i=this;this.isStack=!this.parent||this.parent.node.isInferred||this.parent.breakTop(i,i)!==i,this.stretchChildren();for(const t of this.childNodes)if(t.bbox.pwidth){this.bbox.pwidth=Ut.fullWidth;break}}computeBBox(t,e=!1){const s=this.breakCount;this.lineBBox=s?[new Kt({h:.75,d:.25,w:0},[0,0])]:[],t.empty();for(const e of this.childNodes.keys()){const i=this.childNodes[e];t.append(i.getOuterBBox()),s&&this.computeChildLineBBox(i,e)}t.clean(),s&&!this.coreMO().node.isEmbellished&&this.computeLinebreakBBox(t),this.fixesPWidth&&this.setChildPWidths(e)&&this.computeBBox(t,!0),this.vboxAdjust(t)}computeLinebreakBBox(t){var e;t.empty();const s=this.isStack,i=this.lineBBox,n=i.length-1;if(s)for(const t of i.keys()){const e=i[t];this.addMiddleBorders(e),0===t&&this.addLeftBorders(e),t===n&&this.addRightBorders(e)}let o=0;for(const s of i.keys()){const n=i[s];t.combine(n,0,o),o-=Math.max(.25,n.d)+n.lineLeading+Math.max(.75,(null===(e=i[s+1])||void 0===e?void 0:e.h)||0)}s?(i[0].L=this.bbox.L,i[n].R=this.bbox.R):(t.w=Math.max(...this.lineBBox.map((t=>t.w))),this.shiftLines(t.w),this.jax.math.display||this.linebreakOptions.inline||(t.pwidth=Ut.fullWidth,this.node.isInferred&&(this.parent.bbox.pwidth=Ut.fullWidth))),t.clean()}vboxAdjust(t){if(!this.parent)return;const e=this.breakCount,s=this.parent.node.attributes.get("data-vertical-align");if(e&&"bottom"===s)this.dh=e?t.d-this.lineBBox[e-1].d:0;else{if(!("center"===s||e&&"middle"===s))return void(this.dh=0);{const{h:e,d:s}=t,i=this.font.params.axis_height;this.dh=(e+s)/2+i-e}}t.h+=this.dh,t.d-=this.dh}computeChildLineBBox(t,e){const s=this.lineBBox[this.lineBBox.length-1];s.end=[e,0],s.append(t.getLineBBox(0));const i=t.breakCount+1;if(1!==i)for(let s=1;sthis.surdH?(t.h+t.d-(this.surdH-e-s-i/2))/2:s+i/4]}getRootDimens(t,e){return[0,0,0,0]}rootWidth(){return 1.25}getStretchedSurd(){const t=this.font.params.rule_thickness,e=this.font.params.surd_height,s=this.node.attributes.get("displaystyle")?this.font.params.x_height:t,{h:i,d:n}=this.childNodes[this.base].getOuterBBox();this.surdH=i+n+t+e+s/4,this.surd.getStretchedVariant([this.surdH-n,n],!0)}constructor(t,e,s=null){super(t,e,s),this.surd=this.createMo("\u221a"),this.surd.canStretch(Ft.Vertical),this.getStretchedSurd()}computeBBox(t,e=!1){t.empty();const s=this.surd.getBBox(),i=new Ut(this.childNodes[this.base].getOuterBBox()),n=this.getPQ(s)[1],o=this.font.params.rule_thickness,r=this.font.params.surd_height,a=i.h+n+o,[h]=this.getRootDimens(s,a);t.h=a+r,this.combineRootBBox(t,s,a),t.combine(s,h,a-s.h),t.combine(i,h+s.w,0),t.clean(),this.setChildPWidths(e)}invalidateBBox(){super.invalidateBBox(),this.surd.childNodes[0].invalidateBBox()}}}function fs(t){var e;return(e=class extends t{get scriptChild(){return this.childNodes[this.node.sub]}getOffset(){return[this.baseIsChar?0:this.getAdjustedIc(),-this.getV()]}}).useIC=!1,e}function xs(t){return class extends t{get scriptChild(){return this.childNodes[this.node.sup]}getOffset(){return[this.getAdjustedIc()-(this.baseRemoveIc?0:this.baseIc),this.getU()]}}}function bs(t){var e;return e=class extends t{constructor(){super(...arguments),this.UVQ=null}get subChild(){return this.childNodes[this.node.sub]}get supChild(){return this.childNodes[this.node.sup]}get scriptChild(){return this.supChild}getUVQ(t=this.subChild.getOuterBBox(),e=this.supChild.getOuterBBox()){const s=this.baseCore,i=s.getLineBBox(s.breakCount);if(this.UVQ)return this.UVQ;const n=this.font.params,o=3*n.rule_thickness,r=this.length2em(this.node.attributes.get("subscriptshift"),n.sub2),a=this.baseCharZero(i.d*this.baseScale+n.sub_drop*t.rscale),h=e.d*e.rscale,d=t.h*t.rscale;let[l,c]=[this.getU(),Math.max(a,r)],u=l-h-(d-c);if(u0&&(l+=t,c-=t)}return l=Math.max(this.length2em(this.node.attributes.get("superscriptshift"),l),l),c=Math.max(this.length2em(this.node.attributes.get("subscriptshift"),c),c),u=l-h-(d-c),this.UVQ=[l,-c,u],this.UVQ}appendScripts(t){const[e,s]=[this.subChild.getOuterBBox(),this.supChild.getOuterBBox()],i=this.getBaseWidth(),n=this.getAdjustedIc(),[o,r]=this.getUVQ(),a=t.d-this.baseChild.getLineBBox(this.baseChild.breakCount).d;return t.combine(e,i+(this.baseIsChar?0:n),r-a),t.combine(s,i+n,o-a),t.w+=this.font.params.scriptspace,t}},e.useIC=!1,e}const As=MathJax._.util.numeric,Bs=As.sum,ys=As.max,vs=.333;function ks(t){return class extends t{get tableRows(){return this.childNodes}findContainer(){let t=this,e=t.parent;for(;e&&(e.node.notParent||e.node.isKind("mrow"));)t=e,e=e.parent;this.container=e,this.containerI=t.node.childPosition()}getPercentageWidth(){if(this.hasLabels)this.bbox.pwidth=Ut.fullWidth;else{const t=this.node.attributes.get("width");Ie(t)&&(this.bbox.pwidth=t)}}stretchRows(){const t=this.node.attributes.get("equalrows"),e=t?this.getEqualRowHeight():0,{H:s,D:i}=t?this.getTableData():{H:[0],D:[0]},n=this.tableRows;for(let o=0;o1&&null===e){e=0;const s=i>1&&i===n;for(const i of this.tableRows){const n=i.getChild(t);if(n){const t=n.childNodes[0],i=t.stretch.dir===Ft.None;if(s||i){const{w:s}=t.getBBox(i);s>e&&(e=s)}}}}if(null!==e)for(const t of s)t.coreMO().getStretchedVariant([Math.max(e,t.getBBox().w)/t.coreRScale()])}breakColumn(t,e,s){if("linebreak"!==this.jax.math.root.attributes.get("overflow")||!this.jax.math.display)return;const{D:i}=this.getTableData();let n=0,o=0;for(const s of this.tableRows){const r=s.getChild(t);if(r&&r.getBBox().w>e){r.childNodes[0].breakToWidth(e);const t=r.getBBox();i[n]=Math.max(i[n],t.d),t.w>o&&(o=t.w)}n++}("fit"===s||"auto"===s||Ie(s)||o>this.cWidths[t])&&(this.cWidths[t]=o)}getTableData(){if(this.data)return this.data;const t=new Array(this.numRows).fill(0),e=new Array(this.numRows).fill(0),s=new Array(this.numCols).fill(0),i=new Array(this.numRows),n=new Array(this.numRows),o=[0],r=this.tableRows;for(let a=0;an[s]&&(n[s]=h),d>o[s]&&(o[s]=d),u>a&&(a=u),r&&l>r[e]&&(r[e]=l),a}extendHD(t,e,s,i){const n=(i-(e[t]+s[t]))/2;n<1e-5||(e[t]+=n,s[t]+=n)}recordPWidthCell(t,e){t.childNodes[0]&&t.childNodes[0].getBBox().pwidth&&this.pwidthCells.push([t,e])}setColumnPWidths(){const t=this.cWidths;for(const[e,s]of this.pwidthCells)e.setChildPWidths(!1,t[s])&&(e.invalidateBBox(),e.getBBox())}getBBoxHD(t){const[e,s]=this.getAlignmentRow();if(null===s){const s=this.font.params.axis_height,i=t/2;return{top:[0,t],center:[i,i],bottom:[t,0],baseline:[i,i],axis:[i+s,i-s]}[e]||[i,i]}{const i=this.getVerticalPosition(s,e);return[i,t-i]}}getBBoxLR(){var t;if(this.hasLabels){const t=this.node.attributes,e=t.get("side");let[s,i]=this.getPadAlignShift(e);const n=this.hasLabels&&!!t.get("data-width-includes-label");return n&&this.frame&&this.fSpace[0]&&(s-=this.fSpace[0]),"center"!==i||n?"left"===e?[s,0]:[0,s]:[s,s]}return[(null===(t=this.bbox)||void 0===t?void 0:t.L)||0,0]}getPadAlignShift(t){const{L:e}=this.getTableData();let s=e+this.length2em(this.node.attributes.get("minlabelspacing"));const[i,n]=null==this.styles?["",""]:[this.styles.get("padding-left"),this.styles.get("padding-right")];(i||n)&&(s=Math.max(s,this.length2em(i||"0"),this.length2em(n||"0")));let[o,r]=this.getAlignShift();return o===t&&(r="left"===t?Math.max(s,r)-s:Math.min(-s,r)+s),[s,o,r]}getWidth(){return this.pWidth||this.getBBox().w}adjustWideTable(){const t=this.node.attributes;if("auto"!==t.get("width"))return;const[e,s]=this.getPadAlignShift(t.get("side")),i=Math.max(this.containerWidth/10,this.containerWidth-e-("center"===s?e:0));this.naturalWidth()>i&&this.adjustColumnWidths(i)}naturalWidth(){const t=this.getComputedWidths();return Bs(t.concat(this.cLines,this.cSpace))+2*this.fLine+this.fSpace[0]+this.fSpace[2]}getEqualRowHeight(){const{H:t,D:e}=this.getTableData(),s=Array.from(t.keys()).map((s=>t[s]+e[s]));return Math.max(...s)}getComputedWidths(){const t=this.getTableData().W;let e=Array.from(t.keys()).map((e=>"number"==typeof this.cWidths[e]?this.cWidths[e]:t[e]));return this.node.attributes.get("equalcolumns")&&(e=Array(e.length).fill(ys(e))),e}getColumnWidths(){const t=this.node.attributes.get("width");if(this.node.attributes.get("equalcolumns"))return this.getEqualColumns(t);const e=this.getColumnAttributes("columnwidth",0);return"auto"===t?this.getColumnWidthsAuto(e):Ie(t)?this.getColumnWidthsPercent(e):this.getColumnWidthsFixed(e,this.length2em(t))}getEqualColumns(t){const e=Math.max(1,this.numCols);let s;if("auto"===t){const{W:t}=this.getTableData();s=ys(t)}else if(Ie(t))s=this.percent(1/e);else{const i=Bs([].concat(this.cLines,this.cSpace))+this.fSpace[0]+this.fSpace[2];s=Math.max(0,this.length2em(t)-i)/e}return Array(this.numCols).fill(s)}getColumnWidthsAuto(t){return t.map((t=>"auto"===t||"fit"===t?null:Ie(t)?t:this.length2em(t)))}getColumnWidthsPercent(t){const e=t.includes("fit"),{W:s}=e?this.getTableData():{W:null};return Array.from(t.keys()).map((i=>{const n=t[i];return"fit"===n?null:"auto"===n?e?s[i]:null:Ie(n)?n:this.length2em(n)}))}getColumnWidthsFixed(t,e){const s=Array.from(t.keys()),i=s.filter((e=>"fit"===t[e])),n=s.filter((e=>"auto"===t[e])),o=i.length||n.length,{W:r}=o?this.getTableData():{W:null},a=e-Bs([].concat(this.cLines,this.cSpace))-this.fSpace[0]-this.fSpace[2];let h=a;s.forEach((e=>{const s=t[e];h-="fit"===s||"auto"===s?r[e]:this.length2em(s,a)}));const d=o&&h>0?h/o:0;return s.map((e=>{const s=t[e];return"fit"===s?r[e]+d:"auto"===s?r[e]+(0===i.length?d:0):this.length2em(s,a)}))}adjustColumnWidths(t){const{W:e}=this.getTableData(),s=this.getColumnAttributes("columnwidth",0),i=Array.from(s.keys()),n=[...i.filter((t=>"fit"===s[t])).sort(((t,s)=>e[s]-e[t])),...i.filter((t=>"auto"===s[t])).sort(((t,s)=>e[s]-e[t])),...i.filter((t=>Ie(s[t]))).sort(((t,s)=>e[s]-e[t])),...i.filter((t=>"fit"!==s[t]&&"auto"!==s[t]&&!Ie(s[t]))).sort(((t,s)=>e[s]-e[t]))];if(!n.length)return;this.cWidths=i.map((t=>"number"==typeof this.cWidths[t]?this.cWidths[t]:e[t]));const o=t-Bs([].concat(this.cLines,this.cSpace))-this.fSpace[0]-this.fSpace[2];let r=Bs(this.cWidths)-o,a=0,h=0;for(;hthis.cWidths[t]*=r))}getVerticalPosition(t,e){const s=this.node.attributes.get("equalrows"),{H:i,D:n}=this.getTableData(),o=s?this.getEqualRowHeight():0,r=this.getRowHalfSpacing();let a=this.fLine;for(let e=0;et/2));return t.unshift(this.fSpace[1]),t.push(this.fSpace[1]),t}getColumnHalfSpacing(){const t=this.cSpace.map((t=>t/2));return t.unshift(this.fSpace[0]),t.push(this.fSpace[2]),t}getAlignmentRow(){const[t,e]=Re(this.node.attributes.get("align"));if(null==e)return[t,null];let s=parseInt(e);return s<0&&(s+=this.numRows+1),[t,s<1||s>this.numRows?null:s-1]}getColumnAttributes(t,e=1){const s=this.numCols-e,i=this.getAttributeArray(t);if(0===i.length)return null;for(;i.lengths&&i.splice(s),i}getRowAttributes(t,e=1){const s=this.numRows-e,i=this.getAttributeArray(t);if(0===i.length)return null;for(;i.lengths&&i.splice(s),i}getAttributeArray(t){const e=this.node.attributes.get(t);return e?Re(e):[this.node.attributes.getDefault(t)]}addEm(t,e=1){return t?t.map((t=>this.em(t/e))):null}convertLengths(t){return t?t.map((t=>this.length2em(t))):null}constructor(t,e,s=null){super(t,e,s),this.numCols=0,this.numRows=0,this.data=null,this.pwidthCells=[],this.pWidth=0,this.numCols=ys(this.tableRows.map((t=>t.numCells))),this.numRows=this.childNodes.length,this.hasLabels=this.childNodes.reduce(((t,e)=>t||e.node.isKind("mlabeledtr")),!1),this.findContainer(),this.isTop=!this.container||this.container.node.isKind("math")&&!this.container.parent,this.isTop&&(this.jax.table=this),this.getPercentageWidth();const i=this.node.attributes,n=i.get("frame");this.frame="none"!==n,this.fframe=this.frame||void 0!==i.get("data-frame-styles"),this.fLine=this.frame?.07:0,this.fSpace=this.getFrameSpacing(),this.cSpace=this.convertLengths(this.getColumnAttributes("columnspacing")),this.rSpace=this.convertLengths(this.getRowAttributes("rowspacing")),this.cLines=this.getColumnAttributes("columnlines").map((t=>"none"===t?0:.07)),this.rLines=this.getRowAttributes("rowlines").map((t=>"none"===t?0:.07)),this.cWidths=this.getColumnWidths(),this.adjustWideTable(),this.stretchColumns(),this.stretchRows()}getStyles(){super.getStyles();const t=this.node.attributes.get("data-frame-styles");if(!t)return;this.styles||(this.styles=new de(""));const e=t.split(/ /);for(const t of he.keys()){const s=e[t];"none"!==s&&this.styles.set(`border-${he[t]}`,`.07em ${s}`)}}computeBBox(t,e=!1){const{H:s,D:i}=this.getTableData();let n,o;if(this.node.attributes.get("equalrows")){const t=this.getEqualRowHeight();n=Bs([].concat(this.rLines,this.rSpace))+t*this.numRows}else n=Bs(s.concat(i,this.rLines,this.rSpace));n+=2*(this.fLine+this.fSpace[1]),o=this.naturalWidth();const r=this.node.attributes.get("width");"auto"!==r&&(o=Math.max(this.length2em(r,0)+2*this.fLine,o));const[a,h]=this.getBBoxHD(n);t.h=a,t.d=h,t.w=o;const[d,l]=this.getBBoxLR();t.L=d,t.R=l,Ie(r)||this.setColumnPWidths()}setChildPWidths(t,e,s){const i=this.node.attributes.get("width");if(!Ie(i))return!1;this.hasLabels||(this.bbox.pwidth="",this.container.bbox.pwidth="");const{w:n,L:o,R:r}=this.bbox,a=this.node.attributes.get("data-width-includes-label"),h=Math.max(n,this.length2em(i,Math.max(e,o+n+r)))-(a?o+r:0),d=this.node.attributes.get("equalcolumns")?Array(this.numCols).fill(this.percent(1/Math.max(1,this.numCols))):this.getColumnAttributes("columnwidth",0);return this.cWidths=this.getColumnWidthsFixed(d,h),this.pWidth=this.naturalWidth(),this.isTop&&(this.bbox.w=this.pWidth),this.setColumnPWidths(),this.pWidth!==n&&this.parent.invalidateBBox(),this.pWidth!==n}getAlignShift(){return this.isTop?super.getAlignShift():[this.container.getChildAlign(this.containerI),0]}}}function ws(t){return class extends t{get fixesPWidth(){return!1}invalidateBBox(){this.bboxComputed=!1,this.lineBBox=[]}getWrapWidth(t){const e=this.parent.parent,s=this.parent,i=this.node.childPosition()-(s.labeled?1:0);return"number"==typeof e.cWidths[i]?e.cWidths[i]:e.getTableData().W[i]}getChildAlign(t){return this.node.attributes.get("columnalign")}}}function Ss(t){var e;return e=class extends t{constructor(){super(...arguments),this.breakPoints=[]}textWidth(t){let e=this.textNode;if(!e){const t=this.node.factory.create("text");t.parent=this.node,e=this.textNode=this.factory.wrap(t),e.parent=this}return e.node.setText(t),e.invalidateBBox(!1),e.getBBox().w}get breakCount(){return this.breakPoints.length}getVariant(){const t=this.jax.options,e=this.jax.math.outputData,s=(!!e.merrorFamily||!!t.merrorFont)&&this.node.Parent.isKind("merror");if(e.mtextFamily||t.mtextFont||s){const i=this.node.attributes.get("mathvariant"),n=this.constructor.INHERITFONTS[i]||this.jax.font.getCssFont(i),o=n[0]||(s?e.merrorFamily||t.merrorFont:e.mtextFamily||t.mtextFont);this.variant=this.explicitVariant(o,n[2]?"bold":"",n[1]?"italic":"")}else super.getVariant()}setBreakAt(t){this.breakPoints.push(t)}clearBreakPoints(){this.breakPoints=[]}computeLineBBox(t){const e=Kt.from(this.getOuterBBox(),this.linebreakOptions.lineleading);return this.breakCount?(e.w=this.getBreakWidth(t),0===t?(e.R=0,this.addLeftBorders(e)):(e.L=0,e.indentData=[["left","0"],["left","0"],["left","0"]],t===this.breakCount&&this.addRightBorders(e)),e):e}getBreakWidth(t){const e=this.childNodes;let[s,i]=this.breakPoints[t-1]||[0,0];const[n,o]=this.breakPoints[t]||[e.length,0];let r=e[s].node.getText().split(/ /);if(s===n)return this.textWidth(r.slice(i,o).join(" "));let a=this.textWidth(r.slice(i).join(" "));for(;++st.getBBox()))}stretchChildren(t=null){const e=[],s=this.labeled?this.childNodes.slice(1):this.childNodes;for(const t of s){const s=t.childNodes[0];s.canStretch(Ft.Vertical)&&e.push(s)}const i=e.length,n=this.childNodes.length;if(i&&n>1&&!t){let e=0,o=0;const r=i>1&&i===n;for(const t of s){const s=t.childNodes[0],i=s.stretch.dir===Ft.None;if(r||i){const{h:t,d:n}=s.getBBox(i);t>e&&(e=t),n>o&&(o=n)}}t=[e,o]}if(t)for(const s of e){const e=s.coreRScale();s.coreMO().getStretchedVariant(t.map((t=>t*e)))}}get fixesPWidth(){return!1}}}function Ms(t){return class extends t{get numCells(){return Math.max(0,this.childNodes.length-1)}get labeled(){return!0}get tableCells(){return this.childNodes.slice(1)}getChild(t){return this.childNodes[t+1]}getChildBBoxes(){return this.childNodes.slice(1).map((t=>t.getBBox()))}}}function Ns(t){return class extends t{get scriptChild(){return this.childNodes[this.node.under]}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t,e=!1){if(this.hasMovableLimits())return void super.computeBBox(t,e);t.empty();const s=this.baseChild.getOuterBBox(),i=this.scriptChild.getOuterBBox(),n=this.getUnderKV(s,i)[1],o=this.isLineBelow?0:this.getDelta(this.scriptChild,!0),[r,a]=this.getDeltaW([s,i],[0,-o]);t.combine(s,r,0),t.combine(i,a,n),t.d+=this.font.params.big_op_spacing5,t.clean(),this.setChildPWidths(e)}}}function Ls(t){return class extends t{get scriptChild(){return this.childNodes[this.node.over]}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t){if(this.hasMovableLimits())return void super.computeBBox(t);t.empty();const e=this.baseChild.getOuterBBox(),s=this.scriptChild.getOuterBBox();this.node.attributes.get("accent")&&(e.h=Math.max(e.h,this.font.params.x_height*this.baseScale));const i=this.getOverKU(e,s)[1],n=this.isLineAbove?0:this.getDelta(this.scriptChild),[o,r]=this.getDeltaW([e,s],[0,n]);t.combine(e,o,0),t.combine(s,r,i),t.h+=this.font.params.big_op_spacing5,t.clean()}}}function Ds(t){return class extends t{get underChild(){return this.childNodes[this.node.under]}get overChild(){return this.childNodes[this.node.over]}get subChild(){return this.underChild}get supChild(){return this.overChild}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t){if(this.hasMovableLimits())return void super.computeBBox(t);t.empty();const e=this.overChild.getOuterBBox(),s=this.baseChild.getOuterBBox(),i=this.underChild.getOuterBBox();this.node.attributes.get("accent")&&(s.h=Math.max(s.h,this.font.params.x_height*this.baseScale));const n=this.getOverKU(s,e)[1],o=this.getUnderKV(s,i)[1],r=this.getDelta(this.overChild),a=this.getDelta(this.underChild,!0),[h,d,l]=this.getDeltaW([s,i,e],[0,this.isLineBelow?0:-a,this.isLineAbove?0:r]);t.combine(s,h,0),t.combine(e,l,n),t.combine(i,d,o);const c=this.font.params.big_op_spacing5;t.h+=c,t.d+=c,t.clean()}}}function Os(t){var e;return(e=class extends t{get baseChild(){return this.childNodes[this.node.base]}get scriptChild(){return this.childNodes[1]}getBaseCore(){let t=this.getSemanticBase()||this.childNodes[0],e=null==t?void 0:t.node;for(;t&&(1===t.childNodes.length&&(e.isKind("mrow")||e.isKind("TeXAtom")||e.isKind("mstyle")||e.isKind("mpadded")&&!e.getProperty("vbox")||e.isKind("mphantom")||e.isKind("semantics"))||e.isKind("munderover")&&t.isMathAccent);)this.setBaseAccentsFor(t),t=t.childNodes[0],e=null==t?void 0:t.node;return t||(this.baseHasAccentOver=this.baseHasAccentUnder=!1),t||this.childNodes[0]}setBaseAccentsFor(t){t.node.isKind("munderover")&&(null===this.baseHasAccentOver&&(this.baseHasAccentOver=!!t.node.attributes.get("accent")),null===this.baseHasAccentUnder&&(this.baseHasAccentUnder=!!t.node.attributes.get("accentunder")))}getSemanticBase(){const t=this.node.attributes.getExplicit("data-semantic-fencepointer");return this.getBaseFence(this.baseChild,t)}getBaseFence(t,e){if(!t||!t.node.attributes||!e)return null;if(t.node.attributes.getExplicit("data-semantic-id")===e)return t;for(const s of t.childNodes){const t=this.getBaseFence(s,e);if(t)return t}return null}getBaseScale(){let t=this.baseCore,e=1;for(;t&&t!==this;){e*=t.getOuterBBox().rscale,t=t.parent}return e}getBaseIc(){return this.baseCore.getOuterBBox().ic*this.baseScale}getAdjustedIc(){return this.baseIc?1.05*this.baseIc+.05:0}isCharBase(){const t=this.baseCore;return(t.node.isKind("mo")&&null===t.size||t.node.isKind("mi")||t.node.isKind("mn"))&&1===t.bbox.rscale&&1===Array.from(t.getText()).length}checkLineAccents(){if(this.node.isKind("munderover"))if(this.node.isKind("mover"))this.isLineAbove=this.isLineAccent(this.scriptChild);else if(this.node.isKind("munder"))this.isLineBelow=this.isLineAccent(this.scriptChild);else{const t=this;this.isLineAbove=this.isLineAccent(t.overChild),this.isLineBelow=this.isLineAccent(t.underChild)}}isLineAccent(t){const e=t.coreMO().node;return e.isToken&&"\u2015"===e.getText()}getBaseWidth(){const t=this.baseChild.getLineBBox(this.baseChild.breakCount);return t.w*t.rscale-(this.baseRemoveIc?this.baseIc:0)+this.font.params.extra_ic}getOffset(){return[0,0]}baseCharZero(t){const e=!!this.baseCore.node.attributes.get("largeop"),s=!(!this.baseCore.node.isKind("mo")||!this.baseCore.size),i=this.baseScale;return!this.baseIsChar||e||s||1!==i?t:0}getV(){const t=this.baseCore,e=t.getLineBBox(t.breakCount),s=this.scriptChild.getOuterBBox(),i=this.font.params,n=this.length2em(this.node.attributes.get("subscriptshift"),i.sub1);return Math.max(this.baseCharZero(e.d*this.baseScale+i.sub_drop*s.rscale),n,s.h*s.rscale-.8*i.x_height)}getU(){const t=this.baseCore,e=t.getLineBBox(t.breakCount),s=this.scriptChild.getOuterBBox(),i=this.font.params,n=this.node.attributes.getList("displaystyle","superscriptshift"),o=this.node.getProperty("texprimestyle")?i.sup3:n.displaystyle?i.sup1:i.sup2,r=this.length2em(n.superscriptshift,o);return Math.max(this.baseCharZero(e.h*this.baseScale-i.sup_drop*s.rscale),r,s.d*s.rscale+1/4*i.x_height)}hasMovableLimits(){const t=this.node.attributes.get("displaystyle"),e=this.baseChild.coreMO().node;return!t&&!!e.attributes.get("movablelimits")}getOverKU(t,e){const s=this.node.attributes.get("accent"),i=this.font.params,n=e.d*e.rscale,o=i.rule_thickness*i.separation_factor,r=this.baseHasAccentOver?o:0,a=this.isLineAbove?3*i.rule_thickness:o,h=(s?a:Math.max(i.big_op_spacing1,i.big_op_spacing3-Math.max(0,n)))-r;return[h,t.h*t.rscale+h+n]}getUnderKV(t,e){const s=this.node.attributes.get("accentunder"),i=this.font.params,n=e.h*e.rscale,o=i.rule_thickness*i.separation_factor,r=this.baseHasAccentUnder?o:0,a=this.isLineBelow?3*i.rule_thickness:o,h=(s?a:Math.max(i.big_op_spacing2,i.big_op_spacing4-n))-r;return[h,-(t.d*t.rscale+h+n)]}getDeltaW(t,e=[0,0,0]){const s=this.node.attributes.get("align"),i=t.map((t=>t.w*t.rscale));i[0]-=this.baseRemoveIc&&!this.baseCore.node.attributes.get("largeop")?this.baseIc:0;const n=Math.max(...i),o=[];let r=0;for(const t of i.keys())o[t]=("center"===s?(n-i[t])/2:"right"===s?n-i[t]:0)+e[t],o[t]o[e]+=t[e]?t[e].dx*t[0].rscale:0)),o}getDelta(t,e=!1){const s=this.node.attributes.get("accent");let{sk:i,ic:n}=this.baseCore.getOuterBBox();return s&&(i-=t.getOuterBBox().sk),((s&&!e?i:0)+this.font.skewIcFactor*n)*this.baseScale}stretchChildren(){const t=[];for(const e of this.childNodes)e.canStretch(Ft.Horizontal)&&t.push(e);const e=t.length,s=this.childNodes.length;if(e&&s>1){let i=0;const n=e>1&&e===s;for(const t of this.childNodes){const e=t.stretch.dir===Ft.None;if(n||e){const{w:s,rscale:n}=t.getOuterBBox(e);s*n>i&&(i=s*n)}}for(const e of t){const t=e.coreMO();null===t.size&&t.getStretchedVariant([i/e.coreRScale()])}}}constructor(t,e,s=null){super(t,e,s),this.baseScale=1,this.baseIc=0,this.baseRemoveIc=!1,this.baseIsChar=!1,this.baseHasAccentOver=null,this.baseHasAccentUnder=null,this.isLineAbove=!1,this.isLineBelow=!1,this.isMathAccent=!1;const i=this.baseCore=this.getBaseCore();i&&(this.setBaseAccentsFor(i),this.baseScale=this.getBaseScale(),this.baseIc=this.getBaseIc(),this.baseIsChar=this.isCharBase(),this.isMathAccent=this.baseIsChar&&this.scriptChild&&void 0!==this.scriptChild.coreMO().node.getProperty("mathaccent"),this.checkLineAccents(),this.baseRemoveIc=!this.isLineAbove&&!this.isLineBelow&&(!this.constructor.useIC||this.isMathAccent))}computeBBox(t,e=!1){t.empty(),t.append(this.baseChild.getOuterBBox()),this.appendScripts(t),t.clean(),this.setChildPWidths(e)}appendScripts(t){const e=this.getBaseWidth(),[s,i]=this.getOffset();return t.combine(this.scriptChild.getOuterBBox(),e+s,i),t.w+=this.font.params.scriptspace,t}get breakCount(){return this._breakCount<0&&(this._breakCount=this.node.isEmbellished?this.coreMO().embellishedBreakCount:this.node.linebreakContainer?0:this.childNodes[0].breakCount),this._breakCount}breakTop(t,e){return this.node.linebreakContainer||!this.parent||this.node.childIndex(e.node)?t:this.parent.breakTop(t,this)}computeLineBBox(t){const e=this.breakCount;if(!e)return Kt.from(this.getOuterBBox(),this.linebreakOptions.lineleading);const s=this.baseChild.getLineBBox(t).copy();return tthis.svg("g",{"data-mml-node":this.node.kind}))),t=this.handleHref(t);for(const e of t.keys())this.adaptor.append(t[e],this.dom[e]);return this.dom}handleHref(t){const e=this.node.attributes.get("href");if(!e)return t;let s=0;const i=this.node.isEmbellished&&!this.node.isKind("mo");return t.map((t=>{t=this.adaptor.append(t,this.svg("a",{href:e}));const{h:n,d:o,w:r}=i?this.getOuterBBox():this.getLineBBox(s);return this.adaptor.append(this.dom[s++],this.svg("rect",{"data-hitbox":!0,fill:"none",stroke:"none","pointer-events":"all",width:this.fixed(r),height:this.fixed(n+o),x:1===s||i?this.fixed(-this.dx):0,y:this.fixed(-o)})),t}))}handleStyles(){var t,e,s;if(!this.styles)return;const i=this.styles.cssText;i&&this.dom.forEach((t=>this.adaptor.setAttribute(t,"style",i)));const n=((null===(t=this.styleData)||void 0===t?void 0:t.padding)||[0,0,0,0])[3],o=((null===(s=null===(e=this.styleData)||void 0===e?void 0:e.border)||void 0===s?void 0:s.width)||[0,0,0,0])[3];(n||o)&&(this.dx=n+o)}handleScale(){if(1!==this.bbox.rscale){const t="scale("+this.fixed(this.bbox.rscale/1e3,3)+")";this.dom.forEach((e=>this.adaptor.setAttribute(e,"transform",t)))}}handleColor(){var t;const e=this.adaptor,s=this.node.attributes,i=s.getExplicit("mathcolor")||s.getExplicit("color"),n=s.getExplicit("mathbackground")||s.getExplicit("background")||(null===(t=this.styles)||void 0===t?void 0:t.get("background-color"));if(i&&this.dom.forEach((t=>{e.setAttribute(t,"fill",i),e.setAttribute(t,"stroke",i)})),n){let t=0;const s=this.node.isEmbellished&&!this.node.isKind("mo");this.dom.forEach((i=>{const{h:o,d:r,w:a}=s?this.getOuterBBox():this.getLineBBox(t++),h=this.svg("rect",{fill:n,x:1===t||s?this.fixed(-this.dx):0,y:this.fixed(-r),width:this.fixed(a),height:this.fixed(o+r),"data-bgcolor":!0}),d=e.firstChild(i);d?e.insert(h,d):e.append(i,h)}))}}handleBorder(){var t;const e=null===(t=this.styleData)||void 0===t?void 0:t.border;if(!e)return;const s=Ts.borderFuzz,i=this.adaptor;let n=0;const o=this.dom.length-1,r=this.node.isEmbellished&&!this.node.isKind("mo");for(const t of this.dom){const a=o&&n?0:1,h=o&&n!==o?0:1,d=r?this.getOuterBBox():this.getLineBBox(n++),[l,c,u]=[d.h+s,d.d+s,d.w+s],p=[u,l],m=[-s,l],g=[u,-c],f=[-s,-c],x=[u-h*e.width[1],l-e.width[0]],b=[-s+a*e.width[3],l-e.width[0]],A=[u-h*e.width[1],-c+e.width[2]],B=[-s+a*e.width[3],-c+e.width[2]],y=[[m,p,x,b],[g,p,x,A],[f,g,A,B],[f,m,b,B]],v=i.firstChild(t),k=a*this.dx;for(const s of[0,1,2,3]){if(!e.width[s]||3===s&&!a||1===s&&!h)continue;const i=y[s];"dashed"===e.style[s]||"dotted"===e.style[s]?this.addBorderBroken(i,e.color[s],e.style[s],e.width[s],s,t,k):this.addBorderSolid(i,e.color[s],v,t,k)}}}addBorderSolid(t,e,s,i,n){const o=this.svg("polygon",{points:t.map((([t,e])=>`${this.fixed(t-n)},${this.fixed(e)}`)).join(" "),stroke:"none"});e&&this.adaptor.setAttribute(o,"fill",e),s?this.adaptor.insert(o,s):this.adaptor.append(i,o)}addBorderBroken(t,e,s,i,n,o,r){const a="dotted"===s,h=i/2,[d,l,c,u]=[[h,-h,-h,-h],[-h,h,-h,-h],[h,h,-h,h],[h,h,h,-h]][n],[p,m]=t,g=p[0]+d-r,f=p[1]+l,x=m[0]+c-r,b=m[1]+u,A=Math.abs(n%2?b-f:x-g),B=a?Math.ceil(A/(2*i)):Math.ceil((A-i)/(4*i)),y=A/(4*B+1),v=this.svg("line",{x1:this.fixed(g),y1:this.fixed(f),x2:this.fixed(x),y2:this.fixed(b),"stroke-width":this.fixed(i),stroke:e,"stroke-linecap":a?"round":"square","stroke-dasharray":a?[1,this.fixed(A/B-.002)].join(" "):[this.fixed(y),this.fixed(3*y)].join(" ")}),k=this.adaptor,w=k.firstChild(o);w?k.insert(v,w):k.append(o,v)}handleAttributes(){const t=this.adaptor,e=this.node.attributes,s=e.getAllDefaults(),i=Ts.skipAttributes;for(const n of e.getExplicitNames())!1!==i[n]&&(n in s||i[n]||t.hasAttribute(this.dom[0],n))||this.dom.forEach((s=>t.setAttribute(s,n,e.getExplicit(n))));if(e.get("class"))for(const s of Re(e.get("class")))this.dom.forEach((e=>t.addClass(e,s)))}place(t,e,s=null){if(s||(t+=this.dx*this.bbox.rscale),!t&&!e)return;s||(s=this.dom[0],e=this.handleId(e));const i=`translate(${this.fixed(t)},${this.fixed(e)})`,n=this.adaptor.getAttribute(s,"transform")||"";this.adaptor.setAttribute(s,"transform",i+(n?" "+n:""))}handleId(t){if(!this.node.attributes||!this.node.attributes.get("id"))return t;const e=this.adaptor,{h:s,rscale:i}=this.getBBox(),n=e.childNodes(this.dom[0]);n.forEach((t=>e.remove(t)));const o=this.svg("g",{"data-idbox":!0,transform:`translate(0,${this.fixed(-s)})`},n);return e.append(this.dom[0],this.svg("text",{"data-id-align":!0},[this.text("")])),e.append(this.dom[0],o),t+s*i}firstChild(t=this.dom[0]){const e=this.adaptor;let s=e.firstChild(t);return s&&"text"===e.kind(s)&&e.getAttribute(s,"data-id-align")&&(s=e.firstChild(e.next(s))),s&&"rect"===e.kind(s)&&e.getAttribute(s,"data-hitbox")&&(s=e.next(s)),s}placeChar(t,e,s,i,n=null,o=!1){null===n&&(n=this.variant);const r=t.toString(16).toUpperCase(),[,,a,h]=this.getVariantChar(n,t);if(h.unknown)return this.utext+=String.fromCodePoint(t),o?0:this.addUtext(e,s,i,n);const d=this.addUtext(e,s,i,n);if("p"in h){e+=d;const t=h.p?"M"+h.p+"Z":"";return this.place(e,s,this.adaptor.append(i,this.charNode(n,r,t))),a+d}if("c"in h){const t=this.adaptor.append(i,this.svg("g",{"data-c":r}));this.place(e+d,s,t),e=0;for(const i of this.unicodeChars(h.c,n))e+=this.placeChar(i,e,s,t,n);return e+d}return a}addUtext(t,e,s,i){const n=this.utext;if(!n)return 0;this.utext="";const o=this.adaptor.append(s,this.jax.unknownText(n,i));return this.place(t,e,o),this.jax.measureTextNodeWithCache(o,n,i).w}charNode(t,e,s){return"none"!==this.jax.options.fontCache?this.useNode(t,e,s):this.pathNode(e,s)}pathNode(t,e){return this.svg("path",{"data-c":t,d:e})}useNode(t,e,s){const i=this.svg("use",{"data-c":e}),n="#"+this.jax.fontCache.cachePath(t,e,s);return this.adaptor.setAttribute(i,"href",n,this.jax.options.useXlink?Mn:null),i}drawBBox(){var t,e;const{w:s,h:i,d:n}=this.getOuterBBox(),o=((null===(e=null===(t=this.styleData)||void 0===t?void 0:t.border)||void 0===e?void 0:e.width)||[0,0,0,0])[3],r={style:{opacity:.25}};o&&(r.transform=`translate(${this.fixed(-o)}, 0)`);const a=this.svg("g",r,[this.svg("rect",{fill:"red",height:this.fixed(i),width:this.fixed(s)}),this.svg("rect",{fill:"green",height:this.fixed(n),width:this.fixed(s),y:this.fixed(-n)})]),h=this.dom[0]||this.parent.dom[0];this.adaptor.append(h,a)}html(t,e={},s=[]){return this.jax.html(t,e,s)}svg(t,e={},s=[]){return this.jax.svg(t,e,s)}text(t){return this.jax.text(t)}fixed(t,e=1){return this.jax.fixed(1e3*t,e)}}Ts.kind="unknown",Ts.borderFuzz=.005;const js=MathJax._.core.MmlTree.MmlNodes.math.MmlMath,Es=["url(data:application/x-font-woff;charset=utf-8;base64,","T1RUTwAJAIAAAwAQQ0ZGIGnFMZkAAARQAAAAlE9TLzJpUWOBAAABAAAAAGBjbWFwAAwAUwAABAQAAAAs","aGVhZCFRvpAAAACcAAAANmhoZWEC8AD9AAAA1AAAACRobXR4A+gAAAAABOQAAAAIbWF4cAACUAAAAAD4","AAAABm5hbWVNb8+2AAABYAAAAqNwb3N0AAMAAAAABDAAAAAgAAEAAAABAABVWOu4Xw889QADA+gAAAAA","3ym+2AAAAADfKb7YAAAAAAPoAAAAAAADAAIAAAAAAAAAAQAAAu79EgAAA+gAAAAAAAAAAQAAAAAAAAAA","AAAAAAAAAAIAAFAAAAIAAAADA+gB9AAFAAACigK7AAAAjAKKArsAAAHfADEBAgAAAAAAAAAAAAAAAAAA","AAEAAAAAAAAAAAAAAABYWFhYAEAAIAAgAu79EgAAAu4C7gAAAAEAAAAAAXcAAAAgACAAAAAAACIBngAB","AAAAAAAAAAEAQQABAAAAAAABAAsAAAABAAAAAAACAAcAIQABAAAAAAADABUAxgABAAAAAAAEABMANgAB","AAAAAAAFAAsApQABAAAAAAAGABIAbwABAAAAAAAHAAEAQQABAAAAAAAIAAEAQQABAAAAAAAJAAEAQQAB","AAAAAAAKAAEAQQABAAAAAAALAAEAQQABAAAAAAAMAAEAQQABAAAAAAANAAEAQQABAAAAAAAOAAEAQQAB","AAAAAAAQAAsAAAABAAAAAAARAAcAIQADAAEECQAAAAIAXwADAAEECQABABYACwADAAEECQACAA4AKAAD","AAEECQADACoA2wADAAEECQAEACYASQADAAEECQAFABYAsAADAAEECQAGACQAgQADAAEECQAHAAIAXwAD","AAEECQAIAAIAXwADAAEECQAJAAIAXwADAAEECQAKAAIAXwADAAEECQALAAIAXwADAAEECQAMAAIAXwAD","AAEECQANAAIAXwADAAEECQAOAAIAXwADAAEECQAQABYACwADAAEECQARAA4AKG1qeC1sbS16ZXJvAG0A","agB4AC0AbABtAC0AegBlAHIAb1JlZ3VsYXIAUgBlAGcAdQBsAGEAcm1qeC1sbS16ZXJvIFJlZ3VsYXIA","bQBqAHgALQBsAG0ALQB6AGUAcgBvACAAUgBlAGcAdQBsAGEAcm1qeC1sbS16ZXJvUmVndWxhcgBtAGoA","eAAtAGwAbQAtAHoAZQByAG8AUgBlAGcAdQBsAGEAclZlcnNpb24gMC4xAFYAZQByAHMAaQBvAG4AIAAw","AC4AMSA6bWp4LWxtLXplcm8gUmVndWxhcgAgADoAbQBqAHgALQBsAG0ALQB6AGUAcgBvACAAUgBlAGcA","dQBsAGEAcgAAAAABAAMAAQAAAAwABAAgAAAABAAEAAEAAAAg//8AAAAg////4QABAAAAAAADAAAAAAAA","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAQABAQETbWp4LWxtLXplcm9SZWd1bGFyAAEBASf4GwD4","HAL4HQP4HgSLi/mC+nwFHQAAAIYPHQAAAIkRix0AAACUEgAFAQEMHyoxNlZlcnNpb24gMC4xbWp4LWxt","LXplcm8gUmVndWxhcm1qeC1sbS16ZXJvUmVndWxhcnNwYWNlAAAAAYsAAgEBAwaLDvp8DgAAAAAD6AAA",') format("woff")'].join(""),Vs=function(){var t;const e=Ye(Ts);return(t=class extends e{handleDisplay(){const[t,e]=this.getAlignShift();if("center"!==t&&this.adaptor.setAttribute(this.jax.container,"justify",t),this.bbox.pwidth===Ut.fullWidth){if(this.adaptor.setAttribute(this.jax.container,"width","full"),this.jax.table){let{L:s,w:i,R:n}=this.jax.table.getOuterBBox();"right"===t?n=Math.max(n||-e,-e):"left"===t?s=Math.max(s||e,e):"center"===t&&(i+=2*Math.abs(e)),this.jax.minwidth=Math.max(0,s+i+n)}}else this.jax.shift=e}toSVG(t){super.toSVG(t);const e=this.adaptor;"block"===this.node.attributes.get("display")&&(e.setAttribute(this.jax.container,"display","true"),this.handleDisplay())}setChildPWidths(t,e=null,s=!0){return super.setChildPWidths(t,this.parent?e:this.metrics.containerWidth/this.jax.pxPerEm,!1)}}).kind=js.prototype.kind,t.styles={'mjx-container[jax="SVG"] mjx-break':{"white-space":"normal","line-height":"0","clip-path":"rect(0 0 0 0)","font-family":"MJX-ZERO ! important"},'mjx-break[size="0"]':{"letter-spacing":"-0.999em"},'mjx-break[size="1"]':{"letter-spacing":"-0.889em"},'mjx-break[size="2"]':{"letter-spacing":"-0.833em"},'mjx-break[size="3"]':{"letter-spacing":"-0.778em"},'mjx-break[size="4"]':{"letter-spacing":"-0.722em"},'mjx-break[size="5"]':{"letter-spacing":"-0.667em"},'mjx-container[jax="SVG"] mjx-break[newline]::before':{"white-space":"pre",content:'"\\A"'},'mjx-break[newline] + svg[width="0.054ex"]':{"margin-right":"-1px"},"mjx-break[prebreak]":{"letter-spacing":"-.999em"},"@font-face /* zero */":{"font-family":"MJX-ZERO",src:Es}},t}(),Ps=MathJax._.core.MmlTree.MmlNodes.mrow,Is=Ps.MmlMrow,Rs=Ps.MmlInferredMrow,Fs=function(){var t;const e=cs(Ts);return t=class extends e{constructor(){super(...arguments),this.linebreakCount=0}toSVG(t){this.getBBox();const e=this.linebreakCount=this.isStack?0:this.breakCount;t=e||!this.node.isInferred?this.standardSvgNodes(t):this.getSvgNodes(t),this.addChildren(t),e&&this.placeLines(t)}getSvgNodes(t){if(this.dh){const e=this.svg("g",{transform:`translate(0 ${this.fixed(this.dh)})`});t=[this.adaptor.append(t[0],e)]}return this.dom=t,t}placeLines(t){var e;const s=this.lineBBox,i=this.jax.math.display;let n=this.dh;for(const o of t.keys()){const r=s[o];this.place(r.L||0,n,t[o]),n-=Math.max(.25,r.d)+(i?r.lineLeading:0)+Math.max(.75,(null===(e=s[o+1])||void 0===e?void 0:e.h)||0)}}createSvgNodes(t){const e=this.linebreakCount;if(!e)return super.createSvgNodes(t);const s=this.adaptor,i=this.node.isInferred?{"data-mjx-linestack":!0}:{"data-mml-node":this.node.kind};this.dom=[s.append(t[0],this.svg("g",i))],this.dom=[s.append(this.handleHref(t)[0],this.dom[0])];const n=Array(e);for(let t=0;t<=e;t++)n[t]=s.append(this.dom[0],this.svg("g",{"data-mjx-linebox":!0,"data-mjx-lineno":t}));return n}addChildren(t){let e=0,s=0;for(const i of this.childNodes){const n=i.breakCount;if(i.toSVG(t.slice(s,s+n+1)),i.dom){let t=0;for(const s of i.dom){if(s){const n=t?0:i.dx,o=i.getLineBBox(t++);e+=(o.L+n)*o.rscale,this.place(e,0,s),e+=(o.w+o.R-n)*o.rscale}n&&(e=0)}if(n){const t=i.getLineBBox(n);e+=(t.w+t.R)*t.rscale}}s+=n}}},t.kind=Is.prototype.kind,t}(),Gs=function(){var t;const e=us(Fs);return(t=class extends e{}).kind=Rs.prototype.kind,t}(),_s=MathJax._.core.MmlTree.MmlNodes.mi.MmlMi,Hs=function(){var t;const e=is(Ts);return(t=class extends e{}).kind=_s.prototype.kind,t}(),zs=MathJax._.core.MmlTree.MmlNodes.mo.MmlMo;class Js extends Qt{static charOptions(t,e){return super.charOptions(t,e)}static addExtension(t,e=""){super.addExtension(t,e),Jt(this,"variantCacheIds",t.cacheIds)}}function Qs(t,e,s){for(const s of Object.keys(e)){const i=parseInt(s);Js.charOptions(t,i).p=e[i]}for(const e of Object.keys(s)){const i=parseInt(e);Js.charOptions(t,i).c=s[i]}return t}Js.OPTIONS=Object.assign(Object.assign({},Qt.OPTIONS),{dynamicPrefix:"./svg/dynamic"}),Js.JAX="SVG";const Xs=.1,Us=function(){var t;const e=hs(Ts);return t=class extends e{toSVG(t){const e=this.node.attributes,s=e.get("symmetric")&&this.stretch.dir!==Ft.Horizontal,i=this.stretch.dir!==Ft.None;i&&null===this.size&&this.getStretchedVariant([]);const n=this.standardSvgNodes(t);if(n.length>1&&"duplicate"!==this.breakStyle){const t="after"===this.breakStyle?1:0;this.adaptor.remove(n[t]),n[t]=null}if(i&&this.size<0)this.stretchSvg();else{const t=s||e.get("largeop")?this.fixed(this.getCenterOffset()):"0",i=this.node.getProperty("mathaccent")?this.fixed(this.getAccentOffset()):"0";"0"===t&&"0"===i||(n[0]&&this.adaptor.setAttribute(n[0],"transform",`translate(${i} ${t})`),n[1]&&this.adaptor.setAttribute(n[1],"transform",`translate(${i} ${t})`)),n[0]&&this.addChildren([n[0]]),n[1]&&(this.multChar||this).addChildren([n[1]])}}stretchSvg(){const t=this.stretch.stretch,e=this.getStretchVariants(),s=this.getBBox();this.stretch.dir===Ft.Vertical?this.stretchVertical(t,e,s):this.stretchHorizontal(t,e,s)}getStretchVariants(){const t=this.stretch.c||this.getText().codePointAt(0),e=[];for(const s of this.stretch.stretch.keys())e[s]=this.font.getStretchVariant(t,s);return e}stretchVertical(t,e,s){const{h:i,d:n,w:o}=s,r=this.addTop(t[0],e[0],i,o),a=this.addBot(t[2],e[2],n,o);if(4===t.length){const[s,h]=this.addMidV(t[3],e[3],o);this.addExtV(t[1],e[1],i,-s,r,0,o),this.addExtV(t[1],e[1],-h,n,0,a,o)}else this.addExtV(t[1],e[1],i,n,r,a,o)}stretchHorizontal(t,e,s){const i=s.w,n=this.addLeft(t[0],e[0]),o=this.addRight(t[2],e[2],i);if(4===t.length){const[s,r]=this.addMidH(t[3],e[3],i),a=i/2;this.addExtH(t[1],e[1],a,n,a-s),this.addExtH(t[1],e[1],a,r-a,o,a)}else this.addExtH(t[1],e[1],i,n,o)}getChar(t,e){const s=this.font.getChar(e,t)||[0,0,0,null];return[s[0],s[1],s[2],s[3]||{}]}addGlyph(t,e,s,i,n=null){if(n)return this.placeChar(t,s,i,n,e);if(this.dom[0]){const n=this.placeChar(t,s,i,this.dom[0],e);if(!this.dom[1])return n}return this.placeChar(t,s,i,this.dom[1],e)}addTop(t,e,s,i){if(!t)return 0;const[n,o,r]=this.getChar(t,e);return this.addGlyph(t,e,(i-r)/2,s-n),n+o}addExtV(t,e,s,i,n,o,r){if(!t)return;n=Math.max(0,n-Xs),o=Math.max(0,o-Xs);const a=this.adaptor,[h,d,l]=this.getChar(t,e),c=s+i-n-o,u=1.5*c/(h+d),p=(u*(h-d)-c)/2;if(c<=0)return;const m=this.svg("svg",{width:this.fixed(l),height:this.fixed(c),y:this.fixed(o-i),x:this.fixed((r-l)/2),viewBox:[0,p,l,c].map((t=>this.fixed(t))).join(" ")});this.addGlyph(t,e,0,0,m);const g=a.lastChild(m);a.setAttribute(g,"transform",`scale(1,${this.jax.fixed(u)})`),this.dom[0]&&a.append(this.dom[0],m),this.dom[1]&&a.append(this.dom[1],this.dom[0]?a.clone(m):m)}addBot(t,e,s,i){if(!t)return 0;const[n,o,r]=this.getChar(t,e);return this.addGlyph(t,e,(i-r)/2,o-s),n+o}addMidV(t,e,s){if(!t)return[0,0];const[i,n,o]=this.getChar(t,e),r=(n-i)/2+this.font.params.axis_height;return this.addGlyph(t,e,(s-o)/2,r),[i+r,n-r]}addLeft(t,e){return t?this.addGlyph(t,e,0,0):0}addExtH(t,e,s,i,n,o=0){if(!t)return;n=Math.max(0,n-.1),i=Math.max(0,i-.1);const r=this.adaptor,[a,h,d]=this.getChar(t,e),l=s-i-n,c=a+h+.2,u=l/d*1.5,p=-(h+Xs);if(l<=0)return;const m=this.svg("svg",{width:this.fixed(l),height:this.fixed(c),x:this.fixed(o+i),y:this.fixed(p),viewBox:[(u*d-l)/2,p,l,c].map((t=>this.fixed(t))).join(" ")});this.addGlyph(t,e,0,0,m);const g=r.lastChild(m);r.setAttribute(g,"transform",`scale(${this.jax.fixed(u)},1)`),this.dom[0]&&r.append(this.dom[0],m),this.dom[1]&&r.append(this.dom[1],this.dom[0]?r.clone(m):m)}addRight(t,e,s){if(!t)return 0;const i=this.getChar(t,e)[2];return this.addGlyph(t,e,s-i,0)}addMidH(t,e,s){if(!t)return[0,0];const i=this.getChar(t,e)[2];return this.addGlyph(t,e,(s-i)/2,0),[(s-i)/2,(s+i)/2]}},t.kind=zs.prototype.kind,t}(),Ks=MathJax._.core.MmlTree.MmlNodes.mn.MmlMn,qs=function(){var t;const e=as(Ts);return(t=class extends e{}).kind=Ks.prototype.kind,t}(),$s=MathJax._.core.MmlTree.MmlNodes.ms.MmlMs,Ys=function(){var t;const e=ps(Ts);return(t=class extends e{}).kind=$s.prototype.kind,t}(),Zs=MathJax._.core.MmlTree.MmlNodes.mtext.MmlMtext,ti=function(){var t;const e=Ss(Ts);return(t=class extends e{toSVG(t){if(!this.breakCount)return void super.toSVG(t);const e=this.standardSvgNodes(t),s=this.textNode.node,i=this.childNodes;for(const t of e.keys()){const n=[e[t]];let[o,r]=this.breakPoints[t-1]||[0,0];const[a,h]=this.breakPoints[t]||[i.length,0];let d=i[o].node.getText().split(/ /);if(o===a){s.setText(d.slice(r,h).join(" ")),this.textNode.toSVG(n);continue}s.setText(d.slice(r).join(" ")),this.textNode.toSVG(n);let l=this.textNode.getBBox().w;for(;++o g':{fill:"red",stroke:"red"},'g[data-mml-node="merror"] > rect[data-background]':{fill:"yellow",stroke:"none"}},ii);var ii;const ni=MathJax._.core.MmlTree.MmlNodes.mspace.MmlMspace,oi=function(){var t;const e=ms(Ts);return(t=class extends e{}).kind=ni.prototype.kind,t}(),ri=MathJax._.core.MmlTree.MmlNodes.mpadded.MmlMpadded,ai=function(){var t;const e=ds(Ts);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;let e=this.standardSvgNodes(t);const[,,,,,s,i,n,o]=this.getDimens(),r=this.node.attributes.get("data-align")||"left",a=i+o-(s<0&&"left"!==r?"center"===r?s/2:s:0);(a||n)&&(e=[this.adaptor.append(e[0],this.svg("g"))],this.place(a,n,e[0])),this.addChildren(e)}}).kind=ri.prototype.kind,t}(),hi=MathJax._.core.MmlTree.MmlNodes.mphantom.MmlMphantom,di=function(){var t;return(t=class extends Ts{toSVG(t){this.standardSvgNodes(t)}}).kind=hi.prototype.kind,t}(),li=MathJax._.core.MmlTree.MmlNodes.mfrac.MmlMfrac,ci=function(){var t;const e=es(Ts);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;this.standardSvgNodes(t);const{linethickness:e,bevelled:s}=this.node.attributes.getList("linethickness","bevelled"),i=this.isDisplay();if(s)this.makeBevelled(i);else{const t=this.length2em(String(e),.06);0===t?this.makeAtop(i):this.makeFraction(i,t)}}makeFraction(t,e){const s=this.dom,{numalign:i,denomalign:n}=this.node.attributes.getList("numalign","denomalign"),[o,r]=this.childNodes,a=o.getOuterBBox(),h=r.getOuterBBox(),d=this.font.params,l=d.axis_height,c=this.node.getProperty("withDelims")?0:d.nulldelimiterspace,u=Math.max((a.L+a.w+a.R)*a.rscale,(h.L+h.w+h.R)*h.rscale),p=this.getAlignX(u,a,i)+.1+c,m=this.getAlignX(u,h,n)+.1+c,{T:g,u:f,v:x}=this.getTUV(t,e);o.toSVG(s),o.place(p,l+g+Math.max(a.d*a.rscale,f)),r.toSVG(s),r.place(m,l-g-Math.max(h.h*h.rscale,x)),this.adaptor.append(s[0],this.svg("rect",{width:this.fixed(u+.2),height:this.fixed(e),x:this.fixed(c),y:this.fixed(l-e/2)}))}makeAtop(t){const e=this.dom,{numalign:s,denomalign:i}=this.node.attributes.getList("numalign","denomalign"),[n,o]=this.childNodes,r=n.getOuterBBox(),a=o.getOuterBBox(),h=this.font.params,d=this.node.getProperty("withDelims")?0:h.nulldelimiterspace,l=Math.max((r.L+r.w+r.R)*r.rscale,(a.L+a.w+a.R)*a.rscale),c=this.getAlignX(l,r,s)+d,u=this.getAlignX(l,a,i)+d,{u:p,v:m}=this.getUVQ(t);n.toSVG(e),n.place(c,p),o.toSVG(e),o.place(u,-m)}makeBevelled(t){const e=this.dom,[s,i]=this.childNodes,{u:n,v:o,delta:r,nbox:a,dbox:h}=this.getBevelData(t),d=(a.L+a.w+a.R)*a.rscale;s.toSVG(e),this.bevel.toSVG(e),i.toSVG(e),s.place(a.L*a.rscale,n),this.bevel.place(d-r/2,0),i.place(d+this.bevel.getOuterBBox().w+h.L*h.rscale-r,o)}}).kind=li.prototype.kind,t}(),ui=MathJax._.core.MmlTree.MmlNodes.msqrt.MmlMsqrt,pi=function(){var t;const e=gs(Ts);return t=class extends e{constructor(){super(...arguments),this.dx=0}addRoot(t,e,s,i){return 0}toSVG(t){const e=this.surd,s=this.childNodes[this.base],i=this.root?this.childNodes[this.root]:null,n=e.getBBox(),o=s.getOuterBBox(),r=this.getPQ(n)[1],a=this.font.params.surd_height*this.bbox.scale,h=o.h+r+a,d=this.standardSvgNodes(t);e.toSVG(d);const l=this.addRoot(d,i,n,h),c=this.adaptor.append(d[0],this.svg("g"));s.toSVG([c]),e.place(l,h-n.h),s.place(l+n.w,0),this.adaptor.append(d[d.length-1],this.svg("rect",{width:this.fixed(o.w),height:this.fixed(a),x:this.fixed(l+n.w),y:this.fixed(h-a)}))}},t.kind=ui.prototype.kind,t}(),mi=MathJax._.core.MmlTree.MmlNodes.mroot.MmlMroot,gi=function(){var t;const e=ls(pi);return t=class extends e{addRoot(t,e,s,i){e.toSVG(t);const[n,o,r]=this.getRootDimens(s,i),a=e.getOuterBBox();return e.place(r*a.rscale,o),n}},t.kind=mi.prototype.kind,t}(),fi=MathJax._.core.MmlTree.MmlNodes.mfenced.MmlMfenced,xi=function(){var t;const e=ts(Ts);return(t=class extends e{toSVG(t){const e=this.standardSvgNodes(t);this.setChildrenParent(this.mrow),this.mrow.toSVG(e),this.setChildrenParent(this)}setChildrenParent(t){for(const e of this.childNodes)e.parent=t}}).kind=fi.prototype.kind,t}(),bi=function(){var t;const e=Os(Ts);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t),s=this.getBaseWidth(),[i,n]=this.getOffset();this.baseChild.toSVG(e),this.baseChild.place(0,0),this.scriptChild.toSVG([e[e.length-1]]),this.scriptChild.place(s+i,n)}}).kind="scriptbase",t}(),Ai=MathJax._.core.MmlTree.MmlNodes.msubsup,Bi=Ai.MmlMsubsup,yi=Ai.MmlMsub,vi=Ai.MmlMsup,ki=function(){var t;const e=fs(bi);return(t=class extends e{}).kind=yi.prototype.kind,t}(),wi=function(){var t;const e=xs(bi);return(t=class extends e{}).kind=vi.prototype.kind,t}(),Si=function(){var t;const e=bs(bi);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t),[s,i,n]=[this.baseChild,this.supChild,this.subChild],o=this.getBaseWidth(),r=this.getAdjustedIc(),[a,h]=this.getUVQ();s.toSVG(e);const d=[e[e.length-1]];i.toSVG(d),n.toSVG(d),s.place(0,0),n.place(o+(this.baseIsChar?0:r),h),i.place(o+r,a)}}).kind=Bi.prototype.kind,t}(),Ci=MathJax._.core.MmlTree.MmlNodes.munderover,Mi=Ci.MmlMunderover,Ni=Ci.MmlMunder,Li=Ci.MmlMover,Di=function(){var t;const e=Ns(ki);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;if(this.hasMovableLimits())return void super.toSVG(t);const e=this.standardSvgNodes(t),[s,i]=[this.baseChild,this.scriptChild],[n,o]=[s.getOuterBBox(),i.getOuterBBox()];s.toSVG(e),i.toSVG(e);const r=this.isLineBelow?0:this.getDelta(this.scriptChild,!0),a=this.getUnderKV(n,o)[1],[h,d]=this.getDeltaW([n,o],[0,-r]);s.place(h,0),i.place(d,a)}}).kind=Ni.prototype.kind,t}(),Oi=function(){var t;const e=Ls(wi);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;if(this.hasMovableLimits())return void super.toSVG(t);const e=this.standardSvgNodes(t),[s,i]=[this.baseChild,this.scriptChild],[n,o]=[s.getOuterBBox(),i.getOuterBBox()];s.toSVG(e),i.toSVG(e);const r=this.isLineAbove?0:this.getDelta(this.scriptChild),a=this.getOverKU(n,o)[1],[h,d]=this.getDeltaW([n,o],[0,r]);s.place(h,0),i.place(d,a)}}).kind=Li.prototype.kind,t}(),Wi=function(){var t;const e=Ds(Si);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;if(this.hasMovableLimits())return void super.toSVG(t);const e=this.standardSvgNodes(t),[s,i,n]=[this.baseChild,this.overChild,this.underChild],[o,r,a]=[s.getOuterBBox(),i.getOuterBBox(),n.getOuterBBox()];s.toSVG(e),n.toSVG(e),i.toSVG(e);const h=this.getDelta(this.overChild),d=this.getDelta(this.underChild,!0),l=this.getOverKU(o,r)[1],c=this.getUnderKV(o,a)[1],[u,p,m]=this.getDeltaW([o,a,r],[0,this.isLineBelow?0:-d,this.isLineAbove?0:h]);s.place(u,0),n.place(p,c),i.place(m,l)}}).kind=Mi.prototype.kind,t}(),Ti=MathJax._.core.MmlTree.MmlNodes.mmultiscripts,ji=Ti.MmlMmultiscripts;Ti.MmlMprescripts,Ti.MmlNone;function Ei(t){return{left:(t,e)=>0,center:(t,e)=>(e-t)/2,right:(t,e)=>e-t}[t]||((t,e)=>0)}const Vi=function(){var t;const e=rs(Si);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t),s=this.scriptData,i=this.node.getProperty("scriptalign")||"right left",[n,o]=Re(i+" "+i),[r,a]=this.getCombinedUV();let h=0;s.numPrescripts&&(h=this.addScripts(this.dom[0],this.font.params.scriptspace,r,a,this.firstPrescript,s.numPrescripts,n));const d=this.baseChild;d.toSVG(e),d.place(h,0),this.breakCount&&(h=0),h+=d.getLineBBox(d.breakCount).w,s.numScripts&&this.addScripts(this.dom[this.dom.length-1],h,r,a,1,s.numScripts,o)}addScripts(t,e,s,i,n,o,r){const a=this.adaptor,h=Ei(r),d=a.append(t,this.svg("g")),l=a.append(t,this.svg("g"));this.place(e,s,d),this.place(e,i,l);const c=n+2*o;let u=0;for(;nr?r:this.pWidth),h="left"===o?0:"right"===o?a:a/2;if(h){const e=this.svg("g",{},this.adaptor.childNodes(t));this.place(h,0,e),this.adaptor.append(t,e)}return h}lineClass(t){return"mjx-"+t}makeFrame(t,e,s,i){const n=this.fLine;return this.svg("rect",this.setLineThickness(n,i,{"data-frame":!0,class:this.lineClass(i),width:this.fixed(t-n),height:this.fixed(e+s-n),x:this.fixed(n/2),y:this.fixed(n/2-s)}))}makeVLine(t,e,s){const{h:i,d:n}=this.getBBox(),o="dotted"===e?s/2:0,r=this.fixed(t+s/2);return this.svg("line",this.setLineThickness(s,e,{"data-line":"v",class:this.lineClass(e),x1:r,y1:this.fixed(o-n),x2:r,y2:this.fixed(i-o)}))}makeHLine(t,e,s){const i=this.getBBox().w,n="dotted"===e?s/2:0,o=this.fixed(t-s/2);return this.svg("line",this.setLineThickness(s,e,{"data-line":"h",class:this.lineClass(e),x1:this.fixed(n),y1:o,x2:this.fixed(i-n),y2:o}))}setLineThickness(t,e,s){return.07!==t&&(s["stroke-thickness"]=this.fixed(t),"solid"!==e&&(s["stroke-dasharray"]=("dotted"===e?"0,":"")+this.fixed(2*t))),s}handleLabels(t,e,s){if(!this.hasLabels)return;const i=this.labels,n=this.node.attributes.get("side");this.spaceLabels(),this.isTop?this.topTable(t,i,n):this.subTable(t,i,n,s)}spaceLabels(){const t=this.adaptor,e=this.getBBox().h,s=this.getTableData().L,i=this.getRowHalfSpacing();let n=e-this.fLine,o=t.firstChild(this.labels);for(let e=0;e line[data-line], svg[data-table] > g > line[data-line]':{"stroke-width":"70px",fill:"none"},'g[data-mml-node="mtable"] > rect[data-frame], svg[data-table] > g > rect[data-frame]':{"stroke-width":"70px",fill:"none"},'g[data-mml-node="mtable"] > .mjx-dashed, svg[data-table] > g > .mjx-dashed':{"stroke-dasharray":"140"},'g[data-mml-node="mtable"] > .mjx-dotted, svg[data-table] > g > .mjx-dotted':{"stroke-linecap":"round","stroke-dasharray":"0,140"},'g[data-mml-node="mtable"] > g > svg':{overflow:"visible"}},t}(),Ri=MathJax._.core.MmlTree.MmlNodes.mtr,Fi=Ri.MmlMtr,Gi=Ri.MmlMlabeledtr,_i=function(){var t;const e=Cs(Ts);return t=class extends e{placeCell(t,e){const{x:s,y:i,lSpace:n,w:o,rSpace:r,lLine:a,rLine:h}=e,d=1/this.getBBox().rscale,[l,c]=[this.H*d,this.D*d],[u,p]=[this.tSpace*d,this.bSpace*d],[m,g]=t.placeCell(s+n,i,o,l,c),f=n+o+r;return t.placeColor(-(m+n+a/2),-(c+p+g),f+(a+h)/2,l+c+u+p),f+h}placeCells(t){const e=this.parent,s=e.getColumnHalfSpacing(),i=[e.fLine,...e.cLines,e.fLine],n=e.getComputedWidths(),o=1/this.getBBox().rscale;let r=i[0];for(let e=0;es.addEventListener(t,e)))}Px(t){return this.px(t)}toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t),s=this.selected;let i=0;this.dom.forEach((t=>{const{h:e,d:n,w:o}=s.getLineBBox(i++);this.adaptor.append(t,this.svg("rect",{width:this.fixed(o),height:this.fixed(e+n),x:1===i?this.fixed(-this.dx):0,y:this.fixed(-n),fill:"none","pointer-events":"all"}))})),s.toSVG(e);const n=s.getOuterBBox();s.dom&&s.place(n.L*n.rscale,0),this.action(this,this.data)}}).kind=Qi.prototype.kind,t.styles={'[jax="SVG"] mjx-tool':{display:"inline-block",position:"relative",width:0,height:0},'[jax="SVG"] mjx-tool > mjx-tip':{position:"absolute",top:0,left:0},"mjx-tool > mjx-tip":{display:"inline-block","line-height":0,padding:".2em",border:"1px solid #888","background-color":"#F8F8F8",color:"black","box-shadow":"2px 2px 5px #AAAAAA"},'g[data-mml-node="maction"][data-toggle]':{cursor:"pointer"},"mjx-status":{display:"block",position:"fixed",left:"1em",bottom:"1em","min-width":"25%",padding:".2em .4em",border:"1px solid #888","font-size":"90%","background-color":"#F8F8F8",color:"black"}},t.actions=new Map([["toggle",[(t,e)=>{t.dom.forEach((e=>{t.adaptor.setAttribute(e,"data-toggle",t.node.attributes.get("selection"))}));const s=t.factory.jax.math,i=t.factory.jax.document,n=t.node;t.setEventHandler("click",(t=>{s.end.node||(s.start.node=s.end.node=s.typesetRoot,s.start.n=s.end.n=0),n.nextToggleSelection(),s.rerender(i,n.attributes.get("data-maction-id")?St.ENRICHED:St.RERENDER),t.stopPropagation()}))},{}]],["tooltip",[(t,e)=>{const s=t.childNodes[1];if(s)for(const i of t.dom){const n=t.firstChild(i);if(s.node.isKind("mtext")){const e=s.node.getText();t.adaptor.insert(t.svg("title",{},[t.text(e)]),n)}else{const s=t.adaptor,o=t.jax.container,r=t.node.factory.create("math",{},[t.childNodes[1].node]),a=t.html("mjx-tool",{},[t.html("mjx-tip")]),h=s.append(n,t.svg("foreignObject",{style:{display:"none"}},[a]));t.jax.processMath(t.jax.factory.wrap(r),s.firstChild(a)),t.childNodes[1].node.parent=t.node,t.setEventHandler("mouseover",(n=>{e.stopTimers(i,e),e.hoverTimer.set(i,setTimeout((()=>{s.setStyle(a,"left","0"),s.setStyle(a,"top","0"),s.append(o,a);const e=s.nodeBBox(a),n=s.nodeBBox(i),r=(n.right-e.left)/t.metrics.em+t.tipDx,h=(n.bottom-e.bottom)/t.metrics.em+t.tipDy;s.setStyle(a,"left",t.Px(r)),s.setStyle(a,"top",t.Px(h))}),e.postDelay)),n.stopPropagation()}),i),t.setEventHandler("mouseout",(t=>{e.stopTimers(i,e);const n=setTimeout((()=>s.append(h,a)),e.clearDelay);e.clearTimer.set(i,n),t.stopPropagation()}),i)}}},qe]],["statusline",[(t,e)=>{const s=t.childNodes[1];if(s&&s.node.isKind("mtext")){const i=t.adaptor,n=s.node.getText();t.dom.forEach((t=>i.setAttribute(t,"data-statusline",n))),t.setEventHandler("mouseover",(s=>{if(null===e.status){const s=i.body(i.document);e.status=i.append(s,t.html("mjx-status",{},[t.text(n)]))}s.stopPropagation()})),t.setEventHandler("mouseout",(t=>{e.status&&(i.remove(e.status),e.status=null),t.stopPropagation()}))}},{status:null}]]]),t}(),Ui=MathJax._.core.MmlTree.MmlNodes.menclose.MmlMenclose,Ki={top:(t,e,s,i)=>[0,t-i,s,t-i],right:(t,e,s,i)=>[s-i,-e,s-i,t],bottom:(t,e,s,i)=>[0,i-e,s,i-e],left:(t,e,s,i)=>[i,-e,i,t],vertical:(t,e,s,i)=>[s/2,t,s/2,-e],horizontal:(t,e,s,i)=>[0,(t-e)/2,s,(t-e)/2],up:(t,e,s,i)=>[i,i-e,s-i,t-i],down:(t,e,s,i)=>[i,t-i,s-i,i-e]},qi=function(t,e,s=""){const{h:i,d:n,w:o}=t.getBBox(),r=t.thickness/2;return $i(Ki[e](i,n,o,r),t,s)},$i=function(t,e,s){if(s){const i=e.getOffset(s);i&&("X"===s?(t[0]-=i,t[2]-=i):(t[1]-=i,t[3]-=i))}return t},Yi=function(t,e=""){return(s,i)=>{const n=s.line(qi(s,t,e));s.adaptor.append(s.dom[0],n)}},Zi=function(t){return De(((e,s)=>{e.adaptor.append(e.dom[0],e.line(qi(e,t)))}))(t)},tn=function(t,e,s){return Oe(((t,i)=>{t.adaptor.append(t.dom[0],t.line(qi(t,e))),t.adaptor.append(t.dom[0],t.line(qi(t,s)))}))(t,e,s)},en=function(t){return We((e=>(e,s)=>{e.adaptor.append(e.dom[0],e.line(qi(e,t)))}))(t)},sn=function(t){return Te(((t,e)=>{t.adaptor.append(t.dom[0],e)}))(t)},nn=function(t){return je(((t,e)=>{t.adaptor.append(t.dom[0],e)}))(t)},on=function(){var t;const e=Ze(Ts);return t=class extends e{line(t){const[e,s,i,n]=t;return this.svg("line",{x1:this.fixed(e),y1:this.fixed(s),x2:this.fixed(i),y2:this.fixed(n),"stroke-width":this.fixed(this.thickness)})}box(t,e,s,i=0){const n=this.thickness,o={x:this.fixed(n/2),y:this.fixed(n/2-s),width:this.fixed(t-n),height:this.fixed(e+s-n),fill:"none","stroke-width":this.fixed(n)};return i&&(o.rx=this.fixed(i)),this.svg("rect",o)}ellipse(t,e,s){const i=this.thickness;return this.svg("ellipse",{rx:this.fixed((t-i)/2),ry:this.fixed((e+s-i)/2),cx:this.fixed(t/2),cy:this.fixed((e-s)/2),fill:"none","stroke-width":this.fixed(i)})}path(t,...e){return this.svg("path",{d:e.map((t=>"string"==typeof t?t:this.fixed(t))).join(" "),style:{"stroke-width":this.fixed(this.thickness)},"stroke-linecap":"round","stroke-linejoin":t,fill:"none"})}fill(...t){return this.svg("path",{d:t.map((t=>"string"==typeof t?t:this.fixed(t))).join(" ")})}arrow(t,e,s,i="",n=0){const{w:o,h:r,d:a}=this.getBBox(),h=(t-o)/2,d=(r-a)/2,l=this.thickness,c=l/2,[u,p,m]=[l*this.arrowhead.x,l*this.arrowhead.y,l*this.arrowhead.dx],g=s?this.fill("M",o+h,d,"l",-(u+m),p,"l",m,c-p,"L",u-h,d+c,"l",m,p-c,"l",-(u+m),-p,"l",u+m,-p,"l",-m,p-c,"L",o+h-u,d-c,"l",-m,c-p,"Z"):this.fill("M",o+h,d,"l",-(u+m),p,"l",m,c-p,"L",-h,d+c,"l",0,-l,"L",o+h-u,d-c,"l",-m,c-p,"Z"),f=[];if(n&&f.push("X"===i?`translate(${this.fixed(-n)} 0)`:`translate(0 ${this.fixed(n)})`),e){const t=this.jax.fixed(180*-e/Math.PI);f.push(`rotate(${t} ${this.fixed(o/2)} ${this.fixed(d)})`)}return f.length&&this.adaptor.setAttribute(g,"transform",f.join(" ")),g}toSVG(t){const e=this.standardSvgNodes(t),s=this.getBBoxExtenders()[3],i={};s>0&&(i.transform="translate("+this.fixed(s)+", 0)");const n=this.adaptor.append(e[0],this.svg("g",i));this.renderChild?this.renderChild(this,n):(this.childNodes[0].toSVG([n]),this.childNodes[0].place(0,0));for(const t of Object.keys(this.notations)){const s=this.notations[t];s.renderChild||s.renderer(this,e[0])}}},t.kind=Ui.prototype.kind,t.notations=new Map([Zi("top"),Zi("right"),Zi("bottom"),Zi("left"),tn("actuarial","top","right"),tn("madruwb","bottom","right"),en("up"),en("down"),["horizontalstrike",{renderer:Yi("horizontal","Y"),bbox:t=>[0,t.padding,0,t.padding]}],["verticalstrike",{renderer:Yi("vertical","X"),bbox:t=>[t.padding,0,t.padding,0]}],["box",{renderer:(t,e)=>{const{w:s,h:i,d:n}=t.getBBox();t.adaptor.append(t.dom[0],t.box(s,i,n))},bbox:ye,border:ke,remove:"left right top bottom"}],["roundedbox",{renderer:(t,e)=>{const{w:s,h:i,d:n}=t.getBBox(),o=t.thickness+t.padding;t.adaptor.append(t.dom[0],t.box(s,i,n,o))},bbox:ye}],["circle",{renderer:(t,e)=>{const{w:s,h:i,d:n}=t.getBBox();t.adaptor.append(t.dom[0],t.ellipse(s,i,n))},bbox:ye}],["phasorangle",{renderer:(t,e)=>{const{w:s,h:i,d:n}=t.getBBox(),o=t.getArgMod(1.75*t.padding,i+n)[0],r=t.thickness/2,a=i+n,h=Math.cos(o);t.adaptor.append(t.dom[0],t.path("mitre","M",s,r-n,"L",r+h*r,r-n,"L",h*a+r,a-n-r))},bbox:t=>{const e=t.padding/2,s=t.thickness;return[2*e,e,e+s,3*e+s]},border:t=>[0,0,t.thickness,0],remove:"bottom"}],nn("up"),nn("down"),nn("left"),nn("right"),nn("updown"),nn("leftright"),sn("updiagonal"),sn("northeast"),sn("southeast"),sn("northwest"),sn("southwest"),sn("northeastsouthwest"),sn("northwestsoutheast"),["longdiv",{renderer:(t,e)=>{const{w:s,h:i,d:n}=t.getBBox(),o=t.thickness/2,r=t.padding;t.adaptor.append(t.dom[0],t.path("round","M",o,o-n,"a",r-o/2,(i+n)/2-4*o,0,"0,1",0,i+n-2*o,"L",s-o,i-o))},bbox:t=>{const e=t.padding,s=t.thickness;return[e+s,e,e,2*e+s/2]}}],["radical",{renderer:(t,e)=>{t.msqrt.toSVG([e]);const s=t.sqrtTRBL()[3];t.place(-s,0,e)},init:t=>{t.msqrt=t.createMsqrt(t.childNodes[0])},bbox:t=>t.sqrtTRBL(),renderChild:!0}]]),t}(),rn=MathJax._.core.MmlTree.MmlNodes.semantics,an=rn.MmlSemantics,hn=rn.MmlAnnotationXML,dn=rn.MmlAnnotation,ln=function(){var t;const e=Ws(Ts);return(t=class extends e{toSVG(t){if(this.toEmbellishedSVG(t))return;const e=this.standardSvgNodes(t);this.childNodes.length&&this.childNodes[0].toSVG(e)}}).kind=an.prototype.kind,t}(),cn=function(){var t;return(t=class extends Ts{toSVG(t){super.toSVG(t)}computeBBox(){return this.bbox}}).kind=dn.prototype.kind,t}(),un=function(){var t;return(t=class extends Ts{}).kind=hn.prototype.kind,t.styles={"foreignObject[data-mjx-xml]":{"font-family":"initial","line-height":"normal",overflow:"visible"}},t}(),pn=function(){var t;const e=Ke(Ts);return t=class extends e{toSVG(t){const e=this.jax.math.metrics,s=e.em*e.scale*this.rscale,i=this.fixed(1/s,3),{w:n,h:o,d:r}=this.getBBox();this.dom=[this.adaptor.append(t[0],this.svg("foreignObject",{"data-mjx-xml":!0,y:this.jax.fixed(-o*s)+"px",width:this.jax.fixed(n*s)+"px",height:this.jax.fixed((o+r)*s)+"px",transform:`scale(${i}) matrix(1 0 0 -1 0 0)`},[this.getHTML()]))]}addHDW(t,e){t=this.html("mjx-html-holder",{style:e},[t]);const{h:s,d:i,w:n}=this.getBBox(),o=this.metrics.scale;return e.height=this.em((s+i)*o),e.width=this.em(n*o),e["vertical-align"]=this.em(-i*o),delete e["font-size"],delete e["font-family"],t}},t.kind=Dt.prototype.kind,t.styles=Object.assign({"foreignObject[data-mjx-html]":{overflow:"visible"}},e.styles),t}(),mn=MathJax._.core.MmlTree.MmlNodes.mglyph.MmlMglyph,gn=function(){var t;const e=ss(Ts);return(t=class extends e{toSVG(t){const e=this.standardSvgNodes(t);if(this.charWrapper)return void this.charWrapper.toSVG(e);const{src:s,alt:i}=this.node.attributes.getList("src","alt"),n=this.fixed(this.height),o={width:this.fixed(this.width),height:n,transform:"translate(0 "+this.fixed(this.height+(this.valign||0))+") matrix(1 0 0 -1 0 0)",preserveAspectRatio:"none","aria-label":i,href:s},r=this.svg("image",o);this.adaptor.append(e[0],r)}}).kind=mn.prototype.kind,t}(),fn=MathJax._.core.MmlTree.MmlNodes.TeXAtom.TeXAtom,xn=function(){var t;const e=Xe(Ts);return(t=class extends e{toSVG(t){super.toSVG(t),this.adaptor.setAttribute(this.dom[0],"data-mjx-texclass",Nt[this.node.texClass])}}).kind=fn.prototype.kind,t}(),bn=function(){var t;const e=Ue(Ts);return(t=class extends e{static addStyles(t,e){t.addStyles({'mjx-container[jax="SVG"] path[data-c], mjx-container[jax="SVG"] use[data-c]':{"stroke-width":e.options.blacker}})}toSVG(t){const e=this.adaptor,s=this.parent.variant,i=this.node.getText();if(0!==i.length)if("-explicitFont"===s)this.dom=[e.append(t[0],this.jax.unknownText(i,s))];else{const n=this.remappedText(i,s);this.parent.childNodes.length>1?t=this.dom=[e.append(t[0],this.svg("g",{"data-mml-node":"text"}))]:this.dom=t;let o=0;for(const e of n)o+=this.placeChar(e,o,0,t[0],s,!0);this.addUtext(o,0,t[0],s)}}}).kind=Lt.prototype.kind,t}(),An=MathJax._.core.MmlTree.MmlNodes.HtmlNode.HtmlNode,Bn=function(){var t;return(t=class extends pn{}).kind=An.prototype.kind,t}(),yn={[Vs.kind]:Vs,[Fs.kind]:Fs,[Gs.kind]:Gs,[Hs.kind]:Hs,[Us.kind]:Us,[qs.kind]:qs,[Ys.kind]:Ys,[ti.kind]:ti,[si.kind]:si,[oi.kind]:oi,[ai.kind]:ai,[di.kind]:di,[ci.kind]:ci,[pi.kind]:pi,[gi.kind]:gi,[xi.kind]:xi,[ki.kind]:ki,[wi.kind]:wi,[Si.kind]:Si,[Di.kind]:Di,[Oi.kind]:Oi,[Wi.kind]:Wi,[Vi.kind]:Vi,[Ii.kind]:Ii,[_i.kind]:_i,[Hi.kind]:Hi,[Ji.kind]:Ji,[Xi.kind]:Xi,[on.kind]:on,[ln.kind]:ln,[cn.kind]:cn,[un.kind]:un,[pn.kind]:pn,[gn.kind]:gn,[xn.kind]:xn,[bn.kind]:bn,[Bn.kind]:Bn,[Ts.kind]:Ts};class vn extends Qe{}vn.defaultNodes=yn;class kn{constructor(t){this.cache=new Map,this.defs=null,this.localID="",this.nextID=0,this.jax=t}cachePath(t,e,s){const i="MJX-"+this.localID+(this.jax.font.getVariant(t).cacheID||"")+"-"+e;return this.cache.has(i)||(this.cache.set(i,s),this.jax.adaptor.append(this.defs,this.jax.svg("path",{id:i,d:s}))),i}clearLocalID(){this.localID=""}useLocalID(t=null){this.localID=(null==t?++this.nextID:t)+(""===t?"":"-")}clearCache(){this.cache=new Map,this.defs=this.jax.svg("defs")}getCache(){return this.defs}}const wn="mathjax-newcm",Sn=null,Cn="http://www.w3.org/2000/svg",Mn="http://www.w3.org/1999/xlink";class Nn extends ue{get forceInlineBreaks(){return!0}constructor(t={}){super(t,vn,Sn),this.minwidth=0,this.shift=0,this.svgStyles=null,this.fontCache=new kn(this),this.options.matchFontHeight=!0}initialize(){"global"===this.options.fontCache&&this.fontCache.clearCache()}clearFontCache(){this.fontCache.clearCache()}reset(){this.clearFontCache()}escaped(t,e){return this.setDocument(e),this.html("span",{},[this.text(t.math)])}styleSheet(t){if(this.svgStyles)return this.svgStyles;const e=this.svgStyles=super.styleSheet(t);return this.adaptor.setAttribute(e,"id",Nn.STYLESHEETID),e}insertStyles(t){this.svgStyles&&this.adaptor.insertRules(this.svgStyles,new le(t).getStyleRules())}pageElements(t){return"global"!==this.options.fontCache||this.findCache(t)?null:this.svg("svg",{xmlns:Cn,id:Nn.FONTCACHEID,style:{display:"none"}},[this.fontCache.getCache()])}findCache(t){const e=this.adaptor,s=e.tags(e.body(t.document),"svg");for(let t=s.length-1;t>=0;t--)if(this.adaptor.getAttribute(s[t],"id")===Nn.FONTCACHEID)return!0;return!1}getInitialScale(){return 1}processMath(t,e){const s=this.container;this.container=e;const[i,n]=this.createRoot(t);this.typesetSvg(t,i,n),t.node.getProperty("process-breaks")&&this.handleInlineBreaks(t,i,n),this.container=s}createRoot(t){const{w:e,h:s,d:i,pwidth:n}=t.getOuterBBox(),[o,r]=this.createSVG(s,i,e);if(n){const e=this.adaptor;e.setStyle(o,"min-width",e.getStyle(o,"width")),e.setAttribute(o,"width",n),e.removeAttribute(o,"viewBox");const i=this.fixed(t.metrics.ex/(1e3*this.font.params.x_height),6);e.setAttribute(r,"transform",`scale(${i},-${i}) translate(0, ${this.fixed(1e3*-s,1)})`)}return[o,r]}createSVG(t,e,s){const i=this.math.metrics.em/1e3,n=Math.max(s,i),o=Math.max(t+e,i),r=this.svg("g",{stroke:"currentColor",fill:"currentColor","stroke-width":0,transform:"scale(1,-1)"}),a=this.adaptor,h=a.append(this.container,this.svg("svg",{xmlns:Cn,width:this.ex(n),height:this.ex(o),role:"img",focusable:!1,style:{"vertical-align":this.ex(-e)},viewBox:[0,this.fixed(1e3*-t,1),this.fixed(1e3*n,1),this.fixed(1e3*o,1)].join(" ")},[r]));return.001===n&&(a.setAttribute(h,"preserveAspectRatio","xMidYMid slice"),s<0&&a.setStyle(this.container,"margin-right",this.ex(s))),"none"!==this.options.fontCache&&this.options.useXlink&&a.setAttribute(h,"xmlns:xlink",Mn),[h,r]}typesetSvg(t,e,s){const i=this.adaptor;if(this.minwidth=this.shift=0,"local"===this.options.fontCache&&(this.fontCache.clearCache(),this.fontCache.useLocalID(this.options.localID),i.insert(this.fontCache.getCache(),s)),t.toSVG([s]),this.fontCache.clearLocalID(),this.minwidth)i.setStyle(e,"minWidth",this.ex(this.minwidth)),i.setStyle(this.container,"minWidth",this.ex(this.minwidth));else if(this.shift){const t=i.getAttribute(this.container,"justify")||"center";this.setIndent(e,t,this.shift)}}setIndent(t,e,s){"center"!==e&&"left"!==e||this.adaptor.setStyle(t,"margin-left",this.ex(s)),"center"!==e&&"right"!==e||this.adaptor.setStyle(t,"margin-right",this.ex(-s))}handleInlineBreaks(t,e,s){const i=t.childNodes[0].breakCount;if(!i)return;const n=this.adaptor,o=n.firstChild(s),r=n.childNodes(n.firstChild(o)),a=t.childNodes[0].lineBBox;n.remove(s);for(let s=0;s<=i;s++){const i=a[s]||t.childNodes[0].getLineBBox(s),{h,d,w:l}=i,[c,u]=t.childNodes[0].getBreakNode(i),{scale:p}=c.getBBox(),[m,g]=this.createSVG(h*p,d*p,l*p),f=n.append(g,n.clone(o,!1));for(const t of n.childNodes(r[s]))n.append(f,t);n.insert(m,e);const x=!(!u||!u.node.getProperty("forcebreak"));if(x&&"after"===u.node.attributes.get("linebreakstyle")){const t=c.parent.node.childIndex(c.node)+1,e=c.parent.childNodes[t],s=e?e.getLineBBox(0).originalL*p:0;s&&this.addInlineBreak(m,s,x)}else if(x||s){const t=c&&s?c.getLineBBox(0).originalL*p:0;!t&&x||this.addInlineBreak(m,t,x||!!c.node.getProperty("forcebreak"))}}n.childNodes(e).length&&n.append(n.firstChild(n.parent(e)),n.firstChild(e)),n.remove(e)}addInlineBreak(t,e,s){const i=this.adaptor,n=oe(e);s||i.insert(i.node("mjx-break",{prebreak:!0},[i.text(" ")]),t),i.insert(i.node("mjx-break",s?He[n]?{size:He[n]}:{style:`letter-spacing: ${oe(e-1)}`}:{newline:!0},[i.text(" ")]),t)}ex(t){return t/=this.font.params.x_height,Math.abs(t)<.001?"0":t.toFixed(3).replace(/\.?0+$/,"")+"ex"}svg(t,e={},s=[]){return this.html(t,e,s,Cn)}unknownText(t,e){const s=this.math.metrics,i=this.font.params.x_height/s.ex*s.em*1e3,n=this.svg("text",{"data-variant":e,transform:"scale(1,-1)","font-size":this.fixed(i,1)+"px"},[this.text(t)]),o=this.adaptor;if("-explicitFont"!==e){const s=Pe(t);if(1!==s.length||s[0]<119808||s[0]>120831){const[t,s,i]=this.font.getCssFont(e);o.setAttribute(n,"font-family",t),s&&o.setAttribute(n,"font-style","italic"),i&&o.setAttribute(n,"font-weight","bold")}}return n}measureTextNode(t){const e=this.adaptor;t=e.clone(t),e.removeAttribute(t,"transform");const s=this.fixed(1e3*this.font.params.x_height,1),i=this.svg("svg",{position:"absolute",visibility:"hidden",width:"1ex",height:"1ex",top:0,left:0,viewBox:[0,0,s,s].join(" ")},[t]);e.append(e.body(e.document),i);const n=e.nodeSize(t,1e3,!0)[0];return e.remove(i),{w:n,h:.75,d:.2}}}Nn.NAME="SVG",Nn.OPTIONS=Object.assign(Object.assign({},ue.OPTIONS),{blacker:3,fontCache:"local",localID:null,useXlink:!0}),Nn.commonStyles=Object.assign(Object.assign({},ue.commonStyles),{'mjx-container[jax="SVG"]':{direction:"ltr","white-space":"nowrap"},'mjx-container[jax="SVG"] > svg':{overflow:"visible","min-height":"1px","min-width":"1px"},'mjx-container[jax="SVG"] > svg a':{fill:"blue",stroke:"blue"},"rect[sre-highlighter-added]:has(+ .mjx-selected)":{stroke:"black","stroke-width":"80px"}}),Nn.FONTCACHEID="MJX-SVG-global-cache",Nn.STYLESHEETID="MJX-SVG-styles",MathJax.loader&&MathJax.loader.checkVersion("output/svg","4.0.0","output"),vt({_:{output:{common_ts:o,common:{Direction:e,FontData:s,LineBBox:i,LinebreakVisitor:n,Notation:r,Wrapper:a,WrapperFactory:h,Wrappers:{TeXAtom:d,TextNode:l,XmlNode:c,maction:u,math:p,menclose:m,mfenced:g,mfrac:f,mglyph:x,mi:b,mmultiscripts:A,mn:B,mo:y,mpadded:v,mroot:k,mrow:w,ms:S,mspace:C,msqrt:M,msubsup:N,mtable:L,mtd:D,mtext:O,mtr:W,munderover:T,scriptbase:j,semantics:E}},svg_ts:At,svg:{DefaultFont:bt,FontCache:xt,FontData:G,Notation:ht,Wrapper:V,WrapperFactory:ft,Wrappers_ts:gt,Wrappers:{HtmlNode:mt,TeXAtom:ut,TextNode:pt,maction:at,math:I,menclose:dt,merror:Q,mfenced:Z,mfrac:q,mglyph:ct,mi:F,mmultiscripts:it,mn:H,mo:_,mpadded:U,mphantom:K,mroot:Y,mrow:R,ms:z,mspace:X,msqrt:$,msubsup:et,mtable:nt,mtd:rt,mtext:J,mtr:ot,munderover:st,scriptbase:tt,semantics:lt,zero:P}}}}});const Ln=MathJax._.components.package,Dn=(Ln.PackageError,Ln.Package),On=MathJax._.util.context,Wn=On.hasWindow,Tn=(On.context,Wn?"https://cdn.jsdelivr.net/npm/@mathjax/%%FONT%%-font":"@mathjax/%%FONT%%-font");({config(t,e,s,i){if(MathJax.loader){yt(MathJax.config,t,MathJax.config.output||{});let e=MathJax.config[t],n=e.font||e.fontData||s;if("string"!=typeof n&&(e.fontData=n,e.font=n=n.NAME),"["!==n.charAt(0)){const s=e.fontPath||Tn,i=n.match(/^[a-z]+:/)?(n.match(/[^/:\\]*$/)||[t])[0]:n;yt(MathJax.config.loader,"paths",{[i]:i===n?s.replace(/%%FONT%%/g,n):n}),n=`[${i}]`}const o=n.substring(1,n.length-1);if(o===s&&i){const e=MathJax.config.loader[`${n}/${t}`]?.extraLoads;e&&MathJax.loader.addPackageData(`output/${t}`,{extraLoads:e}),vt({_:{output:{fonts:{[o]:{[t+"_ts"]:{[i.NAME+"Font"]:i}}}}}}),yt(MathJax,"config",{output:{font:n},[t]:{fontData:i,dynamicPrefix:`${n}/${t}/dynamic`}}),"chtml"===t&&yt(MathJax.config,t,{fontURL:Dn.resolvePath(`${n}/${t}/woff2`,!1)})}else MathJax.loader.addPackageData(`output/${t}`,{extraLoads:[`${n}/${t}`]})}MathJax.startup&&(MathJax.startup.registerConstructor(t,e),MathJax.startup.useOutput(t))},loadFont:(t,e,s,i)=>MathJax.loader?(i&&MathJax.loader.preLoaded(`[${s}]/${e}`),Dn.loadPromise(`output/${e}`).then(t)):t}).config("svg",Nn,wn,Sn)})();