You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/5545.e9678146.async.js

3460 lines
1.8 MiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

!(function(){var ro=Math.pow;var $l=(Ir,Mt,Y)=>new Promise((Ce,Le)=>{var Xe=me=>{try{Oe(Y.next(me))}catch(Pe){Le(Pe)}},Ge=me=>{try{Oe(Y.throw(me))}catch(Pe){Le(Pe)}},Oe=me=>me.done?Ce(me.value):Promise.resolve(me.value).then(Xe,Ge);Oe((Y=Y.apply(Ir,Mt)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[5545],{70557:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return $}});var Ce=Y(96663),Le=Y(59301),Xe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},Ge=Xe,Oe=Y(7657),me=function(te,V){return Le.createElement(Oe.Z,(0,Ce.Z)({},te,{ref:V,icon:Ge}))},Pe=Le.forwardRef(me),$=Pe},84105:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return $}});var Ce=Y(96663),Le=Y(59301),Xe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},Ge=Xe,Oe=Y(7657),me=function(te,V){return Le.createElement(Oe.Z,(0,Ce.Z)({},te,{ref:V,icon:Ge}))},Pe=Le.forwardRef(me),$=Pe},18785:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return $}});var Ce=Y(96663),Le=Y(59301),Xe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},Ge=Xe,Oe=Y(7657),me=function(te,V){return Le.createElement(Oe.Z,(0,Ce.Z)({},te,{ref:V,icon:Ge}))},Pe=Le.forwardRef(me),$=Pe},62772:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return $}});var Ce=Y(96663),Le=Y(59301),Xe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},Ge=Xe,Oe=Y(7657),me=function(te,V){return Le.createElement(Oe.Z,(0,Ce.Z)({},te,{ref:V,icon:Ge}))},Pe=Le.forwardRef(me),$=Pe},87395:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return $}});var Ce=Y(96663),Le=Y(59301),Xe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},Ge=Xe,Oe=Y(7657),me=function(te,V){return Le.createElement(Oe.Z,(0,Ce.Z)({},te,{ref:V,icon:Ge}))},Pe=Le.forwardRef(me),$=Pe},35593:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return zr}});var Ce=Y(44127),Le=Y(72071),Xe=Y(6620),Ge=Y(43403),Oe=Y(92310),me=Y.n(Oe),Pe=Y(29301),$=Y(76846),c=Y(96452),te=Y(6089),V=Y(80402),A=Y(34280),b=Y(49658),M=Y(59301),I=Y(96663),re=Y(77900),se=Y(8654);function q(We){var mt=We.prefixCls,Ye=We.align,Et=We.arrow,Tt=We.arrowPos,ge=Et||{},Be=ge.className,et=ge.content,gt=Tt.x,vt=gt===void 0?0:gt,Ut=Tt.y,hr=Ut===void 0?0:Ut,Yt=M.useRef();if(!Ye||!Ye.points)return null;var Ke={position:"absolute"};if(Ye.autoArrow!==!1){var $t=Ye.points[0],cr=Ye.points[1],Fe=$t[0],He=$t[1],qe=cr[0],Dt=cr[1];Fe===qe||!["t","b"].includes(Fe)?Ke.top=hr:Fe==="t"?Ke.top=0:Ke.bottom=0,He===Dt||!["l","r"].includes(He)?Ke.left=vt:He==="l"?Ke.left=0:Ke.right=0}return M.createElement("div",{ref:Yt,className:me()("".concat(mt,"-arrow"),Be),style:Ke},et)}function W(We){var mt=We.prefixCls,Ye=We.open,Et=We.zIndex,Tt=We.mask,ge=We.motion;return Tt?M.createElement(re.default,(0,I.Z)({},ge,{motionAppear:!0,visible:Ye,removeOnLeave:!0}),function(Be){var et=Be.className;return M.createElement("div",{style:{zIndex:Et},className:me()("".concat(mt,"-mask"),et)})}):null}var Z=M.memo(function(We){var mt=We.children;return mt},function(We,mt){return mt.cache}),le=Z,P=M.forwardRef(function(We,mt){var Ye=We.popup,Et=We.className,Tt=We.prefixCls,ge=We.style,Be=We.target,et=We.onVisibleChanged,gt=We.open,vt=We.keepDom,Ut=We.fresh,hr=We.onClick,Yt=We.mask,Ke=We.arrow,$t=We.arrowPos,cr=We.align,Fe=We.motion,He=We.maskMotion,qe=We.forceRender,Dt=We.getPopupContainer,St=We.autoDestroy,Pt=We.portal,Gt=We.zIndex,k=We.onMouseEnter,D=We.onMouseLeave,ut=We.onPointerEnter,U=We.ready,he=We.offsetX,Tr=We.offsetY,Ee=We.offsetR,Ue=We.offsetB,Ze=We.onAlign,G=We.onPrepare,pe=We.stretch,_e=We.targetWidth,Ne=We.targetHeight,H=typeof Ye=="function"?Ye():Ye,Vt=gt||vt,Se=(Dt==null?void 0:Dt.length)>0,qt=M.useState(!Dt||!Se),vr=(0,Le.Z)(qt,2),Xr=vr[0],An=vr[1];if((0,A.Z)(function(){!Xr&&Se&&Be&&An(!0)},[Xr,Se,Be]),!Xr)return null;var Kr="auto",yr={left:"-1000vw",top:"-1000vh",right:Kr,bottom:Kr};if(U||!gt){var gn,fe=cr.points,Ae=cr.dynamicInset||((gn=cr._experimental)===null||gn===void 0?void 0:gn.dynamicInset),Ct=Ae&&fe[0][1]==="r",at=Ae&&fe[0][0]==="b";Ct?(yr.right=Ee,yr.left=Kr):(yr.left=he,yr.right=Kr),at?(yr.bottom=Ue,yr.top=Kr):(yr.top=Tr,yr.bottom=Kr)}var xt={};return pe&&(pe.includes("height")&&Ne?xt.height=Ne:pe.includes("minHeight")&&Ne&&(xt.minHeight=Ne),pe.includes("width")&&_e?xt.width=_e:pe.includes("minWidth")&&_e&&(xt.minWidth=_e)),gt||(xt.pointerEvents="none"),M.createElement(Pt,{open:qe||Vt,getContainer:Dt&&function(){return Dt(Be)},autoDestroy:St},M.createElement(W,{prefixCls:Tt,open:gt,zIndex:Gt,mask:Yt,motion:He}),M.createElement(Pe.Z,{onResize:Ze,disabled:!gt},function(Ot){return M.createElement(re.default,(0,I.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:qe,leavedClassName:"".concat(Tt,"-hidden")},Fe,{onAppearPrepare:G,onEnterPrepare:G,visible:gt,onVisibleChanged:function(Jt){var xr;Fe==null||(xr=Fe.onVisibleChanged)===null||xr===void 0||xr.call(Fe,Jt),et(Jt)}}),function(ir,Jt){var xr=ir.className,br=ir.style,nn=me()(Tt,xr,Et);return M.createElement("div",{ref:(0,se.sQ)(Ot,mt,Jt),className:nn,style:(0,Ce.Z)((0,Ce.Z)((0,Ce.Z)((0,Ce.Z)({"--arrow-x":"".concat($t.x||0,"px"),"--arrow-y":"".concat($t.y||0,"px")},yr),xt),br),{},{boxSizing:"border-box",zIndex:Gt},ge),onMouseEnter:k,onMouseLeave:D,onPointerEnter:ut,onClick:hr},Ke&&M.createElement(q,{prefixCls:Tt,arrow:Ke,arrowPos:$t,align:cr}),M.createElement(le,{cache:!gt&&!Ut},H))})}))}),ae=P,Te=M.forwardRef(function(We,mt){var Ye=We.children,Et=We.getTriggerDOMNode,Tt=(0,se.Yr)(Ye),ge=M.useCallback(function(et){(0,se.mH)(mt,Et?Et(et):et)},[Et]),Be=(0,se.x1)(ge,Ye.ref);return Tt?M.cloneElement(Ye,{ref:Be}):Ye}),ye=Te,Je=M.createContext(null),Ve=Je;function st(We){return We?Array.isArray(We)?We:[We]:[]}function ft(We,mt,Ye,Et){return M.useMemo(function(){var Tt=st(Ye!=null?Ye:mt),ge=st(Et!=null?Et:mt),Be=new Set(Tt),et=new Set(ge);return We&&(Be.has("hover")&&(Be.delete("hover"),Be.add("click")),et.has("hover")&&(et.delete("hover"),et.add("click"))),[Be,et]},[We,mt,Ye,Et])}var ie=Y(29194);function Q(){var We=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ye=arguments.length>2?arguments[2]:void 0;return Ye?We[0]===mt[0]:We[0]===mt[0]&&We[1]===mt[1]}function ue(We,mt,Ye,Et){for(var Tt=Ye.points,ge=Object.keys(We),Be=0;Be<ge.length;Be+=1){var et,gt=ge[Be];if(Q((et=We[gt])===null||et===void 0?void 0:et.points,Tt,Et))return"".concat(mt,"-placement-").concat(gt)}return""}function ce(We,mt,Ye,Et){return mt||(Ye?{motionName:"".concat(We,"-").concat(Ye)}:Et?{motionName:Et}:null)}function De(We){return We.ownerDocument.defaultView}function xe(We){for(var mt=[],Ye=We==null?void 0:We.parentElement,Et=["hidden","scroll","clip","auto"];Ye;){var Tt=De(Ye).getComputedStyle(Ye),ge=Tt.overflowX,Be=Tt.overflowY,et=Tt.overflow;[ge,Be,et].some(function(gt){return Et.includes(gt)})&&mt.push(Ye),Ye=Ye.parentElement}return mt}function C(We){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(We)?mt:We}function B(We){return C(parseFloat(We),0)}function ee(We,mt){var Ye=(0,Ce.Z)({},We);return(mt||[]).forEach(function(Et){if(!(Et instanceof HTMLBodyElement||Et instanceof HTMLHtmlElement)){var Tt=De(Et).getComputedStyle(Et),ge=Tt.overflow,Be=Tt.overflowClipMargin,et=Tt.borderTopWidth,gt=Tt.borderBottomWidth,vt=Tt.borderLeftWidth,Ut=Tt.borderRightWidth,hr=Et.getBoundingClientRect(),Yt=Et.offsetHeight,Ke=Et.clientHeight,$t=Et.offsetWidth,cr=Et.clientWidth,Fe=B(et),He=B(gt),qe=B(vt),Dt=B(Ut),St=C(Math.round(hr.width/$t*1e3)/1e3),Pt=C(Math.round(hr.height/Yt*1e3)/1e3),Gt=($t-cr-qe-Dt)*St,k=(Yt-Ke-Fe-He)*Pt,D=Fe*Pt,ut=He*Pt,U=qe*St,he=Dt*St,Tr=0,Ee=0;if(ge==="clip"){var Ue=B(Be);Tr=Ue*St,Ee=Ue*Pt}var Ze=hr.x+U-Tr,G=hr.y+D-Ee,pe=Ze+hr.width+2*Tr-U-he-Gt,_e=G+hr.height+2*Ee-D-ut-k;Ye.left=Math.max(Ye.left,Ze),Ye.top=Math.max(Ye.top,G),Ye.right=Math.min(Ye.right,pe),Ye.bottom=Math.min(Ye.bottom,_e)}}),Ye}function we(We){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ye="".concat(mt),Et=Ye.match(/^(.*)\%$/);return Et?We*(parseFloat(Et[1])/100):parseFloat(Ye)}function rt(We,mt){var Ye=mt||[],Et=(0,Le.Z)(Ye,2),Tt=Et[0],ge=Et[1];return[we(We.width,Tt),we(We.height,ge)]}function tt(){var We=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[We[0],We[1]]}function ot(We,mt){var Ye=mt[0],Et=mt[1],Tt,ge;return Ye==="t"?ge=We.y:Ye==="b"?ge=We.y+We.height:ge=We.y+We.height/2,Et==="l"?Tt=We.x:Et==="r"?Tt=We.x+We.width:Tt=We.x+We.width/2,{x:Tt,y:ge}}function je(We,mt){var Ye={t:"b",b:"t",l:"r",r:"l"};return We.map(function(Et,Tt){return Tt===mt?Ye[Et]||"c":Et}).join("")}function nr(We,mt,Ye,Et,Tt,ge,Be){var et=M.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Tt[Et]||{}}),gt=(0,Le.Z)(et,2),vt=gt[0],Ut=gt[1],hr=M.useRef(0),Yt=M.useMemo(function(){return mt?xe(mt):[]},[mt]),Ke=M.useRef({}),$t=function(){Ke.current={}};We||$t();var cr=(0,te.Z)(function(){if(mt&&Ye&&We){let oi=function(ti,Mi){var Fi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nn,mi=H.x+ti,Ni=H.y+Mi,Os=mi+gn,Nn=Ni+yr,wn=Math.max(mi,Fi.left),hi=Math.max(Ni,Fi.top),xi=Math.min(Os,Fi.right),es=Math.min(Nn,Fi.bottom);return Math.max(0,(xi-wn)*(es-hi))},Dn=function(){lr=H.y+wr,gr=lr+yr,yn=H.x+Mr,Yn=yn+gn};var qe,Dt,St=mt,Pt=St.ownerDocument,Gt=De(St),k=Gt.getComputedStyle(St),D=k.width,ut=k.height,U=k.position,he=St.style.left,Tr=St.style.top,Ee=St.style.right,Ue=St.style.bottom,Ze=St.style.overflow,G=(0,Ce.Z)((0,Ce.Z)({},Tt[Et]),ge),pe=Pt.createElement("div");(qe=St.parentElement)===null||qe===void 0||qe.appendChild(pe),pe.style.left="".concat(St.offsetLeft,"px"),pe.style.top="".concat(St.offsetTop,"px"),pe.style.position=U,pe.style.height="".concat(St.offsetHeight,"px"),pe.style.width="".concat(St.offsetWidth,"px"),St.style.left="0",St.style.top="0",St.style.right="auto",St.style.bottom="auto",St.style.overflow="hidden";var _e;if(Array.isArray(Ye))_e={x:Ye[0],y:Ye[1],width:0,height:0};else{var Ne=Ye.getBoundingClientRect();_e={x:Ne.x,y:Ne.y,width:Ne.width,height:Ne.height}}var H=St.getBoundingClientRect(),Vt=Pt.documentElement,Se=Vt.clientWidth,qt=Vt.clientHeight,vr=Vt.scrollWidth,Xr=Vt.scrollHeight,An=Vt.scrollTop,Kr=Vt.scrollLeft,yr=H.height,gn=H.width,fe=_e.height,Ae=_e.width,Ct={left:0,top:0,right:Se,bottom:qt},at={left:-Kr,top:-An,right:vr-Kr,bottom:Xr-An},xt=G.htmlRegion,Ot="visible",ir="visibleFirst";xt!=="scroll"&&xt!==ir&&(xt=Ot);var Jt=xt===ir,xr=ee(at,Yt),br=ee(Ct,Yt),nn=xt===Ot?br:xr,kr=Jt?br:nn;St.style.left="auto",St.style.top="auto",St.style.right="0",St.style.bottom="0";var Fr=St.getBoundingClientRect();St.style.left=he,St.style.top=Tr,St.style.right=Ee,St.style.bottom=Ue,St.style.overflow=Ze,(Dt=St.parentElement)===null||Dt===void 0||Dt.removeChild(pe);var $r=C(Math.round(gn/parseFloat(D)*1e3)/1e3),pn=C(Math.round(yr/parseFloat(ut)*1e3)/1e3);if($r===0||pn===0||(0,$.Sh)(Ye)&&!(0,ie.Z)(Ye))return;var Mn=G.offset,mn=G.targetOffset,dn=rt(H,Mn),$n=(0,Le.Z)(dn,2),rn=$n[0],Lr=$n[1],nt=rt(_e,mn),Qe=(0,Le.Z)(nt,2),bt=Qe[0],Rt=Qe[1];_e.x-=bt,_e.y-=Rt;var lt=G.points||[],Nt=(0,Le.Z)(lt,2),Ft=Nt[0],or=Nt[1],_r=tt(or),fr=tt(Ft),Qr=ot(_e,_r),on=ot(H,fr),fn=(0,Ce.Z)({},G),Mr=Qr.x-on.x+rn,wr=Qr.y-on.y+Lr,_n=oi(Mr,wr),ln=oi(Mr,wr,br),qr=ot(_e,["t","l"]),Jr=ot(H,["t","l"]),sn=ot(_e,["b","r"]),en=ot(H,["b","r"]),Ur=G.overflow||{},cn=Ur.adjustX,Ln=Ur.adjustY,xn=Ur.shiftX,sr=Ur.shiftY,Ie=function(Mi){return typeof Mi=="boolean"?Mi:Mi>=0},lr,gr,yn,Yn;Dn();var vn=Ie(Ln),Rn=fr[0]===_r[0];if(vn&&fr[0]==="t"&&(gr>kr.bottom||Ke.current.bt)){var Zr=wr;Rn?Zr-=yr-fe:Zr=qr.y-en.y-Lr;var ai=oi(Mr,Zr),pi=oi(Mr,Zr,br);ai>_n||ai===_n&&(!Jt||pi>=ln)?(Ke.current.bt=!0,wr=Zr,Lr=-Lr,fn.points=[je(fr,0),je(_r,0)]):Ke.current.bt=!1}if(vn&&fr[0]==="b"&&(lr<kr.top||Ke.current.tb)){var In=wr;Rn?In+=yr-fe:In=sn.y-Jr.y-Lr;var ni=oi(Mr,In),qi=oi(Mr,In,br);ni>_n||ni===_n&&(!Jt||qi>=ln)?(Ke.current.tb=!0,wr=In,Lr=-Lr,fn.points=[je(fr,0),je(_r,0)]):Ke.current.tb=!1}var Ti=Ie(cn),Zi=fr[1]===_r[1];if(Ti&&fr[1]==="l"&&(Yn>kr.right||Ke.current.rl)){var Ar=Mr;Zi?Ar-=gn-Ae:Ar=qr.x-en.x-rn;var bn=oi(Ar,wr),zn=oi(Ar,wr,br);bn>_n||bn===_n&&(!Jt||zn>=ln)?(Ke.current.rl=!0,Mr=Ar,rn=-rn,fn.points=[je(fr,1),je(_r,1)]):Ke.current.rl=!1}if(Ti&&fr[1]==="r"&&(yn<kr.left||Ke.current.lr)){var Vn=Mr;Zi?Vn+=gn-Ae:Vn=sn.x-Jr.x-rn;var Gi=oi(Vn,wr),Vi=oi(Vn,wr,br);Gi>_n||Gi===_n&&(!Jt||Vi>=ln)?(Ke.current.lr=!0,Mr=Vn,rn=-rn,fn.points=[je(fr,1),je(_r,1)]):Ke.current.lr=!1}Dn();var ei=xn===!0?0:xn;typeof ei=="number"&&(yn<br.left&&(Mr-=yn-br.left-rn,_e.x+Ae<br.left+ei&&(Mr+=_e.x-br.left+Ae-ei)),Yn>br.right&&(Mr-=Yn-br.right-rn,_e.x>br.right-ei&&(Mr+=_e.x-br.right+ei)));var Ci=sr===!0?0:sr;typeof Ci=="number"&&(lr<br.top&&(wr-=lr-br.top-Lr,_e.y+fe<br.top+Ci&&(wr+=_e.y-br.top+fe-Ci)),gr>br.bottom&&(wr-=gr-br.bottom-Lr,_e.y>br.bottom-Ci&&(wr+=_e.y-br.bottom+Ci)));var Wn=H.x+Mr,Wi=Wn+gn,ui=H.y+wr,Ji=ui+yr,Di=_e.x,bi=Di+Ae,Sn=_e.y,ls=Sn+fe,_s=Math.max(Wn,Di),fs=Math.min(Wi,bi),Xn=(_s+fs)/2,xs=Xn-Wn,ps=Math.max(ui,Sn),er=Math.min(Ji,ls),ci=(ps+er)/2,ws=ci-ui;Be==null||Be(mt,fn);var Qi=Fr.right-H.x-(Mr+H.width),_i=Fr.bottom-H.y-(wr+H.height);Ut({ready:!0,offsetX:Mr/$r,offsetY:wr/pn,offsetR:Qi/$r,offsetB:_i/pn,arrowX:xs/$r,arrowY:ws/pn,scaleX:$r,scaleY:pn,align:fn})}}),Fe=function(){hr.current+=1;var Dt=hr.current;Promise.resolve().then(function(){hr.current===Dt&&cr()})},He=function(){Ut(function(Dt){return(0,Ce.Z)((0,Ce.Z)({},Dt),{},{ready:!1})})};return(0,A.Z)(He,[Et]),(0,A.Z)(function(){We||He()},[We]),[vt.ready,vt.offsetX,vt.offsetY,vt.offsetR,vt.offsetB,vt.arrowX,vt.arrowY,vt.scaleX,vt.scaleY,vt.align,Fe]}var Kt=Y(19127);function Lt(We,mt,Ye,Et,Tt){(0,A.Z)(function(){if(We&&mt&&Ye){let hr=function(){Et(),Tt()};var ge=mt,Be=Ye,et=xe(ge),gt=xe(Be),vt=De(Be),Ut=new Set([vt].concat((0,Kt.Z)(et),(0,Kt.Z)(gt)));return Ut.forEach(function(Yt){Yt.addEventListener("scroll",hr,{passive:!0})}),vt.addEventListener("resize",hr,{passive:!0}),Et(),function(){Ut.forEach(function(Yt){Yt.removeEventListener("scroll",hr),vt.removeEventListener("resize",hr)})}}},[We,mt,Ye])}var Gr=Y(48736),Rr=Y(16089);function hn(We,mt,Ye,Et,Tt,ge,Be,et){var gt=M.useRef(We),vt=M.useRef(!1);gt.current!==We&&(vt.current=!0,gt.current=We),M.useEffect(function(){var Ut=(0,Rr.Z)(function(){vt.current=!1});return function(){Rr.Z.cancel(Ut)}},[We]),M.useEffect(function(){if(mt&&Et&&(!Tt||ge)){var Ut=function(){var U=!1,he=function(Ue){var Ze=Ue.target;U=Be(Ze)},Tr=function(Ue){var Ze=Ue.target;!vt.current&&gt.current&&!U&&!Be(Ze)&&et(!1)};return[he,Tr]},hr=Ut(),Yt=(0,Le.Z)(hr,2),Ke=Yt[0],$t=Yt[1],cr=Ut(),Fe=(0,Le.Z)(cr,2),He=Fe[0],qe=Fe[1],Dt=De(Et);Dt.addEventListener("mousedown",Ke,!0),Dt.addEventListener("click",$t,!0),Dt.addEventListener("contextmenu",$t,!0);var St=(0,c.A)(Ye);if(St&&(St.addEventListener("mousedown",He,!0),St.addEventListener("click",qe,!0),St.addEventListener("contextmenu",qe,!0)),0)var Pt,Gt,k,D;return function(){Dt.removeEventListener("mousedown",Ke,!0),Dt.removeEventListener("click",$t,!0),Dt.removeEventListener("contextmenu",$t,!0),St&&(St.removeEventListener("mousedown",He,!0),St.removeEventListener("click",qe,!0),St.removeEventListener("contextmenu",qe,!0))}}},[mt,Ye,Et,Tt,ge])}var Nr=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function an(){var We=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ge.Z,mt=M.forwardRef(function(Ye,Et){var Tt=Ye.prefixCls,ge=Tt===void 0?"rc-trigger-popup":Tt,Be=Ye.children,et=Ye.action,gt=et===void 0?"hover":et,vt=Ye.showAction,Ut=Ye.hideAction,hr=Ye.popupVisible,Yt=Ye.defaultPopupVisible,Ke=Ye.onPopupVisibleChange,$t=Ye.afterPopupVisibleChange,cr=Ye.mouseEnterDelay,Fe=Ye.mouseLeaveDelay,He=Fe===void 0?.1:Fe,qe=Ye.focusDelay,Dt=Ye.blurDelay,St=Ye.mask,Pt=Ye.maskClosable,Gt=Pt===void 0?!0:Pt,k=Ye.getPopupContainer,D=Ye.forceRender,ut=Ye.autoDestroy,U=Ye.destroyPopupOnHide,he=Ye.popup,Tr=Ye.popupClassName,Ee=Ye.popupStyle,Ue=Ye.popupPlacement,Ze=Ye.builtinPlacements,G=Ze===void 0?{}:Ze,pe=Ye.popupAlign,_e=Ye.zIndex,Ne=Ye.stretch,H=Ye.getPopupClassNameFromAlign,Vt=Ye.fresh,Se=Ye.alignPoint,qt=Ye.onPopupClick,vr=Ye.onPopupAlign,Xr=Ye.arrow,An=Ye.popupMotion,Kr=Ye.maskMotion,yr=Ye.popupTransitionName,gn=Ye.popupAnimation,fe=Ye.maskTransitionName,Ae=Ye.maskAnimation,Ct=Ye.className,at=Ye.getTriggerDOMNode,xt=(0,Xe.Z)(Ye,Nr),Ot=ut||U||!1,ir=M.useState(!1),Jt=(0,Le.Z)(ir,2),xr=Jt[0],br=Jt[1];(0,A.Z)(function(){br((0,b.Z)())},[]);var nn=M.useRef({}),kr=M.useContext(Ve),Fr=M.useMemo(function(){return{registerSubPopup:function(Dr,On){nn.current[Dr]=On,kr==null||kr.registerSubPopup(Dr,On)}}},[kr]),$r=(0,V.Z)(),pn=M.useState(null),Mn=(0,Le.Z)(pn,2),mn=Mn[0],dn=Mn[1],$n=(0,te.Z)(function(Cr){(0,$.Sh)(Cr)&&mn!==Cr&&dn(Cr),kr==null||kr.registerSubPopup($r,Cr)}),rn=M.useState(null),Lr=(0,Le.Z)(rn,2),nt=Lr[0],Qe=Lr[1],bt=M.useRef(null),Rt=(0,te.Z)(function(Cr){(0,$.Sh)(Cr)&&nt!==Cr&&(Qe(Cr),bt.current=Cr)}),lt=M.Children.only(Be),Nt=(lt==null?void 0:lt.props)||{},Ft={},or=(0,te.Z)(function(Cr){var Dr,On,Li=nt;return(Li==null?void 0:Li.contains(Cr))||((Dr=(0,c.A)(Li))===null||Dr===void 0?void 0:Dr.host)===Cr||Cr===Li||(mn==null?void 0:mn.contains(Cr))||((On=(0,c.A)(mn))===null||On===void 0?void 0:On.host)===Cr||Cr===mn||Object.values(nn.current).some(function(jn){return(jn==null?void 0:jn.contains(Cr))||Cr===jn})}),_r=ce(ge,An,gn,yr),fr=ce(ge,Kr,Ae,fe),Qr=M.useState(Yt||!1),on=(0,Le.Z)(Qr,2),fn=on[0],Mr=on[1],wr=hr!=null?hr:fn,_n=(0,te.Z)(function(Cr){hr===void 0&&Mr(Cr)});(0,A.Z)(function(){Mr(hr||!1)},[hr]);var ln=M.useRef(wr);ln.current=wr;var qr=M.useRef([]);qr.current=[];var Jr=(0,te.Z)(function(Cr){var Dr;_n(Cr),((Dr=qr.current[qr.current.length-1])!==null&&Dr!==void 0?Dr:wr)!==Cr&&(qr.current.push(Cr),Ke==null||Ke(Cr))}),sn=M.useRef(),en=function(){clearTimeout(sn.current)},Ur=function(Dr){var On=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;en(),On===0?Jr(Dr):sn.current=setTimeout(function(){Jr(Dr)},On*1e3)};M.useEffect(function(){return en},[]);var cn=M.useState(!1),Ln=(0,Le.Z)(cn,2),xn=Ln[0],sr=Ln[1];(0,A.Z)(function(Cr){(!Cr||wr)&&sr(!0)},[wr]);var Ie=M.useState(null),lr=(0,Le.Z)(Ie,2),gr=lr[0],yn=lr[1],Yn=M.useState([0,0]),vn=(0,Le.Z)(Yn,2),Rn=vn[0],Zr=vn[1],ai=function(Dr){Zr([Dr.clientX,Dr.clientY])},pi=nr(wr,mn,Se?Rn:nt,Ue,G,pe,vr),In=(0,Le.Z)(pi,11),ni=In[0],qi=In[1],Ti=In[2],Zi=In[3],Ar=In[4],bn=In[5],zn=In[6],Vn=In[7],Gi=In[8],Vi=In[9],ei=In[10],Ci=ft(xr,gt,vt,Ut),Wn=(0,Le.Z)(Ci,2),Wi=Wn[0],ui=Wn[1],Ji=Wi.has("click"),Di=ui.has("click")||ui.has("contextMenu"),bi=(0,te.Z)(function(){xn||ei()}),Sn=function(){ln.current&&Se&&Di&&Ur(!1)};Lt(wr,nt,mn,bi,Sn),(0,A.Z)(function(){bi()},[Rn,Ue]),(0,A.Z)(function(){wr&&!(G!=null&&G[Ue])&&bi()},[JSON.stringify(pe)]);var ls=M.useMemo(function(){var Cr=ue(G,ge,Vi,Se);return me()(Cr,H==null?void 0:H(Vi))},[Vi,H,G,ge,Se]);M.useImperativeHandle(Et,function(){return{nativeElement:bt.current,forceAlign:bi}});var _s=M.useState(0),fs=(0,Le.Z)(_s,2),Xn=fs[0],xs=fs[1],ps=M.useState(0),er=(0,Le.Z)(ps,2),ci=er[0],ws=er[1],Qi=function(){if(Ne&&nt){var Dr=nt.getBoundingClientRect();xs(Dr.width),ws(Dr.height)}},_i=function(){Qi(),bi()},oi=function(Dr){sr(!1),ei(),$t==null||$t(Dr)},Dn=function(){return new Promise(function(Dr){Qi(),yn(function(){return Dr})})};(0,A.Z)(function(){gr&&(ei(),gr(),yn(null))},[gr]);function ti(Cr,Dr,On,Li){Ft[Cr]=function(jn){var Ss;Li==null||Li(jn),Ur(Dr,On);for(var Ts=arguments.length,Ns=new Array(Ts>1?Ts-1:0),$i=1;$i<Ts;$i++)Ns[$i-1]=arguments[$i];(Ss=Nt[Cr])===null||Ss===void 0||Ss.call.apply(Ss,[Nt,jn].concat(Ns))}}(Ji||Di)&&(Ft.onClick=function(Cr){var Dr;ln.current&&Di?Ur(!1):!ln.current&&Ji&&(ai(Cr),Ur(!0));for(var On=arguments.length,Li=new Array(On>1?On-1:0),jn=1;jn<On;jn++)Li[jn-1]=arguments[jn];(Dr=Nt.onClick)===null||Dr===void 0||Dr.call.apply(Dr,[Nt,Cr].concat(Li))}),hn(wr,Di,nt,mn,St,Gt,or,Ur);var Mi=Wi.has("hover"),Fi=ui.has("hover"),mi,Ni;Mi&&(ti("onMouseEnter",!0,cr,function(Cr){ai(Cr)}),ti("onPointerEnter",!0,cr,function(Cr){ai(Cr)}),mi=function(Dr){(wr||xn)&&mn!==null&&mn!==void 0&&mn.contains(Dr.target)&&Ur(!0,cr)},Se&&(Ft.onMouseMove=function(Cr){var Dr;(Dr=Nt.onMouseMove)===null||Dr===void 0||Dr.call(Nt,Cr)})),Fi&&(ti("onMouseLeave",!1,He),ti("onPointerLeave",!1,He),Ni=function(){Ur(!1,He)}),Wi.has("focus")&&ti("onFocus",!0,qe),ui.has("focus")&&ti("onBlur",!1,Dt),Wi.has("contextMenu")&&(Ft.onContextMenu=function(Cr){var Dr;ln.current&&ui.has("contextMenu")?Ur(!1):(ai(Cr),Ur(!0)),Cr.preventDefault();for(var On=arguments.length,Li=new Array(On>1?On-1:0),jn=1;jn<On;jn++)Li[jn-1]=arguments[jn];(Dr=Nt.onContextMenu)===null||Dr===void 0||Dr.call.apply(Dr,[Nt,Cr].concat(Li))}),Ct&&(Ft.className=me()(Nt.className,Ct));var Os=(0,Ce.Z)((0,Ce.Z)({},Nt),Ft),Nn={},wn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];wn.forEach(function(Cr){xt[Cr]&&(Nn[Cr]=function(){for(var Dr,On=arguments.length,Li=new Array(On),jn=0;jn<On;jn++)Li[jn]=arguments[jn];(Dr=Os[Cr])===null||Dr===void 0||Dr.call.apply(Dr,[Os].concat(Li)),xt[Cr].apply(xt,Li)})});var hi=M.cloneElement(lt,(0,Ce.Z)((0,Ce.Z)({},Os),Nn)),xi={x:bn,y:zn},es=Xr?(0,Ce.Z)({},Xr!==!0?Xr:{}):null;return M.createElement(M.Fragment,null,M.createElement(Pe.Z,{disabled:!wr,ref:Rt,onResize:_i},M.createElement(ye,{getTriggerDOMNode:at},hi)),M.createElement(Ve.Provider,{value:Fr},M.createElement(ae,{portal:We,ref:$n,prefixCls:ge,popup:he,className:me()(Tr,ls),style:Ee,target:nt,onMouseEnter:mi,onMouseLeave:Ni,onPointerEnter:mi,zIndex:_e,open:wr,keepDom:xn,fresh:Vt,onClick:qt,mask:St,motion:_r,maskMotion:fr,onVisibleChanged:oi,onPrepare:Dn,forceRender:D,autoDestroy:Ot,getPopupContainer:k,align:Vi,arrow:es,arrowPos:xi,ready:ni,offsetX:qi,offsetY:Ti,offsetR:Zi,offsetB:Ar,onAlign:bi,stretch:Ne,targetWidth:Xn/Vn,targetHeight:ci/Gi})))});return mt}var zr=an(Ge.Z)},50304:function(){"use strict"},36785:function(Ir,Mt,Y){"use strict";Y.d(Mt,{o2:function(){return Oe},yT:function(){return me}});var Ce=Y(19127),Le=Y(33166);const Xe=Le.i.map(Pe=>`${Pe}-inverse`),Ge=["success","processing","error","default","warning"];function Oe(Pe){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,Ce.Z)(Xe),(0,Ce.Z)(Le.i)).includes(Pe):Le.i.includes(Pe)}function me(Pe){return Ge.includes(Pe)}},79676:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return me}});var Ce=Y(19447);function Le(Pe,$,c,te){if(te===!1)return{adjustX:!1,adjustY:!1};const V=te&&typeof te=="object"?te:{},A={};switch(Pe){case"top":case"bottom":A.shiftX=$.dropdownArrowOffset*2+c;break;case"left":case"right":A.shiftY=$.dropdownArrowOffsetVertical*2+c;break}const b=Object.assign(Object.assign({},A),V);return b.shiftX||(b.adjustX=!0),b.shiftY||(b.adjustY=!0),b}const Xe={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},Ge={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},Oe=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function me(Pe){const{arrowWidth:$,autoAdjustOverflow:c,arrowPointAtCenter:te,offset:V,borderRadius:A,visibleFirst:b}=Pe,M=$/2,I={};return Object.keys(Xe).forEach(re=>{const se=te&&Ge[re]||Xe[re],q=Object.assign(Object.assign({},se),{offset:[0,0]});switch(I[re]=q,Oe.has(re)&&(q.autoArrow=!1),re){case"top":case"topLeft":case"topRight":q.offset[1]=-M-V;break;case"bottom":case"bottomLeft":case"bottomRight":q.offset[1]=M+V;break;case"left":case"leftTop":case"leftBottom":q.offset[0]=-M-V;break;case"right":case"rightTop":case"rightBottom":q.offset[0]=M+V;break}const W=(0,Ce.fS)({contentRadius:A,limitVerticalRadius:!0});if(te)switch(re){case"topLeft":case"bottomLeft":q.offset[0]=-W.dropdownArrowOffset-M;break;case"topRight":case"bottomRight":q.offset[0]=W.dropdownArrowOffset+M;break;case"leftTop":case"rightTop":q.offset[1]=-W.dropdownArrowOffset-M;break;case"leftBottom":case"rightBottom":q.offset[1]=W.dropdownArrowOffset+M;break}q.overflow=Le(re,W,$,c),b&&(q.htmlRegion="visibleFirst")}),I}},19080:function(Ir,Mt,Y){"use strict";Y.d(Mt,{F:function(){return Oe},Z:function(){return Ge}});var Ce=Y(92310),Le=Y.n(Ce);const Xe=null;function Ge(me,Pe,$){return Le()({[`${me}-status-success`]:Pe==="success",[`${me}-status-warning`]:Pe==="warning",[`${me}-status-error`]:Pe==="error",[`${me}-status-validating`]:Pe==="validating",[`${me}-has-feedback`]:$})}const Oe=(me,Pe)=>Pe||me},5871:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return cr}});var Ce=Y(84105),Le=Y(87395),Xe=Y(92310),Ge=Y.n(Xe),Oe=Y(96663),me=Y(90493),Pe=Y(20135),$=Y(72071),c=Y(6620),te=Y(52884),V=Y(95727);function A(){return typeof BigInt=="function"}function b(Fe){return!Fe&&Fe!==0&&!Number.isNaN(Fe)||!String(Fe).trim()}function M(Fe){var He=Fe.trim(),qe=He.startsWith("-");qe&&(He=He.slice(1)),He=He.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),He.startsWith(".")&&(He="0".concat(He));var Dt=He||"0",St=Dt.split("."),Pt=St[0]||"0",Gt=St[1]||"0";Pt==="0"&&Gt==="0"&&(qe=!1);var k=qe?"-":"";return{negative:qe,negativeStr:k,trimStr:Dt,integerStr:Pt,decimalStr:Gt,fullStr:"".concat(k).concat(Dt)}}function I(Fe){var He=String(Fe);return!Number.isNaN(Number(He))&&He.includes("e")}function re(Fe){var He=String(Fe);if(I(Fe)){var qe=Number(He.slice(He.indexOf("e-")+2)),Dt=He.match(/\.(\d+)/);return Dt!=null&&Dt[1]&&(qe+=Dt[1].length),qe}return He.includes(".")&&q(He)?He.length-He.indexOf(".")-1:0}function se(Fe){var He=String(Fe);if(I(Fe)){if(Fe>Number.MAX_SAFE_INTEGER)return String(A()?BigInt(Fe).toString():Number.MAX_SAFE_INTEGER);if(Fe<Number.MIN_SAFE_INTEGER)return String(A()?BigInt(Fe).toString():Number.MIN_SAFE_INTEGER);He=Fe.toFixed(re(He))}return M(He).fullStr}function q(Fe){return typeof Fe=="number"?!Number.isNaN(Fe):Fe?/^\s*-?\d+(\.\d+)?\s*$/.test(Fe)||/^\s*-?\d+\.\s*$/.test(Fe)||/^\s*-?\.\d+\s*$/.test(Fe):!1}var W=function(){function Fe(He){if((0,te.Z)(this,Fe),(0,me.Z)(this,"origin",""),(0,me.Z)(this,"negative",void 0),(0,me.Z)(this,"integer",void 0),(0,me.Z)(this,"decimal",void 0),(0,me.Z)(this,"decimalLen",void 0),(0,me.Z)(this,"empty",void 0),(0,me.Z)(this,"nan",void 0),b(He)){this.empty=!0;return}if(this.origin=String(He),He==="-"||Number.isNaN(He)){this.nan=!0;return}var qe=He;if(I(qe)&&(qe=Number(qe)),qe=typeof qe=="string"?qe:se(qe),q(qe)){var Dt=M(qe);this.negative=Dt.negative;var St=Dt.trimStr.split(".");this.integer=BigInt(St[0]);var Pt=St[1]||"0";this.decimal=BigInt(Pt),this.decimalLen=Pt.length}else this.nan=!0}return(0,V.Z)(Fe,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(qe){var Dt="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(qe,"0"));return BigInt(Dt)}},{key:"negate",value:function(){var qe=new Fe(this.toString());return qe.negative=!qe.negative,qe}},{key:"cal",value:function(qe,Dt,St){var Pt=Math.max(this.getDecimalStr().length,qe.getDecimalStr().length),Gt=this.alignDecimal(Pt),k=qe.alignDecimal(Pt),D=Dt(Gt,k).toString(),ut=St(Pt),U=M(D),he=U.negativeStr,Tr=U.trimStr,Ee="".concat(he).concat(Tr.padStart(ut+1,"0"));return new Fe("".concat(Ee.slice(0,-ut),".").concat(Ee.slice(-ut)))}},{key:"add",value:function(qe){if(this.isInvalidate())return new Fe(qe);var Dt=new Fe(qe);return Dt.isInvalidate()?this:this.cal(Dt,function(St,Pt){return St+Pt},function(St){return St})}},{key:"multi",value:function(qe){var Dt=new Fe(qe);return this.isInvalidate()||Dt.isInvalidate()?new Fe(NaN):this.cal(Dt,function(St,Pt){return St*Pt},function(St){return St*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(qe){return this.toString()===(qe==null?void 0:qe.toString())}},{key:"lessEquals",value:function(qe){return this.add(qe.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return qe?this.isInvalidate()?"":M("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),Fe}(),Z=function(){function Fe(He){if((0,te.Z)(this,Fe),(0,me.Z)(this,"origin",""),(0,me.Z)(this,"number",void 0),(0,me.Z)(this,"empty",void 0),b(He)){this.empty=!0;return}this.origin=String(He),this.number=Number(He)}return(0,V.Z)(Fe,[{key:"negate",value:function(){return new Fe(-this.toNumber())}},{key:"add",value:function(qe){if(this.isInvalidate())return new Fe(qe);var Dt=Number(qe);if(Number.isNaN(Dt))return this;var St=this.number+Dt;if(St>Number.MAX_SAFE_INTEGER)return new Fe(Number.MAX_SAFE_INTEGER);if(St<Number.MIN_SAFE_INTEGER)return new Fe(Number.MIN_SAFE_INTEGER);var Pt=Math.max(re(this.number),re(Dt));return new Fe(St.toFixed(Pt))}},{key:"multi",value:function(qe){var Dt=Number(qe);if(this.isInvalidate()||Number.isNaN(Dt))return new Fe(NaN);var St=this.number*Dt;if(St>Number.MAX_SAFE_INTEGER)return new Fe(Number.MAX_SAFE_INTEGER);if(St<Number.MIN_SAFE_INTEGER)return new Fe(Number.MIN_SAFE_INTEGER);var Pt=Math.max(re(this.number),re(Dt));return new Fe(St.toFixed(Pt))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(qe){return this.toNumber()===(qe==null?void 0:qe.toNumber())}},{key:"lessEquals",value:function(qe){return this.add(qe.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return qe?this.isInvalidate()?"":se(this.number):this.origin}}]),Fe}();function le(Fe){return A()?new W(Fe):new Z(Fe)}function P(Fe,He,qe){var Dt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Fe==="")return"";var St=M(Fe),Pt=St.negativeStr,Gt=St.integerStr,k=St.decimalStr,D="".concat(He).concat(k),ut="".concat(Pt).concat(Gt);if(qe>=0){var U=Number(k[qe]);if(U>=5&&!Dt){var he=le(Fe).add("".concat(Pt,"0.").concat("0".repeat(qe)).concat(10-U));return P(he.toString(),He,qe,Dt)}return qe===0?ut:"".concat(ut).concat(He).concat(k.padEnd(qe,"0").slice(0,qe))}return D===".0"?ut:"".concat(ut).concat(D)}var ae=le,Te=Y(93681),ye=Y(34280),Je=Y(8654),Ve=Y(59301),st=Y(48736);function ft(Fe,He){var qe=(0,Ve.useRef)(null);function Dt(){try{var Pt=Fe.selectionStart,Gt=Fe.selectionEnd,k=Fe.value,D=k.substring(0,Pt),ut=k.substring(Gt);qe.current={start:Pt,end:Gt,value:k,beforeTxt:D,afterTxt:ut}}catch(U){}}function St(){if(Fe&&qe.current&&He)try{var Pt=Fe.value,Gt=qe.current,k=Gt.beforeTxt,D=Gt.afterTxt,ut=Gt.start,U=Pt.length;if(Pt.endsWith(D))U=Pt.length-qe.current.afterTxt.length;else if(Pt.startsWith(k))U=k.length;else{var he=k[ut-1],Tr=Pt.indexOf(he,ut-1);Tr!==-1&&(U=Tr+1)}Fe.setSelectionRange(U,U)}catch(Ee){(0,st.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(Ee.message))}}return[Dt,St]}var ie=Y(49658),Q=function(){var He=(0,Ve.useState)(!1),qe=(0,$.Z)(He,2),Dt=qe[0],St=qe[1];return(0,ye.Z)(function(){St((0,ie.Z)())},[]),Dt},ue=Q,ce=Y(16089),De=200,xe=600;function C(Fe){var He=Fe.prefixCls,qe=Fe.upNode,Dt=Fe.downNode,St=Fe.upDisabled,Pt=Fe.downDisabled,Gt=Fe.onStep,k=Ve.useRef(),D=Ve.useRef([]),ut=Ve.useRef();ut.current=Gt;var U=function(){clearTimeout(k.current)},he=function(Ne,H){Ne.preventDefault(),U(),ut.current(H);function Vt(){ut.current(H),k.current=setTimeout(Vt,De)}k.current=setTimeout(Vt,xe)};Ve.useEffect(function(){return function(){U(),D.current.forEach(function(_e){return ce.Z.cancel(_e)})}},[]);var Tr=ue();if(Tr)return null;var Ee="".concat(He,"-handler"),Ue=Ge()(Ee,"".concat(Ee,"-up"),(0,me.Z)({},"".concat(Ee,"-up-disabled"),St)),Ze=Ge()(Ee,"".concat(Ee,"-down"),(0,me.Z)({},"".concat(Ee,"-down-disabled"),Pt)),G=function(){return D.current.push((0,ce.Z)(U))},pe={unselectable:"on",role:"button",onMouseUp:G,onMouseLeave:G};return Ve.createElement("div",{className:"".concat(Ee,"-wrap")},Ve.createElement("span",(0,Oe.Z)({},pe,{onMouseDown:function(Ne){he(Ne,!0)},"aria-label":"Increase Value","aria-disabled":St,className:Ue}),qe||Ve.createElement("span",{unselectable:"on",className:"".concat(He,"-handler-up-inner")})),Ve.createElement("span",(0,Oe.Z)({},pe,{onMouseDown:function(Ne){he(Ne,!1)},"aria-label":"Decrease Value","aria-disabled":Pt,className:Ze}),Dt||Ve.createElement("span",{unselectable:"on",className:"".concat(He,"-handler-down-inner")})))}function B(Fe){var He=typeof Fe=="number"?se(Fe):M(Fe).fullStr,qe=He.includes(".");return qe?M(He.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:Fe+"0"}var ee=Y(5643),we=function(){var Fe=(0,Ve.useRef)(0),He=function(){ce.Z.cancel(Fe.current)};return(0,Ve.useEffect)(function(){return He},[]),function(qe){He(),Fe.current=(0,ce.Z)(function(){qe()})}},rt=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],tt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],ot=function(He,qe){return He||qe.isEmpty()?qe.toString():qe.toNumber()},je=function(He){var qe=ae(He);return qe.isInvalidate()?null:qe},nr=Ve.forwardRef(function(Fe,He){var qe,Dt=Fe.prefixCls,St=Dt===void 0?"rc-input-number":Dt,Pt=Fe.className,Gt=Fe.style,k=Fe.min,D=Fe.max,ut=Fe.step,U=ut===void 0?1:ut,he=Fe.defaultValue,Tr=Fe.value,Ee=Fe.disabled,Ue=Fe.readOnly,Ze=Fe.upHandler,G=Fe.downHandler,pe=Fe.keyboard,_e=Fe.controls,Ne=_e===void 0?!0:_e,H=Fe.classNames,Vt=Fe.stringMode,Se=Fe.parser,qt=Fe.formatter,vr=Fe.precision,Xr=Fe.decimalSeparator,An=Fe.onChange,Kr=Fe.onInput,yr=Fe.onPressEnter,gn=Fe.onStep,fe=(0,c.Z)(Fe,rt),Ae="".concat(St,"-input"),Ct=Ve.useRef(null),at=Ve.useState(!1),xt=(0,$.Z)(at,2),Ot=xt[0],ir=xt[1],Jt=Ve.useRef(!1),xr=Ve.useRef(!1),br=Ve.useRef(!1),nn=Ve.useState(function(){return ae(Tr!=null?Tr:he)}),kr=(0,$.Z)(nn,2),Fr=kr[0],$r=kr[1];function pn(sr){Tr===void 0&&$r(sr)}var Mn=Ve.useCallback(function(sr,Ie){if(!Ie)return vr>=0?vr:Math.max(re(sr),re(U))},[vr,U]),mn=Ve.useCallback(function(sr){var Ie=String(sr);if(Se)return Se(Ie);var lr=Ie;return Xr&&(lr=lr.replace(Xr,".")),lr.replace(/[^\w.-]+/g,"")},[Se,Xr]),dn=Ve.useRef(""),$n=Ve.useCallback(function(sr,Ie){if(qt)return qt(sr,{userTyping:Ie,input:String(dn.current)});var lr=typeof sr=="number"?se(sr):sr;if(!Ie){var gr=Mn(lr,Ie);if(q(lr)&&(Xr||gr>=0)){var yn=Xr||".";lr=P(lr,yn,gr)}}return lr},[qt,Mn,Xr]),rn=Ve.useState(function(){var sr=he!=null?he:Tr;return Fr.isInvalidate()&&["string","number"].includes((0,Pe.Z)(sr))?Number.isNaN(sr)?"":sr:$n(Fr.toString(),!1)}),Lr=(0,$.Z)(rn,2),nt=Lr[0],Qe=Lr[1];dn.current=nt;function bt(sr,Ie){Qe($n(sr.isInvalidate()?sr.toString(!1):sr.toString(!Ie),Ie))}var Rt=Ve.useMemo(function(){return je(D)},[D,vr]),lt=Ve.useMemo(function(){return je(k)},[k,vr]),Nt=Ve.useMemo(function(){return!Rt||!Fr||Fr.isInvalidate()?!1:Rt.lessEquals(Fr)},[Rt,Fr]),Ft=Ve.useMemo(function(){return!lt||!Fr||Fr.isInvalidate()?!1:Fr.lessEquals(lt)},[lt,Fr]),or=ft(Ct.current,Ot),_r=(0,$.Z)(or,2),fr=_r[0],Qr=_r[1],on=function(Ie){return Rt&&!Ie.lessEquals(Rt)?Rt:lt&&!lt.lessEquals(Ie)?lt:null},fn=function(Ie){return!on(Ie)},Mr=function(Ie,lr){var gr=Ie,yn=fn(gr)||gr.isEmpty();if(!gr.isEmpty()&&!lr&&(gr=on(gr)||gr,yn=!0),!Ue&&!Ee&&yn){var Yn=gr.toString(),vn=Mn(Yn,lr);return vn>=0&&(gr=ae(P(Yn,".",vn)),fn(gr)||(gr=ae(P(Yn,".",vn,!0)))),gr.equals(Fr)||(pn(gr),An==null||An(gr.isEmpty()?null:ot(Vt,gr)),Tr===void 0&&bt(gr,lr)),gr}return Fr},wr=we(),_n=function sr(Ie){if(fr(),dn.current=Ie,Qe(Ie),!xr.current){var lr=mn(Ie),gr=ae(lr);gr.isNaN()||Mr(gr,!0)}Kr==null||Kr(Ie),wr(function(){var yn=Ie;Se||(yn=Ie.replace(/。/g,".")),yn!==Ie&&sr(yn)})},ln=function(){xr.current=!0},qr=function(){xr.current=!1,_n(Ct.current.value)},Jr=function(Ie){_n(Ie.target.value)},sn=function(Ie){var lr;if(!(Ie&&Nt||!Ie&&Ft)){Jt.current=!1;var gr=ae(br.current?B(U):U);Ie||(gr=gr.negate());var yn=(Fr||ae(0)).add(gr.toString()),Yn=Mr(yn,!1);gn==null||gn(ot(Vt,Yn),{offset:br.current?B(U):U,type:Ie?"up":"down"}),(lr=Ct.current)===null||lr===void 0||lr.focus()}},en=function(Ie){var lr=ae(mn(nt)),gr=lr;lr.isNaN()?gr=Mr(Fr,Ie):gr=Mr(lr,Ie),Tr!==void 0?bt(Fr,!1):gr.isNaN()||bt(gr,!1)},Ur=function(){Jt.current=!0},cn=function(Ie){var lr=Ie.key,gr=Ie.shiftKey;Jt.current=!0,br.current=gr,lr==="Enter"&&(xr.current||(Jt.current=!1),en(!1),yr==null||yr(Ie)),pe!==!1&&!xr.current&&["Up","ArrowUp","Down","ArrowDown"].includes(lr)&&(sn(lr==="Up"||lr==="ArrowUp"),Ie.preventDefault())},Ln=function(){Jt.current=!1,br.current=!1},xn=function(){en(!1),ir(!1),Jt.current=!1};return(0,ye.o)(function(){Fr.isInvalidate()||bt(Fr,!1)},[vr]),(0,ye.o)(function(){var sr=ae(Tr);$r(sr);var Ie=ae(mn(nt));(!sr.equals(Ie)||!Jt.current||qt)&&bt(sr,Jt.current)},[Tr]),(0,ye.o)(function(){qt&&Qr()},[nt]),Ve.createElement("div",{className:Ge()(St,H==null?void 0:H.input,Pt,(qe={},(0,me.Z)(qe,"".concat(St,"-focused"),Ot),(0,me.Z)(qe,"".concat(St,"-disabled"),Ee),(0,me.Z)(qe,"".concat(St,"-readonly"),Ue),(0,me.Z)(qe,"".concat(St,"-not-a-number"),Fr.isNaN()),(0,me.Z)(qe,"".concat(St,"-out-of-range"),!Fr.isInvalidate()&&!fn(Fr)),qe)),style:Gt,onFocus:function(){ir(!0)},onBlur:xn,onKeyDown:cn,onKeyUp:Ln,onCompositionStart:ln,onCompositionEnd:qr,onBeforeInput:Ur},Ne&&Ve.createElement(C,{prefixCls:St,upNode:Ze,downNode:G,upDisabled:Nt,downDisabled:Ft,onStep:sn}),Ve.createElement("div",{className:"".concat(Ae,"-wrap")},Ve.createElement("input",(0,Oe.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":k,"aria-valuemax":D,"aria-valuenow":Fr.isInvalidate()?null:Fr.toString(),step:U},fe,{ref:(0,Je.sQ)(Ct,He),className:Ae,value:nt,onChange:Jr,disabled:Ee,readOnly:Ue}))))}),Kt=Ve.forwardRef(function(Fe,He){var qe=Fe.disabled,Dt=Fe.style,St=Fe.prefixCls,Pt=Fe.value,Gt=Fe.prefix,k=Fe.suffix,D=Fe.addonBefore,ut=Fe.addonAfter,U=Fe.classes,he=Fe.className,Tr=Fe.classNames,Ee=(0,c.Z)(Fe,tt),Ue=Ve.useRef(null),Ze=function(pe){Ue.current&&(0,ee.nH)(Ue.current,pe)};return Ve.createElement(Te.BaseInput,{inputElement:Ve.createElement(nr,(0,Oe.Z)({prefixCls:St,disabled:qe,classNames:Tr,ref:(0,Je.sQ)(Ue,He)},Ee)),className:he,triggerFocus:Ze,prefixCls:St,value:Pt,disabled:qe,style:Dt,prefix:Gt,suffix:k,addonAfter:ut,addonBefore:D,classes:U,classNames:Tr,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});Kt.displayName="InputNumber";var Lt=Kt,Gr=Lt,Rr=Y(19080),hn=Y(36355),Nr=Y(92736),an=Y(1684),zr=Y(19716),We=Y(32441),mt=Y(33234),Ye=Y(9937),Et=Y(17313),Tt=Y(74207),ge=Y(83116),Be=Y(37613);const et=(Fe,He)=>{let{componentCls:qe,borderRadiusSM:Dt,borderRadiusLG:St}=Fe;const Pt=He==="lg"?St:Dt;return{[`&-${He}`]:{[`${qe}-handler-wrap`]:{borderStartEndRadius:Pt,borderEndEndRadius:Pt},[`${qe}-handler-up`]:{borderStartEndRadius:Pt},[`${qe}-handler-down`]:{borderEndEndRadius:Pt}}}},gt=Fe=>{const{componentCls:He,lineWidth:qe,lineType:Dt,colorBorder:St,borderRadius:Pt,fontSizeLG:Gt,controlHeightLG:k,controlHeightSM:D,colorError:ut,paddingInlineSM:U,colorTextDescription:he,motionDurationMid:Tr,handleHoverColor:Ee,paddingInline:Ue,paddingBlock:Ze,handleBg:G,handleActiveBg:pe,colorTextDisabled:_e,borderRadiusSM:Ne,borderRadiusLG:H,controlWidth:Vt,handleVisible:Se,handleBorderColor:qt}=Fe;return[{[He]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Et.Wf)(Fe)),(0,Ye.ik)(Fe)),(0,Ye.bi)(Fe,He)),{display:"inline-block",width:Vt,margin:0,padding:0,border:`${qe}px ${Dt} ${St}`,borderRadius:Pt,"&-rtl":{direction:"rtl",[`${He}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:Gt,borderRadius:H,[`input${He}-input`]:{height:k-2*qe}},"&-sm":{padding:0,borderRadius:Ne,[`input${He}-input`]:{height:D-2*qe,padding:`0 ${U}px`}},"&:hover":Object.assign({},(0,Ye.pU)(Fe)),"&-focused":Object.assign({},(0,Ye.M1)(Fe)),"&-out-of-range":{[`${He}-input-wrap`]:{input:{color:ut}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,Et.Wf)(Fe)),(0,Ye.s7)(Fe)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${He}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${He}-group-addon`]:{borderRadius:H,fontSize:Fe.fontSizeLG}},"&-sm":{[`${He}-group-addon`]:{borderRadius:Ne}},[`${He}-wrapper-disabled > ${He}-group-addon`]:Object.assign({},(0,Ye.Xy)(Fe))}}),[`&-disabled ${He}-input`]:{cursor:"not-allowed"},[He]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,Et.Wf)(Fe)),{width:"100%",padding:`${Ze}px ${Ue}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:Pt,outline:0,transition:`all ${Tr} linear`,appearance:"textfield",fontSize:"inherit"}),(0,Ye.nz)(Fe.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[He]:Object.assign(Object.assign(Object.assign({[`&:hover ${He}-handler-wrap, &-focused ${He}-handler-wrap`]:{opacity:1},[`${He}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:Fe.handleWidth,height:"100%",background:G,borderStartStartRadius:0,borderStartEndRadius:Pt,borderEndEndRadius:Pt,borderEndStartRadius:0,opacity:Se===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${Tr} linear ${Tr}`,[`${He}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${He}-handler-up-inner,
${He}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:Fe.handleFontSize}}},[`${He}-handler`]:{height:"50%",overflow:"hidden",color:he,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${qe}px ${Dt} ${qt}`,transition:`all ${Tr} linear`,"&:active":{background:pe},"&:hover":{height:"60%",[`
${He}-handler-up-inner,
${He}-handler-down-inner
`]:{color:Ee}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,Et.Ro)()),{color:he,transition:`all ${Tr} linear`,userSelect:"none"})},[`${He}-handler-up`]:{borderStartEndRadius:Pt},[`${He}-handler-down`]:{borderBlockStart:`${qe}px ${Dt} ${qt}`,borderEndEndRadius:Pt}},et(Fe,"lg")),et(Fe,"sm")),{"&-disabled, &-readonly":{[`${He}-handler-wrap`]:{display:"none"},[`${He}-input`]:{color:"inherit"}},[`
${He}-handler-up-disabled,
${He}-handler-down-disabled
`]:{cursor:"not-allowed"},[`
${He}-handler-up-disabled:hover &-handler-up-inner,
${He}-handler-down-disabled:hover &-handler-down-inner
`]:{color:_e}})},{[`${He}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${He}-handler-down`]:{borderBlockStartWidth:0}}}]},vt=Fe=>{const{componentCls:He,paddingBlock:qe,paddingInline:Dt,inputAffixPadding:St,controlWidth:Pt,borderRadiusLG:Gt,borderRadiusSM:k}=Fe;return{[`${He}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,Ye.ik)(Fe)),(0,Ye.bi)(Fe,`${He}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:Pt,padding:0,paddingInlineStart:Dt,"&-lg":{borderRadius:Gt},"&-sm":{borderRadius:k},[`&:not(${He}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,Ye.pU)(Fe)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${He}-disabled`]:{background:"transparent"},[`> div${He}`]:{width:"100%",border:"none",outline:"none",[`&${He}-focused`]:{boxShadow:"none !important"}},[`input${He}-input`]:{padding:`${qe}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${He}-handler-wrap`]:{zIndex:2},[He]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:St},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Dt,marginInlineStart:St}}})}};var Ut=(0,ge.Z)("InputNumber",Fe=>{const He=(0,Be.TS)(Fe,(0,Ye.e5)(Fe));return[gt(He),vt(He),(0,Tt.c)(He)]},Fe=>Object.assign(Object.assign({},(0,Ye.TM)(Fe)),{controlWidth:90,handleWidth:Fe.controlHeightSM-Fe.lineWidth*2,handleFontSize:Fe.fontSize/2,handleVisible:"auto",handleActiveBg:Fe.colorFillAlter,handleBg:Fe.colorBgContainer,handleHoverColor:Fe.colorPrimary,handleBorderColor:Fe.colorBorder})),hr=function(Fe,He){var qe={};for(var Dt in Fe)Object.prototype.hasOwnProperty.call(Fe,Dt)&&He.indexOf(Dt)<0&&(qe[Dt]=Fe[Dt]);if(Fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var St=0,Dt=Object.getOwnPropertySymbols(Fe);St<Dt.length;St++)He.indexOf(Dt[St])<0&&Object.prototype.propertyIsEnumerable.call(Fe,Dt[St])&&(qe[Dt[St]]=Fe[Dt[St]]);return qe};const Yt=Ve.forwardRef((Fe,He)=>{const{getPrefixCls:qe,direction:Dt}=Ve.useContext(hn.E_),St=Ve.useRef(null);Ve.useImperativeHandle(He,()=>St.current);const{className:Pt,rootClassName:Gt,size:k,disabled:D,prefixCls:ut,addonBefore:U,addonAfter:he,prefix:Tr,bordered:Ee=!0,readOnly:Ue,status:Ze,controls:G}=Fe,pe=hr(Fe,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),_e=qe("input-number",ut),[Ne,H]=Ut(_e),{compactSize:Vt,compactItemClassnames:Se}=(0,mt.ri)(_e,Dt);let qt=Ve.createElement(Le.Z,{className:`${_e}-handler-up-inner`}),vr=Ve.createElement(Ce.Z,{className:`${_e}-handler-down-inner`});const Xr=typeof G=="boolean"?G:void 0;typeof G=="object"&&(qt=typeof G.upIcon=="undefined"?qt:Ve.createElement("span",{className:`${_e}-handler-up-inner`},G.upIcon),vr=typeof G.downIcon=="undefined"?vr:Ve.createElement("span",{className:`${_e}-handler-down-inner`},G.downIcon));const{hasFeedback:An,status:Kr,isFormItemInput:yr,feedbackIcon:gn}=Ve.useContext(We.aM),fe=(0,Rr.F)(Kr,Ze),Ae=(0,zr.Z)(Jt=>{var xr;return(xr=k!=null?k:Vt)!==null&&xr!==void 0?xr:Jt}),Ct=Ve.useContext(an.Z),at=D!=null?D:Ct,xt=Ge()({[`${_e}-lg`]:Ae==="large",[`${_e}-sm`]:Ae==="small",[`${_e}-rtl`]:Dt==="rtl",[`${_e}-borderless`]:!Ee,[`${_e}-in-form-item`]:yr},(0,Rr.Z)(_e,fe),Se,H),Ot=`${_e}-group`,ir=Ve.createElement(Gr,Object.assign({ref:St,disabled:at,className:Ge()(Pt,Gt),upHandler:qt,downHandler:vr,prefixCls:_e,readOnly:Ue,controls:Xr,prefix:Tr,suffix:An&&gn,addonAfter:he&&Ve.createElement(mt.BR,null,Ve.createElement(We.Ux,{override:!0,status:!0},he)),addonBefore:U&&Ve.createElement(mt.BR,null,Ve.createElement(We.Ux,{override:!0,status:!0},U)),classNames:{input:xt},classes:{affixWrapper:Ge()((0,Rr.Z)(`${_e}-affix-wrapper`,fe,An),{[`${_e}-affix-wrapper-sm`]:Ae==="small",[`${_e}-affix-wrapper-lg`]:Ae==="large",[`${_e}-affix-wrapper-rtl`]:Dt==="rtl",[`${_e}-affix-wrapper-borderless`]:!Ee},H),wrapper:Ge()({[`${Ot}-rtl`]:Dt==="rtl",[`${_e}-wrapper-disabled`]:at},H),group:Ge()({[`${_e}-group-wrapper-sm`]:Ae==="small",[`${_e}-group-wrapper-lg`]:Ae==="large",[`${_e}-group-wrapper-rtl`]:Dt==="rtl"},(0,Rr.Z)(`${_e}-group-wrapper`,fe,An),H)}},pe));return Ne(ir)}),Ke=Yt,$t=Fe=>Ve.createElement(Nr.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},Ve.createElement(Yt,Object.assign({},Fe)));Ke._InternalPanelDoNotUseOrYouWillBeFired=$t;var cr=Ke},9937:function(Ir,Mt,Y){"use strict";Y.d(Mt,{M1:function(){return Pe},TM:function(){return le},Xy:function(){return $},bi:function(){return V},e5:function(){return Z},ik:function(){return A},nz:function(){return Oe},pU:function(){return me},s7:function(){return b},x0:function(){return te}});var Ce=Y(17313),Le=Y(74207),Xe=Y(37613),Ge=Y(83116);const Oe=P=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:P,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),me=P=>({borderColor:P.hoverBorderColor}),Pe=P=>({borderColor:P.activeBorderColor,boxShadow:P.activeShadow,outline:0}),$=P=>({color:P.colorTextDisabled,backgroundColor:P.colorBgContainerDisabled,borderColor:P.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},me((0,Xe.TS)(P,{hoverBorderColor:P.colorBorder})))}),c=P=>{const{paddingBlockLG:ae,fontSizeLG:Te,lineHeightLG:ye,borderRadiusLG:Je,paddingInlineLG:Ve}=P;return{padding:`${ae}px ${Ve}px`,fontSize:Te,lineHeight:ye,borderRadius:Je}},te=P=>({padding:`${P.paddingBlockSM}px ${P.paddingInlineSM}px`,borderRadius:P.borderRadiusSM}),V=(P,ae)=>{const{componentCls:Te,colorError:ye,colorWarning:Je,errorActiveShadow:Ve,warningActiveShadow:st,colorErrorBorderHover:ft,colorWarningBorderHover:ie}=P;return{[`&-status-error:not(${ae}-disabled):not(${ae}-borderless)${ae}`]:{borderColor:ye,"&:hover":{borderColor:ft},"&:focus, &-focused":Object.assign({},Pe((0,Xe.TS)(P,{activeBorderColor:ye,activeShadow:Ve}))),[`${Te}-prefix, ${Te}-suffix`]:{color:ye}},[`&-status-warning:not(${ae}-disabled):not(${ae}-borderless)${ae}`]:{borderColor:Je,"&:hover":{borderColor:ie},"&:focus, &-focused":Object.assign({},Pe((0,Xe.TS)(P,{activeBorderColor:Je,activeShadow:st}))),[`${Te}-prefix, ${Te}-suffix`]:{color:Je}}}},A=P=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${P.paddingBlock}px ${P.paddingInline}px`,color:P.colorText,fontSize:P.fontSize,lineHeight:P.lineHeight,backgroundColor:P.colorBgContainer,backgroundImage:"none",borderWidth:P.lineWidth,borderStyle:P.lineType,borderColor:P.colorBorder,borderRadius:P.borderRadius,transition:`all ${P.motionDurationMid}`},Oe(P.colorTextPlaceholder)),{"&:hover":Object.assign({},me(P)),"&:focus, &-focused":Object.assign({},Pe(P)),"&-disabled, &[disabled]":Object.assign({},$(P)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:P.controlHeight,lineHeight:P.lineHeight,verticalAlign:"bottom",transition:`all ${P.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},c(P)),"&-sm":Object.assign({},te(P)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),b=P=>{const{componentCls:ae,antCls:Te}=P;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:P.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${ae}, &-lg > ${ae}-group-addon`]:Object.assign({},c(P)),[`&-sm ${ae}, &-sm > ${ae}-group-addon`]:Object.assign({},te(P)),[`&-lg ${Te}-select-single ${Te}-select-selector`]:{height:P.controlHeightLG},[`&-sm ${Te}-select-single ${Te}-select-selector`]:{height:P.controlHeightSM},[`> ${ae}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${ae}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${P.paddingInline}px`,color:P.colorText,fontWeight:"normal",fontSize:P.fontSize,textAlign:"center",backgroundColor:P.colorFillAlter,border:`${P.lineWidth}px ${P.lineType} ${P.colorBorder}`,borderRadius:P.borderRadius,transition:`all ${P.motionDurationSlow}`,lineHeight:1,[`${Te}-select`]:{margin:`-${P.paddingBlock+1}px -${P.paddingInline}px`,[`&${Te}-select-single:not(${Te}-select-customize-input)`]:{[`${Te}-select-selector`]:{backgroundColor:"inherit",border:`${P.lineWidth}px ${P.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Te}-select-selector`]:{color:P.colorPrimary}}},[`${Te}-cascader-picker`]:{margin:`-9px -${P.paddingInline}px`,backgroundColor:"transparent",[`${Te}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${ae}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${ae}-search-with-button &`]:{zIndex:0}}},[`> ${ae}:first-child, ${ae}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${Te}-select ${Te}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${ae}-affix-wrapper`]:{[`&:not(:first-child) ${ae}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${ae}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${ae}:last-child, ${ae}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${Te}-select ${Te}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${ae}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${ae}-search &`]:{borderStartStartRadius:P.borderRadius,borderEndStartRadius:P.borderRadius}},[`&:not(:first-child), ${ae}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${ae}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,Ce.dF)()),{[`${ae}-group-addon, ${ae}-group-wrap, > ${ae}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:P.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${ae}-affix-wrapper,
& > ${ae}-number-affix-wrapper,
& > ${Te}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-P.lineWidth,borderInlineEndWidth:P.lineWidth},[`${ae}`]:{float:"none"},[`& > ${Te}-select > ${Te}-select-selector,
& > ${Te}-select-auto-complete ${ae},
& > ${Te}-cascader-picker ${ae},
& > ${ae}-group-wrapper ${ae}`]:{borderInlineEndWidth:P.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Te}-select-focused`]:{zIndex:1},[`& > ${Te}-select > ${Te}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${Te}-select:first-child > ${Te}-select-selector,
& > ${Te}-select-auto-complete:first-child ${ae},
& > ${Te}-cascader-picker:first-child ${ae}`]:{borderStartStartRadius:P.borderRadius,borderEndStartRadius:P.borderRadius},[`& > *:last-child,
& > ${Te}-select:last-child > ${Te}-select-selector,
& > ${Te}-cascader-picker:last-child ${ae},
& > ${Te}-cascader-picker-focused:last-child ${ae}`]:{borderInlineEndWidth:P.lineWidth,borderStartEndRadius:P.borderRadius,borderEndEndRadius:P.borderRadius},[`& > ${Te}-select-auto-complete ${ae}`]:{verticalAlign:"top"},[`${ae}-group-wrapper + ${ae}-group-wrapper`]:{marginInlineStart:-P.lineWidth,[`${ae}-affix-wrapper`]:{borderRadius:0}},[`${ae}-group-wrapper:not(:last-child)`]:{[`&${ae}-search > ${ae}-group`]:{[`& > ${ae}-group-addon > ${ae}-search-button`]:{borderRadius:0},[`& > ${ae}`]:{borderStartStartRadius:P.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:P.borderRadius}}}})}},M=P=>{const{componentCls:ae,controlHeightSM:Te,lineWidth:ye}=P,Ve=(Te-ye*2-16)/2;return{[ae]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ce.Wf)(P)),A(P)),V(P,ae)),{'&[type="color"]':{height:P.controlHeight,[`&${ae}-lg`]:{height:P.controlHeightLG},[`&${ae}-sm`]:{height:Te,paddingTop:Ve,paddingBottom:Ve}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},I=P=>{const{componentCls:ae}=P;return{[`${ae}-clear-icon`]:{margin:0,color:P.colorTextQuaternary,fontSize:P.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${P.motionDurationSlow}`,"&:hover":{color:P.colorTextTertiary},"&:active":{color:P.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${P.inputAffixPadding}px`}}}},re=P=>{const{componentCls:ae,inputAffixPadding:Te,colorTextDescription:ye,motionDurationSlow:Je,colorIcon:Ve,colorIconHover:st,iconCls:ft}=P;return{[`${ae}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},A(P)),{display:"inline-flex",[`&:not(${ae}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},me(P)),{zIndex:1,[`${ae}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${ae}[disabled]`]:{background:"transparent"}},[`> input${ae}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${ae}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:P.paddingXS}},"&-show-count-suffix":{color:ye},"&-show-count-has-suffix":{marginInlineEnd:P.paddingXXS},"&-prefix":{marginInlineEnd:Te},"&-suffix":{marginInlineStart:Te}}}),I(P)),{[`${ft}${ae}-password-icon`]:{color:Ve,cursor:"pointer",transition:`all ${Je}`,"&:hover":{color:st}}}),V(P,`${ae}-affix-wrapper`))}},se=P=>{const{componentCls:ae,colorError:Te,colorWarning:ye,borderRadiusLG:Je,borderRadiusSM:Ve}=P;return{[`${ae}-group`]:Object.assign(Object.assign(Object.assign({},(0,Ce.Wf)(P)),b(P)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${ae}-group-addon`]:{borderRadius:Je,fontSize:P.fontSizeLG}},"&-sm":{[`${ae}-group-addon`]:{borderRadius:Ve}},"&-status-error":{[`${ae}-group-addon`]:{color:Te,borderColor:Te}},"&-status-warning":{[`${ae}-group-addon`]:{color:ye,borderColor:ye}},"&-disabled":{[`${ae}-group-addon`]:Object.assign({},$(P))},[`&:not(${ae}-compact-first-item):not(${ae}-compact-last-item)${ae}-compact-item`]:{[`${ae}, ${ae}-group-addon`]:{borderRadius:0}},[`&:not(${ae}-compact-last-item)${ae}-compact-first-item`]:{[`${ae}, ${ae}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${ae}-compact-first-item)${ae}-compact-last-item`]:{[`${ae}, ${ae}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},q=P=>{const{componentCls:ae,antCls:Te}=P,ye=`${ae}-search`;return{[ye]:{[`${ae}`]:{"&:hover, &:focus":{borderColor:P.colorPrimaryHover,[`+ ${ae}-group-addon ${ye}-button:not(${Te}-btn-primary)`]:{borderInlineStartColor:P.colorPrimaryHover}}},[`${ae}-affix-wrapper`]:{borderRadius:0},[`${ae}-lg`]:{lineHeight:P.lineHeightLG-2e-4},[`> ${ae}-group`]:{[`> ${ae}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${ye}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:P.borderRadius,borderEndEndRadius:P.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${ye}-button:not(${Te}-btn-primary)`]:{color:P.colorTextDescription,"&:hover":{color:P.colorPrimaryHover},"&:active":{color:P.colorPrimaryActive},[`&${Te}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${ye}-button`]:{height:P.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${ye}-button`]:{height:P.controlHeightLG},[`&-small ${ye}-button`]:{height:P.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${ae}-compact-item`]:{[`&:not(${ae}-compact-last-item)`]:{[`${ae}-group-addon`]:{[`${ae}-search-button`]:{marginInlineEnd:-P.lineWidth,borderRadius:0}}},[`&:not(${ae}-compact-first-item)`]:{[`${ae},${ae}-affix-wrapper`]:{borderRadius:0}},[`> ${ae}-group-addon ${ae}-search-button,
> ${ae},
${ae}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${ae}-affix-wrapper-focused`]:{zIndex:2}}}}},W=P=>{const{componentCls:ae,paddingLG:Te}=P,ye=`${ae}-textarea`;return{[ye]:{position:"relative","&-show-count":{[`> ${ae}`]:{height:"100%"},[`${ae}-data-count`]:{position:"absolute",bottom:-P.fontSize*P.lineHeight,insetInlineEnd:0,color:P.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${ae}`]:{paddingInlineEnd:Te}},[`&-affix-wrapper${ye}-has-feedback`]:{[`${ae}`]:{paddingInlineEnd:Te}},[`&-affix-wrapper${ae}-affix-wrapper`]:{padding:0,[`> textarea${ae}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${ae}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${ae}-clear-icon`]:{position:"absolute",insetInlineEnd:P.paddingXS,insetBlockStart:P.paddingXS},[`${ye}-suffix`]:{position:"absolute",top:0,insetInlineEnd:P.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function Z(P){return(0,Xe.TS)(P,{inputAffixPadding:P.paddingXXS})}const le=P=>{const{controlHeight:ae,fontSize:Te,lineHeight:ye,lineWidth:Je,controlHeightSM:Ve,controlHeightLG:st,fontSizeLG:ft,lineHeightLG:ie,paddingSM:Q,controlPaddingHorizontalSM:ue,controlPaddingHorizontal:ce,colorFillAlter:De,colorPrimaryHover:xe,controlOutlineWidth:C,controlOutline:B,colorErrorOutline:ee,colorWarningOutline:we}=P;return{paddingBlock:Math.max(Math.round((ae-Te*ye)/2*10)/10-Je,3),paddingBlockSM:Math.max(Math.round((Ve-Te*ye)/2*10)/10-Je,0),paddingBlockLG:Math.ceil((st-ft*ie)/2*10)/10-Je,paddingInline:Q-Je,paddingInlineSM:ue-Je,paddingInlineLG:ce-Je,addonBg:De,activeBorderColor:xe,hoverBorderColor:xe,activeShadow:`0 0 0 ${C}px ${B}`,errorActiveShadow:`0 0 0 ${C}px ${ee}`,warningActiveShadow:`0 0 0 ${C}px ${we}`}};Mt.ZP=(0,Ge.Z)("Input",P=>{const ae=(0,Xe.TS)(P,Z(P));return[M(ae),W(ae),re(ae),se(ae),q(ae),(0,Le.c)(ae)]},le)},5112:function(Ir,Mt,Y){"use strict";Y.d(Mt,{ZP:function(){return B}});var Ce=Y(92310),Le=Y.n(Ce),Xe=Y(18929),Ge=Y(26112),Oe=Y(59301),me=Y(36355),Pe=Y(19716);const $=Oe.createContext(null),c=$.Provider;var te=$;const V=Oe.createContext(null),A=V.Provider;var b=Y(5630),M=Y(8654),I=Y(1684),re=Y(32441),se=Y(17313),q=Y(83116),W=Y(37613);const Z=ee=>{const{componentCls:we,antCls:rt}=ee,tt=`${we}-group`;return{[tt]:Object.assign(Object.assign({},(0,se.Wf)(ee)),{display:"inline-block",fontSize:0,[`&${tt}-rtl`]:{direction:"rtl"},[`${rt}-badge ${rt}-badge-count`]:{zIndex:1},[`> ${rt}-badge:not(:first-child) > ${rt}-button-wrapper`]:{borderInlineStart:"none"}})}},le=ee=>{const{componentCls:we,wrapperMarginInlineEnd:rt,colorPrimary:tt,radioSize:ot,motionDurationSlow:je,motionDurationMid:nr,motionEaseInOutCirc:Kt,colorBgContainer:Lt,colorBorder:Gr,lineWidth:Rr,dotSize:hn,colorBgContainerDisabled:Nr,colorTextDisabled:an,paddingXS:zr,dotColorDisabled:We,lineType:mt,radioDotDisabledSize:Ye,wireframe:Et,colorWhite:Tt}=ee,ge=`${we}-inner`;return{[`${we}-wrapper`]:Object.assign(Object.assign({},(0,se.Wf)(ee)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:rt,cursor:"pointer",[`&${we}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:ee.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${we}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Rr}px ${mt} ${tt}`,borderRadius:"50%",visibility:"hidden",content:'""'},[we]:Object.assign(Object.assign({},(0,se.Wf)(ee)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${we}-wrapper:hover &,
&:hover ${ge}`]:{borderColor:tt},[`${we}-input:focus-visible + ${ge}`]:Object.assign({},(0,se.oN)(ee)),[`${we}:hover::after, ${we}-wrapper:hover &::after`]:{visibility:"visible"},[`${we}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:ot,height:ot,marginBlockStart:ot/-2,marginInlineStart:ot/-2,backgroundColor:Et?tt:Tt,borderBlockStart:0,borderInlineStart:0,borderRadius:ot,transform:"scale(0)",opacity:0,transition:`all ${je} ${Kt}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:ot,height:ot,backgroundColor:Lt,borderColor:Gr,borderStyle:"solid",borderWidth:Rr,borderRadius:"50%",transition:`all ${nr}`},[`${we}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${we}-checked`]:{[ge]:{borderColor:tt,backgroundColor:Et?Lt:tt,"&::after":{transform:`scale(${hn/ot})`,opacity:1,transition:`all ${je} ${Kt}`}}},[`${we}-disabled`]:{cursor:"not-allowed",[ge]:{backgroundColor:Nr,borderColor:Gr,cursor:"not-allowed","&::after":{backgroundColor:We}},[`${we}-input`]:{cursor:"not-allowed"},[`${we}-disabled + span`]:{color:an,cursor:"not-allowed"},[`&${we}-checked`]:{[ge]:{"&::after":{transform:`scale(${Ye/ot})`}}}},[`span${we} + *`]:{paddingInlineStart:zr,paddingInlineEnd:zr}})}},P=ee=>{const{buttonColor:we,controlHeight:rt,componentCls:tt,lineWidth:ot,lineType:je,colorBorder:nr,motionDurationSlow:Kt,motionDurationMid:Lt,buttonPaddingInline:Gr,fontSize:Rr,buttonBg:hn,fontSizeLG:Nr,controlHeightLG:an,controlHeightSM:zr,paddingXS:We,borderRadius:mt,borderRadiusSM:Ye,borderRadiusLG:Et,buttonCheckedBg:Tt,buttonSolidCheckedColor:ge,colorTextDisabled:Be,colorBgContainerDisabled:et,buttonCheckedBgDisabled:gt,buttonCheckedColorDisabled:vt,colorPrimary:Ut,colorPrimaryHover:hr,colorPrimaryActive:Yt,buttonSolidCheckedBg:Ke,buttonSolidCheckedHoverBg:$t,buttonSolidCheckedActiveBg:cr}=ee;return{[`${tt}-button-wrapper`]:{position:"relative",display:"inline-block",height:rt,margin:0,paddingInline:Gr,paddingBlock:0,color:we,fontSize:Rr,lineHeight:`${rt-ot*2}px`,background:hn,border:`${ot}px ${je} ${nr}`,borderBlockStartWidth:ot+.02,borderInlineStartWidth:0,borderInlineEndWidth:ot,cursor:"pointer",transition:[`color ${Lt}`,`background ${Lt}`,`box-shadow ${Lt}`].join(","),a:{color:we},[`> ${tt}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-ot,insetInlineStart:-ot,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:ot,paddingInline:0,backgroundColor:nr,transition:`background-color ${Kt}`,content:'""'}},"&:first-child":{borderInlineStart:`${ot}px ${je} ${nr}`,borderStartStartRadius:mt,borderEndStartRadius:mt},"&:last-child":{borderStartEndRadius:mt,borderEndEndRadius:mt},"&:first-child:last-child":{borderRadius:mt},[`${tt}-group-large &`]:{height:an,fontSize:Nr,lineHeight:`${an-ot*2}px`,"&:first-child":{borderStartStartRadius:Et,borderEndStartRadius:Et},"&:last-child":{borderStartEndRadius:Et,borderEndEndRadius:Et}},[`${tt}-group-small &`]:{height:zr,paddingInline:We-ot,paddingBlock:0,lineHeight:`${zr-ot*2}px`,"&:first-child":{borderStartStartRadius:Ye,borderEndStartRadius:Ye},"&:last-child":{borderStartEndRadius:Ye,borderEndEndRadius:Ye}},"&:hover":{position:"relative",color:Ut},"&:has(:focus-visible)":Object.assign({},(0,se.oN)(ee)),[`${tt}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${tt}-button-wrapper-disabled)`]:{zIndex:1,color:Ut,background:Tt,borderColor:Ut,"&::before":{backgroundColor:Ut},"&:first-child":{borderColor:Ut},"&:hover":{color:hr,borderColor:hr,"&::before":{backgroundColor:hr}},"&:active":{color:Yt,borderColor:Yt,"&::before":{backgroundColor:Yt}}},[`${tt}-group-solid &-checked:not(${tt}-button-wrapper-disabled)`]:{color:ge,background:Ke,borderColor:Ke,"&:hover":{color:ge,background:$t,borderColor:$t},"&:active":{color:ge,background:cr,borderColor:cr}},"&-disabled":{color:Be,backgroundColor:et,borderColor:nr,cursor:"not-allowed","&:first-child, &:hover":{color:Be,backgroundColor:et,borderColor:nr}},[`&-disabled${tt}-button-wrapper-checked`]:{color:vt,backgroundColor:gt,borderColor:nr,boxShadow:"none"}}}},ae=ee=>ee-4*2;var Te=(0,q.Z)("Radio",ee=>{const{controlOutline:we,controlOutlineWidth:rt,radioSize:tt}=ee,ot=`0 0 0 ${rt}px ${we}`,je=ot,nr=ae(tt),Kt=(0,W.TS)(ee,{radioDotDisabledSize:nr,radioFocusShadow:ot,radioButtonFocusShadow:je});return[Z(Kt),le(Kt),P(Kt)]},ee=>{const{wireframe:we,padding:rt,marginXS:tt,lineWidth:ot,fontSizeLG:je,colorText:nr,colorBgContainer:Kt,colorTextDisabled:Lt,controlItemBgActiveDisabled:Gr,colorTextLightSolid:Rr,colorPrimary:hn,colorPrimaryHover:Nr,colorPrimaryActive:an}=ee,zr=4,We=je,mt=we?ae(We):We-(zr+ot)*2;return{radioSize:We,dotSize:mt,dotColorDisabled:Lt,buttonSolidCheckedColor:Rr,buttonSolidCheckedBg:hn,buttonSolidCheckedHoverBg:Nr,buttonSolidCheckedActiveBg:an,buttonBg:Kt,buttonCheckedBg:Kt,buttonColor:nr,buttonCheckedBgDisabled:Gr,buttonCheckedColorDisabled:Lt,buttonPaddingInline:rt-ot,wrapperMarginInlineEnd:tt}}),ye=Y(14088),Je=Y(4572),Ve=function(ee,we){var rt={};for(var tt in ee)Object.prototype.hasOwnProperty.call(ee,tt)&&we.indexOf(tt)<0&&(rt[tt]=ee[tt]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ot=0,tt=Object.getOwnPropertySymbols(ee);ot<tt.length;ot++)we.indexOf(tt[ot])<0&&Object.prototype.propertyIsEnumerable.call(ee,tt[ot])&&(rt[tt[ot]]=ee[tt[ot]]);return rt};const st=(ee,we)=>{var rt,tt;const ot=Oe.useContext(te),je=Oe.useContext(V),{getPrefixCls:nr,direction:Kt,radio:Lt}=Oe.useContext(me.E_),Gr=Oe.useRef(null),Rr=(0,M.sQ)(we,Gr),{isFormItemInput:hn}=Oe.useContext(re.aM),Nr=Yt=>{var Ke,$t;(Ke=ee.onChange)===null||Ke===void 0||Ke.call(ee,Yt),($t=ot==null?void 0:ot.onChange)===null||$t===void 0||$t.call(ot,Yt)},{prefixCls:an,className:zr,rootClassName:We,children:mt,style:Ye}=ee,Et=Ve(ee,["prefixCls","className","rootClassName","children","style"]),Tt=nr("radio",an),ge=((ot==null?void 0:ot.optionType)||je)==="button",Be=ge?`${Tt}-button`:Tt,[et,gt]=Te(Tt),vt=Object.assign({},Et),Ut=Oe.useContext(I.Z);ot&&(vt.name=ot.name,vt.onChange=Nr,vt.checked=ee.value===ot.value,vt.disabled=(rt=vt.disabled)!==null&&rt!==void 0?rt:ot.disabled),vt.disabled=(tt=vt.disabled)!==null&&tt!==void 0?tt:Ut;const hr=Le()(`${Be}-wrapper`,{[`${Be}-wrapper-checked`]:vt.checked,[`${Be}-wrapper-disabled`]:vt.disabled,[`${Be}-wrapper-rtl`]:Kt==="rtl",[`${Be}-wrapper-in-form-item`]:hn},Lt==null?void 0:Lt.className,zr,We,gt);return et(Oe.createElement(ye.Z,{component:"Radio",disabled:vt.disabled},Oe.createElement("label",{className:hr,style:Object.assign(Object.assign({},Lt==null?void 0:Lt.style),Ye),onMouseEnter:ee.onMouseEnter,onMouseLeave:ee.onMouseLeave},Oe.createElement(b.Z,Object.assign({},vt,{className:Le()(vt.className,!ge&&Je.A),type:"radio",prefixCls:Be,ref:Rr})),mt!==void 0?Oe.createElement("span",null,mt):null)))};var ie=Oe.forwardRef(st);const Q=Oe.forwardRef((ee,we)=>{const{getPrefixCls:rt,direction:tt}=Oe.useContext(me.E_),[ot,je]=(0,Xe.Z)(ee.defaultValue,{value:ee.value}),nr=Ke=>{const $t=ot,cr=Ke.target.value;"value"in ee||je(cr);const{onChange:Fe}=ee;Fe&&cr!==$t&&Fe(Ke)},{prefixCls:Kt,className:Lt,rootClassName:Gr,options:Rr,buttonStyle:hn="outline",disabled:Nr,children:an,size:zr,style:We,id:mt,onMouseEnter:Ye,onMouseLeave:Et,onFocus:Tt,onBlur:ge}=ee,Be=rt("radio",Kt),et=`${Be}-group`,[gt,vt]=Te(Be);let Ut=an;Rr&&Rr.length>0&&(Ut=Rr.map(Ke=>typeof Ke=="string"||typeof Ke=="number"?Oe.createElement(ie,{key:Ke.toString(),prefixCls:Be,disabled:Nr,value:Ke,checked:ot===Ke},Ke):Oe.createElement(ie,{key:`radio-group-value-options-${Ke.value}`,prefixCls:Be,disabled:Ke.disabled||Nr,value:Ke.value,checked:ot===Ke.value,title:Ke.title,style:Ke.style},Ke.label)));const hr=(0,Pe.Z)(zr),Yt=Le()(et,`${et}-${hn}`,{[`${et}-${hr}`]:hr,[`${et}-rtl`]:tt==="rtl"},Lt,Gr,vt);return gt(Oe.createElement("div",Object.assign({},(0,Ge.Z)(ee,{aria:!0,data:!0}),{className:Yt,style:We,onMouseEnter:Ye,onMouseLeave:Et,onFocus:Tt,onBlur:ge,id:mt,ref:we}),Oe.createElement(c,{value:{onChange:nr,value:ot,disabled:ee.disabled,name:ee.name,optionType:ee.optionType}},Ut)))});var ue=Oe.memo(Q),ce=function(ee,we){var rt={};for(var tt in ee)Object.prototype.hasOwnProperty.call(ee,tt)&&we.indexOf(tt)<0&&(rt[tt]=ee[tt]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ot=0,tt=Object.getOwnPropertySymbols(ee);ot<tt.length;ot++)we.indexOf(tt[ot])<0&&Object.prototype.propertyIsEnumerable.call(ee,tt[ot])&&(rt[tt[ot]]=ee[tt[ot]]);return rt};const De=(ee,we)=>{const{getPrefixCls:rt}=Oe.useContext(me.E_),{prefixCls:tt}=ee,ot=ce(ee,["prefixCls"]),je=rt("radio",tt);return Oe.createElement(A,{value:"button"},Oe.createElement(ie,Object.assign({prefixCls:je},ot,{type:"radio",ref:we})))};var xe=Oe.forwardRef(De);const C=ie;C.Button=xe,C.Group=ue,C.__ANT_RADIO=!0;var B=C},8378:function(Ir,Mt){"use strict";const Y=Ce=>({[Ce.componentCls]:{[`${Ce.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${Ce.motionDurationMid} ${Ce.motionEaseInOut},
opacity ${Ce.motionDurationMid} ${Ce.motionEaseInOut} !important`}},[`${Ce.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${Ce.motionDurationMid} ${Ce.motionEaseInOut},
opacity ${Ce.motionDurationMid} ${Ce.motionEaseInOut} !important`}}});Mt.Z=Y},92899:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Fm:function(){return A}});var Ce=Y(93083),Le=Y(95406);const Xe=new Ce.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ge=new Ce.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),Oe=new Ce.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),me=new Ce.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Pe=new Ce.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),$=new Ce.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),c=new Ce.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),te=new Ce.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),V={"move-up":{inKeyframes:c,outKeyframes:te},"move-down":{inKeyframes:Xe,outKeyframes:Ge},"move-left":{inKeyframes:Oe,outKeyframes:me},"move-right":{inKeyframes:Pe,outKeyframes:$}},A=(b,M)=>{const{antCls:I}=b,re=`${I}-${M}`,{inKeyframes:se,outKeyframes:q}=V[M];return[(0,Le.R)(re,se,q,b.motionDurationMid),{[`
${re}-enter,
${re}-appear
`]:{opacity:0,animationTimingFunction:b.motionEaseOutCirc},[`${re}-leave`]:{animationTimingFunction:b.motionEaseInOutCirc}}]}},13826:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Qt:function(){return Oe},Uw:function(){return Ge},fJ:function(){return Xe},ly:function(){return me},oN:function(){return A}});var Ce=Y(93083),Le=Y(95406);const Xe=new Ce.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),Ge=new Ce.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),Oe=new Ce.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),me=new Ce.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Pe=new Ce.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),$=new Ce.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),c=new Ce.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),te=new Ce.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),V={"slide-up":{inKeyframes:Xe,outKeyframes:Ge},"slide-down":{inKeyframes:Oe,outKeyframes:me},"slide-left":{inKeyframes:Pe,outKeyframes:$},"slide-right":{inKeyframes:c,outKeyframes:te}},A=(b,M)=>{const{antCls:I}=b,re=`${I}-${M}`,{inKeyframes:se,outKeyframes:q}=V[M];return[(0,Le.R)(re,se,q,b.motionDurationMid),{[`
${re}-enter,
${re}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:b.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${re}-leave`]:{animationTimingFunction:b.motionEaseInQuint}}]}},19447:function(Ir,Mt,Y){"use strict";Y.d(Mt,{ZP:function(){return Oe},fS:function(){return Xe},qN:function(){return Le}});var Ce=Y(47585);const Le=8;function Xe(me){const Pe=Le,{contentRadius:$,limitVerticalRadius:c}=me,te=$>12?$+2:12;return{dropdownArrowOffset:te,dropdownArrowOffsetVertical:c?Pe:te}}function Ge(me,Pe){return me?Pe:{}}function Oe(me,Pe){const{componentCls:$,sizePopupArrow:c,borderRadiusXS:te,borderRadiusOuter:V,boxShadowPopoverArrow:A}=me,{colorBg:b,contentRadius:M=me.borderRadiusLG,limitVerticalRadius:I,arrowDistance:re=0,arrowPlacement:se={left:!0,right:!0,top:!0,bottom:!0}}=Pe,{dropdownArrowOffsetVertical:q,dropdownArrowOffset:W}=Xe({contentRadius:M,limitVerticalRadius:I});return{[$]:Object.assign(Object.assign(Object.assign(Object.assign({[`${$}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,Ce.r)(c,te,V,b,A)),{"&:before":{background:b}})]},Ge(!!se.top,{[[`&-placement-top ${$}-arrow`,`&-placement-topLeft ${$}-arrow`,`&-placement-topRight ${$}-arrow`].join(",")]:{bottom:re,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${$}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${$}-arrow`]:{left:{_skip_check_:!0,value:W}},[`&-placement-topRight ${$}-arrow`]:{right:{_skip_check_:!0,value:W}}})),Ge(!!se.bottom,{[[`&-placement-bottom ${$}-arrow`,`&-placement-bottomLeft ${$}-arrow`,`&-placement-bottomRight ${$}-arrow`].join(",")]:{top:re,transform:"translateY(-100%)"},[`&-placement-bottom ${$}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${$}-arrow`]:{left:{_skip_check_:!0,value:W}},[`&-placement-bottomRight ${$}-arrow`]:{right:{_skip_check_:!0,value:W}}})),Ge(!!se.left,{[[`&-placement-left ${$}-arrow`,`&-placement-leftTop ${$}-arrow`,`&-placement-leftBottom ${$}-arrow`].join(",")]:{right:{_skip_check_:!0,value:re},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${$}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${$}-arrow`]:{top:q},[`&-placement-leftBottom ${$}-arrow`]:{bottom:q}})),Ge(!!se.right,{[[`&-placement-right ${$}-arrow`,`&-placement-rightTop ${$}-arrow`,`&-placement-rightBottom ${$}-arrow`].join(",")]:{left:{_skip_check_:!0,value:re},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${$}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${$}-arrow`]:{top:q},[`&-placement-rightBottom ${$}-arrow`]:{bottom:q}}))}}},47585:function(Ir,Mt,Y){"use strict";Y.d(Mt,{r:function(){return Ce}});const Ce=(Le,Xe,Ge,Oe,me)=>{const Pe=Le/2,$=0,c=Pe,te=Ge*1/Math.sqrt(2),V=Pe-Ge*(1-1/Math.sqrt(2)),A=Pe-Xe*(1/Math.sqrt(2)),b=Ge*(Math.sqrt(2)-1)+Xe*(1/Math.sqrt(2)),M=2*Pe-A,I=b,re=2*Pe-te,se=V,q=2*Pe-$,W=c,Z=Pe*Math.sqrt(2)+Ge*(Math.sqrt(2)-2),le=Ge*(Math.sqrt(2)-1);return{pointerEvents:"none",width:Le,height:Le,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:Le,height:Le/2,background:Oe,clipPath:{_multi_value_:!0,value:[`polygon(${le}px 100%, 50% ${le}px, ${2*Pe-le}px 100%, ${le}px 100%)`,`path('M ${$} ${c} A ${Ge} ${Ge} 0 0 0 ${te} ${V} L ${A} ${b} A ${Xe} ${Xe} 0 0 1 ${M} ${I} L ${re} ${se} A ${Ge} ${Ge} 0 0 0 ${q} ${W} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:Z,height:Z,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Xe}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:me,zIndex:0,background:"transparent"}}}},99313:function(Ir,Mt,Y){"use strict";Y.d(Mt,{default:function(){return gn}});var Ce=Y(99267),Le=Y(18785),Xe=Y(62772),Ge=Y(92310),Oe=Y.n(Ge),me=Y(96663),Pe=Y(90493),$=Y(44127),c=Y(72071),te=Y(20135),V=Y(6620),A=Y(59301),b=Y(49658),M=Y(18929),I=Y(77900),re=(0,A.createContext)(null),se=A.forwardRef(function(fe,Ae){var Ct=fe.prefixCls,at=fe.className,xt=fe.style,Ot=fe.id,ir=fe.active,Jt=fe.tabKey,xr=fe.children;return A.createElement("div",{id:Ot&&"".concat(Ot,"-panel-").concat(Jt),role:"tabpanel",tabIndex:ir?0:-1,"aria-labelledby":Ot&&"".concat(Ot,"-tab-").concat(Jt),"aria-hidden":!ir,style:xt,className:Oe()(Ct,ir&&"".concat(Ct,"-active"),at),ref:Ae},xr)}),q=se,W=["key","forceRender","style","className"];function Z(fe){var Ae=fe.id,Ct=fe.activeKey,at=fe.animated,xt=fe.tabPosition,Ot=fe.destroyInactiveTabPane,ir=A.useContext(re),Jt=ir.prefixCls,xr=ir.tabs,br=at.tabPane,nn="".concat(Jt,"-tabpane");return A.createElement("div",{className:Oe()("".concat(Jt,"-content-holder"))},A.createElement("div",{className:Oe()("".concat(Jt,"-content"),"".concat(Jt,"-content-").concat(xt),(0,Pe.Z)({},"".concat(Jt,"-content-animated"),br))},xr.map(function(kr){var Fr=kr.key,$r=kr.forceRender,pn=kr.style,Mn=kr.className,mn=(0,V.Z)(kr,W),dn=Fr===Ct;return A.createElement(I.default,(0,me.Z)({key:Fr,visible:dn,forceRender:$r,removeOnLeave:!!Ot,leavedClassName:"".concat(nn,"-hidden")},at.tabPaneMotion),function($n,rn){var Lr=$n.style,nt=$n.className;return A.createElement(q,(0,me.Z)({},mn,{prefixCls:nn,id:Ae,tabKey:Fr,animated:br,active:dn,style:(0,$.Z)((0,$.Z)({},pn),Lr),className:Oe()(Mn,nt),ref:rn}))})})))}var le=Y(19127),P=Y(29301),ae=Y(6089),Te=Y(8654),ye={width:0,height:0,left:0,top:0};function Je(fe,Ae,Ct){return(0,A.useMemo)(function(){for(var at,xt=new Map,Ot=Ae.get((at=fe[0])===null||at===void 0?void 0:at.key)||ye,ir=Ot.left+Ot.width,Jt=0;Jt<fe.length;Jt+=1){var xr=fe[Jt].key,br=Ae.get(xr);if(!br){var nn;br=Ae.get((nn=fe[Jt-1])===null||nn===void 0?void 0:nn.key)||ye}var kr=xt.get(xr)||(0,$.Z)({},br);kr.right=ir-kr.left-kr.width,xt.set(xr,kr)}return xt},[fe.map(function(at){return at.key}).join("_"),Ae,Ct])}function Ve(fe,Ae){var Ct=A.useRef(fe),at=A.useState({}),xt=(0,c.Z)(at,2),Ot=xt[1];function ir(Jt){var xr=typeof Jt=="function"?Jt(Ct.current):Jt;xr!==Ct.current&&Ae(xr,Ct.current),Ct.current=xr,Ot({})}return[Ct.current,ir]}var st=.1,ft=.01,ie=20,Q=Math.pow(.995,ie);function ue(fe,Ae){var Ct=(0,A.useState)(),at=(0,c.Z)(Ct,2),xt=at[0],Ot=at[1],ir=(0,A.useState)(0),Jt=(0,c.Z)(ir,2),xr=Jt[0],br=Jt[1],nn=(0,A.useState)(0),kr=(0,c.Z)(nn,2),Fr=kr[0],$r=kr[1],pn=(0,A.useState)(),Mn=(0,c.Z)(pn,2),mn=Mn[0],dn=Mn[1],$n=(0,A.useRef)();function rn(lt){var Nt=lt.touches[0],Ft=Nt.screenX,or=Nt.screenY;Ot({x:Ft,y:or}),window.clearInterval($n.current)}function Lr(lt){if(xt){lt.preventDefault();var Nt=lt.touches[0],Ft=Nt.screenX,or=Nt.screenY;Ot({x:Ft,y:or});var _r=Ft-xt.x,fr=or-xt.y;Ae(_r,fr);var Qr=Date.now();br(Qr),$r(Qr-xr),dn({x:_r,y:fr})}}function nt(){if(xt&&(Ot(null),dn(null),mn)){var lt=mn.x/Fr,Nt=mn.y/Fr,Ft=Math.abs(lt),or=Math.abs(Nt);if(Math.max(Ft,or)<st)return;var _r=lt,fr=Nt;$n.current=window.setInterval(function(){if(Math.abs(_r)<ft&&Math.abs(fr)<ft){window.clearInterval($n.current);return}_r*=Q,fr*=Q,Ae(_r*ie,fr*ie)},ie)}}var Qe=(0,A.useRef)();function bt(lt){var Nt=lt.deltaX,Ft=lt.deltaY,or=0,_r=Math.abs(Nt),fr=Math.abs(Ft);_r===fr?or=Qe.current==="x"?Nt:Ft:_r>fr?(or=Nt,Qe.current="x"):(or=Ft,Qe.current="y"),Ae(-or,-or)&&lt.preventDefault()}var Rt=(0,A.useRef)(null);Rt.current={onTouchStart:rn,onTouchMove:Lr,onTouchEnd:nt,onWheel:bt},A.useEffect(function(){function lt(_r){Rt.current.onTouchStart(_r)}function Nt(_r){Rt.current.onTouchMove(_r)}function Ft(_r){Rt.current.onTouchEnd(_r)}function or(_r){Rt.current.onWheel(_r)}return document.addEventListener("touchmove",Nt,{passive:!1}),document.addEventListener("touchend",Ft,{passive:!1}),fe.current.addEventListener("touchstart",lt,{passive:!1}),fe.current.addEventListener("wheel",or),function(){document.removeEventListener("touchmove",Nt),document.removeEventListener("touchend",Ft)}},[])}var ce=Y(34280);function De(fe){var Ae=(0,A.useState)(0),Ct=(0,c.Z)(Ae,2),at=Ct[0],xt=Ct[1],Ot=(0,A.useRef)(0),ir=(0,A.useRef)();return ir.current=fe,(0,ce.o)(function(){var Jt;(Jt=ir.current)===null||Jt===void 0||Jt.call(ir)},[at]),function(){Ot.current===at&&(Ot.current+=1,xt(Ot.current))}}function xe(fe){var Ae=(0,A.useRef)([]),Ct=(0,A.useState)({}),at=(0,c.Z)(Ct,2),xt=at[1],Ot=(0,A.useRef)(typeof fe=="function"?fe():fe),ir=De(function(){var xr=Ot.current;Ae.current.forEach(function(br){xr=br(xr)}),Ae.current=[],Ot.current=xr,xt({})});function Jt(xr){Ae.current.push(xr),ir()}return[Ot.current,Jt]}var C={width:0,height:0,left:0,top:0,right:0};function B(fe,Ae,Ct,at,xt,Ot,ir){var Jt=ir.tabs,xr=ir.tabPosition,br=ir.rtl,nn,kr,Fr;return["top","bottom"].includes(xr)?(nn="width",kr=br?"right":"left",Fr=Math.abs(Ct)):(nn="height",kr="top",Fr=-Ct),(0,A.useMemo)(function(){if(!Jt.length)return[0,0];for(var $r=Jt.length,pn=$r,Mn=0;Mn<$r;Mn+=1){var mn=fe.get(Jt[Mn].key)||C;if(mn[kr]+mn[nn]>Fr+Ae){pn=Mn-1;break}}for(var dn=0,$n=$r-1;$n>=0;$n-=1){var rn=fe.get(Jt[$n].key)||C;if(rn[kr]<Fr){dn=$n+1;break}}return dn>=pn?[0,0]:[dn,pn]},[fe,Ae,at,xt,Ot,Fr,xr,Jt.map(function($r){return $r.key}).join("_"),br])}function ee(fe){var Ae;return fe instanceof Map?(Ae={},fe.forEach(function(Ct,at){Ae[at]=Ct})):Ae=fe,JSON.stringify(Ae)}var we="TABS_DQ";function rt(fe){return String(fe).replace(/"/g,we)}function tt(fe,Ae,Ct,at){return!(!Ct||at||fe===!1||fe===void 0&&(Ae===!1||Ae===null))}function ot(fe,Ae){var Ct=fe.prefixCls,at=fe.editable,xt=fe.locale,Ot=fe.style;return!at||at.showAdd===!1?null:A.createElement("button",{ref:Ae,type:"button",className:"".concat(Ct,"-nav-add"),style:Ot,"aria-label":(xt==null?void 0:xt.addAriaLabel)||"Add tab",onClick:function(Jt){at.onEdit("add",{event:Jt})}},at.addIcon||"+")}var je=A.forwardRef(ot),nr=A.forwardRef(function(fe,Ae){var Ct=fe.position,at=fe.prefixCls,xt=fe.extra;if(!xt)return null;var Ot,ir={};return(0,te.Z)(xt)==="object"&&!A.isValidElement(xt)?ir=xt:ir.right=xt,Ct==="right"&&(Ot=ir.right),Ct==="left"&&(Ot=ir.left),Ot?A.createElement("div",{className:"".concat(at,"-extra-content"),ref:Ae},Ot):null}),Kt=nr,Lt=Y(31561),Gr=Y(15285),Rr=Y(10228);function hn(fe,Ae){var Ct=fe.prefixCls,at=fe.id,xt=fe.tabs,Ot=fe.locale,ir=fe.mobile,Jt=fe.moreIcon,xr=Jt===void 0?"More":Jt,br=fe.moreTransitionName,nn=fe.style,kr=fe.className,Fr=fe.editable,$r=fe.tabBarGutter,pn=fe.rtl,Mn=fe.removeAriaLabel,mn=fe.onTabClick,dn=fe.getPopupContainer,$n=fe.popupClassName,rn=(0,A.useState)(!1),Lr=(0,c.Z)(rn,2),nt=Lr[0],Qe=Lr[1],bt=(0,A.useState)(null),Rt=(0,c.Z)(bt,2),lt=Rt[0],Nt=Rt[1],Ft="".concat(at,"-more-popup"),or="".concat(Ct,"-dropdown"),_r=lt!==null?"".concat(Ft,"-").concat(lt):null,fr=Ot==null?void 0:Ot.dropdownAriaLabel;function Qr(qr,Jr){qr.preventDefault(),qr.stopPropagation(),Fr.onEdit("remove",{key:Jr,event:qr})}var on=A.createElement(Gr.ZP,{onClick:function(Jr){var sn=Jr.key,en=Jr.domEvent;mn(sn,en),Qe(!1)},prefixCls:"".concat(or,"-menu"),id:Ft,tabIndex:-1,role:"listbox","aria-activedescendant":_r,selectedKeys:[lt],"aria-label":fr!==void 0?fr:"expanded dropdown"},xt.map(function(qr){var Jr=qr.closable,sn=qr.disabled,en=qr.closeIcon,Ur=qr.key,cn=qr.label,Ln=tt(Jr,en,Fr,sn);return A.createElement(Gr.sN,{key:Ur,id:"".concat(Ft,"-").concat(Ur),role:"option","aria-controls":at&&"".concat(at,"-panel-").concat(Ur),disabled:sn},A.createElement("span",null,cn),Ln&&A.createElement("button",{type:"button","aria-label":Mn||"remove",tabIndex:0,className:"".concat(or,"-menu-item-remove"),onClick:function(sr){sr.stopPropagation(),Qr(sr,Ur)}},en||Fr.removeIcon||"\xD7"))}));function fn(qr){for(var Jr=xt.filter(function(Ln){return!Ln.disabled}),sn=Jr.findIndex(function(Ln){return Ln.key===lt})||0,en=Jr.length,Ur=0;Ur<en;Ur+=1){sn=(sn+qr+en)%en;var cn=Jr[sn];if(!cn.disabled){Nt(cn.key);return}}}function Mr(qr){var Jr=qr.which;if(!nt){[Rr.Z.DOWN,Rr.Z.SPACE,Rr.Z.ENTER].includes(Jr)&&(Qe(!0),qr.preventDefault());return}switch(Jr){case Rr.Z.UP:fn(-1),qr.preventDefault();break;case Rr.Z.DOWN:fn(1),qr.preventDefault();break;case Rr.Z.ESC:Qe(!1);break;case Rr.Z.SPACE:case Rr.Z.ENTER:lt!==null&&mn(lt,qr);break}}(0,A.useEffect)(function(){var qr=document.getElementById(_r);qr&&qr.scrollIntoView&&qr.scrollIntoView(!1)},[lt]),(0,A.useEffect)(function(){nt||Nt(null)},[nt]);var wr=(0,Pe.Z)({},pn?"marginRight":"marginLeft",$r);xt.length||(wr.visibility="hidden",wr.order=1);var _n=Oe()((0,Pe.Z)({},"".concat(or,"-rtl"),pn)),ln=ir?null:A.createElement(Lt.Z,{prefixCls:or,overlay:on,trigger:["hover"],visible:xt.length?nt:!1,transitionName:br,onVisibleChange:Qe,overlayClassName:Oe()(_n,$n),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:dn},A.createElement("button",{type:"button",className:"".concat(Ct,"-nav-more"),style:wr,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Ft,id:"".concat(at,"-more"),"aria-expanded":nt,onKeyDown:Mr},xr));return A.createElement("div",{className:Oe()("".concat(Ct,"-nav-operations"),kr),style:nn,ref:Ae},ln,A.createElement(je,{prefixCls:Ct,locale:Ot,editable:Fr}))}var Nr=A.memo(A.forwardRef(hn),function(fe,Ae){return Ae.tabMoving});function an(fe){var Ae,Ct=fe.prefixCls,at=fe.id,xt=fe.active,Ot=fe.tab,ir=Ot.key,Jt=Ot.label,xr=Ot.disabled,br=Ot.closeIcon,nn=fe.closable,kr=fe.renderWrapper,Fr=fe.removeAriaLabel,$r=fe.editable,pn=fe.onClick,Mn=fe.onFocus,mn=fe.style,dn="".concat(Ct,"-tab"),$n=tt(nn,br,$r,xr);function rn(Qe){xr||pn(Qe)}function Lr(Qe){Qe.preventDefault(),Qe.stopPropagation(),$r.onEdit("remove",{key:ir,event:Qe})}var nt=A.createElement("div",{key:ir,"data-node-key":rt(ir),className:Oe()(dn,(Ae={},(0,Pe.Z)(Ae,"".concat(dn,"-with-remove"),$n),(0,Pe.Z)(Ae,"".concat(dn,"-active"),xt),(0,Pe.Z)(Ae,"".concat(dn,"-disabled"),xr),Ae)),style:mn,onClick:rn},A.createElement("div",{role:"tab","aria-selected":xt,id:at&&"".concat(at,"-tab-").concat(ir),className:"".concat(dn,"-btn"),"aria-controls":at&&"".concat(at,"-panel-").concat(ir),"aria-disabled":xr,tabIndex:xr?null:0,onClick:function(bt){bt.stopPropagation(),rn(bt)},onKeyDown:function(bt){[Rr.Z.SPACE,Rr.Z.ENTER].includes(bt.which)&&(bt.preventDefault(),rn(bt))},onFocus:Mn},Jt),$n&&A.createElement("button",{type:"button","aria-label":Fr||"remove",tabIndex:0,className:"".concat(dn,"-remove"),onClick:function(bt){bt.stopPropagation(),Lr(bt)}},br||$r.removeIcon||"\xD7"));return kr?kr(nt):nt}var zr=an,We=Y(16089),mt=function(Ae){var Ct=Ae.activeTabOffset,at=Ae.horizontal,xt=Ae.rtl,Ot=Ae.indicatorSize,ir=(0,A.useState)(),Jt=(0,c.Z)(ir,2),xr=Jt[0],br=Jt[1],nn=(0,A.useRef)(),kr=function(pn){return typeof Ot=="function"?Ot(pn):typeof Ot=="number"?Ot:pn};function Fr(){We.Z.cancel(nn.current)}return(0,A.useEffect)(function(){var $r={};return Ct&&(at?(xt?($r.right=Ct.right+Ct.width/2,$r.transform="translateX(50%)"):($r.left=Ct.left+Ct.width/2,$r.transform="translateX(-50%)"),$r.width=kr(Ct.width)):($r.top=Ct.top+Ct.height/2,$r.transform="translateY(-50%)",$r.height=kr(Ct.height))),Fr(),nn.current=(0,We.Z)(function(){br($r)}),Fr},[Ct,at,xt,Ot]),{style:xr}},Ye=mt,Et=function(Ae){var Ct=Ae.current||{},at=Ct.offsetWidth,xt=at===void 0?0:at,Ot=Ct.offsetHeight,ir=Ot===void 0?0:Ot;return[xt,ir]},Tt=function(Ae,Ct){return Ae[Ct?0:1]};function ge(fe,Ae){var Ct,at=A.useContext(re),xt=at.prefixCls,Ot=at.tabs,ir=fe.className,Jt=fe.style,xr=fe.id,br=fe.animated,nn=fe.activeKey,kr=fe.rtl,Fr=fe.extra,$r=fe.editable,pn=fe.locale,Mn=fe.tabPosition,mn=fe.tabBarGutter,dn=fe.children,$n=fe.onTabClick,rn=fe.onTabScroll,Lr=fe.indicatorSize,nt=(0,A.useRef)(),Qe=(0,A.useRef)(),bt=(0,A.useRef)(),Rt=(0,A.useRef)(),lt=(0,A.useRef)(),Nt=(0,A.useRef)(),Ft=(0,A.useRef)(),or=Mn==="top"||Mn==="bottom",_r=Ve(0,function(Nn,wn){or&&rn&&rn({direction:Nn>wn?"left":"right"})}),fr=(0,c.Z)(_r,2),Qr=fr[0],on=fr[1],fn=Ve(0,function(Nn,wn){!or&&rn&&rn({direction:Nn>wn?"top":"bottom"})}),Mr=(0,c.Z)(fn,2),wr=Mr[0],_n=Mr[1],ln=(0,A.useState)([0,0]),qr=(0,c.Z)(ln,2),Jr=qr[0],sn=qr[1],en=(0,A.useState)([0,0]),Ur=(0,c.Z)(en,2),cn=Ur[0],Ln=Ur[1],xn=(0,A.useState)([0,0]),sr=(0,c.Z)(xn,2),Ie=sr[0],lr=sr[1],gr=(0,A.useState)([0,0]),yn=(0,c.Z)(gr,2),Yn=yn[0],vn=yn[1],Rn=xe(new Map),Zr=(0,c.Z)(Rn,2),ai=Zr[0],pi=Zr[1],In=Je(Ot,ai,cn[0]),ni=Tt(Jr,or),qi=Tt(cn,or),Ti=Tt(Ie,or),Zi=Tt(Yn,or),Ar=ni<qi+Ti,bn=Ar?ni-Zi:ni-Ti,zn="".concat(xt,"-nav-operations-hidden"),Vn=0,Gi=0;or&&kr?(Vn=0,Gi=Math.max(0,qi-bn)):(Vn=Math.min(0,bn-qi),Gi=0);function Vi(Nn){return Nn<Vn?Vn:Nn>Gi?Gi:Nn}var ei=(0,A.useRef)(),Ci=(0,A.useState)(),Wn=(0,c.Z)(Ci,2),Wi=Wn[0],ui=Wn[1];function Ji(){ui(Date.now())}function Di(){window.clearTimeout(ei.current)}ue(Rt,function(Nn,wn){function hi(xi,es){xi(function(Cr){var Dr=Vi(Cr+es);return Dr})}return Ar?(or?hi(on,Nn):hi(_n,wn),Di(),Ji(),!0):!1}),(0,A.useEffect)(function(){return Di(),Wi&&(ei.current=window.setTimeout(function(){ui(0)},100)),Di},[Wi]);var bi=B(In,bn,or?Qr:wr,qi,Ti,Zi,(0,$.Z)((0,$.Z)({},fe),{},{tabs:Ot})),Sn=(0,c.Z)(bi,2),ls=Sn[0],_s=Sn[1],fs=(0,ae.Z)(function(){var Nn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nn,wn=In.get(Nn)||{width:0,height:0,left:0,right:0,top:0};if(or){var hi=Qr;kr?wn.right<Qr?hi=wn.right:wn.right+wn.width>Qr+bn&&(hi=wn.right+wn.width-bn):wn.left<-Qr?hi=-wn.left:wn.left+wn.width>-Qr+bn&&(hi=-(wn.left+wn.width-bn)),_n(0),on(Vi(hi))}else{var xi=wr;wn.top<-wr?xi=-wn.top:wn.top+wn.height>-wr+bn&&(xi=-(wn.top+wn.height-bn)),on(0),_n(Vi(xi))}}),Xn={};Mn==="top"||Mn==="bottom"?Xn[kr?"marginRight":"marginLeft"]=mn:Xn.marginTop=mn;var xs=Ot.map(function(Nn,wn){var hi=Nn.key;return A.createElement(zr,{id:xr,prefixCls:xt,key:hi,tab:Nn,style:wn===0?void 0:Xn,closable:Nn.closable,editable:$r,active:hi===nn,renderWrapper:dn,removeAriaLabel:pn==null?void 0:pn.removeAriaLabel,onClick:function(es){$n(hi,es)},onFocus:function(){fs(hi),Ji(),Rt.current&&(kr||(Rt.current.scrollLeft=0),Rt.current.scrollTop=0)}})}),ps=function(){return pi(function(){var wn=new Map;return Ot.forEach(function(hi){var xi,es=hi.key,Cr=(xi=lt.current)===null||xi===void 0?void 0:xi.querySelector('[data-node-key="'.concat(rt(es),'"]'));Cr&&wn.set(es,{width:Cr.offsetWidth,height:Cr.offsetHeight,left:Cr.offsetLeft,top:Cr.offsetTop})}),wn})};(0,A.useEffect)(function(){ps()},[Ot.map(function(Nn){return Nn.key}).join("_")]);var er=De(function(){var Nn=Et(nt),wn=Et(Qe),hi=Et(bt);sn([Nn[0]-wn[0]-hi[0],Nn[1]-wn[1]-hi[1]]);var xi=Et(Ft);lr(xi);var es=Et(Nt);vn(es);var Cr=Et(lt);Ln([Cr[0]-xi[0],Cr[1]-xi[1]]),ps()}),ci=Ot.slice(0,ls),ws=Ot.slice(_s+1),Qi=[].concat((0,le.Z)(ci),(0,le.Z)(ws)),_i=In.get(nn),oi=Ye({activeTabOffset:_i,horizontal:or,rtl:kr,indicatorSize:Lr}),Dn=oi.style;(0,A.useEffect)(function(){fs()},[nn,Vn,Gi,ee(_i),ee(In),or]),(0,A.useEffect)(function(){er()},[kr]);var ti=!!Qi.length,Mi="".concat(xt,"-nav-wrap"),Fi,mi,Ni,Os;return or?kr?(mi=Qr>0,Fi=Qr!==Gi):(Fi=Qr<0,mi=Qr!==Vn):(Ni=wr<0,Os=wr!==Vn),A.createElement(P.Z,{onResize:er},A.createElement("div",{ref:(0,Te.x1)(Ae,nt),role:"tablist",className:Oe()("".concat(xt,"-nav"),ir),style:Jt,onKeyDown:function(){Ji()}},A.createElement(Kt,{ref:Qe,position:"left",extra:Fr,prefixCls:xt}),A.createElement(P.Z,{onResize:er},A.createElement("div",{className:Oe()(Mi,(Ct={},(0,Pe.Z)(Ct,"".concat(Mi,"-ping-left"),Fi),(0,Pe.Z)(Ct,"".concat(Mi,"-ping-right"),mi),(0,Pe.Z)(Ct,"".concat(Mi,"-ping-top"),Ni),(0,Pe.Z)(Ct,"".concat(Mi,"-ping-bottom"),Os),Ct)),ref:Rt},A.createElement(P.Z,{onResize:er},A.createElement("div",{ref:lt,className:"".concat(xt,"-nav-list"),style:{transform:"translate(".concat(Qr,"px, ").concat(wr,"px)"),transition:Wi?"none":void 0}},xs,A.createElement(je,{ref:Ft,prefixCls:xt,locale:pn,editable:$r,style:(0,$.Z)((0,$.Z)({},xs.length===0?void 0:Xn),{},{visibility:ti?"hidden":null})}),A.createElement("div",{className:Oe()("".concat(xt,"-ink-bar"),(0,Pe.Z)({},"".concat(xt,"-ink-bar-animated"),br.inkBar)),style:Dn}))))),A.createElement(Nr,(0,me.Z)({},fe,{removeAriaLabel:pn==null?void 0:pn.removeAriaLabel,ref:Nt,prefixCls:xt,tabs:Qi,className:!ti&&zn,tabMoving:!!Wi})),A.createElement(Kt,{ref:bt,position:"right",extra:Fr,prefixCls:xt})))}var Be=A.forwardRef(ge),et=["renderTabBar"],gt=["label","key"];function vt(fe){var Ae=fe.renderTabBar,Ct=(0,V.Z)(fe,et),at=A.useContext(re),xt=at.tabs;if(Ae){var Ot=(0,$.Z)((0,$.Z)({},Ct),{},{panes:xt.map(function(ir){var Jt=ir.label,xr=ir.key,br=(0,V.Z)(ir,gt);return A.createElement(q,(0,me.Z)({tab:Jt,key:xr,tabKey:xr},br))})});return Ae(Ot,Be)}return A.createElement(Be,Ct)}var Ut=Y(48736);function hr(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Ae;return fe===!1?Ae={inkBar:!1,tabPane:!1}:fe===!0?Ae={inkBar:!0,tabPane:!1}:Ae=(0,$.Z)({inkBar:!0},(0,te.Z)(fe)==="object"?fe:{}),Ae.tabPaneMotion&&Ae.tabPane===void 0&&(Ae.tabPane=!0),!Ae.tabPaneMotion&&Ae.tabPane&&(Ae.tabPane=!1),Ae}var Yt=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Ke=0;function $t(fe,Ae){var Ct,at=fe.id,xt=fe.prefixCls,Ot=xt===void 0?"rc-tabs":xt,ir=fe.className,Jt=fe.items,xr=fe.direction,br=fe.activeKey,nn=fe.defaultActiveKey,kr=fe.editable,Fr=fe.animated,$r=fe.tabPosition,pn=$r===void 0?"top":$r,Mn=fe.tabBarGutter,mn=fe.tabBarStyle,dn=fe.tabBarExtraContent,$n=fe.locale,rn=fe.moreIcon,Lr=fe.moreTransitionName,nt=fe.destroyInactiveTabPane,Qe=fe.renderTabBar,bt=fe.onChange,Rt=fe.onTabClick,lt=fe.onTabScroll,Nt=fe.getPopupContainer,Ft=fe.popupClassName,or=fe.indicatorSize,_r=(0,V.Z)(fe,Yt),fr=A.useMemo(function(){return(Jt||[]).filter(function(vn){return vn&&(0,te.Z)(vn)==="object"&&"key"in vn})},[Jt]),Qr=xr==="rtl",on=hr(Fr),fn=(0,A.useState)(!1),Mr=(0,c.Z)(fn,2),wr=Mr[0],_n=Mr[1];(0,A.useEffect)(function(){_n((0,b.Z)())},[]);var ln=(0,M.Z)(function(){var vn;return(vn=fr[0])===null||vn===void 0?void 0:vn.key},{value:br,defaultValue:nn}),qr=(0,c.Z)(ln,2),Jr=qr[0],sn=qr[1],en=(0,A.useState)(function(){return fr.findIndex(function(vn){return vn.key===Jr})}),Ur=(0,c.Z)(en,2),cn=Ur[0],Ln=Ur[1];(0,A.useEffect)(function(){var vn=fr.findIndex(function(Zr){return Zr.key===Jr});if(vn===-1){var Rn;vn=Math.max(0,Math.min(cn,fr.length-1)),sn((Rn=fr[vn])===null||Rn===void 0?void 0:Rn.key)}Ln(vn)},[fr.map(function(vn){return vn.key}).join("_"),Jr,cn]);var xn=(0,M.Z)(null,{value:at}),sr=(0,c.Z)(xn,2),Ie=sr[0],lr=sr[1];(0,A.useEffect)(function(){at||(lr("rc-tabs-".concat(Ke)),Ke+=1)},[]);function gr(vn,Rn){Rt==null||Rt(vn,Rn);var Zr=vn!==Jr;sn(vn),Zr&&(bt==null||bt(vn))}var yn={id:Ie,activeKey:Jr,animated:on,tabPosition:pn,rtl:Qr,mobile:wr},Yn=(0,$.Z)((0,$.Z)({},yn),{},{editable:kr,locale:$n,moreIcon:rn,moreTransitionName:Lr,tabBarGutter:Mn,onTabClick:gr,onTabScroll:lt,extra:dn,style:mn,panes:null,getPopupContainer:Nt,popupClassName:Ft,indicatorSize:or});return A.createElement(re.Provider,{value:{tabs:fr,prefixCls:Ot}},A.createElement("div",(0,me.Z)({ref:Ae,id:at,className:Oe()(Ot,"".concat(Ot,"-").concat(pn),(Ct={},(0,Pe.Z)(Ct,"".concat(Ot,"-mobile"),wr),(0,Pe.Z)(Ct,"".concat(Ot,"-editable"),kr),(0,Pe.Z)(Ct,"".concat(Ot,"-rtl"),Qr),Ct),ir)},_r),A.createElement(vt,(0,me.Z)({},Yn,{renderTabBar:Qe})),A.createElement(Z,(0,me.Z)({destroyInactiveTabPane:nt},yn,{animated:on}))))}var cr=A.forwardRef($t),Fe=cr,He=Fe,qe=Y(36355),Dt=Y(19716),Pt=()=>null,Gt=Y(62892);const k={motionAppear:!1,motionEnter:!0,motionLeave:!0};function D(fe){let Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Ct;return Ae===!1?Ct={inkBar:!1,tabPane:!1}:Ae===!0?Ct={inkBar:!0,tabPane:!0}:Ct=Object.assign({inkBar:!0},typeof Ae=="object"?Ae:{}),Ct.tabPane&&(Ct.tabPaneMotion=Object.assign(Object.assign({},k),{motionName:(0,Gt.m)(fe,"switch")})),Ct}var ut=Y(11592),U=function(fe,Ae){var Ct={};for(var at in fe)Object.prototype.hasOwnProperty.call(fe,at)&&Ae.indexOf(at)<0&&(Ct[at]=fe[at]);if(fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var xt=0,at=Object.getOwnPropertySymbols(fe);xt<at.length;xt++)Ae.indexOf(at[xt])<0&&Object.prototype.propertyIsEnumerable.call(fe,at[xt])&&(Ct[at[xt]]=fe[at[xt]]);return Ct};function he(fe){return fe.filter(Ae=>Ae)}function Tr(fe,Ae){if(fe)return fe;const Ct=(0,ut.Z)(Ae).map(at=>{if(A.isValidElement(at)){const{key:xt,props:Ot}=at,ir=Ot||{},{tab:Jt}=ir,xr=U(ir,["tab"]);return Object.assign(Object.assign({key:String(xt)},xr),{label:Jt})}return null});return he(Ct)}var Ee=Y(17313),Ue=Y(83116),Ze=Y(37613),G=Y(13826),_e=fe=>{const{componentCls:Ae,motionDurationSlow:Ct}=fe;return[{[Ae]:{[`${Ae}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Ct}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Ct}`}}}}},[(0,G.oN)(fe,"slide-up"),(0,G.oN)(fe,"slide-down")]]};const Ne=fe=>{const{componentCls:Ae,tabsCardPadding:Ct,cardBg:at,cardGutter:xt,colorBorderSecondary:Ot,itemSelectedColor:ir}=fe;return{[`${Ae}-card`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{margin:0,padding:Ct,background:at,border:`${fe.lineWidth}px ${fe.lineType} ${Ot}`,transition:`all ${fe.motionDurationSlow} ${fe.motionEaseInOut}`},[`${Ae}-tab-active`]:{color:ir,background:fe.colorBgContainer},[`${Ae}-ink-bar`]:{visibility:"hidden"}},[`&${Ae}-top, &${Ae}-bottom`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab + ${Ae}-tab`]:{marginLeft:{_skip_check_:!0,value:`${xt}px`}}}},[`&${Ae}-top`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{borderRadius:`${fe.borderRadiusLG}px ${fe.borderRadiusLG}px 0 0`},[`${Ae}-tab-active`]:{borderBottomColor:fe.colorBgContainer}}},[`&${Ae}-bottom`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{borderRadius:`0 0 ${fe.borderRadiusLG}px ${fe.borderRadiusLG}px`},[`${Ae}-tab-active`]:{borderTopColor:fe.colorBgContainer}}},[`&${Ae}-left, &${Ae}-right`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab + ${Ae}-tab`]:{marginTop:`${xt}px`}}},[`&${Ae}-left`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{borderRadius:{_skip_check_:!0,value:`${fe.borderRadiusLG}px 0 0 ${fe.borderRadiusLG}px`}},[`${Ae}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:fe.colorBgContainer}}}},[`&${Ae}-right`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${fe.borderRadiusLG}px ${fe.borderRadiusLG}px 0`}},[`${Ae}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:fe.colorBgContainer}}}}}}},H=fe=>{const{componentCls:Ae,itemHoverColor:Ct,dropdownEdgeChildVerticalPadding:at}=fe;return{[`${Ae}-dropdown`]:Object.assign(Object.assign({},(0,Ee.Wf)(fe)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:fe.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Ae}-dropdown-menu`]:{maxHeight:fe.tabsDropdownHeight,margin:0,padding:`${at}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:fe.colorBgContainer,backgroundClip:"padding-box",borderRadius:fe.borderRadiusLG,outline:"none",boxShadow:fe.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Ee.vS),{display:"flex",alignItems:"center",minWidth:fe.tabsDropdownWidth,margin:0,padding:`${fe.paddingXXS}px ${fe.paddingSM}px`,color:fe.colorText,fontWeight:"normal",fontSize:fe.fontSize,lineHeight:fe.lineHeight,cursor:"pointer",transition:`all ${fe.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:fe.marginSM},color:fe.colorTextDescription,fontSize:fe.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Ct}},"&:hover":{background:fe.controlItemBgHover},"&-disabled":{"&, &:hover":{color:fe.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Vt=fe=>{const{componentCls:Ae,margin:Ct,colorBorderSecondary:at,horizontalMargin:xt,verticalItemPadding:Ot,verticalItemMargin:ir}=fe;return{[`${Ae}-top, ${Ae}-bottom`]:{flexDirection:"column",[`> ${Ae}-nav, > div > ${Ae}-nav`]:{margin:xt,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${fe.lineWidth}px ${fe.lineType} ${at}`,content:"''"},[`${Ae}-ink-bar`]:{height:fe.lineWidthBold,"&-animated":{transition:`width ${fe.motionDurationSlow}, left ${fe.motionDurationSlow},
right ${fe.motionDurationSlow}`}},[`${Ae}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:fe.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:fe.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:fe.boxShadowTabsOverflowRight},[`&${Ae}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Ae}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Ae}-top`]:{[`> ${Ae}-nav,
> div > ${Ae}-nav`]:{"&::before":{bottom:0},[`${Ae}-ink-bar`]:{bottom:0}}},[`${Ae}-bottom`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{order:1,marginTop:`${Ct}px`,marginBottom:0,"&::before":{top:0},[`${Ae}-ink-bar`]:{top:0}},[`> ${Ae}-content-holder, > div > ${Ae}-content-holder`]:{order:0}},[`${Ae}-left, ${Ae}-right`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{flexDirection:"column",minWidth:fe.controlHeight*1.25,[`${Ae}-tab`]:{padding:Ot,textAlign:"center"},[`${Ae}-tab + ${Ae}-tab`]:{margin:ir},[`${Ae}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:fe.controlHeight},"&::before":{top:0,boxShadow:fe.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:fe.boxShadowTabsOverflowBottom},[`&${Ae}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Ae}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Ae}-ink-bar`]:{width:fe.lineWidthBold,"&-animated":{transition:`height ${fe.motionDurationSlow}, top ${fe.motionDurationSlow}`}},[`${Ae}-nav-list, ${Ae}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Ae}-left`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Ae}-content-holder, > div > ${Ae}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${fe.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${fe.lineWidth}px ${fe.lineType} ${fe.colorBorder}`},[`> ${Ae}-content > ${Ae}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:fe.paddingLG}}}},[`${Ae}-right`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{order:1,[`${Ae}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Ae}-content-holder, > div > ${Ae}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-fe.lineWidth},borderRight:{_skip_check_:!0,value:`${fe.lineWidth}px ${fe.lineType} ${fe.colorBorder}`},[`> ${Ae}-content > ${Ae}-tabpane`]:{paddingRight:{_skip_check_:!0,value:fe.paddingLG}}}}}},Se=fe=>{const{componentCls:Ae,cardPaddingSM:Ct,cardPaddingLG:at,horizontalItemPaddingSM:xt,horizontalItemPaddingLG:Ot}=fe;return{[Ae]:{"&-small":{[`> ${Ae}-nav`]:{[`${Ae}-tab`]:{padding:xt,fontSize:fe.titleFontSizeSM}}},"&-large":{[`> ${Ae}-nav`]:{[`${Ae}-tab`]:{padding:Ot,fontSize:fe.titleFontSizeLG}}}},[`${Ae}-card`]:{[`&${Ae}-small`]:{[`> ${Ae}-nav`]:{[`${Ae}-tab`]:{padding:Ct}},[`&${Ae}-bottom`]:{[`> ${Ae}-nav ${Ae}-tab`]:{borderRadius:`0 0 ${fe.borderRadius}px ${fe.borderRadius}px`}},[`&${Ae}-top`]:{[`> ${Ae}-nav ${Ae}-tab`]:{borderRadius:`${fe.borderRadius}px ${fe.borderRadius}px 0 0`}},[`&${Ae}-right`]:{[`> ${Ae}-nav ${Ae}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${fe.borderRadius}px ${fe.borderRadius}px 0`}}},[`&${Ae}-left`]:{[`> ${Ae}-nav ${Ae}-tab`]:{borderRadius:{_skip_check_:!0,value:`${fe.borderRadius}px 0 0 ${fe.borderRadius}px`}}}},[`&${Ae}-large`]:{[`> ${Ae}-nav`]:{[`${Ae}-tab`]:{padding:at}}}}}},qt=fe=>{const{componentCls:Ae,itemActiveColor:Ct,itemHoverColor:at,iconCls:xt,tabsHorizontalItemMargin:Ot,horizontalItemPadding:ir,itemSelectedColor:Jt,itemColor:xr}=fe,br=`${Ae}-tab`;return{[br]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:ir,fontSize:fe.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:xr,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Ct}},(0,Ee.Qy)(fe)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-fe.marginXXS},marginLeft:{_skip_check_:!0,value:fe.marginXS},color:fe.colorTextDescription,fontSize:fe.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${fe.motionDurationSlow}`,"&:hover":{color:fe.colorTextHeading}},"&:hover":{color:at},[`&${br}-active ${br}-btn`]:{color:Jt,textShadow:fe.tabsActiveTextShadow},[`&${br}-disabled`]:{color:fe.colorTextDisabled,cursor:"not-allowed"},[`&${br}-disabled ${br}-btn, &${br}-disabled ${Ae}-remove`]:{"&:focus, &:active":{color:fe.colorTextDisabled}},[`& ${br}-remove ${xt}`]:{margin:0},[xt]:{marginRight:{_skip_check_:!0,value:fe.marginSM}}},[`${br} + ${br}`]:{margin:{_skip_check_:!0,value:Ot}}}},vr=fe=>{const{componentCls:Ae,tabsHorizontalItemMarginRTL:Ct,iconCls:at,cardGutter:xt}=fe;return{[`${Ae}-rtl`]:{direction:"rtl",[`${Ae}-nav`]:{[`${Ae}-tab`]:{margin:{_skip_check_:!0,value:Ct},[`${Ae}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[at]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${fe.marginSM}px`}},[`${Ae}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${fe.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${fe.marginXXS}px`},[at]:{margin:0}}}},[`&${Ae}-left`]:{[`> ${Ae}-nav`]:{order:1},[`> ${Ae}-content-holder`]:{order:0}},[`&${Ae}-right`]:{[`> ${Ae}-nav`]:{order:0},[`> ${Ae}-content-holder`]:{order:1}},[`&${Ae}-card${Ae}-top, &${Ae}-card${Ae}-bottom`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab + ${Ae}-tab`]:{marginRight:{_skip_check_:!0,value:xt},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Ae}-dropdown-rtl`]:{direction:"rtl"},[`${Ae}-menu-item`]:{[`${Ae}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},Xr=fe=>{const{componentCls:Ae,tabsCardPadding:Ct,cardHeight:at,cardGutter:xt,itemHoverColor:Ot,itemActiveColor:ir,colorBorderSecondary:Jt}=fe;return{[Ae]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ee.Wf)(fe)),{display:"flex",[`> ${Ae}-nav, > div > ${Ae}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Ae}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${fe.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Ae}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${fe.motionDurationSlow}`},[`${Ae}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Ae}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Ae}-nav-more`]:{position:"relative",padding:Ct,background:"transparent",border:0,color:fe.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:fe.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Ae}-nav-add`]:Object.assign({minWidth:at,marginLeft:{_skip_check_:!0,value:xt},padding:`0 ${fe.paddingXS}px`,background:"transparent",border:`${fe.lineWidth}px ${fe.lineType} ${Jt}`,borderRadius:`${fe.borderRadiusLG}px ${fe.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:fe.colorText,transition:`all ${fe.motionDurationSlow} ${fe.motionEaseInOut}`,"&:hover":{color:Ot},"&:active, &:focus:not(:focus-visible)":{color:ir}},(0,Ee.Qy)(fe))},[`${Ae}-extra-content`]:{flex:"none"},[`${Ae}-ink-bar`]:{position:"absolute",background:fe.inkBarColor,pointerEvents:"none"}}),qt(fe)),{[`${Ae}-content`]:{position:"relative",width:"100%"},[`${Ae}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Ae}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Ae}-centered`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-nav-wrap`]:{[`&:not([class*='${Ae}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var An=(0,Ue.Z)("Tabs",fe=>{const Ae=(0,Ze.TS)(fe,{tabsCardPadding:fe.cardPadding||`${(fe.cardHeight-Math.round(fe.fontSize*fe.lineHeight))/2-fe.lineWidth}px ${fe.padding}px`,dropdownEdgeChildVerticalPadding:fe.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${fe.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${fe.horizontalItemGutter}px`});return[Se(Ae),vr(Ae),Vt(Ae),H(Ae),Ne(Ae),Xr(Ae),_e(Ae)]},fe=>{const Ae=fe.controlHeightLG;return{zIndexPopup:fe.zIndexPopupBase+50,cardBg:fe.colorFillAlter,cardHeight:Ae,cardPadding:"",cardPaddingSM:`${fe.paddingXXS*1.5}px ${fe.padding}px`,cardPaddingLG:`${fe.paddingXS}px ${fe.padding}px ${fe.paddingXXS*1.5}px`,titleFontSize:fe.fontSize,titleFontSizeLG:fe.fontSizeLG,titleFontSizeSM:fe.fontSize,inkBarColor:fe.colorPrimary,horizontalMargin:`0 0 ${fe.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${fe.paddingSM}px 0`,horizontalItemPaddingSM:`${fe.paddingXS}px 0`,horizontalItemPaddingLG:`${fe.padding}px 0`,verticalItemPadding:`${fe.paddingXS}px ${fe.paddingLG}px`,verticalItemMargin:`${fe.margin}px 0 0 0`,itemColor:fe.colorText,itemSelectedColor:fe.colorPrimary,itemHoverColor:fe.colorPrimaryHover,itemActiveColor:fe.colorPrimaryActive,cardGutter:fe.marginXXS/2}}),Kr=function(fe,Ae){var Ct={};for(var at in fe)Object.prototype.hasOwnProperty.call(fe,at)&&Ae.indexOf(at)<0&&(Ct[at]=fe[at]);if(fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var xt=0,at=Object.getOwnPropertySymbols(fe);xt<at.length;xt++)Ae.indexOf(at[xt])<0&&Object.prototype.propertyIsEnumerable.call(fe,at[xt])&&(Ct[at[xt]]=fe[at[xt]]);return Ct};const yr=fe=>{const{type:Ae,className:Ct,rootClassName:at,size:xt,onEdit:Ot,hideAdd:ir,centered:Jt,addIcon:xr,popupClassName:br,children:nn,items:kr,animated:Fr,style:$r,indicatorSize:pn}=fe,Mn=Kr(fe,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:mn,moreIcon:dn=A.createElement(Le.Z,null)}=Mn,{direction:$n,tabs:rn,getPrefixCls:Lr,getPopupContainer:nt}=A.useContext(qe.E_),Qe=Lr("tabs",mn),[bt,Rt]=An(Qe);let lt;Ae==="editable-card"&&(lt={onEdit:(Qr,on)=>{let{key:fn,event:Mr}=on;Ot==null||Ot(Qr==="add"?Mr:fn,Qr)},removeIcon:A.createElement(Ce.Z,null),addIcon:xr||A.createElement(Xe.Z,null),showAdd:ir!==!0});const Nt=Lr(),Ft=Tr(kr,nn),or=D(Qe,Fr),_r=(0,Dt.Z)(xt),fr=Object.assign(Object.assign({},rn==null?void 0:rn.style),$r);return bt(A.createElement(He,Object.assign({direction:$n,getPopupContainer:nt,moreTransitionName:`${Nt}-slide-up`},Mn,{items:Ft,className:Oe()({[`${Qe}-${_r}`]:_r,[`${Qe}-card`]:["card","editable-card"].includes(Ae),[`${Qe}-editable-card`]:Ae==="editable-card",[`${Qe}-centered`]:Jt},rn==null?void 0:rn.className,Ct,at,Rt),popupClassName:Oe()(br,Rt),style:fr,editable:lt,moreIcon:dn,prefixCls:Qe,animated:or,indicatorSize:pn!=null?pn:rn==null?void 0:rn.indicatorSize})))};yr.TabPane=Pt;var gn=yr},33166:function(Ir,Mt,Y){"use strict";Y.d(Mt,{i:function(){return Ce}});const Ce=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return Le}});var Ce=Y(33166);function Le(Xe,Ge){return Ce.i.reduce((Oe,me)=>{const Pe=Xe[`${me}1`],$=Xe[`${me}3`],c=Xe[`${me}6`],te=Xe[`${me}7`];return Object.assign(Object.assign({},Oe),Ge(me,{lightColor:Pe,lightBorderColor:$,darkColor:c,textColor:te}))},{})}},6848:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return st}});var Ce=Y(59301),Le=Y(92310),Xe=Y.n(Le),Ge=Y(55477),Oe=Y(18929),me=Y(62892),Pe=Y(79676),$=Y(92343),c=Y(36355),te=Y(33234),V=Y(88088),A=Y(17313),b=Y(29878),M=Y(19447),I=Y(45157),re=Y(37613),se=Y(83116);const q=ft=>{const{componentCls:ie,tooltipMaxWidth:Q,tooltipColor:ue,tooltipBg:ce,tooltipBorderRadius:De,zIndexPopup:xe,controlHeight:C,boxShadowSecondary:B,paddingSM:ee,paddingXS:we,tooltipRadiusOuter:rt}=ft;return[{[ie]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,A.Wf)(ft)),{position:"absolute",zIndex:xe,display:"block",width:"max-content",maxWidth:Q,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":ce,[`${ie}-inner`]:{minWidth:C,minHeight:C,padding:`${ee/2}px ${we}px`,color:ue,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:ce,borderRadius:De,boxShadow:B,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${ie}-inner`]:{borderRadius:Math.min(De,M.qN)}},[`${ie}-content`]:{position:"relative"}}),(0,I.Z)(ft,(tt,ot)=>{let{darkColor:je}=ot;return{[`&${ie}-${tt}`]:{[`${ie}-inner`]:{backgroundColor:je},[`${ie}-arrow`]:{"--antd-arrow-background-color":je}}}})),{"&-rtl":{direction:"rtl"}})},(0,M.ZP)((0,re.TS)(ft,{borderRadiusOuter:rt}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:De,limitVerticalRadius:!0}),{[`${ie}-pure`]:{position:"relative",maxWidth:"none",margin:ft.sizePopupArrow}}]};var W=(ft,ie)=>(0,se.Z)("Tooltip",ue=>{if(ie===!1)return[];const{borderRadius:ce,colorTextLightSolid:De,colorBgDefault:xe,borderRadiusOuter:C}=ue,B=(0,re.TS)(ue,{tooltipMaxWidth:250,tooltipColor:De,tooltipBorderRadius:ce,tooltipBg:xe,tooltipRadiusOuter:C>4?4:C});return[q(B),(0,b._y)(ue,"zoom-big-fast")]},ue=>{let{zIndexPopupBase:ce,colorBgSpotlight:De}=ue;return{zIndexPopup:ce+70,colorBgDefault:De}},{resetStyle:!1})(ft),Z=Y(36785);function le(ft,ie){const Q=(0,Z.o2)(ie),ue=Xe()({[`${ft}-${ie}`]:ie&&Q}),ce={},De={};return ie&&!Q&&(ce.background=ie,De["--antd-arrow-background-color"]=ie),{className:ue,overlayStyle:ce,arrowStyle:De}}var ae=ft=>{const{prefixCls:ie,className:Q,placement:ue="top",title:ce,color:De,overlayInnerStyle:xe}=ft,{getPrefixCls:C}=Ce.useContext(c.E_),B=C("tooltip",ie),[ee,we]=W(B,!0),rt=le(B,De),tt=rt.arrowStyle,ot=Object.assign(Object.assign({},xe),rt.overlayStyle),je=Xe()(we,B,`${B}-pure`,`${B}-placement-${ue}`,Q,rt.className);return ee(Ce.createElement("div",{className:je,style:tt},Ce.createElement("div",{className:`${B}-arrow`}),Ce.createElement(Ge.G,Object.assign({},ft,{className:we,prefixCls:B,overlayInnerStyle:ot}),ce)))},Te=function(ft,ie){var Q={};for(var ue in ft)Object.prototype.hasOwnProperty.call(ft,ue)&&ie.indexOf(ue)<0&&(Q[ue]=ft[ue]);if(ft!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ce=0,ue=Object.getOwnPropertySymbols(ft);ce<ue.length;ce++)ie.indexOf(ue[ce])<0&&Object.prototype.propertyIsEnumerable.call(ft,ue[ce])&&(Q[ue[ce]]=ft[ue[ce]]);return Q};const ye=(ft,ie)=>{const Q={},ue=Object.assign({},ft);return ie.forEach(ce=>{ft&&ce in ft&&(Q[ce]=ft[ce],delete ue[ce])}),{picked:Q,omitted:ue}};function Je(ft,ie){const Q=ft.type;if((Q.__ANT_BUTTON===!0||ft.type==="button")&&ft.props.disabled||Q.__ANT_SWITCH===!0&&(ft.props.disabled||ft.props.loading)||Q.__ANT_RADIO===!0&&ft.props.disabled){const{picked:ue,omitted:ce}=ye(ft.props.style,["position","left","right","top","bottom","float","display","zIndex"]),De=Object.assign(Object.assign({display:"inline-block"},ue),{cursor:"not-allowed",width:ft.props.block?"100%":void 0}),xe=Object.assign(Object.assign({},ce),{pointerEvents:"none"}),C=(0,$.Tm)(ft,{style:xe,className:null});return Ce.createElement("span",{style:De,className:Xe()(ft.props.className,`${ie}-disabled-compatible-wrapper`)},C)}return ft}const Ve=Ce.forwardRef((ft,ie)=>{var Q,ue;const{prefixCls:ce,openClassName:De,getTooltipContainer:xe,overlayClassName:C,color:B,overlayInnerStyle:ee,children:we,afterOpenChange:rt,afterVisibleChange:tt,destroyTooltipOnHide:ot,arrow:je=!0,title:nr,overlay:Kt,builtinPlacements:Lt,arrowPointAtCenter:Gr=!1,autoAdjustOverflow:Rr=!0}=ft,hn=!!je,[,Nr]=(0,V.Z)(),{getPopupContainer:an,getPrefixCls:zr,direction:We}=Ce.useContext(c.E_),mt=Ce.useRef(null),Ye=()=>{var Ue;(Ue=mt.current)===null||Ue===void 0||Ue.forceAlign()};Ce.useImperativeHandle(ie,()=>({forceAlign:Ye,forcePopupAlign:()=>{Ye()}}));const[Et,Tt]=(0,Oe.Z)(!1,{value:(Q=ft.open)!==null&&Q!==void 0?Q:ft.visible,defaultValue:(ue=ft.defaultOpen)!==null&&ue!==void 0?ue:ft.defaultVisible}),ge=!nr&&!Kt&&nr!==0,Be=Ue=>{var Ze,G;Tt(ge?!1:Ue),ge||((Ze=ft.onOpenChange)===null||Ze===void 0||Ze.call(ft,Ue),(G=ft.onVisibleChange)===null||G===void 0||G.call(ft,Ue))},et=Ce.useMemo(()=>{var Ue,Ze;let G=Gr;return typeof je=="object"&&(G=(Ze=(Ue=je.pointAtCenter)!==null&&Ue!==void 0?Ue:je.arrowPointAtCenter)!==null&&Ze!==void 0?Ze:Gr),Lt||(0,Pe.Z)({arrowPointAtCenter:G,autoAdjustOverflow:Rr,arrowWidth:hn?Nr.sizePopupArrow:0,borderRadius:Nr.borderRadius,offset:Nr.marginXXS,visibleFirst:!0})},[Gr,je,Lt,Nr]),gt=Ce.useMemo(()=>nr===0?nr:Kt||nr||"",[Kt,nr]),vt=Ce.createElement(te.BR,null,typeof gt=="function"?gt():gt),{getPopupContainer:Ut,placement:hr="top",mouseEnterDelay:Yt=.1,mouseLeaveDelay:Ke=.1,overlayStyle:$t,rootClassName:cr}=ft,Fe=Te(ft,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),He=zr("tooltip",ce),qe=zr(),Dt=ft["data-popover-inject"];let St=Et;!("open"in ft)&&!("visible"in ft)&&ge&&(St=!1);const Pt=Je((0,$.l$)(we)&&!(0,$.M2)(we)?we:Ce.createElement("span",null,we),He),Gt=Pt.props,k=!Gt.className||typeof Gt.className=="string"?Xe()(Gt.className,De||`${He}-open`):Gt.className,[D,ut]=W(He,!Dt),U=le(He,B),he=U.arrowStyle,Tr=Object.assign(Object.assign({},ee),U.overlayStyle),Ee=Xe()(C,{[`${He}-rtl`]:We==="rtl"},U.className,cr,ut);return D(Ce.createElement(Ge.Z,Object.assign({},Fe,{showArrow:hn,placement:hr,mouseEnterDelay:Yt,mouseLeaveDelay:Ke,prefixCls:He,overlayClassName:Ee,overlayStyle:Object.assign(Object.assign({},he),$t),getTooltipContainer:Ut||xe||an,ref:mt,builtinPlacements:et,overlay:vt,visible:St,onVisibleChange:Be,afterVisibleChange:rt!=null?rt:tt,overlayInnerStyle:Tr,arrowContent:Ce.createElement("span",{className:`${He}-arrow-content`}),motion:{motionName:(0,me.m)(qe,"zoom-big-fast",ft.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!ot}),St?(0,$.Tm)(Pt,{className:k}):Pt))});Ve._InternalPanelDoNotUseOrYouWillBeFired=ae;var st=Ve},64018:function(){var Ir,Mt,Y,Ce=!1,Le,Xe;window.PR_SHOULD_USE_CONTINUATION=!0;var Ge,Oe;(function(){var me=window,Pe=["break,continue,do,else,for,if,return,while"],$=[Pe,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],c=[$,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],te=[c,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],V=[c,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],A=[c,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],b="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",M=[c,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],I="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",re=[Pe,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],se=[Pe,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],q=[Pe,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],W=[te,A,V,M,I,re,se,q],Z=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,le="str",P="kwd",ae="com",Te="typ",ye="lit",Je="pun",Ve="pln",st="tag",ft="dec",ie="src",Q="atn",ue="atv",ce="nocode",De="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function xe(We){for(var mt=0,Ye=!1,Et=!1,Tt=0,ge=We.length;Tt<ge;++Tt){var Be=We[Tt];if(Be.ignoreCase)Et=!0;else if(/[a-z]/i.test(Be.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ye=!0,Et=!1;break}}var et={b:8,t:9,n:10,v:11,f:12,r:13};function gt(Ke){var $t=Ke.charCodeAt(0);if($t!==92)return $t;var cr=Ke.charAt(1);return $t=et[cr],$t||("0"<=cr&&cr<="7"?parseInt(Ke.substring(1),8):cr==="u"||cr==="x"?parseInt(Ke.substring(2),16):Ke.charCodeAt(1))}function vt(Ke){if(Ke<32)return(Ke<16?"\\x0":"\\x")+Ke.toString(16);var $t=String.fromCharCode(Ke);return $t==="\\"||$t==="-"||$t==="]"||$t==="^"?"\\"+$t:$t}function Ut(Ke){var $t=Ke.substring(1,Ke.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),cr=[],Fe=$t[0]==="^",He=["["];Fe&&He.push("^");for(var qe=Fe?1:0,Dt=$t.length;qe<Dt;++qe){var St=$t[qe];if(/\\[bdsw]/i.test(St))He.push(St);else{var Pt=gt(St),Gt;qe+2<Dt&&$t[qe+1]==="-"?(Gt=gt($t[qe+2]),qe+=2):Gt=Pt,cr.push([Pt,Gt]),Gt<65||Pt>122||(Gt<65||Pt>90||cr.push([Math.max(65,Pt)|32,Math.min(Gt,90)|32]),Gt<97||Pt>122||cr.push([Math.max(97,Pt)&-33,Math.min(Gt,122)&-33]))}}cr.sort(function(U,he){return U[0]-he[0]||he[1]-U[1]});for(var k=[],D=[],qe=0;qe<cr.length;++qe){var ut=cr[qe];ut[0]<=D[1]+1?D[1]=Math.max(D[1],ut[1]):k.push(D=ut)}for(var qe=0;qe<k.length;++qe){var ut=k[qe];He.push(vt(ut[0])),ut[1]>ut[0]&&(ut[1]+1>ut[0]&&He.push("-"),He.push(vt(ut[1])))}return He.push("]"),He.join("")}function hr(Ke){for(var $t=Ke.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),cr=$t.length,Fe=[],He=0,qe=0;He<cr;++He){var Dt=$t[He];if(Dt==="(")++qe;else if(Dt.charAt(0)==="\\"){var St=+Dt.substring(1);St&&(St<=qe?Fe[St]=-1:$t[He]=vt(St))}}for(var He=1;He<Fe.length;++He)Fe[He]===-1&&(Fe[He]=++mt);for(var He=0,qe=0;He<cr;++He){var Dt=$t[He];if(Dt==="(")++qe,Fe[qe]||($t[He]="(?:");else if(Dt.charAt(0)==="\\"){var St=+Dt.substring(1);St&&St<=qe&&($t[He]="\\"+Fe[St])}}for(var He=0;He<cr;++He)$t[He]==="^"&&$t[He+1]!=="^"&&($t[He]="");if(Ke.ignoreCase&&Ye)for(var He=0;He<cr;++He){var Dt=$t[He],Pt=Dt.charAt(0);Dt.length>=2&&Pt==="["?$t[He]=Ut(Dt):Pt!=="\\"&&($t[He]=Dt.replace(/[a-zA-Z]/g,function(D){var ut=D.charCodeAt(0);return"["+String.fromCharCode(ut&-33,ut|32)+"]"}))}return $t.join("")}for(var Yt=[],Tt=0,ge=We.length;Tt<ge;++Tt){var Be=We[Tt];if(Be.global||Be.multiline)throw new Error(""+Be);Yt.push("(?:"+hr(Be)+")")}return new RegExp(Yt.join("|"),Et?"gi":"g")}function C(We,mt){var Ye=/(?:^|\s)nocode(?:\s|$)/,Et=[],Tt=0,ge=[],Be=0;function et(gt){var vt=gt.nodeType;if(vt==1){if(Ye.test(gt.className))return;for(var Ut=gt.firstChild;Ut;Ut=Ut.nextSibling)et(Ut);var hr=gt.nodeName.toLowerCase();(hr==="br"||hr==="li")&&(Et[Be]=`
`,ge[Be<<1]=Tt++,ge[Be++<<1|1]=gt)}else if(vt==3||vt==4){var Yt=gt.nodeValue;Yt.length&&(mt?Yt=Yt.replace(/\r\n?/g,`
`):Yt=Yt.replace(/[ \t\r\n]+/g," "),Et[Be]=Yt,ge[Be<<1]=Tt,Tt+=Yt.length,ge[Be++<<1|1]=gt)}}return et(We),{sourceCode:Et.join("").replace(/\n$/,""),spans:ge}}function B(We,mt,Ye,Et,Tt){if(Ye){var ge={sourceNode:We,pre:1,langExtension:null,numberLines:null,sourceCode:Ye,spans:null,basePos:mt,decorations:null};Et(ge),Tt.push.apply(Tt,ge.decorations)}}var ee=/\S/;function we(We){for(var mt=void 0,Ye=We.firstChild;Ye;Ye=Ye.nextSibling){var Et=Ye.nodeType;mt=Et===1?mt?We:Ye:Et===3&&ee.test(Ye.nodeValue)?We:mt}return mt===We?void 0:mt}function rt(We,mt){var Ye={},Et;(function(){for(var Be=We.concat(mt),et=[],gt={},vt=0,Ut=Be.length;vt<Ut;++vt){var hr=Be[vt],Yt=hr[3];if(Yt)for(var Ke=Yt.length;--Ke>=0;)Ye[Yt.charAt(Ke)]=hr;var $t=hr[1],cr=""+$t;gt.hasOwnProperty(cr)||(et.push($t),gt[cr]=null)}et.push(/[\0-\uffff]/),Et=xe(et)})();var Tt=mt.length,ge=function(Be){for(var et=Be.sourceCode,gt=Be.basePos,vt=Be.sourceNode,Ut=[gt,Ve],hr=0,Yt=et.match(Et)||[],Ke={},$t=0,cr=Yt.length;$t<cr;++$t){var Fe=Yt[$t],He=Ke[Fe],qe=void 0,Dt;if(typeof He=="string")Dt=!1;else{var St=Ye[Fe.charAt(0)];if(St)qe=Fe.match(St[1]),He=St[0];else{for(var Pt=0;Pt<Tt;++Pt)if(St=mt[Pt],qe=Fe.match(St[1]),qe){He=St[0];break}qe||(He=Ve)}Dt=He.length>=5&&He.substring(0,5)==="lang-",Dt&&!(qe&&typeof qe[1]=="string")&&(Dt=!1,He=ie),Dt||(Ke[Fe]=He)}var Gt=hr;if(hr+=Fe.length,!Dt)Ut.push(gt+Gt,He);else{var k=qe[1],D=Fe.indexOf(k),ut=D+k.length;qe[2]&&(ut=Fe.length-qe[2].length,D=ut-k.length);var U=He.substring(5);B(vt,gt+Gt,Fe.substring(0,D),ge,Ut),B(vt,gt+Gt+D,k,Gr(U,k),Ut),B(vt,gt+Gt+ut,Fe.substring(ut),ge,Ut)}}Be.decorations=Ut};return ge}function tt(We){var mt=[],Ye=[];We.tripleQuotedStrings?mt.push([le,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):We.multiLineStrings?mt.push([le,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):mt.push([le,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),We.verbatimStrings&&Ye.push([le,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Et=We.hashComments;Et&&(We.cStyleComments?(Et>1?mt.push([ae,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):mt.push([ae,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ye.push([le,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):mt.push([ae,/^#[^\r\n]*/,null,"#"])),We.cStyleComments&&(Ye.push([ae,/^\/\/[^\r\n]*/,null]),Ye.push([ae,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Tt=We.regexLiterals;if(Tt){var ge=Tt>1?"":`
\r`,Be=ge?".":"[\\S\\s]",et="/(?=[^/*"+ge+"])(?:[^/\\x5B\\x5C"+ge+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+ge+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";Ye.push(["lang-regex",RegExp("^"+De+"("+et+")")])}var gt=We.types;gt&&Ye.push([Te,gt]);var vt=(""+We.keywords).replace(/^ | $/g,"");vt.length&&Ye.push([P,new RegExp("^(?:"+vt.replace(/[\s,]+/g,"|")+")\\b"),null]),mt.push([Ve,/^\s+/,null,` \r
\xA0`]);var Ut="^.[^\\s\\w.$@'\"`/\\\\]*";return We.regexLiterals&&(Ut+="(?!s*/)"),Ye.push([ye,/^@[a-z_$][a-z_$@0-9]*/i,null],[Te,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[Ve,/^[a-z_$][a-z_$@0-9]*/i,null],[ye,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[Ve,/^\\[\s\S]?/,null],[Je,new RegExp(Ut),null]),rt(mt,Ye)}var ot=tt({keywords:W,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function je(We,mt,Ye){for(var Et=/(?:^|\s)nocode(?:\s|$)/,Tt=/\r\n?|\n/,ge=We.ownerDocument,Be=ge.createElement("li");We.firstChild;)Be.appendChild(We.firstChild);var et=[Be];function gt($t){var cr=$t.nodeType;if(cr==1&&!Et.test($t.className))if($t.nodeName==="br")vt($t),$t.parentNode&&$t.parentNode.removeChild($t);else for(var Fe=$t.firstChild;Fe;Fe=Fe.nextSibling)gt(Fe);else if((cr==3||cr==4)&&Ye){var He=$t.nodeValue,qe=He.match(Tt);if(qe){var Dt=He.substring(0,qe.index);$t.nodeValue=Dt;var St=He.substring(qe.index+qe[0].length);if(St){var Pt=$t.parentNode;Pt.insertBefore(ge.createTextNode(St),$t.nextSibling)}vt($t),Dt||$t.parentNode.removeChild($t)}}}function vt($t){for(;!$t.nextSibling;)if($t=$t.parentNode,!$t)return;function cr(qe,Dt){var St=Dt?qe.cloneNode(!1):qe,Pt=qe.parentNode;if(Pt){var Gt=cr(Pt,1),k=qe.nextSibling;Gt.appendChild(St);for(var D=k;D;D=k)k=D.nextSibling,Gt.appendChild(D)}return St}for(var Fe=cr($t.nextSibling,0),He;(He=Fe.parentNode)&&He.nodeType===1;)Fe=He;et.push(Fe)}for(var Ut=0;Ut<et.length;++Ut)gt(et[Ut]);mt===(mt|0)&&et[0].setAttribute("value",mt);var hr=ge.createElement("ol");hr.className="linenums";for(var Yt=Math.max(0,mt-1|0)||0,Ut=0,Ke=et.length;Ut<Ke;++Ut)Be=et[Ut],Be.className="L"+(Ut+Yt)%10,Be.firstChild||Be.appendChild(ge.createTextNode("\xA0")),hr.appendChild(Be);We.appendChild(hr)}function nr(We){var mt=/\bMSIE\s(\d+)/.exec(navigator.userAgent);mt=mt&&+mt[1]<=8;var Ye=/\n/g,Et=We.sourceCode,Tt=Et.length,ge=0,Be=We.spans,et=Be.length,gt=0,vt=We.decorations,Ut=vt.length,hr=0;vt[Ut]=Tt;var Yt,Ke;for(Ke=Yt=0;Ke<Ut;)vt[Ke]!==vt[Ke+2]?(vt[Yt++]=vt[Ke++],vt[Yt++]=vt[Ke++]):Ke+=2;for(Ut=Yt,Ke=Yt=0;Ke<Ut;){for(var $t=vt[Ke],cr=vt[Ke+1],Fe=Ke+2;Fe+2<=Ut&&vt[Fe+1]===cr;)Fe+=2;vt[Yt++]=$t,vt[Yt++]=cr,Ke=Fe}Ut=vt.length=Yt;var He=We.sourceNode,qe="";He&&(qe=He.style.display,He.style.display="none");try{for(var Dt=null;gt<et;){var St=Be[gt],Pt=Be[gt+2]||Tt,Gt=vt[hr+2]||Tt,Fe=Math.min(Pt,Gt),k=Be[gt+1],D;if(k.nodeType!==1&&(D=Et.substring(ge,Fe))){mt&&(D=D.replace(Ye,"\r")),k.nodeValue=D;var ut=k.ownerDocument,U=ut.createElement("span");U.className=vt[hr+1];var he=k.parentNode;he.replaceChild(U,k),U.appendChild(k),ge<Pt&&(Be[gt+1]=k=ut.createTextNode(Et.substring(Fe,Pt)),he.insertBefore(k,U.nextSibling))}ge=Fe,ge>=Pt&&(gt+=2),ge>=Gt&&(hr+=2)}}finally{He&&(He.style.display=qe)}}var Kt={};function Lt(We,mt){for(var Ye=mt.length;--Ye>=0;){var Et=mt[Ye];Kt.hasOwnProperty(Et)?me.console&&console.warn("cannot override language handler %s",Et):Kt[Et]=We}}function Gr(We,mt){return We&&Kt.hasOwnProperty(We)||(We=/^\s*</.test(mt)?"default-markup":"default-code"),Kt[We]}Lt(ot,["default-code"]),Lt(rt([],[[Ve,/^[^<?]+/],[ft,/^<!\w[^>]*(?:>|$)/],[ae,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[Je,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Lt(rt([[Ve,/^[\s]+/,null,` \r
`],[ue,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[st,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[Q,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[Je,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Lt(rt([],[[ue,/^[\s\S]+/]]),["uq.val"]),Lt(tt({keywords:te,hashComments:!0,cStyleComments:!0,types:Z}),["c","cc","cpp","cxx","cyc","m"]),Lt(tt({keywords:"null,true,false"}),["json"]),Lt(tt({keywords:A,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Z}),["cs"]),Lt(tt({keywords:V,cStyleComments:!0}),["java"]),Lt(tt({keywords:q,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Lt(tt({keywords:re,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Lt(tt({keywords:I,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Lt(tt({keywords:se,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Lt(tt({keywords:M,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Lt(tt({keywords:b,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Lt(rt([],[[le,/^[\s\S]+/]]),["regex"]);function Rr(We){var mt=We.langExtension;try{var Ye=C(We.sourceNode,We.pre),Et=Ye.sourceCode;We.sourceCode=Et,We.spans=Ye.spans,We.basePos=0,Gr(mt,Et)(We),nr(We)}catch(Tt){me.console&&console.log(Tt&&Tt.stack||Tt)}}function hn(We,mt,Ye){var Et=Ye||!1,Tt=mt||null,ge=document.createElement("div");ge.innerHTML="<pre>"+We+"</pre>",ge=ge.firstChild,Et&&je(ge,Et,!0);var Be={langExtension:Tt,numberLines:Et,sourceNode:ge,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Rr(Be),ge.innerHTML}function Nr(We,mt){var Ye=mt||document.body,Et=Ye.ownerDocument||document;function Tt(St){return Ye.getElementsByTagName(St)}for(var ge=[Tt("pre"),Tt("code"),Tt("xmp")],Be=[],et=0;et<ge.length;++et)for(var gt=0,vt=ge[et].length;gt<vt;++gt)Be.push(ge[et][gt]);ge=null;var Ut=Date;Ut.now||(Ut={now:function(){return+new Date}});var hr=0,Yt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ke=/\bprettyprint\b/,$t=/\bprettyprinted\b/,cr=/pre|xmp/i,Fe=/^code$/i,He=/^(?:pre|code|xmp)$/i,qe={};function Dt(){for(var St=me.PR_SHOULD_USE_CONTINUATION?Ut.now()+250:1/0;hr<Be.length&&Ut.now()<St;hr++){for(var Pt=Be[hr],Gt=qe,k=Pt;k=k.previousSibling;){var D=k.nodeType,ut=(D===7||D===8)&&k.nodeValue;if(ut?!/^\??prettify\b/.test(ut):D!==3||/\S/.test(k.nodeValue))break;if(ut){Gt={},ut.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Se,qt,vr){Gt[qt]=vr});break}}var U=Pt.className;if((Gt!==qe||Ke.test(U))&&!$t.test(U)){for(var he=!1,Tr=Pt.parentNode;Tr;Tr=Tr.parentNode){var Ee=Tr.tagName;if(He.test(Ee)&&Tr.className&&Ke.test(Tr.className)){he=!0;break}}if(!he){Pt.className+=" prettyprinted";var Ue=Gt.lang;if(!Ue){Ue=U.match(Yt);var Ze;!Ue&&(Ze=we(Pt))&&Fe.test(Ze.tagName)&&(Ue=Ze.className.match(Yt)),Ue&&(Ue=Ue[1])}var G;if(cr.test(Pt.tagName))G=1;else{var pe=Pt.currentStyle,_e=Et.defaultView,Ne=pe?pe.whiteSpace:_e&&_e.getComputedStyle?_e.getComputedStyle(Pt,null).getPropertyValue("white-space"):0;G=Ne&&Ne.substring(0,3)==="pre"}var H=Gt.linenums;(H=H==="true"||+H)||(H=U.match(/\blinenums\b(?::(\d+))?/),H=H?H[1]&&H[1].length?+H[1]:!0:!1),H&&je(Pt,H,G);var Vt={langExtension:Ue,sourceNode:Pt,numberLines:H,pre:G,sourceCode:null,basePos:null,spans:null,decorations:null};Rr(Vt)}}}hr<Be.length?me.setTimeout(Dt,250):typeof We=="function"&&We()}Dt()}var an=me.PR={createSimpleLexer:rt,registerLangHandler:Lt,sourceDecorator:tt,PR_ATTRIB_NAME:Q,PR_ATTRIB_VALUE:ue,PR_COMMENT:ae,PR_DECLARATION:ft,PR_KEYWORD:P,PR_LITERAL:ye,PR_NOCODE:ce,PR_PLAIN:Ve,PR_PUNCTUATION:Je,PR_SOURCE:ie,PR_STRING:le,PR_TAG:st,PR_TYPE:Te,prettyPrintOne:Ce?me.prettyPrintOne=hn:Ge=hn,prettyPrint:Oe=Ce?me.prettyPrint=Nr:Oe=Nr},zr=me.define;typeof zr=="function"&&zr.amd&&zr("google-code-prettify",[],function(){return an})})()},25769:function(Ir,Mt,Y){"use strict";var Ce=Y(98040),Le={"text/plain":"Text","text/html":"Url",default:"Text"},Xe="Copy to clipboard: #{key}, Enter";function Ge(me){var Pe=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return me.replace(/#{\s*key\s*}/g,Pe)}function Oe(me,Pe){var $,c,te,V,A,b,M=!1;Pe||(Pe={}),$=Pe.debug||!1;try{te=Ce(),V=document.createRange(),A=document.getSelection(),b=document.createElement("span"),b.textContent=me,b.ariaHidden="true",b.style.all="unset",b.style.position="fixed",b.style.top=0,b.style.clip="rect(0, 0, 0, 0)",b.style.whiteSpace="pre",b.style.webkitUserSelect="text",b.style.MozUserSelect="text",b.style.msUserSelect="text",b.style.userSelect="text",b.addEventListener("copy",function(re){if(re.stopPropagation(),Pe.format)if(re.preventDefault(),typeof re.clipboardData=="undefined"){$&&console.warn("unable to use e.clipboardData"),$&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var se=Le[Pe.format]||Le.default;window.clipboardData.setData(se,me)}else re.clipboardData.clearData(),re.clipboardData.setData(Pe.format,me);Pe.onCopy&&(re.preventDefault(),Pe.onCopy(re.clipboardData))}),document.body.appendChild(b),V.selectNodeContents(b),A.addRange(V);var I=document.execCommand("copy");if(!I)throw new Error("copy command was unsuccessful");M=!0}catch(re){$&&console.error("unable to copy using execCommand: ",re),$&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(Pe.format||"text",me),Pe.onCopy&&Pe.onCopy(window.clipboardData),M=!0}catch(se){$&&console.error("unable to copy using clipboardData: ",se),$&&console.error("falling back to prompt"),c=Ge("message"in Pe?Pe.message:Xe),window.prompt(c,me)}}finally{A&&(typeof A.removeRange=="function"?A.removeRange(V):A.removeAllRanges()),b&&document.body.removeChild(b),te()}return M}Ir.exports=Oe},53184:function(Ir,Mt,Y){"use strict";var Ce,Le;function Xe(Ge,Oe,me){var Pe=function($,c){return Ge.js_beautify($,c)};return Pe.js=Ge.js_beautify,Pe.css=Oe.css_beautify,Pe.html=me.html_beautify,Pe.js_beautify=Ge.js_beautify,Pe.css_beautify=Oe.css_beautify,Pe.html_beautify=me.html_beautify,Pe}Ce=[Y(58553),Y(87804),Y(40998)],Le=function(Ge,Oe,me){return Xe(Ge,Oe,me)}.apply(Mt,Ce),Le!==void 0&&(Ir.exports=Le)},87804:function(Ir,Mt){var Y,Ce;(function(){var Le;(function(){"use strict";var Ge=[,,function($){function c(A){this.__parent=A,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}c.prototype.clone_empty=function(){var A=new c(this.__parent);return A.set_indent(this.__indent_count,this.__alignment_count),A},c.prototype.item=function(A){return A<0?this.__items[this.__items.length+A]:this.__items[A]},c.prototype.has_match=function(A){for(var b=this.__items.length-1;b>=0;b--)if(this.__items[b].match(A))return!0;return!1},c.prototype.set_indent=function(A,b){this.is_empty()&&(this.__indent_count=A||0,this.__alignment_count=b||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},c.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var A=this.__parent.current_line;return A.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),A.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),A.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,A.__items[0]===" "&&(A.__items.splice(0,1),A.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(A){this.__items.push(A);var b=A.lastIndexOf(`
`);b!==-1?this.__character_count=A.length-b:this.__character_count+=A.length},c.prototype.pop=function(){var A=null;return this.is_empty()||(A=this.__items.pop(),this.__character_count-=A.length),A},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var A="";return this.is_empty()?this.__parent.indent_empty_lines&&(A=this.__parent.get_indent_string(this.__indent_count)):(A=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),A+=this.__items.join("")),A};function te(A,b){this.__cache=[""],this.__indent_size=A.indent_size,this.__indent_string=A.indent_char,A.indent_with_tabs||(this.__indent_string=new Array(A.indent_size+1).join(A.indent_char)),b=b||"",A.indent_level>0&&(b=new Array(A.indent_level+1).join(this.__indent_string)),this.__base_string=b,this.__base_string_length=b.length}te.prototype.get_indent_size=function(A,b){var M=this.__base_string_length;return b=b||0,A<0&&(M=0),M+=A*this.__indent_size,M+=b,M},te.prototype.get_indent_string=function(A,b){var M=this.__base_string;return b=b||0,A<0&&(A=0,M=""),b+=A*this.__indent_size,this.__ensure_cache(b),M+=this.__cache[b],M},te.prototype.__ensure_cache=function(A){for(;A>=this.__cache.length;)this.__add_column()},te.prototype.__add_column=function(){var A=this.__cache.length,b=0,M="";this.__indent_size&&A>=this.__indent_size&&(b=Math.floor(A/this.__indent_size),A-=b*this.__indent_size,M=new Array(b+1).join(this.__indent_string)),A&&(M+=new Array(A+1).join(" ")),this.__cache.push(M)};function V(A,b){this.__indent_cache=new te(A,b),this.raw=!1,this._end_with_newline=A.end_with_newline,this.indent_size=A.indent_size,this.wrap_line_length=A.wrap_line_length,this.indent_empty_lines=A.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}V.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},V.prototype.get_line_number=function(){return this.__lines.length},V.prototype.get_indent_string=function(A,b){return this.__indent_cache.get_indent_string(A,b)},V.prototype.get_indent_size=function(A,b){return this.__indent_cache.get_indent_size(A,b)},V.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},V.prototype.add_new_line=function(A){return this.is_empty()||!A&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},V.prototype.get_code=function(A){this.trim(!0);var b=this.current_line.pop();b&&(b[b.length-1]===`
`&&(b=b.replace(/\n+$/g,"")),this.current_line.push(b)),this._end_with_newline&&this.__add_outputline();var M=this.__lines.join(`
`);return A!==`
`&&(M=M.replace(/[\n]/g,A)),M},V.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},V.prototype.set_indent=function(A,b){return A=A||0,b=b||0,this.next_line.set_indent(A,b),this.__lines.length>1?(this.current_line.set_indent(A,b),!0):(this.current_line.set_indent(),!1)},V.prototype.add_raw_token=function(A){for(var b=0;b<A.newlines;b++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(A.whitespace_before),this.current_line.push(A.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},V.prototype.add_token=function(A){this.__add_space_before_token(),this.current_line.push(A),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},V.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},V.prototype.remove_indent=function(A){for(var b=this.__lines.length;A<b;)this.__lines[A]._remove_indent(),A++;this.current_line._remove_wrap_indent()},V.prototype.trim=function(A){for(A=A===void 0?!1:A,this.current_line.trim();A&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},V.prototype.just_added_newline=function(){return this.current_line.is_empty()},V.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},V.prototype.ensure_empty_line_above=function(A,b){for(var M=this.__lines.length-2;M>=0;){var I=this.__lines[M];if(I.is_empty())break;if(I.item(0).indexOf(A)!==0&&I.item(-1)!==b){this.__lines.splice(M+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}M--}},$.exports.Output=V},,,,function($){function c(A,b){this.raw_options=te(A,b),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}c.prototype._get_array=function(A,b){var M=this.raw_options[A],I=b||[];return typeof M=="object"?M!==null&&typeof M.concat=="function"&&(I=M.concat()):typeof M=="string"&&(I=M.split(/[^a-zA-Z0-9_\/\-]+/)),I},c.prototype._get_boolean=function(A,b){var M=this.raw_options[A],I=M===void 0?!!b:!!M;return I},c.prototype._get_characters=function(A,b){var M=this.raw_options[A],I=b||"";return typeof M=="string"&&(I=M.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),I},c.prototype._get_number=function(A,b){var M=this.raw_options[A];b=parseInt(b,10),isNaN(b)&&(b=0);var I=parseInt(M,10);return isNaN(I)&&(I=b),I},c.prototype._get_selection=function(A,b,M){var I=this._get_selection_list(A,b,M);if(I.length!==1)throw new Error("Invalid Option Value: The option '"+A+`' can only be one of the following values:
`+b+`
You passed in: '`+this.raw_options[A]+"'");return I[0]},c.prototype._get_selection_list=function(A,b,M){if(!b||b.length===0)throw new Error("Selection list cannot be empty.");if(M=M||[b[0]],!this._is_valid_selection(M,b))throw new Error("Invalid Default Value!");var I=this._get_array(A,M);if(!this._is_valid_selection(I,b))throw new Error("Invalid Option Value: The option '"+A+`' can contain only the following values:
`+b+`
You passed in: '`+this.raw_options[A]+"'");return I},c.prototype._is_valid_selection=function(A,b){return A.length&&b.length&&!A.some(function(M){return b.indexOf(M)===-1})};function te(A,b){var M={};A=V(A);var I;for(I in A)I!==b&&(M[I]=A[I]);if(b&&A[b])for(I in A[b])M[I]=A[b][I];return M}function V(A){var b={},M;for(M in A){var I=M.replace(/-/g,"_");b[I]=A[M]}return b}$.exports.Options=c,$.exports.normalizeOpts=V,$.exports.mergeOpts=te},,function($){var c=RegExp.prototype.hasOwnProperty("sticky");function te(V){this.__input=V||"",this.__input_length=this.__input.length,this.__position=0}te.prototype.restart=function(){this.__position=0},te.prototype.back=function(){this.__position>0&&(this.__position-=1)},te.prototype.hasNext=function(){return this.__position<this.__input_length},te.prototype.next=function(){var V=null;return this.hasNext()&&(V=this.__input.charAt(this.__position),this.__position+=1),V},te.prototype.peek=function(V){var A=null;return V=V||0,V+=this.__position,V>=0&&V<this.__input_length&&(A=this.__input.charAt(V)),A},te.prototype.__match=function(V,A){V.lastIndex=A;var b=V.exec(this.__input);return b&&!(c&&V.sticky)&&b.index!==A&&(b=null),b},te.prototype.test=function(V,A){return A=A||0,A+=this.__position,A>=0&&A<this.__input_length?!!this.__match(V,A):!1},te.prototype.testChar=function(V,A){var b=this.peek(A);return V.lastIndex=0,b!==null&&V.test(b)},te.prototype.match=function(V){var A=this.__match(V,this.__position);return A?this.__position+=A[0].length:A=null,A},te.prototype.read=function(V,A,b){var M="",I;return V&&(I=this.match(V),I&&(M+=I[0])),A&&(I||!V)&&(M+=this.readUntil(A,b)),M},te.prototype.readUntil=function(V,A){var b="",M=this.__position;V.lastIndex=this.__position;var I=V.exec(this.__input);return I?(M=I.index,A&&(M+=I[0].length)):M=this.__input_length,b=this.__input.substring(this.__position,M),this.__position=M,b},te.prototype.readUntilAfter=function(V){return this.readUntil(V,!0)},te.prototype.get_regexp=function(V,A){var b=null,M="g";return A&&c&&(M="y"),typeof V=="string"&&V!==""?b=new RegExp(V,M):V&&(b=new RegExp(V.source,M)),b},te.prototype.get_literal_regexp=function(V){return RegExp(V.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},te.prototype.peekUntilAfter=function(V){var A=this.__position,b=this.readUntilAfter(V);return this.__position=A,b},te.prototype.lookBack=function(V){var A=this.__position-1;return A>=V.length&&this.__input.substring(A-V.length,A).toLowerCase()===V},$.exports.InputScanner=te},,,,,function($){function c(te,V){te=typeof te=="string"?te:te.source,V=typeof V=="string"?V:V.source,this.__directives_block_pattern=new RegExp(te+/ beautify( \w+[:]\w+)+ /.source+V,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(te+/\sbeautify\signore:end\s/.source+V,"g")}c.prototype.get_directives=function(te){if(!te.match(this.__directives_block_pattern))return null;var V={};this.__directive_pattern.lastIndex=0;for(var A=this.__directive_pattern.exec(te);A;)V[A[1]]=A[2],A=this.__directive_pattern.exec(te);return V},c.prototype.readIgnored=function(te){return te.readUntilAfter(this.__directives_end_ignore_pattern)},$.exports.Directives=c},,function($,c,te){var V=te(16).Beautifier,A=te(17).Options;function b(M,I){var re=new V(M,I);return re.beautify()}$.exports=b,$.exports.defaultOptions=function(){return new A}},function($,c,te){var V=te(17).Options,A=te(2).Output,b=te(8).InputScanner,M=te(13).Directives,I=new M(/\/\*/,/\*\//),re=/\r\n|[\r\n]/,se=/\r\n|[\r\n]/g,q=/\s/,W=/(?:\s|\n)+/g,Z=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,le=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function P(ae,Te){this._source_text=ae||"",this._options=new V(Te),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}P.prototype.eatString=function(ae){var Te="";for(this._ch=this._input.next();this._ch;){if(Te+=this._ch,this._ch==="\\")Te+=this._input.next();else if(ae.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return Te},P.prototype.eatWhitespace=function(ae){for(var Te=q.test(this._input.peek()),ye=0;q.test(this._input.peek());)this._ch=this._input.next(),ae&&this._ch===`
`&&(ye===0||ye<this._options.max_preserve_newlines)&&(ye++,this._output.add_new_line(!0));return Te},P.prototype.foundNestedPseudoClass=function(){for(var ae=0,Te=1,ye=this._input.peek(Te);ye;){if(ye==="{")return!0;if(ye==="(")ae+=1;else if(ye===")"){if(ae===0)return!1;ae-=1}else if(ye===";"||ye==="}")return!1;Te++,ye=this._input.peek(Te)}return!1},P.prototype.print_string=function(ae){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(ae)},P.prototype.preserveSingleSpace=function(ae){ae&&(this._output.space_before_token=!0)},P.prototype.indent=function(){this._indentLevel++},P.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var ae=this._source_text,Te=this._options.eol;Te==="auto"&&(Te=`
`,ae&&re.test(ae||"")&&(Te=ae.match(re)[0])),ae=ae.replace(se,`
`);var ye=ae.match(/^[\t ]*/)[0];this._output=new A(this._options,ye),this._input=new b(ae),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var Je=0,Ve=!1,st=!1,ft=!1,ie=!1,Q=!1,ue=this._ch,ce=!1,De,xe,C;De=this._input.read(W),xe=De!=="",C=ue,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),ue=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var B=this._input.read(Z),ee=I.get_directives(B);ee&&ee.ignore==="start"&&(B+=I.readIgnored(this._input)),this.print_string(B),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(le)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(xe),this.print_string(this._ch);var we=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);we.match(/[ :]$/)&&(we=this.eatString(": ").replace(/\s+$/,""),this.print_string(we),this._output.space_before_token=!0),Je===0&&we.indexOf(":")!==-1&&(st=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(xe),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var rt=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);rt.match(/[ :]$/)&&(rt=this.eatString(": ").replace(/\s+$/,""),this.print_string(rt),this._output.space_before_token=!0),Je===0&&rt.indexOf(":")!==-1?(st=!0,this.indent()):rt in this.NESTED_AT_RULE?(this._nestedLevel+=1,rt in this.CONDITIONAL_GROUP_RULE&&(ft=!0)):Je===0&&!st&&(ie=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(xe),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")st&&(st=!1,this.outdent()),ie=!1,ft?(ft=!1,Ve=this._indentLevel>=this._nestedLevel):Ve=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&Ve&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(C==="("?this._output.space_before_token=!1:C!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),C==="{"&&this._output.trim(!0),st&&(this.outdent(),st=!1),this.print_string(this._ch),Ve=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var tt=0;tt<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;tt++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[tt])){ce=!0;break}(Ve||ft)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!ie&&Je===0?(this.print_string(":"),st||(st=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ot=C==='"'||C==="'";this.preserveSingleSpace(ot||xe),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")ce=!1,Je===0?(st&&(this.outdent(),st=!1),ie=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),Je++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),Je&&(Je--,this.outdent()));else{var je=!1;this._input.lookBack("with")&&(je=!0),this.preserveSingleSpace(xe||je),this.print_string(this._ch),st&&C==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),Q=!0):(this.eatWhitespace(),Je++,this.indent())}else if(this._ch===")")Je&&(Je--,this.outdent()),Q&&this._input.peek()===";"&&this._options.selector_separator_newline&&(Q=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!st||Q)&&Je===0&&!ie?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!st&&Je===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&q.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(xe),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),q.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var nr=C==='"'||C==="'";this.preserveSingleSpace(nr||xe),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&ce&&this._output.add_new_line()}var Kt=this._output.get_code(Te);return Kt},$.exports.Beautifier=P},function($,c,te){var V=te(6).Options;function A(b){V.call(this,b,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var M=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||M;var I=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var re=0;re<I.length;re++)I[re]!=="expand"?this.brace_style="collapse":this.brace_style=I[re]}A.prototype=new V,$.exports.Options=A}],Oe={};function me($){var c=Oe[$];if(c!==void 0)return c.exports;var te=Oe[$]={exports:{}};return Ge[$](te,te.exports,me),te.exports}var Pe=me(15);Le=Pe})();var Xe=Le;Y=[],Ce=function(){return{css_beautify:Xe}}.apply(Mt,Y),Ce!==void 0&&(Ir.exports=Ce)})()},40998:function(Ir,Mt,Y){var Ce,Le;(function(){var Xe;(function(){"use strict";var Pe=[,,function(V){function A(I){this.__parent=I,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}A.prototype.clone_empty=function(){var I=new A(this.__parent);return I.set_indent(this.__indent_count,this.__alignment_count),I},A.prototype.item=function(I){return I<0?this.__items[this.__items.length+I]:this.__items[I]},A.prototype.has_match=function(I){for(var re=this.__items.length-1;re>=0;re--)if(this.__items[re].match(I))return!0;return!1},A.prototype.set_indent=function(I,re){this.is_empty()&&(this.__indent_count=I||0,this.__alignment_count=re||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},A.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},A.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var I=this.__parent.current_line;return I.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),I.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),I.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,I.__items[0]===" "&&(I.__items.splice(0,1),I.__character_count-=1),!0}return!1},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(I){this.__items.push(I);var re=I.lastIndexOf(`
`);re!==-1?this.__character_count=I.length-re:this.__character_count+=I.length},A.prototype.pop=function(){var I=null;return this.is_empty()||(I=this.__items.pop(),this.__character_count-=I.length),I},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.prototype.toString=function(){var I="";return this.is_empty()?this.__parent.indent_empty_lines&&(I=this.__parent.get_indent_string(this.__indent_count)):(I=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),I+=this.__items.join("")),I};function b(I,re){this.__cache=[""],this.__indent_size=I.indent_size,this.__indent_string=I.indent_char,I.indent_with_tabs||(this.__indent_string=new Array(I.indent_size+1).join(I.indent_char)),re=re||"",I.indent_level>0&&(re=new Array(I.indent_level+1).join(this.__indent_string)),this.__base_string=re,this.__base_string_length=re.length}b.prototype.get_indent_size=function(I,re){var se=this.__base_string_length;return re=re||0,I<0&&(se=0),se+=I*this.__indent_size,se+=re,se},b.prototype.get_indent_string=function(I,re){var se=this.__base_string;return re=re||0,I<0&&(I=0,se=""),re+=I*this.__indent_size,this.__ensure_cache(re),se+=this.__cache[re],se},b.prototype.__ensure_cache=function(I){for(;I>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var I=this.__cache.length,re=0,se="";this.__indent_size&&I>=this.__indent_size&&(re=Math.floor(I/this.__indent_size),I-=re*this.__indent_size,se=new Array(re+1).join(this.__indent_string)),I&&(se+=new Array(I+1).join(" ")),this.__cache.push(se)};function M(I,re){this.__indent_cache=new b(I,re),this.raw=!1,this._end_with_newline=I.end_with_newline,this.indent_size=I.indent_size,this.wrap_line_length=I.wrap_line_length,this.indent_empty_lines=I.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}M.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},M.prototype.get_line_number=function(){return this.__lines.length},M.prototype.get_indent_string=function(I,re){return this.__indent_cache.get_indent_string(I,re)},M.prototype.get_indent_size=function(I,re){return this.__indent_cache.get_indent_size(I,re)},M.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},M.prototype.add_new_line=function(I){return this.is_empty()||!I&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},M.prototype.get_code=function(I){this.trim(!0);var re=this.current_line.pop();re&&(re[re.length-1]===`
`&&(re=re.replace(/\n+$/g,"")),this.current_line.push(re)),this._end_with_newline&&this.__add_outputline();var se=this.__lines.join(`
`);return I!==`
`&&(se=se.replace(/[\n]/g,I)),se},M.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},M.prototype.set_indent=function(I,re){return I=I||0,re=re||0,this.next_line.set_indent(I,re),this.__lines.length>1?(this.current_line.set_indent(I,re),!0):(this.current_line.set_indent(),!1)},M.prototype.add_raw_token=function(I){for(var re=0;re<I.newlines;re++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(I.whitespace_before),this.current_line.push(I.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},M.prototype.add_token=function(I){this.__add_space_before_token(),this.current_line.push(I),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},M.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},M.prototype.remove_indent=function(I){for(var re=this.__lines.length;I<re;)this.__lines[I]._remove_indent(),I++;this.current_line._remove_wrap_indent()},M.prototype.trim=function(I){for(I=I===void 0?!1:I,this.current_line.trim();I&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},M.prototype.just_added_newline=function(){return this.current_line.is_empty()},M.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},M.prototype.ensure_empty_line_above=function(I,re){for(var se=this.__lines.length-2;se>=0;){var q=this.__lines[se];if(q.is_empty())break;if(q.item(0).indexOf(I)!==0&&q.item(-1)!==re){this.__lines.splice(se+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}se--}},V.exports.Output=M},function(V){function A(b,M,I,re){this.type=b,this.text=M,this.comments_before=null,this.newlines=I||0,this.whitespace_before=re||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}V.exports.Token=A},,,function(V){function A(I,re){this.raw_options=b(I,re),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}A.prototype._get_array=function(I,re){var se=this.raw_options[I],q=re||[];return typeof se=="object"?se!==null&&typeof se.concat=="function"&&(q=se.concat()):typeof se=="string"&&(q=se.split(/[^a-zA-Z0-9_\/\-]+/)),q},A.prototype._get_boolean=function(I,re){var se=this.raw_options[I],q=se===void 0?!!re:!!se;return q},A.prototype._get_characters=function(I,re){var se=this.raw_options[I],q=re||"";return typeof se=="string"&&(q=se.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),q},A.prototype._get_number=function(I,re){var se=this.raw_options[I];re=parseInt(re,10),isNaN(re)&&(re=0);var q=parseInt(se,10);return isNaN(q)&&(q=re),q},A.prototype._get_selection=function(I,re,se){var q=this._get_selection_list(I,re,se);if(q.length!==1)throw new Error("Invalid Option Value: The option '"+I+`' can only be one of the following values:
`+re+`
You passed in: '`+this.raw_options[I]+"'");return q[0]},A.prototype._get_selection_list=function(I,re,se){if(!re||re.length===0)throw new Error("Selection list cannot be empty.");if(se=se||[re[0]],!this._is_valid_selection(se,re))throw new Error("Invalid Default Value!");var q=this._get_array(I,se);if(!this._is_valid_selection(q,re))throw new Error("Invalid Option Value: The option '"+I+`' can contain only the following values:
`+re+`
You passed in: '`+this.raw_options[I]+"'");return q},A.prototype._is_valid_selection=function(I,re){return I.length&&re.length&&!I.some(function(se){return re.indexOf(se)===-1})};function b(I,re){var se={};I=M(I);var q;for(q in I)q!==re&&(se[q]=I[q]);if(re&&I[re])for(q in I[re])se[q]=I[re][q];return se}function M(I){var re={},se;for(se in I){var q=se.replace(/-/g,"_");re[q]=I[se]}return re}V.exports.Options=A,V.exports.normalizeOpts=M,V.exports.mergeOpts=b},,function(V){var A=RegExp.prototype.hasOwnProperty("sticky");function b(M){this.__input=M||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var M=null;return this.hasNext()&&(M=this.__input.charAt(this.__position),this.__position+=1),M},b.prototype.peek=function(M){var I=null;return M=M||0,M+=this.__position,M>=0&&M<this.__input_length&&(I=this.__input.charAt(M)),I},b.prototype.__match=function(M,I){M.lastIndex=I;var re=M.exec(this.__input);return re&&!(A&&M.sticky)&&re.index!==I&&(re=null),re},b.prototype.test=function(M,I){return I=I||0,I+=this.__position,I>=0&&I<this.__input_length?!!this.__match(M,I):!1},b.prototype.testChar=function(M,I){var re=this.peek(I);return M.lastIndex=0,re!==null&&M.test(re)},b.prototype.match=function(M){var I=this.__match(M,this.__position);return I?this.__position+=I[0].length:I=null,I},b.prototype.read=function(M,I,re){var se="",q;return M&&(q=this.match(M),q&&(se+=q[0])),I&&(q||!M)&&(se+=this.readUntil(I,re)),se},b.prototype.readUntil=function(M,I){var re="",se=this.__position;M.lastIndex=this.__position;var q=M.exec(this.__input);return q?(se=q.index,I&&(se+=q[0].length)):se=this.__input_length,re=this.__input.substring(this.__position,se),this.__position=se,re},b.prototype.readUntilAfter=function(M){return this.readUntil(M,!0)},b.prototype.get_regexp=function(M,I){var re=null,se="g";return I&&A&&(se="y"),typeof M=="string"&&M!==""?re=new RegExp(M,se):M&&(re=new RegExp(M.source,se)),re},b.prototype.get_literal_regexp=function(M){return RegExp(M.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(M){var I=this.__position,re=this.readUntilAfter(M);return this.__position=I,re},b.prototype.lookBack=function(M){var I=this.__position-1;return I>=M.length&&this.__input.substring(I-M.length,I).toLowerCase()===M},V.exports.InputScanner=b},function(V,A,b){var M=b(8).InputScanner,I=b(3).Token,re=b(10).TokenStream,se=b(11).WhitespacePattern,q={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},W=function(Z,le){this._input=new M(Z),this._options=le||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new se(this._input)};W.prototype.tokenize=function(){this._input.restart(),this.__tokens=new re,this._reset();for(var Z,le=new I(q.START,""),P=null,ae=[],Te=new re;le.type!==q.EOF;){for(Z=this._get_next_token(le,P);this._is_comment(Z);)Te.add(Z),Z=this._get_next_token(le,P);Te.isEmpty()||(Z.comments_before=Te,Te=new re),Z.parent=P,this._is_opening(Z)?(ae.push(P),P=Z):P&&this._is_closing(Z,P)&&(Z.opened=P,P.closed=Z,P=ae.pop(),Z.parent=P),Z.previous=le,le.next=Z,this.__tokens.add(Z),le=Z}return this.__tokens},W.prototype._is_first_token=function(){return this.__tokens.isEmpty()},W.prototype._reset=function(){},W.prototype._get_next_token=function(Z,le){this._readWhitespace();var P=this._input.read(/.+/g);return P?this._create_token(q.RAW,P):this._create_token(q.EOF,"")},W.prototype._is_comment=function(Z){return!1},W.prototype._is_opening=function(Z){return!1},W.prototype._is_closing=function(Z,le){return!1},W.prototype._create_token=function(Z,le){var P=new I(Z,le,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return P},W.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},V.exports.Tokenizer=W,V.exports.TOKEN=q},function(V){function A(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}A.prototype.restart=function(){this.__position=0},A.prototype.isEmpty=function(){return this.__tokens_length===0},A.prototype.hasNext=function(){return this.__position<this.__tokens_length},A.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},A.prototype.peek=function(b){var M=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(M=this.__tokens[b]),M},A.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},V.exports.TokenStream=A},function(V,A,b){var M=b(12).Pattern;function I(re,se){M.call(this,re,se),se?this._line_regexp=this._input.get_regexp(se._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}I.prototype=new M,I.prototype.__set_whitespace_patterns=function(re,se){re+="\\t ",se+="\\n\\r",this._match_pattern=this._input.get_regexp("["+re+se+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+se+"]")},I.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var re=this._input.read(this._match_pattern);if(re===" ")this.whitespace_before_token=" ";else if(re){var se=this.__split(this._newline_regexp,re);this.newline_count=se.length-1,this.whitespace_before_token=se[this.newline_count]}return re},I.prototype.matching=function(re,se){var q=this._create();return q.__set_whitespace_patterns(re,se),q._update(),q},I.prototype._create=function(){return new I(this._input,this)},I.prototype.__split=function(re,se){re.lastIndex=0;for(var q=0,W=[],Z=re.exec(se);Z;)W.push(se.substring(q,Z.index)),q=Z.index+Z[0].length,Z=re.exec(se);return q<se.length?W.push(se.substring(q,se.length)):W.push(""),W},V.exports.WhitespacePattern=I},function(V){function A(b,M){this._input=b,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,M&&(this._starting_pattern=this._input.get_regexp(M._starting_pattern,!0),this._match_pattern=this._input.get_regexp(M._match_pattern,!0),this._until_pattern=this._input.get_regexp(M._until_pattern),this._until_after=M._until_after)}A.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},A.prototype.read_match=function(){return this._input.match(this._match_pattern)},A.prototype.until_after=function(b){var M=this._create();return M._until_after=!0,M._until_pattern=this._input.get_regexp(b),M._update(),M},A.prototype.until=function(b){var M=this._create();return M._until_after=!1,M._until_pattern=this._input.get_regexp(b),M._update(),M},A.prototype.starting_with=function(b){var M=this._create();return M._starting_pattern=this._input.get_regexp(b,!0),M._update(),M},A.prototype.matching=function(b){var M=this._create();return M._match_pattern=this._input.get_regexp(b,!0),M._update(),M},A.prototype._create=function(){return new A(this._input,this)},A.prototype._update=function(){},V.exports.Pattern=A},function(V){function A(b,M){b=typeof b=="string"?b:b.source,M=typeof M=="string"?M:M.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+M,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+M,"g")}A.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var M={};this.__directive_pattern.lastIndex=0;for(var I=this.__directive_pattern.exec(b);I;)M[I[1]]=I[2],I=this.__directive_pattern.exec(b);return M},A.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},V.exports.Directives=A},function(V,A,b){var M=b(12).Pattern,I={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function re(se,q){M.call(this,se,q),this.__template_pattern=null,this._disabled=Object.assign({},I),this._excluded=Object.assign({},I),q&&(this.__template_pattern=this._input.get_regexp(q.__template_pattern),this._excluded=Object.assign(this._excluded,q._excluded),this._disabled=Object.assign(this._disabled,q._disabled));var W=new M(se);this.__patterns={handlebars_comment:W.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:W.starting_with(/{{{/).until_after(/}}}/),handlebars:W.starting_with(/{{/).until_after(/}}/),php:W.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:W.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:W.starting_with(/{%/).until_after(/%}/),django_value:W.starting_with(/{{/).until_after(/}}/),django_comment:W.starting_with(/{#/).until_after(/#}/),smarty:W.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:W.starting_with(/{\*/).until_after(/\*}/),smarty_literal:W.starting_with(/{literal}/).until_after(/{\/literal}/)}}re.prototype=new M,re.prototype._create=function(){return new re(this._input,this)},re.prototype._update=function(){this.__set_templated_pattern()},re.prototype.disable=function(se){var q=this._create();return q._disabled[se]=!0,q._update(),q},re.prototype.read_options=function(se){var q=this._create();for(var W in I)q._disabled[W]=se.templating.indexOf(W)===-1;return q._update(),q},re.prototype.exclude=function(se){var q=this._create();return q._excluded[se]=!0,q._update(),q},re.prototype.read=function(){var se="";this._match_pattern?se=this._input.read(this._starting_pattern):se=this._input.read(this._starting_pattern,this.__template_pattern);for(var q=this._read_template();q;)this._match_pattern?q+=this._input.read(this._match_pattern):q+=this._input.readUntil(this.__template_pattern),se+=q,q=this._read_template();return this._until_after&&(se+=this._input.readUntilAfter(this._until_pattern)),se},re.prototype.__set_templated_pattern=function(){var se=[];this._disabled.php||se.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||se.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||se.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||se.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(se.push(this.__patterns.django._starting_pattern.source),se.push(this.__patterns.django_value._starting_pattern.source),se.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||se.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&se.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+se.join("|")+")")},re.prototype._read_template=function(){var se="",q=this._input.peek();if(q==="<"){var W=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&W==="?"&&(se=se||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&W==="%"&&(se=se||this.__patterns.erb.read())}else q==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(se=se||this.__patterns.handlebars_comment.read(),se=se||this.__patterns.handlebars_unescaped.read(),se=se||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(se=se||this.__patterns.django_value.read()),this._excluded.django||(se=se||this.__patterns.django_comment.read(),se=se||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(se=se||this.__patterns.smarty_comment.read(),se=se||this.__patterns.smarty_literal.read(),se=se||this.__patterns.smarty.read()));return se},V.exports.TemplatablePattern=re},,,,function(V,A,b){var M=b(19).Beautifier,I=b(20).Options;function re(se,q,W,Z){var le=new M(se,q,W,Z);return le.beautify()}V.exports=re,V.exports.defaultOptions=function(){return new I}},function(V,A,b){var M=b(20).Options,I=b(2).Output,re=b(21).Tokenizer,se=b(21).TOKEN,q=/\r\n|[\r\n]/,W=/\r\n|[\r\n]/g,Z=function(ie,Q){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=ie.max_preserve_newlines,this.preserve_newlines=ie.preserve_newlines,this._output=new I(ie,Q)};Z.prototype.current_line_has_match=function(ie){return this._output.current_line.has_match(ie)},Z.prototype.set_space_before_token=function(ie,Q){this._output.space_before_token=ie,this._output.non_breaking_space=Q},Z.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},Z.prototype.add_raw_token=function(ie){this._output.add_raw_token(ie)},Z.prototype.print_preserved_newlines=function(ie){var Q=0;ie.type!==se.TEXT&&ie.previous.type!==se.TEXT&&(Q=ie.newlines?1:0),this.preserve_newlines&&(Q=ie.newlines<this.max_preserve_newlines+1?ie.newlines:this.max_preserve_newlines+1);for(var ue=0;ue<Q;ue++)this.print_newline(ue>0);return Q!==0},Z.prototype.traverse_whitespace=function(ie){return ie.whitespace_before||ie.newlines?(this.print_preserved_newlines(ie)||(this._output.space_before_token=!0),!0):!1},Z.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},Z.prototype.print_newline=function(ie){this._output.add_new_line(ie)},Z.prototype.print_token=function(ie){ie.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(ie.text))},Z.prototype.indent=function(){this.indent_level++},Z.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},Z.prototype.get_full_indent=function(ie){return ie=this.indent_level+(ie||0),ie<1?"":this._output.get_indent_string(ie)};var le=function(ie){for(var Q=null,ue=ie.next;ue.type!==se.EOF&&ie.closed!==ue;){if(ue.type===se.ATTRIBUTE&&ue.text==="type"){ue.next&&ue.next.type===se.EQUALS&&ue.next.next&&ue.next.next.type===se.VALUE&&(Q=ue.next.next.text);break}ue=ue.next}return Q},P=function(ie,Q){var ue=null,ce=null;return Q.closed?(ie==="script"?ue="text/javascript":ie==="style"&&(ue="text/css"),ue=le(Q)||ue,ue.search("text/css")>-1?ce="css":ue.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?ce="javascript":ue.search(/(text|application|dojo)\/(x-)?(html)/)>-1?ce="html":ue.search(/test\/null/)>-1&&(ce="null"),ce):null};function ae(ie,Q){return Q.indexOf(ie)!==-1}function Te(ie,Q,ue){this.parent=ie||null,this.tag=Q?Q.tag_name:"",this.indent_level=ue||0,this.parser_token=Q||null}function ye(ie){this._printer=ie,this._current_frame=null}ye.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},ye.prototype.record_tag=function(ie){var Q=new Te(this._current_frame,ie,this._printer.indent_level);this._current_frame=Q},ye.prototype._try_pop_frame=function(ie){var Q=null;return ie&&(Q=ie.parser_token,this._printer.indent_level=ie.indent_level,this._current_frame=ie.parent),Q},ye.prototype._get_frame=function(ie,Q){for(var ue=this._current_frame;ue&&ie.indexOf(ue.tag)===-1;){if(Q&&Q.indexOf(ue.tag)!==-1){ue=null;break}ue=ue.parent}return ue},ye.prototype.try_pop=function(ie,Q){var ue=this._get_frame([ie],Q);return this._try_pop_frame(ue)},ye.prototype.indent_to_tag=function(ie){var Q=this._get_frame(ie);Q&&(this._printer.indent_level=Q.indent_level)};function Je(ie,Q,ue,ce){this._source_text=ie||"",Q=Q||{},this._js_beautify=ue,this._css_beautify=ce,this._tag_stack=null;var De=new M(Q,"html");this._options=De,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}Je.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var ie=this._source_text,Q=this._options.eol;this._options.eol==="auto"&&(Q=`
`,ie&&q.test(ie)&&(Q=ie.match(q)[0])),ie=ie.replace(W,`
`);var ue=ie.match(/^[\t ]*/)[0],ce={text:"",type:""},De=new Ve(this._options),xe=new Z(this._options,ue),C=new re(ie,this._options).tokenize();this._tag_stack=new ye(xe);for(var B=null,ee=C.next();ee.type!==se.EOF;)ee.type===se.TAG_OPEN||ee.type===se.COMMENT?(B=this._handle_tag_open(xe,ee,De,ce,C),De=B):ee.type===se.ATTRIBUTE||ee.type===se.EQUALS||ee.type===se.VALUE||ee.type===se.TEXT&&!De.tag_complete?B=this._handle_inside_tag(xe,ee,De,ce):ee.type===se.TAG_CLOSE?B=this._handle_tag_close(xe,ee,De):ee.type===se.TEXT?B=this._handle_text(xe,ee,De):ee.type===se.CONTROL_FLOW_OPEN?B=this._handle_control_flow_open(xe,ee):ee.type===se.CONTROL_FLOW_CLOSE?B=this._handle_control_flow_close(xe,ee):xe.add_raw_token(ee),ce=B,ee=C.next();var we=xe._output.get_code(Q);return we},Je.prototype._handle_control_flow_open=function(ie,Q){var ue={text:Q.text,type:Q.type};return ie.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),Q.newlines?ie.print_preserved_newlines(Q):ie.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),ie.print_token(Q),ie.indent(),ue},Je.prototype._handle_control_flow_close=function(ie,Q){var ue={text:Q.text,type:Q.type};return ie.deindent(),Q.newlines?ie.print_preserved_newlines(Q):ie.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),ie.print_token(Q),ue},Je.prototype._handle_tag_close=function(ie,Q,ue){var ce={text:Q.text,type:Q.type};return ie.alignment_size=0,ue.tag_complete=!0,ie.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),ue.is_unformatted?ie.add_raw_token(Q):(ue.tag_start_char==="<"&&(ie.set_space_before_token(Q.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&ue.has_wrapped_attrs&&ie.print_newline(!1)),ie.print_token(Q)),ue.indent_content&&!(ue.is_unformatted||ue.is_content_unformatted)&&(ie.indent(),ue.indent_content=!1),!ue.is_inline_element&&!(ue.is_unformatted||ue.is_content_unformatted)&&ie.set_wrap_point(),ce},Je.prototype._handle_inside_tag=function(ie,Q,ue,ce){var De=ue.has_wrapped_attrs,xe={text:Q.text,type:Q.type};return ie.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),ue.is_unformatted?ie.add_raw_token(Q):ue.tag_start_char==="{"&&Q.type===se.TEXT?ie.print_preserved_newlines(Q)?(Q.newlines=0,ie.add_raw_token(Q)):ie.print_token(Q):(Q.type===se.ATTRIBUTE?ie.set_space_before_token(!0):(Q.type===se.EQUALS||Q.type===se.VALUE&&Q.previous.type===se.EQUALS)&&ie.set_space_before_token(!1),Q.type===se.ATTRIBUTE&&ue.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(ie.traverse_whitespace(Q),De=De||Q.newlines!==0),this._is_wrap_attributes_force&&ue.attr_count>=this._options.wrap_attributes_min_attrs&&(ce.type!==se.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(ie.print_newline(!1),De=!0)),ie.print_token(Q),De=De||ie.previous_token_wrapped(),ue.has_wrapped_attrs=De),xe},Je.prototype._handle_text=function(ie,Q,ue){var ce={text:Q.text,type:"TK_CONTENT"};return ue.custom_beautifier_name?this._print_custom_beatifier_text(ie,Q,ue):ue.is_unformatted||ue.is_content_unformatted?ie.add_raw_token(Q):(ie.traverse_whitespace(Q),ie.print_token(Q)),ce},Je.prototype._print_custom_beatifier_text=function(ie,Q,ue){var ce=this;if(Q.text!==""){var De=Q.text,xe,C=1,B="",ee="";ue.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?xe=this._js_beautify:ue.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?xe=this._css_beautify:ue.custom_beautifier_name==="html"&&(xe=function(nr,Kt){var Lt=new Je(nr,Kt,ce._js_beautify,ce._css_beautify);return Lt.beautify()}),this._options.indent_scripts==="keep"?C=0:this._options.indent_scripts==="separate"&&(C=-ie.indent_level);var we=ie.get_full_indent(C);if(De=De.replace(/\n[ \t]*$/,""),ue.custom_beautifier_name!=="html"&&De[0]==="<"&&De.match(/^(<!--|<!\[CDATA\[)/)){var rt=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(De);if(!rt){ie.add_raw_token(Q);return}B=we+rt[1]+`
`,De=rt[4],rt[5]&&(ee=we+rt[5]),De=De.replace(/\n[ \t]*$/,""),(rt[2]||rt[3].indexOf(`
`)!==-1)&&(rt=rt[3].match(/[ \t]+$/),rt&&(Q.whitespace_before=rt[0]))}if(De)if(xe){var tt=function(){this.eol=`
`};tt.prototype=this._options.raw_options;var ot=new tt;De=xe(we+De,ot)}else{var je=Q.whitespace_before;je&&(De=De.replace(new RegExp(`
(`+je+")?","g"),`
`)),De=we+De.replace(/\n/g,`
`+we)}B&&(De?De=B+De+`
`+ee:De=B+ee),ie.print_newline(!1),De&&(Q.text=De,Q.whitespace_before="",Q.newlines=0,ie.add_raw_token(Q),ie.print_newline(!0))}},Je.prototype._handle_tag_open=function(ie,Q,ue,ce,De){var xe=this._get_tag_open_token(Q);if((ue.is_unformatted||ue.is_content_unformatted)&&!ue.is_empty_element&&Q.type===se.TAG_OPEN&&!xe.is_start_tag?(ie.add_raw_token(Q),xe.start_tag_token=this._tag_stack.try_pop(xe.tag_name)):(ie.traverse_whitespace(Q),this._set_tag_position(ie,Q,xe,ue,ce),xe.is_inline_element||ie.set_wrap_point(),ie.print_token(Q)),xe.is_start_tag&&this._is_wrap_attributes_force){var C=0,B;do B=De.peek(C),B.type===se.ATTRIBUTE&&(xe.attr_count+=1),C+=1;while(B.type!==se.EOF&&B.type!==se.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(xe.alignment_size=Q.text.length+1),!xe.tag_complete&&!xe.is_unformatted&&(ie.alignment_size=xe.alignment_size),xe};var Ve=function(ie,Q,ue){if(this.parent=Q||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!ue)this.tag_complete=!0;else{var ce;this.tag_start_char=ue.text[0],this.text=ue.text,this.tag_start_char==="<"?(ce=ue.text.match(/^<([^\s>]*)/),this.tag_check=ce?ce[1]:""):(ce=ue.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=ce?ce[1]:"",(ue.text.startsWith("{{#>")||ue.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&ue.next!==null?this.tag_check=ue.next.text.split(" ")[0]:this.tag_check=ue.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),ue.type===se.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||ue.closed&&ue.closed.text==="/>";var De=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(De=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!ie.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(De)))}};Je.prototype._get_tag_open_token=function(ie){var Q=new Ve(this._options,this._tag_stack.get_parser_token(),ie);return Q.alignment_size=this._options.wrap_attributes_indent_size,Q.is_end_tag=Q.is_end_tag||ae(Q.tag_check,this._options.void_elements),Q.is_empty_element=Q.tag_complete||Q.is_start_tag&&Q.is_end_tag,Q.is_unformatted=!Q.tag_complete&&ae(Q.tag_check,this._options.unformatted),Q.is_content_unformatted=!Q.is_empty_element&&ae(Q.tag_check,this._options.content_unformatted),Q.is_inline_element=ae(Q.tag_name,this._options.inline)||this._options.inline_custom_elements&&Q.tag_name.includes("-")||Q.tag_start_char==="{",Q},Je.prototype._set_tag_position=function(ie,Q,ue,ce,De){if(ue.is_empty_element||(ue.is_end_tag?ue.start_tag_token=this._tag_stack.try_pop(ue.tag_name):(this._do_optional_end_element(ue)&&(ue.is_inline_element||ie.print_newline(!1)),this._tag_stack.record_tag(ue),(ue.tag_name==="script"||ue.tag_name==="style")&&!(ue.is_unformatted||ue.is_content_unformatted)&&(ue.custom_beautifier_name=P(ue.tag_check,Q)))),ae(ue.tag_check,this._options.extra_liners)&&(ie.print_newline(!1),ie._output.just_added_blankline()||ie.print_newline(!0)),ue.is_empty_element){if(ue.tag_start_char==="{"&&ue.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),ue.indent_content=!0;var xe=ie.current_line_has_match(/{{#if/);xe||ie.print_newline(!1)}ue.tag_name==="!--"&&De.type===se.TAG_CLOSE&&ce.is_end_tag&&ue.text.indexOf(`
`)===-1||(ue.is_inline_element||ue.is_unformatted||ie.print_newline(!1),this._calcluate_parent_multiline(ie,ue))}else if(ue.is_end_tag){var C=!1;C=ue.start_tag_token&&ue.start_tag_token.multiline_content,C=C||!ue.is_inline_element&&!(ce.is_inline_element||ce.is_unformatted)&&!(De.type===se.TAG_CLOSE&&ue.start_tag_token===ce)&&De.type!=="TK_CONTENT",(ue.is_content_unformatted||ue.is_unformatted)&&(C=!1),C&&ie.print_newline(!1)}else ue.indent_content=!ue.custom_beautifier_name,ue.tag_start_char==="<"&&(ue.tag_name==="html"?ue.indent_content=this._options.indent_inner_html:ue.tag_name==="head"?ue.indent_content=this._options.indent_head_inner_html:ue.tag_name==="body"&&(ue.indent_content=this._options.indent_body_inner_html)),!(ue.is_inline_element||ue.is_unformatted)&&(De.type!=="TK_CONTENT"||ue.is_content_unformatted)&&ie.print_newline(!1),this._calcluate_parent_multiline(ie,ue)},Je.prototype._calcluate_parent_multiline=function(ie,Q){Q.parent&&ie._output.just_added_newline()&&!((Q.is_inline_element||Q.is_unformatted)&&Q.parent.is_inline_element)&&(Q.parent.multiline_content=!0)};var st=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],ft=["a","audio","del","ins","map","noscript","video"];Je.prototype._do_optional_end_element=function(ie){var Q=null;if(!(ie.is_empty_element||!ie.is_start_tag||!ie.parent)){if(ie.tag_name==="body")Q=Q||this._tag_stack.try_pop("head");else if(ie.tag_name==="li")Q=Q||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(ie.tag_name==="dd"||ie.tag_name==="dt")Q=Q||this._tag_stack.try_pop("dt",["dl"]),Q=Q||this._tag_stack.try_pop("dd",["dl"]);else if(ie.parent.tag_name==="p"&&st.indexOf(ie.tag_name)!==-1){var ue=ie.parent.parent;(!ue||ft.indexOf(ue.tag_name)===-1)&&(Q=Q||this._tag_stack.try_pop("p"))}else ie.tag_name==="rp"||ie.tag_name==="rt"?(Q=Q||this._tag_stack.try_pop("rt",["ruby","rtc"]),Q=Q||this._tag_stack.try_pop("rp",["ruby","rtc"])):ie.tag_name==="optgroup"?Q=Q||this._tag_stack.try_pop("optgroup",["select"]):ie.tag_name==="option"?Q=Q||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):ie.tag_name==="colgroup"?Q=Q||this._tag_stack.try_pop("caption",["table"]):ie.tag_name==="thead"?(Q=Q||this._tag_stack.try_pop("caption",["table"]),Q=Q||this._tag_stack.try_pop("colgroup",["table"])):ie.tag_name==="tbody"||ie.tag_name==="tfoot"?(Q=Q||this._tag_stack.try_pop("caption",["table"]),Q=Q||this._tag_stack.try_pop("colgroup",["table"]),Q=Q||this._tag_stack.try_pop("thead",["table"]),Q=Q||this._tag_stack.try_pop("tbody",["table"])):ie.tag_name==="tr"?(Q=Q||this._tag_stack.try_pop("caption",["table"]),Q=Q||this._tag_stack.try_pop("colgroup",["table"]),Q=Q||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(ie.tag_name==="th"||ie.tag_name==="td")&&(Q=Q||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),Q=Q||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return ie.parent=this._tag_stack.get_parser_token(),Q}},V.exports.Beautifier=Je},function(V,A,b){var M=b(6).Options;function I(re){M.call(this,re,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}I.prototype=new M,V.exports.Options=I},function(V,A,b){var M=b(9).Tokenizer,I=b(9).TOKEN,re=b(13).Directives,se=b(14).TemplatablePattern,q=b(12).Pattern,W={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:I.START,RAW:I.RAW,EOF:I.EOF},Z=new re(/<\!--/,/-->/),le=function(P,ae){M.call(this,P,ae),this._current_tag_name="";var Te=new se(this._input).read_options(this._options),ye=new q(this._input);if(this.__patterns={word:Te.until(/[\n\r\t <]/),word_control_flow_close_excluded:Te.until(/[\n\r\t <}]/),single_quote:Te.until_after(/'/),double_quote:Te.until_after(/"/),attribute:Te.until(/[\n\r\t =>]|\/>/),element_name:Te.until(/[\n\r\t >\/]/),angular_control_flow_start:ye.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:ye.starting_with(/{{!--/).until_after(/--}}/),handlebars:ye.starting_with(/{{/).until_after(/}}/),handlebars_open:ye.until(/[\n\r\t }]/),handlebars_raw_close:ye.until(/}}/),comment:ye.starting_with(/<!--/).until_after(/-->/),cdata:ye.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:ye.starting_with(/<!\[/).until_after(/]>/),processing:ye.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var Je=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ye.matching(Je).until_after(Je)}};le.prototype=new M,le.prototype._is_comment=function(P){return!1},le.prototype._is_opening=function(P){return P.type===W.TAG_OPEN||P.type===W.CONTROL_FLOW_OPEN},le.prototype._is_closing=function(P,ae){return P.type===W.TAG_CLOSE&&ae&&((P.text===">"||P.text==="/>")&&ae.text[0]==="<"||P.text==="}}"&&ae.text[0]==="{"&&ae.text[1]==="{")||P.type===W.CONTROL_FLOW_CLOSE&&P.text==="}"&&ae.text.endsWith("{")},le.prototype._reset=function(){this._current_tag_name=""},le.prototype._get_next_token=function(P,ae){var Te=null;this._readWhitespace();var ye=this._input.peek();return ye===null?this._create_token(W.EOF,""):(Te=Te||this._read_open_handlebars(ye,ae),Te=Te||this._read_attribute(ye,P,ae),Te=Te||this._read_close(ye,ae),Te=Te||this._read_script_and_style(ye,P),Te=Te||this._read_control_flows(ye,ae),Te=Te||this._read_raw_content(ye,P,ae),Te=Te||this._read_content_word(ye,ae),Te=Te||this._read_comment_or_cdata(ye),Te=Te||this._read_processing(ye),Te=Te||this._read_open(ye,ae),Te=Te||this._create_token(W.UNKNOWN,this._input.next()),Te)},le.prototype._read_comment_or_cdata=function(P){var ae=null,Te=null,ye=null;if(P==="<"){var Je=this._input.peek(1);Je==="!"&&(Te=this.__patterns.comment.read(),Te?(ye=Z.get_directives(Te),ye&&ye.ignore==="start"&&(Te+=Z.readIgnored(this._input))):Te=this.__patterns.cdata.read()),Te&&(ae=this._create_token(W.COMMENT,Te),ae.directives=ye)}return ae},le.prototype._read_processing=function(P){var ae=null,Te=null,ye=null;if(P==="<"){var Je=this._input.peek(1);(Je==="!"||Je==="?")&&(Te=this.__patterns.conditional_comment.read(),Te=Te||this.__patterns.processing.read()),Te&&(ae=this._create_token(W.COMMENT,Te),ae.directives=ye)}return ae},le.prototype._read_open=function(P,ae){var Te=null,ye=null;return(!ae||ae.type===W.CONTROL_FLOW_OPEN)&&P==="<"&&(Te=this._input.next(),this._input.peek()==="/"&&(Te+=this._input.next()),Te+=this.__patterns.element_name.read(),ye=this._create_token(W.TAG_OPEN,Te)),ye},le.prototype._read_open_handlebars=function(P,ae){var Te=null,ye=null;return(!ae||ae.type===W.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&P==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(Te=this.__patterns.handlebars_comment.read(),Te=Te||this.__patterns.handlebars.read(),ye=this._create_token(W.COMMENT,Te)):(Te=this.__patterns.handlebars_open.read(),ye=this._create_token(W.TAG_OPEN,Te))),ye},le.prototype._read_control_flows=function(P,ae){var Te="",ye=null;if(!this._options.templating.includes("angular"))return ye;if(P==="@"){if(Te=this.__patterns.angular_control_flow_start.read(),Te==="")return ye;for(var Je=Te.endsWith("(")?1:0,Ve=0;!(Te.endsWith("{")&&Je===Ve);){var st=this._input.next();if(st===null)break;st==="("?Je++:st===")"&&Ve++,Te+=st}ye=this._create_token(W.CONTROL_FLOW_OPEN,Te)}else P==="}"&&ae&&ae.type===W.CONTROL_FLOW_OPEN&&(Te=this._input.next(),ye=this._create_token(W.CONTROL_FLOW_CLOSE,Te));return ye},le.prototype._read_close=function(P,ae){var Te=null,ye=null;return ae&&ae.type===W.TAG_OPEN&&(ae.text[0]==="<"&&(P===">"||P==="/"&&this._input.peek(1)===">")?(Te=this._input.next(),P==="/"&&(Te+=this._input.next()),ye=this._create_token(W.TAG_CLOSE,Te)):ae.text[0]==="{"&&P==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ye=this._create_token(W.TAG_CLOSE,"}}"))),ye},le.prototype._read_attribute=function(P,ae,Te){var ye=null,Je="";if(Te&&Te.text[0]==="<")if(P==="=")ye=this._create_token(W.EQUALS,this._input.next());else if(P==='"'||P==="'"){var Ve=this._input.next();P==='"'?Ve+=this.__patterns.double_quote.read():Ve+=this.__patterns.single_quote.read(),ye=this._create_token(W.VALUE,Ve)}else Je=this.__patterns.attribute.read(),Je&&(ae.type===W.EQUALS?ye=this._create_token(W.VALUE,Je):ye=this._create_token(W.ATTRIBUTE,Je));return ye},le.prototype._is_content_unformatted=function(P){return this._options.void_elements.indexOf(P)===-1&&(this._options.content_unformatted.indexOf(P)!==-1||this._options.unformatted.indexOf(P)!==-1)},le.prototype._read_raw_content=function(P,ae,Te){var ye="";if(Te&&Te.text[0]==="{")ye=this.__patterns.handlebars_raw_close.read();else if(ae.type===W.TAG_CLOSE&&ae.opened.text[0]==="<"&&ae.text[0]!=="/"){var Je=ae.opened.text.substr(1).toLowerCase();this._is_content_unformatted(Je)&&(ye=this._input.readUntil(new RegExp("</"+Je+"[\\n\\r\\t ]*?>","ig")))}return ye?this._create_token(W.TEXT,ye):null},le.prototype._read_script_and_style=function(P,ae){if(ae.type===W.TAG_CLOSE&&ae.opened.text[0]==="<"&&ae.text[0]!=="/"){var Te=ae.opened.text.substr(1).toLowerCase();if(Te==="script"||Te==="style"){var ye=this._read_comment_or_cdata(P);if(ye)return ye.type=W.TEXT,ye;var Je=this._input.readUntil(new RegExp("</"+Te+"[\\n\\r\\t ]*?>","ig"));if(Je)return this._create_token(W.TEXT,Je)}}return null},le.prototype._read_content_word=function(P,ae){var Te="";return this._options.unformatted_content_delimiter&&P===this._options.unformatted_content_delimiter[0]&&(Te=this.__patterns.unformatted_content_delimiter.read()),Te||(Te=ae&&ae.type===W.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),Te?this._create_token(W.TEXT,Te):null},V.exports.Tokenizer=le,V.exports.TOKEN=W}],$={};function c(V){var A=$[V];if(A!==void 0)return A.exports;var b=$[V]={exports:{}};return Pe[V](b,b.exports,c),b.exports}var te=c(18);Xe=te})();var Ge=Xe;if(1)Ce=[Y,Y(58553),Y(87804)],Le=function(Pe){var $=Y(58553),c=Y(87804);return{html_beautify:function(te,V){return Ge(te,V,$.js_beautify,c.css_beautify)}}}.apply(Mt,Ce),Le!==void 0&&(Ir.exports=Le);else var Oe,me})()},58553:function(Ir,Mt){var Y,Ce;(function(){var Le;(function(){"use strict";var Ge=[function($,c,te){var V=te(1).Beautifier,A=te(5).Options;function b(M,I){var re=new V(M,I);return re.beautify()}$.exports=b,$.exports.defaultOptions=function(){return new A}},function($,c,te){var V=te(2).Output,A=te(3).Token,b=te(4),M=te(5).Options,I=te(7).Tokenizer,re=te(7).line_starters,se=te(7).positionable_operators,q=te(7).TOKEN;function W(B,ee){return ee.indexOf(B)!==-1}function Z(B){return B.replace(/^\s+/g,"")}function le(B){for(var ee={},we=0;we<B.length;we++)ee[B[we].replace(/-/g,"_")]=B[we];return ee}function P(B,ee){return B&&B.type===q.RESERVED&&B.text===ee}function ae(B,ee){return B&&B.type===q.RESERVED&&W(B.text,ee)}var Te=["case","return","do","if","throw","else","await","break","continue","async"],ye=["before-newline","after-newline","preserve-newline"],Je=le(ye),Ve=[Je.before_newline,Je.preserve_newline],st={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function ft(B,ee){ee.multiline_frame||ee.mode===st.ForInitializer||ee.mode===st.Conditional||B.remove_indent(ee.start_line_index)}function ie(B){B=B.replace(b.allLineBreaks,`
`);for(var ee=[],we=B.indexOf(`
`);we!==-1;)ee.push(B.substring(0,we)),B=B.substring(we+1),we=B.indexOf(`
`);return B.length&&ee.push(B),ee}function Q(B){return B===st.ArrayLiteral}function ue(B){return W(B,[st.Expression,st.ForInitializer,st.Conditional])}function ce(B,ee){for(var we=0;we<B.length;we++){var rt=B[we].trim();if(rt.charAt(0)!==ee)return!1}return!0}function De(B,ee){for(var we=0,rt=B.length,tt;we<rt;we++)if(tt=B[we],tt&&tt.indexOf(ee)!==0)return!1;return!0}function xe(B,ee){ee=ee||{},this._source_text=B||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new M(ee)}xe.prototype.create_flags=function(B,ee){var we=0;B&&(we=B.indentation_level,!this._output.just_added_newline()&&B.line_indent_level>we&&(we=B.line_indent_level));var rt={mode:ee,parent:B,last_token:B?B.last_token:new A(q.START_BLOCK,""),last_word:B?B.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:we,alignment:0,line_indent_level:B?B.line_indent_level:we,start_line_index:this._output.get_line_number(),ternary_depth:0};return rt},xe.prototype._reset=function(B){var ee=B.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new V(this._options,ee),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(st.BlockStatement);var we=new I(B,this._options);return this._tokens=we.tokenize(),B},xe.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var B,ee=this._reset(this._source_text),we=this._options.eol;this._options.eol==="auto"&&(we=`
`,ee&&b.lineBreak.test(ee||"")&&(we=ee.match(b.lineBreak)[0]));for(var rt=this._tokens.next();rt;)this.handle_token(rt),this._last_last_text=this._flags.last_token.text,this._flags.last_token=rt,rt=this._tokens.next();return B=this._output.get_code(we),B},xe.prototype.handle_token=function(B,ee){B.type===q.START_EXPR?this.handle_start_expr(B):B.type===q.END_EXPR?this.handle_end_expr(B):B.type===q.START_BLOCK?this.handle_start_block(B):B.type===q.END_BLOCK?this.handle_end_block(B):B.type===q.WORD?this.handle_word(B):B.type===q.RESERVED?this.handle_word(B):B.type===q.SEMICOLON?this.handle_semicolon(B):B.type===q.STRING?this.handle_string(B):B.type===q.EQUALS?this.handle_equals(B):B.type===q.OPERATOR?this.handle_operator(B):B.type===q.COMMA?this.handle_comma(B):B.type===q.BLOCK_COMMENT?this.handle_block_comment(B,ee):B.type===q.COMMENT?this.handle_comment(B,ee):B.type===q.DOT?this.handle_dot(B):B.type===q.EOF?this.handle_eof(B):B.type===q.UNKNOWN?this.handle_unknown(B,ee):this.handle_unknown(B,ee)},xe.prototype.handle_whitespace_and_comments=function(B,ee){var we=B.newlines,rt=this._options.keep_array_indentation&&Q(this._flags.mode);if(B.comments_before)for(var tt=B.comments_before.next();tt;)this.handle_whitespace_and_comments(tt,ee),this.handle_token(tt,ee),tt=B.comments_before.next();if(rt)for(var ot=0;ot<we;ot+=1)this.print_newline(ot>0,ee);else if(this._options.max_preserve_newlines&&we>this._options.max_preserve_newlines&&(we=this._options.max_preserve_newlines),this._options.preserve_newlines&&we>1){this.print_newline(!1,ee);for(var je=1;je<we;je+=1)this.print_newline(!0,ee)}};var C=["async","break","continue","return","throw","yield"];xe.prototype.allow_wrap_or_preserved_newline=function(B,ee){if(ee=ee===void 0?!1:ee,!this._output.just_added_newline()){var we=this._options.preserve_newlines&&B.newlines||ee,rt=W(this._flags.last_token.text,se)||W(B.text,se);if(rt){var tt=W(this._flags.last_token.text,se)&&W(this._options.operator_position,Ve)||W(B.text,se);we=we&&tt}if(we)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(ae(this._flags.last_token,C))return;this._output.set_wrap_point()}}},xe.prototype.print_newline=function(B,ee){if(!ee&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==q.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var we=this._tokens.peek();this._flags.mode===st.Statement&&!(this._flags.if_block&&P(we,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(B)&&(this._flags.multiline_frame=!0)},xe.prototype.print_token_line_indentation=function(B){this._output.just_added_newline()&&(this._options.keep_array_indentation&&B.newlines&&(B.text==="["||Q(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(B.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},xe.prototype.print_token=function(B){if(this._output.raw){this._output.add_raw_token(B);return}if(this._options.comma_first&&B.previous&&B.previous.type===q.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var ee=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(ee),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(B),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(B),this._output.non_breaking_space=!0,this._output.add_token(B.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},xe.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},xe.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},xe.prototype.set_mode=function(B){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,B),this._flags=this.create_flags(this._previous_flags,B),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},xe.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===st.Statement&&ft(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},xe.prototype.start_of_object_property=function(){return this._flags.parent.mode===st.ObjectLiteral&&this._flags.mode===st.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ae(this._flags.last_token,["get","set"]))},xe.prototype.start_of_statement=function(B){var ee=!1;return ee=ee||ae(this._flags.last_token,["var","let","const"])&&B.type===q.WORD,ee=ee||P(this._flags.last_token,"do"),ee=ee||!(this._flags.parent.mode===st.ObjectLiteral&&this._flags.mode===st.Statement)&&ae(this._flags.last_token,C)&&!B.newlines,ee=ee||P(this._flags.last_token,"else")&&!(P(B,"if")&&!B.comments_before),ee=ee||this._flags.last_token.type===q.END_EXPR&&(this._previous_flags.mode===st.ForInitializer||this._previous_flags.mode===st.Conditional),ee=ee||this._flags.last_token.type===q.WORD&&this._flags.mode===st.BlockStatement&&!this._flags.in_case&&!(B.text==="--"||B.text==="++")&&this._last_last_text!=="function"&&B.type!==q.WORD&&B.type!==q.RESERVED,ee=ee||this._flags.mode===st.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ae(this._flags.last_token,["get","set"])),ee?(this.set_mode(st.Statement),this.indent(),this.handle_whitespace_and_comments(B,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(B,ae(B,["do","for","if","while"])),!0):!1},xe.prototype.handle_start_expr=function(B){this.start_of_statement(B)||this.handle_whitespace_and_comments(B);var ee=st.Expression;if(B.text==="["){if(this._flags.last_token.type===q.WORD||this._flags.last_token.text===")"){ae(this._flags.last_token,re)&&(this._output.space_before_token=!0),this.print_token(B),this.set_mode(ee),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}ee=st.ArrayLiteral,Q(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),W(this._flags.last_token.type,[q.START_EXPR,q.END_EXPR,q.WORD,q.OPERATOR,q.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===q.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,ee=st.ForInitializer):W(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,ee=st.Conditional):W(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&B.whitespace_before===""?this._output.space_before_token=!1:(W(this._flags.last_token.text,re)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===q.EQUALS||this._flags.last_token.type===q.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(B);else if(this._flags.last_token.type===q.WORD){this._output.space_before_token=!1;var we=this._tokens.peek(-3);if(this._options.space_after_named_function&&we){var rt=this._tokens.peek(-4);ae(we,["async","function"])||we.text==="*"&&ae(rt,["async","function"])?this._output.space_before_token=!0:this._flags.mode===st.ObjectLiteral?(we.text==="{"||we.text===","||we.text==="*"&&(rt.text==="{"||rt.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(B);(this._flags.last_token.type===q.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(W(this._last_last_text,["function","yield"])||this._flags.mode===st.ObjectLiteral&&W(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===q.START_BLOCK?this.print_newline():(this._flags.last_token.type===q.END_EXPR||this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===q.COMMA)&&this.allow_wrap_or_preserved_newline(B,B.newlines),this.print_token(B),this.set_mode(ee),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},xe.prototype.handle_end_expr=function(B){for(;this._flags.mode===st.Statement;)this.restore_mode();this.handle_whitespace_and_comments(B),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(B,B.text==="]"&&Q(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===q.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(B),this.restore_mode(),ft(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===st.Conditional&&(this._previous_flags.mode=st.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},xe.prototype.handle_start_block=function(B){this.handle_whitespace_and_comments(B);var ee=this._tokens.peek(),we=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===q.END_EXPR?(this.set_mode(st.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(st.BlockStatement):we&&(W(we.text,[":",","])&&W(ee.type,[q.STRING,q.WORD,q.RESERVED])||W(ee.text,["get","set","..."])&&W(we.type,[q.WORD,q.RESERVED]))?W(this._last_last_text,["class","interface"])&&!W(we.text,[":",","])?this.set_mode(st.BlockStatement):this.set_mode(st.ObjectLiteral):this._flags.last_token.type===q.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(st.BlockStatement):W(this._flags.last_token.type,[q.EQUALS,q.START_EXPR,q.COMMA,q.OPERATOR])||ae(this._flags.last_token,["return","throw","import","default"])?this.set_mode(st.ObjectLiteral):this.set_mode(st.BlockStatement),this._flags.last_token&&ae(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var rt=!ee.comments_before&&ee.text==="}",tt=rt&&this._flags.last_word==="function"&&this._flags.last_token.type===q.END_EXPR;if(this._options.brace_preserve_inline){var ot=0,je=null;this._flags.inline_frame=!0;do if(ot+=1,je=this._tokens.peek(ot-1),je.newlines){this._flags.inline_frame=!1;break}while(je.type!==q.EOF&&!(je.type===q.END_BLOCK&&je.opened===B))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&B.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==q.OPERATOR&&(tt||this._flags.last_token.type===q.EQUALS||ae(this._flags.last_token,Te)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(Q(this._previous_flags.mode)&&(this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.COMMA)&&((this._flags.last_token.type===q.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(B),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==q.OPERATOR&&this._flags.last_token.type!==q.START_EXPR&&(W(this._flags.last_token.type,[q.START_BLOCK,q.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(B),this.indent(),!rt&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},xe.prototype.handle_end_block=function(B){for(this.handle_whitespace_and_comments(B);this._flags.mode===st.Statement;)this.restore_mode();var ee=this._flags.last_token.type===q.START_BLOCK;this._flags.inline_frame&&!ee?this._output.space_before_token=!0:this._options.brace_style==="expand"?ee||this.print_newline():ee||(Q(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(B)},xe.prototype.handle_word=function(B){if(B.type===q.RESERVED){if(W(B.text,["set","get"])&&this._flags.mode!==st.ObjectLiteral)B.type=q.WORD;else if(B.text==="import"&&W(this._tokens.peek().text,["(","."]))B.type=q.WORD;else if(W(B.text,["as","from"])&&!this._flags.import_block)B.type=q.WORD;else if(this._flags.mode===st.ObjectLiteral){var ee=this._tokens.peek();ee.text===":"&&(B.type=q.WORD)}}if(this.start_of_statement(B)?ae(this._flags.last_token,["var","let","const"])&&B.type===q.WORD&&(this._flags.declaration_statement=!0):B.newlines&&!ue(this._flags.mode)&&(this._flags.last_token.type!==q.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==q.EQUALS&&(this._options.preserve_newlines||!ae(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(B),this.print_newline()):this.handle_whitespace_and_comments(B),this._flags.do_block&&!this._flags.do_while)if(P(B,"while")){this._output.space_before_token=!0,this.print_token(B),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&P(B,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===st.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&ae(B,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(B),this._flags.in_case=!0;return}if((this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.EQUALS||this._flags.last_token.type===q.OPERATOR)&&!this.start_of_object_property()&&!(W(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===st.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(B),P(B,"function")){(W(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(W(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===q.OPERATOR))&&!this._output.just_added_blankline()&&!B.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===q.RESERVED||this._flags.last_token.type===q.WORD?ae(this._flags.last_token,["get","set","new","export"])||ae(this._flags.last_token,C)?this._output.space_before_token=!0:P(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===q.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(ue(this._flags.mode)||Q(this._flags.mode))||this.print_newline(),this.print_token(B),this._flags.last_word=B.text;return}var we="NONE";if(this._flags.last_token.type===q.END_BLOCK?this._previous_flags.inline_frame?we="SPACE":ae(B,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&B.newlines?we="NEWLINE":(we="SPACE",this._output.space_before_token=!0):we="NEWLINE":this._flags.last_token.type===q.SEMICOLON&&this._flags.mode===st.BlockStatement?we="NEWLINE":this._flags.last_token.type===q.SEMICOLON&&ue(this._flags.mode)?we="SPACE":this._flags.last_token.type===q.STRING?we="NEWLINE":this._flags.last_token.type===q.RESERVED||this._flags.last_token.type===q.WORD||this._flags.last_token.text==="*"&&(W(this._last_last_text,["function","yield"])||this._flags.mode===st.ObjectLiteral&&W(this._last_last_text,["{",","]))?we="SPACE":this._flags.last_token.type===q.START_BLOCK?this._flags.inline_frame?we="SPACE":we="NEWLINE":this._flags.last_token.type===q.END_EXPR&&(this._output.space_before_token=!0,we="NEWLINE"),ae(B,re)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?we="SPACE":we="NEWLINE"),ae(B,["else","catch","finally"]))if((!(this._flags.last_token.type===q.END_BLOCK&&this._previous_flags.mode===st.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&B.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var rt=this._output.current_line;rt.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else we==="NEWLINE"?ae(this._flags.last_token,Te)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&ae(B,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==q.END_EXPR?(this._flags.last_token.type!==q.START_EXPR||!ae(B,["var","let","const"]))&&this._flags.last_token.text!==":"&&(P(B,"if")&&P(B.previous,"else")?this._output.space_before_token=!0:this.print_newline()):ae(B,re)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&Q(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():we==="SPACE"&&(this._output.space_before_token=!0);B.previous&&(B.previous.type===q.WORD||B.previous.type===q.RESERVED)&&(this._output.space_before_token=!0),this.print_token(B),this._flags.last_word=B.text,B.type===q.RESERVED&&(B.text==="do"?this._flags.do_block=!0:B.text==="if"?this._flags.if_block=!0:B.text==="import"?this._flags.import_block=!0:this._flags.import_block&&P(B,"from")&&(this._flags.import_block=!1))},xe.prototype.handle_semicolon=function(B){this.start_of_statement(B)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(B);for(var ee=this._tokens.peek();this._flags.mode===st.Statement&&!(this._flags.if_block&&P(ee,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(B)},xe.prototype.handle_string=function(B){B.text.startsWith("`")&&B.newlines===0&&B.whitespace_before===""&&(B.previous.text===")"||this._flags.last_token.type===q.WORD)||(this.start_of_statement(B)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(B),this._flags.last_token.type===q.RESERVED||this._flags.last_token.type===q.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.EQUALS||this._flags.last_token.type===q.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(B):B.text.startsWith("`")&&this._flags.last_token.type===q.END_EXPR&&(B.previous.text==="]"||B.previous.text===")")&&B.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(B)},xe.prototype.handle_equals=function(B){this.start_of_statement(B)||this.handle_whitespace_and_comments(B),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(B),this._output.space_before_token=!0},xe.prototype.handle_comma=function(B){this.handle_whitespace_and_comments(B,!0),this.print_token(B),this._output.space_before_token=!0,this._flags.declaration_statement?(ue(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(B)):this._flags.mode===st.ObjectLiteral||this._flags.mode===st.Statement&&this._flags.parent.mode===st.ObjectLiteral?(this._flags.mode===st.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(B)},xe.prototype.handle_operator=function(B){var ee=B.text==="*"&&(ae(this._flags.last_token,["function","yield"])||W(this._flags.last_token.type,[q.START_BLOCK,q.COMMA,q.END_BLOCK,q.SEMICOLON])),we=W(B.text,["-","+"])&&(W(this._flags.last_token.type,[q.START_BLOCK,q.START_EXPR,q.EQUALS,q.OPERATOR])||W(this._flags.last_token.text,re)||this._flags.last_token.text===",");if(!this.start_of_statement(B)){var rt=!ee;this.handle_whitespace_and_comments(B,rt)}if(B.text==="*"&&this._flags.last_token.type===q.DOT){this.print_token(B);return}if(B.text==="::"){this.print_token(B);return}if(W(B.text,["-","+"])&&this.start_of_object_property()){this.print_token(B);return}if(this._flags.last_token.type===q.OPERATOR&&W(this._options.operator_position,Ve)&&this.allow_wrap_or_preserved_newline(B),B.text===":"&&this._flags.in_case){this.print_token(B),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==q.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var tt=!0,ot=!0,je=!1;if(B.text===":"?this._flags.ternary_depth===0?tt=!1:(this._flags.ternary_depth-=1,je=!0):B.text==="?"&&(this._flags.ternary_depth+=1),!we&&!ee&&this._options.preserve_newlines&&W(B.text,se)){var nr=B.text===":",Kt=nr&&je,Lt=nr&&!je;switch(this._options.operator_position){case Je.before_newline:this._output.space_before_token=!Lt,this.print_token(B),(!nr||Kt)&&this.allow_wrap_or_preserved_newline(B),this._output.space_before_token=!0;return;case Je.after_newline:this._output.space_before_token=!0,!nr||Kt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(B):this._output.space_before_token=!1,this.print_token(B),this._output.space_before_token=!0;return;case Je.preserve_newline:Lt||this.allow_wrap_or_preserved_newline(B),tt=!(this._output.just_added_newline()||Lt),this._output.space_before_token=tt,this.print_token(B),this._output.space_before_token=!0;return}}if(ee){this.allow_wrap_or_preserved_newline(B),tt=!1;var Gr=this._tokens.peek();ot=Gr&&W(Gr.type,[q.WORD,q.RESERVED])}else if(B.text==="...")this.allow_wrap_or_preserved_newline(B),tt=this._flags.last_token.type===q.START_BLOCK,ot=!1;else if(W(B.text,["--","++","!","~"])||we){if((this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR)&&this.allow_wrap_or_preserved_newline(B),tt=!1,ot=!1,B.newlines&&(B.text==="--"||B.text==="++"||B.text==="~")){var Rr=ae(this._flags.last_token,Te)&&B.newlines;Rr&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Rr,!0)}this._flags.last_token.text===";"&&ue(this._flags.mode)&&(tt=!0),this._flags.last_token.type===q.RESERVED?tt=!0:this._flags.last_token.type===q.END_EXPR?tt=!(this._flags.last_token.text==="]"&&(B.text==="--"||B.text==="++")):this._flags.last_token.type===q.OPERATOR&&(tt=W(B.text,["--","-","++","+"])&&W(this._flags.last_token.text,["--","-","++","+"]),W(B.text,["+","-"])&&W(this._flags.last_token.text,["--","++"])&&(ot=!0)),(this._flags.mode===st.BlockStatement&&!this._flags.inline_frame||this._flags.mode===st.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||tt,this.print_token(B),this._output.space_before_token=ot},xe.prototype.handle_block_comment=function(B,ee){if(this._output.raw){this._output.add_raw_token(B),B.directives&&B.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(B.directives){this.print_newline(!1,ee),this.print_token(B),B.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!b.newline.test(B.text)&&!B.newlines){this._output.space_before_token=!0,this.print_token(B),this._output.space_before_token=!0;return}else this.print_block_commment(B,ee)},xe.prototype.print_block_commment=function(B,ee){var we=ie(B.text),rt,tt=!1,ot=!1,je=B.whitespace_before,nr=je.length;if(this.print_newline(!1,ee),this.print_token_line_indentation(B),this._output.add_token(we[0]),this.print_newline(!1,ee),we.length>1){for(we=we.slice(1),tt=ce(we,"*"),ot=De(we,je),tt&&(this._flags.alignment=1),rt=0;rt<we.length;rt++)tt?(this.print_token_line_indentation(B),this._output.add_token(Z(we[rt]))):ot&&we[rt]?(this.print_token_line_indentation(B),this._output.add_token(we[rt].substring(nr))):(this._output.current_line.set_indent(-1),this._output.add_token(we[rt])),this.print_newline(!1,ee);this._flags.alignment=0}},xe.prototype.handle_comment=function(B,ee){B.newlines?this.print_newline(!1,ee):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(B),this.print_newline(!1,ee)},xe.prototype.handle_dot=function(B){this.start_of_statement(B)||this.handle_whitespace_and_comments(B,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),ae(this._flags.last_token,Te)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(B,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(B)},xe.prototype.handle_unknown=function(B,ee){this.print_token(B),B.text[B.text.length-1]===`
`&&this.print_newline(!1,ee)},xe.prototype.handle_eof=function(B){for(;this._flags.mode===st.Statement;)this.restore_mode();this.handle_whitespace_and_comments(B)},$.exports.Beautifier=xe},function($){function c(A){this.__parent=A,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}c.prototype.clone_empty=function(){var A=new c(this.__parent);return A.set_indent(this.__indent_count,this.__alignment_count),A},c.prototype.item=function(A){return A<0?this.__items[this.__items.length+A]:this.__items[A]},c.prototype.has_match=function(A){for(var b=this.__items.length-1;b>=0;b--)if(this.__items[b].match(A))return!0;return!1},c.prototype.set_indent=function(A,b){this.is_empty()&&(this.__indent_count=A||0,this.__alignment_count=b||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},c.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var A=this.__parent.current_line;return A.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),A.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),A.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,A.__items[0]===" "&&(A.__items.splice(0,1),A.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(A){this.__items.push(A);var b=A.lastIndexOf(`
`);b!==-1?this.__character_count=A.length-b:this.__character_count+=A.length},c.prototype.pop=function(){var A=null;return this.is_empty()||(A=this.__items.pop(),this.__character_count-=A.length),A},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var A="";return this.is_empty()?this.__parent.indent_empty_lines&&(A=this.__parent.get_indent_string(this.__indent_count)):(A=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),A+=this.__items.join("")),A};function te(A,b){this.__cache=[""],this.__indent_size=A.indent_size,this.__indent_string=A.indent_char,A.indent_with_tabs||(this.__indent_string=new Array(A.indent_size+1).join(A.indent_char)),b=b||"",A.indent_level>0&&(b=new Array(A.indent_level+1).join(this.__indent_string)),this.__base_string=b,this.__base_string_length=b.length}te.prototype.get_indent_size=function(A,b){var M=this.__base_string_length;return b=b||0,A<0&&(M=0),M+=A*this.__indent_size,M+=b,M},te.prototype.get_indent_string=function(A,b){var M=this.__base_string;return b=b||0,A<0&&(A=0,M=""),b+=A*this.__indent_size,this.__ensure_cache(b),M+=this.__cache[b],M},te.prototype.__ensure_cache=function(A){for(;A>=this.__cache.length;)this.__add_column()},te.prototype.__add_column=function(){var A=this.__cache.length,b=0,M="";this.__indent_size&&A>=this.__indent_size&&(b=Math.floor(A/this.__indent_size),A-=b*this.__indent_size,M=new Array(b+1).join(this.__indent_string)),A&&(M+=new Array(A+1).join(" ")),this.__cache.push(M)};function V(A,b){this.__indent_cache=new te(A,b),this.raw=!1,this._end_with_newline=A.end_with_newline,this.indent_size=A.indent_size,this.wrap_line_length=A.wrap_line_length,this.indent_empty_lines=A.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}V.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},V.prototype.get_line_number=function(){return this.__lines.length},V.prototype.get_indent_string=function(A,b){return this.__indent_cache.get_indent_string(A,b)},V.prototype.get_indent_size=function(A,b){return this.__indent_cache.get_indent_size(A,b)},V.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},V.prototype.add_new_line=function(A){return this.is_empty()||!A&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},V.prototype.get_code=function(A){this.trim(!0);var b=this.current_line.pop();b&&(b[b.length-1]===`
`&&(b=b.replace(/\n+$/g,"")),this.current_line.push(b)),this._end_with_newline&&this.__add_outputline();var M=this.__lines.join(`
`);return A!==`
`&&(M=M.replace(/[\n]/g,A)),M},V.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},V.prototype.set_indent=function(A,b){return A=A||0,b=b||0,this.next_line.set_indent(A,b),this.__lines.length>1?(this.current_line.set_indent(A,b),!0):(this.current_line.set_indent(),!1)},V.prototype.add_raw_token=function(A){for(var b=0;b<A.newlines;b++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(A.whitespace_before),this.current_line.push(A.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},V.prototype.add_token=function(A){this.__add_space_before_token(),this.current_line.push(A),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},V.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},V.prototype.remove_indent=function(A){for(var b=this.__lines.length;A<b;)this.__lines[A]._remove_indent(),A++;this.current_line._remove_wrap_indent()},V.prototype.trim=function(A){for(A=A===void 0?!1:A,this.current_line.trim();A&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},V.prototype.just_added_newline=function(){return this.current_line.is_empty()},V.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},V.prototype.ensure_empty_line_above=function(A,b){for(var M=this.__lines.length-2;M>=0;){var I=this.__lines[M];if(I.is_empty())break;if(I.item(0).indexOf(A)!==0&&I.item(-1)!==b){this.__lines.splice(M+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}M--}},$.exports.Output=V},function($){function c(te,V,A,b){this.type=te,this.text=V,this.comments_before=null,this.newlines=A||0,this.whitespace_before=b||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}$.exports.Token=c},function($,c){var te="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",V="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",A="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",b="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",M="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",I="(?:"+M+"|["+te+A+"])",re="(?:"+M+"|["+V+A+b+"])*";c.identifier=new RegExp(I+re,"g"),c.identifierStart=new RegExp(I),c.identifierMatch=new RegExp("(?:"+M+"|["+V+A+b+"])+");var se=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;c.newline=/[\n\r\u2028\u2029]/,c.lineBreak=new RegExp(`\r
|`+c.newline.source),c.allLineBreaks=new RegExp(c.lineBreak.source,"g")},function($,c,te){var V=te(6).Options,A=["before-newline","after-newline","preserve-newline"];function b(M){V.call(this,M,"js");var I=this.raw_options.brace_style||null;I==="expand-strict"?this.raw_options.brace_style="expand":I==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var re=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var se=0;se<re.length;se++)re[se]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=re[se];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",A),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}b.prototype=new V,$.exports.Options=b},function($){function c(A,b){this.raw_options=te(A,b),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}c.prototype._get_array=function(A,b){var M=this.raw_options[A],I=b||[];return typeof M=="object"?M!==null&&typeof M.concat=="function"&&(I=M.concat()):typeof M=="string"&&(I=M.split(/[^a-zA-Z0-9_\/\-]+/)),I},c.prototype._get_boolean=function(A,b){var M=this.raw_options[A],I=M===void 0?!!b:!!M;return I},c.prototype._get_characters=function(A,b){var M=this.raw_options[A],I=b||"";return typeof M=="string"&&(I=M.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),I},c.prototype._get_number=function(A,b){var M=this.raw_options[A];b=parseInt(b,10),isNaN(b)&&(b=0);var I=parseInt(M,10);return isNaN(I)&&(I=b),I},c.prototype._get_selection=function(A,b,M){var I=this._get_selection_list(A,b,M);if(I.length!==1)throw new Error("Invalid Option Value: The option '"+A+`' can only be one of the following values:
`+b+`
You passed in: '`+this.raw_options[A]+"'");return I[0]},c.prototype._get_selection_list=function(A,b,M){if(!b||b.length===0)throw new Error("Selection list cannot be empty.");if(M=M||[b[0]],!this._is_valid_selection(M,b))throw new Error("Invalid Default Value!");var I=this._get_array(A,M);if(!this._is_valid_selection(I,b))throw new Error("Invalid Option Value: The option '"+A+`' can contain only the following values:
`+b+`
You passed in: '`+this.raw_options[A]+"'");return I},c.prototype._is_valid_selection=function(A,b){return A.length&&b.length&&!A.some(function(M){return b.indexOf(M)===-1})};function te(A,b){var M={};A=V(A);var I;for(I in A)I!==b&&(M[I]=A[I]);if(b&&A[b])for(I in A[b])M[I]=A[b][I];return M}function V(A){var b={},M;for(M in A){var I=M.replace(/-/g,"_");b[I]=A[M]}return b}$.exports.Options=c,$.exports.normalizeOpts=V,$.exports.mergeOpts=te},function($,c,te){var V=te(8).InputScanner,A=te(9).Tokenizer,b=te(9).TOKEN,M=te(13).Directives,I=te(4),re=te(12).Pattern,se=te(14).TemplatablePattern;function q(ce,De){return De.indexOf(ce)!==-1}var W={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:b.START,RAW:b.RAW,EOF:b.EOF},Z=new M(/\/\*/,/\*\//),le=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,P=/[0-9]/,ae=/[^\d\.]/,Te=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ye=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ye=ye.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ye="\\?\\.(?!\\d) "+ye,ye=ye.replace(/ /g,"|");var Je=new RegExp(ye),Ve="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),st=Ve.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),ft=new RegExp("^(?:"+st.join("|")+")$"),ie,Q=function(ce,De){A.call(this,ce,De),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var xe=new re(this._input),C=new se(this._input).read_options(this._options);this.__patterns={template:C,identifier:C.starting_with(I.identifier).matching(I.identifierMatch),number:xe.matching(le),punct:xe.matching(Je),comment:xe.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:xe.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:xe.matching(/<!--/),html_comment_end:xe.matching(/-->/),include:xe.starting_with(/#include/).until_after(I.lineBreak),shebang:xe.starting_with(/#!/).until_after(I.lineBreak),xml:xe.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:C.until(/['\\\n\r\u2028\u2029]/),double_quote:C.until(/["\\\n\r\u2028\u2029]/),template_text:C.until(/[`\\$]/),template_expression:C.until(/[`}\\]/)}};Q.prototype=new A,Q.prototype._is_comment=function(ce){return ce.type===W.COMMENT||ce.type===W.BLOCK_COMMENT||ce.type===W.UNKNOWN},Q.prototype._is_opening=function(ce){return ce.type===W.START_BLOCK||ce.type===W.START_EXPR},Q.prototype._is_closing=function(ce,De){return(ce.type===W.END_BLOCK||ce.type===W.END_EXPR)&&De&&(ce.text==="]"&&De.text==="["||ce.text===")"&&De.text==="("||ce.text==="}"&&De.text==="{")},Q.prototype._reset=function(){ie=!1},Q.prototype._get_next_token=function(ce,De){var xe=null;this._readWhitespace();var C=this._input.peek();return C===null?this._create_token(W.EOF,""):(xe=xe||this._read_non_javascript(C),xe=xe||this._read_string(C),xe=xe||this._read_pair(C,this._input.peek(1)),xe=xe||this._read_word(ce),xe=xe||this._read_singles(C),xe=xe||this._read_comment(C),xe=xe||this._read_regexp(C,ce),xe=xe||this._read_xml(C,ce),xe=xe||this._read_punctuation(),xe=xe||this._create_token(W.UNKNOWN,this._input.next()),xe)},Q.prototype._read_word=function(ce){var De;if(De=this.__patterns.identifier.read(),De!=="")return De=De.replace(I.allLineBreaks,`
`),!(ce.type===W.DOT||ce.type===W.RESERVED&&(ce.text==="set"||ce.text==="get"))&&ft.test(De)?(De==="in"||De==="of")&&(ce.type===W.WORD||ce.type===W.STRING)?this._create_token(W.OPERATOR,De):this._create_token(W.RESERVED,De):this._create_token(W.WORD,De);if(De=this.__patterns.number.read(),De!=="")return this._create_token(W.WORD,De)},Q.prototype._read_singles=function(ce){var De=null;return ce==="("||ce==="["?De=this._create_token(W.START_EXPR,ce):ce===")"||ce==="]"?De=this._create_token(W.END_EXPR,ce):ce==="{"?De=this._create_token(W.START_BLOCK,ce):ce==="}"?De=this._create_token(W.END_BLOCK,ce):ce===";"?De=this._create_token(W.SEMICOLON,ce):ce==="."&&ae.test(this._input.peek(1))?De=this._create_token(W.DOT,ce):ce===","&&(De=this._create_token(W.COMMA,ce)),De&&this._input.next(),De},Q.prototype._read_pair=function(ce,De){var xe=null;return ce==="#"&&De==="{"&&(xe=this._create_token(W.START_BLOCK,ce+De)),xe&&(this._input.next(),this._input.next()),xe},Q.prototype._read_punctuation=function(){var ce=this.__patterns.punct.read();if(ce!=="")return ce==="="?this._create_token(W.EQUALS,ce):ce==="?."?this._create_token(W.DOT,ce):this._create_token(W.OPERATOR,ce)},Q.prototype._read_non_javascript=function(ce){var De="";if(ce==="#"){if(this._is_first_token()&&(De=this.__patterns.shebang.read(),De))return this._create_token(W.UNKNOWN,De.trim()+`
`);if(De=this.__patterns.include.read(),De)return this._create_token(W.UNKNOWN,De.trim()+`
`);ce=this._input.next();var xe="#";if(this._input.hasNext()&&this._input.testChar(P)){do ce=this._input.next(),xe+=ce;while(this._input.hasNext()&&ce!=="#"&&ce!=="=");return ce==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(xe+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(xe+="{}",this._input.next(),this._input.next())),this._create_token(W.WORD,xe)}this._input.back()}else if(ce==="<"&&this._is_first_token()){if(De=this.__patterns.html_comment_start.read(),De){for(;this._input.hasNext()&&!this._input.testChar(I.newline);)De+=this._input.next();return ie=!0,this._create_token(W.COMMENT,De)}}else if(ie&&ce==="-"&&(De=this.__patterns.html_comment_end.read(),De))return ie=!1,this._create_token(W.COMMENT,De);return null},Q.prototype._read_comment=function(ce){var De=null;if(ce==="/"){var xe="";if(this._input.peek(1)==="*"){xe=this.__patterns.block_comment.read();var C=Z.get_directives(xe);C&&C.ignore==="start"&&(xe+=Z.readIgnored(this._input)),xe=xe.replace(I.allLineBreaks,`
`),De=this._create_token(W.BLOCK_COMMENT,xe),De.directives=C}else this._input.peek(1)==="/"&&(xe=this.__patterns.comment.read(),De=this._create_token(W.COMMENT,xe))}return De},Q.prototype._read_string=function(ce){if(ce==="`"||ce==="'"||ce==='"'){var De=this._input.next();return this.has_char_escapes=!1,ce==="`"?De+=this._read_string_recursive("`",!0,"${"):De+=this._read_string_recursive(ce),this.has_char_escapes&&this._options.unescape_strings&&(De=ue(De)),this._input.peek()===ce&&(De+=this._input.next()),De=De.replace(I.allLineBreaks,`
`),this._create_token(W.STRING,De)}return null},Q.prototype._allow_regexp_or_xml=function(ce){return ce.type===W.RESERVED&&q(ce.text,["return","case","throw","else","do","typeof","yield"])||ce.type===W.END_EXPR&&ce.text===")"&&ce.opened.previous.type===W.RESERVED&&q(ce.opened.previous.text,["if","while","for"])||q(ce.type,[W.COMMENT,W.START_EXPR,W.START_BLOCK,W.START,W.END_BLOCK,W.OPERATOR,W.EQUALS,W.EOF,W.SEMICOLON,W.COMMA])},Q.prototype._read_regexp=function(ce,De){if(ce==="/"&&this._allow_regexp_or_xml(De)){for(var xe=this._input.next(),C=!1,B=!1;this._input.hasNext()&&(C||B||this._input.peek()!==ce)&&!this._input.testChar(I.newline);)xe+=this._input.peek(),C?C=!1:(C=this._input.peek()==="\\",this._input.peek()==="["?B=!0:this._input.peek()==="]"&&(B=!1)),this._input.next();return this._input.peek()===ce&&(xe+=this._input.next(),xe+=this._input.read(I.identifier)),this._create_token(W.STRING,xe)}return null},Q.prototype._read_xml=function(ce,De){if(this._options.e4x&&ce==="<"&&this._allow_regexp_or_xml(De)){var xe="",C=this.__patterns.xml.read_match();if(C){for(var B=C[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),ee=B.indexOf("{")===0,we=0;C;){var rt=!!C[1],tt=C[2],ot=!!C[C.length-1]||tt.slice(0,8)==="![CDATA[";if(!ot&&(tt===B||ee&&tt.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(rt?--we:++we),xe+=C[0],we<=0)break;C=this.__patterns.xml.read_match()}return C||(xe+=this._input.match(/[\s\S]*/g)[0]),xe=xe.replace(I.allLineBreaks,`
`),this._create_token(W.STRING,xe)}}return null};function ue(ce){for(var De="",xe=0,C=new V(ce),B=null;C.hasNext();)if(B=C.match(/([\s]|[^\\]|\\\\)+/g),B&&(De+=B[0]),C.peek()==="\\"){if(C.next(),C.peek()==="x")B=C.match(/x([0-9A-Fa-f]{2})/g);else if(C.peek()==="u")B=C.match(/u([0-9A-Fa-f]{4})/g),B||(B=C.match(/u\{([0-9A-Fa-f]+)\}/g));else{De+="\\",C.hasNext()&&(De+=C.next());continue}if(!B||(xe=parseInt(B[1],16),xe>126&&xe<=255&&B[0].indexOf("x")===0))return ce;xe>=0&&xe<32||xe>1114111?De+="\\"+B[0]:xe===34||xe===39||xe===92?De+="\\"+String.fromCharCode(xe):De+=String.fromCharCode(xe)}return De}Q.prototype._read_string_recursive=function(ce,De,xe){var C,B;ce==="'"?B=this.__patterns.single_quote:ce==='"'?B=this.__patterns.double_quote:ce==="`"?B=this.__patterns.template_text:ce==="}"&&(B=this.__patterns.template_expression);for(var ee=B.read(),we="";this._input.hasNext();){if(we=this._input.next(),we===ce||!De&&I.newline.test(we)){this._input.back();break}else we==="\\"&&this._input.hasNext()?(C=this._input.peek(),C==="x"||C==="u"?this.has_char_escapes=!0:C==="\r"&&this._input.peek(1)===`
`&&this._input.next(),we+=this._input.next()):xe&&(xe==="${"&&we==="$"&&this._input.peek()==="{"&&(we+=this._input.next()),xe===we&&(ce==="`"?we+=this._read_string_recursive("}",De,"`"):we+=this._read_string_recursive("`",De,"${"),this._input.hasNext()&&(we+=this._input.next())));we+=B.read(),ee+=we}return ee},$.exports.Tokenizer=Q,$.exports.TOKEN=W,$.exports.positionable_operators=Te.slice(),$.exports.line_starters=Ve.slice()},function($){var c=RegExp.prototype.hasOwnProperty("sticky");function te(V){this.__input=V||"",this.__input_length=this.__input.length,this.__position=0}te.prototype.restart=function(){this.__position=0},te.prototype.back=function(){this.__position>0&&(this.__position-=1)},te.prototype.hasNext=function(){return this.__position<this.__input_length},te.prototype.next=function(){var V=null;return this.hasNext()&&(V=this.__input.charAt(this.__position),this.__position+=1),V},te.prototype.peek=function(V){var A=null;return V=V||0,V+=this.__position,V>=0&&V<this.__input_length&&(A=this.__input.charAt(V)),A},te.prototype.__match=function(V,A){V.lastIndex=A;var b=V.exec(this.__input);return b&&!(c&&V.sticky)&&b.index!==A&&(b=null),b},te.prototype.test=function(V,A){return A=A||0,A+=this.__position,A>=0&&A<this.__input_length?!!this.__match(V,A):!1},te.prototype.testChar=function(V,A){var b=this.peek(A);return V.lastIndex=0,b!==null&&V.test(b)},te.prototype.match=function(V){var A=this.__match(V,this.__position);return A?this.__position+=A[0].length:A=null,A},te.prototype.read=function(V,A,b){var M="",I;return V&&(I=this.match(V),I&&(M+=I[0])),A&&(I||!V)&&(M+=this.readUntil(A,b)),M},te.prototype.readUntil=function(V,A){var b="",M=this.__position;V.lastIndex=this.__position;var I=V.exec(this.__input);return I?(M=I.index,A&&(M+=I[0].length)):M=this.__input_length,b=this.__input.substring(this.__position,M),this.__position=M,b},te.prototype.readUntilAfter=function(V){return this.readUntil(V,!0)},te.prototype.get_regexp=function(V,A){var b=null,M="g";return A&&c&&(M="y"),typeof V=="string"&&V!==""?b=new RegExp(V,M):V&&(b=new RegExp(V.source,M)),b},te.prototype.get_literal_regexp=function(V){return RegExp(V.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},te.prototype.peekUntilAfter=function(V){var A=this.__position,b=this.readUntilAfter(V);return this.__position=A,b},te.prototype.lookBack=function(V){var A=this.__position-1;return A>=V.length&&this.__input.substring(A-V.length,A).toLowerCase()===V},$.exports.InputScanner=te},function($,c,te){var V=te(8).InputScanner,A=te(3).Token,b=te(10).TokenStream,M=te(11).WhitespacePattern,I={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},re=function(se,q){this._input=new V(se),this._options=q||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new M(this._input)};re.prototype.tokenize=function(){this._input.restart(),this.__tokens=new b,this._reset();for(var se,q=new A(I.START,""),W=null,Z=[],le=new b;q.type!==I.EOF;){for(se=this._get_next_token(q,W);this._is_comment(se);)le.add(se),se=this._get_next_token(q,W);le.isEmpty()||(se.comments_before=le,le=new b),se.parent=W,this._is_opening(se)?(Z.push(W),W=se):W&&this._is_closing(se,W)&&(se.opened=W,W.closed=se,W=Z.pop(),se.parent=W),se.previous=q,q.next=se,this.__tokens.add(se),q=se}return this.__tokens},re.prototype._is_first_token=function(){return this.__tokens.isEmpty()},re.prototype._reset=function(){},re.prototype._get_next_token=function(se,q){this._readWhitespace();var W=this._input.read(/.+/g);return W?this._create_token(I.RAW,W):this._create_token(I.EOF,"")},re.prototype._is_comment=function(se){return!1},re.prototype._is_opening=function(se){return!1},re.prototype._is_closing=function(se,q){return!1},re.prototype._create_token=function(se,q){var W=new A(se,q,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return W},re.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},$.exports.Tokenizer=re,$.exports.TOKEN=I},function($){function c(te){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=te}c.prototype.restart=function(){this.__position=0},c.prototype.isEmpty=function(){return this.__tokens_length===0},c.prototype.hasNext=function(){return this.__position<this.__tokens_length},c.prototype.next=function(){var te=null;return this.hasNext()&&(te=this.__tokens[this.__position],this.__position+=1),te},c.prototype.peek=function(te){var V=null;return te=te||0,te+=this.__position,te>=0&&te<this.__tokens_length&&(V=this.__tokens[te]),V},c.prototype.add=function(te){this.__parent_token&&(te.parent=this.__parent_token),this.__tokens.push(te),this.__tokens_length+=1},$.exports.TokenStream=c},function($,c,te){var V=te(12).Pattern;function A(b,M){V.call(this,b,M),M?this._line_regexp=this._input.get_regexp(M._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}A.prototype=new V,A.prototype.__set_whitespace_patterns=function(b,M){b+="\\t ",M+="\\n\\r",this._match_pattern=this._input.get_regexp("["+b+M+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+M+"]")},A.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var b=this._input.read(this._match_pattern);if(b===" ")this.whitespace_before_token=" ";else if(b){var M=this.__split(this._newline_regexp,b);this.newline_count=M.length-1,this.whitespace_before_token=M[this.newline_count]}return b},A.prototype.matching=function(b,M){var I=this._create();return I.__set_whitespace_patterns(b,M),I._update(),I},A.prototype._create=function(){return new A(this._input,this)},A.prototype.__split=function(b,M){b.lastIndex=0;for(var I=0,re=[],se=b.exec(M);se;)re.push(M.substring(I,se.index)),I=se.index+se[0].length,se=b.exec(M);return I<M.length?re.push(M.substring(I,M.length)):re.push(""),re},$.exports.WhitespacePattern=A},function($){function c(te,V){this._input=te,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,V&&(this._starting_pattern=this._input.get_regexp(V._starting_pattern,!0),this._match_pattern=this._input.get_regexp(V._match_pattern,!0),this._until_pattern=this._input.get_regexp(V._until_pattern),this._until_after=V._until_after)}c.prototype.read=function(){var te=this._input.read(this._starting_pattern);return(!this._starting_pattern||te)&&(te+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),te},c.prototype.read_match=function(){return this._input.match(this._match_pattern)},c.prototype.until_after=function(te){var V=this._create();return V._until_after=!0,V._until_pattern=this._input.get_regexp(te),V._update(),V},c.prototype.until=function(te){var V=this._create();return V._until_after=!1,V._until_pattern=this._input.get_regexp(te),V._update(),V},c.prototype.starting_with=function(te){var V=this._create();return V._starting_pattern=this._input.get_regexp(te,!0),V._update(),V},c.prototype.matching=function(te){var V=this._create();return V._match_pattern=this._input.get_regexp(te,!0),V._update(),V},c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){},$.exports.Pattern=c},function($){function c(te,V){te=typeof te=="string"?te:te.source,V=typeof V=="string"?V:V.source,this.__directives_block_pattern=new RegExp(te+/ beautify( \w+[:]\w+)+ /.source+V,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(te+/\sbeautify\signore:end\s/.source+V,"g")}c.prototype.get_directives=function(te){if(!te.match(this.__directives_block_pattern))return null;var V={};this.__directive_pattern.lastIndex=0;for(var A=this.__directive_pattern.exec(te);A;)V[A[1]]=A[2],A=this.__directive_pattern.exec(te);return V},c.prototype.readIgnored=function(te){return te.readUntilAfter(this.__directives_end_ignore_pattern)},$.exports.Directives=c},function($,c,te){var V=te(12).Pattern,A={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function b(M,I){V.call(this,M,I),this.__template_pattern=null,this._disabled=Object.assign({},A),this._excluded=Object.assign({},A),I&&(this.__template_pattern=this._input.get_regexp(I.__template_pattern),this._excluded=Object.assign(this._excluded,I._excluded),this._disabled=Object.assign(this._disabled,I._disabled));var re=new V(M);this.__patterns={handlebars_comment:re.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:re.starting_with(/{{{/).until_after(/}}}/),handlebars:re.starting_with(/{{/).until_after(/}}/),php:re.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:re.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:re.starting_with(/{%/).until_after(/%}/),django_value:re.starting_with(/{{/).until_after(/}}/),django_comment:re.starting_with(/{#/).until_after(/#}/),smarty:re.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:re.starting_with(/{\*/).until_after(/\*}/),smarty_literal:re.starting_with(/{literal}/).until_after(/{\/literal}/)}}b.prototype=new V,b.prototype._create=function(){return new b(this._input,this)},b.prototype._update=function(){this.__set_templated_pattern()},b.prototype.disable=function(M){var I=this._create();return I._disabled[M]=!0,I._update(),I},b.prototype.read_options=function(M){var I=this._create();for(var re in A)I._disabled[re]=M.templating.indexOf(re)===-1;return I._update(),I},b.prototype.exclude=function(M){var I=this._create();return I._excluded[M]=!0,I._update(),I},b.prototype.read=function(){var M="";this._match_pattern?M=this._input.read(this._starting_pattern):M=this._input.read(this._starting_pattern,this.__template_pattern);for(var I=this._read_template();I;)this._match_pattern?I+=this._input.read(this._match_pattern):I+=this._input.readUntil(this.__template_pattern),M+=I,I=this._read_template();return this._until_after&&(M+=this._input.readUntilAfter(this._until_pattern)),M},b.prototype.__set_templated_pattern=function(){var M=[];this._disabled.php||M.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||M.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||M.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||M.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(M.push(this.__patterns.django._starting_pattern.source),M.push(this.__patterns.django_value._starting_pattern.source),M.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||M.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&M.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+M.join("|")+")")},b.prototype._read_template=function(){var M="",I=this._input.peek();if(I==="<"){var re=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&re==="?"&&(M=M||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&re==="%"&&(M=M||this.__patterns.erb.read())}else I==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(M=M||this.__patterns.handlebars_comment.read(),M=M||this.__patterns.handlebars_unescaped.read(),M=M||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(M=M||this.__patterns.django_value.read()),this._excluded.django||(M=M||this.__patterns.django_comment.read(),M=M||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(M=M||this.__patterns.smarty_comment.read(),M=M||this.__patterns.smarty_literal.read(),M=M||this.__patterns.smarty.read()));return M},$.exports.TemplatablePattern=b}],Oe={};function me($){var c=Oe[$];if(c!==void 0)return c.exports;var te=Oe[$]={exports:{}};return Ge[$](te,te.exports,me),te.exports}var Pe=me(0);Le=Pe})();var Xe=Le;Y=[],Ce=function(){return{js_beautify:Xe}}.apply(Mt,Y),Ce!==void 0&&(Ir.exports=Ce)})()},15342:function(Ir){(function(Y,Ce){Ir.exports=Ce()})(typeof self!="undefined"?self:this,function(){return function(Mt){var Y={};function Ce(Le){if(Y[Le])return Y[Le].exports;var Xe=Y[Le]={i:Le,l:!1,exports:{}};return Mt[Le].call(Xe.exports,Xe,Xe.exports,Ce),Xe.l=!0,Xe.exports}return Ce.m=Mt,Ce.c=Y,Ce.d=function(Le,Xe,Ge){Ce.o(Le,Xe)||Object.defineProperty(Le,Xe,{enumerable:!0,get:Ge})},Ce.r=function(Le){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Le,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Le,"__esModule",{value:!0})},Ce.t=function(Le,Xe){if(Xe&1&&(Le=Ce(Le)),Xe&8||Xe&4&&typeof Le=="object"&&Le&&Le.__esModule)return Le;var Ge=Object.create(null);if(Ce.r(Ge),Object.defineProperty(Ge,"default",{enumerable:!0,value:Le}),Xe&2&&typeof Le!="string")for(var Oe in Le)Ce.d(Ge,Oe,function(me){return Le[me]}.bind(null,Oe));return Ge},Ce.n=function(Le){var Xe=Le&&Le.__esModule?function(){return Le.default}:function(){return Le};return Ce.d(Xe,"a",Xe),Xe},Ce.o=function(Le,Xe){return Object.prototype.hasOwnProperty.call(Le,Xe)},Ce.p="",Ce(Ce.s=1)}([function(Mt,Y,Ce){},function(Mt,Y,Ce){"use strict";Ce.r(Y);var Le=Ce(0),Xe=function(){function K(p,v,y){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=p,this.start=v,this.end=y}return K.range=function(v,y){return y?!v||!v.loc||!y.loc||v.loc.lexer!==y.loc.lexer?null:new K(v.loc.lexer,v.loc.start,y.loc.end):v&&v.loc},K}(),Ge=function(){function K(v,y){this.text=void 0,this.loc=void 0,this.text=v,this.loc=y}var p=K.prototype;return p.range=function(y,x){return new K(x,Xe.range(this,y))},K}(),Oe=function K(p,v){this.position=void 0;var y="KaTeX parse error: "+p,x,O=v&&v.loc;if(O&&O.start<=O.end){var z=O.lexer.input;x=O.start;var oe=O.end;x===z.length?y+=" at end of input: ":y+=" at position "+(x+1)+": ";var be=z.slice(x,oe).replace(/[^]/g,"$&\u0332"),Re;x>15?Re="\u2026"+z.slice(x-15,x):Re=z.slice(0,x);var it;oe+15<z.length?it=z.slice(oe,oe+15)+"\u2026":it=z.slice(oe),y+=Re+be+it}var dt=new Error(y);return dt.name="ParseError",dt.__proto__=K.prototype,dt.position=x,dt};Oe.prototype.__proto__=Error.prototype;var me=Oe,Pe=function(p,v){return p.indexOf(v)!==-1},$=function(p,v){return p===void 0?v:p},c=/([A-Z])/g,te=function(p){return p.replace(c,"-$1").toLowerCase()},V={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},A=/[&><"']/g;function b(K){return String(K).replace(A,function(p){return V[p]})}var M=function K(p){return p.type==="ordgroup"||p.type==="color"?p.body.length===1?K(p.body[0]):p:p.type==="font"?K(p.body):p},I=function(p){var v=M(p);return v.type==="mathord"||v.type==="textord"||v.type==="atom"},re=function(p){if(!p)throw new Error("Expected non-null, but got "+String(p));return p},se=function(p){var v=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(p);return v!=null?v[1]:"_relative"},q={contains:Pe,deflt:$,escape:b,hyphenate:te,getBaseElem:M,isCharacterBox:I,protocolFromUrl:se},W=function(){function K(v){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,v=v||{},this.displayMode=q.deflt(v.displayMode,!1),this.output=q.deflt(v.output,"htmlAndMathml"),this.leqno=q.deflt(v.leqno,!1),this.fleqn=q.deflt(v.fleqn,!1),this.throwOnError=q.deflt(v.throwOnError,!0),this.errorColor=q.deflt(v.errorColor,"#cc0000"),this.macros=v.macros||{},this.minRuleThickness=Math.max(0,q.deflt(v.minRuleThickness,0)),this.colorIsTextColor=q.deflt(v.colorIsTextColor,!1),this.strict=q.deflt(v.strict,"warn"),this.trust=q.deflt(v.trust,!1),this.maxSize=Math.max(0,q.deflt(v.maxSize,1/0)),this.maxExpand=Math.max(0,q.deflt(v.maxExpand,1e3))}var p=K.prototype;return p.reportNonstrict=function(y,x,O){var z=this.strict;if(typeof z=="function"&&(z=z(y,x,O)),!(!z||z==="ignore")){if(z===!0||z==="error")throw new me("LaTeX-incompatible input and strict mode is set to 'error': "+(x+" ["+y+"]"),O);z==="warn"?typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(x+" ["+y+"]")):typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+z+"': "+x+" ["+y+"]"))}},p.useStrictBehavior=function(y,x,O){var z=this.strict;if(typeof z=="function")try{z=z(y,x,O)}catch(oe){z="error"}return!z||z==="ignore"?!1:z===!0||z==="error"?!0:z==="warn"?(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(x+" ["+y+"]")),!1):(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+z+"': "+x+" ["+y+"]")),!1)},p.isTrusted=function(y){y.url&&!y.protocol&&(y.protocol=q.protocolFromUrl(y.url));var x=typeof this.trust=="function"?this.trust(y):this.trust;return!!x},K}(),Z=function(){function K(v,y,x){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=v,this.size=y,this.cramped=x}var p=K.prototype;return p.sup=function(){return ft[ie[this.id]]},p.sub=function(){return ft[Q[this.id]]},p.fracNum=function(){return ft[ue[this.id]]},p.fracDen=function(){return ft[ce[this.id]]},p.cramp=function(){return ft[De[this.id]]},p.text=function(){return ft[xe[this.id]]},p.isTight=function(){return this.size>=2},K}(),le=0,P=1,ae=2,Te=3,ye=4,Je=5,Ve=6,st=7,ft=[new Z(le,0,!1),new Z(P,0,!0),new Z(ae,1,!1),new Z(Te,1,!0),new Z(ye,2,!1),new Z(Je,2,!0),new Z(Ve,3,!1),new Z(st,3,!0)],ie=[ye,Je,ye,Je,Ve,st,Ve,st],Q=[Je,Je,Je,Je,st,st,st,st],ue=[ae,Te,ye,Je,Ve,st,Ve,st],ce=[Te,Te,Je,Je,st,st,st,st],De=[P,P,Te,Te,Je,Je,st,st],xe=[le,P,ae,Te,ae,Te,ae,Te],C={DISPLAY:ft[le],TEXT:ft[ae],SCRIPT:ft[ye],SCRIPTSCRIPT:ft[Ve]},B=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function ee(K){for(var p=0;p<B.length;p++)for(var v=B[p],y=0;y<v.blocks.length;y++){var x=v.blocks[y];if(K>=x[0]&&K<=x[1])return v.name}return null}var we=[];B.forEach(function(K){return K.blocks.forEach(function(p){return we.push.apply(we,p)})});function rt(K){for(var p=0;p<we.length;p+=2)if(K>=we[p]&&K<=we[p+1])return!0;return!1}var tt=80,ot=function(p,v){return"M95,"+(622+p+v)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+p/2.075+" -"+p+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+p)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+p)+" "+v+"h400000v"+(40+p)+"h-400000z"},je=function(p,v){return"M263,"+(601+p+v)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+p/2.084+" -"+p+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+p)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+p)+" "+v+"h400000v"+(40+p)+"h-400000z"},nr=function(p,v){return"M983 "+(10+p+v)+`
l`+p/3.13+" -"+p+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+p)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+p)+" "+v+"h400000v"+(40+p)+"h-400000z"},Kt=function(p,v){return"M424,"+(2398+p+v)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+p/4.223+" -"+p+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+p)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+p)+" "+v+`
h400000v`+(40+p)+"h-400000z"},Lt=function(p,v){return"M473,"+(2713+p+v)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+p/5.298+" -"+p+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+p)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+p)+" "+v+"h400000v"+(40+p)+"H1017.7z"},Gr=function(p,v,y){var x=y-54-v-p;return"M702 "+(p+v)+"H400000"+(40+p)+`
H742v`+x+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+v+"H400000v"+(40+p)+"H742z"},Rr=function(p,v,y){v=1e3*v;var x="";switch(p){case"sqrtMain":x=ot(v,tt);break;case"sqrtSize1":x=je(v,tt);break;case"sqrtSize2":x=nr(v,tt);break;case"sqrtSize3":x=Kt(v,tt);break;case"sqrtSize4":x=Lt(v,tt);break;case"sqrtTall":x=Gr(v,tt,y)}return x},hn={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Nr=function(){function K(v){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=v,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var p=K.prototype;return p.hasClass=function(y){return q.contains(this.classes,y)},p.toNode=function(){for(var y=document.createDocumentFragment(),x=0;x<this.children.length;x++)y.appendChild(this.children[x].toNode());return y},p.toMarkup=function(){for(var y="",x=0;x<this.children.length;x++)y+=this.children[x].toMarkup();return y},p.toText=function(){var y=function(O){return O.toText()};return this.children.map(y).join("")},K}(),an=function(p){return p.filter(function(v){return v}).join(" ")},zr=function(p,v,y){if(this.classes=p||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=y||{},v){v.style.isTight()&&this.classes.push("mtight");var x=v.getColor();x&&(this.style.color=x)}},We=function(p){var v=document.createElement(p);v.className=an(this.classes);for(var y in this.style)this.style.hasOwnProperty(y)&&(v.style[y]=this.style[y]);for(var x in this.attributes)this.attributes.hasOwnProperty(x)&&v.setAttribute(x,this.attributes[x]);for(var O=0;O<this.children.length;O++)v.appendChild(this.children[O].toNode());return v},mt=function(p){var v="<"+p;this.classes.length&&(v+=' class="'+q.escape(an(this.classes))+'"');var y="";for(var x in this.style)this.style.hasOwnProperty(x)&&(y+=q.hyphenate(x)+":"+this.style[x]+";");y&&(v+=' style="'+q.escape(y)+'"');for(var O in this.attributes)this.attributes.hasOwnProperty(O)&&(v+=" "+O+'="'+q.escape(this.attributes[O])+'"');v+=">";for(var z=0;z<this.children.length;z++)v+=this.children[z].toMarkup();return v+="</"+p+">",v},Ye=function(){function K(v,y,x,O){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,zr.call(this,v,x,O),this.children=y||[]}var p=K.prototype;return p.setAttribute=function(y,x){this.attributes[y]=x},p.hasClass=function(y){return q.contains(this.classes,y)},p.toNode=function(){return We.call(this,"span")},p.toMarkup=function(){return mt.call(this,"span")},K}(),Et=function(){function K(v,y,x,O){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,zr.call(this,y,O),this.children=x||[],this.setAttribute("href",v)}var p=K.prototype;return p.setAttribute=function(y,x){this.attributes[y]=x},p.hasClass=function(y){return q.contains(this.classes,y)},p.toNode=function(){return We.call(this,"a")},p.toMarkup=function(){return mt.call(this,"a")},K}(),Tt=function(){function K(v,y,x){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=y,this.src=v,this.classes=["mord"],this.style=x}var p=K.prototype;return p.hasClass=function(y){return q.contains(this.classes,y)},p.toNode=function(){var y=document.createElement("img");y.src=this.src,y.alt=this.alt,y.className="mord";for(var x in this.style)this.style.hasOwnProperty(x)&&(y.style[x]=this.style[x]);return y},p.toMarkup=function(){var y="<img src='"+this.src+" 'alt='"+this.alt+"' ",x="";for(var O in this.style)this.style.hasOwnProperty(O)&&(x+=q.hyphenate(O)+":"+this.style[O]+";");return x&&(y+=' style="'+q.escape(x)+'"'),y+="'/>",y},K}(),ge={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},Be=function(){function K(v,y,x,O,z,oe,be,Re){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=v,this.height=y||0,this.depth=x||0,this.italic=O||0,this.skew=z||0,this.width=oe||0,this.classes=be||[],this.style=Re||{},this.maxFontSize=0;var it=ee(this.text.charCodeAt(0));it&&this.classes.push(it+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ge[this.text])}var p=K.prototype;return p.hasClass=function(y){return q.contains(this.classes,y)},p.toNode=function(){var y=document.createTextNode(this.text),x=null;this.italic>0&&(x=document.createElement("span"),x.style.marginRight=this.italic+"em"),this.classes.length>0&&(x=x||document.createElement("span"),x.className=an(this.classes));for(var O in this.style)this.style.hasOwnProperty(O)&&(x=x||document.createElement("span"),x.style[O]=this.style[O]);return x?(x.appendChild(y),x):y},p.toMarkup=function(){var y=!1,x="<span";this.classes.length&&(y=!0,x+=' class="',x+=q.escape(an(this.classes)),x+='"');var O="";this.italic>0&&(O+="margin-right:"+this.italic+"em;");for(var z in this.style)this.style.hasOwnProperty(z)&&(O+=q.hyphenate(z)+":"+this.style[z]+";");O&&(y=!0,x+=' style="'+q.escape(O)+'"');var oe=q.escape(this.text);return y?(x+=">",x+=oe,x+="</span>",x):oe},K}(),et=function(){function K(v,y){this.children=void 0,this.attributes=void 0,this.children=v||[],this.attributes=y||{}}var p=K.prototype;return p.toNode=function(){var y="http://www.w3.org/2000/svg",x=document.createElementNS(y,"svg");for(var O in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,O)&&x.setAttribute(O,this.attributes[O]);for(var z=0;z<this.children.length;z++)x.appendChild(this.children[z].toNode());return x},p.toMarkup=function(){var y="<svg";for(var x in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,x)&&(y+=" "+x+"='"+this.attributes[x]+"'");y+=">";for(var O=0;O<this.children.length;O++)y+=this.children[O].toMarkup();return y+="</svg>",y},K}(),gt=function(){function K(v,y){this.pathName=void 0,this.alternate=void 0,this.pathName=v,this.alternate=y}var p=K.prototype;return p.toNode=function(){var y="http://www.w3.org/2000/svg",x=document.createElementNS(y,"path");return this.alternate?x.setAttribute("d",this.alternate):x.setAttribute("d",hn[this.pathName]),x},p.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+hn[this.pathName]+"'/>"},K}(),vt=function(){function K(v){this.attributes=void 0,this.attributes=v||{}}var p=K.prototype;return p.toNode=function(){var y="http://www.w3.org/2000/svg",x=document.createElementNS(y,"line");for(var O in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,O)&&x.setAttribute(O,this.attributes[O]);return x},p.toMarkup=function(){var y="<line";for(var x in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,x)&&(y+=" "+x+"='"+this.attributes[x]+"'");return y+="/>",y},K}();function Ut(K){if(K instanceof Be)return K;throw new Error("Expected symbolNode but got "+String(K)+".")}function hr(K){if(K instanceof Ye)return K;throw new Error("Expected span<HtmlDomNode> but got "+String(K)+".")}var Yt={"AMS-Regular":{65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473]},"Fraktur-Regular":{33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],163:[0,.69444,0,0,.86853],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],163:[0,.69444,0,0,.76909],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],305:[0,.43056,0,.02778,.32246],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],567:[.19444,.43056,0,.08334,.38403],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,1],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.67,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.744,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.744,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333]},"Math-Italic":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"Math-Regular":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"SansSerif-Bold":{33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212]},"Size1-Regular":{40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ke={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},$t={\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function cr(K,p){Yt[K]=p}function Fe(K,p,v){if(!Yt[p])throw new Error("Font metrics not found for font: "+p+".");var y=K.charCodeAt(0),x=Yt[p][y];if(!x&&K[0]in $t&&(y=$t[K[0]].charCodeAt(0),x=Yt[p][y]),!x&&v==="text"&&rt(y)&&(x=Yt[p][77]),x)return{depth:x[0],height:x[1],italic:x[2],skew:x[3],width:x[4]}}var He={};function qe(K){var p;if(K>=5?p=0:K>=3?p=1:p=2,!He[p]){var v=He[p]={cssEmPerMu:Ke.quad[p]/18};for(var y in Ke)Ke.hasOwnProperty(y)&&(v[y]=Ke[y][p])}return He[p]}var Dt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},St={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Pt={math:{},text:{}},Gt=Pt;function k(K,p,v,y,x,O){Pt[K][x]={font:p,group:v,replace:y},O&&y&&(Pt[K][y]=Pt[K][x])}var D="math",ut="text",U="main",he="ams",Tr="accent-token",Ee="bin",Ue="close",Ze="inner",G="mathord",pe="op-token",_e="open",Ne="punct",H="rel",Vt="spacing",Se="textord";k(D,U,H,"\u2261","\\equiv",!0),k(D,U,H,"\u227A","\\prec",!0),k(D,U,H,"\u227B","\\succ",!0),k(D,U,H,"\u223C","\\sim",!0),k(D,U,H,"\u22A5","\\perp"),k(D,U,H,"\u2AAF","\\preceq",!0),k(D,U,H,"\u2AB0","\\succeq",!0),k(D,U,H,"\u2243","\\simeq",!0),k(D,U,H,"\u2223","\\mid",!0),k(D,U,H,"\u226A","\\ll",!0),k(D,U,H,"\u226B","\\gg",!0),k(D,U,H,"\u224D","\\asymp",!0),k(D,U,H,"\u2225","\\parallel"),k(D,U,H,"\u22C8","\\bowtie",!0),k(D,U,H,"\u2323","\\smile",!0),k(D,U,H,"\u2291","\\sqsubseteq",!0),k(D,U,H,"\u2292","\\sqsupseteq",!0),k(D,U,H,"\u2250","\\doteq",!0),k(D,U,H,"\u2322","\\frown",!0),k(D,U,H,"\u220B","\\ni",!0),k(D,U,H,"\u221D","\\propto",!0),k(D,U,H,"\u22A2","\\vdash",!0),k(D,U,H,"\u22A3","\\dashv",!0),k(D,U,H,"\u220B","\\owns"),k(D,U,Ne,".","\\ldotp"),k(D,U,Ne,"\u22C5","\\cdotp"),k(D,U,Se,"#","\\#"),k(ut,U,Se,"#","\\#"),k(D,U,Se,"&","\\&"),k(ut,U,Se,"&","\\&"),k(D,U,Se,"\u2135","\\aleph",!0),k(D,U,Se,"\u2200","\\forall",!0),k(D,U,Se,"\u210F","\\hbar",!0),k(D,U,Se,"\u2203","\\exists",!0),k(D,U,Se,"\u2207","\\nabla",!0),k(D,U,Se,"\u266D","\\flat",!0),k(D,U,Se,"\u2113","\\ell",!0),k(D,U,Se,"\u266E","\\natural",!0),k(D,U,Se,"\u2663","\\clubsuit",!0),k(D,U,Se,"\u2118","\\wp",!0),k(D,U,Se,"\u266F","\\sharp",!0),k(D,U,Se,"\u2662","\\diamondsuit",!0),k(D,U,Se,"\u211C","\\Re",!0),k(D,U,Se,"\u2661","\\heartsuit",!0),k(D,U,Se,"\u2111","\\Im",!0),k(D,U,Se,"\u2660","\\spadesuit",!0),k(ut,U,Se,"\xA7","\\S",!0),k(ut,U,Se,"\xB6","\\P",!0),k(D,U,Se,"\u2020","\\dag"),k(ut,U,Se,"\u2020","\\dag"),k(ut,U,Se,"\u2020","\\textdagger"),k(D,U,Se,"\u2021","\\ddag"),k(ut,U,Se,"\u2021","\\ddag"),k(ut,U,Se,"\u2021","\\textdaggerdbl"),k(D,U,Ue,"\u23B1","\\rmoustache",!0),k(D,U,_e,"\u23B0","\\lmoustache",!0),k(D,U,Ue,"\u27EF","\\rgroup",!0),k(D,U,_e,"\u27EE","\\lgroup",!0),k(D,U,Ee,"\u2213","\\mp",!0),k(D,U,Ee,"\u2296","\\ominus",!0),k(D,U,Ee,"\u228E","\\uplus",!0),k(D,U,Ee,"\u2293","\\sqcap",!0),k(D,U,Ee,"\u2217","\\ast"),k(D,U,Ee,"\u2294","\\sqcup",!0),k(D,U,Ee,"\u25EF","\\bigcirc"),k(D,U,Ee,"\u2219","\\bullet"),k(D,U,Ee,"\u2021","\\ddagger"),k(D,U,Ee,"\u2240","\\wr",!0),k(D,U,Ee,"\u2A3F","\\amalg"),k(D,U,Ee,"&","\\And"),k(D,U,H,"\u27F5","\\longleftarrow",!0),k(D,U,H,"\u21D0","\\Leftarrow",!0),k(D,U,H,"\u27F8","\\Longleftarrow",!0),k(D,U,H,"\u27F6","\\longrightarrow",!0),k(D,U,H,"\u21D2","\\Rightarrow",!0),k(D,U,H,"\u27F9","\\Longrightarrow",!0),k(D,U,H,"\u2194","\\leftrightarrow",!0),k(D,U,H,"\u27F7","\\longleftrightarrow",!0),k(D,U,H,"\u21D4","\\Leftrightarrow",!0),k(D,U,H,"\u27FA","\\Longleftrightarrow",!0),k(D,U,H,"\u21A6","\\mapsto",!0),k(D,U,H,"\u27FC","\\longmapsto",!0),k(D,U,H,"\u2197","\\nearrow",!0),k(D,U,H,"\u21A9","\\hookleftarrow",!0),k(D,U,H,"\u21AA","\\hookrightarrow",!0),k(D,U,H,"\u2198","\\searrow",!0),k(D,U,H,"\u21BC","\\leftharpoonup",!0),k(D,U,H,"\u21C0","\\rightharpoonup",!0),k(D,U,H,"\u2199","\\swarrow",!0),k(D,U,H,"\u21BD","\\leftharpoondown",!0),k(D,U,H,"\u21C1","\\rightharpoondown",!0),k(D,U,H,"\u2196","\\nwarrow",!0),k(D,U,H,"\u21CC","\\rightleftharpoons",!0),k(D,he,H,"\u226E","\\nless",!0),k(D,he,H,"\uE010","\\@nleqslant"),k(D,he,H,"\uE011","\\@nleqq"),k(D,he,H,"\u2A87","\\lneq",!0),k(D,he,H,"\u2268","\\lneqq",!0),k(D,he,H,"\uE00C","\\@lvertneqq"),k(D,he,H,"\u22E6","\\lnsim",!0),k(D,he,H,"\u2A89","\\lnapprox",!0),k(D,he,H,"\u2280","\\nprec",!0),k(D,he,H,"\u22E0","\\npreceq",!0),k(D,he,H,"\u22E8","\\precnsim",!0),k(D,he,H,"\u2AB9","\\precnapprox",!0),k(D,he,H,"\u2241","\\nsim",!0),k(D,he,H,"\uE006","\\@nshortmid"),k(D,he,H,"\u2224","\\nmid",!0),k(D,he,H,"\u22AC","\\nvdash",!0),k(D,he,H,"\u22AD","\\nvDash",!0),k(D,he,H,"\u22EA","\\ntriangleleft"),k(D,he,H,"\u22EC","\\ntrianglelefteq",!0),k(D,he,H,"\u228A","\\subsetneq",!0),k(D,he,H,"\uE01A","\\@varsubsetneq"),k(D,he,H,"\u2ACB","\\subsetneqq",!0),k(D,he,H,"\uE017","\\@varsubsetneqq"),k(D,he,H,"\u226F","\\ngtr",!0),k(D,he,H,"\uE00F","\\@ngeqslant"),k(D,he,H,"\uE00E","\\@ngeqq"),k(D,he,H,"\u2A88","\\gneq",!0),k(D,he,H,"\u2269","\\gneqq",!0),k(D,he,H,"\uE00D","\\@gvertneqq"),k(D,he,H,"\u22E7","\\gnsim",!0),k(D,he,H,"\u2A8A","\\gnapprox",!0),k(D,he,H,"\u2281","\\nsucc",!0),k(D,he,H,"\u22E1","\\nsucceq",!0),k(D,he,H,"\u22E9","\\succnsim",!0),k(D,he,H,"\u2ABA","\\succnapprox",!0),k(D,he,H,"\u2246","\\ncong",!0),k(D,he,H,"\uE007","\\@nshortparallel"),k(D,he,H,"\u2226","\\nparallel",!0),k(D,he,H,"\u22AF","\\nVDash",!0),k(D,he,H,"\u22EB","\\ntriangleright"),k(D,he,H,"\u22ED","\\ntrianglerighteq",!0),k(D,he,H,"\uE018","\\@nsupseteqq"),k(D,he,H,"\u228B","\\supsetneq",!0),k(D,he,H,"\uE01B","\\@varsupsetneq"),k(D,he,H,"\u2ACC","\\supsetneqq",!0),k(D,he,H,"\uE019","\\@varsupsetneqq"),k(D,he,H,"\u22AE","\\nVdash",!0),k(D,he,H,"\u2AB5","\\precneqq",!0),k(D,he,H,"\u2AB6","\\succneqq",!0),k(D,he,H,"\uE016","\\@nsubseteqq"),k(D,he,Ee,"\u22B4","\\unlhd"),k(D,he,Ee,"\u22B5","\\unrhd"),k(D,he,H,"\u219A","\\nleftarrow",!0),k(D,he,H,"\u219B","\\nrightarrow",!0),k(D,he,H,"\u21CD","\\nLeftarrow",!0),k(D,he,H,"\u21CF","\\nRightarrow",!0),k(D,he,H,"\u21AE","\\nleftrightarrow",!0),k(D,he,H,"\u21CE","\\nLeftrightarrow",!0),k(D,he,H,"\u25B3","\\vartriangle"),k(D,he,Se,"\u210F","\\hslash"),k(D,he,Se,"\u25BD","\\triangledown"),k(D,he,Se,"\u25CA","\\lozenge"),k(D,he,Se,"\u24C8","\\circledS"),k(D,he,Se,"\xAE","\\circledR"),k(ut,he,Se,"\xAE","\\circledR"),k(D,he,Se,"\u2221","\\measuredangle",!0),k(D,he,Se,"\u2204","\\nexists"),k(D,he,Se,"\u2127","\\mho"),k(D,he,Se,"\u2132","\\Finv",!0),k(D,he,Se,"\u2141","\\Game",!0),k(D,he,Se,"\u2035","\\backprime"),k(D,he,Se,"\u25B2","\\blacktriangle"),k(D,he,Se,"\u25BC","\\blacktriangledown"),k(D,he,Se,"\u25A0","\\blacksquare"),k(D,he,Se,"\u29EB","\\blacklozenge"),k(D,he,Se,"\u2605","\\bigstar"),k(D,he,Se,"\u2222","\\sphericalangle",!0),k(D,he,Se,"\u2201","\\complement",!0),k(D,he,Se,"\xF0","\\eth",!0),k(D,he,Se,"\u2571","\\diagup"),k(D,he,Se,"\u2572","\\diagdown"),k(D,he,Se,"\u25A1","\\square"),k(D,he,Se,"\u25A1","\\Box"),k(D,he,Se,"\u25CA","\\Diamond"),k(D,he,Se,"\xA5","\\yen",!0),k(ut,he,Se,"\xA5","\\yen",!0),k(D,he,Se,"\u2713","\\checkmark",!0),k(ut,he,Se,"\u2713","\\checkmark"),k(D,he,Se,"\u2136","\\beth",!0),k(D,he,Se,"\u2138","\\daleth",!0),k(D,he,Se,"\u2137","\\gimel",!0),k(D,he,Se,"\u03DD","\\digamma",!0),k(D,he,Se,"\u03F0","\\varkappa"),k(D,he,_e,"\u250C","\\ulcorner",!0),k(D,he,Ue,"\u2510","\\urcorner",!0),k(D,he,_e,"\u2514","\\llcorner",!0),k(D,he,Ue,"\u2518","\\lrcorner",!0),k(D,he,H,"\u2266","\\leqq",!0),k(D,he,H,"\u2A7D","\\leqslant",!0),k(D,he,H,"\u2A95","\\eqslantless",!0),k(D,he,H,"\u2272","\\lesssim",!0),k(D,he,H,"\u2A85","\\lessapprox",!0),k(D,he,H,"\u224A","\\approxeq",!0),k(D,he,Ee,"\u22D6","\\lessdot"),k(D,he,H,"\u22D8","\\lll",!0),k(D,he,H,"\u2276","\\lessgtr",!0),k(D,he,H,"\u22DA","\\lesseqgtr",!0),k(D,he,H,"\u2A8B","\\lesseqqgtr",!0),k(D,he,H,"\u2251","\\doteqdot"),k(D,he,H,"\u2253","\\risingdotseq",!0),k(D,he,H,"\u2252","\\fallingdotseq",!0),k(D,he,H,"\u223D","\\backsim",!0),k(D,he,H,"\u22CD","\\backsimeq",!0),k(D,he,H,"\u2AC5","\\subseteqq",!0),k(D,he,H,"\u22D0","\\Subset",!0),k(D,he,H,"\u228F","\\sqsubset",!0),k(D,he,H,"\u227C","\\preccurlyeq",!0),k(D,he,H,"\u22DE","\\curlyeqprec",!0),k(D,he,H,"\u227E","\\precsim",!0),k(D,he,H,"\u2AB7","\\precapprox",!0),k(D,he,H,"\u22B2","\\vartriangleleft"),k(D,he,H,"\u22B4","\\trianglelefteq"),k(D,he,H,"\u22A8","\\vDash",!0),k(D,he,H,"\u22AA","\\Vvdash",!0),k(D,he,H,"\u2323","\\smallsmile"),k(D,he,H,"\u2322","\\smallfrown"),k(D,he,H,"\u224F","\\bumpeq",!0),k(D,he,H,"\u224E","\\Bumpeq",!0),k(D,he,H,"\u2267","\\geqq",!0),k(D,he,H,"\u2A7E","\\geqslant",!0),k(D,he,H,"\u2A96","\\eqslantgtr",!0),k(D,he,H,"\u2273","\\gtrsim",!0),k(D,he,H,"\u2A86","\\gtrapprox",!0),k(D,he,Ee,"\u22D7","\\gtrdot"),k(D,he,H,"\u22D9","\\ggg",!0),k(D,he,H,"\u2277","\\gtrless",!0),k(D,he,H,"\u22DB","\\gtreqless",!0),k(D,he,H,"\u2A8C","\\gtreqqless",!0),k(D,he,H,"\u2256","\\eqcirc",!0),k(D,he,H,"\u2257","\\circeq",!0),k(D,he,H,"\u225C","\\triangleq",!0),k(D,he,H,"\u223C","\\thicksim"),k(D,he,H,"\u2248","\\thickapprox"),k(D,he,H,"\u2AC6","\\supseteqq",!0),k(D,he,H,"\u22D1","\\Supset",!0),k(D,he,H,"\u2290","\\sqsupset",!0),k(D,he,H,"\u227D","\\succcurlyeq",!0),k(D,he,H,"\u22DF","\\curlyeqsucc",!0),k(D,he,H,"\u227F","\\succsim",!0),k(D,he,H,"\u2AB8","\\succapprox",!0),k(D,he,H,"\u22B3","\\vartriangleright"),k(D,he,H,"\u22B5","\\trianglerighteq"),k(D,he,H,"\u22A9","\\Vdash",!0),k(D,he,H,"\u2223","\\shortmid"),k(D,he,H,"\u2225","\\shortparallel"),k(D,he,H,"\u226C","\\between",!0),k(D,he,H,"\u22D4","\\pitchfork",!0),k(D,he,H,"\u221D","\\varpropto"),k(D,he,H,"\u25C0","\\blacktriangleleft"),k(D,he,H,"\u2234","\\therefore",!0),k(D,he,H,"\u220D","\\backepsilon"),k(D,he,H,"\u25B6","\\blacktriangleright"),k(D,he,H,"\u2235","\\because",!0),k(D,he,H,"\u22D8","\\llless"),k(D,he,H,"\u22D9","\\gggtr"),k(D,he,Ee,"\u22B2","\\lhd"),k(D,he,Ee,"\u22B3","\\rhd"),k(D,he,H,"\u2242","\\eqsim",!0),k(D,U,H,"\u22C8","\\Join"),k(D,he,H,"\u2251","\\Doteq",!0),k(D,he,Ee,"\u2214","\\dotplus",!0),k(D,he,Ee,"\u2216","\\smallsetminus"),k(D,he,Ee,"\u22D2","\\Cap",!0),k(D,he,Ee,"\u22D3","\\Cup",!0),k(D,he,Ee,"\u2A5E","\\doublebarwedge",!0),k(D,he,Ee,"\u229F","\\boxminus",!0),k(D,he,Ee,"\u229E","\\boxplus",!0),k(D,he,Ee,"\u22C7","\\divideontimes",!0),k(D,he,Ee,"\u22C9","\\ltimes",!0),k(D,he,Ee,"\u22CA","\\rtimes",!0),k(D,he,Ee,"\u22CB","\\leftthreetimes",!0),k(D,he,Ee,"\u22CC","\\rightthreetimes",!0),k(D,he,Ee,"\u22CF","\\curlywedge",!0),k(D,he,Ee,"\u22CE","\\curlyvee",!0),k(D,he,Ee,"\u229D","\\circleddash",!0),k(D,he,Ee,"\u229B","\\circledast",!0),k(D,he,Ee,"\u22C5","\\centerdot"),k(D,he,Ee,"\u22BA","\\intercal",!0),k(D,he,Ee,"\u22D2","\\doublecap"),k(D,he,Ee,"\u22D3","\\doublecup"),k(D,he,Ee,"\u22A0","\\boxtimes",!0),k(D,he,H,"\u21E2","\\dashrightarrow",!0),k(D,he,H,"\u21E0","\\dashleftarrow",!0),k(D,he,H,"\u21C7","\\leftleftarrows",!0),k(D,he,H,"\u21C6","\\leftrightarrows",!0),k(D,he,H,"\u21DA","\\Lleftarrow",!0),k(D,he,H,"\u219E","\\twoheadleftarrow",!0),k(D,he,H,"\u21A2","\\leftarrowtail",!0),k(D,he,H,"\u21AB","\\looparrowleft",!0),k(D,he,H,"\u21CB","\\leftrightharpoons",!0),k(D,he,H,"\u21B6","\\curvearrowleft",!0),k(D,he,H,"\u21BA","\\circlearrowleft",!0),k(D,he,H,"\u21B0","\\Lsh",!0),k(D,he,H,"\u21C8","\\upuparrows",!0),k(D,he,H,"\u21BF","\\upharpoonleft",!0),k(D,he,H,"\u21C3","\\downharpoonleft",!0),k(D,he,H,"\u22B8","\\multimap",!0),k(D,he,H,"\u21AD","\\leftrightsquigarrow",!0),k(D,he,H,"\u21C9","\\rightrightarrows",!0),k(D,he,H,"\u21C4","\\rightleftarrows",!0),k(D,he,H,"\u21A0","\\twoheadrightarrow",!0),k(D,he,H,"\u21A3","\\rightarrowtail",!0),k(D,he,H,"\u21AC","\\looparrowright",!0),k(D,he,H,"\u21B7","\\curvearrowright",!0),k(D,he,H,"\u21BB","\\circlearrowright",!0),k(D,he,H,"\u21B1","\\Rsh",!0),k(D,he,H,"\u21CA","\\downdownarrows",!0),k(D,he,H,"\u21BE","\\upharpoonright",!0),k(D,he,H,"\u21C2","\\downharpoonright",!0),k(D,he,H,"\u21DD","\\rightsquigarrow",!0),k(D,he,H,"\u21DD","\\leadsto"),k(D,he,H,"\u21DB","\\Rrightarrow",!0),k(D,he,H,"\u21BE","\\restriction"),k(D,U,Se,"\u2018","`"),k(D,U,Se,"$","\\$"),k(ut,U,Se,"$","\\$"),k(ut,U,Se,"$","\\textdollar"),k(D,U,Se,"%","\\%"),k(ut,U,Se,"%","\\%"),k(D,U,Se,"_","\\_"),k(ut,U,Se,"_","\\_"),k(ut,U,Se,"_","\\textunderscore"),k(D,U,Se,"\u2220","\\angle",!0),k(D,U,Se,"\u221E","\\infty",!0),k(D,U,Se,"\u2032","\\prime"),k(D,U,Se,"\u25B3","\\triangle"),k(D,U,Se,"\u0393","\\Gamma",!0),k(D,U,Se,"\u0394","\\Delta",!0),k(D,U,Se,"\u0398","\\Theta",!0),k(D,U,Se,"\u039B","\\Lambda",!0),k(D,U,Se,"\u039E","\\Xi",!0),k(D,U,Se,"\u03A0","\\Pi",!0),k(D,U,Se,"\u03A3","\\Sigma",!0),k(D,U,Se,"\u03A5","\\Upsilon",!0),k(D,U,Se,"\u03A6","\\Phi",!0),k(D,U,Se,"\u03A8","\\Psi",!0),k(D,U,Se,"\u03A9","\\Omega",!0),k(D,U,Se,"A","\u0391"),k(D,U,Se,"B","\u0392"),k(D,U,Se,"E","\u0395"),k(D,U,Se,"Z","\u0396"),k(D,U,Se,"H","\u0397"),k(D,U,Se,"I","\u0399"),k(D,U,Se,"K","\u039A"),k(D,U,Se,"M","\u039C"),k(D,U,Se,"N","\u039D"),k(D,U,Se,"O","\u039F"),k(D,U,Se,"P","\u03A1"),k(D,U,Se,"T","\u03A4"),k(D,U,Se,"X","\u03A7"),k(D,U,Se,"\xAC","\\neg",!0),k(D,U,Se,"\xAC","\\lnot"),k(D,U,Se,"\u22A4","\\top"),k(D,U,Se,"\u22A5","\\bot"),k(D,U,Se,"\u2205","\\emptyset"),k(D,he,Se,"\u2205","\\varnothing"),k(D,U,G,"\u03B1","\\alpha",!0),k(D,U,G,"\u03B2","\\beta",!0),k(D,U,G,"\u03B3","\\gamma",!0),k(D,U,G,"\u03B4","\\delta",!0),k(D,U,G,"\u03F5","\\epsilon",!0),k(D,U,G,"\u03B6","\\zeta",!0),k(D,U,G,"\u03B7","\\eta",!0),k(D,U,G,"\u03B8","\\theta",!0),k(D,U,G,"\u03B9","\\iota",!0),k(D,U,G,"\u03BA","\\kappa",!0),k(D,U,G,"\u03BB","\\lambda",!0),k(D,U,G,"\u03BC","\\mu",!0),k(D,U,G,"\u03BD","\\nu",!0),k(D,U,G,"\u03BE","\\xi",!0),k(D,U,G,"\u03BF","\\omicron",!0),k(D,U,G,"\u03C0","\\pi",!0),k(D,U,G,"\u03C1","\\rho",!0),k(D,U,G,"\u03C3","\\sigma",!0),k(D,U,G,"\u03C4","\\tau",!0),k(D,U,G,"\u03C5","\\upsilon",!0),k(D,U,G,"\u03D5","\\phi",!0),k(D,U,G,"\u03C7","\\chi",!0),k(D,U,G,"\u03C8","\\psi",!0),k(D,U,G,"\u03C9","\\omega",!0),k(D,U,G,"\u03B5","\\varepsilon",!0),k(D,U,G,"\u03D1","\\vartheta",!0),k(D,U,G,"\u03D6","\\varpi",!0),k(D,U,G,"\u03F1","\\varrho",!0),k(D,U,G,"\u03C2","\\varsigma",!0),k(D,U,G,"\u03C6","\\varphi",!0),k(D,U,Ee,"\u2217","*"),k(D,U,Ee,"+","+"),k(D,U,Ee,"\u2212","-"),k(D,U,Ee,"\u22C5","\\cdot",!0),k(D,U,Ee,"\u2218","\\circ"),k(D,U,Ee,"\xF7","\\div",!0),k(D,U,Ee,"\xB1","\\pm",!0),k(D,U,Ee,"\xD7","\\times",!0),k(D,U,Ee,"\u2229","\\cap",!0),k(D,U,Ee,"\u222A","\\cup",!0),k(D,U,Ee,"\u2216","\\setminus"),k(D,U,Ee,"\u2227","\\land"),k(D,U,Ee,"\u2228","\\lor"),k(D,U,Ee,"\u2227","\\wedge",!0),k(D,U,Ee,"\u2228","\\vee",!0),k(D,U,Se,"\u221A","\\surd"),k(D,U,_e,"(","("),k(D,U,_e,"[","["),k(D,U,_e,"\u27E8","\\langle",!0),k(D,U,_e,"\u2223","\\lvert"),k(D,U,_e,"\u2225","\\lVert"),k(D,U,Ue,")",")"),k(D,U,Ue,"]","]"),k(D,U,Ue,"?","?"),k(D,U,Ue,"!","!"),k(D,U,Ue,"\u27E9","\\rangle",!0),k(D,U,Ue,"\u2223","\\rvert"),k(D,U,Ue,"\u2225","\\rVert"),k(D,U,H,"=","="),k(D,U,H,"<","<"),k(D,U,H,">",">"),k(D,U,H,":",":"),k(D,U,H,"\u2248","\\approx",!0),k(D,U,H,"\u2245","\\cong",!0),k(D,U,H,"\u2265","\\ge"),k(D,U,H,"\u2265","\\geq",!0),k(D,U,H,"\u2190","\\gets"),k(D,U,H,">","\\gt"),k(D,U,H,"\u2208","\\in",!0),k(D,U,H,"\uE020","\\@not"),k(D,U,H,"\u2282","\\subset",!0),k(D,U,H,"\u2283","\\supset",!0),k(D,U,H,"\u2286","\\subseteq",!0),k(D,U,H,"\u2287","\\supseteq",!0),k(D,he,H,"\u2288","\\nsubseteq",!0),k(D,he,H,"\u2289","\\nsupseteq",!0),k(D,U,H,"\u22A8","\\models"),k(D,U,H,"\u2190","\\leftarrow",!0),k(D,U,H,"\u2264","\\le"),k(D,U,H,"\u2264","\\leq",!0),k(D,U,H,"<","\\lt"),k(D,U,H,"\u2192","\\rightarrow",!0),k(D,U,H,"\u2192","\\to"),k(D,he,H,"\u2271","\\ngeq",!0),k(D,he,H,"\u2270","\\nleq",!0),k(D,U,Vt,"\xA0","\\ "),k(D,U,Vt,"\xA0","~"),k(D,U,Vt,"\xA0","\\space"),k(D,U,Vt,"\xA0","\\nobreakspace"),k(ut,U,Vt,"\xA0","\\ "),k(ut,U,Vt,"\xA0","~"),k(ut,U,Vt,"\xA0","\\space"),k(ut,U,Vt,"\xA0","\\nobreakspace"),k(D,U,Vt,null,"\\nobreak"),k(D,U,Vt,null,"\\allowbreak"),k(D,U,Ne,",",","),k(D,U,Ne,";",";"),k(D,he,Ee,"\u22BC","\\barwedge",!0),k(D,he,Ee,"\u22BB","\\veebar",!0),k(D,U,Ee,"\u2299","\\odot",!0),k(D,U,Ee,"\u2295","\\oplus",!0),k(D,U,Ee,"\u2297","\\otimes",!0),k(D,U,Se,"\u2202","\\partial",!0),k(D,U,Ee,"\u2298","\\oslash",!0),k(D,he,Ee,"\u229A","\\circledcirc",!0),k(D,he,Ee,"\u22A1","\\boxdot",!0),k(D,U,Ee,"\u25B3","\\bigtriangleup"),k(D,U,Ee,"\u25BD","\\bigtriangledown"),k(D,U,Ee,"\u2020","\\dagger"),k(D,U,Ee,"\u22C4","\\diamond"),k(D,U,Ee,"\u22C6","\\star"),k(D,U,Ee,"\u25C3","\\triangleleft"),k(D,U,Ee,"\u25B9","\\triangleright"),k(D,U,_e,"{","\\{"),k(ut,U,Se,"{","\\{"),k(ut,U,Se,"{","\\textbraceleft"),k(D,U,Ue,"}","\\}"),k(ut,U,Se,"}","\\}"),k(ut,U,Se,"}","\\textbraceright"),k(D,U,_e,"{","\\lbrace"),k(D,U,Ue,"}","\\rbrace"),k(D,U,_e,"[","\\lbrack"),k(ut,U,Se,"[","\\lbrack"),k(D,U,Ue,"]","\\rbrack"),k(ut,U,Se,"]","\\rbrack"),k(D,U,_e,"(","\\lparen"),k(D,U,Ue,")","\\rparen"),k(ut,U,Se,"<","\\textless"),k(ut,U,Se,">","\\textgreater"),k(D,U,_e,"\u230A","\\lfloor",!0),k(D,U,Ue,"\u230B","\\rfloor",!0),k(D,U,_e,"\u2308","\\lceil",!0),k(D,U,Ue,"\u2309","\\rceil",!0),k(D,U,Se,"\\","\\backslash"),k(D,U,Se,"\u2223","|"),k(D,U,Se,"\u2223","\\vert"),k(ut,U,Se,"|","\\textbar"),k(D,U,Se,"\u2225","\\|"),k(D,U,Se,"\u2225","\\Vert"),k(ut,U,Se,"\u2225","\\textbardbl"),k(ut,U,Se,"~","\\textasciitilde"),k(ut,U,Se,"\\","\\textbackslash"),k(ut,U,Se,"^","\\textasciicircum"),k(D,U,H,"\u2191","\\uparrow",!0),k(D,U,H,"\u21D1","\\Uparrow",!0),k(D,U,H,"\u2193","\\downarrow",!0),k(D,U,H,"\u21D3","\\Downarrow",!0),k(D,U,H,"\u2195","\\updownarrow",!0),k(D,U,H,"\u21D5","\\Updownarrow",!0),k(D,U,pe,"\u2210","\\coprod"),k(D,U,pe,"\u22C1","\\bigvee"),k(D,U,pe,"\u22C0","\\bigwedge"),k(D,U,pe,"\u2A04","\\biguplus"),k(D,U,pe,"\u22C2","\\bigcap"),k(D,U,pe,"\u22C3","\\bigcup"),k(D,U,pe,"\u222B","\\int"),k(D,U,pe,"\u222B","\\intop"),k(D,U,pe,"\u222C","\\iint"),k(D,U,pe,"\u222D","\\iiint"),k(D,U,pe,"\u220F","\\prod"),k(D,U,pe,"\u2211","\\sum"),k(D,U,pe,"\u2A02","\\bigotimes"),k(D,U,pe,"\u2A01","\\bigoplus"),k(D,U,pe,"\u2A00","\\bigodot"),k(D,U,pe,"\u222E","\\oint"),k(D,U,pe,"\u222F","\\oiint"),k(D,U,pe,"\u2230","\\oiiint"),k(D,U,pe,"\u2A06","\\bigsqcup"),k(D,U,pe,"\u222B","\\smallint"),k(ut,U,Ze,"\u2026","\\textellipsis"),k(D,U,Ze,"\u2026","\\mathellipsis"),k(ut,U,Ze,"\u2026","\\ldots",!0),k(D,U,Ze,"\u2026","\\ldots",!0),k(D,U,Ze,"\u22EF","\\@cdots",!0),k(D,U,Ze,"\u22F1","\\ddots",!0),k(D,U,Se,"\u22EE","\\varvdots"),k(D,U,Tr,"\u02CA","\\acute"),k(D,U,Tr,"\u02CB","\\grave"),k(D,U,Tr,"\xA8","\\ddot"),k(D,U,Tr,"~","\\tilde"),k(D,U,Tr,"\u02C9","\\bar"),k(D,U,Tr,"\u02D8","\\breve"),k(D,U,Tr,"\u02C7","\\check"),k(D,U,Tr,"^","\\hat"),k(D,U,Tr,"\u20D7","\\vec"),k(D,U,Tr,"\u02D9","\\dot"),k(D,U,Tr,"\u02DA","\\mathring"),k(D,U,G,"\u0131","\\imath",!0),k(D,U,G,"\u0237","\\jmath",!0),k(ut,U,Se,"\u0131","\\i",!0),k(ut,U,Se,"\u0237","\\j",!0),k(ut,U,Se,"\xDF","\\ss",!0),k(ut,U,Se,"\xE6","\\ae",!0),k(ut,U,Se,"\xE6","\\ae",!0),k(ut,U,Se,"\u0153","\\oe",!0),k(ut,U,Se,"\xF8","\\o",!0),k(ut,U,Se,"\xC6","\\AE",!0),k(ut,U,Se,"\u0152","\\OE",!0),k(ut,U,Se,"\xD8","\\O",!0),k(ut,U,Tr,"\u02CA","\\'"),k(ut,U,Tr,"\u02CB","\\`"),k(ut,U,Tr,"\u02C6","\\^"),k(ut,U,Tr,"\u02DC","\\~"),k(ut,U,Tr,"\u02C9","\\="),k(ut,U,Tr,"\u02D8","\\u"),k(ut,U,Tr,"\u02D9","\\."),k(ut,U,Tr,"\u02DA","\\r"),k(ut,U,Tr,"\u02C7","\\v"),k(ut,U,Tr,"\xA8",'\\"'),k(ut,U,Tr,"\u02DD","\\H"),k(ut,U,Tr,"\u25EF","\\textcircled");var qt={"--":!0,"---":!0,"``":!0,"''":!0};k(ut,U,Se,"\u2013","--"),k(ut,U,Se,"\u2013","\\textendash"),k(ut,U,Se,"\u2014","---"),k(ut,U,Se,"\u2014","\\textemdash"),k(ut,U,Se,"\u2018","`"),k(ut,U,Se,"\u2018","\\textquoteleft"),k(ut,U,Se,"\u2019","'"),k(ut,U,Se,"\u2019","\\textquoteright"),k(ut,U,Se,"\u201C","``"),k(ut,U,Se,"\u201C","\\textquotedblleft"),k(ut,U,Se,"\u201D","''"),k(ut,U,Se,"\u201D","\\textquotedblright"),k(D,U,Se,"\xB0","\\degree",!0),k(ut,U,Se,"\xB0","\\degree"),k(ut,U,Se,"\xB0","\\textdegree",!0),k(D,U,G,"\xA3","\\pounds"),k(D,U,G,"\xA3","\\mathsterling",!0),k(ut,U,G,"\xA3","\\pounds"),k(ut,U,G,"\xA3","\\textsterling",!0),k(D,he,Se,"\u2720","\\maltese"),k(ut,he,Se,"\u2720","\\maltese"),k(ut,U,Vt,"\xA0","\\ "),k(ut,U,Vt,"\xA0"," "),k(ut,U,Vt,"\xA0","~");for(var vr='0123456789/@."',Xr=0;Xr<vr.length;Xr++){var An=vr.charAt(Xr);k(D,U,Se,An,An)}for(var Kr='0123456789!@*()-=+[]<>|";:?/.,',yr=0;yr<Kr.length;yr++){var gn=Kr.charAt(yr);k(ut,U,Se,gn,gn)}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ae=0;Ae<fe.length;Ae++){var Ct=fe.charAt(Ae);k(D,U,G,Ct,Ct),k(ut,U,Se,Ct,Ct)}k(D,he,Se,"C","\u2102"),k(ut,he,Se,"C","\u2102"),k(D,he,Se,"H","\u210D"),k(ut,he,Se,"H","\u210D"),k(D,he,Se,"N","\u2115"),k(ut,he,Se,"N","\u2115"),k(D,he,Se,"P","\u2119"),k(ut,he,Se,"P","\u2119"),k(D,he,Se,"Q","\u211A"),k(ut,he,Se,"Q","\u211A"),k(D,he,Se,"R","\u211D"),k(ut,he,Se,"R","\u211D"),k(D,he,Se,"Z","\u2124"),k(ut,he,Se,"Z","\u2124"),k(D,U,G,"h","\u210E"),k(ut,U,G,"h","\u210E");for(var at="",xt=0;xt<fe.length;xt++){var Ot=fe.charAt(xt);at=String.fromCharCode(55349,56320+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at),at=String.fromCharCode(55349,56372+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at),at=String.fromCharCode(55349,56424+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at),at=String.fromCharCode(55349,56580+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at),at=String.fromCharCode(55349,56736+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at),at=String.fromCharCode(55349,56788+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at),at=String.fromCharCode(55349,56840+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at),at=String.fromCharCode(55349,56944+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at),xt<26&&(at=String.fromCharCode(55349,56632+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at),at=String.fromCharCode(55349,56476+xt),k(D,U,G,Ot,at),k(ut,U,Se,Ot,at))}at="\u{1D55C}",k(D,U,G,"k",at),k(ut,U,Se,"k",at);for(var ir=0;ir<10;ir++){var Jt=ir.toString();at=String.fromCharCode(55349,57294+ir),k(D,U,G,Jt,at),k(ut,U,Se,Jt,at),at=String.fromCharCode(55349,57314+ir),k(D,U,G,Jt,at),k(ut,U,Se,Jt,at),at=String.fromCharCode(55349,57324+ir),k(D,U,G,Jt,at),k(ut,U,Se,Jt,at),at=String.fromCharCode(55349,57334+ir),k(D,U,G,Jt,at),k(ut,U,Se,Jt,at)}for(var xr="\xC7\xD0\xDE\xE7\xFE",br=0;br<xr.length;br++){var nn=xr.charAt(br);k(D,U,G,nn,nn),k(ut,U,Se,nn,nn)}k(ut,U,Se,"\xF0","\xF0"),k(ut,U,Se,"\u2013","\u2013"),k(ut,U,Se,"\u2014","\u2014"),k(ut,U,Se,"\u2018","\u2018"),k(ut,U,Se,"\u2019","\u2019"),k(ut,U,Se,"\u201C","\u201C"),k(ut,U,Se,"\u201D","\u201D");var kr=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathdefault","textit","Math-Italic"],["mathdefault","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Fr=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],$r=function(p,v){var y=p.charCodeAt(0),x=p.charCodeAt(1),O=(y-55296)*1024+(x-56320)+65536,z=v==="math"?0:1;if(119808<=O&&O<120484){var oe=Math.floor((O-119808)/26);return[kr[oe][2],kr[oe][z]]}else if(120782<=O&&O<=120831){var be=Math.floor((O-120782)/10);return[Fr[be][2],Fr[be][z]]}else{if(O===120485||O===120486)return[kr[0][2],kr[0][z]];if(120486<O&&O<120782)return["",""];throw new me("Unsupported character: "+p)}},pn=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Mn=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],mn=function(p,v){return v.size<2?p:pn[p-1][v.size-1]},dn=function(){function K(v){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=v.style,this.color=v.color,this.size=v.size||K.BASESIZE,this.textSize=v.textSize||this.size,this.phantom=!!v.phantom,this.font=v.font||"",this.fontFamily=v.fontFamily||"",this.fontWeight=v.fontWeight||"",this.fontShape=v.fontShape||"",this.sizeMultiplier=Mn[this.size-1],this.maxSize=v.maxSize,this.minRuleThickness=v.minRuleThickness,this._fontMetrics=void 0}var p=K.prototype;return p.extend=function(y){var x={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var O in y)y.hasOwnProperty(O)&&(x[O]=y[O]);return new K(x)},p.havingStyle=function(y){return this.style===y?this:this.extend({style:y,size:mn(this.textSize,y)})},p.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},p.havingSize=function(y){return this.size===y&&this.textSize===y?this:this.extend({style:this.style.text(),size:y,textSize:y,sizeMultiplier:Mn[y-1]})},p.havingBaseStyle=function(y){y=y||this.style.text();var x=mn(K.BASESIZE,y);return this.size===x&&this.textSize===K.BASESIZE&&this.style===y?this:this.extend({style:y,size:x})},p.havingBaseSizing=function(){var y;switch(this.style.id){case 4:case 5:y=3;break;case 6:case 7:y=1;break;default:y=6}return this.extend({style:this.style.text(),size:y})},p.withColor=function(y){return this.extend({color:y})},p.withPhantom=function(){return this.extend({phantom:!0})},p.withFont=function(y){return this.extend({font:y})},p.withTextFontFamily=function(y){return this.extend({fontFamily:y,font:""})},p.withTextFontWeight=function(y){return this.extend({fontWeight:y,font:""})},p.withTextFontShape=function(y){return this.extend({fontShape:y,font:""})},p.sizingClasses=function(y){return y.size!==this.size?["sizing","reset-size"+y.size,"size"+this.size]:[]},p.baseSizingClasses=function(){return this.size!==K.BASESIZE?["sizing","reset-size"+this.size,"size"+K.BASESIZE]:[]},p.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=qe(this.size)),this._fontMetrics},p.getColor=function(){return this.phantom?"transparent":this.color},K}();dn.BASESIZE=6;var $n=dn,rn={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Lr={ex:!0,em:!0,mu:!0},nt=function(p){return typeof p!="string"&&(p=p.unit),p in rn||p in Lr||p==="ex"},Qe=function(p,v){var y;if(p.unit in rn)y=rn[p.unit]/v.fontMetrics().ptPerEm/v.sizeMultiplier;else if(p.unit==="mu")y=v.fontMetrics().cssEmPerMu;else{var x;if(v.style.isTight()?x=v.havingStyle(v.style.text()):x=v,p.unit==="ex")y=x.fontMetrics().xHeight;else if(p.unit==="em")y=x.fontMetrics().quad;else throw new me("Invalid unit: '"+p.unit+"'");x!==v&&(y*=x.sizeMultiplier/v.sizeMultiplier)}return Math.min(p.number*y,v.maxSize)},bt=["\\imath","\u0131","\\jmath","\u0237","\\pounds","\\mathsterling","\\textsterling","\xA3"],Rt=function(p,v,y){return Gt[y][p]&&Gt[y][p].replace&&(p=Gt[y][p].replace),{value:p,metrics:Fe(p,v,y)}},lt=function(p,v,y,x,O){var z=Rt(p,v,y),oe=z.metrics;p=z.value;var be;if(oe){var Re=oe.italic;(y==="text"||x&&x.font==="mathit")&&(Re=0),be=new Be(p,oe.height,oe.depth,Re,oe.skew,oe.width,O)}else typeof console!="undefined"&&console.warn("No character metrics "+("for '"+p+"' in style '"+v+"' and mode '"+y+"'")),be=new Be(p,0,0,0,0,0,O);if(x){be.maxFontSize=x.sizeMultiplier,x.style.isTight()&&be.classes.push("mtight");var it=x.getColor();it&&(be.style.color=it)}return be},Nt=function(p,v,y,x){return x===void 0&&(x=[]),y.font==="boldsymbol"&&Rt(p,"Main-Bold",v).metrics?lt(p,"Main-Bold",v,y,x.concat(["mathbf"])):p==="\\"||Gt[v][p].font==="main"?lt(p,"Main-Regular",v,y,x):lt(p,"AMS-Regular",v,y,x.concat(["amsrm"]))},Ft=function(p,v,y,x){return/[0-9]/.test(p.charAt(0))||q.contains(bt,p)?{fontName:"Main-Italic",fontClass:"mathit"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},or=function(p,v,y,x){return q.contains(bt,p)?{fontName:"Main-Italic",fontClass:"mathit"}:/[0-9]/.test(p.charAt(0))?{fontName:"Caligraphic-Regular",fontClass:"mathcal"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},_r=function(p,v,y,x){return Rt(p,"Math-BoldItalic",v).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},fr=function(p,v,y){var x=p.mode,O=p.text,z=["mord"],oe=x==="math"||x==="text"&&v.font,be=oe?v.font:v.fontFamily;if(O.charCodeAt(0)===55349){var Re=$r(O,x),it=Re[0],dt=Re[1];return lt(O,it,x,v,z.concat(dt))}else if(be){var It,Xt;if(be==="boldsymbol"||be==="mathnormal"){var ar=be==="boldsymbol"?_r(O,x,v,z):or(O,x,v,z);It=ar.fontName,Xt=[ar.fontClass]}else q.contains(bt,O)?(It="Main-Italic",Xt=["mathit"]):oe?(It=Ln[be].fontName,Xt=[be]):(It=cn(be,v.fontWeight,v.fontShape),Xt=[be,v.fontWeight,v.fontShape]);if(Rt(O,It,x).metrics)return lt(O,It,x,v,z.concat(Xt));if(qt.hasOwnProperty(O)&&It.substr(0,10)==="Typewriter"){for(var Sr=[],Vr=0;Vr<O.length;Vr++)Sr.push(lt(O[Vr],It,x,v,z.concat(Xt)));return qr(Sr)}}if(y==="mathord"){var En=Ft(O,x,v,z);return lt(O,En.fontName,x,v,z.concat([En.fontClass]))}else if(y==="textord"){var Tn=Gt[x][O]&&Gt[x][O].font;if(Tn==="ams"){var kn=cn("amsrm",v.fontWeight,v.fontShape);return lt(O,kn,x,v,z.concat("amsrm",v.fontWeight,v.fontShape))}else if(Tn==="main"||!Tn){var ii=cn("textrm",v.fontWeight,v.fontShape);return lt(O,ii,x,v,z.concat(v.fontWeight,v.fontShape))}else{var si=cn(Tn,v.fontWeight,v.fontShape);return lt(O,si,x,v,z.concat(si,v.fontWeight,v.fontShape))}}else throw new Error("unexpected type: "+y+" in makeOrd")},Qr=function(p,v){if(an(p.classes)!==an(v.classes)||p.skew!==v.skew||p.maxFontSize!==v.maxFontSize)return!1;for(var y in p.style)if(p.style.hasOwnProperty(y)&&p.style[y]!==v.style[y])return!1;for(var x in v.style)if(v.style.hasOwnProperty(x)&&p.style[x]!==v.style[x])return!1;return!0},on=function(p){for(var v=0;v<p.length-1;v++){var y=p[v],x=p[v+1];y instanceof Be&&x instanceof Be&&Qr(y,x)&&(y.text+=x.text,y.height=Math.max(y.height,x.height),y.depth=Math.max(y.depth,x.depth),y.italic=x.italic,p.splice(v+1,1),v--)}return p},fn=function(p){for(var v=0,y=0,x=0,O=0;O<p.children.length;O++){var z=p.children[O];z.height>v&&(v=z.height),z.depth>y&&(y=z.depth),z.maxFontSize>x&&(x=z.maxFontSize)}p.height=v,p.depth=y,p.maxFontSize=x},Mr=function(p,v,y,x){var O=new Ye(p,v,y,x);return fn(O),O},wr=function(p,v,y,x){return new Ye(p,v,y,x)},_n=function(p,v,y){var x=Mr([p],[],v);return x.height=Math.max(y||v.fontMetrics().defaultRuleThickness,v.minRuleThickness),x.style.borderBottomWidth=x.height+"em",x.maxFontSize=1,x},ln=function(p,v,y,x){var O=new Et(p,v,y,x);return fn(O),O},qr=function(p){var v=new Nr(p);return fn(v),v},Jr=function(p,v){return p instanceof Nr?Mr([],[p],v):p},sn=function(p){if(p.positionType==="individualShift"){for(var v=p.children,y=[v[0]],x=-v[0].shift-v[0].elem.depth,O=x,z=1;z<v.length;z++){var oe=-v[z].shift-O-v[z].elem.depth,be=oe-(v[z-1].elem.height+v[z-1].elem.depth);O=O+oe,y.push({type:"kern",size:be}),y.push(v[z])}return{children:y,depth:x}}var Re;if(p.positionType==="top"){for(var it=p.positionData,dt=0;dt<p.children.length;dt++){var It=p.children[dt];it-=It.type==="kern"?It.size:It.elem.height+It.elem.depth}Re=it}else if(p.positionType==="bottom")Re=-p.positionData;else{var Xt=p.children[0];if(Xt.type!=="elem")throw new Error('First child must have type "elem".');if(p.positionType==="shift")Re=-Xt.elem.depth-p.positionData;else if(p.positionType==="firstBaseline")Re=-Xt.elem.depth;else throw new Error("Invalid positionType "+p.positionType+".")}return{children:p.children,depth:Re}},en=function(p,v){for(var y=sn(p),x=y.children,O=y.depth,z=0,oe=0;oe<x.length;oe++){var be=x[oe];if(be.type==="elem"){var Re=be.elem;z=Math.max(z,Re.maxFontSize,Re.height)}}z+=2;var it=Mr(["pstrut"],[]);it.style.height=z+"em";for(var dt=[],It=O,Xt=O,ar=O,Sr=0;Sr<x.length;Sr++){var Vr=x[Sr];if(Vr.type==="kern")ar+=Vr.size;else{var En=Vr.elem,Tn=Vr.wrapperClasses||[],kn=Vr.wrapperStyle||{},ii=Mr(Tn,[it,En],void 0,kn);ii.style.top=-z-ar-En.depth+"em",Vr.marginLeft&&(ii.style.marginLeft=Vr.marginLeft),Vr.marginRight&&(ii.style.marginRight=Vr.marginRight),dt.push(ii),ar+=En.height+En.depth}It=Math.min(It,ar),Xt=Math.max(Xt,ar)}var si=Mr(["vlist"],dt);si.style.height=Xt+"em";var gi;if(It<0){var wi=Mr([],[]),ji=Mr(["vlist"],[wi]);ji.style.height=-It+"em";var vs=Mr(["vlist-s"],[new Be("\u200B")]);gi=[Mr(["vlist-r"],[si,vs]),Mr(["vlist-r"],[ji])]}else gi=[Mr(["vlist-r"],[si])];var rs=Mr(["vlist-t"],gi);return gi.length===2&&rs.classes.push("vlist-t2"),rs.height=Xt,rs.depth=-It,rs},Ur=function(p,v){var y=Mr(["mspace"],[],v),x=Qe(p,v);return y.style.marginRight=x+"em",y},cn=function(p,v,y){var x="";switch(p){case"amsrm":x="AMS";break;case"textrm":x="Main";break;case"textsf":x="SansSerif";break;case"texttt":x="Typewriter";break;default:x=p}var O;return v==="textbf"&&y==="textit"?O="BoldItalic":v==="textbf"?O="Bold":v==="textit"?O="Italic":O="Regular",x+"-"+O},Ln={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},xn={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},sr=function(p,v){var y=xn[p],x=y[0],O=y[1],z=y[2],oe=new gt(x),be=new et([oe],{width:O+"em",height:z+"em",style:"width:"+O+"em",viewBox:"0 0 "+1e3*O+" "+1e3*z,preserveAspectRatio:"xMinYMin"}),Re=wr(["overlay"],[be],v);return Re.height=z,Re.style.height=z+"em",Re.style.width=O+"em",Re},Ie={fontMap:Ln,makeSymbol:lt,mathsym:Nt,makeSpan:Mr,makeSvgSpan:wr,makeLineSpan:_n,makeAnchor:ln,makeFragment:qr,wrapFragment:Jr,makeVList:en,makeOrd:fr,makeGlue:Ur,staticSvg:sr,svgData:xn,tryCombineChars:on};function lr(K,p){var v=gr(K,p);if(!v)throw new Error("Expected node of type "+p+", but got "+(K?"node of type "+K.type:String(K)));return v}function gr(K,p){return K&&K.type===p?K:null}function yn(K,p){var v=Yn(K,p);if(!v)throw new Error('Expected node of type "atom" and family "'+p+'", but got '+(K?K.type==="atom"?"atom of family "+K.family:"node of type "+K.type:String(K)));return v}function Yn(K,p){return K&&K.type==="atom"&&K.family===p?K:null}function vn(K){var p=Rn(K);if(!p)throw new Error("Expected node of symbol group type, but got "+(K?"node of type "+K.type:String(K)));return p}function Rn(K){return K&&(K.type==="atom"||St.hasOwnProperty(K.type))?K:null}var Zr={number:3,unit:"mu"},ai={number:4,unit:"mu"},pi={number:5,unit:"mu"},In={mord:{mop:Zr,mbin:ai,mrel:pi,minner:Zr},mop:{mord:Zr,mop:Zr,mrel:pi,minner:Zr},mbin:{mord:ai,mop:ai,mopen:ai,minner:ai},mrel:{mord:pi,mop:pi,mopen:pi,minner:pi},mopen:{},mclose:{mop:Zr,mbin:ai,mrel:pi,minner:Zr},mpunct:{mord:Zr,mop:Zr,mrel:pi,mopen:Zr,mclose:Zr,mpunct:Zr,minner:Zr},minner:{mord:Zr,mop:Zr,mbin:ai,mrel:pi,mopen:Zr,mpunct:Zr,minner:Zr}},ni={mord:{mop:Zr},mop:{mord:Zr,mop:Zr},mbin:{},mrel:{},mopen:{},mclose:{mop:Zr},mpunct:{},minner:{mop:Zr}},qi={},Ti={},Zi={};function Ar(K){for(var p=K.type,v=K.names,y=K.props,x=K.handler,O=K.htmlBuilder,z=K.mathmlBuilder,oe={type:p,numArgs:y.numArgs,argTypes:y.argTypes,greediness:y.greediness===void 0?1:y.greediness,allowedInText:!!y.allowedInText,allowedInMath:y.allowedInMath===void 0?!0:y.allowedInMath,numOptionalArgs:y.numOptionalArgs||0,infix:!!y.infix,handler:x},be=0;be<v.length;++be)qi[v[be]]=oe;p&&(O&&(Ti[p]=O),z&&(Zi[p]=z))}function bn(K){var p=K.type,v=K.htmlBuilder,y=K.mathmlBuilder;Ar({type:p,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:v,mathmlBuilder:y})}var zn=function(p){var v=gr(p,"ordgroup");return v?v.body:[p]},Vn=Ie.makeSpan,Gi=["leftmost","mbin","mopen","mrel","mop","mpunct"],Vi=["rightmost","mrel","mclose","mpunct"],ei={display:C.DISPLAY,text:C.TEXT,script:C.SCRIPT,scriptscript:C.SCRIPTSCRIPT},Ci={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Wn=function(p,v,y,x){x===void 0&&(x=[null,null]);for(var O=[],z=0;z<p.length;z++){var oe=Sn(p[z],v);if(oe instanceof Nr){var be=oe.children;O.push.apply(O,be)}else O.push(oe)}if(!y)return O;var Re=v;if(p.length===1){var it=gr(p[0],"sizing")||gr(p[0],"styling");it&&(it.type==="sizing"?Re=v.havingSize(it.size):it.type==="styling"&&(Re=v.havingStyle(ei[it.style])))}var dt=Vn([x[0]||"leftmost"],[],v),It=Vn([x[1]||"rightmost"],[],v);return Wi(O,function(Xt,ar){var Sr=ar.classes[0],Vr=Xt.classes[0];Sr==="mbin"&&q.contains(Vi,Vr)?ar.classes[0]="mord":Vr==="mbin"&&q.contains(Gi,Sr)&&(Xt.classes[0]="mord")},{node:dt},It),Wi(O,function(Xt,ar){var Sr=Di(ar),Vr=Di(Xt),En=Sr&&Vr?Xt.hasClass("mtight")?ni[Sr][Vr]:In[Sr][Vr]:null;if(En)return Ie.makeGlue(En,Re)},{node:dt},It),O},Wi=function K(p,v,y,x){x&&p.push(x);for(var O=0;O<p.length;O++){var z=p[O],oe=ui(z);if(oe){K(oe.children,v,y);continue}if(z.classes[0]!=="mspace"){var be=v(z,y.node);be&&(y.insertAfter?y.insertAfter(be):(p.unshift(be),O++)),y.node=z,y.insertAfter=function(Re){return function(it){p.splice(Re+1,0,it),O++}}(O)}}x&&p.pop()},ui=function(p){return p instanceof Nr||p instanceof Et?p:null},Ji=function K(p,v){var y=ui(p);if(y){var x=y.children;if(x.length){if(v==="right")return K(x[x.length-1],"right");if(v==="left")return K(x[0],"left")}}return p},Di=function(p,v){return p?(v&&(p=Ji(p,v)),Ci[p.classes[0]]||null):null},bi=function(p,v){var y=["nulldelimiter"].concat(p.baseSizingClasses());return Vn(v.concat(y))},Sn=function(p,v,y){if(!p)return Vn();if(Ti[p.type]){var x=Ti[p.type](p,v);if(y&&v.size!==y.size){x=Vn(v.sizingClasses(y),[x],v);var O=v.sizeMultiplier/y.sizeMultiplier;x.height*=O,x.depth*=O}return x}else throw new me("Got group of unknown type: '"+p.type+"'")};function ls(K,p){var v=Vn(["base"],K,p),y=Vn(["strut"]);return y.style.height=v.height+v.depth+"em",y.style.verticalAlign=-v.depth+"em",v.children.unshift(y),v}function _s(K,p){var v=null;K.length===1&&K[0].type==="tag"&&(v=K[0].tag,K=K[0].body);for(var y=Wn(K,p,!0),x=[],O=[],z=0;z<y.length;z++)if(O.push(y[z]),y[z].hasClass("mbin")||y[z].hasClass("mrel")||y[z].hasClass("allowbreak")){for(var oe=!1;z<y.length-1&&y[z+1].hasClass("mspace")&&!y[z+1].hasClass("newline");)z++,O.push(y[z]),y[z].hasClass("nobreak")&&(oe=!0);oe||(x.push(ls(O,p)),O=[])}else y[z].hasClass("newline")&&(O.pop(),O.length>0&&(x.push(ls(O,p)),O=[]),x.push(y[z]));O.length>0&&x.push(ls(O,p));var be;v&&(be=ls(Wn(v,p,!0)),be.classes=["tag"],x.push(be));var Re=Vn(["katex-html"],x);if(Re.setAttribute("aria-hidden","true"),be){var it=be.children[0];it.style.height=Re.height+Re.depth+"em",it.style.verticalAlign=-Re.depth+"em"}return Re}function fs(K){return new Nr(K)}var Xn=function(){function K(v,y){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=v,this.attributes={},this.children=y||[]}var p=K.prototype;return p.setAttribute=function(y,x){this.attributes[y]=x},p.getAttribute=function(y){return this.attributes[y]},p.toNode=function(){var y=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var x in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,x)&&y.setAttribute(x,this.attributes[x]);for(var O=0;O<this.children.length;O++)y.appendChild(this.children[O].toNode());return y},p.toMarkup=function(){var y="<"+this.type;for(var x in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,x)&&(y+=" "+x+'="',y+=q.escape(this.attributes[x]),y+='"');y+=">";for(var O=0;O<this.children.length;O++)y+=this.children[O].toMarkup();return y+="</"+this.type+">",y},p.toText=function(){return this.children.map(function(y){return y.toText()}).join("")},K}(),xs=function(){function K(v){this.text=void 0,this.text=v}var p=K.prototype;return p.toNode=function(){return document.createTextNode(this.text)},p.toMarkup=function(){return q.escape(this.toText())},p.toText=function(){return this.text},K}(),ps=function(){function K(v){this.width=void 0,this.character=void 0,this.width=v,v>=.05555&&v<=.05556?this.character="\u200A":v>=.1666&&v<=.1667?this.character="\u2009":v>=.2222&&v<=.2223?this.character="\u2005":v>=.2777&&v<=.2778?this.character="\u2005\u200A":v>=-.05556&&v<=-.05555?this.character="\u200A\u2063":v>=-.1667&&v<=-.1666?this.character="\u2009\u2063":v>=-.2223&&v<=-.2222?this.character="\u205F\u2063":v>=-.2778&&v<=-.2777?this.character="\u2005\u2063":this.character=null}var p=K.prototype;return p.toNode=function(){if(this.character)return document.createTextNode(this.character);var y=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return y.setAttribute("width",this.width+"em"),y},p.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+this.width+'em"/>'},p.toText=function(){return this.character?this.character:" "},K}(),er={MathNode:Xn,TextNode:xs,SpaceNode:ps,newDocumentFragment:fs},ci=function(p,v,y){return Gt[v][p]&&Gt[v][p].replace&&p.charCodeAt(0)!==55349&&!(qt.hasOwnProperty(p)&&y&&(y.fontFamily&&y.fontFamily.substr(4,2)==="tt"||y.font&&y.font.substr(4,2)==="tt"))&&(p=Gt[v][p].replace),new er.TextNode(p)},ws=function(p){return p.length===1?p[0]:new er.MathNode("mrow",p)},Qi=function(p,v){if(v.fontFamily==="texttt")return"monospace";if(v.fontFamily==="textsf")return v.fontShape==="textit"&&v.fontWeight==="textbf"?"sans-serif-bold-italic":v.fontShape==="textit"?"sans-serif-italic":v.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(v.fontShape==="textit"&&v.fontWeight==="textbf")return"bold-italic";if(v.fontShape==="textit")return"italic";if(v.fontWeight==="textbf")return"bold";var y=v.font;if(!y||y==="mathnormal")return null;var x=p.mode;if(y==="mathit")return"italic";if(y==="boldsymbol")return"bold-italic";if(y==="mathbf")return"bold";if(y==="mathbb")return"double-struck";if(y==="mathfrak")return"fraktur";if(y==="mathscr"||y==="mathcal")return"script";if(y==="mathsf")return"sans-serif";if(y==="mathtt")return"monospace";var O=p.text;if(q.contains(["\\imath","\\jmath"],O))return null;Gt[x][O]&&Gt[x][O].replace&&(O=Gt[x][O].replace);var z=Ie.fontMap[y].fontName;return Fe(O,z,x)?Ie.fontMap[y].variant:null},_i=function(p,v,y){if(p.length===1){var x=Dn(p[0],v);return y&&x instanceof Xn&&x.type==="mo"&&(x.setAttribute("lspace","0em"),x.setAttribute("rspace","0em")),[x]}for(var O=[],z,oe=0;oe<p.length;oe++){var be=Dn(p[oe],v);if(be instanceof Xn&&z instanceof Xn){if(be.type==="mtext"&&z.type==="mtext"&&be.getAttribute("mathvariant")===z.getAttribute("mathvariant")){var Re;(Re=z.children).push.apply(Re,be.children);continue}else if(be.type==="mn"&&z.type==="mn"){var it;(it=z.children).push.apply(it,be.children);continue}else if(be.type==="mi"&&be.children.length===1&&z.type==="mn"){var dt=be.children[0];if(dt instanceof xs&&dt.text==="."){var It;(It=z.children).push.apply(It,be.children);continue}}else if(z.type==="mi"&&z.children.length===1){var Xt=z.children[0];if(Xt instanceof xs&&Xt.text==="\u0338"&&(be.type==="mo"||be.type==="mi"||be.type==="mn")){var ar=be.children[0];ar instanceof xs&&ar.text.length>0&&(ar.text=ar.text.slice(0,1)+"\u0338"+ar.text.slice(1),O.pop())}}}O.push(be),z=be}return O},oi=function(p,v,y){return ws(_i(p,v,y))},Dn=function(p,v){if(!p)return new er.MathNode("mrow");if(Zi[p.type]){var y=Zi[p.type](p,v);return y}else throw new me("Got group of unknown type: '"+p.type+"'")};function ti(K,p,v,y){var x=_i(K,v),O;x.length===1&&x[0]instanceof Xn&&q.contains(["mrow","mtable"],x[0].type)?O=x[0]:O=new er.MathNode("mrow",x);var z=new er.MathNode("annotation",[new er.TextNode(p)]);z.setAttribute("encoding","application/x-tex");var oe=new er.MathNode("semantics",[O,z]),be=new er.MathNode("math",[oe]);be.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var Re=y?"katex":"katex-mathml";return Ie.makeSpan([Re],[be])}var Mi=function(p){return new $n({style:p.displayMode?C.DISPLAY:C.TEXT,maxSize:p.maxSize,minRuleThickness:p.minRuleThickness})},Fi=function(p,v){if(v.displayMode){var y=["katex-display"];v.leqno&&y.push("leqno"),v.fleqn&&y.push("fleqn"),p=Ie.makeSpan(y,[p])}return p},mi=function(p,v,y){var x=Mi(y),O;if(y.output==="mathml")return ti(p,v,x,!0);if(y.output==="html"){var z=_s(p,x);O=Ie.makeSpan(["katex"],[z])}else{var oe=ti(p,v,x,!1),be=_s(p,x);O=Ie.makeSpan(["katex"],[oe,be])}return Fi(O,y)},Ni=function(p,v,y){var x=Mi(y),O=_s(p,x),z=Ie.makeSpan(["katex"],[O]);return Fi(z,y)},Os=mi,Nn={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB"},wn=function(p){var v=new er.MathNode("mo",[new er.TextNode(Nn[p.substr(1)])]);return v.setAttribute("stretchy","true"),v},hi={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},xi=function(p){return p.type==="ordgroup"?p.body.length:1},es=function(p,v){function y(){var be=4e5,Re=p.label.substr(1);if(q.contains(["widehat","widecheck","widetilde","utilde"],Re)){var it=p,dt=xi(it.base),It,Xt,ar;if(dt>5)Re==="widehat"||Re==="widecheck"?(It=420,be=2364,ar=.42,Xt=Re+"4"):(It=312,be=2340,ar=.34,Xt="tilde4");else{var Sr=[1,1,2,2,3,3][dt];Re==="widehat"||Re==="widecheck"?(be=[0,1062,2364,2364,2364][Sr],It=[0,239,300,360,420][Sr],ar=[0,.24,.3,.3,.36,.42][Sr],Xt=Re+Sr):(be=[0,600,1033,2339,2340][Sr],It=[0,260,286,306,312][Sr],ar=[0,.26,.286,.3,.306,.34][Sr],Xt="tilde"+Sr)}var Vr=new gt(Xt),En=new et([Vr],{width:"100%",height:ar+"em",viewBox:"0 0 "+be+" "+It,preserveAspectRatio:"none"});return{span:Ie.makeSvgSpan([],[En],v),minWidth:0,height:ar}}else{var Tn=[],kn=hi[Re],ii=kn[0],si=kn[1],gi=kn[2],wi=gi/1e3,ji=ii.length,vs,rs;if(ji===1){var li=kn[3];vs=["hide-tail"],rs=[li]}else if(ji===2)vs=["halfarrow-left","halfarrow-right"],rs=["xMinYMin","xMaxYMin"];else if(ji===3)vs=["brace-left","brace-center","brace-right"],rs=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+ji+" children.");for(var Ks=0;Ks<ji;Ks++){var ca=new gt(ii[Ks]),qs=new et([ca],{width:"400em",height:wi+"em",viewBox:"0 0 "+be+" "+gi,preserveAspectRatio:rs[Ks]+" slice"}),hs=Ie.makeSvgSpan([vs[Ks]],[qs],v);if(ji===1)return{span:hs,minWidth:si,height:wi};hs.style.height=wi+"em",Tn.push(hs)}return{span:Ie.makeSpan(["stretchy"],Tn,v),minWidth:si,height:wi}}}var x=y(),O=x.span,z=x.minWidth,oe=x.height;return O.height=oe,O.style.height=oe+"em",z>0&&(O.style.minWidth=z+"em"),O},Cr=function(p,v,y,x){var O,z=p.height+p.depth+2*y;if(/fbox|color/.test(v)){if(O=Ie.makeSpan(["stretchy",v],[],x),v==="fbox"){var oe=x.color&&x.getColor();oe&&(O.style.borderColor=oe)}}else{var be=[];/^[bx]cancel$/.test(v)&&be.push(new vt({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(v)&&be.push(new vt({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var Re=new et(be,{width:"100%",height:z+"em"});O=Ie.makeSvgSpan([],[Re],x)}return O.height=z,O.style.height=z+"em",O},Dr={encloseSpan:Cr,mathMLnode:wn,svgSpan:es},On=function(p,v){var y,x,O=gr(p,"supsub"),z;O?(x=lr(O.base,"accent"),y=x.base,O.base=y,z=hr(Sn(O,v)),O.base=x):(x=lr(p,"accent"),y=x.base);var oe=Sn(y,v.havingCrampedStyle()),be=x.isShifty&&q.isCharacterBox(y),Re=0;if(be){var it=q.getBaseElem(y),dt=Sn(it,v.havingCrampedStyle());Re=Ut(dt).skew}var It=Math.min(oe.height,v.fontMetrics().xHeight),Xt;if(x.isStretchy)Xt=Dr.svgSpan(x,v),Xt=Ie.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:oe},{type:"elem",elem:Xt,wrapperClasses:["svg-align"],wrapperStyle:Re>0?{width:"calc(100% - "+2*Re+"em)",marginLeft:2*Re+"em"}:void 0}]},v);else{var ar,Sr;x.label==="\\vec"?(ar=Ie.staticSvg("vec",v),Sr=Ie.svgData.vec[1]):(ar=Ie.makeOrd({mode:x.mode,text:x.label},v,"textord"),ar=Ut(ar),ar.italic=0,Sr=ar.width),Xt=Ie.makeSpan(["accent-body"],[ar]);var Vr=x.label==="\\textcircled";Vr&&(Xt.classes.push("accent-full"),It=oe.height);var En=Re;Vr||(En-=Sr/2),Xt.style.left=En+"em",x.label==="\\textcircled"&&(Xt.style.top=".2em"),Xt=Ie.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:oe},{type:"kern",size:-It},{type:"elem",elem:Xt}]},v)}var Tn=Ie.makeSpan(["mord","accent"],[Xt],v);return z?(z.children[0]=Tn,z.height=Math.max(Tn.height,z.height),z.classes[0]="mord",z):Tn},Li=function(p,v){var y=p.isStretchy?Dr.mathMLnode(p.label):new er.MathNode("mo",[ci(p.label,p.mode)]),x=new er.MathNode("mover",[Dn(p.base,v),y]);return x.setAttribute("accent","true"),x},jn=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(K){return"\\"+K}).join("|"));Ar({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(p,v){var y=v[0],x=!jn.test(p.funcName),O=!x||p.funcName==="\\widehat"||p.funcName==="\\widetilde"||p.funcName==="\\widecheck";return{type:"accent",mode:p.parser.mode,label:p.funcName,isStretchy:x,isShifty:O,base:y}},htmlBuilder:On,mathmlBuilder:Li}),Ar({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!1},handler:function(p,v){var y=v[0];return{type:"accent",mode:p.parser.mode,label:p.funcName,isStretchy:!1,isShifty:!0,base:y}},htmlBuilder:On,mathmlBuilder:Li}),Ar({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[0];return{type:"accentUnder",mode:y.mode,label:x,base:O}},htmlBuilder:function(p,v){var y=Sn(p.base,v),x=Dr.svgSpan(p,v),O=p.label==="\\utilde"?.12:0,z=Ie.makeVList({positionType:"bottom",positionData:x.height+O,children:[{type:"elem",elem:x,wrapperClasses:["svg-align"]},{type:"kern",size:O},{type:"elem",elem:y}]},v);return Ie.makeSpan(["mord","accentunder"],[z],v)},mathmlBuilder:function(p,v){var y=Dr.mathMLnode(p.label),x=new er.MathNode("munder",[Dn(p.base,v),y]);return x.setAttribute("accentunder","true"),x}});var Ss=function(p){var v=new er.MathNode("mpadded",p?[p]:[]);return v.setAttribute("width","+0.6em"),v.setAttribute("lspace","0.3em"),v};Ar({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],props:{numArgs:1,numOptionalArgs:1},handler:function(p,v,y){var x=p.parser,O=p.funcName;return{type:"xArrow",mode:x.mode,label:O,body:v[0],below:y[0]}},htmlBuilder:function(p,v){var y=v.style,x=v.havingStyle(y.sup()),O=Ie.wrapFragment(Sn(p.body,x,v),v);O.classes.push("x-arrow-pad");var z;p.below&&(x=v.havingStyle(y.sub()),z=Ie.wrapFragment(Sn(p.below,x,v),v),z.classes.push("x-arrow-pad"));var oe=Dr.svgSpan(p,v),be=-v.fontMetrics().axisHeight+.5*oe.height,Re=-v.fontMetrics().axisHeight-.5*oe.height-.111;(O.depth>.25||p.label==="\\xleftequilibrium")&&(Re-=O.depth);var it;if(z){var dt=-v.fontMetrics().axisHeight+z.height+.5*oe.height+.111;it=Ie.makeVList({positionType:"individualShift",children:[{type:"elem",elem:O,shift:Re},{type:"elem",elem:oe,shift:be},{type:"elem",elem:z,shift:dt}]},v)}else it=Ie.makeVList({positionType:"individualShift",children:[{type:"elem",elem:O,shift:Re},{type:"elem",elem:oe,shift:be}]},v);return it.children[0].children[0].children[1].classes.push("svg-align"),Ie.makeSpan(["mrel","x-arrow"],[it],v)},mathmlBuilder:function(p,v){var y=Dr.mathMLnode(p.label),x;if(p.body){var O=Ss(Dn(p.body,v));if(p.below){var z=Ss(Dn(p.below,v));x=new er.MathNode("munderover",[y,z,O])}else x=new er.MathNode("mover",[y,O])}else if(p.below){var oe=Ss(Dn(p.below,v));x=new er.MathNode("munder",[y,oe])}else x=Ss(),x=new er.MathNode("mover",[y,x]);return x}}),Ar({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){for(var y=p.parser,x=lr(v[0],"ordgroup"),O=x.body,z="",oe=0;oe<O.length;oe++){var be=lr(O[oe],"textord");z+=be.text}var Re=parseInt(z);if(isNaN(Re))throw new me("\\@char has non-numeric argument "+z);return{type:"textord",mode:y.mode,text:String.fromCharCode(Re)}}});var Ts=function(p,v){var y=Wn(p.body,v.withColor(p.color),!1);return Ie.makeFragment(y)},Ns=function(p,v){var y=_i(p.body,v.withColor(p.color)),x=new er.MathNode("mstyle",y);return x.setAttribute("mathcolor",p.color),x};Ar({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(p,v){var y=p.parser,x=lr(v[0],"color-token").color,O=v[1];return{type:"color",mode:y.mode,color:x,body:zn(O)}},htmlBuilder:Ts,mathmlBuilder:Ns}),Ar({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(p,v){var y=p.parser,x=p.breakOnTokenText,O=lr(v[0],"color-token").color;y.gullet.macros.set("\\current@color",O);var z=y.parseExpression(!0,x);return{type:"color",mode:y.mode,color:O,body:z}},htmlBuilder:Ts,mathmlBuilder:Ns}),Ar({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(p,v,y){var x=p.parser,O=p.funcName,z=y[0],oe=O==="\\cr",be=!1;return oe||(x.settings.displayMode&&x.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")?be=!1:be=!0),{type:"cr",mode:x.mode,newLine:be,newRow:oe,size:z&&lr(z,"size").value}},htmlBuilder:function(p,v){if(p.newRow)throw new me("\\cr valid only within a tabular/array environment");var y=Ie.makeSpan(["mspace"],[],v);return p.newLine&&(y.classes.push("newline"),p.size&&(y.style.marginTop=Qe(p.size,v)+"em")),y},mathmlBuilder:function(p,v){var y=new er.MathNode("mspace");return p.newLine&&(y.setAttribute("linebreak","newline"),p.size&&y.setAttribute("height",Qe(p.size,v)+"em")),y}});var $i=function(p,v,y){var x=Gt.math[p]&&Gt.math[p].replace,O=Fe(x||p,v,y);if(!O)throw new Error("Unsupported symbol "+p+" and font size "+v+".");return O},Qs=function(p,v,y,x){var O=y.havingBaseStyle(v),z=Ie.makeSpan(x.concat(O.sizingClasses(y)),[p],y),oe=O.sizeMultiplier/y.sizeMultiplier;return z.height*=oe,z.depth*=oe,z.maxFontSize=O.sizeMultiplier,z},la=function(p,v,y){var x=v.havingBaseStyle(y),O=(1-v.sizeMultiplier/x.sizeMultiplier)*v.fontMetrics().axisHeight;p.classes.push("delimcenter"),p.style.top=O+"em",p.height-=O,p.depth+=O},wa=function(p,v,y,x,O,z){var oe=Ie.makeSymbol(p,"Main-Regular",O,x),be=Qs(oe,v,x,z);return y&&la(be,x,v),be},za=function(p,v,y,x){return Ie.makeSymbol(p,"Size"+v+"-Regular",y,x)},Sa=function(p,v,y,x,O,z){var oe=za(p,v,O,x),be=Qs(Ie.makeSpan(["delimsizing","size"+v],[oe],x),C.TEXT,x,z);return y&&la(be,x,C.TEXT),be},ts=function(p,v,y){var x;v==="Size1-Regular"?x="delim-size1":x="delim-size4";var O=Ie.makeSpan(["delimsizinginner",x],[Ie.makeSpan([],[Ie.makeSymbol(p,v,y)])]);return{type:"elem",elem:O}},zi={type:"kern",size:-.005},Ki=function(p,v,y,x,O,z){var oe,be,Re,it;oe=Re=it=p,be=null;var dt="Size1-Regular";p==="\\uparrow"?Re=it="\u23D0":p==="\\Uparrow"?Re=it="\u2016":p==="\\downarrow"?oe=Re="\u23D0":p==="\\Downarrow"?oe=Re="\u2016":p==="\\updownarrow"?(oe="\\uparrow",Re="\u23D0",it="\\downarrow"):p==="\\Updownarrow"?(oe="\\Uparrow",Re="\u2016",it="\\Downarrow"):p==="["||p==="\\lbrack"?(oe="\u23A1",Re="\u23A2",it="\u23A3",dt="Size4-Regular"):p==="]"||p==="\\rbrack"?(oe="\u23A4",Re="\u23A5",it="\u23A6",dt="Size4-Regular"):p==="\\lfloor"||p==="\u230A"?(Re=oe="\u23A2",it="\u23A3",dt="Size4-Regular"):p==="\\lceil"||p==="\u2308"?(oe="\u23A1",Re=it="\u23A2",dt="Size4-Regular"):p==="\\rfloor"||p==="\u230B"?(Re=oe="\u23A5",it="\u23A6",dt="Size4-Regular"):p==="\\rceil"||p==="\u2309"?(oe="\u23A4",Re=it="\u23A5",dt="Size4-Regular"):p==="("||p==="\\lparen"?(oe="\u239B",Re="\u239C",it="\u239D",dt="Size4-Regular"):p===")"||p==="\\rparen"?(oe="\u239E",Re="\u239F",it="\u23A0",dt="Size4-Regular"):p==="\\{"||p==="\\lbrace"?(oe="\u23A7",be="\u23A8",it="\u23A9",Re="\u23AA",dt="Size4-Regular"):p==="\\}"||p==="\\rbrace"?(oe="\u23AB",be="\u23AC",it="\u23AD",Re="\u23AA",dt="Size4-Regular"):p==="\\lgroup"||p==="\u27EE"?(oe="\u23A7",it="\u23A9",Re="\u23AA",dt="Size4-Regular"):p==="\\rgroup"||p==="\u27EF"?(oe="\u23AB",it="\u23AD",Re="\u23AA",dt="Size4-Regular"):p==="\\lmoustache"||p==="\u23B0"?(oe="\u23A7",it="\u23AD",Re="\u23AA",dt="Size4-Regular"):(p==="\\rmoustache"||p==="\u23B1")&&(oe="\u23AB",it="\u23A9",Re="\u23AA",dt="Size4-Regular");var It=$i(oe,dt,O),Xt=It.height+It.depth,ar=$i(Re,dt,O),Sr=ar.height+ar.depth,Vr=$i(it,dt,O),En=Vr.height+Vr.depth,Tn=0,kn=1;if(be!==null){var ii=$i(be,dt,O);Tn=ii.height+ii.depth,kn=2}var si=Xt+En+Tn,gi=Math.max(0,Math.ceil((v-si)/(kn*Sr))),wi=si+gi*kn*Sr,ji=x.fontMetrics().axisHeight;y&&(ji*=x.sizeMultiplier);var vs=wi/2-ji,rs=(gi+1)*.005-Sr,li=[];if(li.push(ts(it,dt,O)),be===null)for(var Ks=0;Ks<gi;Ks++)li.push(zi),li.push(ts(Re,dt,O));else{for(var ca=0;ca<gi;ca++)li.push(zi),li.push(ts(Re,dt,O));li.push({type:"kern",size:rs}),li.push(ts(Re,dt,O)),li.push(zi),li.push(ts(be,dt,O));for(var qs=0;qs<gi;qs++)li.push(zi),li.push(ts(Re,dt,O))}li.push({type:"kern",size:rs}),li.push(ts(Re,dt,O)),li.push(zi),li.push(ts(oe,dt,O));var hs=x.havingBaseStyle(C.TEXT),Er=Ie.makeVList({positionType:"bottom",positionData:vs,children:li},hs);return Qs(Ie.makeSpan(["delimsizing","mult"],[Er],hs),C.TEXT,x,z)},ea=80,Cs=.08,Ds=function(p,v,y,x,O){var z=Rr(p,x,y),oe=new gt(p,z),be=new et([oe],{width:"400em",height:v+"em",viewBox:"0 0 400000 "+y,preserveAspectRatio:"xMinYMin slice"});return Ie.makeSvgSpan(["hide-tail"],[be],O)},rl=function(p,v){var y=v.havingBaseSizing(),x=Do("\\surd",p*y.sizeMultiplier,ta,y),O=y.sizeMultiplier,z=Math.max(0,v.minRuleThickness-v.fontMetrics().sqrtRuleThickness),oe,be=0,Re=0,it=0,dt;return x.type==="small"?(it=1e3+1e3*z+ea,p<1?O=1:p<1.4&&(O=.7),be=(1+z+Cs)/O,Re=(1+z)/O,oe=Ds("sqrtMain",be,it,z,v),oe.style.minWidth="0.853em",dt=.833/O):x.type==="large"?(it=(1e3+ea)*Ka[x.size],Re=(Ka[x.size]+z)/O,be=(Ka[x.size]+z+Cs)/O,oe=Ds("sqrtSize"+x.size,be,it,z,v),oe.style.minWidth="1.02em",dt=1/O):(be=p+z+Cs,Re=p+z,it=Math.floor(1e3*p+z)+ea,oe=Ds("sqrtTall",be,it,z,v),oe.style.minWidth="0.742em",dt=1.056),oe.height=Re,oe.style.height=be+"em",{span:oe,advanceWidth:dt,ruleWidth:(v.fontMetrics().sqrtRuleThickness+z)*O}},Hs=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],$s=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],no=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Ka=[0,1.2,1.8,2.4,3],nl=function(p,v,y,x,O){if(p==="<"||p==="\\lt"||p==="\u27E8"?p="\\langle":(p===">"||p==="\\gt"||p==="\u27E9")&&(p="\\rangle"),q.contains(Hs,p)||q.contains(no,p))return Sa(p,v,!1,y,x,O);if(q.contains($s,p))return Ki(p,Ka[v],!1,y,x,O);throw new me("Illegal delimiter: '"+p+"'")},Yi=[{type:"small",style:C.SCRIPTSCRIPT},{type:"small",style:C.SCRIPT},{type:"small",style:C.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ea=[{type:"small",style:C.SCRIPTSCRIPT},{type:"small",style:C.SCRIPT},{type:"small",style:C.TEXT},{type:"stack"}],ta=[{type:"small",style:C.SCRIPTSCRIPT},{type:"small",style:C.SCRIPT},{type:"small",style:C.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Gs=function(p){if(p.type==="small")return"Main-Regular";if(p.type==="large")return"Size"+p.size+"-Regular";if(p.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+p.type+"' here.")},Do=function(p,v,y,x){for(var O=Math.min(2,3-x.style.size),z=O;z<y.length&&y[z].type!=="stack";z++){var oe=$i(p,Gs(y[z]),"math"),be=oe.height+oe.depth;if(y[z].type==="small"){var Re=x.havingBaseStyle(y[z].style);be*=Re.sizeMultiplier}if(be>v)return y[z]}return y[y.length-1]},Jn=function(p,v,y,x,O,z){p==="<"||p==="\\lt"||p==="\u27E8"?p="\\langle":(p===">"||p==="\\gt"||p==="\u27E9")&&(p="\\rangle");var oe;q.contains(no,p)?oe=Yi:q.contains(Hs,p)?oe=ta:oe=Ea;var be=Do(p,v,oe,x);return be.type==="small"?wa(p,be.style,y,x,O,z):be.type==="large"?Sa(p,be.size,y,x,O,z):Ki(p,v,y,x,O,z)},Ua=function(p,v,y,x,O,z){var oe=x.fontMetrics().axisHeight*x.sizeMultiplier,be=901,Re=5/x.fontMetrics().ptPerEm,it=Math.max(v-oe,y+oe),dt=Math.max(it/500*be,2*it-Re);return Jn(p,dt,!0,x,O,z)},ms={sqrtImage:rl,sizedDelim:nl,customSizedDelim:Jn,leftRightDelim:Ua},ma={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},il=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Ha(K,p){var v=Rn(K);if(v&&q.contains(il,v.text))return v;throw new me("Invalid delimiter: '"+(v?v.text:JSON.stringify(K))+"' after '"+p.funcName+"'",K)}Ar({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1},handler:function(p,v){var y=Ha(v[0],p);return{type:"delimsizing",mode:p.parser.mode,size:ma[p.funcName].size,mclass:ma[p.funcName].mclass,delim:y.text}},htmlBuilder:function(p,v){return p.delim==="."?Ie.makeSpan([p.mclass]):ms.sizedDelim(p.delim,p.size,v,p.mode,[p.mclass])},mathmlBuilder:function(p){var v=[];p.delim!=="."&&v.push(ci(p.delim,p.mode));var y=new er.MathNode("mo",v);return p.mclass==="mopen"||p.mclass==="mclose"?y.setAttribute("fence","true"):y.setAttribute("fence","false"),y}});function ka(K){if(!K.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ar({type:"leftright-right",names:["\\right"],props:{numArgs:1},handler:function(p,v){var y=p.parser.gullet.macros.get("\\current@color");if(y&&typeof y!="string")throw new me("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:p.parser.mode,delim:Ha(v[0],p).text,color:y}}}),Ar({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(p,v){var y=Ha(v[0],p),x=p.parser;++x.leftrightDepth;var O=x.parseExpression(!1);--x.leftrightDepth,x.expect("\\right",!1);var z=lr(x.parseFunction(),"leftright-right");return{type:"leftright",mode:x.mode,body:O,left:y.text,right:z.delim,rightColor:z.color}},htmlBuilder:function(p,v){ka(p);for(var y=Wn(p.body,v,!0,["mopen","mclose"]),x=0,O=0,z=!1,oe=0;oe<y.length;oe++)y[oe].isMiddle?z=!0:(x=Math.max(y[oe].height,x),O=Math.max(y[oe].depth,O));x*=v.sizeMultiplier,O*=v.sizeMultiplier;var be;if(p.left==="."?be=bi(v,["mopen"]):be=ms.leftRightDelim(p.left,x,O,v,p.mode,["mopen"]),y.unshift(be),z)for(var Re=1;Re<y.length;Re++){var it=y[Re],dt=it.isMiddle;dt&&(y[Re]=ms.leftRightDelim(dt.delim,x,O,dt.options,p.mode,[]))}var It;if(p.right===".")It=bi(v,["mclose"]);else{var Xt=p.rightColor?v.withColor(p.rightColor):v;It=ms.leftRightDelim(p.right,x,O,Xt,p.mode,["mclose"])}return y.push(It),Ie.makeSpan(["minner"],y,v)},mathmlBuilder:function(p,v){ka(p);var y=_i(p.body,v);if(p.left!=="."){var x=new er.MathNode("mo",[ci(p.left,p.mode)]);x.setAttribute("fence","true"),y.unshift(x)}if(p.right!=="."){var O=new er.MathNode("mo",[ci(p.right,p.mode)]);O.setAttribute("fence","true"),p.rightColor&&O.setAttribute("mathcolor",p.rightColor),y.push(O)}return ws(y)}}),Ar({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(p,v){var y=Ha(v[0],p);if(!p.parser.leftrightDepth)throw new me("\\middle without preceding \\left",y);return{type:"middle",mode:p.parser.mode,delim:y.text}},htmlBuilder:function(p,v){var y;if(p.delim===".")y=bi(v,[]);else{y=ms.sizedDelim(p.delim,1,v,p.mode,[]);var x={delim:p.delim,options:v};y.isMiddle=x}return y},mathmlBuilder:function(p,v){var y=p.delim==="\\vert"||p.delim==="|"?ci("|","text"):ci(p.delim,p.mode),x=new er.MathNode("mo",[y]);return x.setAttribute("fence","true"),x.setAttribute("lspace","0.05em"),x.setAttribute("rspace","0.05em"),x}});var Ga=function(p,v){var y=Ie.wrapFragment(Sn(p.body,v),v),x=p.label.substr(1),O=v.sizeMultiplier,z,oe=0,be=q.isCharacterBox(p.body);if(x==="sout")z=Ie.makeSpan(["stretchy","sout"]),z.height=v.fontMetrics().defaultRuleThickness/O,oe=-.5*v.fontMetrics().xHeight;else{/cancel/.test(x)?be||y.classes.push("cancel-pad"):y.classes.push("boxpad");var Re=0,it=0;/box/.test(x)?(it=Math.max(v.fontMetrics().fboxrule,v.minRuleThickness),Re=v.fontMetrics().fboxsep+(x==="colorbox"?0:it)):Re=be?.2:0,z=Dr.encloseSpan(y,x,Re,v),/fbox|boxed|fcolorbox/.test(x)&&(z.style.borderStyle="solid",z.style.borderWidth=it+"em"),oe=y.depth+Re,p.backgroundColor&&(z.style.backgroundColor=p.backgroundColor,p.borderColor&&(z.style.borderColor=p.borderColor))}var dt;return p.backgroundColor?dt=Ie.makeVList({positionType:"individualShift",children:[{type:"elem",elem:z,shift:oe},{type:"elem",elem:y,shift:0}]},v):dt=Ie.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:0},{type:"elem",elem:z,shift:oe,wrapperClasses:/cancel/.test(x)?["svg-align"]:[]}]},v),/cancel/.test(x)&&(dt.height=y.height,dt.depth=y.depth),/cancel/.test(x)&&!be?Ie.makeSpan(["mord","cancel-lap"],[dt],v):Ie.makeSpan(["mord"],[dt],v)},ra=function(p,v){var y=0,x=new er.MathNode(p.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Dn(p.body,v)]);switch(p.label){case"\\cancel":x.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":x.setAttribute("notation","downdiagonalstrike");break;case"\\sout":x.setAttribute("notation","horizontalstrike");break;case"\\fbox":x.setAttribute("notation","box");break;case"\\fcolorbox":case"\\colorbox":if(y=v.fontMetrics().fboxsep*v.fontMetrics().ptPerEm,x.setAttribute("width","+"+2*y+"pt"),x.setAttribute("height","+"+2*y+"pt"),x.setAttribute("lspace",y+"pt"),x.setAttribute("voffset",y+"pt"),p.label==="\\fcolorbox"){var O=Math.max(v.fontMetrics().fboxrule,v.minRuleThickness);x.setAttribute("style","border: "+O+"em solid "+String(p.borderColor))}break;case"\\xcancel":x.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return p.backgroundColor&&x.setAttribute("mathbackground",p.backgroundColor),x};Ar({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(p,v,y){var x=p.parser,O=p.funcName,z=lr(v[0],"color-token").color,oe=v[1];return{type:"enclose",mode:x.mode,label:O,backgroundColor:z,body:oe}},htmlBuilder:Ga,mathmlBuilder:ra}),Ar({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(p,v,y){var x=p.parser,O=p.funcName,z=lr(v[0],"color-token").color,oe=lr(v[1],"color-token").color,be=v[2];return{type:"enclose",mode:x.mode,label:O,backgroundColor:oe,borderColor:z,body:be}},htmlBuilder:Ga,mathmlBuilder:ra}),Ar({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(p,v){var y=p.parser;return{type:"enclose",mode:y.mode,label:"\\fbox",body:v[0]}}}),Ar({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(p,v,y){var x=p.parser,O=p.funcName,z=v[0];return{type:"enclose",mode:x.mode,label:O,body:z}},htmlBuilder:Ga,mathmlBuilder:ra});var Va={};function zs(K){for(var p=K.type,v=K.names,y=K.props,x=K.handler,O=K.htmlBuilder,z=K.mathmlBuilder,oe={type:p,numArgs:y.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:x},be=0;be<v.length;++be)Va[v[be]]=oe;O&&(Ti[p]=O),z&&(Zi[p]=z)}function io(K){var p=[];K.consumeSpaces();for(var v=K.fetch().text;v==="\\hline"||v==="\\hdashline";)K.consume(),p.push(v==="\\hdashline"),K.consumeSpaces(),v=K.fetch().text;return p}function Kn(K,p,v){var y=p.hskipBeforeAndAfter,x=p.addJot,O=p.cols,z=p.arraystretch,oe=p.colSeparationType;if(K.gullet.beginGroup(),K.gullet.macros.set("\\\\","\\cr"),!z){var be=K.gullet.expandMacroAsText("\\arraystretch");if(be==null)z=1;else if(z=parseFloat(be),!z||z<0)throw new me("Invalid \\arraystretch: "+be)}K.gullet.beginGroup();var Re=[],it=[Re],dt=[],It=[];for(It.push(io(K));;){var Xt=K.parseExpression(!1,"\\cr");K.gullet.endGroup(),K.gullet.beginGroup(),Xt={type:"ordgroup",mode:K.mode,body:Xt},v&&(Xt={type:"styling",mode:K.mode,style:v,body:[Xt]}),Re.push(Xt);var ar=K.fetch().text;if(ar==="&")K.consume();else if(ar==="\\end"){Re.length===1&&Xt.type==="styling"&&Xt.body[0].body.length===0&&it.pop(),It.length<it.length+1&&It.push([]);break}else if(ar==="\\cr"){var Sr=lr(K.parseFunction(),"cr");dt.push(Sr.size),It.push(io(K)),Re=[],it.push(Re)}else throw new me("Expected & or \\\\ or \\cr or \\end",K.nextToken)}return K.gullet.endGroup(),K.gullet.endGroup(),{type:"array",mode:K.mode,addJot:x,arraystretch:z,body:it,cols:O,rowGaps:dt,hskipBeforeAndAfter:y,hLinesBeforeRow:It,colSeparationType:oe}}function qn(K){return K.substr(0,1)==="d"?"display":"text"}var Un=function(p,v){var y,x,O=p.body.length,z=p.hLinesBeforeRow,oe=0,be=new Array(O),Re=[],it=Math.max(v.fontMetrics().arrayRuleWidth,v.minRuleThickness),dt=1/v.fontMetrics().ptPerEm,It=5*dt;if(p.colSeparationType&&p.colSeparationType==="small"){var Xt=v.havingStyle(C.SCRIPT).sizeMultiplier;It=.2778*(Xt/v.sizeMultiplier)}var ar=12*dt,Sr=3*dt,Vr=p.arraystretch*ar,En=.7*Vr,Tn=.3*Vr,kn=0;function ii(Go){for(var La=0;La<Go.length;++La)La>0&&(kn+=.25),Re.push({pos:kn,isDashed:Go[La]})}for(ii(z[0]),y=0;y<p.body.length;++y){var si=p.body[y],gi=En,wi=Tn;oe<si.length&&(oe=si.length);var ji=new Array(si.length);for(x=0;x<si.length;++x){var vs=Sn(si[x],v);wi<vs.depth&&(wi=vs.depth),gi<vs.height&&(gi=vs.height),ji[x]=vs}var rs=p.rowGaps[y],li=0;rs&&(li=Qe(rs,v),li>0&&(li+=Tn,wi<li&&(wi=li),li=0)),p.addJot&&(wi+=Sr),ji.height=gi,ji.depth=wi,kn+=gi,ji.pos=kn,kn+=wi+li,be[y]=ji,ii(z[y+1])}var Ks=kn/2+v.fontMetrics().axisHeight,ca=p.cols||[],qs=[],hs,Er;for(x=0,Er=0;x<oe||Er<ca.length;++x,++Er){for(var di=ca[Er]||{},ia=!0;di.type==="separator";){if(ia||(hs=Ie.makeSpan(["arraycolsep"],[]),hs.style.width=v.fontMetrics().doubleRuleSep+"em",qs.push(hs)),di.separator==="|"||di.separator===":"){var A0=di.separator==="|"?"solid":"dashed",ns=Ie.makeSpan(["vertical-separator"],[],v);ns.style.height=kn+"em",ns.style.borderRightWidth=it+"em",ns.style.borderRightStyle=A0,ns.style.margin="0 -"+it/2+"em",ns.style.verticalAlign=-(kn-Ks)+"em",qs.push(ns)}else throw new me("Invalid separator type: "+di.separator);Er++,di=ca[Er]||{},ia=!1}if(!(x>=oe)){var ha=void 0;(x>0||p.hskipBeforeAndAfter)&&(ha=q.deflt(di.pregap,It),ha!==0&&(hs=Ie.makeSpan(["arraycolsep"],[]),hs.style.width=ha+"em",qs.push(hs)));var Ya=[];for(y=0;y<O;++y){var _l=be[y],xl=_l[x];if(xl){var Zs=_l.pos-Ks;xl.depth=_l.depth,xl.height=_l.height,Ya.push({type:"elem",elem:xl,shift:Zs})}}Ya=Ie.makeVList({positionType:"individualShift",children:Ya},v),Ya=Ie.makeSpan(["col-align-"+(di.align||"c")],[Ya]),qs.push(Ya),(x<oe-1||p.hskipBeforeAndAfter)&&(ha=q.deflt(di.postgap,It),ha!==0&&(hs=Ie.makeSpan(["arraycolsep"],[]),hs.style.width=ha+"em",qs.push(hs)))}}if(be=Ie.makeSpan(["mtable"],qs),Re.length>0){for(var Ys=Ie.makeLineSpan("hline",v,it),au=Ie.makeLineSpan("hdashline",v,it),da=[{type:"elem",elem:be,shift:0}];Re.length>0;){var Uo=Re.pop(),Ho=Uo.pos-Ks;Uo.isDashed?da.push({type:"elem",elem:au,shift:Ho}):da.push({type:"elem",elem:Ys,shift:Ho})}be=Ie.makeVList({positionType:"individualShift",children:da},v)}return Ie.makeSpan(["mord"],[be],v)},Ui={c:"center ",l:"left ",r:"right "},Ii=function(p,v){var y=new er.MathNode("mtable",p.body.map(function(kn){return new er.MathNode("mtr",kn.map(function(ii){return new er.MathNode("mtd",[Dn(ii,v)])}))})),x=p.arraystretch===.5?.1:.16+p.arraystretch-1+(p.addJot?.09:0);y.setAttribute("rowspacing",x+"em");var O="",z="";if(p.cols){var oe=p.cols,be="",Re=!1,it=0,dt=oe.length;oe[0].type==="separator"&&(O+="top ",it=1),oe[oe.length-1].type==="separator"&&(O+="bottom ",dt-=1);for(var It=it;It<dt;It++)oe[It].type==="align"?(z+=Ui[oe[It].align],Re&&(be+="none "),Re=!0):oe[It].type==="separator"&&Re&&(be+=oe[It].separator==="|"?"solid ":"dashed ",Re=!1);y.setAttribute("columnalign",z.trim()),/[sd]/.test(be)&&y.setAttribute("columnlines",be.trim())}if(p.colSeparationType==="align"){for(var Xt=p.cols||[],ar="",Sr=1;Sr<Xt.length;Sr++)ar+=Sr%2?"0em ":"1em ";y.setAttribute("columnspacing",ar.trim())}else p.colSeparationType==="alignat"?y.setAttribute("columnspacing","0em"):p.colSeparationType==="small"?y.setAttribute("columnspacing","0.2778em"):y.setAttribute("columnspacing","1em");var Vr="",En=p.hLinesBeforeRow;O+=En[0].length>0?"left ":"",O+=En[En.length-1].length>0?"right ":"";for(var Tn=1;Tn<En.length-1;Tn++)Vr+=En[Tn].length===0?"none ":En[Tn][0]?"dashed ":"solid ";return/[sd]/.test(Vr)&&y.setAttribute("rowlines",Vr.trim()),O!==""&&(y=new er.MathNode("menclose",[y]),y.setAttribute("notation",O.trim())),p.arraystretch&&p.arraystretch<1&&(y=new er.MathNode("mstyle",[y]),y.setAttribute("scriptlevel","1")),y},Aa=function(p,v){var y=[],x=Kn(p.parser,{cols:y,addJot:!0},"display"),O,z=0,oe={type:"ordgroup",mode:p.mode,body:[]},be=gr(v[0],"ordgroup");if(be){for(var Re="",it=0;it<be.body.length;it++){var dt=lr(be.body[it],"textord");Re+=dt.text}O=Number(Re),z=O*2}var It=!z;x.body.forEach(function(Vr){for(var En=1;En<Vr.length;En+=2){var Tn=lr(Vr[En],"styling"),kn=lr(Tn.body[0],"ordgroup");kn.body.unshift(oe)}if(It)z<Vr.length&&(z=Vr.length);else{var ii=Vr.length/2;if(O<ii)throw new me("Too many math in a row: "+("expected "+O+", but got "+ii),Vr[0])}});for(var Xt=0;Xt<z;++Xt){var ar="r",Sr=0;Xt%2===1?ar="l":Xt>0&&It&&(Sr=1),y[Xt]={type:"align",align:ar,pregap:Sr,postgap:0}}return x.colSeparationType=It?"align":"alignat",x};zs({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(p,v){var y=Rn(v[0]),x=y?[v[0]]:lr(v[0],"ordgroup").body,O=x.map(function(oe){var be=vn(oe),Re=be.text;if("lcr".indexOf(Re)!==-1)return{type:"align",align:Re};if(Re==="|")return{type:"separator",separator:"|"};if(Re===":")return{type:"separator",separator:":"};throw new me("Unknown column alignment: "+Re,oe)}),z={cols:O,hskipBeforeAndAfter:!0};return Kn(p.parser,z,qn(p.envName))},htmlBuilder:Un,mathmlBuilder:Ii}),zs({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"],props:{numArgs:0},handler:function(p){var v={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[p.envName],y={hskipBeforeAndAfter:!1},x=Kn(p.parser,y,qn(p.envName));return v?{type:"leftright",mode:p.mode,body:[x],left:v[0],right:v[1],rightColor:void 0}:x},htmlBuilder:Un,mathmlBuilder:Ii}),zs({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(p){var v={arraystretch:.5},y=Kn(p.parser,v,"script");return y.colSeparationType="small",y},htmlBuilder:Un,mathmlBuilder:Ii}),zs({type:"array",names:["subarray"],props:{numArgs:1},handler:function(p,v){var y=Rn(v[0]),x=y?[v[0]]:lr(v[0],"ordgroup").body,O=x.map(function(oe){var be=vn(oe),Re=be.text;if("lc".indexOf(Re)!==-1)return{type:"align",align:Re};throw new me("Unknown column alignment: "+Re,oe)});if(O.length>1)throw new me("{subarray} can contain only one column");var z={cols:O,hskipBeforeAndAfter:!1,arraystretch:.5};if(z=Kn(p.parser,z,"script"),z.body[0].length>1)throw new me("{subarray} can contain only one column");return z},htmlBuilder:Un,mathmlBuilder:Ii}),zs({type:"array",names:["cases","dcases"],props:{numArgs:0},handler:function(p){var v={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},y=Kn(p.parser,v,qn(p.envName));return{type:"leftright",mode:p.mode,body:[y],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:Un,mathmlBuilder:Ii}),zs({type:"array",names:["aligned"],props:{numArgs:0},handler:Aa,htmlBuilder:Un,mathmlBuilder:Ii}),zs({type:"array",names:["gathered"],props:{numArgs:0},handler:function(p){var v={cols:[{type:"align",align:"c"}],addJot:!0};return Kn(p.parser,v,"display")},htmlBuilder:Un,mathmlBuilder:Ii}),zs({type:"array",names:["alignedat"],props:{numArgs:1},handler:Aa,htmlBuilder:Un,mathmlBuilder:Ii}),Ar({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(p,v){throw new me(p.funcName+" valid only within array environment")}});var Ta=Va,Mo=Ta;Ar({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[0];if(O.type!=="ordgroup")throw new me("Invalid environment name",O);for(var z="",oe=0;oe<O.body.length;++oe)z+=lr(O.body[oe],"textord").text;if(x==="\\begin"){if(!Mo.hasOwnProperty(z))throw new me("No such environment: "+z,O);var be=Mo[z],Re=y.parseArguments("\\begin{"+z+"}",be),it=Re.args,dt=Re.optArgs,It={mode:y.mode,envName:z,parser:y},Xt=be.handler(It,it,dt);y.expect("\\end",!1);var ar=y.nextToken,Sr=lr(y.parseFunction(),"environment");if(Sr.name!==z)throw new me("Mismatch: \\begin{"+z+"} matched by \\end{"+Sr.name+"}",ar);return Xt}return{type:"environment",mode:y.mode,name:z,nameGroup:O}}});var Lo=Ie.makeSpan;function Ca(K,p){var v=Wn(K.body,p,!0);return Lo([K.mclass],v,p)}function na(K,p){var v,y=_i(K.body,p);return K.mclass==="minner"?er.newDocumentFragment(y):(K.mclass==="mord"?K.isCharacterBox?(v=y[0],v.type="mi"):v=new er.MathNode("mi",y):(K.isCharacterBox?(v=y[0],v.type="mo"):v=new er.MathNode("mo",y),K.mclass==="mbin"?(v.attributes.lspace="0.22em",v.attributes.rspace="0.22em"):K.mclass==="mpunct"?(v.attributes.lspace="0em",v.attributes.rspace="0.17em"):(K.mclass==="mopen"||K.mclass==="mclose")&&(v.attributes.lspace="0em",v.attributes.rspace="0em")),v)}Ar({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[0];return{type:"mclass",mode:y.mode,mclass:"m"+x.substr(5),body:zn(O),isCharacterBox:q.isCharacterBox(O)}},htmlBuilder:Ca,mathmlBuilder:na});var Wt=function(p){var v=p.type==="ordgroup"&&p.body.length?p.body[0]:p;return v.type==="atom"&&(v.family==="bin"||v.family==="rel")?"m"+v.family:"mord"};Ar({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(p,v){var y=p.parser;return{type:"mclass",mode:y.mode,mclass:Wt(v[0]),body:[v[1]],isCharacterBox:q.isCharacterBox(v[1])}}}),Ar({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[1],z=v[0],oe;x!=="\\stackrel"?oe=Wt(O):oe="mrel";var be={type:"op",mode:O.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:x!=="\\stackrel",body:zn(O)},Re={type:"supsub",mode:z.mode,base:be,sup:x==="\\underset"?null:z,sub:x==="\\underset"?z:null};return{type:"mclass",mode:y.mode,mclass:oe,body:[Re],isCharacterBox:q.isCharacterBox(Re)}},htmlBuilder:Ca,mathmlBuilder:na});var Wa=function(p,v){var y=p.font,x=v.withFont(y);return Sn(p.body,x)},sl=function(p,v){var y=p.font,x=v.withFont(y);return Dn(p.body,x)},zl={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Ar({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,greediness:2},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[0],z=x;return z in zl&&(z=zl[z]),{type:"font",mode:y.mode,font:z.slice(1),body:O}},htmlBuilder:Wa,mathmlBuilder:sl}),Ar({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(p,v){var y=p.parser,x=v[0],O=q.isCharacterBox(x);return{type:"mclass",mode:y.mode,mclass:Wt(x),body:[{type:"font",mode:y.mode,font:"boldsymbol",body:x}],isCharacterBox:O}}}),Ar({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(p,v){var y=p.parser,x=p.funcName,O=p.breakOnTokenText,z=y.mode,oe=y.parseExpression(!0,O),be="math"+x.slice(1);return{type:"font",mode:z,font:be,body:{type:"ordgroup",mode:y.mode,body:oe}}},htmlBuilder:Wa,mathmlBuilder:sl});var Kl=function(p,v){var y=v;return p==="display"?y=y.id>=C.SCRIPT.id?y.text():C.DISPLAY:p==="text"&&y.size===C.DISPLAY.size?y=C.TEXT:p==="script"?y=C.SCRIPT:p==="scriptscript"&&(y=C.SCRIPTSCRIPT),y},al=function(p,v){var y=Kl(p.size,v.style),x=y.fracNum(),O=y.fracDen(),z;z=v.havingStyle(x);var oe=Sn(p.numer,z,v);if(p.continued){var be=8.5/v.fontMetrics().ptPerEm,Re=3.5/v.fontMetrics().ptPerEm;oe.height=oe.height<be?be:oe.height,oe.depth=oe.depth<Re?Re:oe.depth}z=v.havingStyle(O);var it=Sn(p.denom,z,v),dt,It,Xt;p.hasBarLine?(p.barSize?(It=Qe(p.barSize,v),dt=Ie.makeLineSpan("frac-line",v,It)):dt=Ie.makeLineSpan("frac-line",v),It=dt.height,Xt=dt.height):(dt=null,It=0,Xt=v.fontMetrics().defaultRuleThickness);var ar,Sr,Vr;y.size===C.DISPLAY.size||p.size==="display"?(ar=v.fontMetrics().num1,It>0?Sr=3*Xt:Sr=7*Xt,Vr=v.fontMetrics().denom1):(It>0?(ar=v.fontMetrics().num2,Sr=Xt):(ar=v.fontMetrics().num3,Sr=3*Xt),Vr=v.fontMetrics().denom2);var En;if(dt){var kn=v.fontMetrics().axisHeight;ar-oe.depth-(kn+.5*It)<Sr&&(ar+=Sr-(ar-oe.depth-(kn+.5*It))),kn-.5*It-(it.height-Vr)<Sr&&(Vr+=Sr-(kn-.5*It-(it.height-Vr)));var ii=-(kn-.5*It);En=Ie.makeVList({positionType:"individualShift",children:[{type:"elem",elem:it,shift:Vr},{type:"elem",elem:dt,shift:ii},{type:"elem",elem:oe,shift:-ar}]},v)}else{var Tn=ar-oe.depth-(it.height-Vr);Tn<Sr&&(ar+=.5*(Sr-Tn),Vr+=.5*(Sr-Tn)),En=Ie.makeVList({positionType:"individualShift",children:[{type:"elem",elem:it,shift:Vr},{type:"elem",elem:oe,shift:-ar}]},v)}z=v.havingStyle(y),En.height*=z.sizeMultiplier/v.sizeMultiplier,En.depth*=z.sizeMultiplier/v.sizeMultiplier;var si;y.size===C.DISPLAY.size?si=v.fontMetrics().delim1:si=v.fontMetrics().delim2;var gi,wi;return p.leftDelim==null?gi=bi(v,["mopen"]):gi=ms.customSizedDelim(p.leftDelim,si,!0,v.havingStyle(y),p.mode,["mopen"]),p.continued?wi=Ie.makeSpan([]):p.rightDelim==null?wi=bi(v,["mclose"]):wi=ms.customSizedDelim(p.rightDelim,si,!0,v.havingStyle(y),p.mode,["mclose"]),Ie.makeSpan(["mord"].concat(z.sizingClasses(v)),[gi,Ie.makeSpan(["mfrac"],[En]),wi],v)},ol=function(p,v){var y=new er.MathNode("mfrac",[Dn(p.numer,v),Dn(p.denom,v)]);if(!p.hasBarLine)y.setAttribute("linethickness","0px");else if(p.barSize){var x=Qe(p.barSize,v);y.setAttribute("linethickness",x+"em")}var O=Kl(p.size,v.style);if(O.size!==v.style.size){y=new er.MathNode("mstyle",[y]);var z=O.size===C.DISPLAY.size?"true":"false";y.setAttribute("displaystyle",z),y.setAttribute("scriptlevel","0")}if(p.leftDelim!=null||p.rightDelim!=null){var oe=[];if(p.leftDelim!=null){var be=new er.MathNode("mo",[new er.TextNode(p.leftDelim.replace("\\",""))]);be.setAttribute("fence","true"),oe.push(be)}if(oe.push(y),p.rightDelim!=null){var Re=new er.MathNode("mo",[new er.TextNode(p.rightDelim.replace("\\",""))]);Re.setAttribute("fence","true"),oe.push(Re)}return ws(oe)}return y};Ar({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,greediness:2},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[0],z=v[1],oe,be=null,Re=null,it="auto";switch(x){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":oe=!0;break;case"\\\\atopfrac":oe=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":oe=!1,be="(",Re=")";break;case"\\\\bracefrac":oe=!1,be="\\{",Re="\\}";break;case"\\\\brackfrac":oe=!1,be="[",Re="]";break;default:throw new Error("Unrecognized genfrac command")}switch(x){case"\\cfrac":case"\\dfrac":case"\\dbinom":it="display";break;case"\\tfrac":case"\\tbinom":it="text";break}return{type:"genfrac",mode:y.mode,continued:x==="\\cfrac",numer:O,denom:z,hasBarLine:oe,leftDelim:be,rightDelim:Re,size:it,barSize:null}},htmlBuilder:al,mathmlBuilder:ol}),Ar({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(p){var v=p.parser,y=p.funcName,x=p.token,O;switch(y){case"\\over":O="\\frac";break;case"\\choose":O="\\binom";break;case"\\atop":O="\\\\atopfrac";break;case"\\brace":O="\\\\bracefrac";break;case"\\brack":O="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:v.mode,replaceWith:O,token:x}}});var Vs=["display","text","script","scriptscript"],Da=function(p){var v=null;return p.length>0&&(v=p,v=v==="."?null:v),v};Ar({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(p,v){var y=p.parser,x=v[4],O=v[5],z=gr(v[0],"atom");z&&(z=yn(v[0],"open"));var oe=z?Da(z.text):null,be=gr(v[1],"atom");be&&(be=yn(v[1],"close"));var Re=be?Da(be.text):null,it=lr(v[2],"size"),dt,It=null;it.isBlank?dt=!0:(It=it.value,dt=It.number>0);var Xt="auto",ar=gr(v[3],"ordgroup");if(ar){if(ar.body.length>0){var Sr=lr(ar.body[0],"textord");Xt=Vs[Number(Sr.text)]}}else ar=lr(v[3],"textord"),Xt=Vs[Number(ar.text)];return{type:"genfrac",mode:y.mode,numer:x,denom:O,continued:!1,hasBarLine:dt,barSize:It,leftDelim:oe,rightDelim:Re,size:Xt}},htmlBuilder:al,mathmlBuilder:ol}),Ar({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(p,v){var y=p.parser,x=p.funcName,O=p.token;return{type:"infix",mode:y.mode,replaceWith:"\\\\abovefrac",size:lr(v[0],"size").value,token:O}}}),Ar({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[0],z=re(lr(v[1],"infix").size),oe=v[2],be=z.number>0;return{type:"genfrac",mode:y.mode,numer:O,denom:oe,continued:!1,hasBarLine:be,barSize:z,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:al,mathmlBuilder:ol});var Ul=function(p,v){var y=v.style,x,O,z=gr(p,"supsub");z?(x=z.sup?Sn(z.sup,v.havingStyle(y.sup()),v):Sn(z.sub,v.havingStyle(y.sub()),v),O=lr(z.base,"horizBrace")):O=lr(p,"horizBrace");var oe=Sn(O.base,v.havingBaseStyle(C.DISPLAY)),be=Dr.svgSpan(O,v),Re;if(O.isOver?(Re=Ie.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:oe},{type:"kern",size:.1},{type:"elem",elem:be}]},v),Re.children[0].children[0].children[1].classes.push("svg-align")):(Re=Ie.makeVList({positionType:"bottom",positionData:oe.depth+.1+be.height,children:[{type:"elem",elem:be},{type:"kern",size:.1},{type:"elem",elem:oe}]},v),Re.children[0].children[0].children[0].classes.push("svg-align")),x){var it=Ie.makeSpan(["mord",O.isOver?"mover":"munder"],[Re],v);O.isOver?Re=Ie.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:it},{type:"kern",size:.2},{type:"elem",elem:x}]},v):Re=Ie.makeVList({positionType:"bottom",positionData:it.depth+.2+x.height+x.depth,children:[{type:"elem",elem:x},{type:"kern",size:.2},{type:"elem",elem:it}]},v)}return Ie.makeSpan(["mord",O.isOver?"mover":"munder"],[Re],v)},v0=function(p,v){var y=Dr.mathMLnode(p.label);return new er.MathNode(p.isOver?"mover":"munder",[Dn(p.base,v),y])};Ar({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(p,v){var y=p.parser,x=p.funcName;return{type:"horizBrace",mode:y.mode,label:x,isOver:/^\\over/.test(x),base:v[0]}},htmlBuilder:Ul,mathmlBuilder:v0}),Ar({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(p,v){var y=p.parser,x=v[1],O=lr(v[0],"url").url;return y.settings.isTrusted({command:"\\href",url:O})?{type:"href",mode:y.mode,href:O,body:zn(x)}:y.formatUnsupportedCmd("\\href")},htmlBuilder:function(p,v){var y=Wn(p.body,v,!1);return Ie.makeAnchor(p.href,[],y,v)},mathmlBuilder:function(p,v){var y=oi(p.body,v);return y instanceof Xn||(y=new Xn("mrow",[y])),y.setAttribute("href",p.href),y}}),Ar({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(p,v){var y=p.parser,x=lr(v[0],"url").url;if(!y.settings.isTrusted({command:"\\url",url:x}))return y.formatUnsupportedCmd("\\url");for(var O=[],z=0;z<x.length;z++){var oe=x[z];oe==="~"&&(oe="\\textasciitilde"),O.push({type:"textord",mode:"text",text:oe})}var be={type:"text",mode:y.mode,font:"\\texttt",body:O};return{type:"href",mode:y.mode,href:x,body:zn(be)}}}),Ar({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(p,v){var y=p.parser;return{type:"htmlmathml",mode:y.mode,html:zn(v[0]),mathml:zn(v[1])}},htmlBuilder:function(p,v){var y=Wn(p.html,v,!1);return Ie.makeFragment(y)},mathmlBuilder:function(p,v){return oi(p.mathml,v)}});var Ro=function(p){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(p))return{number:+p,unit:"bp"};var v=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(p);if(!v)throw new me("Invalid size: '"+p+"' in \\includegraphics");var y={number:+(v[1]+v[2]),unit:v[3]};if(!nt(y))throw new me("Invalid unit: '"+y.unit+"' in \\includegraphics.");return y};Ar({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(p,v,y){var x=p.parser,O={number:0,unit:"em"},z={number:.9,unit:"em"},oe={number:0,unit:"em"},be="";if(y[0])for(var Re=lr(y[0],"raw").string,it=Re.split(","),dt=0;dt<it.length;dt++){var It=it[dt].split("=");if(It.length===2){var Xt=It[1].trim();switch(It[0].trim()){case"alt":be=Xt;break;case"width":O=Ro(Xt);break;case"height":z=Ro(Xt);break;case"totalheight":oe=Ro(Xt);break;default:throw new me("Invalid key: '"+It[0]+"' in \\includegraphics.")}}}var ar=lr(v[0],"url").url;return be===""&&(be=ar,be=be.replace(/^.*[\\/]/,""),be=be.substring(0,be.lastIndexOf("."))),x.settings.isTrusted({command:"\\includegraphics",url:ar})?{type:"includegraphics",mode:x.mode,alt:be,width:O,height:z,totalheight:oe,src:ar}:x.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(p,v){var y=Qe(p.height,v),x=0;p.totalheight.number>0&&(x=Qe(p.totalheight,v)-y,x=Number(x.toFixed(2)));var O=0;p.width.number>0&&(O=Qe(p.width,v));var z={height:y+x+"em"};O>0&&(z.width=O+"em"),x>0&&(z.verticalAlign=-x+"em");var oe=new Tt(p.src,p.alt,z);return oe.height=y,oe.depth=x,oe},mathmlBuilder:function(p,v){var y=new er.MathNode("mglyph",[]);y.setAttribute("alt",p.alt);var x=Qe(p.height,v),O=0;if(p.totalheight.number>0&&(O=Qe(p.totalheight,v)-x,O=O.toFixed(2),y.setAttribute("valign","-"+O+"em")),y.setAttribute("height",x+O+"em"),p.width.number>0){var z=Qe(p.width,v);y.setAttribute("width",z+"em")}return y.setAttribute("src",p.src),y}}),Ar({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(p,v){var y=p.parser,x=p.funcName,O=lr(v[0],"size");if(y.settings.strict){var z=x[1]==="m",oe=O.value.unit==="mu";z?(oe||y.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+x+" supports only mu units, "+("not "+O.value.unit+" units")),y.mode!=="math"&&y.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+x+" works only in math mode")):oe&&y.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+x+" doesn't support mu units")}return{type:"kern",mode:y.mode,dimension:O.value}},htmlBuilder:function(p,v){return Ie.makeGlue(p.dimension,v)},mathmlBuilder:function(p,v){var y=Qe(p.dimension,v);return new er.SpaceNode(y)}}),Ar({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[0];return{type:"lap",mode:y.mode,alignment:x.slice(5),body:O}},htmlBuilder:function(p,v){var y;p.alignment==="clap"?(y=Ie.makeSpan([],[Sn(p.body,v)]),y=Ie.makeSpan(["inner"],[y],v)):y=Ie.makeSpan(["inner"],[Sn(p.body,v)]);var x=Ie.makeSpan(["fix"],[]),O=Ie.makeSpan([p.alignment],[y,x],v),z=Ie.makeSpan(["strut"]);return z.style.height=O.height+O.depth+"em",z.style.verticalAlign=-O.depth+"em",O.children.unshift(z),O=Ie.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:O}]},v),Ie.makeSpan(["mord"],[O],v)},mathmlBuilder:function(p,v){var y=new er.MathNode("mpadded",[Dn(p.body,v)]);if(p.alignment!=="rlap"){var x=p.alignment==="llap"?"-1":"-0.5";y.setAttribute("lspace",x+"width")}return y.setAttribute("width","0px"),y}}),Ar({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(p,v){var y=p.funcName,x=p.parser,O=x.mode;x.switchMode("math");var z=y==="\\("?"\\)":"$",oe=x.parseExpression(!1,z);return x.expect(z),x.switchMode(O),{type:"styling",mode:x.mode,style:"text",body:oe}}}),Ar({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(p,v){throw new me("Mismatched "+p.funcName)}});var ll=function(p,v){switch(v.style.size){case C.DISPLAY.size:return p.display;case C.TEXT.size:return p.text;case C.SCRIPT.size:return p.script;case C.SCRIPTSCRIPT.size:return p.scriptscript;default:return p.text}};Ar({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(p,v){var y=p.parser;return{type:"mathchoice",mode:y.mode,display:zn(v[0]),text:zn(v[1]),script:zn(v[2]),scriptscript:zn(v[3])}},htmlBuilder:function(p,v){var y=ll(p,v),x=Wn(y,v,!1);return Ie.makeFragment(x)},mathmlBuilder:function(p,v){var y=ll(p,v);return oi(y,v)}});var Io=function(p,v,y,x,O,z,oe){p=Ie.makeSpan([],[p]);var be,Re;if(v){var it=Sn(v,x.havingStyle(O.sup()),x);Re={elem:it,kern:Math.max(x.fontMetrics().bigOpSpacing1,x.fontMetrics().bigOpSpacing3-it.depth)}}if(y){var dt=Sn(y,x.havingStyle(O.sub()),x);be={elem:dt,kern:Math.max(x.fontMetrics().bigOpSpacing2,x.fontMetrics().bigOpSpacing4-dt.height)}}var It;if(Re&&be){var Xt=x.fontMetrics().bigOpSpacing5+be.elem.height+be.elem.depth+be.kern+p.depth+oe;It=Ie.makeVList({positionType:"bottom",positionData:Xt,children:[{type:"kern",size:x.fontMetrics().bigOpSpacing5},{type:"elem",elem:be.elem,marginLeft:-z+"em"},{type:"kern",size:be.kern},{type:"elem",elem:p},{type:"kern",size:Re.kern},{type:"elem",elem:Re.elem,marginLeft:z+"em"},{type:"kern",size:x.fontMetrics().bigOpSpacing5}]},x)}else if(be){var ar=p.height-oe;It=Ie.makeVList({positionType:"top",positionData:ar,children:[{type:"kern",size:x.fontMetrics().bigOpSpacing5},{type:"elem",elem:be.elem,marginLeft:-z+"em"},{type:"kern",size:be.kern},{type:"elem",elem:p}]},x)}else if(Re){var Sr=p.depth+oe;It=Ie.makeVList({positionType:"bottom",positionData:Sr,children:[{type:"elem",elem:p},{type:"kern",size:Re.kern},{type:"elem",elem:Re.elem,marginLeft:z+"em"},{type:"kern",size:x.fontMetrics().bigOpSpacing5}]},x)}else return p;return Ie.makeSpan(["mop","op-limits"],[It],x)},gs=["\\smallint"],Es=function(p,v){var y,x,O=!1,z,oe=gr(p,"supsub");oe?(y=oe.sup,x=oe.sub,z=lr(oe.base,"op"),O=!0):z=lr(p,"op");var be=v.style,Re=!1;be.size===C.DISPLAY.size&&z.symbol&&!q.contains(gs,z.name)&&(Re=!0);var it;if(z.symbol){var dt=Re?"Size2-Regular":"Size1-Regular",It="";if((z.name==="\\oiint"||z.name==="\\oiiint")&&(It=z.name.substr(1),z.name=It==="oiint"?"\\iint":"\\iiint"),it=Ie.makeSymbol(z.name,dt,"math",v,["mop","op-symbol",Re?"large-op":"small-op"]),It.length>0){var Xt=it.italic,ar=Ie.staticSvg(It+"Size"+(Re?"2":"1"),v);it=Ie.makeVList({positionType:"individualShift",children:[{type:"elem",elem:it,shift:0},{type:"elem",elem:ar,shift:Re?.08:0}]},v),z.name="\\"+It,it.classes.unshift("mop"),it.italic=Xt}}else if(z.body){var Sr=Wn(z.body,v,!0);Sr.length===1&&Sr[0]instanceof Be?(it=Sr[0],it.classes[0]="mop"):it=Ie.makeSpan(["mop"],Ie.tryCombineChars(Sr),v)}else{for(var Vr=[],En=1;En<z.name.length;En++)Vr.push(Ie.mathsym(z.name[En],z.mode,v));it=Ie.makeSpan(["mop"],Vr,v)}var Tn=0,kn=0;return(it instanceof Be||z.name==="\\oiint"||z.name==="\\oiiint")&&!z.suppressBaseShift&&(Tn=(it.height-it.depth)/2-v.fontMetrics().axisHeight,kn=it.italic),O?Io(it,y,x,v,be,kn,Tn):(Tn&&(it.style.position="relative",it.style.top=Tn+"em"),it)},Ws=function(p,v){var y;if(p.symbol)y=new Xn("mo",[ci(p.name,p.mode)]),q.contains(gs,p.name)&&y.setAttribute("largeop","false");else if(p.body)y=new Xn("mo",_i(p.body,v));else{y=new Xn("mi",[new xs(p.name.slice(1))]);var x=new Xn("mo",[ci("\u2061","text")]);p.parentIsSupSub?y=new Xn("mo",[y,x]):y=fs([y,x])}return y},y0={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Ar({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:function(p,v){var y=p.parser,x=p.funcName,O=x;return O.length===1&&(O=y0[O]),{type:"op",mode:y.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:O}},htmlBuilder:Es,mathmlBuilder:Ws}),Ar({type:"op",names:["\\mathop"],props:{numArgs:1},handler:function(p,v){var y=p.parser,x=v[0];return{type:"op",mode:y.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:zn(x)}},htmlBuilder:Es,mathmlBuilder:Ws});var ul={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Ar({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler:function(p){var v=p.parser,y=p.funcName;return{type:"op",mode:v.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:y}},htmlBuilder:Es,mathmlBuilder:Ws}),Ar({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(p){var v=p.parser,y=p.funcName;return{type:"op",mode:v.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:y}},htmlBuilder:Es,mathmlBuilder:Ws}),Ar({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler:function(p){var v=p.parser,y=p.funcName,x=y;return x.length===1&&(x=ul[x]),{type:"op",mode:v.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:x}},htmlBuilder:Es,mathmlBuilder:Ws});var cl=function(p,v){var y,x,O=!1,z,oe=gr(p,"supsub");oe?(y=oe.sup,x=oe.sub,z=lr(oe.base,"operatorname"),O=!0):z=lr(p,"operatorname");var be;if(z.body.length>0){for(var Re=z.body.map(function(Xt){var ar=Xt.text;return typeof ar=="string"?{type:"textord",mode:Xt.mode,text:ar}:Xt}),it=Wn(Re,v.withFont("mathrm"),!0),dt=0;dt<it.length;dt++){var It=it[dt];It instanceof Be&&(It.text=It.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}be=Ie.makeSpan(["mop"],it,v)}else be=Ie.makeSpan(["mop"],[],v);return O?Io(be,y,x,v,v.style,0,0):be},b0=function(p,v){for(var y=_i(p.body,v.withFont("mathrm")),x=!0,O=0;O<y.length;O++){var z=y[O];if(!(z instanceof er.SpaceNode))if(z instanceof er.MathNode)switch(z.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var oe=z.children[0];z.children.length===1&&oe instanceof er.TextNode?oe.text=oe.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):x=!1;break}default:x=!1}else x=!1}if(x){var be=y.map(function(dt){return dt.toText()}).join("");y=[new er.TextNode(be)]}var Re=new er.MathNode("mi",y);Re.setAttribute("mathvariant","normal");var it=new er.MathNode("mo",[ci("\u2061","text")]);return p.parentIsSupSub?new er.MathNode("mo",[Re,it]):er.newDocumentFragment([Re,it])};Ar({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[0];return{type:"operatorname",mode:y.mode,body:zn(O),alwaysHandleSupSub:x==="\\operatorname*",limits:!1,parentIsSupSub:!1}},htmlBuilder:cl,mathmlBuilder:b0}),bn({type:"ordgroup",htmlBuilder:function(p,v){return p.semisimple?Ie.makeFragment(Wn(p.body,v,!1)):Ie.makeSpan(["mord"],Wn(p.body,v,!0),v)},mathmlBuilder:function(p,v){return oi(p.body,v,!0)}}),Ar({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(p,v){var y=p.parser,x=v[0];return{type:"overline",mode:y.mode,body:x}},htmlBuilder:function(p,v){var y=Sn(p.body,v.havingCrampedStyle()),x=Ie.makeLineSpan("overline-line",v),O=v.fontMetrics().defaultRuleThickness,z=Ie.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:y},{type:"kern",size:3*O},{type:"elem",elem:x},{type:"kern",size:O}]},v);return Ie.makeSpan(["mord","overline"],[z],v)},mathmlBuilder:function(p,v){var y=new er.MathNode("mo",[new er.TextNode("\u203E")]);y.setAttribute("stretchy","true");var x=new er.MathNode("mover",[Dn(p.body,v),y]);return x.setAttribute("accent","true"),x}}),Ar({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser,x=v[0];return{type:"phantom",mode:y.mode,body:zn(x)}},htmlBuilder:function(p,v){var y=Wn(p.body,v.withPhantom(),!1);return Ie.makeFragment(y)},mathmlBuilder:function(p,v){var y=_i(p.body,v);return new er.MathNode("mphantom",y)}}),Ar({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser,x=v[0];return{type:"hphantom",mode:y.mode,body:x}},htmlBuilder:function(p,v){var y=Ie.makeSpan([],[Sn(p.body,v.withPhantom())]);if(y.height=0,y.depth=0,y.children)for(var x=0;x<y.children.length;x++)y.children[x].height=0,y.children[x].depth=0;return y=Ie.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:y}]},v),Ie.makeSpan(["mord"],[y],v)},mathmlBuilder:function(p,v){var y=_i(zn(p.body),v),x=new er.MathNode("mphantom",y),O=new er.MathNode("mpadded",[x]);return O.setAttribute("height","0px"),O.setAttribute("depth","0px"),O}}),Ar({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser,x=v[0];return{type:"vphantom",mode:y.mode,body:x}},htmlBuilder:function(p,v){var y=Ie.makeSpan(["inner"],[Sn(p.body,v.withPhantom())]),x=Ie.makeSpan(["fix"],[]);return Ie.makeSpan(["mord","rlap"],[y,x],v)},mathmlBuilder:function(p,v){var y=_i(zn(p.body),v),x=new er.MathNode("mphantom",y),O=new er.MathNode("mpadded",[x]);return O.setAttribute("width","0px"),O}}),Ar({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(p,v){var y=p.parser,x=lr(v[0],"size").value,O=v[1];return{type:"raisebox",mode:y.mode,dy:x,body:O}},htmlBuilder:function(p,v){var y=Sn(p.body,v),x=Qe(p.dy,v);return Ie.makeVList({positionType:"shift",positionData:-x,children:[{type:"elem",elem:y}]},v)},mathmlBuilder:function(p,v){var y=new er.MathNode("mpadded",[Dn(p.body,v)]),x=p.dy.number+p.dy.unit;return y.setAttribute("voffset",x),y}}),Ar({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(p,v,y){var x=p.parser,O=y[0],z=lr(v[0],"size"),oe=lr(v[1],"size");return{type:"rule",mode:x.mode,shift:O&&lr(O,"size").value,width:z.value,height:oe.value}},htmlBuilder:function(p,v){var y=Ie.makeSpan(["mord","rule"],[],v),x=Qe(p.width,v),O=Qe(p.height,v),z=p.shift?Qe(p.shift,v):0;return y.style.borderRightWidth=x+"em",y.style.borderTopWidth=O+"em",y.style.bottom=z+"em",y.width=x,y.height=O+z,y.depth=-z,y.maxFontSize=O*1.125*v.sizeMultiplier,y},mathmlBuilder:function(p,v){var y=Qe(p.width,v),x=Qe(p.height,v),O=p.shift?Qe(p.shift,v):0,z=v.color&&v.getColor()||"black",oe=new er.MathNode("mspace");oe.setAttribute("mathbackground",z),oe.setAttribute("width",y+"em"),oe.setAttribute("height",x+"em");var be=new er.MathNode("mpadded",[oe]);return O>=0?be.setAttribute("height","+"+O+"em"):(be.setAttribute("height",O+"em"),be.setAttribute("depth","+"+-O+"em")),be.setAttribute("voffset",O+"em"),be}});function Oo(K,p,v){for(var y=Wn(K,p,!1),x=p.sizeMultiplier/v.sizeMultiplier,O=0;O<y.length;O++){var z=y[O].classes.indexOf("sizing");z<0?Array.prototype.push.apply(y[O].classes,p.sizingClasses(v)):y[O].classes[z+1]==="reset-size"+p.size&&(y[O].classes[z+1]="reset-size"+v.size),y[O].height*=x,y[O].depth*=x}return Ie.makeFragment(y)}var so=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],_0=function(p,v){var y=v.havingSize(p.size);return Oo(p.body,y,v)};Ar({type:"sizing",names:so,props:{numArgs:0,allowedInText:!0},handler:function(p,v){var y=p.breakOnTokenText,x=p.funcName,O=p.parser,z=O.parseExpression(!1,y);return{type:"sizing",mode:O.mode,size:so.indexOf(x)+1,body:z}},htmlBuilder:_0,mathmlBuilder:function(p,v){var y=v.havingSize(p.size),x=_i(p.body,y),O=new er.MathNode("mstyle",x);return O.setAttribute("mathsize",y.sizeMultiplier+"em"),O}}),Ar({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(p,v,y){var x=p.parser,O=!1,z=!1,oe=y[0]&&lr(y[0],"ordgroup");if(oe)for(var be="",Re=0;Re<oe.body.length;++Re){var it=oe.body[Re];if(be=it.text,be==="t")O=!0;else if(be==="b")z=!0;else{O=!1,z=!1;break}}else O=!0,z=!0;var dt=v[0];return{type:"smash",mode:x.mode,body:dt,smashHeight:O,smashDepth:z}},htmlBuilder:function(p,v){var y=Ie.makeSpan([],[Sn(p.body,v)]);if(!p.smashHeight&&!p.smashDepth)return y;if(p.smashHeight&&(y.height=0,y.children))for(var x=0;x<y.children.length;x++)y.children[x].height=0;if(p.smashDepth&&(y.depth=0,y.children))for(var O=0;O<y.children.length;O++)y.children[O].depth=0;var z=Ie.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:y}]},v);return Ie.makeSpan(["mord"],[z],v)},mathmlBuilder:function(p,v){var y=new er.MathNode("mpadded",[Dn(p.body,v)]);return p.smashHeight&&y.setAttribute("height","0px"),p.smashDepth&&y.setAttribute("depth","0px"),y}}),Ar({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(p,v,y){var x=p.parser,O=y[0],z=v[0];return{type:"sqrt",mode:x.mode,body:z,index:O}},htmlBuilder:function(p,v){var y=Sn(p.body,v.havingCrampedStyle());y.height===0&&(y.height=v.fontMetrics().xHeight),y=Ie.wrapFragment(y,v);var x=v.fontMetrics(),O=x.defaultRuleThickness,z=O;v.style.id<C.TEXT.id&&(z=v.fontMetrics().xHeight);var oe=O+z/4,be=y.height+y.depth+oe+O,Re=ms.sqrtImage(be,v),it=Re.span,dt=Re.ruleWidth,It=Re.advanceWidth,Xt=it.height-dt;Xt>y.height+y.depth+oe&&(oe=(oe+Xt-y.height-y.depth)/2);var ar=it.height-y.height-oe-dt;y.style.paddingLeft=It+"em";var Sr=Ie.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:y,wrapperClasses:["svg-align"]},{type:"kern",size:-(y.height+ar)},{type:"elem",elem:it},{type:"kern",size:dt}]},v);if(p.index){var Vr=v.havingStyle(C.SCRIPTSCRIPT),En=Sn(p.index,Vr,v),Tn=.6*(Sr.height-Sr.depth),kn=Ie.makeVList({positionType:"shift",positionData:-Tn,children:[{type:"elem",elem:En}]},v),ii=Ie.makeSpan(["root"],[kn]);return Ie.makeSpan(["mord","sqrt"],[ii,Sr],v)}else return Ie.makeSpan(["mord","sqrt"],[Sr],v)},mathmlBuilder:function(p,v){var y=p.body,x=p.index;return x?new er.MathNode("mroot",[Dn(y,v),Dn(x,v)]):new er.MathNode("msqrt",[Dn(y,v)])}});var Hl={display:C.DISPLAY,text:C.TEXT,script:C.SCRIPT,scriptscript:C.SCRIPTSCRIPT};Ar({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(p,v){var y=p.breakOnTokenText,x=p.funcName,O=p.parser,z=O.parseExpression(!0,y),oe=x.slice(1,x.length-5);return{type:"styling",mode:O.mode,style:oe,body:z}},htmlBuilder:function(p,v){var y=Hl[p.style],x=v.havingStyle(y).withFont("");return Oo(p.body,x,v)},mathmlBuilder:function(p,v){var y=Hl[p.style],x=v.havingStyle(y),O=_i(p.body,x),z=new er.MathNode("mstyle",O),oe={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},be=oe[p.style];return z.setAttribute("scriptlevel",be[0]),z.setAttribute("displaystyle",be[1]),z}});var hl=function(p,v){var y=p.base;if(y)if(y.type==="op"){var x=y.limits&&(v.style.size===C.DISPLAY.size||y.alwaysHandleSupSub);return x?Es:null}else if(y.type==="operatorname"){var O=y.alwaysHandleSupSub&&(v.style.size===C.DISPLAY.size||y.limits);return O?cl:null}else{if(y.type==="accent")return q.isCharacterBox(y.base)?On:null;if(y.type==="horizBrace"){var z=!p.sub;return z===y.isOver?Ul:null}else return null}else return null};bn({type:"supsub",htmlBuilder:function(p,v){var y=hl(p,v);if(y)return y(p,v);var x=p.base,O=p.sup,z=p.sub,oe=Sn(x,v),be,Re,it=v.fontMetrics(),dt=0,It=0,Xt=x&&q.isCharacterBox(x);if(O){var ar=v.havingStyle(v.style.sup());be=Sn(O,ar,v),Xt||(dt=oe.height-ar.fontMetrics().supDrop*ar.sizeMultiplier/v.sizeMultiplier)}if(z){var Sr=v.havingStyle(v.style.sub());Re=Sn(z,Sr,v),Xt||(It=oe.depth+Sr.fontMetrics().subDrop*Sr.sizeMultiplier/v.sizeMultiplier)}var Vr;v.style===C.DISPLAY?Vr=it.sup1:v.style.cramped?Vr=it.sup3:Vr=it.sup2;var En=v.sizeMultiplier,Tn=.5/it.ptPerEm/En+"em",kn=null;if(Re){var ii=p.base&&p.base.type==="op"&&p.base.name&&(p.base.name==="\\oiint"||p.base.name==="\\oiiint");(oe instanceof Be||ii)&&(kn=-oe.italic+"em")}var si;if(be&&Re){dt=Math.max(dt,Vr,be.depth+.25*it.xHeight),It=Math.max(It,it.sub2);var gi=it.defaultRuleThickness,wi=4*gi;if(dt-be.depth-(Re.height-It)<wi){It=wi-(dt-be.depth)+Re.height;var ji=.8*it.xHeight-(dt-be.depth);ji>0&&(dt+=ji,It-=ji)}var vs=[{type:"elem",elem:Re,shift:It,marginRight:Tn,marginLeft:kn},{type:"elem",elem:be,shift:-dt,marginRight:Tn}];si=Ie.makeVList({positionType:"individualShift",children:vs},v)}else if(Re){It=Math.max(It,it.sub1,Re.height-.8*it.xHeight);var rs=[{type:"elem",elem:Re,marginLeft:kn,marginRight:Tn}];si=Ie.makeVList({positionType:"shift",positionData:It,children:rs},v)}else if(be)dt=Math.max(dt,Vr,be.depth+.25*it.xHeight),si=Ie.makeVList({positionType:"shift",positionData:-dt,children:[{type:"elem",elem:be,marginRight:Tn}]},v);else throw new Error("supsub must have either sup or sub.");var li=Di(oe,"right")||"mord";return Ie.makeSpan([li],[oe,Ie.makeSpan(["msupsub"],[si])],v)},mathmlBuilder:function(p,v){var y=!1,x,O,z=gr(p.base,"horizBrace");z&&(O=!!p.sup,O===z.isOver&&(y=!0,x=z.isOver)),p.base&&(p.base.type==="op"||p.base.type==="operatorname")&&(p.base.parentIsSupSub=!0);var oe=[Dn(p.base,v)];p.sub&&oe.push(Dn(p.sub,v)),p.sup&&oe.push(Dn(p.sup,v));var be;if(y)be=x?"mover":"munder";else if(p.sub)if(p.sup){var dt=p.base;dt&&dt.type==="op"&&dt.limits&&v.style===C.DISPLAY||dt&&dt.type==="operatorname"&&dt.alwaysHandleSupSub&&(v.style===C.DISPLAY||dt.limits)?be="munderover":be="msubsup"}else{var it=p.base;it&&it.type==="op"&&it.limits&&(v.style===C.DISPLAY||it.alwaysHandleSupSub)||it&&it.type==="operatorname"&&it.alwaysHandleSupSub&&(it.limits||v.style===C.DISPLAY)?be="munder":be="msub"}else{var Re=p.base;Re&&Re.type==="op"&&Re.limits&&(v.style===C.DISPLAY||Re.alwaysHandleSupSub)||Re&&Re.type==="operatorname"&&Re.alwaysHandleSupSub&&(Re.limits||v.style===C.DISPLAY)?be="mover":be="msup"}var It=new er.MathNode(be,oe);return It}}),bn({type:"atom",htmlBuilder:function(p,v){return Ie.mathsym(p.text,p.mode,v,["m"+p.family])},mathmlBuilder:function(p,v){var y=new er.MathNode("mo",[ci(p.text,p.mode)]);if(p.family==="bin"){var x=Qi(p,v);x==="bold-italic"&&y.setAttribute("mathvariant",x)}else p.family==="punct"?y.setAttribute("separator","true"):(p.family==="open"||p.family==="close")&&y.setAttribute("stretchy","false");return y}});var Gl={mi:"italic",mn:"normal",mtext:"normal"};bn({type:"mathord",htmlBuilder:function(p,v){return Ie.makeOrd(p,v,"mathord")},mathmlBuilder:function(p,v){var y=new er.MathNode("mi",[ci(p.text,p.mode,v)]),x=Qi(p,v)||"italic";return x!==Gl[y.type]&&y.setAttribute("mathvariant",x),y}}),bn({type:"textord",htmlBuilder:function(p,v){return Ie.makeOrd(p,v,"textord")},mathmlBuilder:function(p,v){var y=ci(p.text,p.mode,v),x=Qi(p,v)||"normal",O;return p.mode==="text"?O=new er.MathNode("mtext",[y]):/[0-9]/.test(p.text)?O=new er.MathNode("mn",[y]):p.text==="\\prime"?O=new er.MathNode("mo",[y]):O=new er.MathNode("mi",[y]),x!==Gl[O.type]&&O.setAttribute("mathvariant",x),O}});var Bo={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},ao={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};bn({type:"spacing",htmlBuilder:function(p,v){if(ao.hasOwnProperty(p.text)){var y=ao[p.text].className||"";if(p.mode==="text"){var x=Ie.makeOrd(p,v,"textord");return x.classes.push(y),x}else return Ie.makeSpan(["mspace",y],[Ie.mathsym(p.text,p.mode,v)],v)}else{if(Bo.hasOwnProperty(p.text))return Ie.makeSpan(["mspace",Bo[p.text]],[],v);throw new me('Unknown type of space "'+p.text+'"')}},mathmlBuilder:function(p,v){var y;if(ao.hasOwnProperty(p.text))y=new er.MathNode("mtext",[new er.TextNode("\xA0")]);else{if(Bo.hasOwnProperty(p.text))return new er.MathNode("mspace");throw new me('Unknown type of space "'+p.text+'"')}return y}});var oo=function(){var p=new er.MathNode("mtd",[]);return p.setAttribute("width","50%"),p};bn({type:"tag",mathmlBuilder:function(p,v){var y=new er.MathNode("mtable",[new er.MathNode("mtr",[oo(),new er.MathNode("mtd",[oi(p.body,v)]),oo(),new er.MathNode("mtd",[oi(p.tag,v)])])]);return y.setAttribute("width","100%"),y}});var js={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},dl={"\\textbf":"textbf","\\textmd":"textmd"},fl={"\\textit":"textit","\\textup":"textup"},Vl=function(p,v){var y=p.font;return y?js[y]?v.withTextFontFamily(js[y]):dl[y]?v.withTextFontWeight(dl[y]):v.withTextFontShape(fl[y]):v};Ar({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],greediness:2,allowedInText:!0},handler:function(p,v){var y=p.parser,x=p.funcName,O=v[0];return{type:"text",mode:y.mode,body:zn(O),font:x}},htmlBuilder:function(p,v){var y=Vl(p,v),x=Wn(p.body,y,!0);return Ie.makeSpan(["mord","text"],Ie.tryCombineChars(x),y)},mathmlBuilder:function(p,v){var y=Vl(p,v);return oi(p.body,y)}}),Ar({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser;return{type:"underline",mode:y.mode,body:v[0]}},htmlBuilder:function(p,v){var y=Sn(p.body,v),x=Ie.makeLineSpan("underline-line",v),O=v.fontMetrics().defaultRuleThickness,z=Ie.makeVList({positionType:"top",positionData:y.height,children:[{type:"kern",size:O},{type:"elem",elem:x},{type:"kern",size:3*O},{type:"elem",elem:y}]},v);return Ie.makeSpan(["mord","underline"],[z],v)},mathmlBuilder:function(p,v){var y=new er.MathNode("mo",[new er.TextNode("\u203E")]);y.setAttribute("stretchy","true");var x=new er.MathNode("munder",[Dn(p.body,v),y]);return x.setAttribute("accentunder","true"),x}}),Ar({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(p,v,y){throw new me("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(p,v){for(var y=Wl(p),x=[],O=v.havingStyle(v.style.text()),z=0;z<y.length;z++){var oe=y[z];oe==="~"&&(oe="\\textasciitilde"),x.push(Ie.makeSymbol(oe,"Typewriter-Regular",p.mode,O,["mord","texttt"]))}return Ie.makeSpan(["mord","text"].concat(O.sizingClasses(v)),Ie.tryCombineChars(x),O)},mathmlBuilder:function(p,v){var y=new er.TextNode(Wl(p)),x=new er.MathNode("mtext",[y]);return x.setAttribute("mathvariant","monospace"),x}});var Wl=function(p){return p.body.replace(/ /g,p.star?"\u2423":"\xA0")},x0=qi,ja=x0,Po=`[ \r
]`,pl="\\\\[a-zA-Z@]+",w0="\\\\[^\uD800-\uDFFF]",jl=""+pl+Po+"*",S0=new RegExp("^("+pl+")"+Po+"*$"),ml="[\u0300-\u036F]",us=new RegExp(ml+"+$"),ks="("+Po+"+)|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(ml+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(ml+"*")+"|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*"+("|"+jl)+("|"+w0+")"),lo=function(){function K(v,y){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=v,this.settings=y,this.tokenRegex=new RegExp(ks,"g"),this.catcodes={"%":14}}var p=K.prototype;return p.setCatcode=function(y,x){this.catcodes[y]=x},p.lex=function(){var y=this.input,x=this.tokenRegex.lastIndex;if(x===y.length)return new Ge("EOF",new Xe(this,x,x));var O=this.tokenRegex.exec(y);if(O===null||O.index!==x)throw new me("Unexpected character: '"+y[x]+"'",new Ge(y[x],new Xe(this,x,x+1)));var z=O[2]||" ";if(this.catcodes[z]===14){var oe=y.indexOf(`
`,this.tokenRegex.lastIndex);return oe===-1?(this.tokenRegex.lastIndex=y.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=oe+1,this.lex()}var be=z.match(S0);return be&&(z=be[1]),new Ge(z,new Xe(this,x,this.tokenRegex.lastIndex))},K}(),ga=function(){function K(v,y){v===void 0&&(v={}),y===void 0&&(y={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=y,this.builtins=v,this.undefStack=[]}var p=K.prototype;return p.beginGroup=function(){this.undefStack.push({})},p.endGroup=function(){if(this.undefStack.length===0)throw new me("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var y=this.undefStack.pop();for(var x in y)y.hasOwnProperty(x)&&(y[x]===void 0?delete this.current[x]:this.current[x]=y[x])},p.has=function(y){return this.current.hasOwnProperty(y)||this.builtins.hasOwnProperty(y)},p.get=function(y){return this.current.hasOwnProperty(y)?this.current[y]:this.builtins[y]},p.set=function(y,x,O){if(O===void 0&&(O=!1),O){for(var z=0;z<this.undefStack.length;z++)delete this.undefStack[z][y];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][y]=x)}else{var oe=this.undefStack[this.undefStack.length-1];oe&&!oe.hasOwnProperty(y)&&(oe[y]=this.current[y])}this.current[y]=x},K}(),ql={},uo=ql;function ke(K,p){ql[K]=p}ke("\\@firstoftwo",function(K){var p=K.consumeArgs(2);return{tokens:p[0],numArgs:0}}),ke("\\@secondoftwo",function(K){var p=K.consumeArgs(2);return{tokens:p[1],numArgs:0}}),ke("\\@ifnextchar",function(K){var p=K.consumeArgs(3),v=K.future();return p[0].length===1&&p[0][0].text===v.text?{tokens:p[1],numArgs:0}:{tokens:p[2],numArgs:0}}),ke("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ke("\\TextOrMath",function(K){var p=K.consumeArgs(2);return K.mode==="text"?{tokens:p[0],numArgs:0}:{tokens:p[1],numArgs:0}});var Ma={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ke("\\char",function(K){var p=K.popToken(),v,y="";if(p.text==="'")v=8,p=K.popToken();else if(p.text==='"')v=16,p=K.popToken();else if(p.text==="`")if(p=K.popToken(),p.text[0]==="\\")y=p.text.charCodeAt(1);else{if(p.text==="EOF")throw new me("\\char` missing argument");y=p.text.charCodeAt(0)}else v=10;if(v){if(y=Ma[p.text],y==null||y>=v)throw new me("Invalid base-"+v+" digit "+p.text);for(var x;(x=Ma[K.future().text])!=null&&x<v;)y*=v,y+=x,K.popToken()}return"\\@char{"+y+"}"});var Fo=function(p,v){var y=p.consumeArgs(1)[0];if(y.length!==1)throw new me("\\gdef's first argument must be a macro name");var x=y[0].text,O=0;for(y=p.consumeArgs(1)[0];y.length===1&&y[0].text==="#";){if(y=p.consumeArgs(1)[0],y.length!==1)throw new me('Invalid argument number length "'+y.length+'"');if(!/^[1-9]$/.test(y[0].text))throw new me('Invalid argument number "'+y[0].text+'"');if(O++,parseInt(y[0].text)!==O)throw new me('Argument number "'+y[0].text+'" out of order');y=p.consumeArgs(1)[0]}return p.macros.set(x,{tokens:y,numArgs:O},v),""};ke("\\gdef",function(K){return Fo(K,!0)}),ke("\\def",function(K){return Fo(K,!1)}),ke("\\global",function(K){var p=K.consumeArgs(1)[0];if(p.length!==1)throw new me("Invalid command after \\global");var v=p[0].text;if(v==="\\def")return Fo(K,!0);throw new me("Invalid command '"+v+"' after \\global")});var No=function(p,v,y){var x=p.consumeArgs(1)[0];if(x.length!==1)throw new me("\\newcommand's first argument must be a macro name");var O=x[0].text,z=p.isDefined(O);if(z&&!v)throw new me("\\newcommand{"+O+"} attempting to redefine "+(O+"; use \\renewcommand"));if(!z&&!y)throw new me("\\renewcommand{"+O+"} when command "+O+" does not yet exist; use \\newcommand");var oe=0;if(x=p.consumeArgs(1)[0],x.length===1&&x[0].text==="["){for(var be="",Re=p.expandNextToken();Re.text!=="]"&&Re.text!=="EOF";)be+=Re.text,Re=p.expandNextToken();if(!be.match(/^\s*[0-9]+\s*$/))throw new me("Invalid number of arguments: "+be);oe=parseInt(be),x=p.consumeArgs(1)[0]}return p.macros.set(O,{tokens:x,numArgs:oe}),""};ke("\\newcommand",function(K){return No(K,!1,!0)}),ke("\\renewcommand",function(K){return No(K,!0,!1)}),ke("\\providecommand",function(K){return No(K,!0,!0)}),ke("\\bgroup","{"),ke("\\egroup","}"),ke("\\lq","`"),ke("\\rq","'"),ke("\\aa","\\r a"),ke("\\AA","\\r A"),ke("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),ke("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ke("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),ke("\u212C","\\mathscr{B}"),ke("\u2130","\\mathscr{E}"),ke("\u2131","\\mathscr{F}"),ke("\u210B","\\mathscr{H}"),ke("\u2110","\\mathscr{I}"),ke("\u2112","\\mathscr{L}"),ke("\u2133","\\mathscr{M}"),ke("\u211B","\\mathscr{R}"),ke("\u212D","\\mathfrak{C}"),ke("\u210C","\\mathfrak{H}"),ke("\u2128","\\mathfrak{Z}"),ke("\\Bbbk","\\Bbb{k}"),ke("\xB7","\\cdotp"),ke("\\llap","\\mathllap{\\textrm{#1}}"),ke("\\rlap","\\mathrlap{\\textrm{#1}}"),ke("\\clap","\\mathclap{\\textrm{#1}}"),ke("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),ke("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),ke("\\ne","\\neq"),ke("\u2260","\\neq"),ke("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),ke("\u2209","\\notin"),ke("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),ke("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),ke("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),ke("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),ke("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),ke("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),ke("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),ke("\u27C2","\\perp"),ke("\u203C","\\mathclose{!\\mkern-0.8mu!}"),ke("\u220C","\\notni"),ke("\u231C","\\ulcorner"),ke("\u231D","\\urcorner"),ke("\u231E","\\llcorner"),ke("\u231F","\\lrcorner"),ke("\xA9","\\copyright"),ke("\xAE","\\textregistered"),ke("\uFE0F","\\textregistered"),ke("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),ke("\u22EE","\\vdots"),ke("\\varGamma","\\mathit{\\Gamma}"),ke("\\varDelta","\\mathit{\\Delta}"),ke("\\varTheta","\\mathit{\\Theta}"),ke("\\varLambda","\\mathit{\\Lambda}"),ke("\\varXi","\\mathit{\\Xi}"),ke("\\varPi","\\mathit{\\Pi}"),ke("\\varSigma","\\mathit{\\Sigma}"),ke("\\varUpsilon","\\mathit{\\Upsilon}"),ke("\\varPhi","\\mathit{\\Phi}"),ke("\\varPsi","\\mathit{\\Psi}"),ke("\\varOmega","\\mathit{\\Omega}"),ke("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ke("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),ke("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ke("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ke("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ke("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var ua={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};ke("\\dots",function(K){var p="\\dotso",v=K.expandAfterFuture().text;return v in ua?p=ua[v]:(v.substr(0,4)==="\\not"||v in Gt.math&&q.contains(["bin","rel"],Gt.math[v].group))&&(p="\\dotsb"),p});var wt={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ke("\\dotso",function(K){var p=K.future().text;return p in wt?"\\ldots\\,":"\\ldots"}),ke("\\dotsc",function(K){var p=K.future().text;return p in wt&&p!==","?"\\ldots\\,":"\\ldots"}),ke("\\cdots",function(K){var p=K.future().text;return p in wt?"\\@cdots\\,":"\\@cdots"}),ke("\\dotsb","\\cdots"),ke("\\dotsm","\\cdots"),ke("\\dotsi","\\!\\cdots"),ke("\\dotsx","\\ldots\\,"),ke("\\DOTSI","\\relax"),ke("\\DOTSB","\\relax"),ke("\\DOTSX","\\relax"),ke("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ke("\\,","\\tmspace+{3mu}{.1667em}"),ke("\\thinspace","\\,"),ke("\\>","\\mskip{4mu}"),ke("\\:","\\tmspace+{4mu}{.2222em}"),ke("\\medspace","\\:"),ke("\\;","\\tmspace+{5mu}{.2777em}"),ke("\\thickspace","\\;"),ke("\\!","\\tmspace-{3mu}{.1667em}"),ke("\\negthinspace","\\!"),ke("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ke("\\negthickspace","\\tmspace-{5mu}{.277em}"),ke("\\enspace","\\kern.5em "),ke("\\enskip","\\hskip.5em\\relax"),ke("\\quad","\\hskip1em\\relax"),ke("\\qquad","\\hskip2em\\relax"),ke("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ke("\\tag@paren","\\tag@literal{({#1})}"),ke("\\tag@literal",function(K){if(K.macros.get("\\df@tag"))throw new me("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ke("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ke("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ke("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ke("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ke("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),ke("\\\\","\\newline"),ke("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var gl=Yt["Main-Regular"][84][1]-.7*Yt["Main-Regular"][65][1]+"em";ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+gl+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+gl+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ke("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ke("\\@hspace","\\hskip #1\\relax"),ke("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ke("\\ordinarycolon",":"),ke("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ke("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ke("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ke("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ke("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ke("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ke("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ke("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ke("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ke("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ke("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ke("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ke("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ke("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ke("\u2237","\\dblcolon"),ke("\u2239","\\eqcolon"),ke("\u2254","\\coloneqq"),ke("\u2255","\\eqqcolon"),ke("\u2A74","\\Coloneqq"),ke("\\ratio","\\vcentcolon"),ke("\\coloncolon","\\dblcolon"),ke("\\colonequals","\\coloneqq"),ke("\\coloncolonequals","\\Coloneqq"),ke("\\equalscolon","\\eqqcolon"),ke("\\equalscoloncolon","\\Eqqcolon"),ke("\\colonminus","\\coloneq"),ke("\\coloncolonminus","\\Coloneq"),ke("\\minuscolon","\\eqcolon"),ke("\\minuscoloncolon","\\Eqcolon"),ke("\\coloncolonapprox","\\Colonapprox"),ke("\\coloncolonsim","\\Colonsim"),ke("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ke("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ke("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ke("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ke("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),ke("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ke("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ke("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),ke("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),ke("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),ke("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),ke("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),ke("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),ke("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),ke("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),ke("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),ke("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),ke("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),ke("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),ke("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),ke("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),ke("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),ke("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),ke("\u27E6","\\llbracket"),ke("\u27E7","\\rrbracket"),ke("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),ke("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),ke("\u2983","\\lBrace"),ke("\u2984","\\rBrace"),ke("\\darr","\\downarrow"),ke("\\dArr","\\Downarrow"),ke("\\Darr","\\Downarrow"),ke("\\lang","\\langle"),ke("\\rang","\\rangle"),ke("\\uarr","\\uparrow"),ke("\\uArr","\\Uparrow"),ke("\\Uarr","\\Uparrow"),ke("\\N","\\mathbb{N}"),ke("\\R","\\mathbb{R}"),ke("\\Z","\\mathbb{Z}"),ke("\\alef","\\aleph"),ke("\\alefsym","\\aleph"),ke("\\Alpha","\\mathrm{A}"),ke("\\Beta","\\mathrm{B}"),ke("\\bull","\\bullet"),ke("\\Chi","\\mathrm{X}"),ke("\\clubs","\\clubsuit"),ke("\\cnums","\\mathbb{C}"),ke("\\Complex","\\mathbb{C}"),ke("\\Dagger","\\ddagger"),ke("\\diamonds","\\diamondsuit"),ke("\\empty","\\emptyset"),ke("\\Epsilon","\\mathrm{E}"),ke("\\Eta","\\mathrm{H}"),ke("\\exist","\\exists"),ke("\\harr","\\leftrightarrow"),ke("\\hArr","\\Leftrightarrow"),ke("\\Harr","\\Leftrightarrow"),ke("\\hearts","\\heartsuit"),ke("\\image","\\Im"),ke("\\infin","\\infty"),ke("\\Iota","\\mathrm{I}"),ke("\\isin","\\in"),ke("\\Kappa","\\mathrm{K}"),ke("\\larr","\\leftarrow"),ke("\\lArr","\\Leftarrow"),ke("\\Larr","\\Leftarrow"),ke("\\lrarr","\\leftrightarrow"),ke("\\lrArr","\\Leftrightarrow"),ke("\\Lrarr","\\Leftrightarrow"),ke("\\Mu","\\mathrm{M}"),ke("\\natnums","\\mathbb{N}"),ke("\\Nu","\\mathrm{N}"),ke("\\Omicron","\\mathrm{O}"),ke("\\plusmn","\\pm"),ke("\\rarr","\\rightarrow"),ke("\\rArr","\\Rightarrow"),ke("\\Rarr","\\Rightarrow"),ke("\\real","\\Re"),ke("\\reals","\\mathbb{R}"),ke("\\Reals","\\mathbb{R}"),ke("\\Rho","\\mathrm{P}"),ke("\\sdot","\\cdot"),ke("\\sect","\\S"),ke("\\spades","\\spadesuit"),ke("\\sub","\\subset"),ke("\\sube","\\subseteq"),ke("\\supe","\\supseteq"),ke("\\Tau","\\mathrm{T}"),ke("\\thetasym","\\vartheta"),ke("\\weierp","\\wp"),ke("\\Zeta","\\mathrm{Z}"),ke("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ke("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ke("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ke("\\blue","\\textcolor{##6495ed}{#1}"),ke("\\orange","\\textcolor{##ffa500}{#1}"),ke("\\pink","\\textcolor{##ff00af}{#1}"),ke("\\red","\\textcolor{##df0030}{#1}"),ke("\\green","\\textcolor{##28ae7b}{#1}"),ke("\\gray","\\textcolor{gray}{#1}"),ke("\\purple","\\textcolor{##9d38bd}{#1}"),ke("\\blueA","\\textcolor{##ccfaff}{#1}"),ke("\\blueB","\\textcolor{##80f6ff}{#1}"),ke("\\blueC","\\textcolor{##63d9ea}{#1}"),ke("\\blueD","\\textcolor{##11accd}{#1}"),ke("\\blueE","\\textcolor{##0c7f99}{#1}"),ke("\\tealA","\\textcolor{##94fff5}{#1}"),ke("\\tealB","\\textcolor{##26edd5}{#1}"),ke("\\tealC","\\textcolor{##01d1c1}{#1}"),ke("\\tealD","\\textcolor{##01a995}{#1}"),ke("\\tealE","\\textcolor{##208170}{#1}"),ke("\\greenA","\\textcolor{##b6ffb0}{#1}"),ke("\\greenB","\\textcolor{##8af281}{#1}"),ke("\\greenC","\\textcolor{##74cf70}{#1}"),ke("\\greenD","\\textcolor{##1fab54}{#1}"),ke("\\greenE","\\textcolor{##0d923f}{#1}"),ke("\\goldA","\\textcolor{##ffd0a9}{#1}"),ke("\\goldB","\\textcolor{##ffbb71}{#1}"),ke("\\goldC","\\textcolor{##ff9c39}{#1}"),ke("\\goldD","\\textcolor{##e07d10}{#1}"),ke("\\goldE","\\textcolor{##a75a05}{#1}"),ke("\\redA","\\textcolor{##fca9a9}{#1}"),ke("\\redB","\\textcolor{##ff8482}{#1}"),ke("\\redC","\\textcolor{##f9685d}{#1}"),ke("\\redD","\\textcolor{##e84d39}{#1}"),ke("\\redE","\\textcolor{##bc2612}{#1}"),ke("\\maroonA","\\textcolor{##ffbde0}{#1}"),ke("\\maroonB","\\textcolor{##ff92c6}{#1}"),ke("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ke("\\maroonD","\\textcolor{##ca337c}{#1}"),ke("\\maroonE","\\textcolor{##9e034e}{#1}"),ke("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ke("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ke("\\purpleC","\\textcolor{##aa87ff}{#1}"),ke("\\purpleD","\\textcolor{##7854ab}{#1}"),ke("\\purpleE","\\textcolor{##543b78}{#1}"),ke("\\mintA","\\textcolor{##f5f9e8}{#1}"),ke("\\mintB","\\textcolor{##edf2df}{#1}"),ke("\\mintC","\\textcolor{##e0e5cc}{#1}"),ke("\\grayA","\\textcolor{##f6f7f7}{#1}"),ke("\\grayB","\\textcolor{##f0f1f2}{#1}"),ke("\\grayC","\\textcolor{##e3e5e6}{#1}"),ke("\\grayD","\\textcolor{##d6d8da}{#1}"),ke("\\grayE","\\textcolor{##babec2}{#1}"),ke("\\grayF","\\textcolor{##888d93}{#1}"),ke("\\grayG","\\textcolor{##626569}{#1}"),ke("\\grayH","\\textcolor{##3b3e40}{#1}"),ke("\\grayI","\\textcolor{##21242c}{#1}"),ke("\\kaBlue","\\textcolor{##314453}{#1}"),ke("\\kaGreen","\\textcolor{##71B307}{#1}");var $o={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},E0=function(){function K(v,y,x){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=y,this.expansionCount=0,this.feed(v),this.macros=new ga(uo,y.macros),this.mode=x,this.stack=[]}var p=K.prototype;return p.feed=function(y){this.lexer=new lo(y,this.settings)},p.switchMode=function(y){this.mode=y},p.beginGroup=function(){this.macros.beginGroup()},p.endGroup=function(){this.macros.endGroup()},p.future=function(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},p.popToken=function(){return this.future(),this.stack.pop()},p.pushToken=function(y){this.stack.push(y)},p.pushTokens=function(y){var x;(x=this.stack).push.apply(x,y)},p.consumeSpaces=function(){for(;;){var y=this.future();if(y.text===" ")this.stack.pop();else break}},p.consumeArgs=function(y){for(var x=[],O=0;O<y;++O){this.consumeSpaces();var z=this.popToken();if(z.text==="{"){for(var oe=[],be=1;be!==0;){var Re=this.popToken();if(oe.push(Re),Re.text==="{")++be;else if(Re.text==="}")--be;else if(Re.text==="EOF")throw new me("End of input in macro argument",z)}oe.pop(),oe.reverse(),x[O]=oe}else{if(z.text==="EOF")throw new me("End of input expecting macro argument");x[O]=[z]}}return x},p.expandOnce=function(){var y=this.popToken(),x=y.text,O=this._getExpansion(x);if(O==null)return this.pushToken(y),y;if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new me("Too many expansions: infinite loop or need to increase maxExpand setting");var z=O.tokens;if(O.numArgs){var oe=this.consumeArgs(O.numArgs);z=z.slice();for(var be=z.length-1;be>=0;--be){var Re=z[be];if(Re.text==="#"){if(be===0)throw new me("Incomplete placeholder at end of macro body",Re);if(Re=z[--be],Re.text==="#")z.splice(be+1,1);else if(/^[1-9]$/.test(Re.text)){var it;(it=z).splice.apply(it,[be,2].concat(oe[+Re.text-1]))}else throw new me("Not a valid argument number",Re)}}}return this.pushTokens(z),z},p.expandAfterFuture=function(){return this.expandOnce(),this.future()},p.expandNextToken=function(){for(;;){var y=this.expandOnce();if(y instanceof Ge)if(y.text==="\\relax")this.stack.pop();else return this.stack.pop()}throw new Error},p.expandMacro=function(y){if(this.macros.get(y)){var x=[],O=this.stack.length;for(this.pushToken(new Ge(y));this.stack.length>O;){var z=this.expandOnce();z instanceof Ge&&x.push(this.stack.pop())}return x}},p.expandMacroAsText=function(y){var x=this.expandMacro(y);return x&&x.map(function(O){return O.text}).join("")},p._getExpansion=function(y){var x=this.macros.get(y);if(x==null)return x;var O=typeof x=="function"?x(this):x;if(typeof O=="string"){var z=0;if(O.indexOf("#")!==-1)for(var oe=O.replace(/##/g,"");oe.indexOf("#"+(z+1))!==-1;)++z;for(var be=new lo(O,this.settings),Re=[],it=be.lex();it.text!=="EOF";)Re.push(it),it=be.lex();Re.reverse();var dt={tokens:Re,numArgs:z};return dt}return O},p.isDefined=function(y){return this.macros.has(y)||ja.hasOwnProperty(y)||Gt.math.hasOwnProperty(y)||Gt.text.hasOwnProperty(y)||$o.hasOwnProperty(y)},K}(),qa={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"}},Zl={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u010F:"d\u030C",\u1E0B:"d\u0307",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u013A:"l\u0301",\u013E:"l\u030C",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u010E:"D\u030C",\u1E0A:"D\u0307",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0139:"L\u0301",\u013D:"L\u030C",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u0164:"T\u030C",\u1E6A:"T\u0307",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},zo=function(){function K(v,y){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new E0(v,y,this.mode),this.settings=y,this.leftrightDepth=0}var p=K.prototype;return p.expect=function(y,x){if(x===void 0&&(x=!0),this.fetch().text!==y)throw new me("Expected '"+y+"', got '"+this.fetch().text+"'",this.fetch());x&&this.consume()},p.consume=function(){this.nextToken=null},p.fetch=function(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},p.switchMode=function(y){this.mode=y,this.gullet.switchMode(y)},p.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var y=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),y},p.parseExpression=function(y,x){for(var O=[];;){this.mode==="math"&&this.consumeSpaces();var z=this.fetch();if(K.endOfExpression.indexOf(z.text)!==-1||x&&z.text===x||y&&ja[z.text]&&ja[z.text].infix)break;var oe=this.parseAtom(x);if(!oe)break;O.push(oe)}return this.mode==="text"&&this.formLigatures(O),this.handleInfixNodes(O)},p.handleInfixNodes=function(y){for(var x=-1,O,z=0;z<y.length;z++){var oe=gr(y[z],"infix");if(oe){if(x!==-1)throw new me("only one infix operator per group",oe.token);x=z,O=oe.replaceWith}}if(x!==-1&&O){var be,Re,it=y.slice(0,x),dt=y.slice(x+1);it.length===1&&it[0].type==="ordgroup"?be=it[0]:be={type:"ordgroup",mode:this.mode,body:it},dt.length===1&&dt[0].type==="ordgroup"?Re=dt[0]:Re={type:"ordgroup",mode:this.mode,body:dt};var It;return O==="\\\\abovefrac"?It=this.callFunction(O,[be,y[x],Re],[]):It=this.callFunction(O,[be,Re],[]),[It]}else return y},p.handleSupSubscript=function(y){var x=this.fetch(),O=x.text;this.consume();var z=this.parseGroup(y,!1,K.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!z)throw new me("Expected group after '"+O+"'",x);return z},p.formatUnsupportedCmd=function(y){for(var x=[],O=0;O<y.length;O++)x.push({type:"textord",mode:"text",text:y[O]});var z={type:"text",mode:this.mode,body:x},oe={type:"color",mode:this.mode,color:this.settings.errorColor,body:[z]};return oe},p.parseAtom=function(y){var x=this.parseGroup("atom",!1,null,y);if(this.mode==="text")return x;for(var O,z;;){this.consumeSpaces();var oe=this.fetch();if(oe.text==="\\limits"||oe.text==="\\nolimits"){var be=gr(x,"op");if(be){var Re=oe.text==="\\limits";be.limits=Re,be.alwaysHandleSupSub=!0}else if(be=gr(x,"operatorname"),be&&be.alwaysHandleSupSub){var it=oe.text==="\\limits";be.limits=it}else throw new me("Limit controls must follow a math operator",oe);this.consume()}else if(oe.text==="^"){if(O)throw new me("Double superscript",oe);O=this.handleSupSubscript("superscript")}else if(oe.text==="_"){if(z)throw new me("Double subscript",oe);z=this.handleSupSubscript("subscript")}else if(oe.text==="'"){if(O)throw new me("Double superscript",oe);var dt={type:"textord",mode:this.mode,text:"\\prime"},It=[dt];for(this.consume();this.fetch().text==="'";)It.push(dt),this.consume();this.fetch().text==="^"&&It.push(this.handleSupSubscript("superscript")),O={type:"ordgroup",mode:this.mode,body:It}}else break}return O||z?{type:"supsub",mode:this.mode,base:x,sup:O,sub:z}:x},p.parseFunction=function(y,x,O){var z=this.fetch(),oe=z.text,be=ja[oe];if(!be)return null;if(this.consume(),O!=null&&be.greediness<=O)throw new me("Got function '"+oe+"' with no arguments"+(x?" as "+x:""),z);if(this.mode==="text"&&!be.allowedInText)throw new me("Can't use function '"+oe+"' in text mode",z);if(this.mode==="math"&&be.allowedInMath===!1)throw new me("Can't use function '"+oe+"' in math mode",z);var Re=this.parseArguments(oe,be),it=Re.args,dt=Re.optArgs;return this.callFunction(oe,it,dt,z,y)},p.callFunction=function(y,x,O,z,oe){var be={funcName:y,parser:this,token:z,breakOnTokenText:oe},Re=ja[y];if(Re&&Re.handler)return Re.handler(be,x,O);throw new me("No function handler for "+y)},p.parseArguments=function(y,x){var O=x.numArgs+x.numOptionalArgs;if(O===0)return{args:[],optArgs:[]};for(var z=x.greediness,oe=[],be=[],Re=0;Re<O;Re++){var it=x.argTypes&&x.argTypes[Re],dt=Re<x.numOptionalArgs,It=Re>0&&!dt||Re===0&&!dt&&this.mode==="math",Xt=this.parseGroupOfType("argument to '"+y+"'",it,dt,z,It);if(!Xt){if(dt){be.push(null);continue}throw new me("Expected group after '"+y+"'",this.fetch())}(dt?be:oe).push(Xt)}return{args:oe,optArgs:be}},p.parseGroupOfType=function(y,x,O,z,oe){switch(x){case"color":return oe&&this.consumeSpaces(),this.parseColorGroup(O);case"size":return oe&&this.consumeSpaces(),this.parseSizeGroup(O);case"url":return this.parseUrlGroup(O,oe);case"math":case"text":return this.parseGroup(y,O,z,void 0,x,oe);case"hbox":{var be=this.parseGroup(y,O,z,void 0,"text",oe);if(!be)return be;var Re={type:"styling",mode:be.mode,body:[be],style:"text"};return Re}case"raw":{if(oe&&this.consumeSpaces(),O&&this.fetch().text==="{")return null;var it=this.parseStringGroup("raw",O,!0);if(it)return{type:"raw",mode:"text",string:it.text};throw new me("Expected raw group",this.fetch())}case"original":case null:case void 0:return this.parseGroup(y,O,z,void 0,void 0,oe);default:throw new me("Unknown group type as "+y,this.fetch())}},p.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},p.parseStringGroup=function(y,x,O){var z=x?"[":"{",oe=x?"]":"}",be=this.fetch();if(be.text!==z){if(x)return null;if(O&&be.text!=="EOF"&&/[^{}[\]]/.test(be.text))return this.consume(),be}var Re=this.mode;this.mode="text",this.expect(z);for(var it="",dt=this.fetch(),It=0,Xt=dt,ar;(ar=this.fetch()).text!==oe||O&&It>0;){switch(ar.text){case"EOF":throw new me("Unexpected end of input in "+y,dt.range(Xt,it));case z:It++;break;case oe:It--;break}Xt=ar,it+=Xt.text,this.consume()}return this.expect(oe),this.mode=Re,dt.range(Xt,it)},p.parseRegexGroup=function(y,x){var O=this.mode;this.mode="text";for(var z=this.fetch(),oe=z,be="",Re;(Re=this.fetch()).text!=="EOF"&&y.test(be+Re.text);)oe=Re,be+=oe.text,this.consume();if(be==="")throw new me("Invalid "+x+": '"+z.text+"'",z);return this.mode=O,z.range(oe,be)},p.parseColorGroup=function(y){var x=this.parseStringGroup("color",y);if(!x)return null;var O=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(x.text);if(!O)throw new me("Invalid color: '"+x.text+"'",x);var z=O[0];return/^[0-9a-f]{6}$/i.test(z)&&(z="#"+z),{type:"color-token",mode:this.mode,color:z}},p.parseSizeGroup=function(y){var x,O=!1;if(!y&&this.fetch().text!=="{"?x=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):x=this.parseStringGroup("size",y),!x)return null;!y&&x.text.length===0&&(x.text="0pt",O=!0);var z=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(x.text);if(!z)throw new me("Invalid size: '"+x.text+"'",x);var oe={number:+(z[1]+z[2]),unit:z[3]};if(!nt(oe))throw new me("Invalid unit: '"+oe.unit+"'",x);return{type:"size",mode:this.mode,value:oe,isBlank:O}},p.parseUrlGroup=function(y,x){this.gullet.lexer.setCatcode("%",13);var O=this.parseStringGroup("url",y,!0);if(this.gullet.lexer.setCatcode("%",14),!O)return null;var z=O.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:z}},p.parseGroup=function(y,x,O,z,oe,be){var Re=this.mode;oe&&this.switchMode(oe),be&&this.consumeSpaces();var it=this.fetch(),dt=it.text,It;if(x?dt==="[":dt==="{"||dt==="\\begingroup"){this.consume();var Xt=K.endOfGroup[dt];this.gullet.beginGroup();var ar=this.parseExpression(!1,Xt),Sr=this.fetch();this.expect(Xt),this.gullet.endGroup(),It={type:"ordgroup",mode:this.mode,loc:Xe.range(it,Sr),body:ar,semisimple:dt==="\\begingroup"||void 0}}else if(x)It=null;else if(It=this.parseFunction(z,y,O)||this.parseSymbol(),It==null&&dt[0]==="\\"&&!$o.hasOwnProperty(dt)){if(this.settings.throwOnError)throw new me("Undefined control sequence: "+dt,it);It=this.formatUnsupportedCmd(dt),this.consume()}return oe&&this.switchMode(Re),It},p.formLigatures=function(y){for(var x=y.length-1,O=0;O<x;++O){var z=y[O],oe=z.text;oe==="-"&&y[O+1].text==="-"&&(O+1<x&&y[O+2].text==="-"?(y.splice(O,3,{type:"textord",mode:"text",loc:Xe.range(z,y[O+2]),text:"---"}),x-=2):(y.splice(O,2,{type:"textord",mode:"text",loc:Xe.range(z,y[O+1]),text:"--"}),x-=1)),(oe==="'"||oe==="`")&&y[O+1].text===oe&&(y.splice(O,2,{type:"textord",mode:"text",loc:Xe.range(z,y[O+1]),text:oe+oe}),x-=1)}},p.parseSymbol=function(){var y=this.fetch(),x=y.text;if(/^\\verb[^a-zA-Z]/.test(x)){this.consume();var O=x.slice(5),z=O.charAt(0)==="*";if(z&&(O=O.slice(1)),O.length<2||O.charAt(0)!==O.slice(-1))throw new me(`\\verb assertion failed --
please report what input caused this bug`);return O=O.slice(1,-1),{type:"verb",mode:"text",body:O,star:z}}Zl.hasOwnProperty(x[0])&&!Gt[this.mode][x[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+x[0]+'" used in math mode',y),x=Zl[x[0]]+x.substr(1));var oe=us.exec(x);oe&&(x=x.substring(0,oe.index),x==="i"?x="\u0131":x==="j"&&(x="\u0237"));var be;if(Gt[this.mode][x]){this.settings.strict&&this.mode==="math"&&xr.indexOf(x)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+x[0]+'" used in math mode',y);var Re=Gt[this.mode][x].group,it=Xe.range(y),dt;if(Dt.hasOwnProperty(Re)){var It=Re;dt={type:"atom",mode:this.mode,family:It,loc:it,text:x}}else dt={type:Re,mode:this.mode,loc:it,text:x};be=dt}else if(x.charCodeAt(0)>=128)this.settings.strict&&(rt(x.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+x[0]+'" used in math mode',y):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+x[0]+'"'+(" ("+x.charCodeAt(0)+")"),y)),be={type:"textord",mode:"text",loc:Xe.range(y),text:x};else return null;if(this.consume(),oe)for(var Xt=0;Xt<oe[0].length;Xt++){var ar=oe[0][Xt];if(!qa[ar])throw new me("Unknown accent ' "+ar+"'",y);var Sr=qa[ar][this.mode];if(!Sr)throw new me("Accent "+ar+" unsupported in "+this.mode+" mode",y);be={type:"accent",mode:this.mode,loc:Xe.range(y),label:Sr,isStretchy:!1,isShifty:!0,base:be}}return be},K}();zo.endOfExpression=["}","\\endgroup","\\end","\\right","&"],zo.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},zo.SUPSUB_GREEDINESS=1;var Ko=function(p,v){if(!(typeof p=="string"||p instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var y=new zo(p,v);delete y.gullet.macros.current["\\df@tag"];var x=y.parse();if(y.gullet.macros.get("\\df@tag")){if(!v.displayMode)throw new me("\\tag works only in display equations");y.gullet.feed("\\df@tag"),x=[{type:"tag",mode:"text",body:x,tag:y.parse()}]}return x},vl=Ko,Yl=function(p,v,y){v.textContent="";var x=cs(p,y).toNode();v.appendChild(x)};typeof document!="undefined"&&document.compatMode!=="CSS1Compat"&&(typeof console!="undefined"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Yl=function(){throw new me("KaTeX doesn't work in quirks mode.")});var Za=function(p,v){var y=cs(p,v).toMarkup();return y},yl=function(p,v){var y=new W(v);return vl(p,y)},co=function(p,v,y){if(y.throwOnError||!(p instanceof me))throw p;var x=Ie.makeSpan(["katex-error"],[new Be(v)]);return x.setAttribute("title",p.toString()),x.setAttribute("style","color:"+y.errorColor),x},cs=function(p,v){var y=new W(v);try{var x=vl(p,y);return mi(x,p,y)}catch(O){return co(O,p,y)}},ho=function(p,v){var y=new W(v);try{var x=vl(p,y);return Ni(x,p,y)}catch(O){return co(O,p,y)}},bl={version:"0.11.1",render:Yl,renderToString:Za,ParseError:me,__parse:yl,__renderToDomTree:cs,__renderToHTMLTree:ho,__setFontMetrics:cr,__defineSymbol:k,__defineMacro:ke,__domTree:{Span:Ye,Anchor:Et,SymbolNode:Be,SvgNode:et,PathNode:gt,LineNode:vt}},k0=Y.default=bl}]).default})},32834:function(Ir){(function(Mt,Y){Ir.exports=Y()})(this,function(){"use strict";function Mt(Ee,Ue){for(var Ze=0;Ze<Ue.length;Ze++){var G=Ue[Ze];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(Ee,G.key,G)}}function Y(Ee,Ue,Ze){return Ue&&Mt(Ee.prototype,Ue),Ze&&Mt(Ee,Ze),Ee}function Ce(Ee,Ue){if(Ee){if(typeof Ee=="string")return Le(Ee,Ue);var Ze=Object.prototype.toString.call(Ee).slice(8,-1);if(Ze==="Object"&&Ee.constructor&&(Ze=Ee.constructor.name),Ze==="Map"||Ze==="Set")return Array.from(Ee);if(Ze==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ze))return Le(Ee,Ue)}}function Le(Ee,Ue){(Ue==null||Ue>Ee.length)&&(Ue=Ee.length);for(var Ze=0,G=new Array(Ue);Ze<Ue;Ze++)G[Ze]=Ee[Ze];return G}function Xe(Ee,Ue){var Ze=typeof Symbol!="undefined"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(Ze)return(Ze=Ze.call(Ee)).next.bind(Ze);if(Array.isArray(Ee)||(Ze=Ce(Ee))||Ue&&Ee&&typeof Ee.length=="number"){Ze&&(Ee=Ze);var G=0;return function(){return G>=Ee.length?{done:!0}:{done:!1,value:Ee[G++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ge={exports:{}};function Oe(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function me(Ee){Ge.exports.defaults=Ee}Ge.exports={defaults:Oe(),getDefaults:Oe,changeDefaults:me};var Pe=/[&<>"']/,$=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,te=/[<>"']|&(?!#?\w+;)/g,V={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},A=function(Ue){return V[Ue]};function b(Ee,Ue){if(Ue){if(Pe.test(Ee))return Ee.replace($,A)}else if(c.test(Ee))return Ee.replace(te,A);return Ee}var M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(Ee){return Ee.replace(M,function(Ue,Ze){return Ze=Ze.toLowerCase(),Ze==="colon"?":":Ze.charAt(0)==="#"?Ze.charAt(1)==="x"?String.fromCharCode(parseInt(Ze.substring(2),16)):String.fromCharCode(+Ze.substring(1)):""})}var re=/(^|[^\[])\^/g;function se(Ee,Ue){Ee=Ee.source||Ee,Ue=Ue||"";var Ze={replace:function(pe,_e){return _e=_e.source||_e,_e=_e.replace(re,"$1"),Ee=Ee.replace(pe,_e),Ze},getRegex:function(){return new RegExp(Ee,Ue)}};return Ze}var q=/[^\w:]/g,W=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Z(Ee,Ue,Ze){if(Ee){var G;try{G=decodeURIComponent(I(Ze)).replace(q,"").toLowerCase()}catch(pe){return null}if(G.indexOf("javascript:")===0||G.indexOf("vbscript:")===0||G.indexOf("data:")===0)return null}Ue&&!W.test(Ze)&&(Ze=ye(Ue,Ze));try{Ze=encodeURI(Ze).replace(/%25/g,"%")}catch(pe){return null}return Ze}var le={},P=/^[^:]+:\/*[^/]*$/,ae=/^([^:]+:)[\s\S]*$/,Te=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ye(Ee,Ue){le[" "+Ee]||(P.test(Ee)?le[" "+Ee]=Ee+"/":le[" "+Ee]=ft(Ee,"/",!0)),Ee=le[" "+Ee];var Ze=Ee.indexOf(":")===-1;return Ue.substring(0,2)==="//"?Ze?Ue:Ee.replace(ae,"$1")+Ue:Ue.charAt(0)==="/"?Ze?Ue:Ee.replace(Te,"$1")+Ue:Ee+Ue}var Je={exec:function(){}};function Ve(Ee){for(var Ue=1,Ze,G;Ue<arguments.length;Ue++){Ze=arguments[Ue];for(G in Ze)Object.prototype.hasOwnProperty.call(Ze,G)&&(Ee[G]=Ze[G])}return Ee}function st(Ee,Ue){var Ze=Ee.replace(/\|/g,function(_e,Ne,H){for(var Vt=!1,Se=Ne;--Se>=0&&H[Se]==="\\";)Vt=!Vt;return Vt?"|":" |"}),G=Ze.split(/ \|/),pe=0;if(G.length>Ue)G.splice(Ue);else for(;G.length<Ue;)G.push("");for(;pe<G.length;pe++)G[pe]=G[pe].trim().replace(/\\\|/g,"|");return G}function ft(Ee,Ue,Ze){var G=Ee.length;if(G===0)return"";for(var pe=0;pe<G;){var _e=Ee.charAt(G-pe-1);if(_e===Ue&&!Ze)pe++;else if(_e!==Ue&&Ze)pe++;else break}return Ee.substr(0,G-pe)}function ie(Ee,Ue){if(Ee.indexOf(Ue[1])===-1)return-1;for(var Ze=Ee.length,G=0,pe=0;pe<Ze;pe++)if(Ee[pe]==="\\")pe++;else if(Ee[pe]===Ue[0])G++;else if(Ee[pe]===Ue[1]&&(G--,G<0))return pe;return-1}function Q(Ee){Ee&&Ee.sanitize&&!Ee.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ue(Ee,Ue){if(Ue<1)return"";for(var Ze="";Ue>1;)Ue&1&&(Ze+=Ee),Ue>>=1,Ee+=Ee;return Ze+Ee}var ce={escape:b,unescape:I,edit:se,cleanUrl:Z,resolveUrl:ye,noopTest:Je,merge:Ve,splitCells:st,rtrim:ft,findClosingBracket:ie,checkSanitizeDeprecation:Q,repeatString:ue},De=Ge.exports.defaults,xe=ce.rtrim,C=ce.splitCells,B=ce.escape,ee=ce.findClosingBracket;function we(Ee,Ue,Ze){var G=Ue.href,pe=Ue.title?B(Ue.title):null,_e=Ee[1].replace(/\\([\[\]])/g,"$1");return Ee[0].charAt(0)!=="!"?{type:"link",raw:Ze,href:G,title:pe,text:_e}:{type:"image",raw:Ze,href:G,title:pe,text:B(_e)}}function rt(Ee,Ue){var Ze=Ee.match(/^(\s+)(?:```)/);if(Ze===null)return Ue;var G=Ze[1];return Ue.split(`
`).map(function(pe){var _e=pe.match(/^\s+/);if(_e===null)return pe;var Ne=_e[0];return Ne.length>=G.length?pe.slice(G.length):pe}).join(`
`)}var tt=function(){function Ee(Ze){this.options=Ze||De}var Ue=Ee.prototype;return Ue.space=function(G){var pe=this.rules.block.newline.exec(G);if(pe)return pe[0].length>1?{type:"space",raw:pe[0]}:{raw:`
`}},Ue.code=function(G){var pe=this.rules.block.code.exec(G);if(pe){var _e=pe[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:pe[0],codeBlockStyle:"indented",text:this.options.pedantic?_e:xe(_e,`
`)}}},Ue.fences=function(G){var pe=this.rules.block.fences.exec(G);if(pe){var _e=pe[0],Ne=rt(_e,pe[3]||"");return{type:"code",raw:_e,lang:pe[2]?pe[2].trim():pe[2],text:Ne}}},Ue.heading=function(G){var pe=this.rules.block.heading.exec(G);if(pe){var _e=pe[2].trim();if(/#$/.test(_e)){var Ne=xe(_e,"#");(this.options.pedantic||!Ne||/ $/.test(Ne))&&(_e=Ne.trim())}return{type:"heading",raw:pe[0],depth:pe[1].length,text:_e}}},Ue.nptable=function(G){var pe=this.rules.block.nptable.exec(G);if(pe){var _e={type:"table",header:C(pe[1].replace(/^ *| *\| *$/g,"")),align:pe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:pe[3]?pe[3].replace(/\n$/,"").split(`
`):[],raw:pe[0]};if(_e.header.length===_e.align.length){var Ne=_e.align.length,H;for(H=0;H<Ne;H++)/^ *-+: *$/.test(_e.align[H])?_e.align[H]="right":/^ *:-+: *$/.test(_e.align[H])?_e.align[H]="center":/^ *:-+ *$/.test(_e.align[H])?_e.align[H]="left":_e.align[H]=null;for(Ne=_e.cells.length,H=0;H<Ne;H++)_e.cells[H]=C(_e.cells[H],_e.header.length);return _e}}},Ue.hr=function(G){var pe=this.rules.block.hr.exec(G);if(pe)return{type:"hr",raw:pe[0]}},Ue.blockquote=function(G){var pe=this.rules.block.blockquote.exec(G);if(pe){var _e=pe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:pe[0],text:_e}}},Ue.list=function(G){var pe=this.rules.block.list.exec(G);if(pe){var _e=pe[0],Ne=pe[2],H=Ne.length>1,Vt={type:"list",raw:_e,ordered:H,start:H?+Ne.slice(0,-1):"",loose:!1,items:[]},Se=pe[0].match(this.rules.block.item),qt=!1,vr,Xr,An,Kr,yr,gn,fe,Ae,Ct,at=Se.length;An=this.rules.block.listItemStart.exec(Se[0]);for(var xt=0;xt<at;xt++){if(vr=Se[xt],_e=vr,this.options.pedantic||(Ct=vr.match(new RegExp("\\n\\s*\\n {0,"+(An[0].length-1)+"}\\S")),Ct&&(yr=vr.length-Ct.index+Se.slice(xt+1).join(`
`).length,Vt.raw=Vt.raw.substring(0,Vt.raw.length-yr),vr=vr.substring(0,Ct.index),_e=vr,at=xt+1)),xt!==at-1){if(Kr=this.rules.block.listItemStart.exec(Se[xt+1]),this.options.pedantic?Kr[1].length>An[1].length:Kr[1].length>=An[0].length||Kr[1].length>3){Se.splice(xt,2,Se[xt]+(!this.options.pedantic&&Kr[1].length<An[0].length&&!Se[xt].match(/\n$/)?"":`
`)+Se[xt+1]),xt--,at--;continue}else(!this.options.pedantic||this.options.smartLists?Kr[2][Kr[2].length-1]!==Ne[Ne.length-1]:H===(Kr[2].length===1))&&(yr=Se.slice(xt+1).join(`
`).length,Vt.raw=Vt.raw.substring(0,Vt.raw.length-yr),xt=at-1);An=Kr}Xr=vr.length,vr=vr.replace(/^ *([*+-]|\d+[.)]) ?/,""),~vr.indexOf(`
`)&&(Xr-=vr.length,vr=this.options.pedantic?vr.replace(/^ {1,4}/gm,""):vr.replace(new RegExp("^ {1,"+Xr+"}","gm"),"")),vr=xe(vr,`
`),xt!==at-1&&(_e=_e+`
`),gn=qt||/\n\n(?!\s*$)/.test(_e),xt!==at-1&&(qt=_e.slice(-2)===`
`,gn||(gn=qt)),gn&&(Vt.loose=!0),this.options.gfm&&(fe=/^\[[ xX]\] /.test(vr),Ae=void 0,fe&&(Ae=vr[1]!==" ",vr=vr.replace(/^\[[ xX]\] +/,""))),Vt.items.push({type:"list_item",raw:_e,task:fe,checked:Ae,loose:gn,text:vr})}return Vt}},Ue.html=function(G){var pe=this.rules.block.html.exec(G);if(pe)return{type:this.options.sanitize?"paragraph":"html",raw:pe[0],pre:!this.options.sanitizer&&(pe[1]==="pre"||pe[1]==="script"||pe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):B(pe[0]):pe[0]}},Ue.def=function(G){var pe=this.rules.block.def.exec(G);if(pe){pe[3]&&(pe[3]=pe[3].substring(1,pe[3].length-1));var _e=pe[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:_e,raw:pe[0],href:pe[2],title:pe[3]}}},Ue.table=function(G){var pe=this.rules.block.table.exec(G);if(pe){var _e={type:"table",header:C(pe[1].replace(/^ *| *\| *$/g,"")),align:pe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:pe[3]?pe[3].replace(/\n$/,"").split(`
`):[]};if(_e.header.length===_e.align.length){_e.raw=pe[0];var Ne=_e.align.length,H;for(H=0;H<Ne;H++)/^ *-+: *$/.test(_e.align[H])?_e.align[H]="right":/^ *:-+: *$/.test(_e.align[H])?_e.align[H]="center":/^ *:-+ *$/.test(_e.align[H])?_e.align[H]="left":_e.align[H]=null;for(Ne=_e.cells.length,H=0;H<Ne;H++)_e.cells[H]=C(_e.cells[H].replace(/^ *\| *| *\| *$/g,""),_e.header.length);return _e}}},Ue.lheading=function(G){var pe=this.rules.block.lheading.exec(G);if(pe)return{type:"heading",raw:pe[0],depth:pe[2].charAt(0)==="="?1:2,text:pe[1]}},Ue.paragraph=function(G){var pe=this.rules.block.paragraph.exec(G);if(pe)return{type:"paragraph",raw:pe[0],text:pe[1].charAt(pe[1].length-1)===`
`?pe[1].slice(0,-1):pe[1]}},Ue.text=function(G){var pe=this.rules.block.text.exec(G);if(pe)return{type:"text",raw:pe[0],text:pe[0]}},Ue.escape=function(G){var pe=this.rules.inline.escape.exec(G);if(pe)return{type:"escape",raw:pe[0],text:B(pe[1])}},Ue.tag=function(G,pe,_e){var Ne=this.rules.inline.tag.exec(G);if(Ne)return!pe&&/^<a /i.test(Ne[0])?pe=!0:pe&&/^<\/a>/i.test(Ne[0])&&(pe=!1),!_e&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ne[0])?_e=!0:_e&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ne[0])&&(_e=!1),{type:this.options.sanitize?"text":"html",raw:Ne[0],inLink:pe,inRawBlock:_e,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ne[0]):B(Ne[0]):Ne[0]}},Ue.link=function(G){var pe=this.rules.inline.link.exec(G);if(pe){var _e=pe[2].trim();if(!this.options.pedantic&&/^</.test(_e)){if(!/>$/.test(_e))return;var Ne=xe(_e.slice(0,-1),"\\");if((_e.length-Ne.length)%2===0)return}else{var H=ee(pe[2],"()");if(H>-1){var Vt=pe[0].indexOf("!")===0?5:4,Se=Vt+pe[1].length+H;pe[2]=pe[2].substring(0,H),pe[0]=pe[0].substring(0,Se).trim(),pe[3]=""}}var qt=pe[2],vr="";if(this.options.pedantic){var Xr=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(qt);Xr&&(qt=Xr[1],vr=Xr[3])}else vr=pe[3]?pe[3].slice(1,-1):"";return qt=qt.trim(),/^</.test(qt)&&(this.options.pedantic&&!/>$/.test(_e)?qt=qt.slice(1):qt=qt.slice(1,-1)),we(pe,{href:qt&&qt.replace(this.rules.inline._escapes,"$1"),title:vr&&vr.replace(this.rules.inline._escapes,"$1")},pe[0])}},Ue.reflink=function(G,pe){var _e;if((_e=this.rules.inline.reflink.exec(G))||(_e=this.rules.inline.nolink.exec(G))){var Ne=(_e[2]||_e[1]).replace(/\s+/g," ");if(Ne=pe[Ne.toLowerCase()],!Ne||!Ne.href){var H=_e[0].charAt(0);return{type:"text",raw:H,text:H}}return we(_e,Ne,_e[0])}},Ue.emStrong=function(G,pe,_e){_e===void 0&&(_e="");var Ne=this.rules.inline.emStrong.lDelim.exec(G);if(Ne&&!(Ne[3]&&_e.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var H=Ne[1]||Ne[2]||"";if(!H||H&&(_e===""||this.rules.inline.punctuation.exec(_e))){var Vt=Ne[0].length-1,Se,qt,vr=Vt,Xr=0,An=Ne[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(An.lastIndex=0,pe=pe.slice(-1*G.length+Vt);(Ne=An.exec(pe))!=null;)if(Se=Ne[1]||Ne[2]||Ne[3]||Ne[4]||Ne[5]||Ne[6],!!Se){if(qt=Se.length,Ne[3]||Ne[4]){vr+=qt;continue}else if((Ne[5]||Ne[6])&&Vt%3&&!((Vt+qt)%3)){Xr+=qt;continue}if(vr-=qt,!(vr>0))return qt=Math.min(qt,qt+vr+Xr),Math.min(Vt,qt)%2?{type:"em",raw:G.slice(0,Vt+Ne.index+qt+1),text:G.slice(1,Vt+Ne.index+qt)}:{type:"strong",raw:G.slice(0,Vt+Ne.index+qt+1),text:G.slice(2,Vt+Ne.index+qt-1)}}}}},Ue.codespan=function(G){var pe=this.rules.inline.code.exec(G);if(pe){var _e=pe[2].replace(/\n/g," "),Ne=/[^ ]/.test(_e),H=/^ /.test(_e)&&/ $/.test(_e);return Ne&&H&&(_e=_e.substring(1,_e.length-1)),_e=B(_e,!0),{type:"codespan",raw:pe[0],text:_e}}},Ue.br=function(G){var pe=this.rules.inline.br.exec(G);if(pe)return{type:"br",raw:pe[0]}},Ue.del=function(G){var pe=this.rules.inline.del.exec(G);if(pe)return{type:"del",raw:pe[0],text:pe[2]}},Ue.autolink=function(G,pe){var _e=this.rules.inline.autolink.exec(G);if(_e){var Ne,H;return _e[2]==="@"?(Ne=B(this.options.mangle?pe(_e[1]):_e[1]),H="mailto:"+Ne):(Ne=B(_e[1]),H=Ne),{type:"link",raw:_e[0],text:Ne,href:H,tokens:[{type:"text",raw:Ne,text:Ne}]}}},Ue.url=function(G,pe){var _e;if(_e=this.rules.inline.url.exec(G)){var Ne,H;if(_e[2]==="@")Ne=B(this.options.mangle?pe(_e[0]):_e[0]),H="mailto:"+Ne;else{var Vt;do Vt=_e[0],_e[0]=this.rules.inline._backpedal.exec(_e[0])[0];while(Vt!==_e[0]);Ne=B(_e[0]),_e[1]==="www."?H="http://"+Ne:H=Ne}return{type:"link",raw:_e[0],text:Ne,href:H,tokens:[{type:"text",raw:Ne,text:Ne}]}}},Ue.inlineText=function(G,pe,_e){var Ne=this.rules.inline.text.exec(G);if(Ne){var H;return pe?H=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ne[0]):B(Ne[0]):Ne[0]:H=B(this.options.smartypants?_e(Ne[0]):Ne[0]),{type:"text",raw:Ne[0],text:H}}},Ee}(),ot=ce.noopTest,je=ce.edit,nr=ce.merge,Kt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ot,table:ot,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};Kt._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Kt._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Kt.def=je(Kt.def).replace("label",Kt._label).replace("title",Kt._title).getRegex(),Kt.bullet=/(?:[*+-]|\d{1,9}[.)])/,Kt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Kt.item=je(Kt.item,"gm").replace(/bull/g,Kt.bullet).getRegex(),Kt.listItemStart=je(/^( *)(bull) */).replace("bull",Kt.bullet).getRegex(),Kt.list=je(Kt.list).replace(/bull/g,Kt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Kt.def.source+")").getRegex(),Kt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Kt.html=je(Kt.html,"i").replace("comment",Kt._comment).replace("tag",Kt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kt.paragraph=je(Kt._paragraph).replace("hr",Kt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Kt._tag).getRegex(),Kt.blockquote=je(Kt.blockquote).replace("paragraph",Kt.paragraph).getRegex(),Kt.normal=nr({},Kt),Kt.gfm=nr({},Kt.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Kt.gfm.nptable=je(Kt.gfm.nptable).replace("hr",Kt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Kt._tag).getRegex(),Kt.gfm.table=je(Kt.gfm.table).replace("hr",Kt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Kt._tag).getRegex(),Kt.pedantic=nr({},Kt.normal,{html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ot,paragraph:je(Kt.normal._paragraph).replace("hr",Kt.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Kt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Lt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ot,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ot,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Lt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Lt.punctuation=je(Lt.punctuation).replace(/punctuation/g,Lt._punctuation).getRegex(),Lt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Lt.escapedEmSt=/\\\*|\\_/g,Lt._comment=je(Kt._comment).replace("(?:-->|$)","-->").getRegex(),Lt.emStrong.lDelim=je(Lt.emStrong.lDelim).replace(/punct/g,Lt._punctuation).getRegex(),Lt.emStrong.rDelimAst=je(Lt.emStrong.rDelimAst,"g").replace(/punct/g,Lt._punctuation).getRegex(),Lt.emStrong.rDelimUnd=je(Lt.emStrong.rDelimUnd,"g").replace(/punct/g,Lt._punctuation).getRegex(),Lt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Lt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Lt._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Lt.autolink=je(Lt.autolink).replace("scheme",Lt._scheme).replace("email",Lt._email).getRegex(),Lt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Lt.tag=je(Lt.tag).replace("comment",Lt._comment).replace("attribute",Lt._attribute).getRegex(),Lt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Lt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Lt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Lt.link=je(Lt.link).replace("label",Lt._label).replace("href",Lt._href).replace("title",Lt._title).getRegex(),Lt.reflink=je(Lt.reflink).replace("label",Lt._label).getRegex(),Lt.reflinkSearch=je(Lt.reflinkSearch,"g").replace("reflink",Lt.reflink).replace("nolink",Lt.nolink).getRegex(),Lt.normal=nr({},Lt),Lt.pedantic=nr({},Lt.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:je(/^!?\[(label)\]\((.*?)\)/).replace("label",Lt._label).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lt._label).getRegex()}),Lt.gfm=nr({},Lt.normal,{escape:je(Lt.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Lt.gfm.url=je(Lt.gfm.url,"i").replace("email",Lt.gfm._extended_email).getRegex(),Lt.breaks=nr({},Lt.gfm,{br:je(Lt.br).replace("{2,}","*").getRegex(),text:je(Lt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Gr={block:Kt,inline:Lt},Rr=tt,hn=Ge.exports.defaults,Nr=Gr.block,an=Gr.inline,zr=ce.repeatString;function We(Ee){return Ee.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function mt(Ee){var Ue="",Ze,G,pe=Ee.length;for(Ze=0;Ze<pe;Ze++)G=Ee.charCodeAt(Ze),Math.random()>.5&&(G="x"+G.toString(16)),Ue+="&#"+G+";";return Ue}var Ye=function(){function Ee(Ze){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ze||hn,this.options.tokenizer=this.options.tokenizer||new Rr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var G={block:Nr.normal,inline:an.normal};this.options.pedantic?(G.block=Nr.pedantic,G.inline=an.pedantic):this.options.gfm&&(G.block=Nr.gfm,this.options.breaks?G.inline=an.breaks:G.inline=an.gfm),this.tokenizer.rules=G}Ee.lex=function(G,pe){var _e=new Ee(pe);return _e.lex(G)},Ee.lexInline=function(G,pe){var _e=new Ee(pe);return _e.inlineTokens(G)};var Ue=Ee.prototype;return Ue.lex=function(G){return G=G.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(G,this.tokens,!0),this.inline(this.tokens),this.tokens},Ue.blockTokens=function(G,pe,_e){pe===void 0&&(pe=[]),_e===void 0&&(_e=!0),this.options.pedantic&&(G=G.replace(/^ +$/gm,""));for(var Ne,H,Vt,Se;G;){if(Ne=this.tokenizer.space(G)){G=G.substring(Ne.raw.length),Ne.type&&pe.push(Ne);continue}if(Ne=this.tokenizer.code(G)){G=G.substring(Ne.raw.length),Se=pe[pe.length-1],Se&&Se.type==="paragraph"?(Se.raw+=`
`+Ne.raw,Se.text+=`
`+Ne.text):pe.push(Ne);continue}if(Ne=this.tokenizer.fences(G)){G=G.substring(Ne.raw.length),pe.push(Ne);continue}if(Ne=this.tokenizer.heading(G)){G=G.substring(Ne.raw.length),pe.push(Ne);continue}if(Ne=this.tokenizer.nptable(G)){G=G.substring(Ne.raw.length),pe.push(Ne);continue}if(Ne=this.tokenizer.hr(G)){G=G.substring(Ne.raw.length),pe.push(Ne);continue}if(Ne=this.tokenizer.blockquote(G)){G=G.substring(Ne.raw.length),Ne.tokens=this.blockTokens(Ne.text,[],_e),pe.push(Ne);continue}if(Ne=this.tokenizer.list(G)){for(G=G.substring(Ne.raw.length),Vt=Ne.items.length,H=0;H<Vt;H++)Ne.items[H].tokens=this.blockTokens(Ne.items[H].text,[],!1);pe.push(Ne);continue}if(Ne=this.tokenizer.html(G)){G=G.substring(Ne.raw.length),pe.push(Ne);continue}if(_e&&(Ne=this.tokenizer.def(G))){G=G.substring(Ne.raw.length),this.tokens.links[Ne.tag]||(this.tokens.links[Ne.tag]={href:Ne.href,title:Ne.title});continue}if(Ne=this.tokenizer.table(G)){G=G.substring(Ne.raw.length),pe.push(Ne);continue}if(Ne=this.tokenizer.lheading(G)){G=G.substring(Ne.raw.length),pe.push(Ne);continue}if(_e&&(Ne=this.tokenizer.paragraph(G))){G=G.substring(Ne.raw.length),pe.push(Ne);continue}if(Ne=this.tokenizer.text(G)){G=G.substring(Ne.raw.length),Se=pe[pe.length-1],Se&&Se.type==="text"?(Se.raw+=`
`+Ne.raw,Se.text+=`
`+Ne.text):pe.push(Ne);continue}if(G){var qt="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(qt);break}else throw new Error(qt)}}return pe},Ue.inline=function(G){var pe,_e,Ne,H,Vt,Se,qt=G.length;for(pe=0;pe<qt;pe++)switch(Se=G[pe],Se.type){case"paragraph":case"text":case"heading":{Se.tokens=[],this.inlineTokens(Se.text,Se.tokens);break}case"table":{for(Se.tokens={header:[],cells:[]},H=Se.header.length,_e=0;_e<H;_e++)Se.tokens.header[_e]=[],this.inlineTokens(Se.header[_e],Se.tokens.header[_e]);for(H=Se.cells.length,_e=0;_e<H;_e++)for(Vt=Se.cells[_e],Se.tokens.cells[_e]=[],Ne=0;Ne<Vt.length;Ne++)Se.tokens.cells[_e][Ne]=[],this.inlineTokens(Vt[Ne],Se.tokens.cells[_e][Ne]);break}case"blockquote":{this.inline(Se.tokens);break}case"list":{for(H=Se.items.length,_e=0;_e<H;_e++)this.inline(Se.items[_e].tokens);break}}return G},Ue.inlineTokens=function(G,pe,_e,Ne){pe===void 0&&(pe=[]),_e===void 0&&(_e=!1),Ne===void 0&&(Ne=!1);var H,Vt,Se=G,qt,vr,Xr;if(this.tokens.links){var An=Object.keys(this.tokens.links);if(An.length>0)for(;(qt=this.tokenizer.rules.inline.reflinkSearch.exec(Se))!=null;)An.includes(qt[0].slice(qt[0].lastIndexOf("[")+1,-1))&&(Se=Se.slice(0,qt.index)+"["+zr("a",qt[0].length-2)+"]"+Se.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(qt=this.tokenizer.rules.inline.blockSkip.exec(Se))!=null;)Se=Se.slice(0,qt.index)+"["+zr("a",qt[0].length-2)+"]"+Se.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(qt=this.tokenizer.rules.inline.escapedEmSt.exec(Se))!=null;)Se=Se.slice(0,qt.index)+"++"+Se.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;G;){if(vr||(Xr=""),vr=!1,H=this.tokenizer.escape(G)){G=G.substring(H.raw.length),pe.push(H);continue}if(H=this.tokenizer.tag(G,_e,Ne)){G=G.substring(H.raw.length),_e=H.inLink,Ne=H.inRawBlock;var Kr=pe[pe.length-1];Kr&&H.type==="text"&&Kr.type==="text"?(Kr.raw+=H.raw,Kr.text+=H.text):pe.push(H);continue}if(H=this.tokenizer.link(G)){G=G.substring(H.raw.length),H.type==="link"&&(H.tokens=this.inlineTokens(H.text,[],!0,Ne)),pe.push(H);continue}if(H=this.tokenizer.reflink(G,this.tokens.links)){G=G.substring(H.raw.length);var yr=pe[pe.length-1];H.type==="link"?(H.tokens=this.inlineTokens(H.text,[],!0,Ne),pe.push(H)):yr&&H.type==="text"&&yr.type==="text"?(yr.raw+=H.raw,yr.text+=H.text):pe.push(H);continue}if(H=this.tokenizer.emStrong(G,Se,Xr)){G=G.substring(H.raw.length),H.tokens=this.inlineTokens(H.text,[],_e,Ne),pe.push(H);continue}if(H=this.tokenizer.codespan(G)){G=G.substring(H.raw.length),pe.push(H);continue}if(H=this.tokenizer.br(G)){G=G.substring(H.raw.length),pe.push(H);continue}if(H=this.tokenizer.del(G)){G=G.substring(H.raw.length),H.tokens=this.inlineTokens(H.text,[],_e,Ne),pe.push(H);continue}if(H=this.tokenizer.autolink(G,mt)){G=G.substring(H.raw.length),pe.push(H);continue}if(!_e&&(H=this.tokenizer.url(G,mt))){G=G.substring(H.raw.length),pe.push(H);continue}if(H=this.tokenizer.inlineText(G,Ne,We)){G=G.substring(H.raw.length),H.raw.slice(-1)!=="_"&&(Xr=H.raw.slice(-1)),vr=!0,Vt=pe[pe.length-1],Vt&&Vt.type==="text"?(Vt.raw+=H.raw,Vt.text+=H.text):pe.push(H);continue}if(G){var gn="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(gn);break}else throw new Error(gn)}}return pe},Y(Ee,null,[{key:"rules",get:function(){return{block:Nr,inline:an}}}]),Ee}(),Et=Ge.exports.defaults,Tt=ce.cleanUrl,ge=ce.escape,Be=function(){function Ee(Ze){this.options=Ze||Et}var Ue=Ee.prototype;return Ue.code=function(G,pe,_e){var Ne=(pe||"").match(/\S*/)[0];if(this.options.highlight){var H=this.options.highlight(G,Ne);H!=null&&H!==G&&(_e=!0,G=H)}return G=G.replace(/\n$/,"")+`
`,Ne?'<pre><code class="'+this.options.langPrefix+ge(Ne,!0)+'">'+(_e?G:ge(G,!0))+`</code></pre>
`:"<pre><code>"+(_e?G:ge(G,!0))+`</code></pre>
`},Ue.blockquote=function(G){return`<blockquote>
`+G+`</blockquote>
`},Ue.html=function(G){return G},Ue.heading=function(G,pe,_e,Ne){return this.options.headerIds?"<h"+pe+' id="'+this.options.headerPrefix+Ne.slug(_e)+'">'+G+"</h"+pe+`>
`:"<h"+pe+">"+G+"</h"+pe+`>
`},Ue.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Ue.list=function(G,pe,_e){var Ne=pe?"ol":"ul",H=pe&&_e!==1?' start="'+_e+'"':"";return"<"+Ne+H+`>
`+G+"</"+Ne+`>
`},Ue.listitem=function(G){return"<li>"+G+`</li>
`},Ue.checkbox=function(G){return"<input "+(G?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ue.paragraph=function(G){return"<p>"+G+`</p>
`},Ue.table=function(G,pe){return pe&&(pe="<tbody>"+pe+"</tbody>"),`<table>
<thead>
`+G+`</thead>
`+pe+`</table>
`},Ue.tablerow=function(G){return`<tr>
`+G+`</tr>
`},Ue.tablecell=function(G,pe){var _e=pe.header?"th":"td",Ne=pe.align?"<"+_e+' align="'+pe.align+'">':"<"+_e+">";return Ne+G+"</"+_e+`>
`},Ue.strong=function(G){return"<strong>"+G+"</strong>"},Ue.em=function(G){return"<em>"+G+"</em>"},Ue.codespan=function(G){return"<code>"+G+"</code>"},Ue.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ue.del=function(G){return"<del>"+G+"</del>"},Ue.link=function(G,pe,_e){if(G=Tt(this.options.sanitize,this.options.baseUrl,G),G===null)return _e;var Ne='<a href="'+ge(G)+'"';return pe&&(Ne+=' title="'+pe+'"'),Ne+=">"+_e+"</a>",Ne},Ue.image=function(G,pe,_e){if(G=Tt(this.options.sanitize,this.options.baseUrl,G),G===null)return _e;var Ne='<img src="'+G+'" alt="'+_e+'"';return pe&&(Ne+=' title="'+pe+'"'),Ne+=this.options.xhtml?"/>":">",Ne},Ue.text=function(G){return G},Ee}(),et=function(){function Ee(){}var Ue=Ee.prototype;return Ue.strong=function(G){return G},Ue.em=function(G){return G},Ue.codespan=function(G){return G},Ue.del=function(G){return G},Ue.html=function(G){return G},Ue.text=function(G){return G},Ue.link=function(G,pe,_e){return""+_e},Ue.image=function(G,pe,_e){return""+_e},Ue.br=function(){return""},Ee}(),gt=function(){function Ee(){this.seen={}}var Ue=Ee.prototype;return Ue.serialize=function(G){return G.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Ue.getNextSafeSlug=function(G,pe){var _e=G,Ne=0;if(this.seen.hasOwnProperty(_e)){Ne=this.seen[G];do Ne++,_e=G+"-"+Ne;while(this.seen.hasOwnProperty(_e))}return pe||(this.seen[G]=Ne,this.seen[_e]=0),_e},Ue.slug=function(G,pe){pe===void 0&&(pe={});var _e=this.serialize(G);return this.getNextSafeSlug(_e,pe.dryrun)},Ee}(),vt=Be,Ut=et,hr=gt,Yt=Ge.exports.defaults,Ke=ce.unescape,$t=function(){function Ee(Ze){this.options=Ze||Yt,this.options.renderer=this.options.renderer||new vt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ut,this.slugger=new hr}Ee.parse=function(G,pe){var _e=new Ee(pe);return _e.parse(G)},Ee.parseInline=function(G,pe){var _e=new Ee(pe);return _e.parseInline(G)};var Ue=Ee.prototype;return Ue.parse=function(G,pe){pe===void 0&&(pe=!0);var _e="",Ne,H,Vt,Se,qt,vr,Xr,An,Kr,yr,gn,fe,Ae,Ct,at,xt,Ot,ir,Jt=G.length;for(Ne=0;Ne<Jt;Ne++)switch(yr=G[Ne],yr.type){case"space":continue;case"hr":{_e+=this.renderer.hr();continue}case"heading":{_e+=this.renderer.heading(this.parseInline(yr.tokens),yr.depth,Ke(this.parseInline(yr.tokens,this.textRenderer)),this.slugger);continue}case"code":{_e+=this.renderer.code(yr.text,yr.lang,yr.escaped);continue}case"table":{for(An="",Xr="",Se=yr.header.length,H=0;H<Se;H++)Xr+=this.renderer.tablecell(this.parseInline(yr.tokens.header[H]),{header:!0,align:yr.align[H]});for(An+=this.renderer.tablerow(Xr),Kr="",Se=yr.cells.length,H=0;H<Se;H++){for(vr=yr.tokens.cells[H],Xr="",qt=vr.length,Vt=0;Vt<qt;Vt++)Xr+=this.renderer.tablecell(this.parseInline(vr[Vt]),{header:!1,align:yr.align[Vt]});Kr+=this.renderer.tablerow(Xr)}_e+=this.renderer.table(An,Kr);continue}case"blockquote":{Kr=this.parse(yr.tokens),_e+=this.renderer.blockquote(Kr);continue}case"list":{for(gn=yr.ordered,fe=yr.start,Ae=yr.loose,Se=yr.items.length,Kr="",H=0;H<Se;H++)at=yr.items[H],xt=at.checked,Ot=at.task,Ct="",at.task&&(ir=this.renderer.checkbox(xt),Ae?at.tokens.length>0&&at.tokens[0].type==="text"?(at.tokens[0].text=ir+" "+at.tokens[0].text,at.tokens[0].tokens&&at.tokens[0].tokens.length>0&&at.tokens[0].tokens[0].type==="text"&&(at.tokens[0].tokens[0].text=ir+" "+at.tokens[0].tokens[0].text)):at.tokens.unshift({type:"text",text:ir}):Ct+=ir),Ct+=this.parse(at.tokens,Ae),Kr+=this.renderer.listitem(Ct,Ot,xt);_e+=this.renderer.list(Kr,gn,fe);continue}case"html":{_e+=this.renderer.html(yr.text);continue}case"paragraph":{_e+=this.renderer.paragraph(this.parseInline(yr.tokens));continue}case"text":{for(Kr=yr.tokens?this.parseInline(yr.tokens):yr.text;Ne+1<Jt&&G[Ne+1].type==="text";)yr=G[++Ne],Kr+=`
`+(yr.tokens?this.parseInline(yr.tokens):yr.text);_e+=pe?this.renderer.paragraph(Kr):Kr;continue}default:{var xr='Token with "'+yr.type+'" type was not found.';if(this.options.silent){console.error(xr);return}else throw new Error(xr)}}return _e},Ue.parseInline=function(G,pe){pe=pe||this.renderer;var _e="",Ne,H,Vt=G.length;for(Ne=0;Ne<Vt;Ne++)switch(H=G[Ne],H.type){case"escape":{_e+=pe.text(H.text);break}case"html":{_e+=pe.html(H.text);break}case"link":{_e+=pe.link(H.href,H.title,this.parseInline(H.tokens,pe));break}case"image":{_e+=pe.image(H.href,H.title,H.text);break}case"strong":{_e+=pe.strong(this.parseInline(H.tokens,pe));break}case"em":{_e+=pe.em(this.parseInline(H.tokens,pe));break}case"codespan":{_e+=pe.codespan(H.text);break}case"br":{_e+=pe.br();break}case"del":{_e+=pe.del(this.parseInline(H.tokens,pe));break}case"text":{_e+=pe.text(H.text);break}default:{var Se='Token with "'+H.type+'" type was not found.';if(this.options.silent){console.error(Se);return}else throw new Error(Se)}}return _e},Ee}(),cr=Ye,Fe=$t,He=tt,qe=Be,Dt=et,St=gt,Pt=ce.merge,Gt=ce.checkSanitizeDeprecation,k=ce.escape,D=Ge.exports.getDefaults,ut=Ge.exports.changeDefaults,U=Ge.exports.defaults;function he(Ee,Ue,Ze){if(typeof Ee=="undefined"||Ee===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ee!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ee)+", string expected");if(typeof Ue=="function"&&(Ze=Ue,Ue=null),Ue=Pt({},he.defaults,Ue||{}),Gt(Ue),Ze){var G=Ue.highlight,pe;try{pe=cr.lex(Ee,Ue)}catch(Vt){return Ze(Vt)}var _e=function(Se){var qt;if(!Se)try{Ue.walkTokens&&he.walkTokens(pe,Ue.walkTokens),qt=Fe.parse(pe,Ue)}catch(vr){Se=vr}return Ue.highlight=G,Se?Ze(Se):Ze(null,qt)};if(!G||G.length<3||(delete Ue.highlight,!pe.length))return _e();var Ne=0;he.walkTokens(pe,function(Vt){Vt.type==="code"&&(Ne++,setTimeout(function(){G(Vt.text,Vt.lang,function(Se,qt){if(Se)return _e(Se);qt!=null&&qt!==Vt.text&&(Vt.text=qt,Vt.escaped=!0),Ne--,Ne===0&&_e()})},0))}),Ne===0&&_e();return}try{var H=cr.lex(Ee,Ue);return Ue.walkTokens&&he.walkTokens(H,Ue.walkTokens),Fe.parse(H,Ue)}catch(Vt){if(Vt.message+=`
Please report this to https://github.com/markedjs/marked.`,Ue.silent)return"<p>An error occurred:</p><pre>"+k(Vt.message+"",!0)+"</pre>";throw Vt}}he.options=he.setOptions=function(Ee){return Pt(he.defaults,Ee),ut(he.defaults),he},he.getDefaults=D,he.defaults=U,he.use=function(Ee){var Ue=Pt({},Ee);if(Ee.renderer&&function(){var G=he.defaults.renderer||new qe,pe=function(H){var Vt=G[H];G[H]=function(){for(var Se=arguments.length,qt=new Array(Se),vr=0;vr<Se;vr++)qt[vr]=arguments[vr];var Xr=Ee.renderer[H].apply(G,qt);return Xr===!1&&(Xr=Vt.apply(G,qt)),Xr}};for(var _e in Ee.renderer)pe(_e);Ue.renderer=G}(),Ee.tokenizer&&function(){var G=he.defaults.tokenizer||new He,pe=function(H){var Vt=G[H];G[H]=function(){for(var Se=arguments.length,qt=new Array(Se),vr=0;vr<Se;vr++)qt[vr]=arguments[vr];var Xr=Ee.tokenizer[H].apply(G,qt);return Xr===!1&&(Xr=Vt.apply(G,qt)),Xr}};for(var _e in Ee.tokenizer)pe(_e);Ue.tokenizer=G}(),Ee.walkTokens){var Ze=he.defaults.walkTokens;Ue.walkTokens=function(G){Ee.walkTokens(G),Ze&&Ze(G)}}he.setOptions(Ue)},he.walkTokens=function(Ee,Ue){for(var Ze=Xe(Ee),G;!(G=Ze()).done;){var pe=G.value;switch(Ue(pe),pe.type){case"table":{for(var _e=Xe(pe.tokens.header),Ne;!(Ne=_e()).done;){var H=Ne.value;he.walkTokens(H,Ue)}for(var Vt=Xe(pe.tokens.cells),Se;!(Se=Vt()).done;)for(var qt=Se.value,vr=Xe(qt),Xr;!(Xr=vr()).done;){var An=Xr.value;he.walkTokens(An,Ue)}break}case"list":{he.walkTokens(pe.items,Ue);break}default:pe.tokens&&he.walkTokens(pe.tokens,Ue)}}},he.parseInline=function(Ee,Ue){if(typeof Ee=="undefined"||Ee===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Ee!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Ee)+", string expected");Ue=Pt({},he.defaults,Ue||{}),Gt(Ue);try{var Ze=cr.lexInline(Ee,Ue);return Ue.walkTokens&&he.walkTokens(Ze,Ue.walkTokens),Fe.parseInline(Ze,Ue)}catch(G){if(G.message+=`
Please report this to https://github.com/markedjs/marked.`,Ue.silent)return"<p>An error occurred:</p><pre>"+k(G.message+"",!0)+"</pre>";throw G}},he.Parser=Fe,he.parser=Fe.parse,he.Renderer=qe,he.TextRenderer=Dt,he.Lexer=cr,he.lexer=cr.lex,he.Tokenizer=He,he.Slugger=St,he.parse=he;var Tr=he;return Tr})},11690:function(Ir){const Mt=/[&<>"']/,Y=/[&<>"']/g,Ce=/[<>"']|&(?!#?\w+;)/,Le=/[<>"']|&(?!#?\w+;)/g,Xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ge=ye=>Xe[ye];function Oe(ye,Je){if(Je){if(Mt.test(ye))return ye.replace(Y,Ge)}else if(Ce.test(ye))return ye.replace(Le,Ge);return ye}const me=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Pe(ye){return ye.replace(me,(Je,Ve)=>(Ve=Ve.toLowerCase(),Ve==="colon"?":":Ve.charAt(0)==="#"?Ve.charAt(1)==="x"?String.fromCharCode(parseInt(Ve.substring(2),16)):String.fromCharCode(+Ve.substring(1)):""))}const $=/(^|[^\[])\^/g;function c(ye,Je){ye=ye.source||ye,Je=Je||"";const Ve={replace:(st,ft)=>(ft=ft.source||ft,ft=ft.replace($,"$1"),ye=ye.replace(st,ft),Ve),getRegex:()=>new RegExp(ye,Je)};return Ve}const te=/[^\w:]/g,V=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(ye,Je,Ve){if(ye){let st;try{st=decodeURIComponent(Pe(Ve)).replace(te,"").toLowerCase()}catch(ft){return null}if(st.indexOf("javascript:")===0||st.indexOf("vbscript:")===0||st.indexOf("data:")===0)return null}Je&&!V.test(Ve)&&(Ve=se(Je,Ve));try{Ve=encodeURI(Ve).replace(/%25/g,"%")}catch(st){return null}return Ve}const b={},M=/^[^:]+:\/*[^/]*$/,I=/^([^:]+:)[\s\S]*$/,re=/^([^:]+:\/*[^/]*)[\s\S]*$/;function se(ye,Je){b[" "+ye]||(M.test(ye)?b[" "+ye]=ye+"/":b[" "+ye]=le(ye,"/",!0)),ye=b[" "+ye];const Ve=ye.indexOf(":")===-1;return Je.substring(0,2)==="//"?Ve?Je:ye.replace(I,"$1")+Je:Je.charAt(0)==="/"?Ve?Je:ye.replace(re,"$1")+Je:ye+Je}const q={exec:function(){}};function W(ye){let Je=1,Ve,st;for(;Je<arguments.length;Je++){Ve=arguments[Je];for(st in Ve)Object.prototype.hasOwnProperty.call(Ve,st)&&(ye[st]=Ve[st])}return ye}function Z(ye,Je){const Ve=ye.replace(/\|/g,(ie,Q,ue)=>{let ce=!1,De=Q;for(;--De>=0&&ue[De]==="\\";)ce=!ce;return ce?"|":" |"}),st=Ve.split(/ \|/);let ft=0;if(st.length>Je)st.splice(Je);else for(;st.length<Je;)st.push("");for(;ft<st.length;ft++)st[ft]=st[ft].trim().replace(/\\\|/g,"|");return st}function le(ye,Je,Ve){const st=ye.length;if(st===0)return"";let ft=0;for(;ft<st;){const ie=ye.charAt(st-ft-1);if(ie===Je&&!Ve)ft++;else if(ie!==Je&&Ve)ft++;else break}return ye.substr(0,st-ft)}function P(ye,Je){if(ye.indexOf(Je[1])===-1)return-1;const Ve=ye.length;let st=0,ft=0;for(;ft<Ve;ft++)if(ye[ft]==="\\")ft++;else if(ye[ft]===Je[0])st++;else if(ye[ft]===Je[1]&&(st--,st<0))return ft;return-1}function ae(ye){ye&&ye.sanitize&&!ye.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Te(ye,Je){if(Je<1)return"";let Ve="";for(;Je>1;)Je&1&&(Ve+=ye),Je>>=1,ye+=ye;return Ve+ye}Ir.exports={escape:Oe,unescape:Pe,edit:c,cleanUrl:A,resolveUrl:se,noopTest:q,merge:W,splitCells:Z,rtrim:le,findClosingBracket:P,checkSanitizeDeprecation:ae,repeatString:Te}},75918:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Wi:function(){return me},Z0:function(){return Pe},aU:function(){return Oe},eZ:function(){return c},wY:function(){return $}});var Ce=Y(4348),Le=Y(69323),Xe=Y(13268),Ge=function(te,V,A,b){function M(I){return I instanceof A?I:new A(function(re){re(I)})}return new(A||(A=Promise))(function(I,re){function se(Z){try{W(b.next(Z))}catch(le){re(le)}}function q(Z){try{W(b.throw(Z))}catch(le){re(le)}}function W(Z){Z.done?I(Z.value):M(Z.value).then(se,q)}W((b=b.apply(te,V||[])).next())})};class Oe extends Le.JT{constructor(V,A="",b="",M=!0,I){super(),this._onDidChange=this._register(new Ce.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=V,this._label=A,this._cssClass=b,this._enabled=M,this._actionCallback=I}get id(){return this._id}get label(){return this._label}set label(V){this._setLabel(V)}_setLabel(V){this._label!==V&&(this._label=V,this._onDidChange.fire({label:V}))}get tooltip(){return this._tooltip||""}set tooltip(V){this._setTooltip(V)}_setTooltip(V){this._tooltip!==V&&(this._tooltip=V,this._onDidChange.fire({tooltip:V}))}get class(){return this._cssClass}set class(V){this._setClass(V)}_setClass(V){this._cssClass!==V&&(this._cssClass=V,this._onDidChange.fire({class:V}))}get enabled(){return this._enabled}set enabled(V){this._setEnabled(V)}_setEnabled(V){this._enabled!==V&&(this._enabled=V,this._onDidChange.fire({enabled:V}))}get checked(){return this._checked}set checked(V){this._setChecked(V)}_setChecked(V){this._checked!==V&&(this._checked=V,this._onDidChange.fire({checked:V}))}run(V,A){return Ge(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(V))})}}class me extends Le.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new Ce.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Ce.Q5),this.onDidRun=this._onDidRun.event}run(V,A){return Ge(this,void 0,void 0,function*(){if(!V.enabled)return;this._onBeforeRun.fire({action:V});let b;try{yield this.runAction(V,A)}catch(M){b=M}this._onDidRun.fire({action:V,error:b})})}runAction(V,A){return Ge(this,void 0,void 0,function*(){yield V.run(A)})}}class Pe extends Oe{constructor(V){super(Pe.ID,V,V?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Pe.ID="vs.actions.separator";class ${constructor(V,A,b,M){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=V,this.label=A,this.class=M,this._actions=b}get actions(){return this._actions}dispose(){}run(){return Ge(this,void 0,void 0,function*(){})}}class c extends Oe{constructor(){super(c.ID,Xe.N("submenu.empty","(empty)"),void 0,!1)}}c.ID="vs.actions.empty"},76068:function(Ir,Mt,Y){"use strict";Y.d(Mt,{ok:function(){return Ce}});function Ce(Le,Xe){if(!Le)throw new Error(Xe?`Assertion failed (${Xe})`:"Assertion Failed")}},52615:function(Ir,Mt,Y){"use strict";Y.d(Mt,{CM:function(){return Oe},JL:function(){return me},dT:function(){return $},fK:function(){return Ge},lA:function(){return Pe}});var Ce=Y(4348);class Le{constructor(){this._icons=new Map,this._onDidRegister=new Ce.Q5}add(te){const V=this._icons.get(te.id);V?te.description?V.description=te.description:console.error(`Duplicate registration of codicon ${te.id}`):(this._icons.set(te.id,te),this._onDidRegister.fire(te))}get(te){return this._icons.get(te)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const Xe=new Le,Ge=Xe;function Oe(c,te){return new Pe(c,te)}function me(c){return c?c.replace(/\$\((.*?)\)/g,(te,V)=>` ${V} `).trim():""}class Pe{constructor(te,V,A){this.id=te,this.definition=V,this.description=A,Xe.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var $;(function(c){c.iconNameSegment="[A-Za-z0-9]+",c.iconNameExpression="[A-Za-z0-9\\-]+",c.iconModifierExpression="~[A-Za-z]+";const te=new RegExp(`^(${c.iconNameExpression})(${c.iconModifierExpression})?$`);function V(M){if(M instanceof Pe)return["codicon","codicon-"+M.id];const I=te.exec(M.id);if(!I)return V(Pe.error);let[,re,se]=I;const q=["codicon","codicon-"+re];return se&&q.push("codicon-modifier-"+se.substr(1)),q}c.asClassNameArray=V;function A(M){return V(M).join(" ")}c.asClassName=A;function b(M){return"."+V(M).join(".")}c.asCSSSelector=b})($||($={})),function(c){c.add=new c("add",{fontCharacter:"\\ea60"}),c.plus=new c("plus",c.add.definition),c.gistNew=new c("gist-new",c.add.definition),c.repoCreate=new c("repo-create",c.add.definition),c.lightbulb=new c("lightbulb",{fontCharacter:"\\ea61"}),c.lightBulb=new c("light-bulb",{fontCharacter:"\\ea61"}),c.repo=new c("repo",{fontCharacter:"\\ea62"}),c.repoDelete=new c("repo-delete",{fontCharacter:"\\ea62"}),c.gistFork=new c("gist-fork",{fontCharacter:"\\ea63"}),c.repoForked=new c("repo-forked",{fontCharacter:"\\ea63"}),c.gitPullRequest=new c("git-pull-request",{fontCharacter:"\\ea64"}),c.gitPullRequestAbandoned=new c("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),c.recordKeys=new c("record-keys",{fontCharacter:"\\ea65"}),c.keyboard=new c("keyboard",{fontCharacter:"\\ea65"}),c.tag=new c("tag",{fontCharacter:"\\ea66"}),c.tagAdd=new c("tag-add",{fontCharacter:"\\ea66"}),c.tagRemove=new c("tag-remove",{fontCharacter:"\\ea66"}),c.person=new c("person",{fontCharacter:"\\ea67"}),c.personFollow=new c("person-follow",{fontCharacter:"\\ea67"}),c.personOutline=new c("person-outline",{fontCharacter:"\\ea67"}),c.personFilled=new c("person-filled",{fontCharacter:"\\ea67"}),c.gitBranch=new c("git-branch",{fontCharacter:"\\ea68"}),c.gitBranchCreate=new c("git-branch-create",{fontCharacter:"\\ea68"}),c.gitBranchDelete=new c("git-branch-delete",{fontCharacter:"\\ea68"}),c.sourceControl=new c("source-control",{fontCharacter:"\\ea68"}),c.mirror=new c("mirror",{fontCharacter:"\\ea69"}),c.mirrorPublic=new c("mirror-public",{fontCharacter:"\\ea69"}),c.star=new c("star",{fontCharacter:"\\ea6a"}),c.starAdd=new c("star-add",{fontCharacter:"\\ea6a"}),c.starDelete=new c("star-delete",{fontCharacter:"\\ea6a"}),c.starEmpty=new c("star-empty",{fontCharacter:"\\ea6a"}),c.comment=new c("comment",{fontCharacter:"\\ea6b"}),c.commentAdd=new c("comment-add",{fontCharacter:"\\ea6b"}),c.alert=new c("alert",{fontCharacter:"\\ea6c"}),c.warning=new c("warning",{fontCharacter:"\\ea6c"}),c.search=new c("search",{fontCharacter:"\\ea6d"}),c.searchSave=new c("search-save",{fontCharacter:"\\ea6d"}),c.logOut=new c("log-out",{fontCharacter:"\\ea6e"}),c.signOut=new c("sign-out",{fontCharacter:"\\ea6e"}),c.logIn=new c("log-in",{fontCharacter:"\\ea6f"}),c.signIn=new c("sign-in",{fontCharacter:"\\ea6f"}),c.eye=new c("eye",{fontCharacter:"\\ea70"}),c.eyeUnwatch=new c("eye-unwatch",{fontCharacter:"\\ea70"}),c.eyeWatch=new c("eye-watch",{fontCharacter:"\\ea70"}),c.circleFilled=new c("circle-filled",{fontCharacter:"\\ea71"}),c.primitiveDot=new c("primitive-dot",{fontCharacter:"\\ea71"}),c.closeDirty=new c("close-dirty",{fontCharacter:"\\ea71"}),c.debugBreakpoint=new c("debug-breakpoint",{fontCharacter:"\\ea71"}),c.debugBreakpointDisabled=new c("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),c.debugHint=new c("debug-hint",{fontCharacter:"\\ea71"}),c.primitiveSquare=new c("primitive-square",{fontCharacter:"\\ea72"}),c.edit=new c("edit",{fontCharacter:"\\ea73"}),c.pencil=new c("pencil",{fontCharacter:"\\ea73"}),c.info=new c("info",{fontCharacter:"\\ea74"}),c.issueOpened=new c("issue-opened",{fontCharacter:"\\ea74"}),c.gistPrivate=new c("gist-private",{fontCharacter:"\\ea75"}),c.gitForkPrivate=new c("git-fork-private",{fontCharacter:"\\ea75"}),c.lock=new c("lock",{fontCharacter:"\\ea75"}),c.mirrorPrivate=new c("mirror-private",{fontCharacter:"\\ea75"}),c.close=new c("close",{fontCharacter:"\\ea76"}),c.removeClose=new c("remove-close",{fontCharacter:"\\ea76"}),c.x=new c("x",{fontCharacter:"\\ea76"}),c.repoSync=new c("repo-sync",{fontCharacter:"\\ea77"}),c.sync=new c("sync",{fontCharacter:"\\ea77"}),c.clone=new c("clone",{fontCharacter:"\\ea78"}),c.desktopDownload=new c("desktop-download",{fontCharacter:"\\ea78"}),c.beaker=new c("beaker",{fontCharacter:"\\ea79"}),c.microscope=new c("microscope",{fontCharacter:"\\ea79"}),c.vm=new c("vm",{fontCharacter:"\\ea7a"}),c.deviceDesktop=new c("device-desktop",{fontCharacter:"\\ea7a"}),c.file=new c("file",{fontCharacter:"\\ea7b"}),c.fileText=new c("file-text",{fontCharacter:"\\ea7b"}),c.more=new c("more",{fontCharacter:"\\ea7c"}),c.ellipsis=new c("ellipsis",{fontCharacter:"\\ea7c"}),c.kebabHorizontal=new c("kebab-horizontal",{fontCharacter:"\\ea7c"}),c.mailReply=new c("mail-reply",{fontCharacter:"\\ea7d"}),c.reply=new c("reply",{fontCharacter:"\\ea7d"}),c.organization=new c("organization",{fontCharacter:"\\ea7e"}),c.organizationFilled=new c("organization-filled",{fontCharacter:"\\ea7e"}),c.organizationOutline=new c("organization-outline",{fontCharacter:"\\ea7e"}),c.newFile=new c("new-file",{fontCharacter:"\\ea7f"}),c.fileAdd=new c("file-add",{fontCharacter:"\\ea7f"}),c.newFolder=new c("new-folder",{fontCharacter:"\\ea80"}),c.fileDirectoryCreate=new c("file-directory-create",{fontCharacter:"\\ea80"}),c.trash=new c("trash",{fontCharacter:"\\ea81"}),c.trashcan=new c("trashcan",{fontCharacter:"\\ea81"}),c.history=new c("history",{fontCharacter:"\\ea82"}),c.clock=new c("clock",{fontCharacter:"\\ea82"}),c.folder=new c("folder",{fontCharacter:"\\ea83"}),c.fileDirectory=new c("file-directory",{fontCharacter:"\\ea83"}),c.symbolFolder=new c("symbol-folder",{fontCharacter:"\\ea83"}),c.logoGithub=new c("logo-github",{fontCharacter:"\\ea84"}),c.markGithub=new c("mark-github",{fontCharacter:"\\ea84"}),c.github=new c("github",{fontCharacter:"\\ea84"}),c.terminal=new c("terminal",{fontCharacter:"\\ea85"}),c.console=new c("console",{fontCharacter:"\\ea85"}),c.repl=new c("repl",{fontCharacter:"\\ea85"}),c.zap=new c("zap",{fontCharacter:"\\ea86"}),c.symbolEvent=new c("symbol-event",{fontCharacter:"\\ea86"}),c.error=new c("error",{fontCharacter:"\\ea87"}),c.stop=new c("stop",{fontCharacter:"\\ea87"}),c.variable=new c("variable",{fontCharacter:"\\ea88"}),c.symbolVariable=new c("symbol-variable",{fontCharacter:"\\ea88"}),c.array=new c("array",{fontCharacter:"\\ea8a"}),c.symbolArray=new c("symbol-array",{fontCharacter:"\\ea8a"}),c.symbolModule=new c("symbol-module",{fontCharacter:"\\ea8b"}),c.symbolPackage=new c("symbol-package",{fontCharacter:"\\ea8b"}),c.symbolNamespace=new c("symbol-namespace",{fontCharacter:"\\ea8b"}),c.symbolObject=new c("symbol-object",{fontCharacter:"\\ea8b"}),c.symbolMethod=new c("symbol-method",{fontCharacter:"\\ea8c"}),c.symbolFunction=new c("symbol-function",{fontCharacter:"\\ea8c"}),c.symbolConstructor=new c("symbol-constructor",{fontCharacter:"\\ea8c"}),c.symbolBoolean=new c("symbol-boolean",{fontCharacter:"\\ea8f"}),c.symbolNull=new c("symbol-null",{fontCharacter:"\\ea8f"}),c.symbolNumeric=new c("symbol-numeric",{fontCharacter:"\\ea90"}),c.symbolNumber=new c("symbol-number",{fontCharacter:"\\ea90"}),c.symbolStructure=new c("symbol-structure",{fontCharacter:"\\ea91"}),c.symbolStruct=new c("symbol-struct",{fontCharacter:"\\ea91"}),c.symbolParameter=new c("symbol-parameter",{fontCharacter:"\\ea92"}),c.symbolTypeParameter=new c("symbol-type-parameter",{fontCharacter:"\\ea92"}),c.symbolKey=new c("symbol-key",{fontCharacter:"\\ea93"}),c.symbolText=new c("symbol-text",{fontCharacter:"\\ea93"}),c.symbolReference=new c("symbol-reference",{fontCharacter:"\\ea94"}),c.goToFile=new c("go-to-file",{fontCharacter:"\\ea94"}),c.symbolEnum=new c("symbol-enum",{fontCharacter:"\\ea95"}),c.symbolValue=new c("symbol-value",{fontCharacter:"\\ea95"}),c.symbolRuler=new c("symbol-ruler",{fontCharacter:"\\ea96"}),c.symbolUnit=new c("symbol-unit",{fontCharacter:"\\ea96"}),c.activateBreakpoints=new c("activate-breakpoints",{fontCharacter:"\\ea97"}),c.archive=new c("archive",{fontCharacter:"\\ea98"}),c.arrowBoth=new c("arrow-both",{fontCharacter:"\\ea99"}),c.arrowDown=new c("arrow-down",{fontCharacter:"\\ea9a"}),c.arrowLeft=new c("arrow-left",{fontCharacter:"\\ea9b"}),c.arrowRight=new c("arrow-right",{fontCharacter:"\\ea9c"}),c.arrowSmallDown=new c("arrow-small-down",{fontCharacter:"\\ea9d"}),c.arrowSmallLeft=new c("arrow-small-left",{fontCharacter:"\\ea9e"}),c.arrowSmallRight=new c("arrow-small-right",{fontCharacter:"\\ea9f"}),c.arrowSmallUp=new c("arrow-small-up",{fontCharacter:"\\eaa0"}),c.arrowUp=new c("arrow-up",{fontCharacter:"\\eaa1"}),c.bell=new c("bell",{fontCharacter:"\\eaa2"}),c.bold=new c("bold",{fontCharacter:"\\eaa3"}),c.book=new c("book",{fontCharacter:"\\eaa4"}),c.bookmark=new c("bookmark",{fontCharacter:"\\eaa5"}),c.debugBreakpointConditionalUnverified=new c("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),c.debugBreakpointConditional=new c("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),c.debugBreakpointConditionalDisabled=new c("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),c.debugBreakpointDataUnverified=new c("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),c.debugBreakpointData=new c("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),c.debugBreakpointDataDisabled=new c("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),c.debugBreakpointLogUnverified=new c("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),c.debugBreakpointLog=new c("debug-breakpoint-log",{fontCharacter:"\\eaab"}),c.debugBreakpointLogDisabled=new c("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),c.briefcase=new c("briefcase",{fontCharacter:"\\eaac"}),c.broadcast=new c("broadcast",{fontCharacter:"\\eaad"}),c.browser=new c("browser",{fontCharacter:"\\eaae"}),c.bug=new c("bug",{fontCharacter:"\\eaaf"}),c.calendar=new c("calendar",{fontCharacter:"\\eab0"}),c.caseSensitive=new c("case-sensitive",{fontCharacter:"\\eab1"}),c.check=new c("check",{fontCharacter:"\\eab2"}),c.checklist=new c("checklist",{fontCharacter:"\\eab3"}),c.chevronDown=new c("chevron-down",{fontCharacter:"\\eab4"}),c.dropDownButton=new c("drop-down-button",c.chevronDown.definition),c.chevronLeft=new c("chevron-left",{fontCharacter:"\\eab5"}),c.chevronRight=new c("chevron-right",{fontCharacter:"\\eab6"}),c.chevronUp=new c("chevron-up",{fontCharacter:"\\eab7"}),c.chromeClose=new c("chrome-close",{fontCharacter:"\\eab8"}),c.chromeMaximize=new c("chrome-maximize",{fontCharacter:"\\eab9"}),c.chromeMinimize=new c("chrome-minimize",{fontCharacter:"\\eaba"}),c.chromeRestore=new c("chrome-restore",{fontCharacter:"\\eabb"}),c.circleOutline=new c("circle-outline",{fontCharacter:"\\eabc"}),c.debugBreakpointUnverified=new c("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),c.circleSlash=new c("circle-slash",{fontCharacter:"\\eabd"}),c.circuitBoard=new c("circuit-board",{fontCharacter:"\\eabe"}),c.clearAll=new c("clear-all",{fontCharacter:"\\eabf"}),c.clippy=new c("clippy",{fontCharacter:"\\eac0"}),c.closeAll=new c("close-all",{fontCharacter:"\\eac1"}),c.cloudDownload=new c("cloud-download",{fontCharacter:"\\eac2"}),c.cloudUpload=new c("cloud-upload",{fontCharacter:"\\eac3"}),c.code=new c("code",{fontCharacter:"\\eac4"}),c.collapseAll=new c("collapse-all",{fontCharacter:"\\eac5"}),c.colorMode=new c("color-mode",{fontCharacter:"\\eac6"}),c.commentDiscussion=new c("comment-discussion",{fontCharacter:"\\eac7"}),c.compareChanges=new c("compare-changes",{fontCharacter:"\\eafd"}),c.creditCard=new c("credit-card",{fontCharacter:"\\eac9"}),c.dash=new c("dash",{fontCharacter:"\\eacc"}),c.dashboard=new c("dashboard",{fontCharacter:"\\eacd"}),c.database=new c("database",{fontCharacter:"\\eace"}),c.debugContinue=new c("debug-continue",{fontCharacter:"\\eacf"}),c.debugDisconnect=new c("debug-disconnect",{fontCharacter:"\\ead0"}),c.debugPause=new c("debug-pause",{fontCharacter:"\\ead1"}),c.debugRestart=new c("debug-restart",{fontCharacter:"\\ead2"}),c.debugStart=new c("debug-start",{fontCharacter:"\\ead3"}),c.debugStepInto=new c("debug-step-into",{fontCharacter:"\\ead4"}),c.debugStepOut=new c("debug-step-out",{fontCharacter:"\\ead5"}),c.debugStepOver=new c("debug-step-over",{fontCharacter:"\\ead6"}),c.debugStop=new c("debug-stop",{fontCharacter:"\\ead7"}),c.debug=new c("debug",{fontCharacter:"\\ead8"}),c.deviceCameraVideo=new c("device-camera-video",{fontCharacter:"\\ead9"}),c.deviceCamera=new c("device-camera",{fontCharacter:"\\eada"}),c.deviceMobile=new c("device-mobile",{fontCharacter:"\\eadb"}),c.diffAdded=new c("diff-added",{fontCharacter:"\\eadc"}),c.diffIgnored=new c("diff-ignored",{fontCharacter:"\\eadd"}),c.diffModified=new c("diff-modified",{fontCharacter:"\\eade"}),c.diffRemoved=new c("diff-removed",{fontCharacter:"\\eadf"}),c.diffRenamed=new c("diff-renamed",{fontCharacter:"\\eae0"}),c.diff=new c("diff",{fontCharacter:"\\eae1"}),c.discard=new c("discard",{fontCharacter:"\\eae2"}),c.editorLayout=new c("editor-layout",{fontCharacter:"\\eae3"}),c.emptyWindow=new c("empty-window",{fontCharacter:"\\eae4"}),c.exclude=new c("exclude",{fontCharacter:"\\eae5"}),c.extensions=new c("extensions",{fontCharacter:"\\eae6"}),c.eyeClosed=new c("eye-closed",{fontCharacter:"\\eae7"}),c.fileBinary=new c("file-binary",{fontCharacter:"\\eae8"}),c.fileCode=new c("file-code",{fontCharacter:"\\eae9"}),c.fileMedia=new c("file-media",{fontCharacter:"\\eaea"}),c.filePdf=new c("file-pdf",{fontCharacter:"\\eaeb"}),c.fileSubmodule=new c("file-submodule",{fontCharacter:"\\eaec"}),c.fileSymlinkDirectory=new c("file-symlink-directory",{fontCharacter:"\\eaed"}),c.fileSymlinkFile=new c("file-symlink-file",{fontCharacter:"\\eaee"}),c.fileZip=new c("file-zip",{fontCharacter:"\\eaef"}),c.files=new c("files",{fontCharacter:"\\eaf0"}),c.filter=new c("filter",{fontCharacter:"\\eaf1"}),c.flame=new c("flame",{fontCharacter:"\\eaf2"}),c.foldDown=new c("fold-down",{fontCharacter:"\\eaf3"}),c.foldUp=new c("fold-up",{fontCharacter:"\\eaf4"}),c.fold=new c("fold",{fontCharacter:"\\eaf5"}),c.folderActive=new c("folder-active",{fontCharacter:"\\eaf6"}),c.folderOpened=new c("folder-opened",{fontCharacter:"\\eaf7"}),c.gear=new c("gear",{fontCharacter:"\\eaf8"}),c.gift=new c("gift",{fontCharacter:"\\eaf9"}),c.gistSecret=new c("gist-secret",{fontCharacter:"\\eafa"}),c.gist=new c("gist",{fontCharacter:"\\eafb"}),c.gitCommit=new c("git-commit",{fontCharacter:"\\eafc"}),c.gitCompare=new c("git-compare",{fontCharacter:"\\eafd"}),c.gitMerge=new c("git-merge",{fontCharacter:"\\eafe"}),c.githubAction=new c("github-action",{fontCharacter:"\\eaff"}),c.githubAlt=new c("github-alt",{fontCharacter:"\\eb00"}),c.globe=new c("globe",{fontCharacter:"\\eb01"}),c.grabber=new c("grabber",{fontCharacter:"\\eb02"}),c.graph=new c("graph",{fontCharacter:"\\eb03"}),c.gripper=new c("gripper",{fontCharacter:"\\eb04"}),c.heart=new c("heart",{fontCharacter:"\\eb05"}),c.home=new c("home",{fontCharacter:"\\eb06"}),c.horizontalRule=new c("horizontal-rule",{fontCharacter:"\\eb07"}),c.hubot=new c("hubot",{fontCharacter:"\\eb08"}),c.inbox=new c("inbox",{fontCharacter:"\\eb09"}),c.issueClosed=new c("issue-closed",{fontCharacter:"\\eba4"}),c.issueReopened=new c("issue-reopened",{fontCharacter:"\\eb0b"}),c.issues=new c("issues",{fontCharacter:"\\eb0c"}),c.italic=new c("italic",{fontCharacter:"\\eb0d"}),c.jersey=new c("jersey",{fontCharacter:"\\eb0e"}),c.json=new c("json",{fontCharacter:"\\eb0f"}),c.kebabVertical=new c("kebab-vertical",{fontCharacter:"\\eb10"}),c.key=new c("key",{fontCharacter:"\\eb11"}),c.law=new c("law",{fontCharacter:"\\eb12"}),c.lightbulbAutofix=new c("lightbulb-autofix",{fontCharacter:"\\eb13"}),c.linkExternal=new c("link-external",{fontCharacter:"\\eb14"}),c.link=new c("link",{fontCharacter:"\\eb15"}),c.listOrdered=new c("list-ordered",{fontCharacter:"\\eb16"}),c.listUnordered=new c("list-unordered",{fontCharacter:"\\eb17"}),c.liveShare=new c("live-share",{fontCharacter:"\\eb18"}),c.loading=new c("loading",{fontCharacter:"\\eb19"}),c.location=new c("location",{fontCharacter:"\\eb1a"}),c.mailRead=new c("mail-read",{fontCharacter:"\\eb1b"}),c.mail=new c("mail",{fontCharacter:"\\eb1c"}),c.markdown=new c("markdown",{fontCharacter:"\\eb1d"}),c.megaphone=new c("megaphone",{fontCharacter:"\\eb1e"}),c.mention=new c("mention",{fontCharacter:"\\eb1f"}),c.milestone=new c("milestone",{fontCharacter:"\\eb20"}),c.mortarBoard=new c("mortar-board",{fontCharacter:"\\eb21"}),c.move=new c("move",{fontCharacter:"\\eb22"}),c.multipleWindows=new c("multiple-windows",{fontCharacter:"\\eb23"}),c.mute=new c("mute",{fontCharacter:"\\eb24"}),c.noNewline=new c("no-newline",{fontCharacter:"\\eb25"}),c.note=new c("note",{fontCharacter:"\\eb26"}),c.octoface=new c("octoface",{fontCharacter:"\\eb27"}),c.openPreview=new c("open-preview",{fontCharacter:"\\eb28"}),c.package_=new c("package",{fontCharacter:"\\eb29"}),c.paintcan=new c("paintcan",{fontCharacter:"\\eb2a"}),c.pin=new c("pin",{fontCharacter:"\\eb2b"}),c.play=new c("play",{fontCharacter:"\\eb2c"}),c.run=new c("run",{fontCharacter:"\\eb2c"}),c.plug=new c("plug",{fontCharacter:"\\eb2d"}),c.preserveCase=new c("preserve-case",{fontCharacter:"\\eb2e"}),c.preview=new c("preview",{fontCharacter:"\\eb2f"}),c.project=new c("project",{fontCharacter:"\\eb30"}),c.pulse=new c("pulse",{fontCharacter:"\\eb31"}),c.question=new c("question",{fontCharacter:"\\eb32"}),c.quote=new c("quote",{fontCharacter:"\\eb33"}),c.radioTower=new c("radio-tower",{fontCharacter:"\\eb34"}),c.reactions=new c("reactions",{fontCharacter:"\\eb35"}),c.references=new c("references",{fontCharacter:"\\eb36"}),c.refresh=new c("refresh",{fontCharacter:"\\eb37"}),c.regex=new c("regex",{fontCharacter:"\\eb38"}),c.remoteExplorer=new c("remote-explorer",{fontCharacter:"\\eb39"}),c.remote=new c("remote",{fontCharacter:"\\eb3a"}),c.remove=new c("remove",{fontCharacter:"\\eb3b"}),c.replaceAll=new c("replace-all",{fontCharacter:"\\eb3c"}),c.replace=new c("replace",{fontCharacter:"\\eb3d"}),c.repoClone=new c("repo-clone",{fontCharacter:"\\eb3e"}),c.repoForcePush=new c("repo-force-push",{fontCharacter:"\\eb3f"}),c.repoPull=new c("repo-pull",{fontCharacter:"\\eb40"}),c.repoPush=new c("repo-push",{fontCharacter:"\\eb41"}),c.report=new c("report",{fontCharacter:"\\eb42"}),c.requestChanges=new c("request-changes",{fontCharacter:"\\eb43"}),c.rocket=new c("rocket",{fontCharacter:"\\eb44"}),c.rootFolderOpened=new c("root-folder-opened",{fontCharacter:"\\eb45"}),c.rootFolder=new c("root-folder",{fontCharacter:"\\eb46"}),c.rss=new c("rss",{fontCharacter:"\\eb47"}),c.ruby=new c("ruby",{fontCharacter:"\\eb48"}),c.saveAll=new c("save-all",{fontCharacter:"\\eb49"}),c.saveAs=new c("save-as",{fontCharacter:"\\eb4a"}),c.save=new c("save",{fontCharacter:"\\eb4b"}),c.screenFull=new c("screen-full",{fontCharacter:"\\eb4c"}),c.screenNormal=new c("screen-normal",{fontCharacter:"\\eb4d"}),c.searchStop=new c("search-stop",{fontCharacter:"\\eb4e"}),c.server=new c("server",{fontCharacter:"\\eb50"}),c.settingsGear=new c("settings-gear",{fontCharacter:"\\eb51"}),c.settings=new c("settings",{fontCharacter:"\\eb52"}),c.shield=new c("shield",{fontCharacter:"\\eb53"}),c.smiley=new c("smiley",{fontCharacter:"\\eb54"}),c.sortPrecedence=new c("sort-precedence",{fontCharacter:"\\eb55"}),c.splitHorizontal=new c("split-horizontal",{fontCharacter:"\\eb56"}),c.splitVertical=new c("split-vertical",{fontCharacter:"\\eb57"}),c.squirrel=new c("squirrel",{fontCharacter:"\\eb58"}),c.starFull=new c("star-full",{fontCharacter:"\\eb59"}),c.starHalf=new c("star-half",{fontCharacter:"\\eb5a"}),c.symbolClass=new c("symbol-class",{fontCharacter:"\\eb5b"}),c.symbolColor=new c("symbol-color",{fontCharacter:"\\eb5c"}),c.symbolConstant=new c("symbol-constant",{fontCharacter:"\\eb5d"}),c.symbolEnumMember=new c("symbol-enum-member",{fontCharacter:"\\eb5e"}),c.symbolField=new c("symbol-field",{fontCharacter:"\\eb5f"}),c.symbolFile=new c("symbol-file",{fontCharacter:"\\eb60"}),c.symbolInterface=new c("symbol-interface",{fontCharacter:"\\eb61"}),c.symbolKeyword=new c("symbol-keyword",{fontCharacter:"\\eb62"}),c.symbolMisc=new c("symbol-misc",{fontCharacter:"\\eb63"}),c.symbolOperator=new c("symbol-operator",{fontCharacter:"\\eb64"}),c.symbolProperty=new c("symbol-property",{fontCharacter:"\\eb65"}),c.wrench=new c("wrench",{fontCharacter:"\\eb65"}),c.wrenchSubaction=new c("wrench-subaction",{fontCharacter:"\\eb65"}),c.symbolSnippet=new c("symbol-snippet",{fontCharacter:"\\eb66"}),c.tasklist=new c("tasklist",{fontCharacter:"\\eb67"}),c.telescope=new c("telescope",{fontCharacter:"\\eb68"}),c.textSize=new c("text-size",{fontCharacter:"\\eb69"}),c.threeBars=new c("three-bars",{fontCharacter:"\\eb6a"}),c.thumbsdown=new c("thumbsdown",{fontCharacter:"\\eb6b"}),c.thumbsup=new c("thumbsup",{fontCharacter:"\\eb6c"}),c.tools=new c("tools",{fontCharacter:"\\eb6d"}),c.triangleDown=new c("triangle-down",{fontCharacter:"\\eb6e"}),c.triangleLeft=new c("triangle-left",{fontCharacter:"\\eb6f"}),c.triangleRight=new c("triangle-right",{fontCharacter:"\\eb70"}),c.triangleUp=new c("triangle-up",{fontCharacter:"\\eb71"}),c.twitter=new c("twitter",{fontCharacter:"\\eb72"}),c.unfold=new c("unfold",{fontCharacter:"\\eb73"}),c.unlock=new c("unlock",{fontCharacter:"\\eb74"}),c.unmute=new c("unmute",{fontCharacter:"\\eb75"}),c.unverified=new c("unverified",{fontCharacter:"\\eb76"}),c.verified=new c("verified",{fontCharacter:"\\eb77"}),c.versions=new c("versions",{fontCharacter:"\\eb78"}),c.vmActive=new c("vm-active",{fontCharacter:"\\eb79"}),c.vmOutline=new c("vm-outline",{fontCharacter:"\\eb7a"}),c.vmRunning=new c("vm-running",{fontCharacter:"\\eb7b"}),c.watch=new c("watch",{fontCharacter:"\\eb7c"}),c.whitespace=new c("whitespace",{fontCharacter:"\\eb7d"}),c.wholeWord=new c("whole-word",{fontCharacter:"\\eb7e"}),c.window=new c("window",{fontCharacter:"\\eb7f"}),c.wordWrap=new c("word-wrap",{fontCharacter:"\\eb80"}),c.zoomIn=new c("zoom-in",{fontCharacter:"\\eb81"}),c.zoomOut=new c("zoom-out",{fontCharacter:"\\eb82"}),c.listFilter=new c("list-filter",{fontCharacter:"\\eb83"}),c.listFlat=new c("list-flat",{fontCharacter:"\\eb84"}),c.listSelection=new c("list-selection",{fontCharacter:"\\eb85"}),c.selection=new c("selection",{fontCharacter:"\\eb85"}),c.listTree=new c("list-tree",{fontCharacter:"\\eb86"}),c.debugBreakpointFunctionUnverified=new c("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),c.debugBreakpointFunction=new c("debug-breakpoint-function",{fontCharacter:"\\eb88"}),c.debugBreakpointFunctionDisabled=new c("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),c.debugStackframeActive=new c("debug-stackframe-active",{fontCharacter:"\\eb89"}),c.debugStackframeDot=new c("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),c.debugStackframe=new c("debug-stackframe",{fontCharacter:"\\eb8b"}),c.debugStackframeFocused=new c("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),c.debugBreakpointUnsupported=new c("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),c.symbolString=new c("symbol-string",{fontCharacter:"\\eb8d"}),c.debugReverseContinue=new c("debug-reverse-continue",{fontCharacter:"\\eb8e"}),c.debugStepBack=new c("debug-step-back",{fontCharacter:"\\eb8f"}),c.debugRestartFrame=new c("debug-restart-frame",{fontCharacter:"\\eb90"}),c.callIncoming=new c("call-incoming",{fontCharacter:"\\eb92"}),c.callOutgoing=new c("call-outgoing",{fontCharacter:"\\eb93"}),c.menu=new c("menu",{fontCharacter:"\\eb94"}),c.expandAll=new c("expand-all",{fontCharacter:"\\eb95"}),c.feedback=new c("feedback",{fontCharacter:"\\eb96"}),c.groupByRefType=new c("group-by-ref-type",{fontCharacter:"\\eb97"}),c.ungroupByRefType=new c("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),c.account=new c("account",{fontCharacter:"\\eb99"}),c.bellDot=new c("bell-dot",{fontCharacter:"\\eb9a"}),c.debugConsole=new c("debug-console",{fontCharacter:"\\eb9b"}),c.library=new c("library",{fontCharacter:"\\eb9c"}),c.output=new c("output",{fontCharacter:"\\eb9d"}),c.runAll=new c("run-all",{fontCharacter:"\\eb9e"}),c.syncIgnored=new c("sync-ignored",{fontCharacter:"\\eb9f"}),c.pinned=new c("pinned",{fontCharacter:"\\eba0"}),c.githubInverted=new c("github-inverted",{fontCharacter:"\\eba1"}),c.debugAlt=new c("debug-alt",{fontCharacter:"\\eb91"}),c.serverProcess=new c("server-process",{fontCharacter:"\\eba2"}),c.serverEnvironment=new c("server-environment",{fontCharacter:"\\eba3"}),c.pass=new c("pass",{fontCharacter:"\\eba4"}),c.stopCircle=new c("stop-circle",{fontCharacter:"\\eba5"}),c.playCircle=new c("play-circle",{fontCharacter:"\\eba6"}),c.record=new c("record",{fontCharacter:"\\eba7"}),c.debugAltSmall=new c("debug-alt-small",{fontCharacter:"\\eba8"}),c.vmConnect=new c("vm-connect",{fontCharacter:"\\eba9"}),c.cloud=new c("cloud",{fontCharacter:"\\ebaa"}),c.merge=new c("merge",{fontCharacter:"\\ebab"}),c.exportIcon=new c("export",{fontCharacter:"\\ebac"}),c.graphLeft=new c("graph-left",{fontCharacter:"\\ebad"}),c.magnet=new c("magnet",{fontCharacter:"\\ebae"}),c.notebook=new c("notebook",{fontCharacter:"\\ebaf"}),c.redo=new c("redo",{fontCharacter:"\\ebb0"}),c.checkAll=new c("check-all",{fontCharacter:"\\ebb1"}),c.pinnedDirty=new c("pinned-dirty",{fontCharacter:"\\ebb2"}),c.passFilled=new c("pass-filled",{fontCharacter:"\\ebb3"}),c.circleLargeFilled=new c("circle-large-filled",{fontCharacter:"\\ebb4"}),c.circleLargeOutline=new c("circle-large-outline",{fontCharacter:"\\ebb5"}),c.combine=new c("combine",{fontCharacter:"\\ebb6"}),c.gather=new c("gather",{fontCharacter:"\\ebb6"}),c.table=new c("table",{fontCharacter:"\\ebb7"}),c.variableGroup=new c("variable-group",{fontCharacter:"\\ebb8"}),c.typeHierarchy=new c("type-hierarchy",{fontCharacter:"\\ebb9"}),c.typeHierarchySub=new c("type-hierarchy-sub",{fontCharacter:"\\ebba"}),c.typeHierarchySuper=new c("type-hierarchy-super",{fontCharacter:"\\ebbb"}),c.gitPullRequestCreate=new c("git-pull-request-create",{fontCharacter:"\\ebbc"}),c.runAbove=new c("run-above",{fontCharacter:"\\ebbd"}),c.runBelow=new c("run-below",{fontCharacter:"\\ebbe"}),c.notebookTemplate=new c("notebook-template",{fontCharacter:"\\ebbf"}),c.debugRerun=new c("debug-rerun",{fontCharacter:"\\ebc0"}),c.workspaceTrusted=new c("workspace-trusted",{fontCharacter:"\\ebc1"}),c.workspaceUntrusted=new c("workspace-untrusted",{fontCharacter:"\\ebc2"}),c.workspaceUnspecified=new c("workspace-unspecified",{fontCharacter:"\\ebc3"}),c.terminalCmd=new c("terminal-cmd",{fontCharacter:"\\ebc4"}),c.terminalDebian=new c("terminal-debian",{fontCharacter:"\\ebc5"}),c.terminalLinux=new c("terminal-linux",{fontCharacter:"\\ebc6"}),c.terminalPowershell=new c("terminal-powershell",{fontCharacter:"\\ebc7"}),c.terminalTmux=new c("terminal-tmux",{fontCharacter:"\\ebc8"}),c.terminalUbuntu=new c("terminal-ubuntu",{fontCharacter:"\\ebc9"}),c.terminalBash=new c("terminal-bash",{fontCharacter:"\\ebca"}),c.arrowSwap=new c("arrow-swap",{fontCharacter:"\\ebcb"}),c.copy=new c("copy",{fontCharacter:"\\ebcc"}),c.personAdd=new c("person-add",{fontCharacter:"\\ebcd"}),c.filterFilled=new c("filter-filled",{fontCharacter:"\\ebce"}),c.wand=new c("wand",{fontCharacter:"\\ebcf"}),c.debugLineByLine=new c("debug-line-by-line",{fontCharacter:"\\ebd0"}),c.inspect=new c("inspect",{fontCharacter:"\\ebd1"}),c.layers=new c("layers",{fontCharacter:"\\ebd2"}),c.layersDot=new c("layers-dot",{fontCharacter:"\\ebd3"}),c.layersActive=new c("layers-active",{fontCharacter:"\\ebd4"}),c.compass=new c("compass",{fontCharacter:"\\ebd5"}),c.compassDot=new c("compass-dot",{fontCharacter:"\\ebd6"}),c.compassActive=new c("compass-active",{fontCharacter:"\\ebd7"}),c.azure=new c("azure",{fontCharacter:"\\ebd8"}),c.issueDraft=new c("issue-draft",{fontCharacter:"\\ebd9"}),c.gitPullRequestClosed=new c("git-pull-request-closed",{fontCharacter:"\\ebda"}),c.gitPullRequestDraft=new c("git-pull-request-draft",{fontCharacter:"\\ebdb"}),c.debugAll=new c("debug-all",{fontCharacter:"\\ebdc"}),c.debugCoverage=new c("debug-coverage",{fontCharacter:"\\ebdd"}),c.runErrors=new c("run-errors",{fontCharacter:"\\ebde"}),c.folderLibrary=new c("folder-library",{fontCharacter:"\\ebdf"}),c.debugContinueSmall=new c("debug-continue-small",{fontCharacter:"\\ebe0"}),c.beakerStop=new c("beaker-stop",{fontCharacter:"\\ebe1"}),c.graphLine=new c("graph-line",{fontCharacter:"\\ebe2"}),c.graphScatter=new c("graph-scatter",{fontCharacter:"\\ebe3"}),c.pieChart=new c("pie-chart",{fontCharacter:"\\ebe4"}),c.bracket=new c("bracket",c.json.definition),c.bracketDot=new c("bracket-dot",{fontCharacter:"\\ebe5"}),c.bracketError=new c("bracket-error",{fontCharacter:"\\ebe6"}),c.lockSmall=new c("lock-small",{fontCharacter:"\\ebe7"}),c.azureDevops=new c("azure-devops",{fontCharacter:"\\ebe8"}),c.verifiedFilled=new c("verified-filled",{fontCharacter:"\\ebe9"})}(Pe||(Pe={}))},79881:function(Ir,Mt,Y){"use strict";Y.d(Mt,{B8:function(){return V},Cp:function(){return Ge},F0:function(){return $},L6:function(){return te},VV:function(){return Pe},b1:function(){return c},dL:function(){return Xe},ri:function(){return Oe}});class Ce{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(b){setTimeout(()=>{throw b.stack?new Error(b.message+`
`+b.stack):b},0)}}emit(b){this.listeners.forEach(M=>{M(b)})}onUnexpectedError(b){this.unexpectedErrorHandler(b),this.emit(b)}onUnexpectedExternalError(b){this.unexpectedErrorHandler(b)}}const Le=new Ce;function Xe(A){Pe(A)||Le.onUnexpectedError(A)}function Ge(A){Pe(A)||Le.onUnexpectedExternalError(A)}function Oe(A){if(A instanceof Error){let{name:b,message:M}=A;const I=A.stacktrace||A.stack;return{$isError:!0,name:b,message:M,stack:I}}return A}const me="Canceled";function Pe(A){return A instanceof Error&&A.name===me&&A.message===me}function $(){const A=new Error(me);return A.name=A.message,A}function c(A){return A?new Error(`Illegal argument: ${A}`):new Error("Illegal argument")}function te(A){return A?new Error(`Illegal state: ${A}`):new Error("Illegal state")}class V extends Error{constructor(b){super("NotSupported"),b&&(this.message=b)}}},4348:function(Ir,Mt,Y){"use strict";Y.d(Mt,{D0:function(){return V},E7:function(){return A},K3:function(){return te},Q5:function(){return c},ZD:function(){return b},ju:function(){return Oe}});var Ce=Y(79881),Le=Y(69323),Xe=Y(34502),Ge=Y(95830),Oe;(function(M){M.None=()=>Le.JT.None;function I(ue){return(ce,De=null,xe)=>{let C=!1,B;return B=ue(ee=>{if(!C)return B?B.dispose():C=!0,ce.call(De,ee)},null,xe),C&&B.dispose(),B}}M.once=I;function re(ue,ce){return P((De,xe=null,C)=>ue(B=>De.call(xe,ce(B)),null,C))}M.map=re;function se(ue,ce){return P((De,xe=null,C)=>ue(B=>{ce(B),De.call(xe,B)},null,C))}M.forEach=se;function q(ue,ce){return P((De,xe=null,C)=>ue(B=>ce(B)&&De.call(xe,B),null,C))}M.filter=q;function W(ue){return ue}M.signal=W;function Z(...ue){return(ce,De=null,xe)=>(0,Le.F8)(...ue.map(C=>C(B=>ce.call(De,B),null,xe)))}M.any=Z;function le(ue,ce,De){let xe=De;return re(ue,C=>(xe=ce(xe,C),xe))}M.reduce=le;function P(ue){let ce;const De=new c({onFirstListenerAdd(){ce=ue(De.fire,De)},onLastListenerRemove(){ce.dispose()}});return De.event}function ae(ue,ce,De=100,xe=!1,C){let B,ee,we,rt=0;const tt=new c({leakWarningThreshold:C,onFirstListenerAdd(){B=ue(ot=>{rt++,ee=ce(ee,ot),xe&&!we&&(tt.fire(ee),ee=void 0),clearTimeout(we),we=setTimeout(()=>{const je=ee;ee=void 0,we=void 0,(!xe||rt>1)&&tt.fire(je),rt=0},De)})},onLastListenerRemove(){B.dispose()}});return tt.event}M.debounce=ae;function Te(ue,ce=(De,xe)=>De===xe){let De=!0,xe;return q(ue,C=>{const B=De||!ce(C,xe);return De=!1,xe=C,B})}M.latch=Te;function ye(ue,ce){return[M.filter(ue,ce),M.filter(ue,De=>!ce(De))]}M.split=ye;function Je(ue,ce=!1,De=[]){let xe=De.slice(),C=ue(we=>{xe?xe.push(we):ee.fire(we)});const B=()=>{xe&&xe.forEach(we=>ee.fire(we)),xe=null},ee=new c({onFirstListenerAdd(){C||(C=ue(we=>ee.fire(we)))},onFirstListenerDidAdd(){xe&&(ce?setTimeout(B):B())},onLastListenerRemove(){C&&C.dispose(),C=null}});return ee.event}M.buffer=Je;class Ve{constructor(ce){this.event=ce}map(ce){return new Ve(re(this.event,ce))}forEach(ce){return new Ve(se(this.event,ce))}filter(ce){return new Ve(q(this.event,ce))}reduce(ce,De){return new Ve(le(this.event,ce,De))}latch(){return new Ve(Te(this.event))}debounce(ce,De=100,xe=!1,C){return new Ve(ae(this.event,ce,De,xe,C))}on(ce,De,xe){return this.event(ce,De,xe)}once(ce,De,xe){return I(this.event)(ce,De,xe)}}function st(ue){return new Ve(ue)}M.chain=st;function ft(ue,ce,De=xe=>xe){const xe=(...we)=>ee.fire(De(...we)),C=()=>ue.on(ce,xe),B=()=>ue.removeListener(ce,xe),ee=new c({onFirstListenerAdd:C,onLastListenerRemove:B});return ee.event}M.fromNodeEventEmitter=ft;function ie(ue,ce,De=xe=>xe){const xe=(...we)=>ee.fire(De(...we)),C=()=>ue.addEventListener(ce,xe),B=()=>ue.removeEventListener(ce,xe),ee=new c({onFirstListenerAdd:C,onLastListenerRemove:B});return ee.event}M.fromDOMEventEmitter=ie;function Q(ue){return new Promise(ce=>I(ue)(ce))}M.toPromise=Q})(Oe||(Oe={}));class me{constructor(I){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${I}_${me._idPool++}`}start(I){this._stopWatch=new Ge.G(!0),this._listenerCount=I}stop(){if(this._stopWatch){const I=this._stopWatch.elapsed();this._elapsedOverall+=I,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${I.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}me._idPool=0;let Pe=-1;class ${constructor(I,re=Math.random().toString(18).slice(2,5)){this.customThreshold=I,this.name=re,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(I){let re=Pe;if(typeof this.customThreshold=="number"&&(re=this.customThreshold),re<=0||I<re)return;this._stacks||(this._stacks=new Map);const se=new Error().stack.split(`
`).slice(3).join(`
`),q=this._stacks.get(se)||0;if(this._stacks.set(se,q+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=re*.5;let W,Z=0;for(const[le,P]of this._stacks)(!W||Z<P)&&(W=le,Z=P);console.warn(`[${this.name}] potential listener LEAK detected, having ${I} listeners already. MOST frequent listener (${Z}):`),console.warn(W)}return()=>{const W=this._stacks.get(se)||0;this._stacks.set(se,W-1)}}}class c{constructor(I){var re;this._disposed=!1,this._options=I,this._leakageMon=Pe>0?new $(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((re=this._options)===null||re===void 0)&&re._profName?new me(this._options._profName):void 0}get event(){return this._event||(this._event=(I,re,se)=>{var q;this._listeners||(this._listeners=new Xe.S);const W=this._listeners.isEmpty();W&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const Z=this._listeners.push(re?[I,re]:I);W&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,I,re);const le=(q=this._leakageMon)===null||q===void 0?void 0:q.check(this._listeners.size),P=(0,Le.OF)(()=>{le&&le(),this._disposed||(Z(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return se instanceof Le.SL?se.add(P):Array.isArray(se)&&se.push(P),P}),this._event}fire(I){var re,se;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Xe.S);for(let q of this._listeners)this._deliveryQueue.push([q,I]);for((re=this._perfMon)===null||re===void 0||re.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[q,W]=this._deliveryQueue.shift();try{typeof q=="function"?q.call(void 0,W):q[0].call(q[1],W)}catch(Z){(0,Ce.dL)(Z)}}(se=this._perfMon)===null||se===void 0||se.stop()}}dispose(){var I,re,se,q,W;this._disposed||(this._disposed=!0,(I=this._listeners)===null||I===void 0||I.clear(),(re=this._deliveryQueue)===null||re===void 0||re.clear(),(q=(se=this._options)===null||se===void 0?void 0:se.onLastListenerRemove)===null||q===void 0||q.call(se),(W=this._leakageMon)===null||W===void 0||W.dispose())}}class te extends c{constructor(I){super(I),this._isPaused=0,this._eventQueue=new Xe.S,this._mergeFn=I==null?void 0:I.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const I=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(I))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(I){this._listeners&&(this._isPaused!==0?this._eventQueue.push(I):super.fire(I))}}class V extends te{constructor(I){var re;super(I),this._delay=(re=I.delay)!==null&&re!==void 0?re:100}fire(I){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(I)}}class A{constructor(){this.buffers=[]}wrapEvent(I){return(re,se,q)=>I(W=>{const Z=this.buffers[this.buffers.length-1];Z?Z.push(()=>re.call(se,W)):re.call(se,W)},void 0,q)}bufferEvents(I){const re=[];this.buffers.push(re);const se=I();return this.buffers.pop(),re.forEach(q=>q()),se}}class b{constructor(){this.listening=!1,this.inputEvent=Oe.None,this.inputEventListener=Le.JT.None,this.emitter=new c({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(I){this.inputEvent=I,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=I(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(Ir,Mt,Y){"use strict";Y.d(Mt,{I:function(){return Ce}});function Ce(Le){const Xe=this;let Ge=!1,Oe;return function(){return Ge||(Ge=!0,Oe=Le.apply(Xe,arguments)),Oe}}},88226:function(Ir,Mt,Y){"use strict";Y.d(Mt,{$:function(){return Ce}});var Ce;(function(Le){function Xe(Z){return Z&&typeof Z=="object"&&typeof Z[Symbol.iterator]=="function"}Le.is=Xe;const Ge=Object.freeze([]);function Oe(){return Ge}Le.empty=Oe;function*me(Z){yield Z}Le.single=me;function Pe(Z){return Z||Ge}Le.from=Pe;function $(Z){return!Z||Z[Symbol.iterator]().next().done===!0}Le.isEmpty=$;function c(Z){return Z[Symbol.iterator]().next().value}Le.first=c;function te(Z,le){for(const P of Z)if(le(P))return!0;return!1}Le.some=te;function V(Z,le){for(const P of Z)if(le(P))return P}Le.find=V;function*A(Z,le){for(const P of Z)le(P)&&(yield P)}Le.filter=A;function*b(Z,le){let P=0;for(const ae of Z)yield le(ae,P++)}Le.map=b;function*M(...Z){for(const le of Z)for(const P of le)yield P}Le.concat=M;function*I(Z){for(const le of Z)for(const P of le)yield P}Le.concatNested=I;function re(Z,le,P){let ae=P;for(const Te of Z)ae=le(ae,Te);return ae}Le.reduce=re;function*se(Z,le,P=Z.length){for(le<0&&(le+=Z.length),P<0?P+=Z.length:P>Z.length&&(P=Z.length);le<P;le++)yield Z[le]}Le.slice=se;function q(Z,le=Number.POSITIVE_INFINITY){const P=[];if(le===0)return[P,Z];const ae=Z[Symbol.iterator]();for(let Te=0;Te<le;Te++){const ye=ae.next();if(ye.done)return[P,Le.empty()];P.push(ye.value)}return[P,{[Symbol.iterator](){return ae}}]}Le.consume=q;function W(Z,le,P=(ae,Te)=>ae===Te){const ae=Z[Symbol.iterator](),Te=le[Symbol.iterator]();for(;;){const ye=ae.next(),Je=Te.next();if(ye.done!==Je.done)return!1;if(ye.done)return!0;if(!P(ye.value,Je.value))return!1}}Le.equals=W})(Ce||(Ce={}))},69323:function(Ir,Mt,Y){"use strict";Y.d(Mt,{B9:function(){return b},F8:function(){return M},JT:function(){return se},Jz:function(){return W},OF:function(){return I},SL:function(){return re},Wf:function(){return A},XK:function(){return q},dk:function(){return te}});var Ce=Y(17845),Le=Y(88226);const Xe=!1;let Ge=null;function Oe(Z){Ge=Z}if(Xe){const Z="__is_disposable_tracked__";Oe(new class{trackDisposable(le){const P=new Error("Potentially leaked disposable").stack;setTimeout(()=>{le[Z]||console.log(P)},3e3)}setParent(le,P){if(le&&le!==se.None)try{le[Z]=!0}catch(ae){}}markAsDisposed(le){if(le&&le!==se.None)try{le[Z]=!0}catch(P){}}markAsSingleton(le){}})}function me(Z){return Ge==null||Ge.trackDisposable(Z),Z}function Pe(Z){Ge==null||Ge.markAsDisposed(Z)}function $(Z,le){Ge==null||Ge.setParent(Z,le)}function c(Z,le){if(Ge)for(const P of Z)Ge.setParent(P,le)}function te(Z){return Ge==null||Ge.markAsSingleton(Z),Z}class V extends Error{constructor(le){super(`Encountered errors while disposing of store. Errors: [${le.join(", ")}]`),this.errors=le}}function A(Z){return typeof Z.dispose=="function"&&Z.dispose.length===0}function b(Z){if(Le.$.is(Z)){let le=[];for(const P of Z)if(P)try{P.dispose()}catch(ae){le.push(ae)}if(le.length===1)throw le[0];if(le.length>1)throw new V(le);return Array.isArray(Z)?[]:Z}else if(Z)return Z.dispose(),Z}function M(...Z){const le=I(()=>b(Z));return c(Z,le),le}function I(Z){const le=me({dispose:(0,Ce.I)(()=>{Pe(le),Z()})});return le}class re{constructor(){this._toDispose=new Set,this._isDisposed=!1,me(this)}dispose(){this._isDisposed||(Pe(this),this._isDisposed=!0,this.clear())}clear(){try{b(this._toDispose.values())}finally{this._toDispose.clear()}}add(le){if(!le)return le;if(le===this)throw new Error("Cannot register a disposable on itself!");return $(le,this),this._isDisposed?re.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(le),le}}re.DISABLE_DISPOSED_WARNING=!1;class se{constructor(){this._store=new re,me(this),$(this._store,this)}dispose(){Pe(this),this._store.dispose()}_register(le){if(le===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(le)}}se.None=Object.freeze({dispose(){}});class q{constructor(){this._isDisposed=!1,me(this)}get value(){return this._isDisposed?void 0:this._value}set value(le){var P;this._isDisposed||le===this._value||((P=this._value)===null||P===void 0||P.dispose(),le&&$(le,this),this._value=le)}clear(){this.value=void 0}dispose(){var le;this._isDisposed=!0,Pe(this),(le=this._value)===null||le===void 0||le.dispose(),this._value=void 0}clearAndLeak(){const le=this._value;return this._value=void 0,le&&$(le,null),le}}class W{constructor(le){this.object=le}dispose(){}}},34502:function(Ir,Mt,Y){"use strict";Y.d(Mt,{S:function(){return Le}});class Ce{constructor(Ge){this.element=Ge,this.next=Ce.Undefined,this.prev=Ce.Undefined}}Ce.Undefined=new Ce(void 0);class Le{constructor(){this._first=Ce.Undefined,this._last=Ce.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ce.Undefined}clear(){let Ge=this._first;for(;Ge!==Ce.Undefined;){const Oe=Ge.next;Ge.prev=Ce.Undefined,Ge.next=Ce.Undefined,Ge=Oe}this._first=Ce.Undefined,this._last=Ce.Undefined,this._size=0}unshift(Ge){return this._insert(Ge,!1)}push(Ge){return this._insert(Ge,!0)}_insert(Ge,Oe){const me=new Ce(Ge);if(this._first===Ce.Undefined)this._first=me,this._last=me;else if(Oe){const $=this._last;this._last=me,me.prev=$,$.next=me}else{const $=this._first;this._first=me,me.next=$,$.prev=me}this._size+=1;let Pe=!1;return()=>{Pe||(Pe=!0,this._remove(me))}}shift(){if(this._first!==Ce.Undefined){const Ge=this._first.element;return this._remove(this._first),Ge}}pop(){if(this._last!==Ce.Undefined){const Ge=this._last.element;return this._remove(this._last),Ge}}_remove(Ge){if(Ge.prev!==Ce.Undefined&&Ge.next!==Ce.Undefined){const Oe=Ge.prev;Oe.next=Ge.next,Ge.next.prev=Oe}else Ge.prev===Ce.Undefined&&Ge.next===Ce.Undefined?(this._first=Ce.Undefined,this._last=Ce.Undefined):Ge.next===Ce.Undefined?(this._last=this._last.prev,this._last.next=Ce.Undefined):Ge.prev===Ce.Undefined&&(this._first=this._first.next,this._first.prev=Ce.Undefined);this._size-=1}*[Symbol.iterator](){let Ge=this._first;for(;Ge!==Ce.Undefined;)yield Ge.element,Ge=Ge.next}}},23345:function(Ir,Mt,Y){"use strict";Y.d(Mt,{$L:function(){return ae},ED:function(){return W},IJ:function(){return le},OS:function(){return Ve},WE:function(){return ye},dz:function(){return Z},gn:function(){return Te},li:function(){return I},r:function(){return ie},tY:function(){return P},xS:function(){return Je}});var Ce=Y(97671),Le;const Xe="en";let Ge=!1,Oe=!1,me=!1,Pe=!1,$=!1,c=!1,te=!1,V,A=null,b=null,M;const I=typeof self=="object"?self:typeof Y.g=="object"?Y.g:{};let re;typeof I.vscode!="undefined"&&typeof I.vscode.process!="undefined"?re=I.vscode.process:typeof Ce!="undefined"&&(re=Ce);const se=typeof((Le=re==null?void 0:re.versions)===null||Le===void 0?void 0:Le.electron)=="string"&&re.type==="renderer";if(typeof navigator=="object"&&!se)M=navigator.userAgent,Ge=M.indexOf("Windows")>=0,Oe=M.indexOf("Macintosh")>=0,te=(M.indexOf("Macintosh")>=0||M.indexOf("iPad")>=0||M.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,me=M.indexOf("Linux")>=0,c=!0,V=navigator.language,A=V;else if(typeof re=="object"){Ge=re.platform==="win32",Oe=re.platform==="darwin",me=re.platform==="linux",Pe=me&&!!re.env.SNAP&&!!re.env.SNAP_REVISION,V=Xe,A=Xe;const Q=re.env.VSCODE_NLS_CONFIG;if(Q)try{const ue=JSON.parse(Q),ce=ue.availableLanguages["*"];V=ue.locale,A=ce||Xe,b=ue._translationsConfigFile}catch(ue){}$=!0}else console.error("Unable to resolve platform.");let q=0;Oe?q=1:Ge?q=3:me&&(q=2);const W=Ge,Z=Oe,le=me,P=$,ae=c,Te=te,ye=M,Je=function(){if(I.setImmediate)return I.setImmediate.bind(I);if(typeof I.postMessage=="function"&&!I.importScripts){let ce=[];I.addEventListener("message",xe=>{if(xe.data&&xe.data.vscodeSetImmediateId)for(let C=0,B=ce.length;C<B;C++){const ee=ce[C];if(ee.id===xe.data.vscodeSetImmediateId){ce.splice(C,1),ee.callback();return}}});let De=0;return xe=>{const C=++De;ce.push({id:C,callback:xe}),I.postMessage({vscodeSetImmediateId:C},"*")}}if(typeof(re==null?void 0:re.nextTick)=="function")return re.nextTick.bind(re);const ue=Promise.resolve();return ce=>ue.then(ce)}(),Ve=Oe||te?2:Ge?1:3;let st=!0,ft=!1;function ie(){if(!ft){ft=!0;const Q=new Uint8Array(2);Q[0]=1,Q[1]=2,st=new Uint16Array(Q.buffer)[0]===513}return st}},95830:function(Ir,Mt,Y){"use strict";Y.d(Mt,{G:function(){return Xe}});var Ce=Y(23345);const Le=Ce.li.performance&&typeof Ce.li.performance.now=="function";class Xe{constructor(Oe){this._highResolution=Le&&Oe,this._startTime=this._now(),this._stopTime=-1}static create(Oe=!0){return new Xe(Oe)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Ce.li.performance.now():Date.now()}}},82983:function(Ir,Mt,Y){"use strict";Y.d(Mt,{$i:function(){return rt},C8:function(){return Kt},GF:function(){return V},HO:function(){return De},IO:function(){return A},K7:function(){return nr},Kw:function(){return Rr},LC:function(){return I},Mh:function(){return Je},P1:function(){return Ve},PJ:function(){return hn},Qe:function(){return tt},R1:function(){return te},RP:function(){return ee},S6:function(){return Nr},TT:function(){return W},Ut:function(){return C},V8:function(){return re},WU:function(){return Xe},YK:function(){return ft},YU:function(){return Ge},ZG:function(){return st},ZH:function(){return Q},ab:function(){return ot},c1:function(){return Lt},df:function(){return ae},ec:function(){return Oe},fi:function(){return an},fy:function(){return me},j3:function(){return Pe},j_:function(){return le},m5:function(){return Ce},mK:function(){return P},mr:function(){return b},oH:function(){return mt},oL:function(){return $},ok:function(){return ye},ow:function(){return se},qq:function(){return Te},qu:function(){return q},rL:function(){return ie},uS:function(){return Gr},un:function(){return c},uq:function(){return M},vH:function(){return ce},xe:function(){return je},zY:function(){return Z}});function Ce(ge){return!ge||typeof ge!="string"?!0:ge.trim().length===0}const Le=/{(\d+)}/g;function Xe(ge,...Be){return Be.length===0?ge:ge.replace(Le,function(et,gt){const vt=parseInt(gt,10);return isNaN(vt)||vt<0||vt>=Be.length?et:Be[vt]})}function Ge(ge){return ge.replace(/[<>&]/g,function(Be){switch(Be){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Be}})}function Oe(ge){return ge.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function me(ge,Be=" "){const et=Pe(ge,Be);return $(et,Be)}function Pe(ge,Be){if(!ge||!Be)return ge;const et=Be.length;if(et===0||ge.length===0)return ge;let gt=0;for(;ge.indexOf(Be,gt)===gt;)gt=gt+et;return ge.substring(gt)}function $(ge,Be){if(!ge||!Be)return ge;const et=Be.length,gt=ge.length;if(et===0||gt===0)return ge;let vt=gt,Ut=-1;for(;Ut=ge.lastIndexOf(Be,vt-1),!(Ut===-1||Ut+et!==vt);){if(Ut===0)return"";vt=Ut}return ge.substring(0,vt)}function c(ge){return ge.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function te(ge){return ge.replace(/\*/g,"")}function V(ge,Be,et={}){if(!ge)throw new Error("Cannot create regex from empty string");Be||(ge=Oe(ge)),et.wholeWord&&(/\B/.test(ge.charAt(0))||(ge="\\b"+ge),/\B/.test(ge.charAt(ge.length-1))||(ge=ge+"\\b"));let gt="";return et.global&&(gt+="g"),et.matchCase||(gt+="i"),et.multiline&&(gt+="m"),et.unicode&&(gt+="u"),new RegExp(ge,gt)}function A(ge){return ge.source==="^"||ge.source==="^$"||ge.source==="$"||ge.source==="^\\s*$"?!1:!!(ge.exec("")&&ge.lastIndex===0)}function b(ge){return(ge.global?"g":"")+(ge.ignoreCase?"i":"")+(ge.multiline?"m":"")+(ge.unicode?"u":"")}function M(ge){return ge.split(/\r\n|\r|\n/)}function I(ge){for(let Be=0,et=ge.length;Be<et;Be++){const gt=ge.charCodeAt(Be);if(gt!==32&&gt!==9)return Be}return-1}function re(ge,Be=0,et=ge.length){for(let gt=Be;gt<et;gt++){const vt=ge.charCodeAt(gt);if(vt!==32&&vt!==9)return ge.substring(Be,gt)}return ge.substring(Be,et)}function se(ge,Be=ge.length-1){for(let et=Be;et>=0;et--){const gt=ge.charCodeAt(et);if(gt!==32&&gt!==9)return et}return-1}function q(ge,Be){return ge<Be?-1:ge>Be?1:0}function W(ge,Be,et=0,gt=ge.length,vt=0,Ut=Be.length){for(;et<gt&&vt<Ut;et++,vt++){let Ke=ge.charCodeAt(et),$t=Be.charCodeAt(vt);if(Ke<$t)return-1;if(Ke>$t)return 1}const hr=gt-et,Yt=Ut-vt;return hr<Yt?-1:hr>Yt?1:0}function Z(ge,Be){return le(ge,Be,0,ge.length,0,Be.length)}function le(ge,Be,et=0,gt=ge.length,vt=0,Ut=Be.length){for(;et<gt&&vt<Ut;et++,vt++){let Ke=ge.charCodeAt(et),$t=Be.charCodeAt(vt);if(Ke===$t)continue;if(Ke>=128||$t>=128)return W(ge.toLowerCase(),Be.toLowerCase(),et,gt,vt,Ut);P(Ke)&&(Ke-=32),P($t)&&($t-=32);const cr=Ke-$t;if(cr!==0)return cr}const hr=gt-et,Yt=Ut-vt;return hr<Yt?-1:hr>Yt?1:0}function P(ge){return ge>=97&&ge<=122}function ae(ge){return ge>=65&&ge<=90}function Te(ge,Be){return ge.length===Be.length&&le(ge,Be)===0}function ye(ge,Be){const et=Be.length;return Be.length>ge.length?!1:le(ge,Be,0,et)===0}function Je(ge,Be){let et,gt=Math.min(ge.length,Be.length);for(et=0;et<gt;et++)if(ge.charCodeAt(et)!==Be.charCodeAt(et))return et;return gt}function Ve(ge,Be){let et,gt=Math.min(ge.length,Be.length);const vt=ge.length-1,Ut=Be.length-1;for(et=0;et<gt;et++)if(ge.charCodeAt(vt-et)!==Be.charCodeAt(Ut-et))return et;return gt}function st(ge){return 55296<=ge&&ge<=56319}function ft(ge){return 56320<=ge&&ge<=57343}function ie(ge,Be){return(ge-55296<<10)+(Be-56320)+65536}function Q(ge,Be,et){const gt=ge.charCodeAt(et);if(st(gt)&&et+1<Be){const vt=ge.charCodeAt(et+1);if(ft(vt))return ie(gt,vt)}return gt}function ue(ge,Be){const et=ge.charCodeAt(Be-1);if(ft(et)&&Be>1){const gt=ge.charCodeAt(Be-2);if(st(gt))return ie(gt,et)}return et}function ce(ge,Be){const et=zr.getInstance(),gt=Be,vt=ge.length,Ut=Q(ge,vt,Be);Be+=Ut>=65536?2:1;let hr=et.getGraphemeBreakType(Ut);for(;Be<vt;){const Yt=Q(ge,vt,Be),Ke=et.getGraphemeBreakType(Yt);if(an(hr,Ke))break;Be+=Yt>=65536?2:1,hr=Ke}return Be-gt}function De(ge,Be){const et=zr.getInstance(),gt=Be,vt=ue(ge,Be);Be-=vt>=65536?2:1;let Ut=et.getGraphemeBreakType(vt);for(;Be>0;){const hr=ue(ge,Be),Yt=et.getGraphemeBreakType(hr);if(an(Yt,Ut))break;Be-=hr>=65536?2:1,Ut=Yt}return gt-Be}const xe=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function C(ge){return xe.test(ge)}const B=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function ee(ge){return B.test(ge)}const we=/^[\t\n\r\x20-\x7E]*$/;function rt(ge){return we.test(ge)}const tt=/[\u2028\u2029]/;function ot(ge){return tt.test(ge)}function je(ge){for(let Be=0,et=ge.length;Be<et;Be++)if(nr(ge.charCodeAt(Be)))return!0;return!1}function nr(ge){return ge=+ge,ge>=11904&&ge<=55215||ge>=63744&&ge<=64255||ge>=65281&&ge<=65374}function Kt(ge){return ge>=127462&&ge<=127487||ge===8986||ge===8987||ge===9200||ge===9203||ge>=9728&&ge<=10175||ge===11088||ge===11093||ge>=127744&&ge<=128591||ge>=128640&&ge<=128764||ge>=128992&&ge<=129003||ge>=129280&&ge<=129535||ge>=129648&&ge<=129750}const Lt="\uFEFF";function Gr(ge){return!!(ge&&ge.length>0&&ge.charCodeAt(0)===65279)}function Rr(ge,Be=!1){return ge?(Be&&(ge=ge.replace(/\\./g,"")),ge.toLowerCase()!==ge):!1}function hn(ge){return ge=ge%(2*26),ge<26?String.fromCharCode(97+ge):String.fromCharCode(65+ge-26)}function Nr(ge){return zr.getInstance().getGraphemeBreakType(ge)}function an(ge,Be){return ge===0?Be!==5&&Be!==7:ge===2&&Be===3?!1:ge===4||ge===2||ge===3||Be===4||Be===2||Be===3?!0:!(ge===8&&(Be===8||Be===9||Be===11||Be===12)||(ge===11||ge===9)&&(Be===9||Be===10)||(ge===12||ge===10)&&Be===10||Be===5||Be===13||Be===7||ge===1||ge===13&&Be===14||ge===6&&Be===6)}class zr{constructor(){this._data=We()}static getInstance(){return zr._INSTANCE||(zr._INSTANCE=new zr),zr._INSTANCE}getGraphemeBreakType(Be){if(Be<32)return Be===10?3:Be===13?2:4;if(Be<127)return 0;const et=this._data,gt=et.length/3;let vt=1;for(;vt<=gt;)if(Be<et[3*vt])vt=2*vt;else if(Be>et[3*vt+1])vt=2*vt+1;else return et[3*vt+2];return 0}}zr._INSTANCE=null;function We(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function mt(ge,Be){if(ge===0)return 0;const et=Ye(ge,Be);if(et!==void 0)return et;const gt=ue(Be,ge);return ge-=Et(gt),ge}function Ye(ge,Be){let et=ue(Be,ge);for(ge-=Et(et);Tt(et)||et===65039||et===8419;){if(ge===0)return;et=ue(Be,ge),ge-=Et(et)}if(Kt(et)){if(ge>=0){const gt=ue(Be,ge);gt===8205&&(ge-=Et(gt))}return ge}}function Et(ge){return ge>=65536?2:1}function Tt(ge){return 127995<=ge&&ge<=127999}},72999:function(Ir,Mt,Y){"use strict";Y.d(Mt,{$E:function(){return I},$K:function(){return Pe},D8:function(){return A},HD:function(){return Le},IU:function(){return re},Jp:function(){return $},Kn:function(){return Xe},cW:function(){return te},f6:function(){return se},hj:function(){return Ge},jn:function(){return Oe},kJ:function(){return Ce},mf:function(){return V},o8:function(){return me},p_:function(){return c},vE:function(){return q}});function Ce(W){return Array.isArray(W)}function Le(W){return typeof W=="string"}function Xe(W){return typeof W=="object"&&W!==null&&!Array.isArray(W)&&!(W instanceof RegExp)&&!(W instanceof Date)}function Ge(W){return typeof W=="number"&&!isNaN(W)}function Oe(W){return W===!0||W===!1}function me(W){return typeof W=="undefined"}function Pe(W){return!$(W)}function $(W){return me(W)||W===null}function c(W,Z){if(!W)throw new Error(Z?`Unexpected type, expected '${Z}'`:"Unexpected type")}function te(W){if($(W))throw new Error("Assertion Failed: argument is undefined or null");return W}function V(W){return typeof W=="function"}function A(W,Z){const le=Math.min(W.length,Z.length);for(let P=0;P<le;P++)b(W[P],Z[P])}function b(W,Z){if(Le(Z)){if(typeof W!==Z)throw new Error(`argument does not match constraint: typeof ${Z}`)}else if(V(Z)){try{if(W instanceof Z)return}catch(le){}if(!$(W)&&W.constructor===Z||Z.length===1&&Z.call(void 0,W)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function M(W){let Z=[],le=Object.getPrototypeOf(W);for(;Object.prototype!==le;)Z=Z.concat(Object.getOwnPropertyNames(le)),le=Object.getPrototypeOf(le);return Z}function I(W){const Z=[];for(const le of M(W))typeof W[le]=="function"&&Z.push(le);return Z}function re(W,Z){const le=ae=>function(){const Te=Array.prototype.slice.call(arguments,0);return Z(ae,Te)};let P={};for(const ae of W)P[ae]=le(ae);return P}function se(W){return W===null?void 0:W}function q(W,Z="Unreachable"){throw new Error(Z)}},13268:function(Ir,Mt,Y){"use strict";Y.d(Mt,{N:function(){return Le}});function Ce(Xe,Ge){let Oe;return Ge.length===0?Oe=Xe:Oe=Xe.replace(/\{(\d+)\}/g,function(me,Pe){const $=Pe[0];return typeof Ge[$]!="undefined"?Ge[$]:me}),Oe}function Le(Xe,Ge,...Oe){return Ce(Ge,Oe)}},96236:function(Ir,Mt,Y){"use strict";Y.d(Mt,{BH:function(){return re},NZ:function(){return se},U8:function(){return q},co:function(){return I},eH:function(){return M},vr:function(){return b}});var Ce=Y(75918),Le=Y(52615),Xe=Y(4348),Ge=Y(88226),Oe=Y(69323),me=Y(34502),Pe=Y(35884),$=Y(90689),c=Y(16925),te=Y(49055),V=function(W,Z,le,P){var ae=arguments.length,Te=ae<3?Z:P===null?P=Object.getOwnPropertyDescriptor(Z,le):P,ye;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Te=Reflect.decorate(W,Z,le,P);else for(var Je=W.length-1;Je>=0;Je--)(ye=W[Je])&&(Te=(ae<3?ye(Te):ae>3?ye(Z,le,Te):ye(Z,le))||Te);return ae>3&&Te&&Object.defineProperty(Z,le,Te),Te},A=function(W,Z){return function(le,P){Z(le,P,W)}};function b(W){return W.command!==void 0}class M{constructor(Z){this.id=M._idPool++,this._debugName=Z}}M._idPool=0,M.CommandPalette=new M("CommandPalette"),M.EditorContext=new M("EditorContext"),M.SimpleEditorContext=new M("SimpleEditorContext"),M.EditorContextCopy=new M("EditorContextCopy"),M.EditorContextPeek=new M("EditorContextPeek"),M.MenubarEditMenu=new M("MenubarEditMenu"),M.MenubarCopy=new M("MenubarCopy"),M.MenubarGoMenu=new M("MenubarGoMenu"),M.MenubarSelectionMenu=new M("MenubarSelectionMenu"),M.InlineCompletionsActions=new M("InlineCompletionsActions");const I=(0,c.yh)("menuService"),re=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Xe.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:W=>W===M.CommandPalette}}addCommand(W){return this.addCommands(Ge.$.single(W))}addCommands(W){for(const Z of W)this._commands.set(Z.id,Z);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,Oe.OF)(()=>{let Z=!1;for(const le of W)Z=this._commands.delete(le.id)||Z;Z&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(W){return this._commands.get(W)}getCommands(){const W=new Map;return this._commands.forEach((Z,le)=>W.set(le,Z)),W}appendMenuItem(W,Z){return this.appendMenuItems(Ge.$.single({id:W,item:Z}))}appendMenuItems(W){const Z=new Set,le=new me.S;for(const{id:P,item:ae}of W){let Te=this._menuItems.get(P);Te||(Te=new me.S,this._menuItems.set(P,Te)),le.push(Te.push(ae)),Z.add(P)}return this._onDidChangeMenu.fire(Z),(0,Oe.OF)(()=>{if(le.size>0){for(let P of le)P();this._onDidChangeMenu.fire(Z),le.clear()}})}getMenuItems(W){let Z;return this._menuItems.has(W)?Z=[...this._menuItems.get(W)]:Z=[],W===M.CommandPalette&&this._appendImplicitItems(Z),Z}_appendImplicitItems(W){const Z=new Set;for(const le of W)b(le)&&(Z.add(le.command.id),le.alt&&Z.add(le.alt.id));this._commands.forEach((le,P)=>{Z.has(P)||W.push({command:le})})}};class se extends Ce.wY{constructor(Z,le,P,ae){super(`submenuitem.${Z.submenu.id}`,typeof Z.title=="string"?Z.title:Z.title.value,[],"submenu"),this.item=Z,this._menuService=le,this._contextKeyService=P,this._options=ae}get actions(){const Z=[],le=this._menuService.createMenu(this.item.submenu,this._contextKeyService),P=le.getActions(this._options);le.dispose();for(const[,ae]of P)ae.length>0&&(Z.push(...ae),Z.push(new Ce.Z0));return Z.length&&Z.pop(),Z}}let q=class Of{constructor(Z,le,P,ae,Te){var ye,Je;if(this._commandService=Te,this.id=Z.id,this.label=P!=null&&P.renderShortTitle&&Z.shortTitle?typeof Z.shortTitle=="string"?Z.shortTitle:Z.shortTitle.value:typeof Z.title=="string"?Z.title:Z.title.value,this.tooltip=(Je=typeof Z.tooltip=="string"?Z.tooltip:(ye=Z.tooltip)===null||ye===void 0?void 0:ye.value)!==null&&Je!==void 0?Je:"",this.enabled=!Z.precondition||ae.contextMatchesRules(Z.precondition),this.checked=void 0,Z.toggled){const Ve=Z.toggled.condition?Z.toggled:{condition:Z.toggled};this.checked=ae.contextMatchesRules(Ve.condition),this.checked&&Ve.tooltip&&(this.tooltip=typeof Ve.tooltip=="string"?Ve.tooltip:Ve.tooltip.value),Ve.title&&(this.label=typeof Ve.title=="string"?Ve.title:Ve.title.value)}this.item=Z,this.alt=le?new Of(le,void 0,P,ae,Te):void 0,this._options=P,te.kS.isThemeIcon(Z.icon)&&(this.class=Le.dT.asClassName(Z.icon))}dispose(){}run(...Z){var le,P;let ae=[];return!((le=this._options)===null||le===void 0)&&le.arg&&(ae=[...ae,this._options.arg]),!((P=this._options)===null||P===void 0)&&P.shouldForwardArgs&&(ae=[...ae,...Z]),this._commandService.executeCommand(this.id,...ae)}};q=V([A(3,$.i6),A(4,Pe.H)],q)},35884:function(Ir,Mt,Y){"use strict";Y.d(Mt,{H:function(){return Pe},P:function(){return $}});var Ce=Y(4348),Le=Y(88226),Xe=Y(69323),Ge=Y(34502),Oe=Y(72999),me=Y(16925);const Pe=(0,me.yh)("commandService"),$=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Ce.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(c,te){if(!c)throw new Error("invalid command");if(typeof c=="string"){if(!te)throw new Error("invalid command");return this.registerCommand({id:c,handler:te})}if(c.description){const I=[];for(let se of c.description.args)I.push(se.constraint);const re=c.handler;c.handler=function(se,...q){return(0,Oe.D8)(q,I),re(se,...q)}}const{id:V}=c;let A=this._commands.get(V);A||(A=new Ge.S,this._commands.set(V,A));let b=A.unshift(c),M=(0,Xe.OF)(()=>{b();const I=this._commands.get(V);I!=null&&I.isEmpty()&&this._commands.delete(V)});return this._onDidRegisterCommand.fire(V),M}registerCommandAlias(c,te){return $.registerCommand(c,(V,...A)=>V.get(Pe).executeCommand(te,...A))}getCommand(c){const te=this._commands.get(c);if(!(!te||te.isEmpty()))return Le.$.first(te)}getCommands(){const c=new Map;for(const te of this._commands.keys()){const V=this.getCommand(te);V&&c.set(te,V)}return c}};$.registerCommand("noop",()=>{})},90689:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Ao:function(){return Pe},Eq:function(){return ie},Fb:function(){return $},K8:function(){return ce},i6:function(){return ft},uy:function(){return st}});var Ce=Y(23345),Le=Y(82983),Xe=Y(16925);let Ge=Ce.WE||"";const Oe=new Map;Oe.set("false",!1),Oe.set("true",!0),Oe.set("isMac",Ce.dz),Oe.set("isLinux",Ce.IJ),Oe.set("isWindows",Ce.ED),Oe.set("isWeb",Ce.$L),Oe.set("isMacNative",Ce.dz&&!Ce.$L),Oe.set("isEdge",Ge.indexOf("Edg/")>=0),Oe.set("isFirefox",Ge.indexOf("Firefox")>=0),Oe.set("isChrome",Ge.indexOf("Chrome")>=0),Oe.set("isSafari",Ge.indexOf("Safari")>=0);const me=Object.prototype.hasOwnProperty;class Pe{static has(C){return A.create(C)}static equals(C,B){return b.create(C,B)}static regex(C,B){return ae.create(C,B)}static not(C){return se.create(C)}static and(...C){return Je.create(C,null)}static or(...C){return Ve.create(C,null,!0)}static deserialize(C,B=!1){if(C)return this._deserializeOrExpression(C,B)}static _deserializeOrExpression(C,B){let ee=C.split("||");return Ve.create(ee.map(we=>this._deserializeAndExpression(we,B)),null,!0)}static _deserializeAndExpression(C,B){let ee=C.split("&&");return Je.create(ee.map(we=>this._deserializeOne(we,B)),null)}static _deserializeOne(C,B){if(C=C.trim(),C.indexOf("!=")>=0){let ee=C.split("!=");return re.create(ee[0].trim(),this._deserializeValue(ee[1],B))}if(C.indexOf("==")>=0){let ee=C.split("==");return b.create(ee[0].trim(),this._deserializeValue(ee[1],B))}if(C.indexOf("=~")>=0){let ee=C.split("=~");return ae.create(ee[0].trim(),this._deserializeRegexValue(ee[1],B))}if(C.indexOf(" in ")>=0){let ee=C.split(" in ");return M.create(ee[0].trim(),ee[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(C)){const ee=C.split(">=");return Z.create(ee[0].trim(),ee[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(C)){const ee=C.split(">");return W.create(ee[0].trim(),ee[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(C)){const ee=C.split("<=");return P.create(ee[0].trim(),ee[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(C)){const ee=C.split("<");return le.create(ee[0].trim(),ee[1].trim())}return/^\!\s*/.test(C)?se.create(C.substr(1).trim()):A.create(C)}static _deserializeValue(C,B){if(C=C.trim(),C==="true")return!0;if(C==="false")return!1;let ee=/^'([^']*)'$/.exec(C);return ee?ee[1].trim():C}static _deserializeRegexValue(C,B){if((0,Le.m5)(C)){if(B)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let ee=C.indexOf("/"),we=C.lastIndexOf("/");if(ee===we||ee<0){if(B)throw new Error(`bad regexp-value '${C}', missing /-enclosure`);return console.warn(`bad regexp-value '${C}', missing /-enclosure`),null}let rt=C.slice(ee+1,we),tt=C[we+1]==="i"?"i":"";try{return new RegExp(rt,tt)}catch(ot){if(B)throw new Error(`bad regexp-value '${C}', parse error: ${ot}`);return console.warn(`bad regexp-value '${C}', parse error: ${ot}`),null}}}function $(xe,C){const B=xe?xe.substituteConstants():void 0,ee=C?C.substituteConstants():void 0;return!B&&!ee?!0:!B||!ee?!1:B.equals(ee)}function c(xe,C){return xe.cmp(C)}class te{constructor(){this.type=0}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!1}serialize(){return"false"}keys(){return[]}negate(){return V.INSTANCE}}te.INSTANCE=new te;class V{constructor(){this.type=1}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!0}serialize(){return"true"}keys(){return[]}negate(){return te.INSTANCE}}V.INSTANCE=new V;class A{constructor(C,B){this.key=C,this.negated=B,this.type=2}static create(C,B=null){const ee=Oe.get(C);return typeof ee=="boolean"?ee?V.INSTANCE:te.INSTANCE:new A(C,B)}cmp(C){return C.type!==this.type?this.type-C.type:Q(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=Oe.get(this.key);return typeof C=="boolean"?C?V.INSTANCE:te.INSTANCE:this}evaluate(C){return!!C.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=se.create(this.key,this)),this.negated}}class b{constructor(C,B,ee){this.key=C,this.value=B,this.negated=ee,this.type=4}static create(C,B,ee=null){if(typeof B=="boolean")return B?A.create(C,ee):se.create(C,ee);const we=Oe.get(C);return typeof we=="boolean"?B===(we?"true":"false")?V.INSTANCE:te.INSTANCE:new b(C,B,ee)}cmp(C){return C.type!==this.type?this.type-C.type:ue(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=Oe.get(this.key);if(typeof C=="boolean"){const B=C?"true":"false";return this.value===B?V.INSTANCE:te.INSTANCE}return this}evaluate(C){return C.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=re.create(this.key,this.value,this)),this.negated}}class M{constructor(C,B){this.key=C,this.valueKey=B,this.type=10,this.negated=null}static create(C,B){return new M(C,B)}cmp(C){return C.type!==this.type?this.type-C.type:ue(this.key,this.valueKey,C.key,C.valueKey)}equals(C){return C.type===this.type?this.key===C.key&&this.valueKey===C.valueKey:!1}substituteConstants(){return this}evaluate(C){const B=C.getValue(this.valueKey),ee=C.getValue(this.key);return Array.isArray(B)?B.indexOf(ee)>=0:typeof ee=="string"&&typeof B=="object"&&B!==null?me.call(B,ee):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=I.create(this)),this.negated}}class I{constructor(C){this._actual=C,this.type=11}static create(C){return new I(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class re{constructor(C,B,ee){this.key=C,this.value=B,this.negated=ee,this.type=5}static create(C,B,ee=null){if(typeof B=="boolean")return B?se.create(C,ee):A.create(C,ee);const we=Oe.get(C);return typeof we=="boolean"?B===(we?"true":"false")?te.INSTANCE:V.INSTANCE:new re(C,B,ee)}cmp(C){return C.type!==this.type?this.type-C.type:ue(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=Oe.get(this.key);if(typeof C=="boolean"){const B=C?"true":"false";return this.value===B?te.INSTANCE:V.INSTANCE}return this}evaluate(C){return C.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this.value,this)),this.negated}}class se{constructor(C,B){this.key=C,this.negated=B,this.type=3}static create(C,B=null){const ee=Oe.get(C);return typeof ee=="boolean"?ee?te.INSTANCE:V.INSTANCE:new se(C,B)}cmp(C){return C.type!==this.type?this.type-C.type:Q(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=Oe.get(this.key);return typeof C=="boolean"?C?te.INSTANCE:V.INSTANCE:this}evaluate(C){return!C.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this)),this.negated}}function q(xe,C){if(typeof xe=="string"){const B=parseFloat(xe);isNaN(B)||(xe=B)}return typeof xe=="string"||typeof xe=="number"?C(xe):te.INSTANCE}class W{constructor(C,B,ee){this.key=C,this.value=B,this.negated=ee,this.type=12}static create(C,B,ee=null){return q(B,we=>new W(C,we,ee))}cmp(C){return C.type!==this.type?this.type-C.type:ue(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=P.create(this.key,this.value,this)),this.negated}}class Z{constructor(C,B,ee){this.key=C,this.value=B,this.negated=ee,this.type=13}static create(C,B,ee=null){return q(B,we=>new Z(C,we,ee))}cmp(C){return C.type!==this.type?this.type-C.type:ue(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=le.create(this.key,this.value,this)),this.negated}}class le{constructor(C,B,ee){this.key=C,this.value=B,this.negated=ee,this.type=14}static create(C,B,ee=null){return q(B,we=>new le(C,we,ee))}cmp(C){return C.type!==this.type?this.type-C.type:ue(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Z.create(this.key,this.value,this)),this.negated}}class P{constructor(C,B,ee){this.key=C,this.value=B,this.negated=ee,this.type=15}static create(C,B,ee=null){return q(B,we=>new P(C,we,ee))}cmp(C){return C.type!==this.type?this.type-C.type:ue(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=W.create(this.key,this.value,this)),this.negated}}class ae{constructor(C,B){this.key=C,this.regexp=B,this.type=7,this.negated=null}static create(C,B){return new ae(C,B)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.key<C.key)return-1;if(this.key>C.key)return 1;const B=this.regexp?this.regexp.source:"",ee=C.regexp?C.regexp.source:"";return B<ee?-1:B>ee?1:0}equals(C){if(C.type===this.type){const B=this.regexp?this.regexp.source:"",ee=C.regexp?C.regexp.source:"";return this.key===C.key&&B===ee}return!1}substituteConstants(){return this}evaluate(C){let B=C.getValue(this.key);return this.regexp?this.regexp.test(B):!1}serialize(){const C=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${C}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Te.create(this)),this.negated}}class Te{constructor(C){this._actual=C,this.type=8}static create(C){return new Te(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ye(xe){let C=null;for(let B=0,ee=xe.length;B<ee;B++){const we=xe[B].substituteConstants();if(xe[B]!==we&&C===null){C=[];for(let rt=0;rt<B;rt++)C[rt]=xe[rt]}C!==null&&(C[B]=we)}return C===null?xe:C}class Je{constructor(C,B){this.expr=C,this.negated=B,this.type=6}static create(C,B){return Je._normalizeArr(C,B)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let B=0,ee=this.expr.length;B<ee;B++){const we=c(this.expr[B],C.expr[B]);if(we!==0)return we}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let B=0,ee=this.expr.length;B<ee;B++)if(!this.expr[B].equals(C.expr[B]))return!1;return!0}return!1}substituteConstants(){const C=ye(this.expr);return C===this.expr?this:Je.create(C,this.negated)}evaluate(C){for(let B=0,ee=this.expr.length;B<ee;B++)if(!this.expr[B].evaluate(C))return!1;return!0}static _normalizeArr(C,B){const ee=[];let we=!1;for(const rt of C)if(rt){if(rt.type===1){we=!0;continue}if(rt.type===0)return te.INSTANCE;if(rt.type===6){ee.push(...rt.expr);continue}ee.push(rt)}if(ee.length===0&&we)return V.INSTANCE;if(ee.length!==0){if(ee.length===1)return ee[0];ee.sort(c);for(let rt=1;rt<ee.length;rt++)ee[rt-1].equals(ee[rt])&&(ee.splice(rt,1),rt--);if(ee.length===1)return ee[0];for(;ee.length>1;){const rt=ee[ee.length-1];if(rt.type!==9)break;ee.pop();const tt=ee.pop(),ot=ee.length===0,je=Ve.create(rt.expr.map(nr=>Je.create([nr,tt],null)),null,ot);je&&(ee.push(je),ee.sort(c))}return ee.length===1?ee[0]:new Je(ee,B)}}serialize(){return this.expr.map(C=>C.serialize()).join(" && ")}keys(){const C=[];for(let B of this.expr)C.push(...B.keys());return C}negate(){if(!this.negated){const C=[];for(let B of this.expr)C.push(B.negate());this.negated=Ve.create(C,this,!0)}return this.negated}}class Ve{constructor(C,B){this.expr=C,this.negated=B,this.type=9}static create(C,B,ee){return Ve._normalizeArr(C,B,ee)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let B=0,ee=this.expr.length;B<ee;B++){const we=c(this.expr[B],C.expr[B]);if(we!==0)return we}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let B=0,ee=this.expr.length;B<ee;B++)if(!this.expr[B].equals(C.expr[B]))return!1;return!0}return!1}substituteConstants(){const C=ye(this.expr);return C===this.expr?this:Ve.create(C,this.negated,!1)}evaluate(C){for(let B=0,ee=this.expr.length;B<ee;B++)if(this.expr[B].evaluate(C))return!0;return!1}static _normalizeArr(C,B,ee){let we=[],rt=!1;if(C){for(let tt=0,ot=C.length;tt<ot;tt++){const je=C[tt];if(je){if(je.type===0){rt=!0;continue}if(je.type===1)return V.INSTANCE;if(je.type===9){we=we.concat(je.expr);continue}we.push(je)}}if(we.length===0&&rt)return te.INSTANCE;we.sort(c)}if(we.length!==0){if(we.length===1)return we[0];for(let tt=1;tt<we.length;tt++)we[tt-1].equals(we[tt])&&(we.splice(tt,1),tt--);if(we.length===1)return we[0];if(ee){for(let tt=0;tt<we.length;tt++)for(let ot=tt+1;ot<we.length;ot++)ce(we[tt],we[ot])&&(we.splice(ot,1),ot--);if(we.length===1)return we[0]}return new Ve(we,B)}}serialize(){return this.expr.map(C=>C.serialize()).join(" || ")}keys(){const C=[];for(let B of this.expr)C.push(...B.keys());return C}negate(){if(!this.negated){let C=[];for(let B of this.expr)C.push(B.negate());for(;C.length>1;){const B=C.shift(),ee=C.shift(),we=[];for(const tt of De(B))for(const ot of De(ee))we.push(Je.create([tt,ot],null));const rt=C.length===0;C.unshift(Ve.create(we,null,rt))}this.negated=C[0]}return this.negated}}class st extends A{constructor(C,B,ee){super(C,null),this._defaultValue=B,typeof ee=="object"?st._info.push(Object.assign(Object.assign({},ee),{key:C})):ee!==!0&&st._info.push({key:C,description:ee,type:B!=null?typeof B:void 0})}static all(){return st._info.values()}bindTo(C){return C.createKey(this.key,this._defaultValue)}getValue(C){return C.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(C){return b.create(this.key,C)}}st._info=[];const ft=(0,Xe.yh)("contextKeyService"),ie="setContext";function Q(xe,C){return xe<C?-1:xe>C?1:0}function ue(xe,C,B,ee){return xe<B?-1:xe>B?1:C<ee?-1:C>ee?1:0}function ce(xe,C){if(C.type===6&&xe.type!==9&&xe.type!==6){for(const we of C.expr)if(xe.equals(we))return!0}const B=xe.negate(),ee=De(B).concat(De(C));ee.sort(c);for(let we=0;we<ee.length;we++){const tt=ee[we].negate();for(let ot=we+1;ot<ee.length;ot++){const je=ee[ot];if(tt.equals(je))return!0}}return!1}function De(xe){return xe.type===9?xe.expr:[xe]}},16925:function(Ir,Mt,Y){"use strict";Y.d(Mt,{I8:function(){return Ce},TG:function(){return Le},jt:function(){return Oe},yh:function(){return Ge}});var Ce;(function(me){me.serviceIds=new Map,me.DI_TARGET="$di$target",me.DI_DEPENDENCIES="$di$dependencies";function Pe($){return $[me.DI_DEPENDENCIES]||[]}me.getServiceDependencies=Pe})(Ce||(Ce={}));const Le=Ge("instantiationService");function Xe(me,Pe,$,c){Pe[Ce.DI_TARGET]===Pe?Pe[Ce.DI_DEPENDENCIES].push({id:me,index:$,optional:c}):(Pe[Ce.DI_DEPENDENCIES]=[{id:me,index:$,optional:c}],Pe[Ce.DI_TARGET]=Pe)}function Ge(me){if(Ce.serviceIds.has(me))return Ce.serviceIds.get(me);const Pe=function($,c,te){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Xe(Pe,$,te,!1)};return Pe.toString=()=>me,Ce.serviceIds.set(me,Pe),Pe}function Oe(me){return function(Pe,$,c){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Xe(me,Pe,c,!0)}}},44650:function(Ir,Mt,Y){"use strict";Y.d(Mt,{B:function(){return Ge}});var Ce=Y(76068),Le=Y(72999);class Xe{constructor(){this.data=new Map}add(me,Pe){Ce.ok(Le.HD(me)),Ce.ok(Le.Kn(Pe)),Ce.ok(!this.data.has(me),"There is already an extension with this id"),this.data.set(me,Pe)}as(me){return this.data.get(me)||null}}const Ge=new Xe},66213:function(Ir,Mt,Y){"use strict";Y.d(Mt,{e:function(){return Ce}});var Ce;(function(Le){Le.DARK="dark",Le.LIGHT="light",Le.HIGH_CONTRAST="hc"})(Ce||(Ce={}))},49055:function(Ir,Mt,Y){"use strict";Y.d(Mt,{EN:function(){return c},IP:function(){return A},Ic:function(){return I},XE:function(){return Pe},bB:function(){return re},kS:function(){return te},m6:function(){return V}});var Ce=Y(52615),Le=Y(4348),Xe=Y(69323),Ge=Y(16925),Oe=Y(44650),me=Y(66213);const Pe=(0,Ge.yh)("themeService");var $;(function(se){function q(W){return W&&typeof W=="object"&&typeof W.id=="string"}se.isThemeColor=q})($||($={}));function c(se){return{id:se}}var te;(function(se){function q(Te){return Te&&typeof Te=="object"&&typeof Te.id=="string"&&(typeof Te.color=="undefined"||$.isThemeColor(Te.color))}se.isThemeIcon=q;const W=new RegExp(`^\\$\\((${Ce.dT.iconNameExpression}(?:${Ce.dT.iconModifierExpression})?)\\)$`);function Z(Te){const ye=W.exec(Te);if(!ye)return;let[,Je]=ye;return{id:Je}}se.fromString=Z;function le(Te,ye){let Je=Te.id;const Ve=Je.lastIndexOf("~");return Ve!==-1&&(Je=Je.substring(0,Ve)),ye&&(Je=`${Je}~${ye}`),{id:Je}}se.modify=le;function P(Te,ye){var Je,Ve;return Te.id===ye.id&&((Je=Te.color)===null||Je===void 0?void 0:Je.id)===((Ve=ye.color)===null||Ve===void 0?void 0:Ve.id)}se.isEqual=P;function ae(Te,ye){return{id:Te.id,color:ye?c(ye):void 0}}se.asThemeIcon=ae,se.asClassNameArray=Ce.dT.asClassNameArray,se.asClassName=Ce.dT.asClassName,se.asCSSSelector=Ce.dT.asCSSSelector})(te||(te={}));function V(se){switch(se){case me.e.DARK:return"vs-dark";case me.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const A={ThemingContribution:"base.contributions.theming"};class b{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Le.Q5}onColorThemeChange(q){return this.themingParticipants.push(q),this.onThemingParticipantAddedEmitter.fire(q),(0,Xe.OF)(()=>{const W=this.themingParticipants.indexOf(q);this.themingParticipants.splice(W,1)})}getThemingParticipants(){return this.themingParticipants}}let M=new b;Oe.B.add(A.ThemingContribution,M);function I(se){return M.onColorThemeChange(se)}class re extends Xe.JT{constructor(q){super(),this.themeService=q,this.theme=q.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(W=>this.onThemeChange(W)))}onThemeChange(q){this.theme=q,this.updateStyles()}updateStyles(){}}},5630:function(Ir,Mt,Y){"use strict";var Ce=Y(96663),Le=Y(44127),Xe=Y(90493),Ge=Y(72071),Oe=Y(6620),me=Y(92310),Pe=Y.n(me),$=Y(18929),c=Y(59301),te=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],V=(0,c.forwardRef)(function(A,b){var M,I=A.prefixCls,re=I===void 0?"rc-checkbox":I,se=A.className,q=A.style,W=A.checked,Z=A.disabled,le=A.defaultChecked,P=le===void 0?!1:le,ae=A.type,Te=ae===void 0?"checkbox":ae,ye=A.title,Je=A.onChange,Ve=(0,Oe.Z)(A,te),st=(0,c.useRef)(null),ft=(0,$.Z)(P,{value:W}),ie=(0,Ge.Z)(ft,2),Q=ie[0],ue=ie[1];(0,c.useImperativeHandle)(b,function(){return{focus:function(){var C;(C=st.current)===null||C===void 0||C.focus()},blur:function(){var C;(C=st.current)===null||C===void 0||C.blur()},input:st.current}});var ce=Pe()(re,se,(M={},(0,Xe.Z)(M,"".concat(re,"-checked"),Q),(0,Xe.Z)(M,"".concat(re,"-disabled"),Z),M)),De=function(C){Z||("checked"in A||ue(C.target.checked),Je==null||Je({target:(0,Le.Z)((0,Le.Z)({},A),{},{type:Te,checked:C.target.checked}),stopPropagation:function(){C.stopPropagation()},preventDefault:function(){C.preventDefault()},nativeEvent:C.nativeEvent}))};return c.createElement("span",{className:ce,title:ye,style:q},c.createElement("input",(0,Ce.Z)({},Ve,{className:"".concat(re,"-input"),ref:st,onChange:De,disabled:Z,checked:!!Q,type:Te})),c.createElement("span",{className:"".concat(re,"-inner")}))});Mt.Z=V},31561:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return Te}});var Ce=Y(96663),Le=Y(90493),Xe=Y(72071),Ge=Y(6620),Oe=Y(35593),me=Y(92310),Pe=Y.n(me),$=Y(8654),c=Y(59301),te=Y(10228),V=Y(16089),A=te.Z.ESC,b=te.Z.TAB;function M(ye){var Je=ye.visible,Ve=ye.triggerRef,st=ye.onVisibleChange,ft=ye.autoFocus,ie=ye.overlayRef,Q=c.useRef(!1),ue=function(){if(Je){var C,B;(C=Ve.current)===null||C===void 0||(B=C.focus)===null||B===void 0||B.call(C),st==null||st(!1)}},ce=function(){var C;return(C=ie.current)!==null&&C!==void 0&&C.focus?(ie.current.focus(),Q.current=!0,!0):!1},De=function(C){switch(C.keyCode){case A:ue();break;case b:{var B=!1;Q.current||(B=ce()),B?C.preventDefault():ue();break}}};c.useEffect(function(){return Je?(window.addEventListener("keydown",De),ft&&(0,V.Z)(ce,3),function(){window.removeEventListener("keydown",De),Q.current=!1}):function(){Q.current=!1}},[Je])}var I=(0,c.forwardRef)(function(ye,Je){var Ve=ye.overlay,st=ye.arrow,ft=ye.prefixCls,ie=(0,c.useMemo)(function(){var ue;return typeof Ve=="function"?ue=Ve():ue=Ve,ue},[Ve]),Q=(0,$.sQ)(Je,ie==null?void 0:ie.ref);return c.createElement(c.Fragment,null,st&&c.createElement("div",{className:"".concat(ft,"-arrow")}),c.cloneElement(ie,{ref:(0,$.Yr)(ie)?Q:void 0}))}),re=I,se={adjustX:1,adjustY:1},q=[0,0],W={topLeft:{points:["bl","tl"],overflow:se,offset:[0,-4],targetOffset:q},top:{points:["bc","tc"],overflow:se,offset:[0,-4],targetOffset:q},topRight:{points:["br","tr"],overflow:se,offset:[0,-4],targetOffset:q},bottomLeft:{points:["tl","bl"],overflow:se,offset:[0,4],targetOffset:q},bottom:{points:["tc","bc"],overflow:se,offset:[0,4],targetOffset:q},bottomRight:{points:["tr","br"],overflow:se,offset:[0,4],targetOffset:q}},Z=W,le=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function P(ye,Je){var Ve,st=ye.arrow,ft=st===void 0?!1:st,ie=ye.prefixCls,Q=ie===void 0?"rc-dropdown":ie,ue=ye.transitionName,ce=ye.animation,De=ye.align,xe=ye.placement,C=xe===void 0?"bottomLeft":xe,B=ye.placements,ee=B===void 0?Z:B,we=ye.getPopupContainer,rt=ye.showAction,tt=ye.hideAction,ot=ye.overlayClassName,je=ye.overlayStyle,nr=ye.visible,Kt=ye.trigger,Lt=Kt===void 0?["hover"]:Kt,Gr=ye.autoFocus,Rr=ye.overlay,hn=ye.children,Nr=ye.onVisibleChange,an=(0,Ge.Z)(ye,le),zr=c.useState(),We=(0,Xe.Z)(zr,2),mt=We[0],Ye=We[1],Et="visible"in ye?nr:mt,Tt=c.useRef(null),ge=c.useRef(null),Be=c.useRef(null);c.useImperativeHandle(Je,function(){return Tt.current});var et=function(Fe){Ye(Fe),Nr==null||Nr(Fe)};M({visible:Et,triggerRef:Be,onVisibleChange:et,autoFocus:Gr,overlayRef:ge});var gt=function(Fe){var He=ye.onOverlayClick;Ye(!1),He&&He(Fe)},vt=function(){return c.createElement(re,{ref:ge,overlay:Rr,prefixCls:Q,arrow:ft})},Ut=function(){return typeof Rr=="function"?vt:vt()},hr=function(){var Fe=ye.minOverlayWidthMatchTrigger,He=ye.alignPoint;return"minOverlayWidthMatchTrigger"in ye?Fe:!He},Yt=function(){var Fe=ye.openClassName;return Fe!==void 0?Fe:"".concat(Q,"-open")},Ke=c.cloneElement(hn,{className:Pe()((Ve=hn.props)===null||Ve===void 0?void 0:Ve.className,Et&&Yt()),ref:(0,$.Yr)(hn)?(0,$.sQ)(Be,hn.ref):void 0}),$t=tt;return!$t&&Lt.indexOf("contextMenu")!==-1&&($t=["click"]),c.createElement(Oe.Z,(0,Ce.Z)({builtinPlacements:ee},an,{prefixCls:Q,ref:Tt,popupClassName:Pe()(ot,(0,Le.Z)({},"".concat(Q,"-show-arrow"),ft)),popupStyle:je,action:Lt,showAction:rt,hideAction:$t,popupPlacement:C,popupAlign:De,popupTransitionName:ue,popupAnimation:ce,popupVisible:Et,stretch:hr()?"minWidth":"",popup:Ut(),onPopupVisibleChange:et,onPopupClick:gt,getPopupContainer:we}),Ke)}var ae=c.forwardRef(P),Te=ae},93681:function(Ir,Mt,Y){"use strict";Y.r(Mt),Y.d(Mt,{BaseInput:function(){return te},default:function(){return W}});var Ce=Y(96663),Le=Y(44127),Xe=Y(90493),Ge=Y(20135),Oe=Y(92310),me=Y.n(Oe),Pe=Y(59301),$=Y(5643),c=function(le){var P,ae,Te=le.inputElement,ye=le.prefixCls,Je=le.prefix,Ve=le.suffix,st=le.addonBefore,ft=le.addonAfter,ie=le.className,Q=le.style,ue=le.disabled,ce=le.readOnly,De=le.focused,xe=le.triggerFocus,C=le.allowClear,B=le.value,ee=le.handleReset,we=le.hidden,rt=le.classes,tt=le.classNames,ot=le.dataAttrs,je=le.styles,nr=le.components,Kt=(nr==null?void 0:nr.affixWrapper)||"span",Lt=(nr==null?void 0:nr.groupWrapper)||"span",Gr=(nr==null?void 0:nr.wrapper)||"span",Rr=(nr==null?void 0:nr.groupAddon)||"span",hn=(0,Pe.useRef)(null),Nr=function(vt){var Ut;(Ut=hn.current)!==null&&Ut!==void 0&&Ut.contains(vt.target)&&(xe==null||xe())},an=function(){var vt;if(!C)return null;var Ut=!ue&&!ce&&B,hr="".concat(ye,"-clear-icon"),Yt=(0,Ge.Z)(C)==="object"&&C!==null&&C!==void 0&&C.clearIcon?C.clearIcon:"\u2716";return Pe.createElement("span",{onClick:ee,onMouseDown:function($t){return $t.preventDefault()},className:me()(hr,(vt={},(0,Xe.Z)(vt,"".concat(hr,"-hidden"),!Ut),(0,Xe.Z)(vt,"".concat(hr,"-has-suffix"),!!Ve),vt)),role:"button",tabIndex:-1},Yt)},zr=(0,Pe.cloneElement)(Te,{value:B,hidden:we,className:me()((P=Te.props)===null||P===void 0?void 0:P.className,!(0,$.X3)(le)&&!(0,$.He)(le)&&ie)||null,style:(0,Le.Z)((0,Le.Z)({},(ae=Te.props)===null||ae===void 0?void 0:ae.style),!(0,$.X3)(le)&&!(0,$.He)(le)?Q:{})});if((0,$.X3)(le)){var We,mt="".concat(ye,"-affix-wrapper"),Ye=me()(mt,(We={},(0,Xe.Z)(We,"".concat(mt,"-disabled"),ue),(0,Xe.Z)(We,"".concat(mt,"-focused"),De),(0,Xe.Z)(We,"".concat(mt,"-readonly"),ce),(0,Xe.Z)(We,"".concat(mt,"-input-with-clear-btn"),Ve&&C&&B),We),!(0,$.He)(le)&&ie,rt==null?void 0:rt.affixWrapper,tt==null?void 0:tt.affixWrapper),Et=(Ve||C)&&Pe.createElement("span",{className:me()("".concat(ye,"-suffix"),tt==null?void 0:tt.suffix),style:je==null?void 0:je.suffix},an(),Ve);zr=Pe.createElement(Kt,(0,Ce.Z)({className:Ye,style:(0,Le.Z)((0,Le.Z)({},(0,$.He)(le)?void 0:Q),je==null?void 0:je.affixWrapper),hidden:!(0,$.He)(le)&&we,onClick:Nr},ot==null?void 0:ot.affixWrapper,{ref:hn}),Je&&Pe.createElement("span",{className:me()("".concat(ye,"-prefix"),tt==null?void 0:tt.prefix),style:je==null?void 0:je.prefix},Je),(0,Pe.cloneElement)(Te,{value:B,hidden:null}),Et)}if((0,$.He)(le)){var Tt="".concat(ye,"-group"),ge="".concat(Tt,"-addon"),Be=me()("".concat(ye,"-wrapper"),Tt,rt==null?void 0:rt.wrapper),et=me()("".concat(ye,"-group-wrapper"),ie,rt==null?void 0:rt.group);return Pe.createElement(Lt,{className:et,style:Q,hidden:we},Pe.createElement(Gr,{className:Be},st&&Pe.createElement(Rr,{className:ge},st),(0,Pe.cloneElement)(zr,{hidden:null}),ft&&Pe.createElement(Rr,{className:ge},ft)))}return zr},te=c,V=Y(19127),A=Y(72071),b=Y(6620),M=Y(18929),I=Y(2738),re=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],se=(0,Pe.forwardRef)(function(Z,le){var P=Z.autoComplete,ae=Z.onChange,Te=Z.onFocus,ye=Z.onBlur,Je=Z.onPressEnter,Ve=Z.onKeyDown,st=Z.prefixCls,ft=st===void 0?"rc-input":st,ie=Z.disabled,Q=Z.htmlSize,ue=Z.className,ce=Z.maxLength,De=Z.suffix,xe=Z.showCount,C=Z.type,B=C===void 0?"text":C,ee=Z.classes,we=Z.classNames,rt=Z.styles,tt=(0,b.Z)(Z,re),ot=(0,M.Z)(Z.defaultValue,{value:Z.value}),je=(0,A.Z)(ot,2),nr=je[0],Kt=je[1],Lt=(0,Pe.useState)(!1),Gr=(0,A.Z)(Lt,2),Rr=Gr[0],hn=Gr[1],Nr=(0,Pe.useRef)(null),an=function(et){Nr.current&&(0,$.nH)(Nr.current,et)};(0,Pe.useImperativeHandle)(le,function(){return{focus:an,blur:function(){var et;(et=Nr.current)===null||et===void 0||et.blur()},setSelectionRange:function(et,gt,vt){var Ut;(Ut=Nr.current)===null||Ut===void 0||Ut.setSelectionRange(et,gt,vt)},select:function(){var et;(et=Nr.current)===null||et===void 0||et.select()},input:Nr.current}}),(0,Pe.useEffect)(function(){hn(function(Be){return Be&&ie?!1:Be})},[ie]);var zr=function(et){Z.value===void 0&&Kt(et.target.value),Nr.current&&(0,$.rJ)(Nr.current,et,ae)},We=function(et){Je&&et.key==="Enter"&&Je(et),Ve==null||Ve(et)},mt=function(et){hn(!0),Te==null||Te(et)},Ye=function(et){hn(!1),ye==null||ye(et)},Et=function(et){Kt(""),an(),Nr.current&&(0,$.rJ)(Nr.current,et,ae)},Tt=function(){var et=(0,I.Z)(Z,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Pe.createElement("input",(0,Ce.Z)({autoComplete:P},et,{onChange:zr,onFocus:mt,onBlur:Ye,onKeyDown:We,className:me()(ft,(0,Xe.Z)({},"".concat(ft,"-disabled"),ie),we==null?void 0:we.input),style:rt==null?void 0:rt.input,ref:Nr,size:Q,type:B}))},ge=function(){var et=Number(ce)>0;if(De||xe){var gt=(0,$.D7)(nr),vt=(0,V.Z)(gt).length,Ut=(0,Ge.Z)(xe)==="object"?xe.formatter({value:gt,count:vt,maxLength:ce}):"".concat(vt).concat(et?" / ".concat(ce):"");return Pe.createElement(Pe.Fragment,null,!!xe&&Pe.createElement("span",{className:me()("".concat(ft,"-show-count-suffix"),(0,Xe.Z)({},"".concat(ft,"-show-count-has-suffix"),!!De),we==null?void 0:we.count),style:(0,Le.Z)({},rt==null?void 0:rt.count)},Ut),De)}return null};return Pe.createElement(te,(0,Ce.Z)({},tt,{prefixCls:ft,className:ue,inputElement:Tt(),handleReset:Et,value:(0,$.D7)(nr),focused:Rr,triggerFocus:an,suffix:ge(),disabled:ie,classes:ee,classNames:we,styles:rt}))}),q=se,W=q},5643:function(Ir,Mt,Y){"use strict";Y.d(Mt,{D7:function(){return Oe},He:function(){return Ce},X3:function(){return Le},nH:function(){return Ge},rJ:function(){return Xe}});function Ce(me){return!!(me.addonBefore||me.addonAfter)}function Le(me){return!!(me.prefix||me.suffix||me.allowClear)}function Xe(me,Pe,$,c){if($){var te=Pe;if(Pe.type==="click"){var V=me.cloneNode(!0);te=Object.create(Pe,{target:{value:V},currentTarget:{value:V}}),V.value="",$(te);return}if(c!==void 0){te=Object.create(Pe,{target:{value:me},currentTarget:{value:me}}),me.value=c,$(te);return}$(te)}}function Ge(me,Pe){if(me){me.focus(Pe);var $=Pe||{},c=$.cursor;if(c){var te=me.value.length;switch(c){case"start":me.setSelectionRange(0,0);break;case"end":me.setSelectionRange(te,te);break;default:me.setSelectionRange(0,te)}}}}function Oe(me){return typeof me=="undefined"||me===null?"":String(me)}},15285:function(Ir,Mt,Y){"use strict";Y.d(Mt,{iz:function(){return kr},ck:function(){return Ze},BW:function(){return nn},sN:function(){return Ze},Wd:function(){return Ot},ZP:function(){return Lr},Xl:function(){return Ve}});var Ce=Y(96663),Le=Y(90493),Xe=Y(44127),Ge=Y(19127),Oe=Y(72071),me=Y(6620),Pe=Y(92310),$=Y.n(Pe),c=Y(11780),te=Y(18929),V=Y(13697),A=Y(48736),b=Y(59301),M=Y(4676),I=b.createContext(null);function re(nt,Qe){return nt===void 0?null:"".concat(nt,"-").concat(Qe)}function se(nt){var Qe=b.useContext(I);return re(Qe,nt)}var q=Y(80547),W=["children","locked"],Z=b.createContext(null);function le(nt,Qe){var bt=(0,Xe.Z)({},nt);return Object.keys(Qe).forEach(function(Rt){var lt=Qe[Rt];lt!==void 0&&(bt[Rt]=lt)}),bt}function P(nt){var Qe=nt.children,bt=nt.locked,Rt=(0,me.Z)(nt,W),lt=b.useContext(Z),Nt=(0,q.Z)(function(){return le(lt,Rt)},[lt,Rt],function(Ft,or){return!bt&&(Ft[0]!==or[0]||!(0,V.Z)(Ft[1],or[1],!0))});return b.createElement(Z.Provider,{value:Nt},Qe)}var ae=[],Te=b.createContext(null);function ye(){return b.useContext(Te)}var Je=b.createContext(ae);function Ve(nt){var Qe=b.useContext(Je);return b.useMemo(function(){return nt!==void 0?[].concat((0,Ge.Z)(Qe),[nt]):Qe},[Qe,nt])}var st=b.createContext(null),ft=b.createContext({}),ie=ft,Q=Y(29194);function ue(nt){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,Q.Z)(nt)){var bt=nt.nodeName.toLowerCase(),Rt=["input","select","textarea","button"].includes(bt)||nt.isContentEditable||bt==="a"&&!!nt.getAttribute("href"),lt=nt.getAttribute("tabindex"),Nt=Number(lt),Ft=null;return lt&&!Number.isNaN(Nt)?Ft=Nt:Rt&&Ft===null&&(Ft=0),Rt&&nt.disabled&&(Ft=null),Ft!==null&&(Ft>=0||Qe&&Ft<0)}return!1}function ce(nt){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,bt=(0,Ge.Z)(nt.querySelectorAll("*")).filter(function(Rt){return ue(Rt,Qe)});return ue(nt,Qe)&&bt.unshift(nt),bt}var De=null;function xe(){De=document.activeElement}function C(){De=null}function B(){if(De)try{De.focus()}catch(nt){}}function ee(nt,Qe){if(Qe.keyCode===9){var bt=ce(nt),Rt=bt[Qe.shiftKey?0:bt.length-1],lt=Rt===document.activeElement||nt===document.activeElement;if(lt){var Nt=bt[Qe.shiftKey?bt.length-1:0];Nt.focus(),Qe.preventDefault()}}}var we=Y(10228),rt=Y(16089),tt=we.Z.LEFT,ot=we.Z.RIGHT,je=we.Z.UP,nr=we.Z.DOWN,Kt=we.Z.ENTER,Lt=we.Z.ESC,Gr=we.Z.HOME,Rr=we.Z.END,hn=[je,nr,tt,ot];function Nr(nt,Qe,bt,Rt){var lt,Nt,Ft,or,_r="prev",fr="next",Qr="children",on="parent";if(nt==="inline"&&Rt===Kt)return{inlineTrigger:!0};var fn=(lt={},(0,Le.Z)(lt,je,_r),(0,Le.Z)(lt,nr,fr),lt),Mr=(Nt={},(0,Le.Z)(Nt,tt,bt?fr:_r),(0,Le.Z)(Nt,ot,bt?_r:fr),(0,Le.Z)(Nt,nr,Qr),(0,Le.Z)(Nt,Kt,Qr),Nt),wr=(Ft={},(0,Le.Z)(Ft,je,_r),(0,Le.Z)(Ft,nr,fr),(0,Le.Z)(Ft,Kt,Qr),(0,Le.Z)(Ft,Lt,on),(0,Le.Z)(Ft,tt,bt?Qr:on),(0,Le.Z)(Ft,ot,bt?on:Qr),Ft),_n={inline:fn,horizontal:Mr,vertical:wr,inlineSub:fn,horizontalSub:wr,verticalSub:wr},ln=(or=_n["".concat(nt).concat(Qe?"":"Sub")])===null||or===void 0?void 0:or[Rt];switch(ln){case _r:return{offset:-1,sibling:!0};case fr:return{offset:1,sibling:!0};case on:return{offset:-1,sibling:!1};case Qr:return{offset:1,sibling:!1};default:return null}}function an(nt){for(var Qe=nt;Qe;){if(Qe.getAttribute("data-menu-list"))return Qe;Qe=Qe.parentElement}return null}function zr(nt,Qe){for(var bt=nt||document.activeElement;bt;){if(Qe.has(bt))return bt;bt=bt.parentElement}return null}function We(nt,Qe){var bt=ce(nt,!0);return bt.filter(function(Rt){return Qe.has(Rt)})}function mt(nt,Qe,bt){var Rt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!nt)return null;var lt=We(nt,Qe),Nt=lt.length,Ft=lt.findIndex(function(or){return bt===or});return Rt<0?Ft===-1?Ft=Nt-1:Ft-=1:Rt>0&&(Ft+=1),Ft=(Ft+Nt)%Nt,lt[Ft]}var Ye=function(Qe,bt){var Rt=new Set,lt=new Map,Nt=new Map;return Qe.forEach(function(Ft){var or=document.querySelector("[data-menu-id='".concat(re(bt,Ft),"']"));or&&(Rt.add(or),Nt.set(or,Ft),lt.set(Ft,or))}),{elements:Rt,key2element:lt,element2key:Nt}};function Et(nt,Qe,bt,Rt,lt,Nt,Ft,or,_r,fr){var Qr=b.useRef(),on=b.useRef();on.current=Qe;var fn=function(){rt.Z.cancel(Qr.current)};return b.useEffect(function(){return function(){fn()}},[]),function(Mr){var wr=Mr.which;if([].concat(hn,[Kt,Lt,Gr,Rr]).includes(wr)){var _n=Nt(),ln=Ye(_n,Rt),qr=ln,Jr=qr.elements,sn=qr.key2element,en=qr.element2key,Ur=sn.get(Qe),cn=zr(Ur,Jr),Ln=en.get(cn),xn=Nr(nt,Ft(Ln,!0).length===1,bt,wr);if(!xn&&wr!==Gr&&wr!==Rr)return;(hn.includes(wr)||[Gr,Rr].includes(wr))&&Mr.preventDefault();var sr=function(Zr){if(Zr){var ai=Zr,pi=Zr.querySelector("a");pi!=null&&pi.getAttribute("href")&&(ai=pi);var In=en.get(Zr);or(In),fn(),Qr.current=(0,rt.Z)(function(){on.current===In&&ai.focus()})}};if([Gr,Rr].includes(wr)||xn.sibling||!cn){var Ie;!cn||nt==="inline"?Ie=lt.current:Ie=an(cn);var lr,gr=We(Ie,Jr);wr===Gr?lr=gr[0]:wr===Rr?lr=gr[gr.length-1]:lr=mt(Ie,Jr,cn,xn.offset),sr(lr)}else if(xn.inlineTrigger)_r(Ln);else if(xn.offset>0)_r(Ln,!0),fn(),Qr.current=(0,rt.Z)(function(){ln=Ye(_n,Rt);var Rn=cn.getAttribute("aria-controls"),Zr=document.getElementById(Rn),ai=mt(Zr,ln.elements);sr(ai)},5);else if(xn.offset<0){var yn=Ft(Ln,!0),Yn=yn[yn.length-2],vn=sn.get(Yn);_r(Yn,!1),sr(vn)}}fr==null||fr(Mr)}}function Tt(nt){Promise.resolve().then(nt)}var ge="__RC_UTIL_PATH_SPLIT__",Be=function(Qe){return Qe.join(ge)},et=function(Qe){return Qe.split(ge)},gt="rc-menu-more";function vt(){var nt=b.useState({}),Qe=(0,Oe.Z)(nt,2),bt=Qe[1],Rt=(0,b.useRef)(new Map),lt=(0,b.useRef)(new Map),Nt=b.useState([]),Ft=(0,Oe.Z)(Nt,2),or=Ft[0],_r=Ft[1],fr=(0,b.useRef)(0),Qr=(0,b.useRef)(!1),on=function(){Qr.current||bt({})},fn=(0,b.useCallback)(function(sn,en){var Ur=Be(en);lt.current.set(Ur,sn),Rt.current.set(sn,Ur),fr.current+=1;var cn=fr.current;Tt(function(){cn===fr.current&&on()})},[]),Mr=(0,b.useCallback)(function(sn,en){var Ur=Be(en);lt.current.delete(Ur),Rt.current.delete(sn)},[]),wr=(0,b.useCallback)(function(sn){_r(sn)},[]),_n=(0,b.useCallback)(function(sn,en){var Ur=Rt.current.get(sn)||"",cn=et(Ur);return en&&or.includes(cn[0])&&cn.unshift(gt),cn},[or]),ln=(0,b.useCallback)(function(sn,en){return sn.some(function(Ur){var cn=_n(Ur,!0);return cn.includes(en)})},[_n]),qr=function(){var en=(0,Ge.Z)(Rt.current.keys());return or.length&&en.push(gt),en},Jr=(0,b.useCallback)(function(sn){var en="".concat(Rt.current.get(sn)).concat(ge),Ur=new Set;return(0,Ge.Z)(lt.current.keys()).forEach(function(cn){cn.startsWith(en)&&Ur.add(lt.current.get(cn))}),Ur},[]);return b.useEffect(function(){return function(){Qr.current=!0}},[]),{registerPath:fn,unregisterPath:Mr,refreshOverflowKeys:wr,isSubPathKey:ln,getKeyPath:_n,getKeys:qr,getSubPathKeys:Jr}}function Ut(nt){var Qe=b.useRef(nt);Qe.current=nt;var bt=b.useCallback(function(){for(var Rt,lt=arguments.length,Nt=new Array(lt),Ft=0;Ft<lt;Ft++)Nt[Ft]=arguments[Ft];return(Rt=Qe.current)===null||Rt===void 0?void 0:Rt.call.apply(Rt,[Qe].concat(Nt))},[]);return nt?bt:void 0}var hr=Math.random().toFixed(5).toString().slice(2),Yt=0;function Ke(nt){var Qe=(0,te.Z)(nt,{value:nt}),bt=(0,Oe.Z)(Qe,2),Rt=bt[0],lt=bt[1];return b.useEffect(function(){Yt+=1;var Nt="".concat(hr,"-").concat(Yt);lt("rc-menu-uuid-".concat(Nt))},[]),Rt}var $t=Y(52884),cr=Y(95727),Fe=Y(65711),He=Y(85745),qe=Y(2738),Dt=Y(8654);function St(nt,Qe,bt,Rt){var lt=b.useContext(Z),Nt=lt.activeKey,Ft=lt.onActive,or=lt.onInactive,_r={active:Nt===nt};return Qe||(_r.onMouseEnter=function(fr){bt==null||bt({key:nt,domEvent:fr}),Ft(nt)},_r.onMouseLeave=function(fr){Rt==null||Rt({key:nt,domEvent:fr}),or(nt)}),_r}function Pt(nt){var Qe=b.useContext(Z),bt=Qe.mode,Rt=Qe.rtl,lt=Qe.inlineIndent;if(bt!=="inline")return null;var Nt=nt;return Rt?{paddingRight:Nt*lt}:{paddingLeft:Nt*lt}}function Gt(nt){var Qe=nt.icon,bt=nt.props,Rt=nt.children,lt;return Qe===null||Qe===!1?null:(typeof Qe=="function"?lt=b.createElement(Qe,(0,Xe.Z)({},bt)):typeof Qe!="boolean"&&(lt=Qe),lt||Rt||null)}var k=["item"];function D(nt){var Qe=nt.item,bt=(0,me.Z)(nt,k);return Object.defineProperty(bt,"item",{get:function(){return(0,A.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Qe}}),bt}var ut=["title","attribute","elementRef"],U=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],he=["active"],Tr=function(nt){(0,Fe.Z)(bt,nt);var Qe=(0,He.Z)(bt);function bt(){return(0,$t.Z)(this,bt),Qe.apply(this,arguments)}return(0,cr.Z)(bt,[{key:"render",value:function(){var lt=this.props,Nt=lt.title,Ft=lt.attribute,or=lt.elementRef,_r=(0,me.Z)(lt,ut),fr=(0,qe.Z)(_r,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,A.ZP)(!Ft,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),b.createElement(c.Z.Item,(0,Ce.Z)({},Ft,{title:typeof Nt=="string"?Nt:void 0},fr,{ref:or}))}}]),bt}(b.Component),Ee=b.forwardRef(function(nt,Qe){var bt,Rt=nt.style,lt=nt.className,Nt=nt.eventKey,Ft=nt.warnKey,or=nt.disabled,_r=nt.itemIcon,fr=nt.children,Qr=nt.role,on=nt.onMouseEnter,fn=nt.onMouseLeave,Mr=nt.onClick,wr=nt.onKeyDown,_n=nt.onFocus,ln=(0,me.Z)(nt,U),qr=se(Nt),Jr=b.useContext(Z),sn=Jr.prefixCls,en=Jr.onItemClick,Ur=Jr.disabled,cn=Jr.overflowDisabled,Ln=Jr.itemIcon,xn=Jr.selectedKeys,sr=Jr.onActive,Ie=b.useContext(ie),lr=Ie._internalRenderMenuItem,gr="".concat(sn,"-item"),yn=b.useRef(),Yn=b.useRef(),vn=Ur||or,Rn=(0,Dt.x1)(Qe,Yn),Zr=Ve(Nt),ai=function(ei){return{key:Nt,keyPath:(0,Ge.Z)(Zr).reverse(),item:yn.current,domEvent:ei}},pi=_r||Ln,In=St(Nt,vn,on,fn),ni=In.active,qi=(0,me.Z)(In,he),Ti=xn.includes(Nt),Zi=Pt(Zr.length),Ar=function(ei){if(!vn){var Ci=ai(ei);Mr==null||Mr(D(Ci)),en(Ci)}},bn=function(ei){if(wr==null||wr(ei),ei.which===we.Z.ENTER){var Ci=ai(ei);Mr==null||Mr(D(Ci)),en(Ci)}},zn=function(ei){sr(Nt),_n==null||_n(ei)},Vn={};nt.role==="option"&&(Vn["aria-selected"]=Ti);var Gi=b.createElement(Tr,(0,Ce.Z)({ref:yn,elementRef:Rn,role:Qr===null?"none":Qr||"menuitem",tabIndex:or?null:-1,"data-menu-id":cn&&qr?null:qr},ln,qi,Vn,{component:"li","aria-disabled":or,style:(0,Xe.Z)((0,Xe.Z)({},Zi),Rt),className:$()(gr,(bt={},(0,Le.Z)(bt,"".concat(gr,"-active"),ni),(0,Le.Z)(bt,"".concat(gr,"-selected"),Ti),(0,Le.Z)(bt,"".concat(gr,"-disabled"),vn),bt),lt),onClick:Ar,onKeyDown:bn,onFocus:zn}),fr,b.createElement(Gt,{props:(0,Xe.Z)((0,Xe.Z)({},nt),{},{isSelected:Ti}),icon:pi}));return lr&&(Gi=lr(Gi,nt,{selected:Ti})),Gi});function Ue(nt,Qe){var bt=nt.eventKey,Rt=ye(),lt=Ve(bt);return b.useEffect(function(){if(Rt)return Rt.registerPath(bt,lt),function(){Rt.unregisterPath(bt,lt)}},[lt]),Rt?null:b.createElement(Ee,(0,Ce.Z)({},nt,{ref:Qe}))}var Ze=b.forwardRef(Ue),G=["className","children"],pe=function(Qe,bt){var Rt=Qe.className,lt=Qe.children,Nt=(0,me.Z)(Qe,G),Ft=b.useContext(Z),or=Ft.prefixCls,_r=Ft.mode,fr=Ft.rtl;return b.createElement("ul",(0,Ce.Z)({className:$()(or,fr&&"".concat(or,"-rtl"),"".concat(or,"-sub"),"".concat(or,"-").concat(_r==="inline"?"inline":"vertical"),Rt),role:"menu"},Nt,{"data-menu-list":!0,ref:bt}),lt)},_e=b.forwardRef(pe);_e.displayName="SubMenuList";var Ne=_e,H=Y(11592);function Vt(nt,Qe){return(0,H.Z)(nt).map(function(bt,Rt){if(b.isValidElement(bt)){var lt,Nt,Ft=bt.key,or=(lt=(Nt=bt.props)===null||Nt===void 0?void 0:Nt.eventKey)!==null&&lt!==void 0?lt:Ft,_r=or==null;_r&&(or="tmp_key-".concat([].concat((0,Ge.Z)(Qe),[Rt]).join("-")));var fr={key:or,eventKey:or};return b.cloneElement(bt,fr)}return bt})}var Se=Y(35593),qt={adjustX:1,adjustY:1},vr={topLeft:{points:["bl","tl"],overflow:qt},topRight:{points:["br","tr"],overflow:qt},bottomLeft:{points:["tl","bl"],overflow:qt},bottomRight:{points:["tr","br"],overflow:qt},leftTop:{points:["tr","tl"],overflow:qt},leftBottom:{points:["br","bl"],overflow:qt},rightTop:{points:["tl","tr"],overflow:qt},rightBottom:{points:["bl","br"],overflow:qt}},Xr={topLeft:{points:["bl","tl"],overflow:qt},topRight:{points:["br","tr"],overflow:qt},bottomLeft:{points:["tl","bl"],overflow:qt},bottomRight:{points:["tr","br"],overflow:qt},rightTop:{points:["tr","tl"],overflow:qt},rightBottom:{points:["br","bl"],overflow:qt},leftTop:{points:["tl","tr"],overflow:qt},leftBottom:{points:["bl","br"],overflow:qt}},An=null;function Kr(nt,Qe,bt){if(Qe)return Qe;if(bt)return bt[nt]||bt.other}var yr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function gn(nt){var Qe=nt.prefixCls,bt=nt.visible,Rt=nt.children,lt=nt.popup,Nt=nt.popupStyle,Ft=nt.popupClassName,or=nt.popupOffset,_r=nt.disabled,fr=nt.mode,Qr=nt.onVisibleChange,on=b.useContext(Z),fn=on.getPopupContainer,Mr=on.rtl,wr=on.subMenuOpenDelay,_n=on.subMenuCloseDelay,ln=on.builtinPlacements,qr=on.triggerSubMenuAction,Jr=on.forceSubMenuRender,sn=on.rootClassName,en=on.motion,Ur=on.defaultMotions,cn=b.useState(!1),Ln=(0,Oe.Z)(cn,2),xn=Ln[0],sr=Ln[1],Ie=Mr?(0,Xe.Z)((0,Xe.Z)({},Xr),ln):(0,Xe.Z)((0,Xe.Z)({},vr),ln),lr=yr[fr],gr=Kr(fr,en,Ur),yn=b.useRef(gr);fr!=="inline"&&(yn.current=gr);var Yn=(0,Xe.Z)((0,Xe.Z)({},yn.current),{},{leavedClassName:"".concat(Qe,"-hidden"),removeOnLeave:!1,motionAppear:!0}),vn=b.useRef();return b.useEffect(function(){return vn.current=(0,rt.Z)(function(){sr(bt)}),function(){rt.Z.cancel(vn.current)}},[bt]),b.createElement(Se.Z,{prefixCls:Qe,popupClassName:$()("".concat(Qe,"-popup"),(0,Le.Z)({},"".concat(Qe,"-rtl"),Mr),Ft,sn),stretch:fr==="horizontal"?"minWidth":null,getPopupContainer:fn,builtinPlacements:Ie,popupPlacement:lr,popupVisible:xn,popup:lt,popupStyle:Nt,popupAlign:or&&{offset:or},action:_r?[]:[qr],mouseEnterDelay:wr,mouseLeaveDelay:_n,onPopupVisibleChange:Qr,forceRender:Jr,popupMotion:Yn,fresh:!0},Rt)}var fe=Y(77900);function Ae(nt){var Qe=nt.id,bt=nt.open,Rt=nt.keyPath,lt=nt.children,Nt="inline",Ft=b.useContext(Z),or=Ft.prefixCls,_r=Ft.forceSubMenuRender,fr=Ft.motion,Qr=Ft.defaultMotions,on=Ft.mode,fn=b.useRef(!1);fn.current=on===Nt;var Mr=b.useState(!fn.current),wr=(0,Oe.Z)(Mr,2),_n=wr[0],ln=wr[1],qr=fn.current?bt:!1;b.useEffect(function(){fn.current&&ln(!1)},[on]);var Jr=(0,Xe.Z)({},Kr(Nt,fr,Qr));Rt.length>1&&(Jr.motionAppear=!1);var sn=Jr.onVisibleChanged;return Jr.onVisibleChanged=function(en){return!fn.current&&!en&&ln(!0),sn==null?void 0:sn(en)},_n?null:b.createElement(P,{mode:Nt,locked:!fn.current},b.createElement(fe.default,(0,Ce.Z)({visible:qr},Jr,{forceRender:_r,removeOnLeave:!1,leavedClassName:"".concat(or,"-hidden")}),function(en){var Ur=en.className,cn=en.style;return b.createElement(Ne,{id:Qe,className:Ur,style:cn},lt)}))}var Ct=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],at=["active"],xt=function(Qe){var bt,Rt=Qe.style,lt=Qe.className,Nt=Qe.title,Ft=Qe.eventKey,or=Qe.warnKey,_r=Qe.disabled,fr=Qe.internalPopupClose,Qr=Qe.children,on=Qe.itemIcon,fn=Qe.expandIcon,Mr=Qe.popupClassName,wr=Qe.popupOffset,_n=Qe.popupStyle,ln=Qe.onClick,qr=Qe.onMouseEnter,Jr=Qe.onMouseLeave,sn=Qe.onTitleClick,en=Qe.onTitleMouseEnter,Ur=Qe.onTitleMouseLeave,cn=(0,me.Z)(Qe,Ct),Ln=se(Ft),xn=b.useContext(Z),sr=xn.prefixCls,Ie=xn.mode,lr=xn.openKeys,gr=xn.disabled,yn=xn.overflowDisabled,Yn=xn.activeKey,vn=xn.selectedKeys,Rn=xn.itemIcon,Zr=xn.expandIcon,ai=xn.onItemClick,pi=xn.onOpenChange,In=xn.onActive,ni=b.useContext(ie),qi=ni._internalRenderSubMenuItem,Ti=b.useContext(st),Zi=Ti.isSubPathKey,Ar=Ve(),bn="".concat(sr,"-submenu"),zn=gr||_r,Vn=b.useRef(),Gi=b.useRef(),Vi=on!=null?on:Rn,ei=fn!=null?fn:Zr,Ci=lr.includes(Ft),Wn=!yn&&Ci,Wi=Zi(vn,Ft),ui=St(Ft,zn,en,Ur),Ji=ui.active,Di=(0,me.Z)(ui,at),bi=b.useState(!1),Sn=(0,Oe.Z)(bi,2),ls=Sn[0],_s=Sn[1],fs=function(Ni){zn||_s(Ni)},Xn=function(Ni){fs(!0),qr==null||qr({key:Ft,domEvent:Ni})},xs=function(Ni){fs(!1),Jr==null||Jr({key:Ft,domEvent:Ni})},ps=b.useMemo(function(){return Ji||(Ie!=="inline"?ls||Zi([Yn],Ft):!1)},[Ie,Ji,Yn,ls,Ft,Zi]),er=Pt(Ar.length),ci=function(Ni){zn||(sn==null||sn({key:Ft,domEvent:Ni}),Ie==="inline"&&pi(Ft,!Ci))},ws=Ut(function(mi){ln==null||ln(D(mi)),ai(mi)}),Qi=function(Ni){Ie!=="inline"&&pi(Ft,Ni)},_i=function(){In(Ft)},oi=Ln&&"".concat(Ln,"-popup"),Dn=b.createElement("div",(0,Ce.Z)({role:"menuitem",style:er,className:"".concat(bn,"-title"),tabIndex:zn?null:-1,ref:Vn,title:typeof Nt=="string"?Nt:null,"data-menu-id":yn&&Ln?null:Ln,"aria-expanded":Wn,"aria-haspopup":!0,"aria-controls":oi,"aria-disabled":zn,onClick:ci,onFocus:_i},Di),Nt,b.createElement(Gt,{icon:Ie!=="horizontal"?ei:void 0,props:(0,Xe.Z)((0,Xe.Z)({},Qe),{},{isOpen:Wn,isSubMenu:!0})},b.createElement("i",{className:"".concat(bn,"-arrow")}))),ti=b.useRef(Ie);if(Ie!=="inline"&&Ar.length>1?ti.current="vertical":ti.current=Ie,!yn){var Mi=ti.current;Dn=b.createElement(gn,{mode:Mi,prefixCls:bn,visible:!fr&&Wn&&Ie!=="inline",popupClassName:Mr,popupOffset:wr,popupStyle:_n,popup:b.createElement(P,{mode:Mi==="horizontal"?"vertical":Mi},b.createElement(Ne,{id:oi,ref:Gi},Qr)),disabled:zn,onVisibleChange:Qi},Dn)}var Fi=b.createElement(c.Z.Item,(0,Ce.Z)({role:"none"},cn,{component:"li",style:Rt,className:$()(bn,"".concat(bn,"-").concat(Ie),lt,(bt={},(0,Le.Z)(bt,"".concat(bn,"-open"),Wn),(0,Le.Z)(bt,"".concat(bn,"-active"),ps),(0,Le.Z)(bt,"".concat(bn,"-selected"),Wi),(0,Le.Z)(bt,"".concat(bn,"-disabled"),zn),bt)),onMouseEnter:Xn,onMouseLeave:xs}),Dn,!yn&&b.createElement(Ae,{id:oi,open:Wn,keyPath:Ar},Qr));return qi&&(Fi=qi(Fi,Qe,{selected:Wi,active:ps,open:Wn,disabled:zn})),b.createElement(P,{onItemClick:ws,mode:Ie==="horizontal"?"vertical":Ie,itemIcon:Vi,expandIcon:ei},Fi)};function Ot(nt){var Qe=nt.eventKey,bt=nt.children,Rt=Ve(Qe),lt=Vt(bt,Rt),Nt=ye();b.useEffect(function(){if(Nt)return Nt.registerPath(Qe,Rt),function(){Nt.unregisterPath(Qe,Rt)}},[Rt]);var Ft;return Nt?Ft=lt:Ft=b.createElement(xt,nt,lt),b.createElement(Je.Provider,{value:Rt},Ft)}var ir=Y(20135),Jt=["className","title","eventKey","children"],xr=["children"],br=function(Qe){var bt=Qe.className,Rt=Qe.title,lt=Qe.eventKey,Nt=Qe.children,Ft=(0,me.Z)(Qe,Jt),or=b.useContext(Z),_r=or.prefixCls,fr="".concat(_r,"-item-group");return b.createElement("li",(0,Ce.Z)({role:"presentation"},Ft,{onClick:function(on){return on.stopPropagation()},className:$()(fr,bt)}),b.createElement("div",{role:"presentation",className:"".concat(fr,"-title"),title:typeof Rt=="string"?Rt:void 0},Rt),b.createElement("ul",{role:"group",className:"".concat(fr,"-list")},Nt))};function nn(nt){var Qe=nt.children,bt=(0,me.Z)(nt,xr),Rt=Ve(bt.eventKey),lt=Vt(Qe,Rt),Nt=ye();return Nt?lt:b.createElement(br,(0,qe.Z)(bt,["warnKey"]),lt)}function kr(nt){var Qe=nt.className,bt=nt.style,Rt=b.useContext(Z),lt=Rt.prefixCls,Nt=ye();return Nt?null:b.createElement("li",{role:"separator",className:$()("".concat(lt,"-item-divider"),Qe),style:bt})}var Fr=["label","children","key","type"];function $r(nt){return(nt||[]).map(function(Qe,bt){if(Qe&&(0,ir.Z)(Qe)==="object"){var Rt=Qe,lt=Rt.label,Nt=Rt.children,Ft=Rt.key,or=Rt.type,_r=(0,me.Z)(Rt,Fr),fr=Ft!=null?Ft:"tmp-".concat(bt);return Nt||or==="group"?or==="group"?b.createElement(nn,(0,Ce.Z)({key:fr},_r,{title:lt}),$r(Nt)):b.createElement(Ot,(0,Ce.Z)({key:fr},_r,{title:lt}),$r(Nt)):or==="divider"?b.createElement(kr,(0,Ce.Z)({key:fr},_r)):b.createElement(Ze,(0,Ce.Z)({key:fr},_r),lt)}return null}).filter(function(Qe){return Qe})}function pn(nt,Qe,bt){var Rt=nt;return Qe&&(Rt=$r(Qe)),Vt(Rt,bt)}var Mn=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],mn=[],dn=b.forwardRef(function(nt,Qe){var bt,Rt,lt=nt,Nt=lt.prefixCls,Ft=Nt===void 0?"rc-menu":Nt,or=lt.rootClassName,_r=lt.style,fr=lt.className,Qr=lt.tabIndex,on=Qr===void 0?0:Qr,fn=lt.items,Mr=lt.children,wr=lt.direction,_n=lt.id,ln=lt.mode,qr=ln===void 0?"vertical":ln,Jr=lt.inlineCollapsed,sn=lt.disabled,en=lt.disabledOverflow,Ur=lt.subMenuOpenDelay,cn=Ur===void 0?.1:Ur,Ln=lt.subMenuCloseDelay,xn=Ln===void 0?.1:Ln,sr=lt.forceSubMenuRender,Ie=lt.defaultOpenKeys,lr=lt.openKeys,gr=lt.activeKey,yn=lt.defaultActiveFirst,Yn=lt.selectable,vn=Yn===void 0?!0:Yn,Rn=lt.multiple,Zr=Rn===void 0?!1:Rn,ai=lt.defaultSelectedKeys,pi=lt.selectedKeys,In=lt.onSelect,ni=lt.onDeselect,qi=lt.inlineIndent,Ti=qi===void 0?24:qi,Zi=lt.motion,Ar=lt.defaultMotions,bn=lt.triggerSubMenuAction,zn=bn===void 0?"hover":bn,Vn=lt.builtinPlacements,Gi=lt.itemIcon,Vi=lt.expandIcon,ei=lt.overflowedIndicator,Ci=ei===void 0?"...":ei,Wn=lt.overflowedIndicatorPopupClassName,Wi=lt.getPopupContainer,ui=lt.onClick,Ji=lt.onOpenChange,Di=lt.onKeyDown,bi=lt.openAnimation,Sn=lt.openTransitionName,ls=lt._internalRenderMenuItem,_s=lt._internalRenderSubMenuItem,fs=(0,me.Z)(lt,Mn),Xn=b.useMemo(function(){return pn(Mr,fn,mn)},[Mr,fn]),xs=b.useState(!1),ps=(0,Oe.Z)(xs,2),er=ps[0],ci=ps[1],ws=b.useRef(),Qi=Ke(_n),_i=wr==="rtl",oi=(0,te.Z)(Ie,{value:lr,postState:function(qn){return qn||mn}}),Dn=(0,Oe.Z)(oi,2),ti=Dn[0],Mi=Dn[1],Fi=function(qn){var Un=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Ui(){Mi(qn),Ji==null||Ji(qn)}Un?(0,M.flushSync)(Ui):Ui()},mi=b.useState(ti),Ni=(0,Oe.Z)(mi,2),Os=Ni[0],Nn=Ni[1],wn=b.useRef(!1),hi=b.useMemo(function(){return(qr==="inline"||qr==="vertical")&&Jr?["vertical",Jr]:[qr,!1]},[qr,Jr]),xi=(0,Oe.Z)(hi,2),es=xi[0],Cr=xi[1],Dr=es==="inline",On=b.useState(es),Li=(0,Oe.Z)(On,2),jn=Li[0],Ss=Li[1],Ts=b.useState(Cr),Ns=(0,Oe.Z)(Ts,2),$i=Ns[0],Qs=Ns[1];b.useEffect(function(){Ss(es),Qs(Cr),wn.current&&(Dr?Mi(Os):Fi(mn))},[es,Cr]);var la=b.useState(0),wa=(0,Oe.Z)(la,2),za=wa[0],Sa=wa[1],ts=za>=Xn.length-1||jn!=="horizontal"||en;b.useEffect(function(){Dr&&Nn(ti)},[ti]),b.useEffect(function(){return wn.current=!0,function(){wn.current=!1}},[]);var zi=vt(),Ki=zi.registerPath,ea=zi.unregisterPath,Cs=zi.refreshOverflowKeys,Ds=zi.isSubPathKey,rl=zi.getKeyPath,Hs=zi.getKeys,$s=zi.getSubPathKeys,no=b.useMemo(function(){return{registerPath:Ki,unregisterPath:ea}},[Ki,ea]),Ka=b.useMemo(function(){return{isSubPathKey:Ds}},[Ds]);b.useEffect(function(){Cs(ts?mn:Xn.slice(za+1).map(function(Kn){return Kn.key}))},[za,ts]);var nl=(0,te.Z)(gr||yn&&((bt=Xn[0])===null||bt===void 0?void 0:bt.key),{value:gr}),Yi=(0,Oe.Z)(nl,2),Ea=Yi[0],ta=Yi[1],Gs=Ut(function(Kn){ta(Kn)}),Do=Ut(function(){ta(void 0)});(0,b.useImperativeHandle)(Qe,function(){return{list:ws.current,focus:function(qn){var Un,Ui=Hs(),Ii=Ye(Ui,Qi),Aa=Ii.elements,Ta=Ii.key2element,Mo=Ii.element2key,Lo=We(ws.current,Aa),Ca=Ea!=null?Ea:Lo[0]?Mo.get(Lo[0]):(Un=Xn.find(function(Wa){return!Wa.props.disabled}))===null||Un===void 0?void 0:Un.key,na=Ta.get(Ca);if(Ca&&na){var Wt;na==null||(Wt=na.focus)===null||Wt===void 0||Wt.call(na,qn)}}}});var Jn=(0,te.Z)(ai||[],{value:pi,postState:function(qn){return Array.isArray(qn)?qn:qn==null?mn:[qn]}}),Ua=(0,Oe.Z)(Jn,2),ms=Ua[0],ma=Ua[1],il=function(qn){if(vn){var Un=qn.key,Ui=ms.includes(Un),Ii;Zr?Ui?Ii=ms.filter(function(Ta){return Ta!==Un}):Ii=[].concat((0,Ge.Z)(ms),[Un]):Ii=[Un],ma(Ii);var Aa=(0,Xe.Z)((0,Xe.Z)({},qn),{},{selectedKeys:Ii});Ui?ni==null||ni(Aa):In==null||In(Aa)}!Zr&&ti.length&&jn!=="inline"&&Fi(mn)},Ha=Ut(function(Kn){ui==null||ui(D(Kn)),il(Kn)}),ka=Ut(function(Kn,qn){var Un=ti.filter(function(Ii){return Ii!==Kn});if(qn)Un.push(Kn);else if(jn!=="inline"){var Ui=$s(Kn);Un=Un.filter(function(Ii){return!Ui.has(Ii)})}(0,V.Z)(ti,Un,!0)||Fi(Un,!0)}),Ga=function(qn,Un){var Ui=Un!=null?Un:!ti.includes(qn);ka(qn,Ui)},ra=Et(jn,Ea,_i,Qi,ws,Hs,rl,ta,Ga,Di);b.useEffect(function(){ci(!0)},[]);var Va=b.useMemo(function(){return{_internalRenderMenuItem:ls,_internalRenderSubMenuItem:_s}},[ls,_s]),zs=jn!=="horizontal"||en?Xn:Xn.map(function(Kn,qn){return b.createElement(P,{key:Kn.key,overflowDisabled:qn>za},Kn)}),io=b.createElement(c.Z,(0,Ce.Z)({id:_n,ref:ws,prefixCls:"".concat(Ft,"-overflow"),component:"ul",itemComponent:Ze,className:$()(Ft,"".concat(Ft,"-root"),"".concat(Ft,"-").concat(jn),fr,(Rt={},(0,Le.Z)(Rt,"".concat(Ft,"-inline-collapsed"),$i),(0,Le.Z)(Rt,"".concat(Ft,"-rtl"),_i),Rt),or),dir:wr,style:_r,role:"menu",tabIndex:on,data:zs,renderRawItem:function(qn){return qn},renderRawRest:function(qn){var Un=qn.length,Ui=Un?Xn.slice(-Un):null;return b.createElement(Ot,{eventKey:gt,title:Ci,disabled:ts,internalPopupClose:Un===0,popupClassName:Wn},Ui)},maxCount:jn!=="horizontal"||en?c.Z.INVALIDATE:c.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(qn){Sa(qn)},onKeyDown:ra},fs));return b.createElement(ie.Provider,{value:Va},b.createElement(I.Provider,{value:Qi},b.createElement(P,{prefixCls:Ft,rootClassName:or,mode:jn,openKeys:ti,rtl:_i,disabled:sn,motion:er?Zi:null,defaultMotions:er?Ar:null,activeKey:Ea,onActive:Gs,onInactive:Do,selectedKeys:ms,inlineIndent:Ti,subMenuOpenDelay:cn,subMenuCloseDelay:xn,forceSubMenuRender:sr,builtinPlacements:Vn,triggerSubMenuAction:zn,getPopupContainer:Wi,itemIcon:Gi,expandIcon:Vi,onItemClick:Ha,onOpenChange:ka},b.createElement(st.Provider,{value:Ka},io),b.createElement("div",{style:{display:"none"},"aria-hidden":!0},b.createElement(Te.Provider,{value:no},Xn)))))}),$n=dn,rn=$n;rn.Item=Ze,rn.SubMenu=Ot,rn.ItemGroup=nn,rn.Divider=kr;var Lr=rn},11780:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return xe}});var Ce=Y(96663),Le=Y(44127),Xe=Y(72071),Ge=Y(6620),Oe=Y(59301),me=Y(92310),Pe=Y.n(me),$=Y(29301),c=Y(34280),te=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],V=void 0;function A(C,B){var ee=C.prefixCls,we=C.invalidate,rt=C.item,tt=C.renderItem,ot=C.responsive,je=C.responsiveDisabled,nr=C.registerSize,Kt=C.itemKey,Lt=C.className,Gr=C.style,Rr=C.children,hn=C.display,Nr=C.order,an=C.component,zr=an===void 0?"div":an,We=(0,Ge.Z)(C,te),mt=ot&&!hn;function Ye(et){nr(Kt,et)}Oe.useEffect(function(){return function(){Ye(null)}},[]);var Et=tt&&rt!==V?tt(rt,{index:Nr}):Rr,Tt;we||(Tt={opacity:mt?0:1,height:mt?0:V,overflowY:mt?"hidden":V,order:ot?Nr:V,pointerEvents:mt?"none":V,position:mt?"absolute":V});var ge={};mt&&(ge["aria-hidden"]=!0);var Be=Oe.createElement(zr,(0,Ce.Z)({className:Pe()(!we&&ee,Lt),style:(0,Le.Z)((0,Le.Z)({},Tt),Gr)},ge,We,{ref:B}),Et);return ot&&(Be=Oe.createElement($.Z,{onResize:function(gt){var vt=gt.offsetWidth;Ye(vt)},disabled:je},Be)),Be}var b=Oe.forwardRef(A);b.displayName="Item";var M=b,I=Y(6089),re=Y(4676),se=Y(16089);function q(C){if(typeof MessageChannel=="undefined")(0,se.Z)(C);else{var B=new MessageChannel;B.port1.onmessage=function(){return C()},B.port2.postMessage(void 0)}}function W(){var C=Oe.useRef(null),B=function(we){C.current||(C.current=[],q(function(){(0,re.unstable_batchedUpdates)(function(){C.current.forEach(function(rt){rt()}),C.current=null})})),C.current.push(we)};return B}function Z(C,B){var ee=Oe.useState(B),we=(0,Xe.Z)(ee,2),rt=we[0],tt=we[1],ot=(0,I.Z)(function(je){C(function(){tt(je)})});return[rt,ot]}var le=Oe.createContext(null),P=["component"],ae=["className"],Te=["className"],ye=function(B,ee){var we=Oe.useContext(le);if(!we){var rt=B.component,tt=rt===void 0?"div":rt,ot=(0,Ge.Z)(B,P);return Oe.createElement(tt,(0,Ce.Z)({},ot,{ref:ee}))}var je=we.className,nr=(0,Ge.Z)(we,ae),Kt=B.className,Lt=(0,Ge.Z)(B,Te);return Oe.createElement(le.Provider,{value:null},Oe.createElement(M,(0,Ce.Z)({ref:ee,className:Pe()(je,Kt)},nr,Lt)))},Je=Oe.forwardRef(ye);Je.displayName="RawItem";var Ve=Je,st=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],ft="responsive",ie="invalidate";function Q(C){return"+ ".concat(C.length," ...")}function ue(C,B){var ee=C.prefixCls,we=ee===void 0?"rc-overflow":ee,rt=C.data,tt=rt===void 0?[]:rt,ot=C.renderItem,je=C.renderRawItem,nr=C.itemKey,Kt=C.itemWidth,Lt=Kt===void 0?10:Kt,Gr=C.ssr,Rr=C.style,hn=C.className,Nr=C.maxCount,an=C.renderRest,zr=C.renderRawRest,We=C.suffix,mt=C.component,Ye=mt===void 0?"div":mt,Et=C.itemComponent,Tt=C.onVisibleChange,ge=(0,Ge.Z)(C,st),Be=Gr==="full",et=W(),gt=Z(et,null),vt=(0,Xe.Z)(gt,2),Ut=vt[0],hr=vt[1],Yt=Ut||0,Ke=Z(et,new Map),$t=(0,Xe.Z)(Ke,2),cr=$t[0],Fe=$t[1],He=Z(et,0),qe=(0,Xe.Z)(He,2),Dt=qe[0],St=qe[1],Pt=Z(et,0),Gt=(0,Xe.Z)(Pt,2),k=Gt[0],D=Gt[1],ut=Z(et,0),U=(0,Xe.Z)(ut,2),he=U[0],Tr=U[1],Ee=(0,Oe.useState)(null),Ue=(0,Xe.Z)(Ee,2),Ze=Ue[0],G=Ue[1],pe=(0,Oe.useState)(null),_e=(0,Xe.Z)(pe,2),Ne=_e[0],H=_e[1],Vt=Oe.useMemo(function(){return Ne===null&&Be?Number.MAX_SAFE_INTEGER:Ne||0},[Ne,Ut]),Se=(0,Oe.useState)(!1),qt=(0,Xe.Z)(Se,2),vr=qt[0],Xr=qt[1],An="".concat(we,"-item"),Kr=Math.max(Dt,k),yr=Nr===ft,gn=tt.length&&yr,fe=Nr===ie,Ae=gn||typeof Nr=="number"&&tt.length>Nr,Ct=(0,Oe.useMemo)(function(){var Lr=tt;return gn?Ut===null&&Be?Lr=tt:Lr=tt.slice(0,Math.min(tt.length,Yt/Lt)):typeof Nr=="number"&&(Lr=tt.slice(0,Nr)),Lr},[tt,Lt,Ut,Nr,gn]),at=(0,Oe.useMemo)(function(){return gn?tt.slice(Vt+1):tt.slice(Ct.length)},[tt,Ct,gn,Vt]),xt=(0,Oe.useCallback)(function(Lr,nt){var Qe;return typeof nr=="function"?nr(Lr):(Qe=nr&&(Lr==null?void 0:Lr[nr]))!==null&&Qe!==void 0?Qe:nt},[nr]),Ot=(0,Oe.useCallback)(ot||function(Lr){return Lr},[ot]);function ir(Lr,nt,Qe){Ne===Lr&&(nt===void 0||nt===Ze)||(H(Lr),Qe||(Xr(Lr<tt.length-1),Tt==null||Tt(Lr)),nt!==void 0&&G(nt))}function Jt(Lr,nt){hr(nt.clientWidth)}function xr(Lr,nt){Fe(function(Qe){var bt=new Map(Qe);return nt===null?bt.delete(Lr):bt.set(Lr,nt),bt})}function br(Lr,nt){D(nt),St(k)}function nn(Lr,nt){Tr(nt)}function kr(Lr){return cr.get(xt(Ct[Lr],Lr))}(0,c.Z)(function(){if(Yt&&typeof Kr=="number"&&Ct){var Lr=he,nt=Ct.length,Qe=nt-1;if(!nt){ir(0,null);return}for(var bt=0;bt<nt;bt+=1){var Rt=kr(bt);if(Be&&(Rt=Rt||0),Rt===void 0){ir(bt-1,void 0,!0);break}if(Lr+=Rt,Qe===0&&Lr<=Yt||bt===Qe-1&&Lr+kr(Qe)<=Yt){ir(Qe,null);break}else if(Lr+Kr>Yt){ir(bt-1,Lr-Rt-he+k);break}}We&&kr(0)+he>Yt&&G(null)}},[Yt,cr,k,he,xt,Ct]);var Fr=vr&&!!at.length,$r={};Ze!==null&&gn&&($r={position:"absolute",left:Ze,top:0});var pn={prefixCls:An,responsive:gn,component:Et,invalidate:fe},Mn=je?function(Lr,nt){var Qe=xt(Lr,nt);return Oe.createElement(le.Provider,{key:Qe,value:(0,Le.Z)((0,Le.Z)({},pn),{},{order:nt,item:Lr,itemKey:Qe,registerSize:xr,display:nt<=Vt})},je(Lr,nt))}:function(Lr,nt){var Qe=xt(Lr,nt);return Oe.createElement(M,(0,Ce.Z)({},pn,{order:nt,key:Qe,item:Lr,renderItem:Ot,itemKey:Qe,registerSize:xr,display:nt<=Vt}))},mn={order:Fr?Vt:Number.MAX_SAFE_INTEGER,className:"".concat(An,"-rest"),registerSize:br,display:Fr},dn=an||Q,$n=zr?Oe.createElement(le.Provider,{value:(0,Le.Z)((0,Le.Z)({},pn),mn)},zr(at)):Oe.createElement(M,(0,Ce.Z)({},pn,mn),typeof dn=="function"?dn(at):dn),rn=Oe.createElement(Ye,(0,Ce.Z)({className:Pe()(!fe&&we,hn),style:Rr,ref:B},ge),Ct.map(Mn),Ae?$n:null,We&&Oe.createElement(M,(0,Ce.Z)({},pn,{responsive:yr,responsiveDisabled:!gn,order:Vt,className:"".concat(An,"-suffix"),registerSize:nn,display:!0,style:$r}),We));return yr?Oe.createElement($.Z,{onResize:Jt,disabled:!gn},rn):rn}var ce=Oe.forwardRef(ue);ce.displayName="Overflow",ce.Item=Ve,ce.RESPONSIVE=ft,ce.INVALIDATE=ie;var De=ce,xe=De},29301:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return ie}});var Ce=Y(96663),Le=Y(59301),Xe=Y(11592),Ge=Y(48736),Oe=Y(44127),me=Y(20135),Pe=Y(76846),$=Y(8654),c=Le.createContext(null);function te(Q){var ue=Q.children,ce=Q.onBatchResize,De=Le.useRef(0),xe=Le.useRef([]),C=Le.useContext(c),B=Le.useCallback(function(ee,we,rt){De.current+=1;var tt=De.current;xe.current.push({size:ee,element:we,data:rt}),Promise.resolve().then(function(){tt===De.current&&(ce==null||ce(xe.current),xe.current=[])}),C==null||C(ee,we,rt)},[ce,C]);return Le.createElement(c.Provider,{value:B},ue)}var V=Y(76374),A=new Map;function b(Q){Q.forEach(function(ue){var ce,De=ue.target;(ce=A.get(De))===null||ce===void 0||ce.forEach(function(xe){return xe(De)})})}var M=new V.Z(b),I=null,re=null;function se(Q,ue){A.has(Q)||(A.set(Q,new Set),M.observe(Q)),A.get(Q).add(ue)}function q(Q,ue){A.has(Q)&&(A.get(Q).delete(ue),A.get(Q).size||(M.unobserve(Q),A.delete(Q)))}var W=Y(52884),Z=Y(95727),le=Y(65711),P=Y(85745),ae=function(Q){(0,le.Z)(ce,Q);var ue=(0,P.Z)(ce);function ce(){return(0,W.Z)(this,ce),ue.apply(this,arguments)}return(0,Z.Z)(ce,[{key:"render",value:function(){return this.props.children}}]),ce}(Le.Component);function Te(Q,ue){var ce=Q.children,De=Q.disabled,xe=Le.useRef(null),C=Le.useRef(null),B=Le.useContext(c),ee=typeof ce=="function",we=ee?ce(xe):ce,rt=Le.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),tt=!ee&&Le.isValidElement(we)&&(0,$.Yr)(we),ot=tt?(0,$.C4)(we):null,je=(0,$.x1)(ot,xe),nr=function(){var Rr;return(0,Pe.ZP)(xe.current)||(xe.current&&(0,me.Z)(xe.current)==="object"?(0,Pe.ZP)((Rr=xe.current)===null||Rr===void 0?void 0:Rr.nativeElement):null)||(0,Pe.ZP)(C.current)};Le.useImperativeHandle(ue,function(){return nr()});var Kt=Le.useRef(Q);Kt.current=Q;var Lt=Le.useCallback(function(Gr){var Rr=Kt.current,hn=Rr.onResize,Nr=Rr.data,an=Gr.getBoundingClientRect(),zr=an.width,We=an.height,mt=Gr.offsetWidth,Ye=Gr.offsetHeight,Et=Math.floor(zr),Tt=Math.floor(We);if(rt.current.width!==Et||rt.current.height!==Tt||rt.current.offsetWidth!==mt||rt.current.offsetHeight!==Ye){var ge={width:Et,height:Tt,offsetWidth:mt,offsetHeight:Ye};rt.current=ge;var Be=mt===Math.round(zr)?zr:mt,et=Ye===Math.round(We)?We:Ye,gt=(0,Oe.Z)((0,Oe.Z)({},ge),{},{offsetWidth:Be,offsetHeight:et});B==null||B(gt,Gr,Nr),hn&&Promise.resolve().then(function(){hn(gt,Gr)})}},[]);return Le.useEffect(function(){var Gr=nr();return Gr&&!De&&se(Gr,Lt),function(){return q(Gr,Lt)}},[xe.current,De]),Le.createElement(ae,{ref:C},tt?Le.cloneElement(we,{ref:je}):we)}var ye=Le.forwardRef(Te),Je=ye,Ve="rc-observer-key";function st(Q,ue){var ce=Q.children,De=typeof ce=="function"?[ce]:(0,Xe.Z)(ce);return De.map(function(xe,C){var B=(xe==null?void 0:xe.key)||"".concat(Ve,"-").concat(C);return Le.createElement(Je,(0,Ce.Z)({},Q,{key:B,ref:C===0?ue:void 0}),xe)})}var ft=Le.forwardRef(st);ft.Collection=te;var ie=ft},55477:function(Ir,Mt,Y){"use strict";Y.d(Mt,{G:function(){return b},Z:function(){return se}});var Ce=Y(96663),Le=Y(44127),Xe=Y(6620),Ge=Y(35593),Oe=Y(59301),me={shiftX:64,adjustY:1},Pe={adjustX:1,shiftY:!0},$=[0,0],c={left:{points:["cr","cl"],overflow:Pe,offset:[-4,0],targetOffset:$},right:{points:["cl","cr"],overflow:Pe,offset:[4,0],targetOffset:$},top:{points:["bc","tc"],overflow:me,offset:[0,-4],targetOffset:$},bottom:{points:["tc","bc"],overflow:me,offset:[0,4],targetOffset:$},topLeft:{points:["bl","tl"],overflow:me,offset:[0,-4],targetOffset:$},leftTop:{points:["tr","tl"],overflow:Pe,offset:[-4,0],targetOffset:$},topRight:{points:["br","tr"],overflow:me,offset:[0,-4],targetOffset:$},rightTop:{points:["tl","tr"],overflow:Pe,offset:[4,0],targetOffset:$},bottomRight:{points:["tr","br"],overflow:me,offset:[0,4],targetOffset:$},rightBottom:{points:["bl","br"],overflow:Pe,offset:[4,0],targetOffset:$},bottomLeft:{points:["tl","bl"],overflow:me,offset:[0,4],targetOffset:$},leftBottom:{points:["br","bl"],overflow:Pe,offset:[-4,0],targetOffset:$}},te=null,V=Y(92310),A=Y.n(V);function b(q){var W=q.children,Z=q.prefixCls,le=q.id,P=q.overlayInnerStyle,ae=q.className,Te=q.style;return Oe.createElement("div",{className:A()("".concat(Z,"-content"),ae),style:Te},Oe.createElement("div",{className:"".concat(Z,"-inner"),id:le,role:"tooltip",style:P},typeof W=="function"?W():W))}var M=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],I=function(W,Z){var le=W.overlayClassName,P=W.trigger,ae=P===void 0?["hover"]:P,Te=W.mouseEnterDelay,ye=Te===void 0?0:Te,Je=W.mouseLeaveDelay,Ve=Je===void 0?.1:Je,st=W.overlayStyle,ft=W.prefixCls,ie=ft===void 0?"rc-tooltip":ft,Q=W.children,ue=W.onVisibleChange,ce=W.afterVisibleChange,De=W.transitionName,xe=W.animation,C=W.motion,B=W.placement,ee=B===void 0?"right":B,we=W.align,rt=we===void 0?{}:we,tt=W.destroyTooltipOnHide,ot=tt===void 0?!1:tt,je=W.defaultVisible,nr=W.getTooltipContainer,Kt=W.overlayInnerStyle,Lt=W.arrowContent,Gr=W.overlay,Rr=W.id,hn=W.showArrow,Nr=hn===void 0?!0:hn,an=(0,Xe.Z)(W,M),zr=(0,Oe.useRef)(null);(0,Oe.useImperativeHandle)(Z,function(){return zr.current});var We=(0,Le.Z)({},an);"visible"in W&&(We.popupVisible=W.visible);var mt=function(){return Oe.createElement(b,{key:"content",prefixCls:ie,id:Rr,overlayInnerStyle:Kt},Gr)};return Oe.createElement(Ge.Z,(0,Ce.Z)({popupClassName:le,prefixCls:ie,popup:mt,action:ae,builtinPlacements:c,popupPlacement:ee,ref:zr,popupAlign:rt,getPopupContainer:nr,onPopupVisibleChange:ue,afterPopupVisibleChange:ce,popupTransitionName:De,popupAnimation:xe,popupMotion:C,defaultPopupVisible:je,autoDestroy:ot,mouseLeaveDelay:Ve,popupStyle:st,mouseEnterDelay:ye,arrow:Nr},We),Q)},re=(0,Oe.forwardRef)(I),se=re},49658:function(Ir,Mt){"use strict";Mt.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Y=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Y)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Y==null?void 0:Y.substr(0,4))}},83145:function(Ir,Mt,Y){"use strict";Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.CopyToClipboard=void 0;var Ce=Xe(Y(59301)),Le=Xe(Y(25769));function Xe(W){return W&&W.__esModule?W:{default:W}}function Ge(W){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ge=function(le){return typeof le}:Ge=function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},Ge(W)}function Oe(W,Z){var le=Object.keys(W);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(W);Z&&(P=P.filter(function(ae){return Object.getOwnPropertyDescriptor(W,ae).enumerable})),le.push.apply(le,P)}return le}function me(W){for(var Z=1;Z<arguments.length;Z++){var le=arguments[Z]!=null?arguments[Z]:{};Z%2?Oe(le,!0).forEach(function(P){se(W,P,le[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(W,Object.getOwnPropertyDescriptors(le)):Oe(le).forEach(function(P){Object.defineProperty(W,P,Object.getOwnPropertyDescriptor(le,P))})}return W}function Pe(W,Z){if(W==null)return{};var le=$(W,Z),P,ae;if(Object.getOwnPropertySymbols){var Te=Object.getOwnPropertySymbols(W);for(ae=0;ae<Te.length;ae++)P=Te[ae],!(Z.indexOf(P)>=0)&&Object.prototype.propertyIsEnumerable.call(W,P)&&(le[P]=W[P])}return le}function $(W,Z){if(W==null)return{};var le={},P=Object.keys(W),ae,Te;for(Te=0;Te<P.length;Te++)ae=P[Te],!(Z.indexOf(ae)>=0)&&(le[ae]=W[ae]);return le}function c(W,Z){if(!(W instanceof Z))throw new TypeError("Cannot call a class as a function")}function te(W,Z){for(var le=0;le<Z.length;le++){var P=Z[le];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(W,P.key,P)}}function V(W,Z,le){return Z&&te(W.prototype,Z),le&&te(W,le),W}function A(W,Z){return Z&&(Ge(Z)==="object"||typeof Z=="function")?Z:M(W)}function b(W){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(le){return le.__proto__||Object.getPrototypeOf(le)},b(W)}function M(W){if(W===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W}function I(W,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Super expression must either be null or a function");W.prototype=Object.create(Z&&Z.prototype,{constructor:{value:W,writable:!0,configurable:!0}}),Z&&re(W,Z)}function re(W,Z){return re=Object.setPrototypeOf||function(P,ae){return P.__proto__=ae,P},re(W,Z)}function se(W,Z,le){return Z in W?Object.defineProperty(W,Z,{value:le,enumerable:!0,configurable:!0,writable:!0}):W[Z]=le,W}var q=function(W){I(Z,W);function Z(){var le,P;c(this,Z);for(var ae=arguments.length,Te=new Array(ae),ye=0;ye<ae;ye++)Te[ye]=arguments[ye];return P=A(this,(le=b(Z)).call.apply(le,[this].concat(Te))),se(M(P),"onClick",function(Je){var Ve=P.props,st=Ve.text,ft=Ve.onCopy,ie=Ve.children,Q=Ve.options,ue=Ce.default.Children.only(ie),ce=(0,Le.default)(st,Q);ft&&ft(st,ce),ue&&ue.props&&typeof ue.props.onClick=="function"&&ue.props.onClick(Je)}),P}return V(Z,[{key:"render",value:function(){var P=this.props,ae=P.text,Te=P.onCopy,ye=P.options,Je=P.children,Ve=Pe(P,["text","onCopy","options","children"]),st=Ce.default.Children.only(Je);return Ce.default.cloneElement(st,me({},Ve,{onClick:this.onClick}))}}]),Z}(Ce.default.PureComponent);Mt.CopyToClipboard=q,se(q,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Ir,Mt,Y){"use strict";var Ce=Y(83145),Le=Ce.CopyToClipboard;Le.CopyToClipboard=Le,Ir.exports=Le},76374:function(Ir,Mt,Y){"use strict";var Ce=function(){if(typeof Map!="undefined")return Map;function ie(Q,ue){var ce=-1;return Q.some(function(De,xe){return De[0]===ue?(ce=xe,!0):!1}),ce}return function(){function Q(){this.__entries__=[]}return Object.defineProperty(Q.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),Q.prototype.get=function(ue){var ce=ie(this.__entries__,ue),De=this.__entries__[ce];return De&&De[1]},Q.prototype.set=function(ue,ce){var De=ie(this.__entries__,ue);~De?this.__entries__[De][1]=ce:this.__entries__.push([ue,ce])},Q.prototype.delete=function(ue){var ce=this.__entries__,De=ie(ce,ue);~De&&ce.splice(De,1)},Q.prototype.has=function(ue){return!!~ie(this.__entries__,ue)},Q.prototype.clear=function(){this.__entries__.splice(0)},Q.prototype.forEach=function(ue,ce){ce===void 0&&(ce=null);for(var De=0,xe=this.__entries__;De<xe.length;De++){var C=xe[De];ue.call(ce,C[1],C[0])}},Q}()}(),Le=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Xe=function(){return typeof Y.g!="undefined"&&Y.g.Math===Math?Y.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),Ge=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Xe):function(ie){return setTimeout(function(){return ie(Date.now())},1e3/60)}}(),Oe=2;function me(ie,Q){var ue=!1,ce=!1,De=0;function xe(){ue&&(ue=!1,ie()),ce&&B()}function C(){Ge(xe)}function B(){var ee=Date.now();if(ue){if(ee-De<Oe)return;ce=!0}else ue=!0,ce=!1,setTimeout(C,Q);De=ee}return B}var Pe=20,$=["top","right","bottom","left","width","height","size","weight"],c=typeof MutationObserver!="undefined",te=function(){function ie(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=me(this.refresh.bind(this),Pe)}return ie.prototype.addObserver=function(Q){~this.observers_.indexOf(Q)||this.observers_.push(Q),this.connected_||this.connect_()},ie.prototype.removeObserver=function(Q){var ue=this.observers_,ce=ue.indexOf(Q);~ce&&ue.splice(ce,1),!ue.length&&this.connected_&&this.disconnect_()},ie.prototype.refresh=function(){var Q=this.updateObservers_();Q&&this.refresh()},ie.prototype.updateObservers_=function(){var Q=this.observers_.filter(function(ue){return ue.gatherActive(),ue.hasActive()});return Q.forEach(function(ue){return ue.broadcastActive()}),Q.length>0},ie.prototype.connect_=function(){!Le||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},ie.prototype.disconnect_=function(){!Le||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},ie.prototype.onTransitionEnd_=function(Q){var ue=Q.propertyName,ce=ue===void 0?"":ue,De=$.some(function(xe){return!!~ce.indexOf(xe)});De&&this.refresh()},ie.getInstance=function(){return this.instance_||(this.instance_=new ie),this.instance_},ie.instance_=null,ie}(),V=function(ie,Q){for(var ue=0,ce=Object.keys(Q);ue<ce.length;ue++){var De=ce[ue];Object.defineProperty(ie,De,{value:Q[De],enumerable:!1,writable:!1,configurable:!0})}return ie},A=function(ie){var Q=ie&&ie.ownerDocument&&ie.ownerDocument.defaultView;return Q||Xe},b=ae(0,0,0,0);function M(ie){return parseFloat(ie)||0}function I(ie){for(var Q=[],ue=1;ue<arguments.length;ue++)Q[ue-1]=arguments[ue];return Q.reduce(function(ce,De){var xe=ie["border-"+De+"-width"];return ce+M(xe)},0)}function re(ie){for(var Q=["top","right","bottom","left"],ue={},ce=0,De=Q;ce<De.length;ce++){var xe=De[ce],C=ie["padding-"+xe];ue[xe]=M(C)}return ue}function se(ie){var Q=ie.getBBox();return ae(0,0,Q.width,Q.height)}function q(ie){var Q=ie.clientWidth,ue=ie.clientHeight;if(!Q&&!ue)return b;var ce=A(ie).getComputedStyle(ie),De=re(ce),xe=De.left+De.right,C=De.top+De.bottom,B=M(ce.width),ee=M(ce.height);if(ce.boxSizing==="border-box"&&(Math.round(B+xe)!==Q&&(B-=I(ce,"left","right")+xe),Math.round(ee+C)!==ue&&(ee-=I(ce,"top","bottom")+C)),!Z(ie)){var we=Math.round(B+xe)-Q,rt=Math.round(ee+C)-ue;Math.abs(we)!==1&&(B-=we),Math.abs(rt)!==1&&(ee-=rt)}return ae(De.left,De.top,B,ee)}var W=function(){return typeof SVGGraphicsElement!="undefined"?function(ie){return ie instanceof A(ie).SVGGraphicsElement}:function(ie){return ie instanceof A(ie).SVGElement&&typeof ie.getBBox=="function"}}();function Z(ie){return ie===A(ie).document.documentElement}function le(ie){return Le?W(ie)?se(ie):q(ie):b}function P(ie){var Q=ie.x,ue=ie.y,ce=ie.width,De=ie.height,xe=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,C=Object.create(xe.prototype);return V(C,{x:Q,y:ue,width:ce,height:De,top:ue,right:Q+ce,bottom:De+ue,left:Q}),C}function ae(ie,Q,ue,ce){return{x:ie,y:Q,width:ue,height:ce}}var Te=function(){function ie(Q){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ae(0,0,0,0),this.target=Q}return ie.prototype.isActive=function(){var Q=le(this.target);return this.contentRect_=Q,Q.width!==this.broadcastWidth||Q.height!==this.broadcastHeight},ie.prototype.broadcastRect=function(){var Q=this.contentRect_;return this.broadcastWidth=Q.width,this.broadcastHeight=Q.height,Q},ie}(),ye=function(){function ie(Q,ue){var ce=P(ue);V(this,{target:Q,contentRect:ce})}return ie}(),Je=function(){function ie(Q,ue,ce){if(this.activeObservations_=[],this.observations_=new Ce,typeof Q!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=Q,this.controller_=ue,this.callbackCtx_=ce}return ie.prototype.observe=function(Q){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(Q instanceof A(Q).Element))throw new TypeError('parameter 1 is not of type "Element".');var ue=this.observations_;ue.has(Q)||(ue.set(Q,new Te(Q)),this.controller_.addObserver(this),this.controller_.refresh())}},ie.prototype.unobserve=function(Q){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(Q instanceof A(Q).Element))throw new TypeError('parameter 1 is not of type "Element".');var ue=this.observations_;ue.has(Q)&&(ue.delete(Q),ue.size||this.controller_.removeObserver(this))}},ie.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},ie.prototype.gatherActive=function(){var Q=this;this.clearActive(),this.observations_.forEach(function(ue){ue.isActive()&&Q.activeObservations_.push(ue)})},ie.prototype.broadcastActive=function(){if(this.hasActive()){var Q=this.callbackCtx_,ue=this.activeObservations_.map(function(ce){return new ye(ce.target,ce.broadcastRect())});this.callback_.call(Q,ue,Q),this.clearActive()}},ie.prototype.clearActive=function(){this.activeObservations_.splice(0)},ie.prototype.hasActive=function(){return this.activeObservations_.length>0},ie}(),Ve=typeof WeakMap!="undefined"?new WeakMap:new Ce,st=function(){function ie(Q){if(!(this instanceof ie))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var ue=te.getInstance(),ce=new Je(Q,ue,this);Ve.set(this,ce)}return ie}();["observe","unobserve","disconnect"].forEach(function(ie){st.prototype[ie]=function(){var Q;return(Q=Ve.get(this))[ie].apply(Q,arguments)}});var ft=function(){return typeof Xe.ResizeObserver!="undefined"?Xe.ResizeObserver:st}();Mt.Z=ft},98040:function(Ir){Ir.exports=function(){var Mt=document.getSelection();if(!Mt.rangeCount)return function(){};for(var Y=document.activeElement,Ce=[],Le=0;Le<Mt.rangeCount;Le++)Ce.push(Mt.getRangeAt(Le));switch(Y.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":Y.blur();break;default:Y=null;break}return Mt.removeAllRanges(),function(){Mt.type==="Caret"&&Mt.removeAllRanges(),Mt.rangeCount||Ce.forEach(function(Xe){Mt.addRange(Xe)}),Y&&Y.focus()}}},1012:function(Ir,Mt,Y){"use strict";Y.d(Mt,{Z:function(){return A}});var Ce=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Le=new Uint8Array(16);function Xe(){if(!Ce)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ce(Le)}var Ge=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Oe(b){return typeof b=="string"&&Ge.test(b)}for(var me=Oe,Pe=[],$=0;$<256;++$)Pe.push(($+256).toString(16).substr(1));function c(b){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,I=(Pe[b[M+0]]+Pe[b[M+1]]+Pe[b[M+2]]+Pe[b[M+3]]+"-"+Pe[b[M+4]]+Pe[b[M+5]]+"-"+Pe[b[M+6]]+Pe[b[M+7]]+"-"+Pe[b[M+8]]+Pe[b[M+9]]+"-"+Pe[b[M+10]]+Pe[b[M+11]]+Pe[b[M+12]]+Pe[b[M+13]]+Pe[b[M+14]]+Pe[b[M+15]]).toLowerCase();if(!me(I))throw TypeError("Stringified UUID is invalid");return I}var te=c;function V(b,M,I){b=b||{};var re=b.random||(b.rng||Xe)();if(re[6]=re[6]&15|64,re[8]=re[8]&63|128,M){I=I||0;for(var se=0;se<16;++se)M[I+se]=re[se];return M}return te(re)}var A=V},40846:function(Ir,Mt,Y){"use strict";Y.d(Mt,{ZP:function(){return Ba}});function Ce(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var Le={exports:{}};(function(d,r){(function(i){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,o=/^(?=([^\/?#]*))\1([^]*)$/,u=/(?:\/|^)\.(?=\/)/g,h=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,m={buildAbsoluteURL:function(_,w,E){if(E=E||{},_=_.trim(),w=w.trim(),!w){if(!E.alwaysNormalize)return _;var L=m.parseURL(_);if(!L)throw new Error("Error trying to parse base URL.");return L.path=m.normalizePath(L.path),m.buildURLFromParts(L)}var N=m.parseURL(w);if(!N)throw new Error("Error trying to parse relative URL.");if(N.scheme)return E.alwaysNormalize?(N.path=m.normalizePath(N.path),m.buildURLFromParts(N)):w;var J=m.parseURL(_);if(!J)throw new Error("Error trying to parse base URL.");if(!J.netLoc&&J.path&&J.path[0]!=="/"){var j=o.exec(J.path);J.netLoc=j[1],J.path=j[2]}J.netLoc&&!J.path&&(J.path="/");var ne={scheme:J.scheme,netLoc:N.netLoc,path:null,params:N.params,query:N.query,fragment:N.fragment};if(!N.netLoc&&(ne.netLoc=J.netLoc,N.path[0]!=="/"))if(!N.path)ne.path=J.path,N.params||(ne.params=J.params,N.query||(ne.query=J.query));else{var de=J.path,$e=de.substring(0,de.lastIndexOf("/")+1)+N.path;ne.path=m.normalizePath($e)}return ne.path===null&&(ne.path=E.alwaysNormalize?m.normalizePath(N.path):N.path),m.buildURLFromParts(ne)},parseURL:function(_){var w=s.exec(_);return w?{scheme:w[1]||"",netLoc:w[2]||"",path:w[3]||"",params:w[4]||"",query:w[5]||"",fragment:w[6]||""}:null},normalizePath:function(_){for(_=_.split("").reverse().join("").replace(u,"");_.length!==(_=_.replace(h,"")).length;);return _.split("").reverse().join("")},buildURLFromParts:function(_){return _.scheme+_.netLoc+_.path+_.params+_.query+_.fragment}};d.exports=m})()})(Le);var Xe=Le.exports;function Ge(d,r){var i=Object.keys(d);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(d);r&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(d,o).enumerable})),i.push.apply(i,s)}return i}function Oe(d){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};r%2?Ge(Object(i),!0).forEach(function(s){$(d,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(i)):Ge(Object(i)).forEach(function(s){Object.defineProperty(d,s,Object.getOwnPropertyDescriptor(i,s))})}return d}function me(d,r){if(typeof d!="object"||!d)return d;var i=d[Symbol.toPrimitive];if(i!==void 0){var s=i.call(d,r||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(d)}function Pe(d){var r=me(d,"string");return typeof r=="symbol"?r:String(r)}function $(d,r,i){return r=Pe(r),r in d?Object.defineProperty(d,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):d[r]=i,d}function c(){return c=Object.assign?Object.assign.bind():function(d){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(d[s]=i[s])}return d},c.apply(this,arguments)}const te=Number.isFinite||function(d){return typeof d=="number"&&isFinite(d)},V=Number.isSafeInteger||function(d){return typeof d=="number"&&Math.abs(d)<=A},A=Number.MAX_SAFE_INTEGER||9007199254740991;let b=function(d){return d.MEDIA_ATTACHING="hlsMediaAttaching",d.MEDIA_ATTACHED="hlsMediaAttached",d.MEDIA_DETACHING="hlsMediaDetaching",d.MEDIA_DETACHED="hlsMediaDetached",d.BUFFER_RESET="hlsBufferReset",d.BUFFER_CODECS="hlsBufferCodecs",d.BUFFER_CREATED="hlsBufferCreated",d.BUFFER_APPENDING="hlsBufferAppending",d.BUFFER_APPENDED="hlsBufferAppended",d.BUFFER_EOS="hlsBufferEos",d.BUFFER_FLUSHING="hlsBufferFlushing",d.BUFFER_FLUSHED="hlsBufferFlushed",d.MANIFEST_LOADING="hlsManifestLoading",d.MANIFEST_LOADED="hlsManifestLoaded",d.MANIFEST_PARSED="hlsManifestParsed",d.LEVEL_SWITCHING="hlsLevelSwitching",d.LEVEL_SWITCHED="hlsLevelSwitched",d.LEVEL_LOADING="hlsLevelLoading",d.LEVEL_LOADED="hlsLevelLoaded",d.LEVEL_UPDATED="hlsLevelUpdated",d.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",d.LEVELS_UPDATED="hlsLevelsUpdated",d.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",d.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",d.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",d.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",d.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",d.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",d.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",d.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",d.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",d.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",d.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",d.CUES_PARSED="hlsCuesParsed",d.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",d.INIT_PTS_FOUND="hlsInitPtsFound",d.FRAG_LOADING="hlsFragLoading",d.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",d.FRAG_LOADED="hlsFragLoaded",d.FRAG_DECRYPTED="hlsFragDecrypted",d.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",d.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",d.FRAG_PARSING_METADATA="hlsFragParsingMetadata",d.FRAG_PARSED="hlsFragParsed",d.FRAG_BUFFERED="hlsFragBuffered",d.FRAG_CHANGED="hlsFragChanged",d.FPS_DROP="hlsFpsDrop",d.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",d.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",d.ERROR="hlsError",d.DESTROYING="hlsDestroying",d.KEY_LOADING="hlsKeyLoading",d.KEY_LOADED="hlsKeyLoaded",d.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",d.BACK_BUFFER_REACHED="hlsBackBufferReached",d.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",d}({}),M=function(d){return d.NETWORK_ERROR="networkError",d.MEDIA_ERROR="mediaError",d.KEY_SYSTEM_ERROR="keySystemError",d.MUX_ERROR="muxError",d.OTHER_ERROR="otherError",d}({}),I=function(d){return d.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",d.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",d.KEY_SYSTEM_NO_SESSION="keySystemNoSession",d.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",d.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",d.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",d.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",d.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",d.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",d.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",d.MANIFEST_LOAD_ERROR="manifestLoadError",d.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",d.MANIFEST_PARSING_ERROR="manifestParsingError",d.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",d.LEVEL_EMPTY_ERROR="levelEmptyError",d.LEVEL_LOAD_ERROR="levelLoadError",d.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",d.LEVEL_PARSING_ERROR="levelParsingError",d.LEVEL_SWITCH_ERROR="levelSwitchError",d.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",d.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",d.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",d.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",d.FRAG_LOAD_ERROR="fragLoadError",d.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",d.FRAG_DECRYPT_ERROR="fragDecryptError",d.FRAG_PARSING_ERROR="fragParsingError",d.FRAG_GAP="fragGap",d.REMUX_ALLOC_ERROR="remuxAllocError",d.KEY_LOAD_ERROR="keyLoadError",d.KEY_LOAD_TIMEOUT="keyLoadTimeOut",d.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",d.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",d.BUFFER_APPEND_ERROR="bufferAppendError",d.BUFFER_APPENDING_ERROR="bufferAppendingError",d.BUFFER_STALLED_ERROR="bufferStalledError",d.BUFFER_FULL_ERROR="bufferFullError",d.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",d.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",d.INTERNAL_EXCEPTION="internalException",d.INTERNAL_ABORTED="aborted",d.UNKNOWN="unknown",d}({});const re=function(){},se={trace:re,debug:re,log:re,warn:re,info:re,error:re};let q=se;function W(d){const r=self.console[d];return r?r.bind(self.console,`[${d}] >`):re}function Z(d,...r){r.forEach(function(i){q[i]=d[i]?d[i].bind(d):W(i)})}function le(d,r){if(typeof console=="object"&&d===!0||typeof d=="object"){Z(d,"debug","log","info","warn","error");try{q.log(`Debug logs enabled for "${r}" in hls.js version 1.5.20`)}catch(i){q=se}}else q=se}const P=q,ae=/^(\d+)x(\d+)$/,Te=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ye{constructor(r){typeof r=="string"&&(r=ye.parseAttrList(r)),c(this,r)}get clientAttrs(){return Object.keys(this).filter(r=>r.substring(0,2)==="X-")}decimalInteger(r){const i=parseInt(this[r],10);return i>Number.MAX_SAFE_INTEGER?1/0:i}hexadecimalInteger(r){if(this[r]){let i=(this[r]||"0x").slice(2);i=(i.length&1?"0":"")+i;const s=new Uint8Array(i.length/2);for(let o=0;o<i.length/2;o++)s[o]=parseInt(i.slice(o*2,o*2+2),16);return s}else return null}hexadecimalIntegerAsNumber(r){const i=parseInt(this[r],16);return i>Number.MAX_SAFE_INTEGER?1/0:i}decimalFloatingPoint(r){return parseFloat(this[r])}optionalFloat(r,i){const s=this[r];return s?parseFloat(s):i}enumeratedString(r){return this[r]}bool(r){return this[r]==="YES"}decimalResolution(r){const i=ae.exec(this[r]);if(i!==null)return{width:parseInt(i[1],10),height:parseInt(i[2],10)}}static parseAttrList(r){let i;const s={},o='"';for(Te.lastIndex=0;(i=Te.exec(r))!==null;){let u=i[2];u.indexOf(o)===0&&u.lastIndexOf(o)===u.length-1&&(u=u.slice(1,-1));const h=i[1].trim();s[h]=u}return s}}function Je(d){return d!=="ID"&&d!=="CLASS"&&d!=="START-DATE"&&d!=="DURATION"&&d!=="END-DATE"&&d!=="END-ON-NEXT"}function Ve(d){return d==="SCTE35-OUT"||d==="SCTE35-IN"}class st{constructor(r,i){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,i){const s=i.attr;for(const o in s)if(Object.prototype.hasOwnProperty.call(r,o)&&r[o]!==s[o]){P.warn(`DATERANGE tag attribute: "${o}" does not match for tags with ID: "${r.ID}"`),this._badValueForSameId=o;break}r=c(new ye({}),s,r)}if(this.attr=r,this._startDate=new Date(r["START-DATE"]),"END-DATE"in this.attr){const s=new Date(this.attr["END-DATE"]);te(s.getTime())&&(this._endDate=s)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const r=this.duration;return r!==null?new Date(this._startDate.getTime()+r*1e3):null}get duration(){if("DURATION"in this.attr){const r=this.attr.decimalFloatingPoint("DURATION");if(te(r))return r}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&te(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class ft{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var ie={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Q{constructor(r){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[ie.AUDIO]:null,[ie.VIDEO]:null,[ie.AUDIOVIDEO]:null},this.baseurl=r}setByteRange(r,i){const s=r.split("@",2);let o;s.length===1?o=(i==null?void 0:i.byteRangeEndOffset)||0:o=parseInt(s[1]),this._byteRange=[o,parseInt(s[0])+o]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Xe.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(r){this._url=r}}class ue extends Q{constructor(r,i){super(i),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new ft,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=r}get decryptdata(){const{levelkeys:r}=this;if(!r&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const i=this.levelkeys.identity;if(i)this._decryptdata=i.getDecryptData(this.sn);else{const s=Object.keys(this.levelkeys);if(s.length===1)return this._decryptdata=this.levelkeys[s[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!te(this.programDateTime))return null;const r=te(this.duration)?this.duration:0;return this.programDateTime+r*1e3}get encrypted(){var r;if((r=this._decryptdata)!=null&&r.encrypted)return!0;if(this.levelkeys){const i=Object.keys(this.levelkeys),s=i.length;if(s>1||s===1&&this.levelkeys[i[0]].encrypted)return!0}return!1}setKeyFormat(r){if(this.levelkeys){const i=this.levelkeys[r];i&&!this._decryptdata&&(this._decryptdata=i.getDecryptData(this.sn))}}abortRequests(){var r,i;(r=this.loader)==null||r.abort(),(i=this.keyLoader)==null||i.abort()}setElementaryStreamInfo(r,i,s,o,u,h=!1){const{elementaryStreams:m}=this,_=m[r];if(!_){m[r]={startPTS:i,endPTS:s,startDTS:o,endDTS:u,partial:h};return}_.startPTS=Math.min(_.startPTS,i),_.endPTS=Math.max(_.endPTS,s),_.startDTS=Math.min(_.startDTS,o),_.endDTS=Math.max(_.endDTS,u)}clearElementaryStreamInfo(){const{elementaryStreams:r}=this;r[ie.AUDIO]=null,r[ie.VIDEO]=null,r[ie.AUDIOVIDEO]=null}}class ce extends Q{constructor(r,i,s,o,u){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new ft,this.duration=r.decimalFloatingPoint("DURATION"),this.gap=r.bool("GAP"),this.independent=r.bool("INDEPENDENT"),this.relurl=r.enumeratedString("URI"),this.fragment=i,this.index=o;const h=r.enumeratedString("BYTERANGE");h&&this.setByteRange(h,u),u&&(this.fragOffset=u.fragOffset+u.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:r}=this;return!!(r.audio||r.video||r.audiovideo)}}const De=10;class xe{constructor(r){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=r}reloaded(r){if(!r){this.advanced=!0,this.updated=!0;return}const i=this.lastPartSn-r.lastPartSn,s=this.lastPartIndex-r.lastPartIndex;this.updated=this.endSN!==r.endSN||!!s||!!i||!this.live,this.advanced=this.endSN>r.endSN||i>0||i===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(r.misses*.6):this.misses=r.misses+1,this.availabilityDelay=r.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?te(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||De}get drift(){const r=this.driftEndTime-this.driftStartTime;return r>0?(this.driftEnd-this.driftStart)*1e3/r:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var r;return(r=this.partList)!=null&&r.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var r;return(r=this.fragments)!=null&&r.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var r;return(r=this.partList)!=null&&r.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var r;return(r=this.partList)!=null&&r.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function C(d){return Uint8Array.from(atob(d),r=>r.charCodeAt(0))}function B(d){const r=rt(d).subarray(0,16),i=new Uint8Array(16);return i.set(r,16-r.length),i}function ee(d){const r=function(s,o,u){const h=s[o];s[o]=s[u],s[u]=h};r(d,0,3),r(d,1,2),r(d,4,5),r(d,6,7)}function we(d){const r=d.split(":");let i=null;if(r[0]==="data"&&r.length===2){const s=r[1].split(";"),o=s[s.length-1].split(",");if(o.length===2){const u=o[0]==="base64",h=o[1];u?(s.splice(-1,1),i=C(h)):i=B(h)}}return i}function rt(d){return Uint8Array.from(unescape(encodeURIComponent(d)),r=>r.charCodeAt(0))}const tt=typeof self!="undefined"?self:void 0;var ot={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},je={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function nr(d){switch(d){case je.FAIRPLAY:return ot.FAIRPLAY;case je.PLAYREADY:return ot.PLAYREADY;case je.WIDEVINE:return ot.WIDEVINE;case je.CLEARKEY:return ot.CLEARKEY}}var Kt={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",FAIRPLAY:"94ce86fb07ff4f43adb893d2fa968ca2",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Lt(d){if(d===Kt.WIDEVINE)return ot.WIDEVINE;if(d===Kt.PLAYREADY)return ot.PLAYREADY;if(d===Kt.CENC||d===Kt.CLEARKEY)return ot.CLEARKEY}function Gr(d){switch(d){case ot.FAIRPLAY:return je.FAIRPLAY;case ot.PLAYREADY:return je.PLAYREADY;case ot.WIDEVINE:return je.WIDEVINE;case ot.CLEARKEY:return je.CLEARKEY}}function Rr(d){const{drmSystems:r,widevineLicenseUrl:i}=d,s=r?[ot.FAIRPLAY,ot.WIDEVINE,ot.PLAYREADY,ot.CLEARKEY].filter(o=>!!r[o]):[];return!s[ot.WIDEVINE]&&i&&s.push(ot.WIDEVINE),s}const hn=function(d){return tt!=null&&(d=tt.navigator)!=null&&d.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Nr(d,r,i,s){let o;switch(d){case ot.FAIRPLAY:o=["cenc","sinf"];break;case ot.WIDEVINE:case ot.PLAYREADY:o=["cenc"];break;case ot.CLEARKEY:o=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${d}`)}return an(o,r,i,s)}function an(d,r,i,s){return[{initDataTypes:d,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:r.map(u=>({contentType:`audio/mp4; codecs="${u}"`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:i.map(u=>({contentType:`video/mp4; codecs="${u}"`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function zr(d){const r=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/2),i=String.fromCharCode.apply(null,Array.from(r)),s=i.substring(i.indexOf("<"),i.length),h=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(h){const m=h.childNodes[0]?h.childNodes[0].nodeValue:h.getAttribute("VALUE");if(m){const _=C(m).subarray(0,16);return ee(_),_}}return null}function We(d,r,i){return Uint8Array.prototype.slice?d.slice(r,i):new Uint8Array(Array.prototype.slice.call(d,r,i))}const mt=(d,r)=>r+10<=d.length&&d[r]===73&&d[r+1]===68&&d[r+2]===51&&d[r+3]<255&&d[r+4]<255&&d[r+6]<128&&d[r+7]<128&&d[r+8]<128&&d[r+9]<128,Ye=(d,r)=>r+10<=d.length&&d[r]===51&&d[r+1]===68&&d[r+2]===73&&d[r+3]<255&&d[r+4]<255&&d[r+6]<128&&d[r+7]<128&&d[r+8]<128&&d[r+9]<128,Et=(d,r)=>{const i=r;let s=0;for(;mt(d,r);){s+=10;const o=Tt(d,r+6);s+=o,Ye(d,r+10)&&(s+=10),r+=s}if(s>0)return d.subarray(i,i+s)},Tt=(d,r)=>{let i=0;return i=(d[r]&127)<<21,i|=(d[r+1]&127)<<14,i|=(d[r+2]&127)<<7,i|=d[r+3]&127,i},ge=(d,r)=>mt(d,r)&&Tt(d,r+6)+10<=d.length-r,Be=d=>{const r=vt(d);for(let i=0;i<r.length;i++){const s=r[i];if(et(s))return $t(s)}},et=d=>d&&d.key==="PRIV"&&d.info==="com.apple.streaming.transportStreamTimestamp",gt=d=>{const r=String.fromCharCode(d[0],d[1],d[2],d[3]),i=Tt(d,4),s=10;return{type:r,size:i,data:d.subarray(s,s+i)}},vt=d=>{let r=0;const i=[];for(;mt(d,r);){const s=Tt(d,r+6);r+=10;const o=r+s;for(;r+8<o;){const u=gt(d.subarray(r)),h=Ut(u);h&&i.push(h),r+=u.size+10}Ye(d,r)&&(r+=10)}return i},Ut=d=>d.type==="PRIV"?hr(d):d.type[0]==="W"?Ke(d):Yt(d),hr=d=>{if(d.size<2)return;const r=cr(d.data,!0),i=new Uint8Array(d.data.subarray(r.length+1));return{key:d.type,info:r,data:i.buffer}},Yt=d=>{if(d.size<2)return;if(d.type==="TXXX"){let i=1;const s=cr(d.data.subarray(i),!0);i+=s.length+1;const o=cr(d.data.subarray(i));return{key:d.type,info:s,data:o}}const r=cr(d.data.subarray(1));return{key:d.type,data:r}},Ke=d=>{if(d.type==="WXXX"){if(d.size<2)return;let i=1;const s=cr(d.data.subarray(i),!0);i+=s.length+1;const o=cr(d.data.subarray(i));return{key:d.type,info:s,data:o}}const r=cr(d.data);return{key:d.type,data:r}},$t=d=>{if(d.data.byteLength===8){const r=new Uint8Array(d.data),i=r[3]&1;let s=(r[4]<<23)+(r[5]<<15)+(r[6]<<7)+r[7];return s/=45,i&&(s+=4772185884e-2),Math.round(s)}},cr=(d,r=!1)=>{const i=He();if(i){const w=i.decode(d);if(r){const E=w.indexOf("\0");return E!==-1?w.substring(0,E):w}return w.replace(/\0/g,"")}const s=d.length;let o,u,h,m="",_=0;for(;_<s;){if(o=d[_++],o===0&&r)return m;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:m+=String.fromCharCode(o);break;case 12:case 13:u=d[_++],m+=String.fromCharCode((o&31)<<6|u&63);break;case 14:u=d[_++],h=d[_++],m+=String.fromCharCode((o&15)<<12|(u&63)<<6|(h&63)<<0);break}}return m};let Fe;function He(){if(!navigator.userAgent.includes("PlayStation 4"))return!Fe&&typeof self.TextDecoder!="undefined"&&(Fe=new self.TextDecoder("utf-8")),Fe}const qe={hexDump:function(d){let r="";for(let i=0;i<d.length;i++){let s=d[i].toString(16);s.length<2&&(s="0"+s),r+=s}return r}},Dt=Math.pow(2,32)-1,St=[].push,Pt={video:1,audio:2,id3:3,text:4};function Gt(d){return String.fromCharCode.apply(null,d)}function k(d,r){const i=d[r]<<8|d[r+1];return i<0?65536+i:i}function D(d,r){const i=U(d,r);return i<0?4294967296+i:i}function ut(d,r){let i=D(d,r);return i*=Math.pow(2,32),i+=D(d,r+4),i}function U(d,r){return d[r]<<24|d[r+1]<<16|d[r+2]<<8|d[r+3]}function he(d,r,i){d[r]=i>>24,d[r+1]=i>>16&255,d[r+2]=i>>8&255,d[r+3]=i&255}function Tr(d){const r=d.byteLength;for(let i=0;i<r;){const s=D(d,i);if(s>8&&d[i+4]===109&&d[i+5]===111&&d[i+6]===111&&d[i+7]===102)return!0;i=s>1?i+s:r}return!1}function Ee(d,r){const i=[];if(!r.length)return i;const s=d.byteLength;for(let o=0;o<s;){const u=D(d,o),h=Gt(d.subarray(o+4,o+8)),m=u>1?o+u:s;if(h===r[0])if(r.length===1)i.push(d.subarray(o+8,m));else{const _=Ee(d.subarray(o+8,m),r.slice(1));_.length&&St.apply(i,_)}o=m}return i}function Ue(d){const r=[],i=d[0];let s=8;const o=D(d,s);s+=4;let u=0,h=0;i===0?(u=D(d,s),h=D(d,s+4),s+=8):(u=ut(d,s),h=ut(d,s+8),s+=16),s+=2;let m=d.length+h;const _=k(d,s);s+=2;for(let w=0;w<_;w++){let E=s;const L=D(d,E);E+=4;const N=L&2147483647;if((L&2147483648)>>>31===1)return P.warn("SIDX has hierarchical references (not supported)"),null;const j=D(d,E);E+=4,r.push({referenceSize:N,subsegmentDuration:j,info:{duration:j/o,start:m,end:m+N-1}}),m+=N,E+=4,s=E}return{earliestPresentationTime:u,timescale:o,version:i,referencesCount:_,references:r}}function Ze(d){const r=[],i=Ee(d,["moov","trak"]);for(let o=0;o<i.length;o++){const u=i[o],h=Ee(u,["tkhd"])[0];if(h){let m=h[0];const _=D(h,m===0?12:20),w=Ee(u,["mdia","mdhd"])[0];if(w){m=w[0];const E=D(w,m===0?12:20),L=Ee(u,["mdia","hdlr"])[0];if(L){const N=Gt(L.subarray(8,12)),J={soun:ie.AUDIO,vide:ie.VIDEO}[N];if(J){const j=Ee(u,["mdia","minf","stbl","stsd"])[0],ne=G(j);r[_]={timescale:E,type:J},r[J]=Oe({timescale:E,id:_},ne)}}}}}return Ee(d,["moov","mvex","trex"]).forEach(o=>{const u=D(o,4),h=r[u];h&&(h.default={duration:D(o,12),flags:D(o,20)})}),r}function G(d){const r=d.subarray(8),i=r.subarray(86),s=Gt(r.subarray(4,8));let o=s;const u=s==="enca"||s==="encv";if(u){const m=Ee(r,[s])[0].subarray(s==="enca"?28:78);Ee(m,["sinf"]).forEach(w=>{const E=Ee(w,["schm"])[0];if(E){const L=Gt(E.subarray(4,8));if(L==="cbcs"||L==="cenc"){const N=Ee(w,["frma"])[0];N&&(o=Gt(N))}}})}switch(o){case"avc1":case"avc2":case"avc3":case"avc4":{const h=Ee(i,["avcC"])[0];o+="."+_e(h[1])+_e(h[2])+_e(h[3]);break}case"mp4a":{const h=Ee(r,[s])[0],m=Ee(h.subarray(28),["esds"])[0];if(m&&m.length>12){let _=4;if(m[_++]!==3)break;_=pe(m,_),_+=2;const w=m[_++];if(w&128&&(_+=2),w&64&&(_+=m[_++]),m[_++]!==4)break;_=pe(m,_);const E=m[_++];if(E===64)o+="."+_e(E);else break;if(_+=12,m[_++]!==5)break;_=pe(m,_);const L=m[_++];let N=(L&248)>>3;N===31&&(N+=1+((L&7)<<3)+((m[_]&224)>>5)),o+="."+N}break}case"hvc1":case"hev1":{const h=Ee(i,["hvcC"])[0],m=h[1],_=["","A","B","C"][m>>6],w=m&31,E=D(h,2),L=(m&32)>>5?"H":"L",N=h[12],J=h.subarray(6,12);o+="."+_+w,o+="."+E.toString(16).toUpperCase(),o+="."+L+N;let j="";for(let ne=J.length;ne--;){const de=J[ne];(de||j)&&(j="."+de.toString(16).toUpperCase()+j)}o+=j;break}case"dvh1":case"dvhe":{const h=Ee(i,["dvcC"])[0],m=h[2]>>1&127,_=h[2]<<5&32|h[3]>>3&31;o+="."+Ne(m)+"."+Ne(_);break}case"vp09":{const h=Ee(i,["vpcC"])[0],m=h[4],_=h[5],w=h[6]>>4&15;o+="."+Ne(m)+"."+Ne(_)+"."+Ne(w);break}case"av01":{const h=Ee(i,["av1C"])[0],m=h[1]>>>5,_=h[1]&31,w=h[2]>>>7?"H":"M",E=(h[2]&64)>>6,L=(h[2]&32)>>5,N=m===2&&E?L?12:10:E?10:8,J=(h[2]&16)>>4,j=(h[2]&8)>>3,ne=(h[2]&4)>>2,de=h[2]&3;o+="."+m+"."+Ne(_)+w+"."+Ne(N)+"."+J+"."+j+ne+de+"."+Ne(1)+"."+Ne(1)+"."+Ne(1)+"."+0;break}}return{codec:o,encrypted:u}}function pe(d,r){const i=r+5;for(;d[r++]&128&&r<i;);return r}function _e(d){return("0"+d.toString(16).toUpperCase()).slice(-2)}function Ne(d){return(d<10?"0":"")+d}function H(d,r){if(!d||!r)return d;const i=r.keyId;return i&&r.isCommonEncryption&&Ee(d,["moov","trak"]).forEach(o=>{const h=Ee(o,["mdia","minf","stbl","stsd"])[0].subarray(8);let m=Ee(h,["enca"]);const _=m.length>0;_||(m=Ee(h,["encv"])),m.forEach(w=>{const E=_?w.subarray(28):w.subarray(78);Ee(E,["sinf"]).forEach(N=>{const J=Vt(N);if(J){const j=J.subarray(8,24);j.some(ne=>ne!==0)||(P.log(`[eme] Patching keyId in 'enc${_?"a":"v"}>sinf>>tenc' box: ${qe.hexDump(j)} -> ${qe.hexDump(i)}`),J.set(i,8))}})})}),d}function Vt(d){const r=Ee(d,["schm"])[0];if(r){const i=Gt(r.subarray(4,8));if(i==="cbcs"||i==="cenc")return Ee(d,["schi","tenc"])[0]}return null}function Se(d,r){return Ee(r,["moof","traf"]).reduce((i,s)=>{const o=Ee(s,["tfdt"])[0],u=o[0],h=Ee(s,["tfhd"]).reduce((m,_)=>{const w=D(_,4),E=d[w];if(E){let L=D(o,4);if(u===1){if(L===Dt)return P.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),m;L*=Dt+1,L+=D(o,8)}const N=E.timescale||9e4,J=L/N;if(te(J)&&(m===null||J<m))return J}return m},null);return h!==null&&te(h)&&(i===null||h<i)?h:i},null)}function qt(d,r){let i=0,s=0,o=0;const u=Ee(d,["moof","traf"]);for(let h=0;h<u.length;h++){const m=u[h],_=Ee(m,["tfhd"])[0],w=D(_,4),E=r[w];if(!E)continue;const L=E.default,N=D(_,0)|(L==null?void 0:L.flags);let J=L==null?void 0:L.duration;N&8&&(N&2?J=D(_,12):J=D(_,8));const j=E.timescale||9e4,ne=Ee(m,["trun"]);for(let de=0;de<ne.length;de++){if(i=vr(ne[de]),!i&&J){const $e=D(ne[de],4);i=J*$e}E.type===ie.VIDEO?s+=i/j:E.type===ie.AUDIO&&(o+=i/j)}}if(s===0&&o===0){let h=1/0,m=0,_=0;const w=Ee(d,["sidx"]);for(let E=0;E<w.length;E++){const L=Ue(w[E]);if(L!=null&&L.references){h=Math.min(h,L.earliestPresentationTime/L.timescale);const N=L.references.reduce((J,j)=>J+j.info.duration||0,0);m=Math.max(m,N+L.earliestPresentationTime/L.timescale),_=m-h}}if(_&&te(_))return _}return s||o}function vr(d){const r=D(d,0);let i=8;r&1&&(i+=4),r&4&&(i+=4);let s=0;const o=D(d,4);for(let u=0;u<o;u++){if(r&256){const h=D(d,i);s+=h,i+=4}r&512&&(i+=4),r&1024&&(i+=4),r&2048&&(i+=4)}return s}function Xr(d,r,i){Ee(r,["moof","traf"]).forEach(s=>{Ee(s,["tfhd"]).forEach(o=>{const u=D(o,4),h=d[u];if(!h)return;const m=h.timescale||9e4;Ee(s,["tfdt"]).forEach(_=>{const w=_[0],E=i*m;if(E){let L=D(_,4);if(w===0)L-=E,L=Math.max(L,0),he(_,4,L);else{L*=Math.pow(2,32),L+=D(_,8),L-=E,L=Math.max(L,0);const N=Math.floor(L/(Dt+1)),J=Math.floor(L%(Dt+1));he(_,4,N),he(_,8,J)}}})})})}function An(d){const r={valid:null,remainder:null},i=Ee(d,["moof"]);if(i.length<2)return r.remainder=d,r;const s=i[i.length-1];return r.valid=We(d,0,s.byteOffset-8),r.remainder=We(d,s.byteOffset-8),r}function Kr(d,r){const i=new Uint8Array(d.length+r.length);return i.set(d),i.set(r,d.length),i}function yr(d,r){const i=[],s=r.samples,o=r.timescale,u=r.id;let h=!1;return Ee(s,["moof"]).map(_=>{const w=_.byteOffset-8;Ee(_,["traf"]).map(L=>{const N=Ee(L,["tfdt"]).map(J=>{const j=J[0];let ne=D(J,4);return j===1&&(ne*=Math.pow(2,32),ne+=D(J,8)),ne/o})[0];return N!==void 0&&(d=N),Ee(L,["tfhd"]).map(J=>{const j=D(J,4),ne=D(J,0)&16777215,de=(ne&1)!==0,$e=(ne&2)!==0,ct=(ne&8)!==0;let ht=0;const At=(ne&16)!==0;let yt=0;const Qt=(ne&32)!==0;let zt=8;j===u&&(de&&(zt+=8),$e&&(zt+=4),ct&&(ht=D(J,zt),zt+=4),At&&(yt=D(J,zt),zt+=4),Qt&&(zt+=4),r.type==="video"&&(h=gn(r.codec)),Ee(L,["trun"]).map(pr=>{const Or=pr[0],Zt=D(pr,0)&16777215,mr=(Zt&1)!==0;let un=0;const Wr=(Zt&4)!==0,Cn=(Zt&256)!==0;let kt=0;const Br=(Zt&512)!==0;let fi=0;const Bi=(Zt&1024)!==0,tn=(Zt&2048)!==0;let jr=0;const Qn=D(pr,4);let Pn=8;mr&&(un=D(pr,Pn),Pn+=4),Wr&&(Pn+=4);let Ei=un+w;for(let ys=0;ys<Qn;ys++){if(Cn?(kt=D(pr,Pn),Pn+=4):kt=ht,Br?(fi=D(pr,Pn),Pn+=4):fi=yt,Bi&&(Pn+=4),tn&&(Or===0?jr=D(pr,Pn):jr=U(pr,Pn),Pn+=4),r.type===ie.VIDEO){let As=0;for(;As<fi;){const ss=D(s,Ei);if(Ei+=4,fe(h,s[Ei])){const vi=s.subarray(Ei,Ei+ss);Ae(vi,h?2:1,d+jr/o,i)}Ei+=ss,As+=ss+4}}d+=kt/o}}))})})}),i}function gn(d){if(!d)return!1;const r=d.indexOf("."),i=r<0?d:d.substring(0,r);return i==="hvc1"||i==="hev1"||i==="dvh1"||i==="dvhe"}function fe(d,r){if(d){const i=r>>1&63;return i===39||i===40}else return(r&31)===6}function Ae(d,r,i,s){const o=Ct(d);let u=0;u+=r;let h=0,m=0,_=0;for(;u<o.length;){h=0;do{if(u>=o.length)break;_=o[u++],h+=_}while(_===255);m=0;do{if(u>=o.length)break;_=o[u++],m+=_}while(_===255);const w=o.length-u;let E=u;if(m<w)u+=m;else if(m>w){P.error(`Malformed SEI payload. ${m} is too small, only ${w} bytes left to parse.`);break}if(h===4){if(o[E++]===181){const N=k(o,E);if(E+=2,N===49){const J=D(o,E);if(E+=4,J===1195456820){const j=o[E++];if(j===3){const ne=o[E++],de=31&ne,$e=64&ne,ct=$e?2+de*3:0,ht=new Uint8Array(ct);if($e){ht[0]=ne;for(let At=1;At<ct;At++)ht[At]=o[E++]}s.push({type:j,payloadType:h,pts:i,bytes:ht})}}}}}else if(h===5&&m>16){const L=[];for(let j=0;j<16;j++){const ne=o[E++].toString(16);L.push(ne.length==1?"0"+ne:ne),(j===3||j===5||j===7||j===9)&&L.push("-")}const N=m-16,J=new Uint8Array(N);for(let j=0;j<N;j++)J[j]=o[E++];s.push({payloadType:h,pts:i,uuid:L.join(""),userData:cr(J),userDataBytes:J})}}}function Ct(d){const r=d.byteLength,i=[];let s=1;for(;s<r-2;)d[s]===0&&d[s+1]===0&&d[s+2]===3?(i.push(s+2),s+=2):s++;if(i.length===0)return d;const o=r-i.length,u=new Uint8Array(o);let h=0;for(s=0;s<o;h++,s++)h===i[0]&&(h++,i.shift()),u[s]=d[h];return u}function at(d){const r=d[0];let i="",s="",o=0,u=0,h=0,m=0,_=0,w=0;if(r===0){for(;Gt(d.subarray(w,w+1))!=="\0";)i+=Gt(d.subarray(w,w+1)),w+=1;for(i+=Gt(d.subarray(w,w+1)),w+=1;Gt(d.subarray(w,w+1))!=="\0";)s+=Gt(d.subarray(w,w+1)),w+=1;s+=Gt(d.subarray(w,w+1)),w+=1,o=D(d,12),u=D(d,16),m=D(d,20),_=D(d,24),w=28}else if(r===1){w+=4,o=D(d,w),w+=4;const L=D(d,w);w+=4;const N=D(d,w);for(w+=4,h=ro(2,32)*L+N,V(h)||(h=Number.MAX_SAFE_INTEGER,P.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),m=D(d,w),w+=4,_=D(d,w),w+=4;Gt(d.subarray(w,w+1))!=="\0";)i+=Gt(d.subarray(w,w+1)),w+=1;for(i+=Gt(d.subarray(w,w+1)),w+=1;Gt(d.subarray(w,w+1))!=="\0";)s+=Gt(d.subarray(w,w+1)),w+=1;s+=Gt(d.subarray(w,w+1)),w+=1}const E=d.subarray(w,d.byteLength);return{schemeIdUri:i,value:s,timeScale:o,presentationTime:h,presentationTimeDelta:u,eventDuration:m,id:_,payload:E}}function xt(d,...r){const i=r.length;let s=8,o=i;for(;o--;)s+=r[o].byteLength;const u=new Uint8Array(s);for(u[0]=s>>24&255,u[1]=s>>16&255,u[2]=s>>8&255,u[3]=s&255,u.set(d,4),o=0,s=8;o<i;o++)u.set(r[o],s),s+=r[o].byteLength;return u}function Ot(d,r,i){if(d.byteLength!==16)throw new RangeError("Invalid system id");let s,o;if(r){s=1,o=new Uint8Array(r.length*16);for(let m=0;m<r.length;m++){const _=r[m];if(_.byteLength!==16)throw new RangeError("Invalid key");o.set(_,m*16)}}else s=0,o=new Uint8Array;let u;s>0?(u=new Uint8Array(4),r.length>0&&new DataView(u.buffer).setUint32(0,r.length,!1)):u=new Uint8Array;const h=new Uint8Array(4);return i&&i.byteLength>0&&new DataView(h.buffer).setUint32(0,i.byteLength,!1),xt([112,115,115,104],new Uint8Array([s,0,0,0]),d,u,o,h,i||new Uint8Array)}function ir(d){const r=[];if(d instanceof ArrayBuffer){const i=d.byteLength;let s=0;for(;s+32<i;){const o=new DataView(d,s),u=Jt(o);r.push(u),s+=u.size}}return r}function Jt(d){const r=d.getUint32(0),i=d.byteOffset,s=d.byteLength;if(s<r)return{offset:i,size:s};if(d.getUint32(4)!==1886614376)return{offset:i,size:r};const u=d.getUint32(8)>>>24;if(u!==0&&u!==1)return{offset:i,size:r};const h=d.buffer,m=qe.hexDump(new Uint8Array(h,i+12,16)),_=d.getUint32(28);let w=null,E=null;if(u===0){if(r-32<_||_<22)return{offset:i,size:r};E=new Uint8Array(h,i+32,_)}else if(u===1){if(!_||s<i+32+_*16+16)return{offset:i,size:r};w=[];for(let L=0;L<_;L++)w.push(new Uint8Array(h,i+32+L*16,16))}return{version:u,systemId:m,kids:w,data:E,offset:i,size:r}}let xr={};class br{static clearKeyUriToKeyIdMap(){xr={}}constructor(r,i,s,o=[1],u=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=r,this.uri=i,this.keyFormat=s,this.keyFormatVersions=o,this.iv=u,this.encrypted=r?r!=="NONE":!1,this.isCommonEncryption=this.encrypted&&r!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case je.FAIRPLAY:case je.WIDEVINE:case je.PLAYREADY:case je.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(r){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof r!="number"&&(this.method==="AES-128"&&!this.iv&&P.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),r=0);const s=nn(r);return new br(this.method,this.uri,"identity",this.keyFormatVersions,s)}const i=we(this.uri);if(i)switch(this.keyFormat){case je.WIDEVINE:this.pssh=i,i.length>=22&&(this.keyId=i.subarray(i.length-22,i.length-6));break;case je.PLAYREADY:{const s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Ot(s,null,i),this.keyId=zr(i);break}default:{let s=i.subarray(0,16);if(s.length!==16){const o=new Uint8Array(16);o.set(s,16-s.length),s=o}this.keyId=s;break}}if(!this.keyId||this.keyId.byteLength!==16){let s=xr[this.uri];if(!s){const o=Object.keys(xr).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16),new DataView(s.buffer,12,4).setUint32(0,o),xr[this.uri]=s}this.keyId=s}return this}}function nn(d){const r=new Uint8Array(16);for(let i=12;i<16;i++)r[i]=d>>8*(15-i)&255;return r}const kr=/\{\$([a-zA-Z0-9-_]+)\}/g;function Fr(d){return kr.test(d)}function $r(d,r,i){if(d.variableList!==null||d.hasVariableRefs)for(let s=i.length;s--;){const o=i[s],u=r[o];u&&(r[o]=pn(d,u))}}function pn(d,r){if(d.variableList!==null||d.hasVariableRefs){const i=d.variableList;return r.replace(kr,s=>{const o=s.substring(2,s.length-1),u=i==null?void 0:i[o];return u===void 0?(d.playlistParsingError||(d.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${o}"`)),s):u})}return r}function Mn(d,r,i){let s=d.variableList;s||(d.variableList=s={});let o,u;if("QUERYPARAM"in r){o=r.QUERYPARAM;try{const h=new self.URL(i).searchParams;if(h.has(o))u=h.get(o);else throw new Error(`"${o}" does not match any query parameter in URI: "${i}"`)}catch(h){d.playlistParsingError||(d.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${h.message}`))}}else o=r.NAME,u=r.VALUE;o in s?d.playlistParsingError||(d.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${o}"`)):s[o]=u||""}function mn(d,r,i){const s=r.IMPORT;if(i&&s in i){let o=d.variableList;o||(d.variableList=o={}),o[s]=i[s]}else d.playlistParsingError||(d.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}function dn(d=!0){return typeof self=="undefined"?void 0:(d||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function $n(d){return typeof self!="undefined"&&d===self.ManagedMediaSource}const rn={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Lr(d,r){const i=rn[r];return!!i&&!!i[d.slice(0,4)]}function nt(d,r,i=!0){return!d.split(",").some(s=>!Qe(s,r,i))}function Qe(d,r,i=!0){var s;const o=dn(i);return(s=o==null?void 0:o.isTypeSupported(bt(d,r)))!=null?s:!1}function bt(d,r){return`${r}/mp4;codecs="${d}"`}function Rt(d){if(d){const r=d.substring(0,4);return rn.video[r]}return 2}function lt(d){return d.split(",").reduce((r,i)=>{const s=rn.video[i];return s?(s*2+r)/(r?3:2):(rn.audio[i]+r)/(r?2:1)},0)}const Nt={};function Ft(d,r=!0){if(Nt[d])return Nt[d];const i={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[d];for(let s=0;s<i.length;s++)if(Qe(i[s],"audio",r))return Nt[d]=i[s],i[s];return d}const or=/flac|opus/i;function _r(d,r=!0){return d.replace(or,i=>Ft(i.toLowerCase(),r))}function fr(d,r){return d&&d!=="mp4a"?d:r&&r.split(",")[0]}function Qr(d){const r=d.split(",");for(let i=0;i<r.length;i++){const s=r[i].split(".");if(s.length>2){let o=s.shift()+".";o+=parseInt(s.shift()).toString(16),o+=("000"+parseInt(s.shift()).toString(16)).slice(-4),r[i]=o}}return r.join(",")}const on=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,fn=/#EXT-X-MEDIA:(.*)/g,Mr=/^#EXT(?:INF|-X-TARGETDURATION):/m,wr=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),_n=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class ln{static findGroup(r,i){for(let s=0;s<r.length;s++){const o=r[s];if(o.id===i)return o}}static resolve(r,i){return Xe.buildAbsoluteURL(i,r,{alwaysNormalize:!0})}static isMediaPlaylist(r){return Mr.test(r)}static parseMasterPlaylist(r,i){const s=Fr(r),o={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:s},u=[];on.lastIndex=0;let h;for(;(h=on.exec(r))!=null;)if(h[1]){var m;const w=new ye(h[1]);$r(o,w,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const E=pn(o,h[2]),L={attrs:w,bitrate:w.decimalInteger("BANDWIDTH")||w.decimalInteger("AVERAGE-BANDWIDTH"),name:w.NAME,url:ln.resolve(E,i)},N=w.decimalResolution("RESOLUTION");N&&(L.width=N.width,L.height=N.height),sn(w.CODECS,L),(m=L.unknownCodecs)!=null&&m.length||u.push(L),o.levels.push(L)}else if(h[3]){const w=h[3],E=h[4];switch(w){case"SESSION-DATA":{const L=new ye(E);$r(o,L,["DATA-ID","LANGUAGE","VALUE","URI"]);const N=L["DATA-ID"];N&&(o.sessionData===null&&(o.sessionData={}),o.sessionData[N]=L);break}case"SESSION-KEY":{const L=qr(E,i,o);L.encrypted&&L.isSupported()?(o.sessionKeys===null&&(o.sessionKeys=[]),o.sessionKeys.push(L)):P.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${E}"`);break}case"DEFINE":{{const L=new ye(E);$r(o,L,["NAME","VALUE","QUERYPARAM"]),Mn(o,L,i)}break}case"CONTENT-STEERING":{const L=new ye(E);$r(o,L,["SERVER-URI","PATHWAY-ID"]),o.contentSteering={uri:ln.resolve(L["SERVER-URI"],i),pathwayId:L["PATHWAY-ID"]||"."};break}case"START":{o.startTimeOffset=Jr(E);break}}}const _=u.length>0&&u.length<o.levels.length;return o.levels=_?u:o.levels,o.levels.length===0&&(o.playlistParsingError=new Error("no levels found in manifest")),o}static parseMasterPlaylistMedia(r,i,s){let o;const u={},h=s.levels,m={AUDIO:h.map(w=>({id:w.attrs.AUDIO,audioCodec:w.audioCodec})),SUBTITLES:h.map(w=>({id:w.attrs.SUBTITLES,textCodec:w.textCodec})),"CLOSED-CAPTIONS":[]};let _=0;for(fn.lastIndex=0;(o=fn.exec(r))!==null;){const w=new ye(o[1]),E=w.TYPE;if(E){const L=m[E],N=u[E]||[];u[E]=N,$r(s,w,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const J=w.LANGUAGE,j=w["ASSOC-LANGUAGE"],ne=w.CHANNELS,de=w.CHARACTERISTICS,$e=w["INSTREAM-ID"],ct={attrs:w,bitrate:0,id:_++,groupId:w["GROUP-ID"]||"",name:w.NAME||J||"",type:E,default:w.bool("DEFAULT"),autoselect:w.bool("AUTOSELECT"),forced:w.bool("FORCED"),lang:J,url:w.URI?ln.resolve(w.URI,i):""};if(j&&(ct.assocLang=j),ne&&(ct.channels=ne),de&&(ct.characteristics=de),$e&&(ct.instreamId=$e),L!=null&&L.length){const ht=ln.findGroup(L,ct.groupId)||L[0];en(ct,ht,"audioCodec"),en(ct,ht,"textCodec")}N.push(ct)}}return u}static parseLevelPlaylist(r,i,s,o,u,h){const m=new xe(i),_=m.fragments;let w=null,E=0,L=0,N=0,J=0,j=null,ne=new ue(o,i),de,$e,ct,ht=-1,At=!1,yt=null;for(wr.lastIndex=0,m.m3u8=r,m.hasVariableRefs=Fr(r);(de=wr.exec(r))!==null;){At&&(At=!1,ne=new ue(o,i),ne.start=N,ne.sn=E,ne.cc=J,ne.level=s,w&&(ne.initSegment=w,ne.rawProgramDateTime=w.rawProgramDateTime,w.rawProgramDateTime=null,yt&&(ne.setByteRange(yt),yt=null)));const Or=de[1];if(Or){ne.duration=parseFloat(Or);const Zt=(" "+de[2]).slice(1);ne.title=Zt||null,ne.tagList.push(Zt?["INF",Or,Zt]:["INF",Or])}else if(de[3]){if(te(ne.duration)){ne.start=N,ct&&xn(ne,ct,m),ne.sn=E,ne.level=s,ne.cc=J,_.push(ne);const Zt=(" "+de[3]).slice(1);ne.relurl=pn(m,Zt),cn(ne,j),j=ne,N+=ne.duration,E++,L=0,At=!0}}else if(de[4]){const Zt=(" "+de[4]).slice(1);j?ne.setByteRange(Zt,j):ne.setByteRange(Zt)}else if(de[5])ne.rawProgramDateTime=(" "+de[5]).slice(1),ne.tagList.push(["PROGRAM-DATE-TIME",ne.rawProgramDateTime]),ht===-1&&(ht=_.length);else{if(de=de[0].match(_n),!de){P.warn("No matches on slow regex match for level playlist!");continue}for($e=1;$e<de.length&&typeof de[$e]=="undefined";$e++);const Zt=(" "+de[$e]).slice(1),mr=(" "+de[$e+1]).slice(1),un=de[$e+2]?(" "+de[$e+2]).slice(1):"";switch(Zt){case"PLAYLIST-TYPE":m.type=mr.toUpperCase();break;case"MEDIA-SEQUENCE":E=m.startSN=parseInt(mr);break;case"SKIP":{const Wr=new ye(mr);$r(m,Wr,["RECENTLY-REMOVED-DATERANGES"]);const Cn=Wr.decimalInteger("SKIPPED-SEGMENTS");if(te(Cn)){m.skippedSegments=Cn;for(let Br=Cn;Br--;)_.unshift(null);E+=Cn}const kt=Wr.enumeratedString("RECENTLY-REMOVED-DATERANGES");kt&&(m.recentlyRemovedDateranges=kt.split(" "));break}case"TARGETDURATION":m.targetduration=Math.max(parseInt(mr),1);break;case"VERSION":m.version=parseInt(mr);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":m.live=!1;break;case"#":(mr||un)&&ne.tagList.push(un?[mr,un]:[mr]);break;case"DISCONTINUITY":J++,ne.tagList.push(["DIS"]);break;case"GAP":ne.gap=!0,ne.tagList.push([Zt]);break;case"BITRATE":ne.tagList.push([Zt,mr]);break;case"DATERANGE":{const Wr=new ye(mr);$r(m,Wr,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),$r(m,Wr,Wr.clientAttrs);const Cn=new st(Wr,m.dateRanges[Wr.ID]);Cn.isValid||m.skippedSegments?m.dateRanges[Cn.id]=Cn:P.warn(`Ignoring invalid DATERANGE tag: "${mr}"`),ne.tagList.push(["EXT-X-DATERANGE",mr]);break}case"DEFINE":{{const Wr=new ye(mr);$r(m,Wr,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in Wr?mn(m,Wr,h):Mn(m,Wr,i)}break}case"DISCONTINUITY-SEQUENCE":J=parseInt(mr);break;case"KEY":{const Wr=qr(mr,i,m);if(Wr.isSupported()){if(Wr.method==="NONE"){ct=void 0;break}ct||(ct={}),ct[Wr.keyFormat]&&(ct=c({},ct)),ct[Wr.keyFormat]=Wr}else P.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${mr}"`);break}case"START":m.startTimeOffset=Jr(mr);break;case"MAP":{const Wr=new ye(mr);if($r(m,Wr,["BYTERANGE","URI"]),ne.duration){const Cn=new ue(o,i);Ln(Cn,Wr,s,ct),w=Cn,ne.initSegment=w,w.rawProgramDateTime&&!ne.rawProgramDateTime&&(ne.rawProgramDateTime=w.rawProgramDateTime)}else{const Cn=ne.byteRangeEndOffset;if(Cn){const kt=ne.byteRangeStartOffset;yt=`${Cn-kt}@${kt}`}else yt=null;Ln(ne,Wr,s,ct),w=ne,At=!0}break}case"SERVER-CONTROL":{const Wr=new ye(mr);m.canBlockReload=Wr.bool("CAN-BLOCK-RELOAD"),m.canSkipUntil=Wr.optionalFloat("CAN-SKIP-UNTIL",0),m.canSkipDateRanges=m.canSkipUntil>0&&Wr.bool("CAN-SKIP-DATERANGES"),m.partHoldBack=Wr.optionalFloat("PART-HOLD-BACK",0),m.holdBack=Wr.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const Wr=new ye(mr);m.partTarget=Wr.decimalFloatingPoint("PART-TARGET");break}case"PART":{let Wr=m.partList;Wr||(Wr=m.partList=[]);const Cn=L>0?Wr[Wr.length-1]:void 0,kt=L++,Br=new ye(mr);$r(m,Br,["BYTERANGE","URI"]);const fi=new ce(Br,ne,i,kt,Cn);Wr.push(fi),ne.duration+=fi.duration;break}case"PRELOAD-HINT":{const Wr=new ye(mr);$r(m,Wr,["URI"]),m.preloadHint=Wr;break}case"RENDITION-REPORT":{const Wr=new ye(mr);$r(m,Wr,["URI"]),m.renditionReports=m.renditionReports||[],m.renditionReports.push(Wr);break}default:P.warn(`line parsed but not handled: ${de}`);break}}}j&&!j.relurl?(_.pop(),N-=j.duration,m.partList&&(m.fragmentHint=j)):m.partList&&(cn(ne,j),ne.cc=J,m.fragmentHint=ne,ct&&xn(ne,ct,m));const Qt=_.length,zt=_[0],pr=_[Qt-1];if(N+=m.skippedSegments*m.targetduration,N>0&&Qt&&pr){m.averagetargetduration=N/Qt;const Or=pr.sn;m.endSN=Or!=="initSegment"?Or:0,m.live||(pr.endList=!0),zt&&(m.startCC=zt.cc)}else m.endSN=0,m.startCC=0;return m.fragmentHint&&(N+=m.fragmentHint.duration),m.totalduration=N,m.endCC=J,ht>0&&Ur(_,ht),m}}function qr(d,r,i){var s,o;const u=new ye(d);$r(i,u,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const h=(s=u.METHOD)!=null?s:"",m=u.URI,_=u.hexadecimalInteger("IV"),w=u.KEYFORMATVERSIONS,E=(o=u.KEYFORMAT)!=null?o:"identity";m&&u.IV&&!_&&P.error(`Invalid IV: ${u.IV}`);const L=m?ln.resolve(m,r):"",N=(w||"1").split("/").map(Number).filter(Number.isFinite);return new br(h,L,E,N,_)}function Jr(d){const i=new ye(d).decimalFloatingPoint("TIME-OFFSET");return te(i)?i:null}function sn(d,r){let i=(d||"").split(/[ ,]+/).filter(s=>s);["video","audio","text"].forEach(s=>{const o=i.filter(u=>Lr(u,s));o.length&&(r[`${s}Codec`]=o.join(","),i=i.filter(u=>o.indexOf(u)===-1))}),r.unknownCodecs=i}function en(d,r,i){const s=r[i];s&&(d[i]=s)}function Ur(d,r){let i=d[r];for(let s=r;s--;){const o=d[s];if(!o)return;o.programDateTime=i.programDateTime-o.duration*1e3,i=o}}function cn(d,r){d.rawProgramDateTime?d.programDateTime=Date.parse(d.rawProgramDateTime):r!=null&&r.programDateTime&&(d.programDateTime=r.endProgramDateTime),te(d.programDateTime)||(d.programDateTime=null,d.rawProgramDateTime=null)}function Ln(d,r,i,s){d.relurl=r.URI,r.BYTERANGE&&d.setByteRange(r.BYTERANGE),d.level=i,d.sn="initSegment",s&&(d.levelkeys=s),d.initSegment=null}function xn(d,r,i){d.levelkeys=r;const{encryptedFragments:s}=i;(!s.length||s[s.length-1].levelkeys!==r)&&Object.keys(r).some(o=>r[o].isCommonEncryption)&&s.push(d)}var sr={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Ie={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function lr(d){const{type:r}=d;switch(r){case sr.AUDIO_TRACK:return Ie.AUDIO;case sr.SUBTITLE_TRACK:return Ie.SUBTITLE;default:return Ie.MAIN}}function gr(d,r){let i=d.url;return(i===void 0||i.indexOf("data:")===0)&&(i=r.url),i}class yn{constructor(r){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=r,this.registerListeners()}startLoad(r){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:r}=this;r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.LEVEL_LOADING,this.onLevelLoading,this),r.on(b.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(b.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:r}=this;r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.LEVEL_LOADING,this.onLevelLoading,this),r.off(b.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(b.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(r){const i=this.hls.config,s=i.pLoader,o=i.loader,u=s||o,h=new u(i);return this.loaders[r.type]=h,h}getInternalLoader(r){return this.loaders[r.type]}resetInternalLoader(r){this.loaders[r]&&delete this.loaders[r]}destroyInternalLoaders(){for(const r in this.loaders){const i=this.loaders[r];i&&i.destroy(),this.resetInternalLoader(r)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(r,i){const{url:s}=i;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:sr.MANIFEST,url:s,deliveryDirectives:null})}onLevelLoading(r,i){const{id:s,level:o,pathwayId:u,url:h,deliveryDirectives:m}=i;this.load({id:s,level:o,pathwayId:u,responseType:"text",type:sr.LEVEL,url:h,deliveryDirectives:m})}onAudioTrackLoading(r,i){const{id:s,groupId:o,url:u,deliveryDirectives:h}=i;this.load({id:s,groupId:o,level:null,responseType:"text",type:sr.AUDIO_TRACK,url:u,deliveryDirectives:h})}onSubtitleTrackLoading(r,i){const{id:s,groupId:o,url:u,deliveryDirectives:h}=i;this.load({id:s,groupId:o,level:null,responseType:"text",type:sr.SUBTITLE_TRACK,url:u,deliveryDirectives:h})}load(r){var i;const s=this.hls.config;let o=this.getInternalLoader(r);if(o){const w=o.context;if(w&&w.url===r.url&&w.level===r.level){P.trace("[playlist-loader]: playlist request ongoing");return}P.log(`[playlist-loader]: aborting previous loader for type: ${r.type}`),o.abort()}let u;if(r.type===sr.MANIFEST?u=s.manifestLoadPolicy.default:u=c({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),o=this.createInternalLoader(r),te((i=r.deliveryDirectives)==null?void 0:i.part)){let w;if(r.type===sr.LEVEL&&r.level!==null?w=this.hls.levels[r.level].details:r.type===sr.AUDIO_TRACK&&r.id!==null?w=this.hls.audioTracks[r.id].details:r.type===sr.SUBTITLE_TRACK&&r.id!==null&&(w=this.hls.subtitleTracks[r.id].details),w){const E=w.partTarget,L=w.targetduration;if(E&&L){const N=Math.max(E*3,L*.8)*1e3;u=c({},u,{maxTimeToFirstByteMs:Math.min(N,u.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(N,u.maxTimeToFirstByteMs)})}}}const h=u.errorRetry||u.timeoutRetry||{},m={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:h.maxNumRetry||0,retryDelay:h.retryDelayMs||0,maxRetryDelay:h.maxRetryDelayMs||0},_={onSuccess:(w,E,L,N)=>{const J=this.getInternalLoader(L);this.resetInternalLoader(L.type);const j=w.data;if(j.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(w,L,new Error("no EXTM3U delimiter"),N||null,E);return}E.parsing.start=performance.now(),ln.isMediaPlaylist(j)?this.handleTrackOrLevelPlaylist(w,E,L,N||null,J):this.handleMasterPlaylist(w,E,L,N)},onError:(w,E,L,N)=>{this.handleNetworkError(E,L,!1,w,N)},onTimeout:(w,E,L)=>{this.handleNetworkError(E,L,!0,void 0,w)}};o.load(r,m,_)}handleMasterPlaylist(r,i,s,o){const u=this.hls,h=r.data,m=gr(r,s),_=ln.parseMasterPlaylist(h,m);if(_.playlistParsingError){this.handleManifestParsingError(r,s,_.playlistParsingError,o,i);return}const{contentSteering:w,levels:E,sessionData:L,sessionKeys:N,startTimeOffset:J,variableList:j}=_;this.variableList=j;const{AUDIO:ne=[],SUBTITLES:de,"CLOSED-CAPTIONS":$e}=ln.parseMasterPlaylistMedia(h,m,_);ne.length&&!ne.some(ht=>!ht.url)&&E[0].audioCodec&&!E[0].attrs.AUDIO&&(P.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),ne.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ye({}),bitrate:0,url:""})),u.trigger(b.MANIFEST_LOADED,{levels:E,audioTracks:ne,subtitles:de,captions:$e,contentSteering:w,url:m,stats:i,networkDetails:o,sessionData:L,sessionKeys:N,startTimeOffset:J,variableList:j})}handleTrackOrLevelPlaylist(r,i,s,o,u){const h=this.hls,{id:m,level:_,type:w}=s,E=gr(r,s),L=0,N=te(_)?_:te(m)?m:0,J=lr(s),j=ln.parseLevelPlaylist(r.data,E,N,J,L,this.variableList);if(w===sr.MANIFEST){const ne={attrs:new ye({}),bitrate:0,details:j,name:"",url:E};h.trigger(b.MANIFEST_LOADED,{levels:[ne],audioTracks:[],url:E,stats:i,networkDetails:o,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}i.parsing.end=performance.now(),s.levelDetails=j,this.handlePlaylistLoaded(j,r,i,s,o,u)}handleManifestParsingError(r,i,s,o,u){this.hls.trigger(b.ERROR,{type:M.NETWORK_ERROR,details:I.MANIFEST_PARSING_ERROR,fatal:i.type===sr.MANIFEST,url:r.url,err:s,error:s,reason:s.message,response:r,context:i,networkDetails:o,stats:u})}handleNetworkError(r,i,s=!1,o,u){let h=`A network ${s?"timeout":"error"+(o?" (status "+o.code+")":"")} occurred while loading ${r.type}`;r.type===sr.LEVEL?h+=`: ${r.level} id: ${r.id}`:(r.type===sr.AUDIO_TRACK||r.type===sr.SUBTITLE_TRACK)&&(h+=` id: ${r.id} group-id: "${r.groupId}"`);const m=new Error(h);P.warn(`[playlist-loader]: ${h}`);let _=I.UNKNOWN,w=!1;const E=this.getInternalLoader(r);switch(r.type){case sr.MANIFEST:_=s?I.MANIFEST_LOAD_TIMEOUT:I.MANIFEST_LOAD_ERROR,w=!0;break;case sr.LEVEL:_=s?I.LEVEL_LOAD_TIMEOUT:I.LEVEL_LOAD_ERROR,w=!1;break;case sr.AUDIO_TRACK:_=s?I.AUDIO_TRACK_LOAD_TIMEOUT:I.AUDIO_TRACK_LOAD_ERROR,w=!1;break;case sr.SUBTITLE_TRACK:_=s?I.SUBTITLE_TRACK_LOAD_TIMEOUT:I.SUBTITLE_LOAD_ERROR,w=!1;break}E&&this.resetInternalLoader(r.type);const L={type:M.NETWORK_ERROR,details:_,fatal:w,url:r.url,loader:E,context:r,error:m,networkDetails:i,stats:u};if(o){const N=(i==null?void 0:i.url)||r.url;L.response=Oe({url:N,data:void 0},o)}this.hls.trigger(b.ERROR,L)}handlePlaylistLoaded(r,i,s,o,u,h){const m=this.hls,{type:_,level:w,id:E,groupId:L,deliveryDirectives:N}=o,J=gr(i,o),j=lr(o),ne=typeof o.level=="number"&&j===Ie.MAIN?w:void 0;if(!r.fragments.length){const $e=new Error("No Segments found in Playlist");m.trigger(b.ERROR,{type:M.NETWORK_ERROR,details:I.LEVEL_EMPTY_ERROR,fatal:!1,url:J,error:$e,reason:$e.message,response:i,context:o,level:ne,parent:j,networkDetails:u,stats:s});return}r.targetduration||(r.playlistParsingError=new Error("Missing Target Duration"));const de=r.playlistParsingError;if(de){m.trigger(b.ERROR,{type:M.NETWORK_ERROR,details:I.LEVEL_PARSING_ERROR,fatal:!1,url:J,error:de,reason:de.message,response:i,context:o,level:ne,parent:j,networkDetails:u,stats:s});return}switch(r.live&&h&&(h.getCacheAge&&(r.ageHeader=h.getCacheAge()||0),(!h.getCacheAge||isNaN(r.ageHeader))&&(r.ageHeader=0)),_){case sr.MANIFEST:case sr.LEVEL:m.trigger(b.LEVEL_LOADED,{details:r,level:ne||0,id:E||0,stats:s,networkDetails:u,deliveryDirectives:N});break;case sr.AUDIO_TRACK:m.trigger(b.AUDIO_TRACK_LOADED,{details:r,id:E||0,groupId:L||"",stats:s,networkDetails:u,deliveryDirectives:N});break;case sr.SUBTITLE_TRACK:m.trigger(b.SUBTITLE_TRACK_LOADED,{details:r,id:E||0,groupId:L||"",stats:s,networkDetails:u,deliveryDirectives:N});break}}}function Yn(d,r){let i;try{i=new Event("addtrack")}catch(s){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=d,r.dispatchEvent(i)}function vn(d,r){const i=d.mode;if(i==="disabled"&&(d.mode="hidden"),d.cues&&!d.cues.getCueById(r.id))try{if(d.addCue(r),!d.cues.getCueById(r.id))throw new Error(`addCue is failed for: ${r}`)}catch(s){P.debug(`[texttrack-utils]: ${s}`);try{const o=new self.TextTrackCue(r.startTime,r.endTime,r.text);o.id=r.id,d.addCue(o)}catch(o){P.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${o}`)}}i==="disabled"&&(d.mode=i)}function Rn(d){const r=d.mode;if(r==="disabled"&&(d.mode="hidden"),d.cues)for(let i=d.cues.length;i--;)d.removeCue(d.cues[i]);r==="disabled"&&(d.mode=r)}function Zr(d,r,i,s){const o=d.mode;if(o==="disabled"&&(d.mode="hidden"),d.cues&&d.cues.length>0){const u=pi(d.cues,r,i);for(let h=0;h<u.length;h++)(!s||s(u[h]))&&d.removeCue(u[h])}o==="disabled"&&(d.mode=o)}function ai(d,r){if(r<d[0].startTime)return 0;const i=d.length-1;if(r>d[i].endTime)return-1;let s=0,o=i;for(;s<=o;){const u=Math.floor((o+s)/2);if(r<d[u].startTime)o=u-1;else if(r>d[u].startTime&&s<i)s=u+1;else return u}return d[s].startTime-r<r-d[o].startTime?s:o}function pi(d,r,i){const s=[],o=ai(d,r);if(o>-1)for(let u=o,h=d.length;u<h;u++){const m=d[u];if(m.startTime>=r&&m.endTime<=i)s.push(m);else if(m.startTime>i)return s}return s}function In(d){const r=[];for(let i=0;i<d.length;i++){const s=d[i];(s.kind==="subtitles"||s.kind==="captions")&&s.label&&r.push(d[i])}return r}var ni={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const qi=.25;function Ti(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Zi(d,r,i,s,o){let u=new d(r,i,"");try{u.value=s,o&&(u.type=o)}catch(h){u=new d(r,i,JSON.stringify(o?Oe({type:o},s):s))}return u}const Ar=(()=>{const d=Ti();try{d&&new d(0,Number.POSITIVE_INFINITY,"")}catch(r){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function bn(d,r){return d.getTime()/1e3-r}function zn(d){return Uint8Array.from(d.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Vn{constructor(r){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=r,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:r}=this;r.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),r.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(b.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:r}=this;r.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),r.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(b.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(r,i){this.media=i.media}onMediaDetaching(){this.id3Track&&(Rn(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(r){const i=this.getID3Track(r.textTracks);return i.mode="hidden",i}getID3Track(r){if(this.media){for(let i=0;i<r.length;i++){const s=r[i];if(s.kind==="metadata"&&s.label==="id3")return Yn(s,this.media),s}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(r,i){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:s,enableID3MetadataCues:o}}}=this;if(!s&&!o)return;const{samples:u}=i;this.id3Track||(this.id3Track=this.createTrack(this.media));const h=Ti();if(h)for(let m=0;m<u.length;m++){const _=u[m].type;if(_===ni.emsg&&!s||!o)continue;const w=vt(u[m].data);if(w){const E=u[m].pts;let L=E+u[m].duration;L>Ar&&(L=Ar),L-E<=0&&(L=E+qi);for(let J=0;J<w.length;J++){const j=w[J];if(!et(j)){this.updateId3CueEnds(E,_);const ne=Zi(h,E,L,j,_);ne&&this.id3Track.addCue(ne)}}}}}updateId3CueEnds(r,i){var s;const o=(s=this.id3Track)==null?void 0:s.cues;if(o)for(let u=o.length;u--;){const h=o[u];h.type===i&&h.startTime<r&&h.endTime===Ar&&(h.endTime=r)}}onBufferFlushing(r,{startOffset:i,endOffset:s,type:o}){const{id3Track:u,hls:h}=this;if(!h)return;const{config:{enableEmsgMetadataCues:m,enableID3MetadataCues:_}}=h;if(u&&(m||_)){let w;o==="audio"?w=E=>E.type===ni.audioId3&&_:o==="video"?w=E=>E.type===ni.emsg&&m:w=E=>E.type===ni.audioId3&&_||E.type===ni.emsg&&m,Zr(u,i,s,w)}}onLevelUpdated(r,{details:i}){if(!this.media||!i.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:s,id3Track:o}=this,{dateRanges:u}=i,h=Object.keys(u);if(o){const E=Object.keys(s).filter(L=>!h.includes(L));for(let L=E.length;L--;){const N=E[L];Object.keys(s[N].cues).forEach(J=>{o.removeCue(s[N].cues[J])}),delete s[N]}}const m=i.fragments[i.fragments.length-1];if(h.length===0||!te(m==null?void 0:m.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const _=m.programDateTime/1e3-m.start,w=Ti();for(let E=0;E<h.length;E++){const L=h[E],N=u[L],J=bn(N.startDate,_),j=s[L],ne=(j==null?void 0:j.cues)||{};let de=(j==null?void 0:j.durationKnown)||!1,$e=Ar;const ct=N.endDate;if(ct)$e=bn(ct,_),de=!0;else if(N.endOnNext&&!de){const At=h.reduce((yt,Qt)=>{if(Qt!==N.id){const zt=u[Qt];if(zt.class===N.class&&zt.startDate>N.startDate&&(!yt||N.startDate<yt.startDate))return zt}return yt},null);At&&($e=bn(At.startDate,_),de=!0)}const ht=Object.keys(N.attr);for(let At=0;At<ht.length;At++){const yt=ht[At];if(!Je(yt))continue;const Qt=ne[yt];if(Qt)de&&!j.durationKnown&&(Qt.endTime=$e);else if(w){let zt=N.attr[yt];Ve(yt)&&(zt=zn(zt));const pr=Zi(w,J,$e,{key:yt,data:zt},ni.dateRange);pr&&(pr.id=L,this.id3Track.addCue(pr),ne[yt]=pr)}}s[L]={cues:ne,dateRange:N,durationKnown:de}}}}class Gi{constructor(r){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=r,this.config=r.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:r,levelDetails:i}=this;return r.liveMaxLatencyDuration!==void 0?r.liveMaxLatencyDuration:i?r.liveMaxLatencyDurationCount*i.targetduration:0}get targetLatency(){const{levelDetails:r}=this;if(r===null)return null;const{holdBack:i,partHoldBack:s,targetduration:o}=r,{liveSyncDuration:u,liveSyncDurationCount:h,lowLatencyMode:m}=this.config,_=this.hls.userConfig;let w=m&&s||i;(_.liveSyncDuration||_.liveSyncDurationCount||w===0)&&(w=u!==void 0?u:h*o);const E=o;return w+Math.min(this.stallCount*1,E)}get liveSyncPosition(){const r=this.estimateLiveEdge(),i=this.targetLatency,s=this.levelDetails;if(r===null||i===null||s===null)return null;const o=s.edge,u=r-i-this.edgeStalled,h=o-s.totalduration,m=o-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(h,u),m)}get drift(){const{levelDetails:r}=this;return r===null?1:r.drift}get edgeStalled(){const{levelDetails:r}=this;if(r===null)return 0;const i=(this.config.lowLatencyMode&&r.partTarget||r.targetduration)*3;return Math.max(r.age-i,0)}get forwardBufferLength(){const{media:r,levelDetails:i}=this;if(!r||!i)return 0;const s=r.buffered.length;return(s?r.buffered.end(s-1):i.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(b.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(b.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(b.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(b.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(b.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(b.ERROR,this.onError,this)}onMediaAttached(r,i){this.media=i.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(r,{details:i}){this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(r,i){var s;i.details===I.BUFFER_STALLED_ERROR&&(this.stallCount++,(s=this.levelDetails)!=null&&s.live&&P.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:r,levelDetails:i}=this;if(!r||!i)return;this.currentTime=r.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:o,maxLiveSyncPlaybackRate:u}=this.config;if(!o||u===1||!i.live)return;const h=this.targetLatency;if(h===null)return;const m=s-h,_=Math.min(this.maxLatency,h+i.targetduration);if(m<_&&m>.05&&this.forwardBufferLength>1){const E=Math.min(2,Math.max(1,u)),L=Math.round(2/(1+Math.exp(-.75*m-this.edgeStalled))*20)/20;r.playbackRate=Math.min(E,Math.max(1,L))}else r.playbackRate!==1&&r.playbackRate!==0&&(r.playbackRate=1)}estimateLiveEdge(){const{levelDetails:r}=this;return r===null?null:r.edge+r.age}computeLatency(){const r=this.estimateLiveEdge();return r===null?null:r-this.currentTime}}const Vi=["NONE","TYPE-0","TYPE-1",null];function ei(d){return Vi.indexOf(d)>-1}const Ci=["SDR","PQ","HLG"];function Wn(d){return!!d&&Ci.indexOf(d)>-1}var Wi={No:"",Yes:"YES",v2:"v2"};function ui(d){const{canSkipUntil:r,canSkipDateRanges:i,age:s}=d,o=s<r/2;return r&&o?i?Wi.v2:Wi.Yes:Wi.No}class Ji{constructor(r,i,s){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=r,this.part=i,this.skip=s}addDirectives(r){const i=new self.URL(r);return this.msn!==void 0&&i.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&i.searchParams.set("_HLS_part",this.part.toString()),this.skip&&i.searchParams.set("_HLS_skip",this.skip),i.href}}class Di{constructor(r){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[r.url],this._attrs=[r.attrs],this.bitrate=r.bitrate,r.details&&(this.details=r.details),this.id=r.id||0,this.name=r.name,this.width=r.width||0,this.height=r.height||0,this.frameRate=r.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=r.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=r.audioCodec,this.videoCodec=r.videoCodec,this.codecSet=[r.videoCodec,r.audioCodec].filter(i=>!!i).map(i=>i.substring(0,4)).join(","),this.addGroupId("audio",r.attrs.AUDIO),this.addGroupId("text",r.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(r){return bi(this._audioGroups,r)}hasSubtitleGroup(r){return bi(this._subtitleGroups,r)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(r,i){if(i){if(r==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(i)===-1&&s.push(i)}else if(r==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(i)===-1&&s.push(i)}}}get urlId(){return 0}set urlId(r){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var r;return(r=this.audioGroups)==null?void 0:r[0]}get textGroupId(){var r;return(r=this.subtitleGroups)==null?void 0:r[0]}addFallback(){}}function bi(d,r){return!r||!d?!1:d.indexOf(r)!==-1}function Sn(d,r){const i=r.startPTS;if(te(i)){let s=0,o;r.sn>d.sn?(s=i-d.start,o=d):(s=d.start-i,o=r),o.duration!==s&&(o.duration=s)}else r.sn>d.sn?d.cc===r.cc&&d.minEndPTS?r.start=d.start+(d.minEndPTS-d.start):r.start=d.start+d.duration:r.start=Math.max(d.start-r.duration,0)}function ls(d,r,i,s,o,u){s-i<=0&&(P.warn("Fragment should have a positive duration",r),s=i+r.duration,u=o+r.duration);let m=i,_=s;const w=r.startPTS,E=r.endPTS;if(te(w)){const de=Math.abs(w-i);te(r.deltaPTS)?r.deltaPTS=Math.max(de,r.deltaPTS):r.deltaPTS=de,m=Math.max(i,w),i=Math.min(i,w),o=Math.min(o,r.startDTS),_=Math.min(s,E),s=Math.max(s,E),u=Math.max(u,r.endDTS)}const L=i-r.start;r.start!==0&&(r.start=i),r.duration=s-r.start,r.startPTS=i,r.maxStartPTS=m,r.startDTS=o,r.endPTS=s,r.minEndPTS=_,r.endDTS=u;const N=r.sn;if(!d||N<d.startSN||N>d.endSN)return 0;let J;const j=N-d.startSN,ne=d.fragments;for(ne[j]=r,J=j;J>0;J--)Sn(ne[J],ne[J-1]);for(J=j;J<ne.length-1;J++)Sn(ne[J],ne[J+1]);return d.fragmentHint&&Sn(ne[ne.length-1],d.fragmentHint),d.PTSKnown=d.alignedSliding=!0,L}function _s(d,r){let i=null;const s=d.fragments;for(let m=s.length-1;m>=0;m--){const _=s[m].initSegment;if(_){i=_;break}}d.fragmentHint&&delete d.fragmentHint.endPTS;let o;xs(d,r,(m,_,w,E)=>{if(r.skippedSegments&&_.cc!==m.cc){const L=m.cc-_.cc;for(let N=w;N<E.length;N++)E[N].cc+=L}te(m.startPTS)&&te(m.endPTS)&&(_.start=_.startPTS=m.startPTS,_.startDTS=m.startDTS,_.maxStartPTS=m.maxStartPTS,_.endPTS=m.endPTS,_.endDTS=m.endDTS,_.minEndPTS=m.minEndPTS,_.duration=m.endPTS-m.startPTS,_.duration&&(o=_),r.PTSKnown=r.alignedSliding=!0),_.elementaryStreams=m.elementaryStreams,_.loader=m.loader,_.stats=m.stats,m.initSegment&&(_.initSegment=m.initSegment,i=m.initSegment)});const u=r.fragments;if(i&&(r.fragmentHint?u.concat(r.fragmentHint):u).forEach(_=>{var w;_&&(!_.initSegment||_.initSegment.relurl===((w=i)==null?void 0:w.relurl))&&(_.initSegment=i)}),r.skippedSegments){if(r.deltaUpdateFailed=u.some(m=>!m),r.deltaUpdateFailed){P.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let m=r.skippedSegments;m--;)u.shift();r.startSN=u[0].sn}else r.canSkipDateRanges&&(r.dateRanges=fs(d.dateRanges,r.dateRanges,r.recentlyRemovedDateranges));r.startCC=r.fragments[0].cc,r.endCC=u[u.length-1].cc}Xn(d.partList,r.partList,(m,_)=>{_.elementaryStreams=m.elementaryStreams,_.stats=m.stats}),o?ls(r,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS):ps(d,r),u.length&&(r.totalduration=r.edge-u[0].start),r.driftStartTime=d.driftStartTime,r.driftStart=d.driftStart;const h=r.advancedDateTime;if(r.advanced&&h){const m=r.edge;r.driftStart||(r.driftStartTime=h,r.driftStart=m),r.driftEndTime=h,r.driftEnd=m}else r.driftEndTime=d.driftEndTime,r.driftEnd=d.driftEnd,r.advancedDateTime=d.advancedDateTime}function fs(d,r,i){const s=c({},d);return i&&i.forEach(o=>{delete s[o]}),Object.keys(r).forEach(o=>{const u=new st(r[o].attr,s[o]);u.isValid?s[o]=u:P.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(r[o].attr)}"`)}),s}function Xn(d,r,i){if(d&&r){let s=0;for(let o=0,u=d.length;o<=u;o++){const h=d[o],m=r[o+s];h&&m&&h.index===m.index&&h.fragment.sn===m.fragment.sn?i(h,m):s--}}}function xs(d,r,i){const s=r.skippedSegments,o=Math.max(d.startSN,r.startSN)-r.startSN,u=(d.fragmentHint?1:0)+(s?r.endSN:Math.min(d.endSN,r.endSN))-r.startSN,h=r.startSN-d.startSN,m=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,_=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;for(let w=o;w<=u;w++){const E=_[h+w];let L=m[w];s&&!L&&w<s&&(L=r.fragments[w]=E),E&&L&&i(E,L,w,m)}}function ps(d,r){const i=r.startSN+r.skippedSegments-d.startSN,s=d.fragments;i<0||i>=s.length||er(r,s[i].start)}function er(d,r){if(r){const i=d.fragments;for(let s=d.skippedSegments;s<i.length;s++)i[s].start+=r;d.fragmentHint&&(d.fragmentHint.start+=r)}}function ci(d,r=1/0){let i=1e3*d.targetduration;if(d.updated){const s=d.fragments;if(s.length&&i*4>r){const u=s[s.length-1].duration*1e3;u<i&&(i=u)}}else i/=2;return Math.round(i)}function ws(d,r,i){if(!(d!=null&&d.details))return null;const s=d.details;let o=s.fragments[r-s.startSN];return o||(o=s.fragmentHint,o&&o.sn===r)?o:r<s.startSN&&i&&i.sn===r?i:null}function Qi(d,r,i){var s;return d!=null&&d.details?_i((s=d.details)==null?void 0:s.partList,r,i):null}function _i(d,r,i){if(d)for(let s=d.length;s--;){const o=d[s];if(o.index===i&&o.fragment.sn===r)return o}return null}function oi(d){d.forEach((r,i)=>{const{details:s}=r;s!=null&&s.fragments&&s.fragments.forEach(o=>{o.level=i})})}function Dn(d){switch(d.details){case I.FRAG_LOAD_TIMEOUT:case I.KEY_LOAD_TIMEOUT:case I.LEVEL_LOAD_TIMEOUT:case I.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function ti(d,r){const i=Dn(r);return d.default[`${i?"timeout":"error"}Retry`]}function Mi(d,r){const i=d.backoff==="linear"?1:Math.pow(2,r);return Math.min(i*d.retryDelayMs,d.maxRetryDelayMs)}function Fi(d){return Oe(Oe({},d),{errorRetry:null,timeoutRetry:null})}function mi(d,r,i,s){if(!d)return!1;const o=s==null?void 0:s.code,u=r<d.maxNumRetry&&(Ni(o)||!!i);return d.shouldRetry?d.shouldRetry(d,r,i,s,u):u}function Ni(d){return d===0&&navigator.onLine===!1||!!d&&(d<400||d>499)}const Os={search:function(d,r){let i=0,s=d.length-1,o=null,u=null;for(;i<=s;){o=(i+s)/2|0,u=d[o];const h=r(u);if(h>0)i=o+1;else if(h<0)s=o-1;else return u}return null}};function Nn(d,r,i){if(r===null||!Array.isArray(d)||!d.length||!te(r))return null;const s=d[0].programDateTime;if(r<(s||0))return null;const o=d[d.length-1].endProgramDateTime;if(r>=(o||0))return null;i=i||0;for(let u=0;u<d.length;++u){const h=d[u];if(es(r,i,h))return h}return null}function wn(d,r,i=0,s=0,o=.005){let u=null;if(d){u=r[d.sn-r[0].sn+1]||null;const m=d.endDTS-i;m>0&&m<15e-7&&(i+=15e-7)}else i===0&&r[0].start===0&&(u=r[0]);if(u&&((!d||d.level===u.level)&&xi(i,s,u)===0||hi(u,d,Math.min(o,s))))return u;const h=Os.search(r,xi.bind(null,i,s));return h&&(h!==d||!u)?h:u}function hi(d,r,i){if(r&&r.start===0&&r.level<d.level&&(r.endPTS||0)>0){const s=r.tagList.reduce((o,u)=>(u[0]==="INF"&&(o+=parseFloat(u[1])),o),i);return d.start<=s}return!1}function xi(d=0,r=0,i){if(i.start<=d&&i.start+i.duration>d)return 0;const s=Math.min(r,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-s<=d?1:i.start-s>d&&i.start?-1:0}function es(d,r,i){const s=Math.min(r,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3;return(i.endProgramDateTime||0)-s>d}function Cr(d,r){return Os.search(d,i=>i.cc<r?1:i.cc>r?-1:0)}var Dr={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},On={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Li{constructor(r){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=r,this.log=P.log.bind(P,"[info]:"),this.warn=P.warn.bind(P,"[warning]:"),this.error=P.error.bind(P,"[error]:"),this.registerListeners()}registerListeners(){const r=this.hls;r.on(b.ERROR,this.onError,this),r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const r=this.hls;r&&(r.off(b.ERROR,this.onError,this),r.off(b.ERROR,this.onErrorOut,this),r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(r){}stopLoad(){this.playlistError=0}getVariantLevelIndex(r){return(r==null?void 0:r.type)===Ie.MAIN?r.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(r,i){var s,o;if(i.fatal)return;const u=this.hls,h=i.context;switch(i.details){case I.FRAG_LOAD_ERROR:case I.FRAG_LOAD_TIMEOUT:case I.KEY_LOAD_ERROR:case I.KEY_LOAD_TIMEOUT:i.errorAction=this.getFragRetryOrSwitchAction(i);return;case I.FRAG_PARSING_ERROR:if((s=i.frag)!=null&&s.gap){i.errorAction={action:Dr.DoNothing,flags:On.None};return}case I.FRAG_GAP:case I.FRAG_DECRYPT_ERROR:{i.errorAction=this.getFragRetryOrSwitchAction(i),i.errorAction.action=Dr.SendAlternateToPenaltyBox;return}case I.LEVEL_EMPTY_ERROR:case I.LEVEL_PARSING_ERROR:{var m,_;const w=i.parent===Ie.MAIN?i.level:u.loadLevel;i.details===I.LEVEL_EMPTY_ERROR&&((m=i.context)!=null&&(_=m.levelDetails)!=null&&_.live)?i.errorAction=this.getPlaylistRetryOrSwitchAction(i,w):(i.levelRetry=!1,i.errorAction=this.getLevelSwitchAction(i,w))}return;case I.LEVEL_LOAD_ERROR:case I.LEVEL_LOAD_TIMEOUT:typeof(h==null?void 0:h.level)=="number"&&(i.errorAction=this.getPlaylistRetryOrSwitchAction(i,h.level));return;case I.AUDIO_TRACK_LOAD_ERROR:case I.AUDIO_TRACK_LOAD_TIMEOUT:case I.SUBTITLE_LOAD_ERROR:case I.SUBTITLE_TRACK_LOAD_TIMEOUT:if(h){const w=u.levels[u.loadLevel];if(w&&(h.type===sr.AUDIO_TRACK&&w.hasAudioGroup(h.groupId)||h.type===sr.SUBTITLE_TRACK&&w.hasSubtitleGroup(h.groupId))){i.errorAction=this.getPlaylistRetryOrSwitchAction(i,u.loadLevel),i.errorAction.action=Dr.SendAlternateToPenaltyBox,i.errorAction.flags=On.MoveAllAlternatesMatchingHost;return}}return;case I.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const w=u.levels[u.loadLevel],E=w==null?void 0:w.attrs["HDCP-LEVEL"];E?i.errorAction={action:Dr.SendAlternateToPenaltyBox,flags:On.MoveAllAlternatesMatchingHDCP,hdcpLevel:E}:this.keySystemError(i)}return;case I.BUFFER_ADD_CODEC_ERROR:case I.REMUX_ALLOC_ERROR:case I.BUFFER_APPEND_ERROR:i.errorAction=this.getLevelSwitchAction(i,(o=i.level)!=null?o:u.loadLevel);return;case I.INTERNAL_EXCEPTION:case I.BUFFER_APPENDING_ERROR:case I.BUFFER_FULL_ERROR:case I.LEVEL_SWITCH_ERROR:case I.BUFFER_STALLED_ERROR:case I.BUFFER_SEEK_OVER_HOLE:case I.BUFFER_NUDGE_ON_STALL:i.errorAction={action:Dr.DoNothing,flags:On.None};return}i.type===M.KEY_SYSTEM_ERROR&&this.keySystemError(i)}keySystemError(r){const i=this.getVariantLevelIndex(r.frag);r.levelRetry=!1,r.errorAction=this.getLevelSwitchAction(r,i)}getPlaylistRetryOrSwitchAction(r,i){const s=this.hls,o=ti(s.config.playlistLoadPolicy,r),u=this.playlistError++;if(mi(o,u,Dn(r),r.response))return{action:Dr.RetryRequest,flags:On.None,retryConfig:o,retryCount:u};const m=this.getLevelSwitchAction(r,i);return o&&(m.retryConfig=o,m.retryCount=u),m}getFragRetryOrSwitchAction(r){const i=this.hls,s=this.getVariantLevelIndex(r.frag),o=i.levels[s],{fragLoadPolicy:u,keyLoadPolicy:h}=i.config,m=ti(r.details.startsWith("key")?h:u,r),_=i.levels.reduce((E,L)=>E+L.fragmentError,0);if(o&&(r.details!==I.FRAG_GAP&&o.fragmentError++,mi(m,_,Dn(r),r.response)))return{action:Dr.RetryRequest,flags:On.None,retryConfig:m,retryCount:_};const w=this.getLevelSwitchAction(r,s);return m&&(w.retryConfig=m,w.retryCount=_),w}getLevelSwitchAction(r,i){const s=this.hls;i==null&&(i=s.loadLevel);const o=this.hls.levels[i];if(o){var u,h;const w=r.details;o.loadError++,w===I.BUFFER_APPEND_ERROR&&o.fragmentError++;let E=-1;const{levels:L,loadLevel:N,minAutoLevel:J,maxAutoLevel:j}=s;s.autoLevelEnabled||(s.loadLevel=-1);const ne=(u=r.frag)==null?void 0:u.type,$e=(ne===Ie.AUDIO&&w===I.FRAG_PARSING_ERROR||r.sourceBufferName==="audio"&&(w===I.BUFFER_ADD_CODEC_ERROR||w===I.BUFFER_APPEND_ERROR))&&L.some(({audioCodec:Qt})=>o.audioCodec!==Qt),ht=r.sourceBufferName==="video"&&(w===I.BUFFER_ADD_CODEC_ERROR||w===I.BUFFER_APPEND_ERROR)&&L.some(({codecSet:Qt,audioCodec:zt})=>o.codecSet!==Qt&&o.audioCodec===zt),{type:At,groupId:yt}=(h=r.context)!=null?h:{};for(let Qt=L.length;Qt--;){const zt=(Qt+N)%L.length;if(zt!==N&&zt>=J&&zt<=j&&L[zt].loadError===0){var m,_;const pr=L[zt];if(w===I.FRAG_GAP&&ne===Ie.MAIN&&r.frag){const Or=L[zt].details;if(Or){const Zt=wn(r.frag,Or.fragments,r.frag.start);if(Zt!=null&&Zt.gap)continue}}else{if(At===sr.AUDIO_TRACK&&pr.hasAudioGroup(yt)||At===sr.SUBTITLE_TRACK&&pr.hasSubtitleGroup(yt))continue;if(ne===Ie.AUDIO&&(m=o.audioGroups)!=null&&m.some(Or=>pr.hasAudioGroup(Or))||ne===Ie.SUBTITLE&&(_=o.subtitleGroups)!=null&&_.some(Or=>pr.hasSubtitleGroup(Or))||$e&&o.audioCodec===pr.audioCodec||!$e&&o.audioCodec!==pr.audioCodec||ht&&o.codecSet===pr.codecSet)continue}E=zt;break}}if(E>-1&&s.loadLevel!==E)return r.levelRetry=!0,this.playlistError=0,{action:Dr.SendAlternateToPenaltyBox,flags:On.None,nextAutoLevel:E}}return{action:Dr.SendAlternateToPenaltyBox,flags:On.MoveAllAlternatesMatchingHost}}onErrorOut(r,i){var s;switch((s=i.errorAction)==null?void 0:s.action){case Dr.DoNothing:break;case Dr.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(i),!i.errorAction.resolved&&i.details!==I.FRAG_GAP?i.fatal=!0:/MediaSource readyState: ended/.test(i.error.message)&&(this.warn(`MediaSource ended after "${i.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case Dr.RetryRequest:break}if(i.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(r){const i=this.hls,s=r.errorAction;if(!s)return;const{flags:o,hdcpLevel:u,nextAutoLevel:h}=s;switch(o){case On.None:this.switchLevel(r,h);break;case On.MoveAllAlternatesMatchingHDCP:u&&(i.maxHdcpLevel=Vi[Vi.indexOf(u)-1],s.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${i.maxHdcpLevel}" or lower`);break}s.resolved||this.switchLevel(r,h)}switchLevel(r,i){i!==void 0&&r.errorAction&&(this.warn(`switching to level ${i} after ${r.details}`),this.hls.nextAutoLevel=i,r.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class jn{constructor(r,i){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=P.log.bind(P,`${i}:`),this.warn=P.warn.bind(P,`${i}:`),this.hls=r}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(r,i,s){const o=i==null?void 0:i.renditionReports;if(o){let u=-1;for(let h=0;h<o.length;h++){const m=o[h];let _;try{_=new self.URL(m.URI,i.url).href}catch(w){P.warn(`Could not construct new URL for Rendition Report: ${w}`),_=m.URI||""}if(_===r){u=h;break}else _===r.substring(0,_.length)&&(u=h)}if(u!==-1){const h=o[u],m=parseInt(h["LAST-MSN"])||(i==null?void 0:i.lastPartSn);let _=parseInt(h["LAST-PART"])||(i==null?void 0:i.lastPartIndex);if(this.hls.config.lowLatencyMode){const E=Math.min(i.age-i.partTarget,i.targetduration);_>=0&&E>i.partTarget&&(_+=1)}const w=s&&ui(s);return new Ji(m,_>=0?_:void 0,w)}}}loadPlaylist(r){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(r){return this.canLoad&&!!r&&!!r.url&&(!r.details||r.details.live)}shouldReloadPlaylist(r){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(r)}playlistLoaded(r,i,s){const{details:o,stats:u}=i,h=self.performance.now(),m=u.loading.first?Math.max(0,h-u.loading.first):0;if(o.advancedDateTime=Date.now()-m,o.live||s!=null&&s.live){if(o.reloaded(s),s&&this.log(`live playlist ${r} ${o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:o.updated?"UPDATED":"MISSED"}`),s&&o.fragments.length>0&&_s(s,o),!this.canLoad||!o.live)return;let _,w,E;if(o.canBlockReload&&o.endSN&&o.advanced){const de=this.hls.config.lowLatencyMode,$e=o.lastPartSn,ct=o.endSN,ht=o.lastPartIndex,At=ht!==-1,yt=$e===ct,Qt=de?0:ht;At?(w=yt?ct+1:$e,E=yt?Qt:ht+1):w=ct+1;const zt=o.age,pr=zt+o.ageHeader;let Or=Math.min(pr-o.partTarget,o.targetduration*1.5);if(Or>0){if(s&&Or>s.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${Or} with playlist age: ${o.age}`),Or=0;else{const Zt=Math.floor(Or/o.targetduration);if(w+=Zt,E!==void 0){const mr=Math.round(Or%o.targetduration/o.partTarget);E+=mr}this.log(`CDN Tune-in age: ${o.ageHeader}s last advanced ${zt.toFixed(2)}s goal: ${Or} skip sn ${Zt} to part ${E}`)}o.tuneInGoal=Or}if(_=this.getDeliveryDirectives(o,i.deliveryDirectives,w,E),de||!yt){this.loadPlaylist(_);return}}else(o.canBlockReload||o.canSkipUntil)&&(_=this.getDeliveryDirectives(o,i.deliveryDirectives,w,E));const L=this.hls.mainForwardBufferInfo,N=L?L.end-L.len:0,J=(o.edge-N)*1e3,j=ci(o,J);o.updated&&h>this.requestScheduled+j&&(this.requestScheduled=u.loading.start),w!==void 0&&o.canBlockReload?this.requestScheduled=u.loading.first+j-(o.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+j<h?this.requestScheduled=h:this.requestScheduled-h<=0&&(this.requestScheduled+=j);let ne=this.requestScheduled-h;ne=Math.max(0,ne),this.log(`reload live playlist ${r} in ${Math.round(ne)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(_),ne)}else this.clearTimer()}getDeliveryDirectives(r,i,s,o){let u=ui(r);return i!=null&&i.skip&&r.deltaUpdateFailed&&(s=i.msn,o=i.part,u=Wi.No),new Ji(s,o,u)}checkRetry(r){const i=r.details,s=Dn(r),o=r.errorAction,{action:u,retryCount:h=0,retryConfig:m}=o||{},_=!!o&&!!m&&(u===Dr.RetryRequest||!o.resolved&&u===Dr.SendAlternateToPenaltyBox);if(_){var w;if(this.requestScheduled=-1,h>=m.maxNumRetry)return!1;if(s&&(w=r.context)!=null&&w.deliveryDirectives)this.warn(`Retrying playlist loading ${h+1}/${m.maxNumRetry} after "${i}" without delivery-directives`),this.loadPlaylist();else{const E=Mi(m,h);this.timer=self.setTimeout(()=>this.loadPlaylist(),E),this.warn(`Retrying playlist loading ${h+1}/${m.maxNumRetry} after "${i}" in ${E}ms`)}r.levelRetry=!0,o.resolved=!0}return _}}class Ss{constructor(r,i=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=r,this.alpha_=r?Math.exp(Math.log(.5)/r):0,this.estimate_=i,this.totalWeight_=s}sample(r,i){const s=Math.pow(this.alpha_,r);this.estimate_=i*(1-s)+s*this.estimate_,this.totalWeight_+=r}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const r=1-Math.pow(this.alpha_,this.totalWeight_);if(r)return this.estimate_/r}return this.estimate_}}class Ts{constructor(r,i,s,o=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Ss(r),this.fast_=new Ss(i),this.defaultTTFB_=o,this.ttfb_=new Ss(r)}update(r,i){const{slow_:s,fast_:o,ttfb_:u}=this;s.halfLife!==r&&(this.slow_=new Ss(r,s.getEstimate(),s.getTotalWeight())),o.halfLife!==i&&(this.fast_=new Ss(i,o.getEstimate(),o.getTotalWeight())),u.halfLife!==r&&(this.ttfb_=new Ss(r,u.getEstimate(),u.getTotalWeight()))}sample(r,i){r=Math.max(r,this.minDelayMs_);const s=8*i,o=r/1e3,u=s/o;this.fast_.sample(o,u),this.slow_.sample(o,u)}sampleTTFB(r){const i=r/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(i,2)/2);this.ttfb_.sample(s,Math.max(r,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const Ns={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},$i={};function Qs(d,r,i,s,o,u){const h=d.audioCodec?d.audioGroups:null,m=u==null?void 0:u.audioCodec,_=u==null?void 0:u.channels,w=_?parseInt(_):m?1/0:2;let E=null;if(h!=null&&h.length)try{h.length===1&&h[0]?E=r.groups[h[0]].channels:E=h.reduce((L,N)=>{if(N){const J=r.groups[N];if(!J)throw new Error(`Audio track group ${N} not found`);Object.keys(J.channels).forEach(j=>{L[j]=(L[j]||0)+J.channels[j]})}return L},{2:0})}catch(L){return!0}return d.videoCodec!==void 0&&(d.width>1920&&d.height>1088||d.height>1920&&d.width>1088||d.frameRate>Math.max(s,30)||d.videoRange!=="SDR"&&d.videoRange!==i||d.bitrate>Math.max(o,8e6))||!!E&&te(w)&&Object.keys(E).some(L=>parseInt(L)>w)}function la(d,r,i){const s=d.videoCodec,o=d.audioCodec;if(!s||!o||!i)return Promise.resolve(Ns);const u={width:d.width,height:d.height,bitrate:Math.ceil(Math.max(d.bitrate*.9,d.averageBitrate)),framerate:d.frameRate||30},h=d.videoRange;h!=="SDR"&&(u.transferFunction=h.toLowerCase());const m=s.split(",").map(_=>({type:"media-source",video:Oe(Oe({},u),{},{contentType:bt(_,"video")})}));return o&&d.audioGroups&&d.audioGroups.forEach(_=>{var w;_&&((w=r.groups[_])==null||w.tracks.forEach(E=>{if(E.groupId===_){const L=E.channels||"",N=parseFloat(L);te(N)&&N>2&&m.push.apply(m,o.split(",").map(J=>({type:"media-source",audio:{contentType:bt(J,"audio"),channels:""+N}})))}}))}),Promise.all(m.map(_=>{const w=wa(_);return $i[w]||($i[w]=i.decodingInfo(_))})).then(_=>({supported:!_.some(w=>!w.supported),configurations:m,decodingInfoResults:_})).catch(_=>({supported:!1,configurations:m,decodingInfoResults:[],error:_}))}function wa(d){const{audio:r,video:i}=d,s=i||r;if(s){const o=s.contentType.split('"')[1];if(i)return`r${i.height}x${i.width}f${Math.ceil(i.framerate)}${i.transferFunction||"sd"}_${o}_${Math.ceil(i.bitrate/1e5)}`;if(r)return`c${r.channels}${r.spatialRendering?"s":"n"}_${o}`}return""}function za(){if(typeof matchMedia=="function"){const d=matchMedia("(dynamic-range: high)"),r=matchMedia("bad query");if(d.media!==r.media)return d.matches===!0}return!1}function Sa(d,r){let i=!1,s=[];return d&&(i=d!=="SDR",s=[d]),r&&(s=r.allowedVideoRanges||Ci.slice(0),i=r.preferHDR!==void 0?r.preferHDR:za(),i?s=s.filter(o=>o!=="SDR"):s=["SDR"]),{preferHDR:i,allowedVideoRanges:s}}function ts(d,r,i,s,o){const u=Object.keys(d),h=s==null?void 0:s.channels,m=s==null?void 0:s.audioCodec,_=h&&parseInt(h)===2;let w=!0,E=!1,L=1/0,N=1/0,J=1/0,j=0,ne=[];const{preferHDR:de,allowedVideoRanges:$e}=Sa(r,o);for(let yt=u.length;yt--;){const Qt=d[u[yt]];w=Qt.channels[2]>0,L=Math.min(L,Qt.minHeight),N=Math.min(N,Qt.minFramerate),J=Math.min(J,Qt.minBitrate);const zt=$e.filter(pr=>Qt.videoRanges[pr]>0);zt.length>0&&(E=!0,ne=zt)}L=te(L)?L:0,N=te(N)?N:0;const ct=Math.max(1080,L),ht=Math.max(30,N);return J=te(J)?J:i,i=Math.max(J,i),E||(r=void 0,ne=[]),{codecSet:u.reduce((yt,Qt)=>{const zt=d[Qt];if(Qt===yt)return yt;if(zt.minBitrate>i)return zi(Qt,`min bitrate of ${zt.minBitrate} > current estimate of ${i}`),yt;if(!zt.hasDefaultAudio)return zi(Qt,"no renditions with default or auto-select sound found"),yt;if(m&&Qt.indexOf(m.substring(0,4))%5!==0)return zi(Qt,`audio codec preference "${m}" not found`),yt;if(h&&!_){if(!zt.channels[h])return zi(Qt,`no renditions with ${h} channel sound found (channels options: ${Object.keys(zt.channels)})`),yt}else if((!m||_)&&w&&zt.channels[2]===0)return zi(Qt,"no renditions with stereo sound found"),yt;return zt.minHeight>ct?(zi(Qt,`min resolution of ${zt.minHeight} > maximum of ${ct}`),yt):zt.minFramerate>ht?(zi(Qt,`min framerate of ${zt.minFramerate} > maximum of ${ht}`),yt):ne.some(pr=>zt.videoRanges[pr]>0)?zt.maxScore<j?(zi(Qt,`max score of ${zt.maxScore} < selected max of ${j}`),yt):yt&&(lt(Qt)>=lt(yt)||zt.fragmentError>d[yt].fragmentError)?yt:(j=zt.maxScore,Qt):(zi(Qt,`no variants with VIDEO-RANGE of ${JSON.stringify(ne)} found`),yt)},void 0),videoRanges:ne,preferHDR:de,minFramerate:N,minBitrate:J}}function zi(d,r){P.log(`[abr] start candidates with "${d}" ignored because ${r}`)}function Ki(d){return d.reduce((r,i)=>{let s=r.groups[i.groupId];s||(s=r.groups[i.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),s.tracks.push(i);const o=i.channels||"2";return s.channels[o]=(s.channels[o]||0)+1,s.hasDefault=s.hasDefault||i.default,s.hasAutoSelect=s.hasAutoSelect||i.autoselect,s.hasDefault&&(r.hasDefaultAudio=!0),s.hasAutoSelect&&(r.hasAutoSelectAudio=!0),r},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function ea(d,r,i,s){return d.slice(i,s+1).reduce((o,u)=>{if(!u.codecSet)return o;const h=u.audioGroups;let m=o[u.codecSet];m||(o[u.codecSet]=m={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!h,fragmentError:0}),m.minBitrate=Math.min(m.minBitrate,u.bitrate);const _=Math.min(u.height,u.width);return m.minHeight=Math.min(m.minHeight,_),m.minFramerate=Math.min(m.minFramerate,u.frameRate),m.maxScore=Math.max(m.maxScore,u.score),m.fragmentError+=u.fragmentError,m.videoRanges[u.videoRange]=(m.videoRanges[u.videoRange]||0)+1,h&&h.forEach(w=>{if(!w)return;const E=r.groups[w];E&&(m.hasDefaultAudio=m.hasDefaultAudio||r.hasDefaultAudio?E.hasDefault:E.hasAutoSelect||!r.hasDefaultAudio&&!r.hasAutoSelectAudio,Object.keys(E.channels).forEach(L=>{m.channels[L]=(m.channels[L]||0)+E.channels[L]}))}),o},{})}function Cs(d,r,i){if("attrs"in d){const s=r.indexOf(d);if(s!==-1)return s}for(let s=0;s<r.length;s++){const o=r[s];if(Ds(d,o,i))return s}return-1}function Ds(d,r,i){const{groupId:s,name:o,lang:u,assocLang:h,default:m}=d,_=d.forced;return(s===void 0||r.groupId===s)&&(o===void 0||r.name===o)&&(u===void 0||r.lang===u)&&(u===void 0||r.assocLang===h)&&(m===void 0||r.default===m)&&(_===void 0||r.forced===_)&&(!("characteristics"in d)||rl(d.characteristics||"",r.characteristics))&&(i===void 0||i(d,r))}function rl(d,r=""){const i=d.split(","),s=r.split(",");return i.length===s.length&&!i.some(o=>s.indexOf(o)===-1)}function Hs(d,r){const{audioCodec:i,channels:s}=d;return(i===void 0||(r.audioCodec||"").substring(0,4)===i.substring(0,4))&&(s===void 0||s===(r.channels||"2"))}function $s(d,r,i,s,o){const u=r[s],m=r.reduce((N,J,j)=>{const ne=J.uri;return(N[ne]||(N[ne]=[])).push(j),N},{})[u.uri];m.length>1&&(s=Math.max.apply(Math,m));const _=u.videoRange,w=u.frameRate,E=u.codecSet.substring(0,4),L=no(r,s,N=>{if(N.videoRange!==_||N.frameRate!==w||N.codecSet.substring(0,4)!==E)return!1;const J=N.audioGroups,j=i.filter(ne=>!J||J.indexOf(ne.groupId)!==-1);return Cs(d,j,o)>-1});return L>-1?L:no(r,s,N=>{const J=N.audioGroups,j=i.filter(ne=>!J||J.indexOf(ne.groupId)!==-1);return Cs(d,j,o)>-1})}function no(d,r,i){for(let s=r;s>-1;s--)if(i(d[s]))return s;for(let s=r+1;s<d.length;s++)if(i(d[s]))return s;return-1}class Ka{constructor(r){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:i,partCurrent:s,hls:o}=this,{autoLevelEnabled:u,media:h}=o;if(!i||!h)return;const m=performance.now(),_=s?s.stats:i.stats,w=s?s.duration:i.duration,E=m-_.loading.start,L=o.minAutoLevel;if(_.aborted||_.loaded&&_.loaded===_.total||i.level<=L){this.clearTimer(),this._nextAutoLevel=-1;return}if(!u||h.paused||!h.playbackRate||!h.readyState)return;const N=o.mainForwardBufferInfo;if(N===null)return;const J=this.bwEstimator.getEstimateTTFB(),j=Math.abs(h.playbackRate);if(E<=Math.max(J,1e3*(w/(j*2))))return;const ne=N.len/j,de=_.loading.first?_.loading.first-_.loading.start:-1,$e=_.loaded&&de>-1,ct=this.getBwEstimate(),ht=o.levels,At=ht[i.level],yt=_.total||Math.max(_.loaded,Math.round(w*At.averageBitrate/8));let Qt=$e?E-de:E;Qt<1&&$e&&(Qt=Math.min(E,_.loaded*8/ct));const zt=$e?_.loaded*1e3/Qt:0,pr=zt?(yt-_.loaded)/zt:yt*8/ct+J/1e3;if(pr<=ne)return;const Or=zt?zt*8:ct;let Zt=Number.POSITIVE_INFINITY,mr;for(mr=i.level-1;mr>L;mr--){const Wr=ht[mr].maxBitrate;if(Zt=this.getTimeToLoadFrag(J/1e3,Or,w*Wr,!ht[mr].details),Zt<ne)break}if(Zt>=pr||Zt>w*10)return;o.nextLoadLevel=o.nextAutoLevel=mr,$e?this.bwEstimator.sample(E-Math.min(J,de),_.loaded):this.bwEstimator.sampleTTFB(E);const un=ht[mr].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>un&&this.resetEstimator(un),this.clearTimer(),P.warn(`[abr] Fragment ${i.sn}${s?" part "+s.index:""} of level ${i.level} is loading too slowly;
Time to underbuffer: ${ne.toFixed(3)} s
Estimated load time for current fragment: ${pr.toFixed(3)} s
Estimated load time for down switch fragment: ${Zt.toFixed(3)} s
TTFB estimate: ${de|0} ms
Current BW estimate: ${te(ct)?ct|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${mr} @ ${un|0} bps`),o.trigger(b.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:s,stats:_})},this.hls=r,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(r){r&&(P.log(`setting initial bwe to ${r}`),this.hls.config.abrEwmaDefaultEstimate=r),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const r=this.hls.config;return new Ts(r.abrEwmaSlowVoD,r.abrEwmaFastVoD,r.abrEwmaDefaultEstimate)}registerListeners(){const{hls:r}=this;r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.FRAG_LOADING,this.onFragLoading,this),r.on(b.FRAG_LOADED,this.onFragLoaded,this),r.on(b.FRAG_BUFFERED,this.onFragBuffered,this),r.on(b.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(b.LEVEL_LOADED,this.onLevelLoaded,this),r.on(b.LEVELS_UPDATED,this.onLevelsUpdated,this),r.on(b.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),r.on(b.ERROR,this.onError,this)}unregisterListeners(){const{hls:r}=this;r&&(r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.FRAG_LOADING,this.onFragLoading,this),r.off(b.FRAG_LOADED,this.onFragLoaded,this),r.off(b.FRAG_BUFFERED,this.onFragBuffered,this),r.off(b.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(b.LEVEL_LOADED,this.onLevelLoaded,this),r.off(b.LEVELS_UPDATED,this.onLevelsUpdated,this),r.off(b.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),r.off(b.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(r,i){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(r,i){const s=i.frag;if(!this.ignoreFragment(s)){if(!s.bitrateTest){var o;this.fragCurrent=s,this.partCurrent=(o=i.part)!=null?o:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(r,i){this.clearTimer()}onError(r,i){if(!i.fatal)switch(i.details){case I.BUFFER_ADD_CODEC_ERROR:case I.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case I.FRAG_LOAD_TIMEOUT:{const s=i.frag,{fragCurrent:o,partCurrent:u}=this;if(s&&o&&s.sn===o.sn&&s.level===o.level){const h=performance.now(),m=u?u.stats:s.stats,_=h-m.loading.start,w=m.loading.first?m.loading.first-m.loading.start:-1;if(m.loaded&&w>-1){const L=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(_-Math.min(L,w),m.loaded)}else this.bwEstimator.sampleTTFB(_)}break}}}getTimeToLoadFrag(r,i,s,o){const u=r+s/i,h=o?this.lastLevelLoadSec:0;return u+h}onLevelLoaded(r,i){const s=this.hls.config,{loading:o}=i.stats,u=o.end-o.start;te(u)&&(this.lastLevelLoadSec=u/1e3),i.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)}onFragLoaded(r,{frag:i,part:s}){const o=s?s.stats:i.stats;if(i.type===Ie.MAIN&&this.bwEstimator.sampleTTFB(o.loading.first-o.loading.start),!this.ignoreFragment(i)){if(this.clearTimer(),i.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const u=s?s.duration:i.duration,h=this.hls.levels[i.level],m=(h.loaded?h.loaded.bytes:0)+o.loaded,_=(h.loaded?h.loaded.duration:0)+u;h.loaded={bytes:m,duration:_},h.realBitrate=Math.round(8*m/_)}if(i.bitrateTest){const u={stats:o,frag:i,part:s,id:i.type};this.onFragBuffered(b.FRAG_BUFFERED,u),i.bitrateTest=!1}else this.lastLoadedFragLevel=i.level}}onFragBuffered(r,i){const{frag:s,part:o}=i,u=o!=null&&o.stats.loaded?o.stats:s.stats;if(u.aborted||this.ignoreFragment(s))return;const h=u.parsing.end-u.loading.start-Math.min(u.loading.first-u.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(h,u.loaded),u.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=h/1e3:this.bitrateTestDelay=0}ignoreFragment(r){return r.type!==Ie.MAIN||r.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:r,minAutoLevel:i}=this.hls,s=this.getBwEstimate(),o=this.hls.config.maxStarvationDelay,u=this.findBestLevel(s,i,r,0,o,1,1);if(u>-1)return u;const h=this.hls.firstLevel,m=Math.min(Math.max(h,i),r);return P.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${h} clamped to ${m}`),m}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const r=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),o=this.lastLoadedFragLevel>-1;if(r!==-1&&(!s||!o||this.nextAutoLevelKey===this.getAutoLevelKey()))return r;const u=s&&o?this.getNextABRAutoLevel():this.firstAutoLevel;if(r!==-1){const h=this.hls.levels;if(h.length>Math.max(r,u)&&h[r].loadError<=h[u].loadError)return r}return this._nextAutoLevel=u,this.nextAutoLevelKey=this.getAutoLevelKey(),u}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:r,partCurrent:i,hls:s}=this,{maxAutoLevel:o,config:u,minAutoLevel:h}=s,m=i?i.duration:r?r.duration:0,_=this.getBwEstimate(),w=this.getStarvationDelay();let E=u.abrBandWidthFactor,L=u.abrBandWidthUpFactor;if(w){const de=this.findBestLevel(_,h,o,w,0,E,L);if(de>=0)return de}let N=m?Math.min(m,u.maxStarvationDelay):u.maxStarvationDelay;if(!w){const de=this.bitrateTestDelay;de&&(N=(m?Math.min(m,u.maxLoadingDelay):u.maxLoadingDelay)-de,P.info(`[abr] bitrate test took ${Math.round(1e3*de)}ms, set first fragment max fetchDuration to ${Math.round(1e3*N)} ms`),E=L=1)}const J=this.findBestLevel(_,h,o,w,N,E,L);if(P.info(`[abr] ${w?"rebuffering expected":"buffer is empty"}, optimal quality level ${J}`),J>-1)return J;const j=s.levels[h],ne=s.levels[s.loadLevel];return(j==null?void 0:j.bitrate)<(ne==null?void 0:ne.bitrate)?h:s.loadLevel}getStarvationDelay(){const r=this.hls,i=r.media;if(!i)return 1/0;const s=i&&i.playbackRate!==0?Math.abs(i.playbackRate):1,o=r.mainForwardBufferInfo;return(o?o.len:0)/s}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(r,i,s,o,u,h,m){var _;const w=o+u,E=this.lastLoadedFragLevel,L=E===-1?this.hls.firstLevel:E,{fragCurrent:N,partCurrent:J}=this,{levels:j,allAudioTracks:ne,loadLevel:de,config:$e}=this.hls;if(j.length===1)return 0;const ct=j[L],ht=!!(ct!=null&&(_=ct.details)!=null&&_.live),At=de===-1||E===-1;let yt,Qt="SDR",zt=(ct==null?void 0:ct.frameRate)||0;const{audioPreference:pr,videoPreference:Or}=$e,Zt=this.audioTracksByGroup||(this.audioTracksByGroup=Ki(ne));if(At){if(this.firstSelection!==-1)return this.firstSelection;const kt=this.codecTiers||(this.codecTiers=ea(j,Zt,i,s)),Br=ts(kt,Qt,r,pr,Or),{codecSet:fi,videoRanges:Bi,minFramerate:tn,minBitrate:jr,preferHDR:Qn}=Br;yt=fi,Qt=Qn?Bi[Bi.length-1]:Bi[0],zt=tn,r=Math.max(r,jr),P.log(`[abr] picked start tier ${JSON.stringify(Br)}`)}else yt=ct==null?void 0:ct.codecSet,Qt=ct==null?void 0:ct.videoRange;const mr=J?J.duration:N?N.duration:0,un=this.bwEstimator.getEstimateTTFB()/1e3,Wr=[];for(let kt=s;kt>=i;kt--){var Cn;const Br=j[kt],fi=kt>L;if(!Br)continue;if($e.useMediaCapabilities&&!Br.supportedResult&&!Br.supportedPromise){const ys=navigator.mediaCapabilities;typeof(ys==null?void 0:ys.decodingInfo)=="function"&&Qs(Br,Zt,Qt,zt,r,pr)?(Br.supportedPromise=la(Br,Zt,ys),Br.supportedPromise.then(As=>{if(!this.hls)return;Br.supportedResult=As;const ss=this.hls.levels,vi=ss.indexOf(Br);As.error?P.warn(`[abr] MediaCapabilities decodingInfo error: "${As.error}" for level ${vi} ${JSON.stringify(As)}`):As.supported||(P.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${vi} ${JSON.stringify(As)}`),vi>-1&&ss.length>1&&(P.log(`[abr] Removing unsupported level ${vi}`),this.hls.removeLevel(vi)))})):Br.supportedResult=Ns}if(yt&&Br.codecSet!==yt||Qt&&Br.videoRange!==Qt||fi&&zt>Br.frameRate||!fi&&zt>0&&zt<Br.frameRate||Br.supportedResult&&!((Cn=Br.supportedResult.decodingInfoResults)!=null&&Cn[0].smooth)){Wr.push(kt);continue}const Bi=Br.details,tn=(J?Bi==null?void 0:Bi.partTarget:Bi==null?void 0:Bi.averagetargetduration)||mr;let jr;fi?jr=m*r:jr=h*r;const Qn=mr&&o>=mr*2&&u===0?j[kt].averageBitrate:j[kt].maxBitrate,Pn=this.getTimeToLoadFrag(un,jr,Qn*tn,Bi===void 0);if(jr>=Qn&&(kt===E||Br.loadError===0&&Br.fragmentError===0)&&(Pn<=un||!te(Pn)||ht&&!this.bitrateTestDelay||Pn<w)){const ys=this.forcedAutoLevel;return kt!==de&&(ys===-1||ys!==de)&&(Wr.length&&P.trace(`[abr] Skipped level(s) ${Wr.join(",")} of ${s} max with CODECS and VIDEO-RANGE:"${j[Wr[0]].codecs}" ${j[Wr[0]].videoRange}; not compatible with "${ct.codecs}" ${Qt}`),P.info(`[abr] switch candidate:${L}->${kt} adjustedbw(${Math.round(jr)})-bitrate=${Math.round(jr-Qn)} ttfb:${un.toFixed(1)} avgDuration:${tn.toFixed(1)} maxFetchDuration:${w.toFixed(1)} fetchDuration:${Pn.toFixed(1)} firstSelection:${At} codecSet:${yt} videoRange:${Qt} hls.loadLevel:${de}`)),At&&(this.firstSelection=kt),kt}}return-1}set nextAutoLevel(r){const{maxAutoLevel:i,minAutoLevel:s}=this.hls,o=Math.min(Math.max(r,s),i);this._nextAutoLevel!==o&&(this.nextAutoLevelKey="",this._nextAutoLevel=o)}}class nl{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(r){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,r),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var Yi={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Ea{constructor(r){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=r,this._registerListeners()}_registerListeners(){const{hls:r}=this;r.on(b.BUFFER_APPENDED,this.onBufferAppended,this),r.on(b.FRAG_BUFFERED,this.onFragBuffered,this),r.on(b.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:r}=this;r.off(b.BUFFER_APPENDED,this.onBufferAppended,this),r.off(b.FRAG_BUFFERED,this.onFragBuffered,this),r.off(b.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(r,i){const s=this.activePartLists[i];if(s)for(let o=s.length;o--;){const u=s[o];if(!u)break;const h=u.end;if(u.start<=r&&h!==null&&r<=h)return u}return this.getBufferedFrag(r,i)}getBufferedFrag(r,i){const{fragments:s}=this,o=Object.keys(s);for(let u=o.length;u--;){const h=s[o[u]];if((h==null?void 0:h.body.type)===i&&h.buffered){const m=h.body;if(m.start<=r&&r<=m.end)return m}}return null}detectEvictedFragments(r,i,s,o){this.timeRanges&&(this.timeRanges[r]=i);const u=(o==null?void 0:o.fragment.sn)||-1;Object.keys(this.fragments).forEach(h=>{const m=this.fragments[h];if(!m||u>=m.body.sn)return;if(!m.buffered&&!m.loaded){m.body.type===s&&this.removeFragment(m.body);return}const _=m.range[r];_&&_.time.some(w=>{const E=!this.isTimeBuffered(w.startPTS,w.endPTS,i);return E&&this.removeFragment(m.body),E})})}detectPartialFragments(r){const i=this.timeRanges,{frag:s,part:o}=r;if(!i||s.sn==="initSegment")return;const u=Gs(s),h=this.fragments[u];if(!h||h.buffered&&s.gap)return;const m=!s.relurl;Object.keys(i).forEach(_=>{const w=s.elementaryStreams[_];if(!w)return;const E=i[_],L=m||w.partial===!0;h.range[_]=this.getBufferedTimes(s,o,L,E)}),h.loaded=null,Object.keys(h.range).length?(h.buffered=!0,(h.body.endList=s.endList||h.body.endList)&&(this.endListFragments[h.body.type]=h),ta(h)||this.removeParts(s.sn-1,s.type)):this.removeFragment(h.body)}removeParts(r,i){const s=this.activePartLists[i];s&&(this.activePartLists[i]=s.filter(o=>o.fragment.sn>=r))}fragBuffered(r,i){const s=Gs(r);let o=this.fragments[s];!o&&i&&(o=this.fragments[s]={body:r,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},r.gap&&(this.hasGaps=!0)),o&&(o.loaded=null,o.buffered=!0)}getBufferedTimes(r,i,s,o){const u={time:[],partial:s},h=r.start,m=r.end,_=r.minEndPTS||m,w=r.maxStartPTS||h;for(let E=0;E<o.length;E++){const L=o.start(E)-this.bufferPadding,N=o.end(E)+this.bufferPadding;if(w>=L&&_<=N){u.time.push({startPTS:Math.max(h,o.start(E)),endPTS:Math.min(m,o.end(E))});break}else if(h<N&&m>L){const J=Math.max(h,o.start(E)),j=Math.min(m,o.end(E));j>J&&(u.partial=!0,u.time.push({startPTS:J,endPTS:j}))}else if(m<=L)break}return u}getPartialFragment(r){let i=null,s,o,u,h=0;const{bufferPadding:m,fragments:_}=this;return Object.keys(_).forEach(w=>{const E=_[w];E&&ta(E)&&(o=E.body.start-m,u=E.body.end+m,r>=o&&r<=u&&(s=Math.min(r-o,u-r),h<=s&&(i=E.body,h=s)))}),i}isEndListAppended(r){const i=this.endListFragments[r];return i!==void 0&&(i.buffered||ta(i))}getState(r){const i=Gs(r),s=this.fragments[i];return s?s.buffered?ta(s)?Yi.PARTIAL:Yi.OK:Yi.APPENDING:Yi.NOT_LOADED}isTimeBuffered(r,i,s){let o,u;for(let h=0;h<s.length;h++){if(o=s.start(h)-this.bufferPadding,u=s.end(h)+this.bufferPadding,r>=o&&i<=u)return!0;if(i<=o)return!1}return!1}onFragLoaded(r,i){const{frag:s,part:o}=i;if(s.sn==="initSegment"||s.bitrateTest)return;const u=o?null:i,h=Gs(s);this.fragments[h]={body:s,appendedPTS:null,loaded:u,buffered:!1,range:Object.create(null)}}onBufferAppended(r,i){const{frag:s,part:o,timeRanges:u}=i;if(s.sn==="initSegment")return;const h=s.type;if(o){let m=this.activePartLists[h];m||(this.activePartLists[h]=m=[]),m.push(o)}this.timeRanges=u,Object.keys(u).forEach(m=>{const _=u[m];this.detectEvictedFragments(m,_,h,o)})}onFragBuffered(r,i){this.detectPartialFragments(i)}hasFragment(r){const i=Gs(r);return!!this.fragments[i]}hasParts(r){var i;return!!((i=this.activePartLists[r])!=null&&i.length)}removeFragmentsInRange(r,i,s,o,u){o&&!this.hasGaps||Object.keys(this.fragments).forEach(h=>{const m=this.fragments[h];if(!m)return;const _=m.body;_.type!==s||o&&!_.gap||_.start<i&&_.end>r&&(m.buffered||u)&&this.removeFragment(_)})}removeFragment(r){const i=Gs(r);r.stats.loaded=0,r.clearElementaryStreamInfo();const s=this.activePartLists[r.type];if(s){const o=r.sn;this.activePartLists[r.type]=s.filter(u=>u.fragment.sn!==o)}delete this.fragments[i],r.endList&&delete this.endListFragments[r.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function ta(d){var r,i,s;return d.buffered&&(d.body.gap||((r=d.range.video)==null?void 0:r.partial)||((i=d.range.audio)==null?void 0:i.partial)||((s=d.range.audiovideo)==null?void 0:s.partial))}function Gs(d){return`${d.type}_${d.level}_${d.sn}`}const Do={length:0,start:()=>0,end:()=>0};class Jn{static isBuffered(r,i){try{if(r){const s=Jn.getBuffered(r);for(let o=0;o<s.length;o++)if(i>=s.start(o)&&i<=s.end(o))return!0}}catch(s){}return!1}static bufferInfo(r,i,s){try{if(r){const o=Jn.getBuffered(r),u=[];let h;for(h=0;h<o.length;h++)u.push({start:o.start(h),end:o.end(h)});return this.bufferedInfo(u,i,s)}}catch(o){}return{len:0,start:i,end:i,nextStart:void 0}}static bufferedInfo(r,i,s){i=Math.max(0,i),r.sort(function(w,E){const L=w.start-E.start;return L||E.end-w.end});let o=[];if(s)for(let w=0;w<r.length;w++){const E=o.length;if(E){const L=o[E-1].end;r[w].start-L<s?r[w].end>L&&(o[E-1].end=r[w].end):o.push(r[w])}else o.push(r[w])}else o=r;let u=0,h,m=i,_=i;for(let w=0;w<o.length;w++){const E=o[w].start,L=o[w].end;if(i+s>=E&&i<L)m=E,_=L,u=_-i;else if(i+s<E){h=E;break}}return{len:u,start:m||0,end:_||0,nextStart:h}}static getBuffered(r){try{return r.buffered}catch(i){return P.log("failed to get media.buffered",i),Do}}}class Ua{constructor(r,i,s,o=0,u=-1,h=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=ms(),this.buffering={audio:ms(),video:ms(),audiovideo:ms()},this.level=r,this.sn=i,this.id=s,this.size=o,this.part=u,this.partial=h}}function ms(){return{start:0,executeStart:0,executeEnd:0,end:0}}function ma(d,r){for(let s=0,o=d.length;s<o;s++){var i;if(((i=d[s])==null?void 0:i.cc)===r)return d[s]}return null}function il(d,r,i){return!!(r&&(i.endCC>i.startCC||d&&d.cc<i.startCC))}function Ha(d,r){const i=d.fragments,s=r.fragments;if(!s.length||!i.length){P.log("No fragments to align");return}const o=ma(i,s[0].cc);if(!o||o&&!o.startPTS){P.log("No frag in previous level to align on");return}return o}function ka(d,r){if(d){const i=d.start+r;d.start=d.startPTS=i,d.endPTS=i+d.duration}}function Ga(d,r){const i=r.fragments;for(let s=0,o=i.length;s<o;s++)ka(i[s],d);r.fragmentHint&&ka(r.fragmentHint,d),r.alignedSliding=!0}function ra(d,r,i){r&&(Va(d,i,r),!i.alignedSliding&&r&&zs(i,r),!i.alignedSliding&&r&&!i.skippedSegments&&ps(r,i))}function Va(d,r,i){if(il(d,i,r)){const s=Ha(i,r);s&&te(s.start)&&(P.log(`Adjusting PTS using last level due to CC increase within current level ${r.url}`),Ga(s.start,r))}}function zs(d,r){if(!d.hasProgramDateTime||!r.hasProgramDateTime)return;const i=d.fragments,s=r.fragments;if(!i.length||!s.length)return;let o,u;const h=Math.min(r.endCC,d.endCC);r.startCC<h&&d.startCC<h&&(o=ma(s,h),u=ma(i,h)),(!o||!u)&&(o=s[Math.floor(s.length/2)],u=ma(i,o.cc)||i[Math.floor(i.length/2)]);const m=o.programDateTime,_=u.programDateTime;if(!m||!_)return;const w=(_-m)/1e3-(u.start-o.start);Ga(w,d)}const io=Math.pow(2,17);class Kn{constructor(r){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=r}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(r,i){const s=r.url;if(!s)return Promise.reject(new Ui({type:M.NETWORK_ERROR,details:I.FRAG_LOAD_ERROR,fatal:!1,frag:r,error:new Error(`Fragment does not have a ${s?"part list":"url"}`),networkDetails:null}));this.abort();const o=this.config,u=o.fLoader,h=o.loader;return new Promise((m,_)=>{if(this.loader&&this.loader.destroy(),r.gap)if(r.tagList.some(J=>J[0]==="GAP")){_(Un(r));return}else r.gap=!1;const w=this.loader=r.loader=u?new u(o):new h(o),E=qn(r),L=Fi(o.fragLoadPolicy.default),N={loadPolicy:L,timeout:L.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:r.sn==="initSegment"?1/0:io};r.stats=w.stats,w.load(E,N,{onSuccess:(J,j,ne,de)=>{this.resetLoader(r,w);let $e=J.data;ne.resetIV&&r.decryptdata&&(r.decryptdata.iv=new Uint8Array($e.slice(0,16)),$e=$e.slice(16)),m({frag:r,part:null,payload:$e,networkDetails:de})},onError:(J,j,ne,de)=>{this.resetLoader(r,w),_(new Ui({type:M.NETWORK_ERROR,details:I.FRAG_LOAD_ERROR,fatal:!1,frag:r,response:Oe({url:s,data:void 0},J),error:new Error(`HTTP Error ${J.code} ${J.text}`),networkDetails:ne,stats:de}))},onAbort:(J,j,ne)=>{this.resetLoader(r,w),_(new Ui({type:M.NETWORK_ERROR,details:I.INTERNAL_ABORTED,fatal:!1,frag:r,error:new Error("Aborted"),networkDetails:ne,stats:J}))},onTimeout:(J,j,ne)=>{this.resetLoader(r,w),_(new Ui({type:M.NETWORK_ERROR,details:I.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,error:new Error(`Timeout after ${N.timeout}ms`),networkDetails:ne,stats:J}))},onProgress:(J,j,ne,de)=>{i&&i({frag:r,part:null,payload:ne,networkDetails:de})}})})}loadPart(r,i,s){this.abort();const o=this.config,u=o.fLoader,h=o.loader;return new Promise((m,_)=>{if(this.loader&&this.loader.destroy(),r.gap||i.gap){_(Un(r,i));return}const w=this.loader=r.loader=u?new u(o):new h(o),E=qn(r,i),L=Fi(o.fragLoadPolicy.default),N={loadPolicy:L,timeout:L.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:io};i.stats=w.stats,w.load(E,N,{onSuccess:(J,j,ne,de)=>{this.resetLoader(r,w),this.updateStatsFromPart(r,i);const $e={frag:r,part:i,payload:J.data,networkDetails:de};s($e),m($e)},onError:(J,j,ne,de)=>{this.resetLoader(r,w),_(new Ui({type:M.NETWORK_ERROR,details:I.FRAG_LOAD_ERROR,fatal:!1,frag:r,part:i,response:Oe({url:E.url,data:void 0},J),error:new Error(`HTTP Error ${J.code} ${J.text}`),networkDetails:ne,stats:de}))},onAbort:(J,j,ne)=>{r.stats.aborted=i.stats.aborted,this.resetLoader(r,w),_(new Ui({type:M.NETWORK_ERROR,details:I.INTERNAL_ABORTED,fatal:!1,frag:r,part:i,error:new Error("Aborted"),networkDetails:ne,stats:J}))},onTimeout:(J,j,ne)=>{this.resetLoader(r,w),_(new Ui({type:M.NETWORK_ERROR,details:I.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,part:i,error:new Error(`Timeout after ${N.timeout}ms`),networkDetails:ne,stats:J}))}})})}updateStatsFromPart(r,i){const s=r.stats,o=i.stats,u=o.total;if(s.loaded+=o.loaded,u){const _=Math.round(r.duration/i.duration),w=Math.min(Math.round(s.loaded/u),_),L=(_-w)*Math.round(s.loaded/w);s.total=s.loaded+L}else s.total=Math.max(s.loaded,s.total);const h=s.loading,m=o.loading;h.start?h.first+=m.first-m.start:(h.start=m.start,h.first=m.first),h.end=m.end}resetLoader(r,i){r.loader=null,this.loader===i&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),i.destroy()}}function qn(d,r=null){const i=r||d,s={frag:d,part:r,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},o=i.byteRangeStartOffset,u=i.byteRangeEndOffset;if(te(o)&&te(u)){var h;let m=o,_=u;if(d.sn==="initSegment"&&((h=d.decryptdata)==null?void 0:h.method)==="AES-128"){const w=u-o;w%16&&(_=u+(16-w%16)),o!==0&&(s.resetIV=!0,m=o-16)}s.rangeStart=m,s.rangeEnd=_}return s}function Un(d,r){const i=new Error(`GAP ${d.gap?"tag":"attribute"} found`),s={type:M.MEDIA_ERROR,details:I.FRAG_GAP,fatal:!1,frag:d,error:i,networkDetails:null};return r&&(s.part=r),(r||d).stats.aborted=!0,new Ui(s)}class Ui extends Error{constructor(r){super(r.error.message),this.data=void 0,this.data=r}}class Ii{constructor(r,i){this.subtle=void 0,this.aesIV=void 0,this.subtle=r,this.aesIV=i}decrypt(r,i){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,r)}}class Aa{constructor(r,i){this.subtle=void 0,this.key=void 0,this.subtle=r,this.key=i}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function Ta(d){const r=d.byteLength,i=r&&new DataView(d.buffer).getUint8(r-1);return i?We(d,0,r-i):d}class Mo{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(r){const i=new DataView(r),s=new Uint32Array(4);for(let o=0;o<4;o++)s[o]=i.getUint32(o*4);return s}initTable(){const r=this.sBox,i=this.invSBox,s=this.subMix,o=s[0],u=s[1],h=s[2],m=s[3],_=this.invSubMix,w=_[0],E=_[1],L=_[2],N=_[3],J=new Uint32Array(256);let j=0,ne=0,de=0;for(de=0;de<256;de++)de<128?J[de]=de<<1:J[de]=de<<1^283;for(de=0;de<256;de++){let $e=ne^ne<<1^ne<<2^ne<<3^ne<<4;$e=$e>>>8^$e&255^99,r[j]=$e,i[$e]=j;const ct=J[j],ht=J[ct],At=J[ht];let yt=J[$e]*257^$e*16843008;o[j]=yt<<24|yt>>>8,u[j]=yt<<16|yt>>>16,h[j]=yt<<8|yt>>>24,m[j]=yt,yt=At*16843009^ht*65537^ct*257^j*16843008,w[$e]=yt<<24|yt>>>8,E[$e]=yt<<16|yt>>>16,L[$e]=yt<<8|yt>>>24,N[$e]=yt,j?(j=ct^J[J[J[At^ct]]],ne^=J[J[ne]]):j=ne=1}}expandKey(r){const i=this.uint8ArrayToUint32Array_(r);let s=!0,o=0;for(;o<i.length&&s;)s=i[o]===this.key[o],o++;if(s)return;this.key=i;const u=this.keySize=i.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);const h=this.ksRows=(u+6+1)*4;let m,_;const w=this.keySchedule=new Uint32Array(h),E=this.invKeySchedule=new Uint32Array(h),L=this.sBox,N=this.rcon,J=this.invSubMix,j=J[0],ne=J[1],de=J[2],$e=J[3];let ct,ht;for(m=0;m<h;m++){if(m<u){ct=w[m]=i[m];continue}ht=ct,m%u===0?(ht=ht<<8|ht>>>24,ht=L[ht>>>24]<<24|L[ht>>>16&255]<<16|L[ht>>>8&255]<<8|L[ht&255],ht^=N[m/u|0]<<24):u>6&&m%u===4&&(ht=L[ht>>>24]<<24|L[ht>>>16&255]<<16|L[ht>>>8&255]<<8|L[ht&255]),w[m]=ct=(w[m-u]^ht)>>>0}for(_=0;_<h;_++)m=h-_,_&3?ht=w[m]:ht=w[m-4],_<4||m<=4?E[_]=ht:E[_]=j[L[ht>>>24]]^ne[L[ht>>>16&255]]^de[L[ht>>>8&255]]^$e[L[ht&255]],E[_]=E[_]>>>0}networkToHostOrderSwap(r){return r<<24|(r&65280)<<8|(r&16711680)>>8|r>>>24}decrypt(r,i,s){const o=this.keySize+6,u=this.invKeySchedule,h=this.invSBox,m=this.invSubMix,_=m[0],w=m[1],E=m[2],L=m[3],N=this.uint8ArrayToUint32Array_(s);let J=N[0],j=N[1],ne=N[2],de=N[3];const $e=new Int32Array(r),ct=new Int32Array($e.length);let ht,At,yt,Qt,zt,pr,Or,Zt,mr,un,Wr,Cn,kt,Br;const fi=this.networkToHostOrderSwap;for(;i<$e.length;){for(mr=fi($e[i]),un=fi($e[i+1]),Wr=fi($e[i+2]),Cn=fi($e[i+3]),zt=mr^u[0],pr=Cn^u[1],Or=Wr^u[2],Zt=un^u[3],kt=4,Br=1;Br<o;Br++)ht=_[zt>>>24]^w[pr>>16&255]^E[Or>>8&255]^L[Zt&255]^u[kt],At=_[pr>>>24]^w[Or>>16&255]^E[Zt>>8&255]^L[zt&255]^u[kt+1],yt=_[Or>>>24]^w[Zt>>16&255]^E[zt>>8&255]^L[pr&255]^u[kt+2],Qt=_[Zt>>>24]^w[zt>>16&255]^E[pr>>8&255]^L[Or&255]^u[kt+3],zt=ht,pr=At,Or=yt,Zt=Qt,kt=kt+4;ht=h[zt>>>24]<<24^h[pr>>16&255]<<16^h[Or>>8&255]<<8^h[Zt&255]^u[kt],At=h[pr>>>24]<<24^h[Or>>16&255]<<16^h[Zt>>8&255]<<8^h[zt&255]^u[kt+1],yt=h[Or>>>24]<<24^h[Zt>>16&255]<<16^h[zt>>8&255]<<8^h[pr&255]^u[kt+2],Qt=h[Zt>>>24]<<24^h[zt>>16&255]<<16^h[pr>>8&255]<<8^h[Or&255]^u[kt+3],ct[i]=fi(ht^J),ct[i+1]=fi(Qt^j),ct[i+2]=fi(yt^ne),ct[i+3]=fi(At^de),J=mr,j=un,ne=Wr,de=Cn,i=i+4}return ct.buffer}}const Lo=16;class Ca{constructor(r,{removePKCS7Padding:i=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=r.enableSoftwareAES,this.removePKCS7Padding=i,i)try{const s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(s){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:r,remainderData:i}=this;if(!r||i)return this.reset(),null;const s=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?Ta(s):s}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(r,i,s){return this.useSoftware?new Promise((o,u)=>{this.softwareDecrypt(new Uint8Array(r),i,s);const h=this.flush();h?o(h.buffer):u(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(r),i,s)}softwareDecrypt(r,i,s){const{currentIV:o,currentResult:u,remainderData:h}=this;this.logOnce("JS AES decrypt"),h&&(r=Kr(h,r),this.remainderData=null);const m=this.getValidChunk(r);if(!m.length)return null;o&&(s=o);let _=this.softwareDecrypter;_||(_=this.softwareDecrypter=new Mo),_.expandKey(i);const w=u;return this.currentResult=_.decrypt(m.buffer,0,s),this.currentIV=We(m,-16).buffer,w||null}webCryptoDecrypt(r,i,s){if(this.key!==i||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(r,i,s));this.key=i,this.fastAesKey=new Aa(this.subtle,i)}return this.fastAesKey.expandKey().then(o=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Ii(this.subtle,new Uint8Array(s)).decrypt(r.buffer,o)):Promise.reject(new Error("web crypto not initialized"))).catch(o=>(P.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${o.name}: ${o.message}`),this.onWebCryptoError(r,i,s)))}onWebCryptoError(r,i,s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(r,i,s);const o=this.flush();if(o)return o.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(r){let i=r;const s=r.length-r.length%Lo;return s!==r.length&&(i=We(r,0,s),this.remainderData=We(r,s)),i}logOnce(r){this.logEnabled&&(P.log(`[decrypter]: ${r}`),this.logEnabled=!1)}}const na={toString:function(d){let r="";const i=d.length;for(let s=0;s<i;s++)r+=`[${d.start(s).toFixed(3)}-${d.end(s).toFixed(3)}]`;return r}},Wt={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class Wa extends nl{constructor(r,i,s,o,u){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Wt.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=u,this.logPrefix=o,this.log=P.log.bind(P,`${o}:`),this.warn=P.warn.bind(P,`${o}:`),this.hls=r,this.fragmentLoader=new Kn(r.config),this.keyLoader=s,this.fragmentTracker=i,this.config=r.config,this.decrypter=new Ca(r.config),r.on(b.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(r){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const r=this.fragCurrent;r!=null&&r.loader&&(r.abortRequests(),this.fragmentTracker.removeFragment(r)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Wt.STOPPED}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}_streamEnded(r,i){if(i.live||r.nextStart||!r.end||!this.media)return!1;const s=i.partList;if(s!=null&&s.length){const u=s[s.length-1];return Jn.isBuffered(this.media,u.start+u.duration/2)}const o=i.fragments[i.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(o)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var r;return(r=this.levelLastLoaded)==null?void 0:r.details}}onMediaAttached(r,i){const s=this.media=this.mediaBuffer=i.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),s.addEventListener("seeking",this.onvseeking),s.addEventListener("ended",this.onvended);const o=this.config;this.levels&&o.autoStartLoad&&this.state===Wt.STOPPED&&this.startLoad(o.startPosition)}onMediaDetaching(){const r=this.media;r!=null&&r.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),r&&this.onvseeking&&this.onvended&&(r.removeEventListener("seeking",this.onvseeking),r.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:r,fragCurrent:i,media:s,mediaBuffer:o,state:u}=this,h=s?s.currentTime:0,m=Jn.bufferInfo(o||s,h,r.maxBufferHole);if(this.log(`media seeking to ${te(h)?h.toFixed(3):h}, state: ${u}`),this.state===Wt.ENDED)this.resetLoadingState();else if(i){const _=r.maxFragLookUpTolerance,w=i.start-_,E=i.start+i.duration+_;if(!m.len||E<m.start||w>m.end){const L=h>E;(h<w||L)&&(L&&i.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),i.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}s&&(this.fragmentTracker.removeFragmentsInRange(h,1/0,this.playlistType,!0),this.lastCurrentTime=h),!this.loadedmetadata&&!m.len&&(this.nextLoadPosition=this.startPosition=h),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(r,i){this.startTimeOffset=i.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.hls.off(b.MANIFEST_LOADED,this.onManifestLoaded,this),this.stopLoad(),super.onHandlerDestroying(),this.hls=null}onHandlerDestroyed(){this.state=Wt.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(r,i,s){this._loadFragForPlayback(r,i,s)}_loadFragForPlayback(r,i,s){const o=u=>{if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${u.part?" p: "+u.part.index:""} of level ${r.level} was dropped during download.`),this.fragmentTracker.removeFragment(r);return}r.stats.chunkCount++,this._handleFragmentLoadProgress(u)};this._doFragLoad(r,i,s,o).then(u=>{if(!u)return;const h=this.state;if(this.fragContextChanged(r)){(h===Wt.FRAG_LOADING||!this.fragCurrent&&h===Wt.PARSING)&&(this.fragmentTracker.removeFragment(r),this.state=Wt.IDLE);return}"payload"in u&&(this.log(`Loaded fragment ${r.sn} of level ${r.level}`),this.hls.trigger(b.FRAG_LOADED,u)),this._handleFragmentLoadComplete(u)}).catch(u=>{this.state===Wt.STOPPED||this.state===Wt.ERROR||(this.warn(`Frag error: ${(u==null?void 0:u.message)||u}`),this.resetFragmentLoading(r))})}clearTrackerIfNeeded(r){var i;const{fragmentTracker:s}=this;if(s.getState(r)===Yi.APPENDING){const u=r.type,h=this.getFwdBufferInfo(this.mediaBuffer,u),m=Math.max(r.duration,h?h.len:this.config.maxBufferLength),_=this.backtrackFragment;((_?r.sn-_.sn:0)===1||this.reduceMaxBufferLength(m,r.duration))&&s.removeFragment(r)}else((i=this.mediaBuffer)==null?void 0:i.buffered.length)===0?s.removeAllFragments():s.hasParts(r.type)&&(s.detectPartialFragments({frag:r,part:null,stats:r.stats,id:r.type}),s.getState(r)===Yi.PARTIAL&&s.removeFragment(r))}checkLiveUpdate(r){if(r.updated&&!r.live){const i=r.fragments[r.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:i,part:null,stats:i.stats,id:i.type})}r.fragments[0]||(r.deltaUpdateFailed=!0)}flushMainBuffer(r,i,s=null){if(!(r-i))return;const o={startOffset:r,endOffset:i,type:s};this.hls.trigger(b.BUFFER_FLUSHING,o)}_loadInitSegment(r,i){this._doFragLoad(r,i).then(s=>{if(!s||this.fragContextChanged(r)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:o}=this,{payload:u}=s,h=r.decryptdata;if(u&&u.byteLength>0&&h!=null&&h.key&&h.iv&&h.method==="AES-128"){const m=self.performance.now();return this.decrypter.decrypt(new Uint8Array(u),h.key.buffer,h.iv.buffer).catch(_=>{throw o.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.FRAG_DECRYPT_ERROR,fatal:!1,error:_,reason:_.message,frag:r}),_}).then(_=>{const w=self.performance.now();return o.trigger(b.FRAG_DECRYPTED,{frag:r,payload:_,stats:{tstart:m,tdecrypt:w}}),s.payload=_,this.completeInitSegmentLoad(s)})}return this.completeInitSegmentLoad(s)}).catch(s=>{this.state===Wt.STOPPED||this.state===Wt.ERROR||(this.warn(s),this.resetFragmentLoading(r))})}completeInitSegmentLoad(r){const{levels:i}=this;if(!i)throw new Error("init load aborted, missing levels");const s=r.frag.stats;this.state=Wt.IDLE,r.frag.data=new Uint8Array(r.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),this.tick()}fragContextChanged(r){const{fragCurrent:i}=this;return!r||!i||r.sn!==i.sn||r.level!==i.level}fragBufferedComplete(r,i){var s,o,u,h;const m=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${r.type} sn: ${r.sn}${i?" part: "+i.index:""} of ${this.playlistType===Ie.MAIN?"level":"track"} ${r.level} (frag:[${((s=r.startPTS)!=null?s:NaN).toFixed(3)}-${((o=r.endPTS)!=null?o:NaN).toFixed(3)}] > buffer:${m?na.toString(Jn.getBuffered(m)):"(detached)"})`),r.sn!=="initSegment"){var _;if(r.type!==Ie.SUBTITLE){const E=r.elementaryStreams;if(!Object.keys(E).some(L=>!!E[L])){this.state=Wt.IDLE;return}}const w=(_=this.levels)==null?void 0:_[r.level];w!=null&&w.fragmentError&&(this.log(`Resetting level fragment error count of ${w.fragmentError} on frag buffered`),w.fragmentError=0)}this.state=Wt.IDLE,m&&(!this.loadedmetadata&&r.type==Ie.MAIN&&m.buffered.length&&((u=this.fragCurrent)==null?void 0:u.sn)===((h=this.fragPrevious)==null?void 0:h.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(r){const{transmuxer:i}=this;if(!i)return;const{frag:s,part:o,partsLoaded:u}=r,h=!u||u.length===0||u.some(_=>!_),m=new Ua(s.level,s.sn,s.stats.chunkCount+1,0,o?o.index:-1,!h);i.flush(m)}_handleFragmentLoadProgress(r){}_doFragLoad(r,i,s=null,o){var u;const h=i==null?void 0:i.details;if(!this.levels||!h)throw new Error(`frag load aborted, missing level${h?"":" detail"}s`);let m=null;if(r.encrypted&&!((u=r.decryptdata)!=null&&u.key)?(this.log(`Loading key for ${r.sn} of [${h.startSN}-${h.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${r.level}`),this.state=Wt.KEY_LOADING,this.fragCurrent=r,m=this.keyLoader.load(r).then(E=>{if(!this.fragContextChanged(E.frag))return this.hls.trigger(b.KEY_LOADED,E),this.state===Wt.KEY_LOADING&&(this.state=Wt.IDLE),E}),this.hls.trigger(b.KEY_LOADING,{frag:r}),this.fragCurrent===null&&(m=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!r.encrypted&&h.encryptedFragments.length&&this.keyLoader.loadClear(r,h.encryptedFragments),s=Math.max(r.start,s||0),this.config.lowLatencyMode&&r.sn!=="initSegment"){const E=h.partList;if(E&&o){s>r.end&&h.fragmentHint&&(r=h.fragmentHint);const L=this.getNextPart(E,r,s);if(L>-1){const N=E[L];this.log(`Loading part sn: ${r.sn} p: ${N.index} cc: ${r.cc} of playlist [${h.startSN}-${h.endSN}] parts [0-${L}-${E.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${r.level}, target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=N.start+N.duration,this.state=Wt.FRAG_LOADING;let J;return m?J=m.then(j=>!j||this.fragContextChanged(j.frag)?null:this.doFragPartsLoad(r,N,i,o)).catch(j=>this.handleFragLoadError(j)):J=this.doFragPartsLoad(r,N,i,o).catch(j=>this.handleFragLoadError(j)),this.hls.trigger(b.FRAG_LOADING,{frag:r,part:N,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):J}else if(!r.url||this.loadedEndOfParts(E,s))return Promise.resolve(null)}}this.log(`Loading fragment ${r.sn} cc: ${r.cc} ${h?"of ["+h.startSN+"-"+h.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${r.level}, target: ${parseFloat(s.toFixed(3))}`),te(r.sn)&&!this.bitrateTest&&(this.nextLoadPosition=r.start+r.duration),this.state=Wt.FRAG_LOADING;const _=this.config.progressive;let w;return _&&m?w=m.then(E=>!E||this.fragContextChanged(E==null?void 0:E.frag)?null:this.fragmentLoader.load(r,o)).catch(E=>this.handleFragLoadError(E)):w=Promise.all([this.fragmentLoader.load(r,_?o:void 0),m]).then(([E])=>(!_&&E&&o&&o(E),E)).catch(E=>this.handleFragLoadError(E)),this.hls.trigger(b.FRAG_LOADING,{frag:r,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):w}doFragPartsLoad(r,i,s,o){return new Promise((u,h)=>{var m;const _=[],w=(m=s.details)==null?void 0:m.partList,E=L=>{this.fragmentLoader.loadPart(r,L,o).then(N=>{_[L.index]=N;const J=N.part;this.hls.trigger(b.FRAG_LOADED,N);const j=Qi(s,r.sn,L.index+1)||_i(w,r.sn,L.index+1);if(j)E(j);else return u({frag:r,part:J,partsLoaded:_})}).catch(h)};E(i)})}handleFragLoadError(r){if("data"in r){const i=r.data;r.data&&i.details===I.INTERNAL_ABORTED?this.handleFragLoadAborted(i.frag,i.part):this.hls.trigger(b.ERROR,i)}else this.hls.trigger(b.ERROR,{type:M.OTHER_ERROR,details:I.INTERNAL_EXCEPTION,err:r,error:r,fatal:!0});return null}_handleTransmuxerFlush(r){const i=this.getCurrentContext(r);if(!i||this.state!==Wt.PARSING){!this.fragCurrent&&this.state!==Wt.STOPPED&&this.state!==Wt.ERROR&&(this.state=Wt.IDLE);return}const{frag:s,part:o,level:u}=i,h=self.performance.now();s.stats.parsing.end=h,o&&(o.stats.parsing.end=h),this.updateLevelTiming(s,o,u,r.partial)}getCurrentContext(r){const{levels:i,fragCurrent:s}=this,{level:o,sn:u,part:h}=r;if(!(i!=null&&i[o]))return this.warn(`Levels object was unset while buffering fragment ${u} of level ${o}. The current chunk will not be buffered.`),null;const m=i[o],_=h>-1?Qi(m,u,h):null,w=_?_.fragment:ws(m,u,s);return w?(s&&s!==w&&(w.stats=s.stats),{frag:w,part:_,level:m}):null}bufferFragmentData(r,i,s,o,u){var h;if(!r||this.state!==Wt.PARSING)return;const{data1:m,data2:_}=r;let w=m;if(m&&_&&(w=Kr(m,_)),!((h=w)!=null&&h.length))return;const E={type:r.type,frag:i,part:s,chunkMeta:o,parent:i.type,data:w};if(this.hls.trigger(b.BUFFER_APPENDING,E),r.dropped&&r.independent&&!s){if(u)return;this.flushBufferGap(i)}}flushBufferGap(r){const i=this.media;if(!i)return;if(!Jn.isBuffered(i,i.currentTime)){this.flushMainBuffer(0,r.start);return}const s=i.currentTime,o=Jn.bufferInfo(i,s,0),u=r.duration,h=Math.min(this.config.maxFragLookUpTolerance*2,u*.25),m=Math.max(Math.min(r.start-h,o.end-h),s+h);r.start-m>h&&this.flushMainBuffer(m,r.start)}getFwdBufferInfo(r,i){const s=this.getLoadPosition();return te(s)?this.getFwdBufferInfoAtPos(r,s,i):null}getFwdBufferInfoAtPos(r,i,s){const{config:{maxBufferHole:o}}=this,u=Jn.bufferInfo(r,i,o);if(u.len===0&&u.nextStart!==void 0){const h=this.fragmentTracker.getBufferedFrag(i,s);if(h&&u.nextStart<h.end)return Jn.bufferInfo(r,i,Math.max(u.nextStart,o))}return u}getMaxBufferLength(r){const{config:i}=this;let s;return r?s=Math.max(8*i.maxBufferSize/r,i.maxBufferLength):s=i.maxBufferLength,Math.min(s,i.maxMaxBufferLength)}reduceMaxBufferLength(r,i){const s=this.config,o=Math.max(Math.min(r-i,s.maxBufferLength),i),u=Math.max(r-i*3,s.maxMaxBufferLength/2,o);return u>=o?(s.maxMaxBufferLength=u,this.warn(`Reduce max buffer length to ${u}s`),!0):!1}getAppendedFrag(r,i=Ie.MAIN){const s=this.fragmentTracker.getAppendedFrag(r,Ie.MAIN);return s&&"fragment"in s?s.fragment:s}getNextFragment(r,i){const s=i.fragments,o=s.length;if(!o)return null;const{config:u}=this,h=s[0].start;let m;if(i.live){const _=u.initialLiveManifestSize;if(o<_)return this.warn(`Not enough fragments to start playback (have: ${o}, need: ${_})`),null;(!i.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||r<h)&&(m=this.getInitialLiveFragment(i,s),this.startPosition=this.nextLoadPosition=m?this.hls.liveSyncPosition||m.start:r)}else r<=h&&(m=s[0]);if(!m){const _=u.lowLatencyMode?i.partEnd:i.fragmentEnd;m=this.getFragmentAtPosition(r,_,i)}return this.mapToInitFragWhenRequired(m)}isLoopLoading(r,i){const s=this.fragmentTracker.getState(r);return(s===Yi.OK||s===Yi.PARTIAL&&!!r.gap)&&this.nextLoadPosition>i}getNextFragmentLoopLoading(r,i,s,o,u){const h=r.gap,m=this.getNextFragment(this.nextLoadPosition,i);if(m===null)return m;if(r=m,h&&r&&!r.gap&&s.nextStart){const _=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,o);if(_!==null&&s.len+_.len>=u)return this.log(`buffer full after gaps in "${o}" playlist starting at sn: ${r.sn}`),null}return r}mapToInitFragWhenRequired(r){return r!=null&&r.initSegment&&!(r!=null&&r.initSegment.data)&&!this.bitrateTest?r.initSegment:r}getNextPart(r,i,s){let o=-1,u=!1,h=!0;for(let m=0,_=r.length;m<_;m++){const w=r[m];if(h=h&&!w.independent,o>-1&&s<w.start)break;const E=w.loaded;E?o=-1:(u||w.independent||h)&&w.fragment===i&&(o=m),u=E}return o}loadedEndOfParts(r,i){const s=r[r.length-1];return s&&i>s.start&&s.loaded}getInitialLiveFragment(r,i){const s=this.fragPrevious;let o=null;if(s){if(r.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${s.programDateTime}`),o=Nn(i,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!o){const u=s.sn+1;if(u>=r.startSN&&u<=r.endSN){const h=i[u-r.startSN];s.cc===h.cc&&(o=h,this.log(`Live playlist, switching playlist, load frag with next SN: ${o.sn}`))}o||(o=Cr(i,s.cc),o&&this.log(`Live playlist, switching playlist, load frag with same CC: ${o.sn}`))}}else{const u=this.hls.liveSyncPosition;u!==null&&(o=this.getFragmentAtPosition(u,this.bitrateTest?r.fragmentEnd:r.edge,r))}return o}getFragmentAtPosition(r,i,s){const{config:o}=this;let{fragPrevious:u}=this,{fragments:h,endSN:m}=s;const{fragmentHint:_}=s,{maxFragLookUpTolerance:w}=o,E=s.partList,L=!!(o.lowLatencyMode&&E!=null&&E.length&&_);L&&_&&!this.bitrateTest&&(h=h.concat(_),m=_.sn);let N;if(r<i){const J=r>i-w?0:w;N=wn(u,h,r,J)}else N=h[h.length-1];if(N){const J=N.sn-s.startSN,j=this.fragmentTracker.getState(N);if((j===Yi.OK||j===Yi.PARTIAL&&N.gap)&&(u=N),u&&N.sn===u.sn&&(!L||E[0].fragment.sn>N.sn)&&u&&N.level===u.level){const de=h[J+1];N.sn<m&&this.fragmentTracker.getState(de)!==Yi.OK?N=de:N=null}}return N}synchronizeToLiveEdge(r){const{config:i,media:s}=this;if(!s)return;const o=this.hls.liveSyncPosition,u=s.currentTime,h=r.fragments[0].start,m=r.edge,_=u>=h-i.maxFragLookUpTolerance&&u<=m;if(o!==null&&s.duration>o&&(u<o||!_)){const w=i.liveMaxLatencyDuration!==void 0?i.liveMaxLatencyDuration:i.liveMaxLatencyDurationCount*r.targetduration;(!_&&s.readyState<4||u<m-w)&&(this.loadedmetadata||(this.nextLoadPosition=o),s.readyState&&(this.warn(`Playback: ${u.toFixed(3)} is located too far from the end of live sliding playlist: ${m}, reset currentTime to : ${o.toFixed(3)}`),s.currentTime=o))}}alignPlaylists(r,i,s){const o=r.fragments.length;if(!o)return this.warn("No fragments in live playlist"),0;const u=r.fragments[0].start,h=!i,m=r.alignedSliding&&te(u);if(h||!m&&!u){const{fragPrevious:_}=this;ra(_,s,r);const w=r.fragments[0].start;return this.log(`Live playlist sliding: ${w.toFixed(2)} start-sn: ${i?i.startSN:"na"}->${r.startSN} prev-sn: ${_?_.sn:"na"} fragments: ${o}`),w}return u}waitForCdnTuneIn(r){return r.live&&r.canBlockReload&&r.partTarget&&r.tuneInGoal>Math.max(r.partHoldBack,r.partTarget*3)}setStartPosition(r,i){let s=this.startPosition;if(s<i&&(s=-1),s===-1||this.lastCurrentTime===-1){const o=this.startTimeOffset!==null,u=o?this.startTimeOffset:r.startTimeOffset;u!==null&&te(u)?(s=i+u,u<0&&(s+=r.totalduration),s=Math.min(Math.max(i,s),i+r.totalduration),this.log(`Start time offset ${u} found in ${o?"multivariant":"media"} playlist, adjust startPosition to ${s}`),this.startPosition=s):r.live?s=this.hls.liveSyncPosition||i:this.startPosition=s=0,this.lastCurrentTime=s}this.nextLoadPosition=s}getLoadPosition(){const{media:r}=this;let i=0;return this.loadedmetadata&&r?i=r.currentTime:this.nextLoadPosition&&(i=this.nextLoadPosition),i}handleFragLoadAborted(r,i){this.transmuxer&&r.sn!=="initSegment"&&r.stats.aborted&&(this.warn(`Fragment ${r.sn}${i?" part "+i.index:""} of level ${r.level} was aborted`),this.resetFragmentLoading(r))}resetFragmentLoading(r){(!this.fragCurrent||!this.fragContextChanged(r)&&this.state!==Wt.FRAG_LOADING_WAITING_RETRY)&&(this.state=Wt.IDLE)}onFragmentOrKeyLoadError(r,i){if(i.chunkMeta&&!i.frag){const E=this.getCurrentContext(i.chunkMeta);E&&(i.frag=E.frag)}const s=i.frag;if(!s||s.type!==r||!this.levels)return;if(this.fragContextChanged(s)){var o;this.warn(`Frag load error must match current frag to retry ${s.url} > ${(o=this.fragCurrent)==null?void 0:o.url}`);return}const u=i.details===I.FRAG_GAP;u&&this.fragmentTracker.fragBuffered(s,!0);const h=i.errorAction,{action:m,retryCount:_=0,retryConfig:w}=h||{};if(h&&m===Dr.RetryRequest&&w){this.resetStartWhenNotLoaded(this.levelLastLoaded);const E=Mi(w,_);this.warn(`Fragment ${s.sn} of ${r} ${s.level} errored with ${i.details}, retrying loading ${_+1}/${w.maxNumRetry} in ${E}ms`),h.resolved=!0,this.retryDate=self.performance.now()+E,this.state=Wt.FRAG_LOADING_WAITING_RETRY}else if(w&&h)if(this.resetFragmentErrors(r),_<w.maxNumRetry)!u&&m!==Dr.RemoveAlternatePermanently&&(h.resolved=!0);else{P.warn(`${i.details} reached or exceeded max retry (${_})`);return}else(h==null?void 0:h.action)===Dr.SendAlternateToPenaltyBox?this.state=Wt.WAITING_LEVEL:this.state=Wt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(r){if(this.state===Wt.PARSING||this.state===Wt.PARSED){const i=r.frag,s=r.parent,o=this.getFwdBufferInfo(this.mediaBuffer,s),u=o&&o.len>.5;u&&this.reduceMaxBufferLength(o.len,(i==null?void 0:i.duration)||10);const h=!u;return h&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${s} buffer`),i&&(this.fragmentTracker.removeFragment(i),this.nextLoadPosition=i.start),this.resetLoadingState(),h}return!1}resetFragmentErrors(r){r===Ie.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Wt.STOPPED&&(this.state=Wt.IDLE)}afterBufferFlushed(r,i,s){if(!r)return;const o=Jn.getBuffered(r);this.fragmentTracker.detectEvictedFragments(i,o,s),this.state===Wt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Wt.IDLE}resetStartWhenNotLoaded(r){if(!this.loadedmetadata){this.startFragRequested=!1;const i=r?r.details:null;i!=null&&i.live?(this.startPosition=-1,this.setStartPosition(i,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(r){this.warn(`The loading context changed while buffering fragment ${r.sn} of level ${r.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(r=0){this.fragmentTracker.removeFragmentsInRange(r,1/0,this.playlistType,!1,!0)}updateLevelTiming(r,i,s,o){var u;const h=s.details;if(!h){this.warn("level.details undefined");return}if(!Object.keys(r.elementaryStreams).reduce((_,w)=>{const E=r.elementaryStreams[w];if(E){const L=E.endPTS-E.startPTS;if(L<=0)return this.warn(`Could not parse fragment ${r.sn} ${w} duration reliably (${L})`),_||!1;const N=o?0:ls(h,r,E.startPTS,E.endPTS,E.startDTS,E.endDTS);return this.hls.trigger(b.LEVEL_PTS_UPDATED,{details:h,level:s,drift:N,type:w,frag:r,start:E.startPTS,end:E.endPTS}),!0}return _},!1)&&((u=this.transmuxer)==null?void 0:u.error)===null){const _=new Error(`Found no media in fragment ${r.sn} of level ${r.level} resetting transmuxer to fallback to playlist timing`);if(s.fragmentError===0&&(s.fragmentError++,r.gap=!0,this.fragmentTracker.removeFragment(r),this.fragmentTracker.fragBuffered(r,!0)),this.warn(_.message),this.hls.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.FRAG_PARSING_ERROR,fatal:!1,error:_,frag:r,reason:`Found no media in msn ${r.sn} of level "${s.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Wt.PARSED,this.hls.trigger(b.FRAG_PARSED,{frag:r,part:i})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(r){r.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(r){const i=this._state;i!==r&&(this._state=r,this.log(`${i}->${r}`))}get state(){return this._state}}class sl{constructor(){this.chunks=[],this.dataLength=0}push(r){this.chunks.push(r),this.dataLength+=r.length}flush(){const{chunks:r,dataLength:i}=this;let s;if(r.length)r.length===1?s=r[0]:s=zl(r,i);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function zl(d,r){const i=new Uint8Array(r);let s=0;for(let o=0;o<d.length;o++){const u=d[o];i.set(u,s),s+=u.length}return i}function Kl(){return typeof __HLS_WORKER_BUNDLE__=="function"}function al(){const d=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),r=self.URL.createObjectURL(d);return{worker:new self.Worker(r),objectURL:r}}function ol(d){const r=new self.URL(d,self.location.href).href;return{worker:new self.Worker(r),scriptURL:r}}function Vs(d="",r=9e4){return{type:d,id:-1,pid:-1,inputTimeScale:r,sequenceNumber:-1,samples:[],dropped:0}}class Da{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(r,i,s,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(r){this.initPTS=r,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(r,i){return!1}appendFrame(r,i,s){}demux(r,i){this.cachedData&&(r=Kr(this.cachedData,r),this.cachedData=null);let s=Et(r,0),o=s?s.length:0,u;const h=this._audioTrack,m=this._id3Track,_=s?Be(s):void 0,w=r.length;for((this.basePTS===null||this.frameIndex===0&&te(_))&&(this.basePTS=Ul(_,i,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),s&&s.length>0&&m.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:ni.audioId3,duration:Number.POSITIVE_INFINITY});o<w;){if(this.canParse(r,o)){const E=this.appendFrame(h,r,o);E?(this.frameIndex++,this.lastPTS=E.sample.pts,o+=E.length,u=o):o=w}else ge(r,o)?(s=Et(r,o),m.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:ni.audioId3,duration:Number.POSITIVE_INFINITY}),o+=s.length,u=o):o++;if(o===w&&u!==w){const E=We(r,u);this.cachedData?this.cachedData=Kr(this.cachedData,E):this.cachedData=E}}return{audioTrack:h,videoTrack:Vs(),id3Track:m,textTrack:Vs()}}demuxSampleAes(r,i,s){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(r){const i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),{audioTrack:this._audioTrack,videoTrack:Vs(),id3Track:this._id3Track,textTrack:Vs()}}destroy(){}}const Ul=(d,r,i)=>{if(te(d))return d*90;const s=i?i.baseTime*9e4/i.timescale:0;return r*9e4+s};function v0(d,r,i,s){let o,u,h,m;const _=navigator.userAgent.toLowerCase(),w=s,E=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];o=((r[i+2]&192)>>>6)+1;const L=(r[i+2]&60)>>>2;if(L>E.length-1){const N=new Error(`invalid ADTS sampling index:${L}`);d.emit(b.ERROR,b.ERROR,{type:M.MEDIA_ERROR,details:I.FRAG_PARSING_ERROR,fatal:!0,error:N,reason:N.message});return}return h=(r[i+2]&1)<<2,h|=(r[i+3]&192)>>>6,P.log(`manifest codec:${s}, ADTS type:${o}, samplingIndex:${L}`),/firefox/i.test(_)?L>=6?(o=5,m=new Array(4),u=L-3):(o=2,m=new Array(2),u=L):_.indexOf("android")!==-1?(o=2,m=new Array(2),u=L):(o=5,m=new Array(4),s&&(s.indexOf("mp4a.40.29")!==-1||s.indexOf("mp4a.40.5")!==-1)||!s&&L>=6?u=L-3:((s&&s.indexOf("mp4a.40.2")!==-1&&(L>=6&&h===1||/vivaldi/i.test(_))||!s&&h===1)&&(o=2,m=new Array(2)),u=L)),m[0]=o<<3,m[0]|=(L&14)>>1,m[1]|=(L&1)<<7,m[1]|=h<<3,o===5&&(m[1]|=(u&14)>>1,m[2]=(u&1)<<7,m[2]|=8,m[3]=0),{config:m,samplerate:E[L],channelCount:h,codec:"mp4a.40."+o,manifestCodec:w}}function Ro(d,r){return d[r]===255&&(d[r+1]&246)===240}function ll(d,r){return d[r+1]&1?7:9}function Io(d,r){return(d[r+3]&3)<<11|d[r+4]<<3|(d[r+5]&224)>>>5}function gs(d,r){return r+5<d.length}function Es(d,r){return r+1<d.length&&Ro(d,r)}function Ws(d,r){return gs(d,r)&&Ro(d,r)&&Io(d,r)<=d.length-r}function y0(d,r){if(Es(d,r)){const i=ll(d,r);if(r+i>=d.length)return!1;const s=Io(d,r);if(s<=i)return!1;const o=r+s;return o===d.length||Es(d,o)}return!1}function ul(d,r,i,s,o){if(!d.samplerate){const u=v0(r,i,s,o);if(!u)return;d.config=u.config,d.samplerate=u.samplerate,d.channelCount=u.channelCount,d.codec=u.codec,d.manifestCodec=u.manifestCodec,P.log(`parsed codec:${d.codec}, rate:${u.samplerate}, channels:${u.channelCount}`)}}function cl(d){return 1024*9e4/d}function b0(d,r){const i=ll(d,r);if(r+i<=d.length){const s=Io(d,r)-i;if(s>0)return{headerLength:i,frameLength:s}}}function Oo(d,r,i,s,o){const u=cl(d.samplerate),h=s+o*u,m=b0(r,i);let _;if(m){const{frameLength:L,headerLength:N}=m,J=N+L,j=Math.max(0,i+J-r.length);j?(_=new Uint8Array(J-N),_.set(r.subarray(i+N,r.length),0)):_=r.subarray(i+N,i+J);const ne={unit:_,pts:h};return j||d.samples.push(ne),{sample:ne,length:J,missing:j}}const w=r.length-i;return _=new Uint8Array(w),_.set(r.subarray(i,r.length),0),{sample:{unit:_,pts:h},length:w,missing:-1}}let so=null;const _0=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Hl=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],hl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Gl=[0,1,1,4];function Bo(d,r,i,s,o){if(i+24>r.length)return;const u=ao(r,i);if(u&&i+u.frameLength<=r.length){const h=u.samplesPerFrame*9e4/u.sampleRate,m=s+o*h,_={unit:r.subarray(i,i+u.frameLength),pts:m,dts:m};return d.config=[],d.channelCount=u.channelCount,d.samplerate=u.sampleRate,d.samples.push(_),{sample:_,length:u.frameLength,missing:0}}}function ao(d,r){const i=d[r+1]>>3&3,s=d[r+1]>>1&3,o=d[r+2]>>4&15,u=d[r+2]>>2&3;if(i!==1&&o!==0&&o!==15&&u!==3){const h=d[r+2]>>1&1,m=d[r+3]>>6,_=i===3?3-s:s===3?3:4,w=_0[_*14+o-1]*1e3,L=Hl[(i===3?0:i===2?1:2)*3+u],N=m===3?1:2,J=hl[i][s],j=Gl[s],ne=J*8*j,de=Math.floor(J*w/L+h)*j;if(so===null){const ht=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);so=ht?parseInt(ht[1]):0}return!!so&&so<=87&&s===2&&w>=224e3&&m===0&&(d[r+3]=d[r+3]|128),{sampleRate:L,channelCount:N,frameLength:de,samplesPerFrame:ne}}}function oo(d,r){return d[r]===255&&(d[r+1]&224)===224&&(d[r+1]&6)!==0}function js(d,r){return r+1<d.length&&oo(d,r)}function dl(d,r){return oo(d,r)&&4<=d.length-r}function fl(d,r){if(r+1<d.length&&oo(d,r)){const s=ao(d,r);let o=4;s!=null&&s.frameLength&&(o=s.frameLength);const u=r+o;return u===d.length||js(d,u)}return!1}class Vl extends Da{constructor(r,i){super(),this.observer=void 0,this.config=void 0,this.observer=r,this.config=i}resetInitSegment(r,i,s,o){super.resetInitSegment(r,i,s,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}}static probe(r){if(!r)return!1;const i=Et(r,0);let s=(i==null?void 0:i.length)||0;if(fl(r,s))return!1;for(let o=r.length;s<o;s++)if(y0(r,s))return P.log("ADTS sync word found !"),!0;return!1}canParse(r,i){return Ws(r,i)}appendFrame(r,i,s){ul(r,this.observer,i,s,r.manifestCodec);const o=Oo(r,i,s,this.basePTS,this.frameIndex);if(o&&o.missing===0)return o}}const Wl=/\/emsg[-/]ID3/i;class x0{constructor(r,i){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=i}resetTimeStamp(){}resetInitSegment(r,i,s,o){const u=this.videoTrack=Vs("video",1),h=this.audioTrack=Vs("audio",1),m=this.txtTrack=Vs("text",1);if(this.id3Track=Vs("id3",1),this.timeOffset=0,!(r!=null&&r.byteLength))return;const _=Ze(r);if(_.video){const{id:w,timescale:E,codec:L}=_.video;u.id=w,u.timescale=m.timescale=E,u.codec=L}if(_.audio){const{id:w,timescale:E,codec:L}=_.audio;h.id=w,h.timescale=E,h.codec=L}m.id=Pt.text,u.sampleDuration=0,u.duration=h.duration=o}resetContiguity(){this.remainderData=null}static probe(r){return Tr(r)}demux(r,i){this.timeOffset=i;let s=r;const o=this.videoTrack,u=this.txtTrack;if(this.config.progressive){this.remainderData&&(s=Kr(this.remainderData,r));const m=An(s);this.remainderData=m.remainder,o.samples=m.valid||new Uint8Array}else o.samples=s;const h=this.extractID3Track(o,i);return u.samples=yr(i,o),{videoTrack:o,audioTrack:this.audioTrack,id3Track:h,textTrack:this.txtTrack}}flush(){const r=this.timeOffset,i=this.videoTrack,s=this.txtTrack;i.samples=this.remainderData||new Uint8Array,this.remainderData=null;const o=this.extractID3Track(i,this.timeOffset);return s.samples=yr(r,i),{videoTrack:i,audioTrack:Vs(),id3Track:o,textTrack:Vs()}}extractID3Track(r,i){const s=this.id3Track;if(r.samples.length){const o=Ee(r.samples,["emsg"]);o&&o.forEach(u=>{const h=at(u);if(Wl.test(h.schemeIdUri)){const m=te(h.presentationTime)?h.presentationTime/h.timeScale:i+h.presentationTimeDelta/h.timeScale;let _=h.eventDuration===4294967295?Number.POSITIVE_INFINITY:h.eventDuration/h.timeScale;_<=.001&&(_=Number.POSITIVE_INFINITY);const w=h.payload;s.samples.push({data:w,len:w.byteLength,dts:m,pts:m,type:ni.emsg,duration:_})}})}return s}demuxSampleAes(r,i,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const ja=(d,r)=>{let i=0,s=5;r+=s;const o=new Uint32Array(1),u=new Uint32Array(1),h=new Uint8Array(1);for(;s>0;){h[0]=d[r];const m=Math.min(s,8),_=8-m;u[0]=4278190080>>>24+_<<_,o[0]=(h[0]&u[0])>>_,i=i?i<<m|o[0]:o[0],r+=1,s-=m}return i};class Po extends Da{constructor(r){super(),this.observer=void 0,this.observer=r}resetInitSegment(r,i,s,o){super.resetInitSegment(r,i,s,o),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}}canParse(r,i){return i+64<r.length}appendFrame(r,i,s){const o=pl(r,i,s,this.basePTS,this.frameIndex);if(o!==-1)return{sample:r.samples[r.samples.length-1],length:o,missing:0}}static probe(r){if(!r)return!1;const i=Et(r,0);if(!i)return!1;const s=i.length;return r[s]===11&&r[s+1]===119&&Be(i)!==void 0&&ja(r,s)<16}}function pl(d,r,i,s,o){if(i+8>r.length||r[i]!==11||r[i+1]!==119)return-1;const u=r[i+4]>>6;if(u>=3)return-1;const m=[48e3,44100,32e3][u],_=r[i+4]&63,E=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][_*3+u]*2;if(i+E>r.length)return-1;const L=r[i+6]>>5;let N=0;L===2?N+=2:(L&1&&L!==1&&(N+=2),L&4&&(N+=2));const J=(r[i+6]<<8|r[i+7])>>12-N&1,ne=[2,1,2,3,3,4,4,5][L]+J,de=r[i+5]>>3,$e=r[i+5]&7,ct=new Uint8Array([u<<6|de<<1|$e>>2,($e&3)<<6|L<<3|J<<2|_>>4,_<<4&224]),ht=1536/m*9e4,At=s+o*ht,yt=r.subarray(i,i+E);return d.config=ct,d.channelCount=ne,d.samplerate=m,d.samples.push({unit:yt,pts:At}),E}class w0{constructor(){this.VideoSample=null}createVideoSample(r,i,s,o){return{key:r,frame:!1,pts:i,dts:s,units:[],debug:o,length:0}}getLastNalUnit(r){var i;let s=this.VideoSample,o;if((!s||s.units.length===0)&&(s=r[r.length-1]),(i=s)!=null&&i.units){const u=s.units;o=u[u.length-1]}return o}pushAccessUnit(r,i){if(r.units.length&&r.frame){if(r.pts===void 0){const s=i.samples,o=s.length;if(o){const u=s[o-1];r.pts=u.pts,r.dts=u.dts}else{i.dropped++;return}}i.samples.push(r)}r.debug.length&&P.log(r.pts+"/"+r.dts+":"+r.debug)}}class jl{constructor(r){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=r,this.bytesAvailable=r.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const r=this.data,i=this.bytesAvailable,s=r.byteLength-i,o=new Uint8Array(4),u=Math.min(4,i);if(u===0)throw new Error("no bytes available");o.set(r.subarray(s,s+u)),this.word=new DataView(o.buffer).getUint32(0),this.bitsAvailable=u*8,this.bytesAvailable-=u}skipBits(r){let i;r=Math.min(r,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,i=r>>3,r-=i<<3,this.bytesAvailable-=i,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)}readBits(r){let i=Math.min(this.bitsAvailable,r);const s=this.word>>>32-i;if(r>32&&P.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=i,this.bitsAvailable>0)this.word<<=i;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return i=r-i,i>0&&this.bitsAvailable?s<<i|this.readBits(i):s}skipLZ(){let r;for(r=0;r<this.bitsAvailable;++r)if(this.word&2147483648>>>r)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const r=this.skipLZ();return this.readBits(r+1)-1}readEG(){const r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(r){let i=8,s=8,o;for(let u=0;u<r;u++)s!==0&&(o=this.readEG(),s=(i+o+256)%256),i=s===0?i:s}readSPS(){let r=0,i=0,s=0,o=0,u,h,m;const _=this.readUByte.bind(this),w=this.readBits.bind(this),E=this.readUEG.bind(this),L=this.readBoolean.bind(this),N=this.skipBits.bind(this),J=this.skipEG.bind(this),j=this.skipUEG.bind(this),ne=this.skipScalingList.bind(this);_();const de=_();if(w(5),N(3),_(),j(),de===100||de===110||de===122||de===244||de===44||de===83||de===86||de===118||de===128){const Qt=E();if(Qt===3&&N(1),j(),j(),N(1),L())for(h=Qt!==3?8:12,m=0;m<h;m++)L()&&(m<6?ne(16):ne(64))}j();const $e=E();if($e===0)E();else if($e===1)for(N(1),J(),J(),u=E(),m=0;m<u;m++)J();j(),N(1);const ct=E(),ht=E(),At=w(1);At===0&&N(1),N(1),L()&&(r=E(),i=E(),s=E(),o=E());let yt=[1,1];if(L()&&L())switch(_()){case 1:yt=[1,1];break;case 2:yt=[12,11];break;case 3:yt=[10,11];break;case 4:yt=[16,11];break;case 5:yt=[40,33];break;case 6:yt=[24,11];break;case 7:yt=[20,11];break;case 8:yt=[32,11];break;case 9:yt=[80,33];break;case 10:yt=[18,11];break;case 11:yt=[15,11];break;case 12:yt=[64,33];break;case 13:yt=[160,99];break;case 14:yt=[4,3];break;case 15:yt=[3,2];break;case 16:yt=[2,1];break;case 255:{yt=[_()<<8|_(),_()<<8|_()];break}}return{width:Math.ceil((ct+1)*16-r*2-i*2),height:(2-At)*(ht+1)*16-(At?2:4)*(s+o),pixelRatio:yt}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class S0 extends w0{parseAVCPES(r,i,s,o,u){const h=this.parseAVCNALu(r,s.data);let m=this.VideoSample,_,w=!1;s.data=null,m&&h.length&&!r.audFound&&(this.pushAccessUnit(m,r),m=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts,"")),h.forEach(E=>{var L;switch(E.type){case 1:{let ne=!1;_=!0;const de=E.data;if(w&&de.length>4){const $e=new jl(de).readSliceType();($e===2||$e===4||$e===7||$e===9)&&(ne=!0)}if(ne){var N;(N=m)!=null&&N.frame&&!m.key&&(this.pushAccessUnit(m,r),m=this.VideoSample=null)}m||(m=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),m.frame=!0,m.key=ne;break}case 5:_=!0,(L=m)!=null&&L.frame&&!m.key&&(this.pushAccessUnit(m,r),m=this.VideoSample=null),m||(m=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),m.key=!0,m.frame=!0;break;case 6:{_=!0,Ae(E.data,1,s.pts,i.samples);break}case 7:{var J,j;_=!0,w=!0;const ne=E.data,$e=new jl(ne).readSPS();if(!r.sps||r.width!==$e.width||r.height!==$e.height||((J=r.pixelRatio)==null?void 0:J[0])!==$e.pixelRatio[0]||((j=r.pixelRatio)==null?void 0:j[1])!==$e.pixelRatio[1]){r.width=$e.width,r.height=$e.height,r.pixelRatio=$e.pixelRatio,r.sps=[ne],r.duration=u;const ct=ne.subarray(1,4);let ht="avc1.";for(let At=0;At<3;At++){let yt=ct[At].toString(16);yt.length<2&&(yt="0"+yt),ht+=yt}r.codec=ht}break}case 8:_=!0,r.pps=[E.data];break;case 9:_=!0,r.audFound=!0,m&&this.pushAccessUnit(m,r),m=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts,"");break;case 12:_=!0;break;default:_=!1,m&&(m.debug+="unknown NAL "+E.type+" ");break}m&&_&&m.units.push(E)}),o&&m&&(this.pushAccessUnit(m,r),this.VideoSample=null)}parseAVCNALu(r,i){const s=i.byteLength;let o=r.naluState||0;const u=o,h=[];let m=0,_,w,E,L=-1,N=0;for(o===-1&&(L=0,N=i[0]&31,o=0,m=1);m<s;){if(_=i[m++],!o){o=_?0:1;continue}if(o===1){o=_?0:2;continue}if(!_)o=3;else if(_===1){if(w=m-o-1,L>=0){const J={data:i.subarray(L,w),type:N};h.push(J)}else{const J=this.getLastNalUnit(r.samples);J&&(u&&m<=4-u&&J.state&&(J.data=J.data.subarray(0,J.data.byteLength-u)),w>0&&(J.data=Kr(J.data,i.subarray(0,w)),J.state=0))}m<s?(E=i[m]&31,L=m,N=E,o=0):o=-1}else o=0}if(L>=0&&o>=0){const J={data:i.subarray(L,s),type:N,state:o};h.push(J)}if(h.length===0){const J=this.getLastNalUnit(r.samples);J&&(J.data=Kr(J.data,i))}return r.naluState=o,h}}class ml{constructor(r,i,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new Ca(i,{removePKCS7Padding:!1})}decryptBuffer(r){return this.decrypter.decrypt(r,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(r,i,s){const o=r[i].unit;if(o.length<=16)return;const u=o.subarray(16,o.length-o.length%16),h=u.buffer.slice(u.byteOffset,u.byteOffset+u.length);this.decryptBuffer(h).then(m=>{const _=new Uint8Array(m);o.set(_,16),this.decrypter.isSync()||this.decryptAacSamples(r,i+1,s)})}decryptAacSamples(r,i,s){for(;;i++){if(i>=r.length){s();return}if(!(r[i].unit.length<32)&&(this.decryptAacSample(r,i,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(r){const i=Math.floor((r.length-48)/160)*16+16,s=new Int8Array(i);let o=0;for(let u=32;u<r.length-16;u+=160,o+=16)s.set(r.subarray(u,u+16),o);return s}getAvcDecryptedUnit(r,i){const s=new Uint8Array(i);let o=0;for(let u=32;u<r.length-16;u+=160,o+=16)r.set(s.subarray(o,o+16),u);return r}decryptAvcSample(r,i,s,o,u){const h=Ct(u.data),m=this.getAvcEncryptedData(h);this.decryptBuffer(m.buffer).then(_=>{u.data=this.getAvcDecryptedUnit(h,_),this.decrypter.isSync()||this.decryptAvcSamples(r,i,s+1,o)})}decryptAvcSamples(r,i,s,o){if(r instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;i++,s=0){if(i>=r.length){o();return}const u=r[i].units;for(;!(s>=u.length);s++){const h=u[s];if(!(h.data.length<=48||h.type!==1&&h.type!==5)&&(this.decryptAvcSample(r,i,s,o,h),!this.decrypter.isSync()))return}}}}const us=188;class ks{constructor(r,i,s){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=r,this.config=i,this.typeSupported=s,this.videoParser=new S0}static probe(r){const i=ks.syncOffset(r);return i>0&&P.warn(`MPEG2-TS detected but first sync word found @ offset ${i}`),i!==-1}static syncOffset(r){const i=r.length;let s=Math.min(us*5,i-us)+1,o=0;for(;o<s;){let u=!1,h=-1,m=0;for(let _=o;_<i;_+=us)if(r[_]===71&&(i-_===us||r[_+us]===71)){if(m++,h===-1&&(h=_,h!==0&&(s=Math.min(h+us*99,r.length-us)+1)),u||(u=lo(r,_)===0),u&&m>1&&(h===0&&m>2||_+us>s))return h}else{if(m)return-1;break}o++}return-1}static createTrack(r,i){return{container:r==="video"||r==="audio"?"video/mp2t":void 0,type:r,id:Pt[r],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:r==="audio"?i:void 0}}resetInitSegment(r,i,s,o){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=ks.createTrack("video"),this._audioTrack=ks.createTrack("audio",o),this._id3Track=ks.createTrack("id3"),this._txtTrack=ks.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=i,this.videoCodec=s,this._duration=o}resetTimeStamp(){}resetContiguity(){const{_audioTrack:r,_videoTrack:i,_id3Track:s}=this;r&&(r.pesData=null),i&&(i.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(r,i,s=!1,o=!1){s||(this.sampleAes=null);let u;const h=this._videoTrack,m=this._audioTrack,_=this._id3Track,w=this._txtTrack;let E=h.pid,L=h.pesData,N=m.pid,J=_.pid,j=m.pesData,ne=_.pesData,de=null,$e=this.pmtParsed,ct=this._pmtId,ht=r.length;if(this.remainderData&&(r=Kr(this.remainderData,r),ht=r.length,this.remainderData=null),ht<us&&!o)return this.remainderData=r,{audioTrack:m,videoTrack:h,id3Track:_,textTrack:w};const At=Math.max(0,ks.syncOffset(r));ht-=(ht-At)%us,ht<r.byteLength&&!o&&(this.remainderData=new Uint8Array(r.buffer,ht,r.buffer.byteLength-ht));let yt=0;for(let zt=At;zt<ht;zt+=us)if(r[zt]===71){const pr=!!(r[zt+1]&64),Or=lo(r,zt),Zt=(r[zt+3]&48)>>4;let mr;if(Zt>1){if(mr=zt+5+r[zt+4],mr===zt+us)continue}else mr=zt+4;switch(Or){case E:pr&&(L&&(u=Ma(L))&&this.videoParser.parseAVCPES(h,w,u,!1,this._duration),L={data:[],size:0}),L&&(L.data.push(r.subarray(mr,zt+us)),L.size+=zt+us-mr);break;case N:if(pr){if(j&&(u=Ma(j)))switch(m.segmentCodec){case"aac":this.parseAACPES(m,u);break;case"mp3":this.parseMPEGPES(m,u);break;case"ac3":this.parseAC3PES(m,u);break}j={data:[],size:0}}j&&(j.data.push(r.subarray(mr,zt+us)),j.size+=zt+us-mr);break;case J:pr&&(ne&&(u=Ma(ne))&&this.parseID3PES(_,u),ne={data:[],size:0}),ne&&(ne.data.push(r.subarray(mr,zt+us)),ne.size+=zt+us-mr);break;case 0:pr&&(mr+=r[mr]+1),ct=this._pmtId=ga(r,mr);break;case ct:{pr&&(mr+=r[mr]+1);const un=ql(r,mr,this.typeSupported,s,this.observer);E=un.videoPid,E>0&&(h.pid=E,h.segmentCodec=un.segmentVideoCodec),N=un.audioPid,N>0&&(m.pid=N,m.segmentCodec=un.segmentAudioCodec),J=un.id3Pid,J>0&&(_.pid=J),de!==null&&!$e&&(P.warn(`MPEG-TS PMT found at ${zt} after unknown PID '${de}'. Backtracking to sync byte @${At} to parse all TS packets.`),de=null,zt=At-188),$e=this.pmtParsed=!0;break}case 17:case 8191:break;default:de=Or;break}}else yt++;yt>0&&uo(this.observer,new Error(`Found ${yt} TS packet/s that do not start with 0x47`)),h.pesData=L,m.pesData=j,_.pesData=ne;const Qt={audioTrack:m,videoTrack:h,id3Track:_,textTrack:w};return o&&this.extractRemainingSamples(Qt),Qt}flush(){const{remainderData:r}=this;this.remainderData=null;let i;return r?i=this.demux(r,-1,!1,!0):i={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(i),this.sampleAes?this.decrypt(i,this.sampleAes):i}extractRemainingSamples(r){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:u}=r,h=s.pesData,m=i.pesData,_=o.pesData;let w;if(h&&(w=Ma(h))?(this.videoParser.parseAVCPES(s,u,w,!0,this._duration),s.pesData=null):s.pesData=h,m&&(w=Ma(m))){switch(i.segmentCodec){case"aac":this.parseAACPES(i,w);break;case"mp3":this.parseMPEGPES(i,w);break;case"ac3":this.parseAC3PES(i,w);break}i.pesData=null}else m!=null&&m.size&&P.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=m;_&&(w=Ma(_))?(this.parseID3PES(o,w),o.pesData=null):o.pesData=_}demuxSampleAes(r,i,s){const o=this.demux(r,s,!0,!this.config.progressive),u=this.sampleAes=new ml(this.observer,this.config,i);return this.decrypt(o,u)}decrypt(r,i){return new Promise(s=>{const{audioTrack:o,videoTrack:u}=r;o.samples&&o.segmentCodec==="aac"?i.decryptAacSamples(o.samples,0,()=>{u.samples?i.decryptAvcSamples(u.samples,0,0,()=>{s(r)}):s(r)}):u.samples&&i.decryptAvcSamples(u.samples,0,0,()=>{s(r)})})}destroy(){this._duration=0}parseAACPES(r,i){let s=0;const o=this.aacOverFlow;let u=i.data;if(o){this.aacOverFlow=null;const L=o.missing,N=o.sample.unit.byteLength;if(L===-1)u=Kr(o.sample.unit,u);else{const J=N-L;o.sample.unit.set(u.subarray(0,L),J),r.samples.push(o.sample),s=o.missing}}let h,m;for(h=s,m=u.length;h<m-1&&!Es(u,h);h++);if(h!==s){let L;const N=h<m-1;if(N?L=`AAC PES did not start with ADTS header,offset:${h}`:L="No ADTS header found in AAC PES",uo(this.observer,new Error(L),N),!N)return}ul(r,this.observer,u,h,this.audioCodec);let _;if(i.pts!==void 0)_=i.pts;else if(o){const L=cl(r.samplerate);_=o.sample.pts+L}else{P.warn("[tsdemuxer]: AAC PES unknown PTS");return}let w=0,E;for(;h<m;)if(E=Oo(r,u,h,_,w),h+=E.length,E.missing){this.aacOverFlow=E;break}else for(w++;h<m-1&&!Es(u,h);h++);}parseMPEGPES(r,i){const s=i.data,o=s.length;let u=0,h=0;const m=i.pts;if(m===void 0){P.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<o;)if(js(s,h)){const _=Bo(r,s,h,m,u);if(_)h+=_.length,u++;else break}else h++}parseAC3PES(r,i){{const s=i.data,o=i.pts;if(o===void 0){P.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const u=s.length;let h=0,m=0,_;for(;m<u&&(_=pl(r,s,m,o,h++))>0;)m+=_}}parseID3PES(r,i){if(i.pts===void 0){P.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const s=c({},i,{type:this._videoTrack?ni.emsg:ni.audioId3,duration:Number.POSITIVE_INFINITY});r.samples.push(s)}}function lo(d,r){return((d[r+1]&31)<<8)+d[r+2]}function ga(d,r){return(d[r+10]&31)<<8|d[r+11]}function ql(d,r,i,s,o){const u={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},h=(d[r+1]&15)<<8|d[r+2],m=r+3+h-4,_=(d[r+10]&15)<<8|d[r+11];for(r+=12+_;r<m;){const w=lo(d,r),E=(d[r+3]&15)<<8|d[r+4];switch(d[r]){case 207:if(!s){ke("ADTS AAC");break}case 15:u.audioPid===-1&&(u.audioPid=w);break;case 21:u.id3Pid===-1&&(u.id3Pid=w);break;case 219:if(!s){ke("H.264");break}case 27:u.videoPid===-1&&(u.videoPid=w,u.segmentVideoCodec="avc");break;case 3:case 4:!i.mpeg&&!i.mp3?P.log("MPEG audio found, not supported in this browser"):u.audioPid===-1&&(u.audioPid=w,u.segmentAudioCodec="mp3");break;case 193:if(!s){ke("AC-3");break}case 129:i.ac3?u.audioPid===-1&&(u.audioPid=w,u.segmentAudioCodec="ac3"):P.log("AC-3 audio found, not supported in this browser");break;case 6:if(u.audioPid===-1&&E>0){let L=r+5,N=E;for(;N>2;){switch(d[L]){case 106:i.ac3!==!0?P.log("AC-3 audio found, not supported in this browser for now"):(u.audioPid=w,u.segmentAudioCodec="ac3");break}const j=d[L+1]+2;L+=j,N-=j}}break;case 194:case 135:return uo(o,new Error("Unsupported EC-3 in M2TS found")),u;case 36:return uo(o,new Error("Unsupported HEVC in M2TS found")),u}r+=E+5}return u}function uo(d,r,i){P.warn(`parsing error: ${r.message}`),d.emit(b.ERROR,b.ERROR,{type:M.MEDIA_ERROR,details:I.FRAG_PARSING_ERROR,fatal:!1,levelRetry:i,error:r,reason:r.message})}function ke(d){P.log(`${d} with AES-128-CBC encryption found in unencrypted stream`)}function Ma(d){let r=0,i,s,o,u,h;const m=d.data;if(!d||d.size===0)return null;for(;m[0].length<19&&m.length>1;)m[0]=Kr(m[0],m[1]),m.splice(1,1);if(i=m[0],(i[0]<<16)+(i[1]<<8)+i[2]===1){if(s=(i[4]<<8)+i[5],s&&s>d.size-6)return null;const w=i[7];w&192&&(u=(i[9]&14)*536870912+(i[10]&255)*4194304+(i[11]&254)*16384+(i[12]&255)*128+(i[13]&254)/2,w&64?(h=(i[14]&14)*536870912+(i[15]&255)*4194304+(i[16]&254)*16384+(i[17]&255)*128+(i[18]&254)/2,u-h>60*9e4&&(P.warn(`${Math.round((u-h)/9e4)}s delta between PTS and DTS, align them`),u=h)):h=u),o=i[8];let E=o+9;if(d.size<=E)return null;d.size-=E;const L=new Uint8Array(d.size);for(let N=0,J=m.length;N<J;N++){i=m[N];let j=i.byteLength;if(E)if(E>j){E-=j;continue}else i=i.subarray(E),j-=E,E=0;L.set(i,r),r+=j}return s&&(s-=o+3),{data:L,pts:u,dts:h,len:s}}return null}class Fo extends Da{resetInitSegment(r,i,s,o){super.resetInitSegment(r,i,s,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}}static probe(r){if(!r)return!1;const i=Et(r,0);let s=(i==null?void 0:i.length)||0;if(i&&r[s]===11&&r[s+1]===119&&Be(i)!==void 0&&ja(r,s)<=16)return!1;for(let o=r.length;s<o;s++)if(fl(r,s))return P.log("MPEG Audio sync word found !"),!0;return!1}canParse(r,i){return dl(r,i)}appendFrame(r,i,s){if(this.basePTS!==null)return Bo(r,i,s,this.basePTS,this.frameIndex)}}class No{static getSilentFrame(r,i){switch(r){case"mp4a.40.2":if(i===1)return new Uint8Array([0,200,0,128,35,128]);if(i===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(i===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(i===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(i===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(i===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(i===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(i===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(i===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const ua=Math.pow(2,32)-1;class wt{static init(){wt.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let r;for(r in wt.types)wt.types.hasOwnProperty(r)&&(wt.types[r]=[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3)]);const i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),s=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);wt.HDLR_TYPES={video:i,audio:s};const o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),u=new Uint8Array([0,0,0,0,0,0,0,0]);wt.STTS=wt.STSC=wt.STCO=u,wt.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),wt.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),wt.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),wt.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const h=new Uint8Array([105,115,111,109]),m=new Uint8Array([97,118,99,49]),_=new Uint8Array([0,0,0,1]);wt.FTYP=wt.box(wt.types.ftyp,h,_,h,m),wt.DINF=wt.box(wt.types.dinf,wt.box(wt.types.dref,o))}static box(r,...i){let s=8,o=i.length;const u=o;for(;o--;)s+=i[o].byteLength;const h=new Uint8Array(s);for(h[0]=s>>24&255,h[1]=s>>16&255,h[2]=s>>8&255,h[3]=s&255,h.set(r,4),o=0,s=8;o<u;o++)h.set(i[o],s),s+=i[o].byteLength;return h}static hdlr(r){return wt.box(wt.types.hdlr,wt.HDLR_TYPES[r])}static mdat(r){return wt.box(wt.types.mdat,r)}static mdhd(r,i){i*=r;const s=Math.floor(i/(ua+1)),o=Math.floor(i%(ua+1));return wt.box(wt.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,85,196,0,0]))}static mdia(r){return wt.box(wt.types.mdia,wt.mdhd(r.timescale,r.duration),wt.hdlr(r.type),wt.minf(r))}static mfhd(r){return wt.box(wt.types.mfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255]))}static minf(r){return r.type==="audio"?wt.box(wt.types.minf,wt.box(wt.types.smhd,wt.SMHD),wt.DINF,wt.stbl(r)):wt.box(wt.types.minf,wt.box(wt.types.vmhd,wt.VMHD),wt.DINF,wt.stbl(r))}static moof(r,i,s){return wt.box(wt.types.moof,wt.mfhd(r),wt.traf(s,i))}static moov(r){let i=r.length;const s=[];for(;i--;)s[i]=wt.trak(r[i]);return wt.box.apply(null,[wt.types.moov,wt.mvhd(r[0].timescale,r[0].duration)].concat(s).concat(wt.mvex(r)))}static mvex(r){let i=r.length;const s=[];for(;i--;)s[i]=wt.trex(r[i]);return wt.box.apply(null,[wt.types.mvex,...s])}static mvhd(r,i){i*=r;const s=Math.floor(i/(ua+1)),o=Math.floor(i%(ua+1)),u=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return wt.box(wt.types.mvhd,u)}static sdtp(r){const i=r.samples||[],s=new Uint8Array(4+i.length);let o,u;for(o=0;o<i.length;o++)u=i[o].flags,s[o+4]=u.dependsOn<<4|u.isDependedOn<<2|u.hasRedundancy;return wt.box(wt.types.sdtp,s)}static stbl(r){return wt.box(wt.types.stbl,wt.stsd(r),wt.box(wt.types.stts,wt.STTS),wt.box(wt.types.stsc,wt.STSC),wt.box(wt.types.stsz,wt.STSZ),wt.box(wt.types.stco,wt.STCO))}static avc1(r){let i=[],s=[],o,u,h;for(o=0;o<r.sps.length;o++)u=r.sps[o],h=u.byteLength,i.push(h>>>8&255),i.push(h&255),i=i.concat(Array.prototype.slice.call(u));for(o=0;o<r.pps.length;o++)u=r.pps[o],h=u.byteLength,s.push(h>>>8&255),s.push(h&255),s=s.concat(Array.prototype.slice.call(u));const m=wt.box(wt.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|r.sps.length].concat(i).concat([r.pps.length]).concat(s))),_=r.width,w=r.height,E=r.pixelRatio[0],L=r.pixelRatio[1];return wt.box(wt.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,_>>8&255,_&255,w>>8&255,w&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),m,wt.box(wt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),wt.box(wt.types.pasp,new Uint8Array([E>>24,E>>16&255,E>>8&255,E&255,L>>24,L>>16&255,L>>8&255,L&255])))}static esds(r){const i=r.config.length;return new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(r.config).concat([6,1,2]))}static audioStsd(r){const i=r.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0])}static mp4a(r){return wt.box(wt.types.mp4a,wt.audioStsd(r),wt.box(wt.types.esds,wt.esds(r)))}static mp3(r){return wt.box(wt.types[".mp3"],wt.audioStsd(r))}static ac3(r){return wt.box(wt.types["ac-3"],wt.audioStsd(r),wt.box(wt.types.dac3,r.config))}static stsd(r){return r.type==="audio"?r.segmentCodec==="mp3"&&r.codec==="mp3"?wt.box(wt.types.stsd,wt.STSD,wt.mp3(r)):r.segmentCodec==="ac3"?wt.box(wt.types.stsd,wt.STSD,wt.ac3(r)):wt.box(wt.types.stsd,wt.STSD,wt.mp4a(r)):wt.box(wt.types.stsd,wt.STSD,wt.avc1(r))}static tkhd(r){const i=r.id,s=r.duration*r.timescale,o=r.width,u=r.height,h=Math.floor(s/(ua+1)),m=Math.floor(s%(ua+1));return wt.box(wt.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,i&255,0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,m>>24,m>>16&255,m>>8&255,m&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,o>>8&255,o&255,0,0,u>>8&255,u&255,0,0]))}static traf(r,i){const s=wt.sdtp(r),o=r.id,u=Math.floor(i/(ua+1)),h=Math.floor(i%(ua+1));return wt.box(wt.types.traf,wt.box(wt.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),wt.box(wt.types.tfdt,new Uint8Array([1,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,h>>24,h>>16&255,h>>8&255,h&255])),wt.trun(r,s.length+16+20+8+16+8+8),s)}static trak(r){return r.duration=r.duration||4294967295,wt.box(wt.types.trak,wt.tkhd(r),wt.mdia(r))}static trex(r){const i=r.id;return wt.box(wt.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(r,i){const s=r.samples||[],o=s.length,u=12+16*o,h=new Uint8Array(u);let m,_,w,E,L,N;for(i+=8+u,h.set([r.type==="video"?1:0,0,15,1,o>>>24&255,o>>>16&255,o>>>8&255,o&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255],0),m=0;m<o;m++)_=s[m],w=_.duration,E=_.size,L=_.flags,N=_.cts,h.set([w>>>24&255,w>>>16&255,w>>>8&255,w&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,L.isLeading<<2|L.dependsOn,L.isDependedOn<<6|L.hasRedundancy<<4|L.paddingValue<<1|L.isNonSync,L.degradPrio&61440,L.degradPrio&15,N>>>24&255,N>>>16&255,N>>>8&255,N&255],12+16*m);return wt.box(wt.types.trun,h)}static initSegment(r){wt.types||wt.init();const i=wt.moov(r);return Kr(wt.FTYP,i)}}wt.types=void 0,wt.HDLR_TYPES=void 0,wt.STTS=void 0,wt.STSC=void 0,wt.STCO=void 0,wt.STSZ=void 0,wt.VMHD=void 0,wt.SMHD=void 0,wt.STSD=void 0,wt.FTYP=void 0,wt.DINF=void 0;const gl=9e4;function $o(d,r,i=1,s=!1){const o=d*r*i;return s?Math.round(o):o}function E0(d,r,i=1,s=!1){return $o(d,r,1/i,s)}function qa(d,r=!1){return $o(d,1e3,1/gl,r)}function Zl(d,r=1){return $o(d,gl,1/r)}const zo=10*1e3,Ko=1024,vl=1152,Yl=1536;let Za=null,yl=null;class co{constructor(r,i,s,o=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=r,this.config=i,this.typeSupported=s,this.ISGenerated=!1,Za===null){const h=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Za=h?parseInt(h[1]):0}if(yl===null){const u=navigator.userAgent.match(/Safari\/(\d+)/i);yl=u?parseInt(u[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(r){P.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=r}resetNextTimestamp(){P.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){P.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(r){let i=!1;const s=r[0].pts,o=r.reduce((u,h)=>{let m=h.pts,_=m-u;return _<-4294967296&&(i=!0,m=cs(m,s),_=m-u),_>0?u:m},s);return i&&P.debug("PTS rollover detected"),o}remux(r,i,s,o,u,h,m,_){let w,E,L,N,J,j,ne=u,de=u;const $e=r.pid>-1,ct=i.pid>-1,ht=i.samples.length,At=r.samples.length>0,yt=m&&ht>0||ht>1;if((!$e||At)&&(!ct||yt)||this.ISGenerated||m){if(this.ISGenerated){var zt,pr,Or,Zt;const Cn=this.videoTrackConfig;Cn&&(i.width!==Cn.width||i.height!==Cn.height||((zt=i.pixelRatio)==null?void 0:zt[0])!==((pr=Cn.pixelRatio)==null?void 0:pr[0])||((Or=i.pixelRatio)==null?void 0:Or[1])!==((Zt=Cn.pixelRatio)==null?void 0:Zt[1]))&&this.resetInitSegment()}else L=this.generateIS(r,i,u,h);const mr=this.isVideoContiguous;let un=-1,Wr;if(yt&&(un=ho(i.samples),!mr&&this.config.forceKeyFrameOnDiscontinuity))if(j=!0,un>0){P.warn(`[mp4-remuxer]: Dropped ${un} out of ${ht} video samples due to a missing keyframe`);const Cn=this.getVideoStartPts(i.samples);i.samples=i.samples.slice(un),i.dropped+=un,de+=(i.samples[0].pts-Cn)/i.inputTimeScale,Wr=de}else un===-1&&(P.warn(`[mp4-remuxer]: No keyframe found out of ${ht} video samples`),j=!1);if(this.ISGenerated){if(At&&yt){const Cn=this.getVideoStartPts(i.samples),Br=(cs(r.samples[0].pts,Cn)-Cn)/i.inputTimeScale;ne+=Math.max(0,Br),de+=Math.max(0,-Br)}if(At){if(r.samplerate||(P.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),L=this.generateIS(r,i,u,h)),E=this.remuxAudio(r,ne,this.isAudioContiguous,h,ct||yt||_===Ie.AUDIO?de:void 0),yt){const Cn=E?E.endPTS-E.startPTS:0;i.inputTimeScale||(P.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),L=this.generateIS(r,i,u,h)),w=this.remuxVideo(i,de,mr,Cn)}}else yt&&(w=this.remuxVideo(i,de,mr,0));w&&(w.firstKeyFrame=un,w.independent=un!==-1,w.firstKeyFramePTS=Wr)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(J=bl(s,u,this._initPTS,this._initDTS)),o.samples.length&&(N=k0(o,u,this._initPTS))),{audio:E,video:w,initSegment:L,independent:j,text:N,id3:J}}generateIS(r,i,s,o){const u=r.samples,h=i.samples,m=this.typeSupported,_={},w=this._initPTS;let E=!w||o,L="audio/mp4",N,J,j;if(E&&(N=J=1/0),r.config&&u.length){switch(r.timescale=r.samplerate,r.segmentCodec){case"mp3":m.mpeg?(L="audio/mpeg",r.codec=""):m.mp3&&(r.codec="mp3");break;case"ac3":r.codec="ac-3";break}_.audio={id:"audio",container:L,codec:r.codec,initSegment:r.segmentCodec==="mp3"&&m.mpeg?new Uint8Array(0):wt.initSegment([r]),metadata:{channelCount:r.channelCount}},E&&(j=r.inputTimeScale,!w||j!==w.timescale?N=J=u[0].pts-Math.round(j*s):E=!1)}if(i.sps&&i.pps&&h.length){if(i.timescale=i.inputTimeScale,_.video={id:"main",container:"video/mp4",codec:i.codec,initSegment:wt.initSegment([i]),metadata:{width:i.width,height:i.height}},E)if(j=i.inputTimeScale,!w||j!==w.timescale){const ne=this.getVideoStartPts(h),de=Math.round(j*s);J=Math.min(J,cs(h[0].dts,ne)-de),N=Math.min(N,ne-de)}else E=!1;this.videoTrackConfig={width:i.width,height:i.height,pixelRatio:i.pixelRatio}}if(Object.keys(_).length)return this.ISGenerated=!0,E?(this._initPTS={baseTime:N,timescale:j},this._initDTS={baseTime:J,timescale:j}):N=j=void 0,{tracks:_,initPTS:N,timescale:j}}remuxVideo(r,i,s,o){const u=r.inputTimeScale,h=r.samples,m=[],_=h.length,w=this._initPTS;let E=this.nextAvcDts,L=8,N=this.videoSampleDuration,J,j,ne=Number.POSITIVE_INFINITY,de=Number.NEGATIVE_INFINITY,$e=!1;if(!s||E===null){const tn=i*u,jr=h[0].pts-cs(h[0].dts,h[0].pts);Za&&E!==null&&Math.abs(tn-jr-E)<15e3?s=!0:E=tn-jr}const ct=w.baseTime*u/w.timescale;for(let tn=0;tn<_;tn++){const jr=h[tn];jr.pts=cs(jr.pts-ct,E),jr.dts=cs(jr.dts-ct,E),jr.dts<h[tn>0?tn-1:tn].dts&&($e=!0)}$e&&h.sort(function(tn,jr){const Qn=tn.dts-jr.dts,Pn=tn.pts-jr.pts;return Qn||Pn}),J=h[0].dts,j=h[h.length-1].dts;const ht=j-J,At=ht?Math.round(ht/(_-1)):N||r.inputTimeScale/30;if(s){const tn=J-E,jr=tn>At,Qn=tn<-1;if((jr||Qn)&&(jr?P.warn(`AVC: ${qa(tn,!0)} ms (${tn}dts) hole between fragments detected at ${i.toFixed(3)}`):P.warn(`AVC: ${qa(-tn,!0)} ms (${tn}dts) overlapping between fragments detected at ${i.toFixed(3)}`),!Qn||E>=h[0].pts||Za)){J=E;const Pn=h[0].pts-tn;if(jr)h[0].dts=J,h[0].pts=Pn;else for(let Ei=0;Ei<h.length&&!(h[Ei].dts>Pn);Ei++)h[Ei].dts-=tn,h[Ei].pts-=tn;P.log(`Video: Initial PTS/DTS adjusted: ${qa(Pn,!0)}/${qa(J,!0)}, delta: ${qa(tn,!0)} ms`)}}J=Math.max(0,J);let yt=0,Qt=0,zt=J;for(let tn=0;tn<_;tn++){const jr=h[tn],Qn=jr.units,Pn=Qn.length;let Ei=0;for(let ys=0;ys<Pn;ys++)Ei+=Qn[ys].data.length;Qt+=Ei,yt+=Pn,jr.length=Ei,jr.dts<zt?(jr.dts=zt,zt+=At/4|0||1):zt=jr.dts,ne=Math.min(jr.pts,ne),de=Math.max(jr.pts,de)}j=h[_-1].dts;const pr=Qt+4*yt+8;let Or;try{Or=new Uint8Array(pr)}catch(tn){this.observer.emit(b.ERROR,b.ERROR,{type:M.MUX_ERROR,details:I.REMUX_ALLOC_ERROR,fatal:!1,error:tn,bytes:pr,reason:`fail allocating video mdat ${pr}`});return}const Zt=new DataView(Or.buffer);Zt.setUint32(0,pr),Or.set(wt.types.mdat,4);let mr=!1,un=Number.POSITIVE_INFINITY,Wr=Number.POSITIVE_INFINITY,Cn=Number.NEGATIVE_INFINITY,kt=Number.NEGATIVE_INFINITY;for(let tn=0;tn<_;tn++){const jr=h[tn],Qn=jr.units;let Pn=0;for(let As=0,ss=Qn.length;As<ss;As++){const vi=Qn[As],Qa=vi.data,r0=vi.data.byteLength;Zt.setUint32(L,r0),L+=4,Or.set(Qa,L),L+=r0,Pn+=4+r0}let Ei;if(tn<_-1)N=h[tn+1].dts-jr.dts,Ei=h[tn+1].pts-jr.pts;else{const As=this.config,ss=tn>0?jr.dts-h[tn-1].dts:At;if(Ei=tn>0?jr.pts-h[tn-1].pts:At,As.stretchShortVideoTrack&&this.nextAudioPts!==null){const vi=Math.floor(As.maxBufferHole*u),Qa=(o?ne+o*u:this.nextAudioPts)-jr.pts;Qa>vi?(N=Qa-ss,N<0?N=ss:mr=!0,P.log(`[mp4-remuxer]: It is approximately ${Qa/90} ms to the next segment; using duration ${N/90} ms for the last video frame.`)):N=ss}else N=ss}const ys=Math.round(jr.pts-jr.dts);un=Math.min(un,N),Cn=Math.max(Cn,N),Wr=Math.min(Wr,Ei),kt=Math.max(kt,Ei),m.push(new K(jr.key,N,Pn,ys))}if(m.length){if(Za){if(Za<70){const tn=m[0].flags;tn.dependsOn=2,tn.isNonSync=0}}else if(yl&&kt-Wr<Cn-un&&At/Cn<.025&&m[0].cts===0){P.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let tn=J;for(let jr=0,Qn=m.length;jr<Qn;jr++){const Pn=tn+m[jr].duration,Ei=tn+m[jr].cts;if(jr<Qn-1){const ys=Pn+m[jr+1].cts;m[jr].duration=ys-Ei}else m[jr].duration=jr?m[jr-1].duration:At;m[jr].cts=0,tn=Pn}}}N=mr||!N?At:N,this.nextAvcDts=E=j+N,this.videoSampleDuration=N,this.isVideoContiguous=!0;const Bi={data1:wt.moof(r.sequenceNumber++,J,c({},r,{samples:m})),data2:Or,startPTS:ne/u,endPTS:(de+N)/u,startDTS:J/u,endDTS:E/u,type:"video",hasAudio:!1,hasVideo:!0,nb:m.length,dropped:r.dropped};return r.samples=[],r.dropped=0,Bi}getSamplesPerFrame(r){switch(r.segmentCodec){case"mp3":return vl;case"ac3":return Yl;default:return Ko}}remuxAudio(r,i,s,o,u){const h=r.inputTimeScale,m=r.samplerate?r.samplerate:h,_=h/m,w=this.getSamplesPerFrame(r),E=w*_,L=this._initPTS,N=r.segmentCodec==="mp3"&&this.typeSupported.mpeg,J=[],j=u!==void 0;let ne=r.samples,de=N?0:8,$e=this.nextAudioPts||-1;const ct=i*h,ht=L.baseTime*h/L.timescale;if(this.isAudioContiguous=s=s||ne.length&&$e>0&&(o&&Math.abs(ct-$e)<9e3||Math.abs(cs(ne[0].pts-ht,ct)-$e)<20*E),ne.forEach(function(Br){Br.pts=cs(Br.pts-ht,ct)}),!s||$e<0){if(ne=ne.filter(Br=>Br.pts>=0),!ne.length)return;u===0?$e=0:o&&!j?$e=Math.max(0,ct):$e=ne[0].pts}if(r.segmentCodec==="aac"){const Br=this.config.maxAudioFramesDrift;for(let fi=0,Bi=$e;fi<ne.length;fi++){const tn=ne[fi],jr=tn.pts,Qn=jr-Bi,Pn=Math.abs(1e3*Qn/h);if(Qn<=-Br*E&&j)fi===0&&(P.warn(`Audio frame @ ${(jr/h).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*Qn/h)} ms.`),this.nextAudioPts=$e=Bi=jr);else if(Qn>=Br*E&&Pn<zo&&j){let Ei=Math.round(Qn/E);Bi=jr-Ei*E,Bi<0&&(Ei--,Bi+=E),fi===0&&(this.nextAudioPts=$e=Bi),P.warn(`[mp4-remuxer]: Injecting ${Ei} audio frame @ ${(Bi/h).toFixed(3)}s due to ${Math.round(1e3*Qn/h)} ms gap.`);for(let ys=0;ys<Ei;ys++){const As=Math.max(Bi,0);let ss=No.getSilentFrame(r.manifestCodec||r.codec,r.channelCount);ss||(P.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ss=tn.unit.subarray()),ne.splice(fi,0,{unit:ss,pts:As}),Bi+=E,fi++}}tn.pts=Bi,Bi+=E}}let At=null,yt=null,Qt,zt=0,pr=ne.length;for(;pr--;)zt+=ne[pr].unit.byteLength;for(let Br=0,fi=ne.length;Br<fi;Br++){const Bi=ne[Br],tn=Bi.unit;let jr=Bi.pts;if(yt!==null){const Pn=J[Br-1];Pn.duration=Math.round((jr-yt)/_)}else if(s&&r.segmentCodec==="aac"&&(jr=$e),At=jr,zt>0){zt+=de;try{Qt=new Uint8Array(zt)}catch(Pn){this.observer.emit(b.ERROR,b.ERROR,{type:M.MUX_ERROR,details:I.REMUX_ALLOC_ERROR,fatal:!1,error:Pn,bytes:zt,reason:`fail allocating audio mdat ${zt}`});return}N||(new DataView(Qt.buffer).setUint32(0,zt),Qt.set(wt.types.mdat,4))}else return;Qt.set(tn,de);const Qn=tn.byteLength;de+=Qn,J.push(new K(!0,w,Qn,0)),yt=jr}const Or=J.length;if(!Or)return;const Zt=J[J.length-1];this.nextAudioPts=$e=yt+_*Zt.duration;const mr=N?new Uint8Array(0):wt.moof(r.sequenceNumber++,At/_,c({},r,{samples:J}));r.samples=[];const un=At/h,Wr=$e/h,kt={data1:mr,data2:Qt,startPTS:un,endPTS:Wr,startDTS:un,endDTS:Wr,type:"audio",hasAudio:!0,hasVideo:!1,nb:Or};return this.isAudioContiguous=!0,kt}remuxEmptyAudio(r,i,s,o){const u=r.inputTimeScale,h=r.samplerate?r.samplerate:u,m=u/h,_=this.nextAudioPts,w=this._initDTS,E=w.baseTime*9e4/w.timescale,L=(_!==null?_:o.startDTS*u)+E,N=o.endDTS*u+E,J=m*Ko,j=Math.ceil((N-L)/J),ne=No.getSilentFrame(r.manifestCodec||r.codec,r.channelCount);if(P.warn("[mp4-remuxer]: remux empty Audio"),!ne){P.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const de=[];for(let $e=0;$e<j;$e++){const ct=L+$e*J;de.push({unit:ne,pts:ct,dts:ct})}return r.samples=de,this.remuxAudio(r,i,s,!1)}}function cs(d,r){let i;if(r===null)return d;for(r<d?i=-8589934592:i=8589934592;Math.abs(d-r)>4294967296;)d+=i;return d}function ho(d){for(let r=0;r<d.length;r++)if(d[r].key)return r;return-1}function bl(d,r,i,s){const o=d.samples.length;if(!o)return;const u=d.inputTimeScale;for(let m=0;m<o;m++){const _=d.samples[m];_.pts=cs(_.pts-i.baseTime*u/i.timescale,r*u)/u,_.dts=cs(_.dts-s.baseTime*u/s.timescale,r*u)/u}const h=d.samples;return d.samples=[],{samples:h}}function k0(d,r,i){const s=d.samples.length;if(!s)return;const o=d.inputTimeScale;for(let h=0;h<s;h++){const m=d.samples[h];m.pts=cs(m.pts-i.baseTime*o/i.timescale,r*o)/o}d.samples.sort((h,m)=>h.pts-m.pts);const u=d.samples;return d.samples=[],{samples:u}}class K{constructor(r,i,s,o){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=i,this.size=s,this.cts=o,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:r?2:1,isNonSync:r?0:1}}}class p{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(r){this.initPTS=r,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(r,i,s,o){this.audioCodec=i,this.videoCodec=s,this.generateInitSegment(H(r,o)),this.emitInitSegment=!0}generateInitSegment(r){let{audioCodec:i,videoCodec:s}=this;if(!(r!=null&&r.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const o=this.initData=Ze(r);o.audio&&(i=y(o.audio,ie.AUDIO)),o.video&&(s=y(o.video,ie.VIDEO));const u={};o.audio&&o.video?u.audiovideo={container:"video/mp4",codec:i+","+s,initSegment:r,id:"main"}:o.audio?u.audio={container:"audio/mp4",codec:i,initSegment:r,id:"audio"}:o.video?u.video={container:"video/mp4",codec:s,initSegment:r,id:"main"}:P.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u}remux(r,i,s,o,u,h){var m,_;let{initPTS:w,lastEndTime:E}=this;const L={audio:void 0,video:void 0,text:o,id3:s,initSegment:void 0};te(E)||(E=this.lastEndTime=u||0);const N=i.samples;if(!(N!=null&&N.length))return L;const J={initPTS:void 0,timescale:1};let j=this.initData;if((m=j)!=null&&m.length||(this.generateInitSegment(N),j=this.initData),!((_=j)!=null&&_.length))return P.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),L;this.emitInitSegment&&(J.tracks=this.initTracks,this.emitInitSegment=!1);const ne=qt(N,j),de=Se(j,N),$e=de===null?u:de;(v(w,$e,u,ne)||J.timescale!==w.timescale&&h)&&(J.initPTS=$e-u,w&&w.timescale===1&&P.warn(`Adjusting initPTS by ${J.initPTS-w.baseTime}`),this.initPTS=w={baseTime:J.initPTS,timescale:1});const ct=r?$e-w.baseTime/w.timescale:E,ht=ct+ne;Xr(j,N,w.baseTime/w.timescale),ne>0?this.lastEndTime=ht:(P.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const At=!!j.audio,yt=!!j.video;let Qt="";At&&(Qt+="audio"),yt&&(Qt+="video");const zt={data1:N,startPTS:ct,startDTS:ct,endPTS:ht,endDTS:ht,type:Qt,hasAudio:At,hasVideo:yt,nb:1,dropped:0};return L.audio=zt.type==="audio"?zt:void 0,L.video=zt.type!=="audio"?zt:void 0,L.initSegment=J,L.id3=bl(s,u,w,w),o.samples.length&&(L.text=k0(o,u,w)),L}}function v(d,r,i,s){if(d===null)return!0;const o=Math.max(s,1),u=r-d.baseTime/d.timescale;return Math.abs(u-i)>o}function y(d,r){const i=d==null?void 0:d.codec;if(i&&i.length>4)return i;if(r===ie.AUDIO){if(i==="ec-3"||i==="ac-3"||i==="alac")return i;if(i==="fLaC"||i==="Opus")return _r(i,!1);const s="mp4a.40.5";return P.info(`Parsed audio codec "${i}" or audio object type not handled. Using "${s}"`),s}return P.warn(`Unhandled video codec "${i}"`),i==="hvc1"||i==="hev1"?"hvc1.1.6.L120.90":i==="av01"?"av01.0.04M.08":"avc1.42e01e"}let x;try{x=self.performance.now.bind(self.performance)}catch(d){P.debug("Unable to use Performance API on this environment"),x=tt==null?void 0:tt.Date.now}const O=[{demux:x0,remux:p},{demux:ks,remux:co},{demux:Vl,remux:co},{demux:Fo,remux:co}];O.splice(2,0,{demux:Po,remux:co});class z{constructor(r,i,s,o,u){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=r,this.typeSupported=i,this.config=s,this.vendor=o,this.id=u}configure(r){this.transmuxConfig=r,this.decrypter&&this.decrypter.reset()}push(r,i,s,o){const u=s.transmuxing;u.executeStart=x();let h=new Uint8Array(r);const{currentTransmuxState:m,transmuxConfig:_}=this;o&&(this.currentTransmuxState=o);const{contiguous:w,discontinuity:E,trackSwitch:L,accurateTimeOffset:N,timeOffset:J,initSegmentChange:j}=o||m,{audioCodec:ne,videoCodec:de,defaultInitPts:$e,duration:ct,initSegmentData:ht}=_,At=oe(h,i);if(At&&At.method==="AES-128"){const pr=this.getDecrypter();if(pr.isSync()){let Or=pr.softwareDecrypt(h,At.key.buffer,At.iv.buffer);if(s.part>-1&&(Or=pr.flush()),!Or)return u.executeEnd=x(),be(s);h=new Uint8Array(Or)}else return this.decryptionPromise=pr.webCryptoDecrypt(h,At.key.buffer,At.iv.buffer).then(Or=>{const Zt=this.push(Or,null,s);return this.decryptionPromise=null,Zt}),this.decryptionPromise}const yt=this.needsProbing(E,L);if(yt){const pr=this.configureTransmuxer(h);if(pr)return P.warn(`[transmuxer] ${pr.message}`),this.observer.emit(b.ERROR,b.ERROR,{type:M.MEDIA_ERROR,details:I.FRAG_PARSING_ERROR,fatal:!1,error:pr,reason:pr.message}),u.executeEnd=x(),be(s)}(E||L||j||yt)&&this.resetInitSegment(ht,ne,de,ct,i),(E||j||yt)&&this.resetInitialTimestamp($e),w||this.resetContiguity();const Qt=this.transmux(h,At,J,N,s),zt=this.currentTransmuxState;return zt.contiguous=!0,zt.discontinuity=!1,zt.trackSwitch=!1,u.executeEnd=x(),Qt}flush(r){const i=r.transmuxing;i.executeStart=x();const{decrypter:s,currentTransmuxState:o,decryptionPromise:u}=this;if(u)return u.then(()=>this.flush(r));const h=[],{timeOffset:m}=o;if(s){const L=s.flush();L&&h.push(this.push(L,null,r))}const{demuxer:_,remuxer:w}=this;if(!_||!w)return i.executeEnd=x(),[be(r)];const E=_.flush(m);return Re(E)?E.then(L=>(this.flushRemux(h,L,r),h)):(this.flushRemux(h,E,r),h)}flushRemux(r,i,s){const{audioTrack:o,videoTrack:u,id3Track:h,textTrack:m}=i,{accurateTimeOffset:_,timeOffset:w}=this.currentTransmuxState;P.log(`[transmuxer.ts]: Flushed fragment ${s.sn}${s.part>-1?" p: "+s.part:""} of level ${s.level}`);const E=this.remuxer.remux(o,u,h,m,w,_,!0,this.id);r.push({remuxResult:E,chunkMeta:s}),s.transmuxing.executeEnd=x()}resetInitialTimestamp(r){const{demuxer:i,remuxer:s}=this;!i||!s||(i.resetTimeStamp(r),s.resetTimeStamp(r))}resetContiguity(){const{demuxer:r,remuxer:i}=this;!r||!i||(r.resetContiguity(),i.resetNextTimestamp())}resetInitSegment(r,i,s,o,u){const{demuxer:h,remuxer:m}=this;!h||!m||(h.resetInitSegment(r,i,s,o),m.resetInitSegment(r,i,s,u))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(r,i,s,o,u){let h;return i&&i.method==="SAMPLE-AES"?h=this.transmuxSampleAes(r,i,s,o,u):h=this.transmuxUnencrypted(r,s,o,u),h}transmuxUnencrypted(r,i,s,o){const{audioTrack:u,videoTrack:h,id3Track:m,textTrack:_}=this.demuxer.demux(r,i,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(u,h,m,_,i,s,!1,this.id),chunkMeta:o}}transmuxSampleAes(r,i,s,o,u){return this.demuxer.demuxSampleAes(r,i,s).then(h=>({remuxResult:this.remuxer.remux(h.audioTrack,h.videoTrack,h.id3Track,h.textTrack,s,o,!1,this.id),chunkMeta:u}))}configureTransmuxer(r){const{config:i,observer:s,typeSupported:o,vendor:u}=this;let h;for(let N=0,J=O.length;N<J;N++){var m;if((m=O[N].demux)!=null&&m.probe(r)){h=O[N];break}}if(!h)return new Error("Failed to find demuxer by probing fragment data");const _=this.demuxer,w=this.remuxer,E=h.remux,L=h.demux;(!w||!(w instanceof E))&&(this.remuxer=new E(s,i,o,u)),(!_||!(_ instanceof L))&&(this.demuxer=new L(s,i,o),this.probe=L.probe)}needsProbing(r,i){return!this.demuxer||!this.remuxer||r||i}getDecrypter(){let r=this.decrypter;return r||(r=this.decrypter=new Ca(this.config)),r}}function oe(d,r){let i=null;return d.byteLength>0&&(r==null?void 0:r.key)!=null&&r.iv!==null&&r.method!=null&&(i=r),i}const be=d=>({remuxResult:{},chunkMeta:d});function Re(d){return"then"in d&&d.then instanceof Function}class it{constructor(r,i,s,o,u){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=r,this.videoCodec=i,this.initSegmentData=s,this.duration=o,this.defaultInitPts=u||null}}class dt{constructor(r,i,s,o,u,h){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=r,this.contiguous=i,this.accurateTimeOffset=s,this.trackSwitch=o,this.timeOffset=u,this.initSegmentChange=h}}var It={exports:{}};(function(d){var r=Object.prototype.hasOwnProperty,i="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(i=!1));function o(_,w,E){this.fn=_,this.context=w,this.once=E||!1}function u(_,w,E,L,N){if(typeof E!="function")throw new TypeError("The listener must be a function");var J=new o(E,L||_,N),j=i?i+w:w;return _._events[j]?_._events[j].fn?_._events[j]=[_._events[j],J]:_._events[j].push(J):(_._events[j]=J,_._eventsCount++),_}function h(_,w){--_._eventsCount===0?_._events=new s:delete _._events[w]}function m(){this._events=new s,this._eventsCount=0}m.prototype.eventNames=function(){var w=[],E,L;if(this._eventsCount===0)return w;for(L in E=this._events)r.call(E,L)&&w.push(i?L.slice(1):L);return Object.getOwnPropertySymbols?w.concat(Object.getOwnPropertySymbols(E)):w},m.prototype.listeners=function(w){var E=i?i+w:w,L=this._events[E];if(!L)return[];if(L.fn)return[L.fn];for(var N=0,J=L.length,j=new Array(J);N<J;N++)j[N]=L[N].fn;return j},m.prototype.listenerCount=function(w){var E=i?i+w:w,L=this._events[E];return L?L.fn?1:L.length:0},m.prototype.emit=function(w,E,L,N,J,j){var ne=i?i+w:w;if(!this._events[ne])return!1;var de=this._events[ne],$e=arguments.length,ct,ht;if(de.fn){switch(de.once&&this.removeListener(w,de.fn,void 0,!0),$e){case 1:return de.fn.call(de.context),!0;case 2:return de.fn.call(de.context,E),!0;case 3:return de.fn.call(de.context,E,L),!0;case 4:return de.fn.call(de.context,E,L,N),!0;case 5:return de.fn.call(de.context,E,L,N,J),!0;case 6:return de.fn.call(de.context,E,L,N,J,j),!0}for(ht=1,ct=new Array($e-1);ht<$e;ht++)ct[ht-1]=arguments[ht];de.fn.apply(de.context,ct)}else{var At=de.length,yt;for(ht=0;ht<At;ht++)switch(de[ht].once&&this.removeListener(w,de[ht].fn,void 0,!0),$e){case 1:de[ht].fn.call(de[ht].context);break;case 2:de[ht].fn.call(de[ht].context,E);break;case 3:de[ht].fn.call(de[ht].context,E,L);break;case 4:de[ht].fn.call(de[ht].context,E,L,N);break;default:if(!ct)for(yt=1,ct=new Array($e-1);yt<$e;yt++)ct[yt-1]=arguments[yt];de[ht].fn.apply(de[ht].context,ct)}}return!0},m.prototype.on=function(w,E,L){return u(this,w,E,L,!1)},m.prototype.once=function(w,E,L){return u(this,w,E,L,!0)},m.prototype.removeListener=function(w,E,L,N){var J=i?i+w:w;if(!this._events[J])return this;if(!E)return h(this,J),this;var j=this._events[J];if(j.fn)j.fn===E&&(!N||j.once)&&(!L||j.context===L)&&h(this,J);else{for(var ne=0,de=[],$e=j.length;ne<$e;ne++)(j[ne].fn!==E||N&&!j[ne].once||L&&j[ne].context!==L)&&de.push(j[ne]);de.length?this._events[J]=de.length===1?de[0]:de:h(this,J)}return this},m.prototype.removeAllListeners=function(w){var E;return w?(E=i?i+w:w,this._events[E]&&h(this,E)):(this._events=new s,this._eventsCount=0),this},m.prototype.off=m.prototype.removeListener,m.prototype.addListener=m.prototype.on,m.prefixed=i,m.EventEmitter=m,d.exports=m})(It);var Xt=It.exports,ar=Ce(Xt);class Sr{constructor(r,i,s,o){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const u=r.config;this.hls=r,this.id=i,this.useWorker=!!u.enableWorker,this.onTransmuxComplete=s,this.onFlush=o;const h=(w,E)=>{E=E||{},E.frag=this.frag,E.id=this.id,w===b.ERROR&&(this.error=E.error),this.hls.trigger(w,E)};this.observer=new ar,this.observer.on(b.FRAG_DECRYPTED,h),this.observer.on(b.ERROR,h);const m=dn(u.preferManagedMediaSource)||{isTypeSupported:()=>!1},_={mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:m.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker!="undefined"&&(u.workerPath||Kl())){try{u.workerPath?(P.log(`loading Web Worker ${u.workerPath} for "${i}"`),this.workerContext=ol(u.workerPath)):(P.log(`injecting Web Worker for "${i}"`),this.workerContext=al()),this.onwmsg=L=>this.onWorkerMessage(L);const{worker:E}=this.workerContext;E.addEventListener("message",this.onwmsg),E.onerror=L=>{const N=new Error(`${L.message} (${L.filename}:${L.lineno})`);u.enableWorker=!1,P.warn(`Error in "${i}" Web Worker, fallback to inline`),this.hls.trigger(b.ERROR,{type:M.OTHER_ERROR,details:I.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:N})},E.postMessage({cmd:"init",typeSupported:_,vendor:"",id:i,config:JSON.stringify(u)})}catch(E){P.warn(`Error setting up "${i}" Web Worker, fallback to inline`,E),this.resetWorker(),this.error=null,this.transmuxer=new z(this.observer,_,u,"",i)}return}this.transmuxer=new z(this.observer,_,u,"",i)}resetWorker(){if(this.workerContext){const{worker:r,objectURL:i}=this.workerContext;i&&self.URL.revokeObjectURL(i),r.removeEventListener("message",this.onwmsg),r.onerror=null,r.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}const r=this.observer;r&&r.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(r,i,s,o,u,h,m,_,w,E){var L,N;w.transmuxing.start=self.performance.now();const{transmuxer:J}=this,j=h?h.start:u.start,ne=u.decryptdata,de=this.frag,$e=!(de&&u.cc===de.cc),ct=!(de&&w.level===de.level),ht=de?w.sn-de.sn:-1,At=this.part?w.part-this.part.index:-1,yt=ht===0&&w.id>1&&w.id===(de==null?void 0:de.stats.chunkCount),Qt=!ct&&(ht===1||ht===0&&(At===1||yt&&At<=0)),zt=self.performance.now();(ct||ht||u.stats.parsing.start===0)&&(u.stats.parsing.start=zt),h&&(At||!Qt)&&(h.stats.parsing.start=zt);const pr=!(de&&((L=u.initSegment)==null?void 0:L.url)===((N=de.initSegment)==null?void 0:N.url)),Or=new dt($e,Qt,_,ct,j,pr);if(!Qt||$e||pr){P.log(`[transmuxer-interface, ${u.type}]: Starting new transmux session for sn: ${w.sn} p: ${w.part} level: ${w.level} id: ${w.id}
discontinuity: ${$e}
trackSwitch: ${ct}
contiguous: ${Qt}
accurateTimeOffset: ${_}
timeOffset: ${j}
initSegmentChange: ${pr}`);const Zt=new it(s,o,i,m,E);this.configureTransmuxer(Zt)}if(this.frag=u,this.part=h,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:r,decryptdata:ne,chunkMeta:w,state:Or},r instanceof ArrayBuffer?[r]:[]);else if(J){const Zt=J.push(r,ne,w,Or);Re(Zt)?(J.async=!0,Zt.then(mr=>{this.handleTransmuxComplete(mr)}).catch(mr=>{this.transmuxerError(mr,w,"transmuxer-interface push error")})):(J.async=!1,this.handleTransmuxComplete(Zt))}}flush(r){r.transmuxing.start=self.performance.now();const{transmuxer:i}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:r});else if(i){let s=i.flush(r);Re(s)||i.async?(Re(s)||(s=Promise.resolve(s)),s.then(u=>{this.handleFlushResult(u,r)}).catch(u=>{this.transmuxerError(u,r,"transmuxer-interface flush error")})):this.handleFlushResult(s,r)}}transmuxerError(r,i,s){this.hls&&(this.error=r,this.hls.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.FRAG_PARSING_ERROR,chunkMeta:i,frag:this.frag||void 0,fatal:!1,error:r,err:r,reason:s}))}handleFlushResult(r,i){r.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(i)}onWorkerMessage(r){const i=r.data;if(!(i!=null&&i.event)){P.warn(`worker message received with no ${i?"event name":"data"}`);return}const s=this.hls;if(this.hls)switch(i.event){case"init":{var o;const u=(o=this.workerContext)==null?void 0:o.objectURL;u&&self.URL.revokeObjectURL(u);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}case"workerLog":P[i.data.logType]&&P[i.data.logType](i.data.message);break;default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,s.trigger(i.event,i.data);break}}}configureTransmuxer(r){const{transmuxer:i}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:r}):i&&i.configure(r)}handleTransmuxComplete(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)}}const Vr=100;class En extends Wa{constructor(r,i,s){super(r,i,s,"[audio-stream-controller]",Ie.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:r}=this;r.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.LEVEL_LOADED,this.onLevelLoaded,this),r.on(b.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),r.on(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.on(b.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.on(b.ERROR,this.onError,this),r.on(b.BUFFER_RESET,this.onBufferReset,this),r.on(b.BUFFER_CREATED,this.onBufferCreated,this),r.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(b.BUFFER_FLUSHED,this.onBufferFlushed,this),r.on(b.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(b.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:r}=this;r.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.LEVEL_LOADED,this.onLevelLoaded,this),r.off(b.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),r.off(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.off(b.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.off(b.ERROR,this.onError,this),r.off(b.BUFFER_RESET,this.onBufferReset,this),r.off(b.BUFFER_CREATED,this.onBufferCreated,this),r.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(b.BUFFER_FLUSHED,this.onBufferFlushed,this),r.off(b.INIT_PTS_FOUND,this.onInitPtsFound,this),r.off(b.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(r,{frag:i,id:s,initPTS:o,timescale:u}){if(s==="main"){const h=i.cc;this.initPTS[i.cc]={baseTime:o,timescale:u},this.log(`InitPTS for cc: ${h} found from main: ${o}`),this.videoTrackCC=h,this.state===Wt.WAITING_INIT_PTS&&this.tick()}}startLoad(r){if(!this.levels){this.startPosition=r,this.state=Wt.STOPPED;return}const i=this.lastCurrentTime;this.stopLoad(),this.setInterval(Vr),i>0&&r===-1?(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),r=i,this.state=Wt.IDLE):(this.loadedmetadata=!1,this.state=Wt.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=r,this.tick()}doTick(){switch(this.state){case Wt.IDLE:this.doTickIdle();break;case Wt.WAITING_TRACK:{var r;const{levels:s,trackId:o}=this,u=s==null||(r=s[o])==null?void 0:r.details;if(u){if(this.waitForCdnTuneIn(u))break;this.state=Wt.WAITING_INIT_PTS}break}case Wt.FRAG_LOADING_WAITING_RETRY:{var i;const s=performance.now(),o=this.retryDate;if(!o||s>=o||(i=this.media)!=null&&i.seeking){const{levels:u,trackId:h}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((u==null?void 0:u[h])||null),this.state=Wt.IDLE}break}case Wt.WAITING_INIT_PTS:{const s=this.waitingData;if(s){const{frag:o,part:u,cache:h,complete:m}=s;if(this.initPTS[o.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=Wt.FRAG_LOADING;const _=h.flush(),w={frag:o,part:u,payload:_,networkDetails:null};this._handleFragmentLoadProgress(w),m&&super._handleFragmentLoadComplete(w)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${o.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const _=this.getLoadPosition(),w=Jn.bufferInfo(this.mediaBuffer,_,this.config.maxBufferHole);xi(w.end,this.config.maxFragLookUpTolerance,o)<0&&(this.log(`Waiting fragment cc (${o.cc}) @ ${o.start} cancelled because another fragment at ${w.end} is needed`),this.clearWaitingFragment())}}else this.state=Wt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const r=this.waitingData;r&&(this.fragmentTracker.removeFragment(r.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Wt.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:r}=this;r!=null&&r.readyState&&(this.lastCurrentTime=r.currentTime)}doTickIdle(){const{hls:r,levels:i,media:s,trackId:o}=this,u=r.config;if(!this.buffering||!s&&(this.startFragRequested||!u.startFragPrefetch)||!(i!=null&&i[o]))return;const h=i[o],m=h.details;if(!m||m.live&&this.levelLastLoaded!==h||this.waitForCdnTuneIn(m)){this.state=Wt.WAITING_TRACK;return}const _=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&_&&(this.bufferFlushed=!1,this.afterBufferFlushed(_,ie.AUDIO,Ie.AUDIO));const w=this.getFwdBufferInfo(_,Ie.AUDIO);if(w===null)return;if(!this.switchingTrack&&this._streamEnded(w,m)){r.trigger(b.BUFFER_EOS,{type:"audio"}),this.state=Wt.ENDED;return}const E=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Ie.MAIN),L=w.len,N=this.getMaxBufferLength(E==null?void 0:E.len),J=m.fragments,j=J[0].start,ne=this.getLoadPosition(),de=this.flushing?ne:w.end;if(this.switchingTrack&&s){const At=ne;m.PTSKnown&&At<j&&(w.end>j||w.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=j+.05)}if(L>=N&&!this.switchingTrack&&de<J[J.length-1].start)return;let $e=this.getNextFragment(de,m),ct=!1;if($e&&this.isLoopLoading($e,de)&&(ct=!!$e.gap,$e=this.getNextFragmentLoopLoading($e,m,w,Ie.MAIN,N)),!$e){this.bufferFlushed=!0;return}const ht=E&&$e.start>E.end+m.targetduration;if(ht||!(E!=null&&E.len)&&w.len){const At=this.getAppendedFrag($e.start,Ie.MAIN);if(At===null||(ct||(ct=!!At.gap||!!ht&&E.len===0),ht&&!ct||ct&&w.nextStart&&w.nextStart<At.end))return}this.loadFragment($e,h,de)}getMaxBufferLength(r){const i=super.getMaxBufferLength();return r?Math.min(Math.max(i,r),this.config.maxMaxBufferLength):i}onMediaDetaching(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,super.onMediaDetaching()}onAudioTracksUpdated(r,{audioTracks:i}){this.resetTransmuxer(),this.levels=i.map(s=>new Di(s))}onAudioTrackSwitching(r,i){const s=!!i.url;this.trackId=i.id;const{fragCurrent:o}=this;o&&(o.abortRequests(),this.removeUnbufferedFrags(o.start)),this.resetLoadingState(),s?this.setInterval(Vr):this.resetTransmuxer(),s?(this.switchingTrack=i,this.state=Wt.IDLE,this.flushAudioIfNeeded(i)):(this.switchingTrack=null,this.bufferedTrack=i,this.state=Wt.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(r,i){this.mainDetails=i.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(b.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(r,i){var s;if(this.mainDetails==null){this.cachedTrackLoadedData=i;return}const{levels:o}=this,{details:u,id:h}=i;if(!o){this.warn(`Audio tracks were reset while loading level ${h}`);return}this.log(`Audio track ${h} loaded [${u.startSN},${u.endSN}]${u.lastPartSn?`[part-${u.lastPartSn}-${u.lastPartIndex}]`:""},duration:${u.totalduration}`);const m=o[h];let _=0;if(u.live||(s=m.details)!=null&&s.live){this.checkLiveUpdate(u);const E=this.mainDetails;if(u.deltaUpdateFailed||!E)return;if(!m.details&&u.hasProgramDateTime&&E.hasProgramDateTime)zs(u,E),_=u.fragments[0].start;else{var w;_=this.alignPlaylists(u,m.details,(w=this.levelLastLoaded)==null?void 0:w.details)}}m.details=u,this.levelLastLoaded=m,!this.startFragRequested&&(this.mainDetails||!u.live)&&this.setStartPosition(this.mainDetails||u,_),this.state===Wt.WAITING_TRACK&&!this.waitForCdnTuneIn(u)&&(this.state=Wt.IDLE),this.tick()}_handleFragmentLoadProgress(r){var i;const{frag:s,part:o,payload:u}=r,{config:h,trackId:m,levels:_}=this;if(!_){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const w=_[m];if(!w){this.warn("Audio track is undefined on fragment load progress");return}const E=w.details;if(!E){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const L=h.defaultAudioCodec||w.audioCodec||"mp4a.40.2";let N=this.transmuxer;N||(N=this.transmuxer=new Sr(this.hls,Ie.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const J=this.initPTS[s.cc],j=(i=s.initSegment)==null?void 0:i.data;if(J!==void 0){const de=o?o.index:-1,$e=de!==-1,ct=new Ua(s.level,s.sn,s.stats.chunkCount,u.byteLength,de,$e);N.push(u,j,L,"",s,o,E.totalduration,!1,ct,J)}else{this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${E.startSN} ,${E.endSN}],track ${m}`);const{cache:ne}=this.waitingData=this.waitingData||{frag:s,part:o,cache:new sl,complete:!1};ne.push(new Uint8Array(u)),this.waitingVideoCC=this.videoTrackCC,this.state=Wt.WAITING_INIT_PTS}}_handleFragmentLoadComplete(r){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(r)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(r,i){const s=i.tracks.audio;s&&(this.mediaBuffer=s.buffer||null),i.tracks.video&&(this.videoBuffer=i.tracks.video.buffer||null)}onFragBuffered(r,i){const{frag:s,part:o}=i;if(s.type!==Ie.AUDIO){if(!this.loadedmetadata&&s.type===Ie.MAIN){const u=this.videoBuffer||this.media;u&&Jn.getBuffered(u).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${o?" p: "+o.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(s.sn!=="initSegment"){this.fragPrevious=s;const u=this.switchingTrack;u&&(this.bufferedTrack=u,this.switchingTrack=null,this.hls.trigger(b.AUDIO_TRACK_SWITCHED,Oe({},u)))}this.fragBufferedComplete(s,o)}onError(r,i){var s;if(i.fatal){this.state=Wt.ERROR;return}switch(i.details){case I.FRAG_GAP:case I.FRAG_PARSING_ERROR:case I.FRAG_DECRYPT_ERROR:case I.FRAG_LOAD_ERROR:case I.FRAG_LOAD_TIMEOUT:case I.KEY_LOAD_ERROR:case I.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Ie.AUDIO,i);break;case I.AUDIO_TRACK_LOAD_ERROR:case I.AUDIO_TRACK_LOAD_TIMEOUT:case I.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===Wt.WAITING_TRACK&&((s=i.context)==null?void 0:s.type)===sr.AUDIO_TRACK&&(this.state=Wt.IDLE);break;case I.BUFFER_APPEND_ERROR:case I.BUFFER_FULL_ERROR:if(!i.parent||i.parent!=="audio")return;if(i.details===I.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(i)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case I.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}onBufferFlushing(r,{type:i}){i!==ie.VIDEO&&(this.flushing=!0)}onBufferFlushed(r,{type:i}){if(i!==ie.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Wt.ENDED&&(this.state=Wt.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,i,Ie.AUDIO),this.tick())}}_handleTransmuxComplete(r){var i;const s="audio",{hls:o}=this,{remuxResult:u,chunkMeta:h}=r,m=this.getCurrentContext(h);if(!m){this.resetWhenMissingContext(h);return}const{frag:_,part:w,level:E}=m,{details:L}=E,{audio:N,text:J,id3:j,initSegment:ne}=u;if(this.fragContextChanged(_)||!L){this.fragmentTracker.removeFragment(_);return}if(this.state=Wt.PARSING,this.switchingTrack&&N&&this.completeAudioSwitch(this.switchingTrack),ne!=null&&ne.tracks){const de=_.initSegment||_;this._bufferInitSegment(E,ne.tracks,de,h),o.trigger(b.FRAG_PARSING_INIT_SEGMENT,{frag:de,id:s,tracks:ne.tracks})}if(N){const{startPTS:de,endPTS:$e,startDTS:ct,endDTS:ht}=N;w&&(w.elementaryStreams[ie.AUDIO]={startPTS:de,endPTS:$e,startDTS:ct,endDTS:ht}),_.setElementaryStreamInfo(ie.AUDIO,de,$e,ct,ht),this.bufferFragmentData(N,_,w,h)}if(j!=null&&(i=j.samples)!=null&&i.length){const de=c({id:s,frag:_,details:L},j);o.trigger(b.FRAG_PARSING_METADATA,de)}if(J){const de=c({id:s,frag:_,details:L},J);o.trigger(b.FRAG_PARSING_USERDATA,de)}}_bufferInitSegment(r,i,s,o){if(this.state!==Wt.PARSING)return;i.video&&delete i.video;const u=i.audio;if(!u)return;u.id="audio";const h=r.audioCodec;this.log(`Init audio buffer, container:${u.container}, codecs[level/parsed]=[${h}/${u.codec}]`),h&&h.split(",").length===1&&(u.levelCodec=h),this.hls.trigger(b.BUFFER_CODECS,i);const m=u.initSegment;if(m!=null&&m.byteLength){const _={type:"audio",frag:s,part:null,chunkMeta:o,parent:s.type,data:m};this.hls.trigger(b.BUFFER_APPENDING,_)}this.tickImmediate()}loadFragment(r,i,s){const o=this.fragmentTracker.getState(r);if(this.fragCurrent=r,this.switchingTrack||o===Yi.NOT_LOADED||o===Yi.PARTIAL){var u;if(r.sn==="initSegment")this._loadInitSegment(r,i);else if((u=i.details)!=null&&u.live&&!this.initPTS[r.cc]){this.log(`Waiting for video PTS in continuity counter ${r.cc} of live stream before loading audio fragment ${r.sn} of level ${this.trackId}`),this.state=Wt.WAITING_INIT_PTS;const h=this.mainDetails;h&&h.fragments[0].start!==i.details.fragments[0].start&&zs(i.details,h)}else this.startFragRequested=!0,super.loadFragment(r,i,s)}else this.clearTrackerIfNeeded(r)}flushAudioIfNeeded(r){if(this.media&&this.bufferedTrack){const{name:i,lang:s,assocLang:o,characteristics:u,audioCodec:h,channels:m}=this.bufferedTrack;Ds({name:i,lang:s,assocLang:o,characteristics:u,audioCodec:h,channels:m},r,Hs)||(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}}completeAudioSwitch(r){const{hls:i}=this;this.flushAudioIfNeeded(r),this.bufferedTrack=r,this.switchingTrack=null,i.trigger(b.AUDIO_TRACK_SWITCHED,Oe({},r))}}function Tn(d,r){if(d.length!==r.length)return!1;for(let i=0;i<d.length;i++)if(!kn(d[i].attrs,r[i].attrs))return!1;return!0}function kn(d,r,i){const s=d["STABLE-RENDITION-ID"];return s&&!i?s===r["STABLE-RENDITION-ID"]:!(i||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(o=>d[o]!==r[o])}function ii(d,r){return r.label.toLowerCase()===d.name.toLowerCase()&&(!r.language||r.language.toLowerCase()===(d.lang||"").toLowerCase())}class si extends jn{constructor(r){super(r,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:r}=this;r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.MANIFEST_PARSED,this.onManifestParsed,this),r.on(b.LEVEL_LOADING,this.onLevelLoading,this),r.on(b.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(b.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.on(b.ERROR,this.onError,this)}unregisterListeners(){const{hls:r}=this;r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.MANIFEST_PARSED,this.onManifestParsed,this),r.off(b.LEVEL_LOADING,this.onLevelLoading,this),r.off(b.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(b.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.off(b.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(r,i){this.tracks=i.audioTracks||[]}onAudioTrackLoaded(r,i){const{id:s,groupId:o,details:u}=i,h=this.tracksInGroup[s];if(!h||h.groupId!==o){this.warn(`Audio track with id:${s} and group:${o} not found in active group ${h==null?void 0:h.groupId}`);return}const m=h.details;h.details=i.details,this.log(`Audio track ${s} "${h.name}" lang:${h.lang} group:${o} loaded [${u.startSN}-${u.endSN}]`),s===this.trackId&&this.playlistLoaded(s,i,m)}onLevelLoading(r,i){this.switchLevel(i.level)}onLevelSwitching(r,i){this.switchLevel(i.level)}switchLevel(r){const i=this.hls.levels[r];if(!i)return;const s=i.audioGroups||null,o=this.groupIds;let u=this.currentTrack;if(!s||(o==null?void 0:o.length)!==(s==null?void 0:s.length)||s!=null&&s.some(m=>(o==null?void 0:o.indexOf(m))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const m=this.tracks.filter(N=>!s||s.indexOf(N.groupId)!==-1);if(m.length)this.selectDefaultTrack&&!m.some(N=>N.default)&&(this.selectDefaultTrack=!1),m.forEach((N,J)=>{N.id=J});else if(!u&&!this.tracksInGroup.length)return;this.tracksInGroup=m;const _=this.hls.config.audioPreference;if(!u&&_){const N=Cs(_,m,Hs);if(N>-1)u=m[N];else{const J=Cs(_,this.tracks);u=this.tracks[J]}}let w=this.findTrackId(u);w===-1&&u&&(w=this.findTrackId(null));const E={audioTracks:m};this.log(`Updating audio tracks, ${m.length} track(s) found in group(s): ${s==null?void 0:s.join(",")}`),this.hls.trigger(b.AUDIO_TRACKS_UPDATED,E);const L=this.trackId;if(w!==-1&&L===-1)this.setAudioTrack(w);else if(m.length&&L===-1){var h;const N=new Error(`No audio track selected for current audio group-ID(s): ${(h=this.groupIds)==null?void 0:h.join(",")} track count: ${m.length}`);this.warn(N.message),this.hls.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:N})}}else this.shouldReloadPlaylist(u)&&this.setAudioTrack(this.trackId)}onError(r,i){i.fatal||!i.context||i.context.type===sr.AUDIO_TRACK&&i.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(i.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(i))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(r){this.selectDefaultTrack=!1,this.setAudioTrack(r)}setAudioOption(r){const i=this.hls;if(i.config.audioPreference=r,r){const s=this.allAudioTracks;if(this.selectDefaultTrack=!1,s.length){const o=this.currentTrack;if(o&&Ds(r,o,Hs))return o;const u=Cs(r,this.tracksInGroup,Hs);if(u>-1){const h=this.tracksInGroup[u];return this.setAudioTrack(u),h}else if(o){let h=i.loadLevel;h===-1&&(h=i.firstAutoLevel);const m=$s(r,i.levels,s,h,Hs);if(m===-1)return null;i.nextLoadLevel=m}if(r.channels||r.audioCodec){const h=Cs(r,s);if(h>-1)return s[h]}}}return null}setAudioTrack(r){const i=this.tracksInGroup;if(r<0||r>=i.length){this.warn(`Invalid audio track id: ${r}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,o=i[r],u=o.details&&!o.details.live;if(r===this.trackId&&o===s&&u||(this.log(`Switching to audio-track ${r} "${o.name}" lang:${o.lang} group:${o.groupId} channels:${o.channels}`),this.trackId=r,this.currentTrack=o,this.hls.trigger(b.AUDIO_TRACK_SWITCHING,Oe({},o)),u))return;const h=this.switchParams(o.url,s==null?void 0:s.details,o.details);this.loadPlaylist(h)}findTrackId(r){const i=this.tracksInGroup;for(let s=0;s<i.length;s++){const o=i[s];if(!(this.selectDefaultTrack&&!o.default)&&(!r||Ds(r,o,Hs)))return s}if(r){const{name:s,lang:o,assocLang:u,characteristics:h,audioCodec:m,channels:_}=r;for(let w=0;w<i.length;w++){const E=i[w];if(Ds({name:s,lang:o,assocLang:u,characteristics:h,audioCodec:m,channels:_},E,Hs))return w}for(let w=0;w<i.length;w++){const E=i[w];if(kn(r.attrs,E.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return w}for(let w=0;w<i.length;w++){const E=i[w];if(kn(r.attrs,E.attrs,["LANGUAGE"]))return w}}return-1}loadPlaylist(r){const i=this.currentTrack;if(this.shouldLoadPlaylist(i)&&i){super.loadPlaylist();const s=i.id,o=i.groupId;let u=i.url;if(r)try{u=r.addDirectives(u)}catch(h){this.warn(`Could not construct new URL with HLS Delivery Directives: ${h}`)}this.log(`loading audio-track playlist ${s} "${i.name}" lang:${i.lang} group:${o}`),this.clearTimer(),this.hls.trigger(b.AUDIO_TRACK_LOADING,{url:u,id:s,groupId:o,deliveryDirectives:r||null})}}}const gi=500;class wi extends Wa{constructor(r,i,s){super(r,i,s,"[subtitle-stream-controller]",Ie.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}_registerListeners(){const{hls:r}=this;r.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.LEVEL_LOADED,this.onLevelLoaded,this),r.on(b.ERROR,this.onError,this),r.on(b.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(b.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),r.on(b.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(b.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),r.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(b.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:r}=this;r.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.LEVEL_LOADED,this.onLevelLoaded,this),r.off(b.ERROR,this.onError,this),r.off(b.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.off(b.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),r.off(b.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(b.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),r.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(b.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(r){this.stopLoad(),this.state=Wt.IDLE,this.setInterval(gi),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=r,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(r,i){this.mainDetails=i.details}onSubtitleFragProcessed(r,i){const{frag:s,success:o}=i;if(this.fragPrevious=s,this.state=Wt.IDLE,!o)return;const u=this.tracksBuffered[this.currentTrackId];if(!u)return;let h;const m=s.start;for(let w=0;w<u.length;w++)if(m>=u[w].start&&m<=u[w].end){h=u[w];break}const _=s.start+s.duration;h?h.end=_:(h={start:m,end:_},u.push(h)),this.fragmentTracker.fragBuffered(s),this.fragBufferedComplete(s,null)}onBufferFlushing(r,i){const{startOffset:s,endOffset:o}=i;if(s===0&&o!==Number.POSITIVE_INFINITY){const u=o-1;if(u<=0)return;i.endOffsetSubtitles=Math.max(0,u),this.tracksBuffered.forEach(h=>{for(let m=0;m<h.length;){if(h[m].end<=u){h.shift();continue}else if(h[m].start<u)h[m].start=u;else break;m++}}),this.fragmentTracker.removeFragmentsInRange(s,u,Ie.SUBTITLE)}}onFragBuffered(r,i){if(!this.loadedmetadata&&i.frag.type===Ie.MAIN){var s;(s=this.media)!=null&&s.buffered.length&&(this.loadedmetadata=!0)}}onError(r,i){const s=i.frag;(s==null?void 0:s.type)===Ie.SUBTITLE&&(i.details===I.FRAG_GAP&&this.fragmentTracker.fragBuffered(s,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Wt.STOPPED&&(this.state=Wt.IDLE))}onSubtitleTracksUpdated(r,{subtitleTracks:i}){if(this.levels&&Tn(this.levels,i)){this.levels=i.map(s=>new Di(s));return}this.tracksBuffered=[],this.levels=i.map(s=>{const o=new Di(s);return this.tracksBuffered[o.id]=[],o}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Ie.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(r,i){var s;if(this.currentTrackId=i.id,!((s=this.levels)!=null&&s.length)||this.currentTrackId===-1){this.clearInterval();return}const o=this.levels[this.currentTrackId];o!=null&&o.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,o&&this.setInterval(gi)}onSubtitleTrackLoaded(r,i){var s;const{currentTrackId:o,levels:u}=this,{details:h,id:m}=i;if(!u){this.warn(`Subtitle tracks were reset while loading level ${m}`);return}const _=u[m];if(m>=u.length||!_)return;this.log(`Subtitle track ${m} loaded [${h.startSN},${h.endSN}]${h.lastPartSn?`[part-${h.lastPartSn}-${h.lastPartIndex}]`:""},duration:${h.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let w=0;if(h.live||(s=_.details)!=null&&s.live){const L=this.mainDetails;if(h.deltaUpdateFailed||!L)return;const N=L.fragments[0];if(!_.details)h.hasProgramDateTime&&L.hasProgramDateTime?(zs(h,L),w=h.fragments[0].start):N&&(w=N.start,er(h,w));else{var E;w=this.alignPlaylists(h,_.details,(E=this.levelLastLoaded)==null?void 0:E.details),w===0&&N&&(w=N.start,er(h,w))}}_.details=h,this.levelLastLoaded=_,m===o&&(!this.startFragRequested&&(this.mainDetails||!h.live)&&this.setStartPosition(this.mainDetails||h,w),this.tick(),h.live&&!this.fragCurrent&&this.media&&this.state===Wt.IDLE&&(wn(null,h.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),_.details=void 0)))}_handleFragmentLoadComplete(r){const{frag:i,payload:s}=r,o=i.decryptdata,u=this.hls;if(!this.fragContextChanged(i)&&s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&o.method==="AES-128"){const h=performance.now();this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer).catch(m=>{throw u.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.FRAG_DECRYPT_ERROR,fatal:!1,error:m,reason:m.message,frag:i}),m}).then(m=>{const _=performance.now();u.trigger(b.FRAG_DECRYPTED,{frag:i,payload:m,stats:{tstart:h,tdecrypt:_}})}).catch(m=>{this.warn(`${m.name}: ${m.message}`),this.state=Wt.IDLE})}}doTick(){if(!this.media){this.state=Wt.IDLE;return}if(this.state===Wt.IDLE){const{currentTrackId:r,levels:i}=this,s=i==null?void 0:i[r];if(!s||!i.length||!s.details)return;const{config:o}=this,u=this.getLoadPosition(),h=Jn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],u,o.maxBufferHole),{end:m,len:_}=h,w=this.getFwdBufferInfo(this.media,Ie.MAIN),E=s.details,L=this.getMaxBufferLength(w==null?void 0:w.len)+E.levelTargetDuration;if(_>L)return;const N=E.fragments,J=N.length,j=E.edge;let ne=null;const de=this.fragPrevious;if(m<j){const $e=o.maxFragLookUpTolerance,ct=m>j-$e?0:$e;ne=wn(de,N,Math.max(N[0].start,m),ct),!ne&&de&&de.start<N[0].start&&(ne=N[0])}else ne=N[J-1];if(!ne)return;if(ne=this.mapToInitFragWhenRequired(ne),ne.sn!=="initSegment"){const $e=ne.sn-E.startSN,ct=N[$e-1];ct&&ct.cc===ne.cc&&this.fragmentTracker.getState(ct)===Yi.NOT_LOADED&&(ne=ct)}this.fragmentTracker.getState(ne)===Yi.NOT_LOADED&&this.loadFragment(ne,s,m)}}getMaxBufferLength(r){const i=super.getMaxBufferLength();return r?Math.max(i,r):i}loadFragment(r,i,s){this.fragCurrent=r,r.sn==="initSegment"?this._loadInitSegment(r,i):(this.startFragRequested=!0,super.loadFragment(r,i,s))}get mediaBufferTimeRanges(){return new ji(this.tracksBuffered[this.currentTrackId]||[])}}class ji{constructor(r){this.buffered=void 0;const i=(s,o,u)=>{if(o=o>>>0,o>u-1)throw new DOMException(`Failed to execute '${s}' on 'TimeRanges': The index provided (${o}) is greater than the maximum bound (${u})`);return r[o][s]};this.buffered={get length(){return r.length},end(s){return i("end",s,r.length)},start(s){return i("start",s,r.length)}}}}class vs extends jn{constructor(r){super(r,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let i=null;const s=In(this.media.textTracks);for(let u=0;u<s.length;u++)if(s[u].mode==="hidden")i=s[u];else if(s[u].mode==="showing"){i=s[u];break}const o=this.findTrackForTextTrack(i);this.subtitleTrack!==o&&this.setSubtitleTrack(o)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(r){this._subtitleDisplay=r,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:r}=this;r.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.MANIFEST_PARSED,this.onManifestParsed,this),r.on(b.LEVEL_LOADING,this.onLevelLoading,this),r.on(b.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(b.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(b.ERROR,this.onError,this)}unregisterListeners(){const{hls:r}=this;r.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.MANIFEST_PARSED,this.onManifestParsed,this),r.off(b.LEVEL_LOADING,this.onLevelLoading,this),r.off(b.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(b.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(b.ERROR,this.onError,this)}onMediaAttached(r,i){this.media=i.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,r)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),In(this.media.textTracks).forEach(i=>{Rn(i)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(r,i){this.tracks=i.subtitleTracks}onSubtitleTrackLoaded(r,i){const{id:s,groupId:o,details:u}=i,h=this.tracksInGroup[s];if(!h||h.groupId!==o){this.warn(`Subtitle track with id:${s} and group:${o} not found in active group ${h==null?void 0:h.groupId}`);return}const m=h.details;h.details=i.details,this.log(`Subtitle track ${s} "${h.name}" lang:${h.lang} group:${o} loaded [${u.startSN}-${u.endSN}]`),s===this.trackId&&this.playlistLoaded(s,i,m)}onLevelLoading(r,i){this.switchLevel(i.level)}onLevelSwitching(r,i){this.switchLevel(i.level)}switchLevel(r){const i=this.hls.levels[r];if(!i)return;const s=i.subtitleGroups||null,o=this.groupIds;let u=this.currentTrack;if(!s||(o==null?void 0:o.length)!==(s==null?void 0:s.length)||s!=null&&s.some(h=>(o==null?void 0:o.indexOf(h))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const h=this.tracks.filter(E=>!s||s.indexOf(E.groupId)!==-1);if(h.length)this.selectDefaultTrack&&!h.some(E=>E.default)&&(this.selectDefaultTrack=!1),h.forEach((E,L)=>{E.id=L});else if(!u&&!this.tracksInGroup.length)return;this.tracksInGroup=h;const m=this.hls.config.subtitlePreference;if(!u&&m){this.selectDefaultTrack=!1;const E=Cs(m,h);if(E>-1)u=h[E];else{const L=Cs(m,this.tracks);u=this.tracks[L]}}let _=this.findTrackId(u);_===-1&&u&&(_=this.findTrackId(null));const w={subtitleTracks:h};this.log(`Updating subtitle tracks, ${h.length} track(s) found in "${s==null?void 0:s.join(",")}" group-id`),this.hls.trigger(b.SUBTITLE_TRACKS_UPDATED,w),_!==-1&&this.trackId===-1&&this.setSubtitleTrack(_)}else this.shouldReloadPlaylist(u)&&this.setSubtitleTrack(this.trackId)}findTrackId(r){const i=this.tracksInGroup,s=this.selectDefaultTrack;for(let o=0;o<i.length;o++){const u=i[o];if(!(s&&!u.default||!s&&!r)&&(!r||Ds(u,r)))return o}if(r){for(let o=0;o<i.length;o++){const u=i[o];if(kn(r.attrs,u.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return o}for(let o=0;o<i.length;o++){const u=i[o];if(kn(r.attrs,u.attrs,["LANGUAGE"]))return o}}return-1}findTrackForTextTrack(r){if(r){const i=this.tracksInGroup;for(let s=0;s<i.length;s++){const o=i[s];if(ii(o,r))return s}}return-1}onError(r,i){i.fatal||!i.context||i.context.type===sr.SUBTITLE_TRACK&&i.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(i.context.groupId)!==-1)&&this.checkRetry(i)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(r){this.selectDefaultTrack=!1,this.setSubtitleTrack(r)}setSubtitleOption(r){if(this.hls.config.subtitlePreference=r,r){const i=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,i.length){const s=this.currentTrack;if(s&&Ds(r,s))return s;const o=Cs(r,this.tracksInGroup);if(o>-1){const u=this.tracksInGroup[o];return this.setSubtitleTrack(o),u}else{if(s)return null;{const u=Cs(r,i);if(u>-1)return i[u]}}}}return null}loadPlaylist(r){super.loadPlaylist();const i=this.currentTrack;if(this.shouldLoadPlaylist(i)&&i){const s=i.id,o=i.groupId;let u=i.url;if(r)try{u=r.addDirectives(u)}catch(h){this.warn(`Could not construct new URL with HLS Delivery Directives: ${h}`)}this.log(`Loading subtitle playlist for id ${s}`),this.hls.trigger(b.SUBTITLE_TRACK_LOADING,{url:u,id:s,groupId:o,deliveryDirectives:r||null})}}toggleTrackModes(){const{media:r}=this;if(!r)return;const i=In(r.textTracks),s=this.currentTrack;let o;if(s&&(o=i.filter(u=>ii(s,u))[0],o||this.warn(`Unable to find subtitle TextTrack with name "${s.name}" and language "${s.lang}"`)),[].slice.call(i).forEach(u=>{u.mode!=="disabled"&&u!==o&&(u.mode="disabled")}),o){const u=this.subtitleDisplay?"showing":"hidden";o.mode!==u&&(o.mode=u)}}setSubtitleTrack(r){const i=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(r<-1||r>=i.length||!te(r)){this.warn(`Invalid subtitle track id: ${r}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,o=i[r]||null;if(this.trackId=r,this.currentTrack=o,this.toggleTrackModes(),!o){this.hls.trigger(b.SUBTITLE_TRACK_SWITCH,{id:r});return}const u=!!o.details&&!o.details.live;if(r===this.trackId&&o===s&&u)return;this.log(`Switching to subtitle-track ${r}`+(o?` "${o.name}" lang:${o.lang} group:${o.groupId}`:""));const{id:h,groupId:m="",name:_,type:w,url:E}=o;this.hls.trigger(b.SUBTITLE_TRACK_SWITCH,{id:h,groupId:m,name:_,type:w,url:E});const L=this.switchParams(o.url,s==null?void 0:s.details,o.details);this.loadPlaylist(L)}}class rs{constructor(r){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=r}append(r,i,s){const o=this.queues[i];o.push(r),o.length===1&&!s&&this.executeNext(i)}insertAbort(r,i){this.queues[i].unshift(r),this.executeNext(i)}appendBlocker(r){let i;const s=new Promise(u=>{i=u}),o={execute:i,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(o,r),s}executeNext(r){const i=this.queues[r];if(i.length){const s=i[0];try{s.execute()}catch(o){P.warn(`[buffer-operation-queue]: Exception executing "${r}" SourceBuffer operation: ${o}`),s.onError(o);const u=this.buffers[r];u!=null&&u.updating||this.shiftAndExecuteNext(r)}}}shiftAndExecuteNext(r){this.queues[r].shift(),this.executeNext(r)}current(r){return this.queues[r][0]}}const li=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class Ks{constructor(r){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=s=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=s=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:s,mediaSource:o}=this;this.log("Media source opened"),s&&(s.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(b.MEDIA_ATTACHED,{media:s,mediaSource:o})),o&&o.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:s,_objectUrl:o}=this;s!==o&&P.error(`Media element src was set while attaching MediaSource (${o} > ${s})`)},this.hls=r;const i="[buffer-controller]";this.appendSource=$n(dn(r.config.preferManagedMediaSource)),this.log=P.log.bind(P,i),this.warn=P.warn.bind(P,i),this.error=P.error.bind(P,i),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:r}=this;r.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.MANIFEST_PARSED,this.onManifestParsed,this),r.on(b.BUFFER_RESET,this.onBufferReset,this),r.on(b.BUFFER_APPENDING,this.onBufferAppending,this),r.on(b.BUFFER_CODECS,this.onBufferCodecs,this),r.on(b.BUFFER_EOS,this.onBufferEos,this),r.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(b.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(b.FRAG_PARSED,this.onFragParsed,this),r.on(b.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:r}=this;r.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.MANIFEST_PARSED,this.onManifestParsed,this),r.off(b.BUFFER_RESET,this.onBufferReset,this),r.off(b.BUFFER_APPENDING,this.onBufferAppending,this),r.off(b.BUFFER_CODECS,this.onBufferCodecs,this),r.off(b.BUFFER_EOS,this.onBufferEos,this),r.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(b.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(b.FRAG_PARSED,this.onFragParsed,this),r.off(b.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new rs(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(r,i){let s=2;(i.audio&&!i.video||!i.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(r,i){const s=this.media=i.media,o=dn(this.appendSource);if(s&&o){var u;const h=this.mediaSource=new o;this.log(`created media source: ${(u=h.constructor)==null?void 0:u.name}`),h.addEventListener("sourceopen",this._onMediaSourceOpen),h.addEventListener("sourceended",this._onMediaSourceEnded),h.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(h.addEventListener("startstreaming",this._onStartStreaming),h.addEventListener("endstreaming",this._onEndStreaming));const m=this._objectUrl=self.URL.createObjectURL(h);if(this.appendSource)try{s.removeAttribute("src");const _=self.ManagedMediaSource;s.disableRemotePlayback=s.disableRemotePlayback||_&&h instanceof _,ca(s),qs(s,m),s.load()}catch(_){s.src=m}else s.src=m;s.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:r,mediaSource:i,_objectUrl:s}=this;if(i){if(this.log("media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(o){this.warn(`onMediaDetaching: ${o.message} while calling endOfStream`)}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(i.removeEventListener("startstreaming",this._onStartStreaming),i.removeEventListener("endstreaming",this._onEndStreaming)),r&&(r.removeEventListener("emptied",this._onMediaEmptied),s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(r.removeAttribute("src"),this.appendSource&&ca(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(b.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(r=>{this.resetBuffer(r)}),this._initSourceBuffer(),this.hls.resumeBuffering()}resetBuffer(r){const i=this.sourceBuffer[r];try{if(i){var s;this.removeBufferListeners(r),this.sourceBuffer[r]=void 0,(s=this.mediaSource)!=null&&s.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(i)}}catch(o){this.warn(`onBufferReset ${r}`,o)}}onBufferCodecs(r,i){const s=this.getSourceBufferTypes().length,o=Object.keys(i);if(o.forEach(h=>{if(s){const _=this.tracks[h];if(_&&typeof _.buffer.changeType=="function"){var m;const{id:w,codec:E,levelCodec:L,container:N,metadata:J}=i[h],j=fr(_.codec,_.levelCodec),ne=j==null?void 0:j.replace(li,"$1");let de=fr(E,L);const $e=(m=de)==null?void 0:m.replace(li,"$1");if(de&&ne!==$e){h.slice(0,5)==="audio"&&(de=_r(de,this.appendSource));const ct=`${N};codecs=${de}`;this.appendChangeType(h,ct),this.log(`switching codec ${j} to ${de}`),this.tracks[h]={buffer:_.buffer,codec:E,container:N,levelCodec:L,metadata:J,id:w}}}}else this.pendingTracks[h]=i[h]}),s)return;const u=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==u&&(this.log(`${u} bufferCodec event(s) expected ${o.join(",")}`),this.bufferCodecEventsExpected=u),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(r,i){const{operationQueue:s}=this,o={execute:()=>{const u=this.sourceBuffer[r];u&&(this.log(`changing ${r} sourceBuffer type to ${i}`),u.changeType(i)),s.shiftAndExecuteNext(r)},onStart:()=>{},onComplete:()=>{},onError:u=>{this.warn(`Failed to change ${r} SourceBuffer type`,u)}};s.append(o,r,!!this.pendingTracks[r])}onBufferAppending(r,i){const{hls:s,operationQueue:o,tracks:u}=this,{data:h,type:m,frag:_,part:w,chunkMeta:E}=i,L=E.buffering[m],N=self.performance.now();L.start=N;const J=_.stats.buffering,j=w?w.stats.buffering:null;J.start===0&&(J.start=N),j&&j.start===0&&(j.start=N);const ne=u.audio;let de=!1;m==="audio"&&(ne==null?void 0:ne.container)==="audio/mpeg"&&(de=!this.lastMpegAudioChunk||E.id===1||this.lastMpegAudioChunk.sn!==E.sn,this.lastMpegAudioChunk=E);const $e=_.start,ct={execute:()=>{if(L.executeStart=self.performance.now(),de){const ht=this.sourceBuffer[m];if(ht){const At=$e-ht.timestampOffset;Math.abs(At)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${$e} (delta: ${At}) sn: ${_.sn})`),ht.timestampOffset=$e)}}this.appendExecutor(h,m)},onStart:()=>{},onComplete:()=>{const ht=self.performance.now();L.executeEnd=L.end=ht,J.first===0&&(J.first=ht),j&&j.first===0&&(j.first=ht);const{sourceBuffer:At}=this,yt={};for(const Qt in At)yt[Qt]=Jn.getBuffered(At[Qt]);this.appendErrors[m]=0,m==="audio"||m==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(b.BUFFER_APPENDED,{type:m,frag:_,part:w,chunkMeta:E,parent:_.type,timeRanges:yt})},onError:ht=>{const At={type:M.MEDIA_ERROR,parent:_.type,details:I.BUFFER_APPEND_ERROR,sourceBufferName:m,frag:_,part:w,chunkMeta:E,error:ht,err:ht,fatal:!1};if(ht.code===DOMException.QUOTA_EXCEEDED_ERR)At.details=I.BUFFER_FULL_ERROR;else{const yt=++this.appendErrors[m];At.details=I.BUFFER_APPEND_ERROR,this.warn(`Failed ${yt}/${s.config.appendErrorMaxRetry} times to append segment in "${m}" sourceBuffer`),yt>=s.config.appendErrorMaxRetry&&(At.fatal=!0)}s.trigger(b.ERROR,At)}};o.append(ct,m,!!this.pendingTracks[m])}onBufferFlushing(r,i){const{operationQueue:s}=this,o=u=>({execute:this.removeExecutor.bind(this,u,i.startOffset,i.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(b.BUFFER_FLUSHED,{type:u})},onError:h=>{this.warn(`Failed to remove from ${u} SourceBuffer`,h)}});i.type?s.append(o(i.type),i.type):this.getSourceBufferTypes().forEach(u=>{s.append(o(u),u)})}onFragParsed(r,i){const{frag:s,part:o}=i,u=[],h=o?o.elementaryStreams:s.elementaryStreams;h[ie.AUDIOVIDEO]?u.push("audiovideo"):(h[ie.AUDIO]&&u.push("audio"),h[ie.VIDEO]&&u.push("video"));const m=()=>{const _=self.performance.now();s.stats.buffering.end=_,o&&(o.stats.buffering.end=_);const w=o?o.stats:s.stats;this.hls.trigger(b.FRAG_BUFFERED,{frag:s,part:o,stats:w,id:s.type})};u.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${s.type} level: ${s.level} sn: ${s.sn}`),this.blockBuffers(m,u)}onFragChanged(r,i){this.trimBuffers()}onBufferEos(r,i){this.getSourceBufferTypes().reduce((o,u)=>{const h=this.sourceBuffer[u];return h&&(!i.type||i.type===u)&&(h.ending=!0,h.ended||(h.ended=!0,this.log(`${u} sourceBuffer now EOS`))),o&&!!(!h||h.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(u=>{const h=this.sourceBuffer[u];h&&(h.ending=!1)});const{mediaSource:o}=this;if(!o||o.readyState!=="open"){o&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${o.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),o.endOfStream()}))}onLevelUpdated(r,{details:i}){i.fragments.length&&(this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:r,details:i,media:s}=this;if(!s||i===null||!this.getSourceBufferTypes().length)return;const u=r.config,h=s.currentTime,m=i.levelTargetDuration,_=i.live&&u.liveBackBufferLength!==null?u.liveBackBufferLength:u.backBufferLength;if(te(_)&&_>0){const w=Math.max(_,m),E=Math.floor(h/m)*m-w;this.flushBackBuffer(h,m,E)}if(te(u.frontBufferFlushThreshold)&&u.frontBufferFlushThreshold>0){const w=Math.max(u.maxBufferLength,u.frontBufferFlushThreshold),E=Math.max(w,m),L=Math.floor(h/m)*m+E;this.flushFrontBuffer(h,m,L)}}flushBackBuffer(r,i,s){const{details:o,sourceBuffer:u}=this;this.getSourceBufferTypes().forEach(m=>{const _=u[m];if(_){const w=Jn.getBuffered(_);if(w.length>0&&s>w.start(0)){if(this.hls.trigger(b.BACK_BUFFER_REACHED,{bufferEnd:s}),o!=null&&o.live)this.hls.trigger(b.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(_.ended&&w.end(w.length-1)-r<i*2){this.log(`Cannot flush ${m} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(b.BUFFER_FLUSHING,{startOffset:0,endOffset:s,type:m})}}})}flushFrontBuffer(r,i,s){const{sourceBuffer:o}=this;this.getSourceBufferTypes().forEach(h=>{const m=o[h];if(m){const _=Jn.getBuffered(m),w=_.length;if(w<2)return;const E=_.start(w-1),L=_.end(w-1);if(s>E||r>=E&&r<=L)return;if(m.ended&&r-L<2*i){this.log(`Cannot flush ${h} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(b.BUFFER_FLUSHING,{startOffset:E,endOffset:1/0,type:h})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:r,hls:i,media:s,mediaSource:o}=this,u=r.fragments[0].start+r.totalduration,h=s.duration,m=te(o.duration)?o.duration:0;r.live&&i.config.liveDurationInfinity?(o.duration=1/0,this.updateSeekableRange(r)):(u>m&&u>h||!te(h))&&(this.log(`Updating Media Source duration to ${u.toFixed(3)}`),o.duration=u)}updateSeekableRange(r){const i=this.mediaSource,s=r.fragments;if(s.length&&r.live&&i!=null&&i.setLiveSeekableRange){const u=Math.max(0,s[0].start),h=Math.max(u,u+r.totalduration);this.log(`Media Source duration is set to ${i.duration}. Setting seekable range to ${u}-${h}.`),i.setLiveSeekableRange(u,h)}}checkPendingTracks(){const{bufferCodecEventsExpected:r,operationQueue:i,pendingTracks:s}=this,o=Object.keys(s).length;if(o&&(!r||o===2||"audiovideo"in s)){this.createSourceBuffers(s),this.pendingTracks={};const u=this.getSourceBufferTypes();if(u.length)this.hls.trigger(b.BUFFER_CREATED,{tracks:this.tracks}),u.forEach(h=>{i.executeNext(h)});else{const h=new Error("could not create source buffer for media codec(s)");this.hls.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:h,reason:h.message})}}}createSourceBuffers(r){const{sourceBuffer:i,mediaSource:s}=this;if(!s)throw Error("createSourceBuffers called when mediaSource was null");for(const u in r)if(!i[u]){var o;const h=r[u];if(!h)throw Error(`source buffer exists for track ${u}, however track does not`);let m=((o=h.levelCodec)==null?void 0:o.indexOf(","))===-1?h.levelCodec:h.codec;m&&u.slice(0,5)==="audio"&&(m=_r(m,this.appendSource));const _=`${h.container};codecs=${m}`;this.log(`creating sourceBuffer(${_})`);try{const w=i[u]=s.addSourceBuffer(_),E=u;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(E,"bufferedchange",(L,N)=>{const J=N.removedRanges;J!=null&&J.length&&this.hls.trigger(b.BUFFER_FLUSHED,{type:u})}),this.tracks[u]={buffer:w,codec:m,container:h.container,levelCodec:h.levelCodec,metadata:h.metadata,id:h.id}}catch(w){this.error(`error while trying to add sourceBuffer: ${w.message}`),this.hls.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:w,sourceBufferName:u,mimeType:_})}}}get mediaSrc(){var r,i;const s=((r=this.media)==null||(i=r.querySelector)==null?void 0:i.call(r,"source"))||this.media;return s==null?void 0:s.src}_onSBUpdateStart(r){const{operationQueue:i}=this;i.current(r).onStart()}_onSBUpdateEnd(r){var i;if(((i=this.mediaSource)==null?void 0:i.readyState)==="closed"){this.resetBuffer(r);return}const{operationQueue:s}=this;s.current(r).onComplete(),s.shiftAndExecuteNext(r)}_onSBUpdateError(r,i){var s;const o=new Error(`${r} SourceBuffer error. MediaSource readyState: ${(s=this.mediaSource)==null?void 0:s.readyState}`);this.error(`${o}`,i),this.hls.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.BUFFER_APPENDING_ERROR,sourceBufferName:r,error:o,fatal:!1});const u=this.operationQueue.current(r);u&&u.onError(o)}removeExecutor(r,i,s){const{media:o,mediaSource:u,operationQueue:h,sourceBuffer:m}=this,_=m[r];if(!o||!u||!_){this.warn(`Attempting to remove from the ${r} SourceBuffer, but it does not exist`),h.shiftAndExecuteNext(r);return}const w=te(o.duration)?o.duration:1/0,E=te(u.duration)?u.duration:1/0,L=Math.max(0,i),N=Math.min(s,w,E);N>L&&(!_.ending||_.ended)?(_.ended=!1,this.log(`Removing [${L},${N}] from the ${r} SourceBuffer`),_.remove(L,N)):h.shiftAndExecuteNext(r)}appendExecutor(r,i){const s=this.sourceBuffer[i];if(!s){if(!this.pendingTracks[i])throw new Error(`Attempting to append to the ${i} SourceBuffer, but it does not exist`);return}s.ended=!1,s.appendBuffer(r)}blockBuffers(r,i=this.getSourceBufferTypes()){if(!i.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(r);return}const{operationQueue:s}=this,o=i.map(u=>s.appendBlocker(u));Promise.all(o).then(()=>{r(),i.forEach(u=>{const h=this.sourceBuffer[u];h!=null&&h.updating||s.shiftAndExecuteNext(u)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(r,i,s){const o=this.sourceBuffer[r];if(!o)return;const u=s.bind(this,r);this.listeners[r].push({event:i,listener:u}),o.addEventListener(i,u)}removeBufferListeners(r){const i=this.sourceBuffer[r];i&&this.listeners[r].forEach(s=>{i.removeEventListener(s.event,s.listener)})}}function ca(d){const r=d.querySelectorAll("source");[].slice.call(r).forEach(i=>{d.removeChild(i)})}function qs(d,r){const i=self.document.createElement("source");i.type="video/mp4",i.src=r,d.appendChild(i)}const hs={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Er=d=>String.fromCharCode(hs[d]||d),di=15,ia=100,A0={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ns={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ha={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Ya={25:2,26:4,29:6,30:8,31:10,27:13,28:15},_l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class xl{constructor(){this.time=null,this.verboseLevel=0}log(r,i){if(this.verboseLevel>=r){const s=typeof i=="function"?i():i;P.log(`${this.time} [${r}] ${s}`)}}}const Zs=function(r){const i=[];for(let s=0;s<r.length;s++)i.push(r[s].toString(16));return i};class Ys{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(r){const i=["foreground","underline","italics","background","flash"];for(let s=0;s<i.length;s++){const o=i[s];r.hasOwnProperty(o)&&(this[o]=r[o])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(r){return this.foreground===r.foreground&&this.underline===r.underline&&this.italics===r.italics&&this.background===r.background&&this.flash===r.flash}copy(r){this.foreground=r.foreground,this.underline=r.underline,this.italics=r.italics,this.background=r.background,this.flash=r.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class au{constructor(){this.uchar=" ",this.penState=new Ys}reset(){this.uchar=" ",this.penState.reset()}setChar(r,i){this.uchar=r,this.penState.copy(i)}setPenState(r){this.penState.copy(r)}equals(r){return this.uchar===r.uchar&&this.penState.equals(r.penState)}copy(r){this.uchar=r.uchar,this.penState.copy(r.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class da{constructor(r){this.chars=[],this.pos=0,this.currPenState=new Ys,this.cueStartTime=null,this.logger=void 0;for(let i=0;i<ia;i++)this.chars.push(new au);this.logger=r}equals(r){for(let i=0;i<ia;i++)if(!this.chars[i].equals(r.chars[i]))return!1;return!0}copy(r){for(let i=0;i<ia;i++)this.chars[i].copy(r.chars[i])}isEmpty(){let r=!0;for(let i=0;i<ia;i++)if(!this.chars[i].isEmpty()){r=!1;break}return r}setCursor(r){this.pos!==r&&(this.pos=r),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>ia&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=ia)}moveCursor(r){const i=this.pos+r;if(r>1)for(let s=this.pos+1;s<i+1;s++)this.chars[s].setPenState(this.currPenState);this.setCursor(i)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(r){r>=144&&this.backSpace();const i=Er(r);if(this.pos>=ia){this.logger.log(0,()=>"Cannot insert "+r.toString(16)+" ("+i+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(i,this.currPenState),this.moveCursor(1)}clearFromPos(r){let i;for(i=r;i<ia;i++)this.chars[i].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const r=[];let i=!0;for(let s=0;s<ia;s++){const o=this.chars[s].uchar;o!==" "&&(i=!1),r.push(o)}return i?"":r.join("")}setPenStyles(r){this.currPenState.setStyles(r),this.chars[this.pos].setPenState(this.currPenState)}}class Uo{constructor(r){this.rows=[],this.currRow=di-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let i=0;i<di;i++)this.rows.push(new da(r));this.logger=r}reset(){for(let r=0;r<di;r++)this.rows[r].clear();this.currRow=di-1}equals(r){let i=!0;for(let s=0;s<di;s++)if(!this.rows[s].equals(r.rows[s])){i=!1;break}return i}copy(r){for(let i=0;i<di;i++)this.rows[i].copy(r.rows[i])}isEmpty(){let r=!0;for(let i=0;i<di;i++)if(!this.rows[i].isEmpty()){r=!1;break}return r}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(r){this.rows[this.currRow].insertChar(r)}setPen(r){this.rows[this.currRow].setPenStyles(r)}moveCursor(r){this.rows[this.currRow].moveCursor(r)}setCursor(r){this.logger.log(2,"setCursor: "+r),this.rows[this.currRow].setCursor(r)}setPAC(r){this.logger.log(2,()=>"pacData = "+JSON.stringify(r));let i=r.row-1;if(this.nrRollUpRows&&i<this.nrRollUpRows-1&&(i=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==i){for(let m=0;m<di;m++)this.rows[m].clear();const u=this.currRow+1-this.nrRollUpRows,h=this.lastOutputScreen;if(h){const m=h.rows[u].cueStartTime,_=this.logger.time;if(m!==null&&_!==null&&m<_)for(let w=0;w<this.nrRollUpRows;w++)this.rows[i-this.nrRollUpRows+w+1].copy(h.rows[u+w])}}this.currRow=i;const s=this.rows[this.currRow];if(r.indent!==null){const u=r.indent,h=Math.max(u-1,0);s.setCursor(r.indent),r.color=s.chars[h].penState.foreground}const o={foreground:r.color,underline:r.underline,italics:r.italics,background:"black",flash:!1};this.setPen(o)}setBkgData(r){this.logger.log(2,()=>"bkgData = "+JSON.stringify(r)),this.backSpace(),this.setPen(r),this.insertChar(32)}setRollUpRows(r){this.nrRollUpRows=r}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const r=this.currRow+1-this.nrRollUpRows,i=this.rows.splice(r,1)[0];i.clear(),this.rows.splice(this.currRow,0,i),this.logger.log(2,"Rolling up")}getDisplayText(r){r=r||!1;const i=[];let s="",o=-1;for(let u=0;u<di;u++){const h=this.rows[u].getTextString();h&&(o=u+1,r?i.push("Row "+o+": '"+h+"'"):i.push(h.trim()))}return i.length>0&&(r?s="["+i.join(" | ")+"]":s=i.join(`
`)),s}getTextAndFormat(){return this.rows}}class Ho{constructor(r,i,s){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=r,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new Uo(s),this.nonDisplayedMemory=new Uo(s),this.lastOutputScreen=new Uo(s),this.currRollUpRow=this.displayedMemory.rows[di-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[di-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(r){this.outputFilter=r}setPAC(r){this.writeScreen.setPAC(r)}setBkgData(r){this.writeScreen.setBkgData(r)}setMode(r){r!==this.mode&&(this.mode=r,this.logger.log(2,()=>"MODE="+r),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=r)}insertChars(r){for(let s=0;s<r.length;s++)this.writeScreen.insertChar(r[s]);const i=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>i+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(r){this.logger.log(2,"RU("+r+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(r)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const r=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=r,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(r){this.logger.log(2,"TO("+r+") - Tab Offset"),this.writeScreen.moveCursor(r)}ccMIDROW(r){const i={flash:!1};if(i.underline=r%2===1,i.italics=r>=46,i.italics)i.foreground="white";else{const s=Math.floor(r/2)-16,o=["white","green","blue","cyan","red","yellow","magenta"];i.foreground=o[s]}this.logger.log(2,"MIDROW: "+JSON.stringify(i)),this.writeScreen.setPen(i)}outputDataUpdate(r=!1){const i=this.logger.time;i!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=i:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,i,this.lastOutputScreen),r&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:i),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(r){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,r,this.displayedMemory),this.cueStartTime=r))}}class Go{constructor(r,i,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=ou(),this.logger=void 0;const o=this.logger=new xl;this.channels=[null,new Ho(r,i,o),new Ho(r+1,s,o)]}getHandler(r){return this.channels[r].getHandler()}setHandler(r,i){this.channels[r].setHandler(i)}addData(r,i){this.logger.time=r;for(let s=0;s<i.length;s+=2){const o=i[s]&127,u=i[s+1]&127;let h=!1,m=null;if(o===0&&u===0)continue;this.logger.log(3,()=>"["+Zs([i[s],i[s+1]])+"] -> ("+Zs([o,u])+")");const _=this.cmdHistory;if(o>=16&&o<=31){if(wl(o,u,_)){La(null,null,_),this.logger.log(3,()=>"Repeated command ("+Zs([o,u])+") is dropped");continue}La(o,u,this.cmdHistory),h=this.parseCmd(o,u),h||(h=this.parseMidrow(o,u)),h||(h=this.parsePAC(o,u)),h||(h=this.parseBackgroundAttributes(o,u))}else La(null,null,_);if(!h&&(m=this.parseChars(o,u),m)){const E=this.currentChannel;E&&E>0?this.channels[E].insertChars(m):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!h&&!m&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Zs([o,u])+" orig: "+Zs([i[s],i[s+1]]))}}parseCmd(r,i){const s=(r===20||r===28||r===21||r===29)&&i>=32&&i<=47,o=(r===23||r===31)&&i>=33&&i<=35;if(!(s||o))return!1;const u=r===20||r===21||r===23?1:2,h=this.channels[u];return r===20||r===21||r===28||r===29?i===32?h.ccRCL():i===33?h.ccBS():i===34?h.ccAOF():i===35?h.ccAON():i===36?h.ccDER():i===37?h.ccRU(2):i===38?h.ccRU(3):i===39?h.ccRU(4):i===40?h.ccFON():i===41?h.ccRDC():i===42?h.ccTR():i===43?h.ccRTD():i===44?h.ccEDM():i===45?h.ccCR():i===46?h.ccENM():i===47&&h.ccEOC():h.ccTO(i-32),this.currentChannel=u,!0}parseMidrow(r,i){let s=0;if((r===17||r===25)&&i>=32&&i<=47){if(r===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const o=this.channels[s];return o?(o.ccMIDROW(i),this.logger.log(3,()=>"MIDROW ("+Zs([r,i])+")"),!0):!1}return!1}parsePAC(r,i){let s;const o=(r>=17&&r<=23||r>=25&&r<=31)&&i>=64&&i<=127,u=(r===16||r===24)&&i>=64&&i<=95;if(!(o||u))return!1;const h=r<=23?1:2;i>=64&&i<=95?s=h===1?A0[r]:ha[r]:s=h===1?ns[r]:Ya[r];const m=this.channels[h];return m?(m.setPAC(this.interpretPAC(s,i)),this.currentChannel=h,!0):!1}interpretPAC(r,i){let s;const o={color:null,italics:!1,indent:null,underline:!1,row:r};return i>95?s=i-96:s=i-64,o.underline=(s&1)===1,s<=13?o.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(o.italics=!0,o.color="white"):o.indent=Math.floor((s-16)/2)*4,o}parseChars(r,i){let s,o=null,u=null;if(r>=25?(s=2,u=r-8):(s=1,u=r),u>=17&&u<=19){let h;u===17?h=i+80:u===18?h=i+112:h=i+144,this.logger.log(2,()=>"Special char '"+Er(h)+"' in channel "+s),o=[h]}else r>=32&&r<=127&&(o=i===0?[r]:[r,i]);return o&&this.logger.log(3,()=>"Char codes = "+Zs(o).join(",")),o}parseBackgroundAttributes(r,i){const s=(r===16||r===24)&&i>=32&&i<=47,o=(r===23||r===31)&&i>=45&&i<=47;if(!(s||o))return!1;let u;const h={};r===16||r===24?(u=Math.floor((i-32)/2),h.background=_l[u],i%2===1&&(h.background=h.background+"_semi")):i===45?h.background="transparent":(h.foreground="black",i===47&&(h.underline=!0));const m=r<=23?1:2;return this.channels[m].setBkgData(h),!0}reset(){for(let r=0;r<Object.keys(this.channels).length;r++){const i=this.channels[r];i&&i.reset()}La(null,null,this.cmdHistory)}cueSplitAtTime(r){for(let i=0;i<this.channels.length;i++){const s=this.channels[i];s&&s.cueSplitAtTime(r)}}}function La(d,r,i){i.a=d,i.b=r}function wl(d,r,i){return i.a===d&&i.b===r}function ou(){return{a:null,b:null}}class Sl{constructor(r,i){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=r,this.trackName=i}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(r,i,s){(this.startTime===null||this.startTime>r)&&(this.startTime=r),this.endTime=i,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var T0=function(){if(tt!=null&&tt.VTTCue)return self.VTTCue;const d=["","lr","rl"],r=["start","middle","end","left","right"];function i(m,_){if(typeof _!="string"||!Array.isArray(m))return!1;const w=_.toLowerCase();return~m.indexOf(w)?w:!1}function s(m){return i(d,m)}function o(m){return i(r,m)}function u(m,..._){let w=1;for(;w<arguments.length;w++){const E=arguments[w];for(const L in E)m[L]=E[L]}return m}function h(m,_,w){const E=this,L={enumerable:!0};E.hasBeenReset=!1;let N="",J=!1,j=m,ne=_,de=w,$e=null,ct="",ht=!0,At="auto",yt="start",Qt=50,zt="middle",pr=50,Or="middle";Object.defineProperty(E,"id",u({},L,{get:function(){return N},set:function(Zt){N=""+Zt}})),Object.defineProperty(E,"pauseOnExit",u({},L,{get:function(){return J},set:function(Zt){J=!!Zt}})),Object.defineProperty(E,"startTime",u({},L,{get:function(){return j},set:function(Zt){if(typeof Zt!="number")throw new TypeError("Start time must be set to a number.");j=Zt,this.hasBeenReset=!0}})),Object.defineProperty(E,"endTime",u({},L,{get:function(){return ne},set:function(Zt){if(typeof Zt!="number")throw new TypeError("End time must be set to a number.");ne=Zt,this.hasBeenReset=!0}})),Object.defineProperty(E,"text",u({},L,{get:function(){return de},set:function(Zt){de=""+Zt,this.hasBeenReset=!0}})),Object.defineProperty(E,"region",u({},L,{get:function(){return $e},set:function(Zt){$e=Zt,this.hasBeenReset=!0}})),Object.defineProperty(E,"vertical",u({},L,{get:function(){return ct},set:function(Zt){const mr=s(Zt);if(mr===!1)throw new SyntaxError("An invalid or illegal string was specified.");ct=mr,this.hasBeenReset=!0}})),Object.defineProperty(E,"snapToLines",u({},L,{get:function(){return ht},set:function(Zt){ht=!!Zt,this.hasBeenReset=!0}})),Object.defineProperty(E,"line",u({},L,{get:function(){return At},set:function(Zt){if(typeof Zt!="number"&&Zt!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");At=Zt,this.hasBeenReset=!0}})),Object.defineProperty(E,"lineAlign",u({},L,{get:function(){return yt},set:function(Zt){const mr=o(Zt);if(!mr)throw new SyntaxError("An invalid or illegal string was specified.");yt=mr,this.hasBeenReset=!0}})),Object.defineProperty(E,"position",u({},L,{get:function(){return Qt},set:function(Zt){if(Zt<0||Zt>100)throw new Error("Position must be between 0 and 100.");Qt=Zt,this.hasBeenReset=!0}})),Object.defineProperty(E,"positionAlign",u({},L,{get:function(){return zt},set:function(Zt){const mr=o(Zt);if(!mr)throw new SyntaxError("An invalid or illegal string was specified.");zt=mr,this.hasBeenReset=!0}})),Object.defineProperty(E,"size",u({},L,{get:function(){return pr},set:function(Zt){if(Zt<0||Zt>100)throw new Error("Size must be between 0 and 100.");pr=Zt,this.hasBeenReset=!0}})),Object.defineProperty(E,"align",u({},L,{get:function(){return Or},set:function(Zt){const mr=o(Zt);if(!mr)throw new SyntaxError("An invalid or illegal string was specified.");Or=mr,this.hasBeenReset=!0}})),E.displayState=void 0}return h.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},h}();class Zc{decode(r,i){if(!r)return"";if(typeof r!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(r))}}function qu(d){function r(s,o,u,h){return(s|0)*3600+(o|0)*60+(u|0)+parseFloat(h||0)}const i=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?r(i[2],i[3],0,i[4]):r(i[1],i[2],i[3],i[4]):null}class Yc{constructor(){this.values=Object.create(null)}set(r,i){!this.get(r)&&i!==""&&(this.values[r]=i)}get(r,i,s){return s?this.has(r)?this.values[r]:i[s]:this.has(r)?this.values[r]:i}has(r){return r in this.values}alt(r,i,s){for(let o=0;o<s.length;++o)if(i===s[o]){this.set(r,i);break}}integer(r,i){/^-?\d+$/.test(i)&&this.set(r,parseInt(i,10))}percent(r,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){const s=parseFloat(i);if(s>=0&&s<=100)return this.set(r,s),!0}return!1}}function Xl(d,r,i,s){const o=s?d.split(s):[d];for(const u in o){if(typeof o[u]!="string")continue;const h=o[u].split(i);if(h.length!==2)continue;const m=h[0],_=h[1];r(m,_)}}const lu=new T0(0,0,""),Vo=lu.align==="middle"?"middle":"center";function Zu(d,r,i){const s=d;function o(){const m=qu(d);if(m===null)throw new Error("Malformed timestamp: "+s);return d=d.replace(/^[^\sa-zA-Z-]+/,""),m}function u(m,_){const w=new Yc;Xl(m,function(N,J){let j;switch(N){case"region":for(let ne=i.length-1;ne>=0;ne--)if(i[ne].id===J){w.set(N,i[ne].region);break}break;case"vertical":w.alt(N,J,["rl","lr"]);break;case"line":j=J.split(","),w.integer(N,j[0]),w.percent(N,j[0])&&w.set("snapToLines",!1),w.alt(N,j[0],["auto"]),j.length===2&&w.alt("lineAlign",j[1],["start",Vo,"end"]);break;case"position":j=J.split(","),w.percent(N,j[0]),j.length===2&&w.alt("positionAlign",j[1],["start",Vo,"end","line-left","line-right","auto"]);break;case"size":w.percent(N,J);break;case"align":w.alt(N,J,["start",Vo,"end","left","right"]);break}},/:/,/\s/),_.region=w.get("region",null),_.vertical=w.get("vertical","");let E=w.get("line","auto");E==="auto"&&lu.line===-1&&(E=-1),_.line=E,_.lineAlign=w.get("lineAlign","start"),_.snapToLines=w.get("snapToLines",!0),_.size=w.get("size",100),_.align=w.get("align",Vo);let L=w.get("position","auto");L==="auto"&&lu.position===50&&(L=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=L}function h(){d=d.replace(/^\s+/,"")}if(h(),r.startTime=o(),h(),d.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);d=d.slice(3),h(),r.endTime=o(),h(),u(d,r)}function uu(d){return d.replace(/<br(?: \/)?>/gi,`
`)}class Xc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Zc,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(r){const i=this;r&&(i.buffer+=i.decoder.decode(r,{stream:!0}));function s(){let u=i.buffer,h=0;for(u=uu(u);h<u.length&&u[h]!=="\r"&&u[h]!==`
`;)++h;const m=u.slice(0,h);return u[h]==="\r"&&++h,u[h]===`
`&&++h,i.buffer=u.slice(h),m}function o(u){Xl(u,function(h,m){},/:/)}try{let u="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;u=s();const m=u.match(/^()?WEBVTT([ \t].*)?$/);if(!(m!=null&&m[0]))throw new Error("Malformed WebVTT signature.");i.state="HEADER"}let h=!1;for(;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(h?h=!1:u=s(),i.state){case"HEADER":/:/.test(u)?o(u):u||(i.state="ID");continue;case"NOTE":u||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(u)){i.state="NOTE";break}if(!u)continue;if(i.cue=new T0(0,0,""),i.state="CUE",u.indexOf("-->")===-1){i.cue.id=u;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{Zu(u,i.cue,i.regionList)}catch(m){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{const m=u.indexOf("-->")!==-1;if(!u||m&&(h=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=`
`),i.cue.text+=u}continue;case"BADCUE":u||(i.state="ID")}}}catch(u){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const r=this;try{if((r.cue||r.state==="HEADER")&&(r.buffer+=`
`,r.parse()),r.state==="INITIAL"||r.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){r.onparsingerror&&r.onparsingerror(i)}return r.onflush&&r.onflush(),this}}const Yu=/\r\n|\n\r|\n|\r/g,cu=function(r,i,s=0){return r.slice(s,s+i.length)===i},Jc=function(r){let i=parseInt(r.slice(-3));const s=parseInt(r.slice(-6,-4)),o=parseInt(r.slice(-9,-7)),u=r.length>9?parseInt(r.substring(0,r.indexOf(":"))):0;if(!te(i)||!te(s)||!te(o)||!te(u))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${r}`);return i+=1e3*s,i+=60*1e3*o,i+=60*60*1e3*u,i},El=function(r){let i=5381,s=r.length;for(;s;)i=i*33^r.charCodeAt(--s);return(i>>>0).toString()};function Bn(d,r,i){return El(d.toString())+El(r.toString())+El(i)}const Oi=function(r,i,s){let o=r[i],u=r[o.prevCC];if(!u||!u.new&&o.new){r.ccOffset=r.presentationOffset=o.start,o.new=!1;return}for(;(h=u)!=null&&h.new;){var h;r.ccOffset+=o.start-u.start,o.new=!1,o=u,u=r[o.prevCC]}r.presentationOffset=s};function Wo(d,r,i,s,o,u,h){const m=new Xc,_=cr(new Uint8Array(d)).trim().replace(Yu,`
`).split(`
`),w=[],E=r?Zl(r.baseTime,r.timescale):0;let L="00:00.000",N=0,J=0,j,ne=!0;m.oncue=function(de){const $e=i[s];let ct=i.ccOffset;const ht=(N-E)/9e4;if($e!=null&&$e.new&&(J!==void 0?ct=i.ccOffset=$e.start:Oi(i,s,ht)),ht){if(!r){j=new Error("Missing initPTS for VTT MPEGTS");return}ct=ht-i.presentationOffset}const At=de.endTime-de.startTime,yt=cs((de.startTime+ct-J)*9e4,o*9e4)/9e4;de.startTime=Math.max(yt,0),de.endTime=Math.max(yt+At,0);const Qt=de.text.trim();de.text=decodeURIComponent(encodeURIComponent(Qt)),de.id||(de.id=Bn(de.startTime,de.endTime,Qt)),de.endTime>0&&w.push(de)},m.onparsingerror=function(de){j=de},m.onflush=function(){if(j){h(j);return}u(w)},_.forEach(de=>{if(ne)if(cu(de,"X-TIMESTAMP-MAP=")){ne=!1,de.slice(16).split(",").forEach($e=>{cu($e,"LOCAL:")?L=$e.slice(6):cu($e,"MPEGTS:")&&(N=parseInt($e.slice(7)))});try{J=Jc(L)/1e3}catch($e){j=$e}return}else de===""&&(ne=!1);m.parse(de+`
`)}),m.flush()}const C0="stpp.ttml.im1t",Xs=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,hu=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,fo={left:"start",center:"center",right:"end",start:"start",end:"end"};function du(d,r,i,s){const o=Ee(new Uint8Array(d),["mdat"]);if(o.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const u=o.map(m=>cr(m)),h=E0(r.baseTime,1,r.timescale);try{u.forEach(m=>i(Qc(m,h)))}catch(m){s(m)}}function Qc(d,r){const o=new DOMParser().parseFromString(d,"text/xml").getElementsByTagName("tt")[0];if(!o)throw new Error("Invalid ttml");const u={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},h=Object.keys(u).reduce((L,N)=>(L[N]=o.getAttribute(`ttp:${N}`)||u[N],L),{}),m=o.getAttribute("xml:space")!=="preserve",_=D0(fu(o,"styling","style")),w=D0(fu(o,"layout","region")),E=fu(o,"body","[begin]");return[].map.call(E,L=>{const N=kl(L,m);if(!N||!L.hasAttribute("begin"))return null;const J=Al(L.getAttribute("begin"),h),j=Al(L.getAttribute("dur"),h);let ne=Al(L.getAttribute("end"),h);if(J===null)throw M0(L);if(ne===null){if(j===null)throw M0(L);ne=J+j}const de=new T0(J-r,ne-r,N);de.id=Bn(de.startTime,de.endTime,de.text);const $e=w[L.getAttribute("region")],ct=_[L.getAttribute("style")],ht=Jl($e,ct,_),{textAlign:At}=ht;if(At){const yt=fo[At];yt&&(de.lineAlign=yt),de.align=At}return c(de,ht),de}).filter(L=>L!==null)}function fu(d,r,i){const s=d.getElementsByTagName(r)[0];return s?[].slice.call(s.querySelectorAll(i)):[]}function D0(d){return d.reduce((r,i)=>{const s=i.getAttribute("xml:id");return s&&(r[s]=i),r},{})}function kl(d,r){return[].slice.call(d.childNodes).reduce((i,s,o)=>{var u;return s.nodeName==="br"&&o?i+`
`:(u=s.childNodes)!=null&&u.length?kl(s,r):r?i+s.textContent.trim().replace(/\s+/g," "):i+s.textContent},"")}function Jl(d,r,i){const s="http://www.w3.org/ns/ttml#styling";let o=null;const u=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],h=d!=null&&d.hasAttribute("style")?d.getAttribute("style"):null;return h&&i.hasOwnProperty(h)&&(o=i[h]),u.reduce((m,_)=>{const w=rr(r,s,_)||rr(d,s,_)||rr(o,s,_);return w&&(m[_]=w),m},{})}function rr(d,r,i){return d&&d.hasAttributeNS(r,i)?d.getAttributeNS(r,i):null}function M0(d){return new Error(`Could not parse ttml timestamp ${d}`)}function Al(d,r){if(!d)return null;let i=qu(d);return i===null&&(Xs.test(d)?i=L0(d,r):hu.test(d)&&(i=R0(d,r))),i}function L0(d,r){const i=Xs.exec(d),s=(i[4]|0)+(i[5]|0)/r.subFrameRate;return(i[1]|0)*3600+(i[2]|0)*60+(i[3]|0)+s/r.frameRate}function R0(d,r){const i=hu.exec(d),s=Number(i[1]);switch(i[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/r.frameRate;case"t":return s/r.tickRate}return s}class eh{constructor(r){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Qu(),this.captionsProperties=void 0,this.hls=r,this.config=r.config,this.Cues=r.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},r.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(b.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(b.FRAG_LOADING,this.onFragLoading,this),r.on(b.FRAG_LOADED,this.onFragLoaded,this),r.on(b.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(b.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(b.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(b.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:r}=this;r.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.MANIFEST_LOADED,this.onManifestLoaded,this),r.off(b.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.off(b.FRAG_LOADING,this.onFragLoading,this),r.off(b.FRAG_LOADED,this.onFragLoaded,this),r.off(b.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.off(b.FRAG_DECRYPTED,this.onFragDecrypted,this),r.off(b.INIT_PTS_FOUND,this.onInitPtsFound,this),r.off(b.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const r=new Sl(this,"textTrack1"),i=new Sl(this,"textTrack2"),s=new Sl(this,"textTrack3"),o=new Sl(this,"textTrack4");this.cea608Parser1=new Go(1,r,i),this.cea608Parser2=new Go(3,s,o)}}addCues(r,i,s,o,u){let h=!1;for(let m=u.length;m--;){const _=u[m],w=ds(_[0],_[1],i,s);if(w>=0&&(_[0]=Math.min(_[0],i),_[1]=Math.max(_[1],s),h=!0,w/(s-i)>.5))return}if(h||u.push([i,s]),this.config.renderTextTracksNatively){const m=this.captionsTracks[r];this.Cues.newCue(m,i,s,o)}else{const m=this.Cues.newCue(null,i,s,o);this.hls.trigger(b.CUES_PARSED,{type:"captions",cues:m,track:r})}}onInitPtsFound(r,{frag:i,id:s,initPTS:o,timescale:u}){const{unparsedVttFrags:h}=this;s==="main"&&(this.initPTS[i.cc]={baseTime:o,timescale:u}),h.length&&(this.unparsedVttFrags=[],h.forEach(m=>{this.onFragLoaded(b.FRAG_LOADED,m)}))}getExistingTrack(r,i){const{media:s}=this;if(s)for(let o=0;o<s.textTracks.length;o++){const u=s.textTracks[o];if(Ju(u,{name:r,lang:i,attrs:{}}))return u}return null}createCaptionsTrack(r){this.config.renderTextTracksNatively?this.createNativeTrack(r):this.createNonNativeTrack(r)}createNativeTrack(r){if(this.captionsTracks[r])return;const{captionsProperties:i,captionsTracks:s,media:o}=this,{label:u,languageCode:h}=i[r],m=this.getExistingTrack(u,h);if(m)s[r]=m,Rn(s[r]),Yn(s[r],o);else{const _=this.createTextTrack("captions",u,h);_&&(_[r]=!0,s[r]=_)}}createNonNativeTrack(r){if(this.nonNativeCaptionsTracks[r])return;const i=this.captionsProperties[r];if(!i)return;const s=i.label,o={_id:r,label:s,kind:"captions",default:i.media?!!i.media.default:!1,closedCaptions:i.media};this.nonNativeCaptionsTracks[r]=o,this.hls.trigger(b.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[o]})}createTextTrack(r,i,s){const o=this.media;if(o)return o.addTextTrack(r,i,s)}onMediaAttaching(r,i){this.media=i.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:r}=this;Object.keys(r).forEach(i=>{Rn(r[i]),delete r[i]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Qu(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:r}=this;if(!r)return;const i=r.textTracks;if(i)for(let s=0;s<i.length;s++)Rn(i[s])}onSubtitleTracksUpdated(r,i){const s=i.subtitleTracks||[],o=s.some(u=>u.textCodec===C0);if(this.config.enableWebVTT||o&&this.config.enableIMSC1){if(Tn(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const h=this.media,m=h?In(h.textTracks):null;if(this.tracks.forEach((_,w)=>{let E;if(m){let L=null;for(let N=0;N<m.length;N++)if(m[N]&&Ju(m[N],_)){L=m[N],m[N]=null;break}L&&(E=L)}if(E)Rn(E);else{const L=Xu(_);E=this.createTextTrack(L,_.name,_.lang),E&&(E.mode="disabled")}E&&this.textTracks.push(E)}),m!=null&&m.length){const _=m.filter(w=>w!==null).map(w=>w.label);_.length&&P.warn(`Media element contains unused subtitle tracks: ${_.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const h=this.tracks.map(m=>({label:m.name,kind:m.type.toLowerCase(),default:m.default,subtitleTrack:m}));this.hls.trigger(b.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:h})}}}onManifestLoaded(r,i){this.config.enableCEA708Captions&&i.captions&&i.captions.forEach(s=>{const o=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!o)return;const u=`textTrack${o[1]}`,h=this.captionsProperties[u];h&&(h.label=s.name,s.lang&&(h.languageCode=s.lang),h.media=s)})}closedCaptionsForLevel(r){const i=this.hls.levels[r.level];return i==null?void 0:i.attrs["CLOSED-CAPTIONS"]}onFragLoading(r,i){if(this.enabled&&i.frag.type===Ie.MAIN){var s,o;const{cea608Parser1:u,cea608Parser2:h,lastSn:m}=this,{cc:_,sn:w}=i.frag,E=(s=(o=i.part)==null?void 0:o.index)!=null?s:-1;u&&h&&(w!==m+1||w===m&&E!==this.lastPartIndex+1||_!==this.lastCc)&&(u.reset(),h.reset()),this.lastCc=_,this.lastSn=w,this.lastPartIndex=E}}onFragLoaded(r,i){const{frag:s,payload:o}=i;if(s.type===Ie.SUBTITLE)if(o.byteLength){const u=s.decryptdata,h="stats"in i;if(u==null||!u.encrypted||h){const m=this.tracks[s.level],_=this.vttCCs;_[s.cc]||(_[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),m&&m.textCodec===C0?this._parseIMSC1(s,o):this._parseVTTs(i)}}else this.hls.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(r,i){const s=this.hls;du(i,this.initPTS[r.cc],o=>{this._appendCues(o,r.level),s.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},o=>{P.log(`Failed to parse IMSC1: ${o}`),s.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:o})})}_parseVTTs(r){var i;const{frag:s,payload:o}=r,{initPTS:u,unparsedVttFrags:h}=this,m=u.length-1;if(!u[s.cc]&&m===-1){h.push(r);return}const _=this.hls,w=(i=s.initSegment)!=null&&i.data?Kr(s.initSegment.data,new Uint8Array(o)):o;Wo(w,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,E=>{this._appendCues(E,s.level),_.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},E=>{const L=E.message==="Missing initPTS for VTT MPEGTS";L?h.push(r):this._fallbackToIMSC1(s,o),P.log(`Failed to parse VTT cue: ${E}`),!(L&&m>s.cc)&&_.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:E})})}_fallbackToIMSC1(r,i){const s=this.tracks[r.level];s.textCodec||du(i,this.initPTS[r.cc],()=>{s.textCodec=C0,this._parseIMSC1(r,i)},()=>{s.textCodec="wvtt"})}_appendCues(r,i){const s=this.hls;if(this.config.renderTextTracksNatively){const o=this.textTracks[i];if(!o||o.mode==="disabled")return;r.forEach(u=>vn(o,u))}else{const o=this.tracks[i];if(!o)return;const u=o.default?"default":"subtitles"+i;s.trigger(b.CUES_PARSED,{type:"subtitles",cues:r,track:u})}}onFragDecrypted(r,i){const{frag:s}=i;s.type===Ie.SUBTITLE&&this.onFragLoaded(b.FRAG_LOADED,i)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(r,i){this.initCea608Parsers();const{cea608Parser1:s,cea608Parser2:o}=this;if(!this.enabled||!s||!o)return;const{frag:u,samples:h}=i;if(!(u.type===Ie.MAIN&&this.closedCaptionsForLevel(u)==="NONE"))for(let m=0;m<h.length;m++){const _=h[m].bytes;if(_){const w=this.extractCea608Data(_);s.addData(h[m].pts,w[0]),o.addData(h[m].pts,w[1])}}}onBufferFlushing(r,{startOffset:i,endOffset:s,endOffsetSubtitles:o,type:u}){const{media:h}=this;if(!(!h||h.currentTime<s)){if(!u||u==="video"){const{captionsTracks:m}=this;Object.keys(m).forEach(_=>Zr(m[_],i,s))}if(this.config.renderTextTracksNatively&&i===0&&o!==void 0){const{textTracks:m}=this;Object.keys(m).forEach(_=>Zr(m[_],i,o))}}}extractCea608Data(r){const i=[[],[]],s=r[0]&31;let o=2;for(let u=0;u<s;u++){const h=r[o++],m=127&r[o++],_=127&r[o++];if(m===0&&_===0)continue;if((4&h)!==0){const E=3&h;(E===0||E===1)&&(i[E].push(m),i[E].push(_))}}return i}}function Xu(d){return d.characteristics&&/transcribes-spoken-dialog/gi.test(d.characteristics)&&/describes-music-and-sound/gi.test(d.characteristics)?"captions":"subtitles"}function Ju(d,r){return!!d&&d.kind===Xu(r)&&ii(r,d)}function ds(d,r,i,s){return Math.min(r,s)-Math.max(d,i)}function Qu(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class Ql{constructor(r){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=r,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(r){this.streamController=r}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:r}=this;r.on(b.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(b.MANIFEST_PARSED,this.onManifestParsed,this),r.on(b.LEVELS_UPDATED,this.onLevelsUpdated,this),r.on(b.BUFFER_CODECS,this.onBufferCodecs,this),r.on(b.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:r}=this;r.off(b.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(b.MANIFEST_PARSED,this.onManifestParsed,this),r.off(b.LEVELS_UPDATED,this.onLevelsUpdated,this),r.off(b.BUFFER_CODECS,this.onBufferCodecs,this),r.off(b.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(r,i){const s=this.hls.levels[i.droppedLevel];this.isLevelAllowed(s)&&this.restrictedLevels.push({bitrate:s.bitrate,height:s.height,width:s.width})}onMediaAttaching(r,i){this.media=i.media instanceof HTMLVideoElement?i.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(r,i){const s=this.hls;this.restrictedLevels=[],this.firstLevel=i.firstLevel,s.config.capLevelToPlayerSize&&i.video&&this.startCapping()}onLevelsUpdated(r,i){this.timer&&te(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(r,i){this.hls.config.capLevelToPlayerSize&&i.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const r=this.hls.levels;if(r.length){const i=this.hls,s=this.getMaxLevel(r.length-1);s!==this.autoLevelCapping&&P.log(`Setting autoLevelCapping to ${s}: ${r[s].height}p@${r[s].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),i.autoLevelCapping=s,i.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=i.autoLevelCapping}}}getMaxLevel(r){const i=this.hls.levels;if(!i.length)return-1;const s=i.filter((o,u)=>this.isLevelAllowed(o)&&u<=r);return this.clientRect=null,Ql.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const r=this.media,i={width:0,height:0};if(r){const s=r.getBoundingClientRect();i.width=s.width,i.height=s.height,!i.width&&!i.height&&(i.width=s.right-s.left||r.width||0,i.height=s.bottom-s.top||r.height||0)}return this.clientRect=i,i}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let r=1;if(!this.hls.config.ignoreDevicePixelRatio)try{r=self.devicePixelRatio}catch(i){}return r}isLevelAllowed(r){return!this.restrictedLevels.some(s=>r.bitrate===s.bitrate&&r.width===s.width&&r.height===s.height)}static getMaxLevelByMediaSize(r,i,s){if(!(r!=null&&r.length))return-1;const o=(m,_)=>_?m.width!==_.width||m.height!==_.height:!0;let u=r.length-1;const h=Math.max(i,s);for(let m=0;m<r.length;m+=1){const _=r[m];if((_.width>=h||_.height>=h)&&o(_,r[m+1])){u=m;break}}return u}}class I0{constructor(r){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=r,this.registerListeners()}setStreamController(r){this.streamController=r}registerListeners(){this.hls.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(r,i){const s=this.hls.config;if(s.capLevelOnFPSDrop){const o=i.media instanceof self.HTMLVideoElement?i.media:null;this.media=o,o&&typeof o.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}checkFPS(r,i,s){const o=performance.now();if(i){if(this.lastTime){const u=o-this.lastTime,h=s-this.lastDroppedFrames,m=i-this.lastDecodedFrames,_=1e3*h/u,w=this.hls;if(w.trigger(b.FPS_DROP,{currentDropped:h,currentDecoded:m,totalDroppedFrames:s}),_>0&&h>w.config.fpsDroppedMonitoringThreshold*m){let E=w.currentLevel;P.warn("drop FPS ratio greater than max allowed value for currentLevel: "+E),E>0&&(w.autoLevelCapping===-1||w.autoLevelCapping>=E)&&(E=E-1,w.trigger(b.FPS_DROP_LEVEL_CAPPING,{level:E,droppedLevel:w.currentLevel}),w.autoLevelCapping=E,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=s,this.lastDecodedFrames=i}}checkFPSInterval(){const r=this.media;if(r)if(this.isVideoPlaybackQualityAvailable){const i=r.getVideoPlaybackQuality();this.checkFPS(r,i.totalVideoFrames,i.droppedVideoFrames)}else this.checkFPS(r,r.webkitDecodedFrameCount,r.webkitDroppedFrameCount)}}const jo="[eme]";class fa{constructor(r){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=fa.CDMCleanupPromise?[fa.CDMCleanupPromise]:[],this.debug=P.debug.bind(P,jo),this.log=P.log.bind(P,jo),this.warn=P.warn.bind(P,jo),this.error=P.error.bind(P,jo),this.onMediaEncrypted=i=>{const{initDataType:s,initData:o}=i,u=`"${i.type}" event: init data type: "${s}"`;if(this.debug(u),o!==null){if(!this.keyFormatPromise){let h=Object.keys(this.keySystemAccessPromises);h.length||(h=Rr(this.config));const m=h.map(Gr).filter(_=>!!_);this.keyFormatPromise=this.getKeyFormatPromise(m)}this.keyFormatPromise.then(h=>{const m=nr(h);let _,w;if(s==="sinf"){if(m!==ot.FAIRPLAY){this.warn(`Ignoring unexpected "${i.type}" event with init data type: "${s}" for selected key-system ${m}`);return}const j=Gt(new Uint8Array(o));try{const ne=C(JSON.parse(j).sinf),de=Vt(ne);if(!de)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");_=de.subarray(8,24),w=ot.FAIRPLAY}catch(ne){this.warn(`${u} Failed to parse sinf: ${ne}`);return}}else{if(m!==ot.WIDEVINE&&m!==ot.PLAYREADY){this.warn(`Ignoring unexpected "${i.type}" event with init data type: "${s}" for selected key-system ${m}`);return}const j=ir(o),ne=j.filter($e=>!!$e.systemId&&Lt($e.systemId)===m);ne.length>1&&this.warn(`${u} Using first of ${ne.length} pssh found for selected key-system ${m}`);const de=ne[0];if(!de){j.length===0||j.some($e=>!$e.systemId)?this.warn(`${u} contains incomplete or invalid pssh data`):this.log(`ignoring ${u} for ${j.map($e=>Lt($e.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(w=Lt(de.systemId),de.version===0&&de.data)if(w===ot.WIDEVINE){const $e=de.data.length-22;_=de.data.subarray($e,$e+16)}else w===ot.PLAYREADY&&(_=zr(de.data))}if(!w||!_){this.log(`Unable to handle ${u} with key-system ${m}`);return}const E=qe.hexDump(_),{keyIdToKeySessionPromise:L,mediaKeySessions:N}=this;let J=L[E];for(let j=0;j<N.length;j++){const ne=N[j],de=ne.decryptdata;if(!de.keyId)continue;const $e=qe.hexDump(de.keyId);if(E===$e||de.uri.replace(/-/g,"").indexOf(E)!==-1){if(J=L[$e],de.pssh)break;delete L[$e],de.pssh=new Uint8Array(o),de.keyId=_,J=L[E]=J.then(()=>this.generateRequestWithPreferredKeySession(ne,s,o,"encrypted-event-key-match")),J.catch(ct=>this.handleError(ct));break}}if(!J){if(w!==m){this.log(`Ignoring "${u}" with ${w} init data for selected key-system ${m}`);return}J=L[E]=this.getKeySystemSelectionPromise([w]).then(({keySystem:j,mediaKeys:ne})=>{var de;this.throwIfDestroyed();const $e=new br("ISO-23001-7",E,(de=Gr(j))!=null?de:"");return $e.pssh=new Uint8Array(o),$e.keyId=_,this.attemptSetMediaKeys(j,ne).then(()=>{this.throwIfDestroyed();const ct=this.createMediaKeySessionContext({decryptdata:$e,keySystem:j,mediaKeys:ne});return this.generateRequestWithPreferredKeySession(ct,s,o,"encrypted-event-no-match")})}),J.catch(j=>this.handleError(j))}})}},this.onWaitingForKey=i=>{this.log(`"${i.type}" event`)},this.hls=r,this.config=r.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const r=this.config;r.requestMediaKeySystemAccessFunc=null,r.licenseXhrSetup=r.licenseResponseCallback=void 0,r.drmSystems=r.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(b.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(b.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(b.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(b.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(b.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(b.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(r){const{drmSystems:i,widevineLicenseUrl:s}=this.config,o=i[r];if(o)return o.licenseUrl;if(r===ot.WIDEVINE&&s)return s}getLicenseServerUrlOrThrow(r){const i=this.getLicenseServerUrl(r);if(i===void 0)throw new Error(`no license server URL configured for key-system "${r}"`);return i}getServerCertificateUrl(r){const{drmSystems:i}=this.config,s=i[r];if(s)return s.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${r}"]`)}attemptKeySystemAccess(r){const i=this.hls.levels,s=(h,m,_)=>!!h&&_.indexOf(h)===m,o=i.map(h=>h.audioCodec).filter(s),u=i.map(h=>h.videoCodec).filter(s);return o.length+u.length===0&&u.push("avc1.42e01e"),new Promise((h,m)=>{const _=w=>{const E=w.shift();this.getMediaKeysPromise(E,o,u).then(L=>h({keySystem:E,mediaKeys:L})).catch(L=>{w.length?_(w):L instanceof Bs?m(L):m(new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_NO_ACCESS,error:L,fatal:!0},L.message))})};_(r)})}requestMediaKeySystemAccess(r,i){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let o=`Configured requestMediaKeySystemAccess is not a function ${s}`;return hn===null&&self.location.protocol==="http:"&&(o=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(o))}return s(r,i)}getMediaKeysPromise(r,i,s){const o=Nr(r,i,s,this.config.drmSystemOptions),u=this.keySystemAccessPromises[r];let h=u==null?void 0:u.keySystemAccess;if(!h){this.log(`Requesting encrypted media "${r}" key-system access with config: ${JSON.stringify(o)}`),h=this.requestMediaKeySystemAccess(r,o);const m=this.keySystemAccessPromises[r]={keySystemAccess:h};return h.catch(_=>{this.log(`Failed to obtain access to key-system "${r}": ${_}`)}),h.then(_=>{this.log(`Access for key-system "${_.keySystem}" obtained`);const w=this.fetchServerCertificate(r);return this.log(`Create media-keys for "${r}"`),m.mediaKeys=_.createMediaKeys().then(E=>(this.log(`Media-keys created for "${r}"`),w.then(L=>L?this.setMediaKeysServerCertificate(E,r,L):E))),m.mediaKeys.catch(E=>{this.error(`Failed to create media-keys for "${r}"}: ${E}`)}),m.mediaKeys})}return h.then(()=>u.mediaKeys)}createMediaKeySessionContext({decryptdata:r,keySystem:i,mediaKeys:s}){this.log(`Creating key-system session "${i}" keyId: ${qe.hexDump(r.keyId||[])}`);const o=s.createSession(),u={decryptdata:r,keySystem:i,mediaKeys:s,mediaKeysSession:o,keyStatus:"status-pending"};return this.mediaKeySessions.push(u),u}renewKeySession(r){const i=r.decryptdata;if(i.pssh){const s=this.createMediaKeySessionContext(r),o=this.getKeyIdString(i),u="cenc";this.keyIdToKeySessionPromise[o]=this.generateRequestWithPreferredKeySession(s,u,i.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(r)}getKeyIdString(r){if(!r)throw new Error("Could not read keyId of undefined decryptdata");if(r.keyId===null)throw new Error("keyId is null");return qe.hexDump(r.keyId)}updateKeySession(r,i){var s;const o=r.mediaKeysSession;return this.log(`Updating key-session "${o.sessionId}" for keyID ${qe.hexDump(((s=r.decryptdata)==null?void 0:s.keyId)||[])}
} (data length: ${i&&i.byteLength})`),o.update(i)}selectKeySystemFormat(r){const i=Object.keys(r.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${r.sn} ${r.type}: ${r.level}) key formats ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)),this.keyFormatPromise}getKeyFormatPromise(r){return new Promise((i,s)=>{const o=Rr(this.config),u=r.map(nr).filter(h=>!!h&&o.indexOf(h)!==-1);return this.getKeySystemSelectionPromise(u).then(({keySystem:h})=>{const m=Gr(h);m?i(m):s(new Error(`Unable to find format for key-system "${h}"`))}).catch(s)})}loadKey(r){const i=r.keyInfo.decryptdata,s=this.getKeyIdString(i),o=`(keyId: ${s} format: "${i.keyFormat}" method: ${i.method} uri: ${i.uri})`;this.log(`Starting session for key ${o}`);let u=this.keyIdToKeySessionPromise[s];return u||(u=this.keyIdToKeySessionPromise[s]=this.getKeySystemForKeyPromise(i).then(({keySystem:h,mediaKeys:m})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${r.frag.sn} ${r.frag.type}: ${r.frag.level} using key ${o}`),this.attemptSetMediaKeys(h,m).then(()=>{this.throwIfDestroyed();const _=this.createMediaKeySessionContext({keySystem:h,mediaKeys:m,decryptdata:i});return this.generateRequestWithPreferredKeySession(_,"cenc",i.pssh,"playlist-key")}))),u.catch(h=>this.handleError(h))),u}throwIfDestroyed(r="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(r){this.hls&&(this.error(r.message),r instanceof Bs?this.hls.trigger(b.ERROR,r.data):this.hls.trigger(b.ERROR,{type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_NO_KEYS,error:r,fatal:!0}))}getKeySystemForKeyPromise(r){const i=this.getKeyIdString(r),s=this.keyIdToKeySessionPromise[i];if(!s){const o=nr(r.keyFormat),u=o?[o]:Rr(this.config);return this.attemptKeySystemAccess(u)}return s}getKeySystemSelectionPromise(r){if(r.length||(r=Rr(this.config)),r.length===0)throw new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(r)}attemptSetMediaKeys(r,i){const s=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${r}"`);const o=Promise.all(s).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(i)});return this.setMediaKeysQueue.push(o),o.then(()=>{this.log(`Media-keys set for "${r}"`),s.push(o),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(u=>s.indexOf(u)===-1)})}generateRequestWithPreferredKeySession(r,i,s,o){var u,h;const m=(u=this.config.drmSystems)==null||(h=u[r.keySystem])==null?void 0:h.generateRequest;if(m)try{const j=m.call(this.hls,i,s,r);if(!j)throw new Error("Invalid response from configured generateRequest filter");i=j.initDataType,s=r.decryptdata.pssh=j.initData?new Uint8Array(j.initData):null}catch(j){var _;if(this.warn(j.message),(_=this.hls)!=null&&_.config.debug)throw j}if(s===null)return this.log(`Skipping key-session request for "${o}" (no initData)`),Promise.resolve(r);const w=this.getKeyIdString(r.decryptdata);this.log(`Generating key-session request for "${o}": ${w} (init data type: ${i} length: ${s?s.byteLength:null})`);const E=new ar,L=r._onmessage=j=>{const ne=r.mediaKeysSession;if(!ne){E.emit("error",new Error("invalid state"));return}const{messageType:de,message:$e}=j;this.log(`"${de}" message event for session "${ne.sessionId}" message size: ${$e.byteLength}`),de==="license-request"||de==="license-renewal"?this.renewLicense(r,$e).catch(ct=>{this.handleError(ct),E.emit("error",ct)}):de==="license-release"?r.keySystem===ot.FAIRPLAY&&(this.updateKeySession(r,rt("acknowledged")),this.removeSession(r)):this.warn(`unhandled media key message type "${de}"`)},N=r._onkeystatuseschange=j=>{if(!r.mediaKeysSession){E.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(r);const de=r.keyStatus;E.emit("keyStatus",de),de==="expired"&&(this.warn(`${r.keySystem} expired for key ${w}`),this.renewKeySession(r))};r.mediaKeysSession.addEventListener("message",L),r.mediaKeysSession.addEventListener("keystatuseschange",N);const J=new Promise((j,ne)=>{E.on("error",ne),E.on("keyStatus",de=>{de.startsWith("usable")?j():de==="output-restricted"?ne(new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):de==="internal-error"?ne(new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${de}"`)):de==="expired"?ne(new Error("key expired while generating request")):this.warn(`unhandled key status change "${de}"`)})});return r.mediaKeysSession.generateRequest(i,s).then(()=>{var j;this.log(`Request generated for key-session "${(j=r.mediaKeysSession)==null?void 0:j.sessionId}" keyId: ${w}`)}).catch(j=>{throw new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_NO_SESSION,error:j,fatal:!1},`Error generating key-session request: ${j}`)}).then(()=>J).catch(j=>{throw E.removeAllListeners(),this.removeSession(r),j}).then(()=>(E.removeAllListeners(),r))}onKeyStatusChange(r){r.mediaKeysSession.keyStatuses.forEach((i,s)=>{this.log(`key status change "${i}" for keyStatuses keyId: ${qe.hexDump("buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s))} session keyId: ${qe.hexDump(new Uint8Array(r.decryptdata.keyId||[]))} uri: ${r.decryptdata.uri}`),r.keyStatus=i})}fetchServerCertificate(r){const i=this.config,s=i.loader,o=new s(i),u=this.getServerCertificateUrl(r);return u?(this.log(`Fetching server certificate for "${r}"`),new Promise((h,m)=>{const _={responseType:"arraybuffer",url:u},w=i.certLoadPolicy.default,E={loadPolicy:w,timeout:w.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},L={onSuccess:(N,J,j,ne)=>{h(N.data)},onError:(N,J,j,ne)=>{m(new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:j,response:Oe({url:_.url,data:void 0},N)},`"${r}" certificate request failed (${u}). Status: ${N.code} (${N.text})`))},onTimeout:(N,J,j)=>{m(new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:j,response:{url:_.url,data:void 0}},`"${r}" certificate request timed out (${u})`))},onAbort:(N,J,j)=>{m(new Error("aborted"))}};o.load(_,E,L)})):Promise.resolve()}setMediaKeysServerCertificate(r,i,s){return new Promise((o,u)=>{r.setServerCertificate(s).then(h=>{this.log(`setServerCertificate ${h?"success":"not supported by CDM"} (${s==null?void 0:s.byteLength}) on "${i}"`),o(r)}).catch(h=>{u(new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:h,fatal:!0},h.message))})})}renewLicense(r,i){return this.requestLicense(r,new Uint8Array(i)).then(s=>this.updateKeySession(r,new Uint8Array(s)).catch(o=>{throw new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:o,fatal:!0},o.message)}))}unpackPlayReadyKeyMessage(r,i){const s=String.fromCharCode.apply(null,new Uint16Array(i.buffer));if(!s.includes("PlayReadyKeyMessage"))return r.setRequestHeader("Content-Type","text/xml; charset=utf-8"),i;const o=new DOMParser().parseFromString(s,"application/xml"),u=o.querySelectorAll("HttpHeader");if(u.length>0){let E;for(let L=0,N=u.length;L<N;L++){var h,m;E=u[L];const J=(h=E.querySelector("name"))==null?void 0:h.textContent,j=(m=E.querySelector("value"))==null?void 0:m.textContent;J&&j&&r.setRequestHeader(J,j)}}const _=o.querySelector("Challenge"),w=_==null?void 0:_.textContent;if(!w)throw new Error("Cannot find <Challenge> in key message");return rt(atob(w))}setupLicenseXHR(r,i,s,o){const u=this.config.licenseXhrSetup;return u?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return u.call(this.hls,r,i,s,o)}).catch(h=>{if(!s.decryptdata)throw h;return r.open("POST",i,!0),u.call(this.hls,r,i,s,o)}).then(h=>(r.readyState||r.open("POST",i,!0),{xhr:r,licenseChallenge:h||o})):(r.open("POST",i,!0),Promise.resolve({xhr:r,licenseChallenge:o}))}requestLicense(r,i){const s=this.config.keyLoadPolicy.default;return new Promise((o,u)=>{const h=this.getLicenseServerUrlOrThrow(r.keySystem);this.log(`Sending license request to URL: ${h}`);const m=new XMLHttpRequest;m.responseType="arraybuffer",m.onreadystatechange=()=>{if(!this.hls||!r.mediaKeysSession)return u(new Error("invalid state"));if(m.readyState===4)if(m.status===200){this._requestLicenseFailureCount=0;let _=m.response;this.log(`License received ${_ instanceof ArrayBuffer?_.byteLength:_}`);const w=this.config.licenseResponseCallback;if(w)try{_=w.call(this.hls,m,h,r)}catch(E){this.error(E)}o(_)}else{const _=s.errorRetry,w=_?_.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>w||m.status>=400&&m.status<500)u(new Bs({type:M.KEY_SYSTEM_ERROR,details:I.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:m,response:{url:h,data:void 0,code:m.status,text:m.statusText}},`License Request XHR failed (${h}). Status: ${m.status} (${m.statusText})`));else{const E=w-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${E} attempts left`),this.requestLicense(r,i).then(o,u)}}},r.licenseXhr&&r.licenseXhr.readyState!==XMLHttpRequest.DONE&&r.licenseXhr.abort(),r.licenseXhr=m,this.setupLicenseXHR(m,h,r,i).then(({xhr:_,licenseChallenge:w})=>{r.keySystem==ot.PLAYREADY&&(w=this.unpackPlayReadyKeyMessage(_,w)),_.send(w)})})}onMediaAttached(r,i){if(!this.config.emeEnabled)return;const s=i.media;this.media=s,s.removeEventListener("encrypted",this.onMediaEncrypted),s.removeEventListener("waitingforkey",this.onWaitingForKey),s.addEventListener("encrypted",this.onMediaEncrypted),s.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const r=this.media,i=this.mediaKeySessions;r&&(r.removeEventListener("encrypted",this.onMediaEncrypted),r.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},br.clearKeyUriToKeyIdMap();const s=i.length;fa.CDMCleanupPromise=Promise.all(i.map(o=>this.removeSession(o)).concat(r==null?void 0:r.setMediaKeys(null).catch(o=>{this.log(`Could not clear media keys: ${o}`)}))).then(()=>{s&&(this.log("finished closing key sessions and clearing media keys"),i.length=0)}).catch(o=>{this.log(`Could not close sessions and clear media keys: ${o}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(r,{sessionKeys:i}){if(!(!i||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=i.reduce((o,u)=>(o.indexOf(u.keyFormat)===-1&&o.push(u.keyFormat),o),[]);this.log(`Selecting key-system from session-keys ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(r){const{mediaKeysSession:i,licenseXhr:s}=r;if(i){this.log(`Remove licenses and keys and close session ${i.sessionId}`),r._onmessage&&(i.removeEventListener("message",r._onmessage),r._onmessage=void 0),r._onkeystatuseschange&&(i.removeEventListener("keystatuseschange",r._onkeystatuseschange),r._onkeystatuseschange=void 0),s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),r.mediaKeysSession=r.decryptdata=r.licenseXhr=void 0;const o=this.mediaKeySessions.indexOf(r);return o>-1&&this.mediaKeySessions.splice(o,1),i.remove().catch(u=>{this.log(`Could not remove session: ${u}`)}).then(()=>i.close()).catch(u=>{this.log(`Could not close session: ${u}`)})}}}fa.CDMCleanupPromise=void 0;class Bs extends Error{constructor(r,i){super(i),this.data=void 0,r.error||(r.error=new Error(i)),this.data=r,r.err=r.error}}var Ri;(function(d){d.MANIFEST="m",d.AUDIO="a",d.VIDEO="v",d.MUXED="av",d.INIT="i",d.CAPTION="c",d.TIMED_TEXT="tt",d.KEY="k",d.OTHER="o"})(Ri||(Ri={}));var Xa;(function(d){d.DASH="d",d.HLS="h",d.SMOOTH="s",d.OTHER="o"})(Xa||(Xa={}));var is;(function(d){d.OBJECT="CMCD-Object",d.REQUEST="CMCD-Request",d.SESSION="CMCD-Session",d.STATUS="CMCD-Status"})(is||(is={}));const po={[is.OBJECT]:["br","d","ot","tb"],[is.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[is.SESSION]:["cid","pr","sf","sid","st","v"],[is.STATUS]:["bs","rtp"]};class Ra{constructor(r,i){this.value=void 0,this.params=void 0,Array.isArray(r)&&(r=r.map(s=>s instanceof Ra?s:new Ra(s))),this.value=r,this.params=i}}class va{constructor(r){this.description=void 0,this.description=r}}const ec="Dict";function tc(d){return Array.isArray(d)?JSON.stringify(d):d instanceof Map?"Map{}":d instanceof Set?"Set{}":typeof d=="object"?JSON.stringify(d):String(d)}function pu(d,r,i,s){return new Error(`failed to ${d} "${tc(r)}" as ${i}`,{cause:s})}const rc="Bare Item",Ms="Boolean",Ia="Byte Sequence",th="Decimal",nc="Integer";function mu(d){return d<-999999999999999||999999999999999<d}const Hn=/[\x00-\x1f\x7f]+/,Tl="Token",qo="Key";function sa(d,r,i){return pu("serialize",d,r,i)}function Bt(d){if(typeof d!="boolean")throw sa(d,Ms);return d?"?1":"?0"}function rh(d){return btoa(String.fromCharCode(...d))}function nh(d){if(ArrayBuffer.isView(d)===!1)throw sa(d,Ia);return`:${rh(d)}:`}function O0(d){if(mu(d))throw sa(d,nc);return d.toString()}function ih(d){return`@${O0(d.getTime()/1e3)}`}function Cl(d,r){if(d<0)return-Cl(-d,r);const i=Math.pow(10,r);if(Math.abs(d*i%1-.5)<Number.EPSILON){const o=Math.floor(d*i);return(o%2===0?o:o+1)/i}else return Math.round(d*i)/i}function sh(d){const r=Cl(d,3);if(Math.floor(Math.abs(r)).toString().length>12)throw sa(d,th);const i=r.toString();return i.includes(".")?i:`${i}.0`}const ah="String";function Ps(d){if(Hn.test(d))throw sa(d,ah);return`"${d.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function mo(d){return d.description||d.toString().slice(7,-1)}function e0(d){const r=mo(d);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(r)===!1)throw sa(r,Tl);return r}function Dl(d){switch(typeof d){case"number":if(!te(d))throw sa(d,rc);return Number.isInteger(d)?O0(d):sh(d);case"string":return Ps(d);case"symbol":return e0(d);case"boolean":return Bt(d);case"object":if(d instanceof Date)return ih(d);if(d instanceof Uint8Array)return nh(d);if(d instanceof va)return e0(d);default:throw sa(d,rc)}}function gu(d){if(/^[a-z*][a-z0-9\-_.*]*$/.test(d)===!1)throw sa(d,qo);return d}function vu(d){return d==null?"":Object.entries(d).map(([r,i])=>i===!0?`;${gu(r)}`:`;${gu(r)}=${Dl(i)}`).join("")}function B0(d){return d instanceof Ra?`${Dl(d.value)}${vu(d.params)}`:Dl(d)}function ic(d){return`(${d.value.map(B0).join(" ")})${vu(d.params)}`}function P0(d,r={whitespace:!0}){if(typeof d!="object")throw sa(d,ec);const i=d instanceof Map?d.entries():Object.entries(d),s=r!=null&&r.whitespace?" ":"";return Array.from(i).map(([o,u])=>{u instanceof Ra||(u=new Ra(u));let h=gu(o);return u.value===!0?h+=vu(u.params):(h+="=",Array.isArray(u.value)?h+=ic(u):h+=B0(u)),h}).join(`,${s}`)}function Us(d,r){return P0(d,r)}const Zo=d=>d==="ot"||d==="sf"||d==="st",sc=d=>typeof d=="number"?te(d):d!=null&&d!==""&&d!==!1;function ac(d,r){const i=new URL(d),s=new URL(r);if(i.origin!==s.origin)return d;const o=i.pathname.split("/").slice(1),u=s.pathname.split("/").slice(1,-1);for(;o[0]===u[0];)o.shift(),u.shift();for(;u.length;)u.shift(),o.unshift("..");return o.join("/")}function yu(){try{return crypto.randomUUID()}catch(d){try{const r=URL.createObjectURL(new Blob),i=r.toString();return URL.revokeObjectURL(r),i.slice(i.lastIndexOf("/")+1)}catch(r){let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const u=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(o=="x"?u:u&3|8).toString(16)})}}}const F0=d=>Math.round(d),oh=(d,r)=>(r!=null&&r.baseUrl&&(d=ac(d,r.baseUrl)),encodeURIComponent(d)),N0=d=>F0(d/100)*100,lh={br:F0,d:F0,bl:N0,dl:N0,mtp:N0,nor:oh,rtp:N0,tb:F0};function oc(d,r){const i={};if(d==null||typeof d!="object")return i;const s=Object.keys(d).sort(),o=c({},lh,r==null?void 0:r.formatters),u=r==null?void 0:r.filter;return s.forEach(h=>{if(u!=null&&u(h))return;let m=d[h];const _=o[h];_&&(m=_(m,r)),!(h==="v"&&m===1)&&(h=="pr"&&m===1||sc(m)&&(Zo(h)&&typeof m=="string"&&(m=new va(m)),i[h]=m))}),i}function Si(d,r={}){return d?Us(oc(d,r),c({whitespace:!1},r)):""}function uh(d,r={}){if(!d)return{};const i=Object.entries(d),s=Object.entries(po).concat(Object.entries((r==null?void 0:r.customHeaderMap)||{})),o=i.reduce((u,h)=>{var m,_;const[w,E]=h,L=((m=s.find(N=>N[1].includes(w)))==null?void 0:m[0])||is.REQUEST;return(_=u[L])!=null||(u[L]={}),u[L][w]=E,u},{});return Object.entries(o).reduce((u,[h,m])=>(u[h]=Si(m,r),u),{})}function ch(d,r,i){return c(d,uh(r,i))}const Yo="CMCD";function hh(d,r={}){if(!d)return"";const i=Si(d,r);return`${Yo}=${encodeURIComponent(i)}`}const Ml=/CMCD=[^&#]+/;function dh(d,r,i){const s=hh(r,i);if(!s)return d;if(Ml.test(d))return d.replace(Ml,s);const o=d.includes("?")?"&":"?";return`${d}${o}${s}`}class lc{constructor(r){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=o=>{try{this.apply(o,{ot:Ri.MANIFEST,su:!this.initialized})}catch(u){P.warn("Could not generate manifest CMCD data.",u)}},this.applyFragmentData=o=>{try{const u=o.frag,h=this.hls.levels[u.level],m=this.getObjectType(u),_={d:u.duration*1e3,ot:m};(m===Ri.VIDEO||m===Ri.AUDIO||m==Ri.MUXED)&&(_.br=h.bitrate/1e3,_.tb=this.getTopBandwidth(m)/1e3,_.bl=this.getBufferLength(m)),this.apply(o,_)}catch(u){P.warn("Could not generate segment CMCD data.",u)}},this.hls=r;const i=this.config=r.config,{cmcd:s}=i;s!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||yu(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.includeKeys=s.includeKeys,this.registerListeners())}registerListeners(){const r=this.hls;r.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(b.MEDIA_DETACHED,this.onMediaDetached,this),r.on(b.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const r=this.hls;r.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(b.MEDIA_DETACHED,this.onMediaDetached,this),r.off(b.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(r,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(r,i){var s,o;this.audioBuffer=(s=i.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(o=i.tracks.video)==null?void 0:o.buffer}createData(){var r;return{v:1,sf:Xa.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)==null?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(r,i={}){c(i,this.createData());const s=i.ot===Ri.INIT||i.ot===Ri.VIDEO||i.ot===Ri.MUXED;this.starved&&s&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering);const{includeKeys:o}=this;o&&(i=Object.keys(i).reduce((u,h)=>(o.includes(h)&&(u[h]=i[h]),u),{})),this.useHeaders?(r.headers||(r.headers={}),ch(r.headers,i)):r.url=dh(r.url,i)}getObjectType(r){const{type:i}=r;if(i==="subtitle")return Ri.TIMED_TEXT;if(r.sn==="initSegment")return Ri.INIT;if(i==="audio")return Ri.AUDIO;if(i==="main")return this.hls.audioTracks.length?Ri.VIDEO:Ri.MUXED}getTopBandwidth(r){let i=0,s;const o=this.hls;if(r===Ri.AUDIO)s=o.audioTracks;else{const u=o.maxAutoLevel,h=u>-1?u+1:o.levels.length;s=o.levels.slice(0,h)}for(const u of s)u.bitrate>i&&(i=u.bitrate);return i>0?i:NaN}getBufferLength(r){const i=this.hls.media,s=r===Ri.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!i?NaN:Jn.bufferInfo(s,i.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:r}=this.config,i=this.applyPlaylistData,s=r||this.config.loader;return class{constructor(u){this.loader=void 0,this.loader=new s(u)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(u,h,m){i(u),this.loader.load(u,h,m)}}}createFragmentLoader(){const{fLoader:r}=this.config,i=this.applyFragmentData,s=r||this.config.loader;return class{constructor(u){this.loader=void 0,this.loader=new s(u)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(u,h,m){i(u),this.loader.load(u,h,m)}}}}const uc=3e5;class t0{constructor(r){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=r,this.log=P.log.bind(P,"[content-steering]:"),this.registerListeners()}registerListeners(){const r=this.hls;r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(b.MANIFEST_PARSED,this.onManifestParsed,this),r.on(b.ERROR,this.onError,this)}unregisterListeners(){const r=this.hls;r&&(r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.MANIFEST_LOADED,this.onManifestLoaded,this),r.off(b.MANIFEST_PARSED,this.onManifestParsed,this),r.off(b.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const r=this.timeToLoad*1e3-(performance.now()-this.updated);if(r>0){this.scheduleRefresh(this.uri,r);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(r){const i=this.levels;i&&(this.levels=i.filter(s=>s!==r))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(r,i){const{contentSteering:s}=i;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(r,i){this.audioTracks=i.audioTracks,this.subtitleTracks=i.subtitleTracks}onError(r,i){const{errorAction:s}=i;if((s==null?void 0:s.action)===Dr.SendAlternateToPenaltyBox&&s.flags===On.MoveAllAlternatesMatchingHost){const o=this.levels;let u=this.pathwayPriority,h=this.pathwayId;if(i.context){const{groupId:m,pathwayId:_,type:w}=i.context;m&&o?h=this.getPathwayForGroupId(m,w,h):_&&(h=_)}h in this.penalizedPathways||(this.penalizedPathways[h]=performance.now()),!u&&o&&(u=o.reduce((m,_)=>(m.indexOf(_.pathwayId)===-1&&m.push(_.pathwayId),m),[])),u&&u.length>1&&(this.updatePathwayPriority(u),s.resolved=this.pathwayId!==h),s.resolved||P.warn(`Could not resolve ${i.details} ("${i.error.message}") with content-steering for Pathway: ${h} levels: ${o&&o.length} priorities: ${JSON.stringify(u)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(r){this.levels=r;let i=this.getLevelsForPathway(this.pathwayId);if(i.length===0){const s=r[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${s}"`),i=this.getLevelsForPathway(s),this.pathwayId=s}return i.length!==r.length&&this.log(`Found ${i.length}/${r.length} levels in Pathway "${this.pathwayId}"`),i}getLevelsForPathway(r){return this.levels===null?[]:this.levels.filter(i=>r===i.pathwayId)}updatePathwayPriority(r){this.pathwayPriority=r;let i;const s=this.penalizedPathways,o=performance.now();Object.keys(s).forEach(u=>{o-s[u]>uc&&delete s[u]});for(let u=0;u<r.length;u++){const h=r[u];if(h in s)continue;if(h===this.pathwayId)return;const m=this.hls.nextLoadLevel,_=this.hls.levels[m];if(i=this.getLevelsForPathway(h),i.length>0){this.log(`Setting Pathway to "${h}"`),this.pathwayId=h,oi(i),this.hls.trigger(b.LEVELS_UPDATED,{levels:i});const w=this.hls.levels[m];_&&w&&this.levels&&(w.attrs["STABLE-VARIANT-ID"]!==_.attrs["STABLE-VARIANT-ID"]&&w.bitrate!==_.bitrate&&this.log(`Unstable Pathways change from bitrate ${_.bitrate} to ${w.bitrate}`),this.hls.nextLoadLevel=m);break}}}getPathwayForGroupId(r,i,s){const o=this.getLevelsForPathway(s).concat(this.levels||[]);for(let u=0;u<o.length;u++)if(i===sr.AUDIO_TRACK&&o[u].hasAudioGroup(r)||i===sr.SUBTITLE_TRACK&&o[u].hasSubtitleGroup(r))return o[u].pathwayId;return s}clonePathways(r){const i=this.levels;if(!i)return;const s={},o={};r.forEach(u=>{const{ID:h,"BASE-ID":m,"URI-REPLACEMENT":_}=u;if(i.some(E=>E.pathwayId===h))return;const w=this.getLevelsForPathway(m).map(E=>{const L=new ye(E.attrs);L["PATHWAY-ID"]=h;const N=L.AUDIO&&`${L.AUDIO}_clone_${h}`,J=L.SUBTITLES&&`${L.SUBTITLES}_clone_${h}`;N&&(s[L.AUDIO]=N,L.AUDIO=N),J&&(o[L.SUBTITLES]=J,L.SUBTITLES=J);const j=bu(E.uri,L["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",_),ne=new Di({attrs:L,audioCodec:E.audioCodec,bitrate:E.bitrate,height:E.height,name:E.name,url:j,videoCodec:E.videoCodec,width:E.width});if(E.audioGroups)for(let de=1;de<E.audioGroups.length;de++)ne.addGroupId("audio",`${E.audioGroups[de]}_clone_${h}`);if(E.subtitleGroups)for(let de=1;de<E.subtitleGroups.length;de++)ne.addGroupId("text",`${E.subtitleGroups[de]}_clone_${h}`);return ne});i.push(...w),cc(this.audioTracks,s,_,h),cc(this.subtitleTracks,o,_,h)})}loadSteeringManifest(r){const i=this.hls.config,s=i.loader;this.loader&&this.loader.destroy(),this.loader=new s(i);let o;try{o=new self.URL(r)}catch(E){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${r}`);return}if(o.protocol!=="data:"){const E=(this.hls.bandwidthEstimate||i.abrEwmaDefaultEstimate)|0;o.searchParams.set("_HLS_pathway",this.pathwayId),o.searchParams.set("_HLS_throughput",""+E)}const u={responseType:"json",url:o.href},h=i.steeringManifestLoadPolicy.default,m=h.errorRetry||h.timeoutRetry||{},_={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:m.maxNumRetry||0,retryDelay:m.retryDelayMs||0,maxRetryDelay:m.maxRetryDelayMs||0},w={onSuccess:(E,L,N,J)=>{this.log(`Loaded steering manifest: "${o}"`);const j=E.data;if(j.VERSION!==1){this.log(`Steering VERSION ${j.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=j.TTL;const{"RELOAD-URI":ne,"PATHWAY-CLONES":de,"PATHWAY-PRIORITY":$e}=j;if(ne)try{this.uri=new self.URL(ne,o).href}catch(ht){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${ne}`);return}this.scheduleRefresh(this.uri||N.url),de&&this.clonePathways(de);const ct={steeringManifest:j,url:o.toString()};this.hls.trigger(b.STEERING_MANIFEST_LOADED,ct),$e&&this.updatePathwayPriority($e)},onError:(E,L,N,J)=>{if(this.log(`Error loading steering manifest: ${E.code} ${E.text} (${L.url})`),this.stopLoad(),E.code===410){this.enabled=!1,this.log(`Steering manifest ${L.url} no longer available`);return}let j=this.timeToLoad*1e3;if(E.code===429){const ne=this.loader;if(typeof(ne==null?void 0:ne.getResponseHeader)=="function"){const de=ne.getResponseHeader("Retry-After");de&&(j=parseFloat(de)*1e3)}this.log(`Steering manifest ${L.url} rate limited`);return}this.scheduleRefresh(this.uri||L.url,j)},onTimeout:(E,L,N)=>{this.log(`Timeout loading steering manifest (${L.url})`),this.scheduleRefresh(this.uri||L.url)}};this.log(`Requesting steering manifest: ${o}`),this.loader.load(u,_,w)}scheduleRefresh(r,i=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var s;const o=(s=this.hls)==null?void 0:s.media;if(o&&!o.ended){this.loadSteeringManifest(r);return}this.scheduleRefresh(r,this.timeToLoad*1e3)},i)}}function cc(d,r,i,s){d&&Object.keys(r).forEach(o=>{const u=d.filter(h=>h.groupId===o).map(h=>{const m=c({},h);return m.details=void 0,m.attrs=new ye(m.attrs),m.url=m.attrs.URI=bu(h.url,h.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),m.groupId=m.attrs["GROUP-ID"]=r[o],m.attrs["PATHWAY-ID"]=s,m});d.push(...u)})}function bu(d,r,i,s){const{HOST:o,PARAMS:u,[i]:h}=s;let m;r&&(m=h==null?void 0:h[r],m&&(d=m));const _=new self.URL(d);return o&&!m&&(_.host=o),u&&Object.keys(u).sort().forEach(w=>{w&&_.searchParams.set(w,u[w])}),_.href}const _u=/^age:\s*[\d.]+\s*$/im;class xu{constructor(r){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=r&&r.xhrSetup||null,this.stats=new ft,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const r=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),r&&(r.onreadystatechange=null,r.onprogress=null,r.readyState!==4&&(this.stats.aborted=!0,r.abort()))}abort(){var r;this.abortInternal(),(r=this.callbacks)!=null&&r.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(r,i,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=r,this.config=i,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:r,context:i}=this;if(!r||!i)return;const s=this.loader=new self.XMLHttpRequest,o=this.stats;o.loading.first=0,o.loaded=0,o.aborted=!1;const u=this.xhrSetup;u?Promise.resolve().then(()=>{if(!(this.loader!==s||this.stats.aborted))return u(s,i.url)}).catch(h=>{if(!(this.loader!==s||this.stats.aborted))return s.open("GET",i.url,!0),u(s,i.url)}).then(()=>{this.loader!==s||this.stats.aborted||this.openAndSendXhr(s,i,r)}).catch(h=>{this.callbacks.onError({code:s.status,text:h.message},i,s,o)}):this.openAndSendXhr(s,i,r)}openAndSendXhr(r,i,s){r.readyState||r.open("GET",i.url,!0);const o=i.headers,{maxTimeToFirstByteMs:u,maxLoadTimeMs:h}=s.loadPolicy;if(o)for(const m in o)r.setRequestHeader(m,o[m]);i.rangeEnd&&r.setRequestHeader("Range","bytes="+i.rangeStart+"-"+(i.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=i.responseType,self.clearTimeout(this.requestTimeout),s.timeout=u&&te(u)?u:h,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),r.send()}readystatechange(){const{context:r,loader:i,stats:s}=this;if(!r||!i)return;const o=i.readyState,u=this.config;if(!s.aborted&&o>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),u.timeout!==u.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),u.timeout=u.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),o===4)){self.clearTimeout(this.requestTimeout),i.onreadystatechange=null,i.onprogress=null;const h=i.status,m=i.responseType==="text"?i.responseText:null;if(h>=200&&h<300){const L=m!=null?m:i.response;if(L!=null){s.loading.end=Math.max(self.performance.now(),s.loading.first);const N=i.responseType==="arraybuffer"?L.byteLength:L.length;if(s.loaded=s.total=N,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first),!this.callbacks)return;const J=this.callbacks.onProgress;if(J&&J(s,r,L,i),!this.callbacks)return;const j={url:i.responseURL,data:L,code:h};this.callbacks.onSuccess(j,s,r,i);return}}const _=u.loadPolicy.errorRetry,w=s.retry,E={url:r.url,data:void 0,code:h};mi(_,w,!1,E)?this.retry(_):(P.error(`${h} while loading ${r.url}`),this.callbacks.onError({code:h,text:i.statusText},r,i,s))}}loadtimeout(){if(!this.config)return;const r=this.config.loadPolicy.timeoutRetry,i=this.stats.retry;if(mi(r,i,!0))this.retry(r);else{var s;P.warn(`timeout while loading ${(s=this.context)==null?void 0:s.url}`);const o=this.callbacks;o&&(this.abortInternal(),o.onTimeout(this.stats,this.context,this.loader))}}retry(r){const{context:i,stats:s}=this;this.retryDelay=Mi(r,s.retry),s.retry++,P.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${i==null?void 0:i.url}, retrying ${s.retry}/${r.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(r){const i=this.stats;i.loaded=r.loaded,r.lengthComputable&&(i.total=r.total)}getCacheAge(){let r=null;if(this.loader&&_u.test(this.loader.getAllResponseHeaders())){const i=this.loader.getResponseHeader("age");r=i?parseFloat(i):null}return r}getResponseHeader(r){return this.loader&&new RegExp(`^${r}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(r):null}}function fh(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}const ph=/(\d+)-(\d+)\/(\d+)/;class hc{constructor(r){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=r.fetchSetup||yh,this.controller=new self.AbortController,this.stats=new ft}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var r;this.abortInternal(),(r=this.callbacks)!=null&&r.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(r,i,s){const o=this.stats;if(o.loading.start)throw new Error("Loader can only be used once.");o.loading.start=self.performance.now();const u=mh(r,this.controller.signal),h=s.onProgress,m=r.responseType==="arraybuffer",_=m?"byteLength":"length",{maxTimeToFirstByteMs:w,maxLoadTimeMs:E}=i.loadPolicy;this.context=r,this.config=i,this.callbacks=s,this.request=this.fetchSetup(r,u),self.clearTimeout(this.requestTimeout),i.timeout=w&&te(w)?w:E,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(o,r,this.response)},i.timeout),self.fetch(this.request).then(L=>{this.response=this.loader=L;const N=Math.max(self.performance.now(),o.loading.start);if(self.clearTimeout(this.requestTimeout),i.timeout=E,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(o,r,this.response)},E-(N-o.loading.start)),!L.ok){const{status:J,statusText:j}=L;throw new bh(j||"fetch, bad network response",J,L)}return o.loading.first=N,o.total=vh(L.headers)||o.total,h&&te(i.highWaterMark)?this.loadProgressively(L,o,r,i.highWaterMark,h):m?L.arrayBuffer():r.responseType==="json"?L.json():L.text()}).then(L=>{const N=this.response;if(!N)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),o.loading.end=Math.max(self.performance.now(),o.loading.first);const J=L[_];J&&(o.loaded=o.total=J);const j={url:N.url,data:L,code:N.status};h&&!te(i.highWaterMark)&&h(o,r,L,N),s.onSuccess(j,o,r,N)}).catch(L=>{if(self.clearTimeout(this.requestTimeout),o.aborted)return;const N=L&&L.code||0,J=L?L.message:null;s.onError({code:N,text:J},r,L?L.details:null,o)})}getCacheAge(){let r=null;if(this.response){const i=this.response.headers.get("age");r=i?parseFloat(i):null}return r}getResponseHeader(r){return this.response?this.response.headers.get(r):null}loadProgressively(r,i,s,o=0,u){const h=new sl,m=r.body.getReader(),_=()=>m.read().then(w=>{if(w.done)return h.dataLength&&u(i,s,h.flush(),r),Promise.resolve(new ArrayBuffer(0));const E=w.value,L=E.length;return i.loaded+=L,L<o||h.dataLength?(h.push(E),h.dataLength>=o&&u(i,s,h.flush(),r)):u(i,s,E,r),_()}).catch(()=>Promise.reject());return _()}}function mh(d,r){const i={method:"GET",mode:"cors",credentials:"same-origin",signal:r,headers:new self.Headers(c({},d.headers))};return d.rangeEnd&&i.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),i}function gh(d){const r=ph.exec(d);if(r)return parseInt(r[2])-parseInt(r[1])+1}function vh(d){const r=d.get("Content-Range");if(r){const s=gh(r);if(te(s))return s}const i=d.get("Content-Length");if(i)return parseInt(i)}function yh(d,r){return new self.Request(d.url,r)}class bh extends Error{constructor(r,i,s){super(r),this.code=void 0,this.details=void 0,this.code=i,this.details=s}}const go=/\s/,Xo={newCue(d,r,i,s){const o=[];let u,h,m,_,w;const E=self.VTTCue||self.TextTrackCue;for(let N=0;N<s.rows.length;N++)if(u=s.rows[N],m=!0,_=0,w="",!u.isEmpty()){var L;for(let ne=0;ne<u.chars.length;ne++)go.test(u.chars[ne].uchar)&&m?_++:(w+=u.chars[ne].uchar,m=!1);u.cueStartTime=r,r===i&&(i+=1e-4),_>=16?_--:_++;const J=uu(w.trim()),j=Bn(r,i,J);d!=null&&(L=d.cues)!=null&&L.getCueById(j)||(h=new E(r,i,J),h.id=j,h.line=N+1,h.align="left",h.position=10+Math.min(80,Math.floor(_*8/32)*10),o.push(h))}return d&&o.length&&(o.sort((N,J)=>N.line==="auto"||J.line==="auto"?0:N.line>8&&J.line>8?J.line-N.line:N.line-J.line),o.forEach(N=>vn(d,N))),o}},Ll={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Oa=Oe(Oe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:xu,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Ka,bufferController:Ks,capLevelController:Ql,errorController:Li,fpsController:I0,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:hn,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:Ll},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Ja()),{},{subtitleStreamController:wi,subtitleTrackController:vs,timelineController:eh,audioStreamController:En,audioTrackController:si,emeController:fa,cmcdController:lc,contentSteeringController:t0});function Ja(){return{cueHandler:Xo,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function vo(d,r){if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(r.liveMaxLatencyDurationCount!==void 0&&(r.liveSyncDurationCount===void 0||r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(r.liveMaxLatencyDuration!==void 0&&(r.liveSyncDuration===void 0||r.liveMaxLatencyDuration<=r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const i=Rl(d),s=["manifest","level","frag"],o=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(u=>{const h=`${u==="level"?"playlist":u}LoadPolicy`,m=r[h]===void 0,_=[];o.forEach(w=>{const E=`${u}Loading${w}`,L=r[E];if(L!==void 0&&m){_.push(E);const N=i[h].default;switch(r[h]={default:N},w){case"TimeOut":N.maxLoadTimeMs=L,N.maxTimeToFirstByteMs=L;break;case"MaxRetry":N.errorRetry.maxNumRetry=L,N.timeoutRetry.maxNumRetry=L;break;case"RetryDelay":N.errorRetry.retryDelayMs=L,N.timeoutRetry.retryDelayMs=L;break;case"MaxRetryTimeout":N.errorRetry.maxRetryDelayMs=L,N.timeoutRetry.maxRetryDelayMs=L;break}}}),_.length&&P.warn(`hls.js config: "${_.join('", "')}" setting(s) are deprecated, use "${h}": ${JSON.stringify(r[h])}`)}),Oe(Oe({},i),r)}function Rl(d){return d&&typeof d=="object"?Array.isArray(d)?d.map(Rl):Object.keys(d).reduce((r,i)=>(r[i]=Rl(d[i]),r),{}):d}function $0(d){const r=d.loader;r!==hc&&r!==xu?(P.log("[config]: Custom loader detected, cannot enable progressive streaming"),d.progressive=!1):fh()&&(d.loader=hc,d.progressive=!0,d.enableSoftwareAES=!0,P.log("[config]: Progressive streaming enabled, using FetchLoader"))}let Il;class z0 extends jn{constructor(r,i){super(r,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=i,this._registerListeners()}_registerListeners(){const{hls:r}=this;r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(b.LEVEL_LOADED,this.onLevelLoaded,this),r.on(b.LEVELS_UPDATED,this.onLevelsUpdated,this),r.on(b.FRAG_BUFFERED,this.onFragBuffered,this),r.on(b.ERROR,this.onError,this)}_unregisterListeners(){const{hls:r}=this;r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.MANIFEST_LOADED,this.onManifestLoaded,this),r.off(b.LEVEL_LOADED,this.onLevelLoaded,this),r.off(b.LEVELS_UPDATED,this.onLevelsUpdated,this),r.off(b.FRAG_BUFFERED,this.onFragBuffered,this),r.off(b.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(i=>{i.loadError=0,i.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(r,i){this.resetLevels()}onManifestLoaded(r,i){const s=this.hls.config.preferManagedMediaSource,o=[],u={},h={};let m=!1,_=!1,w=!1;i.levels.forEach(E=>{var L,N;const J=E.attrs;let{audioCodec:j,videoCodec:ne}=E;((L=j)==null?void 0:L.indexOf("mp4a.40.34"))!==-1&&(Il||(Il=/chrome|firefox/i.test(navigator.userAgent)),Il&&(E.audioCodec=j=void 0)),j&&(E.audioCodec=j=_r(j,s)),((N=ne)==null?void 0:N.indexOf("avc1"))===0&&(ne=E.videoCodec=Qr(ne));const{width:de,height:$e,unknownCodecs:ct}=E;if(m||(m=!!(de&&$e)),_||(_=!!ne),w||(w=!!j),ct!=null&&ct.length||j&&!nt(j,"audio",s)||ne&&!nt(ne,"video",s))return;const{CODECS:ht,"FRAME-RATE":At,"HDCP-LEVEL":yt,"PATHWAY-ID":Qt,RESOLUTION:zt,"VIDEO-RANGE":pr}=J,Zt=`${`${Qt||"."}-`}${E.bitrate}-${zt}-${At}-${ht}-${pr}-${yt}`;if(u[Zt])if(u[Zt].uri!==E.url&&!E.attrs["PATHWAY-ID"]){const mr=h[Zt]+=1;E.attrs["PATHWAY-ID"]=new Array(mr+1).join(".");const un=new Di(E);u[Zt]=un,o.push(un)}else u[Zt].addGroupId("audio",J.AUDIO),u[Zt].addGroupId("text",J.SUBTITLES);else{const mr=new Di(E);u[Zt]=mr,h[Zt]=1,o.push(mr)}}),this.filterAndSortMediaOptions(o,i,m,_,w)}filterAndSortMediaOptions(r,i,s,o,u){let h=[],m=[],_=r;if((s||o)&&u&&(_=_.filter(({videoCodec:j,videoRange:ne,width:de,height:$e})=>(!!j||!!(de&&$e))&&Wn(ne))),_.length===0){Promise.resolve().then(()=>{if(this.hls){i.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(i.levels[0].attrs)}`);const j=new Error("no level with compatible codecs found in manifest");this.hls.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:i.url,error:j,reason:j.message})}});return}if(i.audioTracks){const{preferManagedMediaSource:j}=this.hls.config;h=i.audioTracks.filter(ne=>!ne.audioCodec||nt(ne.audioCodec,"audio",j)),dc(h)}i.subtitles&&(m=i.subtitles,dc(m));const w=_.slice(0);_.sort((j,ne)=>{if(j.attrs["HDCP-LEVEL"]!==ne.attrs["HDCP-LEVEL"])return(j.attrs["HDCP-LEVEL"]||"")>(ne.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&j.height!==ne.height)return j.height-ne.height;if(j.frameRate!==ne.frameRate)return j.frameRate-ne.frameRate;if(j.videoRange!==ne.videoRange)return Ci.indexOf(j.videoRange)-Ci.indexOf(ne.videoRange);if(j.videoCodec!==ne.videoCodec){const de=Rt(j.videoCodec),$e=Rt(ne.videoCodec);if(de!==$e)return $e-de}if(j.uri===ne.uri&&j.codecSet!==ne.codecSet){const de=lt(j.codecSet),$e=lt(ne.codecSet);if(de!==$e)return $e-de}return j.averageBitrate!==ne.averageBitrate?j.averageBitrate-ne.averageBitrate:0});let E=w[0];if(this.steering&&(_=this.steering.filterParsedLevels(_),_.length!==w.length)){for(let j=0;j<w.length;j++)if(w[j].pathwayId===_[0].pathwayId){E=w[j];break}}this._levels=_;for(let j=0;j<_.length;j++)if(_[j]===E){var L;this._firstLevel=j;const ne=E.bitrate,de=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${_.length} level(s) found, first bitrate: ${ne}`),((L=this.hls.userConfig)==null?void 0:L.abrEwmaDefaultEstimate)===void 0){const $e=Math.min(ne,this.hls.config.abrEwmaDefaultEstimateMax);$e>de&&de===Oa.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=$e)}break}const N=u&&!o,J={levels:_,audioTracks:h,subtitleTracks:m,sessionData:i.sessionData,sessionKeys:i.sessionKeys,firstLevel:this._firstLevel,stats:i.stats,audio:u,video:o,altAudio:!N&&h.some(j=>!!j.url)};this.hls.trigger(b.MANIFEST_PARSED,J),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(r){const i=this._levels;if(i.length===0)return;if(r<0||r>=i.length){const E=new Error("invalid level idx"),L=r<0;if(this.hls.trigger(b.ERROR,{type:M.OTHER_ERROR,details:I.LEVEL_SWITCH_ERROR,level:r,fatal:L,error:E,reason:E.message}),L)return;r=Math.min(r,i.length-1)}const s=this.currentLevelIndex,o=this.currentLevel,u=o?o.attrs["PATHWAY-ID"]:void 0,h=i[r],m=h.attrs["PATHWAY-ID"];if(this.currentLevelIndex=r,this.currentLevel=h,s===r&&h.details&&o&&u===m)return;this.log(`Switching to level ${r} (${h.height?h.height+"p ":""}${h.videoRange?h.videoRange+" ":""}${h.codecSet?h.codecSet+" ":""}@${h.bitrate})${m?" with Pathway "+m:""} from level ${s}${u?" with Pathway "+u:""}`);const _={level:r,attrs:h.attrs,details:h.details,bitrate:h.bitrate,averageBitrate:h.averageBitrate,maxBitrate:h.maxBitrate,realBitrate:h.realBitrate,width:h.width,height:h.height,codecSet:h.codecSet,audioCodec:h.audioCodec,videoCodec:h.videoCodec,audioGroups:h.audioGroups,subtitleGroups:h.subtitleGroups,loaded:h.loaded,loadError:h.loadError,fragmentError:h.fragmentError,name:h.name,id:h.id,uri:h.uri,url:h.url,urlId:0,audioGroupIds:h.audioGroupIds,textGroupIds:h.textGroupIds};this.hls.trigger(b.LEVEL_SWITCHING,_);const w=h.details;if(!w||w.live){const E=this.switchParams(h.uri,o==null?void 0:o.details,w);this.loadPlaylist(E)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(r){this.manualLevelIndex=r,this._startLevel===void 0&&(this._startLevel=r),r!==-1&&(this.level=r)}get firstLevel(){return this._firstLevel}set firstLevel(r){this._firstLevel=r}get startLevel(){if(this._startLevel===void 0){const r=this.hls.config.startLevel;return r!==void 0?r:this.hls.firstAutoLevel}return this._startLevel}set startLevel(r){this._startLevel=r}onError(r,i){i.fatal||!i.context||i.context.type===sr.LEVEL&&i.context.level===this.level&&this.checkRetry(i)}onFragBuffered(r,{frag:i}){if(i!==void 0&&i.type===Ie.MAIN){const s=i.elementaryStreams;if(!Object.keys(s).some(u=>!!s[u]))return;const o=this._levels[i.level];o!=null&&o.loadError&&(this.log(`Resetting level error count of ${o.loadError} on frag buffered`),o.loadError=0)}}onLevelLoaded(r,i){var s;const{level:o,details:u}=i,h=this._levels[o];if(!h){var m;this.warn(`Invalid level index ${o}`),(m=i.deliveryDirectives)!=null&&m.skip&&(u.deltaUpdateFailed=!0);return}o===this.currentLevelIndex?(h.fragmentError===0&&(h.loadError=0),this.playlistLoaded(o,i,h.details)):(s=i.deliveryDirectives)!=null&&s.skip&&(u.deltaUpdateFailed=!0)}loadPlaylist(r){super.loadPlaylist();const i=this.currentLevelIndex,s=this.currentLevel;if(s&&this.shouldLoadPlaylist(s)){let o=s.uri;if(r)try{o=r.addDirectives(o)}catch(h){this.warn(`Could not construct new URL with HLS Delivery Directives: ${h}`)}const u=s.attrs["PATHWAY-ID"];this.log(`Loading level index ${i}${(r==null?void 0:r.msn)!==void 0?" at sn "+r.msn+" part "+r.part:""} with${u?" Pathway "+u:""} ${o}`),this.clearTimer(),this.hls.trigger(b.LEVEL_LOADING,{url:o,level:i,pathwayId:s.attrs["PATHWAY-ID"],id:0,deliveryDirectives:r||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(r){this.level=r,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=r)}removeLevel(r){var i;const s=this._levels.filter((o,u)=>u!==r?!0:(this.steering&&this.steering.removeLevel(o),o===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,o.details&&o.details.fragments.forEach(h=>h.level=-1)),!1));oi(s),this._levels=s,this.currentLevelIndex>-1&&(i=this.currentLevel)!=null&&i.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(b.LEVELS_UPDATED,{levels:s})}onLevelsUpdated(r,{levels:i}){this._levels=i}checkMaxAutoUpdated(){const{autoLevelCapping:r,maxAutoLevel:i,maxHdcpLevel:s}=this.hls;this._maxAutoLevel!==i&&(this._maxAutoLevel=i,this.hls.trigger(b.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:r,levels:this.levels,maxAutoLevel:i,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:s}))}}function dc(d){const r={};d.forEach(i=>{const s=i.groupId||"";i.id=r[s]=r[s]||0,r[s]++})}class fc{constructor(r){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=r}abort(r){for(const s in this.keyUriToKeyInfo){const o=this.keyUriToKeyInfo[s].loader;if(o){var i;if(r&&r!==((i=o.context)==null?void 0:i.frag.type))return;o.abort()}}}detach(){for(const r in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[r];(i.mediaKeySessionContext||i.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[r]}}destroy(){this.detach();for(const r in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[r].loader;i&&i.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(r,i=I.KEY_LOAD_ERROR,s,o,u){return new Ui({type:M.NETWORK_ERROR,details:i,fatal:!1,frag:r,response:u,error:s,networkDetails:o})}loadClear(r,i){if(this.emeController&&this.config.emeEnabled){const{sn:s,cc:o}=r;for(let u=0;u<i.length;u++){const h=i[u];if(o<=h.cc&&(s==="initSegment"||h.sn==="initSegment"||s<h.sn)){this.emeController.selectKeySystemFormat(h).then(m=>{h.setKeyFormat(m)});break}}}}load(r){return!r.decryptdata&&r.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(r).then(i=>this.loadInternal(r,i)):this.loadInternal(r)}loadInternal(r,i){var s,o;i&&r.setKeyFormat(i);const u=r.decryptdata;if(!u){const w=new Error(i?`Expected frag.decryptdata to be defined after setting format ${i}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(r,I.KEY_LOAD_ERROR,w))}const h=u.uri;if(!h)return Promise.reject(this.createKeyLoadError(r,I.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${h}"`)));let m=this.keyUriToKeyInfo[h];if((s=m)!=null&&s.decryptdata.key)return u.key=m.decryptdata.key,Promise.resolve({frag:r,keyInfo:m});if((o=m)!=null&&o.keyLoadPromise){var _;switch((_=m.mediaKeySessionContext)==null?void 0:_.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return m.keyLoadPromise.then(w=>(u.key=w.keyInfo.decryptdata.key,{frag:r,keyInfo:m}))}}switch(m=this.keyUriToKeyInfo[h]={decryptdata:u,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},u.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return u.keyFormat==="identity"?this.loadKeyHTTP(m,r):this.loadKeyEME(m,r);case"AES-128":return this.loadKeyHTTP(m,r);default:return Promise.reject(this.createKeyLoadError(r,I.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${u.method}"`)))}}loadKeyEME(r,i){const s={frag:i,keyInfo:r};if(this.emeController&&this.config.emeEnabled){const o=this.emeController.loadKey(s);if(o)return(r.keyLoadPromise=o.then(u=>(r.mediaKeySessionContext=u,s))).catch(u=>{throw r.keyLoadPromise=null,u})}return Promise.resolve(s)}loadKeyHTTP(r,i){const s=this.config,o=s.loader,u=new o(s);return i.keyLoader=r.loader=u,r.keyLoadPromise=new Promise((h,m)=>{const _={keyInfo:r,frag:i,responseType:"arraybuffer",url:r.decryptdata.uri},w=s.keyLoadPolicy.default,E={loadPolicy:w,timeout:w.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},L={onSuccess:(N,J,j,ne)=>{const{frag:de,keyInfo:$e,url:ct}=j;if(!de.decryptdata||$e!==this.keyUriToKeyInfo[ct])return m(this.createKeyLoadError(de,I.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),ne));$e.decryptdata.key=de.decryptdata.key=new Uint8Array(N.data),de.keyLoader=null,$e.loader=null,h({frag:de,keyInfo:$e})},onError:(N,J,j,ne)=>{this.resetLoader(J),m(this.createKeyLoadError(i,I.KEY_LOAD_ERROR,new Error(`HTTP Error ${N.code} loading key ${N.text}`),j,Oe({url:_.url,data:void 0},N)))},onTimeout:(N,J,j)=>{this.resetLoader(J),m(this.createKeyLoadError(i,I.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),j))},onAbort:(N,J,j)=>{this.resetLoader(J),m(this.createKeyLoadError(i,I.INTERNAL_ABORTED,new Error("key loading aborted"),j))}};u.load(_,E,L)})}resetLoader(r){const{frag:i,keyInfo:s,url:o}=r,u=s.loader;i.keyLoader===u&&(i.keyLoader=null,s.loader=null),delete this.keyUriToKeyInfo[o],u&&u.destroy()}}function wu(){return self.SourceBuffer||self.WebKitSourceBuffer}function Su(){if(!dn())return!1;const r=wu();return!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function"}function _h(){if(!Su())return!1;const d=dn();return typeof(d==null?void 0:d.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(r=>d.isTypeSupported(bt(r,"video")))||["mp4a.40.2","fLaC"].some(r=>d.isTypeSupported(bt(r,"audio"))))}function pc(){var d;const r=wu();return typeof(r==null||(d=r.prototype)==null?void 0:d.changeType)=="function"}const xh=250,K0=2,wh=.1,Sh=.05;class Eh{constructor(r,i,s,o){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=r,this.media=i,this.fragmentTracker=s,this.hls=o}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(r,i){const{config:s,media:o,stalled:u}=this;if(o===null)return;const{currentTime:h,seeking:m}=o,_=this.seeking&&!m,w=!this.seeking&&m;if(this.seeking=m,h!==r){if(this.moved=!0,m||(this.nudgeRetry=0),u!==null){if(this.stallReported){const de=self.performance.now()-u;P.warn(`playback not stuck anymore @${h}, after ${Math.round(de)}ms`),this.stallReported=!1}this.stalled=null}return}if(w||_){this.stalled=null;return}if(o.paused&&!m||o.ended||o.playbackRate===0||!Jn.getBuffered(o).length){this.nudgeRetry=0;return}const E=Jn.bufferInfo(o,h,0),L=E.nextStart||0;if(m){const de=E.len>K0,$e=!L||i&&i.start<=h||L-h>K0&&!this.fragmentTracker.getPartialFragment(h);if(de||$e)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var N;if(!(E.len>0)&&!L)return;const $e=Math.max(L,E.start||0)-h,ct=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,At=(ct==null||(N=ct.details)==null?void 0:N.live)?ct.details.targetduration*2:K0,yt=this.fragmentTracker.getPartialFragment(h);if($e>0&&($e<=At||yt)){o.paused||this._trySkipBufferHole(yt);return}}const J=self.performance.now();if(u===null){this.stalled=J;return}const j=J-u;if(!m&&j>=xh&&(this._reportStall(E),!this.media))return;const ne=Jn.bufferInfo(o,h,s.maxBufferHole);this._tryFixBufferStall(ne,j)}_tryFixBufferStall(r,i){const{config:s,fragmentTracker:o,media:u}=this;if(u===null)return;const h=u.currentTime,m=o.getPartialFragment(h);m&&(this._trySkipBufferHole(m)||!this.media)||(r.len>s.maxBufferHole||r.nextStart&&r.nextStart-h<s.maxBufferHole)&&i>s.highBufferWatchdogPeriod*1e3&&(P.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(r){const{hls:i,media:s,stallReported:o}=this;if(!o&&s){this.stallReported=!0;const u=new Error(`Playback stalling at @${s.currentTime} due to low buffer (${JSON.stringify(r)})`);P.warn(u.message),i.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.BUFFER_STALLED_ERROR,fatal:!1,error:u,buffer:r.len})}}_trySkipBufferHole(r){const{config:i,hls:s,media:o}=this;if(o===null)return 0;const u=o.currentTime,h=Jn.bufferInfo(o,u,0),m=u<h.start?h.start:h.nextStart;if(m){const _=h.len<=i.maxBufferHole,w=h.len>0&&h.len<1&&o.readyState<3,E=m-u;if(E>0&&(_||w)){if(E>i.maxBufferHole){const{fragmentTracker:N}=this;let J=!1;if(u===0){const j=N.getAppendedFrag(0,Ie.MAIN);j&&m<j.end&&(J=!0)}if(!J){const j=r||N.getAppendedFrag(u,Ie.MAIN);if(j){let ne=!1,de=j.end;for(;de<m;){const $e=N.getPartialFragment(de);if($e)de+=$e.duration;else{ne=!0;break}}if(ne)return 0}}}const L=Math.max(m+Sh,u+wh);if(P.warn(`skipping hole, adjusting currentTime from ${u} to ${L}`),this.moved=!0,this.stalled=null,o.currentTime=L,r&&!r.gap){const N=new Error(`fragment loaded with buffer holes, seeking from ${u} to ${L}`);s.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:N,reason:N.message,frag:r})}return L}}return 0}_tryNudgeBuffer(){const{config:r,hls:i,media:s,nudgeRetry:o}=this;if(s===null)return;const u=s.currentTime;if(this.nudgeRetry++,o<r.nudgeMaxRetry){const h=u+(o+1)*r.nudgeOffset,m=new Error(`Nudging 'currentTime' from ${u} to ${h}`);P.warn(m.message),s.currentTime=h,i.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.BUFFER_NUDGE_ON_STALL,error:m,fatal:!1})}else{const h=new Error(`Playhead still not moving while enough data buffered @${u} after ${r.nudgeMaxRetry} nudges`);P.error(h.message),i.trigger(b.ERROR,{type:M.MEDIA_ERROR,details:I.BUFFER_STALLED_ERROR,error:h,fatal:!0})}}}const kh=100;class Ah extends Wa{constructor(r,i,s){super(r,i,s,"[stream-controller]",Ie.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:r}=this;r.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(b.MANIFEST_LOADING,this.onManifestLoading,this),r.on(b.MANIFEST_PARSED,this.onManifestParsed,this),r.on(b.LEVEL_LOADING,this.onLevelLoading,this),r.on(b.LEVEL_LOADED,this.onLevelLoaded,this),r.on(b.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),r.on(b.ERROR,this.onError,this),r.on(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.on(b.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),r.on(b.BUFFER_CREATED,this.onBufferCreated,this),r.on(b.BUFFER_FLUSHED,this.onBufferFlushed,this),r.on(b.LEVELS_UPDATED,this.onLevelsUpdated,this),r.on(b.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:r}=this;r.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(b.MANIFEST_LOADING,this.onManifestLoading,this),r.off(b.MANIFEST_PARSED,this.onManifestParsed,this),r.off(b.LEVEL_LOADED,this.onLevelLoaded,this),r.off(b.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),r.off(b.ERROR,this.onError,this),r.off(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.off(b.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),r.off(b.BUFFER_CREATED,this.onBufferCreated,this),r.off(b.BUFFER_FLUSHED,this.onBufferFlushed,this),r.off(b.LEVELS_UPDATED,this.onLevelsUpdated,this),r.off(b.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(r){if(this.levels){const{lastCurrentTime:i,hls:s}=this;if(this.stopLoad(),this.setInterval(kh),this.level=-1,!this.startFragRequested){let o=s.startLevel;o===-1&&(s.config.testBandwidth&&this.levels.length>1?(o=0,this.bitrateTest=!0):o=s.firstAutoLevel),s.nextLoadLevel=o,this.level=s.loadLevel,this.loadedmetadata=!1}i>0&&r===-1&&(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),r=i),this.state=Wt.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=r,this.tick()}else this._forceStartLoad=!0,this.state=Wt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Wt.WAITING_LEVEL:{const{levels:i,level:s}=this,o=i==null?void 0:i[s],u=o==null?void 0:o.details;if(u&&(!u.live||this.levelLastLoaded===o)){if(this.waitForCdnTuneIn(u))break;this.state=Wt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Wt.IDLE;break}break}case Wt.FRAG_LOADING_WAITING_RETRY:{var r;const i=self.performance.now(),s=this.retryDate;if(!s||i>=s||(r=this.media)!=null&&r.seeking){const{levels:o,level:u}=this,h=o==null?void 0:o[u];this.resetStartWhenNotLoaded(h||null),this.state=Wt.IDLE}}break}this.state===Wt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:r,levelLastLoaded:i,levels:s,media:o}=this;if(i===null||!o&&(this.startFragRequested||!r.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const u=this.buffering?r.nextLoadLevel:r.loadLevel;if(!(s!=null&&s[u]))return;const h=s[u],m=this.getMainFwdBufferInfo();if(m===null)return;const _=this.getLevelDetails();if(_&&this._streamEnded(m,_)){const ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(b.BUFFER_EOS,ne),this.state=Wt.ENDED;return}if(!this.buffering)return;r.loadLevel!==u&&r.manualLevel===-1&&this.log(`Adapting to level ${u} from level ${this.level}`),this.level=r.nextLoadLevel=u;const w=h.details;if(!w||this.state===Wt.WAITING_LEVEL||w.live&&this.levelLastLoaded!==h){this.level=u,this.state=Wt.WAITING_LEVEL;return}const E=m.len,L=this.getMaxBufferLength(h.maxBitrate);if(E>=L)return;this.backtrackFragment&&this.backtrackFragment.start>m.end&&(this.backtrackFragment=null);const N=this.backtrackFragment?this.backtrackFragment.start:m.end;let J=this.getNextFragment(N,w);if(this.couldBacktrack&&!this.fragPrevious&&J&&J.sn!=="initSegment"&&this.fragmentTracker.getState(J)!==Yi.OK){var j;const de=((j=this.backtrackFragment)!=null?j:J).sn-w.startSN,$e=w.fragments[de-1];$e&&J.cc===$e.cc&&(J=$e,this.fragmentTracker.removeFragment($e))}else this.backtrackFragment&&m.len&&(this.backtrackFragment=null);if(J&&this.isLoopLoading(J,N)){if(!J.gap){const de=this.audioOnly&&!this.altAudio?ie.AUDIO:ie.VIDEO,$e=(de===ie.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;$e&&this.afterBufferFlushed($e,de,Ie.MAIN)}J=this.getNextFragmentLoopLoading(J,w,m,Ie.MAIN,L)}J&&(J.initSegment&&!J.initSegment.data&&!this.bitrateTest&&(J=J.initSegment),this.loadFragment(J,h,N))}loadFragment(r,i,s){const o=this.fragmentTracker.getState(r);this.fragCurrent=r,o===Yi.NOT_LOADED||o===Yi.PARTIAL?r.sn==="initSegment"?this._loadInitSegment(r,i):this.bitrateTest?(this.log(`Fragment ${r.sn} of level ${r.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(r,i)):(this.startFragRequested=!0,super.loadFragment(r,i,s)):this.clearTrackerIfNeeded(r)}getBufferedFrag(r){return this.fragmentTracker.getBufferedFrag(r,Ie.MAIN)}followingBufferedFrag(r){return r?this.getBufferedFrag(r.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:r,media:i}=this;if(i!=null&&i.readyState){let s;const o=this.getAppendedFrag(i.currentTime);o&&o.start>1&&this.flushMainBuffer(0,o.start-1);const u=this.getLevelDetails();if(u!=null&&u.live){const m=this.getMainFwdBufferInfo();if(!m||m.len<u.targetduration*2)return}if(!i.paused&&r){const m=this.hls.nextLoadLevel,_=r[m],w=this.fragLastKbps;w&&this.fragCurrent?s=this.fragCurrent.duration*_.maxBitrate/(1e3*w)+1:s=0}else s=0;const h=this.getBufferedFrag(i.currentTime+s);if(h){const m=this.followingBufferedFrag(h);if(m){this.abortCurrentFrag();const _=m.maxStartPTS?m.maxStartPTS:m.start,w=m.duration,E=Math.max(h.end,_+Math.min(Math.max(w-this.config.maxFragLookUpTolerance,w*(this.couldBacktrack?.5:.125)),w*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(E,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const r=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,r&&(r.abortRequests(),this.fragmentTracker.removeFragment(r)),this.state){case Wt.KEY_LOADING:case Wt.FRAG_LOADING:case Wt.FRAG_LOADING_WAITING_RETRY:case Wt.PARSING:case Wt.PARSED:this.state=Wt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(r,i){super.flushMainBuffer(r,i,this.altAudio?"video":null)}onMediaAttached(r,i){super.onMediaAttached(r,i);const s=i.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),s.addEventListener("playing",this.onvplaying),s.addEventListener("seeked",this.onvseeked),this.gapController=new Eh(this.config,s,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:r}=this;r&&this.onvplaying&&this.onvseeked&&(r.removeEventListener("playing",this.onvplaying),r.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const r=this.media,i=r?r.currentTime:null;te(i)&&this.log(`Media seeked to ${i.toFixed(3)}`);const s=this.getMainFwdBufferInfo();if(s===null||s.len===0){this.warn(`Main forward buffer length on "seeked" event ${s?s.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(b.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(r,i){let s=!1,o=!1;i.levels.forEach(u=>{const h=u.audioCodec;h&&(s=s||h.indexOf("mp4a.40.2")!==-1,o=o||h.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=s&&o&&!pc(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=i.levels,this.startFragRequested=!1}onLevelLoading(r,i){const{levels:s}=this;if(!s||this.state!==Wt.IDLE)return;const o=s[i.level];(!o.details||o.details.live&&this.levelLastLoaded!==o||this.waitForCdnTuneIn(o.details))&&(this.state=Wt.WAITING_LEVEL)}onLevelLoaded(r,i){var s;const{levels:o}=this,u=i.level,h=i.details,m=h.totalduration;if(!o){this.warn(`Levels were reset while loading level ${u}`);return}this.log(`Level ${u} loaded [${h.startSN},${h.endSN}]${h.lastPartSn?`[part-${h.lastPartSn}-${h.lastPartIndex}]`:""}, cc [${h.startCC}, ${h.endCC}] duration:${m}`);const _=o[u],w=this.fragCurrent;w&&(this.state===Wt.FRAG_LOADING||this.state===Wt.FRAG_LOADING_WAITING_RETRY)&&w.level!==i.level&&w.loader&&this.abortCurrentFrag();let E=0;if(h.live||(s=_.details)!=null&&s.live){var L;if(this.checkLiveUpdate(h),h.deltaUpdateFailed)return;E=this.alignPlaylists(h,_.details,(L=this.levelLastLoaded)==null?void 0:L.details)}if(_.details=h,this.levelLastLoaded=_,this.hls.trigger(b.LEVEL_UPDATED,{details:h,level:u}),this.state===Wt.WAITING_LEVEL){if(this.waitForCdnTuneIn(h))return;this.state=Wt.IDLE}this.startFragRequested?h.live&&this.synchronizeToLiveEdge(h):this.setStartPosition(h,E),this.tick()}_handleFragmentLoadProgress(r){var i;const{frag:s,part:o,payload:u}=r,{levels:h}=this;if(!h){this.warn(`Levels were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const m=h[s.level],_=m.details;if(!_){this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`),this.fragmentTracker.removeFragment(s);return}const w=m.videoCodec,E=_.PTSKnown||!_.live,L=(i=s.initSegment)==null?void 0:i.data,N=this._getAudioCodec(m),J=this.transmuxer=this.transmuxer||new Sr(this.hls,Ie.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),j=o?o.index:-1,ne=j!==-1,de=new Ua(s.level,s.sn,s.stats.chunkCount,u.byteLength,j,ne),$e=this.initPTS[s.cc];J.push(u,L,N,w,s,o,_.totalduration,E,de,$e)}onAudioTrackSwitching(r,i){const s=this.altAudio;if(!!!i.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const h=this.fragCurrent;h&&(this.log("Switching to main audio track, cancel main fragment load"),h.abortRequests(),this.fragmentTracker.removeFragment(h)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const u=this.hls;s&&(u.trigger(b.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),u.trigger(b.AUDIO_TRACK_SWITCHED,i)}}onAudioTrackSwitched(r,i){const s=i.id,o=!!this.hls.audioTracks[s].url;if(o){const u=this.videoBuffer;u&&this.mediaBuffer!==u&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=u)}this.altAudio=o,this.tick()}onBufferCreated(r,i){const s=i.tracks;let o,u,h=!1;for(const m in s){const _=s[m];if(_.id==="main"){if(u=m,o=_,m==="video"){const w=s[m];w&&(this.videoBuffer=w.buffer)}}else h=!0}h&&o?(this.log(`Alternate track found, use ${u}.buffered to schedule main fragment loading`),this.mediaBuffer=o.buffer):this.mediaBuffer=this.media}onFragBuffered(r,i){const{frag:s,part:o}=i;if(s&&s.type!==Ie.MAIN)return;if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${o?" p: "+o.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}`),this.state===Wt.PARSED&&(this.state=Wt.IDLE);return}const u=o?o.stats:s.stats;this.fragLastKbps=Math.round(8*u.total/(u.buffering.end-u.loading.first)),s.sn!=="initSegment"&&(this.fragPrevious=s),this.fragBufferedComplete(s,o)}onError(r,i){var s;if(i.fatal){this.state=Wt.ERROR;return}switch(i.details){case I.FRAG_GAP:case I.FRAG_PARSING_ERROR:case I.FRAG_DECRYPT_ERROR:case I.FRAG_LOAD_ERROR:case I.FRAG_LOAD_TIMEOUT:case I.KEY_LOAD_ERROR:case I.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Ie.MAIN,i);break;case I.LEVEL_LOAD_ERROR:case I.LEVEL_LOAD_TIMEOUT:case I.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===Wt.WAITING_LEVEL&&((s=i.context)==null?void 0:s.type)===sr.LEVEL&&(this.state=Wt.IDLE);break;case I.BUFFER_APPEND_ERROR:case I.BUFFER_FULL_ERROR:if(!i.parent||i.parent!=="main")return;if(i.details===I.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(i)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case I.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}checkBuffer(){const{media:r,gapController:i}=this;if(!(!r||!i||!r.readyState)){if(this.loadedmetadata||!Jn.getBuffered(r).length){const s=this.state!==Wt.IDLE?this.fragCurrent:null;i.poll(this.lastCurrentTime,s)}this.lastCurrentTime=r.currentTime}}onFragLoadEmergencyAborted(){this.state=Wt.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(r,{type:i}){if(i!==ie.AUDIO||this.audioOnly&&!this.altAudio){const s=(i===ie.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(s,i,Ie.MAIN),this.tick()}}onLevelsUpdated(r,i){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=i.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:r}=this;if(!r)return;const i=r.currentTime;let s=this.startPosition;if(s>=0&&i<s){if(r.seeking){this.log(`could not seek to ${s}, already seeking at ${i}`);return}const o=Jn.getBuffered(r),h=(o.length?o.start(0):0)-s;h>0&&(h<this.config.maxBufferHole||h<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${h} to match buffer start`),s+=h,this.startPosition=s),this.log(`seek to target start position ${s} from current time ${i}`),r.currentTime=s}}_getAudioCodec(r){let i=this.config.defaultAudioCodec||r.audioCodec;return this.audioCodecSwap&&i&&(this.log("Swapping audio codec"),i.indexOf("mp4a.40.5")!==-1?i="mp4a.40.2":i="mp4a.40.5"),i}_loadBitrateTestFrag(r,i){r.bitrateTest=!0,this._doFragLoad(r,i).then(s=>{const{hls:o}=this;if(!s||this.fragContextChanged(r))return;i.fragmentError=0,this.state=Wt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const u=r.stats;u.parsing.start=u.parsing.end=u.buffering.start=u.buffering.end=self.performance.now(),o.trigger(b.FRAG_LOADED,s),r.bitrateTest=!1})}_handleTransmuxComplete(r){var i;const s="main",{hls:o}=this,{remuxResult:u,chunkMeta:h}=r,m=this.getCurrentContext(h);if(!m){this.resetWhenMissingContext(h);return}const{frag:_,part:w,level:E}=m,{video:L,text:N,id3:J,initSegment:j}=u,{details:ne}=E,de=this.altAudio?void 0:u.audio;if(this.fragContextChanged(_)){this.fragmentTracker.removeFragment(_);return}if(this.state=Wt.PARSING,j){if(j!=null&&j.tracks){const ht=_.initSegment||_;this._bufferInitSegment(E,j.tracks,ht,h),o.trigger(b.FRAG_PARSING_INIT_SEGMENT,{frag:ht,id:s,tracks:j.tracks})}const $e=j.initPTS,ct=j.timescale;te($e)&&(this.initPTS[_.cc]={baseTime:$e,timescale:ct},o.trigger(b.INIT_PTS_FOUND,{frag:_,id:s,initPTS:$e,timescale:ct}))}if(L&&ne&&_.sn!=="initSegment"){const $e=ne.fragments[_.sn-1-ne.startSN],ct=_.sn===ne.startSN,ht=!$e||_.cc>$e.cc;if(u.independent!==!1){const{startPTS:At,endPTS:yt,startDTS:Qt,endDTS:zt}=L;if(w)w.elementaryStreams[L.type]={startPTS:At,endPTS:yt,startDTS:Qt,endDTS:zt};else if(L.firstKeyFrame&&L.independent&&h.id===1&&!ht&&(this.couldBacktrack=!0),L.dropped&&L.independent){const pr=this.getMainFwdBufferInfo(),Or=(pr?pr.end:this.getLoadPosition())+this.config.maxBufferHole,Zt=L.firstKeyFramePTS?L.firstKeyFramePTS:At;if(!ct&&Or<Zt-this.config.maxBufferHole&&!ht){this.backtrack(_);return}else ht&&(_.gap=!0);_.setElementaryStreamInfo(L.type,_.start,yt,_.start,zt,!0)}else ct&&At>K0&&(_.gap=!0);_.setElementaryStreamInfo(L.type,At,yt,Qt,zt),this.backtrackFragment&&(this.backtrackFragment=_),this.bufferFragmentData(L,_,w,h,ct||ht)}else if(ct||ht)_.gap=!0;else{this.backtrack(_);return}}if(de){const{startPTS:$e,endPTS:ct,startDTS:ht,endDTS:At}=de;w&&(w.elementaryStreams[ie.AUDIO]={startPTS:$e,endPTS:ct,startDTS:ht,endDTS:At}),_.setElementaryStreamInfo(ie.AUDIO,$e,ct,ht,At),this.bufferFragmentData(de,_,w,h)}if(ne&&J!=null&&(i=J.samples)!=null&&i.length){const $e={id:s,frag:_,details:ne,samples:J.samples};o.trigger(b.FRAG_PARSING_METADATA,$e)}if(ne&&N){const $e={id:s,frag:_,details:ne,samples:N.samples};o.trigger(b.FRAG_PARSING_USERDATA,$e)}}_bufferInitSegment(r,i,s,o){if(this.state!==Wt.PARSING)return;this.audioOnly=!!i.audio&&!i.video,this.altAudio&&!this.audioOnly&&delete i.audio;const{audio:u,video:h,audiovideo:m}=i;if(u){let _=r.audioCodec;const w=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){_&&(_.indexOf("mp4a.40.5")!==-1?_="mp4a.40.2":_="mp4a.40.5");const E=u.metadata;E&&"channelCount"in E&&(E.channelCount||1)!==1&&w.indexOf("firefox")===-1&&(_="mp4a.40.5")}_&&_.indexOf("mp4a.40.5")!==-1&&w.indexOf("android")!==-1&&u.container!=="audio/mpeg"&&(_="mp4a.40.2",this.log(`Android: force audio codec to ${_}`)),r.audioCodec&&r.audioCodec!==_&&this.log(`Swapping manifest audio codec "${r.audioCodec}" for "${_}"`),u.levelCodec=_,u.id="main",this.log(`Init audio buffer, container:${u.container}, codecs[selected/level/parsed]=[${_||""}/${r.audioCodec||""}/${u.codec}]`)}h&&(h.levelCodec=r.videoCodec,h.id="main",this.log(`Init video buffer, container:${h.container}, codecs[level/parsed]=[${r.videoCodec||""}/${h.codec}]`)),m&&this.log(`Init audiovideo buffer, container:${m.container}, codecs[level/parsed]=[${r.codecs}/${m.codec}]`),this.hls.trigger(b.BUFFER_CODECS,i),Object.keys(i).forEach(_=>{const E=i[_].initSegment;E!=null&&E.byteLength&&this.hls.trigger(b.BUFFER_APPENDING,{type:_,data:E,frag:s,part:null,chunkMeta:o,parent:s.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,Ie.MAIN)}backtrack(r){this.couldBacktrack=!0,this.backtrackFragment=r,this.resetTransmuxer(),this.flushBufferGap(r),this.fragmentTracker.removeFragment(r),this.fragPrevious=null,this.nextLoadPosition=r.start,this.state=Wt.IDLE}checkFragmentChanged(){const r=this.media;let i=null;if(r&&r.readyState>1&&r.seeking===!1){const s=r.currentTime;if(Jn.isBuffered(r,s)?i=this.getAppendedFrag(s):Jn.isBuffered(r,s+.1)&&(i=this.getAppendedFrag(s+.1)),i){this.backtrackFragment=null;const o=this.fragPlaying,u=i.level;(!o||i.sn!==o.sn||o.level!==u)&&(this.fragPlaying=i,this.hls.trigger(b.FRAG_CHANGED,{frag:i}),(!o||o.level!==u)&&this.hls.trigger(b.LEVEL_SWITCHED,{level:u}))}}}get nextLevel(){const r=this.nextBufferedFrag;return r?r.level:-1}get currentFrag(){const r=this.media;return r?this.fragPlaying||this.getAppendedFrag(r.currentTime):null}get currentProgramDateTime(){const r=this.media;if(r){const i=r.currentTime,s=this.currentFrag;if(s&&te(i)&&te(s.programDateTime)){const o=s.programDateTime+(i-s.start)*1e3;return new Date(o)}}return null}get currentLevel(){const r=this.currentFrag;return r?r.level:-1}get nextBufferedFrag(){const r=this.currentFrag;return r?this.followingBufferedFrag(r):null}get forceStartLoad(){return this._forceStartLoad}}class Ba{static get version(){return"1.5.20"}static isMSESupported(){return Su()}static isSupported(){return _h()}static getMediaSource(){return dn()}static get Events(){return b}static get ErrorTypes(){return M}static get ErrorDetails(){return I}static get DefaultConfig(){return Ba.defaultConfig?Ba.defaultConfig:Oa}static set DefaultConfig(r){Ba.defaultConfig=r}constructor(r={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new ar,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,le(r.debug||!1,"Hls instance");const i=this.config=vo(Ba.DefaultConfig,r);this.userConfig=r,i.progressive&&$0(i);const{abrController:s,bufferController:o,capLevelController:u,errorController:h,fpsController:m}=i,_=new h(this),w=this.abrController=new s(this),E=this.bufferController=new o(this),L=this.capLevelController=new u(this),N=new m(this),J=new yn(this),j=new Vn(this),ne=i.contentSteeringController,de=ne?new ne(this):null,$e=this.levelController=new z0(this,de),ct=new Ea(this),ht=new fc(this.config),At=this.streamController=new Ah(this,ct,ht);L.setStreamController(At),N.setStreamController(At);const yt=[J,$e,At];de&&yt.splice(1,0,de),this.networkControllers=yt;const Qt=[w,E,L,N,j,ct];this.audioTrackController=this.createController(i.audioTrackController,yt);const zt=i.audioStreamController;zt&&yt.push(new zt(this,ct,ht)),this.subtitleTrackController=this.createController(i.subtitleTrackController,yt);const pr=i.subtitleStreamController;pr&&yt.push(new pr(this,ct,ht)),this.createController(i.timelineController,Qt),ht.emeController=this.emeController=this.createController(i.emeController,Qt),this.cmcdController=this.createController(i.cmcdController,Qt),this.latencyController=this.createController(Gi,Qt),this.coreComponents=Qt,yt.push(_);const Or=_.onErrorOut;typeof Or=="function"&&this.on(b.ERROR,Or,_)}createController(r,i){if(r){const s=new r(this);return i&&i.push(s),s}return null}on(r,i,s=this){this._emitter.on(r,i,s)}once(r,i,s=this){this._emitter.once(r,i,s)}removeAllListeners(r){this._emitter.removeAllListeners(r)}off(r,i,s=this,o){this._emitter.off(r,i,s,o)}listeners(r){return this._emitter.listeners(r)}emit(r,i,s){return this._emitter.emit(r,i,s)}trigger(r,i){if(this.config.debug)return this.emit(r,r,i);try{return this.emit(r,r,i)}catch(s){if(P.error("An internal error happened while handling event "+r+'. Error message: "'+s.message+'". Here is a stacktrace:',s),!this.triggeringException){this.triggeringException=!0;const o=r===b.ERROR;this.trigger(b.ERROR,{type:M.OTHER_ERROR,details:I.INTERNAL_EXCEPTION,fatal:o,event:r,error:s}),this.triggeringException=!1}}return!1}listenerCount(r){return this._emitter.listenerCount(r)}destroy(){P.log("destroy"),this.trigger(b.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(i=>i.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(i=>i.destroy()),this.coreComponents.length=0;const r=this.config;r.xhrSetup=r.fetchSetup=void 0,this.userConfig=null}attachMedia(r){P.log("attachMedia"),this._media=r,this.trigger(b.MEDIA_ATTACHING,{media:r})}detachMedia(){P.log("detachMedia"),this.trigger(b.MEDIA_DETACHING,void 0),this._media=null}loadSource(r){this.stopLoad();const i=this.media,s=this.url,o=this.url=Xe.buildAbsoluteURL(self.location.href,r,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,P.log(`loadSource:${o}`),i&&s&&(s!==o||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(i)),this.trigger(b.MANIFEST_LOADING,{url:r})}startLoad(r=-1){P.log(`startLoad(${r})`),this.started=!0,this.resumeBuffering();for(let i=0;i<this.networkControllers.length&&(this.networkControllers[i].startLoad(r),!(!this.started||!this.networkControllers));i++);}stopLoad(){P.log("stopLoad"),this.started=!1;for(let r=0;r<this.networkControllers.length&&(this.networkControllers[r].stopLoad(),!(this.started||!this.networkControllers));r++);}resumeBuffering(){P.log("resume buffering"),this.networkControllers.forEach(r=>{r.resumeBuffering&&r.resumeBuffering()})}pauseBuffering(){P.log("pause buffering"),this.networkControllers.forEach(r=>{r.pauseBuffering&&r.pauseBuffering()})}swapAudioCodec(){P.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){P.log("recoverMediaError");const r=this._media;this.detachMedia(),r&&this.attachMedia(r)}removeLevel(r){this.levelController.removeLevel(r)}get levels(){const r=this.levelController.levels;return r||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(r){P.log(`set currentLevel:${r}`),this.levelController.manualLevel=r,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(r){P.log(`set nextLevel:${r}`),this.levelController.manualLevel=r,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(r){P.log(`set loadLevel:${r}`),this.levelController.manualLevel=r}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(r){this.levelController.nextLoadLevel=r}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(r){P.log(`set firstLevel:${r}`),this.levelController.firstLevel=r}get startLevel(){const r=this.levelController.startLevel;return r===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:r}set startLevel(r){P.log(`set startLevel:${r}`),r!==-1&&(r=Math.max(r,this.minAutoLevel)),this.levelController.startLevel=r}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(r){const i=!!r;i!==this.config.capLevelToPlayerSize&&(i?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=i)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:r}=this.abrController;return r?r.getEstimate():NaN}set bandwidthEstimate(r){this.abrController.resetEstimator(r)}get ttfbEstimate(){const{bwEstimator:r}=this.abrController;return r?r.getEstimateTTFB():NaN}set autoLevelCapping(r){this._autoLevelCapping!==r&&(P.log(`set autoLevelCapping:${r}`),this._autoLevelCapping=r,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(r){ei(r)&&this._maxHdcpLevel!==r&&(this._maxHdcpLevel=r,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:r,config:{minAutoBitrate:i}}=this;if(!r)return 0;const s=r.length;for(let o=0;o<s;o++)if(r[o].maxBitrate>=i)return o;return 0}get maxAutoLevel(){const{levels:r,autoLevelCapping:i,maxHdcpLevel:s}=this;let o;if(i===-1&&r!=null&&r.length?o=r.length-1:o=i,s)for(let u=o;u--;){const h=r[u].attrs["HDCP-LEVEL"];if(h&&h<=s)return u}return o}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(r){this.abrController.nextAutoLevel=r}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(r){var i;return(i=this.audioTrackController)==null?void 0:i.setAudioOption(r)}setSubtitleOption(r){var i;return(i=this.subtitleTrackController)==null||i.setSubtitleOption(r),null}get allAudioTracks(){const r=this.audioTrackController;return r?r.allAudioTracks:[]}get audioTracks(){const r=this.audioTrackController;return r?r.audioTracks:[]}get audioTrack(){const r=this.audioTrackController;return r?r.audioTrack:-1}set audioTrack(r){const i=this.audioTrackController;i&&(i.audioTrack=r)}get allSubtitleTracks(){const r=this.subtitleTrackController;return r?r.allSubtitleTracks:[]}get subtitleTracks(){const r=this.subtitleTrackController;return r?r.subtitleTracks:[]}get subtitleTrack(){const r=this.subtitleTrackController;return r?r.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(r){const i=this.subtitleTrackController;i&&(i.subtitleTrack=r)}get subtitleDisplay(){const r=this.subtitleTrackController;return r?r.subtitleDisplay:!1}set subtitleDisplay(r){const i=this.subtitleTrackController;i&&(i.subtitleDisplay=r)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(r){this.config.lowLatencyMode=r}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Ba.defaultConfig=void 0},48136:function(Ir,Mt,Y){"use strict";var Ce=Object.defineProperty,Le=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,Pe=(e,t,n)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))Oe.call(t,n)&&Pe(e,n,t[n]);if(Ge)for(var n of Ge(t))me.call(t,n)&&Pe(e,n,t[n]);return e},c=(e,t)=>Le(e,Xe(t)),te=e=>typeof e=="symbol"?e:e+"",V=(e,t)=>{var n={};for(var a in e)Oe.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&Ge)for(var a of Ge(e))t.indexOf(a)<0&&me.call(e,a)&&(n[a]=e[a]);return n};function A(e){return Array.isArray(e)}var b={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function M(){return"window"in globalThis&&"document"in globalThis}function I(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function re(){return typeof navigator.vibrate=="function"}function se(){var e,t;if(!M())return"other";const n=(t=(e=navigator.userAgentData)==null?void 0:e.platform)!=null?t:navigator.platform;return/^mac/i.test(n)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(n)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function q(){if(!M())return!0;if(/firefox/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/firefox\/(\d+)/i);return e?parseInt(e[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/edg\/(\d+)/i);return e?parseInt(e[1])>=79:!1}return!0}function W(){return HTMLElement.prototype.hasOwnProperty("popover")}var Z={strings:b,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return Z._locale||(Z._locale=M()?navigator.language.slice(0,5):"en-US"),Z._locale},set locale(e){Z._locale=e,Z._numberFormatter=void 0,Z.dirty=!0},get numberFormatter(){return Z._numberFormatter||(Z._numberFormatter=new Intl.NumberFormat(Z.locale)),Z._numberFormatter},merge(e,t){if(typeof e=="string"&&t)Z.strings[e]=$($({},Z.strings[e]),t),Z.dirty=!0;else for(const n of Object.keys(e))Z.merge(n,e[n])},get dirty(){return Z._dirty},set dirty(e){Z._dirty||Z._dirty===e||(Z._dirty=!0,setTimeout(()=>{Z._dirty=!1,this._subscribers.forEach(t=>t==null?void 0:t())},0))},subscribe(e){return Z._subscribers.push(e),Z._subscribers.length-1},unsubscribe(e){e<0||e>=Z._subscribers.length||(Z._subscribers[e]=void 0)},update(e){let t=e.querySelectorAll("[data-l10n-tooltip]");for(const n of t){const a=n.getAttribute("data-l10n-tooltip");if(a){const l=le(a);l&&n.setAttribute("data-tooltip",l)}}t=e.querySelectorAll("[data-l10n-arial-label]");for(const n of t){const a=n.getAttribute("data-l10n-arial-label");if(a){const l=le(a);l&&n.setAttribute("aria-label",l)}}}};function le(e,...t){if(e===void 0)return;let n="";const a=Z.locale;Z.strings[a]&&(n=Z.strings[a][e]);const l=a.slice(0,2);if(!n&&Z.strings[l]&&(n=Z.strings[l][e]),n||(n=Z.strings.en[e]),!n)return;const f=/(%@|%([0-9]+)\$@)/g;let g=f.exec(n),S=0;for(;g;){if(t[S++]){const R=g[2]?parseInt(g[2],10)-1:S-1;let F=t[R];typeof F=="number"&&(F=Z.numberFormatter.format(F)),n=n.replace(g[1],F)}g=f.exec(n)}return n=n.replace(/%%/g,"%"),n}var P={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},ae={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Te={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},ye={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},Je={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},Ve={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function st(e){var t,n,a,l,f,g;const S=e.split("!");let T,R,F,X=255,ve=255,Me=255,ze=-1;const _t=S.length>0&&S[0].startsWith("-");_t&&(S[0]=S[0].slice(1));for(let tr=0;tr<S.length;tr++){T=X,R=ve,F=Me;const pt=(t=S[tr].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:t[1],Ht=pt==null?void 0:pt.toLowerCase(),ur=pt&&(g=(f=(l=(a=(n=ye[Ht])!=null?n:ye[Je[pt]])!=null?a:ae[pt])!=null?l:Ve[pt])!=null?f:P[pt])!=null?g:S[tr].trim();let jt=ur.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(jt!=null&&jt[1]&&jt[2]&&jt[3])X=Math.max(0,Math.min(255,Number.parseInt(jt[1],16))),ve=Math.max(0,Math.min(255,Number.parseInt(jt[2],16))),Me=Math.max(0,Math.min(255,Number.parseInt(jt[3],16)));else if(jt=ur.match(/^#([\da-f]{3})$/i),jt!=null&&jt[1]){const Pr=Number.parseInt(jt[1][0],16),Yr=Number.parseInt(jt[1][1],16),Hr=Number.parseInt(jt[1][2],16);X=Math.max(0,Math.min(255,Pr*16+Pr)),ve=Math.max(0,Math.min(255,Yr*16+Yr)),Me=Math.max(0,Math.min(255,Hr*16+Hr))}else if(jt=ur.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),jt!=null&&jt[1]&&jt[2]&&jt[3])X=Math.max(0,Math.min(255,Number.parseInt(jt[1]))),ve=Math.max(0,Math.min(255,Number.parseInt(jt[2]))),Me=Math.max(0,Math.min(255,Number.parseInt(jt[3])));else return;ze>=0&&(X=(1-ze)*X+ze*T,ve=(1-ze)*ve+ze*R,Me=(1-ze)*Me+ze*F,ze=-1),tr+1<S.length&&(ze=Math.max(0,Math.min(100,Number.parseInt(S[++tr])))/100)}return ze>=0&&(X=ze*X+(1-ze)*T,ve=ze*ve+(1-ze)*R,Me=ze*Me+(1-ze)*F),_t&&(X=255-X,ve=255-ve,Me=255-Me),"#"+("00"+Math.round(X).toString(16)).slice(-2)+("00"+Math.round(ve).toString(16)).slice(-2)+("00"+Math.round(Me).toString(16)).slice(-2)}function ft(e){var t,n;return e=e.trim(),(n=(t=Te[e.toLowerCase()])!=null?t:Te[Je[e]])!=null?n:st(e)}function ie(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&t.a===void 0&&(t.a=1),t}function Q(e,t,n){return n<0&&(n+=6),n>=6&&(n-=6),n<1?(t-e)*n+e:n<3?t:n<4?(t-e)*(4-n)+e:e}function ue(e){let[t,n,a]=[e.h,e.s,e.l];t=(t+360)%360/60,a=Math.max(0,Math.min(a,1)),n=Math.max(0,Math.min(n,1));const l=a<=.5?a*(n+1):a+n-a*n,f=a*2-l;return{r:Math.round(255*Q(f,l,t+2)),g:Math.round(255*Q(f,l,t)),b:Math.round(255*Q(f,l,t-2))}}function ce(e){return e<0?0:e>255?255:Math.round(e)}function De(e){const{r:t,g:n,b:a}=e;let l=((1<<24)+(ce(t)<<16)+(ce(n)<<8)+ce(a)).toString(16).slice(1);return l[0]===l[1]&&l[2]===l[3]&&l[4]===l[5]&&l[6]===l[7]&&(l=l[0]+l[2]+l[4]),"#"+l}function xe(e){let{r:t,g:n,b:a}=e;t=t/255,n=n/255,a=a/255;const l=Math.min(t,n,a),f=Math.max(t,n,a),g=f-l;let S,T;f===l?S=0:t===f?S=(n-a)/g:n===f?S=2+(a-t)/g:a===f&&(S=4+(t-n)/g),S=Math.min(S*60,360),S<0&&(S+=360);const R=(l+f)/2;return f===l?T=0:R<=.5?T=g/(f+l):T=g/(2-f-l),{h:S,s:T,l:R}}function C(e){let t=ie(e);if(!t)return e;let{h:n,s:a,l}=xe(t);return a+=.1,l-=.1,De(ue({h:n,s:a,l}))}var B={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},ee={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},we=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function rt(e,t,n){if(!/[A-Za-z\d]/.test(e)||(n==="up"&&(n=void 0),!t&&!n))return e;const a=e.codePointAt(0);if(a===void 0)return e;for(const l of we)if((!t||l.variant===t)&&(!n||l.style===n)&&a>=l.offset&&a<l.offset+l.len){const f=l.start+a-l.offset;return String.fromCodePoint(ee[f]||f)}return e}function tt(e){var t;if((e<119808||e>120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const n in ee)if(ee[n]===e){e=(t=n.codePointAt(0))!=null?t:0;break}for(const n of we)if(e>=n.start&&e<n.start+n.len)return{char:String.fromCodePoint(e-n.start+n.offset),variant:n.variant,style:n.style};return{char:String.fromCodePoint(e)}}function ot(e){var t;let n="";for(const a of e){if("{}<>[]$&#^_%:'\u02DC".includes(a)){n+=a;continue}const l=(t=a.codePointAt(0))!=null?t:0;let f=B[l];if(f)f.startsWith("\\")?n+=f+" ":n+=f;else{const{char:g,variant:S,style:T}=tt(l);switch(f=g,S){case"double-struck":f=`\\mathbb{${f}}`;break;case"fraktur":f=`\\mathfrak{${f}}`;break;case"script":f=`\\mathscr{${f}}`;break;case"sans-serif":f=`\\mathsf{${f}}`;break;case"monospace":f=`\\mathtt{${f}}`;break;case"calligraphic":f=`\\mathcal{${f}}`;break}switch(T){case"bold":f=`\\mathbf{${f}}`;break;case"italic":f=`\\mathit{${f}}`;break;case"bolditalic":f=`\\mathbfit{${f}}`;break}n+=f}}return n}function je(e){return e?Array.isArray(e)?e:typeof e=="object"&&"group"in e?e.group:[]:[]}var nr={},Kt=$({},B),Lt={},Gr={},Rr={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},hn={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},Nr={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},an={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:Nr},"amsmath.sty":{package:hn,primitive:!0},"texvc.sty":{package:Rr,primitive:!1}},zr={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},We=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,mt,Ye;q()?(mt=new RegExp("\\p{Letter}","u"),Ye=new RegExp("[0-9\\p{Letter}]","u")):(mt=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,Ye=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function Et(e,t,n="mord",a){t!==void 0&&(nr[e]={definitionType:"symbol",type:n,variant:a,codepoint:t},Kt[t]||(Kt[t]=e))}function Tt(e,t,n){if(typeof e=="string"){for(let a=0;a<e.length;a++){const l=e.charAt(a);Et(l,l.codePointAt(0))}return}for(const[a,l,f,g]of e)Et(a,l,f!=null?f:t,g!=null?g:n)}function ge(e,t){for(let n=e;n<=t;n++)Et(String.fromCodePoint(n),n)}function Be(e){var t;return(t=Gr[e])!=null?t:null}function et(e,t){var n,a;if(t.length===0||t==="\\"||!t.startsWith("\\"))return[];const l=[];for(const g in Lt)g.startsWith(t)&&!Lt[g].infix&&l.push({match:g,frequency:(n=Lt[g].frequency)!=null?n:0});for(const g in nr)g.startsWith(t)&&l.push({match:g,frequency:(a=nr[g].frequency)!=null?a:0});const f=t.substring(1);for(const g of Object.keys(e.options.macros))g.startsWith(f)&&l.push({match:"\\"+g,frequency:0});return l.sort((g,S)=>{var T,R;return g.frequency===S.frequency?g.match.length===S.match.length?g.match<S.match?-1:1:g.match.length-S.match.length:((T=S.frequency)!=null?T:0)-((R=g.frequency)!=null?R:0)}),l.map(g=>g.match)}function gt(e){let t="auto";const n=e.match(/:([^=]+)/);return n&&(t=n[1].trim()),t}function vt(e){if(!e)return[];const t=[];let n=e.split("]");if(n[0].startsWith("[")){t.push({isOptional:!0,type:gt(n[0].slice(1))});for(let a=1;a<=n.length;a++)t.push(...vt(n[a]))}else if(n=e.split("}"),n[0].startsWith("{")){t.push({isOptional:!1,type:gt(n[0].slice(1))});for(let a=1;a<=n.length;a++)t.push(...vt(n[a]))}return t}function Ut(e){if(!e)return"";let t="",n=!0;for(const a of e)typeof a.value=="string"?t+=a.value:n=!1;return n?t:""}function hr(e,t){typeof e=="string"&&(e=[e]);const n={tabular:!1,params:[],createAtom:t};for(const a of e)Gr[a]=n}function Yt(e,t,n){typeof e=="string"&&(e=[e]);const l={tabular:!0,params:vt(t),createAtom:n};for(const f of e)Gr[f]=l}function Ke(e,t,n){var a,l;n||(n={});const f={definitionType:"function",params:vt(t),ifMode:n.ifMode,isFunction:(a=n.isFunction)!=null?a:!1,applyMode:n.applyMode,infix:(l=n.infix)!=null?l:!1,parse:n.parse,createAtom:n.createAtom,applyStyle:n.applyStyle,serialize:n.serialize,render:n.render};if(typeof e=="string")Lt["\\"+e]=f;else for(const g of e)Lt["\\"+g]=f}var $t;function cr(e){return $t||($t=He(an)),e?He($($({},$t),e)):$t}function Fe(e,t){var n,a,l,f;if(typeof e=="string"){let g=0;const S=e;return/(^|[^\\])#1/.test(S)&&(g=1),/(^|[^\\])#2/.test(S)&&(g=2),/(^|[^\\])#3/.test(S)&&(g=3),/(^|[^\\])#4/.test(S)&&(g=4),/(^|[^\\])#5/.test(S)&&(g=5),/(^|[^\\])#6/.test(S)&&(g=6),/(^|[^\\])#7/.test(S)&&(g=7),/(^|[^\\])#8/.test(S)&&(g=8),/(^|[^\\])#9/.test(S)&&(g=9),{expand:(n=t==null?void 0:t.expand)!=null?n:!0,captureSelection:(a=t==null?void 0:t.captureSelection)!=null?a:!0,args:g,def:S}}return $({expand:(l=t==null?void 0:t.expand)!=null?l:!0,captureSelection:(f=t==null?void 0:t.captureSelection)!=null?f:!0,args:0},e)}function He(e){if(!e)return{};const t={};for(const n of Object.keys(e)){const a=e[n];if(a==null)delete t[n];else if(typeof a=="object"&&"package"in a)for(const l of Object.keys(a.package))t[l]=Fe(a.package[l],{expand:!a.primitive,captureSelection:a.captureSelection});else t[n]=Fe(a)}return t}function qe(e,t="math"){if(!e||e.length===0)return null;let n=null;if(e.startsWith("\\")){if(n=Lt[e],n)return!n.ifMode||n.ifMode===t?n:null;t==="math"?n=nr[e]:zr[e]&&(n={definitionType:"symbol",type:"mord",codepoint:zr[e]})}else if(t==="math"){if(n=nr[e],!n&&e.length===1){const a=St("math",e.codePointAt(0));return a.startsWith("\\")?c($({},qe(a,"math")),{command:a}):null}}else zr[e]?n={definitionType:"symbol",type:"mord",codepoint:zr[e]}:t==="text"&&(n={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return n!=null?n:null}function Dt(e,t){if(!e.startsWith("\\"))return null;const n=e.slice(1);return t[n]}function St(e,t){if(t===void 0)return"";if(e==="math"&&Kt[t])return Kt[t];if(e==="text"){const n=Object.keys(zr).find(a=>zr[a]===t);return n||String.fromCodePoint(t)}return String.fromCodePoint(t)}var Pt=[0,.68889,0,0,.72222],Gt=[0,.68889,0,0,.66667],k=[0,.68889,0,0,.77778],D=[0,.68889,0,0,.61111],ut=[.16667,.68889,0,0,.77778],U=[0,.68889,0,0,.55556],he=[0,0,0,0,.25],Tr=[0,.825,0,0,2.33334],Ee=[0,.9,0,0,2.33334],Ue=[0,.68889,0,0,.54028],Ze=[-.03598,.46402,0,0,.5],G=[-.13313,.36687,0,0,1],pe=[.01354,.52239,0,0,1],_e=[.01354,.52239,0,0,1.11111],Ne=[0,.54986,0,0,1],H=[0,.69224,0,0,.5],Vt=[0,.43056,0,0,1],Se=[.08198,.58198,0,0,.77778],qt=[.19444,.69224,0,0,.41667],vr=[.1808,.675,0,0,1],Xr=[.19444,.69224,0,0,.83334],An=[.13667,.63667,0,0,1],Kr=[-.064,.437,0,0,1.334],yr=[.08167,.58167,0,0,.77778],gn=[0,.69224,0,0,.72222],fe=[0,.69224,0,0,.66667],Ae=[-.13313,.36687,0,0,.77778],Ct=[.06062,.54986,0,0,.77778],at=[0,.69224,0,0,.77778],xt=[.25583,.75583,0,0,.77778],Ot=[.25142,.75726,0,0,.77778],ir=[.20576,.70576,0,0,.77778],Jt=[.30274,.79383,0,0,.77778],xr=[.22958,.72958,0,0,.77778],br=[.1808,.675,0,0,.77778],nn=[.13667,.63667,0,0,.77778],kr=[.13597,.63597,0,0,.77778],Fr=[.03517,.54986,0,0,.77778],$r=[0,.675,0,0,.77778],pn=[.19444,.69224,0,0,.61111],Mn=[0,.54986,0,0,.76042],mn=[0,.54986,0,0,.66667],dn=[.0391,.5391,0,0,.77778],$n=[.03517,.54986,0,0,1.33334],rn=[.38569,.88569,0,0,.77778],Lr=[.23222,.74111,0,0,.77778],nt=[.19444,.69224,0,0,.77778],Qe=[0,.37788,0,0,.5],bt=[0,.54986,0,0,.72222],Rt=[0,.69224,0,0,.83334],lt=[.11111,.69224,0,0,.66667],Nt=[.26167,.75726,0,0,.77778],Ft=[.48256,.98256,0,0,.77778],or=[.28481,.79383,0,0,.77778],_r=[.08167,.58167,0,0,.22222],fr=[.08167,.58167,0,0,.38889],Qr=[0,.43056,.04028,0,.66667],on=[.41951,.91951,0,0,.77778],fn=[.24982,.74947,0,0,.38865],Mr=[.08319,.58283,0,0,.75623],wr=[0,.10803,0,0,.27764],_n=[0,.47534,0,0,.50181],ln=[.18906,.47534,0,0,.50181],qr=[0,.69141,0,0,.50181],Jr=[.24982,.74947,0,0,.27764],sn=[0,.69141,0,0,.21471],en=[.25,.75,0,0,.44722],Ur=[0,.64444,0,0,.575],cn=[.08556,.58556,0,0,.89444],Ln=[0,.69444,0,0,.89444],xn=[0,.68611,0,0,.9],sr=[0,.68611,0,0,.86944],Ie=[.25,.75,0,0,.575],lr=[.25,.75,0,0,.31944],gr=[0,.69444,0,0,.63889],yn=[0,.69444,0,0,.31944],Yn=[0,.44444,0,0,.63889],vn=[0,.44444,0,0,.51111],Rn=[0,.69444,0,0,.575],Zr=[.13333,.63333,0,0,.89444],ai=[0,.44444,0,0,.31944],pi=[0,.69444,0,0,.86944],In=[0,.68611,0,0,.69166],ni=[0,.68611,0,0,.83055],qi=[0,.68611,0,0,.89444],Ti=[0,.69444,0,0,.60278],Zi=[.19444,.69444,0,0,.51111],Ar=[0,.69444,0,0,.83055],bn=[-.10889,.39111,0,0,1.14999],zn=[.19444,.69444,0,0,.575],Vn=[.19444,.69444,0,0,1.14999],Gi=[.19444,.69444,0,0,.70277],Vi=[.05556,.75,0,0,.575],ei=[0,.68611,0,0,.95833],Ci=[.08556,.58556,0,0,.76666],Wn=[-.02639,.47361,0,0,.575],Wi=[0,.44444,0,0,.89444],ui=[0,.55556,0,0,.76666],Ji=[-.10889,.39111,0,0,.89444],Di=[.00222,.50222,0,0,.89444],bi=[.19667,.69667,0,0,.89444],Sn=[.08556,.58556,0,0,1.14999],ls=[0,.69444,0,0,.70277],_s=[-.02778,.47222,0,0,.575],fs=[.25,.75,0,0,.51111],Xn=[-.13889,.36111,0,0,1.14999],xs=[.19444,.69444,0,0,1.02222],ps=[.12963,.69444,0,0,.89444],er=[.19444,.69444,0,0,.44722],ci=[0,.64444,.13167,0,.59111],ws=[.19444,.64444,.13167,0,.59111],Qi=[0,.68611,.17208,0,.8961],_i=[.19444,.44444,.105,0,.53222],oi=[0,.44444,.085,0,.82666],Dn=[0,.69444,.06709,0,.59111],ti=[0,.69444,.12945,0,.35555],Mi=[0,.69444,0,0,.94888],Fi=[0,.69444,.11472,0,.59111],mi=[0,.68611,.10778,0,.88555],Ni=[0,.69444,.07939,0,.62055],Os=[0,.69444,.12417,0,.30667],Nn=[0,.64444,.13556,0,.51111],wn=[.19444,.64444,.13556,0,.51111],hi=[0,.68333,.16389,0,.74333],xi=[.19444,.43056,.08847,0,.46],es=[0,.43056,.07514,0,.71555],Cr=[0,.69444,.06646,0,.51111],Dr=[0,.69444,0,0,.83129],On=[0,.69444,.1225,0,.51111],Li=[0,.68333,.09403,0,.76666],jn=[0,.68333,.11111,0,.76666],Ss=[0,.69444,.06961,0,.51444],Ts=[0,.69444,0,0,.27778],Ns=[.25,.75,0,0,.38889],$i=[0,.64444,0,0,.5],Qs=[0,.69444,0,0,.77778],la=[0,.68333,0,0,.75],wa=[0,.68333,0,0,.77778],za=[0,.68333,0,0,.68056],Sa=[0,.68333,0,0,.72222],ts=[.25,.75,0,0,.5],zi=[.25,.75,0,0,.27778],Ki=[0,.69444,0,0,.5],ea=[0,.69444,0,0,.55556],Cs=[0,.43056,0,0,.44445],Ds=[0,.43056,0,0,.5],rl=[.19444,.43056,0,0,.55556],Hs=[0,.43056,0,0,.55556],$s=[.08333,.58333,0,0,.77778],no=[0,.43056,0,0,.27778],Ka=[0,.66786,0,0,.27778],nl=[0,.69444,0,0,.75],Yi=[0,.66786,0,0,.5],Ea=[0,.68333,0,0,.625],ta=[.19444,.69444,0,0,.44445],Gs=[0,.69444,0,0,.72222],Do=[.19444,.69444,0,0,.5],Jn=[.19444,.69444,0,0,1],Ua=[.011,.511,0,0,1.126],ms=[.19444,.69444,0,0,.61111],ma=[.05556,.75,0,0,.5],il=[0,.68333,0,0,.83334],Ha=[.0391,.5391,0,0,.66667],ka=[-.05555,.44445,0,0,.5],Ga=[0,.43056,0,0,.77778],ra=[0,.55556,0,0,.66667],Va=[-.03625,.46375,0,0,.77778],zs=[-.01688,.48312,0,0,.77778],io=[.0391,.5391,0,0,1],Kn=[0,.69444,0,0,.61111],qn=[-.03472,.46528,0,0,.5],Un=[.25,.75,0,0,.44445],Ui=[-.14236,.35764,0,0,1],Ii=[.244,.744,0,0,.412],Aa=[.19444,.69444,0,0,.88889],Ta=[.12963,.69444,0,0,.77778],Mo=[.19444,.69444,0,0,.38889],Lo=[.011,.511,0,0,1.638],Ca=[.19444,.69444,0,0,0],na=[0,.44444,0,0,.575],Wt=[.19444,.44444,0,0,.575],Wa=[0,.68611,0,0,.75555],sl=[0,.69444,0,0,.66759],zl=[0,.68611,0,0,.80555],Kl=[0,.68611,.08229,0,.98229],al=[0,.68611,0,0,.76666],ol=[0,.44444,0,0,.58472],Vs=[.19444,.44444,0,0,.6118],Da=[.19444,.43056,0,0,.5],Ul=[0,.68333,.02778,.08334,.76278],v0=[0,.68333,.08125,.05556,.83125],Ro=[0,.43056,0,.05556,.48472],ll=[.19444,.43056,0,.08334,.51702],Io=[.25,.75,0,0,.42778],gs=[0,.69444,0,0,.55],Es=[0,.69444,0,0,.73334],Ws=[0,.69444,0,0,.79445],y0=[0,.69444,0,0,.51945],ul=[0,.69444,0,0,.70278],cl=[0,.69444,0,0,.76389],b0=[.25,.75,0,0,.34306],Oo=[0,.69444,0,0,.56111],so=[0,.69444,0,0,.25556],_0=[.19444,.45833,0,0,.56111],Hl=[0,.45833,0,0,.56111],hl=[0,.69444,0,0,.30556],Gl=[0,.69444,0,0,.58056],Bo=[0,.69444,0,0,.67223],ao=[0,.69444,0,0,.85556],oo=[0,.69444,0,0,.55834],js=[0,.65556,.11156,0,.5],dl=[0,.69444,.08094,0,.70834],fl=[.17014,0,0,0,.44445],Vl=[0,.69444,.0799,0,.5],Wl=[0,.69444,0,0,.73752],x0=[0,.69444,.09205,0,.5],ja=[0,.69444,.09031,0,.77778],Po=[0,.69444,.07816,0,.27778],pl=[0,.69444,.00316,0,.5],w0=[.19444,.69444,0,0,.83334],jl=[.05556,.75,0,0,.83334],S0=[0,.75,0,0,.5],ml=[.125,.08333,0,0,.27778],us=[0,.08333,0,0,.27778],ks=[0,.65556,0,0,.5],lo=[0,.69444,0,0,.47222],ga=[0,.69444,0,0,.66667],ql=[0,.69444,0,0,.59722],uo=[0,.69444,0,0,.54167],ke=[0,.69444,0,0,.70834],Ma=[.25,.75,0,0,.28889],Fo=[0,.69444,0,0,.51667],No=[0,.44444,0,0,.44445],ua=[.19444,.44444,0,0,.51667],wt=[0,.44444,0,0,.38333],gl=[0,.44444,0,0,.51667],$o=[0,.69444,0,0,.83334],E0=[.35001,.85,0,0,.45834],qa=[.35001,.85,0,0,.57778],Zl=[.35001,.85,0,0,.41667],zo=[.35001,.85,0,0,.58334],Ko=[0,.72222,0,0,.55556],vl=[1e-5,.6,0,0,.66667],Yl=[1e-5,.6,0,0,.77778],Za=[.25001,.75,0,0,.94445],yl=[.306,.805,.19445,0,.47222],co=[.30612,.805,.19445,0,.47222],cs=[.25001,.75,0,0,.83334],ho=[.35001,.85,0,0,.47222],bl=[.25001,.75,0,0,1.11111],k0=[.65002,1.15,0,0,.59722],K=[.65002,1.15,0,0,.81111],p=[.65002,1.15,0,0,.47222],v=[.65002,1.15,0,0,.66667],y=[0,.75,0,0,1],x=[.55001,1.05,0,0,1.27778],O=[.862,1.36,.44445,0,.55556],z=[.86225,1.36,.44445,0,.55556],oe=[.55001,1.05,0,0,1.11111],be=[.65002,1.15,0,0,.52778],Re=[.65002,1.15,0,0,.61111],it=[.55001,1.05,0,0,1.51112],dt=[.95003,1.45,0,0,.73611],It=[.95003,1.45,0,0,1.04445],Xt=[.95003,1.45,0,0,.52778],ar=[.95003,1.45,0,0,.75],Sr=[0,.75,0,0,1.44445],Vr=[.95003,1.45,0,0,.58334],En=[1.25003,1.75,0,0,.79167],Tn=[1.25003,1.75,0,0,1.27778],kn=[1.25003,1.75,0,0,.58334],ii=[1.25003,1.75,0,0,.80556],si=[0,.825,0,0,1.8889],gi=[1.25003,1.75,0,0,.63889],wi=[.64502,1.155,0,0,.875],ji=[1e-5,.6,0,0,.875],vs=[-99e-5,.601,0,0,.66667],rs=[.64502,1.155,0,0,.66667],li=[1e-5,.9,0,0,.88889],Ks=[.65002,1.15,0,0,.88889],ca=[.90001,0,0,0,.88889],qs=[-.00499,.605,0,0,1.05556],hs=[0,.12,0,0,.45],Er=[0,.61111,0,0,.525],di=[.08333,.69444,0,0,.525],ia=[-.08056,.53055,0,0,.525],A0=[-.05556,.55556,0,0,.525],ns=[0,.43056,0,0,.525],ha=[.22222,.43056,0,0,.525],Ya=[0,0,0,0,.525],_l={"AMS-Regular":{32:he,65:Pt,66:Gt,67:Pt,68:Pt,69:Gt,70:D,71:k,72:k,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:k,76:Gt,77:[0,.68889,0,0,.94445],78:Pt,79:ut,80:D,81:ut,82:Pt,83:U,84:Gt,85:Pt,86:Pt,87:[0,.68889,0,0,1],88:Pt,89:Pt,90:Gt,107:U,160:he,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:U,295:Ue,710:Tr,732:Ee,770:Tr,771:Ee,989:yr,1008:Qr,8245:[0,.54986,0,0,.275],8463:Ue,8487:Pt,8498:U,8502:Gt,8503:[0,.68889,0,0,.44445],8504:Gt,8513:[0,.68889,0,0,.63889],8592:Ze,8594:Ze,8602:G,8603:G,8606:pe,8608:pe,8610:_e,8611:_e,8619:Ne,8620:Ne,8621:[-.13313,.37788,0,0,1.38889],8622:G,8624:H,8625:H,8630:Vt,8631:Vt,8634:Se,8635:Se,8638:qt,8639:qt,8642:qt,8643:qt,8644:vr,8646:vr,8647:vr,8648:Xr,8649:vr,8650:Xr,8651:pe,8652:pe,8653:G,8654:G,8655:G,8666:An,8667:An,8669:[-.13313,.37788,0,0,1],8672:Kr,8674:Kr,8705:[0,.825,0,0,.5],8708:U,8709:yr,8717:[0,.43056,0,0,.42917],8722:Ze,8724:[.08198,.69224,0,0,.77778],8726:yr,8733:at,8736:gn,8737:gn,8738:[.03517,.52239,0,0,.72222],8739:_r,8740:[.25142,.74111,0,0,.27778],8741:fr,8742:[.25142,.74111,0,0,.5],8756:fe,8757:fe,8764:Ae,8765:[-.13313,.37788,0,0,.77778],8769:Ae,8770:Va,8774:Jt,8776:zs,8778:yr,8782:Ct,8783:Ct,8785:Se,8786:Se,8787:Se,8790:at,8791:xr,8796:[.08198,.91667,0,0,.77778],8806:xt,8807:xt,8808:Ot,8809:Ot,8812:[.25583,.75583,0,0,.5],8814:ir,8815:ir,8816:Jt,8817:Jt,8818:xr,8819:xr,8822:br,8823:br,8828:nn,8829:nn,8830:xr,8831:xr,8832:ir,8833:ir,8840:Jt,8841:Jt,8842:kr,8843:kr,8847:Fr,8848:Fr,8858:Se,8859:Se,8861:Se,8862:$r,8863:$r,8864:$r,8865:$r,8872:[0,.69224,0,0,.61111],8873:gn,8874:[0,.69224,0,0,.88889],8876:D,8877:D,8878:Pt,8879:Pt,8882:Fr,8883:Fr,8884:nn,8885:nn,8888:[0,.54986,0,0,1.11111],8890:rl,8891:pn,8892:pn,8901:[0,.54986,0,0,.27778],8903:yr,8905:yr,8906:yr,8907:at,8908:at,8909:[-.03598,.46402,0,0,.77778],8910:Mn,8911:Mn,8912:Fr,8913:Fr,8914:mn,8915:mn,8916:fe,8918:dn,8919:dn,8920:$n,8921:$n,8922:rn,8923:rn,8926:nn,8927:nn,8928:Jt,8929:Jt,8934:Lr,8935:Lr,8936:Lr,8937:Lr,8938:ir,8939:ir,8940:Jt,8941:Jt,8994:nt,8995:nt,9416:[.15559,.69224,0,0,.90222],9484:H,9488:H,9492:Qe,9496:Qe,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:$r,9633:$r,9650:bt,9651:bt,9654:Fr,9660:bt,9661:bt,9664:Fr,9674:lt,9733:[.19444,.69224,0,0,.94445],10003:Rt,10016:Rt,10731:lt,10846:[.19444,.75583,0,0,.61111],10877:nn,10878:nn,10885:xt,10886:xt,10887:kr,10888:kr,10889:Nt,10890:Nt,10891:Ft,10892:Ft,10901:nn,10902:nn,10933:Ot,10934:Ot,10935:Nt,10936:Nt,10937:Nt,10938:Nt,10949:xt,10950:xt,10955:or,10956:or,57350:_r,57351:fr,57352:yr,57353:Qr,57356:Ot,57357:Ot,57358:on,57359:Jt,57360:Jt,57361:on,57366:Ot,57367:Ot,57368:Ot,57369:Ot,57370:kr,57371:kr},"Caligraphic-Regular":{32:he,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:he},"Fraktur-Regular":{32:he,33:[0,.69141,0,0,.29574],34:sn,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:fn,41:fn,42:[0,.62119,0,0,.27764],43:Mr,44:wr,45:Mr,46:wr,47:[.24982,.74947,0,0,.50181],48:_n,49:_n,50:_n,51:ln,52:ln,53:ln,54:qr,55:ln,56:qr,57:ln,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:Jr,93:Jr,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:he,8216:sn,8217:sn,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:he,33:[0,.69444,0,0,.35],34:Ti,35:[.19444,.69444,0,0,.95833],36:Vi,37:[.05556,.75,0,0,.95833],38:Ln,39:yn,40:en,41:en,42:[0,.75,0,0,.575],43:Zr,44:[.19444,.15556,0,0,.31944],45:wt,46:[0,.15556,0,0,.31944],47:Ie,48:Ur,49:Ur,50:Ur,51:Ur,52:Ur,53:Ur,54:Ur,55:Ur,56:Ur,57:Ur,58:ai,59:[.19444,.44444,0,0,.31944],60:cn,61:Ji,62:cn,63:[0,.69444,0,0,.54305],64:Ln,65:sr,66:[0,.68611,0,0,.81805],67:ni,68:[0,.68611,0,0,.88194],69:Wa,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:xn,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:In,77:[0,.68611,0,0,1.09166],78:xn,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:sr,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:lr,92:Ie,93:lr,94:Rn,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:gr,99:vn,100:gr,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:gr,105:yn,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:yn,109:[0,.44444,0,0,.95833],110:Yn,111:na,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:Yn,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:vn,123:Ie,124:lr,125:Ie,126:[.35,.34444,0,0,.575],160:he,163:[0,.69444,0,0,.86853],168:Rn,172:[0,.44444,0,0,.76666],176:pi,177:Zr,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Zr,216:[.04861,.73472,0,0,.89444],223:ql,230:[0,.44444,0,0,.83055],247:Zr,248:[.09722,.54167,0,0,.575],305:ai,338:[0,.68611,0,0,1.16944],339:Wi,567:[.19444,.44444,0,0,.35139],710:Rn,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Rn,715:Rn,728:Rn,729:yn,730:pi,732:Rn,733:Rn,915:In,916:ei,920:qi,923:zl,926:al,928:xn,931:ni,933:qi,934:ni,936:qi,937:ni,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:yn,8217:yn,8220:Ti,8221:Ti,8224:Zi,8225:Zi,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:sl,8465:Ar,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Ar,8501:ls,8592:bn,8593:zn,8594:bn,8595:zn,8596:bn,8597:Ie,8598:Vn,8599:Vn,8600:Vn,8601:Vn,8636:bn,8637:bn,8640:bn,8641:bn,8656:bn,8657:Gi,8658:bn,8659:Gi,8660:bn,8661:[.25,.75,0,0,.70277],8704:gr,8706:[0,.69444,.06389,0,.62847],8707:gr,8709:Vi,8711:ei,8712:Ci,8715:Ci,8722:Zr,8723:Zr,8725:Ie,8726:Ie,8727:_s,8728:Wn,8729:Wn,8730:[.18,.82,0,0,.95833],8733:Wi,8734:[0,.44444,0,0,1.14999],8736:gn,8739:lr,8741:Ie,8743:ui,8744:ui,8745:ui,8746:ui,8747:[.19444,.69444,.12778,0,.56875],8764:Ji,8768:[.19444,.69444,0,0,.31944],8771:Di,8776:[.02444,.52444,0,0,.89444],8781:Di,8801:Di,8804:bi,8805:bi,8810:Sn,8811:Sn,8826:cn,8827:cn,8834:cn,8835:cn,8838:bi,8839:bi,8846:ui,8849:bi,8850:bi,8851:ui,8852:ui,8853:Zr,8854:Zr,8855:Zr,8856:Zr,8857:Zr,8866:ls,8867:ls,8868:Ln,8869:Ln,8900:Wn,8901:[-.02639,.47361,0,0,.31944],8902:_s,8968:fs,8969:fs,8970:fs,8971:fs,8994:Xn,8995:Xn,9651:xs,9657:_s,9661:xs,9667:_s,9711:Vn,9824:ps,9825:ps,9826:ps,9827:ps,9837:[0,.75,0,0,.44722],9838:er,9839:er,10216:en,10217:en,10815:xn,10927:bi,10928:bi,57376:Ca},"Main-BoldItalic":{32:he,33:[0,.69444,.11417,0,.38611],34:Ni,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:ti,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:ci,49:ci,50:ci,51:ci,52:ws,53:ci,54:ci,55:ws,56:ci,57:ci,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Fi,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:Qi,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:Qi,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:Dn,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:_i,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:_i,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:he,168:[0,.69444,.11473,0,.59111],176:Mi,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:oi,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:oi,567:[.19444,.44444,.04611,0,.385],710:Dn,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:ti,730:Mi,732:Fi,733:Fi,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:Qi,931:[0,.68611,.11431,0,.82666],933:mi,934:[0,.68611,.05632,0,.82666],936:mi,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:ti,8217:ti,8220:[0,.69444,.16772,0,.62055],8221:Ni},"Main-Italic":{32:he,33:Os,34:Ss,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Os,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:Nn,49:Nn,50:Nn,51:Nn,52:wn,53:Nn,54:Nn,55:wn,56:Nn,57:Nn,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:On,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:hi,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:hi,79:Li,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:hi,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:Cr,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:xi,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:xi,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:he,168:[0,.66786,.10474,0,.51111],176:Dr,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:es,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:es,710:Cr,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:Dr,732:[0,.66786,.11585,0,.51111],733:On,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Li,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:hi,931:[0,.68333,.12028,0,.71555],933:jn,934:[0,.68333,.05986,0,.71555],936:jn,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Os,8217:Os,8220:[0,.69444,.1685,0,.51444],8221:Ss,8463:Ue},"Main-Regular":{32:he,33:Ts,34:Ki,35:w0,36:ma,37:jl,38:Qs,39:Ts,40:Ns,41:Ns,42:S0,43:$s,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:ts,48:$i,49:$i,50:$i,51:$i,52:$i,53:$i,54:$i,55:$i,56:$i,57:$i,58:no,59:[.19444,.43056,0,0,.27778],60:dn,61:Ae,62:dn,63:lo,64:Qs,65:la,66:[0,.68333,0,0,.70834],67:Sa,68:[0,.68333,0,0,.76389],69:za,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:la,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:wa,76:Ea,77:[0,.68333,0,0,.91667],78:la,79:wa,80:za,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Sa,85:la,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:la,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:zi,92:ts,93:zi,94:Ki,95:[.31,.12056,.02778,0,.5],97:Ds,98:ea,99:Cs,100:ea,101:Cs,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:ea,105:Ka,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:Ts,109:[0,.43056,0,0,.83334],110:Hs,111:Ds,112:rl,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:Hs,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:Cs,123:ts,124:zi,125:ts,126:[.35,.31786,0,0,.5],160:he,163:[0,.69444,0,0,.76909],167:ta,168:Yi,172:[0,.43056,0,0,.66667],176:nl,177:$s,182:ms,184:fl,198:[0,.68333,0,0,.90278],215:$s,216:[.04861,.73194,0,0,.77778],223:Ki,230:[0,.43056,0,0,.72222],247:$s,248:[.09722,.52778,0,0,.5],305:no,338:[0,.68333,0,0,1.01389],339:Ga,567:[.19444,.43056,0,0,.30556],710:Ki,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Ki,715:Ki,728:Ki,729:Ka,730:nl,732:Yi,733:Ki,915:Ea,916:il,920:wa,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:la,931:Sa,933:wa,934:Sa,936:wa,937:Sa,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:Ts,8217:Ts,8220:Ki,8221:Ki,8224:ta,8225:ta,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Ue,8465:Gs,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:Gs,8501:Kn,8592:G,8593:Do,8594:G,8595:Do,8596:G,8597:ts,8598:Jn,8599:Jn,8600:Jn,8601:Jn,8614:[.011,.511,0,0,1],8617:Ua,8618:Ua,8636:G,8637:G,8640:G,8641:G,8652:[.011,.671,0,0,1],8656:G,8657:ms,8658:G,8659:ms,8660:G,8661:[.25,.75,0,0,.61111],8704:ea,8706:[0,.69444,.05556,.08334,.5309],8707:ea,8709:ma,8711:il,8712:Ha,8715:Ha,8722:$s,8723:$s,8725:ts,8726:ts,8727:qn,8728:ka,8729:ka,8730:[.2,.8,0,0,.83334],8733:Ga,8734:Vt,8736:gn,8739:zi,8741:ts,8743:ra,8744:ra,8745:ra,8746:ra,8747:[.19444,.69444,.11111,0,.41667],8764:Ae,8768:[.19444,.69444,0,0,.27778],8771:Va,8773:[-.022,.589,0,0,1],8776:zs,8781:Va,8784:[-.133,.67,0,0,.778],8801:Va,8804:kr,8805:kr,8810:io,8811:io,8826:dn,8827:dn,8834:dn,8835:dn,8838:kr,8839:kr,8846:ra,8849:kr,8850:kr,8851:ra,8852:ra,8853:$s,8854:$s,8855:$s,8856:$s,8857:$s,8866:Kn,8867:Kn,8868:Qs,8869:Qs,8872:[.249,.75,0,0,.867],8900:ka,8901:[-.05555,.44445,0,0,.27778],8902:qn,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:Un,8969:Un,8970:Un,8971:Un,8994:Ui,8995:Ui,9136:Ii,9137:Ii,9651:Aa,9657:qn,9661:Aa,9667:qn,9711:Jn,9824:Ta,9825:Ta,9826:Ta,9827:Ta,9837:[0,.75,0,0,.38889],9838:Mo,9839:Mo,10216:Ns,10217:Ns,10222:Ii,10223:Ii,10229:[.011,.511,0,0,1.609],10230:Lo,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:Lo,10815:la,10927:kr,10928:kr,57376:Ca},"Math-BoldItalic":{32:he,48:na,49:na,50:na,51:Wt,52:Wt,53:Wt,54:Ur,55:Wt,56:Ur,57:Wt,65:sr,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:Kl,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Wa,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:sl,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:ol,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:he,915:[0,.68611,.15972,0,.65694],916:ei,920:[0,.68611,.03194,0,.86722],923:zl,926:[0,.68611,.07458,0,.84125],928:Kl,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:al,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:ol,960:[0,.44444,.03704,0,.68241],961:Vs,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:Vs,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:he,48:Ds,49:Ds,50:Ds,51:Da,52:Da,53:Da,54:$i,55:Da,56:$i,57:Da,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:v0,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:Ul,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:Ro,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:he,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Ul,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:v0,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:Ro,960:[0,.43056,.03588,0,.57003],961:ll,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:ll,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:he,33:[0,.69444,0,0,.36667],34:oo,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:hl,40:Io,41:Io,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:gs,49:gs,50:gs,51:gs,52:gs,53:gs,54:gs,55:gs,56:gs,57:gs,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:y0,64:Es,65:Es,66:Es,67:ul,68:Ws,69:[0,.69444,0,0,.64167],70:Kn,71:Es,72:Ws,73:[0,.69444,0,0,.33056],74:y0,75:cl,76:Gl,77:[0,.69444,0,0,.97778],78:Ws,79:Ws,80:ul,81:[.10556,.69444,0,0,.79445],82:ul,83:Kn,84:Es,85:cl,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Es,89:[0,.69444,.0275,0,.73334],90:Bo,91:b0,93:b0,94:gs,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Oo,99:[0,.45833,0,0,.48889],100:Oo,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Oo,105:so,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:so,109:[0,.45833,0,0,.86667],110:Hl,111:[0,.45833,0,0,.55],112:_0,113:_0,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Hl,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:he,168:gs,176:Es,180:gs,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:gs,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:gs,729:hl,730:Es,732:gs,733:gs,915:Gl,916:[0,.69444,0,0,.91667],920:ao,923:Bo,926:Es,928:Ws,931:Ws,933:ao,934:Ws,936:ao,937:Ws,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:hl,8217:hl,8220:oo,8221:oo},"SansSerif-Italic":{32:he,33:[0,.69444,.05733,0,.31945],34:pl,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:Po,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:ml,45:[0,.44444,.01946,0,.33333],46:us,47:[.25,.75,.13164,0,.5],48:js,49:js,50:js,51:js,52:js,53:js,54:js,55:js,56:js,57:js,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:ga,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:dl,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:uo,77:[0,.69444,.08094,0,.875],78:dl,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:Vl,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:he,168:[0,.67937,.06385,0,.5],176:Wl,184:fl,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Vl,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:x0,715:Ki,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Wl,732:[0,.67659,.08826,0,.5],733:x0,915:[0,.69444,.13372,0,.54167],916:$o,920:[0,.69444,.07555,0,.77778],923:Kn,926:[0,.69444,.12816,0,.66667],928:dl,931:[0,.69444,.11983,0,.72222],933:ja,934:[0,.69444,.04603,0,.72222],936:ja,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Po,8217:Po,8220:[0,.69444,.14205,0,.5],8221:pl},"SansSerif-Regular":{32:he,33:[0,.69444,0,0,.31945],34:Ki,35:w0,36:ma,37:jl,38:[0,.69444,0,0,.75834],39:Ts,40:Ns,41:Ns,42:S0,43:$s,44:ml,45:[0,.44444,0,0,.33333],46:us,47:ts,48:ks,49:ks,50:ks,51:ks,52:ks,53:ks,54:ks,55:ks,56:ks,57:ks,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:lo,64:ga,65:ga,66:ga,67:gr,68:[0,.69444,0,0,.72223],69:ql,70:[0,.69444,0,0,.56945],71:ga,72:ke,73:Ts,74:lo,75:[0,.69444,0,0,.69445],76:uo,77:[0,.69444,0,0,.875],78:ke,79:[0,.69444,0,0,.73611],80:gr,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:ea,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:ga,89:[0,.69444,.025,0,.66667],90:Kn,91:Ma,93:Ma,94:Ki,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Fo,99:No,100:Fo,101:No,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Fo,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:gl,111:[0,.44444,0,0,.5],112:ua,113:ua,114:[0,.44444,.01389,0,.34167],115:wt,116:[0,.57143,0,0,.36111],117:gl,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:he,168:[0,.67937,0,0,.5],176:ga,184:fl,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Ki,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Ki,715:Ki,728:Ki,729:[0,.67937,0,0,.27778],730:ga,732:[0,.67659,0,0,.5],733:Ki,915:uo,916:$o,920:Qs,923:Kn,926:ga,928:ke,931:Gs,933:Qs,934:Gs,936:Qs,937:Gs,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:Ts,8217:Ts,8220:Ki,8221:Ki},"Script-Regular":{32:he,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:he},"Size1-Regular":{32:he,40:E0,41:E0,47:qa,91:Zl,92:qa,93:Zl,123:zo,125:zo,160:he,710:Ko,732:Ko,770:Ko,771:Ko,8214:[-99e-5,.601,0,0,.77778],8593:vl,8595:vl,8657:Yl,8659:Yl,8719:Za,8720:Za,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:co,8748:yl,8749:yl,8750:co,8896:cs,8897:cs,8898:cs,8899:cs,8968:ho,8969:ho,8970:ho,8971:ho,9168:vs,10216:ho,10217:ho,10752:bl,10753:bl,10754:bl,10756:cs,10758:cs},"Size2-Regular":{32:he,40:k0,41:k0,47:K,91:p,92:K,93:p,123:v,125:v,160:he,710:y,732:y,770:y,771:y,8719:x,8720:x,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:z,8748:O,8749:O,8750:z,8896:oe,8897:oe,8898:oe,8899:oe,8968:be,8969:be,8970:be,8971:be,10216:Re,10217:Re,10752:it,10753:it,10754:it,10756:oe,10758:oe},"Size3-Regular":{32:he,40:dt,41:dt,47:It,91:Xt,92:It,93:Xt,123:ar,125:ar,160:he,710:Sr,732:Sr,770:Sr,771:Sr,8730:[.95003,1.45,0,0,1],8968:Vr,8969:Vr,8970:Vr,8971:Vr,10216:ar,10217:ar},"Size4-Regular":{32:he,40:En,41:En,47:Tn,91:kn,92:Tn,93:kn,123:ii,125:ii,160:he,710:si,732:si,770:si,771:si,8730:[1.25003,1.75,0,0,1],8968:gi,8969:gi,8970:gi,8971:gi,9115:wi,9116:ji,9117:wi,9118:wi,9119:ji,9120:wi,9121:rs,9122:vs,9123:rs,9124:rs,9125:vs,9126:rs,9127:li,9128:Ks,9129:ca,9130:[0,.3,0,0,.88889],9131:li,9132:Ks,9133:ca,9143:[.88502,.915,0,0,1.05556],10216:ii,10217:ii,57344:qs,57345:qs,57680:hs,57681:hs,57682:hs,57683:hs},"Typewriter-Regular":{32:Ya,33:Er,34:Er,35:Er,36:di,37:di,38:Er,39:Er,40:di,41:di,42:[0,.52083,0,0,.525],43:ia,44:[.13889,.125,0,0,.525],45:ia,46:[0,.125,0,0,.525],47:di,48:Er,49:Er,50:Er,51:Er,52:Er,53:Er,54:Er,55:Er,56:Er,57:Er,58:ns,59:[.13889,.43056,0,0,.525],60:A0,61:[-.19549,.41562,0,0,.525],62:A0,63:Er,64:Er,65:Er,66:Er,67:Er,68:Er,69:Er,70:Er,71:Er,72:Er,73:Er,74:Er,75:Er,76:Er,77:Er,78:Er,79:Er,80:Er,81:[.13889,.61111,0,0,.525],82:Er,83:Er,84:Er,85:Er,86:Er,87:Er,88:Er,89:Er,90:Er,91:di,92:di,93:di,94:Er,95:[.09514,0,0,0,.525],96:Er,97:ns,98:Er,99:ns,100:Er,101:ns,102:Er,103:ha,104:Er,105:Er,106:[.22222,.61111,0,0,.525],107:Er,108:Er,109:ns,110:ns,111:ns,112:ha,113:ha,114:ns,115:ns,116:[0,.55358,0,0,.525],117:ns,118:ns,119:ns,120:ns,121:ha,122:ns,123:di,124:di,125:di,126:Er,127:Er,160:Ya,176:Er,184:[.19445,0,0,0,.525],305:ns,567:ha,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Er,715:Er,728:Er,730:Er,770:Er,771:Er,776:Er,915:Er,916:Er,920:Er,923:Er,926:Er,928:Er,931:Er,933:Er,934:Er,936:Er,937:Er,8216:Er,8217:Er,8242:Er,9251:[.11111,.21944,0,0,.525]}},xl=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,Zs=10,Ys=.25,au=1.2,da=.431,Uo={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[da,da,da],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[Ys,Ys,Ys],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},Ho=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Go=5,La={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function wl(e,t){e===void 0&&(e=77);const n=_l[t][e];if(n)return{defaultMetrics:!1,depth:n[0],height:n[1],italic:n[2],skew:n[3],width:n[4]};if(e===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const a=String.fromCodePoint(e);if(a in La)e=La[a].codePointAt(0);else if(xl.test(a))return e=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var ou={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Sl={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},T0={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
c -179 0 -524 -115 -524 -115
c -5 -1 -9 -5 -9 -10
c 0 -1 1 -2 1 -3
l 4 -22
c 1 -5 5 -9 11 -9
h 2
s 338 93 512 92
c 174 0 513 -92 513 -92
h 2
c 5 0 9 4 11 9
l 5 22
c 1 6 -2 12 -8 13
c 0 0 -342 115 -520 115
z
`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function Zc(e){if(Sl[e]){const[R,F,X]=Sl[e],ve=`<span class="stretchy" style="height:${X}em"><svg width="100%" height="${X}em" viewBox="0 0 ${R} ${F}" preserveAspectRatio="none" ><path fill="currentcolor" d="${T0[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*X/2)/100}em;min-width:0">${ve}</span>`}const[t,n,a,l]=ou[e];let f,g;const S=a/1e3;t.length===3?(f=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],g=["xMinYMin","xMidYMin","xMaxYMin"]):t.length===2?(f=["slice-1-of-2","slice-2-of-2"],g=["xMinYMin","xMaxYMin"]):(f=["slice-1-of-1"],g=[l]);const T=t.map((R,F)=>`<span class="${f[F]}" style=height:${S}em><svg width=400em height=${S}em viewBox="0 0 400000 ${a}" preserveAspectRatio="${g[F]} slice"><path fill="currentcolor" d="${T0[R]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${S}em;min-width:${n}em;">${T}</span>`}function qu(e){return ou[e]?ou[e][2]/1e3:Sl[e][2]}function Yc(e){const t=[];for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);if(a===13&&e.charCodeAt(n+1)===10&&(a=10,n++),(a===13||a===12)&&(a=10),a===0&&(a=65533),a>=55296&&a<=56319){const l=e.charCodeAt(n+1);if(l>=56320&&l<=57343){const f=a-55296,g=l-56320;a=ro(2,16)+f*ro(2,10)+g,n++}}t.push(a)}return t}var Xl=8205,lu=[[Xl,1],[65038,2],[127995,5],[129456,4],[917536,96]],Vo,Zu=[127462,127487];function uu(e){var t;if(Vo===void 0){Vo={};for(const n of lu)for(let a=n[0];a<=n[0]+n[1]-1;a++)Vo[a]=!0}return(t=Vo[e])!=null?t:!1}function Xc(e){return e>=Zu[0]&&e<=Zu[1]}function Yu(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;const t=[],n=Yc(e);let a=0;for(;a<n.length;){const l=n[a++],f=n[a];if(f===Xl){const g=a-1;for(a+=2;n[a]===Xl;)a+=2;t.push(String.fromCodePoint(...n.slice(g,a-g+1)))}else if(uu(f)){const g=a-1;for(;uu(n[a]);)a+=n[a]===Xl?2:1;t.push(String.fromCodePoint(...n.slice(g,2*a-g-1)))}else Xc(l)?(a+=1,t.push(String.fromCodePoint(...n.slice(a-2,2)))):t.push(String.fromCodePoint(l))}return t}var cu=class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=Yu(e)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(e){const t=typeof this.s=="string"?e.exec(this.s.slice(this.pos)):e.exec(this.s.slice(this.pos).join(""));return t!=null&&t[0]?(this.pos+=t[0].length,t[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const e=this.get();if(e==="\\"){if(!this.end()){let t=this.match(/^[a-zA-Z\*]+/);return t?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):t=this.get(),"\\"+t}}else{if(e==="{")return"<{>";if(e==="}")return"<}>";if(e==="^"){if(this.peek()==="^"){this.get();const t=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(t)return String.fromCodePoint(Number.parseInt(t.slice(t.lastIndexOf("^")+1),16))}return e}else if(e==="#"){if(!this.end()){let t=!1;if(/[\d?@]/.test(this.peek())&&(t=!0,this.pos+1<this.s.length)){const n=this.s[this.pos+1];t=/[^\dA-Za-z]/.test(n)}return t?"#"+this.get():"#"}}else if(e==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return e}};function Jc(e,t){var n,a,l,f;const g=[];let S=e.next();if(S&&S!=="\\relax"){if(S==="\\noexpand")S=e.next(),S&&g.push(S);else if(S==="\\obeyspaces")e.obeyspaces=!0;else if(S==="\\bgroup")g.push("<{>");else if(S==="\\egroup")g.push("<}>");else if(S==="\\string"){if(S=e.next(),S)if(S.startsWith("\\"))for(const T of S)g.push(T==="\\"?"\\backslash":T);else S==="<{>"?g.push("\\{"):S==="<space>"?g.push("~"):S==="<}>"&&g.push("\\}")}else if(S==="\\csname"){for(;e.peek()==="<space>";)e.next();let T="",R=!1,F=[];do{if(F.length===0)if(/^#[\d?@]$/.test(e.peek())){const X=e.get().slice(1);F=El((a=(n=t==null?void 0:t(X))!=null?n:t==null?void 0:t("?"))!=null?a:"\\placeholder{}",t),S=F[0]}else S=e.next(),F=S?[S]:[];R=F.length===0,!R&&S==="\\endcsname"&&(R=!0,F.shift()),R||(R=S==="<$>"||S==="<$$>"||S==="<{>"||S==="<}>"||typeof S=="string"&&S.length>1&&S.startsWith("\\")),R||(T+=F.shift())}while(!R);T&&g.push("\\"+T),g.push(...F)}else if(S!=="\\endcsname")if(S.length>1&&S.startsWith("#")){const T=S.slice(1);g.push(...El((f=(l=t==null?void 0:t(T))!=null?l:t==null?void 0:t("?"))!=null?f:"\\placeholder{}",t))}else g.push(S)}return g}function El(e,t=null){const n=[];let a="";for(const g of e.toString().split(/\r?\n/)){a&&n.push(a),a=" ";const S=g.match(/((?:\\%)|[^%])*/);S!==null&&n.push(S[0])}const l=new cu(ot(n.join(""))),f=[];do f.push(...Jc(l,t));while(!l.end());return f}function Bn(e){let t="";const n=[];for(const a of e)a&&(t&&/^[a-zA-Z\*]/.test(a)&&n.push(t),n.push(a),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(a)&&n.push(" "),t=/\\[a-zA-Z]+\*?$/.test(a)?" ":"");return n.join("")}function Oi(e,...t){return console.assert(e.startsWith("\\")),t.length===0?e:Bn([e,...t.map(n=>`{${n}}`)])}function Wo(e){return Bn(e.map(t=>{var n;return(n={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[t])!=null?n:t}))}var C0=class ju{constructor(t){ju._registry[t]=this}static createAtom(t,n,a){return ju._registry[t].createAtom(n,qe(n,t),a)}static serialize(t,n){var a;if(!t||t.length===0)return"";if((a=n.skipStyles)!=null&&a){const l=[];for(const f of hu(t)){const g=ju._registry[f[0].mode];l.push(...g.serialize(f,n))}return Bn(l)}return Bn(fu(t,n))}static getFont(t,n,a){return ju._registry[t].getFont(n,a)}};C0._registry={};var Xs=C0;function hu(e){const t=[];let n=[],a="NONE";for(const l of e)l.type!=="first"&&(l.mode!==a?(n.length>0&&t.push(n),n=[l],a=l.mode):n.push(l));return n.length>0&&t.push(n),t}function fo(e,t){const n=[];let a=[],l;for(const f of e)if(f.type!=="first"&&f.style){let g;t==="variant"?(g=f.style.variant,f.style.variantStyle&&f.style.variantStyle!=="up"&&(g+="-"+f.style.variantStyle)):g=f.style[t],g===l?a.push(f):(a.length>0&&n.push(a),a=[f],l=g)}return a.length>0&&n.push(a),n}function du(e,t){var n;const{parent:a}=e[0],l=a==null?void 0:a.computedStyle.color,f=[];for(const g of hu(e)){const S=t.defaultMode;for(const T of fo(g,"color")){const R=T[0].computedStyle,F=Xs._registry[T[0].mode].serialize(T,c($({},t),{defaultMode:S==="text"?"text":"math"}));!t.skipStyles&&R.color&&R.color!=="none"&&(!a||l!==R.color)?f.push(Oi("\\textcolor",(n=R.verbatimColor)!=null?n:R.color,Bn(F))):f.push(Bn(F))}}return f}function Qc(e,t){const{parent:n}=e[0],a=n==null?void 0:n.computedStyle.backgroundColor;return fo(e,"backgroundColor").map(l=>{var f;if(l.length>0||l[0].type!=="box"){const g=l[0].computedStyle;if(g.backgroundColor&&g.backgroundColor!=="none"&&(!n||a!==g.backgroundColor))return Oi("\\colorbox",(f=g.verbatimBackgroundColor)!=null?f:g.backgroundColor,Bn(du(l,c($({},t),{defaultMode:"text"}))))}return Bn(du(l,t))})}function fu(e,t){if(e.length===0)return[];const{parent:n}=e[0],a=n==null?void 0:n.computedStyle.fontSize,l=[];for(const f of fo(e,"fontSize")){const g=f[0].computedStyle.fontSize,S=Qc(f,t);S&&(g&&g!=="auto"&&(!n||a!==g)?l.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][g],...S):l.push(...S))}return l}function D0(e){return e?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[e]:void 0}function kl(e){if(e.length===0)return"ord";const t=D0(e[0].type),n=D0(e[e.length-1].type);return t&&t===n?t:"ord"}function Jl(e,t){if(typeof e=="string")return e;if(typeof e=="number"){console.assert(Number.isFinite(e));const n=Math.ceil(100*e)/100;return n===0?"0":n.toString()+(t!=null?t:"")}return""}var rr=class Bf{constructor(t,n){var a,l,f,g,S;if(typeof t=="number"?this.value=String.fromCodePoint(t):typeof t=="string"?this.value=t:A(t)?this.children=t.filter(R=>R!==null):t&&t instanceof Bf&&(this.children=[t]),this.children)for(const R of this.children)R.parent=this;this.type=(a=n==null?void 0:n.type)!=null?a:"ignore",this.isSelected=(n==null?void 0:n.isSelected)===!0,n!=null&&n.caret&&(this.caret=n.caret),this.classes=(l=n==null?void 0:n.classes)!=null?l:"",this.isTight=(f=n==null?void 0:n.isTight)!=null?f:!1,n!=null&&n.attributes&&(this.attributes=n.attributes);let T=n==null?void 0:n.fontFamily;n!=null&&n.style&&this.value&&(T=(S=Xs.getFont((g=n.mode)!=null?g:"math",this,c($({variant:"normal"},n.style),{letterShapeStyle:n.letterShapeStyle})))!=null?S:void 0),T||(T="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(n==null?void 0:n.maxFontSize)!==void 0&&(this.maxFontSize=n.maxFontSize),eh(this,T)}set atomID(t){t===void 0||t.length===0||(this.id=t)}selected(t){if(this.isSelected!==t&&(this.isSelected=t,this.children))for(const n of this.children)n.selected(t)}setStyle(t,n,a){if(n===void 0)return;const l=Jl(n,a);l.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[t]=l)}setTop(t){Number.isFinite(t)&&Math.abs(t)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=Jl(t,"em"),this.height-=t,this.depth+=t)}get left(){var t;return(t=this.cssProperties)!=null&&t["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=Jl(t,"em")))}set right(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=Jl(t,"em")))}set bottom(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=Jl(t,"em")))}get width(){return this._width*this.scale}set width(t){this._width=t,this.hasExplicitWidth=!0}set softWidth(t){}get height(){return this._height*this.scale}set height(t){this._height=t}get depth(){return this._depth*this.scale}set depth(t){this._depth=t}wrap(t){const n=t.parent;if(!n)return this;t.isPhantom&&this.setStyle("opacity",0);const a=t.color;a&&a!==n.color&&this.setStyle("color",a);let l=t.backgroundColor;this.isSelected&&(l=C(l)),l&&l!==n.backgroundColor&&(this.setStyle("background-color",l),this.setStyle("display","inline-block"));const f=t.scalingFactor;return this.scale=f,this.skew*=f,this.italic*=f,this}toMarkup(){var t,n,a,l;let f=(t=this.value)!=null?t:"";if(this.children)for(const Me of this.children)f+=Me.toMarkup();let g="";if(this.svgBody)g=Zc(this.svgBody);else if(this.svgOverlay){g='<span style="',g+="display: inline-block;",g+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,g+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,g+='">',g+=f,g+="</span>",g+='<svg style="position:absolute;overflow:visible;',g+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const Me=(n=this.cssProperties)==null?void 0:n.padding;Me?(g+=`top:${Me};`,g+=`left:${Me};`,g+=`width:calc(100% - 2 * ${Me} );`):g+="top:0;left:0;width:100%;",g+="z-index:2;",g+='"',this.svgStyle&&(g+=this.svgStyle),g+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,g+=`>${this.svgOverlay}</svg>`}let S="";const T=this.classes.split(" ");T.push((a={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?a:""),this.caret==="latex"&&T.push("ML__latex-caret"),this.isSelected&&T.push("ML__selected");const R=T.length===1?T[0]:T.filter((Me,ze,_t)=>Me.length>0&&_t.indexOf(Me)===ze).join(" ");if(R.length>0&&(S+=` class="${R}"`),this.id&&(S+=` data-atom-id=${this.id}`),this.cssId&&(S+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(S+=" "+Object.keys(this.attributes).map(Me=>`${Me}="${this.attributes[Me]}"`).join(" ")),this.htmlData){const Me=this.htmlData.split(",");for(const ze of Me){const _t=ze.match(/([^=]+)=(.+$)/);if(_t){const tr=_t[1].trim().replace(/ /g,"-");tr&&(S+=` data-${tr}="${_t[2]}" `)}else{const tr=ze.trim().replace(/ /g,"-");tr&&(S+=` data-${tr} `)}}}const F=(l=this.cssProperties)!=null?l:{};this.hasExplicitWidth&&F.width===void 0&&(F.width=`${Math.ceil(this._width*100)/100}em`);const X=Object.keys(F).map(Me=>`${Me}:${F[Me]}`);if(this.scale!==void 0&&this.scale!==1&&(f.length>0||g.length>0)&&X.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const Me=this.htmlStyle.split(";");let ze="";for(const _t of Me){const tr=_t.match(/([^=]+):(.+$)/);if(tr){const pt=tr[1].trim().replace(/ /g,"-");pt&&(ze+=`${pt}:${tr[2]};`)}}ze&&(S+=` style="${ze}"`)}X.length>0&&(S+=` style="${X.join(";")}"`);let ve="";return S.length>0||g.length>0?ve=`<span${S}>${f}${g}</span>`:ve=f,this.caret==="text"?ve+='<span class="ML__text-caret"></span>':this.caret==="math"&&(ve+='<span class="ML__caret"></span>'),ve}tryCoalesceWith(t){if(this.svgBody||!this.value||t.svgBody||!t.value)return!1;const n=this.children&&this.children.length>0,a=t.children&&t.children.length>0;if(n||a)return!1;if(t.cssProperties||this.cssProperties){for(const T of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(t.cssProperties&&T in t.cssProperties||this.cssProperties&&T in this.cssProperties)return!1}const l=this.cssProperties?Object.keys(this.cssProperties).length:0,f=t.cssProperties?Object.keys(t.cssProperties).length:0;if(l!==f)return!1;if(l>0){for(const T of Object.keys(this.cssProperties))if(this.cssProperties[T]!==t.cssProperties[T])return!1}const g=this.classes.trim().replace(/\s+/g," ").split(" "),S=t.classes.trim().replace(/\s+/g," ").split(" ");if(g.length!==S.length)return!1;g.sort(),S.sort();for(const[T,R]of g.entries())if(R==="vertical-separator"||R!==S[T])return!1;return this.value+=t.value,this.height=Math.max(this.height,t.height),this.depth=Math.max(this.depth,t.depth),this._width=this._width+t._width,this.maxFontSize=Math.max(this.maxFontSize,t.maxFontSize),this.italic=t.italic,!0}};function M0(e){if(!e||e.length===0)return[];e[0].children=M0(e[0].children);const t=[e[0]];for(let n=1;n<e.length;n++)t[t.length-1].tryCoalesceWith(e[n])||(e[n].children=M0(e[n].children),t.push(e[n]));return t}function Al(e){return e.children&&(e.children=M0(e.children)),e}function L0(e,t){if(!e)return new rr(null,t);const n=new rr(null,{classes:"ML__strut",type:"ignore"});n.setStyle("height",Math.max(0,e.height),"em");const a=[n];if(e.depth!==0){const l=new rr(null,{classes:"ML__strut--bottom",type:"ignore"});l.setStyle("height",e.height+e.depth,"em"),l.setStyle("vertical-align",-e.depth,"em"),a.push(l)}return a.push(e),new rr(a,c($({},t),{type:"lift"}))}function R0(e){const t=qu(e)/2,n=new rr(null,{maxFontSize:0});return n.height=t+.166,n.depth=t-.166,n.svgBody=e,n}function eh(e,t){var n;if(e.type==="latex"){e.height=.9,e.depth=.2,e._width=1;return}if(e.value){e.height=-1/0,e.depth=-1/0,e._width=0,e.skew=-1/0,e.italic=-1/0;for(let a=0;a<e.value.length;a++){const l=wl(e.value.codePointAt(a),t);e.height=Math.max(e.height,l.height),e.depth=Math.max(e.depth,l.depth),e._width+=l.width,e.skew=l.skew,e.italic=l.italic}return}if(e.children&&e.children.length>0){let a=-1/0,l=-1/0,f=0;for(const g of e.children)g.height>a&&(a=g.height),g.depth>l&&(l=g.depth),f=Math.max(f,(n=g.maxFontSize)!=null?n:0);e.height=a,e.depth=l,e._width=e.children.reduce((g,S)=>g+S.width,0),e.maxFontSize=f}}function Xu(e){if("individualShift"in e){const t=e.individualShift;let n=t[0];const a=[n],l=-n.shift-n.box.depth;let f=l;for(let g=1;g<t.length;g++){const S=t[g],T=-S.shift-f-S.box.depth,R=T-(n.box.height+n.box.depth);f=f+T,a.push(R),a.push(S),n=S}return[a,l]}if("top"in e){let t=e.top;for(const n of e.children)t-=typeof n=="number"?n:n.box.height+n.box.depth;return[e.children,t]}else{if("bottom"in e)return[e.children,-e.bottom];if("firstBaseline"in e){const t=e.firstBaseline[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.firstBaseline,-t.box.depth]}else if("shift"in e){const t=e.children[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.children,-t.box.depth-e.shift]}}return[null,0]}function Ju(e){var t;const[n,a]=Xu(e);if(!n)return[[],0,0];const l=new rr(null,{classes:"pstrut"});let f=0;for(const ze of n)if(typeof ze!="number"){const _t=ze.box;f=Math.max(f,_t.maxFontSize,_t.height)}f+=2,l.height=f,l.setStyle("height",f,"em");const g=[];let S=a,T=a,R=a,F=0;for(const ze of n){if(typeof ze=="number")R+=ze;else{const _t=ze.box,tr=(t=ze.classes)!=null?t:[],pt=new rr([l,_t],{classes:tr.join(" "),style:ze.style});_t.setStyle("height",_t.height+_t.depth,"em"),_t.setStyle("display","inline-block"),pt.setStyle("top",-f-R-_t.depth,"em"),ze.marginLeft&&pt.setStyle("margin-left",ze.marginLeft,"em"),ze.marginRight&&pt.setStyle("margin-right",ze.marginRight,"em"),g.push(pt),R+=_t.height+_t.depth,F=Math.max(F,pt.width)}S=Math.min(S,R),T=Math.max(T,R)}g.forEach(ze=>{ze.softWidth=F});const X=new rr(g,{classes:"vlist"});if(X.softWidth=F,X.height=T,X.setStyle("height",T,"em"),S>=0)return[[new rr(X,{classes:"vlist-r"})],T,-S];const ve=new rr(new rr(null),{classes:"vlist"});ve.height=-S,ve.setStyle("height",-S,"em");const Me=new rr(8203,{classes:"vlist-s",maxFontSize:0});return Me.softWidth=0,Me.height=0,Me.depth=0,[[new rr([X,Me],{classes:"vlist-r"}),new rr(ve,{classes:"vlist-r"})],T,-S]}var ds=class extends rr{constructor(e,t){var n;const[a,l,f]=Ju(e);super(a.length===1?a[0]:a,{type:t==null?void 0:t.type,classes:((n=t==null?void 0:t.classes)!=null?n:"")+" vlist-t"+(a.length===2?" vlist-t2":"")}),this.height=l,this.depth=f,this.softWidth=a.reduce((g,S)=>Math.max(g,S.width),0)}};function Qu(e,t){var n,a,l,f,g;const S=e.metrics,T=new rr(t.base),R=(n=t.baseShift)!=null?n:0,F=(a=t.slant)!=null?a:0;let X=0,ve=0;t.above&&(X=(l=t.aboveShift)!=null?l:Math.max(S.bigOpSpacing1,S.bigOpSpacing3-t.above.depth)),t.below&&(ve=(f=t.belowShift)!=null?f:Math.max(S.bigOpSpacing2,S.bigOpSpacing4-t.below.height));let Me=null;if(t.below&&t.above){const ze=S.bigOpSpacing5+t.below.height+t.below.depth+ve+T.depth+R;Me=new ds({bottom:ze,children:[S.bigOpSpacing5,{box:t.below,marginLeft:-F,classes:["ML__center"]},ve,{box:T,classes:["ML__center"]},X,{box:t.above,marginLeft:F,classes:["ML__center"]},S.bigOpSpacing5]}).wrap(e)}else if(t.below&&!t.above)Me=new ds({top:T.height-R,children:[S.bigOpSpacing5,{box:t.below,marginLeft:-F,classes:["ML__center"]},ve,{box:T,classes:["ML__center"]}]}).wrap(e);else if(!t.below&&t.above){const ze=T.depth+R;Me=new ds({bottom:ze,children:[{box:T,classes:["ML__center"]},X,{box:t.above,marginLeft:F,classes:["ML__center"]},S.bigOpSpacing5]}).wrap(e)}else{const ze=T.depth+R;Me=new ds({bottom:ze,children:[{box:T},S.bigOpSpacing5]}).wrap(e)}return new rr(Me,{type:(g=t.type)!=null?g:"op"})}var Ql=7,I0=6,jo=5,fa=4,Bs=3,Ri=2,Xa=1,is=0,po=class{constructor(e,t,n){this.id=e,this.sizeDelta=t,this.cramped=n;const a={"-4":2,"-3":1,0:0}[t];this.metrics=Object.keys(Uo).reduce((l,f)=>c($({},l),{[f]:Uo[f][a]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return va[[is,Xa,is,Xa,Ri,Bs,Ri,Bs][this.id]]}get sub(){return va[[is,is,is,is,Ri,Ri,Ri,Ri][this.id]]}get fracNum(){return va[[is,Xa,is,Xa,Ri,Bs,fa,jo][this.id]]}get fracDen(){return va[[is,is,is,is,Ri,Ri,fa,fa][this.id]]}get cramp(){return va[[is,is,Ri,Ri,fa,fa,I0,I0][this.id]]}get isTight(){return this.sizeDelta<0}},Ra={7:new po(Ql,0,!1),6:new po(I0,0,!0),5:new po(jo,0,!1),4:new po(fa,0,!0),3:new po(Bs,-3,!1),2:new po(Ri,-3,!0),1:new po(Xa,-4,!1),0:new po(is,-4,!0)},va=c($({},Ra),{displaystyle:Ra[Ql],textstyle:Ra[jo],scriptstyle:Ra[Bs],scriptscriptstyle:Ra[Xa]});function ec(e,t){var n;if(!e)return 0;const a={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:Zs,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(n=e.unit)!=null?n:"pt"];if(Number.isFinite(t)){const l=ro(10,t);return Math.round(e.dimension/Zs*a*l)/l}return e.dimension*a}function tc(e,t){if(e===null)return 0;const n=ec(e)/Zs;if(Number.isFinite(t)){const a=ro(10,t);return Math.round(n*a)/a}return n}function pu(e){var t;return`${e.dimension}${(t=e.unit)!=null?t:"pt"}`}function rc(e){let t=pu(e.glue);return e.grow&&e.grow.dimension!==0&&(t+=` plus ${pu(e.grow)}`),e.shrink&&e.shrink.dimension!==0&&(t+=` minus ${pu(e.shrink)}`),t}function Ms(e){var t,n;if(e==null)return null;let a="";if("dimension"in e&&(a=`${e.dimension}${(t=e.unit)!=null?t:"pt"}`),"glue"in e&&(a=rc(e)),"number"in e)if(!("base"in e)||e.base==="decimal")a=Number(e.number).toString();else if(e.base==="alpha")a=`\`${String.fromCodePoint(e.number)}`;else{const l=Math.round(e.number)>>>0;e.base==="hexadecimal"?(a=Number(l).toString(16).toUpperCase(),l<=255?a=a.padStart(2,"0"):l<=65535?a=a.padStart(4,"0"):l<=16777215?a=a.padStart(6,"0"):a=a.padStart(8,"0"),a=`"${a}`):e.base==="octal"&&(a=Number(l).toString(8),l<=63?a=a.padStart(2,"0"):l<=30583?a=a.padStart(4,"0"):a=a.padStart(8,"0"),a=`'${a}`)}return"register"in e&&("factor"in e&&(e.factor===-1?a="-":e.factor!==1&&(a=Number(e.factor).toString())),"global"in e&&e.global&&(a+="\\global"),a+=`\\${e.register}`),"string"in e&&(a=e.string),(n=e.relax)!=null&&n&&(a+="\\relax"),a}function Ia(e,t){return e==null?null:"number"in e?c($({},e),{number:e.number*t}):"register"in e?"factor"in e&&e.factor?c($({},e),{factor:e.factor*t}):c($({},e),{factor:t}):"dimension"in e?c($({},e),{dimension:e.dimension*t}):"glue"in e?e.shrink&&e.grow?{glue:Ia(e.glue,t),shrink:Ia(e.shrink,t),grow:Ia(e.grow,t)}:e.shrink?{glue:Ia(e.glue,t),shrink:Ia(e.shrink,t)}:e.grow?{glue:Ia(e.glue,t),grow:Ia(e.grow,t)}:{glue:Ia(e.glue,t)}:null}var th={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function nc(){return $({},th)}function mu(){return{registers:nc(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:Z.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:st,backgroundColorMap:ft,getMacro:e=>Dt(e,cr())}}var Hn=class Pf{constructor(t,n){var a,l,f,g,S,T,R,F,X,ve,Me,ze,_t,tr,pt;let Ht;t!=null&&t.parent?(this.parent=t.parent,Ht=t.parent,this.registers={}):(Ht=$($({},mu()),(a=t==null?void 0:t.from)!=null?a:{}),this.registers=Ht.registers),Ht.atomIdsSettings&&(this.atomIdsSettings=$({},Ht.atomIdsSettings)),this.renderPlaceholder=Ht.renderPlaceholder,this.isPhantom=(g=(f=t==null?void 0:t.isPhantom)!=null?f:(l=this.parent)==null?void 0:l.isPhantom)!=null?g:!1,this.letterShapeStyle=Ht.letterShapeStyle,this.minFontScale=Ht.minFontScale,n!=null&&n.color&&n.color!=="none"?this.color=n.color:this.color=(T=(S=this.parent)==null?void 0:S.color)!=null?T:"",n!=null&&n.backgroundColor&&n.backgroundColor!=="none"?this.backgroundColor=n.backgroundColor:this.backgroundColor=(F=(R=this.parent)==null?void 0:R.backgroundColor)!=null?F:"",n!=null&&n.fontSize&&n.fontSize!=="auto"&&n.fontSize!==((X=this.parent)==null?void 0:X.size)?this.size=n.fontSize:this.size=(Me=(ve=this.parent)==null?void 0:ve.size)!=null?Me:Go;let ur=(_t=(ze=this.parent)==null?void 0:ze.mathstyle)!=null?_t:va.displaystyle;if(typeof(t==null?void 0:t.mathstyle)=="string"){if(Ht instanceof Pf)switch(t.mathstyle){case"cramp":ur=ur.cramp;break;case"superscript":ur=ur.sup;break;case"subscript":ur=ur.sub;break;case"numerator":ur=ur.fracNum;break;case"denominator":ur=ur.fracDen;break}switch(t.mathstyle){case"textstyle":ur=va.textstyle;break;case"displaystyle":ur=va.displaystyle;break;case"scriptstyle":ur=va.scriptstyle;break;case"scriptscriptstyle":ur=va.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=ur,this.smartFence=Ht.smartFence,this.placeholderSymbol=Ht.placeholderSymbol,this.colorMap=(tr=Ht.colorMap)!=null?tr:jt=>jt,this.backgroundColorMap=(pt=Ht.backgroundColorMap)!=null?pt:jt=>jt,this.getMacro=Ht.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const t=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,t}scale(t){return t*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===Ql||this.mathstyle.id===I0}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(Ho[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(t){var n;if((n=this.registers)!=null&&n[t])return this.registers[t];if(this.parent)return this.parent.getRegister(t)}getRegisterAsNumber(t){const n=this.getRegister(t);if(typeof n=="number")return n;if(typeof n=="string")return Number(n)}getRegisterAsGlue(t){var n;if((n=this.registers)!=null&&n[t]){const a=this.registers[t];return typeof a=="object"&&"glue"in a?a:typeof a=="object"&&"dimension"in a?{glue:{dimension:a.dimension}}:typeof a=="number"?{glue:{dimension:a}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(t)}getRegisterAsEm(t,n){return tc(this.getRegisterAsDimension(t),n)}getRegisterAsDimension(t){var n;if((n=this.registers)!=null&&n[t]){const a=this.registers[t];return typeof a=="object"&&"glue"in a?a.glue:typeof a=="object"&&"dimension"in a?a:typeof a=="number"?{dimension:a}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(t)}setRegister(t,n){if(n===void 0){delete this.registers[t];return}this.registers[t]=n}evaluate(t){if(!t||!("register"in t))return t;let n=this;if("global"in t&&t.global)for(;n.parent;)n=n.parent;let a=1;"factor"in t&&t.factor!==1&&t.factor!==void 0&&(a=t.factor);const l=n.getRegister(t.register);if(l===void 0)return;if(typeof l=="string")return{string:Number(l).toString()+l};if(typeof l=="number")return{number:a*l};const f=n.evaluate(l);if(f!==void 0)return"string"in f?{string:Number(l).toString()+f.string}:"number"in f?{number:a*f.number}:"dimension"in f?c($({},f),{dimension:a*f.dimension}):"glue"in f?c($({},f),{glue:c($({},f.glue),{dimension:a*f.glue.dimension}),shrink:f.shrink?c($({},f.shrink),{dimension:a*f.shrink.dimension}):void 0,grow:f.grow?c($({},f.grow),{dimension:a*f.grow.dimension}):void 0}):t}toDimension(t){const n=this.evaluate(t);return n===void 0?null:"dimension"in n?n:"glue"in n?n.glue:"number"in n?{dimension:n.number}:null}toEm(t,n){if(t===null)return 0;const a=this.toDimension(t);return a===null?0:ec(a,n)/Zs}toNumber(t){if(t===null)return null;const n=this.evaluate(t);return n===void 0?null:"number"in n?n.number:"dimension"in n?n.dimension:"glue"in n?n.glue.dimension:"string"in n?Number(n.string):null}toColor(t){var n,a;if(t===null)return null;const l=this.evaluate(t);return l===void 0?null:"string"in l?(a=(n=this.colorMap)==null?void 0:n.call(this,l.string))!=null?a:l.string:null}toBackgroundColor(t){var n,a;if(t===null)return null;const l=this.evaluate(t);return l===void 0?null:"string"in l?(a=(n=this.backgroundColorMap)==null?void 0:n.call(this,l.string))!=null?a:l.string:null}},Tl=["body","above","below","superscript","subscript"];function qo(e){return typeof e=="string"&&Tl.includes(e)}function sa(e){return e!==void 0&&Array.isArray(e)&&e.length===2}var Bt=class el{constructor(t){var n,a,l,f,g,S;this.type=t.type,typeof t.value=="string"&&(this.value=t.value),this.command=(a=(n=t.command)!=null?n:this.value)!=null?a:"",this.mode=(l=t.mode)!=null?l:"math",t.isFunction&&(this.isFunction=!0),t.limits&&(this.subsupPlacement=t.limits),this.style=$({},t.style),this.displayContainsHighlight=(f=t.displayContainsHighlight)!=null?f:!1,this.captureSelection=(g=t.captureSelection)!=null?g:!1,this.skipBoundary=(S=t.skipBoundary)!=null?S:!1,t.verbatimLatex!==void 0&&t.verbatimLatex!==null&&(this.verbatimLatex=t.verbatimLatex),t.args&&(this.args=t.args),t.body&&(this.body=t.body),this._changeCounter=0}static createBox(t,n,a){var l;if(!n)return null;const f=rh(n),g=[];for(const T of f){const R=T[0].style,F=nh(t,T,{style:{color:R.color,backgroundColor:R.backgroundColor,fontSize:R.fontSize}});F&&g.push(F)}if(g.length===0)return null;const S=((l=a==null?void 0:a.classes)!=null?l:"").trim();return g.length===1&&!S&&!(a!=null&&a.type)?g[0].wrap(t):new rr(g,{classes:S,type:a==null?void 0:a.type}).wrap(t)}static serialize(t,n){return Xs.serialize(t,n)}static commonAncestor(t,n){if(t===n||t.parent===n.parent)return t.parent;const a=new WeakSet;let{parent:l}=t;for(;l;)a.add(l),l=l.parent;for(l=n.parent;l;){if(a.has(l))return l;l=l.parent}console.assert(!!l)}static fromJson(t){return typeof t=="string"?new el({type:"mord",value:t,mode:"math"}):new el(t)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const t={};if(this.type&&(t.type=this.type),this.mode!=="math"&&(t.mode=this.mode),this.command&&this.command!==this.value&&(t.command=this.command),this.value!==void 0&&(t.value=this.value),this.style&&Object.keys(this.style).length>0&&(t.style=$({},this.style)),this.verbatimLatex!==void 0&&(t.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(t.explicitSubsupPlacement=!0),this.isFunction&&(t.isFunction=!0),this.displayContainsHighlight&&(t.displayContainsHighlight=!0),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.skipBoundary&&(t.skipBoundary=!0),this.captureSelection&&(t.captureSelection=!0),this.args&&(t.args=ih(this.args)),this._branches)for(const n of Object.keys(this._branches))this._branches[n]&&(t[n]=this._branches[n].filter(a=>a.type!=="first").map(a=>a.toJson()));return t.type==="mord"&&Object.keys(t).length===2&&"value"in t?t.value:t}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(t){if(t){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:n}=this;for(;n;)n.parent||n._changeCounter++,"verbatimLatex"in n&&(n.verbatimLatex=void 0),n._children=void 0,n=n.parent}}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=qe(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,t):this.body&&this.command?Bn([Oi(this.command,this.bodyToLatex(t)),this.supsubToLatex(t)]):this.body?Bn([this.bodyToLatex(t),this.supsubToLatex(t)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(t){var n;return Xs.serialize(this.body,c($({},t),{defaultMode:(n=t.defaultMode)!=null?n:this.latexMode}))}aboveToLatex(t){return Xs.serialize(this.above,t)}belowToLatex(t){return Xs.serialize(this.below,t)}supsubToLatex(t){let n="";if(t=c($({},t),{defaultMode:"math"}),this.branch("subscript")!==void 0){const a=Xs.serialize(this.subscript,t);a.length===0?n+="_{}":a.length===1?/^[0-9]$/.test(a)?n+=`_${a}`:n+=`_{${a}}`:n+=`_{${a}}`}if(this.branch("superscript")!==void 0){const a=Xs.serialize(this.superscript,t);a.length===0?n+="^{}":a.length===1?a==="\u2032"?n+="^\\prime ":a==="\u2033"?n+="^\\doubleprime ":/^[0-9]$/.test(a)?n+=`^${a}`:n+=`^{${a}}`:n+=`^{${a}}`}return n}get treeDepth(){let t=1,n=this.parent;for(;n;)n=n.parent,t+=1;return t}get inCaptureSelection(){let t=this;for(;t;){if(t.captureSelection)return!0;t=t.parent}return!1}get parentPrompt(){let t=this.parent;for(;t;){if(t.type==="prompt"&&!t.captureSelection)return t;t=t.parent}return null}branch(t){if(qo(t)&&this._branches)return this._branches[t]}get branches(){if(!this._branches)return[];const t=[];for(const n of Tl)this._branches[n]&&t.push(n);return t}createBranch(t){return console.assert(qo(t)),qo(t)?(this._branches?this._branches[t]||(this._branches[t]=[this.makeFirstAtom(t)]):this._branches={[t]:[this.makeFirstAtom(t)]},this.isDirty=!0,this._branches[t]):[]}get row(){return sa(this.parentBranch)?this.parentBranch[0]:-1}get col(){return sa(this.parentBranch)?this.parentBranch[1]:-1}get body(){var t;return(t=this._branches)==null?void 0:t.body}set body(t){this.setChildren(t,"body")}get superscript(){var t;return(t=this._branches)==null?void 0:t.superscript}set superscript(t){this.setChildren(t,"superscript")}get subscript(){var t;return(t=this._branches)==null?void 0:t.subscript}set subscript(t){this.setChildren(t,"subscript")}get above(){var t;return(t=this._branches)==null?void 0:t.above}set above(t){this.setChildren(t,"above")}get below(){var t;return(t=this._branches)==null?void 0:t.below}set below(t){this.setChildren(t,"below")}get computedStyle(){var t,n;const a=typeof this.style.verbatimColor=="string",l=typeof this.style.verbatimBackgroundColor=="string",f=$($({},(n=(t=this.parent)==null?void 0:t.computedStyle)!=null?n:{}),this.style);return delete f.variant,delete f.variantStyle,l||delete f.verbatimBackgroundColor,a||delete f.verbatimColor,f}applyStyle(t){this.isDirty=!0,this.style=$($({},this.style),t),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const n of this.children)n.applyStyle(t)}getInitialBaseElement(){var t,n,a;return this.hasEmptyBranch("body")?this:(console.assert(((t=this.body)==null?void 0:t[0].type)==="first"),(a=(n=this.body[1])==null?void 0:n.getInitialBaseElement())!=null?a:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(t){const n=this.branch(t);return n?(console.assert(n.length>0),console.assert(n[0].type==="first"),n.length===1):!0}setChildren(t,n){var a;if(!t||(console.assert(qo(n)),!qo(n)))return;console.assert(((a=t[0])==null?void 0:a.type)!=="first");const l=[this.makeFirstAtom(n),...t];this._branches?this._branches[n]=l:this._branches={[n]:l};for(const f of t)f.parent=this,f.parentBranch=n;this.isDirty=!0}makeFirstAtom(t){const n=new el({type:"first",mode:this.mode});return n.parent=this,n.parentBranch=t,n}addChild(t,n){console.assert(t.type!=="first"),this.createBranch(n).push(t),this.isDirty=!0,t.parent=this,t.parentBranch=n}addChildBefore(t,n){console.assert(n.parentBranch!==void 0);const a=this.createBranch(n.parentBranch);a.splice(a.indexOf(n),0,t),this.isDirty=!0,t.parent=this,t.parentBranch=n.parentBranch}addChildAfter(t,n){console.assert(n.parentBranch!==void 0);const a=this.createBranch(n.parentBranch);a.splice(a.indexOf(n)+1,0,t),this.isDirty=!0,t.parent=this,t.parentBranch=n.parentBranch}addChildren(t,n){const a=this.createBranch(n);for(const l of t)l.parent=this,l.parentBranch=n,a.push(l);this.isDirty=!0}addChildrenAfter(t,n){console.assert(t.length===0||t[0].type!=="first"),console.assert(n.parentBranch!==void 0);const a=this.createBranch(n.parentBranch);a.splice(a.indexOf(n)+1,0,...t),this.isDirty=!0;for(const l of t)l.parent=this,l.parentBranch=n.parentBranch;return t[t.length-1]}removeBranch(t){const n=this.branch(t);if(qo(t)&&(this._branches[t]=void 0),!n)return[];for(const a of n)a.parent=void 0,a.parentBranch=void 0;return console.assert(n[0].type==="first"),n.shift(),this.isDirty=!0,n}removeChild(t){if(console.assert(t.parent===this),t.type==="first")return;const n=this.branch(t.parentBranch),a=n.indexOf(t);console.assert(a>=0),n.splice(a,1),this.isDirty=!0,t.parent=void 0,t.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:t}=this;return t[t.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:t}=this;return t[t.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const t=[];for(const n of Tl)if(this._branches[n])for(const a of this._branches[n])t.push(...a.children),t.push(a);return this._children=t,t}render(t){if(this.type==="first"&&!t.atomIdsSettings)return null;const n=qe(this.command,this.mode);if(n!=null&&n.render)return n.render(this,t);const a=new Hn({parent:t},this.style);let l=this.createBox(a,{classes:this.parent?"":"ML__base"});return l?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(l=this.attachSupsub(a,{base:l})),l.wrap(a)):null}attachSupsub(t,n){var a;const l=n.base,f=this.superscript,g=this.subscript;if(!f&&!g)return l;let S=null,T=null;const R=(a=n.isCharacterBox)!=null?a:this.isCharacterBox();let F=0;if(f){const _t=new Hn({parent:t,mathstyle:"superscript"});S=el.createBox(_t,f),R||(F=l.height-t.metrics.supDrop*_t.scalingFactor)}let X=0;if(g){const _t=new Hn({parent:t,mathstyle:"subscript"});T=el.createBox(_t,g),R||(X=l.depth+t.metrics.subDrop*_t.scalingFactor)}let ve;t.isDisplayStyle?ve=t.metrics.sup1:t.isCramped?ve=t.metrics.sup3:ve=t.metrics.sup2;const Me=.5/Zs/t.scalingFactor;let ze=null;if(T&&S){F=Math.max(F,ve,S.depth+.25*t.metrics.xHeight),X=Math.max(X,t.metrics.sub2);const _t=t.metrics.defaultRuleThickness;if(F-S.depth-(T.height-X)<4*_t){X=4*_t-(F-S.depth)+T.height;const pt=.8*t.metrics.xHeight-(F-S.depth);pt>0&&(F+=pt,X-=pt)}const tr=this.isExtensibleSymbol&&l.italic?-l.italic:0;ze=new ds({individualShift:[{box:T,shift:X,marginLeft:tr},{box:S,shift:-F}]}).wrap(t)}else T&&!S?(X=Math.max(X,t.metrics.sub1,T.height-.8*da),ze=new ds({shift:X,children:[{box:T,marginRight:Me,marginLeft:this.isCharacterBox()?-l.italic:0}]})):!T&&S&&(F=Math.max(F,ve,S.depth+.25*da),ze=new ds({shift:-F,children:[{box:S,marginRight:Me}]}));return new rr([l,new rr(ze,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:n.type})}attachLimits(t,n){const a=this.superscript?el.createBox(new Hn({parent:t,mathstyle:"superscript"},this.style),this.superscript):null,l=this.subscript?el.createBox(new Hn({parent:t,mathstyle:"subscript"},this.style),this.subscript):null;return!a&&!l?n.base.wrap(t):Qu(t,c($({},n),{above:a,below:l}))}bind(t,n){if(!n||t.isPhantom||this.value==="\u200B")return n;let a=this.parent;for(;a&&!a.captureSelection;)a=a.parent;return a!=null&&a.captureSelection||(this.id||(this.id=t.makeID()),n.atomID=this.id),n}createBox(t,n){var a,l,f,g;const S=(a=this.value)!=null?a:this.body,T=(l=n==null?void 0:n.boxType)!=null?l:D0(this.type);let R=(f=n==null?void 0:n.classes)!=null?f:"";this.mode==="text"&&(R+=" ML__text");const F=typeof S=="string"||S===void 0?new rr(S!=null?S:null,{type:T,isSelected:this.isSelected,mode:this.mode,maxFontSize:t.scalingFactor,style:c($({variant:"normal"},this.style),{fontSize:Math.max(1,t.size+t.mathstyle.sizeDelta)}),letterShapeStyle:t.letterShapeStyle,classes:R}):(g=el.createBox(t,S,{type:T,classes:R}))!=null?g:new rr(null);return t.isTight&&(F.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(F.italic=0),F.right=F.italic,this.bind(t,F),this.caret&&!this.superscript&&!this.subscript&&(F.caret=this.caret),F}isDigit(){var t;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((t=this.body)==null?void 0:t.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var t;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((t=this.body)==null?void 0:t.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function rh(e){let t;const n=[];let a=[];for(const l of e)if(!t&&!l.style)a.push(l);else{const f=l.computedStyle;t&&f.color===t.color&&f.backgroundColor===t.backgroundColor&&f.fontSize===t.fontSize?a.push(l):(a.length>0&&n.push(a),a=[l],t=f)}return a.length>0&&n.push(a),n}function nh(e,t,n){var a,l,f,g,S;if(!t||t.length===0)return null;const T=new Hn({parent:e},n.style),R=!((a=T.atomIdsSettings)!=null&&a.groupNumbers);let F=[];if(t.length===1){const ve=t[0],Me=ve.render(T);Me&&(R&&ve.isSelected&&Me.selected(!0),F=[Me])}else{let ve="",Me=!0;for(const ze of t){(l=T.atomIdsSettings)!=null&&l.groupNumbers&&ve&&(Me&&ze.isDigit()||!Me&&O0(ze))&&(T.atomIdsSettings.overrideID=ve);const _t=ze.render(T);T.atomIdsSettings&&(T.atomIdsSettings.overrideID=void 0),_t&&((f=T.atomIdsSettings)!=null&&f.groupNumbers&&((ze.isDigit()||O0(ze))&&(!ve||Me!==ze.isDigit())&&(Me=ze.isDigit(),ve=(g=ze.id)!=null?g:""),ve&&(!(ze.isDigit()||O0(ze))||!ze.hasEmptyBranch("superscript")||!ze.hasEmptyBranch("subscript"))&&(ve="")),R&&ze.isSelected&&_t.selected(!0),F.push(_t))}}if(F.length===0)return null;const X=new rr(F,c($({isTight:T.isTight},n),{type:(S=n.type)!=null?S:"lift"}));return X.isSelected=F.every(ve=>ve.isSelected),X.wrap(T)}function O0(e){return e.mode==="text"}function ih(e){return e.map(t=>t===null?"<null>":Array.isArray(t)&&t[0]instanceof Bt?{atoms:t.map(n=>n.toJson())}:typeof t=="object"&&"group"in t?{group:t.group.map(n=>n.toJson())}:t)}var Cl=class Ff extends Bt{constructor(t,n,a){super({type:"text",command:t,mode:"text",displayContainsHighlight:!0}),this.value=n,this.verbatimLatex=n,this.applyStyle(a)}static fromJson(t){return new Ff(t.command,t.value,t.style)}render(t){const n=this.createBox(t);return this.caret&&(n.caret=this.caret),n}_serialize(t){var n;return(n=this.verbatimLatex)!=null?n:St("text",this.value.codePointAt(0))}};function sh(e,t){if(e.direction===t.direction){const n=e.ranges.length;if(t.ranges.length===n){let a=0;for(;a<n&&ah(e.ranges[a],t.ranges[a])==="equal";)a++;return a===n?"equal":"different"}}return"different"}function ah(e,t){return e[0]===t[0]&&e[1]===t[1]?"equal":"different"}function Ps(e){let t=1/0,n=-1/0;for(const a of e.ranges)t=Math.min(t,a[0],a[1]),n=Math.max(n,a[0],a[1]);return[t,n]}function mo(e){return typeof e=="number"&&!Number.isNaN(e)}function e0(e){return Array.isArray(e)&&e.length===2}function Dl(e){return e!=null&&typeof e=="object"&&"ranges"in e&&Array.isArray(e.ranges)}function gu(e,t){const n=e.at(t);let a;if(n){a=n.mode;let l=n.parent;for(;!a&&l;)l&&(a=l.mode),l=l.parent}return a}function vu(e,t){if(!t)return"";if(typeof t=="string")return t;if(!e||t.after===void 0)return t.value;let n=!1,a=!1,l=!1,f=!1,g=!1,S=!1,T=!1,R=!1,F=!1,X=!1,ve=!1,Me=!1,ze=!1,_t=!1,tr=!1,pt=e[0],Ht=0;for(;pt!=null&&pt.type&&/^(subsup|placeholder)$/.test(pt.type);)Ht+=1,pt=e[Ht];return n=!pt||pt.type==="first",pt&&(_t=pt.mode==="text",a=!_t&&pt.type==="mord"&&mt.test(pt.value),l=!_t&&pt.type==="mord"&&/\d+$/.test(pt.value),f=!_t&&pt.isFunction,g=pt.type==="genfrac",S=pt.type==="surd",T=pt.type==="mbin",R=pt.type==="mrel",F=pt.type==="mop"||pt.type==="operator"||pt.type==="extensible-symbol",X=pt.type==="mpunct"||pt.type==="minner",ve=pt.type==="array",Me=pt.type==="mopen",ze=pt.type==="mclose"||pt.type==="leftright",tr=pt.type==="space"),t.after.includes("nothing")&&n||t.after.includes("letter")&&a||t.after.includes("digit")&&l||t.after.includes("function")&&f||t.after.includes("frac")&&g||t.after.includes("surd")&&S||t.after.includes("binop")&&T||t.after.includes("relop")&&R||t.after.includes("operator")&&F||t.after.includes("punct")&&X||t.after.includes("array")&&ve||t.after.includes("openfence")&&Me||t.after.includes("closefence")&&ze||t.after.includes("text")&&_t||t.after.includes("space")&&tr?t.value:""}function B0(e,t,n){return n?vu(e,n[t]):""}var ic={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function P0(e,t){var n;let a=(n=t==null?void 0:t.format)!=null?n:"auto";return a==="auto"&&([a,e]=F0(e)),a==="ascii-math"?(e=e.replace(/\u2061/gu,""),e=e.replace(/\u3016/gu,"{"),e=e.replace(/\u3017/gu,"}"),e=e.replace(/([^\\])sinx/g,"$1\\sin x"),e=e.replace(/([^\\])cosx/g,"$1\\cos x "),e=e.replace(/\u2013/g,"-"),["ascii-math",Us(e,{inlineShortcuts:t==null?void 0:t.inlineShortcuts})]):["latex",e]}function Us(e,t){var n,a,l;if(!e)return"";let f=!1,g;const S=(n=t.inlineShortcuts)!=null?n:ic;if(!f&&(e.startsWith("^")||e.startsWith("_"))&&(g=Zo(e.slice(1),{inlineShortcuts:S,noWrap:!0}),e=e[0]+"{"+g.match+"}",e+=Us(g.rest,t),f=!0),f||(g=e.match(/^(sqrt|\u221A)(.*)/),g&&(g=Zo(g[2],{inlineShortcuts:S,noWrap:!0}),e="\\sqrt{"+((a=g.match)!=null?a:"\\placeholder{}")+"}",e+=Us(g.rest,t),f=!0)),f||(g=e.match(/^(\\cbrt|\u221B)(.*)/),g&&(g=Zo(g[2],{inlineShortcuts:S,noWrap:!0}),e="\\sqrt[3]{"+((l=g.match)!=null?l:"\\placeholder{}")+"}",e+=Us(g.rest,t),f=!0)),f||(g=e.match(/^abs(.*)/),g&&(g=Zo(g[1],{inlineShortcuts:S,noWrap:!0}),e="\\left|"+g.match+"\\right|",e+=Us(g.rest,t),f=!0)),f||(g=e.match(/^["”“](.*?)["”“](.*)/),g&&(e="\\text{"+g[1]+"}",e+=Us(g[2],t),f=!0)),f||(g=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),g&&(e=sc(g[1],S),e+=Us(g[2],t),f=!0)),!f&&/^([fgh])[^a-zA-Z]/.test(e)&&(g=Zo(e.slice(1),{inlineShortcuts:S,noWrap:!0}),e=e[1]==="("?e[0]+"\\left("+g.match+"\\right)":e[0]+g.match,e+=Us(g.rest,t),f=!0),f||(g=e.match(/^([a-zA-Z]+)(.*)/),g&&(e=sc(g[1],S),e+=Us(g[2],t),f=!0)),!f)if(g=Zo(e,{inlineShortcuts:S,noWrap:!0}),g.match&&g.rest[0]==="/"){const T=Zo(g.rest.slice(1),{inlineShortcuts:S,noWrap:!0});T.match&&(e="\\frac{"+g.match+"}{"+T.match+"}"+Us(T.rest,t)),f=!0}else g.match&&(e=e.startsWith("(")?"\\left("+g.match+"\\right)"+Us(g.rest,t):g.match+Us(g.rest,t),f=!0);return f||(g=e.match(/^(\s+)(.*)$/),g&&(e=" "+Us(g[2],t),f=!0)),e}function Zo(e,t){let n="";e=e.trim();let a=e,l=e.charAt(0),f={"(":")","{":"}","[":"]"}[l];if(f){let g=1,S=1;for(;S<e.length&&g>0;)e[S]===l&&g++,e[S]===f&&g--,S++;g===0?(t.noWrap&&l==="("?n=Us(e.substring(1,S-1),t):(l==="{"&&f==="}"&&(l="\\{",f="\\}"),n="\\left"+l+Us(e.substring(1,S-1),t)+"\\right"+f),a=e.slice(Math.max(0,S))):(n=e.substring(1,S),a="")}else{let g=e.match(/^([a-zA-Z]+)/);if(g){let S=B0(null,e,t.inlineShortcuts);if(S)return S=S.replace("_{#?}",""),S=S.replace("^{#?}",""),{match:S,rest:e.slice(S.length)}}if(g=e.match(/^([a-zA-Z])/),g)return{match:g[1],rest:e.slice(1)};if(g=e.match(/^(-)?\d+(\.\d*)?/),g)return{match:g[0],rest:e.slice(g[0].length)};/^\\(left|right)/.test(e)||(g=e.match(/^(\\[a-zA-Z]+)/),g&&(a=e.slice(g[1].length),n=g[1]))}return{match:n,rest:a}}function sc(e,t){let n=B0(null,e,t);return n?(n=n.replace("_{#?}",""),n=n.replace("^{#?}",""),n+=" "):n=e,n}var ac=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function yu(e){const t=e.trim();for(const n of ac)if(t.startsWith(n[0])&&t.endsWith(n[1]))return[!0,t.substring(n[0].length,t.length-n[1].length)];return[!1,e]}function F0(e){if(e=e.trim(),e.length<=1)return["latex",e];let t;return[t,e]=yu(e),t?["latex",e]:e.startsWith("`")&&e.endsWith("`")?(e=e.substring(1,e.length-1),["ascii-math",e]):e.includes("\\")?["latex",e]:/\$.+\$/.test(e)?["latex",`\\text{${e}}`]:[void 0,e]}var oh="$$",N0="$$",lh=(e,t,n)=>(ac.some(a=>t.startsWith(a[0])&&t.endsWith(a[1]))||(t=`${oh} ${t} ${N0}`),t),oc=class qc{constructor(t){qc._modes[t]=this}static onPaste(t,n,a){var l;if(!n.contentEditable&&n.userSelect==="none")return n.model.announce("plonk"),!1;if(typeof a=="string"){const g=new DataTransfer;g.setData("text/plain",a),a=g}const f=new ClipboardEvent("paste",{clipboardData:a,cancelable:!0});return(l=n.host)!=null&&l.dispatchEvent(f)?qc._modes[t].onPaste(n,a):!1}static copyToClipboard(t,n){if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const a=t.model,l=a.selectionIsCollapsed?[0,a.lastOffset]:Ps(a.selection),f=a.getValue(l,n);navigator.clipboard.writeText(f).then(()=>{},()=>t.model.announce("plonk"))}static onCopy(t,n){var a;if(!n.clipboardData)return;if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const l=t.model,f=l.selectionIsCollapsed?[0,l.lastOffset]:Ps(l.selection);let g=l.getAtoms(f);if(g.every(S=>S.mode==="text"||!S.mode))n.clipboardData.setData("text/plain",g.filter(S=>S instanceof Cl).map(S=>S.value).join(""));else if(g.every(S=>S.mode==="latex"))n.clipboardData.setData("text/plain",l.getAtoms(f,{includeChildren:!0}).map(S=>{var T;return(T=S.value)!=null?T:""}).join(""));else{let S;g.length===1&&g[0].verbatimLatex!==void 0?S=g[0].verbatimLatex:S=l.getValue(f,"latex-expanded"),n.clipboardData.setData("application/x-latex",S);try{n.clipboardData.setData("text/plain",t.options.onExport(t,S,f))}catch(T){}if(g.length===1){const T=g[0];(T.type==="root"||T.type==="group")&&(g=T.body.filter(R=>R.type!=="first"))}try{n.clipboardData.setData("application/json+mathlive",JSON.stringify(g.map(T=>T.toJson())))}catch(T){}if((a=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&a.ComputeEngine){const T=window.MathfieldElement.computeEngine;if(T)try{const R=T.jsonSerializationOptions;T.jsonSerializationOptions={metadata:["latex"]};const F=T.parse(l.getValue(f,"latex-unstyled"));T.jsonSerializationOptions=R;const X=JSON.stringify(F.json);X&&n.clipboardData.setData("application/json",X)}catch(R){}}}n.preventDefault()}static insert(t,n,a={}){var l;const f=a.mode==="auto"?t.mode:(l=a.mode)!=null?l:t.mode;return qc._modes[f].insert(t,n,a)}onPaste(t,n){return!1}insert(t,n,a){return!1}};oc._modes={};var Si=oc,uh=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],ch={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function Yo(e){var t;return((t=e.element)==null?void 0:t.mathfield)===e}function hh(e){var t,n;return(n=(t=e.querySelector(".ML__caret"))!=null?t:e.querySelector(".ML__text-caret"))!=null?n:e.querySelector(".ML__latex-caret")}function Ml(e){const t=hh(e);if(!t)return null;const n=t.getBoundingClientRect();return{x:n.right,y:n.bottom,height:n.height}}function dh(e){var t;if(!e.parent)return"root";let n=(t=e.parent.id)!=null?t:"";return n+=typeof e.parentBranch=="string"?"-"+e.parentBranch:`-${e.parentBranch[0]}/${e.parentBranch[0]}`,n}function lc(e,t,n){if(!t)return null;const a=e.field.getBoundingClientRect(),l=t.right-t.left,f=t.bottom-t.top,g=Math.ceil(t.left-a.left+e.field.scrollLeft*n),S=Math.ceil(t.top-a.top);return{left:g,right:g+l,top:S,bottom:S+f}}function uc(e){const t=e.getBoundingClientRect(),n=parseInt(getComputedStyle(e).marginRight),a={top:t.top-1,bottom:t.bottom,left:t.left,right:t.right-1+n};if(e.children.length===0||e.tagName.toUpperCase()==="SVG")return a;for(const l of e.children)if(l.nodeType===1&&"atomId"in l.dataset&&!l.classList.contains("pstrut")){const f=uc(l);a.left=Math.min(a.left,f.left),a.right=Math.max(a.right,f.right),a.top=Math.min(a.top,f.top),a.bottom=Math.max(a.bottom,f.bottom)}return a}function t0(e,t){var n,a;if(!t.id)return null;let l=(a=(n=e.atomBoundsCache)==null?void 0:n.get(t.id))!=null?a:null;if(l!==null)return l;const f=e.field.querySelector(`[data-atom-id="${t.id}"]`);return l=f?uc(f):null,e.atomBoundsCache&&(l?e.atomBoundsCache.set(t.id,l):e.atomBoundsCache.delete(t.id)),l!=null?l:null}function cc(e,t,n){const a=new Map;for(const l of e.model.getAtoms(t,{includeChildren:!0})){if(n!=null&&n.excludeAtomsWithBackground&&l.style.backgroundColor)continue;const f=e.field,g=f.offsetWidth;let T=Math.floor(f.getBoundingClientRect().width)/g;T=isNaN(T)?1:T;const R=lc(e,t0(e,l),T);if(R){const F=dh(l);if(a.has(F)){const X=a.get(F);a.set(F,{left:Math.min(X.left,R.left),right:Math.max(X.right,R.right),top:Math.min(X.top,R.top),bottom:Math.max(X.bottom,R.bottom)})}else a.set(F,R)}}return[...a.values()]}function bu(e,t){return e.model.selection.ranges.reduce((n,a)=>n.concat(...cc(e,a,t)),[])}function _u(e,t){return e==="*"||t==="none"?!0:t==="same-origin"?!window.origin||e===window.origin:typeof t=="function"?t(e):!1}function xu(e){let t=0,n=0;const a=e.offsetWidth,l=e.offsetHeight;for(;e instanceof HTMLElement;)t+=e.offsetTop,n+=e.offsetLeft,e=e.offsetParent;return new DOMRect(n,t,a,l)}var fh=`@keyframes ML__caret-blink {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
.ML__container {
display: inline-flex;
flex-flow: row;
justify-content: space-between;
align-items: flex-end;
min-height: 39px;
/* Need some room for the virtual keyboard toggle */
width: 100%;
/* Encourage browsers to consider allocating a hardware accelerated
layer for this element. */
isolation: isolate;
/* Prevent the browser from trying to interpret touch gestures in the field */
/* "Disabling double-tap to zoom removes the need for browsers to
delay the generation of click events when the user taps the screen." */
touch-action: none;
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
--_selection-color: var(--selection-color, #000);
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
--_smart-fence-color: var(--smart-fence-color, currentColor);
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
--_correct-color: var(--correct-color, #10a000);
--_incorrect-color: var(--incorrect-color, #a01b00);
--_composition-background-color: var(--composition-background-color, #fff1c2);
--_composition-text-color: var(--composition-text-color, black);
--_composition-underline-color: var(--composition-underline-color, transparent);
}
/* This is the actual field content (formula) */
.ML__content {
display: flex;
align-items: center;
align-self: center;
position: relative;
overflow: hidden;
padding: 2px 3px 2px 1px;
width: 100%;
}
.ML__virtual-keyboard-toggle,
.ML__menu-toggle {
box-sizing: border-box;
display: flex;
align-self: center;
align-items: center;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
width: 34px;
height: 34px;
padding: 0;
margin-right: 4px;
cursor: pointer;
/* Avoid some weird blinking with :hover */
border-radius: 8px;
border: 1px solid transparent;
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
color: hsl(var(--_hue), 40%, 50%);
fill: currentColor;
background: transparent;
}
.ML__virtual-keyboard-toggle:hover,
.ML__menu-toggle:hover {
background: hsla(0, 0%, 70%, 0.3);
color: #333;
fill: currentColor;
}
.ML__virtual-keyboard-toggle > span,
.ML__menu-toggle > span {
display: flex;
align-self: center;
align-items: center;
}
/* The invisible element used to capture keyboard events. We're just trying
really hard to make sure it doesn't show. */
.ML__keyboard-sink {
display: inline-block;
resize: none;
outline: none;
border: none;
/* Need these for Microsoft Edge */
position: fixed;
clip: rect(0 0 0 0);
/* Need this to prevent iOS Safari from auto-zooming */
font-size: 1em;
font-family: KaTeX_Main;
line-height: 0.5;
/* On Chromium, if this is 0, no keyboard events are received */
}
[part="placeholder"] {
color: var(--neutral-400);
}
.ML__composition {
background: var(--_composition-background-color);
color: var(--_composition-text-color);
text-decoration: underline var(--_composition-underline-color);
}
.ML__caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__text-caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__latex-caret::after {
content: '';
visibility: hidden;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_latex-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.019em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__focused .ML__latex-caret::after,
.ML__focused .ML__text-caret::after,
.ML__focused .ML__caret::after {
visibility: visible;
}
.ML__focused .ML__text {
background: var(--_text-highlight-background-color);
}
/* When using smartFence, the anticipated closing fence is displayed
with this style */
.ML__smart-fence__close {
opacity: var(--_smart-fence-opacity);
color: var(--_smart-fence-color);
}
.ML__selected,
.ML__focused .ML__selected .ML__contains-caret,
.ML__focused .ML__selected .ML__smart-fence__close,
.ML__focused .ML__selected .ML__placeholder {
color: var(--_selection-color);
opacity: 1;
}
.ML__selection {
box-sizing: border-box;
background: var(--_selection-background-color) !important;
}
.ML__contains-caret.ML__close,
.ML__contains-caret.ML__open,
.ML__contains-caret > .ML__close,
.ML__contains-caret > .ML__open,
.ML__contains-caret .ML__sqrt-sign,
.ML__contains-caret .ML__sqrt-line {
color: var(--_caret-color);
}
.ML__contains-highlight {
box-sizing: border-box;
background: transparent;
}
.ML__focused .ML__contains-highlight {
background: var(--_contains-highlight-background-color);
}
.ML__raw-latex {
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-weight: 400;
font-size: 0.8em;
letter-spacing: -0.05em;
color: var(--_latex-color);
}
.ML__suggestion {
color: var(--neutral-500);
}
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
.ML__virtual-keyboard-toggle:focus {
outline: none;
border-radius: 8px;
border: 2px solid hsl(var(--_hue), 40%, 50%);
}
.ML__virtual-keyboard-toggle.is-pressed,
.ML__virtual-keyboard-toggle.is-active:hover,
.ML__virtual-keyboard-toggle.is-active {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
/* Add an attribute 'data-tooltip' to automatically show a
tooltip over a element on hover.
*/
[data-tooltip] {
position: relative;
}
[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
display: block;
z-index: 2;
pointer-events: none;
right: auto;
top: calc(-100% - 4px);
width: max-content;
max-width: 200px;
padding: 8px 8px;
border-radius: 4px;
background: #616161;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
text-align: center;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 13px;
/* Phone */
opacity: 0;
transform: scale(0.5);
}
@media only screen and (max-width: 767px) {
[data-tooltip]::after {
padding: 8px 16px;
font-size: 16px;
}
}
menu [data-tooltip]::after {
left: 100%;
top: 0%;
}
menu .ML__base {
cursor: default;
}
/** Don't display if we're tracking, i.e. have the pointer down */
.tracking [data-tooltip]:hover::after {
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
visibility: hidden;
}
/** But do display if tracking and inside a menu */
.tracking menu li[data-tooltip]:hover::after,
[data-tooltip]:hover::after {
visibility: visible;
opacity: 1;
transform: scale(1);
transition-property: opacity, scale;
transition-duration: 0.15s;
transition-delay: 1s;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__prompt {
border-radius: 2px;
}
.ML__editablePromptBox {
outline: 1px solid #acacac;
border-radius: 2px;
z-index: -1;
}
.ML__focusedPromptBox {
outline: highlight auto 1px;
}
.ML__lockedPromptBox {
background-color: rgba(142, 142, 141, 0.4);
z-index: -1;
}
.ML__correctPromptBox {
outline: 1px solid var(--_correct-color);
box-shadow: 0 0 5px var(--_correct-color);
}
.ML__incorrectPromptBox {
outline: 1px solid var(--_incorrect-color);
box-shadow: 0 0 5px var(--_incorrect-color);
}
.variant-submenu {
display: flex;
flex-direction: column;
padding: 8px;
}
.variant-submenu [part=menu-item] {
font-size: 2rem;
text-align: center;
margin: 0;
}
.insert-matrix-submenu {
display: grid;
padding: 8px;
align-content: center;
justify-content: center;
grid-template-columns: repeat(5, minmax(0, 1fr));
}
.insert-matrix-submenu [part=menu-item] {
font-size: 21px;
border: none;
border-radius: 0;
line-height: 21px;
text-align: center;
padding: 0;
margin: 0;
}
.border-submenu [part=menu-item] {
font-size: 2rem;
line-height: 1.2;
text-align: center;
}
.swatches-submenu {
--_swatch-size: 2rem;
--_columns: 4;
display: flex;
flex-flow: wrap;
padding: 8px;
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
box-sizing: border-box;
}
.menu-swatch {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: fit-content;
height: fit-content;
margin: 2px;
padding: 0;
background: var(--neutral-200);
}
.menu-swatch > .label {
padding: 0;
margin: 0;
line-height: 0;
}
.menu-swatch > .label > span {
display: inline-block;
margin: 6px;
min-width: var(--_swatch-size);
min-height: var(--_swatch-size);
border-radius: 50%;
}
.menu-swatch.active {
background: var(--neutral-100);
scale: 1.4;
}
.menu-swatch.active > .label > span {
border-radius: 2px;
}
.menu-swatch .ui-checkmark,
.menu-swatch .ui-mixedmark {
position: absolute;
margin: 0;
padding: 0;
color: white;
}
.menu-swatch.dark-contrast .ui-checkmark,
.menu-swatch.dark-contrast .ui-mixedmark {
color: #000;
}
`,ph=`.ML__container {
min-height: auto !important;
--_hue: var(--hue, 212);
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
}
.ML__sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
.ML__is-inline {
display: inline-block;
}
.ML__base {
visibility: inherit;
display: inline-block;
position: relative;
cursor: text;
padding: 0;
margin: 0;
box-sizing: content-box;
border: 0;
outline: 0;
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
text-decoration: none;
width: min-content;
}
.ML__strut,
.ML__strut--bottom {
display: inline-block;
min-height: 0.5em;
}
.ML__small-delim {
font-family: KaTeX_Main;
}
/* Text mode */
.ML__text {
font-family: var(--_text-font-family);
white-space: pre;
}
/* Use cmr for 'math upright' */
.ML__cmr {
font-family: KaTeX_Main;
font-style: normal;
}
.ML__mathit {
font-family: KaTeX_Math;
/* The KaTeX_Math font is italic by default, so the font-style below is only
useful when a fallback font is used
*/
font-style: italic;
}
.ML__mathbf {
font-family: KaTeX_Main;
font-weight: bold;
}
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
to match TeX idiosyncratic behavior */
.lcGreek.ML__mathbf {
font-family: KaTeX_Math;
font-weight: normal;
}
.ML__mathbfit {
font-family: KaTeX_Math;
font-weight: bold;
font-style: italic;
}
.ML__ams {
font-family: KaTeX_AMS;
}
/* Blackboard */
.ML__bb {
font-family: KaTeX_AMS;
}
.ML__cal {
font-family: KaTeX_Caligraphic;
}
.ML__frak {
font-family: KaTeX_Fraktur;
}
.ML__tt {
font-family: KaTeX_Typewriter;
}
.ML__script {
font-family: KaTeX_Script;
}
.ML__sans {
font-family: KaTeX_SansSerif;
}
.ML__series_ul {
font-weight: 100;
}
.ML__series_el {
font-weight: 100;
}
.ML__series_l {
font-weight: 200;
}
.ML__series_sl {
font-weight: 300;
}
.ML__series_sb {
font-weight: 500;
}
.ML__bold,
.ML__boldsymbol {
font-weight: 700;
}
.ML__series_eb {
font-weight: 800;
}
.ML__series_ub {
font-weight: 900;
}
.ML__series_uc {
font-stretch: ultra-condensed;
}
.ML__series_ec {
font-stretch: extra-condensed;
}
.ML__series_c {
font-stretch: condensed;
}
.ML__series_sc {
font-stretch: semi-condensed;
}
.ML__series_sx {
font-stretch: semi-expanded;
}
.ML__series_x {
font-stretch: expanded;
}
.ML__series_ex {
font-stretch: extra-expanded;
}
.ML__series_ux {
font-stretch: ultra-expanded;
}
.ML__it {
font-style: italic;
}
.ML__shape_ol {
-webkit-text-stroke: 1px black;
text-stroke: 1px black;
color: transparent;
}
.ML__shape_sc {
font-variant: small-caps;
}
.ML__shape_sl {
font-style: oblique;
}
/* First level emphasis */
.ML__emph {
color: #bc2612;
}
/* Second level emphasis */
.ML__emph .ML__emph {
color: #0c7f99;
}
.ML__highlight {
color: #007cb2;
background: #edd1b0;
}
.ML__center {
text-align: center;
}
.ML__label_padding {
padding: 0 0.5em;
}
.ML__frac-line {
width: 100%;
min-height: 1px;
}
.ML__frac-line:after {
content: '';
display: block;
margin-top: max(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
/* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%).
Setting the min-height used to work around it, but that workaround
broke in Chrome 84 or so.
Setting the background (and the min-height) seems to work for now.
*/
background: currentColor;
box-sizing: content-box;
/* Vuetify sets the box-sizing to inherit
causes the fraction line to not draw at all sizes (see #26) */
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt {
display: inline-block;
}
.ML__sqrt-sign {
display: inline-block;
position: relative;
}
.ML__sqrt-line {
display: inline-block;
height: max(1px, 0.04em);
width: 100%;
}
.ML__sqrt-line:before {
content: '';
display: block;
margin-top: min(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
background: currentColor;
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt-line:after {
border-bottom-width: 1px;
content: ' ';
display: block;
margin-top: -0.1em;
}
.ML__sqrt-index {
margin-left: 0.27777778em;
margin-right: -0.55555556em;
}
.ML__delim-size1 {
font-family: KaTeX_Size1;
}
.ML__delim-size2 {
font-family: KaTeX_Size2;
}
.ML__delim-size3 {
font-family: KaTeX_Size3;
}
.ML__delim-size4 {
font-family: KaTeX_Size4;
}
.ML__delim-mult .delim-size1 > span {
font-family: KaTeX_Size1;
}
.ML__delim-mult .delim-size4 > span {
font-family: KaTeX_Size4;
}
.ML__accent-body > span {
font-family: KaTeX_Main;
width: 0;
}
.ML__accent-vec {
position: relative;
left: 0.24em;
}
/** The markup for a LaTeX formula, either in an editable mathfield or
in a static display.
*/
.ML__latex {
display: inline-block;
direction: ltr;
text-align: left;
text-indent: 0;
text-rendering: auto;
font-family: KaTeX_Main, 'Times New Roman', serif;
font-style: normal;
font-size-adjust: none;
font-stretch: normal;
font-variant-caps: normal;
letter-spacing: normal;
line-height: 1.2;
word-wrap: normal;
word-spacing: normal;
white-space: nowrap;
text-shadow: none;
-webkit-user-select: none;
user-select: none;
width: min-content;
}
.ML__latex .style-wrap {
position: relative;
}
.ML__latex .mfrac {
display: inline-block;
}
.ML__latex .left-right {
display: inline-block;
}
.ML__latex .vlist-t {
display: inline-table;
table-layout: fixed;
border-collapse: collapse;
}
.ML__latex .vlist-r {
display: table-row;
}
.ML__latex .vlist {
display: table-cell;
vertical-align: bottom;
position: relative;
}
.ML__latex .vlist > span {
display: block;
height: 0;
position: relative;
}
.ML__latex .vlist > span > span {
display: inline-block;
}
.ML__latex .vlist > span > .pstrut {
overflow: hidden;
width: 0;
}
.ML__latex .vlist-t2 {
margin-right: -2px;
}
.ML__latex .vlist-s {
display: table-cell;
vertical-align: bottom;
font-size: 1px;
width: 2px;
min-width: 2px;
}
.ML__latex .msubsup {
text-align: left;
}
.ML__latex .negativethinspace {
display: inline-block;
margin-left: -0.16667em;
height: 0.71em;
}
.ML__latex .thinspace {
display: inline-block;
width: 0.16667em;
height: 0.71em;
}
.ML__latex .mediumspace {
display: inline-block;
width: 0.22222em;
height: 0.71em;
}
.ML__latex .thickspace {
display: inline-block;
width: 0.27778em;
height: 0.71em;
}
.ML__latex .enspace {
display: inline-block;
width: 0.5em;
height: 0.71em;
}
.ML__latex .quad {
display: inline-block;
width: 1em;
height: 0.71em;
}
.ML__latex .qquad {
display: inline-block;
width: 2em;
height: 0.71em;
}
.ML__latex .llap,
.ML__latex .rlap {
width: 0;
position: relative;
display: inline-block;
}
.ML__latex .llap > .inner,
.ML__latex .rlap > .inner {
position: absolute;
}
.ML__latex .llap > .fix,
.ML__latex .rlap > .fix {
display: inline-block;
}
.ML__latex .llap > .inner {
right: 0;
}
.ML__latex .rlap > .inner {
left: 0;
}
.ML__latex .rule {
display: inline-block;
border: solid 0;
position: relative;
box-sizing: border-box;
}
.ML__latex .overline .overline-line,
.ML__latex .underline .underline-line {
width: 100%;
}
.ML__latex .overline .overline-line:before,
.ML__latex .underline .underline-line:before {
content: '';
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: block;
}
.ML__latex .overline .overline-line:after,
.ML__latex .underline .underline-line:after {
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
content: '';
display: block;
margin-top: -1px;
}
.ML__latex .stretchy {
display: block;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .stretchy:before,
.ML__latex .stretchy:after {
content: '';
}
.ML__latex .stretchy svg {
display: block;
position: absolute;
width: 100%;
height: inherit;
fill: currentColor;
stroke: currentColor;
fill-rule: nonzero;
fill-opacity: 1;
stroke-width: 1;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-miterlimit: 4;
stroke-dasharray: none;
stroke-dashoffset: 0;
stroke-opacity: 1;
}
.ML__latex .slice-1-of-2 {
display: inline-flex;
position: absolute;
left: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-2-of-2 {
display: inline-flex;
position: absolute;
right: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-1-of-3 {
display: inline-flex;
position: absolute;
left: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-2-of-3 {
display: inline-flex;
position: absolute;
left: 25%;
width: 50%;
overflow: hidden;
}
.ML__latex .slice-3-of-3 {
display: inline-flex;
position: absolute;
right: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-1-of-1 {
display: inline-flex;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .nulldelimiter {
display: inline-block;
}
.ML__latex .op-group {
display: inline-block;
}
.ML__latex .op-symbol {
position: relative;
}
.ML__latex .op-symbol.small-op {
font-family: KaTeX_Size1;
}
.ML__latex .op-symbol.large-op {
font-family: KaTeX_Size2;
}
.ML__latex .mtable .vertical-separator {
display: inline-block;
min-width: 1px;
box-sizing: border-box;
}
.ML__latex .mtable .arraycolsep {
display: inline-block;
}
.ML__latex .mtable .col-align-m > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-c > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-l > .vlist-t {
text-align: left;
}
.ML__latex .mtable .col-align-r > .vlist-t {
text-align: right;
}
.ML__error {
display: inline-block;
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
background-color: hsla(341, 100%, 40%, 0.1);
background-repeat: repeat-x;
background-size: 3px 3px;
padding-bottom: 3px;
background-position: 0 100%;
}
.ML__error > .ML__error {
background: transparent;
padding: 0;
}
.ML__placeholder {
color: var(--_placeholder-color);
opacity: var(--_placeholder-opacity);
padding-left: 0.4ex;
padding-right: 0.4ex;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
.ML__notation {
position: absolute;
box-sizing: border-box;
line-height: 0;
}
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
For UI elements, see \`[data-ML__tooltip]\`
*/
.ML__tooltip-container {
position: relative;
transform: scale(0);
}
.ML__tooltip-container .ML__tooltip-content {
position: fixed;
display: inline-table;
visibility: hidden;
z-index: 2;
width: max-content;
max-width: 400px;
padding: 12px 12px;
border-radius: 8px;
background: #616161;
--_selection-color: #fff;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
opacity: 0;
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
}
.ML__tooltip-container .ML__tooltip-content .ML__text {
white-space: normal;
}
.ML__tooltip-container .ML__tooltip-content .ML__base {
display: contents;
}
.ML__tooltip-container:hover .ML__tooltip-content {
visibility: visible;
opacity: 1;
font-size: 0.75em;
transform: scale(1) translate(0, 3em);
}
`,hc=`#mathlive-environment-popover.is-visible {
visibility: visible;
}
#mathlive-environment-popover {
--_environment-panel-height: var(--environment-panel-height, 70px);
--_accent-color: var(--accent-color, #aaa);
--_background: var(--environment-panel-background, #fff);
--_button-background: var(--environment-panel-button-background, white);
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
--_button-text: var(--environment-panel-button-text, #e3e4e8);
position: absolute;
width: calc(var(--_environment-panel-height) * 2);
height: var(--_environment-panel-height);
border-radius: 4px;
border: 1.5px solid var(--_accent-color);
background-color: var(--_background);
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
pointer-events: all;
visibility: hidden;
}
#mathlive-environment-popover .MLEP__array-buttons {
height: calc(var(--_environment-panel-height) * 5/4);
width: calc(var(--_environment-panel-height) * 5/4);
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
}
#mathlive-environment-popover .MLEP__array-buttons .font {
fill: white;
}
#mathlive-environment-popover .MLEP__array-buttons circle {
fill: #7f7f7f;
transition: fill 300ms;
}
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
fill-opacity: 1;
fill: var(--_background);
stroke: var(--_accent-color);
stroke-width: 3px;
}
#mathlive-environment-popover .MLEP__array-buttons line {
stroke: var(--_accent-color);
stroke-opacity: 0;
stroke-width: 40;
pointer-events: none;
transition: stroke-opacity 300ms;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
fill: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
stroke-opacity: 1;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
height: 100%;
width: 50%;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
width: var(--_environment-panel-height);
height: var(--_environment-panel-height);
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-around;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
pointer-events: all;
margin-top: 2px;
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
height: calc(var(--_environment-panel-height) / 3 - 2px);
border-radius: calc(var(--_environment-panel-height) / 25);
background-color: var(--_button-background);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
background-color: var(--_button-background-hover);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
stroke: var(--_button-text);
stroke-width: 2;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
fill-opacity: 0;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
pointer-events: none;
background-color: var(--_button-background-active);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
stroke: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
fill: var(--_accent-color);
}
`,mh=`/* The element that display info while in latex mode */
#mathlive-suggestion-popover {
background-color: rgba(97, 97, 97);
color: #fff;
text-align: center;
border-radius: 8px;
position: fixed;
z-index: 1;
display: none;
flex-direction: column;
justify-content: center;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
#mathlive-suggestion-popover.top-tip::after {
content: '';
position: absolute;
top: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.bottom-tip::after {
content: '';
position: absolute;
bottom: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.is-animated {
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
}
#mathlive-suggestion-popover.is-visible {
display: flex;
}
@keyframes ML__fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* The wrapper class for the entire content of the popover panel */
#mathlive-suggestion-popover ul {
display: flex;
flex-flow: column;
list-style: none;
margin: 0;
padding: 0;
align-items: flex-start;
max-height: 400px;
overflow-y: auto;
}
#mathlive-suggestion-popover li {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 8px;
padding: 8px;
width: calc(100% - 16px - 16px);
column-gap: 1em;
border-radius: 8px;
cursor: pointer;
/* Since the content can be clicked on, provide feedback on hover */
}
#mathlive-suggestion-popover li a {
color: #5ea6fd;
padding-top: 0.3em;
margin-top: 0.4em;
display: block;
}
#mathlive-suggestion-popover li a:hover {
color: #5ea6fd;
text-decoration: underline;
}
#mathlive-suggestion-popover li:hover,
#mathlive-suggestion-popover li.is-pressed,
#mathlive-suggestion-popover li.is-active {
background: rgba(255, 255, 255, 0.1);
}
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
.ML__popover__command {
font-size: 1.6rem;
font-family: KaTeX_Main;
}
.ML__popover__current {
background: #5ea6fd;
color: #fff;
}
.ML__popover__latex {
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
align-self: center;
}
/* The keyboard shortcuts for a symbol as displayed in the popover */
.ML__popover__keybinding {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 0.8em;
opacity: 0.7;
}
/* Style for the character that joins the modifiers of a keyboard shortcut
(usually a "+" sign)*/
.ML__shortcut-join {
opacity: 0.5;
}
`,gh=`/* The element that displays the keys as the user type them */
#mathlive-keystroke-caption-panel {
visibility: hidden;
/*min-width: 160px;*/
/*background-color: rgba(97, 97, 200, .95);*/
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
border-color: var(--secondary-border, hsl(0, 0%, 91%));
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
text-align: center;
border-radius: 6px;
padding: 16px;
position: absolute;
z-index: 1;
display: flex;
flex-direction: row-reverse;
justify-content: center;
--keystroke: white;
--on-keystroke: #555;
--keystroke-border: #f7f7f7;
}
@media (prefers-color-scheme: dark) {
body:not([theme='light']) #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
}
body[theme='dark'] #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
#mathlive-keystroke-caption-panel > span {
min-width: 14px;
/*height: 8px;*/
margin: 0 8px 0 0;
padding: 4px;
background-color: var(--keystroke);
color: var(--on-keystroke);
fill: currentColor;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 1em;
border-radius: 6px;
border: 2px solid var(--keystroke-border);
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
}
`,vh=`.ML__keyboard {
--_keyboard-height: 0;
--_keyboard-zindex: var(--keyboard-zindex, 105);
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
--_padding-top: var(--keyboard-padding-top, 5px);
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_keycap-height: var(--keycap-height, 60px);
/* Keycap width (incl. margin) */
--_keycap-max-width: var(--keycap-max-width, 100px);
--_keycap-gap: var(--keycap-gap, 8px);
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
--_variant-keycap-length: var(--variant-keycap-length, 70px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
}
.is-math-mode .MLK__rows .if-text-mode,
.is-text-mode .MLK__rows .if-math-mode {
display: none;
}
.if-can-undo,
.if-can-redo,
.if-can-copy,
.if-can-cut,
.if-can-paste {
opacity: 0.4;
pointer-events: none;
}
.can-undo .if-can-undo,
.can-redo .if-can-redo,
.can-copy .if-can-copy,
.can-cut .if-can-cut,
.can-paste .if-can-paste {
opacity: 1;
pointer-events: all;
}
body > .ML__keyboard {
position: fixed;
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
}
body > .ML__keyboard.is-visible > .MLK__backdrop {
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
border-top: 1px solid var(--_border);
}
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
box-shadow: none;
border: none;
}
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
transition-property: transform, opacity;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__keyboard {
position: relative;
overflow: hidden;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: var(--_keyboard-zindex);
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
opacity: 1;
transform: none;
pointer-events: none;
}
.ML__keyboard :where(div) {
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
transform: none;
}
.MLK__backdrop {
position: absolute;
bottom: calc(-1 * var(--_keyboard-height));
width: 100%;
height: var(--_keyboard-height);
box-sizing: border-box;
padding-top: var(--_padding-top);
padding-bottom: var(--_padding-bottom);
padding-left: var(--_padding-horizontal);
padding-right: var(--_padding-horizontal);
opacity: 0;
visibility: hidden;
transform: translate(0, 0);
background: var(--_background);
}
.backdrop-is-transparent .MLK__backdrop {
background: transparent;
}
/* If a custom layout has a custom container/backdrop
(backdrop-is-transparent), make sure to let pointer event go through. */
.backdrop-is-transparent .MLK__plate {
background: transparent;
pointer-events: none;
}
/* If a custom layout has a custom container/backdrop, make sure to
allow pointer events on it. */
.backdrop-is-transparent .MLK__layer > div > div {
pointer-events: all;
}
.ML__keyboard.is-visible > .MLK__backdrop {
transform: translate(0, calc(-1 * var(--_keyboard-height)));
opacity: 1;
visibility: visible;
}
.caps-lock-indicator {
display: none;
width: 8px;
height: 8px;
background: #0cbc0c;
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
border-radius: 8px;
right: 8px;
top: 8px;
position: absolute;
}
.ML__keyboard.is-caps-lock .caps-lock-indicator {
display: block;
}
.ML__keyboard.is-caps-lock .shift {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
}
.MLK__plate {
position: absolute;
top: var(--_padding-top);
left: var(--_padding-horizontal);
width: calc(100% - 2 * var(--_padding-horizontal));
margin: 0;
padding: 0;
box-sizing: border-box;
container-type: inline-size;
touch-action: none;
-webkit-user-select: none;
user-select: none;
pointer-events: all;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
/* Size of toolbar labels */
font-weight: 400;
text-shadow: none;
}
.ML__box-placeholder {
color: var(--_box-placeholder-color);
}
.MLK__tex {
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__tex-math {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
font-style: italic;
}
.MLK__layer {
display: none;
outline: none;
}
.MLK__layer.is-visible {
display: flex;
flex-flow: column;
}
/* Keyboard layouts are made or rows of keys... */
.MLK__rows {
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
display: flex;
flex-flow: column;
align-items: center;
border-collapse: separate;
clear: both;
border: 0;
margin: 0;
margin-bottom: var(--_keycap-gap);
gap: var(--_keycap-gap);
/* If the styling include, e.g., some shadows, they will be
cut off by the overflow. In that case, set the padding to
compensate. */
padding-left: var(--_row-padding-left);
padding-right: var(--_row-padding-right);
overflow: visible;
touch-action: none;
}
.MLK__rows > .MLK__row {
display: flex;
flex-flow: row;
justify-content: center;
width: 100%;
gap: var(--_keycap-gap);
margin: 0;
padding: 0;
/* For the alignment of the text on some modifiers (e.g. shift) */
/* Extra spacing between two adjacent keys */
}
.MLK__rows > .MLK__row .tex {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .tex-math {
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .big-op {
font-size: calc(1.25 * var(--_keycap-font-size));
}
.MLK__rows > .MLK__row .small {
font-size: var(--_keycap-small-font-size);
}
.MLK__rows > .MLK__row .bottom {
justify-content: flex-end;
}
.MLK__rows > .MLK__row .left {
align-items: flex-start;
padding-left: 12px;
}
.MLK__rows > .MLK__row .right {
align-items: flex-end;
padding-right: 12px;
}
.MLK__rows > .MLK__row .w0 {
width: 0;
}
.MLK__rows > .MLK__row .w5 {
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w15 {
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w20 {
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w40 {
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w50 {
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .MLK__keycap.w50 {
font-size: 80%;
padding-top: 10px;
font-weight: 100;
}
.MLK__rows > .MLK__row .separator {
background: transparent;
border: none;
pointer-events: none;
}
.MLK__rows > .MLK__row .horizontal-rule {
height: 6px;
margin-top: 3px;
margin-bottom: 0;
width: 100%;
border-radius: 0;
border-top: var(--_horizontal-rule);
}
.MLK__rows > .MLK__row .ghost {
background: var(--_toolbar-background);
border: none;
color: var(--_toolbar-text);
}
.MLK__rows > .MLK__row .ghost:hover {
background: var(--_toolbar-background-hover);
}
.MLK__rows > .MLK__row .bigfnbutton {
font-size: var(--_keycap-extra-small-font-size);
}
.MLK__rows > .MLK__row .shift,
.MLK__rows > .MLK__row .action {
color: var(--_keycap-secondary-text);
background: var(--_keycap-secondary-background);
border-color: var(--_keycap-secondary-border);
border-bottom-color: var(--_keycap-secondary-border-bottom);
line-height: 0.8;
font-size: min(1rem, var(--_keycap-small-font-size));
font-weight: 600;
padding: 8px 12px 8px 12px;
}
.MLK__rows > .MLK__row .shift:hover,
.MLK__rows > .MLK__row .action:hover {
background: var(--_keycap-secondary-background-hover);
}
.MLK__rows > .MLK__row .action.primary {
background: var(--_keycap-primary-background);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .action.primary:hover {
background: var(--_keycap-primary-background-hover);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .shift.selected,
.MLK__rows > .MLK__row .action.selected {
color: var(--_toolbar-text-active);
}
.MLK__rows > .MLK__row .shift.selected.is-pressed,
.MLK__rows > .MLK__row .action.selected.is-pressed,
.MLK__rows > .MLK__row .shift.selected.is-active,
.MLK__rows > .MLK__row .action.selected.is-active {
color: white;
}
.MLK__rows > .MLK__row .warning {
background: #cd0030;
color: white;
}
.MLK__rows > .MLK__row .warning svg.svg-glyph {
width: 24px;
height: 24px;
min-height: 24px;
}
/** A regular keycap
* Use the :where() pseudo-class to give it a very low specifity,
* so that it can be overriden by custom style.
*/
:where(.MLK__rows > .MLK__row div) {
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-evenly;
width: calc(var(--_keycap-width) - var(--_keycap-gap));
height: var(--_keycap-height);
box-sizing: border-box;
padding: 0;
vertical-align: top;
text-align: center;
float: left;
color: var(--_keycap-text);
fill: currentColor;
font-size: var(--_keycap-font-size);
background: var(--_keycap-background);
border: 1px solid var(--_keycap-border);
border-bottom-color: var(--_keycap-border-bottom);
border-radius: 6px;
cursor: pointer;
touch-action: none;
/* Keys with a variants panel */
position: relative;
overflow: hidden;
-webkit-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
:where(.MLK__rows > .MLK__row div):hover {
overflow: visible;
background: var(--_keycap-background-hover);
}
:where(.MLK__rows > .MLK__row div) .ML__latex {
pointer-events: none;
touch-action: none;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
margin: 8px 0;
width: 20px;
height: 20px;
min-height: 20px;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
margin: 8px 0;
width: 24px;
height: 24px;
min-height: 24px;
}
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
font-size: 25px;
}
:where(.MLK__rows > .MLK__row div).is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
z-index: calc(var(--_keyboard-zindex) - 5);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
:where(.MLK__rows > .MLK__row div).action.is-active aside,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
display: none;
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
display: none;
}
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
}
:where(.MLK__rows > .MLK__row div).shift.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div) small {
color: var(--_keycap-secondary-text);
}
:where(.MLK__rows > .MLK__row div) aside {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 10px;
line-height: 10px;
color: var(--_keycap-secondary-text);
}
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
Note there are a different set of tooltip rules for the keyboard toggle
(it's in a different CSS tree) */
.ML__keyboard [data-tooltip] {
position: relative;
}
.ML__keyboard [data-tooltip]::after {
position: absolute;
display: inline-table;
content: attr(data-tooltip);
top: inherit;
bottom: 100%;
width: max-content;
max-width: 200px;
padding: 8px 8px;
background: #616161;
color: #fff;
text-align: center;
z-index: 2;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
border-radius: 2px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-weight: 400;
font-size: 12px;
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
opacity: 0;
transform: scale(0.5);
}
.ML__keyboard [data-tooltip]:hover {
position: relative;
}
.ML__keyboard [data-tooltip]:hover::after {
opacity: 1;
transform: scale(1);
}
.MLK__toolbar {
align-self: center;
display: flex;
flex-flow: row;
justify-content: space-between;
width: 100%;
max-width: 996px;
min-height: 32px;
/* Icons for undo/redo, etc. */
}
.MLK__toolbar svg {
height: 20px;
width: 20px;
}
.MLK__toolbar > .left {
position: relative;
display: flex;
justify-content: flex-start;
flex-flow: row;
}
.MLK__toolbar > .right {
display: flex;
justify-content: flex-end;
flex-flow: row;
}
.MLK__toolbar > div > div {
/* "button" in the toolbar */
display: flex;
align-items: center;
justify-content: center;
color: var(--_toolbar-text);
fill: currentColor;
background: var(--_toolbar-background);
font-size: var(--_toolbar-font-size);
padding: 4px 15px;
cursor: pointer;
width: max-content;
min-width: 42px;
min-height: 34px;
border: none;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 8px;
padding-top: 8px;
margin-top: 0;
margin-bottom: 4px;
margin-left: 4px;
margin-right: 4px;
border-radius: 8px;
box-shadow: none;
border-bottom: 2px solid transparent;
}
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
background: var(--_toolbar-background-hover);
}
.MLK__toolbar > div > div.disabled svg,
.MLK__toolbar > div > div.disabled:hover svg,
.MLK__toolbar > div > div.disabled.is-pressed svg {
color: var(--_toolbar-text);
opacity: 0.2;
}
.MLK__toolbar > div > div:hover,
.MLK__toolbar > div > div:active,
.MLK__toolbar > div > div.is-pressed,
.MLK__toolbar > div > div.is-active {
color: var(--_toolbar-text-active);
}
.MLK__toolbar > div > div.selected {
color: var(--_toolbar-text-active);
background: var(--_toolbar-background-selected);
border-radius: 0;
border-bottom-color: var(--_toolbar-text-active);
padding-bottom: 4px;
margin-bottom: 8px;
}
/* This is the element that displays variants on press+hold */
.MLK__variant-panel {
visibility: hidden;
position: fixed;
display: flex;
flex-flow: row wrap-reverse;
justify-content: center;
align-content: center;
margin: 0;
padding: 0;
bottom: auto;
top: 0;
box-sizing: content-box;
transform: none;
z-index: calc(var(--_keyboard-zindex) + 1);
touch-action: none;
max-width: 350px;
background: var(--_variant-panel-background);
text-align: center;
border-radius: 6px;
padding: 6px;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
transition: none;
}
.MLK__variant-panel.is-visible {
visibility: visible;
}
.MLK__variant-panel.compact {
--_variant-keycap-length: var(--variant-keycap-length, 50px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
}
.MLK__variant-panel .item {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: var(--_variant-keycap-font-size);
height: var(--_variant-keycap-length);
width: var(--_variant-keycap-length);
margin: 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid transparent;
background: transparent;
pointer-events: all;
cursor: pointer;
color: var(--_variant-keycap-text);
fill: currentColor;
}
@media (max-height: 412px) {
.MLK__variant-panel .item {
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
.MLK__variant-panel .item .ML__latex {
pointer-events: none;
}
.MLK__variant-panel .item.is-active {
background: var(--_variant-keycap-background-active);
color: var(--_variant-keycap-text-active);
}
.MLK__variant-panel .item.is-pressed {
background: var(--_variant-keycap-background-pressed);
color: var(--_variant-keycap-text-pressed);
}
.MLK__variant-panel .item.small {
font-size: var(--_keycap-small-font-size);
}
.MLK__variant-panel .item.swatch-button {
box-sizing: border-box;
background: #fbfbfb;
}
.MLK__variant-panel .item.swatch-button > span {
display: inline-block;
margin: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
border-radius: 50%;
}
.MLK__variant-panel .item.swatch-button:hover {
background: #f0f0f0;
}
.MLK__variant-panel .item.swatch-button:hover > span {
border-radius: 2px;
}
.MLK__variant-panel .item.box > div,
.MLK__variant-panel .item.box > span {
border: 1px dashed rgba(0, 0, 0, 0.24);
}
.MLK__variant-panel .item .warning {
min-height: 60px;
min-width: 60px;
background: #cd0030;
color: white;
padding: 5px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.MLK__variant-panel .item .warning.is-pressed,
.MLK__variant-panel .item .warning.is-active {
background: red;
}
.MLK__variant-panel .item .warning svg.svg-glyph {
width: 50px;
height: 50px;
}
.MLK__variant-panel .item aside {
font-size: var(--_variant-keycap-aside-font-size);
line-height: 12px;
opacity: 0.78;
padding-top: 2px;
}
.MLK__keycap {
position: relative;
}
.MLK__shift {
display: block;
position: absolute;
right: 4px;
top: 4px;
font-size: var(--_keycap-shift-font-size);
color: var(--_keycap-shift-color);
}
.hide-shift .MLK__shift {
display: none;
}
@media (max-width: 414px) {
.MLK__variant-panel {
max-width: 350px;
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
/* @xs breakpoint: iPhone 5 */
@container (max-width: 414px) {
.MLK__rows {
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
--_keycap-height: max(var(--_keycap-height), 42px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
font-size: 100%;
margin-left: 2px;
margin-right: 2px;
}
.MLK__rows .shift,
.MLK__rows .action {
font-size: 65%;
}
.MLK__rows .warning svg.svg-glyph {
width: 14px;
height: 14px;
min-height: 14px;
}
}
@container (max-width: 744px) {
.MLK__rows {
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
--_keycap-height: max(var(--keycap-height, 52px), 52px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
padding-left: 0;
padding-right: 0;
}
.MLK__tooltip::after {
padding: 8px 16px;
font-size: 16px;
}
.MLK__rows > .MLK__row > div.fnbutton {
font-size: 16px;
}
.MLK__rows > .MLK__row > div.bigfnbutton {
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
}
.MLK__rows > .MLK__row > div.small {
font-size: 13px;
}
.MLK__rows > .MLK__row > div > aside {
display: none;
}
.MLK__shift {
display: none;
}
}
/* Medium breakpoint: larger phones */
@container (max-width: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@media (max-height: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@container (max-width: 1444px) {
.MLK__rows .if-wide {
display: none;
}
}
@media (prefers-color-scheme: dark) {
.ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
}
/* Same as the media query, but with a class */
[theme='dark'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
[theme='light'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--_keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
}
`,yh=`:host {
--primary-color: #5898ff;
--primary-color-dimmed: #c0c0f0;
--primary-color-dark: var(--blue-500);
--primary-color-light: var(--blue-100);
--primary-color-reverse: #ffffff;
--secondary-color: #ff8a65;
--secondary-color-dimmed: #f0d5c5;
--secondary-color-dark: var(--orange-500);
--secondary-color-light: var(--orange-100);
--secondary-color-reverse: #ffffff;
--link-color: #5898ff;
--link-color-dimmed: #c5c5c5;
--link-color-dark: #121212;
--link-color-light: #e2e2e2;
--link-color-reverse: #ffffff;
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--neutral-100: #f5f5f5;
--neutral-200: #eeeeee;
--neutral-300: #e0e0e0;
--neutral-400: #bdbdbd;
--neutral-500: #9e9e9e;
--neutral-600: #757575;
--neutral-700: #616161;
--neutral-800: #424242;
--neutral-900: #212121;
--red-25: #fff8f7;
--red-50: #fff1ef;
--red-100: #ffeae6;
--red-200: #ffcac1;
--red-300: #ffa495;
--red-400: #ff7865;
--red-500: #f21c0d;
--red-600: #e50018;
--red-700: #d30024;
--red-800: #bd002c;
--red-900: #a1002f;
--orange-25: #fffbf8;
--orange-50: #fff7f1;
--orange-100: #fff3ea;
--orange-200: #ffe1c9;
--orange-300: #ffcca2;
--orange-400: #ffb677;
--orange-500: #fe9310;
--orange-600: #f58700;
--orange-700: #ea7c00;
--orange-800: #dc6d00;
--orange-900: #ca5b00;
--brown-25: #fff8ef;
--brown-50: #fff1df;
--brown-100: #ffe9ce;
--brown-200: #ebcca6;
--brown-300: #cdaf8a;
--brown-400: #af936f;
--brown-500: #856a47;
--brown-600: #7f5e34;
--brown-700: #78511f;
--brown-800: #6e4200;
--brown-900: #593200;
--yellow-25: #fffdf9;
--yellow-50: #fffcf2;
--yellow-100: #fffaec;
--yellow-200: #fff2ce;
--yellow-300: #ffe8ab;
--yellow-400: #ffdf85;
--yellow-500: #ffcf33;
--yellow-600: #f1c000;
--yellow-700: #dfb200;
--yellow-800: #c9a000;
--yellow-900: #ad8a00;
--lime-25: #f4ffee;
--lime-50: #e9ffdd;
--lime-100: #ddffca;
--lime-200: #a8fb6f;
--lime-300: #94e659;
--lime-400: #80d142;
--lime-500: #63b215;
--lime-600: #45a000;
--lime-700: #268e00;
--lime-800: #007417;
--lime-900: #005321;
--green-25: #f5fff5;
--green-50: #ebffea;
--green-100: #e0ffdf;
--green-200: #a7ffa7;
--green-300: #5afa65;
--green-400: #45e953;
--green-500: #17cf36;
--green-600: #00b944;
--green-700: #00a34a;
--green-800: #008749;
--green-900: #00653e;
--teal-25: #f3ffff;
--teal-50: #e6fffe;
--teal-100: #d9fffe;
--teal-200: #8dfffe;
--teal-300: #57f4f4;
--teal-400: #43e5e5;
--teal-500: #17cfcf;
--teal-600: #00c2c0;
--teal-700: #00b5b1;
--teal-800: #00a49e;
--teal-900: #009087;
--cyan-25: #f7fcff;
--cyan-50: #eff8ff;
--cyan-100: #e7f5ff;
--cyan-200: #c2e6ff;
--cyan-300: #95d5ff;
--cyan-400: #61c4ff;
--cyan-500: #13a7ec;
--cyan-600: #069eda;
--cyan-700: #0095c9;
--cyan-800: #0088b2;
--cyan-900: #0a7897;
--blue-25: #f7faff;
--blue-50: #eef5ff;
--blue-100: #e5f1ff;
--blue-200: #bfdbff;
--blue-300: #92c2ff;
--blue-400: #63a8ff;
--blue-500: #0d80f2;
--blue-600: #0077db;
--blue-700: #006dc4;
--blue-800: #0060a7;
--blue-900: #005086;
--indigo-25: #f8f7ff;
--indigo-50: #f1efff;
--indigo-100: #eae7ff;
--indigo-200: #ccc3ff;
--indigo-300: #ac99ff;
--indigo-400: #916aff;
--indigo-500: #63c;
--indigo-600: #5a21b2;
--indigo-700: #4e0b99;
--indigo-800: #3b0071;
--indigo-900: #220040;
--purple-25: #fbf7ff;
--purple-50: #f8f0ff;
--purple-100: #f4e8ff;
--purple-200: #e4c4ff;
--purple-300: #d49aff;
--purple-400: #c36aff;
--purple-500: #a219e6;
--purple-600: #9000c4;
--purple-700: #7c009f;
--purple-800: #600073;
--purple-900: #3d0043;
--magenta-25: #fff8fb;
--magenta-50: #fff2f6;
--magenta-100: #ffebf2;
--magenta-200: #ffcddf;
--magenta-300: #ffa8cb;
--magenta-400: #ff7fb7;
--magenta-500: #eb4799;
--magenta-600: #da3689;
--magenta-700: #c82179;
--magenta-800: #b00065;
--magenta-900: #8a004c;
}
@media (prefers-color-scheme: dark) {
:host {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
}
:host([theme='dark']) {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
/* @media (prefers-color-scheme: dark) {
:host {
--label-color: #fff;
--active-label-color: #000;
--menu-bg: #525252;
--active-bg: #5898ff;
--active-bg-dimmed: #5c5c5c;
}
} */
:host {
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
--ui-font-size: 14px;
--ui-line-height: 1.5;
--ui-letter-spacing: 0.007em;
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
--ui-layer-1: var(--neutral-100);
--ui-layer-2: var(--neutral-200);
--ui-layer-3: var(--neutral-300);
--ui-layer-4: var(--neutral-400);
--ui-layer-5: var(--neutral-500);
--ui-layer-6: var(--neutral-600);
--ui-border-color: var(--primary-color);
--ui-border-radius: 4px;
--ui-text: var(--neutral-900);
--ui-text-secondary: var(--neutral-700);
--ui-text-placeholder: var(--neutral-500);
--ui-text-muted: var(--neutral-300);
/** A field is a UI element in which a user can type data, for
* example an input or textarea element.
*/
--ui-field-bg: var(--neutral-100);
--ui-field-bg-hover: var(--neutral-100);
--ui-field-bg-disabled: var(--neutral-300);
--ui-field-bg-invalid: var(--red-100);
--ui-field-bg-focus: var(--neutral-100);
--ui-field-border: 0.5px solid var(--border-color);
--ui-field-border-hover: 0.5px solid var(--border-color);
--ui-field-border-disabled: 0.5px solid var(--border-color);
--ui-field-border-invalid: 0.5px solid var(--border-color);
--ui-field-border-focus: 0.5px solid var(--border-color);
--ui-menu-bg: var(--neutral-100);
--ui-menu-text: var(--neutral-900);
--ui-menu-bg-hover: var(--neutral-200);
--ui-menu-text-hover: var(--neutral-900);
/** The \`active\` state is used for the state of menu items
* when they are selected.
*/
--ui-menu-bg-active: var(--primary-color);
--ui-menu-text-active: var(--primary-color-reverse);
/** The \`active-muted\` set is used for the state of
* submenus when they are open.
*/
--ui-menu-bg-active-muted: var(--neutral-300);
--ui-menu-text-active-muted: var(--neutral-900);
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
--ui-menu-divider: 0.5px solid #c7c7c7;
/* var(--neutral-300); */
--ui-menu-z-index: 10000;
--page-bg: var(--neutral-100);
--content-bg: var(--neutral-200);
}
@media (prefers-color-scheme: dark) {
:host {
--ui-menu-bg: var(--neutral-200);
}
}
:host([theme='dark']) {
--ui-menu-bg: var(--neutral-200);
}
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
Noto is a Linux/Android font.
*/
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh) {
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
}
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
}
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac) {
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
}
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(ko-kr-apple) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh),
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo),
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac),
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std),
:lang(ko-kr-apple) {
--ui-font-size: 1rem;
--ui-line-height: 1.7;
--ui-letter-spacing: 0;
}
:dir(rtl) {
--ui-line-height: auto;
--ui-letter-spacing: 0;
}
`,bh=`.ui-menu *,
.ui-menu ::before,
.ui-menu ::after {
box-sizing: border-box;
}
.ui-menu {
display: none;
color-scheme: light dark;
-webkit-user-select: none;
/* Important: Safari iOS doesn't respect user-select */
user-select: none;
cursor: default;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0 0 0 0);
--active-label-color: #fff;
/* ui-menu-text-active */
--label-color: #121212;
/* ui-menu-text */
--menu-bg: #e2e2e2;
/* ui-menu-background */
--active-bg: #5898ff;
/* ui-menu-background-active */
--active-bg-dimmed: #c5c5c5;
/* ui-menu-background-active-muted */
}
/** Use the :where pseudo selector to make the specificity of the
* selector 0, so that it can be overridden by the user.
*/
:where(.ui-menu-container) {
position: absolute;
overflow: visible;
width: auto;
height: auto;
z-index: 10000;
border-radius: 8px;
background: var(--ui-menu-bg);
box-shadow: var(--ui-menu-shadow);
list-style: none;
padding: 6px 0 6px 0;
margin: 0;
user-select: none;
cursor: default;
color: var(--ui-menu-text);
font-weight: normal;
font-style: normal;
text-shadow: none;
text-transform: none;
letter-spacing: 0;
outline: none;
opacity: 1;
/* The [popover] elements have a 1px solid black border. Ugh. */
border: none;
width: fit-content;
height: fit-content;
}
:where(.ui-menu-container > li) {
display: flex;
flex-flow: row;
align-items: center;
padding: 1px 7px 1px 7px;
margin-top: 0;
margin-left: 6px;
margin-right: 6px;
border-radius: 4px;
white-space: nowrap;
position: relative;
outline: none;
fill: currentColor;
user-select: none;
cursor: default;
text-align: left;
color: inherit;
font-family: var(--ui-font-family);
font-size: var(--ui-font-size);
line-height: var(--ui-line-height);
letter-spacing: var(--ui-letter-spacing);
}
:where(.ui-menu-container > li > .label) {
appearance: none;
background: none;
outline: none;
width: 100%;
margin: 0;
padding: 1px 2px 1px 1px;
overflow: visible;
border: 1px solid transparent;
white-space: nowrap;
text-align: start;
}
:where(.ui-menu-container > li:has(.heading)) {
margin-top: 0.5em;
}
:where(.ui-menu-container > li > .label.heading) {
font-weight: bold;
opacity: 0.4;
}
:where(.ui-menu-container > li.indent > .label) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li > .label.indent) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li[role='divider']) {
border-bottom: 1px solid var(--ui-menu-divider);
border-radius: 0;
padding: 0;
margin-left: 15px;
margin-right: 15px;
padding-top: 5px;
margin-bottom: 5px;
width: calc(100% - 30px);
/** 100% - (margin-left + margin-right) */
}
:where(.ui-menu-container > li[aria-disabled='true']) {
opacity: 0.5;
}
:where(.ui-menu-container > li.active) {
background: var(--ui-menu-bg-active);
background: -apple-system-control-accent;
color: var(--ui-menu-text-active);
}
:where(.ui-menu-container > li.active.is-submenu-open) {
background: var(--ui-menu-bg-active-muted);
color: inherit;
}
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
padding-inline-end: 0;
}
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
color: var(--ui-menu-text-active);
}
/** Keyboard shortcut */
:where(.ui-menu-container > li > kbd) {
font-family: var(--ui-font-family);
margin-inline-start: 12px;
opacity: 0.4;
}
:where(.ui-menu-container > li.active > kbd) {
opacity: 0.85;
}
.ui-trailing-chevron {
display: flex;
margin-inline-start: 24px;
width: 10px;
height: 10px;
margin-bottom: 4px;
}
.ui-trailing-chevron:dir(rtl) {
transform: scaleX(-1);
}
.ui-checkmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
.ui-mixedmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
`,go;function Xo(e){let t="";switch(e){case"mathfield-element":t=`
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
:host([hidden]) { display: none; }
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
:host(:focus), :host(:focus-within) {
outline: Highlight auto 1px; /* For Firefox */
outline: -webkit-focus-ring-color auto 1px;
}
:host([readonly]:focus), :host([readonly]:focus-within),
:host([read-only]:focus), :host([read-only]:focus-within) {
outline: none;
}
@media (hover: none) and (pointer: coarse) {
:host(:not(:focus)) :first-child { pointer-events: none !important; }
}`;break;case"core":t=ph;break;case"mathfield":t=fh;break;case"environment-popover":t=hc;break;case"suggestion-popover":t=mh;break;case"keystroke-caption":t=gh;break;case"virtual-keyboard":t=vh;break;case"ui":t=yh;break;case"menu":t=bh;break;default:debugger}return t}function Ll(e){return go||(go={}),go[e]||(go[e]=new CSSStyleSheet,go[e].replaceSync(Xo(e))),go[e]}var Oa;function Ja(e){var t;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${e}`))return;const n=window.document.createElement("style");n.id=`mathlive-style-${e}`,n.append(window.document.createTextNode(Xo(e))),window.document.head.appendChild(n);return}if(Oa||(Oa={}),((t=Oa[e])!=null?t:0)!==0)Oa[e]+=1;else{const n=Ll(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,n],Oa[e]=1}}function vo(e){if("adoptedStyleSheets"in document&&Oa!=null&&Oa[e]&&(Oa[e]-=1,Oa[e]<=0)){const t=go[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>n!==t)}}var Rl=class Nf extends Bt{constructor(t){var n;super(c($({},t),{type:"accent",body:(n=t.body)!=null?n:void 0})),t.accentChar?this.accent=t.accentChar:this.svgAccent=t==null?void 0:t.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(t){return new Nf(t)}toJson(){return c($({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(t){var n;const a=new Hn({parent:t,mathstyle:"cramp"},this.style),l=(n=Bt.createBox(a,this.body))!=null?n:new rr("\u25A2",{style:this.style});let f=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(f=l.skew);let g=Math.min(l.height,da),S;if(this.svgAccent)S=R0(this.svgAccent),g=a.metrics.bigOpSpacing1-g;else if(this.accent){const R=new rr(this.accent,{fontFamily:"Main-Regular"});R.italic=0;const F=this.accent===8407?" ML__accent-vec":"";S=new rr(new rr(R),{classes:"ML__accent-body"+F})}S=new ds({shift:0,children:[{box:new rr(l)},-g,{box:S,marginLeft:l.left+2*f,classes:["ML__center"]}]});const T=new rr(S,{type:"lift"});return this.caret&&(T.caret=this.caret),this.bind(a,T.wrap(a)),this.attachSupsub(a,{base:T})}},$0={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},Il=Object.fromEntries(Object.entries($0).map(([e,t])=>[t,e]));function z0(e){var t;return(t={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[e])!=null?t:e.codePointAt(0)}function dc(e,t,n,a){var l;const g=new rr(z0(e),{fontFamily:"Main-Regular",isSelected:a.isSelected,classes:"ML__small-delim "+((l=a.classes)!=null?l:"")}).wrap(t);return n&&g.setTop((1-t.scalingFactor)*Ys),g}function fc(e,t,n,a,l){var f,g;const S=new Hn({parent:a,mathstyle:"textstyle"},l==null?void 0:l.style),T=new rr(z0(e),{fontFamily:`Size${t}-Regular`,isSelected:l.isSelected,classes:((f=l.classes)!=null?f:"")+` ML__delim-size${t}`,type:(g=l.type)!=null?g:"ignore"}).wrap(S);return n&&T.setTop((1-S.scalingFactor)*Ys),T}function wu(e,t,n,a,l){var f;let g,S,T,R;g=T=R=z0(e),S=null;let F="Size1-Regular";e==="\\vert"||e==="\\lvert"||e==="\\rvert"||e==="\\mvert"||e==="\\mid"?T=g=R=8739:e==="\\Vert"||e==="\\lVert"||e==="\\rVert"||e==="\\mVert"||e==="\\|"?T=g=R=8741:e==="\\uparrow"?T=R=9168:e==="\\Uparrow"?T=R=8214:e==="\\downarrow"?g=T=9168:e==="\\Downarrow"?g=T=8214:e==="\\updownarrow"?(g=8593,T=9168,R=8595):e==="\\Updownarrow"?(g=8657,T=8214,R=8659):e==="["||e==="\\lbrack"?(g=9121,T=9122,R=9123,F="Size4-Regular"):e==="]"||e==="\\rbrack"?(g=9124,T=9125,R=9126,F="Size4-Regular"):e==="\\lfloor"||e==="\u230A"?(T=g=9122,R=9123,F="Size4-Regular"):e==="\\lceil"||e==="\u2308"?(g=9121,T=R=9122,F="Size4-Regular"):e==="\\rfloor"||e==="\u230B"?(T=g=9125,R=9126,F="Size4-Regular"):e==="\\rceil"||e==="\u2309"?(g=9124,T=R=9125,F="Size4-Regular"):e==="("||e==="\\lparen"?(g=9115,T=9116,R=9117,F="Size4-Regular"):e===")"||e==="\\rparen"?(g=9118,T=9119,R=9120,F="Size4-Regular"):e==="\\{"||e==="\\lbrace"?(g=9127,S=9128,R=9129,T=9130,F="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(g=9131,S=9132,R=9133,T=9130,F="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(g=9127,R=9129,T=9130,F="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(g=9131,R=9133,T=9130,F="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(g=9127,R=9133,T=9130,F="Size4-Regular"):e==="\\rmoustache"||e==="\u23B1"?(g=9131,R=9129,T=9130,F="Size4-Regular"):e==="\\surd"?(g=57345,R=9143,T=57344,F="Size4-Regular"):e==="\\ulcorner"?(g=9484,T=R=32):e==="\\urcorner"?(g=9488,T=R=32):e==="\\llcorner"?(R=9492,T=g=32):e==="\\lrcorner"&&(g=9496,T=g=32);const X=wl(g,F),ve=X.height+X.depth,Me=wl(T,F),ze=Me.height+Me.depth,_t=wl(R,F),tr=_t.height+_t.depth;let pt=0,Ht=1;if(S!==null){const Rs=wl(S,F);pt=Rs.height+Rs.depth,Ht=2}const ur=ve+tr+pt,jt=Math.max(0,Math.ceil((t-ur)/(Ht*ze))),Pr=ur+jt*Ht*ze;let Yr=Ys;n&&(Yr=Yr*a.scalingFactor);const Hr=Pr/2-Yr,Gn=.008,yi=[];yi.push({box:new rr(R,{fontFamily:F})}),yi.push(-Gn);const dr=new rr(T,{fontFamily:F});if(S===null)for(let Rs=0;Rs<jt;Rs++)yi.push({box:dr});else{for(let Rs=0;Rs<jt;Rs++)yi.push({box:dr});yi.push(-Gn),yi.push({box:new rr(S,{fontFamily:F})}),yi.push(-Gn);for(let Rs=0;Rs<jt;Rs++)yi.push({box:dr})}yi.push(-Gn),yi.push({box:new rr(g,{fontFamily:F})});let _a="";F==="Size1-Regular"?_a=" delim-size1":F==="Size4-Regular"&&(_a=" delim-size4");const Eo=new ds({bottom:Hr,children:yi},{classes:_a});return new rr(Eo,c($({},l!=null?l:{}),{classes:((f=l==null?void 0:l.classes)!=null?f:"")+" ML__delim-mult"}))}var Su=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),_h=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),pc=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),xh=[0,1.2,1.8,2.4,3];function K0(e,t,n,a){return e===void 0||e==="."?r(n,a.classes):(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),Su.has(e)||pc.has(e)?fc(e,t,!1,n,a):_h.has(e)?wu(e,xh[t],!1,n,a):(console.assert(!1,"Unknown delimiter '"+e+"'"),null))}var wh=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Sh=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],Eh=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function kh(e){return e.type==="small"?"Main-Regular":e.type==="large"?"Size"+e.size+"-Regular":(console.assert(e.type==="stack"),"Size4-Regular")}function Ah(e,t,n,a){const l={"-4":0,"-3":1,0:2}[a.mathstyle.sizeDelta];for(let f=l;f<n.length&&n[f].type!=="stack";f++){const g=wl(e,kh(n[f]));if(g.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let S=g.height+g.depth;if(n[f].type==="small"&&(n[f].mathstyle==="scriptscriptstyle"?S*=Math.max(Ho[Math.max(1,a.size-2)],a.minFontScale):n[f].mathstyle==="scriptstyle"&&(S*=Math.max(Ho[Math.max(1,a.size-1)],a.minFontScale))),S>t)return n[f]}return n[n.length-1]}function Ba(e,t,n,a,l,f){if(!t||t.length===0||t===".")return r(l);t==="<"||t==="\\lt"?t="\\langle":(t===">"||t==="\\gt")&&(t="\\rangle");let g;pc.has(t)?g=wh:Su.has(t)?g=Eh:g=Sh;const S=Ah(z0(t),n,g,l),T=new Hn({parent:l,mathstyle:S.mathstyle},f==null?void 0:f.style);return S.type==="small"?dc(t,T,a,c($({},f),{type:e})):S.type==="large"?fc(t,S.size,a,T,c($({},f),{type:e})):(console.assert(S.type==="stack"),wu(t,n,a,T,c($({},f),{type:e})))}function d(e,t,n,a,l,f){if(t===".")return r(l,f==null?void 0:f.classes);const g=Ys*l.scalingFactor,S=901,T=5/Zs,R=Math.max(n-g,a+g),F=Math.max(R/500*S,2*R-T);return Ba(e,t,F,!0,l,f)}function r(e,t){const n=new rr(null,{classes:" nulldelimiter "+(t!=null?t:""),type:"ignore"});return n.width=e.getRegisterAsEm("nulldelimiterspace"),n.wrap(new Hn({parent:e,mathstyle:"textstyle"}))}var i=class $f extends Bt{constructor(t){var n;super({type:"placeholder",command:"\\placeholder",mode:(n=t==null?void 0:t.mode)!=null?n:"math",style:t==null?void 0:t.style}),this.captureSelection=!0}static fromJson(t){return new $f(t)}toJson(){return super.toJson()}render(t){let n;return this.value=t.placeholderSymbol,typeof t.renderPlaceholder=="function"?n=t.renderPlaceholder(t):n=this.createBox(t),this.caret&&(n.classes+=" ML__placeholder-selected"),n}_serialize(t){return t.skipPlaceholders?"":"\\placeholder{}"}},s=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],o=["cases","dcases","rcases"],u=["align","align*","aligned","gather","gathered","split"],h=["array","subequations","eqnarray"];function m(e){return h.concat(u).concat(o).concat(s).includes(e)}function _(e){return s.includes(e)}function w(e){return o.includes(e)}function E(e){return u.includes(e)}function L(e,t,n){let a=0;for(const R of n)"align"in R&&(a+=1);let l=0;const f=[];for(const R of t){let F=0;for(l=Math.max(l,Math.min(R.length,a));F<R.length;){const X=[],ve=Math.min(R.length,F+a);for(;F<ve;){const Me=R[F];Me.length===0?X.push([new Bt({type:"first",mode:e.mode})]):Me[0].type!=="first"?X.push([new Bt({type:"first",mode:e.mode}),...Me]):(console.assert(!Me.slice(1).some(ze=>ze.type==="first")),X.push(Me)),F+=1}f.push(X)}}f.length>0&&f[f.length-1].length===1&&f[f.length-1][0].length===1&&f[f.length-1][0][0].type==="first"&&f.pop();const g=[];for(const R of f){if(R.length!==l)for(let F=R.length;F<l;F++)R.push([new Bt({type:"first",mode:e.mode}),new i]);g.push(R)}let S=0,T=0;for(const R of g){T=0;for(const F of R){for(const X of F)X.parent=e,X.parentBranch=[S,T];T+=1}S+=1}return e.isDirty=!0,g}var N=class zf extends Bt{constructor(t,n,a,l={}){var f;super({type:"array"}),this.environmentName=t,this.rowGaps=a,l.mathstyleName&&(this.mathstyleName=l.mathstyleName),l.columns&&(l.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=l.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=L(this,n,this.colFormat),l.leftDelim&&(this.leftDelim=l.leftDelim),l.rightDelim&&(this.rightDelim=l.rightDelim),l.arraycolsep!==void 0&&(this.arraycolsep=l.arraycolsep),this.colSeparationType=l.colSeparationType,l.arraystretch!==void 0&&(this.arraystretch=l.arraystretch),this.minColumns=(f=l.minColumns)!=null?f:1}static fromJson(t){return new zf(t.environmentName,t.array,t.rowGaps,t)}toJson(){const t=c($({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(n=>n.map(a=>a.map(l=>l.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(t.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(t.arraycolsep=this.arraycolsep),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}branch(t){var n;if(sa(t))return(n=this.array[t[0]][t[1]])!=null?n:void 0}createBranch(t){var n;return sa(t)?(this.isDirty=!0,(n=this.branch(t))!=null?n:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(t=>!!t.align).length}removeBranch(t){if(qo(t))return super.removeBranch(t);const n=this.branch(t);return this.array[t[0]][t[1]]=void 0,n.forEach(a=>{a.parent=void 0,a.parentBranch=void 0}),console.assert(n[0].type==="first"),n.shift(),this.isDirty=!0,n}get hasChildren(){return this.children.length>0}get children(){const t=[];for(const n of this.array)for(const a of n)if(a)for(const l of a)t.push(...l.children),t.push(l);return[...t,...super.children]}render(t){var n,a,l,f,g,S;const T=new Hn({parent:t,mathstyle:this.mathstyleName},this.style),R=T.getRegisterAsEm("arrayrulewidth"),F=T.getRegisterAsEm("arraycolsep"),X=T.getRegisterAsEm("doublerulesep"),ve=(a=(n=this.arraystretch)!=null?n:T.getRegisterAsNumber("arraystretch"))!=null?a:1;let Me=typeof this.arraycolsep=="number"?this.arraycolsep:F;this.colSeparationType==="small"&&(Me=.2778*(new Hn({parent:t,mathstyle:"scriptstyle"}).scalingFactor/t.scalingFactor));const ze=ve*au,_t=.7*ze,tr=.3*ze;let pt=0;const Ht=[];let ur=0;const jt=this.array.length;for(let Ai=0;Ai<jt;++Ai){const os=this.array[Ai];ur=Math.max(ur,os.length);const Is=new Hn({parent:T,mathstyle:this.mathstyleName},this.style);let ko=_t/Is.scalingFactor,Ao=tr/Is.scalingFactor;const To={cells:[],height:0,depth:0,pos:0};for(const to of os){const pd=(l=Bt.createBox(Is,to,{type:"ignore"}))!=null?l:new rr(null,{type:"ignore"});Ao=Math.max(Ao,pd.depth),ko=Math.max(ko,pd.height),To.cells.push(pd)}let Co=(f=tc(this.rowGaps[Ai]))!=null?f:0;Co>0&&(Co+=tr,Ao=Math.max(Ao,Co),Co=0),Ai<jt-1&&!_(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Ao+=T.getRegisterAsEm("jot")),To.height=ko,To.depth=Ao,pt+=ko,To.pos=pt,pt+=Ao+Co,Ht.push(To)}const Pr=pt/2+Ys,Yr=[];for(let Ai=0;Ai<ur;Ai++){const os=[];for(const Is of Ht){const ko=Is.cells[Ai];ko.depth=Is.depth,ko.height=Is.height,os.push({box:ko,shift:Is.pos-Pr})}os.length>0&&Yr.push(new ds({individualShift:os}))}const Hr=[];let Gn=!1,yi=!1,dr=0,_a=!this.leftDelim;const{colFormat:Eo}=this;for(const Ai of Eo){if("align"in Ai&&dr>=Yr.length)break;if("align"in Ai)Gn?Hr.push(j(2*Me)):(yi||_a)&&Hr.push(j(Me)),Hr.push(new rr(Yr[dr],{classes:"col-align-"+Ai.align})),dr++,Gn=!0,yi=!1,_a=!1;else if("gap"in Ai){if(typeof Ai.gap=="number")Hr.push(j(Ai.gap));else{const os=ne(t,Ht,Pr,Ai.gap);os&&Hr.push(os)}Gn=!1,yi=!1,_a=!1}else if("separator"in Ai){const os=new rr(null,{classes:"vertical-separator"});os.height=pt,os.setStyle("height",pt,"em"),os.setStyle("border-right",`${R}em ${Ai.separator} currentColor`),os.setStyle("vertical-align",-(pt-Pr),"em");let Is=0;yi?Is=X-R:Gn&&(Is=Me-R),os.left=Is,Hr.push(os),Gn=!1,yi=!0,_a=!1}}Gn&&!this.rightDelim&&Hr.push(j(Me));const Na=new rr(Hr,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Na.caret=this.caret),this.bind(t,Na);const Rs=Na.height,xa=Na.depth,oa=this.bind(t,new rr([this.bind(t,d("open",(g=this.leftDelim)!=null?g:".",Rs,xa,T,{isSelected:this.isSelected})),Na,this.bind(t,d("close",(S=this.rightDelim)!=null?S:".",Rs,xa,T,{isSelected:this.isSelected}))],{type:"ord"}));return oa?(oa.setStyle("display","inline-block"),this.caret&&(oa.caret=this.caret),this.bind(t,this.attachSupsub(t,{base:oa}))):null}_serialize(t){var n;const a=[];if(this.environmentName==="lines"?a.push("{\\displaylines"):a.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(a.push("{"),this.colFormat!==void 0)for(const l of this.colFormat)"align"in l&&typeof l.align=="string"?a.push(l.align):"separator"in l&&l.separator==="solid"?a.push("|"):"separator"in l&&l.separator==="dashed"&&a.push(":");a.push("}")}for(let l=0;l<this.array.length;l++){for(let f=0;f<this.array[l].length;f++)f>0&&a.push(" & "),a.push(Bt.serialize(this.array[l][f],t));if(l<this.array.length-1){const f=this.rowGaps[l];f!=null&&f.dimension?a.push(`\\\\[${f.dimension} ${(n=f.unit)!=null?n:"pt"}] `):a.push("\\\\ ")}}return this.environmentName==="lines"?a.push("}"):a.push(`\\end{${this.environmentName}}`),Bn(a)}getCell(t,n){return this.array[t][n]}setCell(t,n,a){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[t][n]!==void 0);for(const f of this.array[t][n])f.parent=void 0,f.parentBranch=void 0;let l=a;(a.length===0||a[0].type!=="first")&&(l=[new Bt({type:"first",mode:this.mode}),...a]),this.array[t][n]=l;for(const f of l)f.parent=this,f.parentBranch=[t,n];this.isDirty=!0}addRowBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));const n=[];for(let a=0;a<this.colCount;a++)n.push(J(this));this.array.splice(t,0,n);for(let a=t;a<this.rowCount;a++)for(let l=0;l<this.colCount;l++){const f=this.array[a][l];if(f)for(const g of f)g.parentBranch=[a,l]}this.isDirty=!0}addRowAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));const n=[];for(let a=0;a<this.colCount;a++)n.push(J(this));this.array.splice(t+1,0,n);for(let a=t+1;a<this.rowCount;a++)for(let l=0;l<this.colCount;l++){const f=this.array[a][l];if(f)for(const g of f)g.parentBranch=[a,l]}this.isDirty=!0}removeRow(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>t);const n=this.array.splice(t,1);for(const a of n)for(const l of a)if(l)for(const f of l)f.parent=void 0,f.parentBranch=void 0;for(let a=t;a<this.rowCount;a++)for(let l=0;l<this.colCount;l++){const f=this.array[a][l];if(f)for(const g of f)g.parentBranch=[a,l]}this.isDirty=!0}addColumnBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const n of this.array)n.splice(t,0,J(this));for(let n=0;n<this.rowCount;n++)for(let a=t;a<this.colCount;a++){const l=this.array[n][a];if(l)for(const f of l)f.parentBranch=[n,a]}this.isDirty=!0}addColumnAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const n of this.array)n.splice(t+1,0,J(this));for(let n=0;n<this.rowCount;n++)for(let a=t+1;a<this.colCount;a++){const l=this.array[n][a];if(l)for(const f of l)f.parentBranch=[n,a]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>t);for(const n of this.array){const a=n.splice(t,1);for(const l of a)if(l)for(const f of l)f.parent=void 0,f.parentBranch=void 0}for(let n=0;n<this.rowCount;n++)for(let a=t;a<this.colCount;a++){const l=this.array[n][a];if(l)for(const f of l)f.parentBranch=[n,a]}this.isDirty=!0}get cells(){const t=[];for(const n of this.array)for(const a of n)a&&t.push(a.filter(l=>l.type!=="first"));return t}};function J(e){const t=new Bt({type:"first",mode:e.mode});t.parent=e;const n=new i;return n.parent=e,[t,n]}function j(e){const t=new rr(null,{classes:"arraycolsep"});return t.width=e,t}function ne(e,t,n,a){if(!a)return null;const l=[];for(const f of t){const g=Bt.createBox(e,a,{type:"ignore"});g&&(g.depth=f.depth,g.height=f.height,l.push({box:g,shift:f.pos-n}))}return new ds({individualShift:l}).wrap(e)}var de=class Kf extends Bt{constructor(t){super({mode:t.mode,command:t.command,style:t.style,body:t.body,type:"box"}),this.framecolor=t.framecolor,this.backgroundcolor=t.backgroundcolor,this.padding=t.padding,this.offset=t.offset,this.border=t.border}static fromJson(t){return new Kf(t)}toJson(){return c($({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(t){var n,a,l,f;const g=Bt.createBox(t,this.body,{type:"lift"});if(!g)return null;const S=t.toEm((n=this.offset)!=null?n:{dimension:0});g.depth+=S,g.setStyle("display","inline-block"),g.setStyle("position","relative"),g.setStyle("height",Math.floor(100*g.height+g.depth)/100,"em"),g.setStyle("vertical-align",-Math.floor(100*g.height)/100,"em");const T=new Hn({parent:t},this.style),R=T.toEm((a=this.padding)!=null?a:{register:"fboxsep"}),F=new rr(null,{classes:"ML__box"});F.height=g.height+R,F.depth=g.depth+R,F.setStyle("box-sizing","border-box"),F.setStyle("position","absolute"),F.setStyle("top",-R+.3,"em"),F.setStyle("left",0),F.setStyle("height",F.height+F.depth,"em"),F.setStyle("width","100%"),this.backgroundcolor&&F.setStyle("background-color",(l=T.toColor(this.backgroundcolor))!=null?l:"transparent"),this.framecolor&&F.setStyle("border",`${T.getRegisterAsEm("fboxrule",2)}em solid ${(f=T.toColor(this.framecolor))!=null?f:"black"}`),this.border&&F.setStyle("border",this.border);const X=new rr([F,g],{type:"lift"});return X.setStyle("display","inline-block"),X.setStyle("position","relative"),X.setStyle("line-height",0),X.height=g.height+R+(S>0?S:0),X.depth=g.depth+R+(S<0?-S:0),X.setStyle("padding-left",R,"em"),X.setStyle("padding-right",R,"em"),X.setStyle("height",Math.floor(100*(g.height+g.depth+2*R+Math.abs(S)))/100,"em"),X.setStyle("margin-top",-R,"em"),X.setStyle("top",Math.floor(100*(g.depth-g.height+2*R-S))/100,"em"),X.setStyle("vertical-align",Math.floor(100*(g.depth+2*R))/100,"em"),this.caret&&(X.caret=this.caret),this.attachSupsub(t,{base:X})}_serialize(t){return t.skipStyles?Bn([this.bodyToLatex(t),this.supsubToLatex(t)]):super._serialize(t)}},$e=class Uf extends Bt{constructor(t,n){var a;super({type:"composition",mode:(a=n==null?void 0:n.mode)!=null?a:"math",value:t})}static fromJson(t){return new Uf(t.value,t)}toJson(){return super.toJson()}get computedStyle(){return{}}render(t){const n=new rr(this.value,{classes:"ML__composition",type:"composition"});return this.bind(t,n),this.caret&&(n.caret=this.caret),n}_serialize(t){return""}},ct=class Hf extends Bt{constructor(t){super({type:"error",value:t,command:t,mode:"math"}),this.verbatimLatex=t}static fromJson(t){return new Hf(t.command)}toJson(){return super.toJson()}render(t){const n=this.createBox(t,{classes:"ML__error"});return this.caret&&(n.caret=this.caret),n}},ht=class Gf extends Bt{constructor(t,n,a){super({type:"group",mode:n,style:a}),this.body=t,this.boxType=t.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,t&&t.length===1&&t[0].command===","&&(this.captureSelection=!0)}static fromJson(t){return new Gf(t.body,t.mode,t.style)}render(t){const n=Bt.createBox(t,this.body,{type:this.boxType});return n?(this.caret&&(n.caret=this.caret),this.bind(t,n)):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=qe(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,t):`{${this.bodyToLatex(t)}}`}},At=class Vf extends Bt{constructor(t,n,a){super({type:"leftright",style:a.style,displayContainsHighlight:!0}),this.variant=t,this.body=n,this.leftDelim=a.leftDelim,this.rightDelim=a.rightDelim}static fromJson(t){var n;return new Vf((n=t.variant)!=null?n:"",t.body,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}_serialize(t){var n,a;const l=this.matchingRightDelim();return this.variant==="left...right"?Bn(["\\left",(n=this.leftDelim)!=null?n:".",this.bodyToLatex(t),"\\right",l]):this.variant==="mleft...mright"?Bn(["\\mleft",(a=this.leftDelim)!=null?a:".",this.bodyToLatex(t),"\\mright",l]):Bn([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(t),l])}matchingRightDelim(){var t,n;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const a=(t=this.leftDelim)!=null?t:".";return(n=$0[a])!=null?n:a}render(t){var n,a;const l=new Hn({parent:t},this.style);console.assert(this.body!==void 0);const f=new Hn({parent:t,mathstyle:"textstyle"},this.style),g=(n=Bt.createBox(l,this.body,{type:"inner"}))!=null?n:new rr(null,{type:"inner"}),S=g.height/f.scalingFactor,T=g.depth/f.scalingFactor,R=[];if(this.leftDelim&&R.push(this.bind(f,d("open",this.leftDelim,S,T,f,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),g&&(yt(g.children,this,l,S,T),R.push(g)),this.rightDelim){let Me=this.containsCaret?" ML__contains-caret":"",ze=this.rightDelim;ze==="?"&&(l.smartFence?(ze=this.matchingRightDelim(),Me+=" ML__smart-fence__close"):ze="."),R.push(this.bind(f,d("close",ze,S,T,f,{isSelected:this.isSelected,classes:Me+" ML__close",mode:this.mode,style:this.style})))}let F=this.variant==="mleft...mright";const X=this.leftSibling;X&&(!F&&X.isFunction&&(F=!0),!F&&X.type==="subsup"&&((a=X.leftSibling)!=null&&a.isFunction)&&(F=!0));const ve=new rr(R,{type:F?"close":"inner",classes:"left-right"});return ve.setStyle("margin-top",`${-g.depth}em`),ve.setStyle("height",`${g.height+g.depth}em`),this.caret&&(ve.caret=this.caret),this.bind(l,ve.wrap(l))}};function yt(e,t,n,a,l){if(e)for(let f=0;f<e.length;f++){const g=e[f];g.type==="middle"?(e[f]=t.bind(n,d("inner",g.value,a,l,n,{isSelected:t.isSelected})),e[f].caret=g.caret,e[f].isSelected=g.isSelected,e[f].cssId=g.cssId,e[f].htmlData=g.htmlData,e[f].htmlStyle=g.htmlStyle,e[f].attributes=g.attributes,e[f].cssProperties=g.cssProperties):g.children&&yt(g.children,t,n,a,l)}}var Qt=class Wf extends Bt{constructor(t,n){var a;super({type:"macro",command:t,style:n.style}),this.body=n.body,n.captureSelection===void 0?n.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=n.captureSelection,this.macroArgs=n.args,this.expand=(a=n.expand)!=null?a:!1}static fromJson(t){return new Wf(t.command,t)}toJson(){const t=super.toJson();return this.expand&&(t.expand=!0),this.captureSelection!==void 0&&(t.captureSelection=this.captureSelection),this.macroArgs&&(t.args=this.macroArgs),t}_serialize(t){var n;return t.expandMacro&&this.expand?this.bodyToLatex(t):this.command+((n=this.macroArgs)!=null?n:"")}render(t){const n=Bt.createBox(t,this.body);return n?(this.caret&&(n.caret=this.caret),this.bind(t,n)):null}},zt=class jf extends Bt{constructor(){super({type:"macro-argument"})}static fromJson(t){return new jf}toJson(){return super.toJson()}_serialize(t){return""}render(t){return null}},pr=class qf extends Bt{constructor(t,n,a=!1,l,f){var g;super({type:"prompt",mode:(g=f==null?void 0:f.mode)!=null?g:"math",style:f==null?void 0:f.style,command:"\\placeholder"}),this.body=l,this.correctness=n,this.placeholderId=t,this.locked=a,this.captureSelection=this.locked}static fromJson(t){return new qf(t.placeholderId,t.correctness,t.locked,t.body,t)}toJson(){const t=super.toJson();return this.placeholderId&&(t.placeholderId=this.placeholderId),this.body||delete t.body,this.body&&(t.body=this.body.filter(n=>n.type!=="first").map(n=>n.toJson())),this.correctness&&(t.correctness=this.correctness),t.locked=this.locked,t}render(t){const n=new Hn({parent:t}),a=n.getRegisterAsEm("fboxsep"),l=a,f=a,g=Bt.createBox(t,this.body);if(!g)return null;g.height||(g.height=n.metrics.xHeight),g.setStyle("vertical-align",-g.height,"em"),this.correctness==="correct"?g.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&g.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const S=new rr(g,{type:"ord"});S.setStyle("display","inline-block"),S.setStyle("height",g.height+g.depth,"em"),S.setStyle("vertical-align",-f,"em");let T="ML__prompt ";this.locked?T+=" ML__lockedPromptBox ":T+=" ML__editablePromptBox ",this.correctness==="correct"?T+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(T+=" ML__incorrectPromptBox "),this.containsCaret&&(T+=" ML__focusedPromptBox ");const R=new rr(null,{classes:T,attributes:{part:"prompt"}});R.height=S.height+f,R.depth=S.depth+f,R.width=S.width+2*l,R.setStyle("box-sizing","border-box"),R.setStyle("position","absolute"),R.setStyle("height",S.height+S.depth+2*f,"em"),l===0&&R.setStyle("width","100%"),l!==0&&(R.setStyle("width",`calc(100% + ${2*l}em)`),R.setStyle("top",a,"em"),R.setStyle("left",-l,"em")),(!this.body||this.body.length===1)&&(R.width=3*l,R.setStyle("width",`calc(100% + ${3*l}em)`),R.setStyle("left",-1.5*l,"em"));let F="";this.correctness==="incorrect"&&(F+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),F&&(R.svgOverlay=F);const X=new rr([R,S],{classes:"ML__prompt-atom"});return X.setStyle("position","relative"),X.setStyle("display","inline-block"),X.setStyle("line-height",0),X.height=S.height+f+.2,X.depth=S.depth+f,X.left=l,X.right=l,X.setStyle("height",S.height+f,"em"),X.setStyle("top",S.depth-S.height,"em"),X.setStyle("vertical-align",S.depth+f,"em"),X.setStyle("margin-left",.5,"em"),X.setStyle("margin-right",.5,"em"),this.caret&&(X.caret=this.caret),this.bind(n,this.attachSupsub(t,{base:X}))}_serialize(t){var n;const a=(n=this.bodyToLatex(t))!=null?n:"";if(t.skipPlaceholders)return a;let l="\\placeholder";return this.placeholderId&&(l+=`[${this.placeholderId}]`),this.correctness==="correct"?l+="[correct]":this.correctness==="incorrect"&&(l+="[incorrect]"),this.locked&&(l+="[locked]"),Oi(l,a)}},Or=class Zf extends Bt{constructor(t){super({type:"subsup",style:t==null?void 0:t.style}),this.subsupPlacement="auto"}static fromJson(t){const n=new Zf(t);for(const a of Tl)t[a]&&n.setChildren(t[a],a);return n}render(t){var n;const a=new Hn({parent:t,isPhantom:!0}),l=this.leftSibling,f=(n=l.render(a))!=null?n:new rr(null),g=new rr(null);return g.height=f.height,g.depth=f.depth,this.attachSupsub(t,{base:g,isCharacterBox:l.isCharacterBox(),type:"ignore"})}_serialize(t){return this.supsubToLatex(t)}};function Zt(e){return e?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(e):!1}var mr=class{constructor(e,t,n){this.errors=[],this.index=0,this.endCount=0;var a,l,f,g;n!=null||(n={}),this.tokens=e,this.context=t instanceof Hn&&!(n!=null&&n.parseMode)&&!n.mathstyle?t:new Hn({from:t,mathstyle:n.mathstyle},n.style),this.args=(a=n.args)!=null?a:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(l=n.style)!=null?l:{},parseMode:(f=n.parseMode)!=null?f:"math",mathstyle:(g=n.mathstyle)!=null?g:"displaystyle",tabular:!1}}beginContext(e){var t,n,a;const l=this.parsingContext,f={parent:l,mathlist:[],style:$({},l.style),parseMode:(t=e==null?void 0:e.mode)!=null?t:l.parseMode,mathstyle:(n=e==null?void 0:e.mathstyle)!=null?n:l.mathstyle,tabular:(a=e==null?void 0:e.tabular)!=null?a:!1};this.parsingContext=f}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push($({before:Wo(this.tokens.slice(this.index,this.index+10)),after:Wo(this.tokens.slice(Math.max(0,this.index-10),this.index))},e))}get mathlist(){return this.parsingContext.mathlist}set mathlist(e){this.parsingContext.mathlist=e}get parseMode(){return this.parsingContext.parseMode}set parseMode(e){this.parsingContext.parseMode=e}get tabularMode(){return this.parsingContext.tabular}get style(){let e=this.parsingContext;for(;e;){if(e.style)return $({},e.style);e=e.parent}return{}}set style(e){this.parsingContext.style=e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(e){return this.tokens[this.index]===e?(this.index++,!0):!1}lastSubsupAtom(){let e;return this.mathlist.length>0&&(e=this.mathlist[this.mathlist.length-1],e.type==="subsup"||e.subsupPlacement!==void 0)||(e=new Or({style:this.style}),this.mathlist.push(e)),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var e;const{index:t}=this;if(t<this.tokens.length&&this.tokens[t].startsWith("\\")){const n=qe(this.tokens[t],this.parseMode);return!n||n.definitionType==="symbol"||n.ifMode&&!n.ifMode.includes(this.parseMode)?!1:(e=n.infix)!=null?e:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const e=this.peek();return e!=="\\\\"&&e!=="\\cr"&&e!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var e;const t=(e=this.args)==null?void 0:e.call(this,"?");return t?un(t,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new i({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(e){let t=this.tokens[this.index];for(;t&&t!==e;)t=this.tokens[++this.index];t===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(e){const t=this.index;let n=this.end(),a="";for(;!n;){const f=this.get();Zt(f)?(a+=f,n=this.end()||a.length>=e.length):n=!0}const l=e.toUpperCase()===a.toUpperCase();return l||(this.index=t),l}scanString(){let e="";for(;!this.end();){const t=this.peek();if(t==="]")return e;if(t==="<space>")e+=" ";else if(t.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=t.substring(1);else if(Zt(t))e+=t;else return e;this.next()}return e}scanBalancedString(){let e="",t=this.end(),n=1;for(;!t;){const a=this.get();a==="<space>"?e+=" ":a==="<{>"?(e+="{",n+=1):a==="<}>"?(n-=1,n>0?e+="}":this.index-=1):a==="<$>"?e+="$":a==="<$$>"?e+="$$":e+=a,t=n===0||this.end()}return e}scanLiteralGroup(){var e;if(!this.match("<{>"))return"";let t="",n=1;for(;n>0&&!this.end();){const a=this.get();a==="<}>"?(n-=1,n>0&&(t+="}")):a==="<{>"?(n+=1,t+="{"):(/\\[a-zA-Z]+$/.test(t)&&/^[a-zA-Z]/.test(a)&&(t+=" "),t+=(e={"<space>":" ","<$$>":"$$","<$>":"$"}[a])!=null?e:a)}return t}scanNumber(e=!0){var t,n;let a=!1,l=this.peek();for(;l==="<space>"||l==="+"||l==="-";)this.get(),l==="-"&&(a=!a),l=this.peek();e=!!e;let f=10,g=/\d/;if(this.match("'"))f=8,g=/[0-7]/,e=!0;else if(this.match('"'))f=16,g=/[\dA-F]/,e=!0;else if(this.match("x"))f=16,g=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return l=this.get(),l?l.length===2&&l.startsWith("\\")?{number:(a?-1:1)*((t=l.codePointAt(1))!=null?t:0),base:"alpha"}:{number:(a?-1:1)*((n=l.codePointAt(0))!=null?n:0),base:"alpha"}:null;let S="";for(;this.hasPattern(g);)S+=this.get();if(!e&&(this.match(".")||this.match(",")))for(S+=".";this.hasPattern(g);)S+=this.get();const T=e?Number.parseInt(S,f):Number.parseFloat(S);return Number.isNaN(T)?null:{number:a?-T:T,base:f===16?"hexadecimal":f===8?"octal":"decimal"}}scanRegister(){var e;const t=this.index,n=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return n;let a=!1;if(n===null)for(;;){const f=this.peek();if(f==="-")a=!a;else if(f!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const f=this.get();return f.startsWith("\\")?n?{register:f,global:!0,factor:(a?-1:1)*n.number}:a?{register:f,global:!0,factor:-1}:{register:f,global:!0}:(this.index=t,null)}let l=this.get();return l!=null&&l.startsWith("\\")?(l=l.substring(1),this.context.registers[l]?!a||n!==null?{register:l,factor:(a?-1:1)*((e=n==null?void 0:n.number)!=null?e:1)}:{register:l}:(this.index=t,null)):(this.index=t,null)}scanValue(){const e=this.scanRegister();if(e)return e;const t=this.index,n=this.scanGlueOrDimen();if(n&&("unit"in n||"glue"in n&&"unit"in n.glue))return n;this.index=t;const a=this.scanNumber();if(a)return a;if(this.end()||!Zt(this.peek()))return null;const l=this.scanString();return l.length>0?{string:l}:null}scanDimen(){const e=this.scanNumber(!1);if(e===null)return null;const t=e.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let n;return this.matchKeyword("pt")?n="pt":this.matchKeyword("mm")?n="mm":this.matchKeyword("cm")?n="cm":this.matchKeyword("ex")?n="ex":this.matchKeyword("px")?n="px":this.matchKeyword("em")?n="em":this.matchKeyword("bp")?n="bp":this.matchKeyword("dd")?n="dd":this.matchKeyword("pc")?n="pc":this.matchKeyword("in")?n="in":this.matchKeyword("mu")&&(n="mu"),n?{dimension:t,unit:n}:{dimension:t}}scanGlueOrDimen(){const e=this.scanDimen();if(e===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;const t={glue:e};if(this.matchKeyword("plus")){const n=this.scanDimen();if(n)t.grow=n;else return t}if(this.skipWhitespace(),this.match("\\relax"))return t;if(this.skipWhitespace(),this.matchKeyword("minus")){const n=this.scanDimen();if(n)t.shrink=n;else return t}return!t.grow&&!t.shrink?e:t}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const t=this.get();t==="c"||t==="r"||t==="l"?e.push({align:t}):t==="|"?e.push({separator:"solid"}):t===":"?e.push({separator:"dashed"}):t==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),e.push({gap:this.scan(n=>n==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return e}scanModeSet(){let e;if(this.match("\\(")&&(e="textstyle"),!e&&this.match("\\[")&&(e="displaystyle"),!e)return null;this.beginContext({mode:"math",mathstyle:e});const t=this.scan(n=>n===(e==="displaystyle"?"\\]":"\\)"));return this.match(e==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const t=this.scan(n=>n===e);return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanEnvironment(){if(!this.match("\\begin"))return null;const e=this.scanArgument("string");if(!e)return null;const t=Be(e);if(!t)return this.onError({code:"unknown-environment",arg:e}),null;const n=[];if(t.params)for(const S of t.params)if(S.isOptional)n.push(this.scanOptionalArgument(S.type));else{const T=this.scanArgument(S.type);T||this.onError({code:"missing-argument",arg:e}),n.push(T)}this.beginContext({tabular:t.tabular});const a=[],l=[];let f=[],g=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),g=!0),!g&&this.match("\\end")&&(this.scanArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),g=!0),!g)if(this.matchColumnSeparator())f.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){f.push(this.mathlist),this.mathlist=[];let S=null;this.skipWhitespace(),this.match("[")&&(S=this.scanDimen(),this.skipWhitespace(),this.match("]")),l.push(S!=null?S:{dimension:0}),a.push(f),f=[]}else this.mathlist.push(...this.scan(S=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(S)));while(!g);return f.push(this.mathlist),f.length>0&&a.push(f),this.endContext(),t.createAtom(e,a,l,n)}scanExpression(){const e=this.mathlist;if(this.mathlist=[],this.parseExpression()){const t=this.mathlist;return this.mathlist=e,t}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=g=>g==="<}>");let t="",n=null,a=[],l=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!t?(t=this.get(),n=qe(t,"math"),n&&(a=this.scanArguments(n)[1]),l=this.mathlist,this.mathlist=[]):this.parseExpression();let f;return t?(console.assert(!!n),a.unshift(this.mathlist),l&&a.unshift(l),f=[n.createAtom({command:t,args:a,style:this.style,mode:this.parseMode})]):f=this.mathlist,this.endContext(),f}scanGroup(){const e=this.index;if(!this.match("<{>"))return null;const t=this.scan(a=>a==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const n=new ht(t,this.parseMode,this.style);return n.verbatimLatex=Wo(this.tokens.slice(e,this.index)),n}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let e=1;for(;!this.end()&&e!==0;)this.match("(")&&(e+=1),this.match(")")&&(e-=1),e!==0&&this.parseExpression();const t=new At("",this.mathlist,{leftDelim:"(",rightDelim:e===0?")":"?"});return this.endContext(),t}scanDelim(){this.skipWhitespace();const e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!Zt(e)&&!e.startsWith("\\"))return null;this.next();const t=qe(e,"math");return t?t.definitionType==="function"&&t.ifMode&&!t.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):t.definitionType==="symbol"&&(t.type==="mopen"||t.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:(this.onError({code:"unexpected-delimiter",arg:e}),null):(this.onError({code:"unknown-command",arg:e}),null)}scanLeftRight(){var e;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new ct("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new ct("\\mright");let t="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;t="\\mright"}const n=this.scanDelim();if(!n)return this.onError({code:"unexpected-delimiter"}),new ct(t==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(t);)this.parseExpression();const a=this.mathlist;this.endContext();const l=(e=this.scanDelim())!=null?e:".";return new At(t==="\\right"?"left...right":"mleft...mright",a,{leftDelim:n,rightDelim:l,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let e=this.peek();if(e!=="^"&&e!=="_"&&e!=="'")return!1;const t=this.lastSubsupAtom();for(;e==="^"||e==="_"||e==="'";)this.match("'")?this.match("'")?t.addChild(new Bt({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):t.addChild(new Bt({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&t.addChildren(je(this.scanArgument("expression")),e==="_"?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const e=this.match("\\limits"),t=!e&&this.match("\\nolimits"),n=!t&&!e&&this.match("\\displaylimits");if(!e&&!t&&!n)return!1;const a=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return a===null?!1:(a.explicitSubsupPlacement=!0,e&&(a.subsupPlacement="over-under"),t&&(a.subsupPlacement="adjacent"),n&&(a.subsupPlacement="auto"),!0)}scanArguments(e){if(!(e!=null&&e.params))return[void 0,[]];let t;const n=[];let a=e.infix?2:0;for(;a<e.params.length;){const l=e.params[a];l.type==="rest"?n.push(this.scan(f=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(f))):l.isOptional?n.push(this.scanOptionalArgument(l.type)):l.type.endsWith("*")?t=l.type.slice(0,-1):n.push(this.scanArgument(l.type)),a+=1}return[t,n]}scanSymbolOrLiteral(){const e=this.peek();if(!e)return null;this.next();let t;if(Zt(e)){const n=Xs.createAtom(this.parseMode,e,$({},this.style));return n?[n]:null}if(t=this.scanMacro(e),t)return[t];if(e.startsWith("\\")){const n=qe(e,this.parseMode);if(!n)return this.onError({code:"unknown-command",arg:e}),[new ct(e)];if(n.definitionType==="symbol"){const a=$({},this.style);n.variant&&(a.variant=n.variant),t=new Bt({type:n.type,command:e,style:a,value:String.fromCodePoint(n.codepoint),mode:this.parseMode,verbatimLatex:e})}else{if(n.applyMode||n.applyStyle||n.infix)return this.onError({code:"invalid-command",arg:e}),[new ct(e)];n.createAtom&&(t=n.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return t?[t]:null}scanArgument(e){var t;this.skipFiller();const n=this.parseMode;if(e==="auto"&&(e=n),!this.match("<{>")){if(e==="string")return this.scanString();if(e==="value")return this.scanValue();if(e==="delim")return(t=this.scanDelim())!=null?t:".";if(e==="expression")return this.scanExpression();if(e==="math"){e!==n&&this.beginContext({mode:"math"});const l=this.scanSymbolOrLiteral();return e!==n&&this.endContext(),l}if(e==="text"){e!==n&&this.beginContext({mode:"text"});const l=this.scanSymbolOrLiteral();return e!==n&&this.endContext(),l}return e==="balanced-string"||console.assert(!1),null}if(e==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const l=this.mathlist;return this.endContext(),{group:l}}if(e==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const l=this.mathlist;return this.endContext(),{group:l}}let a=null;if(e==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const l=this.mathlist;return this.endContext(),{group:l}}return e==="string"?a=this.scanString():e==="balanced-string"?a=this.scanBalancedString():e==="colspec"?a=this.scanColspec():e==="value"&&(a=this.scanValue()),this.skipUntilToken("<}>"),a}scanOptionalArgument(e){if(e=e==="auto"?this.parseMode:e,this.skipFiller(),!this.match("["))return null;let t=null;for(;!this.end()&&!this.match("]");)if(e==="string")t=this.scanString();else if(e==="value")t=this.scanValue();else if(e==="colspec")t=this.scanColspec();else if(e==="bbox"){const n={},a=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const l of a){const f=l.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(f)n.padding={dimension:parseInt(f[1]),unit:f[2]};else{const g=l.match(/^\s*border\s*:\s*(.*)/);g?n.border=g[1]:n.backgroundcolor={string:l}}}t=n}else e==="math"&&(this.beginContext({mode:"math"}),t=this.mathlist.concat(this.scan(n=>n==="]")),this.endContext());return t}scanSymbolOrCommand(e){var t,n,a;if(e==="\\placeholder"){const S=this.scanOptionalArgument("string"),T=this.scanOptionalArgument("math"),R=Bt.serialize(T,{defaultMode:"math"});let F=[],X;!X&&R==="correct"?X="correct":!X&&R==="incorrect"?X="incorrect":R!==""&&(F=T);const ve=this.scanOptionalArgument("string")==="locked",Me=this.scanArgument("auto");let ze;return Me&&Array.isArray(Me)&&Me.length>0?ze=Me:Me&&typeof Me=="object"&&"group"in Me?ze=Me.group:ze=F,S?[new pr(S,X,ve,ze!=null?ze:F,{mode:this.parseMode,style:this.style})]:[new i({mode:this.parseMode,style:this.style})]}if(e==="\\renewcommand"||e==="\\newcommand"||e==="\\providecommand"||e==="\\def"){const S=this.index,T=this.scanLiteralGroup()||this.next();if(!T)return null;if(this.context.registers[T.substring(1)]){const R=this.scanArgument("string");R!==null&&(this.context.registers[T.substring(1)]=R);const F=Bn([e,Wo(this.tokens.slice(S,this.index))]);return[new Bt({type:"text",value:"",verbatimLatex:F})]}}let l=this.scanMacro(e);if(l)return[l];const f=qe(e,this.parseMode);if(!f)return this.parseMode==="text"?(/[a-zA-Z]/.test((t=this.peek())!=null?t:"")&&(e+=" "),[...e].map(S=>new Bt({type:"text",value:S,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:e}),[new ct(e)]);const g=this.index;if(f.definitionType==="symbol"){const S=$({},this.style);f.variant&&(S.variant=f.variant),l=new Bt({type:f.type,command:e,style:S,value:String.fromCodePoint(f.codepoint),mode:this.parseMode})}else{if(f.ifMode&&!f.ifMode.includes(this.parseMode))return[];const S=this.parseMode;f.applyMode&&(this.parseMode=f.applyMode);let T,R=[];if(f.parse?R=f.parse(this):[T,R]=this.scanArguments(f),this.parseMode=S,f.applyMode&&!f.applyStyle&&!f.createAtom)return je(R[0]);if(f.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if(typeof f.createAtom=="function")l=f.createAtom({command:e,args:R,style:this.style,mode:this.parseMode}),T&&(l.body=je(this.scanArgument(T)));else if(typeof f.applyStyle=="function"){const F=$($({},this.style),f.applyStyle(e,R,this.context)),X=this.parseMode;if(f.applyMode&&(this.parseMode=f.applyMode),T){const ve=this.style;this.style=F;const Me=this.scanArgument(T);return this.style=ve,this.parseMode=X,je(Me)}this.style=F}else l=new Bt({type:"mord",command:(n=f.command)!=null?n:e,style:$({},this.style),value:e,mode:(a=f.applyMode)!=null?a:this.parseMode})}if(!l)return null;if(l instanceof Bt&&l.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){const S=Bn([e,Wo(this.tokens.slice(g,this.index))]);S&&(l.verbatimLatex=S)}if(l.verbatimLatex===null&&(l.verbatimLatex=void 0),l.isFunction&&this.smartFence){const S=this.scanSmartFence();if(S)return[l,S]}return[l]}scanSymbolCommandOrLiteral(){const e=this.get();if(!e)return null;if(Zt(e)){const t=Xs.createAtom(this.parseMode,e,$({},this.style));if(!t)return null;if(t.isFunction&&this.smartFence){const n=this.scanSmartFence();if(n)return[t,n]}return[t]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):e==="<space>"?this.parseMode==="text"?[new Cl(" "," ",this.style)]:null:(e==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var t;const n=this.context.getMacro(e);if(!n)return null;const a=this.index,l=n.args,f={"?":(t=this.args)==null?void 0:t.call(this,"?")};for(let g=1;g<=l;g++){let S=this.scanLiteralGroup();if(!S){const T=this.index;this.scanExpression(),S=Wo(this.tokens.slice(T,this.index))}f[g]=S}return new Qt(e,{expand:n.expand,captureSelection:n.captureSelection,args:a===this.index?null:Wo(this.tokens.slice(a,this.index)),style:this.parsingContext.style,body:un(n.def,{context:this.context,parseMode:this.parseMode,args:g=>f[g],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var e,t,n,a;let l=(a=(n=(t=(e=this.scanEnvironment())!=null?e:this.scanModeShift())!=null?t:this.scanModeSet())!=null?n:this.scanGroup())!=null?a:this.scanLeftRight();if(l===null){if(this.parseSupSub()||this.parseLimits())return!0;l=this.scanSymbolCommandOrLiteral()}return l?(Array.isArray(l)?this.mathlist.push(...l):this.mathlist.push(l),!0):!1}};function un(e,t){var n,a,l,f;const g=(n=t==null?void 0:t.args)!=null?n:void 0,S=new mr(El(e,g),t==null?void 0:t.context,{args:g,mathstyle:(a=t==null?void 0:t.mathstyle)!=null?a:"displaystyle",parseMode:(l=t==null?void 0:t.parseMode)!=null?l:"math",style:(f=t==null?void 0:t.style)!=null?f:{}}),T=[];for(;!S.end();)T.push(...S.scan(()=>!1));return T}function Wr(e,t){var n;const a=new mr(El(e,null),t==null?void 0:t.context,{mathstyle:"displaystyle",parseMode:(n=t==null?void 0:t.parseMode)!=null?n:"math"});for(;!a.end();)a.scan();return a.errors}var Cn=class Yf extends Bt{constructor(t,n){super({type:"chem"},{command:t,mode:"math"});const a=Br.go(kt.go(n,t==="\\pu"?"pu":"ce"),!1);this.body=un(a),this._verbatimLatex=t+"{"+n+"}",this.arg=n,this.captureSelection=!0}static fromJson(t){return new Yf(t.command,t.arg)}set verbatimLatex(t){}get verbatimLatex(){return this._verbatimLatex}toJson(){return c($({},super.toJson()),{arg:this.arg})}render(t){const n=Bt.createBox(t,this.body,{type:"inner"});return this.caret&&(n.caret=this.caret),this.bind(t,n)}_serialize(t){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};Ke(["ce","pu"],"{chemformula:balanced-string}",{createAtom:e=>{var t;return new Cn(e.command,(t=e.args[0])!=null?t:"")}});var kt={go:function(e,t){if(!e)return[];t===void 0&&(t="ce");var n="0",a={};a.parenthesisLevel=0,e=e.replace(/\n/g," "),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),e=e.replace(/[\u2026]/g,"...");for(var l,f=10,g=[];;){l!==e?(f=10,l=e):f--;var S=kt.stateMachines[t],T=S.transitions[n]||S.transitions["*"];e:for(var R=0;R<T.length;R++){var F=kt.patterns.match_(T[R].pattern,e);if(F){for(var X=T[R].task,ve=0;ve<X.action_.length;ve++){var Me;if(S.actions[X.action_[ve].type_])Me=S.actions[X.action_[ve].type_](a,F.match_,X.action_[ve].option);else if(kt.actions[X.action_[ve].type_])Me=kt.actions[X.action_[ve].type_](a,F.match_,X.action_[ve].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+X.action_[ve].type_+")"];kt.concatArray(g,Me)}if(n=X.nextState||n,e.length>0){if(X.revisit||(e=F.remainder),!X.toContinue)break e}else return g}}if(f<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Object.prototype.toString.call(t)==="[object Array]")for(var n=0;n<t.length;n++)e.push(t[n]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=kt.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var n=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return n?{match_:n[0],remainder:e.substr(n[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return kt.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return kt.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return kt.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return kt.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return kt.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return kt.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return kt.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return kt.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return kt.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return kt.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return kt.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return kt.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return kt.patterns.findObserveGroups(e,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return kt.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return kt.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return kt.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return kt.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return kt.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return kt.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return kt.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return kt.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return kt.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return kt.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return kt.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return kt.patterns.findObserveGroups(e,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var t;if(t=e.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),t)return{match_:t[0],remainder:e.substr(t[0].length)};var n=kt.patterns.findObserveGroups(e,"","$","$","");return n&&(t=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),t)?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,n,a,l,f,g,S,T,R){var F=function(pt,Ht){if(typeof Ht=="string")return pt.indexOf(Ht)!==0?null:Ht;var ur=pt.match(Ht);return ur?ur[0]:null},X=function(pt,Ht,ur){for(var jt=0;Ht<pt.length;){var Pr=pt.charAt(Ht),Yr=F(pt.substr(Ht),ur);if(Yr!==null&&jt===0)return{endMatchBegin:Ht,endMatchEnd:Ht+Yr.length};if(Pr==="{")jt++;else if(Pr==="}"){if(jt===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];jt--}Ht++}return jt>0,null},ve=F(e,t);if(ve===null||(e=e.substr(ve.length),ve=F(e,n),ve===null))return null;var Me=X(e,ve.length,a||l);if(Me===null)return null;var ze=e.substring(0,a?Me.endMatchEnd:Me.endMatchBegin);if(f||g){var _t=this.findObserveGroups(e.substr(Me.endMatchEnd),f,g,S,T);if(_t===null)return null;var tr=[ze,_t.match_];return{match_:R?tr.join(""):tr,remainder:_t.remainder}}else return{match_:ze,remainder:e.substr(Me.endMatchEnd)}},match_:function(e,t){var n=kt.patterns.patterns[e];if(n===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if(typeof n=="function")return kt.patterns.patterns[e](t);var a=t.match(n);if(a){var l;return a[2]?l=[a[1],a[2]]:a[1]?l=a[1]:l=a[0],{match_:l,remainder:t.substr(a[0].length)}}return null}},actions:{"a=":function(e,t){e.a=(e.a||"")+t},"b=":function(e,t){e.b=(e.b||"")+t},"p=":function(e,t){e.p=(e.p||"")+t},"o=":function(e,t){e.o=(e.o||"")+t},"q=":function(e,t){e.q=(e.q||"")+t},"d=":function(e,t){e.d=(e.d||"")+t},"rm=":function(e,t){e.rm=(e.rm||"")+t},"text=":function(e,t){e.text_=(e.text_||"")+t},insert:function(e,t,n){return{type_:n}},"insert+p1":function(e,t,n){return{type_:n,p1:t}},"insert+p1+p2":function(e,t,n){return{type_:n,p1:t[0],p2:t[1]}},copy:function(e,t){return t},rm:function(e,t){return{type_:"rm",p1:t||""}},text:function(e,t){return kt.go(t,"text")},"{text}":function(e,t){var n=["{"];return kt.concatArray(n,kt.go(t,"text")),n.push("}"),n},"tex-math":function(e,t){return kt.go(t,"tex-math")},"tex-math tight":function(e,t){return kt.go(t,"tex-math tight")},bond:function(e,t,n){return{type_:"bond",kind_:n||t}},"color0-output":function(e,t){return{type_:"color0",color:t[0]}},ce:function(e,t){return kt.go(t)},"1/2":function(e,t){var n=[];t.match(/^[+\-]/)&&(n.push(t.substr(0,1)),t=t.substr(1));var a=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return a[1]=a[1].replace(/\$/g,""),n.push({type_:"frac",p1:a[1],p2:a[2]}),a[3]&&(a[3]=a[3].replace(/\$/g,""),n.push({type_:"tex-math",p1:a[3]})),n},"9,9":function(e,t){return kt.go(t,"9,9")}},createTransitions:function(e){var t,n,a,l,f={};for(t in e)for(n in e[t])for(a=n.split("|"),e[t][n].stateArray=a,l=0;l<a.length;l++)f[a[l]]=[];for(t in e)for(n in e[t])for(a=e[t][n].stateArray||[],l=0;l<a.length;l++){var g=e[t][n];if(g.action_){g.action_=[].concat(g.action_);for(var S=0;S<g.action_.length;S++)typeof g.action_[S]=="string"&&(g.action_[S]={type_:g.action_[S]})}else g.action_=[];for(var T=t.split("|"),R=0;R<T.length;R++)if(a[l]==="*")for(var F in f)f[F].push({pattern:T[R],task:g});else f[a[l]].push({pattern:T[R],task:g})}return f},stateMachines:{}};kt.stateMachines={ce:{transitions:kt.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(e,t){var n;if((e.d||"").match(/^[0-9]+$/)){var a=e.d;e.d=void 0,n=this.output(e),e.b=a}else n=this.output(e);return kt.actions["o="](e,t),n},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var n=[];return kt.concatArray(n,this.output(e)),kt.concatArray(n,kt.actions.bond(e,t,"-")),n}else e.d=t},"- after o/d":function(e,t,n){var a=kt.patterns.match_("orbital",e.o||""),l=kt.patterns.match_("one lowercase greek letter $",e.o||""),f=kt.patterns.match_("one lowercase latin letter $",e.o||""),g=kt.patterns.match_("$one lowercase latin letter$ $",e.o||""),S=t==="-"&&(a&&a.remainder===""||l||f||g);S&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!a&&f&&(e.o="$"+e.o+"$");var T=[];return S?(kt.concatArray(T,this.output(e)),T.push({type_:"hyphen"})):(a=kt.patterns.match_("digits",e.d||""),n&&a&&a.remainder===""?(kt.concatArray(T,kt.actions["d="](e,t)),kt.concatArray(T,this.output(e))):(kt.concatArray(T,this.output(e)),kt.concatArray(T,kt.actions.bond(e,t,"-")))),T},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:"state of aggregation",p1:kt.go(t,"o")}},comma:function(e,t){var n=t.replace(/\s*$/,""),a=n!==t;return a&&e.parenthesisLevel===0?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(e,t,n){var a;if(!e.r)a=[],!e.a&&!e.b&&!e.p&&!e.o&&!e.q&&!e.d&&!n||(e.sb&&a.push({type_:"entitySkip"}),!e.o&&!e.q&&!e.d&&!e.b&&!e.p&&n!==2?(e.o=e.a,e.a=void 0):!e.o&&!e.q&&!e.d&&(e.b||e.p)?(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):e.o&&e.dType==="kv"&&kt.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&e.dType==="kv"&&!e.q&&(e.dType=void 0),a.push({type_:"chemfive",a:kt.go(e.a,"a"),b:kt.go(e.b,"bd"),p:kt.go(e.p,"pq"),o:kt.go(e.o,"o"),q:kt.go(e.q,"pq"),d:kt.go(e.d,e.dType==="oxidation"?"oxidation":"bd"),dType:e.dType}));else{var l;e.rdt==="M"?l=kt.go(e.rd,"tex-math"):e.rdt==="T"?l=[{type_:"text",p1:e.rd||""}]:l=kt.go(e.rd);var f;e.rqt==="M"?f=kt.go(e.rq,"tex-math"):e.rqt==="T"?f=[{type_:"text",p1:e.rq||""}]:f=kt.go(e.rq),a={type_:"arrow",r:e.r,rd:l,rq:f}}for(var g in e)g!=="parenthesisLevel"&&g!=="beginsWithBond"&&delete e[g];return a},"oxidation-output":function(e,t){var n=["{"];return kt.concatArray(n,kt.go(t,"oxidation")),n.push("}"),n},"frac-output":function(e,t){return{type_:"frac-ce",p1:kt.go(t[0]),p2:kt.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:kt.go(t[0]),p2:kt.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:kt.go(t[0]),p2:kt.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:kt.go(t[0]),p2:kt.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:kt.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,n){return{type_:"operator",kind_:n||t}}}},a:{transitions:kt.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:kt.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:kt.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(e){if(e.text_){var t={type_:"text",p1:e.text_};for(var n in e)delete e[n];return t}}}},pq:{transitions:kt.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(e,t){return{type_:"state of aggregation subscript",p1:kt.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:kt.go(t[1],"pq")}}}},bd:{transitions:kt.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(e,t){return{type_:"color",color1:t[0],color2:kt.go(t[1],"bd")}}}},oxidation:{transitions:kt.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,t){return{type_:"roman numeral",p1:t||""}}}},"tex-math":{transitions:kt.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return t}}}},"tex-math tight":{transitions:kt.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,t){e.o=(e.o||"")+"{"+t+"}"},output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return t}}}},"9,9":{transitions:kt.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:kt.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(e,t){var n=[];return t[0]==="+-"||t[0]==="+/-"?n.push("\\pm "):t[0]&&n.push(t[0]),t[1]&&(kt.concatArray(n,kt.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?kt.concatArray(n,kt.go(t[2],"pu-9,9")):n.push(t[2])),(t[3]||t[4])&&(t[3]==="e"||t[4]==="*"?n.push({type_:"cdot"}):n.push({type_:"times"}))),t[5]&&n.push("10^{"+t[5]+"}"),n},"number^":function(e,t){var n=[];return t[0]==="+-"||t[0]==="+/-"?n.push("\\pm "):t[0]&&n.push(t[0]),kt.concatArray(n,kt.go(t[1],"pu-9,9")),n.push("^{"+t[2]+"}"),n},operator:function(e,t,n){return{type_:"operator",kind_:n||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,n=kt.patterns.match_("{(...)}",e.d||"");n&&n.remainder===""&&(e.d=n.match_);var a=kt.patterns.match_("{(...)}",e.q||"");if(a&&a.remainder===""&&(e.q=a.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var l={d:kt.go(e.d,"pu"),q:kt.go(e.q,"pu")};e.o==="//"?t={type_:"pu-frac",p1:l.d,p2:l.q}:(t=l.d,l.d.length>1||l.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),kt.concatArray(t,l.q))}else t=kt.go(e.d,"pu-2");for(var f in e)delete e[f];return t}}},"pu-2":{transitions:kt.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(e,t){e.rm+="^{"+t+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var t=[];if(e.rm){var n=kt.patterns.match_("{(...)}",e.rm||"");n&&n.remainder===""?t=kt.go(n.match_,"pu"):t={type_:"rm",p1:e.rm}}for(var a in e)delete e[a];return t}}},"pu-9,9":{transitions:kt.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){var n=e.text_.length%3;n===0&&(n=3);for(var a=e.text_.length-3;a>0;a-=3)t.push(e.text_.substr(a,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,n)),t.reverse()}else t.push(e.text_);for(var l in e)delete e[l];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var n=e.text_.length-3,a=0;a<n;a+=3)t.push(e.text_.substr(a,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(a))}else t.push(e.text_);for(var l in e)delete e[l];return t}}}};var Br={go:function(e,t){if(!e)return"";for(var n="",a=!1,l=0;l<e.length;l++){var f=e[l];typeof f=="string"?n+=f:(n+=Br._go2(f),f.type_==="1st-level escape"&&(a=!0))}return!t&&!a&&n&&(n="{"+n+"}"),n},_goInner:function(e){return e&&Br.go(e,!0)},_go2:function(e){var t;switch(e.type_){case"chemfive":t="";var n={a:Br._goInner(e.a),b:Br._goInner(e.b),p:Br._goInner(e.p),o:Br._goInner(e.o),q:Br._goInner(e.q),d:Br._goInner(e.d)};n.a&&(n.a.match(/^[+\-]/)&&(n.a="{"+n.a+"}"),t+=n.a+"\\,"),(n.b||n.p)&&(t+="{\\vphantom{X}}",t+="^{\\hphantom{"+(n.b||"")+"}}_{\\hphantom{"+(n.p||"")+"}}",t+="{\\vphantom{X}}",t+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(n.b||"")+"}}",t+="_{\\vphantom{2}\\llap{\\smash[t]{"+(n.p||"")+"}}}"),n.o&&(n.o.match(/^[+\-]/)&&(n.o="{"+n.o+"}"),t+=n.o),e.dType==="kv"?((n.d||n.q)&&(t+="{\\vphantom{X}}"),n.d&&(t+="^{"+n.d+"}"),n.q&&(t+="_{\\smash[t]{"+n.q+"}}")):e.dType==="oxidation"?(n.d&&(t+="{\\vphantom{X}}",t+="^{"+n.d+"}"),n.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+n.q+"}}")):(n.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+n.q+"}}"),n.d&&(t+="{\\vphantom{X}}",t+="^{"+n.d+"}"));break;case"rm":t="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),t="\\mathrm{"+e.p1+"}"):t="\\text{"+e.p1+"}";break;case"roman numeral":t="\\mathrm{"+e.p1+"}";break;case"state of aggregation":t="\\mskip2mu "+Br._goInner(e.p1);break;case"state of aggregation subscript":t="\\mskip1mu "+Br._goInner(e.p1);break;case"bond":if(t=Br._getBond(e.kind_),!t)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var a="\\frac{"+e.p1+"}{"+e.p2+"}";t="\\mathchoice{\\textstyle"+a+"}{"+a+"}{"+a+"}{"+a+"}";break;case"pu-frac":var l="\\frac{"+Br._goInner(e.p1)+"}{"+Br._goInner(e.p2)+"}";t="\\mathchoice{\\textstyle"+l+"}{"+l+"}{"+l+"}{"+l+"}";break;case"tex-math":t=e.p1+" ";break;case"frac-ce":t="\\frac{"+Br._goInner(e.p1)+"}{"+Br._goInner(e.p2)+"}";break;case"overset":t="\\overset{"+Br._goInner(e.p1)+"}{"+Br._goInner(e.p2)+"}";break;case"underset":t="\\underset{"+Br._goInner(e.p1)+"}{"+Br._goInner(e.p2)+"}";break;case"underbrace":t="\\underbrace{"+Br._goInner(e.p1)+"}_{"+Br._goInner(e.p2)+"}";break;case"color":t="{\\color{"+e.color1+"}{"+Br._goInner(e.color2)+"}}";break;case"color0":t="\\color{"+e.color+"}";break;case"arrow":var f={rd:Br._goInner(e.rd),rq:Br._goInner(e.rq)},g=Br._getArrow(e.r);f.rd||f.rq?e.r==="<=>"||e.r==="<=>>"||e.r==="<<=>"||e.r==="<-->"?(g="\\long"+g,f.rd&&(g="\\overset{"+f.rd+"}{"+g+"}"),f.rq&&(e.r==="<-->"?g="\\underset{\\lower2mu{"+f.rq+"}}{"+g+"}":g="\\underset{\\lower6mu{"+f.rq+"}}{"+g+"}"),g=" {}\\mathrel{"+g+"}{} "):(f.rq&&(g+="[{"+f.rq+"}]"),g+="{"+f.rd+"}",g=" {}\\mathrel{\\x"+g+"}{} "):g=" {}\\mathrel{\\long"+g+"}{} ",t=g;break;case"operator":t=Br._getOperator(e.kind_);break;case"1st-level escape":t=e.p1+" ";break;case"space":t=" ";break;case"entitySkip":t="~";break;case"pu-space-1":t="~";break;case"pu-space-2":t="\\mkern3mu ";break;case"1000 separator":t="\\mkern2mu ";break;case"commaDecimal":t="{,}";break;case"comma enumeration L":t="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":t="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":t="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":t="\\text{-}";break;case"addition compound":t="\\,{\\cdot}\\,";break;case"electron dot":t="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":t="{\\times}";break;case"prime":t="\\prime ";break;case"cdot":t="\\cdot ";break;case"tight cdot":t="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":t="\\times ";break;case"circa":t="{\\sim}";break;case"^":t="uparrow";break;case"v":t="downarrow";break;case"ellipsis":t="\\ldots ";break;case"/":t="/";break;case" / ":t="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return t},_getArrow:function(e){switch(e){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(e){switch(e){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function fi(e){}function Bi(e){}var tn=class Xf extends Bt{constructor(t){super(c($({},t),{type:"delim"})),this.value=t.delim,this.size=t.size}static fromJson(t){return new Xf(t)}toJson(){return c($({},super.toJson()),{delim:this.value,size:this.size})}render(t){return new rr(this.value,{type:"middle"})}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=qe(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,t):Oi(this.command,this.value)}},jr=class Jf extends Bt{constructor(t){super(c($({},t),{type:"sizeddelim",value:t.delim})),this.delimType=t.delimType,this.size=t.size}static fromJson(t){return new Jf(t)}toJson(){return c($({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(t){let n=K0(this.value,this.size,t,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return n?(n=this.bind(t,n),this.caret&&(n.caret=this.caret),n):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=qe(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,t):Oi(this.command,this.value)}},Qn=class Qf extends Bt{constructor(t,n,a,l){var f,g;super({type:"enclose",command:t,style:l.style}),this.body=n,this.backgroundcolor=l.backgroundcolor,a.updiagonalarrow&&(a.updiagonalstrike=!1),a.box&&(a.left=!1,a.right=!1,a.bottom=!1,a.top=!1),this.notation=a,this.shadow=(f=l.shadow)!=null?f:"none",this.strokeWidth=(g=l.strokeWidth)!=null?g:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=l.strokeStyle,this.svgStrokeStyle=l.svgStrokeStyle,this.strokeColor=l.strokeColor,this.borderStyle=l.borderStyle,this.padding=l.padding,this.captureSelection=!1}static fromJson(t){return new Qf(t.command,t.body,t.notation,t)}toJson(){return c($({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(t){var n;if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const a=qe(this.command,this.mode);if(a!=null&&a.serialize)return a.serialize(this,t);let l=(n=this.command)!=null?n:"";if(this.command==="\\enclose"){l+="{"+Object.keys(this.notation).join(" ")+"}";let f="",g="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(f+=g+'mathbackground="'+this.backgroundcolor+'"',g=","),this.shadow&&this.shadow!=="auto"&&(f+=g+'shadow="'+this.shadow+'"',g=","),this.strokeWidth||this.strokeStyle!=="solid"?(f+=g+this.borderStyle,g=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(f+=g+'mathcolor="'+this.strokeColor+'"',g=","),f&&(l+=`[${f}]`)}return Oi(l,this.bodyToLatex(t))}render(t){const n=new Hn({parent:t},this.style),a=Bt.createBox(n,this.body);if(!a)return null;const l=Ei(this.borderStyle),f=n.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});a.setStyle("position","relative"),a.setStyle("display","inline-block"),a.setStyle("top",f,"em"),a.setStyle("height",a.height+a.depth,"em"),a.setStyle("width",a.width,"em");const g=new rr(null,{classes:"ML__notation"});let S=a.height+a.depth+2*f;const T=a.width+2*f;let R="";if(this.notation.horizontalstrike&&(R+=this.line(3,50,97,50)),this.notation.verticalstrike&&(R+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(R+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(R+=this.line(3,3,97,97)),this.notation.updiagonalarrow){R+=this.line(f.toString(),(f+a.depth+a.height).toString(),(f+a.width).toString(),f.toString());const ze=.03*Math.sqrt(T*T+S*S)*1,_t=a.width*ze,tr=(a.depth+a.height)*ze,pt=f+a.width;let Ht=f;Ht+tr-.4*_t<0&&(Ht=.4*_t-tr),R+='<polygon points="',R+=`${pt},${Ht} ${pt-_t-.4*tr},${Ht+tr-.4*_t} `,R+=`${pt-.7*_t},${Ht+.7*tr} ${pt-_t+.4*tr},${Ht+tr+.4*_t} `,R+=`${pt},${Ht}`,R+=`" stroke='none' fill="${this.strokeColor}"`,R+="/>"}let F=0;if(this.notation.phasorangle){const ve=As(n),Me=(a.height+a.depth+2*ve+f).toString(),ze=(a.height+a.depth)/2;R+=this.line(f.toString(),Me,(f+ze+a.width).toString(),Me),R+=this.line(f.toString(),Me,(f+ze).toString(),(f-ve).toString()),S+=ve,F=ze,a.left+=S/2-f}if(this.notation.longdiv){const ve=As(n);S+=ve,R+=this.line(f.toString(),f.toString(),(f+a.width).toString(),f.toString());const Me=.3;F=Me+ve,a.left+=Me+ve,a.setTop(f+ve),R+='<path d="',R+=`M ${f} ${f} a${Me} ${(a.depth+a.height+2*ve)/2}, 0, 1, 1, 0 ${a.depth+a.height+2*ve} "`,R+=` stroke-width="${ys(n)}" stroke="${this.strokeColor}" fill="none"`,R+="/>"}if(g.width=a.width+2*f+F,g.height=a.height+f,g.depth=a.depth+f,g.setStyle("box-sizing","border-box"),g.setStyle("left",`calc(-${l} / 2 )`),g.setStyle("height",`${Math.floor(100*S)/100}em`),g.setStyle("top",`calc(${l} / 2 )`),this.backgroundcolor&&g.setStyle("background-color",this.backgroundcolor),this.notation.box&&g.setStyle("border","1px solid red"),this.notation.actuarial&&(g.setStyle("border-top",this.borderStyle),g.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(g.setStyle("border-bottom",this.borderStyle),g.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(g.setStyle("border-radius","8px"),g.setStyle("border",this.borderStyle)),this.notation.circle&&(g.setStyle("border-radius","50%"),g.setStyle("border",this.borderStyle)),this.notation.top&&g.setStyle("border-top",this.borderStyle),this.notation.left&&g.setStyle("border-left",this.borderStyle),this.notation.right&&g.setStyle("border-right",this.borderStyle),this.notation.bottom&&g.setStyle("border-bottom",this.borderStyle),R){let ve="";this.shadow==="auto"&&(ve+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(ve+=`filter: drop-shadow(${this.shadow})`),ve+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,ve+=' stroke-linecap="round"',this.svgStrokeStyle&&(ve+=` stroke-dasharray="${this.svgStrokeStyle}"`),g.svgStyle=ve,g.svgOverlay=R}const X=new rr([g,a]);return X.setStyle("position","relative"),X.setStyle("vertical-align",f,"em"),X.setStyle("height",`${Math.floor(100*(a.height+a.depth+2*f))/100}em`),X.setStyle("display","inline-block"),X.height=g.height,X.depth=g.depth,X.width=g.width-2*f,X.left=f,X.right=f,this.caret&&(X.caret=this.caret),X.wrap(n)}line(t,n,a,l){return`<line x1="${Pn(t)}" y1="${Pn(n)}" x2="${Pn(a)}" y2="${Pn(l)}" vector-effect="non-scaling-stroke"></line>`}};function Pn(e){return typeof e=="number"?`${Math.floor(100*e)/100}%`:e}function Ei(e){if(!e)return"1px";const t=e.match(/([0-9][a-zA-Z\%]+)/);return t===null?"1px":t[1]}function ys(e){return(Math.floor(100*e.metrics.sqrtRuleThickness/e.scalingFactor)/100/10).toString()+"em"}function As(e){const t=e.isDisplayStyle?da:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*t/4}var ss=class ep extends Bt{constructor(t,n,a){var l,f;super(c($({},a),{type:"genfrac",displayContainsHighlight:!0})),this.above=t,this.below=n,this.hasBarLine=(l=a==null?void 0:a.hasBarLine)!=null?l:!0,this.continuousFraction=(f=a==null?void 0:a.continuousFraction)!=null?f:!1,this.numerPrefix=a==null?void 0:a.numerPrefix,this.denomPrefix=a==null?void 0:a.denomPrefix,this.mathstyleName=a==null?void 0:a.mathstyleName,this.leftDelim=a==null?void 0:a.leftDelim,this.rightDelim=a==null?void 0:a.rightDelim,this.fractionNavigationOrder=a==null?void 0:a.fractionNavigationOrder}static fromJson(t){return new ep(t.above,t.below,t)}toJson(){const t={};return this.continuousFraction&&(t.continuousFraction=!0),this.numerPrefix&&(t.numerPrefix=this.numerPrefix),this.denomPrefix&&(t.denomPrefix=this.denomPrefix),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),this.hasBarLine||(t.hasBarLine=!1),this.mathstyleName&&(t.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(t.fractionNavigationOrder=this.fractionNavigationOrder),$($({},super.toJson()),t)}get children(){if(this._children)return this._children;const t=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const n of this.below)t.push(...n.children),t.push(n);for(const n of this.above)t.push(...n.children),t.push(n)}else{for(const n of this.above)t.push(...n.children),t.push(n);for(const n of this.below)t.push(...n.children),t.push(n)}return this._children=t,t}render(t){var n,a;const l=new Hn({parent:t,mathstyle:this.mathstyleName},this.style),f=l.metrics,g=new Hn({parent:l,mathstyle:this.continuousFraction?"":"numerator"},this.style),S=this.numerPrefix?new rr([new rr(this.numerPrefix),Bt.createBox(g,this.above)],{isTight:g.isTight,type:"ignore"}):(n=Bt.createBox(g,this.above,{type:"ignore"}))!=null?n:new rr(null,{type:"ignore"}),T=new Hn({parent:l,mathstyle:this.continuousFraction?"":"denominator"},this.style),R=this.denomPrefix?new rr([new rr(this.denomPrefix),Bt.createBox(T,this.below,{type:"ignore"})]):(a=Bt.createBox(T,this.below,{type:"ignore"}))!=null?a:new rr(null,{type:"ignore"}),F=this.hasBarLine?f.defaultRuleThickness:0;let X,ve=0,Me;l.isDisplayStyle?(X=g.metrics.num1,ve=F>0?3*F:7*F,Me=T.metrics.denom1):(F>0?(X=g.metrics.num2,ve=F):(X=g.metrics.num3,ve=3*f.defaultRuleThickness),Me=T.metrics.denom2);const ze=[];this.isSelected&&ze.push("ML__selected");const _t=S.depth,tr=R.height;let pt;if(F<=0){const Hr=X-_t-(tr-Me);Hr<ve&&(X+=(ve-Hr)/2,Me+=(ve-Hr)/2),pt=new ds({individualShift:[{box:S,shift:-X,classes:[...ze,"ML__center"]},{box:R,shift:Me,classes:[...ze,"ML__center"]}]}).wrap(l)}else{const Hr=new rr(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Hr.softWidth=Math.max(S.width,R.width),Hr.height=F/2,Hr.depth=F/2;const Gn=Ys+F/2;X<ve+_t+Gn&&(X=ve+_t+Gn);const yi=Ys-F/2;Me<ve+tr-yi&&(Me=ve+tr-yi),pt=new ds({individualShift:[{box:R,shift:Me,classes:[...ze,"ML__center"]},{box:Hr,shift:-yi,classes:ze},{box:S,shift:-X,classes:[...ze,"ML__center"]}]}).wrap(l)}const Ht=l.isDisplayStyle?f.delim1:f.delim2,ur=this.leftDelim?this.bind(t,Ba("open",this.leftDelim,Ht,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):r(l,"open");let jt=null;this.continuousFraction?jt=new rr(null,{type:"close"}):this.rightDelim?jt=this.bind(t,Ba("close",this.rightDelim,Ht,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):jt=r(l,"close");const Pr=new rr([ur,pt,jt],{isTight:l.isTight,type:"inner",classes:"mfrac"}),Yr=this.bind(t,Pr);return this.caret&&(Yr.caret=this.caret),this.attachSupsub(t,{base:Yr})}},vi=class tp extends Bt{constructor(t,n){var a;super({type:"latex",value:t,mode:"latex"}),this.isSuggestion=(a=n==null?void 0:n.isSuggestion)!=null?a:!1,this.isError=!1}static fromJson(t){const n=new tp(t.value);return t.isSuggestion&&(n.isSuggestion=!0),t.isError&&(n.isError=!0),n}toJson(){const t={};return this.isSuggestion&&(t.isSuggestion=!0),this.isError&&(t.isError=!0),$({type:"latex",value:this.value},t)}get computedStyle(){return{}}render(t){const n=new rr(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return n?(this.caret&&(n.caret=this.caret),this.bind(t,n)):null}},Qa=class rp extends Bt{constructor(t){super({type:"latexgroup",mode:"latex"}),this.body=[...t].map(n=>new vi(n)),this.skipBoundary=!1}static fromJson(t){return new rp("")}toJson(){return super.toJson()}render(t){const n=Bt.createBox(t,this.body);return n?(this.caret&&(n.caret=this.caret),this.bind(t,n)):null}_serialize(t){var n,a;return(a=(n=this.body)==null?void 0:n.map(l=>l.value).join(""))!=null?a:""}},r0=class np extends Bt{constructor(t,n){super(c($({},n),{type:"extensible-symbol",isFunction:n==null?void 0:n.isFunction})),this.value=t,this.variant=n==null?void 0:n.variant,this.subsupPlacement=n==null?void 0:n.limits}static fromJson(t){return new np(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.value&&(t.symbol=this.value),t}render(t){var n;const a=t.isDisplayStyle&&this.value!=="\\smallint",l=new rr(this.value,{fontFamily:a?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(a?"large-op":"small-op"),type:"op",maxFontSize:t.scalingFactor,isSelected:this.isSelected});if(!l)return null;l.right=l.italic;const f=(l.height-l.depth)/2-Ys*t.scalingFactor,g=l.italic;l.setTop(f);let S=l;if(this.superscript||this.subscript){const T=(n=this.subsupPlacement)!=null?n:"auto";S=T==="over-under"||T==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:l,baseShift:f,slant:g}):this.attachSupsub(t,{base:l})}return new rr(this.bind(t,S),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=qe(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,t);const a=[];return a.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&a.push("\\limits"),this.subsupPlacement==="adjacent"&&a.push("\\nolimits"),this.subsupPlacement==="auto"&&a.push("\\displaylimits")),a.push(this.supsubToLatex(t)),Bn(a)}},n0=class ip extends Bt{constructor(t){const n=t.body;super(c($({},t),{type:"overlap",body:typeof n=="string"?[new Bt({value:n})]:n,style:t==null?void 0:t.style})),this.skipBoundary=!0,this.align=t==null?void 0:t.align,this.boxType=t==null?void 0:t.boxType}static fromJson(t){return new ip(t)}toJson(){const t={};return this.align&&(t.align=this.align),this.boxType&&(t.boxType=this.boxType),$($({},super.toJson()),t)}render(t){const n=Bt.createBox(t,this.body,{classes:"inner"});return n?(this.caret&&(n.caret=this.caret),this.bind(t,new rr([n,new rr(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Pa=class sp extends Bt{constructor(t){var n,a,l,f;super({type:"overunder",command:t.command,style:t.style,mode:t.mode,body:t.body,skipBoundary:(n=t.skipBoundary)!=null?n:!0}),this.subsupPlacement=t.supsubPlacement,this.svgAbove=t.svgAbove,this.svgBelow=t.svgBelow,this.svgBody=t.svgBody,this.above=t.above,this.below=t.below,this.boxType=(a=t.boxType)!=null?a:"ord",this.paddedBody=(l=t.paddedBody)!=null?l:!1,this.paddedLabels=(f=t.paddedLabels)!=null?f:!1}static fromJson(t){return new sp(t)}toJson(){const t=super.toJson();return this.skipBoundary||(t.skipBoundary=!1),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.svgAbove&&(t.svgAbove=this.svgAbove),this.svgBelow&&(t.svgBelow=this.svgBelow),this.svgBody&&(t.svgBody=this.svgBody),this.boxType!=="ord"&&(t.boxType=this.boxType),this.paddedBody&&(t.paddedBody=!0),this.paddedLabels&&(t.paddedLabels=!0),t}render(t){let n=this.svgBody?R0(this.svgBody):Bt.createBox(t,this.body,{type:"ignore"});const a=new Hn({parent:t,mathstyle:"scriptstyle"},this.style);let l=null;this.svgAbove?l=R0(this.svgAbove):this.above&&(l=Bt.createBox(a,this.above,{type:"ignore"}));let f=null;this.svgBelow?f=R0(this.svgBelow):this.below&&(f=Bt.createBox(a,this.below,{type:"ignore"})),this.paddedBody&&(n=new rr([r(t,"open"),n,r(t,"close")],{type:"ignore"}));let g=mp(t,{base:n,above:l,below:f,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return g?(this.subsupPlacement==="over-under"?g=this.attachLimits(t,{base:g,type:g.type}):g=this.attachSupsub(t,{base:g}),this.caret&&(g.caret=this.caret),this.bind(t,g)):null}};function mp(e,t){if(!t.base)return null;if(!t.above&&!t.below){const S=new rr(t.base,{type:t.type});return S.setStyle("position","relative"),S}let n=0;t.above&&(n=e.metrics.bigOpSpacing5);let a=null;const l=t.base,f=0,g=["ML__center"];if(t.paddedAboveBelow&&g.push("ML__label_padding"),t.below&&t.above){const S=e.metrics.bigOpSpacing5+t.below.height+t.below.depth+l.depth+f;a=new ds({bottom:S,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:g},{box:l,classes:["ML__center"]},n,{box:t.above,classes:g},e.metrics.bigOpSpacing5]})}else t.below?a=new ds({top:l.height-f,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:g},{box:l,classes:["ML__center"]}]}):t.above&&(a=new ds({bottom:l.depth+f,children:[{box:l,classes:["ML__center"]},n,{box:t.above,classes:g},e.metrics.bigOpSpacing5]}));return new rr(a,{type:t.type})}var Eu=class ap extends Bt{constructor(t){var n,a,l,f;super(c($({},t),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(n=t.isInvisible)!=null?n:!1,this.smashDepth=(a=t.smashDepth)!=null?a:!1,this.smashHeight=(l=t.smashHeight)!=null?l:!1,this.smashWidth=(f=t.smashWidth)!=null?f:!1}static fromJson(t){return new ap(t)}toJson(){const t={};return this.isInvisible&&(t.isInvisible=!0),this.smashDepth&&(t.smashDepth=!0),this.smashHeight&&(t.smashHeight=!0),this.smashWidth&&(t.smashWidth=!0),$($({},super.toJson()),t)}render(t){const n=new Hn({parent:t,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Bt.createBox(n,this.body,{classes:"inner"});const a=Bt.createBox(this.isInvisible?n:t,this.body);if(!a)return null;if(this.smashWidth){const l=new rr(null,{classes:"fix"});return new rr([a,l],{classes:"rlap"}).wrap(t)}if(!this.smashHeight&&!this.smashDepth)return a;if(this.smashHeight&&(a.height=0),this.smashDepth&&(a.depth=0),a.children)for(const l of a.children)this.smashHeight&&(l.height=0),this.smashDepth&&(l.depth=0);return new ds({firstBaseline:[{box:a}]},{type:a.type}).wrap(t)}},ku=class op extends Bt{constructor(t){var n;super($({type:"spacing"},t)),this.width=t==null?void 0:t.width,this._braced=(n=t==null?void 0:t.braced)!=null?n:!1}static fromJson(t){return new op(t)}toJson(){const t=super.toJson();return this.width!==void 0&&(t.width=this.width),this._braced&&(t.braced=!0),t}render(t){var n;if(this.command==="space")return new rr(this.mode==="math"?null:" ");let a;if(this.width!==void 0)a=new rr(null,{classes:"mspace"}),a.left=t.toEm(this.width);else{const l=(n={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?n:"mediumspace";a=new rr(null,{classes:l})}return a=this.bind(t,a),this.caret&&(a.caret=this.caret),a}_serialize(t){var n;if(!t.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const a=qe(this.command,this.mode);if(a!=null&&a.serialize)return a.serialize(this,t);const l=(n=this.command)!=null?n:"";return this.width===void 0?l:this._braced&&!("register"in this.width)?`${l}{${Ms(this.width)}}`:`${l}${Ms(this.width)}`}},md=class lp extends Bt{constructor(t){var n;super(c($({},t),{type:"surd",mode:(n=t.mode)!=null?n:"math",style:t.style,displayContainsHighlight:!0,body:t.body})),this.above=t.index}static fromJson(t){return new lp(c($({},t),{index:t.above}))}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=qe(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,t);const a=this.command,l=this.bodyToLatex(t);return this.above&&!this.hasEmptyBranch("above")?Oi(`${a}[${this.aboveToLatex(t)}]`,l):/^[0-9]$/.test(l)?`${a}${l}`:Oi(a,l)}get children(){if(this._children)return this._children;const t=[];if(this.above)for(const n of this.above)t.push(...n.children),t.push(n);if(this.body)for(const n of this.body)t.push(...n.children),t.push(n);return this._children=t,t}render(t){var n;const a=new Hn({parent:t,mathstyle:"cramp"},this.style),l=(n=Bt.createBox(a,this.body,{type:"inner"}))!=null?n:new rr(null),f=a.scalingFactor,g=a.metrics.defaultRuleThickness/f,S=t.isDisplayStyle?da:g,T=new rr(null,{classes:"ML__sqrt-line",style:this.style});T.height=g,T.softWidth=l.width;let R=f*(g+S/4);const X=Math.max(f*2*S,l.height+l.depth)+R+g,ve=new Hn({parent:t},this.style),Me=this.bind(ve,new rr(Ba("inner","\\surd",X,!1,ve,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!Me)return null;const ze=Me.height+Me.depth-g;ze>l.height+l.depth+R&&(R=(R+ze-(l.height+l.depth))/2),Me.setTop(Me.height-l.height-R);const _t=this.bind(t,new ds({firstBaseline:[{box:new rr(l)},R-2*g,{box:T},g]})),tr=Bt.createBox(new Hn({parent:t,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!tr){const ur=new rr([Me,_t],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return ur.setStyle("display","inline-block"),ur.setStyle("height",ur.height+ur.depth,"em"),this.caret&&(ur.caret=this.caret),this.bind(t,ur)}const pt=new ds({shift:-.6*(Math.max(Me.height,_t.height)-Math.max(Me.depth,_t.depth)),children:[{box:tr}]}),Ht=new rr([new rr(pt,{classes:"ML__sqrt-index",type:"ignore"}),Me,_t],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return Ht.height=Me.height,Ht.depth=Me.depth,this.caret&&(Ht.caret=this.caret),this.bind(t,Ht)}},gp=class extends rr{constructor(e){super(null,{type:"skip"}),this._width=e}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function mc(e,t){if(!e.parent)return;const n=e.parent.children,a=n.indexOf(e);let l=a-1;for(;l>=0&&n[l].type==="ignore";)l-=1;if(l<0&&e.parent.parent&&e.parent.type==="lift"){mc(e.parent,t);return}a>0&&n[a-1].type==="skip"?n[a-1].width+=t:n.splice(a,0,new gp(t))}var vp={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},yp={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function bp(e){Tu(e,(t,n)=>{n.type==="bin"&&(!t||/^(middle|bin|op|rel|open|punct)$/.test(t.type))&&(n.type="ord"),(t==null?void 0:t.type)==="bin"&&/^(rel|close|punct)$/.test(n.type)&&(t.type="ord"),n.type!=="ignore"&&(t=n)})}function Au(e,t){if(!e.children)return e;const n=e.children;bp(n);const a=t.getRegisterAsEm("thinmuskip"),l=t.getRegisterAsEm("medmuskip"),f=t.getRegisterAsEm("thickmuskip");return Tu(n,(g,S)=>{var T,R,F;if(!g)return;const X=g.type,ve=S.isTight?(T=yp[X])!=null?T:null:(R=vp[X])!=null?R:null,Me=(F=ve==null?void 0:ve[S.type])!=null?F:null;Me===3&&mc(S,a),Me===4&&mc(S,l),Me===5&&mc(S,f)}),e}function Tu(e,t,n=void 0){if(!e)return n;e=[...e];for(const a of e)a.type==="lift"?n=Tu(a.children,t,n):a.type==="ignore"?Tu(a.children,t):(t(n,a),Tu(a.children,t),n=a);return n}var Th=class up extends Bt{constructor(t){super({type:"tooltip",command:t.command,mode:t.mode,style:t.style,body:t.body,displayContainsHighlight:!0}),this.tooltip=new Bt({type:"root",mode:t.content,body:t.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(t){return new up(c($({},t),{tooltip:Ol(t.tooltip)}))}toJson(){var t;const n=(t=this.tooltip.body)==null?void 0:t.filter(a=>a.type!=="first").map(a=>a.toJson());return c($({},super.toJson()),{tooltip:n})}render(t){const n=Bt.createBox(new Hn,this.body);if(!n)return null;const a=new Hn({parent:t,mathstyle:"displaystyle"},{fontSize:Go}),l=Al(Au(new rr(this.tooltip.render(a),{classes:"ML__tooltip-content"}),a)),f=new rr([l,n],{classes:"ML__tooltip-container"});return this.caret&&(f.caret=this.caret),this.bind(t,f)}},i0=class cp extends Bt{constructor(t,n){super(c($({},n),{type:"operator",isFunction:n==null?void 0:n.isFunction})),this.value=t,this.variant=n==null?void 0:n.variant,this.variantStyle=n==null?void 0:n.variantStyle,this.subsupPlacement=n==null?void 0:n.limits}static fromJson(t){return new cp(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.variantStyle&&(t.variantStyle=this.variantStyle),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.value&&(t.symbol=this.value),t}render(t){var n;const a=new rr(this.value,{type:"op",mode:"math",maxFontSize:t.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:t.letterShapeStyle});let l=a;if(this.superscript||this.subscript){const f=(n=this.subsupPlacement)!=null?n:"auto";l=f==="over-under"||f==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:a}):this.attachSupsub(t,{base:a})}return new rr(this.bind(t,l),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=qe(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,t);const a=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&a.push("\\limits"),this.subsupPlacement==="adjacent"&&a.push("\\nolimits"),this.subsupPlacement==="auto"&&a.push("\\displaylimits")),a.push(this.supsubToLatex(t)),Bn(a)}};function Ol(e){if(A(e))return e.map(a=>Ol(a));if(typeof e=="string")return Bt.fromJson(e);e=$({},e);for(const a of Tl)e[a]&&(e[a]=Ol(e[a]));e.args&&(e.args=_p(e.args)),e.array&&(e.array=Ol(e.array));const t=e.type;let n;t==="accent"&&(n=Rl.fromJson(e)),t==="array"&&(n=N.fromJson(e)),t==="box"&&(n=de.fromJson(e)),t==="chem"&&(n=Cn.fromJson(e)),t==="composition"&&(n=$e.fromJson(e)),t==="delim"&&(n=tn.fromJson(e)),t==="enclose"&&(n=Qn.fromJson(e)),t==="error"&&(n=ct.fromJson(e)),t==="extensible-symbol"&&(n=r0.fromJson(e)),t==="genfrac"&&(n=ss.fromJson(e)),t==="group"&&(n=ht.fromJson(e)),t==="latex"&&(n=vi.fromJson(e)),t==="latexgroup"&&(n=Qa.fromJson(e)),t==="leftright"&&(n=At.fromJson(e)),t==="macro"&&(n=Qt.fromJson(e)),t==="macro-argument"&&(n=zt.fromJson(e)),t==="operator"&&(n=i0.fromJson(e)),t==="overlap"&&(n=n0.fromJson(e)),t==="overunder"&&(n=Pa.fromJson(e)),t==="placeholder"&&(n=i.fromJson(e)),t==="prompt"&&(n=pr.fromJson(e)),t==="phantom"&&(n=Eu.fromJson(e)),t==="sizeddelim"&&(n=jr.fromJson(e)),t==="spacing"&&(n=ku.fromJson(e)),t==="subsup"&&(n=Or.fromJson(e)),t==="surd"&&(n=md.fromJson(e)),t==="text"&&(n=Cl.fromJson(e)),t==="tooltip"&&(n=Th.fromJson(e)),n||(console.assert(!t||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(t),`MathLive 0.98.5: an unexpected atom type "${t}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),n=Bt.fromJson(e));for(const a of Tl)e[a]&&n.setChildren(e[a],a);return e.verbatimLatex!==void 0&&(n.verbatimLatex=e.verbatimLatex),e.subsupPlacement&&(n.subsupPlacement=e.subsupPlacement),e.explicitSubsupPlacement&&(n.explicitSubsupPlacement=!0),e.isFunction&&(n.isFunction=!0),e.isExtensibleSymbol&&(n.isExtensibleSymbol=!0),e.skipBoundary&&(n.skipBoundary=!0),e.captureSelection&&(n.captureSelection=!0),n}function _p(e){if(e&&Array.isArray(e))return e.map(t=>t==="<null>"?null:typeof t=="object"&&"group"in t?{group:t.group.map(n=>Ol(n))}:typeof t=="object"&&"atoms"in t?t.atoms.map(n=>Ol(n)):t)}var gd={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},Ch={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},vd=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,xp=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,wp=[/^[a-z]$/,/^[A-Z]$/,vd,xp],Sp={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},Ep=class extends Xs{constructor(){super("math")}createAtom(e,t,n){var a,l,f,g;if(t===null)return new Bt({type:"mord",mode:"math",command:e,value:e,style:n});const S=window.MathfieldElement.isFunction((a=t.command)!=null?a:e);if(t.definitionType==="symbol"){const R=new Bt({type:(l=t.type)!=null?l:"mord",mode:"math",command:(f=t.command)!=null?f:e,value:String.fromCodePoint(t.codepoint),style:n});return S&&(R.isFunction=!0),e.startsWith("\\")&&(R.verbatimLatex=e),R}const T=new Bt({type:"mord",mode:"math",command:(g=t.command)!=null?g:e,value:e,style:n});return S&&(T.isFunction=!0),e.startsWith("\\")&&(T.verbatimLatex=e),T}serialize(e,t){const n=kp(e,c($({},t),{defaultMode:"math"}));return n.length===0||t.defaultMode!=="text"?n:["$ ",...n," $"]}getFont(e,t){console.assert(t.variant!==void 0);let{variant:n}=t,{variantStyle:a}=t;n==="normal"&&!a&&/[\u00A3\u0131\u0237]/.test(e.value)&&(n="main",a="italic"),n==="normal"&&!a&&e.value.length===1&&wp.forEach((S,T)=>{var R;S.test(e.value)&&Sp[(R=t.letterShapeStyle)!=null?R:"tex"][T]==="it"&&(a="italic")}),a==="up"&&(a=void 0);const l=a?n+"-"+a:n;console.assert(gd[l]!==void 0);const[f,g]=gd[l];return Ch[n]&&!Ch[n].test(e.value)?(e.value=rt(e.value,n,a),null):(vd.test(e.value)&&(e.classes+=" lcGreek"),g&&(e.classes+=" "+g),f)}};function kp(e,t){const{parent:n}=e[0],a=yd(n);return fo(e,"variant").map(l=>{const f=yd(l[0]);let g="";f&&f!==a&&(g={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[f],console.assert(g!==void 0));const S=Bn(l.map(T=>T._serialize(t)));return g?Oi(g,S):S})}function yd(e){if(!e)return"";const{style:t}=e;if(t.variant===void 0)return"";let n=t.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(t.variant)&&t.variantStyle&&t.variantStyle!=="up"&&(n+="-"+t.variantStyle),n}new Ep;function Ap(e,t){return e.map(n=>n._serialize(t))}function Tp(e,t){return fo(e,"fontShape").map(n=>{const a=Ap(n,t),{fontShape:l}=n[0].style;let f="";return l==="it"&&(f="\\textit"),l==="sl"&&(f="\\textsl"),l==="sc"&&(f="\\textsc"),l==="n"&&(f="\\textup"),!f&&l?`{${Oi("\\fontshape",l)}${Bn(a)}}`:f?Oi(f,Bn(a)):Bn(a)})}function Cp(e,t){return fo(e,"fontSeries").map(n=>{const a=Tp(n,t),{fontSeries:l}=n[0].style;let f="";return l==="b"&&(f="\\textbf"),l==="l"&&(f="\\textlf"),l==="m"&&(f="\\textmd"),l&&!f?`{${Oi("\\fontseries",l)}${Bn(a)}}`:f?Oi(f,Bn(a)):Bn(a)})}function Dp(e,t){return fo(e,"fontSize").map(n=>{var a,l;const f=Cp(n,t),g=(l=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(a=n[0].style.fontSize)!=null?a:""])!=null?l:"";return g?`${g} ${Bn(f)}`:Bn(f)})}function Mp(e,t,n){return fo(e,"fontFamily").map(a=>{var l,f;const g=Dp(a,t),S=(f={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(l=a[0].style.fontFamily)!=null?l:""])!=null?f:"";return S?`\\${S}{${Bn(g)}}`:a[0].style.fontFamily?`{\\fontfamily{${a[0].style.fontFamily}} ${Bn(g)}}`:n?`\\text{${Bn(g)}}`:Bn(g)})}var bd={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Lp=class extends Xs{constructor(){super("text")}createAtom(e,t,n){return t&&t.definitionType==="symbol"?new Cl(e,String.fromCodePoint(t.codepoint),n!=null?n:{}):null}serialize(e,t){return Mp(e,c($({},t),{defaultMode:"text"}),t.defaultMode!=="text")}getFont(e,t){var n,a,l,f,g;const{fontFamily:S}=t;if(bd[S]?e.classes+=" "+bd[S]:S&&e.setStyle("font-family",S),t.fontShape&&(e.classes+=" ",e.classes+=(n={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape])!=null?n:""),t.fontSeries){const T=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);T&&(e.classes+=" ",e.classes+=(l={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(a=T[1])!=null?a:""])!=null?l:"",e.classes+=" ",e.classes+=(g={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(f=T[2])!=null?f:""])!=null?g:"")}return"Main-Regular"}};new Lp;var Rp=class extends Xs{constructor(){super("latex")}createAtom(e){return new vi(e)}serialize(e,t){return e.filter(n=>n instanceof vi&&!n.isSuggestion).map(n=>n.value)}getFont(){return null}};new Rp;var Ip={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},Dh={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},_d={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},xd={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Op={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},Bp={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Pp={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},Fp={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},Np={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},$p={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},zp={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},Kp={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Up={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function wd(e){const t=e.split("+"),n={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:t.pop()};return t.includes("shift")&&(n.shift=!0),t.includes("alt")&&(n.alt=!0),t.includes("ctrl")&&(n.ctrl=!0),t.includes("cmd")&&(n.cmd=!0),t.includes("win")&&(n.win=!0),t.includes("meta")&&(n.meta=!0),n}function U0(e){let t="";return e.shift&&(t+="shift+"),e.alt&&(t+="alt+"),e.ctrl&&(t+="ctrl+"),e.cmd&&(t+="cmd+"),e.win&&(t+="win+"),e.meta&&(t+="meta+"),t+e.key}var Hp={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},Cu=[],Du;function Mh(){switch(se()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function ya(e){(!e.platform||e.platform===Mh())&&Cu.push(e)}function Gp(e,t){var n;const a={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!e)return a;for(const[l,f]of Object.entries(t.mapping)){if(f[0]===e)return a.key=`[${l}]`,a;if(f[1]===e)return a.shift=!0,a.key=`[${l}]`,a;if(f[2]===e)return a.alt=!0,a.key=`[${l}]`,a;if(f[3]===e)return a.shift=!0,a.alt=!0,a.key=`[${l}]`,a}return a.key=(n=Hp[e])!=null?n:"",a}function Vp(e){if(e.code)return e;const t=Object.entries(Mu().mapping);let n=!1,a=!1,l="";for(let f=0;f<4;f++){for(const[g,S]of t)if(S[f]===e.key){l=g,f===3?(n=!0,a=!0):f===2?n=!0:f===1&&(a=!0);break}if(l)break}return new KeyboardEvent(e.type,c($({},e),{altKey:n,shiftKey:a,code:l}))}function Wp(e){var t,n;if(!e||e.key==="Unidentified"||e.key==="Dead")return;const a=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;for(const l of Cu)((t=l.mapping[e.code])==null?void 0:t[a])===e.key?l.score+=1:(n=l.mapping[e.code])!=null&&n[a]&&(l.score=0);Cu.sort((l,f)=>f.score-l.score)}function jp(e){Du=Cu.find(t=>e.startsWith(t.locale))}function Mu(){return Du!=null?Du:Cu[0]}function qp(){switch(Mh()){case"apple":return Dh;case"windows":return _d;case"linux":return xd}return Dh}switch(Mh()){case"apple":ya(Dh),ya(Op),ya(zp),ya(Fp);break;case"windows":ya(_d),ya(Bp),ya(Kp),ya(Np);break;case"linux":ya(xd),ya(Pp),ya(Up),ya($p);break}ya(Ip);function Lh(e){var t;const n=/macos|ios/.test(se()),a=e.split("+");let l="";for(const f of a)l&&(l+=n?"\u2009":'<span class="ML__shortcut-join">+</span>'),f.startsWith("[Key")?l+=f.slice(4,5):f.startsWith("Key")?l+=f.slice(3,4):f.startsWith("[Digit")?l+=f.slice(6,7):f.startsWith("Digit")?l+=f.slice(5,6):l+=(t={cmd:"\u2318",meta:n?"\u2318":"Ctrl",shift:n?"\u21E7":"Shift",alt:n?"\u2325":"Alt",ctrl:n?"\u2303":"Ctrl","\n":n?"\u23CE":"Return","[return]":n?"\u23CE":"Return","[enter]":n?"\u2324":"Enter","[tab]":n?"\u21E5":"Tab","[escape]":"Esc","[backspace]":n?"\u232B":"Backspace","[delete]":n?"\u2326":"Del","[pageup]":n?"\u21DE":"Page Up","[pagedown]":n?"\u21DF":"Page Down","[home]":n?"\u2912":"Home","[end]":n?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* &#128290;",numpaddivide:"/ &#128290;",numpadsubtract:"- &#128290;",numpadadd:"+ &#128290;",numpaddecimal:". &#128290;",numpadcomma:", &#128290;",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[f.toLowerCase()])!=null?t:f.toUpperCase();return l}function gc(e){if(e instanceof MouseEvent||e instanceof PointerEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const t=[...e.touches].reduce((a,l)=>({x:a.x+l.clientX,y:a.y+l.clientY}),{x:0,y:0}),n=e.touches.length;return{x:t.x/n,y:t.y/n}}}function s0(e){const t={alt:!1,control:!1,shift:!1,meta:!1};return(e instanceof MouseEvent||e instanceof PointerEvent||e instanceof TouchEvent||e instanceof KeyboardEvent)&&(e.altKey&&(t.alt=!0),e.ctrlKey&&(t.control=!0),e.metaKey&&(t.meta=!0),e.shiftKey&&(t.shift=!0)),t}function Zp(e,t){return!e&&t||e&&!t?!1:!e||!t?!0:e.alt===t.alt&&e.control===t.control&&e.shift===t.shift&&e.meta===t.meta}var Yp=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function vc(e){return e.ctrlKey||e.metaKey||["Dead","Process"].includes(e.key)?!1:e.code===""?!0:Yp.has(e.code)}function yc(){var e;let t=document.activeElement;for(;(e=t==null?void 0:t.shadowRoot)!=null&&e.activeElement;)t=t.shadowRoot.activeElement;return t}var yo=class tl{static get scrim(){return tl._scrim||(tl._scrim=new tl),tl._scrim}static open(t){tl.scrim.open(t)}static close(){tl.scrim.close()}static get state(){return tl.scrim.state}static get element(){return tl.scrim.element}constructor(t){var n,a;this.lightDismiss=(n=t==null?void 0:t.lightDismiss)!=null?n:!0,this.translucent=(a=t==null?void 0:t.translucent)!=null?a:!1,this.state="closed"}get element(){if(this._element)return this._element;const t=document.createElement("div");return t.setAttribute("role","presentation"),t.style.position="fixed",t.style.contain="content",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.zIndex="var(--scrim-zindex, 10099)",t.style.outline="none",this.translucent?(t.style.background="rgba(255, 255, 255, .2)",t.style.backdropFilter="contrast(40%)"):t.style.background="transparent",this._element=t,t}open(t){var n;if(this.state!=="closed")return;this.state="opening",this.onDismiss=t==null?void 0:t.onDismiss,this.savedActiveElement=yc();const{element:a}=this;((n=t==null?void 0:t.root)!=null?n:document.body).appendChild(a),a.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const l=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const f=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${f+l}px`,t!=null&&t.child&&a.append(t.child),this.state="open"}close(){var t,n,a,l;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:f}=this;f.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),f.remove(),document.body.style.overflow=(t=this.savedOverflow)!=null?t:"",document.body.style.marginRight=(n=this.savedMarginRight)!=null?n:"",yc()!==this.savedActiveElement&&((l=(a=this.savedActiveElement)==null?void 0:a.focus)==null||l.call(a)),f.innerHTML="",this.state="closed"}handleEvent(t){this.lightDismiss&&(t.target===this._element&&t.type==="click"?(this.close(),t.preventDefault(),t.stopPropagation()):t.target===document&&(t.type==="touchmove"||t.type==="scroll")&&(this.close(),t.preventDefault(),t.stopPropagation()))}};function Xp(e,t,n){let a=null,l=null,f=!1,g=!1,S=!1;const T=new AbortController,R=T.signal;return e.addEventListener("keydown",F=>{if(f||F.key==="Process"||F.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(F.code)){a=null;return}a=F,l=null,n.onKeystroke(F)?e.textContent="":a=null},{capture:!0,signal:R}),e.addEventListener("keypress",F=>{f||(a&&l&&n.onKeystroke(a),l=F)},{capture:!0,signal:R}),e.addEventListener("compositionstart",F=>{e.textContent="",f=!0,n.onCompositionStart(F.data)},{capture:!0,signal:R}),e.addEventListener("compositionupdate",F=>{f&&n.onCompositionUpdate(F.data)},{capture:!0,signal:R}),e.addEventListener("compositionend",F=>{e.textContent="",f&&(f=!1,n.onCompositionEnd(F.data))},{capture:!0,signal:R}),e.addEventListener("beforeinput",F=>F.stopImmediatePropagation(),{signal:R}),e.addEventListener("input",F=>{var X;if(!f&&(e.textContent="",F.inputType!=="insertCompositionText")){if(F.inputType==="insertFromPaste"){F.preventDefault(),F.stopPropagation();return}n.onInput((X=F.data)!=null?X:""),F.preventDefault(),F.stopPropagation()}},{signal:R}),e.addEventListener("paste",F=>{e.focus({preventScroll:!0}),e.textContent="",n.onPaste(F)||F.preventDefault(),F.stopImmediatePropagation()},{signal:R}),e.addEventListener("cut",F=>n.onCut(F),{capture:!0,signal:R}),e.addEventListener("copy",F=>n.onCopy(F),{capture:!0,signal:R}),e.addEventListener("blur",F=>{var X,ve;if(((ve=(X=F.relatedTarget)==null?void 0:X._mathfield)==null?void 0:ve.element)===t){e.focus({preventScroll:!0}),F.preventDefault(),F.stopPropagation();return}const Me=yo.state;if(Me==="open"||Me==="opening"){F.preventDefault(),F.stopPropagation();return}if(F.relatedTarget===F.target.getRootNode().host){F.preventDefault(),F.stopPropagation();return}S||g||(S=!0,a=null,l=null,n.onBlur(),S=!1)},{capture:!0,signal:R}),e.addEventListener("focus",F=>{S||g||(g=!0,n.onFocus(),g=!1)},{capture:!0,signal:R}),{dispose:()=>T.abort(),cancelComposition:()=>{f&&(e.blur(),requestAnimationFrame(()=>e.focus({preventScroll:!0})))},blur:()=>{typeof e.blur=="function"&&e.blur()},focus:()=>{!g&&typeof e.focus=="function"&&e.focus({preventScroll:!0})},hasFocus:()=>yc()===e,setAriaLabel:F=>e.setAttribute("aria-label",F),setValue:F=>{var X;e.textContent=F,e.style.left="-1000px",(X=window.getSelection())==null||X.selectAllChildren(e)},moveTo:(F,X)=>{e.style.top=`${X}px`,e.style.left=`${F}px`}}}function H0(e){var t;if(!e||!vc(e))return"";let n;return e.key==="Unidentified"&&e.target&&(n=e.target.value),n=(t=n!=null?n:e.key)!=null?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(n)&&(n=""),n}function Sd(e){e=Vp(e);const t=[];return e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),t.length===0?`[${e.code}]`:(t.push(`[${e.code}]`),t.join("+"))}function Jp(e){if(M()){const t=se(),n=e.startsWith("!"),a=e.endsWith(t);if(n&&!a||!n&&a)return!0}return e==="!other"?!1:e==="other"}function Qp(e,t,n){if(e.length===0)return"";const a=U0(wd(Sd(n))),l=U0({key:n.key,shift:n.shiftKey,alt:n.altKey,ctrl:n.ctrlKey,meta:n.metaKey||n.ctrlKey&&/macos|ios/.test(se()),cmd:!1,win:!1});for(let f=e.length-1;f>=0;f--)if((e[f].key===a||e[f].key===l)&&(!e[f].ifMode||e[f].ifMode===t))return e[f].command;return""}function Ed(e){let t=e;return A(t)&&(t=t.length>0?t[0]+"("+t.slice(1).join("")+")":""),t}function e1(e,t){let n=[];if(typeof t=="string"){const f=ch[t];A(f)?n=f.slice():f&&n.push(f)}const a=Ed(t),l=new RegExp("^"+a.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const f of e)l.test(Ed(f.command))&&n.push(f.key);return n.map(Lh)}function t1(e,t){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);if(e.ifLayout!==void 0&&(t.score===0||!e.ifLayout.includes(t.id)))return;const n=wd(e.key);let a=e.ifPlatform;if(n.cmd){if(a&&a!=="macos"&&a!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+a+`"
"cmd" modifier can only be used with macOS or iOS platform.`);a||(a=se()==="ios"?"ios":"macos"),n.win=!1,n.cmd=!1,n.meta=!0}if(n.win){if(a&&a!=="windows")throw new Error('Unexpected "win" modifier with platform "'+a+`"
"win" modifier can only be used with Windows platform.`);a="windows",n.win=!1,n.cmd=!1,n.meta=!0}if(a&&!Jp(a))return;if(/^\[.+\]$/.test(n.key))return c($({},e),{key:U0(n)});const l=Gp(n.key,t);if(!l)return c($({},e),{key:U0(n)});if(l.shift&&n.shift||l.alt&&n.alt)throw new Error(`The keybinding ${e.key} (${Rh(e.command)}) is conflicting with the key combination ${U0(l)} using the ${t.displayName} keyboard layout`);return l.shift=l.shift||n.shift,l.alt=l.alt||n.alt,l.meta=n.meta,l.ctrl=n.ctrl,c($({},e),{key:U0(l)})}function Rh(e){if(Array.isArray(e)){const t=[...e];return t.shift()+"("+t.map(n=>typeof n=="string"?`"${n}"`:n.toString()).join(", ")+")"}return e}function r1(e,t){const n=[],a=[];for(const l of e)try{const f=t1(l,t);if(!f)continue;const g=a.find(S=>S.key===f.key&&S.ifMode===f.ifMode);if(g)throw new Error(`Ambiguous key binding ${l.key} (${Rh(l.command)}) matches ${g.key} (${Rh(g.command)}) with the ${t.displayName} keyboard layout`);a.push(f)}catch(f){f instanceof Error&&n.push(f.message)}return[a,n]}var n1=class extends Si{constructor(){super("latex")}createAtom(e){return new vi(e)}onPaste(e,t){if(!t)return!1;const n=typeof t=="string"?t:t.getData("application/x-latex")||t.getData("text/plain");return n&&e.model.contentWillChange({inputType:"insertFromPaste",data:n})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n)&&(e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),Xi(e)),e.startRecording(),!0):!1}insert(e,t,n){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;n||(n={}),n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder");const{silenceNotifications:a}=e;n.silenceNotifications&&(e.silenceNotifications=!0);const l=e.silenceNotifications;e.silenceNotifications=!0,n.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ps(e.selection)):n.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):n.insertionMode==="insertBefore"?e.collapseSelection("backward"):n.insertionMode==="insertAfter"&&e.collapseSelection("forward");const f=[];for(const T of t)We.test(T)&&f.push(new vi(T));let g=e.at(e.position);if(g instanceof Qa&&(g=g.lastChild),!(g.parent instanceof Qa)){const T=new Qa("");g.parent.addChildAfter(T,g),g=T.firstChild}const S=g.parent.addChildrenAfter(f,g);return e.silenceNotifications=l,n.selectionMode==="before"||(n.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(S)):S&&(e.position=e.offsetOf(S))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=a,!0}};function i1(e){return e.atoms.find(t=>t.type==="latexgroup")}function Lu(e){var t,n;const a=e.atoms.find(l=>l.type==="latexgroup");return a?(n=(t=a.body)==null?void 0:t.filter(l=>l.type==="latex"))!=null?n:[]:[]}function kd(e,t){var n;let a=0,l=!1;const f=Number.isFinite(t==null?void 0:t.before)?(n=t==null?void 0:t.before)!=null?n:0:e.lastOffset;for(;a<=f&&!l;){const T=e.at(a);l=T instanceof vi&&T.isSuggestion,l||a++}if(!l)return[void 0,void 0];let g=a,S=!1;for(;g<=f&&!S;){const T=e.at(g);S=!(T instanceof vi&&T.isSuggestion),S||g++}return[a-1,g-1]}new n1;function bc(e){const t=Lu(e.model).filter(n=>n.isSuggestion);if(t.length!==0){e.model.position=e.model.offsetOf(t[0].leftSibling);for(const n of t)n.parent.removeChild(n)}}function Ru(e,t){var n;const{model:a}=e;bc(e);for(const F of Lu(a))F.isError=!1;if(!a.selectionIsCollapsed||e.options.popoverPolicy==="off"){V0(e);return}const l=[];let f=a.at(a.position);for(;f&&f instanceof vi&&/^[a-zA-Z\*]$/.test(f.value);)f=f.leftSibling;if(f&&f instanceof vi&&f.value==="\\")for(l.push(f),f=f.rightSibling;f&&f instanceof vi&&/^[a-zA-Z\*]$/.test(f.value);)l.push(f),f=f.rightSibling;const g=l.map(F=>F.value).join(""),S=et(e,g);if(S.length===0){if(/^\\[a-zA-Z\*]+$/.test(g))for(const F of l)F.isError=!0;V0(e);return}const T=(n=t==null?void 0:t.atIndex)!=null?n:0;e.suggestionIndex=T<0?S.length-1:T%S.length;const R=S[e.suggestionIndex];if(R!==g){const F=l[l.length-1];F.parent.addChildrenAfter([...R.slice(g.length-R.length)].map(X=>new vi(X,{isSuggestion:!0})),F),a0(e,{interactive:!0})}a1(e,S)}function Ad(e){const[t,n]=kd(e,{before:e.position});if(t===void 0||n===void 0)return!1;let a=!1;return e.getAtoms([t,n]).forEach(l=>{l.isSuggestion&&(l.isSuggestion=!1,a=!0)}),a}function G0(e,t="accept",n){var a,l;V0(e);const f=i1(e.model);if(!f)return!1;if(t==="accept-suggestion"||t==="accept-all"){const R=Lu(e.model).filter(F=>F.isSuggestion);if(R.length!==0){for(const F of R)F.isSuggestion=!1;e.model.position=e.model.offsetOf(R[R.length-1])}if(t==="accept-suggestion")return R.length!==0}const S=Lu(e.model).filter(R=>!R.isSuggestion).map(R=>R.value).join(""),T=f.leftSibling;return f.parent.removeChild(f),e.model.position=e.model.offsetOf(T),e.switchMode((a=n==null?void 0:n.mode)!=null?a:"math"),t==="reject"||(Si.insert(e.model,S,{selectionMode:(l=n==null?void 0:n.selectItem)!=null&&l?"item":"placeholder",format:"latex",mode:"math"}),e.snapshot(),e.model.announce("replacement"),e.switchMode("math")),!0}function _c(e){var t;let n=document.getElementById(e);return n?n.dataset.refcount=Number(Number.parseInt((t=n.dataset.refcount)!=null?t:"0")+1).toString():(n=document.createElement("div"),n.setAttribute("aria-hidden","true"),n.dataset.refcount="1",n.id=e,document.body.append(n)),n}function Ih(e){var t;const n=document.getElementById(e);if(!n)return;const a=Number.parseInt((t=n.getAttribute("data-refcount"))!=null?t:"0");a<=1?n.remove():n.dataset.refcount=Number(a-1).toString()}function s1(e,t){const n=new Hn({from:e.context}),a=new Bt({mode:"math",type:"root",body:un(t,{context:n})}),l=Al(Au(new rr(a.render(n),{classes:"ML__base"}),n));return L0(l,{classes:"ML__latex"}).toMarkup()}function a1(e,t){var n;if(t.length===0){V0(e);return}let a="";for(const[f,g]of t.entries()){const S=g,T=s1(e,g),R=e1(e.keybindings,S).join("<br>");a+=`<li role="button" data-command="${S}" ${f===e.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${S}</span><span class="ML__popover__command">${T}</span>`,R&&(a+=`<span class="ML__popover__keybinding">${R}</span>`),a+="</li>"}const l=o1(e,`<ul>${a}</ul>`);Oh()&&((n=l.querySelector(".ML__popover__current"))==null||n.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var f;l&&!Oh()&&(l.classList.add("is-visible"),xc(e),(f=l.querySelector(".ML__popover__current"))==null||f.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function Oh(){const e=document.getElementById("mathlive-suggestion-popover");return e?e.classList.contains("is-visible"):!1}function xc(e,t){var n;if(!e.element||e.element.mathfield!==e||!Oh())return;if(((n=e.model.at(e.model.position))==null?void 0:n.type)!=="latex"){V0(e);return}if(t!=null&&t.deferred){setTimeout(()=>xc(e),32);return}const a=Ml(e.field);if(!a)return;const l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=window.innerWidth-document.documentElement.clientWidth,S=window.innerHeight-document.documentElement.clientHeight,T=window.mathVirtualKeyboard.boundingRect.height,R=document.getElementById("mathlive-suggestion-popover");a.x+R.offsetWidth/2>f-g?R.style.left=`${f-R.offsetWidth-g}px`:a.x-R.offsetWidth/2<0?R.style.left="0":R.style.left=`${a.x-R.offsetWidth/2}px`;const F=a.y-a.height;l-S-T-a.y<F?(R.classList.add("ML__popover--reverse-direction"),R.classList.remove("top-tip"),R.classList.add("bottom-tip"),R.style.top=`${a.y-a.height-R.offsetHeight-15}px`):(R.classList.remove("ML__popover--reverse-direction"),R.classList.add("top-tip"),R.classList.remove("bottom-tip"),R.style.top=`${a.y+15}px`)}function V0(e){e.suggestionIndex=0;const t=document.getElementById("mathlive-suggestion-popover");t&&(t.classList.remove("is-visible"),t.innerHTML="")}function o1(e,t){let n=document.getElementById("mathlive-suggestion-popover");return n||(n=_c("mathlive-suggestion-popover"),Ja("suggestion-popover"),Ja("core"),n.addEventListener("pointerdown",a=>a.preventDefault()),n.addEventListener("click",a=>{let l=a.target;for(;l&&!l.dataset.command;)l=l.parentElement;l&&(G0(e,"reject"),Si.insert(e.model,l.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),e.dirty=!0,e.focus())})),n.innerHTML=window.MathfieldElement.createHTML(t),n}function l1(){document.getElementById("mathlive-suggestion-popover")&&(Ih("mathlive-suggestion-popover"),vo("suggestion-popover"),vo("core"))}function u1(){const e=String(new Error().stack).replace(/^Error.*\n/,"").split(`
`);if(e.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let t=e[1],n=t.match(/http.*\.ts[\?:]/);return n&&(t=e[2]),n=t.match(/(https?:.*):[0-9]+:[0-9]+/),n||(n=t.match(/at (.*(\.ts))[\?:]/),n||(n=t.match(/at (.*(\.mjs|\.js))[\?:]/))),n?n[1]:(console.error(e),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${t}").`),"")}var wc=null,Td,Cd,Bh=((Cd=(Td=globalThis==null?void 0:globalThis.document)==null?void 0:Td.currentScript)==null?void 0:Cd.src)||u1();function Dd(e){return $l(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(wc===null)try{const t=yield fetch(Bh,{method:"HEAD"});t.status===200&&(wc=t.url)}catch(t){console.error(`Invalid URL "${e}" (relative to "${Bh}")`)}return new URL(e,wc!=null?wc:Bh).href})}function c1(e,t,n={}){return new FontFace(e,`url(${t}.woff2) format('woff2')`,n)}var ba="not-loaded";function h1(){return $l(this,null,function*(){return ba="not-loaded",Sc()})}function Sc(){return $l(this,null,function*(){var e;if(ba!=="not-loaded")return;if(ba="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){ba="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const n=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],a=Array.from(document.fonts).map(g=>g.family);if(n.every(g=>a.includes(g))){ba="ready";return}if(!window.MathfieldElement.fontsDirectory){ba="not-loaded";return}const l=yield Dd(window.MathfieldElement.fontsDirectory);if(!l){document.body.classList.add("ML__fonts-did-not-load"),ba="error";return}const f=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(g=>c1(g[0].replace(/-[a-zA-Z]+$/,""),`${l}/${g[0]}`,g[1]));try{(yield Promise.all(f.map(S=>{try{return S.load()}catch(T){}}))).forEach(S=>document.fonts.add(S)),ba="ready";return}catch(g){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${l}"`,{cause:g}),document.body.classList.add("ML__fonts-did-not-load")}ba="error"}})}function d1(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n),t=t|0;return Math.abs(t)}function Xi(e,t){e&&(e.dirty||(e.dirty=!0,requestAnimationFrame(()=>{Yo(e)&&e.dirty&&(e.atomBoundsCache=new Map,a0(e,t),e.atomBoundsCache=void 0)})))}function f1(e,t){var n;t=t!=null?t:{};const a=new Hn({from:c($({},e.context),{atomIdsSettings:{seed:t.forHighlighting?d1(Bt.serialize([e.model.root],{expandMacro:!1,defaultMode:e.options.defaultMode})):"random",groupNumbers:(n=t.forHighlighting)!=null?n:!1},letterShapeStyle:e.options.letterShapeStyle}),mathstyle:e.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),l=e.model.root.render(a);return L0(Au(l,a),{classes:e.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function Md(e,t){const{model:n}=e;n.root.caret=void 0,n.root.isSelected=!1,n.root.containsCaret=!0;for(const l of n.atoms)l.caret=void 0,l.isSelected=!1,l.containsCaret=!1;if(n.selectionIsCollapsed){const l=n.at(n.position);l.caret=e.model.mode;let f=l.parent;for(;f;)f.containsCaret=!0,f=f.parent}else{const l=n.getAtoms(n.selection,{includeChildren:!0});for(const f of l)f.isSelected=!0}return f1(e,t).toMarkup()}function a0(e,t){if(!Yo(e))return;t!=null||(t={});const n=e.element.querySelector("[part=virtual-keyboard-toggle]");n&&(n.style.display=e.hasEditableContent?"":"none");const a=e.field;if(!a)return;const l=e.isSelectionEditable&&e.hasFocus(),f=a.classList.contains("ML__focused");f&&!l?a.classList.remove("ML__focused"):!f&&l&&a.classList.add("ML__focused");let g=Md(e,t);const S=e.element.querySelector("[part=menu-toggle]");if(S&&(e.model.atoms.length<=1||e.disabled||e.readOnly&&!e.hasEditableContent||e.userSelect==="none"?S.style.display="none":S.style.display=""),e.model.atoms.length<=1){const T=e.options.contentPlaceholder;T&&(g+=`<span part=placeholder class="ML__content-placeholder">${Ls(T)}</span>`)}a.innerHTML=window.MathfieldElement.createHTML(g),Ec(e,t.interactive),e.dirty=!1}function Ec(e,t){const n=e.field;if(!n)return;for(const S of n.querySelectorAll(".ML__selection, .ML__contains-highlight"))S.remove();!(t!=null&&t)&&ba!=="error"&&ba!=="ready"&&setTimeout(()=>{ba==="ready"?Ec(e):setTimeout(()=>Ec(e),128)},32);const a=e.model,l=n.offsetWidth,f=n.getBoundingClientRect().width;let g=Math.floor(f)/l;if(g=isNaN(g)?1:g,a.selectionIsCollapsed){xc(e,{deferred:!0});let S=a.at(a.position);for(;S&&S.type!=="prompt"&&!(S.containsCaret&&S.displayContainsHighlight);)S=S.parent;if(S!=null&&S.containsCaret&&S.displayContainsHighlight){const T=lc(e,t0(e,S),g);if(T){T.left/=g,T.right/=g,T.top/=g,T.bottom/=g;const R=document.createElement("div");R.classList.add("ML__contains-highlight"),R.style.position="absolute",R.style.left=`${T.left+1}px`,R.style.top=`${Math.ceil(T.top)}px`,R.style.width=`${Math.ceil(T.right-T.left)}px`,R.style.height=`${Math.ceil(T.bottom-T.top)}px`,n.insertBefore(R,n.childNodes[0])}}return}for(const S of p1(bu(e,{excludeAtomsWithBackground:!0}))){S.left/=g,S.right/=g,S.top/=g,S.bottom/=g;const T=document.createElement("div");T.classList.add("ML__selection"),T.style.position="absolute",T.style.left=`${S.left}px`,T.style.top=`${S.top}px`,T.style.width=`${Math.ceil(S.right-S.left)}px`,T.style.height=`${Math.ceil(S.bottom-S.top-1)}px`,n.insertBefore(T,n.childNodes[0])}}function p1(e){let t=[];for(const n of e){let a=!1;for(const l of t)if(n.left===l.left&&n.right===l.right&&n.top===l.top&&n.bottom===l.bottom){a=!0;break}a||t.push(n)}e=t,t=[];for(const n of e){let a=0;for(const l of e)if(n.left>=l.left&&n.right<=l.right&&n.top>=l.top&&n.bottom<=l.bottom&&(a+=1,a>1))break;a===1&&t.push(n)}return t}var Ld=3,bo;function pa(e,t){t=$({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},t!=null?t:{}),bo||(bo={});for(const n of Object.keys(e))console.assert(!bo[n],"Selector already defined: ",n),bo[n]=c($({},t),{fn:e[n]})}function Ph(e){let t;if(Array.isArray(e)){if(e[0]==="performWithFeedback")return Ph(e[1]);t=e[0]}else t=e;return t=t.replace(/-\w/g,n=>n[1].toUpperCase()),bo[t]}function W0(e){var t;return(t=Ph(e))==null?void 0:t.target}function m1(e,t){var n;if(!t)return!1;let a,l=[],f=!1,g=!1;A(t)?(a=t[0],l=t.slice(1)):a=t,a=a.replace(/-\w/g,R=>R[1].toUpperCase());const S=bo[a],T=S==null?void 0:S.target;if(T==="model"){if(!e.isSelectionEditable&&(S!=null&&S.changeContent))return e.model.announce("plonk"),!1;/^(delete|add)/.test(a)&&(a!=="deleteBackward"&&e.flushInlineShortcutBuffer(),e.snapshot(a)),/^complete/.test(a)||bc(e),bo[a].fn(e.model,...l),Ru(e),g=!0,f=!0}else if(T==="virtual-keyboard")g=(n=window.mathVirtualKeyboard.executeCommand(t))!=null?n:!1,f=!0;else if(bo[a]){if(!e.isSelectionEditable&&(S!=null&&S.changeContent))return e.model.announce("plonk"),!1;/^(undo|redo)/.test(a)&&e.flushInlineShortcutBuffer(),g=bo[a].fn(e,...l),f=!0}else throw new Error(`Unknown command "${a}"`);return T!=="virtual-keyboard"&&(!e.model.selectionIsCollapsed||S!=null&&S.changeSelection&&t!=="deleteBackward")&&(e.flushInlineShortcutBuffer(),S!=null&&S.changeContent||e.stopCoalescingUndo(),e.defaultStyle={}),g&&Xi(e),f}function g1(e,t){var n;if(!e)return!1;e.focus(),Tf.keypressVibration&&re()&&navigator.vibrate(Ld);const a=Ph(t);window.MathfieldElement.playSound((n=a==null?void 0:a.audioFeedback)!=null?n:"keypress");const l=e.executeCommand(t);return e.scrollIntoView(),l}pa({performWithFeedback:(e,t)=>g1(e,t)});function v1(e){return Ru(e,{atIndex:e.suggestionIndex+1}),!1}function y1(e){return Ru(e,{atIndex:e.suggestionIndex-1}),!1}pa({complete:G0},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),pa({nextSuggestion:v1,previousSuggestion:y1},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var kc="mathlive#virtual-keyboard-message";function Fh(e){var t;return e.type!=="message"?!1:((t=e.data)==null?void 0:t.type)===kc}var b1=class hp{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new hp),this._singleton}set alphabeticLayout(t){this.sendMessage("update-setting",{alphabeticLayout:t})}set layouts(t){this.sendMessage("update-setting",{layouts:t})}get normalizedLayouts(){return[]}set editToolbar(t){this.sendMessage("update-setting",{editToolbar:t})}set actionKeycap(t){this.sendMessage("update-setting",{actionKeycap:t})}set shiftKeycap(t){this.sendMessage("update-setting",{shiftKeycap:t})}set backspaceKeycap(t){this.sendMessage("update-setting",{backspaceKeycap:t})}set tabKeycap(t){this.sendMessage("update-setting",{tabKeycap:t})}set container(t){throw new Error("Container inside an iframe cannot be changed")}show(t){this.sendMessage("show",t)}hide(t){this.sendMessage("hide",t)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(t){t?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(t){return this.sendMessage("execute-command",{command:t}),!0}updateToolbar(t){this.sendMessage("update-toolbar",t)}update(t){this.sendMessage("update-setting",t)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(t,n,a){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(n)||this.listeners[t].add(n)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(n=>{typeof n=="function"?n(t):n==null||n.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,n,a){this.listeners[t]&&this.listeners[t].delete(n)}handleEvent(t){if(Fh(t)){if(!_u(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");this.handleMessage(t.data)}}handleMessage(t){const{action:n}=t;if(n==="execute-command"){const{command:a}=t;W0(a)==="virtual-keyboard"&&this.executeCommand(a);return}if(n==="synchronize-proxy"){this._boundingRect=t.boundingRect,this._isShifted=t.isShifted;return}if(n==="geometry-changed"){this._boundingRect=t.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(t,n={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage($({type:kc,action:t},n),this.targetOrigin)}},Rd={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"&alpha;&beta;&gamma;",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>&#x03c6;</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>&#x03c2;</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>&#x03f5;</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>&rho;</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>&tau;</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>&upsilon;</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>&theta;</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>&iota;</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>&omicron;</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>&pi;</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>&alpha;</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>&sigma;</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>&delta;</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>&gamma;</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>&eta;</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>&xi;</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>&kappa;</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>&lambda;</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>&zeta;</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>&chi;</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>&psi;</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>&omega;</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>&beta;</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>&nu;</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>&mu;</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>&#x03b5;</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>&#x03d1;</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>&#x3f0;</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>&#x03d6;</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>&#x03f1;</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"&infin;\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
.minimalist-backdrop {
display: flex;
justify-content: center;
}
.minimalist-container {
--keycap-height: 40px;
--keycap-max-width: 53px;
--keycap-small-font-size: 12px;
background: var(--keyboard-background);
padding: 20px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid var(--keyboard-border);
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
}
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Ac={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},Iu;function Id(e,t){var n,a,l;const f=Bl.singleton;if(!f)return;const g=j0(e),S=(a=(n=f.getKeycap(g==null?void 0:g.id))==null?void 0:n.variants)!=null?a:"";if(typeof S=="string"&&!Od(S)||Array.isArray(S)&&S.length===0){t==null||t();return}const T={};let R="";for(const _t of x1(S)){const tr=Pd(_t),pt=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);T[pt]=tr;const[Ht,ur]=Tc(tr);R+=`<div id=${pt} class="item ${ur}">${Ht}</div>`}const F=document.createElement("div");F.setAttribute("aria-hidden","true"),F.className="MLK__variant-panel",F.style.height="auto";const X=Object.keys(T).length;let ve=5;X===1?ve=1:X===2||X===4?ve=2:X===3||X===5||X===6?ve=3:X>=7&&X<14&&(ve=4),F.style.width=`calc(var(--variant-keycap-length) * ${ve} + 12px)`,F.innerHTML=Tf.createHTML(R),yo.open({root:(l=f==null?void 0:f.container)==null?void 0:l.querySelector(".ML__keyboard"),child:F}),Iu=new AbortController;const{signal:Me}=Iu,ze=e==null?void 0:e.getBoundingClientRect();if(ze){ze.top-F.clientHeight<0&&(F.style.width="auto",X<=6?F.style.height="56px":X<=12?F.style.height="108px":X<=18?F.style.height="205px":F.classList.add("compact"));const _t=Math.max(0,Math.min(window.innerWidth-F.offsetWidth,(ze.left+ze.right-F.offsetWidth)/2)),tr=ze.top-F.clientHeight+5;F.style.transform=`translate(${_t}px, ${tr}px)`,F.classList.add("is-visible"),requestAnimationFrame(()=>{F.addEventListener("pointerup",pt=>{const Ht=j0(pt.target);!(Ht!=null&&Ht.id)||!T[Ht.id]||(Nh(T[Ht.id]),Ou(),t==null||t(),pt.preventDefault())},{capture:!0,passive:!1,signal:Me}),F.addEventListener("pointerenter",pt=>{const Ht=j0(pt.target);!(Ht!=null&&Ht.id)||!T[Ht.id]||Ht.classList.add("is-active")},{capture:!0,signal:Me}),F.addEventListener("pointerleave",pt=>{const Ht=j0(pt.target);!(Ht!=null&&Ht.id)||!T[Ht.id]||Ht.classList.remove("is-active")},{capture:!0,signal:Me}),window.addEventListener("pointercancel",()=>{Ou(),t==null||t()},{signal:Me}),window.addEventListener("pointerup",()=>{Ou(),t==null||t()},{signal:Me})})}}function Ou(){Iu==null||Iu.abort(),Iu=null,yo.state==="open"&&yo.close()}function _1(e){if(e==="foreground-color"){const t=[];for(const n of Object.keys(ye))t.push({class:"swatch-button",label:'<span style="border: 3px solid '+ye[n]+'"></span>',command:["applyStyle",{color:n}]});return t}if(e==="background-color"){const t=[];for(const n of Object.keys(Te))t.push({class:"swatch-button",label:'<span style="background:'+Te[n]+'"></span>',command:["applyStyle",{backgroundColor:n}]});return t}}function Od(e){return Ac[e]!==void 0}function x1(e){var t;return typeof e!="string"?e:(Ac[e]||(Ac[e]=(t=_1(e))!=null?t:[]),Ac[e])}function w1(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n} !important`).join(";")}function S1(e){return Object.keys(e).map(t=>`${t} {${w1(e[t])}}`).join("")}function Bu(e){if(!e)return"";const t=new Hn,n=new Bt({mode:"math",type:"root",body:un(e,{context:t,args:l=>l==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),a=Al(Au(new rr(n.render(t),{classes:"ML__base"}),t));return L0(a,{classes:"ML__latex"}).toMarkup()}function Pu(e){var t;if(Array.isArray(e))return e.map(a=>Pu(a)).flat();const n=typeof e=="string"?{markup:e}:e;return"rows"in n&&Array.isArray(n.rows)&&(n.rows=n.rows.map(a=>a.map(l=>Pd(l)))),(t=n.id)!=null||(n.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[n]}function E1(){var e,t;let a=window.mathVirtualKeyboard.alphabeticLayout;if(a==="auto"){const S=Mu();S&&(a=S.virtualLayout),(!a||a==="auto")&&(a=(e={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[Z.locale.slice(0,2)])!=null?e:"qwerty")}const l={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},f=(t=l[a])!=null?t:l.qwerty,g=a==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const S of f){const T=[];for(const R of S)/[a-z]/.test(R)?T.push({label:R,class:"hide-shift",shift:{label:R.toUpperCase()},variants:Od(R)?R:void 0}):R==="~"?a!=="dvorak"?T.push("[backspace]"):T.push({label:"[backspace]",width:1}):R==="^"?T.push("[shift]"):R===" "&&T.push("[separator-5]");g.push(T)}return g.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:Pu({rows:g})}}function Bd(e){if(e==="alphabetic")return E1();if(typeof e=="string")return console.assert(Rd[e]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${e}"`),Bd(Rd[e]);let t;if("rows"in e&&Array.isArray(e.rows)){console.assert(!("layers"in e||"markup"in e),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const l=e,{rows:f}=l,g=V(l,["rows"]);t=c($({},g),{layers:Pu({rows:e.rows})})}else if("markup"in e&&typeof e.markup=="string"){const l=e,{markup:f}=l,g=V(l,["markup"]);t=c($({},g),{layers:Pu(e.markup)})}else t=$({},e),"layers"in e?t.layers=Pu(e.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let n=!1,a=!1;for(const l of t.layers)if(l.rows)for(const f of l.rows.flat()){q0(f)&&(n=!0);const g=f.command;typeof g=="string"&&["undo","redo","cut","copy","paste"].includes(g)&&(a=!0)}return(!("displayShiftedKeycaps"in e)||e.displayShiftedKeycaps===void 0)&&(t.displayShiftedKeycaps=n),(!("displayEditToolbar"in e)||e.displayEditToolbar===void 0)&&(t.displayEditToolbar=!a),t}function k1(e,t){var n,a;let l='<div class="left">';if(e.normalizedLayouts.length>1)for(const[f,g]of e.normalizedLayouts.entries()){const S=g,T=[f===t?"selected":"layer-switch"];S.tooltip&&T.push("MLK__tooltip"),S.labelClass&&T.push(...S.labelClass.split(" ")),l+=`<div class="${T.join(" ")}"`,S.tooltip&&(l+=" data-tooltip='"+((n=le(S.tooltip))!=null?n:S.tooltip)+"' "),f!==t&&(l+=`data-layer="${S.layers[0].id}"`),l+=`>${(a=S.label)!=null?a:"untitled"}</div>`}return l+="</div>",l}function A1(e,t){let n="";if(e.editToolbar==="none")return"";const l=[];t.selectionIsCollapsed?l.push("undo","redo","pasteFromClipboard"):l.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const f={undo:`<div class='action ${t.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${le("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${t.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${le("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${le("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${le("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${le("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return n+=l.map(g=>f[g]).join(""),n}function T1(e){for(const t of e)C1(t)}function C1(e){const t=Bl.singleton;if(!t)return;const n={};if(!e.id){if(e.hasAttribute("data-label")&&(n.label=e.dataset.label),e.hasAttribute("data-latex")&&(n.latex=e.dataset.latex),e.hasAttribute("data-key")&&(n.key=e.dataset.key),e.hasAttribute("data-insert")&&(n.insert=e.dataset.insert),e.hasAttribute("data-variants")&&(n.variants=e.dataset.variants),e.hasAttribute("data-aside")&&(n.aside=e.dataset.aside),e.className&&(n.class=e.className),!n.label&&!n.latex&&!n.key&&!n.insert&&(n.latex=e.innerText,n.label=e.innerHTML),e.hasAttribute("data-command"))try{n.command=JSON.parse(e.dataset.command)}catch(a){}e.id=t.registerKeycap(n)}if(!e.innerHTML){const[a,l]=Tc(n);e.innerHTML=window.MathfieldElement.createHTML(a)}}function D1(){Ja("virtual-keyboard"),Ja("core"),Sc()}function M1(){vo("core"),vo("virtual-keyboard")}var L1=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
</symbol>
<symbol id="svg-shift" viewBox="0 0 384 512">
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
</symbol>
<symbol id="svg-commit" viewBox="0 0 512 512">
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
</symbol>
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
<symbol id="svg-command" viewBox="0 0 640 512">
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
</symbol>
<symbol id="svg-undo" viewBox="0 0 512 512">
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
</symbol>
<symbol id="svg-redo" viewBox="0 0 512 512">
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
</symbol>
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
</symbol>
<symbol id="svg-tab" viewBox="0 0 448 512">
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
</symbol>
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
</symbol>
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
</symbol>
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
</symbol>
<symbol id="svg-trash" viewBox="0 0 448 512">
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
</symbol>
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
</svg>`;function R1(e){e.resetKeycapRegistry(),D1();const t=document.createElement("div");t.className="ML__keyboard";const n=document.createElement("div");n.className="MLK__plate",n.innerHTML=window.MathfieldElement.createHTML(L1+e.normalizedLayouts.map((g,S)=>I1(e,g,S)).join(""));const a=document.createElement("div");a.className="MLK__backdrop",a.appendChild(n),t.appendChild(a),t.addEventListener("pointerdown",B1,{passive:!1});const l=t.querySelectorAll(".ML__edit-toolbar");if(l)for(const g of l)g.addEventListener("click",S=>{var T,R;let F=S.target,X="";for(;F&&!X;)X=(T=F==null?void 0:F.getAttribute("data-command"))!=null?T:"",F=(R=F==null?void 0:F.parentElement)!=null?R:null;X&&e.executeCommand(JSON.parse(X))});T1(t.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const f=t.querySelectorAll(".MLK__layer");console.assert(f.length>0,"No virtual keyboards available");for(const g of f)g.addEventListener("pointerdown",S=>S.preventDefault());return e.currentLayer=e.latentLayer,t}function I1(e,t,n){const a=[];if(!("layers"in t))return"";for(const l of t.layers)a.push(`<div tabindex="-1" class="MLK__layer" id="${l.id}">`),(e.normalizedLayouts.length>1||t.displayEditToolbar)&&(a.push("<div class='MLK__toolbar' role='toolbar'>"),a.push(k1(e,n)),t.displayEditToolbar&&a.push('<div class="ML__edit-toolbar right"></div>'),a.push("</div>")),a.push(O1(e,l)),a.push("</div>");return a.join("")}function O1(e,t){if(typeof t=="string")return t;let n="";if(typeof t.style=="string"?n+=`<style>${t.style}</style>`:typeof t.style=="object"&&(n+=`<style>${S1(t.style)}</style>`),t.backdrop&&(n+=`<div class='${t.backdrop}'>`),t.container&&(n+=`<div class='${t.container}'>`),t.rows){n+="<div class=MLK__rows>";for(const a of t.rows){n+="<div dir='ltr' class=MLK__row>";for(const l of a)if(l){const f=e.registerKeycap(l),[g,S]=Tc(l);/(^|\s)separator/.test(S)?n+=`<div class="${S}"`:n+=`<div tabindex="-1" id="${f}" class="${S}"`,l.tooltip&&(n+=` data-tooltip="${l.tooltip}"`),n+=`>${g}</div>`}n+="</div>"}n+="</div>"}else t.markup&&(n+=t.markup);return t.container&&(n+="</div>"),t.backdrop&&(n+="</div>"),n}function Tc(e,t={shifted:!1}){var n,a,l,f,g,S,T;let R="",F=(n=e.class)!=null?n:"";if(t.shifted&&q0(e)&&(F+=" is-active"),t.shifted&&"shift"in e)typeof e.shift=="string"?R=Bu(e.shift):typeof e.shift=="object"&&(R=e.shift.label?e.shift.label:(a=Bu(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?a:""),typeof e.shift=="object"&&(F=(f=(l=e.shift.class)!=null?l:e.class)!=null?f:"");else{if(R=e.label?e.label:(g=Bu(e.latex||e.insert||"")||e.key)!=null?g:"",e.shift){let X;typeof e.shift=="string"?X=Bu(e.shift):e.shift.label?X=e.shift.label:X=(S=Bu(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?S:"",R+=`<span class="MLK__shift">${X}</span>`}e.aside&&(R+=`<aside>${e.aside}</aside>`)}return e.layer&&!/layer-switch/.test(F)&&(F+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(F)||(F+=" MLK__keycap"),!/\bw[0-9]+\b/.test(F)&&e.width&&(F+=(T={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[e.width])!=null?T:""),[R,F||"MLK__keycap"]}var o0={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"&#x2212;",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"&divide;"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"&times;",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function Pd(e){var t;if(typeof e=="string"){if(e==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(e="[,]"),!o0[e])return{latex:e};e={label:e}}let n;return"label"in e&&e.label&&o0[e.label]&&(n=c($($({},o0[e.label]),e),{label:o0[e.label].label})),"key"in e&&e.key&&o0[e.key]&&(n=c($($({},o0[e.key]),e),{key:o0[e.key].key})),n?(n.command==="insertDecimalSeparator"&&(n.label=(t=window.MathfieldElement.decimalSeparator)!=null?t:"."),e.label==="[action]"&&(n=$($({},n),window.mathVirtualKeyboard.actionKeycap)),e.label==="[shift]"&&(n=$($({},n),window.mathVirtualKeyboard.shiftKeycap)),e.label==="[backspace]"&&(n=$($({},n),window.mathVirtualKeyboard.backspaceKeycap)),e.label==="[tab]"&&(n=$($({},n),window.mathVirtualKeyboard.tabKeycap)),n):e}var Fu;function B1(e){var t;if(e.button!==0)return;const n=Bl.singleton;if(!n)return;let a=e.target;for(;a&&!a.getAttribute("data-layer");)a=a.parentElement;if(a){n.currentLayer=(t=a.getAttribute("data-layer"))!=null?t:"",e.preventDefault();return}const l=j0(e.target);if(!(l!=null&&l.id))return;const f=n.getKeycap(l.id);if(!f)return;console.assert(e.type==="pointerdown");const g=new AbortController,S=g.signal;l.classList.add("is-pressed"),l.addEventListener("pointerenter",Cc(g),{capture:!0,signal:S}),l.addEventListener("pointerleave",Cc(g),{capture:!0,signal:S}),l.addEventListener("pointercancel",Cc(g),{signal:S}),l.addEventListener("pointerup",Cc(g),{signal:S}),q0(f)&&(l.classList.add("is-active"),n.shiftPressCount++),f.variants&&(Fu&&clearTimeout(Fu),Fu=setTimeout(()=>{l.classList.contains("is-pressed")&&(l.classList.remove("is-pressed"),l.classList.add("is-active"),e.target&&"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId),Id(l,()=>{g.abort(),l==null||l.classList.remove("is-active")}))},300)),e.preventDefault()}function Cc(e){return t=>{const n=j0(t.target);if(!(n!=null&&n.id))return;const a=Bl.singleton;if(!a)return;const l=a.getKeycap(n.id);if(l){if(t.type==="pointerenter"&&t.target===n&&t.isPrimary&&n.classList.add("is-pressed"),t.type==="pointercancel"){n.classList.remove("is-pressed"),q0(l)&&(a.shiftPressCount--,n.classList.toggle("is-active",a.isShifted)),e.abort();return}if(t.type==="pointerleave"&&t.target===n){n.classList.remove("is-pressed"),q0(l)&&(a.shiftPressCount--,n.classList.toggle("is-active",a.isShifted));return}if(t.type==="pointerup"){Fu&&clearTimeout(Fu),q0(l)?n.classList.toggle("is-active",a.isShifted):n.classList.contains("is-pressed")&&(n.classList.remove("is-pressed"),a.isShifted&&l.shift?typeof l.shift=="string"?a.executeCommand(["insert",l.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):Nh(l.shift):Nh(l),a.shiftPressCount===1&&!t.shiftKey&&(a.shiftPressCount=0)),e.abort(),t.preventDefault();return}}}}function Nh(e){var t;let n=e.command;!n&&e.insert&&(n=["insert",e.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!n&&e.key&&(n=["typedText",e.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!n&&e.latex&&(n=["insert",e.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),n||(n=["typedText",e.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(t=Bl.singleton)==null||t.executeCommand(n)}function P1(e){if(e.nodeType!==1)return!1;const t=e.classList;return t.contains("MLK__keycap")||t.contains("shift")||t.contains("action")||t.contains("fnbutton")||t.contains("bigfnbutton")}function j0(e){if(!e)return;let t=e;for(;t&&!P1(t);)t=t.parentElement;return t!=null?t:void 0}function q0(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var Bl=class dp{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var t,n,a;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(n=(t=window.document)==null?void 0:t.body)!=null?n:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(l=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(a=window.top)==null||a.addEventListener("message",this)}catch(l){window.addEventListener("message",this)}document.body.addEventListener("focusin",l=>{const f=l.target;f!=null&&f.isConnected&&setTimeout(()=>{const g=Fd();g&&!g.readOnly&&g.mathVirtualKeyboardPolicy==="auto"&&I()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",l=>{l.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{Fd()||this.hide()},300)})}get currentLayer(){var t,n,a;return(a=(n=(t=this._element)==null?void 0:t.querySelector(".MLK__layer.is-visible"))==null?void 0:n.id)!=null?a:""}set currentLayer(t){var n;if(!this._element){this.latentLayer=t;return}let a=t?this._element.querySelector(`#${t}.MLK__layer`):null;a||(a=this._element.querySelector(".MLK__layer")),a&&((n=this._element.querySelector(".MLK__layer.is-visible"))==null||n.classList.remove("is-visible"),a.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(t){var n;this._shiftPressCount=t>2||t<0?0:t,(n=this._element)==null||n.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(t){const n="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[n]=t,n}getKeycap(t){return t?this.keycapRegistry[t]:void 0}getLayer(t){const n=this.normalizedLayouts;for(const a of n)for(const l of a.layers)if(l.id===t)return l}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(t){this._alphabeticLayout=t,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(t){this._actionKeycap=typeof t=="string"?{label:t}:t}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(t){this._shiftKeycap=typeof t=="string"?{label:t}:t}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(t){this._backspaceKeycap=typeof t=="string"?{label:t}:t}get tabKeycap(){return this._tabKeycap}set tabKeycap(t){this._tabKeycap=typeof t=="string"?{label:t}:t}get layouts(){return this._layouts}set layouts(t){this.updateNormalizedLayouts(t),this.rebuild()}updateNormalizedLayouts(t){const n=Array.isArray(t)?[...t]:[t],a=n.findIndex(l=>l==="default");a>=0&&n.splice(a,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(n),this._normalizedLayouts=n.map(l=>Bd(l))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(t){this._editToolbar=t,this.rebuild()}get container(){return this._container}set container(t){this._container=t,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new dp}catch(t){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(t,n,a){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(n)||this.listeners[t].add(n)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(n=>{typeof n=="function"?n(t):n==null||n.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,n,a){this.listeners[t]&&this.listeners[t].delete(n)}get element(){return this._element}set element(t){var n;this._element!==t&&((n=this._element)==null||n.remove(),this._element=t)}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get boundingRect(){var t;if(!this._visible)return new DOMRect;const n=(t=this._element)==null?void 0:t.getElementsByClassName("MLK__plate")[0];return n?n.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var t,n;const a=this.boundingRect.height;if(this.container===document.body){(t=this._element)==null||t.style.setProperty("--_keyboard-height",`calc(${a}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const l=a-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${l}px)`:`${l}px`}else(n=this._element)==null||n.style.setProperty("--_keyboard-height",`${a}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const t=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=t,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const t=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(t&&(t.backdrop||t.container)));const n=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(n)for(const a of n){const l=this.getKeycap(a.id);if(l){const[f,g]=Tc(l,{shifted:this.isShifted});a.innerHTML=window.MathfieldElement.createHTML(f),a.className=g}}}show(t){var n;if(this._visible)return;const a=this.container;if(a&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const l=this._element.getElementsByClassName("MLK__plate")[0];if(l&&this.observer.observe(l),a===window.document.body){const f=a.style.paddingBottom;this.originalContainerBottomPadding=f;const g=l.offsetHeight-1;a.style.paddingBottom=f?`calc(${f} + ${g}px)`:`${g}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(n=this._element)==null||n.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,t!=null&&t.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var l;return(l=this._element)==null?void 0:l.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(t){var n;const a=this.container;if(a&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const l=this._element.getElementsByClassName("MLK__plate")[0];l&&this.observer.unobserve(l),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),Ou(),M1(),(n=this._element)==null||n.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(a.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var t,n;return(n=(t=this.element)==null?void 0:t.offsetHeight)!=null?n:0}buildAndAttachElement(){var t;console.assert(!this.element),this.element=R1(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",n=>{n.shiftKey||((n.ctrlKey||n.button===2)&&Id(n.target),n.preventDefault(),n.stopPropagation())},{capture:!0}),(t=this.container)==null||t.appendChild(this.element)}handleEvent(t){if(Fh(t)){if(!_u(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");t.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:t.data.action!=="update-setting"&&t.data.action!=="proxy-created"&&t.data.action!=="execute-command"&&(console.assert(t.source!==void 0),this.connectedMathfieldWindow=t.source),this.handleMessage(t.data,t.source)}if(this._element)switch(t.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":t.button!==2&&t.preventDefault();break;case"keydown":{t.key==="Shift"&&!t.repeat&&(this.shiftPressCount=1);break}case"keyup":{(t.key==="Shift"||!t.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(t,n){const{action:a}=t;if(a==="execute-command"){const{command:l}=t,f=W0(l);if(window.top!==void 0&&f!=="virtual-keyboard")return;this.executeCommand(l);return}if((a==="connect"||a==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},n),a!=="disconnect"&&window===window.top){if(a==="show"){typeof t.animate!="undefined"?this.show({animate:t.animate}):this.show();return}if(a==="hide"){typeof t.animate!="undefined"?this.hide({animate:t.animate}):this.hide();return}if(a==="update-setting"){t.alphabeticLayout&&(this.alphabeticLayout=t.alphabeticLayout),t.layouts&&(this.layouts=t.layouts),t.editToolbar&&(this.editToolbar=t.editToolbar);return}if(a==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},n);return}}}sendMessage(t,n,a){if(a||(a=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||a===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:$({type:kc,action:t},n)}));return}if(a)a.postMessage($({type:kc,action:t},n),{targetOrigin:this.targetOrigin});else if(n.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:n.command})),t==="execute-command"&&Array.isArray(n.command)&&n.command[0]==="insert"){const l=n.command[1].split("");for(const f of l)this.dispatchEvent(new KeyboardEvent("keydown",{key:f,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:f,bubbles:!0}))}}stateWillChange(t){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:t},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(t){const n=this._element;if(!n)return;n.classList.toggle("is-math-mode",t.mode==="math"),n.classList.toggle("is-text-mode",t.mode==="text"),n.classList.toggle("can-undo",t.canUndo),n.classList.toggle("can-redo",t.canRedo),n.classList.toggle("can-copy",!t.selectionIsCollapsed),n.classList.toggle("can-copy",!t.selectionIsCollapsed),n.classList.toggle("can-paste",!0);const a=n.querySelectorAll(".ML__edit-toolbar");if(a)for(const l of a)l.innerHTML=A1(this,t)}update(t){this._style=t.style,this.updateToolbar(t)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(t){let n,a=[],l=W0(t);return A(t)?(n=t[0],n==="performWithFeedback"&&(t=t.slice(1),l=W0(t)),a=t.slice(1)):n=t,n=n.replace(/-\w/g,f=>f[1].toUpperCase()),l==="virtual-keyboard"?bo[n].fn(void 0,...a):(this.sendMessage("execute-command",{command:t}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function Fd(){var e,t;let n=yc(),a=null;for(;n;){if("host"in n&&((t=(e=n.host)==null?void 0:e.tagName)==null?void 0:t.toLowerCase())==="math-field"){a=n.host;break}n=n.parentNode}return a}if(M()&&!("mathVirtualKeyboard"in window))if(window===window.top){const e=Bl.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>b1.singleton,configurable:!0});function Dc(e){const t={};for(const n of Object.keys(e))switch(n){case"scriptDepth":const a=e.scriptDepth;if(A(a))t.scriptDepth=[a[0],a[1]];else if(typeof a=="number")t.scriptDepth=[a,a];else if(typeof a=="string"){const[f,g]=a.split(",").map(S=>parseInt(S.trim()));t.scriptDepth=[f,g]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let l=e.mathVirtualKeyboardPolicy.toLowerCase();if(l==="sandboxed"){if(window!==window.top){const f=Bl.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>f})}l="manual"}t.mathVirtualKeyboardPolicy=l;break;case"letterShapeStyle":e.letterShapeStyle==="auto"?Z.locale.startsWith("fr")?t.letterShapeStyle="french":t.letterShapeStyle="tex":t.letterShapeStyle=e.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(e.defaultMode)?t.defaultMode=e.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),t.defaultMode="math");break;case"macros":t.macros=He(e.macros);break;default:A(e[n])?t[n]=[...e[n]]:typeof e[n]=="object"&&!(e[n]instanceof Element)&&n!=="computeEngine"?t[n]=$({},e[n]):t[n]=e[n]}return t}function l0(e,t){let n;typeof t=="string"?n=[t]:t===void 0?n=Object.keys(e):n=t;const a={};for(const l of n)e[l]===null?a[l]=null:A(e[l])?a[l]=[...e[l]]:typeof e[l]=="object"&&!(e[l]instanceof Element)&&l!=="computeEngine"?a[l]=$({},e[l]):a[l]=e[l];return typeof t=="string"?a[t]:a}function Mc(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:st,backgroundColorMap:ft,letterShapeStyle:Z.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:e=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(e),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:uh,inlineShortcuts:ic,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:lh,value:""}}function Nd(e){return e.defaultMode==="inline-math"?"math":e.defaultMode}function Pl(e,t){!e||!t||(A(e)?e.forEach(n=>Pl(n,t)):typeof e=="object"&&!e.style.color&&!e.style.backgroundColor&&!e.style.fontFamily&&!e.style.fontShape&&!e.style.fontSeries&&!e.style.fontSize&&!e.style.variant&&!e.style.variantStyle&&(e.applyStyle(t),Pl(e.body,t),Pl(e.above,t),Pl(e.below,t),Pl(e.subscript,t),Pl(e.superscript,t)))}function $h(e,t,n,a){function l(g,S){for(const T of f)if(T.style[g]!==S)return!1;return!0}if(t=e.normalizeRange(t),t[0]===t[1])return!1;const f=e.getAtoms(t,{includeChildren:!0});a.operation==="toggle"&&(n.color&&l("color",n.color)&&(n.color="none",delete n.verbatimColor),n.backgroundColor&&l("backgroundColor",n.backgroundColor)&&(n.backgroundColor="none",delete n.verbatimBackgroundColor),n.fontFamily&&l("fontFamily",n.fontFamily)&&(n.fontFamily="none"),n.fontSeries&&l("fontSeries",n.fontSeries)&&(n.fontSeries="auto"),n.fontShape&&l("fontShape",n.fontShape)&&(n.fontShape="auto"),n.fontSize&&l("fontSize",n.fontSize)&&(n.fontSize=Go),n.variant&&l("variant",n.variant)&&(n.variant="normal"),n.variantStyle&&l("variantStyle",n.variantStyle)&&(n.variantStyle=""));for(const g of f)g.applyStyle(n);return!0}function F1(e,t){const n=e.at(e.position);if(n.type==="composition")n.value=t;else{const{caret:a}=n;n.caret=void 0;const l=new $e(t,{mode:n.mode});l.caret=a,n.parent.addChildAfter(l,n),e.position+=1}}function N1(e){const t=e.at(e.position);t.type==="composition"&&(t.parent.removeChild(t),e.position-=1)}hr(["math","displaymath"],Fa),hr("center",Fa),Ke("displaylines","",{parse:e=>{const t=[];let n=[];e.beginContext({tabular:!0});do{if(e.end()||e.match("<}>"))break;e.matchColumnSeparator()||e.matchRowSeparator()?(t.push([n]),n=[]):n.push(...e.scan(a=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(a)))}while(!0);return e.endContext(),t.push([n]),t},createAtom:e=>new N("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Yt("array","{columns:colspec}",(e,t,n,a)=>new N(e,zh(t),n,{columns:a[0],mathstyleName:"textstyle"})),Yt(["equation","equation*","subequations"],"",(e,t,n)=>new N(e,zh(t),n,{columns:[{align:"c"}]})),Yt(["multline","multline*"],"",Fa),Yt(["align","align*","aligned","eqnarray"],"",Fa),Yt("split","",Fa),Yt(["gather","gathered"],"",Fa),Yt(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Fa),Yt(["smallmatrix","smallmatrix*"],"[columns:colspec]",Fa),Yt(["cases","dcases","rcases"],"",Fa);function $1(e){for(const t of e)for(const n of t)if(n.length>0)return!1;return!0}function zh(e,t=1){return $1(e)?Array(t).fill([[new Bt({type:"first"}),new i]]):e.map(n=>n.length===0?[[new Bt({type:"first"})]]:n.map(a=>a.length===0?[new Bt({type:"first"})]:(a[0].type!=="first"&&a.unshift(new Bt({type:"first"})),a)))}function Fa(e,t=[[[]]],n=[],a=[]){switch(t=zh(t,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":return new N(e,t,n,{mathstyleName:"textstyle"});case"displaymath":return new N(e,t,n,{mathstyleName:"textstyle"});case"center":return new N(e,t,n,{columns:[{align:"c"}]});case"multline":case"multline*":return new N(e,t,n,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new N(e,t,n,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new N(e,t,n,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new N(e,t,n,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:u0(a[0])});case"bmatrix":case"bmatrix*":return new N(e,t,n,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:u0(a[0])});case"Bmatrix":case"Bmatrix*":return new N(e,t,n,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:u0(a[0])});case"vmatrix":case"vmatrix*":return new N(e,t,n,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:u0(a[0])});case"Vmatrix":case"Vmatrix*":return new N(e,t,n,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:u0(a[0])});case"matrix":case"matrix*":return new N(e,t,n,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:u0(a==null?void 0:a[0])});case"smallmatrix":case"smallmatrix*":return new N(e,t,n,{mathstyleName:"scriptstyle",columns:u0(a==null?void 0:a[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new N(e,t,n,{mathstyleName:e==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new N(e,t,n,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new N(e,t,n,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let l=0;for(const S of t)l=Math.max(l,S.length);const f=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let g=2;for(;g<l;)f.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),g+=2;return f.push({gap:0}),new N(e,t,n,{arraycolsep:0,columns:f,minColumns:2})}}return new N(e,t,n,{mathstyleName:"textstyle"})}function u0(e){return e!=null?e:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function z1(e,t){let n=e.at(e.position);for(;n&&!(n.parent instanceof N);)n=n.parent;if(n&&n.type==="array"&&n.environmentName,!n||!(n.parent instanceof N)){const a=e.at(e.position);if(n=a,!n.parent.parent){let l=e.extractAtoms([e.position,e.lastOffset]),f=e.extractAtoms([0,e.position]);f.length===0&&(f=Ic()),l.length===0&&(l=Ic());let g;return t.endsWith("column")?(g=Fa("split",[[f,l]]),e.root=g,c0(g,0,0)?h0(e,g,0,0):c0(g,0,1)?h0(e,g,0,1):e.position=e.offsetOf(a)):(g=Fa("lines",[[f],[l]]),e.root=g,c0(g,0,0)?h0(e,g,0,0):c0(g,1,0)?h0(e,g,1,0):e.position=e.offsetOf(a)),[void 0,[0,0]]}if(n.parent instanceof At){const l=n.parent;let f=e.extractAtoms([e.position,e.offsetOf(l.lastChild)]),g=e.extractAtoms([e.offsetOf(l.firstChild),e.position]);g.length===0&&(g=Ic()),f.length===0&&(f=Ic());let S="pmatrix";const T=l.leftDelim,R=l.rightDelim;T==="("&&(R===")"||R==="?")?S="pmatrix":(T==="["||T==="\\lbrack")&&(R==="]"||R==="\\rbrack"||R==="?")?S="bmatrix":T==="\\vert"&&R==="\\vert"?S="vmatrix":T==="\\Vert"&&R==="\\Vert"?S="Vmatrix":(T==="{"||T==="\\lbrace")&&(R==="."||R==="?")&&(S="cases");const F=Fa(S,t.endsWith("column")?[[g,f]]:[[g],[f]]);return l.parent.addChildBefore(F,l),l.parent.removeChild(l),c0(F,0,0)?h0(e,F,0,0):t.endsWith("column")?c0(F,0,1)?h0(e,F,0,1):e.position=e.offsetOf(n):c0(F,1,0)?h0(e,F,1,0):e.position=e.offsetOf(n),[void 0,[0,0]]}}return n&&n.parent instanceof N?[n.parent,n.parentBranch]:[void 0,[0,0]]}function c0(e,t,n){const a=e.getCell(t,n);return!a||a.length!==2?!1:a[1].type==="placeholder"}function K1(e,t,n,a){const l=t.getCell(n,a);return l?[e.offsetOf(l[0]),e.offsetOf(l[l.length-1])]:-1}function h0(e,t,n,a){const l=K1(e,t,n,a);typeof l!="number"&&e.setSelection(l)}function Lc(e,t,n,a,l){const f=t.getCell(n,a);f&&e.setPositionHandlingPlaceholder(e.offsetOf(f[l==="start"?0:f.length-1]))}function Rc(e,t){const[n,[a,l]]=z1(e,t);if(n)switch(t){case"after row":n.addRowAfter(a),Lc(e,n,a+1,0,"end");break;case"after column":if(n.maxColumns<=n.colCount){e.announce("plonk");return}n.addColumnAfter(l),Lc(e,n,a,l+1,"end");break;case"before row":n.addRowBefore(a),Lc(e,n,a,0,"start");break;case"before column":if(n.maxColumns<=n.colCount){e.announce("plonk");return}n.addColumnBefore(l),Lc(e,n,a,l,"start");break}}function $d(e){return e.contentWillChange({inputType:"insertText"})?(Rc(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function U1(e){return e.contentWillChange({inputType:"insertText"})?(Rc(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function zd(e){return e.contentWillChange({inputType:"insertText"})?(Rc(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function H1(e){return e.contentWillChange({inputType:"insertText"})?(Rc(e,"before column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Kd(e,t){if(!e.contentWillChange({}))return!1;e.mathfield.snapshot();let n=".",a=".";switch(t){case"pmatrix":case"pmatrix*":n="(",a=")";break;case"bmatrix":case"bmatrix*":n="[",a="]";break;case"Bmatrix":case"Bmatrix*":n="\\lbrace",a="\\rbrace";break;case"vmatrix":case"vmatrix*":n="\\vert",a="\\vert";break;case"Vmatrix":case"Vmatrix*":n="\\Vert",a="\\Vert";break;case"matrix":case"matrix*":n=".",a=".";break;case"cases":case"dcases":n="\\lbrace";break;case"rcases":a="\\rbrace";break}const l=e.at(e.position),f=l.type==="array"?l:e.parentEnvironment;return f.environmentName=t,f.leftDelim=n,f.rightDelim=a,e.contentDidChange({}),!0}function Ud(e,t){let n=e.at(e.position);for(;n&&!(Array.isArray(n.parentBranch)&&n.parent instanceof N);)n=n.parent;if(Array.isArray(n==null?void 0:n.parentBranch)&&(n==null?void 0:n.parent)instanceof N){const a=n.parent,l=n.parentBranch;let f;switch(t){case"row":if(a.rowCount>1){a.removeRow(l[0]);const g=a.getCell(Math.max(0,l[0]-1),l[1]);f=e.offsetOf(g[g.length-1])}break;case"column":if(a.colCount>a.minColumns){a.removeColumn(l[1]);const g=a.getCell(l[0],Math.max(0,l[1]-1));f=e.offsetOf(g[g.length-1])}break}f&&e.setPositionHandlingPlaceholder(f)}}function G1(e){return e.contentWillChange({inputType:"deleteContent"})?(Ud(e,"row"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}function V1(e){return e.contentWillChange({inputType:"deleteContent"})?(Ud(e,"column"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}pa({addRowAfter:$d,addColumnAfter:zd,addRowBefore:U1,addColumnBefore:H1,removeRow:G1,removeColumn:V1,setEnvironment:Kd},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Ic(){return[new i]}var Hd=class fp{constructor(t){this.recording=!1,this.model=t,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(t){t&&this.index>=0&&(this.stack[this.index].selection=t),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(t){return this.recording?(t&&t===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>fp.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=t!=null?t:"",!0):!1}};Hd.maximumDepth=1e3;var W1=Hd;function Kh(e,t,n){if(e.at(t).mode!=="text")return t;const a=n==="backward"?-1:1;let l;if(Ye.test(e.at(t).value)){let f=t,g;do g=e.at(f).mode==="text"&&Ye.test(e.at(f).value),f+=a;while(e.at(f)&&g);l=e.at(f)?f-2*a:f-a}else if(/\s/.test(e.at(t).value)){let f=t;for(;e.at(f)&&e.at(f).mode==="text"&&/\s/.test(e.at(f).value);)f+=a;if(!e.at(f))l=f-a;else{let g=!0;do g=e.at(f).mode==="text"&&!/\s/.test(e.at(f).value),f+=a;while(e.at(f)&&g);l=e.at(f)?f-2*a:f-a}}else{let f=t;for(;e.at(f)&&e.at(f).mode==="text"&&!/\s/.test(e.at(f).value);)f+=a;l=e.at(f)?f:f-a;let g=!0;for(;e.at(f)&&g;)g=e.at(f).mode==="text"&&/\s/.test(e.at(f).value),g&&(l=f),f+=a;l=e.at(f)?f-2*a:f-a}return l-(a>0?0:1)}function Z0(e,t,n){var a,l,f,g,S,T,R;const F=e.position;(a=n==null?void 0:n.extend)!=null&&a||e.collapseSelection(t);let X=e.at(e.position);if(t==="forward"&&(X.type==="subsup"?(X=X.rightSibling,X||(X=e.at(e.position+1))):X=e.at(e.position+1)),!X)return e.announce("plonk"),!1;let ve=e.offsetOf(X);if(X instanceof Cl)ve=Kh(e,ve,t);else if(X instanceof vi)if(X.isSuggestion)for(console.assert(t==="forward");X&&X instanceof vi;)X.isSuggestion=!1,ve=e.offsetOf(X),X=X.rightSibling;else if(t==="forward"){if(X=X.rightSibling,!X||!(X instanceof vi))return e.announce("plonk"),!1;for(;X&&X instanceof vi&&/[a-zA-Z\*]/.test(X.value);)ve=e.offsetOf(X),X=X.rightSibling}else{if(X=X.leftSibling,!X||!(X instanceof vi))return e.announce("plonk"),!1;for(;X&&X instanceof vi&&/[a-zA-Z\*]/.test(X.value);)ve=e.offsetOf(X),X=X.leftSibling}else if(t==="forward"&&X.type==="mopen"){let Me=0;do X.type==="mopen"?Me+=1:X.type==="mclose"&&(Me-=1),X=X.rightSibling;while(!X.isLastSibling&&Me!==0);ve=e.offsetOf(X.leftSibling)}else if(t==="backward"&&X.type==="mclose"){let Me=0;do X.type==="mopen"?Me+=1:X.type==="mclose"&&(Me-=1),X=X.leftSibling;while(!X.isFirstSibling&&Me!==0);ve=e.offsetOf(X)}else if(t==="backward")if(X.type==="first")for(;ve>0&&X.type==="first";)ve-=1,X=e.at(ve);else{const Me=X.type;X.type==="subsup"&&(ve=e.offsetOf(e.at(ve).leftSibling)),ve-=1;let ze=(l=e.at(ve))==null?void 0:l.type;for(;ve>=0&&ze===Me;)((f=e.at(ve))==null?void 0:f.type)==="subsup"?ve=e.offsetOf(e.at(ve).leftSibling):ve-=1,ze=e.at(ve).type}else{const{type:Me}=X;let ze=(g=e.at(ve))==null?void 0:g.type;const{lastOffset:_t}=e;for(;ve<=_t&&(ze===Me||ze==="subsup");){for(;((S=e.at(ve).rightSibling)==null?void 0:S.type)==="subsup";)ve=e.offsetOf(e.at(ve).rightSibling);ve+=1,ze=(T=e.at(ve))==null?void 0:T.type}ve-=1}if((R=n==null?void 0:n.extend)!=null&&R){if(!e.setSelection(e.anchor,ve))return e.announce("plonk"),!1}else{if(ve===e.position)return e.announce("plonk"),!1;e.position=ve}return e.announce("move",F),e.mathfield.stopCoalescingUndo(),!0}function _o(e,t,n){var a,l;if(n=n!=null?n:{extend:!1},e.mathfield.adoptStyle=t==="backward"?"right":"left",t!=="forward"){const[S,T]=kd(e);S!==void 0&&T!==void 0&&e.deleteAtoms([S,T])}if(t==="upward")return q1(e,n);if(t==="downward")return Z1(e,n);if(n.extend){let S=Oc(e,e.position,t);S<0&&(S=0),S>e.lastOffset&&(S=e.lastOffset);const T=e.setSelection(e.anchor,S);return e.mathfield.stopCoalescingUndo(),T}if(e.selectionIsPlaceholder){e.collapseSelection(t);const S=_o(e,t);return e.mathfield.stopCoalescingUndo(),S}let f=e.position;const g=f;if(e.collapseSelection(t)?(f=e.position,Gd(e,f)||(f=Oc(e,f,t))):f=Oc(e,f,t),f<0||f>e.lastOffset){let S=!0;return e.silenceNotifications||(S=(l=(a=e.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))!=null?l:!0),S&&e.announce("plonk"),S}return e.setPositionHandlingPlaceholder(f),e.mathfield.stopCoalescingUndo(),e.announce("move",g),!0}function Oc(e,t,n){return t=t+(n==="forward"?1:-1),t<0||t>e.lastOffset||Gd(e,t)?t:Oc(e,t,n)}function Gd(e,t){var n;const a=e.at(t);let l=a.parent;for(;l&&!l.inCaptureSelection;)l=l.parent;return!(l!=null&&l.inCaptureSelection||(n=a.parent)!=null&&n.skipBoundary&&(!a.isFirstSibling&&a.isLastSibling||a.type==="first")||e.mathfield.hasEditablePrompts&&!a.parentPrompt)}function j1(e,t,n){let a=1/0,l=0;for(;l<t.length;l++){const f=xu(e.getHTMLElement(t[l])).right,g=Math.abs(n-f);if(g<=a)a=g;else break}return t[l-1]}function Bc(e,t,n,a,l){const f=e.mathfield.hasEditablePrompts,g=f?n.filter(R=>R.type==="prompt"&&!R.captureSelection):n,S=xu(e.mathfield.getHTMLElement(t)).right,T=e.offsetOf(j1(e.mathfield,g,S))-(f?1:0);if(a){const[R,F]=e.selection.ranges[0];let X;T<(l==="up"?R:F)?X={ranges:[[T,F]],direction:"backward"}:X={ranges:[[R,T]],direction:"forward"},e.setSelection(X)}else e.setPositionHandlingPlaceholder(T);e.announce(`move ${l}`)}function q1(e,t){var n,a;const l=(n=t==null?void 0:t.extend)!=null?n:!1;l||e.collapseSelection("backward");const f=()=>{var T,R;let F=!0;return e.silenceNotifications||(F=(R=(T=e.mathfield.host)==null?void 0:T.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?R:!0),e.announce(F?"plonk":"line"),F},g=e.at(e.position);let S=g;for(;S&&S.parentBranch!=="below"&&!(Array.isArray(S.parentBranch)&&S.parent instanceof N);)S=S.parent;if(Array.isArray(S==null?void 0:S.parentBranch)&&S.parent instanceof N){const T=S.parent;if(S.parentBranch[0]<1)return f();const R=S.parentBranch[0]-1,F=T.array[R][S.parentBranch[1]];if(!F.some(ve=>ve.type==="prompt"&&!ve.captureSelection)&&e.mathfield.hasEditablePrompts)return f();Bc(e,g,F,l,"up")}else if(S){const T=(a=S.parent.branch("above"))!=null?a:S.parent.createBranch("above");if(!T.some(F=>F.type==="prompt"&&F.placeholderId)&&e.mathfield.hasEditablePrompts)return f();Bc(e,g,T,l,"up")}else return f();return e.mathfield.stopCoalescingUndo(),!0}function Z1(e,t){var n,a;const l=(n=t==null?void 0:t.extend)!=null?n:!1;l||e.collapseSelection("forward");const f=()=>{var T,R;let F=!0;return e.silenceNotifications||(F=(R=(T=e.mathfield.host)==null?void 0:T.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?R:!0),e.announce(F?"plonk":"line"),F},g=e.at(e.position);let S=g;for(;S&&S.parentBranch!=="above"&&!(Array.isArray(S.parentBranch)&&S.parent instanceof N);)S=S.parent;if(Array.isArray(S==null?void 0:S.parentBranch)&&S.parent instanceof N){const T=S.parent;if(S.parentBranch[0]+1>T.array.length-1)return f();const R=S.parentBranch[0]+1,F=T.array[R][S.parentBranch[1]];if(!F.some(ve=>ve.type==="prompt"&&!ve.captureSelection)&&e.mathfield.hasEditablePrompts)return f();Bc(e,g,F,l,"down")}else if(S){const T=(a=S.parent.branch("below"))!=null?a:S.parent.createBranch("below");if(!T.some(F=>F.type==="prompt")&&e.mathfield.hasEditablePrompts)return f();Bc(e,g,T,l,"down")}else return f();return!0}function Vd(e){const t=e.position,n=e.at(t).parent;return n!=null&&n.parent?(e.position=e.offsetOf(n),e.mathfield.stopCoalescingUndo(),e.announce("move",t),!0):(e.announce("plonk"),!1)}function Y1(e){let t=0,n=e.at(e.position),a=!1;for(;n;)(!n.hasEmptyBranch("superscript")||!n.hasEmptyBranch("subscript"))&&(t+=1),n.hasEmptyBranch("superscript")?n.hasEmptyBranch("subscript")||(a=!1):a=!0,n=n.parent;return a?t:0}function X1(e){let t=0,n=e.at(e.position),a=!1;for(;n;)(!n.hasEmptyBranch("superscript")||!n.hasEmptyBranch("subscript"))&&(t+=1),n.hasEmptyBranch("superscript")?n.hasEmptyBranch("subscript")||(a=!0):a=!1,n=n.parent;return a?t:0}function Wd(e){var t;if(e.collapseSelection(),Y1(e)>=e.mathfield.options.scriptDepth[1])return e.announce("plonk"),!1;let n=e.at(e.position);return n.subsupPlacement===void 0&&(((t=n.rightSibling)==null?void 0:t.type)!=="subsup"&&n.parent.addChildAfter(new Or({style:n.computedStyle}),n),n=n.rightSibling),n.createBranch("superscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(n.superscript[0]))),!0}function jd(e){var t;if(e.collapseSelection(),X1(e)>=e.mathfield.options.scriptDepth[0])return e.announce("plonk"),!1;let n=e.at(e.position);return n.subsupPlacement===void 0&&(((t=e.at(e.position+1))==null?void 0:t.type)!=="subsup"&&n.parent.addChildAfter(new Or({style:e.at(e.position).computedStyle}),n),n=e.at(e.position+1)),n.createBranch("subscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(n.subscript[0]))),!0}function J1(){function e(T){const R=[],F=[];return[...T.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(t).forEach((ve,Me)=>{const ze=a(ve);ze===0?R.push(ve):F.push({documentOrder:Me,tabIndex:ze,node:ve})}),F.sort((ve,Me)=>ve.tabIndex===Me.tabIndex?ve.documentOrder-Me.documentOrder:ve.tabIndex-Me.tabIndex).map(ve=>ve.node).concat(R)}function t(T){return!(!n(T)||l(T)||a(T)<0)}function n(T){return!(T.disabled||T.type==="hidden"&&T.tagName.toUpperCase()==="INPUT"||S(T))}function a(T){var R;const F=Number.parseInt((R=T.getAttribute("tabindex"))!=null?R:"NaN",10);return Number.isNaN(F)?T.contentEditable==="true"||(T.nodeName==="AUDIO"||T.nodeName==="VIDEO")&&T.getAttribute("tabindex")===null?0:T.tabIndex:F}function l(T){return T.tagName.toUpperCase()==="INPUT"&&T.type==="radio"&&!g(T)}function f(T,R){for(const F of T)if(F.checked&&F.form===R)return F;return null}function g(T){var R;if(!T.name)return!0;const X=((R=T.form)!=null?R:T.ownerDocument).querySelectorAll('input[type="radio"][name="'+T.name+'"]'),ve=f(X,T.form);return!ve||ve===T}function S(T){if(!M()||T===document.activeElement||T.contains(document.activeElement))return!1;if(getComputedStyle(T).visibility==="hidden")return!0;const R=T.getBoundingClientRect();if(R.width===0||R.height===0)return!0;for(;T;){if(getComputedStyle(T).display==="none")return!0;T=T.parentElement}return!1}return M()?e(document.body):[]}function Js(e,t,n="forward"){const a=e.position;if(Array.isArray(t)){const l=e.offsetOf(t[0]),f=e.offsetOf(t[t.length-1]);return n==="forward"?e.setSelection(l,f):e.setSelection(f,l),e.announce("move",a),e.mathfield.stopCoalescingUndo(),!0}return n==="forward"?Js(e,[t.leftSibling,t]):Js(e,[t,t.leftSibling])}function eo(e,t){const n=e.position;if(typeof t=="number"&&(t=e.at(t)),t.type==="prompt")e.setSelection(e.offsetOf(t.firstChild),e.offsetOf(t.lastChild));else{const a=e.offsetOf(t);t.type==="placeholder"?e.setSelection(a-1,a):e.position=a}return e.announce("move",n),e.mathfield.stopCoalescingUndo(),!0}function Pc(e,t,n=!0){var a,l;const f=t==="forward"?1:-1;e.at(e.anchor).type==="placeholder"&&_o(e,t);let g;const S=e.at(e.anchor).parentPrompt;S?t==="forward"?g=e.offsetOf(S)+1:g=e.offsetOf(S.leftSibling):g=Math.max(e.position+f,0);const T=Uh(e,g,t);if(!T||t==="forward"&&e.offsetOf(T)<g||t==="backward"&&e.offsetOf(T)>g){if(!n||!((l=(a=e.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))==null||l))return e.announce("plonk"),!1;const F=J1();if(!document.activeElement||F.length<=1)return e.announce("plonk"),!1;let X=F.indexOf(document.activeElement)+f;return X<0&&(X=F.length-1),X>=F.length&&(X=0),F[X].focus(),e.mathfield.stopCoalescingUndo(),!0}return eo(e,T),!0}function Uh(e,t=0,n="forward"){return e.findAtom(a=>a.type==="placeholder"||a.type==="prompt"||!e.mathfield.readOnly&&a.treeDepth>2&&a.isFirstSibling&&a.isLastSibling,t,n)}pa({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},n=e.at(e.position),{parent:a}=n;if(!a)return e.announce("plonk"),!1;const l=n.parentBranch;let f;if(typeof l=="string"&&(f=t[l]),!f){const S=n.subsupPlacement?jd(e):Wd(e);return e.mathfield.stopCoalescingUndo(),S}a.branch(f)||a.createBranch(f);const g=e.setSelection(e.getBranchRange(e.offsetOf(a),f));return e.mathfield.stopCoalescingUndo(),g},moveBeforeParent:e=>{const{parent:t}=e.at(e.position);return t?(e.position=e.offsetOf(t),e.mathfield.stopCoalescingUndo(),!0):(e.announce("plonk"),!1)},moveAfterParent:e=>Vd(e),moveToNextChar:e=>_o(e,"forward"),moveToPreviousChar:e=>_o(e,"backward"),moveUp:e=>_o(e,"upward"),moveDown:e=>_o(e,"downward"),moveToNextWord:e=>Z0(e,"forward"),moveToPreviousWord:e=>Z0(e,"backward"),moveToGroupStart:e=>{const t=e.offsetOf(e.at(e.position).firstSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:e=>{const t=e.offsetOf(e.at(e.position).lastSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:e=>{var t,n,a,l;if(e.position===e.lastOffset&&e.anchor===e.lastOffset)return Pc(e,"forward");const f=e.at(e.position);if(f.mode==="text"){if(e.selectionIsCollapsed){let ve=f;for(;ve&&ve.mode==="text";)ve=ve.leftSibling;let Me=f;for(;((t=Me.rightSibling)==null?void 0:t.mode)==="text";)Me=Me.rightSibling;if(ve&&Me)return Js(e,[ve,Me])}if(f.rightSibling.mode==="text"){let ve=f;for(;ve&&ve.mode==="text";)ve=ve.rightSibling;return ve?(eo(e,(n=ve.leftSibling)!=null?n:ve),e.mathfield.switchMode("math"),!0):eo(e,e.lastOffset)}}const S=e.at(e.anchor).parentPrompt,T=S?e.offsetOf(S)+1:Math.max(e.position+1,0),R=Uh(e,T,"forward");if(R)return eo(e,R);const F=qd(e,f,ve=>ve.type==="leftright"||ve.type==="text","forward");if(F){if(F.mode==="text"){let ve=F;for(;ve&&ve.mode==="text";)ve=ve.rightSibling;return Js(e,[(a=F.leftSibling)!=null?a:F,(l=ve.leftSibling)!=null?l:ve])}return Js(e,F)}const X=f.parent;if(X){if(X.type==="leftright"||X.type==="surd")return Js(e,X);if(f.parentBranch==="superscript"&&X.subscript)return Js(e,X.subscript);if(f.parentBranch==="above"&&X.below)return Js(e,X.below);if(f.parentBranch==="superscript"||f.parentBranch==="subscript")return eo(e,X);if(f.parentBranch==="above"||f.parentBranch==="below")return Js(e,X)}return eo(e,e.lastOffset)},moveToPreviousGroup:e=>{var t;if(e.position===0&&e.anchor===0)return Pc(e,"backward");let n=e.at(e.position);const a=n.mode;if(a==="text"){if(e.selectionIsCollapsed){let S=n;for(;S&&S.mode==="text";)S=S.leftSibling;let T=n;for(;((t=T.rightSibling)==null?void 0:t.mode)==="text";)T=T.rightSibling;if(S&&T)return Js(e,[S,T])}for(;n&&n.mode==="text";)n=n.leftSibling;return n?eo(e,n):eo(e,0)}const l=e.at(e.anchor).parentPrompt,f=l?e.offsetOf(l.leftSibling):Math.max(e.position-1,0),g=Uh(e,f,"backward");if(g)return eo(e,g);if(a==="math"){const S=qd(e,n,R=>R.type==="leftright"||R.type==="text","backward");if(S){if(S.mode==="text"){let R=S;for(;R&&R.mode==="text";)R=R.leftSibling;return Js(e,[S,R])}return Js(e,S)}const T=n.parent;if(T){if(T.type==="leftright"||T.type==="surd")return Js(e,T);if(n.parentBranch==="subscript"&&T.superscript)return Js(e,T.superscript);if(n.parentBranch==="below"&&T.above)return Js(e,T.above);if(n.parentBranch==="superscript"||n.parentBranch==="subscript")return eo(e,T);if(n.parentBranch==="above"||n.parentBranch==="below")return Js(e,T)}return eo(e,0)}return!1},moveToMathfieldStart:e=>e.selectionIsCollapsed&&e.position===0?(e.announce("plonk"),!1):(e.position=0,e.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:e=>e.selectionIsCollapsed&&e.position===e.lastOffset?(e.announce("plonk"),!1):(e.position=e.lastOffset,e.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:Wd,moveToSubscript:jd},{target:"model",changeSelection:!0}),pa({moveToNextPlaceholder:e=>Pc(e,"forward"),moveToPreviousPlaceholder:e=>Pc(e,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function qd(e,t,n,a){if(a==="forward"){let f=t.rightSibling;for(;f&&!n(f);)f=f.rightSibling;return f}let l=t.leftSibling;for(;l&&!n(l);)l=l.leftSibling;return l}function Fc(e,t,n){typeof t=="function"&&(n=t,t=1/0),t===void 0&&(t=1/0);let a=e.position,l=!1,f="";for(;!l;){const g=e.at(a);l=t===0||g===void 0||g.type==="first"||g.mode!=="math"||!(g.type&&/mord|mpunct|operator/.test(g.type)||g.type==="mop"&&/[a-zA-Z ]+/.test(g.value))||!g.hasEmptyBranch("superscript")||!g.hasEmptyBranch("subscript")||typeof n=="function"&&!n(g),l||(g.mode="text",g.command=g.value,g.verbatimLatex=void 0,f+=g.value),a-=1,t-=1}e.contentDidChange({data:f,inputType:"insertText"})}function d0(e,t,n){typeof t=="function"&&(n=t,t=1/0),t===void 0&&(t=1/0);let a=e.position,l=!1;const f=[];for(;!l;){const g=e.at(a);l=t===0||!g||g.type==="first"||g.isFirstSibling||g.mode!=="text"||g.value===" "||typeof n=="function"&&!n(g),l||(f.push(Bt.serialize([g],{defaultMode:"math"})),g.mode="math"),a-=1,t-=1}Hh(e),e.contentDidChange({data:Bn(f),inputType:"insertText"})}function Hh(e){var t;let n=e.position-1;for(;n>=0&&((t=e.at(n))==null?void 0:t.mode)==="math";)n-=1;if(!(n<0)&&e.at(n).mode==="text"&&e.at(n).value===" "&&e.at(n-1).mode==="math"){e.at(n-1).parent.removeChild(e.at(n-1));const a=e.silenceNotifications;e.silenceNotifications=!0,e.position-=1,e.silenceNotifications=a,e.contentDidChange({inputType:"deleteContent"})}}function Q1(e){let t="",n=e.position,a=!1;for(;!a;){const l=e.at(n);a=!(l&&(l.mode==="text"||l.mode==="math"&&l.type&&/mord|mpunct/.test(l.type))),a||(t=l.value+t),n-=1}return t}function em(e,t,n){const{model:a}=e;if(a.mode==="latex"||!a.at(a.position).isLastSibling||!n||!vc(n))return!1;const l=H0(n);if(!a.selectionIsCollapsed)return!!(e.model.mode==="text"&&/[/_^]/.test(l));const f=Q1(a)+l;if(e.model.mode==="text"){if(t==="Esc"||/[/\\]/.test(l))return!0;if(/[\^_]/.test(l))return/(^|\s)[a-zA-Z][^_]$/.test(f)&&d0(a,1),!0;const g={")":"(","}":"{","]":"["}[l],{parent:S}=a.at(a.position);if(g&&S instanceof At&&S.leftDelim===g)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(f))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(l))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(f))return d0(a,1),!1;if(/\D\.[^\d\s]$/.test(f)){d0(a,1);const T=a.at(a.position);return T.value="\u22C5",T.style.variant="normal",T.command="\\cdot",T.verbatimLatex=void 0,a.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(f)||/\.\d$/.test(f)||/\([\d+\-.]$/.test(f))return d0(a,1),!0;if(/\([a-z][,;]$/.test(f))return d0(a,2),!0;if(/[\d+\-=><*|]$/.test(l))return Hh(a),!0}else{if(t==="[Space]")return Fc(a,void 0,g=>/[a-z][:,;.]$/.test(g.value)),!0;if(/[a-zA-Z]{3,}$/.test(f)&&!/(dxd|abc|xyz|uvw)$/.test(f))return Fc(a,void 0,g=>/[a-zA-Z]/.test(g.value)),!0;if(/(^|\W)(if)$/i.test(f))return Fc(a,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(f)&&!/(αβγ)$/.test(f))return Fc(a,void 0,g=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(g.value)),!0;if(l==="?"||l==="."&&!/[\d-+]\.$/.test(f))return!0}return!1}function tm(e,t){if(!e.isSelectionEditable||!e.keystrokeCaptionVisible)return;const n=Zd(),a=e.element.getBoundingClientRect();n.style.left=`${a.left}px`,n.style.top=`${a.top-64}px`,n.innerHTML=window.MathfieldElement.createHTML("<span>"+(Lh(t)||t)+"</span>"+n.innerHTML),n.style.visibility="visible",setTimeout(()=>{n.childNodes.length>0&&n.childNodes[n.childNodes.length-1].remove(),n.childNodes.length===0&&(n.style.visibility="hidden")},3e3)}function rm(e){if(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaptionVisible){const t=Zd();t.innerHTML=""}else{const t=_c("mathlive-keystroke-caption-panel");t.style.visibility="hidden"}return!1}function Zd(){const e=document.getElementById("mathlive-keystroke-caption-panel");return e||(Ja("keystroke-caption"),Ja("core"),_c("mathlive-keystroke-caption-panel"))}function nm(){document.getElementById("mathlive-keystroke-caption-panel")&&(Ih("mathlive-keystroke-caption-panel"),vo("core"),vo("keystroke-caption"))}function Yd(e,t){var n,a,l;const{model:f}=e,g=Sd(t);if(t.isTrusted){Wp(t);const Me=Mu();e.keyboardLayout!==Me.id&&(e.keyboardLayout=Me.id,e._keybindings=void 0)}if(clearTimeout(e.inlineShortcutBufferFlushTimer),e.inlineShortcutBufferFlushTimer=0,tm(e,g),t.isTrusted&&t.defaultPrevented)return e.flushInlineShortcutBuffer(),!1;let S,T="",R;const F=e.inlineShortcutBuffer;if(e.isSelectionEditable){if(f.mode==="math")if(g==="[Backspace]")F.pop();else if(!vc(t))e.flushInlineShortcutBuffer();else{const Me=H0(t),ze=[...(a=(n=F[F.length-1])==null?void 0:n.keystrokes)!=null?a:[],Me];F.push({state:f.getState(),keystrokes:ze,leftSiblings:im(e)});let _t=0,tr="";for(;!S&&_t<ze.length;)R=F.length-(ze.length-_t),tr=ze.slice(_t).join(""),S=B0(F[R].leftSiblings,tr,e.options.inlineShortcuts),!S&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(tr)&&(S=e.options.onInlineShortcut(e,tr)),_t+=1;e.flushInlineShortcutBuffer({defer:!0})}e.options.smartMode&&(S?e.switchMode("math"):em(e,g,t)&&(e.switchMode({math:"text",text:"math"}[f.mode]),T=""))}if(!S){if(T||(T=Qp(e.keybindings,f.mode,t)),!T&&(g==="[Enter]"||g==="[Return]")){let Me=!1;return f.contentWillChange({inputType:"insertLineBreak"})&&(e.host&&(Me=!e.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),Me||t.preventDefault&&(t.preventDefault(),t.stopPropagation()),f.contentDidChange({inputType:"insertLineBreak"})),Me}if((!T||g==="[Space]")&&f.mode==="math"){if(g==="[Space]"){if(e.adoptStyle="none",e.flushInlineShortcutBuffer(),e.options.mathModeSpace)return Si.insert(f,e.options.mathModeSpace,{format:"latex",mode:"math"}),e.snapshot("insert-space"),T="",e.dirty=!0,e.scrollIntoView(),t.preventDefault&&(t.preventDefault(),t.stopPropagation()),!1;const Me=f.at(f.position+1),ze=f.at(f.position-1);if((Me==null?void 0:Me.mode)==="text"||(ze==null?void 0:ze.mode)==="text")return Si.insert(f," ",{mode:"text"}),e.snapshot("insert-space"),e.dirty=!0,e.scrollIntoView(),!1}(l=f.at(f.position))!=null&&l.isDigit()&&window.MathfieldElement.decimalSeparator===","&&H0(t)===","&&(T="insertDecimalSeparator")}}if(!S&&!T){if(f.mathfield.smartFence){if(Vh(f,H0(t),e.effectiveStyle))return e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}else{const{parent:Me}=f.at(f.position);if(Me instanceof At&&Me.rightDelim==="?"&&f.at(f.position).isLastSibling&&/^[)}\]|]$/.test(g))return e.snapshot(),Me.isDirty=!0,Me.rightDelim=g,f.position+=1,f.selectionDidChange(),f.contentDidChange({data:H0(t),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1;if(!f.selectionIsCollapsed){const ze=H0(t);if(ze==="("||ze==="{"||ze==="["){const _t={"(":"(","{":"\\lbrace","[":"\\lbrack"}[ze],tr={"(":")","{":"\\rbrace","[":"\\rbrack"}[ze],[pt,Ht]=Ps(f.selection);return e.snapshot(),f.position=Ht,Si.insert(f,tr,{format:"latex"}),f.position=pt,Si.insert(f,_t,{format:"latex"}),f.setSelection(pt+1,Ht+1),f.contentDidChange({data:ze,inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}}}return!0}const X=f.at(Math.max(f.position,f.anchor)),{parent:ve}=X;if(T==="moveAfterParent"&&(ve==null?void 0:ve.type)==="leftright"&&X.isLastSibling&&e.options.smartFence&&Vh(f,".",e.defaultStyle)&&(T="",Xi(e)),e.keyboardDelegate.cancelComposition(),T)e.executeCommand(T);else if(S){const Me=e.effectiveStyle;f.setState(F[R].state);const ze=F[F.length-1].keystrokes;for(const _t of ze)Si.insert(f,_t,{silenceNotifications:!0,style:Me});e.snapshot("insert-shortcut"),f.setState(F[R].state),f.deferNotifications({content:!0,selection:!0,data:S,type:"insertText"},()=>(Si.insert(f,S,{format:"latex",style:Me}),Hh(e.model),S.endsWith(" ")&&(e.switchMode("text"),Si.insert(f," ",{style:Me,mode:"text"})),e.snapshot(),f.selectionIsCollapsed||e.flushInlineShortcutBuffer(),!0)),e.dirty=!0,f.announce("replacement")}return e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}function Gh(e,t,n){const{model:a}=e;if(!e.isSelectionEditable){a.announce("plonk");return}n!=null||(n={}),n.focus&&e.focus(),n.feedback&&window.MathfieldElement.playSound("keypress"),typeof n.mode=="string"&&(e.switchMode(n.mode),e.snapshot());let l=Yu(t);const f=window.mathVirtualKeyboard;if(f!=null&&f.isShifted&&(l=typeof l=="string"?l.toUpperCase():l.map(T=>T.toUpperCase())),n.simulateKeystroke){let T=!0;for(const R of l)Yd(e,new KeyboardEvent("keypress",{key:R}))&&(T=!1);if(T)return}const g=a.at(a.position),S=$($({},g.computedStyle),e.defaultStyle);if(a.selectionIsCollapsed||(a.deleteAtoms(Ps(a.selection)),e.snapshot("delete")),a.mode==="latex")a.deferNotifications({content:!0,selection:!0,data:t,type:"insertText"},()=>{bc(e);for(const T of l)Si.insert(a,T);e.snapshot("insert-latex"),Ru(e)});else if(a.mode==="text"){for(const T of l)Si.insert(a,T,{style:S});e.snapshot("insert-text")}else if(a.mode==="math")for(const T of l)sm(e,T,S,g);e.dirty=!0,e.scrollIntoView()}function im(e){const t=e.model,n=[];let a=t.at(Math.min(t.position,t.anchor));for(;a.type!=="first";)n.push(a),a=a.leftSibling;return n}function sm(e,t,n,a){const l=e.model;let f={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(t===" "&&e.options.mathModeSpace&&(f=["insert",e.options.mathModeSpace]),f){e.executeCommand(f);return}if(/\d/.test(t)&&e.options.smartSuperscript&&a.parentBranch==="superscript"&&a.parent.type!=="mop"&&a.parent.type!=="operator"&&a.parent.type!=="extensible-symbol"&&a.hasNoSiblings){am(l),Si.insert(l,t,{style:n}),e.snapshot(),Vd(l),e.snapshot();return}if(/[a-zA-Z0-9]/.test(t)&&e.adoptStyle!=="none"){const g=e.adoptStyle==="left"?a:a.parent?a.rightSibling:null;(g==null?void 0:g.type)==="mord"&&/[a-zA-Z0-9]/.test(g.value)&&(n=$({},n),g.style.variant&&(n.variant=g.style.variant),g.style.variantStyle&&(n.variantStyle=g.style.variantStyle))}Si.insert(l,t,{style:n}),e.snapshot(`insert-${l.at(l.position).type}`)}function am(e){e.selectionIsCollapsed||(e.deleteAtoms(Ps(e.selection)),e.mathfield.snapshot("delete"))}function Vh(e,t,n){if(!t||e.mode!=="math")return!1;const a=e.at(e.position),{parent:l}=a,f={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[t];if(!f)return!1;const g=Il[f],S=$0[f];if(!e.selectionIsCollapsed){e.mathfield.snapshot();const[T,R]=Ps(e.selection),F=e.extractAtoms([T,R]),X=l.addChildrenAfter([new At("left...right",F,{leftDelim:f,rightDelim:S})],e.at(T));return e.setSelection(e.offsetOf(X.firstChild),e.offsetOf(X.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:f,inputType:"insertText"}),!0}if(f==="|"){const T=l instanceof At?l.leftDelim+l.rightDelim:"";if(T==="\\lbrace\\rbrace"||T==="\\{\\}"||T==="\\lbrace?")return e.mathfield.snapshot(),Si.insert(e,"\\,\\middle\\vert\\,",{format:"latex",style:n}),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:f,inputType:"insertText"}),!0}if(S){if(l instanceof At&&l.firstChild===a&&(l.leftDelim==="?"||l.leftDelim==="."))return l.leftDelim=f,l.isDirty=!0,e.mathfield.snapshot(),e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(!(l instanceof At)){let X=a;for(;X&&!(X.type==="mclose"&&X.value===S);)X=X.rightSibling;if(X){e.mathfield.snapshot();const ve=e.extractAtoms([e.offsetOf(a),e.offsetOf(X)]);return ve.pop(),l.addChildrenAfter([new At("left...right",ve,{leftDelim:f,rightDelim:S})],a),e.position=e.offsetOf(l.firstChild)+1,e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}}const T=e.offsetOf(a.lastSibling);let R;for(R=e.position;R<=T;R++){const X=e.at(R);if(X instanceof At&&(X.leftDelim==="?"||X.leftDelim===".")&&Xd(f,X.rightDelim))break}const F=e.at(R);if(R<=T&&F instanceof At){F.leftDelim=f,e.mathfield.snapshot();let X=e.extractAtoms([e.position,R-1]);return X=X.filter(ve=>ve.type!=="first"),F.addChildren(X,F.parentBranch),e.position+=1,e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(l instanceof At&&(l.leftDelim==="?"||l.leftDelim===".")&&Xd(f,l.rightDelim)){l.isDirty=!0,l.leftDelim=f,e.mathfield.snapshot();const X=e.extractAtoms([e.offsetOf(a.firstSibling),e.position]);for(const ve of X)l.parent.addChildBefore(ve,l);return e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(l instanceof At&&l.leftDelim==="|")){if(e.mathfield.snapshot(),Si.insert(e,`\\left${f}\\right?`,{format:"latex",style:n}),a.lastSibling.type!=="first"){const X=e.offsetOf(a.lastSibling),ve=e.extractAtoms([e.position,X]);e.at(e.position).body=ve,e.position-=1}return e.mathfield.snapshot("insert-fence"),!0}}if(g){let T=a;for(;T;){if(T.type==="mopen"&&T.value===g){e.mathfield.snapshot();const Me=T.leftSibling,ze=e.extractAtoms([e.offsetOf(T.leftSibling),e.offsetOf(a)]);ze.shift();const _t=new At("left...right",ze,{leftDelim:g,rightDelim:f});return l.addChildrenAfter([_t],Me),e.position=e.offsetOf(_t),e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}T=T.leftSibling}if(l instanceof At&&a.isLastSibling&&Wh(l.leftDelim,f))return e.mathfield.snapshot(),l.isDirty=!0,l.rightDelim=f,e.position+=1,e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const R=e.offsetOf(a.firstSibling);let F;for(F=e.position;F>=R;F--){const Me=e.at(F);if(Me instanceof At&&(Me.rightDelim==="?"||Me.rightDelim===".")&&Wh(Me.leftDelim,f))break}const X=e.at(F);if(F>=R&&X instanceof At)return e.mathfield.snapshot(),X.rightDelim=f,X.addChildren(e.extractAtoms([F,e.position]),X.parentBranch),e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(l instanceof At&&(l.rightDelim==="?"||l.rightDelim===".")&&Wh(l.leftDelim,f))return e.mathfield.snapshot(),l.isDirty=!0,l.rightDelim=f,l.parent.addChildren(e.extractAtoms([e.position,e.offsetOf(a.lastSibling)]),l.parentBranch),e.position=e.offsetOf(l),e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const ve=l.parent;return ve instanceof At&&(ve.rightDelim==="?"||ve.rightDelim===".")&&e.at(e.position).isLastSibling?(e.position=e.offsetOf(ve),Vh(e,f,n)):!1}return!1}function Wh(e,t){return e?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t):$0[e]===t:!0}function Xd(e,t){return t?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):Il[t]===e:!0}pa({undo:e=>(e.undo(),!0),redo:e=>(e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},toggleKeystrokeCaption:rm,toggleContextMenu:e=>{const t=e.toggleContextMenu();return t||e.model.announce("plonk"),t},plonk:e=>(e.model.announce("plonk"),!0),switchMode:(e,t,n,a)=>(e.switchMode(t,n,a),!0),insert:(e,t,n)=>e.insert(t,n),typedText:(e,t,n)=>(Gh(e,t,n),!0),insertDecimalSeparator:e=>{const t=e.model;return t.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&t.at(Math.max(t.position,t.anchor)).isDigit()?(e.insert("{,}",{format:"latex"}),e.snapshot("insert-mord"),!0):(e.insert("."),!0)},commit:e=>{var t;return e.model.contentWillChange({inputType:"insertLineBreak"})&&((t=e.host)==null||t.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(e,t,n)=>{const a=e.getPrompts();let l="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),f=0;for(;a.includes(l)&&f<100;){if(f===99)return console.error("could not find a unique ID after 100 tries"),!1;l="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),f++}return e.insert(`\\placeholder[${t!=null?t:l}]{}`,n),!0}}),pa({copyToClipboard:e=>(e.focus(),e.model.selectionIsCollapsed&&e.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),pa({cutToClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(t=>{t&&e.model.contentWillChange({inputType:"insertFromPaste",data:t})?(e.stopCoalescingUndo(),e.stopRecording(),e.insert(t,{mode:e.model.mode})&&(Ru(e),e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),Xi(e))):e.model.announce("plonk"),e.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function om(e,t){e.flushInlineShortcutBuffer(),e.stopCoalescingUndo();const n=jh(e,t),{model:a}=e;return a.selectionIsCollapsed?(e.defaultStyle.fontSeries&&n.fontSeries===e.defaultStyle.fontSeries&&(n.fontSeries="auto"),n.fontShape&&n.fontShape===e.defaultStyle.fontShape&&(n.fontShape="auto"),n.color&&n.color===e.defaultStyle.color&&(n.color="none"),n.backgroundColor&&n.backgroundColor===e.defaultStyle.backgroundColor&&(n.backgroundColor="none"),n.fontSize&&n.fontSize===e.defaultStyle.fontSize&&(n.fontSize="auto"),e.defaultStyle=$($({},e.defaultStyle),n)):e.model.deferNotifications({content:!0,type:"insertText"},()=>{a.selection.ranges.forEach(l=>$h(a,l,n,{operation:"toggle"})),e.snapshot("style-change")}),!0}pa({applyStyle:om},{target:"mathfield",canUndo:!0,changeContent:!0});function jh(e,t){var n,a,l,f,g,S,T,R,F,X;const ve={};if(typeof t.color=="string"){const ze=(a=e.colorMap((n=t.color)!=null?n:t.verbatimColor))!=null?a:"none";ze!==t.color&&(ve.verbatimColor=(l=t.verbatimColor)!=null?l:t.color),ve.color=ze}if(typeof t.backgroundColor=="string"){const ze=(g=e.backgroundColorMap((f=t.backgroundColor)!=null?f:t.verbatimBackgroundColor))!=null?g:"none";ze!==t.backgroundColor&&(ve.verbatimBackgroundColor=(S=t.verbatimBackgroundColor)!=null?S:t.backgroundColor),ve.backgroundColor=ze}typeof t.fontFamily=="string"&&(ve.fontFamily=t.fontFamily),typeof t.series=="string"&&(ve.fontSeries=t.series),typeof t.fontSeries=="string"&&(ve.fontSeries=t.fontSeries.toLowerCase()),ve.fontSeries&&(ve.fontSeries=(T={bold:"b",medium:"m",normal:"m"}[ve.fontSeries])!=null?T:ve.fontSeries),typeof t.shape=="string"&&(ve.fontShape=t.shape),typeof t.fontShape=="string"&&(ve.fontShape=t.fontShape.toLowerCase()),ve.fontShape&&(ve.fontShape=(R={italic:"it",up:"n",upright:"n",normal:"n"}[ve.fontShape])!=null?R:ve.fontShape),t.variant&&(ve.variant=t.variant.toLowerCase()),t.variantStyle&&(ve.variantStyle=t.variantStyle.toLowerCase());const Me=(F=t.size)!=null?F:t.fontSize;return typeof Me=="number"?ve.fontSize=Math.max(1,Math.min(10,Me)):typeof Me=="string"&&(ve.fontSize=(X={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[Me.toLowerCase()])!=null?X:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[Me]),ve}function qh(e){let[t,n]=Ps(e.selection);if(t=Jd(e,t,"backward"),n=Jd(e,n,"forward"),t===n){const a=e.at(t);if(a.type==="leftright")return e.setSelection(e.offsetOf(a.firstChild)-1,n);if(a.type==="first"&&(a.parent.type==="leftright"||a.parent.type==="surd"))return e.setSelection(t-1,e.offsetOf(a.parent.lastChild)+1);e.setSelection(t-1,n)}else e.setSelection(t,n);return!0}function Jd(e,t,n){var a,l,f;let g=e.at(t);if(!g)return t;const S=n==="forward"?1:-1;if(g.mode==="text"){for(;g&&!(g.mode!=="text"||!Ye.test(g.value));)t+=S,g=e.at(t);return n==="backward"?t-1:t}if(g.mode==="latex"){if(/[a-zA-Z\*]/.test(g.value))if(n==="backward")for(;g&&g.mode==="latex"&&g.value!=="\\"&&/[a-zA-Z]/.test(g.value);)t+=S,g=e.at(t);else for(;g&&g.mode==="latex"&&/[a-zA-Z\*]/.test(g.value);)t+=S,g=e.at(t);else if(g.value==="{"){if(n==="forward"){for(;g&&g.mode==="latex"&&g.value!=="}";)t+=S,g=e.at(t);return t}return t-1}else if(g.value==="}"){if(n==="backward"){for(;g&&g.mode==="latex"&&g.value!=="{";)t+=S,g=e.at(t);return t-1}return t}return t-1}if(g.mode==="math"){if(g.isDigit()){for(;(a=e.at(t+S))!=null&&a.isDigit();)t+=S;return n==="backward"?t-1:t}if(g.style.variant||g.style.variantStyle){let T=(l=e.at(t))==null?void 0:l.style;for(;T&&T.variant===g.style.variant&&T.variantStyle===g.style.variantStyle;)T=(f=e.at(t+S))==null?void 0:f.style,t+=S;return n==="backward"?t-1:t}return t}return t}pa({selectGroup:e=>{const t=qh(e);return t||e.announce("plonk"),t},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>_o(e,"forward",{extend:!0}),extendSelectionBackward:e=>_o(e,"backward",{extend:!0}),extendToNextWord:e=>Z0(e,"forward",{extend:!0}),extendToPreviousWord:e=>Z0(e,"backward",{extend:!0}),extendSelectionUpward:e=>_o(e,"upward",{extend:!0}),extendSelectionDownward:e=>_o(e,"downward",{extend:!0}),extendToNextBoundary:e=>Z0(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>Z0(e,"backward",{extend:!0}),extendToGroupStart:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).firstSibling));return t||e.announce("plonk"),t},extendToGroupEnd:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).lastSibling));return t||e.announce("plonk"),t},extendToMathFieldStart:e=>{const t=e.setSelection(e.anchor,0);return t||e.announce("plonk"),t},extendToMathFieldEnd:e=>{const t=e.setSelection(e.anchor,e.lastOffset);return t||e.announce("plonk"),t}},{target:"model",changeSelection:!0});var f0=null,Nu=0,Nc=class $a{static start(t,n,a,l){var f;$a.element=t,(f=$a.controller)==null||f.abort(),$a.controller=new AbortController;const g={signal:$a.controller.signal};"PointerEvent"in window?(t.addEventListener("pointermove",a,g),t.addEventListener("pointerup",l,g),t.addEventListener("pointercancel",l,g),Zh(n)&&($a.pointerId=n.pointerId,t.setPointerCapture(n.pointerId))):(window.addEventListener("mousemove",a,g),window.addEventListener("blur",l,g),window.addEventListener("mouseup",l,g))}static stop(){var t;(t=$a.controller)==null||t.abort(),$a.controller=void 0,typeof $a.pointerId=="number"&&($a.element.releasePointerCapture($a.pointerId),$a.pointerId=void 0)}};function Zh(e){return e!==null&&globalThis.PointerEvent!==void 0&&e instanceof PointerEvent}function Qd(e,t){var n;if(t.buttons>1)return;e.atomBoundsCache=new Map;const a=e;let l,f=!1,g=!1,S="none",T=!1,R=!1;const F=t.clientX,X=t.clientY,ve=Date.now(),Me=a.field,ze=setInterval(()=>{T?Me.scroll({top:0,left:Me.scrollLeft-16}):R&&Me.scroll({top:0,left:Me.scrollLeft+16})},32);function _t(){Nc.stop(),f=!1,clearInterval(ze),e.element.classList.remove("tracking"),t&&t.preventDefault()}function tr(Ht){if(!a.hasFocus()){_t();return}const ur=Ht.clientX,jt=Ht.clientY,Pr=Zh(Ht)&&Ht.pointerType==="touch"?20:5;if(Date.now()<ve+500&&Math.abs(F-ur)<Pr&&Math.abs(X-jt)<Pr){Ht.preventDefault(),Ht.stopPropagation();return}const Yr=Me.getBoundingClientRect();R=ur>Yr.right,T=ur<Yr.left;let Hr=l;Zh(Ht)&&(Ht.isPrimary||(Hr=$u(a,Ht.clientX,Ht.clientY,{bias:0})));const Gn=$u(a,ur,jt,{bias:ur<=F?ur===F?0:-1:1});Hr>=0&&Gn>=0&&(a.model.extendSelectionTo(Hr,Gn),Xi(e)),g&&qh(a.model)}f0&&Math.abs(f0.x-F)<5&&Math.abs(f0.y-X)<5&&Date.now()<f0.time+500?(Nu+=1,f0.time=ve):(f0={x:F,y:X,time:ve},Nu=1);const pt=Me.getBoundingClientRect();if(F>=pt.left&&F<=pt.right&&X>=pt.top&&X<=pt.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",l=$u(e,F,X,{bias:0}),l>=0){if(e.element.classList.add("tracking"),t.shiftKey){const Ht=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,l),Ad(e.model)||Ht?S="all":S="selection"}else e.model.at(l).type==="placeholder"?(e.model.setSelection(l-1,l),S="selection"):((n=e.model.at(l).rightSibling)==null?void 0:n.type)==="placeholder"?(e.model.setSelection(l,l+1),S="selection"):(e.model.position=l,Ad(e.model)?S="all":S="selection");e.defaultStyle={},t.detail===3||Nu>2?(_t(),(t.detail===3||Nu===3)&&(e.model.selection={ranges:[[0,e.model.lastOffset]]},S="all")):f||(f=!0,Nc.start(Me,t,tr,_t),(t.detail===2||Nu===2)&&(g=!0,qh(e.model),S="all"))}e.hasFocus()||(S="none",e.focus({preventScroll:!0}))}else f0=null;e.stopCoalescingUndo(),S!=="none"&&(e.model.selectionIsCollapsed&&(S="all"),Xi(e)),t.preventDefault()}function lm(e,t,n){if(e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom)return 0;const a=e-(n.left+n.right)/2,l=t-(n.top+n.bottom)/2;return a*a+l*l}function ef(e,t,n,a,l){if(!n.id)return[1/0,null];if(t.has(n.id))return t.get(n.id);const f=t0(e,n);if(!f)return[1/0,null];let g=[1/0,null];if(n.hasChildren&&!n.captureSelection&&a>=f.left&&a<=f.right)for(const S of n.children){const T=ef(e,t,S,a,l);T[0]<=g[0]&&(g=T)}return g[1]||(g=[lm(a,l,f),n]),t.set(n.id,g),g}function um(e,t,n){const[,a]=ef(e,new Map,e.model.root,t,n);return a}function $u(e,t,n,a){var l;const f=e.field.querySelector(".ML__latex").getBoundingClientRect();if(!f)return 0;if(t>f.right||n>f.bottom+8)return e.model.lastOffset;if(t<f.left||n<f.top-8)return 0;a=a!=null?a:{},a.bias=(l=a.bias)!=null?l:0;let g=um(e,t,n);const S=[];let T=g;for(;T;)S.unshift(T),T=T.parent;for(const F of S)if(F.captureSelection){g=F;break}let R=e.model.offsetOf(g);if(R<0)return-1;if(g.leftSibling)if(a.bias===0&&g.type!=="placeholder"){const F=t0(e,g);F&&t<(F.left+F.right)/2&&(R=e.model.offsetOf(g.leftSibling))}else a.bias<0&&(R=e.model.offsetOf(g.leftSibling));return R}var cm=class extends Si{constructor(){super("math")}onPaste(e,t){if(!t||!e.model.contentWillChange({data:typeof t=="string"?t:null,dataTransfer:typeof t=="string"?null:t,inputType:"insertFromPaste"}))return!1;let n="",a="auto",l=typeof t!="string"?t.getData("application/json+mathlive"):"";if(l)try{const f=JSON.parse(l);if(f&&Array.isArray(f)){e.snapshot();const g=Ol(f),{model:S}=e;S.selectionIsCollapsed||S.deleteAtoms(Ps(S.selection));const T=S.at(S.position);if(T.parent instanceof N){console.assert(T.parentBranch!==void 0);const R=[];let F=[];g[0].type==="first"&&g.shift(),g[g.length-1].type==="first"&&g.pop();for(const ze of g)ze.type==="first"&&F.length>0?(R.push(F),F=[ze]):F.push(ze);F.length>0&&R.push(F);let X=Number(T.parentBranch[0]),ve=Number(T.parentBranch[1]);const Me=T.parent.maxColumns;for(;T.parent.colCount-ve<R.length&&T.parent.colCount<Me;)T.parent.addColumn();T.parent.addChildrenAfter(R[0],T);for(let ze=1;ze<R.length;ze++)ve++,ve>=Me&&(ve=0,T.parent.addRowAfter(X),X++),T.parent.setCell(X,ve,R[ze])}else T.parent.addChildrenAfter(g.filter(R=>R.type!=="first"),T);return S.position=S.offsetOf(g[g.length-1]),S.contentDidChange({inputType:"insertFromPaste"}),Xi(e),!0}}catch(f){}if(l=typeof t!="string"?t.getData("application/json"):"",l&&window.MathfieldElement.computeEngine)try{const f=JSON.parse(l);if(typeof f=="object"&&"latex"in f&&f.latex&&(n=f.latex),!n){const g=window.MathfieldElement.computeEngine.box(f);g&&!g.has("Error")&&(n=g.latex)}n||(a="latex")}catch(f){}if(!n&&typeof t!="string"&&(n=t.getData("application/x-latex"),n&&(a="latex")),n||(n=typeof t=="string"?t:t.getData("text/plain")),n){let f;return[f,n]=yu(n),a==="auto"&&f&&(a="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n,{format:a})&&(e.startRecording(),e.snapshot("paste"),Xi(e)),e.startRecording(),!0}return!1}insert(e,t,n){var a,l;const f=typeof t=="string"?t:(l=(a=window.MathfieldElement.computeEngine)==null?void 0:a.box(t).latex)!=null?l:"";if(!n.silenceNotifications&&!e.contentWillChange({data:f,inputType:"insertText"}))return!1;n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder"),n.format||(n.format="auto");const{silenceNotifications:g}=e;n.silenceNotifications&&(e.silenceNotifications=!0);const S=e.silenceNotifications;e.silenceNotifications=!0;const T={"?":"\\placeholder{}","@":"\\placeholder{}"};T[0]=n.insertionMode==="replaceAll"?"":e.getValue(e.selection,"latex-unstyled"),n.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ps(e.selection)):n.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):n.insertionMode==="insertBefore"?e.collapseSelection("backward"):n.insertionMode==="insertAfter"&&e.collapseSelection("forward"),!e.at(e.position).isLastSibling&&e.at(e.position+1).type==="placeholder"?e.deleteAtoms([e.position,e.position+1]):e.at(e.position).type==="placeholder"&&e.deleteAtoms([e.position-1,e.position]);let R=-1;T[0]?T["@"]=T[0]:typeof t=="string"&&/(^|[^\\])#@/.test(t)&&(R=dm(e),R>=0&&(T["@"]=e.getValue(R,e.position,"latex"))),T[0]||(T[0]=T["?"]);let F=!1;const X=ur=>(F=!0,T[ur]);let[ve,Me]=tf(e,t,X,n);if(!Me)return!1;const ze=Me.length===1&&Me[0].type==="genfrac";ze&&R>=0&&typeof e.mathfield.options.isImplicitFunction=="function"&&e.mathfield.options.isImplicitFunction(e.at(e.position).command)?(T["@"]=T["?"],F=!1,[ve,Me]=tf(e,t,X,n)):R>=0&&e.deleteAtoms([R,e.position]);const{parent:_t}=e.at(e.position),tr=_t.hasEmptyBranch("body");if(ze&&ve!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&_t instanceof At&&_t.leftDelim==="("&&tr){const ur=_t.parent,jt=_t.parentBranch;ur.removeChild(_t),ur.setChildren(Me,jt)}const pt=e.at(e.position);pt.parent.addChildrenAfter(Me,pt),ve==="latex"&&typeof t=="string"&&(_t==null?void 0:_t.type)==="root"&&tr&&!F&&(_t.verbatimLatex=t),e.silenceNotifications=S;const Ht=Me[Me.length-1];if(n.selectionMode==="placeholder"){const ur=Me.flatMap(jt=>[jt,...jt.children]).find(jt=>jt.type==="placeholder");if(ur){const jt=e.offsetOf(ur);e.setSelection(jt-1,jt),e.announce("move")}else Ht&&(e.position=e.offsetOf(Ht))}else n.selectionMode==="before"||(n.selectionMode==="after"?Ht&&(e.position=e.offsetOf(Ht)):n.selectionMode==="item"&&e.setSelection(e.anchor,e.offsetOf(Ht)));return e.contentDidChange({data:f,inputType:"insertText"}),e.silenceNotifications=g,!0}};function tf(e,t,n,a){var l;let f,g=[];if(typeof t!="string"||a.format==="math-json"){const S=window.MathfieldElement.computeEngine;if(!S)return["math-json",[]];[f,t]=["latex",S.box(t).latex],g=un(t,{context:e.mathfield.context})}else typeof t=="string"&&a.format==="ascii-math"?([f,t]=P0(t,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),g=un(t,{context:e.mathfield.context}),f!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&$c(g)):(a.format==="auto"||(l=a.format)!=null&&l.startsWith("latex"))&&(a.format==="auto"&&([f,t]=P0(t,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),a.format==="latex"&&([,t]=yu(t)),g=un(t,{context:e.mathfield.context,args:n}),a.format!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&$c(g));return Pl(g,a.style),[f!=null?f:"latex",g]}function hm(e){if(!e||(console.assert(e[0].type==="first"),e.length>1))return null;const t=e[0];return t instanceof At&&t.leftDelim==="("&&t.rightDelim===")"?t.removeBranch("body"):null}function $c(e){if(e){for(let t=0;e[t];t++){const n=e[t];if(n instanceof At&&n.leftDelim==="("){let a=0,l=0,f=0;for(let g=0;n.body[g];g++)n.body[g].type==="genfrac"&&(a++,l=g),f++;f===0&&a===1&&(e[t]=n.body[l])}}for(const t of e){for(const n of t.branches)if(!t.hasEmptyBranch(n)){$c(t.branch(n));const a=hm(t.branch(n));a&&t.setChildren(a,n)}if(t instanceof N)for(const n of t.cells)$c(n)}}}function dm(e){let t=e.at(e.position);if(t.mode==="text"){for(;!t.isFirstSibling&&t.mode==="text";)t=t.leftSibling;return e.offsetOf(t)}const n=t;let a=!1;if(t.type==="mclose"){const l=Il[t.value];for(;!t.isFirstSibling&&!(t.type==="mopen"&&t.value===l);)t=t.leftSibling;t.isFirstSibling||(t=t.leftSibling),a=!0}else t.type==="leftright"&&(t=t.leftSibling,a=!0);if(a)for(;!t.isFirstSibling&&(t.isFunction||rf(t));)t=t.leftSibling;else{const l=[];for(;!t.isFirstSibling&&(rf(t)||l.length>0);)t.type==="mclose"&&l.unshift(t.value),t.type==="mopen"&&l.length>0&&t.value===Il[l[0]]&&l.shift(),t=t.leftSibling}return n===t?-1:e.offsetOf(t)}function rf(e){return e.isDigit()?!0:e.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(e.type)?!e.isExtensibleSymbol:!1}new cm;var fm=class extends Si{constructor(){super("text")}onPaste(e,t){if(!t)return!1;const n=typeof t=="string"?t:t.getData("text/plain");return n&&e.model.contentWillChange({inputType:"insertFromPaste",data:n})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n)&&(e.model.contentDidChange({inputType:"insertFromPaste"}),e.startRecording(),e.snapshot("paste"),Xi(e)),e.startRecording(),!0):!1}insert(e,t,n={}){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder"),n.format||(n.format="auto");const{silenceNotifications:a}=e;n.silenceNotifications&&(e.silenceNotifications=!0);const l=e.silenceNotifications;e.silenceNotifications=!0,n.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ps(e.selection)):n.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):n.insertionMode==="insertBefore"?e.collapseSelection("backward"):n.insertionMode==="insertAfter"&&e.collapseSelection("forward");const f=pm(t,e.mathfield.context);if(Pl(f,n.style),!f)return!1;const g=e.at(e.position),S=g.parent.addChildrenAfter(f,g);return e.silenceNotifications=l,n.selectionMode==="before"||(n.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(S)):S&&(e.position=e.offsetOf(S))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=a,!0}};function pm(e,t){return e=e.replace(/\\/g,"\\textbackslash "),e=e.replace(/#/g,"\\#"),e=e.replace(/\$/g,"\\$"),e=e.replace(/%/g,"\\%"),e=e.replace(/&/g,"\\&"),e=e.replace(/_/g,"\\_"),e=e.replace(/{/g,"\\textbraceleft "),e=e.replace(/}/g,"\\textbraceright "),e=e.replace(/lbrace/g,"\\textbraceleft "),e=e.replace(/rbrace/g,"\\textbraceright "),e=e.replace(/\^/g,"\\textasciicircum "),e=e.replace(/~/g,"\\textasciitilde "),e=e.replace(/£/g,"\\textsterling "),un(e,{context:t,parseMode:"text"})}new fm;function xo(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}var Pi=4,aa=20,bs=2*(aa+Pi),zc=(e,t)=>`
<line x1="${e+aa}" y1="${t+aa}"
x2="${e>t?e+aa:7*aa+10*Pi}"
y2="${e<t?t+aa:7*aa+10*Pi}"/>
<svg id="plus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
</svg>`,nf=(e,t)=>`
<line x1="${e+aa}" y1="${t+aa}"
x2="${e>t?e+aa:7*aa+10*Pi}"
y2="${e<t?t+aa:7*aa+10*Pi}"/>
<svg id="minus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
</svg>`,Kc=(e,t,n)=>`
<svg id="arrow" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<g transform="rotate(${n})" transform-origin="20 20">
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
</g>
</svg>`,mm=`
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox=
"-2 -2 ${8*aa+10*Pi+5} ${8*aa+10*Pi+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${bs+Pi}"
height="${3*bs}"
width="${bs}"
rx="${bs/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${bs+Pi}"
y="0"
height="${bs}"
width="${3*bs}"
rx="${bs/2}"/>
<g data-command='"moveDown"'>
${Kc(2*(Pi+bs),2*Pi+3*bs,0)}
</g>
<g data-command='"moveUp"'>
${Kc(2*(Pi+bs),2*Pi+bs,180)}
</g>
<g data-command='"moveToNextWord"'>
${Kc(2*Pi+3*bs,2*(Pi+bs),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${Kc(2*Pi+bs,2*(Pi+bs),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${zc(2*Pi+bs,Pi)}
</g>
<g data-command='"removeColumn"'>
${nf(2*Pi+2*bs,Pi)}
</g>
<g data-command='"addColumnAfter"'>
${zc(2*Pi+3*bs,Pi)}
</g>
<g data-command='"addRowBefore"'>
${zc(Pi,2*Pi+bs)}
</g>
<g data-command='"removeRow"'>
${nf(Pi,2*Pi+2*bs)}
</g>
<g data-command='"addRowAfter"'>
${zc(Pi,2*Pi+3*bs)}
</g>
</svg>`,gm=e=>`
<svg id="matrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","matrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,vm=e=>`
<svg id="pmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","pmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,sf=e=>`
<svg id="Bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","Bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,ym=e=>`
<svg id="bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4h-3v16h3"/>
<path class="cls-2" d="m22,4h3v16h-3"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,bm=e=>`
<svg id="vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
</svg>`,_m=e=>`
<svg id="Vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
data-command='["setEnvironment","Vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
</svg>`,xm=e=>`
<svg id="cases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","cases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<circle cx="13" cy="8" r="1"/>
<circle cx="13" cy="16" r="1"/>
<circle cx="21" cy="8" r="1"/>
<circle cx="21" cy="16" r="1"/>
</svg>`,wm=e=>`
<svg id="rcases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","rcases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
<circle cx="15" cy="8" r="1"/>
<circle cx="15" cy="16" r="1"/>
<circle cx="7" cy="8" r="1"/>
<circle cx="7" cy="16" r="1"/>
</svg>`,Yh={matrix:gm,pmatrix:vm,bmatrix:ym,Bmatrix:sf,vmatrix:bm,Vmatrix:_m},Xh={cases:xm,rcases:wm,Bmatrix:sf};function Sm(e){var t,n;const a=(t=e.model.parentEnvironment)==null?void 0:t.array;if(!a)return;let l=0;a.forEach(ze=>{(!l||ze.length>l)&&(l=ze.length)});let f=document.getElementById("mathlive-environment-popover");f||(f=_c("mathlive-environment-popover"),Ja("environment-popover"),Ja("core"),f.setAttribute("aria-hidden","true"));let g;const S=f.querySelector(".MLEP__environment-controls");S?g=S:(g=document.createElement("div"),f.innerHTML="",f.appendChild(g)),g.className="MLEP__environment-controls",g.style.display="flex",g.style.width="100%",g.style.height="100%",g.style.boxSizing="border-box",g.innerHTML=mm;let T=[],R="";const F=e.model.parentEnvironment.environmentName;if(_(F)){const ze=km(F);R=Yh[ze]("active");const _t=Yh,{[ze]:tr}=_t,pt=V(_t,[te(ze)]);T=Object.values(pt).map(Ht=>Ht("inactive"))}else if(w(F)){const ze=Am(F);R=Xh[ze]("active");const _t=Xh,{[ze]:tr}=_t,pt=V(_t,[te(ze)]);T=Object.values(pt).map(Ht=>Ht("inactive"))}else E(F)&&(R=Yh.matrix("active"),T=Object.values(Xh).map(ze=>ze("inactive")));const X=document.createElement("div");X.className="MLEP__environment-delimiter-controls",X.style.display="flex",X.style.flexDirection="column",X.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${R}
${T.join("")}
</div>`,R&&g.appendChild(X),g.querySelectorAll("[data-command]").forEach(ze=>{const _t=ze.dataset.command;let tr=_t;try{tr=JSON.parse(_t)}catch(pt){}ze.addEventListener("mousedown",pt=>pt.preventDefault()),tr&&ze.addEventListener("click",()=>e.executeCommand(tr))});const Me=(n=e.field)==null?void 0:n.getBoundingClientRect();Me&&(f.style.top=`${window.scrollY+(Me.top-f.clientHeight-15)}px`,f.style.left=`${Me.left+20}px`,f.classList.add("is-visible"))}function Jh(){const e=document.getElementById("mathlive-environment-popover");e==null||e.classList.remove("is-visible")}function Em(){document.getElementById("mathlive-environment-popover")&&(Ih("mathlive-environment-popover"),vo("environment-popover"),vo("core"))}function Uc(e){if(!e.hasFocus())return;let t=!1;if(e.model.mode==="math"){const n=e.model.parentEnvironment;if(n!=null&&n.array&&m(n.environmentName)){const a=e.options.environmentPopoverPolicy;t=a==="auto"||a==="on"}}t?Sm(e):Jh()}function km(e){return e.replace("*","")}function Am(e){return e==="dcases"?"cases":e}function af(e){const t=getComputedStyle(e).direction;return t==="ltr"||t==="rtl"?t:"ltr"}function of(e,t,n){return t==="left"||t==="leading"&&n==="ltr"||t==="trailing"&&n==="rtl"?e.left:e.right}function Qh(e,t,n,a){return n==="middle"?e-t/2:n==="start"&&a==="rtl"||n==="end"&&a==="ltr"||n==="top"||n==="right"?Math.max(0,e-t):e}function Tm(e,t,n,a){return n==="middle"?e-t/2:n==="start"&&a==="ltr"||n==="end"&&a==="rtl"||n==="top"||n==="right"?e:e-t}function Cm(e,t){var n,a,l;const f=(n=af(e))!=null?n:"ltr";e.style.position="fixed",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.height="",e.style.width="";const g=e.getBoundingClientRect(),S=Number.isFinite(t.maxHeight)?Math.min(t.maxHeight,window.innerHeight):window.innerHeight;let T=Math.min(S,(a=t.height)!=null?a:g.height),R=Qh(t.location.y,T,t.verticalPos,f);R+T>window.innerHeight-8&&(t.alternateLocation?(R=Qh(t.alternateLocation.y,T,t.verticalPos,f),R+T>window.innerHeight-8&&(R=void 0)):R=void 0),Number.isFinite(R)||(R=Math.max(8,window.innerHeight-8-T),8+T>window.innerHeight-8&&(e.style.bottom="8px")),T=Math.min(R+T,window.innerHeight-8)-R;const F=Number.isFinite(t.maxWidth)?Math.min(t.maxWidth,window.innerWidth):window.innerWidth;let X=Math.min(F,(l=t.width)!=null?l:g.width),ve=Qh(t.location.x,X,t.horizontalPos,f);ve+X>window.innerWidth-8&&(t.alternateLocation?(ve=Tm(t.alternateLocation.x,X,t.verticalPos,f),ve+X>window.innerWidth-8&&(ve=void 0)):ve=void 0),Number.isFinite(ve)||(ve=Math.max(8,window.innerWidth-8-X),8+X>window.innerWidth-8&&(e.style.right="8px")),X=Math.min(ve+X,window.innerWidth-8)-ve,f==="rtl"?e.style.right=`${Math.ceil(window.innerWidth-ve-X).toString()}px`:e.style.left=`${Math.ceil(ve).toString()}px`,e.style.top=`${Math.ceil(R).toString()}px`,T!==g.height&&(e.style.height=`${Math.ceil(T).toString()}px`),X!==g.width&&(e.style.width=`${Math.ceil(X).toString()}px`)}function Dm(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function Y0(e){return"submenu"in e}function wo(e){return"type"in e&&e.type==="command"||"onMenuSelect"in e||"id"in e}function ed(e){return"type"in e&&e.type==="divider"}function td(e){return"type"in e&&e.type==="heading"}var lf={};function rd(e){let t=lf[e];if(!t){let n;switch(e){case"checkmark":n=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
</span>`;break;case"trailing-chevron":n='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":n='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(n){const a=document.createElement("template");a.innerHTML=n,lf[e]=a,t=a}}if(t){if("content"in t)return t.content.cloneNode(!0);const n=document.createElement("svg");return n.innerHTML=t.innerHTML,n}}var uf=80,cf=class{constructor(e,t){this._element=null;var n;this.parentMenu=t,this._declaration=e,Y0(e)?(this.type="submenu",this.submenu=new hf(e.submenu,{parentMenu:t,submenuClass:e.submenuClass,columnCount:e.columnCount})):this.type=(n=e.type)!=null?n:"command",this.hasCheck=wo(e)&&e.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var e,t;(e=this._abortController)==null||e.abort(),this._abortController=void 0,(t=this._element)==null||t.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var e;return(e=this._label)!=null?e:""}set label(e){e===void 0&&(e=""),e!==this._label&&(this._label=e,this.dirty=!0)}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.dirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.element&&(e?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(e){this._checked=e,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(e){e!==this._tooltip&&(this._tooltip=e,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){e!==this._ariaLabel&&(this._ariaLabel=e,this.dirty=!0)}get active(){var e,t;return(t=(e=this.element)==null?void 0:e.classList.contains("active"))!=null?t:!1}set active(e){this.element&&this.element.classList.toggle("active",e)}updateState(e){var t,n,a;const l=this._declaration;if(ed(l)){this.enabled=!1,this.checked=!1;return}td(l)&&(this.enabled=!1,this.checked=!1,this.visible=!0),wo(l)&&(this.checked=wo(l)&&((t=X0(l.checked,e))!=null?t:!1)),(wo(l)||Y0(l))&&(this.enabled=(n=X0(l.enabled,e))!=null?n:!0,this.visible=(a=X0(l.visible,e))!=null?a:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(wo(l)||td(l)||Y0(l))&&(this.label=X0(l.label,e),this.tooltip=X0(l.tooltip,e),this.ariaLabel=X0(l.ariaLabel,e)),this._element&&this.updateElement()}set dirty(e){console.assert(e===!0),e&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const e=this.element;e.textContent="",this.enabled?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true"),this.checked===!0?(e.setAttribute("aria-checked","true"),e.append(rd("checkmark"))):this.checked==="mixed"?(e.setAttribute("aria-checked","mixed"),e.append(rd("mixedmark"))):e.removeAttribute("aria-checked"),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel);const t=document.createElement("span");if(t.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&t.classList.add("heading"),t.innerHTML=this.label,e.append(t),this._tooltip&&e.setAttribute("data-tooltip",this._tooltip),wo(this._declaration)&&this._declaration.keyboardShortcut){const n=document.createElement("kbd");n.innerHTML=Lh(this._declaration.keyboardShortcut),e.append(n)}this.type==="submenu"&&e.append(rd("trailing-chevron"))}get element(){if(this._element)return this._element;if(ed(this._declaration)){const n=document.createElement("li");return n.setAttribute("part","menu-divider"),n.setAttribute("role","divider"),this._element=n,n}const e=document.createElement("li");this._element=e,(wo(this._declaration)||td(this._declaration)||Y0(this._declaration))&&this._declaration.class&&(e.className=this._declaration.class),e.setAttribute("part","menu-item"),e.setAttribute("tabindex","-1"),this.hasCheck?e.setAttribute("role","menuitemcheckbox"):e.setAttribute("role","menuitem"),this.type==="submenu"&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const t=this.abortController.signal;return e.addEventListener("pointerenter",this,{signal:t}),e.addEventListener("pointerleave",this,{signal:t}),e.addEventListener("pointerup",this,{signal:t}),e.addEventListener("click",this,{signal:t}),this._element}dispatchSelect(){if(!wo(this._declaration))return;const e=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(e)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(e){var t;if(!(!this.visible||!this.enabled)){if(e.type==="click"){this.rootMenu.state==="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}if(e.type==="pointerenter"){const n=e;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((t=this.parentMenu.activeMenuItem)!=null&&t.movingTowardSubmenu(n))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(e.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(e.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},uf)},uf)}openSubmenu(e){var t;if(this.type!=="submenu"||!this.element)return;if((t=e==null?void 0:e.withDelay)!=null&&t){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const n=this.element.getBoundingClientRect(),a=af(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:of(n,"trailing",a),y:n.top-4},alternateLocation:{x:of(n,"leading",a),y:n.top-4}})}movingTowardSubmenu(e){if(!this.element||this.type!=="submenu")return!1;const t=this.rootMenu.lastMoveEvent;if(!t)return!1;const n=e.timeStamp-t.timeStamp;if(n>500)return!1;const a=e.clientX-t.clientX;if(Mm(a,t.clientY-e.clientY,n)<=.2)return!1;let f="right";if(this.submenu.element){const g=this.submenu.element.getBoundingClientRect(),S=this.element.getBoundingClientRect();g.left<S.left+S.width/2&&(f="left")}return f==="right"?a>0:a<0}};function Mm(e,t,n){return Math.hypot(e,t)/n}function X0(e,t){return e===void 0||typeof e!="function"?e:(t!=null||(t={alt:!1,control:!1,shift:!1,meta:!1}),e(t))}var hf=class su{constructor(t,n){this._element=null,this._activeMenuItem=null,this._dirty=!0;var a,l;this.parentMenu=(a=n==null?void 0:n.parentMenu)!=null?a:null,this._submenuClass=n==null?void 0:n.submenuClass,this.columnCount=(l=n==null?void 0:n.columnCount)!=null?l:1,this.isSubmenuOpen=!1,this.menuItems=t}get children(){return this._menuItems}set menuItems(t){const n=this.parentMenu;this.dispose(),this.parentMenu=n,t=[...t],this._menuItems=t.map(a=>a.onCreate?a.onCreate(a,this):new cf(a,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var t;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(t=this._menuItems)==null||t.forEach(n=>n.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(t){if(t.type==="wheel"&&this._element){const n=t;this._element.scrollBy(0,n.deltaY),t.stopPropagation()}}dispatchEvent(t){return this.rootMenu.dispatchEvent(t)}get rootMenu(){return this.parentMenu.rootMenu}updateState(t){var n,a,l;this._menuItems.forEach(R=>R.updateState(t));const f=this.hasCheck;this.hasCheck=this._menuItems.some(R=>R.visible&&R.hasCheck),this.hasCheck!==f&&this._menuItems.forEach(R=>R.updateState(t));let g,S=0;for(const R of this._menuItems)R.type==="heading"?(g&&S===0&&(g.visible=!1),g=R,S=0):R.type==="divider"&&g?(g.visible=S>0,g=void 0,S=0):g&&R.visible&&(S+=1);g&&(g.visible=S>0);let T=!0;for(const R of this._menuItems)R.type==="divider"?(R.visible=!T,T=!0):R.visible&&(T=!1);(n=this.activeMenuItem)!=null&&n.visible||(this.activeMenuItem=null),!((a=this.activeMenuItem)!=null&&a.enabled)&&((l=this.activeMenuItem)==null?void 0:l.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible&&t.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible)}set dirty(t){console.assert(t===!0),this._dirty!==t&&t&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var t;if(this._element){this._element.textContent="";for(const{element:n,visible:a}of this._menuItems)n&&a&&this._element.append(n);(t=this._element.querySelector("li:first-of-type"))==null||t.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const t=document.createElement("menu");t.setAttribute("role","menu"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-orientation","vertical"),t.setAttribute("part","ui-menu-container"),this._submenuClass&&t.classList.add(this._submenuClass),t.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const n=this._abortController.signal;return t.addEventListener("focus",this,{signal:n}),t.addEventListener("wheel",this,{passive:!0,signal:n}),this._element=t,this.updateElement(),t}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(t){var n,a,l,f;if(this.rootMenu.cancelDelayedOperation(),t!==this._activeMenuItem){if(this.activeMenuItem){const g=this.activeMenuItem;g.active=!1,(n=g.submenu)==null||n.hide()}if(!((a=t==null?void 0:t.visible)==null||a)){this._activeMenuItem=null;return}this._activeMenuItem=t,t&&(t.active=!0)}t?(l=t.element)==null||l.focus({preventScroll:!0}):(f=this._element)==null||f.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let t=0,n=!1;const a=this._menuItems;for(;!n&&t<=a.length-1;){const l=a[t];n=l.type!=="divider"&&l.visible&&l.enabled,t+=1}return n?a[t-1]:null}get lastMenuItem(){this.updateIfDirty();const t=this._menuItems;let n=t.length-1,a=!1;for(;!a&&n>=0;){const l=t[n];a=l.type!=="divider"&&l.visible&&l.enabled,n-=1}return a?t[n+1]:null}nextMenuItem(t){if(t===0)return this._activeMenuItem;if(!this._activeMenuItem)return t>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const n=this._menuItems.indexOf(this.firstMenuItem),a=this._menuItems.indexOf(this.lastMenuItem);let l=this._menuItems.indexOf(this._activeMenuItem),f=1;for(;l>=n&&l<=a;){l+=t>0?1:-1;const g=this._menuItems[l];if(!g)break;if(g.visible&&g.enabled){if(f===Math.abs(t))return this._menuItems[l];f+=1}}return t>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(t){this.updateIfDirty();const a=this._menuItems.filter(l=>l.visible&&l.enabled).indexOf(t);return a<0?-1:a%this.columnCount}static get collator(){return su._collator||(su._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),su._collator}findMenuItem(t){var n;this.updateIfDirty();const a=this._menuItems.filter(S=>S.type!=="divider"&&S.visible&&S.enabled);if(a.length===0)return null;const l=Math.max(...a.map(S=>S.label.length))-t.length;if(l<0)return null;let f=null,g=0;for(;g<l&&!f;)f=(n=a.find(S=>su.collator.compare(t,S.label.substring(g,t.length))===0))!=null?n:null,g++;return f}show(t){return!this.visible||!t.container?!1:(this.updateElement(),t.container.appendChild(this.element),W()&&(this.element.popover="manual",this.element.showPopover()),t.location&&Cm(this.element,{location:t.location,alternateLocation:t.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var t,n,a,l,f;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),W()&&((t=this._element)!=null&&t.popover)&&this.element.hidePopover(),(a=(n=this.parentMenu)==null?void 0:n.element)==null||a.focus(),(f=(l=this._element)==null?void 0:l.parentNode)==null||f.removeChild(this._element)}set openSubmenu(t){var n,a,l,f;const g=t!==null;((n=this.activeMenuItem)==null?void 0:n.type)==="submenu"&&((a=this.activeMenuItem.element)==null||a.setAttribute("aria-expanded",g.toString())),(f=(l=this.activeMenuItem)==null?void 0:l.element)==null||f.classList.toggle("is-submenu-open",g),this.isSubmenuOpen=g}},df=class pp extends hf{constructor(t,n){var a;super(t),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(a=n==null?void 0:n.host)!=null?a:null,this.isDynamic=t.some(ff),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(t){Zp(this._modifiers,t)||(this._modifiers=t,this.dirty=!0)}get activeSubmenu(){let t=this;for(;t.isSubmenuOpen;)t=t.activeMenuItem.submenu;return t}set dirty(t){this._updating||(console.assert(t===!0),this._dirty!==t&&(this._dirty=!0,t&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(t){this._updating=!0,this.modifiers=t!=null?t:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(t){this.isDynamic&&(this.modifiers=s0(t)),t.stopImmediatePropagation()}handleKeydownEvent(t){var n,a,l;if(t.key==="Tab"||t.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=s0(t));let f=!0;const g=this.activeSubmenu,S=g.activeMenuItem;switch(t.key){case" ":case"Space":case"Return":case"Enter":S==null||S.select(s0(t));break;case"ArrowRight":if((S==null?void 0:S.type)==="submenu")S.select(s0(t)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!S)g.activeMenuItem=g.firstMenuItem;else{const T=(n=g.getMenuItemColumn(S))!=null?n:-1;if(T>=0&&T<((a=g.columnCount)!=null?a:1)-1){const R=g.nextMenuItem(1);R&&(g.activeMenuItem=R)}}break;case"ArrowLeft":if(g===this.rootMenu)S||(g.activeMenuItem=g.firstMenuItem);else if((S&&(l=g.getMenuItemColumn(S))!=null?l:-1)<=0||!S){g.hide();const R=g.parentMenu.activeMenuItem;if(R){const{element:F}=R;F==null||F.focus(),F==null||F.classList.remove("is-submenu-open")}}else{const R=g.nextMenuItem(-1);R&&(g.activeMenuItem=R)}break;case"ArrowDown":g.activeMenuItem=g.nextMenuItem(g.columnCount);break;case"ArrowUp":g.activeMenuItem=g.nextMenuItem(-g.columnCount);break;case"Home":case"PageUp":g.activeMenuItem=g.firstMenuItem;break;case"End":case"PageDown":g.activeMenuItem=g.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const T=g.findMenuItem(this.typingBuffer);T&&(g.activeMenuItem=T),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(vc(t)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=t.key;const T=g.findMenuItem(this.typingBuffer);T&&(g.activeMenuItem=T),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else f=!1}f&&(t.preventDefault(),t.stopPropagation())}handleEvent(t){if(t.type==="keydown")this.handleKeydownEvent(t);else if(t.type==="keyup")this.handleKeyupEvent(t);else if(t.type==="pointermove")this.lastMoveEvent=t;else if(t.type==="pointerup"&&t.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(t.type==="contextmenu"){t.preventDefault(),t.stopPropagation();return}super.handleEvent(t)}dispatchEvent(t){return this._host?this._host.dispatchEvent(t):!0}get scrim(){return yo.element}connectScrim(t){const n=this.scrim;n.addEventListener("pointerup",this),n.addEventListener("contextmenu",this),n.addEventListener("keydown",this),n.addEventListener("keyup",this),n.addEventListener("pointermove",this),yo.open({root:t,onDismiss:()=>this.hide()})}disconnectScrim(){const t=this.scrim;t.removeEventListener("pointerup",this),t.removeEventListener("contextmenu",this),t.removeEventListener("keydown",this),t.removeEventListener("keyup",this),t.removeEventListener("pointermove",this),yo.state==="open"&&yo.scrim.close()}get rootMenu(){return this}show(t){return this._onDismiss=t==null?void 0:t.onDismiss,t!=null&&t.modifiers&&(this.modifiers=t.modifiers),this.updateState(),this.connectScrim(t==null?void 0:t.target),super.show(c($({},t),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,yo.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(t){this.cancelDelayedOperation();const n=pp.SUBMENU_DELAY;if(n<=0){t();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,t()},n)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};df.SUBMENU_DELAY=120;var Lm=df;function ff(e){return ed(e)?!1:typeof e.label=="function"||typeof e.ariaLabel=="function"||typeof e.tooltip=="function"||(wo(e)||Y0(e))&&(typeof e.enabled=="function"||typeof e.visible=="function")||wo(e)&&typeof e.checked=="function"?!0:Y0(e)?e.submenu.some(ff):!1}var Hc=class{};Hc.DELAY=300,Hc.MAX_DISTANCE=10;function Rm(e){return new Promise((t,n)=>{const a=gc(e);a||t(!1);let l=a;const f=setTimeout(()=>{g.abort(),t(Dm(l,a)<Hc.MAX_DISTANCE)},Hc.DELAY),g=new AbortController,S=g.signal;for(const T of["pointermove","pointerup","pointercancel"])window.addEventListener(T,R=>{if(R.type==="pointerup"||R.type==="pointercancel")clearTimeout(f),g.abort(),t(!1);else if(R.type==="pointermove"){const F=gc(R);F&&(l=F)}},{passive:!0,signal:S})})}function pf(e,t,n){return $l(this,null,function*(){if(e.type==="contextmenu"){const a=e;if(n.show({target:t,location:gc(a),modifiers:s0(a)}))return e.preventDefault(),e.stopPropagation(),!0}if(e.type==="keydown"){const a=e;if(a.code==="ContextMenu"||a.code==="F10"&&a.shiftKey){const l=t==null?void 0:t.getBoundingClientRect();if(l&&n.show({target:t,location:{x:Math.ceil(l.left+l.width/2),y:Math.ceil(l.top+l.height/2)},modifiers:s0(a)}))return e.preventDefault(),e.stopPropagation(),!0}}if(e.type==="pointerdown"&&e.pointerType!=="mouse"&&e.button===0){let a=e.target;for(;a&&t!==a;)a=a.parentNode;if(!a||!n.visible)return!1;const l=gc(e);if(yield Rm(e))return n.state!=="closed"?!1:(n.show({target:t,location:l}),!0)}return!1})}var mf={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};Ke(Object.keys(mf),"{body:auto}",{createAtom:e=>new Rl(c($({},e),{body:je(e.args[0]),accentChar:mf[e.command.slice(1)]}))}),Ke(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{const t=Ut(je(e.args[0]));return new Rl(c($({},e),{body:je(e.args[0]),svgAccent:e.command.slice(1)+(t.length>5?"4":["1","1","2","2","3","3"][t.length])}))}}),Ke(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:e=>new Rl(c($({},e),{body:je(e.args[0]),svgAccent:"overarc"}))}),Ke(["underarc","underparen"],"{body:auto}",{createAtom:e=>new Pa(c($({},e),{body:je(e.args[0]),svgBelow:"underarc"}))}),Ke("utilde","{body:auto}",{createAtom:e=>{const t=je(e.args[0]),n=Ut(t),a="widetilde"+(n.length>5?"4":["1","1","2","2","3","3"][n.length]);return new Pa(c($({},e),{body:t,svgBelow:a,boxType:kl(t)}))}}),Ke("^","{:string}",{createAtom:e=>{var t;return new Bt(c($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[e.args[0]])!=null?t:"^"}))}}),Ke("`","{:string}",{createAtom:e=>{var t;return new Bt(c($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[e.args[0]])!=null?t:"`"}))}}),Ke("'","{:string}",{createAtom:e=>{var t;return new Bt(c($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[e.args[0]])!=null?t:"'"}))}}),Ke('"',"{:string}",{createAtom:e=>{var t,n;return new Bt(c($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(n={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[e.args[0]])!=null?n:'"'+e.args[0]:'"'}))}}),Ke(".","{:string}",{createAtom:e=>{var t,n;return new Bt(c($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(n={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[e.args[0]])!=null?n:"."+e.args[0]:"."}))}}),Ke("=","{:string}",{createAtom:e=>{var t,n;return new Bt(c($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(n={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[e.args[0]])!=null?n:"="+e.args[0]:"="}))}}),Ke("~","{:string}",{createAtom:e=>{var t;return new Bt(c($({type:"mord"},e),{isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[e.args[0]])!=null?t:"\xB4"}))}}),Ke("c","{:string}",{createAtom:e=>{var t;return new Bt(c($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={c:"\xE7",C:"\xC7"}[e.args[0]])!=null?t:""}))}}),Ke("enclose","{notation:string}[style:string]{body:auto}",{createAtom:e=>{var t,n;const a=e.args,l={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(t=e.style)!=null?t:{}};if(a[1]){const g=a[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const S of g){const T=S.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(T)l.strokeWidth=T[1],l.strokeStyle=T[2],l.strokeColor=T[3];else{const R=S.match(/\s*([a-z]*)\s*=\s*"(.*)"/);R&&(R[1]==="mathbackground"?l.backgroundcolor=R[2]:R[1]==="mathcolor"?l.strokeColor=R[2]:R[1]==="padding"?l.padding=R[2]:R[1]==="shadow"&&(l.shadow=R[2]))}}l.strokeStyle==="dashed"?l.svgStrokeStyle="5,5":l.strokeStyle==="dotted"&&(l.svgStrokeStyle="1,5")}l.borderStyle=`${l.strokeWidth} ${l.strokeStyle} ${l.strokeColor}`;const f={};return((n=a[0])!=null?n:"").split(/[, ]/).filter(g=>g.length>0).forEach(g=>{f[g.toLowerCase()]=!0}),new Qn(e.command,je(a[2]),f,l)}}),Ke("cancel","{body:auto}",{createAtom:e=>{var t;return new Qn(e.command,je(e.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),Ke("bcancel","{body:auto}",{createAtom:e=>{var t;return new Qn(e.command,je(e.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),Ke("xcancel","{body:auto}",{createAtom:e=>{var t;return new Qn(e.command,je(e.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),Ke(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:e=>{var t;return new Pa(c($({},e),{body:je((t=e.args)==null?void 0:t[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:e.command.slice(1)}))}}),Ke("overbrace","{:auto}",{createAtom:e=>new Pa(c($({},e),{body:je(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:e.command.slice(1)}))}),Ke(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:e=>new Pa(c($({},e),{body:je(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:e.command.slice(1)}))}),Ke(["underbrace"],"{:auto}",{createAtom:e=>new Pa(c($({},e),{body:je(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:e.command.slice(1)}))}),Ke(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:e=>{var t,n,a,l,f;return new Pa(c($({},e),{svgBody:e.command.slice(1),above:((n=je((t=e.args)==null?void 0:t[1]))==null?void 0:n.length)===0?void 0:je((a=e.args)==null?void 0:a[1]),below:(f=je((l=e.args)==null?void 0:l[0]))!=null?f:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(e,t)=>e.command+(e.hasEmptyBranch("below")?"":`[${e.belowToLatex(t)}]`)+`{${e.aboveToLatex(t)}}${e.supsubToLatex(t)}`}),Ke(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:e=>new i0(e.command.slice(1),c($({},e),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),Ke(["liminf","limsup"],"",{ifMode:"math",createAtom:e=>new i0({"\\liminf":"lim inf","\\limsup":"lim sup"}[e.command],c($({},e),{limits:"over-under",variant:"main"}))}),Ke(["lim","mod"],"",{ifMode:"math",createAtom:e=>new i0(e.command.slice(1),c($({},e),{limits:"over-under",variant:"main"}))}),Ke(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new i0(e.command.slice(1),c($({},e),{limits:"over-under",isFunction:!0,variant:"main"}))}),Ke(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new Bt(c($({},e),{body:je(e.args[0])})),serialize:(e,t)=>`\\ang{${e.bodyToLatex(t)}}`,render:(e,t)=>{const n=e.createBox(t),a=n.caret;n.caret=void 0;const l=new rr("\xB0",{style:c($({},e.style),{variant:"normal",variantStyle:"up"})});return new rr([n,l],{type:"inner",isSelected:e.isSelected,caret:a})}}),Ke("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new md(c($({},e),{body:je(e.args[1]),index:e.args[0]?je(e.args[0]):void 0}))}),Ke(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:e=>{const t=$({},e),n=e.command,a=e.args;switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":t.hasBarLine=!0;break;case"\\atopfrac":t.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":t.hasBarLine=!1,t.leftDelim="(",t.rightDelim=")";break;case"\\cfrac":t.hasBarLine=!0,t.continuousFraction=!0;break;default:}switch(n){case"\\dfrac":case"\\dbinom":t.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":t.mathstyleName="textstyle";break;default:}return new ss(a[0]?je(a[0]):[new i],a[1]?je(a[1]):[new i],t)},serialize:(e,t)=>{const n=e.aboveToLatex(t),a=e.belowToLatex(t);return/^[0-9]$/.test(n)&&/^[0-9]$/.test(a)?`${e.command}${n}${a}`:Oi(e.command,n,a)}}),Ke(["brace","brack"],"",{infix:!0,createAtom:e=>new ss(je(e.args[0]),je(e.args[1]),c($({},e),{hasBarLine:!1,leftDelim:e.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:e.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(e,t)=>Bn([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),Ke(["over","atop","choose"],"",{infix:!0,createAtom:e=>{let t,n;const a=e.args;return e.command==="\\choose"&&(t="(",n=")"),new ss(je(a[0]),je(a[1]),c($({},e),{hasBarLine:e.command==="\\over",leftDelim:t,rightDelim:n}))},serialize:(e,t)=>Bn([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),Ke(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:e=>{var t,n;const a=e.args;return new ss(je(a[0]),je(a[1]),c($({},e),{leftDelim:(t=a[2])!=null?t:".",rightDelim:(n=a[3])!=null?n:".",hasBarLine:!1}))},serialize:(e,t)=>`${e.aboveToLatex(t)} ${e.command}${e.leftDelim}${e.rightDelim}${e.belowToLatex(t)}`}),Ke("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:e=>new ss(je(e.args[0]),je(e.args[1]),c($({},e),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),Ke(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:e=>new r0({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[e.command.slice(1)],c($({},e),{limits:"auto",variant:"main"}))}),Ke("smallint","",{ifMode:"math",createAtom:e=>new i0("\u222B",c($({},e),{limits:"adjacent",variant:"main"}))});var gf={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};Ke(Object.keys(gf),"",{ifMode:"math",createAtom:e=>{const t=e.command,n=gf[t.slice(1)];return new r0(n,c($({},e),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[n]}))}}),Ke(["Re","Im"],"",{ifMode:"math",createAtom:e=>new i0({"\\Re":"\u211C","\\Im":"\u2111"}[e.command],c($({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Ke("middle","{:delim}",{ifMode:"math",createAtom:e=>{var t;return new tn(c($({},e),{delim:(t=e.args[0])!=null?t:"|",size:1}))}}),Ke("the","{:value}",{createAtom:e=>new Bt(c($({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,t)=>{var n;const a=new Hn({parent:t},e.style);let l="";e.isSelected&&(l+=" ML__selected");const f=a.evaluate(e.args[0]);return new rr(((n=Ms(f))!=null?n:"").split("").map(g=>new rr(g,{type:"ord",classes:l,mode:e.mode,isSelected:e.isSelected,style:$({variant:"main"},e.style)})),{type:"lift",style:e.style,caret:e.caret,isSelected:e.isSelected,classes:l}).wrap(a)},serialize:e=>{var t;return`\\the${(t=Ms(e.args[0]))!=null?t:"\\relax"}`}}),Ke("mathtip","{:auto}{:math}",{createAtom:e=>new Th(c($({},e),{body:je(e.args[0]),tooltip:je(e.args[1]),content:"math"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${Bt.serialize([e.tooltip],c($({},t),{defaultMode:"math"}))}}`}),Ke("texttip","{:auto}{:text}",{createAtom:e=>new Th(c($({},e),{body:je(e.args[0]),tooltip:je(e.args[1]),content:"text"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${Bt.serialize([e.tooltip],c($({},t),{defaultMode:"text"}))}}`}),Ke("error","{:math}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[0])})),serialize:(e,t)=>`\\error{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__error"})}),Ke("ensuremath","{:math}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(c($({},t),{defaultMode:"math"}))}}`}),Ke("color","{:value}",{applyStyle:(e,t,n)=>{var a,l;return{verbatimColor:(a=Ms(t[0]))!=null?a:void 0,color:n.toColor((l=t[0])!=null?l:{string:"red"})}}}),Ke("textcolor","{:value}{content:auto*}",{applyStyle:(e,t,n)=>{var a,l;return{verbatimColor:(a=Ms(t[0]))!=null?a:void 0,color:n.toColor((l=t[0])!=null?l:{string:"red"})}}}),Ke("boxed","{content:math}",{createAtom:e=>new de(c($({},e),{body:je(e.args[0]),framecolor:{string:"black"}}))}),Ke("colorbox","{:value}{:text*}",{applyStyle:(e,t,n)=>{var a,l;return{verbatimBackgroundColor:(a=Ms(t[0]))!=null?a:void 0,backgroundColor:n.toBackgroundColor((l=t[0])!=null?l:{string:"yellow"})}}}),Ke("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:e=>{var t,n;return new de(c($({},e),{body:je(e.args[2]),framecolor:(t=e.args[0])!=null?t:{string:"blue"},backgroundcolor:(n=e.args[1])!=null?n:{string:"yellow"}}))},serialize:(e,t)=>{var n,a;return t.skipStyles?e.bodyToLatex(c($({},t),{defaultMode:"text"})):Oi(e.command,(n=Ms(e.framecolor))!=null?n:"",(a=Ms(e.backgroundcolor))!=null?a:"",e.bodyToLatex(c($({},t),{defaultMode:"text"})))}}),Ke("bbox","[:bbox]{body:auto}",{createAtom:e=>{var t;const n=e.args[0],a=je(e.args[1]);return n?new de(c($({},e),{body:a,padding:n.padding,border:n.border,backgroundcolor:(t=n.backgroundcolor)!=null?t:void 0})):new de(c($({},e),{body:a}))},serialize:(e,t)=>{var n,a;if(t.skipStyles)return e.bodyToLatex(t);let l=e.command;if(Number.isFinite(e.padding)||e.border!==void 0||e.backgroundcolor!==void 0){const f=[];e.padding&&f.push((n=Ms(e.padding))!=null?n:""),e.border&&f.push(`border: ${e.border}`),e.backgroundcolor&&f.push((a=Ms(e.backgroundcolor))!=null?a:""),l+=`[${f.join(",")}]`}return Oi(l,e.bodyToLatex(t))}}),Ke(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[0])})),render:(e,t)=>{const n=new Hn({parent:t,mathstyle:e.command.slice(1)},e.style),a=Bt.createBox(n,e.body,{type:"lift"});return e.caret&&(a.caret=e.caret),e.bind(t,a)},serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{${Bn([e.command,e.bodyToLatex(t)])}}`}),Ke(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:e=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[e]})}),Ke("fontseries","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var n;return{fontSeries:(n=t[0])!=null?n:"auto"}}}),Ke("fontshape","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var n;return{fontShape:(n=t[0])!=null?n:"auto"}}}),Ke("fontfamily","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var n;return{fontFamily:(n=t[0])!=null?n:"roman"}}}),Ke("selectfont","",{ifMode:"text",applyStyle:()=>({})}),Ke("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),Ke(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:e=>new Bt(c($({},e),{body:je(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__boldsymbol"})}),Ke("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),Ke("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Ke("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Ke("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Ke("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Ke("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Ke("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Ke("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Ke("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Ke("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),Ke("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Ke("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),Ke("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Ke("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),Ke("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),Ke("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),Ke("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),Ke("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),Ke("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),Ke("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),Ke("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),Ke("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),Ke("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),Ke("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),Ke("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),Ke("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),Ke("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),Ke(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),Ke(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),Ke("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),Ke("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),Ke("mbox","{:text}",{ifMode:"math",createAtom:e=>new Bt(c($({},e),{type:"mord",body:je(e.args[0]),mode:"math"})),serialize:(e,t)=>Oi("\\mbox",e.bodyToLatex(c($({},t),{defaultMode:"text"})))}),Ke("text","{:text}",{ifMode:"math",applyMode:"text"}),Ke(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[1])})),serialize:(e,t)=>!e.args[0]||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`,render:(e,t)=>{var n;return e.createBox(t,{classes:(n=e.args[0])!=null?n:""})}}),Ke(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[1])})),serialize:(e,t)=>{var n;return!((n=e.args)!=null&&n[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var n;const a=e.createBox(t);return a.cssId=(n=e.args[0])!=null?n:"",a}}),Ke("htmlData","{data:string}{content:auto}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[1])})),serialize:(e,t)=>{var n;return!((n=e.args)!=null&&n[0])||t.skipStyles?e.bodyToLatex(t):`\\htmlData{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var n;const a=e.createBox(t);return a.htmlData=(n=e.args[0])!=null?n:"",a}}),Ke(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[1])})),serialize:(e,t)=>{var n;return!((n=e.args)!=null&&n[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var n;const a=e.createBox(t);return a.htmlStyle=(n=e.args[0])!=null?n:"",a}}),Ke("em","{:rest}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[0])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{\\em ${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})}),Ke("emph","{:auto}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[1])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\emph{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})});var vf={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};Ke(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:e=>{var t;return new jr(c($({},e),{delim:(t=e.args[0])!=null?t:".",size:vf[e.command].size,delimType:vf[e.command].mclass}))}}),Ke(["hspace","hspace*"],"{width:value}",{createAtom:e=>{var t;return new ku(c($({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),Ke(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var t;return new ku(c($({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),Ke("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:e=>new Bt(e),render:(e,t)=>{let n=0;const a=t.mathstyle.id;(a===jo||a===fa)&&(n=1),(a===Bs||a===Ri)&&(n=2),(a===Xa||a===is)&&(n=3);const l=je(e.args[n]);return Bt.createBox(t,l)},serialize:(e,t)=>`\\mathchoice{${Bt.serialize(e.args[0],t)}}{${Bt.serialize(e.args[1],t)}}{${Bt.serialize(e.args[2],t)}}{${Bt.serialize(e.args[3],t)}}`}),Ke("mathop","{:auto}",{createAtom:e=>new Bt(c($({},e),{type:"mop",body:je(e.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(e,t)=>{var n;let a=Bt.createBox(t,e.body);if(e.superscript||e.subscript){const l=(n=e.subsupPlacement)!=null?n:"auto";a=l==="over-under"||l==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:a}):e.attachSupsub(t,{base:a})}return new rr(e.bind(t,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const n=[Oi(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&n.push("\\limits"),e.subsupPlacement==="adjacent"&&n.push("\\nolimits"),e.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(e.supsubToLatex(t)),Bn(n)}}),Ke(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new Bt(c($({},e),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e.command],body:je(e.args[0])}))}),Ke(["operatorname","operatorname*"],"{operator:math}",{createAtom:e=>{const t=je(e.args[0]).map(n=>{var a;return n.type!=="first"&&(n.type="mord",n.value=(a={"\u2217":"*","\u2212":"-"}[n.value])!=null?a:n.value,n.isFunction=!1,!n.style.variant&&!n.style.variantStyle&&(n.style.variant="main",n.style.variantStyle="up")),n});return new Bt(c($({},e),{type:"mop",body:t,isFunction:!0,limits:e.command==="\\operatorname"?"adjacent":"over-under"}))},render:(e,t)=>{var n;let a=Bt.createBox(t,e.body);if(e.superscript||e.subscript){const l=(n=e.subsupPlacement)!=null?n:"auto";a=l==="over-under"||l==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:a}):e.attachSupsub(t,{base:a})}return e.caret&&(a.caret=e.caret),new rr(e.bind(t,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const n=[Oi(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&n.push("\\limits"),e.subsupPlacement==="adjacent"&&n.push("\\nolimits"),e.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(e.supsubToLatex(t)),Bn(n)}}),Ke(["char","unicode"],"{charcode:value}",{createAtom:e=>new Bt(c($({},e),{type:e.mode==="text"?"text":"mord"})),serialize:e=>{var t;return`${e.command}${Ms((t=e.args[0])!=null?t:{number:10067,base:"hexadecimal"})}`},render:(e,t)=>{let n=t.evaluate(e.args[0]);return(!n||!("number"in n))&&(n={number:10067,base:"hexadecimal"}),e.value=String.fromCodePoint(n.number),e.createBox(t)}}),Ke("rule","[raise:value]{width:value}{thickness:value}",{createAtom:e=>new Bt(e),render:(e,t)=>{var n,a,l;const f=new Hn({parent:t,mathstyle:"textstyle"},e.style),g=f.toEm((n=e.args[0])!=null?n:{dimension:0}),S=f.toEm((a=e.args[1])!=null?a:{dimension:10}),T=f.toEm((l=e.args[2])!=null?l:{dimension:10}),R=new rr(null,{classes:"rule",type:"ord"});return R.width=S,R.height=T+g,R.depth=-g,R.setStyle("border-right-width",S,"em"),R.setStyle("border-top-width",T,"em"),R.setStyle("border-color",e.style.color),R.setStyle("vertical-align",g,"em"),e.isSelected&&R.setStyle("opacity","50%"),e.bind(f,R),e.caret&&(R.caret=e.caret),R.wrap(t)},serialize:e=>`\\rule${e.args[0]?`[${Ms(e.args[0])}]`:""}{${Ms(e.args[1])}}{${Ms(e.args[2])}}`}),Ke(["overline","underline"],"{:auto}",{createAtom:e=>new Bt(c($({},e),{body:je(e.args[0])})),render:(e,t)=>{const n=e.command.substring(1),a=new Hn({parent:t,mathstyle:"cramp"},e.style),l=Bt.createBox(a,e.body);if(!l)return null;const f=a.metrics.defaultRuleThickness/a.scalingFactor,g=new rr(null,{classes:n+"-line"});g.height=f,g.maxFontSize=f*1.125*a.scalingFactor;let S;return n==="overline"?S=new ds({shift:0,children:[{box:l},3*f,{box:g},f]}):S=new ds({top:l.height,children:[f,{box:g},3*f,{box:l}]}),e.caret&&(S.caret=e.caret),new rr(S,{classes:n,type:"ignore"})}}),Ke("overset","{:auto}{base:auto}",{createAtom:e=>{const t=je(e.args[1]);return new Pa(c($({},e),{above:je(e.args[0]),body:t,skipBoundary:!1,boxType:kl(t)}))},serialize:(e,t)=>Oi(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),Ke("underset","{:auto}{base:auto}",{createAtom:e=>{const t=je(e.args[1]);return new Pa(c($({},e),{below:je(e.args[0]),body:t,skipBoundary:!1,boxType:kl(t)}))},serialize:(e,t)=>Oi(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),Ke("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:e=>{const t=je(e.args[2]);return new Pa(c($({},e),{above:je(e.args[0]),below:je(e.args[1]),body:t,skipBoundary:!1,boxType:kl(t)}))},serialize:(e,t)=>Oi(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),Ke(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new Pa(c($({},e),{body:je(e.args[2]),above:je(e.args[1]),below:je(e.args[0]),skipBoundary:!1,boxType:e.command==="\\stackrel"?"rel":"bin"})),serialize:(e,t)=>Oi(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),Ke("smash","[:string]{:auto}",{createAtom:e=>{var t,n,a,l;return new Eu(c($({},e),{body:je(e.args[1]),smashHeight:(n=(t=e.args[0])==null?void 0:t.includes("t"))!=null?n:!0,smashDepth:(l=(a=e.args[0])==null?void 0:a.includes("b"))!=null?l:!0}))}}),Ke(["vphantom"],"{:auto}",{createAtom:e=>new Eu(c($({},e),{body:je(e.args[0]),isInvisible:!0,smashWidth:!0}))}),Ke(["hphantom"],"{:auto}",{createAtom:e=>new Eu(c($({},e),{body:je(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Ke(["phantom"],"{:auto}",{createAtom:e=>new Eu(c($({},e),{body:je(e.args[0]),isInvisible:!0}))}),Ke("not","{:math}",{createAtom:e=>{const t=je(e.args[0]);return t.length===0?new Bt(c($({},e),{type:"mrel",value:"\uE020"})):new Bt(c($({},e),{body:[new n0(c($({},e),{body:"\uE020",align:"right"})),...t],captureSelection:!0}))},serialize:(e,t)=>{const n=e.args[0],a=n&&typeof n=="object"&&"group"in n;return e.value!=="\uE020"?a?`\\not{${Bt.serialize(n.group,t)}}`:`\\not${Bt.serialize(n,t)}`:a?"\\not{}":"\\not"},render:(e,t)=>{if(e.value)return e.createBox(t);const a=e.args[0]&&typeof e.args[0]=="object"&&"group"in e.args[0]?"ord":kl(je(e.args[0])),l=Bt.createBox(t,e.body,{type:a});return e.caret&&(l.caret=e.caret),e.bind(t,l)}}),Ke(["ne","neq"],"",{createAtom:e=>new Bt(c($({},e),{type:"mrel",body:[new n0(c($({},e),{body:"\uE020",align:"right",boxType:"rel"})),new Bt(c($({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command}),Ke("rlap","{:auto}",{createAtom:e=>new n0(c($({},e),{body:je(e.args[0]),align:"right"}))}),Ke("llap","{:auto}",{createAtom:e=>new n0(c($({},e),{body:je(e.args[0]),align:"left"}))}),Ke("mathrlap","{:math}",{createAtom:e=>new n0(c($({},e),{body:je(e.args[0]),align:"left"}))}),Ke("mathllap","{:math}",{createAtom:e=>new n0(c($({},e),{body:je(e.args[0]),align:"left"}))}),Ke("raisebox","{:value}{:text}",{createAtom:e=>{var t;return new de(c($({},e),{body:je(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var n;return Oi("\\raisebox",(n=Ms(e.offset))!=null?n:"0pt",e.bodyToLatex(t))}}),Ke("raise","{:value}{:auto}",{createAtom:e=>{var t;return new de(c($({},e),{body:je(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var n;return Oi("\\raise",(n=Ms(e.offset))!=null?n:"0pt",e.bodyToLatex(t))}}),Ke("lower","{:value}{:auto}",{createAtom:e=>{var t;return new de(c($({},e),{body:je(e.args[1]),padding:{dimension:0},offset:(t=Ia(e.args[0],-1))!=null?t:{dimension:0}}))},serialize:(e,t)=>{var n,a;return Oi("\\lower",(a=Ms(Ia((n=e.offset)!=null?n:{dimension:0},-1)))!=null?a:"0pt",e.bodyToLatex(t))}}),Tt("0123456789/@.?!"),ge(65,90),ge(97,122),Tt([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Tt([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Tt([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),Tt([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),Tt([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),Tt([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),Tt([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),Tt([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),Tt([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),Tt([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),Tt([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),Tt([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Tt([["\\wp",8472],["\\aleph",8501]]),Tt([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),Tt([["\\ ",160],["~",160]],"space"),Ke(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:e=>new ku(e)}),Ke("space","",{createAtom:e=>new ku(e)}),Tt([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Tt([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Tt([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var yf="<mo>&#x2061;</mo>",Gc="<mo>&#8290;</mo>";function Vc(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ki(e,t){return!e||!t.generateID?"":` extid="${e}"`}function Im(e,t,n){var a,l,f,g,S,T,R,F,X,ve,Me;let ze=!1;t=t!=null?t:e.atoms.length;let _t="",tr="",pt=e.atoms[e.index];const Ht=(l=(a=pt.style)==null?void 0:a.variant)!=null?l:"",ur=(g=(f=pt.style)==null?void 0:f.variantStyle)!=null?g:"";let jt="";if(Ht||ur){const Yr=rt(pt.value,(S=pt.style)==null?void 0:S.variant,(T=pt.style)==null?void 0:T.variantStyle);if(Yr!==pt.value)return e.index+=1,_t=`<mi${ki(pt.id,n)}>${Yr}</mi>`,Jo(_t,e,n)||(e.mathML+=_t,e.lastType="mi"),!0;jt=(R={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[ur+Ht])!=null?R:"",jt=` mathvariant="${jt}"`}const Pr={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(pt.command==="!")return e.index+=1,_t="<mo>!</mo>",Jo(_t,e,n)||(e.mathML+=_t,e.lastType="mo"),!0;if(Pr[pt.command]){e.index+=1;let Yr=`<mi${ki(pt.id,n)}${jt}>${Pr[pt.command]}</mi>`;return(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mtext"||e.lastType==="fence")&&(Yr=Gc+Yr),Jo(Yr,e,n)||(e.mathML+=Yr,e.lastType="mi"),!0}if(pt.command==="\\operatorname")tr=J0(pt.body),e.index+=1;else if(Ht||ur)for(;e.index<t&&(pt.type==="mord"||pt.type==="macro")&&!pt.isDigit()&&Ht===((X=(F=pt.style)==null?void 0:F.variant)!=null?X:"")&&ur===((Me=(ve=pt.style)==null?void 0:ve.variantStyle)!=null?Me:"");)tr+=J0([pt]),e.index+=1,pt=e.atoms[e.index];else(pt.type==="mord"||pt.type==="macro")&&!pt.isDigit()&&(tr+=J0([pt]),e.index+=1);if(tr.length>0){ze=!0,_t=`<mi${jt}>${tr}</mi>`;const Yr=e.lastType;_t.endsWith(">f</mi>")||_t.endsWith(">g</mi>")?(_t+=yf,e.lastType="applyfunction"):e.lastType=/^<mo>(.*)<\/mo>$/.test(_t)?"mo":"mi",Jo(_t,e,n)||((Yr==="mi"||Yr==="mn"||Yr==="mtext"||Yr==="fence")&&(_t=Gc+_t),e.mathML+=_t)}return ze}function Om(e){return e.index<e.atoms.length&&e.atoms[e.index].superscript&&e.atoms[e.index].type==="subsup"}function Bm(e){let t=-1,n=e.index,a=!1,l=!1;for(;n<e.atoms.length&&!a&&!l;){const f=e.atoms[n];a=!f.isDigit(),l=!a&&f.superscript!==void 0,n++}return l&&(t=n-1),t}function Jo(e,t,n){var a;let l=t.atoms[t.index-1];if(!l)return!1;if(!l.superscript&&!l.subscript)if(((a=t.atoms[t.index])==null?void 0:a.type)==="subsup")l=t.atoms[t.index],t.index+=1;else return!1;const f=t.lastType;t.lastType="";const g=ri(l.superscript,n);t.lastType="";const S=ri(l.subscript,n);if(t.lastType=f,!g&&!S)return!1;let T="";return g&&S?T=`<msubsup>${e}${S}${g}</msubsup>`:g?T=`<msup>${e}${g}</msup>`:S&&(T=`<msub>${e}${S}</msub>`),t.mathML+=T,t.lastType="",!0}function Pm(e,t,n){t=t!=null?t:e.atoms.length;const a=e.index;let l="";for(;e.index<t&&e.atoms[e.index].mode==="text";)l+=e.atoms[e.index].value?e.atoms[e.index].value:" ",e.index+=1;return l.length>0?(e.mathML+=`<mtext ${ki(e.atoms[a].id,n)}>${l}</mtext>`,e.lastType="mtext",!0):!1}function Fm(e,t,n){t=t!=null?t:e.atoms.length;const a=e.index;let l="",f=Bm(e);for(f>=0&&f<t&&(t=f);e.index<t&&e.atoms[e.index].isDigit();)l+=e.atoms[e.index].asDigit(),e.index+=1;return l.length<=0?!1:(l="<mn"+ki(e.atoms[a].id,n)+">"+l+"</mn>",f<0&&Om(e)&&(f=e.index,e.index+=1),Jo(l,e,n)||(e.mathML+=l,e.lastType="mn"),!0)}function Nm(e,t,n){let a=!1;t=t!=null?t:e.atoms.length;let l="",f="";if(e.index<t&&e.atoms[e.index].type==="mopen"){let g=!1,S=0;const T=e.index;let R=-1,F=T+1;for(;F<t&&!g;)e.atoms[F].type==="mopen"?S+=1:e.atoms[F].type==="mclose"&&(S-=1),S===-1&&(g=!0,R=F),F+=1;g&&(l="<mrow>",l+=p0(e.atoms[T],n),l+=ri(e.atoms,n,T+1,R),l+=p0(e.atoms[R],n),l+="</mrow>",e.index=R+1,(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mfrac"||e.lastType==="fence")&&(e.mathML+=Gc),Jo(l,e,n)&&(a=!0,e.lastType="",l=""),f="fence")}return l.length>0&&(a=!0,e.mathML+=l,e.lastType=f),a}function $m(e,t,n){let a=!1;t=t!=null?t:e.atoms.length;let l="",f="";const g=e.atoms[e.index];if(!g)return!1;const S={"\\ne":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(S[g.command]){e.index+=1;const T=`<mo${ki(g.id,n)}>${S[g.command]}</mo>`;return Jo(T,e,n)||(e.mathML+=T,e.lastType="mo"),!0}if(e.index<t&&(g.type==="mbin"||g.type==="mrel"))l+=nd(e.atoms[e.index],n),e.index+=1,f="mo";else if(e.index<t&&(g.type==="mop"||g.type==="operator"||g.type==="extensible-symbol")){if(g.subsupPlacement==="over-under"&&(g.superscript||g.subscript)){const T=p0(g,n);return g.superscript&&g.subscript?(l+="<munderover>"+T,l+=ri(g.subscript,n),l+=ri(g.superscript,n),l+="</munderover>"):g.superscript?(l+="<mover>"+T,l+=ri(g.superscript,n),l+="</mover>"):g.subscript&&(l+="<munder>"+T,l+=ri(g.subscript,n),l+="</munder>"),e.mathML+=l,e.lastType="mo",e.index+=1,!0}{const T=e.atoms[e.index],R=T.value==="\\operatorname",F=R?'<mi class="MathML-Unit"'+ki(T.id,n)+">"+J0(T.value)+"</mi>":p0(T,n);l+=F,!R&&!/^<mo>(.*)<\/mo>$/.test(F)?(l+=yf,f="applyfunction"):f=R?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(l)&&(l=Gc+l),e.index+=1}return l.length>0&&(a=!0,Jo(l,e,n)||(e.mathML+=l,e.lastType=f)),a}function ri(e,t,n,a){t!=null||(t={});const l={atoms:[],index:n!=null?n:0,mathML:"",lastType:""};if(typeof e=="number"||typeof e=="boolean")l.mathML=e.toString();else if(typeof e=="string")l.mathML=e;else if(e instanceof Bt)l.mathML=nd(e,t);else if(Array.isArray(e)){l.atoms=e;let f=0;for(a=a||(e?e.length:0);l.index<a;)if(Pm(l,a,t)||Fm(l,a,t)||Im(l,a,t)||$m(l,a,t)||Nm(l,a,t))f+=1;else if(l.index<a){let g=nd(l.atoms[l.index],t);l.lastType==="mn"&&g.length>0&&l.atoms[l.index].type==="genfrac"&&(g="<mo>&#x2064;</mo>"+g),l.atoms[l.index].type==="genfrac"?l.lastType="mfrac":l.lastType="",l.index+=1,Jo(g,l,t)?f+=1:g.length>0&&(l.mathML+=g,f+=1)}f>1&&(l.mathML="<mrow>"+l.mathML+"</mrow>")}return l.mathML}function p0(e,t){let n="";const a=J0(e.value);return a&&(n="<mo"+ki(e.id,t)+">"+a+"</mo>"),n}function J0(e){if(!e)return"";if(typeof e=="string")return Vc(e);if(!Array.isArray(e)&&typeof e.body=="string")return Vc(e.body);let t="";for(const n of e)typeof n.value=="string"&&(t+=n.value);return Vc(t)}function nd(e,t){var n,a,l,f,g,S,T,R,F,X,ve,Me,ze,_t,tr,pt,Ht,ur,jt,Pr,Yr,Hr;if(e.mode==="text")return`<mi${ki(e.id,t)}>${e.value}</mi>`;const Gn={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},yi={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let dr="",_a="",Eo,Na,Rs,xa,oa,Ai;const{command:os}=e;if(e.command==="\\error")return`<merror${ki(e.id,t)}>${ri(e.body,t)}</merror>`;const Is={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},ko={"\\vec":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(e.type){case"first":break;case"group":case"root":dr=ri(e.body,t);break;case"array":if((e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(dr+="<mrow>",e.leftDelim&&e.leftDelim!=="."&&(dr+="<mo>"+(Is[e.leftDelim]||e.leftDelim)+"</mo>")),dr+="<mtable",e.colFormat){for(dr+=' columnalign="',Rs=0;Rs<e.colFormat.length;Rs++)e.colFormat[Rs].align&&(dr+={l:"left",c:"center",r:"right"}[e.colFormat[Rs].align]+" ");dr+='"'}for(dr+=">",Na=0;Na<e.array.length;Na++){for(dr+="<mtr>",Eo=0;Eo<e.array[Na].length;Eo++)dr+="<mtd>"+ri(e.array[Na][Eo],t)+"</mtd>";dr+="</mtr>"}dr+="</mtable>",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(dr+="<mo>"+(Is[e.leftDelim]||e.rightDelim)+"</mo>"),dr+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(dr+="<mrow>"),e.leftDelim&&e.leftDelim!=="."&&(dr+="<mo"+ki(e.id,t)+">"+(Is[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(dr+="<mfrac>",dr+=ri(e.above,t)||"<mi>&nbsp;</mi>",dr+=ri(e.below,t)||"<mi>&nbsp;</mi>",dr+="</mfrac>"):(dr+="<mtable"+ki(e.id,t)+">",dr+="<mtr>"+ri(e.above,t)+"</mtr>",dr+="<mtr>"+ri(e.below,t)+"</mtr>",dr+="</mtable>"),e.rightDelim&&e.rightDelim!=="."&&(dr+="<mo"+ki(e.id,t)+">"+(Is[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(dr+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(dr+="<msqrt"+ki(e.id,t)+">",dr+=ri(e.body,t),dr+="</msqrt>"):(dr+="<mroot"+ki(e.id,t)+">",dr+=ri(e.body,t),dr+=ri(e.above,t),dr+="</mroot>");break;case"leftright":const Ao=e,To=Ao.leftDelim;dr="<mrow>",To&&To!=="."&&(dr+=`<mo${ki(e.id,t)}>${(n=Is[To])!=null?n:To}</mo>`),e.body&&(dr+=ri(e.body,t));const Co=Ao.matchingRightDelim();Co&&Co!=="."&&(dr+=`<mo${ki(e.id,t)}>${(a=Is[Co])!=null?a:Co}</mo>`),dr+="</mrow>";break;case"sizeddelim":case"delim":dr+=`<mo${ki(e.id,t)}>${Is[e.value]||e.value}</mo>`;break;case"accent":dr+='<mover accent="true"'+ki(e.id,t)+">",dr+=ri(e.body,t),dr+="<mo>"+(ko[os]||e.accent)+"</mo>",dr+="</mover>";break;case"line":case"overlap":break;case"overunder":oa=e.above,xa=e.below,(e.svgAbove||oa)&&(e.svgBelow||xa)?Ai=e.body:oa&&oa.length>0?(Ai=e.body,(f=(l=e.body)==null?void 0:l[0])!=null&&f.below?(xa=e.body[0].below,Ai=e.body[0].body):((S=(g=e.body)==null?void 0:g[0])==null?void 0:S.type)==="first"&&((R=(T=e.body)==null?void 0:T[1])!=null&&R.below)&&(xa=e.body[1].below,Ai=e.body[1].body)):xa&&xa.length>0&&(Ai=e.body,(X=(F=e.body)==null?void 0:F[0])!=null&&X.above?(oa=e.body[0].above,Ai=e.body[0].body):((Me=(ve=e.body)==null?void 0:ve[0])==null?void 0:Me.type)==="first"&&((_t=(ze=e.body)==null?void 0:ze[1])!=null&&_t.above)&&(oa=e.body[1].overscript,Ai=e.body[1].body)),(e.svgAbove||oa)&&(e.svgBelow||xa)?(dr+=`<munderover ${ki(e.id,t)}>`,dr+=(tr=Gn[e.svgBody])!=null?tr:ri(Ai,t),dr+=(pt=Gn[e.svgBelow])!=null?pt:ri(xa,t),dr+=(Ht=Gn[e.svgAbove])!=null?Ht:ri(oa,t),dr+="</munderover>"):e.svgAbove||oa?(dr+=`<mover ${ki(e.id,t)}>`+((ur=Gn[e.svgBody])!=null?ur:ri(Ai,t)),dr+=(jt=Gn[e.svgAbove])!=null?jt:ri(oa,t),dr+="</mover>"):(e.svgBelow||xa)&&(dr+=`<munder ${ki(e.id,t)}>`+((Pr=Gn[e.svgBody])!=null?Pr:ri(Ai,t)),dr+=(Yr=Gn[e.svgBelow])!=null?Yr:ri(xa,t),dr+="</munder>");break;case"placeholder":dr+="?";break;case"mord":{dr=typeof e.value=="string"?e.value:os,os==="\\char"?dr="&#x"+("000000"+e.args[0].number.toString(16)).slice(-4)+";":dr.length>0&&dr.startsWith("\\")&&(typeof e.value=="string"&&e.value.charCodeAt(0)>255?dr="&#x"+("000000"+e.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof e.value=="string"?dr=e.value.charAt(0):(console.error("Did not expect this"),dr=""));const to=/\d/.test(dr)?"mn":"mi";dr=`<${to}${ki(e.id,t)}>${Vc(dr)}</${to}>`;break}case"mbin":case"mrel":case"minner":dr=p0(e,t);break;case"mpunct":dr='<mo separator="true"'+ki(e.id,t)+">"+os+"</mo>";break;case"mop":case"operator":case"extensible-symbol":e.body!=="\u200B"&&(dr="<mo"+ki(e.id,t)+">",dr+=os==="\\operatorname"?e.body:os||e.body,dr+="</mo>");break;case"box":dr='<menclose notation="box"',e.backgroundcolor&&(dr+=' mathbackground="'+e.backgroundcolor+'"'),dr+=ki(e.id,t)+">"+ri(e.body,t)+"</menclose>";break;case"spacing":dr+='<mspace width="'+((Hr=yi[os])!=null?Hr:0)+'em"/>';break;case"enclose":dr='<menclose notation="';for(const to in e.notation)Object.prototype.hasOwnProperty.call(e.notation,to)&&e.notation[to]&&(dr+=_a+to,_a=" ");dr+=ki(e.id,t)+'">'+ri(e.body,t)+"</menclose>";break;case"prompt":dr='<menclose notation="roundexbox""">'+ri(e.body,t)+"</menclose>";break;case"space":dr+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":dr+=p0(e,t);break;case"mclose":dr+=p0(e,t);break;case"macro":{const to=e.command+J0(e.macroArgs);to&&(dr+=`<mo ${ki(e.id,t)}>${to}</mo>`)}break;case"latexgroup":dr+=ri(e.body,t);break;case"latex":dr+="<mtext"+ki(e.id,t)+">"+e.value+"</mtext>";break;case"tooltip":dr+=ri(e.body,t);break;case"text":dr+=`<mtext ${ki(e.id,t)}x>${e.value}</mtext>`;break;default:if(e.command==="\\displaystyle")return`<mrow ${ki(e.id,t)} displaystyle="true">${ri(e.body,t)}</mrow>`;if(e.command==="\\textstyle")return`<mrow ${ki(e.id,t)} displaystyle="false">${ri(e.body,t)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return dr}var Q0={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},id={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function zm(e){let t="";return e.startsWith("\\")&&(t=" "+e.replace("\\","")+" "),t}function zu(e){let t=0;if(A(e))for(const n of e)n.type!=="first"&&(t+=1);return t===1}function Km(e){if(A(e)){for(const t of e)if(t.type!=="first"&&t.id)return t.id.toString()}return""}function bf(e){let t="";if(A(e))for(const n of e)n.type!=="first"&&typeof n.value=="string"&&(t+=n.value);return t}function Um(e){return e?e.map(t=>t.value).join(""):""}function Fn(e,t){var n,a,l,f,g;function S(F){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(F)?` <say-as interpret-as="character">${F}</say-as>`:/[A-Z]/.test(F)?`capital <say-as interpret-as="character">${F.toLowerCase()}</say-as>`:F:/[a-z]/.test(F)?" '"+F.toUpperCase()+"'":/[A-Z]/.test(F)?" 'capital "+F.toUpperCase()+"'":F}function T(F){return"<emphasis>"+F+"</emphasis>"}if(!t)return"";let R="";if(A(t)){let F=!1,X=!1;for(let ve=0;ve<t.length;ve++)t[ve].type!=="first"&&(t[ve].mode!=="text"&&(X=!1),ve<t.length-2&&t[ve].type==="mopen"&&t[ve+2].type==="mclose"&&t[ve+1].type==="mord"?(R+=" of ",R+=T(Fn(e,t[ve+1])),ve+=2):t[ve].mode==="text"?X?R+=(n=t[ve].value)!=null?n:" ":(X=!0,R+=Fn("text",t[ve])):t[ve].isDigit()?F?R+=t[ve].asDigit():(F=!0,R+=Fn(e,t[ve])):(F=!1,R+=Fn(e,t[ve])))}else if(t.mode==="text")t.id&&e==="math"&&(R+='<mark name="'+t.id.toString()+'"/>'),R+=t.value;else{t.id&&e==="math"&&(R+='<mark name="'+t.id.toString()+'"/>');let F="",X="",ve="",Me=!1;const{command:ze}=t;switch(ze){case"\\vec":return"vector "+Fn(e,t.body);case"\\acute":return Fn(e,t.body)+" acute";case"\\grave":return Fn(e,t.body)+" grave";case"\\dot":return"dot over"+Fn(e,t.body);case"\\ddot":return"double dot over"+Fn(e,t.body);case"\\mathring":return"ring over"+Fn(e,t.body);case"\\tilde":case"\\widetilde":return"tilde over"+Fn(e,t.body);case"\\bar":return Fn(e,t.body)+" bar";case"\\breve":return Fn(e,t.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Fn(e,t.body);case"\\hat":case"\\widehat":return"hat over"+Fn(e,t.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Fn(e,t.body);case"\\underarc":case"\\underparen":return"arc under "+Fn(e,t.body)}switch(t.type){case"prompt":const _t=t.body.length>1?'start input . <break time="500ms"/> '+Fn(e,t.body)+'. <break time="500ms"/> end input':"blank";R+=' <break time="300ms"/> '+_t+'. <break time="700ms"/>'+((a=t.correctness)!=null?a:"")+' . <break time="700ms"/> ';break;case"array":const tr=t.array,pt=t.environmentName;if(Object.keys(id).includes(pt)){R+=` begin ${id[pt]} `;for(let jt=0;jt<tr.length;jt++){jt>0&&(R+=","),R+=` row ${jt+1} `;for(let Pr=0;Pr<tr[jt].length;Pr++)Pr>0&&(R+=","),R+=` column ${Pr+1}: `,R+=Fn("math",tr[jt][Pr])}R+=` end ${id[pt]} `}break;case"group":ze==="\\ne"?R+=" not equal ":(ze==="\\not"&&(R+=" not "),R+=Fn("math",t.body));break;case"root":R+=Fn("math",t.body);break;case"genfrac":if(F=Fn("math",t.above),X=Fn("math",t.below),zu(t.above)&&zu(t.below)){const Pr={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[bf(t.above)+"/"+bf(t.below)];Pr?R=Pr:R+=F+" over "+X}else R+=' the fraction <break time="150ms"/>'+F+' over <break time="150ms"/>'+X+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(ve=Fn("math",t.body),t.hasEmptyBranch("above"))R+=zu(t.body)?" the square root of "+ve+" , ":' the square root of <break time="200ms"/>'+ve+'. <break time="200ms"/> End square root';else{let jt=Fn("math",t.above);jt=jt.trim();const Pr=jt.replace(/<mark([^/]*)\/>/g,"");Pr==="3"?R+=' the cube root of <break time="200ms"/>'+ve+'. <break time="200ms"/> End cube root':Pr==="n"?R+=' the nth root of <break time="200ms"/>'+ve+'. <break time="200ms"/> End root':R+=' the root with index: <break time="200ms"/>'+jt+', of <break time="200ms"/>'+ve+'. <break time="200ms"/> End root'}break;case"leftright":{const jt=t;R+=(l=jt.leftDelim?Q0[jt.leftDelim]:void 0)!=null?l:jt.leftDelim,R+=Fn("math",t.body),R+=(f=jt.rightDelim?Q0[jt.rightDelim]:void 0)!=null?f:jt.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const Ht=ze.replace(/^\\/g,""),ur=cr()[Ht];ur&&(ur!=null&&ur.expand?R+=Fn("math",t.body):R+=`${Ht} `);break;case"placeholder":R+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(ze==="\\mathbin"||ze==="\\mathrel"||ze==="\\mathopen"||ze==="\\mathclose"||ze==="\\mathpunct"||ze==="\\mathord"||ze==="\\mathinner"){R=Fn(e,t.body);break}let jt=t.isDigit()?t.asDigit():t.value,Pr=t.command;if((t.type==="delim"||t.type==="sizeddelim")&&(Pr=t.value,jt=Pr),e==="text")R+=jt;else{if(t.type==="mbin"&&(R+='<break time="150ms"/>'),jt){const Yr=Q0[jt]||(Pr?Q0[Pr.trim()]:"");if(Yr)R+=" "+Yr;else{const Hr=Pr?zm(Pr.trim()):"";R+=Hr||S(jt)}}else R+=Fn("math",t.body);t.type==="mbin"&&(R+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(t.value!=="\u200B"){const jt=t.command;if(jt==="\\sum")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let Pr=Fn("math",t.superscript);Pr=Pr.trim();let Yr=Fn("math",t.subscript);Yr=Yr.trim(),R+=' the summation from <break time="200ms"/>'+Yr+'<break time="200ms"/> to <break time="200ms"/>'+Pr+'<break time="200ms"/> of <break time="150ms"/>',Me=!0}else if(t.hasEmptyBranch("subscript"))R+=" the summation of";else{let Pr=Fn("math",t.subscript);Pr=Pr.trim(),R+=' the summation from <break time="200ms"/>'+Pr+'<break time="200ms"/> of <break time="150ms"/>',Me=!0}else if(jt==="\\prod")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let Pr=Fn("math",t.superscript);Pr=Pr.trim();let Yr=Fn("math",t.subscript);Yr=Yr.trim(),R+=' the product from <break time="200ms"/>'+Yr+'<break time="200ms"/> to <break time="200ms"/>'+Pr+'<break time="200ms"/> of <break time="150ms"/>',Me=!0}else if(t.hasEmptyBranch("subscript"))R+=" the product of ";else{let Pr=Fn("math",t.subscript);Pr=Pr.trim(),R+=' the product from <break time="200ms"/>'+Pr+'<break time="200ms"/> of <break time="150ms"/>',Me=!0}else if(jt==="\\int")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let Pr=Fn("math",t.superscript);Pr=Pr.trim();let Yr=Fn("math",t.subscript);Yr=Yr.trim(),R+=' the integral from <break time="200ms"/>'+T(Yr)+'<break time="200ms"/> to <break time="200ms"/>'+T(Pr)+' <break time="200ms"/> of ',Me=!0}else R+=' the integral of <break time="200ms"/> ';else if(typeof t.value=="string"){const Pr=(g=Q0[t.value])!=null?g:t.command?Q0[t.command]:void 0;R+=Pr||" "+t.value}else t.command&&(t.command==="\\mathop"?R+=Fn("math",t.body):t.command==="\\operatorname"?R+=Um(t.body):R+=t.command.startsWith("\\")?" "+t.command.slice(1):" "+t.command)}break;case"enclose":ve=Fn("math",t.body),R+=" crossed out "+ve+". End crossed out.";break;case"space":case"spacing":break}if(!Me&&!t.hasEmptyBranch("superscript")){let _t=Fn(e,t.superscript);_t=_t.trim();const tr=_t.replace(/<[^>]*>/g,"");if(zu(t.superscript)){if(e==="math"){const pt=Km(t.superscript);pt&&(R+='<mark name="'+pt+'"/>')}tr==="\u2032"?R+=" prime ":tr==="2"?R+=" squared ":tr==="3"?R+=" cubed ":Number.isNaN(Number.parseInt(tr))?R+=" to the "+_t+"; ":R+=' to the <say-as interpret-as="ordinal">'+tr+"</say-as> power; "}else Number.isNaN(Number.parseInt(tr))?R+=" raised to the "+_t+"; ":R+=' raised to the <say-as interpret-as="ordinal">'+tr+"</say-as> power; "}if(!Me&&!t.hasEmptyBranch("subscript")){let _t=Fn("math",t.subscript);_t=_t.trim(),R+=zu(t.subscript)?" sub "+_t:" subscript "+_t+". End subscript. "}}return R}function eu(e){var t,n;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const l=ri(e);if(l){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(t=window.MathfieldElement.textToSpeechRulesOptions)!=null?t:{},window.MathfieldElement.textToSpeechRulesOptions=c($({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=c($({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=c($({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const f=(n=window.SRE)!=null?n:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&f.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let g="";try{g=f.toSpeech(l)}catch(S){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",S)}return g}return""}let a=Fn("math",e);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let l="";window.MathfieldElement.speechEngineRate&&(l='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),a='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+l+"<p><s>"+a+"</s></p>"+(l?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&se()==="macos"?a=a.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):a=a.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return a}var Ku={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},Uu={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function Hm(e){let t="";for(const n of e){const a=t[t.length-1];a!==void 0&&/\d/.test(a)&&/^\d/.test(n)&&(t+=" "),t+=n}return t}function as(e){var t,n,a,l,f,g,S,T,R,F,X,ve,Me;if(!e)return"";if(A(e)){if(e.length===0)return"";if(e[0].mode==="latex")return e.map(as).join("");if(e[0].mode==="text"){let ur=0,jt="";for(;((t=e[ur])==null?void 0:t.mode)==="text";)jt+=e[ur].body?as(e[ur].body):e[ur].value,ur++;return`"${jt}" ${as(e.slice(ur))}`}let pt=0;const Ht=[];for(;e[pt]&&e[pt].mode==="math";){let ur="";for(;e[pt]&&e[pt].type==="mord"&&/\d/.test(e[pt].value);)ur+=e[pt++].value;ur?Ht.push(ur):Ht.push(as(e[pt++]))}return Ht.push(as(e.slice(pt))),Hm(Ht)}if(e.mode==="text")return`"${e.value}"`;let ze="";const{command:_t}=e;let tr;if(_t==="\\placeholder")return`(${as(e.body)})`;switch(e.type){case"accent":const pt={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[_t];ze=`${pt!=null?pt:""} ${as(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map(Hr=>Hr.value).join("");case"group":case"root":ze=(n=Ku[_t])!=null?n:as(e.body);break;case"genfrac":{const Hr=e;(Hr.leftDelim||Hr.rightDelim)&&(ze=Hr.leftDelim==="."||!Hr.leftDelim?"{:":Hr.leftDelim),Hr.hasBarLine?(ze+="(",ze+=as(Hr.above),ze+=")/(",ze+=as(Hr.below),ze+=")"):(ze+="("+as(Hr.above)+"),",ze+="("+as(Hr.below)+")"),(Hr.leftDelim||Hr.rightDelim)&&(ze+=Hr.rightDelim==="."||!Hr.rightDelim?"{:":Hr.rightDelim)}break;case"surd":ze+=e.hasEmptyBranch("above")?"sqrt("+as(e.body)+")":"root("+as(e.above)+")("+as(e.body)+")";break;case"latex":ze=e.value;break;case"leftright":{const Hr=e,Gn=Hr.leftDelim;ze+=Gn==="."||!Gn?"{:":Gn,ze+=as(Hr.body);const yi=Hr.matchingRightDelim();ze+=yi==="."||!yi?":}":yi}break;case"sizeddelim":case"delim":ze=e.value;break;case"overlap":break;case"overunder":break;case"mord":ze=(l=(a=Ku[_t])!=null?a:_t)!=null?l:typeof e.value=="string"?e.value:"",ze.startsWith("\\")&&(ze+=" "),tr=_t?_t.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,tr?ze=String.fromCodePoint(Number.parseInt("0x"+tr[1])):ze.length>0&&ze.startsWith("\\")&&(ze=typeof e.value=="string"?e.value.charAt(0):e.command),ze=Gm(ze,e.style);break;case"mbin":case"mrel":case"minner":ze=(g=(f=Ku[_t])!=null?f:Uu[_t])!=null?g:e.value;break;case"mopen":case"mclose":ze=e.value;break;case"mpunct":ze=(S=Uu[_t])!=null?S:_t;break;case"mop":case"operator":case"extensible-symbol":e.value!=="\u200B"&&(Uu[_t]?ze=Uu[_t]:ze=_t==="\\operatorname"?as(e.body):(T=e.value)!=null?T:_t,ze+=" ");break;case"array":const Ht=e.array,ur=e.environmentName,jt=(R={bmatrix:["[","]"],"bmatrix*":["[","]"]}[ur])!=null?R:["(",")"],Pr=[];for(const Hr of Ht){const Gn=[];for(const yi of Hr)Gn.push(jt[0]+as(yi)+jt[1]);Pr.push(Gn.join(","))}const Yr=(F={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[ur])!=null?F:["(",")"];ze=Yr[0]+Pr.join(",")+Yr[1];break;case"box":break;case"spacing":ze=(X=Ku[_t])!=null?X:" ";break;case"enclose":ze="("+as(e.body)+")";break;case"space":ze=" ";break;case"subsup":ze="";break;case"macro":ze=(Me=(ve=Ku[_t])!=null?ve:Uu[_t])!=null?Me:as(e.body);break}if(!e.hasEmptyBranch("subscript")){ze+="_";const pt=as(e.subscript);ze+=pt.length!==1?`(${pt})`:pt}if(!e.hasEmptyBranch("superscript")){ze+="^";const pt=as(e.superscript);ze+=pt.length!==1?`(${pt})`:pt}return ze}function Gm(e,t){if(!t)return e;let n=e;return t.variant==="double-struck"&&(n=`bbb "${n}"`),t.variant==="script"&&(n=`cc "${n}"`),t.variant==="fraktur"&&(n=`fr "${n}"`),t.variant==="sans-serif"&&(n=`sf "${n}"`),t.variant==="monospace"&&(n=`tt "${n}"`),t.variantStyle==="bold"&&(n=`bb "${n}"`),t.color?`color({${t.color}})(${n})`:n}function Ls(e,t){var n,a;t!=null||(t={}),t.mathstyle=(n=t.mathstyle)!=null?n:"displaystyle";const l=new Hn({from:c($({},mu()),{renderPlaceholder:()=>new rr(160,{maxFontSize:1}),letterShapeStyle:(a=t==null?void 0:t.letterShapeStyle)!=null?a:"tex"}),mathstyle:t.mathstyle}),g=new Bt({mode:"math",type:"root",body:un(e,{context:l,parseMode:"math",mathstyle:t.mathstyle})}).render(l);return g?(Al(Au(g,l)),L0(g,{classes:"ML__latex"}).toMarkup()):""}function Og(e){return Wr(e,{context:mu()})}function Vm(e,t={}){return ri(un(e,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),t)}function Wm(e){const t=un(e,{parseMode:"math",mathstyle:"displaystyle"});return eu(t)}var Wc;function jm(e){var t,n;if(!Wc){const a=(t=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;a?Wc=new a:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(n=Wc==null?void 0:Wc.box(e).latex)!=null?n:""}function Bg(e,t="math"){return as(new Bt({type:"root",body:un(e,{parseMode:t})}))}function Pg(e){return P0(e,{format:"ascii-math"})[1]}function sd(e){if(typeof e=="string"){const t=qm(e);if(!t)throw new Error(`Invalid color: ${e}`);return t}return"C"in e?Ym(e):"a"in e?_f(e):e}function tu(e){return e<0?0:e>255?255:Math.round(e)}function qm(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&typeof t.a=="undefined"&&(t.a=1),t}function ad(e){const[t,n,a]=[e.L,e.C,e.H],l=a*Math.PI/180,f={L:t,a:n*Math.cos(l),b:n*Math.sin(l)};return e.alpha!==void 0&&(f.alpha=e.alpha),f}function Zm(e){const[t,n,a]=[e.L,e.a,e.b],l=Math.sqrt(n*n+a*a),g=Math.atan2(a,n)*180/Math.PI,S={L:t,C:l,H:g};return e.alpha!==void 0&&(S.alpha=e.alpha),S}function od(e){const[t,n,a]=[e.L,e.a,e.b],l=Math.pow(.9999999984505198*t+.39633779217376786*n+.2158037580607588*a,3),f=Math.pow(1.00000000888176*t-.10556134232365635*n-.0638541747717059*a,3),g=Math.pow(t*1.000000054672411-.0894841820949657*n-1.2914855378640917*a,3),S=4.076741661347994*l-3.307711590408193*f+.230969928729428*g,T=-1.2684380040921763*l+2.6097574006633715*f-.3413193963102197*g,R=-.004196086541837188*l-.7034186144594493*f+1.7076147009309444*g,F=X=>{const ve=Math.abs(X);return ve<=.0031308?X*12.92:(Math.sign(X)||1)*(1.055*Math.pow(ve,1/2.4)-.055)};return[F(S),F(T),F(R)]}function ld(e){const[t,n,a]=e;return t>=0&&t<=1&&n>=0&&n<=1&&a>=0&&a<=1}function ud(e,t){let[n,a,l]=e;return n=tu(n*255),a=tu(a*255),l=tu(l*255),t!==void 0?{r:n,g:a,b:l,alpha:t}:{r:n,g:a,b:l}}function _f(e){let[t,n,a]=od(e);if(ld([t,n,a]))return ud([t,n,a],e.alpha);const l=Zm(e);if(l.C=0,[t,n,a]=od(ad(l)),!ld([t,n,a]))return ud([t,n,a],e.alpha);let f=0,g=e.L,S=(f+g)/2;l.C=S;const T=.36/Math.pow(2,12);for(;g-f>T;)S=(f+g)/2,l.C=S,[t,n,a]=od(ad(l)),ld([t,n,a])?f=S:g=S;return ud([t,n,a],e.alpha)}function Ym(e){return _f(ad(e))}function xf(e,t){const n=sd(e),a=sd(t),l=.56,f=.57,g=.62,S=.65,T=.022,R=1.414,F=.1,X=5e-4,ve=1.14,Me=.027,ze=1.14,_t=.027;function tr(Hr){return Hr>=T?Hr:Hr+ro(T-Hr,R)}function pt(Hr){return(Hr<0?-1:1)*Math.pow(Math.abs(Hr),2.4)}const Ht=tr(pt(a.r/255)*.2126729+pt(a.g/255)*.7151522+pt(a.b/255)*.072175),ur=tr(pt(n.r/255)*.2126729+pt(n.g/255)*.7151522+pt(n.b/255)*.072175);let jt,Pr,Yr;return Math.abs(ur-Ht)<X?Pr=0:ur>Ht?(jt=ro(ur,l)-ro(Ht,f),Pr=jt*ve):(jt=ro(ur,S)-ro(Ht,g),Pr=jt*ze),Math.abs(Pr)<F?Yr=0:Pr>0?Yr=Pr-_t:Yr=Pr+Me,Yr*100}function wf(e,t,n){n!=null||(n="#fff"),t!=null||(t="#000");const a=xf(e,n),l=xf(e,t);return Math.abs(a)>Math.abs(l)?n:t}function Xm(e){const t=sd(e);let n=((1<<24)+(tu(t.r)<<16)+(tu(t.g)<<8)+tu(t.b)).toString(16).slice(1);return t.alpha!==void 0&&t.alpha<1&&(n+=("00"+Math.round(t.alpha*255).toString(16)).slice(-2)),n[0]===n[1]&&n[2]===n[3]&&n[4]===n[5]&&n[6]===n[7]&&(n=n[0]+n[2]+n[4]+(t.alpha!==void 0&&t.alpha<1?n[6]:"")),"#"+n}function Hi(e){const t=Sf(e);let n="";for(const a of t){if(typeof a.value!="string")return"";n+=a.value}return n}function Sf(e){const n=e.model.selection.ranges;return n.length!==1?[]:e.model.getAtoms(n[0])}function Jm(e,t){const n=Sf(e);if(n.length!==1)return!1;const a=Ch[t];return a?!!a.test(n[0].value):!1}function Qm(e,t){return Hi(e).length>0}function eg(e){return[cd(e,"double-struck","mathbb","tooltip.blackboard"),cd(e,"fraktur","mathfrak","tooltip.fraktur"),cd(e,"calligraphic","mathcal","tooltip.caligraphic"),hd(e,"up","mathrm","tooltip.roman-upright"),hd(e,"bold","mathbf","tooltip.bold"),hd(e,"italic","mathit","tooltip.italic")]}function tg(e){return[{label:()=>Ls(`\\vec{${Hi(e)}}`),visible:()=>Hi(e).length===1,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\overrightarrow{${Hi(e)}}`),visible:()=>Hi(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\overleftarrow{${Hi(e)}}`),visible:()=>Hi(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\dot{${Hi(e)}}`),visible:()=>Hi(e).length===1,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\ddot{${Hi(e)}}`),visible:()=>Hi(e).length===1,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\bar{${Hi(e)}}`),visible:()=>Hi(e).length===1,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\overline{${Hi(e)}}`),visible:()=>Hi(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\overgroup{${Hi(e)}}`),visible:()=>Hi(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\overbrace{${Hi(e)}}`),visible:()=>Hi(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\underline{${Hi(e)}}`),visible:()=>Hi(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\undergroup{${Hi(e)}}`),visible:()=>Hi(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\underbrace{${Hi(e)}}`),visible:()=>Hi(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function rg(e){return[{label:()=>Ls(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Ls(`\\bbox[5px, border: 2px dashed black]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function ng(e){const t=[];for(const n of Object.keys(Te))t.push({class:(Xm(wf(Te[n]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Te[n]} "></span>`,ariaLabel:()=>{var a;return(a=le(n))!=null?a:n},checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({backgroundColor:n}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({backgroundColor:n},{operation:"toggle"}),e.adoptStyle="none"}});return t}function ig(e){const t=[];for(const n of Object.keys(ye))t.push({class:(wf(ye[n])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${ye[n]} "></span>`,ariaLabel:()=>{var a;return(a=le(n))!=null?a:n},checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({color:n}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({color:n},{operation:"toggle"}),e.adoptStyle="none"}});return t}var sg=class extends cf{constructor(e,t,n,a){super(e,t),this.row=n,this.col=a}set active(e){const t=this.parentMenu.children;if(e)for(const n of t)n.element.classList.toggle("active",n.row<=this.row&&n.col<=this.col);else for(const n of t)n.element.classList.remove("active")}};function ag(e){const t=[];for(let n=1;n<=5;n++)for(let a=1;a<=5;a++)t.push({onCreate:(l,f)=>new sg(l,f,n,a),label:"\u2610",tooltip:()=>le("tooltip.row-by-col",n,a),data:{row:n,col:a},onMenuSelect:()=>{e.insert(`\\begin{pmatrix}${Array(n).fill(Array(a).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return t}function og(e){return[{label:()=>le("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>e.executeCommand("addRowBefore"),visible:()=>m0(e)},{label:()=>le("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>m0(e)},{label:()=>le("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>m0(e),enabled:()=>{const t=e.model.parentEnvironment;if(!t)return!1;const[n,a]=ug(e);return n<t.maxColumns}},{label:()=>le("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>e.executeCommand("addColumnAfter"),visible:()=>m0(e)},{type:"divider"},{label:()=>le("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>m0(e)},{label:()=>le("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>m0(e)},{type:"divider"},{label:()=>le("menu.borders"),visible:()=>(lg(e)||m0(e))&&e.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Hu(e,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Hu(e,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Hu(e,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Hu(e,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Hu(e,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>le("menu.insert matrix"),id:"insert-matrix",visible:()=>e.isSelectionEditable,submenu:ag(e),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>le("menu.mode"),id:"mode",visible:()=>e.isSelectionEditable&&e.model.selectionIsCollapsed,submenu:[{label:()=>le("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{G0(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>e.model.mode==="math"},{label:()=>le("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{G0(e,"accept-all"),e.executeCommand(["switchMode","text"])},checked:()=>e.model.mode==="text"},{label:()=>le("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>e.executeCommand(["switchMode","latex"]),checked:()=>e.model.mode==="latex"}]},{type:"divider"},{label:()=>le("menu.font-style"),id:"variant",visible:()=>e.isSelectionEditable,submenu:eg(e),submenuClass:"variant-submenu"},{label:()=>le("menu.color"),id:"color",visible:()=>e.isSelectionEditable,submenu:ig(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>le("menu.background-color"),id:"background-color",visible:()=>e.isSelectionEditable,submenu:ng(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>le("menu.accent"),id:"accent",visible:()=>e.isSelectionEditable,submenu:tg(e),submenuClass:"variant-submenu"},{label:()=>le("menu.decoration"),id:"decoration",visible:()=>e.isSelectionEditable&&Hi(e).length>0,submenu:rg(e),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>le("menu.evaluate"),id:"ce-evaluate",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const t=cg(e);if(!t){e.model.announce("plonk");return}e.model.selectionIsCollapsed?(e.model.position=e.model.lastOffset,e.insert(`=${t}`,{insertionMode:"insertAfter",selectionMode:"item"})):e.insert(t,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>le("menu.simplify"),id:"ce-simplify",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var t,n;if(e.model.selectionIsCollapsed){const a=(t=e.expression)==null?void 0:t.simplify();if(e.model.position=e.model.lastOffset,!a){e.model.announce("plonk");return}e.insert(`=${a.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const a=(n=window.MathfieldElement.computeEngine)==null?void 0:n.parse(e.getValue(e.model.selection)).simplify();if(!a){e.model.announce("plonk");return}e.insert(a.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var t;if(window.MathfieldElement.computeEngine===null)return"";const n=(t=e.expression)==null?void 0:t.unknowns[0];return n?le("menu.solve-for",Ls(n)):le("menu.solve")},id:"ce-solve",visible:()=>{var t;return e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((t=e.expression)==null?void 0:t.unknowns.length)===1&&e.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var t;const n=e.expression,a=n==null?void 0:n.unknowns[0],l=(t=n.solve(a))==null?void 0:t.map(f=>{var g;return(g=f.simplify().latex)!=null?g:""});if(!l){e.model.announce("plonk");return}e.insert(`${a}=${l.length===1?l[0]:"\\left\\lbrace"+(l==null?void 0:l.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>le("menu.cut"),onMenuSelect:()=>e.executeCommand("cutToClipboard"),visible:()=>!e.options.readOnly&&e.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>le("menu.copy"),id:"copy",submenu:[{label:()=>le("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>Si.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>le("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>Si.copyToClipboard(e,"ascii-math")},{label:()=>le("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>Si.copyToClipboard(e,"math-ml")}]},{label:()=>le("menu.paste"),id:"paste",onMenuSelect:()=>e.executeCommand("pasteFromClipboard"),visible:()=>e.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>le("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>e.executeCommand("selectAll")}]}function m0(e){var t;return!!((t=e.model.parentEnvironment)!=null&&t.array)}function lg(e){return e.model.at(e.model.position).type==="array"}function ug(e){var t;const n=(t=e.model.parentEnvironment)==null?void 0:t.array;return n?[n.length,n.reduce((a,l)=>Math.max(a,l.length),0)]:[0,0]}function Hu(e,t){bc(e),e.flushInlineShortcutBuffer(),Kd(e.model,t),Xi(e)}function cg(e){var t,n;let a;if(e.model.selectionIsCollapsed?a=(t=window.MathfieldElement.computeEngine)==null?void 0:t.parse(e.getValue(),{canonical:!1}):a=(n=window.MathfieldElement.computeEngine)==null?void 0:n.parse(e.getValue(e.model.selection),{canonical:!1}),!a)return"";let l=a.evaluate();return l.isSame(a)&&(l=a.N()),l.latex}function cd(e,t,n,a){return{label:()=>Ls(`\\${n}{${Hi(e)}}`),tooltip:()=>{var l;return(l=le(a))!=null?l:a},visible:()=>Jm(e,t),checked:()=>{var l;return{some:"mixed",all:!0}[(l=e.queryStyle({variant:t}))!=null?l:!1]},onMenuSelect:()=>{e.applyStyle({variant:t},{operation:"toggle"}),e.adoptStyle="none"}}}function hd(e,t,n,a){return{label:()=>Ls(`\\${n}{${Hi(e)}}`),tooltip:()=>{var l;return(l=le(a))!=null?l:a},visible:()=>Qm(e,t),checked:()=>{var l;return{some:"mixed",all:!0}[(l=e.queryStyle({variantStyle:t}))!=null?l:!1]},onMenuSelect:()=>{e.applyStyle({variantStyle:t},{operation:"toggle"}),e.adoptStyle="none"}}}function ru(e,t){return e+eu(t)}pa({speak:(e,t,n)=>hg(e,t,n)},{target:"mathfield"});function hg(e,t,n){var a,l;n=n!=null?n:{withHighlighting:!1};const{model:f}=e;function g(F){let X=null;switch(F){case"all":X=f.root;break;case"selection":X=f.getAtoms(f.selection);break;case"left":{X=f.getAtoms(f.offsetOf(f.at(f.position).leftSibling),f.position);break}case"right":{X=f.getAtoms(f.position,f.offsetOf(f.at(f.position).rightSibling));break}case"group":X=f.getAtoms(f.getSiblingsRange(f.position));break;case"parent":{const{parent:ve}=f.at(f.position);ve!=null&&ve.parent?X=ve:X=f.root;break}default:X=f.root}return X}function S(F){let X="";switch(F){case"all":console.log("Internal failure: speak all failed");break;case"selection":X="no selection";break;case"left":X="at start";break;case"right":X="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":X="no parent";break;default:console.log('unknown speak_ param value: "'+F+'"');break}return X}const T=g(t);if(T===null)return(l=(a=window.MathfieldElement).speakHook)==null||l.call(a,S(t)),!1;(n.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const R=eu(T);return M()&&n.withHighlighting?(Nl().readAloudMathfield=e,a0(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,R)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(R),!1}function dg(e){var t,n;if(!M()){console.log("Speak:",e);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const a=new SpeechSynthesisUtterance(e);window.speechSynthesis.speak(a)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),l={OutputFormat:"mp3",VoiceId:(t=window.MathfieldElement.speechEngineVoice)!=null?t:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((n=window.MathfieldElement.speechEngineVoice)!=null?n:"Joanna")?"neural":"standard",Text:e,TextType:"ssml"};a.synthesizeSpeech(l,(f,g)=>{if(f)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${f}`);else if(g!=null&&g.AudioStream){const S=new Uint8Array(g.AudioStream),T=new Blob([S.buffer],{type:"audio/mpeg"}),R=URL.createObjectURL(T);new Audio(R).play().catch(X=>console.log(X))}else console.log("polly.synthesizeSpeech():",g)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function Ef(e){var t;let n;if(e.parent.type==="prompt")e.parentBranch==="body"&&(n="prompt");else if(e.parentBranch==="body")n=e.type&&(t={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[e.type])!=null?t:"parent";else if(e.parent.type==="genfrac"){if(e.parentBranch==="above")return"numerator";if(e.parentBranch==="below")return"denominator"}else e.parent.type==="surd"?e.parentBranch==="above"&&(n="index"):e.parentBranch==="superscript"?n="superscript":e.parentBranch==="subscript"&&(n="subscript");return n||console.log("unknown relationship"),n!=null?n:"parent"}function fg(e,t,n,a){let l="";if(t==="plonk")window.MathfieldElement.playSound("plonk"),e.flushInlineShortcutBuffer();else if(t==="delete")l=ru("deleted: ",a);else if(t==="focus"||t.includes("move"))l=pg(e.model,n)+(e.model.selectionIsCollapsed?"":"selected: ")+mg(e.model);else if(t==="replacement")l=ru("",e.model.at(e.model.position));else if(t==="line"){const f=ru("",e.model.root);e.keyboardDelegate.setAriaLabel(f)}else l=a?ru(t+" ",a):t;if(l){const f=e.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";e.ariaLiveText.textContent=l+f}}function pg(e,t){if(Number.isNaN(t))return"";const n=e.at(t);if(!n||n.treeDepth<=e.at(e.position).treeDepth)return"";let a="",l=n.parent;const f=e.at(e.position).parent;for(;l!==e.root&&l!==f;)a+=`out of ${Ef(l)};`,l=l.parent;return a}function mg(e){if(!e.selectionIsCollapsed)return ru("",e.getAtoms(e.selection));let t="";const n=e.at(e.position),a=Ef(n);return n.isFirstSibling&&(t=(a?"start of "+a:"unknown")+": "),n.isLastSibling?n.isFirstSibling||(t+=a?"end of "+a:"unknown"):t+=ru("",n),t}var gg=class{constructor(e,t,n){this.mathfield=e,this.mode=t,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=n}dispose(){this.mathfield=void 0}getState(){const e={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(e.direction=this.selection.direction),{content:this.root.toJson(),selection:e,mode:this.mode}}setState(e,t){var n;const a=this.silenceNotifications;this.silenceNotifications=(n=t==null?void 0:t.silenceNotifications)!=null?n:!0;let l={};if((t==null?void 0:t.type)==="undo"&&(l={inputType:"historyUndo"}),(t==null?void 0:t.type)==="redo"&&(l={inputType:"historyRedo"}),this.contentWillChange(l)){const f=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=Ol(e.content),this.selection=e.selection,this.silenceNotifications=f,this.contentDidChange(l)}this.silenceNotifications=a}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var n,a,l;const f=this.normalizeSelection(e,t);if(f===void 0)throw new TypeError("Invalid selection");if(f.ranges.length===1&&f.ranges[0][0]===f.ranges[0][1]){const F=f.ranges[0][0];if(!this.mathfield.dirty&&!((n=this.at(F))!=null&&n.parentPrompt)&&this.mathfield.hasEditablePrompts){if((a=this.at(F-1))!=null&&a.parentPrompt){this._anchor=this.normalizeOffset(F-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((l=this.at(F+1))!=null&&l.parentPrompt){this._anchor=this.normalizeOffset(F+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=F,this._position=F,this._selection=f;return}const g=Ps(f);f.direction==="backward"?[this._position,this._anchor]=g:[this._anchor,this._position]=g;const S=this.at(g[0]+1),T=this.at(g[1]),R=Bt.commonAncestor(S,T);(R==null?void 0:R.type)==="array"&&S.parent===R&&T.parent===R?this._selection={ranges:[g],direction:f.direction}:this._selection={ranges:[g],direction:f.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(e){var t;const n=this.at(e);(n==null?void 0:n.type)==="placeholder"?this.setSelection(e-1,e):((t=n==null?void 0:n.rightSibling)==null?void 0:t.type)==="placeholder"?this.setSelection(e,e+1):this.position=e,n instanceof vi&&n.isSuggestion&&(n.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(e){this.setSelection(e,e)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(e="forward"){return this._anchor===this._position?!1:(e==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(e){return this.atoms[e]}offsetOf(e){return this.atoms.indexOf(e)}getSiblingsRange(e){const t=this.at(e),{parent:n}=t;if(!n)return[0,this.lastOffset];const a=t.parent.branch(t.parentBranch);return[this.offsetOf(a[0]),this.offsetOf(a[a.length-1])]}getBranchRange(e,t){const n=this.at(e).branch(t);return[this.offsetOf(n[0]),this.offsetOf(n[n.length-1])]}getAtoms(e,t,n){let a=n!=null?n:{};if(Dl(e)){if(a=t!=null?t:{},e.ranges.length>1)return e.ranges.reduce((R,F)=>[...R,...this.getAtoms(F,a)],[]);e=e.ranges[0]}let l,f;if(mo(e)){if(l=e,!mo(t))return[];f=t}else[l,f]=e,a=t!=null?t:{};if(!Number.isFinite(l))return[];a.includeChildren===void 0&&(a.includeChildren=!1),l<0&&(l=this.lastOffset-l+1),f<0&&(f=this.lastOffset-f+1);const g=Math.min(l,f)+1,S=Math.max(l,f);if(!a.includeChildren&&g===1&&S===this.lastOffset)return[this.root];let T=[];for(let R=g;R<=S;R++){const F=this.atoms[R];kf(this,F,g,S)&&T.push(F)}return a.includeChildren||(T=T.filter(R=>{let F=!1,{parent:X}=R;for(;X&&!F;)F=kf(this,X,g,S),X=X.parent;return!F})),T}getAllAtoms(e=0){const t=[],n=this.lastOffset;for(let a=e;a<=n;a++)t.push(this.atoms[a]);for(let a=0;a<e;a++)t.push(this.atoms[a]);return t}findAtom(e,t=0,n="forward"){let a;const l=this.lastOffset;if(n==="forward"){for(let f=t;f<=l;f++)if(a=this.atoms[f],e(a))return a;for(let f=0;f<t;f++)if(a=this.atoms[f],e(a))return a;return}for(let f=t;f>=0;f--)if(a=this.atoms[f],e(a))return a;for(let f=l;f>t;f--)if(a=this.atoms[f],e(a))return a}extractAtoms(e){let t=this.getAtoms(e);if(t.length===1&&!t[0].parent)if(t[0].type==="root")t=[...t[0].body],t.shift();else return t=this.root.cells.flat(),this.root=new Bt({type:"root",body:[]}),t;for(const n of t)n.parent.removeChild(n);return t}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,t){const n=t!=null?t:"latex";if(n.startsWith("latex"))return Bt.serialize([e],{expandMacro:n==="latex-expanded",skipStyles:n==="latex-unstyled",skipPlaceholders:n==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(n==="math-ml")return ri(e);if(n==="spoken")return eu(e);if(n==="spoken-text"){const a=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const l=eu(e);return window.MathfieldElement.textToSpeechMarkup=a,l}if(n==="spoken-ssml"||n==="spoken-ssml-with-highlighting"){const a=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const l=eu(e);return window.MathfieldElement.textToSpeechMarkup=a,l}return n==="ascii-math"?as(e):(console.error(`MathLive 0.98.5: Unexpected format "${n}`),"")}getValue(e,t,n){if(e===void 0)return this.atomToString(this.root,"latex");if(typeof e=="string"&&e!=="math-json")return this.atomToString(this.root,e);let a,l;if(mo(e)&&mo(t)?(a=[this.normalizeRange([e,t])],l=n):e0(e)?(a=[this.normalizeRange(e)],l=t):Dl(e)?(a=e.ranges,l=t):(a=[this.normalizeRange([0,-1])],l=e),l!=null||(l="latex"),l==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const f=this.getValue({ranges:a},"latex-unstyled");try{const g=window.MathfieldElement.computeEngine.parse(f);return JSON.stringify(g.json)}catch(g){return JSON.stringify(["Error",`'${g.toString()}'`])}}if(l.startsWith("latex")){const f={expandMacro:l==="latex-expanded",skipStyles:l==="latex-unstyled",skipPlaceholders:l==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return Bn(a.map(g=>Bt.serialize(this.getAtoms(g),f)))}return a.map(f=>this.getAtoms(f).map(g=>this.atomToString(g,l)).join("")).join("")}extendSelectionTo(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const n=this.normalizeRange([e,t]);let[a,l]=n,{parent:f}=this.at(l);if(f&&(f.type==="genfrac"||f.type==="subsup"))for(;f!==this.root&&dd(this,f,[a,l]);)l=this.offsetOf(f),f=f.parent;for(f=this.at(a).parent;f!==this.root&&dd(this,f,[a,l]);)a=this.offsetOf(f.leftSibling),f=f.parent;if(f=this.at(l).parent,(f==null?void 0:f.type)==="genfrac")for(;f!==this.root&&dd(this,f,[a,l]);)l=this.offsetOf(f),console.assert(l>=0),f=f.parent;this._position=this.normalizeOffset(t),this._selection={ranges:[[a,l]],direction:"none"}})}announce(e,t,n=[]){var a,l;((l=(a=this.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:t,atoms:n},cancelable:!0,bubbles:!0,composed:!0})))!=null?l:!0)&&fg(this.mathfield,e,t,n)}deferNotifications(e,t){const n=this._selection,a=this._anchor,l=this._position,f=this.silenceNotifications;this.silenceNotifications=!0;const g=this.root.changeCounter;t();const S=this.root.changeCounter!==g,T=a!==this._anchor||l!==this._position||sh(this._selection,n)==="different";return this.silenceNotifications=f,e.content&&S&&this.contentDidChange({inputType:e.type}),e.selection&&T&&this.selectionDidChange(),S||T}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[t,n]=e;return t=this.normalizeOffset(t),n=this.normalizeOffset(n),t<n?[t,n]:[n,t]}normalizeSelection(e,t){var n;let a;if(mo(e)){const l=this.normalizeOffset(e);if(mo(t)){const f=this.normalizeOffset(t);a=l<=f?{ranges:[[l,f]],direction:"none"}:{ranges:[[f,l]],direction:"backward"}}else a={ranges:[[l,l]],direction:"none"}}else if(e0(e)){const l=this.normalizeOffset(e[0]),f=this.normalizeOffset(e[1]);a=l<=f?{ranges:[[l,f]],direction:"none"}:{ranges:[[f,l]],direction:"backward"}}else Dl(e)&&(a={ranges:e.ranges.map(l=>this.normalizeRange(l)),direction:(n=e.direction)!=null?n:"none"});return console.assert(a!==void 0),a}get parentEnvironment(){let e=this.at(this.position).parent;if(e){for(;e.parent&&e.type!=="array";)e=e.parent;if(e.type==="array")return e}}get cell(){var e;let t=this.at(this.position);if(t){for(;t&&((e=t.parent)==null?void 0:e.type)!=="array";)t=t.parent;if(!(!(t!=null&&t.parent)||t.parent.type!=="array"))return t.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;const t=this.silenceNotifications;this.silenceNotifications=!0;const n=this.mathfield.onContentWillChange(e);return this.silenceNotifications=t,n}contentDidChange(e){var t;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(xo(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const n=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",c($({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",bubbles:!0,composed:!0}))),this.silenceNotifications=n}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(xo(this.mathfield)),this.silenceNotifications))return;const e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}};function kf(e,t,n,a){const l=e.offsetOf(t);if(l<n||l>a)return!1;if(!t.hasChildren)return!0;const f=e.offsetOf(t.firstChild);if(f>=n&&f<=a){const g=e.offsetOf(t.lastChild);if(g>=n&&g<=a)return!0}return!1}function dd(e,t,n){if(!(t!=null&&t.hasChildren))return!1;const[a,l]=n,f=e.offsetOf(t.firstChild),g=e.offsetOf(t.lastChild);return f>=a&&f<=l&&g>=f&&g<=l}function Gu(e,t,n,a){var l,f,g,S,T,R;const F=n.parent;if(F&&n instanceof At){const X=!a&&t==="forward"||a==="body"&&t==="backward";let ve=X?e.offsetOf(n.firstChild):e.offsetOf(n.lastChild);return X?n.rightDelim!=="?"&&n.rightDelim!=="."?(n.leftDelim=".",n.isDirty=!0):(F.addChildrenAfter(n.removeBranch("body"),n),F.removeChild(n),ve--):n.leftDelim!=="?"&&n.leftDelim!=="."?(n.rightDelim=".",n.isDirty=!0):(F.addChildrenAfter(n.removeBranch("body"),n),F.removeChild(n),ve--),e.position=ve,!0}if(F&&n.type==="surd"){if(t==="forward"&&!a||t==="backward"&&a==="body"){const X=n.leftSibling;n.hasChildren&&F.addChildrenAfter(n.removeBranch("body"),n),F.removeChild(n),e.position=e.offsetOf(X)}else t==="forward"&&a==="body"?e.position=e.offsetOf(n):!a&&t==="backward"?n.hasChildren?e.position=e.offsetOf(n.lastChild):(e.position=Math.max(0,e.offsetOf(n)-1),F.removeChild(n)):a==="above"&&(n.hasEmptyBranch("above")&&n.removeBranch("above"),t==="backward"?e.position=e.offsetOf(n.leftSibling):e.position=e.offsetOf(n.body[0]));return!0}if(F&&(n.type==="box"||n.type==="enclose")){const X=a&&t==="backward"||!a&&t==="forward"?n.leftSibling:n.lastChild;return F.addChildrenAfter(n.removeBranch("body"),n),F.removeChild(n),e.position=e.offsetOf(X),!0}if(n.type==="genfrac"||n.type==="overunder"){if(!a)return n.type==="overunder"&&n.hasEmptyBranch("body")||n.type==="genfrac"&&n.hasEmptyBranch("below")&&n.hasEmptyBranch("above")?!1:(e.position=e.offsetOf(t==="forward"?n.firstChild:n.lastChild),!0);const X=Vu.fractionNavigationOrder==="numerator-denominator"?"above":"below",ve=X==="above"?"below":"above";if(F&&(t==="forward"&&a===X||t==="backward"&&a===ve)){const Me=n.removeBranch(X),ze=n.removeBranch(ve);return F.addChildrenAfter([...Me,...ze],n),F.removeChild(n),e.position=e.offsetOf(Me.length>0?Me[Me.length-1]:ze[0]),!0}return t==="backward"?e.position=e.offsetOf(n.leftSibling):e.position=e.offsetOf(n),!0}if(n.isExtensibleSymbol||n.type==="subsup"){if(!a&&t==="forward")return!1;if(!a){if(n.subscript||n.superscript){const X=t==="forward"?(g=(l=n.superscript)==null?void 0:l[0])!=null?g:(f=n.subscript)==null?void 0:f[0]:(R=(S=n.subscript)==null?void 0:S[0].lastSibling)!=null?R:(T=n.superscript)==null?void 0:T[0].lastSibling;return X&&(e.position=e.offsetOf(X)),!0}return!1}if(!n.hasChildren&&n.type==="subsup"){const X=t==="forward"?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);return n.parent.removeChild(n),e.position=X,!0}if(a==="superscript")if(t==="backward"){const X=e.offsetOf(n.firstChild)-1;console.assert(X>=0),e.position=X}else n.subscript?e.position=e.offsetOf(n.subscript[0]):e.position=e.offsetOf(n);else a==="subscript"&&(t==="backward"&&n.superscript?e.position=e.offsetOf(n.superscript[0].lastSibling):t==="backward"?e.position=e.offsetOf(n.firstChild)-1:e.position=e.offsetOf(n));if(a&&n.hasEmptyBranch(a)&&(n.removeBranch(a),n.type==="subsup"&&!n.subscript&&!n.superscript)){const X=t==="forward"?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);n.parent.removeChild(n),e.position=X}return!0}if((F==null?void 0:F.type)==="genfrac"&&!a&&n.type!=="first"){let X=e.offsetOf(n.leftSibling);return F.removeChild(n),F.hasEmptyBranch("above")&&F.hasEmptyBranch("below")?(X=e.offsetOf(F.leftSibling),F.parent.removeChild(F),e.announce("delete",void 0,[F]),e.position=X,!0):(e.announce("delete",void 0,[n]),e.position=X,!0)}if(t==="backward"&&((F==null?void 0:F.command)==="\\ln"||(F==null?void 0:F.command)==="\\log")&&n.parentBranch!=="body"){const X=e.offsetOf(F.leftSibling);return F.parent.removeChild(F),e.announce("delete",void 0,[F]),e.position=X,!0}return!1}function vg(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentBackward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let t=e.at(e.position);if(!(t&&Gu(e,"backward",t))){if(t!=null&&t.isFirstSibling){if(Gu(e,"backward",t.parent,t.parentBranch))return;t=null}if(!t){e.announce("plonk");return}e.position=e.offsetOf(t.leftSibling),t.parent.removeChild(t),e.announce("delete",void 0,[t])}}):So(e,Ps(e.selection),"deleteContentBackward")}function yg(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentForward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var t,n;let a=e.at(e.position).rightSibling;if(a&&Gu(e,"forward",a))return;if(a){if(e.at(e.position).isLastSibling&&Gu(e,"forward",a.parent,a.parentBranch))return}else{if(a=e.at(e.position),a.isLastSibling&&Gu(e,"forward",a.parent,a.parentBranch))return;a=void 0}if(e.position===e.lastOffset||!a){e.announce("plonk");return}a.parent.removeChild(a);let l=(t=e.at(e.position))==null?void 0:t.rightSibling;for(;(l==null?void 0:l.type)==="subsup";)l.parent.removeChild(l),l=(n=e.at(e.position))==null?void 0:n.rightSibling;e.announce("delete",void 0,[a])}):So(e,Ps(e.selection),"deleteContentForward")}function So(e,t,n){const a=e.getAtoms(t);if(a.length>0&&a[0].parent){let l=a[0].parent.firstChild;l.type==="first"&&(l=l.rightSibling);const f=a[a.length-1].parent.lastChild;let g=a[0];g.type==="first"&&(g=g.rightSibling);const S=a[a.length-1];if(g===l&&S===f){const T=a[0].parent;T.parent&&T.type!=="prompt"&&(t=[e.offsetOf(T.leftSibling),e.offsetOf(T)])}if(a.length===1&&a[0].type==="placeholder"&&a[0].parent.type==="genfrac"){const T=a[0].parent,R=a[0].parentBranch==="below"?"above":"below",F=e.offsetOf(T.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:n},()=>{var X,ve;const Me=T.removeBranch(R);if(Me.length===1&&Me[0].type==="placeholder")(ve=T.parent)==null||ve.removeChild(T),e.position=Math.max(0,F);else{const ze=T.parent.addChildrenAfter(Me,T);(X=T.parent)==null||X.removeChild(T),e.position=e.offsetOf(ze)}})}}return e.deferNotifications({content:!0,selection:!0,type:n},()=>e.deleteAtoms(t))}pa({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&So(e,[0,-1],"deleteContent"),deleteForward:e=>yg(e),deleteBackward:e=>vg(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&So(e,[e.anchor,Kh(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&So(e,[e.anchor,Kh(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&So(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&So(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&So(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&So(e,[e.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var bg=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${le("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,_g=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${le("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,xg=class{constructor(e,t){this.focusBlurInProgress=!1;var n,a,l;this.options=$(c($({},Mc()),{macros:cr(),registers:nc()}),Dc(t)),this.eventController=new AbortController;const f=this.eventController.signal;t.eventSink&&(this.host=t.eventSink),this.element=e,e.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let g=(a=(n=t.value)!=null?n:this.element.textContent)!=null?a:"";g=g.trim();const S=Nd(this.options),T=new Bt({type:"root",mode:S,body:un(g,{context:this.context})});this.model=new gg(this,S,T),this.undoManager=new W1(this.model);const R=[];if(R.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),R.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),R.push("<span part=content class=ML__content>"),R.push(Md(this)),R.push("</span>"),window.mathVirtualKeyboard&&(R.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),R.push(bg),R.push("</div>")),R.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),R.push(_g),R.push("</div>"),R.push("</span>"),R.push("<span class=ML__sr-only>"),R.push("<span role=status aria-live=assertive aria-atomic=true></span>"),R.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(R.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=Z.subscribe(()=>Z.update(this.element)),Z.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",X=>X.stopImmediatePropagation(),{capture:!1,signal:f}),this.field.addEventListener("wheel",this,{passive:!1,signal:f}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:f}):this.field.addEventListener("mousedown",this,{signal:f}),(l=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||l.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(xo(this)))},{signal:f}),this._menu=new Lm(og(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:f});const F=this.element.querySelector("[part=menu-toggle]");F==null||F.addEventListener("pointerdown",X=>{if(X.currentTarget!==F||this._menu.state!=="closed")return;this.element.classList.add("tracking");const ve=F.getBoundingClientRect();this._menu.modifiers=s0(X),this._menu.show({target:F,location:{x:ve.left,y:ve.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),X.preventDefault(),X.stopPropagation()},{signal:f}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(F.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=Xp(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:f}),document.addEventListener("scroll",this,{signal:f}),this.resizeObserver=new ResizeObserver(()=>Xi(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:f}),Du&&!Z.locale.startsWith(Du.locale)&&jp(Z.locale),ba!=="ready"&&document.fonts.ready.then(()=>Ec(this)),e.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(e){this._defaultStyle=e}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const e=this.model.at(this.model.position),t=this.adoptStyle==="right"?e.rightSibling:e;if(!t)return this.defaultStyle;if(t.type==="group"){const n=t.branch("body");return!n||n.length<2?{}:this.adoptStyle==="right"?n[1].computedStyle:n[n.length-1].computedStyle}return t.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(xo(this)),Uc(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Jh())}showMenu(e){var t,n;const a=(n=(t=e==null?void 0:e.location)!=null?t:Ml(this.field))!=null?n:void 0,l=e==null?void 0:e.modifiers,f=this.element.querySelector("[part=container]");return this._menu.show({target:f,location:a,modifiers:l})}get colorMap(){return e=>{var t,n,a;return(a=(n=(t=this.options).colorMap)==null?void 0:n.call(t,e))!=null?a:st(e)}}get backgroundColorMap(){return e=>{var t,n,a,l,f,g;return(g=(f=(n=(t=this.options).backgroundColorMap)==null?void 0:n.call(t,e))!=null?f:(l=(a=this.options).colorMap)==null?void 0:l.call(a,e))!=null?g:ft(e)}}get smartFence(){var e;return(e=this.options.smartFence)!=null?e:!1}get readOnly(){var e;return(e=this.options.readOnly)!=null?e:!1}get disabled(){var e,t;return(t=(e=this.host)==null?void 0:e.disabled)!=null?t:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const e=getComputedStyle(this.host);return e.getPropertyValue("user-select")||e.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(e=>e.type==="prompt"&&!e.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const e=this.model.at(this.model.anchor),t=this.model.at(this.model.position),n=Bt.commonAncestor(e,t);return!!((n==null?void 0:n.type)==="prompt"||n!=null&&n.parentPrompt)}get letterShapeStyle(){var e;return(e=this.options.letterShapeStyle)!=null?e:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const e=this.model.getAtoms(this.model.selection);if(e.length===0)return{};const t=$({},e[0].style);for(const n of e)for(const[a,l]of Object.entries(n.style))t[a]!==l&&delete t[a];return t}queryStyle(e){const t=jh(this,e);"verbatimColor"in t&&delete t.verbatimColor,"verbatimBackgroundColor"in t&&delete t.verbatimBackgroundColor;const n=Object.keys(t).length;if(n===0)return"all";if(n>1){for(const T of Object.keys(t)){const R=this.queryStyle({[T]:t[T]});if(R==="none")return"none";if(R==="some")return"some"}return"all"}const a=Object.keys(t)[0],l=t[a];if(this.model.selectionIsCollapsed)return this.effectiveStyle[a]===l?"all":"none";const f=this.model.getAtoms(this.model.selection,{includeChildren:!0});let g=f.length;if(g===0)return"none";let S=0;for(const T of f){if(T.type==="first"){g-=1;continue}T.style[a]===l&&(S+=1)}return S===0?"none":S===g?"all":"some"}get keybindings(){var e,t;if(this._keybindings)return this._keybindings;const[n,a]=r1(this.options.keybindings,(e=Mu())!=null?e:qp());return((t=Mu())==null?void 0:t.score)>0&&(this._keybindings=n,a.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",a)),n}get menu(){return this._menu}setOptions(e){var t;this.options=$($({},this.options),Dc(e)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let n=this.options.defaultMode;n==="inline-math"&&(n="math"),((t=this.model.root.firstChild)==null?void 0:t.mode)!==n&&(this.model.root.firstChild.mode=n),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const a=Bt.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==a)&&Si.insert(this.model,a,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in e||"macros"in e||"registers"in e||"colorMap"in e||"backgroundColorMap"in e||"letterShapeStyle"in e||"minFontScale"in e||"readOnly"in e||"placeholderSymbol"in e)&&Xi(this)}getOptions(e){return l0(this.options,e)}getOption(e){return l0(this.options,e)}handleEvent(e){return $l(this,null,function*(){var t;if(Yo(this)){if(Fh(e)){if(!_u(e.origin,(t=this.options.originValidator)!=null?t:"none"))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");const{action:n}=e.data;if(n==="execute-command"){const a=e.data.command;if(W0(a)==="virtual-keyboard")return;this.executeCommand(a)}else n==="update-state"||(n==="focus"?this.focus({preventScroll:!0}):n==="blur"&&this.blur());return}switch(e.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&Qd(this,e);break;case"pointerdown":this.userSelect!=="none"&&(Qd(this,e),e.shiftKey===!1&&(yield pf(e,this.element.querySelector("[part=container]"),this._menu))&&Nc.stop());break;case"contextmenu":this.userSelect!=="none"&&e.shiftKey===!1&&(yield pf(e,this.element.querySelector("[part=container]"),this._menu))&&Nc.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Uc(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Yo(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Yo(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}})}dispose(){if(!Yo(this))return;Z.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const e=this.element;delete e.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,nm(),l1(),Em()}flushInlineShortcutBuffer(e){if(e!=null||(e={defer:!1}),!e.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(e){return W0(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(xo(this))),!1):m1(this,e)}get errors(){return Wr(this.model.getValue(),{context:this.context})}getValue(e,t,n){return this.model.getValue(e,t,n)}setValue(e,t){var n;t=t!=null?t:{mode:"math"},t.insertionMode===void 0&&(t.insertionMode="replaceAll"),(t.format===void 0||t.format==="auto")&&(t.format="latex"),(t.mode===void 0||t.mode==="auto")&&(t.mode=(n=gu(this.model,this.model.position))!=null?n:"math");const a=this.undoManager.canUndo();Si.insert(this.model,e,t)&&(Xi(this),a||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const e=window.MathfieldElement.computeEngine;return e?e.box(e.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var e;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const a=window.mathVirtualKeyboard.boundingRect,l=this.host.getBoundingClientRect();l.bottom>a.top&&((e=window.document.scrollingElement)==null||e.scrollBy(0,l.bottom-a.top+8))}}this.dirty&&a0(this,{interactive:!0});const t=this.field.getBoundingClientRect();let n=null;if(this.model.selectionIsCollapsed)n=Ml(this.field);else{const a=bu(this);if(a.length>0){let l=-1/0,f=-1/0;for(const g of a)g.right>l&&(l=g.right),g.top<f&&(f=g.top);n={x:l+t.left-this.field.scrollLeft,y:f+t.top-this.field.scrollTop,height:0}}}if(this.host&&n){const a=this.host.getBoundingClientRect(),l=n.y;let f=this.host.scrollTop;l<a.top?f=l-a.top+this.host.scrollTop:l>a.bottom&&(f=l-a.bottom+this.host.scrollTop+n.height),this.host.scroll({top:f,left:0})}if(n){const a=n.x-window.scrollX;let l=this.field.scrollLeft;a<t.left?l=a-t.left+this.field.scrollLeft-20:a>t.right&&(l=a-t.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:l})}}insert(e,t){return typeof e!="string"||e.length===0&&((t==null?void 0:t.insertionMode)==="insertBefore"||(t==null?void 0:t.insertionMode)==="insertAfter")||e.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),t=t!=null?t:{mode:"math"},t.focus&&this.focus(),t.feedback&&(window.MathfieldElement.keypressVibration&&re()&&navigator.vibrate(Ld),window.MathfieldElement.playSound("keypress")),e==="\\\\"?$d(this.model):e==="&"?zd(this.model):this.model.selectionIsCollapsed?Si.insert(this.model,e,$({style:this.model.at(this.model.position).computedStyle},t)):Si.insert(this.model,e,t),this.snapshot(`insert-${this.model.at(this.model.position).type}`),Xi(this),t.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(e,t="",n=""){var a;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const l=this.model.mode;if(this.model.mode=e,!((a=this.host)!=null&&a.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=l;return}const f=this.model.mode,{model:g}=this;g.deferNotifications({content:!!n||!!t,selection:!0,type:"insertText"},()=>{let S=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),t&&e!=="latex"){const T=un(t,{context:this.context,parseMode:e});g.collapseSelection("forward");const R=g.at(g.position);g.position=g.offsetOf(R.parent.addChildrenAfter(T,R)),S=!0}if(this.model.mode=e,e==="latex"){let T=g.selectionIsCollapsed;G0(this,"accept");let R,F=g.at(g.position);if(T)R="\\";else{const ve=Ps(g.selection);R=this.model.getValue(ve,"latex");const Me=this.model.extractAtoms(ve);Me.length===1&&Me[0].type==="placeholder"&&(R=t,T=!0),F=g.at(ve[0])}const X=new Qa(R);F.parent.addChildAfter(X,F),T?g.position=g.offsetOf(X.lastChild):g.setSelection(g.offsetOf(X.firstChild),g.offsetOf(X.lastChild))}else Lu(g).forEach(T=>{T.isError=!1});if(n){const T=un(n,{context:this.context,parseMode:f});g.collapseSelection("forward");const R=g.at(g.position);g.position=g.offsetOf(R.parent.addChildrenAfter(T,R)),S=!0}return Xi(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),S}),this.model.mode=e,window.mathVirtualKeyboard.update(xo(this))}hasFocus(){return!this.blurred}focus(e){var t;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(t=e==null?void 0:e.preventScroll)!=null&&t||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(e,t={}){var n,a;const l={operation:"set",silenceNotifications:!1};e0(t)?l.range=t:(t.operation==="toggle"&&(l.operation="toggle"),l.range=t.range,l.silenceNotifications=(n=t.silenceNotifications)!=null?n:!1);const f=jh(this,e),g=(a=l.operation)!=null?a:"set";if(l.range===void 0&&this.model.selectionIsCollapsed){if(g==="set"){this.defaultStyle=$($({},this.defaultStyle),f);return}const S=$({},this.defaultStyle);for(const T of Object.keys(f))S[T]===f[T]?(T==="color"&&delete S.verbatimColor,T==="backgroundColor"&&delete S.verbatimBackgroundColor,delete S[T]):S[T]=f[T];this.defaultStyle=S;return}this.model.deferNotifications({content:!l.silenceNotifications,type:"insertText"},()=>{if(l.range===void 0)for(const S of this.model.selection.ranges)$h(this.model,S,f,{operation:g});else $h(this.model,l.range,f,{operation:g})}),Xi(this)}toggleContextMenu(){var e;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(e=this.getCaretPoint())!=null?e:void 0,onDismiss:()=>{var t;return(t=this.element)==null?void 0:t.focus()}}),!0):!1}getCaretPoint(){const e=Ml(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,t){const n=$u(this,e,t,{bias:0});if(n<0)return!1;const a=this.model.position;return this.model.position=n,this.model.announce("move",a),Xi(this),!0}getPrompt(e){const t=this.model.findAtom(n=>n.type==="prompt"&&n.placeholderId===e);return console.assert(t!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),t}getPromptValue(e,t){const n=this.getPrompt(e);if(!n)return"";const a=this.model.offsetOf(n.firstChild),l=this.model.offsetOf(n.lastChild);return this.model.getValue(a,l,t)}getPrompts(e){return this.model.getAllAtoms().filter(t=>t.type!=="prompt"?!1:e?!(e.id&&t.placeholderId!==e.id||e.locked&&t.locked!==e.locked||e.correctness==="undefined"&&t.correctness||e.correctness&&t.correctness!==e.correctness):!0).map(t=>t.placeholderId)}setPromptValue(e,t,n){if(t!==void 0){const a=this.getPrompt(e);if(!a){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}const l=this.model.getBranchRange(this.model.offsetOf(a),"body");this.model.setSelection(l),this.insert(t,c($({},n),{insertionMode:"replaceSelection"}))}n!=null&&n.silenceNotifications&&(this.valueOnFocus=this.getValue()),Xi(this)}setPromptState(e,t,n){const a=this.getPrompt(e);if(!a){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}t==="undefined"?a.correctness=void 0:typeof t=="string"&&(a.correctness=t),typeof n=="boolean"&&(a.locked=n,a.captureSelection=n),Xi(this)}getPromptState(e){const t=this.getPrompt(e);return t?[t.correctness,t.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[void 0,!0])}getPromptRange(e){const t=this.getPrompt(e);return t?this.model.getBranchRange(this.model.offsetOf(t),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(e){var t;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(xo(this)),(t=this.host)==null||t.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var e;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(xo(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var e;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(xo(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var e;(e=this.undoManager)==null||e.reset()}onSelectionDidChange(){var e,t;const n=this.model;this.keyboardDelegate.setValue(n.getValue(this.model.selection,"latex-expanded"));{const a=n.at(n.position),l=(e=a.mode)!=null?e:Nd(this.options);this.model.mode!==l&&(this.model.mode==="latex"?(G0(this,"accept",{mode:l}),n.position=n.offsetOf(a)):this.switchMode(l))}(t=this.host)==null||t.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(xo(this)),Uc(this)}onContentWillChange(e){var t,n,a;return(a=(n=this.host)==null?void 0:n.dispatchEvent(new InputEvent("beforeinput",c($({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?a:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),a0(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var e,t,n;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",V0(this),this.model.getValue()!==this.valueOnFocus&&((e=this.host)==null||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(t=this.host)==null||t.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(n=this.host)==null||n.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),Xi(this),this.focusBlurInProgress=!1,Jh();const a=new AbortController,l=a.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Yo(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:l})},{once:!0,signal:l}),setTimeout(()=>a.abort(),100)}onInput(e){Gh(this,e)}onKeystroke(e){return Yd(this,e)}onCompositionStart(e){this.model.deleteAtoms(Ps(this.model.selection));const t=Ml(this.field);t&&requestAnimationFrame(()=>{a0(this),this.keyboardDelegate.moveTo(t.x,t.y-t.height)})}onCompositionUpdate(e){F1(this.model,e),Xi(this)}onCompositionEnd(e){N1(this.model),Gh(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),Si.onCopy(this,e),So(this.model,Ps(this.model.selection),"deleteByCut"),this.snapshot("cut"),Xi(this))}onCopy(e){Si.onCopy(this,e)}onPaste(e){let t=this.isSelectionEditable;return t&&(t=Si.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),t||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),t}onGeometryChange(){this._menu.hide(),xc(this),Uc(this)}onWheel(e){const t=5*e.deltaX;if(!Number.isFinite(t)||t===0)return;const n=this.field;t<0&&n.scrollLeft===0||t>0&&n.offsetWidth+n.scrollLeft>=n.scrollWidth||(n.scrollBy({top:0,left:t}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let t=e;for(;!t.id&&t.hasChildren;)t=e.children[0];return this.field.querySelector(`[data-atom-id="${t.id}"]`)}get context(){var e,t;return{registers:(e=this.options.registers)!=null?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(t=this.options.placeholderSymbol)!=null?t:"\u25A2",colorMap:n=>this.colorMap(n),backgroundColorMap:n=>this.backgroundColorMap(n),getMacro:n=>Dt(n,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function Af(e){if(e&&(e.classList.remove("ML__highlight"),e.children))for(const t of e.children)Af(t)}function fd(e,t){var n;e&&(!t||((n=e.dataset)==null?void 0:n.atomId)===t?(e.classList.add("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(a=>{a instanceof HTMLElement&&fd(a)})):(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(a=>{a instanceof HTMLElement&&fd(a,t)})))}function wg(e,t){var n;if(!M())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(t);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),l={OutputFormat:"json",VoiceId:(n=window.MathfieldElement.speechEngineVoice)!=null?n:"Joanna",Engine:"standard",Text:t,TextType:"ssml",SpeechMarkTypes:["ssml"]};Nl().readAloudElement=e,a.synthesizeSpeech(l,(f,g)=>{if(f){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${f}`);return}if(!(g!=null&&g.AudioStream)){console.log("polly.synthesizeSpeech():",g);return}const S=new TextDecoder("utf-8").decode(new Uint8Array(g.AudioStream));Nl().readAloudMarks=S.split(`
`).map(T=>T?JSON.parse(T):{}),Nl().readAloudTokens=[];for(const T of Nl().readAloudMarks)T.value&&Nl().readAloudTokens.push(T.value);Nl().readAloudCurrentMark="",l.OutputFormat="mp3",l.SpeechMarkTypes=[],a.synthesizeSpeech(l,(T,R)=>{if(T){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${t}") error:${T}`);return}if(!(R!=null&&R.AudioStream))return;const F=new Uint8Array(R.AudioStream),X=new Blob([F.buffer],{type:"audio/mpeg"}),ve=URL.createObjectURL(X),Me=Nl();Me.readAloudAudio?Me.readAloudAudio.pause():(Me.readAloudAudio=new Audio,Me.readAloudAudio.addEventListener("ended",()=>{const ze=Me.readAloudMathfield;Me.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),ze?(a0(ze),Me.readAloudElement=null,Me.readAloudMathfield=null,Me.readAloudTokens=[],Me.readAloudMarks=[],Me.readAloudCurrentMark=""):Af(Me.readAloudElement)}),Me.readAloudAudio.addEventListener("timeupdate",()=>{let ze="";const _t=Me.readAloudAudio.currentTime*1e3+100;for(const tr of Me.readAloudMarks)tr.time<_t&&(ze=tr.value);Me.readAloudCurrentMark!==ze&&(Me.readAloudCurrentToken=ze,ze&&ze===Me.readAloudFinalToken?Me.readAloudAudio.pause():(Me.readAloudCurrentMark=ze,fd(Me.readAloudElement,Me.readAloudCurrentMark)))})),Me.readAloudAudio.src=ve,Me.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),Me.readAloudAudio.play()})})}M()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var Zn=new WeakMap,Sg=.5,Fl={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},Fs=class g0 extends HTMLElement{static get formAssociated(){return nu()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(t){t!==this._fontsDirectory&&(this._fontsDirectory=t,h1())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(t){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(t){this._soundsDirectory=t,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(t){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(t){var n,a,l;this.audioBuffers={},t===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof t=="string"?this._keypressSound={spacebar:t,return:t,delete:t,default:t}:typeof t=="object"&&"default"in t&&(this._keypressSound={spacebar:(n=t.spacebar)!=null?n:t.default,return:(a=t.return)!=null?a:t.default,delete:(l=t.delete)!=null?l:t.default,default:t.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(t){this.audioBuffers={},this._plonkSound=t}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(t){this._speechEngine=t}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(t){this._speechEngineRate=t}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(t){this._speechEngineVoice=t}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(t){this._textToSpeechMarkup=t}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(t){this._textToSpeechRules=t}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(t){this._textToSpeechRulesOptions=t}static get locale(){return Z.locale}static set locale(t){t==="auto"&&(t=navigator.language.slice(0,5)),Z.locale=t}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(t){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return Z.strings}static set strings(t){Z.merge(t)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(t){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(t){this._decimalSeparator=t,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(t){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var t,n;if(this._computeEngine===void 0){const a=(t=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;if(!a)return null;this._computeEngine=new a,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(n=this._computeEngine)!=null?n:null}static set computeEngine(t){this._computeEngine=t}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(t){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(t){this._isFunction=t}static loadSound(t){return $l(this,null,function*(){delete this.audioBuffers[t];let n="";switch(t){case"keypress":n=this._keypressSound.default;break;case"return":n=this._keypressSound.return;break;case"spacebar":n=this._keypressSound.spacebar;break;case"delete":n=this._keypressSound.delete;break;case"plonk":n=this.plonkSound;break}if(typeof n!="string")return;n=n.trim();const a=this.soundsDirectory;if(!(a==null||a==="null"||n==="none"||n==="null"))try{const f=yield(yield fetch(yield Dd(`${a}/${n}`))).arrayBuffer(),g=yield this.audioContext.decodeAudioData(f);this.audioBuffers[t]=g}catch(l){}})}static playSound(t){return $l(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[t]||(yield this.loadSound(t)),!this.audioBuffers[t])return;const n=this.audioContext.createBufferSource();n.buffer=this.audioBuffers[t];const a=this.audioContext.createGain();a.gain.value=Sg,n.connect(a).connect(this.audioContext.destination),n.start()})}constructor(t){if(super(),t){const n=[];for(const a of Object.keys(t))if(Fl[a])if(Fl[a].startsWith("mf."))if(Fl[a].startsWith(`mf.${a}`))n.push(`Option \`${a}\` cannot be used as a constructor option. Use ${Fl[a]}`);else{const l=Fl[a].match(/([a-zA-Z]+) =/);n.push(`Option \`${a}\` has been renamed \`${l[1]}\``)}else n.push(`Option \`${a}\` cannot be used as a constructor option. Use ${Fl[a]}`);if(n.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const a of n)console.warn(a);console.groupEnd()}}if(nu()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[Ll("core"),Ll("mathfield"),Ll("mathfield-element"),Ll("ui"),Ll("menu")],this.shadowRoot.appendChild(document.createElement("span"));const n=document.createElement("slot");n.style.display="none",this.shadowRoot.appendChild(n)}else this.shadowRoot.innerHTML="<style>"+Xo("core")+Xo("mathfield")+Xo("mathfield-element")+Xo("ui")+Xo("menu")+'</style><span></span><slot style="display:none"></slot>';t&&this._setOptions(t),this.shadowRoot.addEventListener("slotchange",()=>{var n;const a=this.shadowRoot.querySelector("slot:not([name])");this.value=(n=a==null?void 0:a.assignedNodes().map(l=>l.nodeType===3?l.textContent:"").join("").trim())!=null?n:""})}showMenu(t){var n,a;return(a=(n=this._mathfield)==null?void 0:n.showMenu(t))!=null?a:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",t=>{var n;t.target===this&&!((n=this._mathfield)!=null&&n.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,movementX:t.movementX,movementY:t.movementY,relatedTarget:t.relatedTarget,screenX:t.screenX,screenY:t.screenY,shiftKey:t.shiftKey}))},{once:!0})}getPromptValue(t,n){var a,l;return(l=(a=this._mathfield)==null?void 0:a.getPromptValue(t,n))!=null?l:""}setPromptValue(t,n,a){var l;(l=this._mathfield)==null||l.setPromptValue(t,n,a)}getPromptRange(t){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPromptRange(t))!=null?a:null}getPrompts(t){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPrompts(t))!=null?a:[]}get form(){var t;return(t=this._internals)==null?void 0:t.form}get name(){var t;return(t=this.getAttribute("name"))!=null?t:""}get type(){return this.localName}get mode(){var t,n;return(n=(t=this._mathfield)==null?void 0:t.model.mode)!=null?n:this.defaultMode==="text"?"text":"math"}set mode(t){var n;(n=this._mathfield)==null||n.switchMode(t)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(t){var n,a;if(!this._mathfield)return;const l=(a=(n=g0.computeEngine)==null?void 0:n.box(t).latex)!=null?a:null;l!==null&&this._mathfield.setValue(l),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var t,n;return(n=(t=this._mathfield)==null?void 0:t.errors)!=null?n:[]}_getOptions(t){return this._mathfield?l0(this._mathfield.options,t):Zn.has(this)?$({},l0($($({},Mc()),Dc(Zn.get(this).options)),t)):null}getOptions(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?l0(this._mathfield.options,t):Zn.has(this)?l0($($({},Mc()),Dc(Zn.get(this).options)),t):null}reflectAttributes(){const t=Mc(),n=this._getOptions();Object.keys(g0.optionsAttributes).forEach(a=>{const l=Qo(a);g0.optionsAttributes[a]==="on/off"?t[l]!==n[l]?this.setAttribute(a,n[l]?"on":"off"):this.removeAttribute(a):t[l]!==n[l]&&(g0.optionsAttributes[a]==="boolean"?n[l]?this.setAttribute(a,""):this.removeAttribute(a):(typeof n[l]=="string"||typeof n[l]=="number")&&this.setAttribute(a,n[l].toString()))})}getOption(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([t])[t]}_getOption(t){return this._getOptions([t])[t]}_setOptions(t){if(this._mathfield)this._mathfield.setOptions(t);else if(Zn.has(this)){const n=$($({},Zn.get(this).options),t);Zn.set(this,c($({},Zn.get(this)),{selection:{ranges:n.readOnly?[[0,0]]:[[0,-1]]},options:n}))}else Zn.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:t,menuItems:void 0});this.reflectAttributes()}setOptions(t){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const n of Object.keys(t))Fl[n]&&console.warn(`\`mf.setOptions({${n}:...})\` -> ${Fl[n]}`);console.groupEnd(),this._setOptions(t)}executeCommand(t){var n,a;return(a=(n=this._mathfield)==null?void 0:n.executeCommand(t))!=null?a:!1}getValue(t,n,a){var l,f;if(this._mathfield)return this._mathfield.model.getValue(t,n,a);if(Zn.has(this)){let g,S,T;if(Dl(t)?([g,S]=t.ranges[0],T=n):e0(t)?([g,S]=t,T=n):mo(t)&&mo(n)?(g=t,S=n,T=a):(g=0,S=-1,T=t),(T===void 0||T==="latex")&&g===0&&S===-1)return(f=(l=Zn.get(this).value)!=null?l:this.textContent)!=null?f:""}return""}setValue(t,n){if(this._mathfield&&t!==void 0){n!=null||(n={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(t,n);return}if(Zn.has(this)){const l=Zn.get(this).options;Zn.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:l,menuItems:void 0});return}const a=Wu(this);Zn.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:a,menuItems:void 0})}hasFocus(){var t,n;return(n=(t=this._mathfield)==null?void 0:t.hasFocus())!=null?n:!1}focus(){var t;(t=this._mathfield)==null||t.focus()}blur(){var t;(t=this._mathfield)==null||t.blur()}select(){var t;(t=this._mathfield)==null||t.select()}insert(t,n){var a,l;return(l=(a=this._mathfield)==null?void 0:a.insert(t,n))!=null?l:!1}applyStyle(t,n){var a;return(a=this._mathfield)==null?void 0:a.applyStyle(t,n)}queryStyle(t){var n,a;return(a=(n=this._mathfield)==null?void 0:n.queryStyle(t))!=null?a:"none"}get caretPoint(){var t,n;return(n=(t=this._mathfield)==null?void 0:t.getCaretPoint())!=null?n:null}set caretPoint(t){var n;t&&((n=this._mathfield)==null||n.setCaretPoint(t.x,t.y))}setCaretPoint(t,n){var a,l;return(l=(a=this._mathfield)==null?void 0:a.setCaretPoint(t,n))!=null?l:!1}offsetFromPoint(t,n,a){return this._mathfield?$u(this._mathfield,t,n,a):-1}hitboxFromOffset(t){if(!this._mathfield)return null;const n=this._mathfield.model.at(t);if(!n)return null;const a=t0(this._mathfield,n);return a?new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top):null}resetUndo(){var t;(t=this._mathfield)==null||t.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(t){var n,a,l,f;yo.state==="closed"&&((a=(n=this._mathfield)==null?void 0:n.menu)==null?void 0:a.state)==="closed"&&(t.type==="pointerdown"&&this.onPointerDown(),t.type==="focus"&&((l=this._mathfield)==null||l.focus()),t.type==="blur"&&((f=this._mathfield)==null||f.blur()))}connectedCallback(){var t,n,a,l;const f=window.getComputedStyle(this),g=this.shadowRoot,S=f.userSelect!=="none";if(S)g.host.addEventListener("pointerdown",this,!0);else{const F=g.querySelector("span");F.style.pointerEvents="none"}g.host.addEventListener("focus",this,!0),g.host.addEventListener("blur",this,!0),nu()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),S&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const T=g.querySelector("slot:not([name])");if(T)try{this._style=T.assignedElements().filter(F=>F.tagName.toLowerCase()==="style").map(F=>F.textContent).join("")}catch(F){console.error(F)}if(this._style){const F=document.createElement("style");F.textContent=this._style,g.appendChild(F)}let R="";if(this.hasAttribute("value")?R=this.getAttribute("value"):R=(t=T==null?void 0:T.assignedNodes().map(F=>F.nodeType===3?F.textContent:"").join("").trim())!=null?t:"",this._mathfield=new xg(g.querySelector(":host > span"),c($({},(a=(n=Zn.get(this))==null?void 0:n.options)!=null?a:Wu(this)),{eventSink:this,value:R})),!Zn.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const F of Object.keys(g0.optionsAttributes))this.upgradeProperty(Qo(F))}if(!((l=this._mathfield)!=null&&l.model)){this._mathfield=null;return}if(Zn.has(this)){const F=this._mathfield,X=Zn.get(this),ve=X.menuItems;F.model.deferNotifications({content:!1,selection:!1},()=>{const Me=X.value;Me!==void 0&&F.setValue(Me),F.model.selection=X.selection,Zn.delete(this)}),ve&&(this.menuItems=ve)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Sc()}disconnectedCallback(){var t,n;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const a=l0(this._mathfield.options,Object.keys(g0.optionsAttributes).map(l=>Qo(l)));Zn.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(n=(t=this._mathfield.menu)==null?void 0:t.menuItems)!=null?n:void 0,options:a}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(t){if(this.hasOwnProperty(t)){const n=this[t];delete this[t],(t==="readonly"||t==="read-only")&&(t="readOnly"),this[t]=n}}attributeChangedCallback(t,n,a){if(n===a)return;const l=a!==null;switch(t){case"contenteditable":Xi(this._mathfield);break;case"disabled":this.disabled=l;break;case"read-only":case"readonly":this.readOnly=l;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(t){const n=!!t;n?(this.setAttribute("readonly",""),nu()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(nu()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:n})}get disabled(){return this.hasAttribute("disabled")}set disabled(t){var n;const a=!!t;a?this.setAttribute("disabled",""):this.removeAttribute("disabled"),nu()?this._internals.ariaDisabled=a?"true":"false":this.setAttribute("aria-disabled",a?"true":"false"),a&&((n=this._mathfield)!=null&&n.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(t){this.setValue(t)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(t){this._setOptions({defaultMode:t})}get macros(){return this._getOption("macros")}set macros(t){this._setOptions({macros:t})}get registers(){const t=this;return new Proxy({},{get:(n,a)=>{if(typeof a=="string")return t._getOption("registers")[a]},set(n,a,l){return typeof a!="string"?!1:(t._setOptions({registers:c($({},t._getOption("registers")),{[a]:l})}),!0)}})}set registers(t){this._setOptions({registers:t})}get colorMap(){return this._getOption("colorMap")}set colorMap(t){this._setOptions({colorMap:t})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(t){this._setOptions({backgroundColorMap:t})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(t){this._setOptions({letterShapeStyle:t})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(t){this._setOptions({minFontScale:t})}get smartMode(){return this._getOption("smartMode")}set smartMode(t){this._setOptions({smartMode:t})}get smartFence(){return this._getOption("smartFence")}set smartFence(t){this._setOptions({smartFence:t})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(t){this._setOptions({smartSuperscript:t})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(t){this._setOptions({scriptDepth:t})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(t){this._setOptions({removeExtraneousParentheses:t})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(t){this._setOptions({mathModeSpace:t})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(t){this._setOptions({placeholderSymbol:t})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(t){this._setOptions({popoverPolicy:t})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(t){this._setOptions({environmentPopoverPolicy:t})}get menuItems(){var t,n,a;return this._mathfield?(t=this._mathfield.menu._menuItems.map(l=>l.menuItem))!=null?t:[]:(a=(n=Zn.get(this))==null?void 0:n.menuItems)!=null?a:[]}set menuItems(t){var n;if(this._mathfield){const a=(n=this._mathfield.element)==null?void 0:n.querySelector("[part=menu-toggle]");a&&(a.style.display=t.length===0?"none":""),this._mathfield.menu.menuItems=t}Zn.has(this)?Zn.set(this,c($({},Zn.get(this)),{menuItems:t})):Zn.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Wu(this),menuItems:t})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(t){this._setOptions({mathVirtualKeyboardPolicy:t})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(t){this._setOptions({inlineShortcuts:t})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(t){this._setOptions({inlineShortcutTimeout:t})}get keybindings(){return this._getOption("keybindings")}set keybindings(t){this._setOptions({keybindings:t})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(t){this._setOptions({onInlineShortcut:t})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(t){this._setOptions({onScrollIntoView:t})}get onExport(){return this._getOption("onExport")}set onExport(t){this._setOptions({onExport:t})}get readOnly(){return this._getOption("readOnly")}set readOnly(t){this._setOptions({readOnly:t})}get isSelectionEditable(){var t,n;return(n=(t=this._mathfield)==null?void 0:t.isSelectionEditable)!=null?n:!1}setPromptState(t,n,a){var l;(l=this._mathfield)==null||l.setPromptState(t,n,a)}getPromptState(t){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPromptState(t))!=null?a:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(t){this._setOptions({virtualKeyboardTargetOrigin:t})}get selection(){return this._mathfield?this._mathfield.model.selection:Zn.has(this)?Zn.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(t){if(typeof t=="number"&&(t={ranges:[[t,t]]}),this._mathfield){this._mathfield.model.selection=t,Xi(this._mathfield);return}if(Zn.has(this)){Zn.set(this,c($({},Zn.get(this)),{selection:t}));return}Zn.set(this,{value:void 0,selection:t,options:Wu(this),menuItems:void 0})}get selectionIsCollapsed(){const t=this.selection;return t.ranges.length===1&&t.ranges[0][0]===t.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:Zn.has(this)?Zn.get(this).selection.ranges[0][0]:0}set position(t){if(this._mathfield&&(this._mathfield.model.position=t,Xi(this._mathfield)),Zn.has(this)){Zn.set(this,c($({},Zn.get(this)),{selection:{ranges:[[t,t]]}}));return}Zn.set(this,{value:void 0,selection:{ranges:[[t,t]]},options:Wu(this),menuItems:void 0})}getOffsetDepth(t){var n,a;return this._mathfield?((a=(n=this._mathfield.model.at(t))==null?void 0:n.treeDepth)!=null?a:2)-2:0}get lastOffset(){var t,n;return(n=(t=this._mathfield)==null?void 0:t.model.lastOffset)!=null?n:-1}};Fs.version="0.98.5",Fs._fontsDirectory="./fonts",Fs._soundsDirectory="./sounds",Fs.keypressVibration=!0,Fs._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},Fs._plonkSound="plonk.wav",Fs.audioBuffers={},Fs.createHTML=e=>e,Fs._speechEngineRate="100%",Fs._speechEngineVoice="Joanna",Fs._textToSpeechMarkup="",Fs._textToSpeechRules="mathlive",Fs._textToSpeechRulesOptions={},Fs.speakHook=dg,Fs.readAloudHook=wg,Fs._decimalSeparator=".",Fs.fractionNavigationOrder="numerator-denominator",Fs._isFunction=e=>{var t,n;const a=window.MathfieldElement.computeEngine;return(n=(t=a==null?void 0:a.parse(e).domain)==null?void 0:t.isFunction)!=null?n:!1};var Vu=Fs;function Qo(e){return e.replace(/[^a-zA-Z\d]+(.)/g,(t,n)=>n.toUpperCase())}function Wu(e){const t={readOnly:!1},n=Vu.optionsAttributes;return Object.keys(n).forEach(a=>{if(e.hasAttribute(a)){const l=e.getAttribute(a);a==="placeholder"?t.contentPlaceholder=l!=null?l:"":n[a]==="boolean"?t[Qo(a)]=!0:n[a]==="on/off"?l==="on"?t[Qo(a)]=!0:l==="off"?t[Qo(a)]=!1:t[Qo(a)]=void 0:n[a]==="number"?t[Qo(a)]=Number.parseFloat(l!=null?l:"0"):t[Qo(a)]=l}}),t}function nu(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var Tf=Vu,Cf,Df,Mf,Lf;if(M()&&!((Cf=window.customElements)!=null&&Cf.get("math-field"))){(Mf=window[Df=Symbol.for("io.cortexjs.mathlive")])!=null||(window[Df]={});const e=window[Symbol.for("io.cortexjs.mathlive")];e.version="0.98.5",window.MathfieldElement=Vu,(Lf=window.customElements)==null||Lf.define("math-field",Vu)}function Eg(e,t,n){let a=n,l=0;const f=e.length;for(;a<t.length;){const g=t[a];if(l<=0&&t.slice(a,a+f)===e)return a;g==="\\"?a++:g==="{"?l++:g==="}"&&l--,a++}return-1}function jc(e,t,n,a,l="latex"){const f=[];for(const g of e)if(g.type==="text"){const S=g.data;let T=!0,R=0,F;F=S.indexOf(t),F!==-1&&(R=F,R>0&&f.push({type:"text",data:S.slice(0,R)}),T=!1);let X=!1;for(;!X;){if(T){if(F=S.indexOf(t,R),F===-1){X=!0;break}R!==F&&f.push({type:"text",data:S.slice(R,F)}),R=F}else{if(F=Eg(n,S,R+t.length),F===-1){X=!0;break}let ve=S.slice(R+t.length,F);l==="ascii-math"&&([,ve]=P0(ve,{format:"ascii-math"})),f.push({type:"math",data:ve,rawData:S.slice(R,F+n.length),mathstyle:a}),R=F+n.length}T=!T}R<S.length&&f.push({type:"text",data:S.slice(R)})}else f.push(g);return f}function Rf(e,t,n){let a=[{type:"text",data:e}];return t!=null&&t.inline&&t.inline.forEach(([l,f])=>{a=jc(a,l,f,"textstyle")}),t!=null&&t.display&&t.display.forEach(([l,f])=>{a=jc(a,l,f,"displaystyle")}),n!=null&&n.inline&&n.inline.forEach(([l,f])=>{a=jc(a,l,f,"textstyle","ascii-math")}),n!=null&&n.display&&n.display.forEach(([l,f])=>{a=jc(a,l,f,"displaystyle","ascii-math")}),a}function kg(e,t){const n=document.createElement("span");n.setAttribute("translate","no");try{const a="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+t.renderToMathML(e)+"</math>";n.innerHTML=window.MathfieldElement.createHTML(a)}catch(a){console.error(`MathLive 0.98.5: Could not convert "${e}"' to MathML with ${a}`),n.textContent=e}return n.className="ML__sr-only",n}function Ag(e,t,n,a){try{const l=t.renderToMarkup(e,{mathstyle:n,format:"html"}),f=document.createElement("span");return f.dataset.latex=e,f.style.display=n==="displaystyle"?"flex":"inline-flex",f.setAttribute("aria-hidden","true"),f.setAttribute("translate","no"),f.innerHTML=window.MathfieldElement.createHTML(l),f}catch(l){if(console.error("Could not parse'"+e+"' with ",l),a)return document.createTextNode(e)}return null}function iu(e,t,n,a){var l;const f=Ag(e,n,t||"textstyle",a),g=(l=n.renderAccessibleContent)!=null?l:"";if(f&&/\b(mathml|speakable-text)\b/i.test(g)){const S=document.createElement("span");if(/\bmathml\b/i.test(g)&&n.renderToMathML&&S.append(kg(e,n)),/\bspeakable-text\b/i.test(g)&&n.renderToSpeakableText){const T=document.createElement("span");T.setAttribute("translate","no");const R=n.renderToSpeakableText(e);T.innerHTML=window.MathfieldElement.createHTML(R),T.className="ML__sr-only",S.append(T)}return S.append(f),S}return f}function Tg(e,t){var n,a,l;let f=null;if((n=t.TeX)!=null&&n.processEnvironments&&/^\s*\\begin/.test(e)){f=document.createDocumentFragment();const g=iu(e,"",t,!0);g&&f.appendChild(g)}else{if(!e.trim())return null;const g=Rf(e,(a=t.TeX)==null?void 0:a.delimiters,(l=t.asciiMath)==null?void 0:l.delimiters);if(g.length===1&&g[0].type==="text")return null;f=document.createDocumentFragment();for(const S of g)if(S.type==="text")f.appendChild(document.createTextNode(S.data));else{const T=iu(S.data,S.mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);T&&f.appendChild(T)}}return f}function If(e,t){var n,a,l,f,g,S,T,R,F,X,ve,Me,ze,_t,tr,pt;if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const Ht=(n=e.childNodes[0].textContent)!=null?n:"";if((a=t.TeX)!=null&&a.processEnvironments&&/^\s*\\begin/.test(Ht)){e.textContent="";const jt=iu(Ht,"",t,!0);jt&&e.append(jt);return}const ur=Rf(Ht,(l=t.TeX)==null?void 0:l.delimiters,(f=t.asciiMath)==null?void 0:f.delimiters);if(ur.length===1&&ur[0].type==="math"){e.textContent="";const jt=iu(ur[0].data,ur[0].mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);jt&&e.append(jt);return}if(ur.length===1&&ur[0].type==="text")return}for(let Ht=e.childNodes.length-1;Ht>=0;Ht--){const ur=e.childNodes[Ht];if(ur.nodeType===3){const jt=Tg((g=ur.textContent)!=null?g:"",t);jt&&(Ht+=jt.childNodes.length-1,ur.replaceWith(jt))}else if(ur.nodeType===1){const jt=ur,Pr=ur.nodeName.toLowerCase();if(Pr==="script"){const Yr=ur;let Hr;if((S=t.processScriptTypePattern)!=null&&S.test(Yr.type))Hr=(T=Yr.textContent)!=null?T:"";else if((R=t.processMathJSONScriptTypePattern)!=null&&R.test(Yr.type))try{Hr=(X=t.serializeToLatex)==null?void 0:X.call(t,JSON.parse((F=Yr.textContent)!=null?F:""))}catch(Gn){console.error(Gn)}if(Hr){let Gn="textstyle";for(const dr of Yr.type.split(";")){const[_a,Eo]=dr.toLowerCase().split("=");_a.trim()==="mode"&&(Gn=Eo.trim()==="display"?"displaystyle":"textstyle")}const yi=iu(Hr,Gn,t,!0);yi&&Yr.parentNode.replaceChild(yi,Yr)}}else if(((Me=(ve=t.processClassPattern)==null?void 0:ve.test(jt.className))!=null?Me:!1)||!((_t=(ze=t.skipTags)==null?void 0:ze.includes(Pr))!=null&&_t||(pt=(tr=t.ignoreClassPattern)==null?void 0:tr.test(jt.className))!=null&&pt))if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const Hr=e.textContent;e.textContent="";const Gn=iu(Hr!=null?Hr:"","displaystyle",t,!0);Gn&&e.append(Gn)}else If(jt,t)}}}var Cg={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function Dg(e,t){var n,a,l,f;try{const g=$($({},Cg),t);g.ignoreClassPattern=new RegExp((n=g.ignoreClass)!=null?n:""),g.processClassPattern=new RegExp((a=g.processClass)!=null?a:""),g.processScriptTypePattern=new RegExp((l=g.processScriptType)!=null?l:""),g.processMathJSONScriptTypePattern=new RegExp((f=g.processMathJSONScriptType)!=null?f:""),Sc(),Ja("core"),If(e,g)}catch(g){g instanceof Error?console.error("renderMathInElement(): "+g.message):console.error("renderMathInElement(): Could not render math for element",e)}}function Mg(e,t){const n=Bl.singleton;return n?(n.show(),Ou(),n.currentLayer=t,n.render(),n.focus(),!0):!1}function Lg(){const e=window.mathVirtualKeyboard;return e.visible?e.hide({animate:!0}):e.show({animate:!0}),!1}pa({switchKeyboardLayer:Mg,toggleVirtualKeyboard:Lg,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function Nl(){var e,t;return(t=globalThis[e=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[e]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function Fg(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function Ng(e){Ig(document.body,e)}function Rg(e){if(typeof e=="string"){const t=document.getElementById(e);if(t===null)throw new Error(`The element with ID "${e}" could not be found.`);return t}return typeof e=="string"?null:e}function Ig(e,t){var n,a,l,f;const g=Rg(e);if(!g)return;const S=t!=null?t:{};(n=S.renderToMarkup)!=null||(S.renderToMarkup=Ls),(a=S.renderToMathML)!=null||(S.renderToMathML=Vm),(l=S.renderToSpeakableText)!=null||(S.renderToSpeakableText=Wm),(f=S.serializeToLatex)!=null||(S.serializeToLatex=jm),Dg(g,S)}var $g={mathlive:"0.98.5"}}}]);
}());