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/6274.e16f53d9.async.js

3460 lines
1.9 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 Lo=Math.pow;var bu=(Fr,Ct,Y)=>new Promise((U,Pe)=>{var We=E=>{try{ae(Y.next(E))}catch(Te){Pe(Te)}},Me=E=>{try{ae(Y.throw(E))}catch(Te){Pe(Te)}},ae=E=>E.done?U(E.value):Promise.resolve(E.value).then(We,Me);ae((Y=Y.apply(Fr,Ct)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[6274],{70557:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return z}});var U=Y(60499),Pe=Y(59301),We={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"},Me=We,ae=Y(7657),E=function(ne,q){return Pe.createElement(ae.Z,(0,U.Z)({},ne,{ref:q,icon:Me}))},Te=Pe.forwardRef(E),z=Te},84105:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return z}});var U=Y(60499),Pe=Y(59301),We={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"},Me=We,ae=Y(7657),E=function(ne,q){return Pe.createElement(ae.Z,(0,U.Z)({},ne,{ref:q,icon:Me}))},Te=Pe.forwardRef(E),z=Te},18785:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return z}});var U=Y(60499),Pe=Y(59301),We={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"},Me=We,ae=Y(7657),E=function(ne,q){return Pe.createElement(ae.Z,(0,U.Z)({},ne,{ref:q,icon:Me}))},Te=Pe.forwardRef(E),z=Te},62772:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return z}});var U=Y(60499),Pe=Y(59301),We={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"},Me=We,ae=Y(7657),E=function(ne,q){return Pe.createElement(ae.Z,(0,U.Z)({},ne,{ref:q,icon:Me}))},Te=Pe.forwardRef(E),z=Te},68196:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return si}});var U=Y(85899),Pe=Y(72190),We=Y(42244),Me=Y(43403),ae=Y(92310),E=Y.n(ae),Te=Y(29301),z=Y(76846),d=Y(96452),ne=Y(6089),q=Y(80402),M=Y(34280),L=Y(49658),O=Y(59301),G=Y(60499),he=Y(77900),le=Y(8654);function J(et){var ct=et.prefixCls,Ue=et.align,wt=et.arrow,Rt=et.arrowPos,Dt=wt||{},fe=Dt.className,ze=Dt.content,it=Rt.x,ut=it===void 0?0:it,_t=Rt.y,Ft=_t===void 0?0:_t,nr=O.useRef();if(!Ue||!Ue.points)return null;var Pt={position:"absolute"};if(Ue.autoArrow!==!1){var Ve=Ue.points[0],Bt=Ue.points[1],gr=Ve[0],Kt=Ve[1],qt=Bt[0],Gt=Bt[1];gr===qt||!["t","b"].includes(gr)?Pt.top=Ft:gr==="t"?Pt.top=0:Pt.bottom=0,Kt===Gt||!["l","r"].includes(Kt)?Pt.left=ut:Kt==="l"?Pt.left=0:Pt.right=0}return O.createElement("div",{ref:nr,className:E()("".concat(ct,"-arrow"),fe),style:Pt},ze)}function B(et){var ct=et.prefixCls,Ue=et.open,wt=et.zIndex,Rt=et.mask,Dt=et.motion;return Rt?O.createElement(he.default,(0,G.Z)({},Dt,{motionAppear:!0,visible:Ue,removeOnLeave:!0}),function(fe){var ze=fe.className;return O.createElement("div",{style:{zIndex:wt},className:E()("".concat(ct,"-mask"),ze)})}):null}var V=O.memo(function(et){var ct=et.children;return ct},function(et,ct){return ct.cache}),H=V,ie=O.forwardRef(function(et,ct){var Ue=et.popup,wt=et.className,Rt=et.prefixCls,Dt=et.style,fe=et.target,ze=et.onVisibleChanged,it=et.open,ut=et.keepDom,_t=et.fresh,Ft=et.onClick,nr=et.mask,Pt=et.arrow,Ve=et.arrowPos,Bt=et.align,gr=et.motion,Kt=et.maskMotion,qt=et.forceRender,Gt=et.getPopupContainer,Lr=et.autoDestroy,wr=et.portal,Xt=et.zIndex,Ar=et.onMouseEnter,C=et.onMouseLeave,N=et.onPointerEnter,yt=et.onPointerDownCapture,X=et.ready,ue=et.offsetX,br=et.offsetY,Ne=et.offsetR,Fe=et.offsetB,qe=et.onAlign,ee=et.onPrepare,de=et.stretch,Re=et.targetWidth,Ge=et.targetHeight,Z=typeof Ue=="function"?Ue():Ue,Nt=it||ut,Ae=(Gt==null?void 0:Gt.length)>0,sr=O.useState(!Gt||!Ae),Sr=(0,Pe.Z)(sr,2),mi=Sr[0],Hi=Sr[1];if((0,M.Z)(function(){!mi&&Ae&&fe&&Hi(!0)},[mi,Ae,fe]),!mi)return null;var Ai="auto",zr={left:"-1000vw",top:"-1000vh",right:Ai,bottom:Ai};if(X||!it){var Ji,Cn=Bt.points,Di=Bt.dynamicInset||((Ji=Bt._experimental)===null||Ji===void 0?void 0:Ji.dynamicInset),Ii=Di&&Cn[0][1]==="r",ar=Di&&Cn[0][0]==="b";Ii?(zr.right=Ne,zr.left=Ai):(zr.left=ue,zr.right=Ai),ar?(zr.bottom=Fe,zr.top=Ai):(zr.top=br,zr.bottom=Ai)}var Wr={};return de&&(de.includes("height")&&Ge?Wr.height=Ge:de.includes("minHeight")&&Ge&&(Wr.minHeight=Ge),de.includes("width")&&Re?Wr.width=Re:de.includes("minWidth")&&Re&&(Wr.minWidth=Re)),it||(Wr.pointerEvents="none"),O.createElement(wr,{open:qt||Nt,getContainer:Gt&&function(){return Gt(fe)},autoDestroy:Lr},O.createElement(B,{prefixCls:Rt,open:it,zIndex:Xt,mask:nr,motion:Kt}),O.createElement(Te.Z,{onResize:qe,disabled:!it},function(pe){return O.createElement(he.default,(0,G.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:qt,leavedClassName:"".concat(Rt,"-hidden")},gr,{onAppearPrepare:ee,onEnterPrepare:ee,visible:it,onVisibleChanged:function(kt){var Ot;gr==null||(Ot=gr.onVisibleChanged)===null||Ot===void 0||Ot.call(gr,kt),ze(kt)}}),function(we,kt){var Ot=we.className,Yt=we.style,rr=E()(Rt,Ot,wt);return O.createElement("div",{ref:(0,le.sQ)(pe,ct,kt),className:rr,style:(0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)({"--arrow-x":"".concat(Ve.x||0,"px"),"--arrow-y":"".concat(Ve.y||0,"px")},zr),Wr),Yt),{},{boxSizing:"border-box",zIndex:Xt},Dt),onMouseEnter:Ar,onMouseLeave:C,onPointerEnter:N,onClick:Ft,onPointerDownCapture:yt},Pt&&O.createElement(J,{prefixCls:Rt,arrow:Pt,arrowPos:Ve,align:Bt}),O.createElement(H,{cache:!it&&!_t},Z))})}))}),De=ie,$e=O.forwardRef(function(et,ct){var Ue=et.children,wt=et.getTriggerDOMNode,Rt=(0,le.Yr)(Ue),Dt=O.useCallback(function(ze){(0,le.mH)(ct,wt?wt(ze):ze)},[wt]),fe=(0,le.x1)(Dt,(0,le.C4)(Ue));return Rt?O.cloneElement(Ue,{ref:fe}):Ue}),Se=$e,Ye=O.createContext(null),lt=Ye;function Xe(et){return et?Array.isArray(et)?et:[et]:[]}function $t(et,ct,Ue,wt){return O.useMemo(function(){var Rt=Xe(Ue!=null?Ue:ct),Dt=Xe(wt!=null?wt:ct),fe=new Set(Rt),ze=new Set(Dt);return et&&(fe.has("hover")&&(fe.delete("hover"),fe.add("click")),ze.has("hover")&&(ze.delete("hover"),ze.add("click"))),[fe,ze]},[et,ct,Ue,wt])}var ye=Y(29194);function oe(){var et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ct=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ue=arguments.length>2?arguments[2]:void 0;return Ue?et[0]===ct[0]:et[0]===ct[0]&&et[1]===ct[1]}function me(et,ct,Ue,wt){for(var Rt=Ue.points,Dt=Object.keys(et),fe=0;fe<Dt.length;fe+=1){var ze,it=Dt[fe];if(oe((ze=et[it])===null||ze===void 0?void 0:ze.points,Rt,wt))return"".concat(ct,"-placement-").concat(it)}return""}function ge(et,ct,Ue,wt){return ct||(Ue?{motionName:"".concat(et,"-").concat(Ue)}:wt?{motionName:wt}:null)}function Ee(et){return et.ownerDocument.defaultView}function be(et){for(var ct=[],Ue=et==null?void 0:et.parentElement,wt=["hidden","scroll","clip","auto"];Ue;){var Rt=Ee(Ue).getComputedStyle(Ue),Dt=Rt.overflowX,fe=Rt.overflowY,ze=Rt.overflow;[Dt,fe,ze].some(function(it){return wt.includes(it)})&&ct.push(Ue),Ue=Ue.parentElement}return ct}function D(et){var ct=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(et)?ct:et}function R(et){return D(parseFloat(et),0)}function se(et,ct){var Ue=(0,U.Z)({},et);return(ct||[]).forEach(function(wt){if(!(wt instanceof HTMLBodyElement||wt instanceof HTMLHtmlElement)){var Rt=Ee(wt).getComputedStyle(wt),Dt=Rt.overflow,fe=Rt.overflowClipMargin,ze=Rt.borderTopWidth,it=Rt.borderBottomWidth,ut=Rt.borderLeftWidth,_t=Rt.borderRightWidth,Ft=wt.getBoundingClientRect(),nr=wt.offsetHeight,Pt=wt.clientHeight,Ve=wt.offsetWidth,Bt=wt.clientWidth,gr=R(ze),Kt=R(it),qt=R(ut),Gt=R(_t),Lr=D(Math.round(Ft.width/Ve*1e3)/1e3),wr=D(Math.round(Ft.height/nr*1e3)/1e3),Xt=(Ve-Bt-qt-Gt)*Lr,Ar=(nr-Pt-gr-Kt)*wr,C=gr*wr,N=Kt*wr,yt=qt*Lr,X=Gt*Lr,ue=0,br=0;if(Dt==="clip"){var Ne=R(fe);ue=Ne*Lr,br=Ne*wr}var Fe=Ft.x+yt-ue,qe=Ft.y+C-br,ee=Fe+Ft.width+2*ue-yt-X-Xt,de=qe+Ft.height+2*br-C-N-Ar;Ue.left=Math.max(Ue.left,Fe),Ue.top=Math.max(Ue.top,qe),Ue.right=Math.min(Ue.right,ee),Ue.bottom=Math.min(Ue.bottom,de)}}),Ue}function Ie(et){var ct=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ue="".concat(ct),wt=Ue.match(/^(.*)\%$/);return wt?et*(parseFloat(wt[1])/100):parseFloat(Ue)}function at(et,ct){var Ue=ct||[],wt=(0,Pe.Z)(Ue,2),Rt=wt[0],Dt=wt[1];return[Ie(et.width,Rt),Ie(et.height,Dt)]}function Et(){var et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[et[0],et[1]]}function bt(et,ct){var Ue=ct[0],wt=ct[1],Rt,Dt;return Ue==="t"?Dt=et.y:Ue==="b"?Dt=et.y+et.height:Dt=et.y+et.height/2,wt==="l"?Rt=et.x:wt==="r"?Rt=et.x+et.width:Rt=et.x+et.width/2,{x:Rt,y:Dt}}function He(et,ct){var Ue={t:"b",b:"t",l:"r",r:"l"};return et.map(function(wt,Rt){return Rt===ct?Ue[wt]||"c":wt}).join("")}function Ht(et,ct,Ue,wt,Rt,Dt,fe){var ze=O.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Rt[wt]||{}}),it=(0,Pe.Z)(ze,2),ut=it[0],_t=it[1],Ft=O.useRef(0),nr=O.useMemo(function(){return ct?be(ct):[]},[ct]),Pt=O.useRef({}),Ve=function(){Pt.current={}};et||Ve();var Bt=(0,ne.Z)(function(){if(ct&&Ue&&et){let dn=function(Bn,Ln){var Cs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nr,Zn=Nt.x+Bn,ia=Nt.y+Ln,ca=Zn+ar,Gs=ia+Ii,_s=Math.max(Zn,Cs.left),Kr=Math.max(ia,Cs.top),fi=Math.min(ca,Cs.right),Zi=Math.min(Gs,Cs.bottom);return Math.max(0,(fi-_s)*(Zi-Kr))},Sn=function(){tn=Nt.y+Zr,zi=tn+Ii,$r=Nt.x+hr,jr=$r+ar};var qt,Gt,Lr,wr,Xt=ct,Ar=Xt.ownerDocument,C=Ee(Xt),N=C.getComputedStyle(Xt),yt=N.position,X=Xt.style.left,ue=Xt.style.top,br=Xt.style.right,Ne=Xt.style.bottom,Fe=Xt.style.overflow,qe=(0,U.Z)((0,U.Z)({},Rt[wt]),Dt),ee=Ar.createElement("div");(qt=Xt.parentElement)===null||qt===void 0||qt.appendChild(ee),ee.style.left="".concat(Xt.offsetLeft,"px"),ee.style.top="".concat(Xt.offsetTop,"px"),ee.style.position=yt,ee.style.height="".concat(Xt.offsetHeight,"px"),ee.style.width="".concat(Xt.offsetWidth,"px"),Xt.style.left="0",Xt.style.top="0",Xt.style.right="auto",Xt.style.bottom="auto",Xt.style.overflow="hidden";var de;if(Array.isArray(Ue))de={x:Ue[0],y:Ue[1],width:0,height:0};else{var Re,Ge,Z=Ue.getBoundingClientRect();Z.x=(Re=Z.x)!==null&&Re!==void 0?Re:Z.left,Z.y=(Ge=Z.y)!==null&&Ge!==void 0?Ge:Z.top,de={x:Z.x,y:Z.y,width:Z.width,height:Z.height}}var Nt=Xt.getBoundingClientRect(),Ae=C.getComputedStyle(Xt),sr=Ae.height,Sr=Ae.width;Nt.x=(Gt=Nt.x)!==null&&Gt!==void 0?Gt:Nt.left,Nt.y=(Lr=Nt.y)!==null&&Lr!==void 0?Lr:Nt.top;var mi=Ar.documentElement,Hi=mi.clientWidth,Ai=mi.clientHeight,zr=mi.scrollWidth,Ji=mi.scrollHeight,Cn=mi.scrollTop,Di=mi.scrollLeft,Ii=Nt.height,ar=Nt.width,Wr=de.height,pe=de.width,we={left:0,top:0,right:Hi,bottom:Ai},kt={left:-Di,top:-Cn,right:zr-Di,bottom:Ji-Cn},Ot=qe.htmlRegion,Yt="visible",rr="visibleFirst";Ot!=="scroll"&&Ot!==rr&&(Ot=Yt);var ir=Ot===rr,or=se(kt,nr),dr=se(we,nr),Nr=Ot===Yt?dr:or,qr=ir?dr:Nr;Xt.style.left="auto",Xt.style.top="auto",Xt.style.right="0",Xt.style.bottom="0";var xi=Xt.getBoundingClientRect();Xt.style.left=X,Xt.style.top=ue,Xt.style.right=br,Xt.style.bottom=Ne,Xt.style.overflow=Fe,(wr=Xt.parentElement)===null||wr===void 0||wr.removeChild(ee);var Qr=D(Math.round(ar/parseFloat(Sr)*1e3)/1e3),Mi=D(Math.round(Ii/parseFloat(sr)*1e3)/1e3);if(Qr===0||Mi===0||(0,z.Sh)(Ue)&&!(0,ye.Z)(Ue))return;var Qi=qe.offset,wi=qe.targetOffset,$i=at(Nt,Qi),je=(0,Pe.Z)($i,2),tt=je[0],At=je[1],dt=at(de,wi),pt=(0,Pe.Z)(dt,2),Tt=pt[0],Ut=pt[1];de.x-=Tt,de.y-=Ut;var Jt=qe.points||[],Er=(0,Pe.Z)(Jt,2),kr=Er[0],Or=Er[1],vr=Et(Or),cr=Et(kr),Tr=bt(de,vr),gi=bt(Nt,cr),ci=(0,U.Z)({},qe),hr=Tr.x-gi.x+tt,Zr=Tr.y-gi.y+At,Si=dn(hr,Zr),ti=dn(hr,Zr,dr),Vr=bt(de,["t","l"]),Ti=bt(Nt,["t","l"]),Ur=bt(de,["b","r"]),ri=bt(Nt,["b","r"]),Ri=qe.overflow||{},st=Ri.adjustX,Ir=Ri.adjustY,hi=Ri.shiftX,Oi=Ri.shiftY,ln=function(Ln){return typeof Ln=="boolean"?Ln:Ln>=0},tn,zi,$r,jr;Sn();var qi=ln(Ir),Ki=cr[0]===vr[0];if(qi&&cr[0]==="t"&&(zi>qr.bottom||Pt.current.bt)){var Bi=Zr;Ki?Bi-=Ii-Wr:Bi=Vr.y-ri.y-At;var bs=dn(hr,Bi),Wn=dn(hr,Bi,dr);bs>Si||bs===Si&&(!ir||Wn>=ti)?(Pt.current.bt=!0,Zr=Bi,At=-At,ci.points=[He(cr,0),He(vr,0)]):Pt.current.bt=!1}if(qi&&cr[0]==="b"&&(tn<qr.top||Pt.current.tb)){var un=Zr;Ki?un+=Ii-Wr:un=Ur.y-Ti.y-At;var Rr=dn(hr,un),Ci=dn(hr,un,dr);Rr>Si||Rr===Si&&(!ir||Ci>=ti)?(Pt.current.tb=!0,Zr=un,At=-At,ci.points=[He(cr,0),He(vr,0)]):Pt.current.tb=!1}var Gi=ln(st),On=cr[1]===vr[1];if(Gi&&cr[1]==="l"&&(jr>qr.right||Pt.current.rl)){var ss=hr;On?ss-=ar-pe:ss=Vr.x-ri.x-tt;var xn=dn(ss,Zr),Dn=dn(ss,Zr,dr);xn>Si||xn===Si&&(!ir||Dn>=ti)?(Pt.current.rl=!0,hr=ss,tt=-tt,ci.points=[He(cr,1),He(vr,1)]):Pt.current.rl=!1}if(Gi&&cr[1]==="r"&&($r<qr.left||Pt.current.lr)){var vn=hr;On?vn+=ar-pe:vn=Ur.x-Ti.x-tt;var Fi=dn(vn,Zr),ds=dn(vn,Zr,dr);Fi>Si||Fi===Si&&(!ir||ds>=ti)?(Pt.current.lr=!0,hr=vn,tt=-tt,ci.points=[He(cr,1),He(vr,1)]):Pt.current.lr=!1}Sn();var cn=hi===!0?0:hi;typeof cn=="number"&&($r<dr.left&&(hr-=$r-dr.left-tt,de.x+pe<dr.left+cn&&(hr+=de.x-dr.left+pe-cn)),jr>dr.right&&(hr-=jr-dr.right-tt,de.x>dr.right-cn&&(hr+=de.x-dr.right+cn)));var es=Oi===!0?0:Oi;typeof es=="number"&&(tn<dr.top&&(Zr-=tn-dr.top-At,de.y+Wr<dr.top+es&&(Zr+=de.y-dr.top+Wr-es)),zi>dr.bottom&&(Zr-=zi-dr.bottom-At,de.y>dr.bottom-es&&(Zr+=de.y-dr.bottom+es)));var ts=Nt.x+hr,wn=ts+ar,Ei=Nt.y+Zr,as=Ei+Ii,rs=de.x,os=rs+pe,zn=de.y,di=zn+Wr,Ts=Math.max(ts,rs),tr=Math.min(wn,os),hn=(Ts+tr)/2,Ps=hn-ts,ls=Math.max(Ei,zn),Mn=Math.min(as,di),us=(ls+Mn)/2,oi=us-Ei;fe==null||fe(ct,ci);var Kn=xi.right-Nt.x-(hr+Nt.width),fs=xi.bottom-Nt.y-(Zr+Nt.height);Qr===1&&(hr=Math.floor(hr),Kn=Math.floor(Kn)),Mi===1&&(Zr=Math.floor(Zr),fs=Math.floor(fs));var jn={ready:!0,offsetX:hr/Qr,offsetY:Zr/Mi,offsetR:Kn/Qr,offsetB:fs/Mi,arrowX:Ps/Qr,arrowY:oi/Mi,scaleX:Qr,scaleY:Mi,align:ci};_t(jn)}}),gr=function(){Ft.current+=1;var Gt=Ft.current;Promise.resolve().then(function(){Ft.current===Gt&&Bt()})},Kt=function(){_t(function(Gt){return(0,U.Z)((0,U.Z)({},Gt),{},{ready:!1})})};return(0,M.Z)(Kt,[wt]),(0,M.Z)(function(){et||Kt()},[et]),[ut.ready,ut.offsetX,ut.offsetY,ut.offsetR,ut.offsetB,ut.arrowX,ut.arrowY,ut.scaleX,ut.scaleY,ut.align,gr]}var gt=Y(77654);function Qe(et,ct,Ue,wt,Rt){(0,M.Z)(function(){if(et&&ct&&Ue){let Ft=function(){wt(),Rt()};var Dt=ct,fe=Ue,ze=be(Dt),it=be(fe),ut=Ee(fe),_t=new Set([ut].concat((0,gt.Z)(ze),(0,gt.Z)(it)));return _t.forEach(function(nr){nr.addEventListener("scroll",Ft,{passive:!0})}),ut.addEventListener("resize",Ft,{passive:!0}),wt(),function(){_t.forEach(function(nr){nr.removeEventListener("scroll",Ft),ut.removeEventListener("resize",Ft)})}}},[et,ct,Ue])}var xr=Y(48736);function mr(et,ct,Ue,wt,Rt,Dt,fe,ze){var it=O.useRef(et);it.current=et;var ut=O.useRef(!1);O.useEffect(function(){if(ct&&wt&&(!Rt||Dt)){var Ft=function(){ut.current=!1},nr=function(Lr){var wr;it.current&&!fe(((wr=Lr.composedPath)===null||wr===void 0||(wr=wr.call(Lr))===null||wr===void 0?void 0:wr[0])||Lr.target)&&!ut.current&&ze(!1)},Pt=Ee(wt);Pt.addEventListener("pointerdown",Ft,!0),Pt.addEventListener("mousedown",nr,!0),Pt.addEventListener("contextmenu",nr,!0);var Ve=(0,d.A)(Ue);if(Ve&&(Ve.addEventListener("mousedown",nr,!0),Ve.addEventListener("contextmenu",nr,!0)),0)var Bt,gr,Kt,qt;return function(){Pt.removeEventListener("pointerdown",Ft,!0),Pt.removeEventListener("mousedown",nr,!0),Pt.removeEventListener("contextmenu",nr,!0),Ve&&(Ve.removeEventListener("mousedown",nr,!0),Ve.removeEventListener("contextmenu",nr,!0))}}},[ct,Ue,wt,Rt,Dt]);function _t(){ut.current=!0}return _t}var pi=["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 Wt(){var et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Me.Z,ct=O.forwardRef(function(Ue,wt){var Rt=Ue.prefixCls,Dt=Rt===void 0?"rc-trigger-popup":Rt,fe=Ue.children,ze=Ue.action,it=ze===void 0?"hover":ze,ut=Ue.showAction,_t=Ue.hideAction,Ft=Ue.popupVisible,nr=Ue.defaultPopupVisible,Pt=Ue.onPopupVisibleChange,Ve=Ue.afterPopupVisibleChange,Bt=Ue.mouseEnterDelay,gr=Ue.mouseLeaveDelay,Kt=gr===void 0?.1:gr,qt=Ue.focusDelay,Gt=Ue.blurDelay,Lr=Ue.mask,wr=Ue.maskClosable,Xt=wr===void 0?!0:wr,Ar=Ue.getPopupContainer,C=Ue.forceRender,N=Ue.autoDestroy,yt=Ue.destroyPopupOnHide,X=Ue.popup,ue=Ue.popupClassName,br=Ue.popupStyle,Ne=Ue.popupPlacement,Fe=Ue.builtinPlacements,qe=Fe===void 0?{}:Fe,ee=Ue.popupAlign,de=Ue.zIndex,Re=Ue.stretch,Ge=Ue.getPopupClassNameFromAlign,Z=Ue.fresh,Nt=Ue.alignPoint,Ae=Ue.onPopupClick,sr=Ue.onPopupAlign,Sr=Ue.arrow,mi=Ue.popupMotion,Hi=Ue.maskMotion,Ai=Ue.popupTransitionName,zr=Ue.popupAnimation,Ji=Ue.maskTransitionName,Cn=Ue.maskAnimation,Di=Ue.className,Ii=Ue.getTriggerDOMNode,ar=(0,We.Z)(Ue,pi),Wr=N||yt||!1,pe=O.useState(!1),we=(0,Pe.Z)(pe,2),kt=we[0],Ot=we[1];(0,M.Z)(function(){Ot((0,L.Z)())},[]);var Yt=O.useRef({}),rr=O.useContext(lt),ir=O.useMemo(function(){return{registerSubPopup:function(fi,Zi){Yt.current[fi]=Zi,rr==null||rr.registerSubPopup(fi,Zi)}}},[rr]),or=(0,q.Z)(),dr=O.useState(null),Nr=(0,Pe.Z)(dr,2),qr=Nr[0],xi=Nr[1],Qr=O.useRef(null),Mi=(0,ne.Z)(function(Kr){Qr.current=Kr,(0,z.Sh)(Kr)&&qr!==Kr&&xi(Kr),rr==null||rr.registerSubPopup(or,Kr)}),Qi=O.useState(null),wi=(0,Pe.Z)(Qi,2),$i=wi[0],je=wi[1],tt=O.useRef(null),At=(0,ne.Z)(function(Kr){(0,z.Sh)(Kr)&&$i!==Kr&&(je(Kr),tt.current=Kr)}),dt=O.Children.only(fe),pt=(dt==null?void 0:dt.props)||{},Tt={},Ut=(0,ne.Z)(function(Kr){var fi,Zi,yi=$i;return(yi==null?void 0:yi.contains(Kr))||((fi=(0,d.A)(yi))===null||fi===void 0?void 0:fi.host)===Kr||Kr===yi||(qr==null?void 0:qr.contains(Kr))||((Zi=(0,d.A)(qr))===null||Zi===void 0?void 0:Zi.host)===Kr||Kr===qr||Object.values(Yt.current).some(function(_i){return(_i==null?void 0:_i.contains(Kr))||Kr===_i})}),Jt=ge(Dt,mi,zr,Ai),Er=ge(Dt,Hi,Cn,Ji),kr=O.useState(nr||!1),Or=(0,Pe.Z)(kr,2),vr=Or[0],cr=Or[1],Tr=Ft!=null?Ft:vr,gi=(0,ne.Z)(function(Kr){Ft===void 0&&cr(Kr)});(0,M.Z)(function(){cr(Ft||!1)},[Ft]);var ci=O.useRef(Tr);ci.current=Tr;var hr=O.useRef([]);hr.current=[];var Zr=(0,ne.Z)(function(Kr){var fi;gi(Kr),((fi=hr.current[hr.current.length-1])!==null&&fi!==void 0?fi:Tr)!==Kr&&(hr.current.push(Kr),Pt==null||Pt(Kr))}),Si=O.useRef(),ti=function(){clearTimeout(Si.current)},Vr=function(fi){var Zi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ti(),Zi===0?Zr(fi):Si.current=setTimeout(function(){Zr(fi)},Zi*1e3)};O.useEffect(function(){return ti},[]);var Ti=O.useState(!1),Ur=(0,Pe.Z)(Ti,2),ri=Ur[0],Ri=Ur[1];(0,M.Z)(function(Kr){(!Kr||Tr)&&Ri(!0)},[Tr]);var st=O.useState(null),Ir=(0,Pe.Z)(st,2),hi=Ir[0],Oi=Ir[1],ln=O.useState(null),tn=(0,Pe.Z)(ln,2),zi=tn[0],$r=tn[1],jr=function(fi){$r([fi.clientX,fi.clientY])},qi=Ht(Tr,qr,Nt&&zi!==null?zi:$i,Ne,qe,ee,sr),Ki=(0,Pe.Z)(qi,11),Bi=Ki[0],bs=Ki[1],Wn=Ki[2],un=Ki[3],Rr=Ki[4],Ci=Ki[5],Gi=Ki[6],On=Ki[7],ss=Ki[8],xn=Ki[9],Dn=Ki[10],vn=$t(kt,it,ut,_t),Fi=(0,Pe.Z)(vn,2),ds=Fi[0],cn=Fi[1],es=ds.has("click"),ts=cn.has("click")||cn.has("contextMenu"),wn=(0,ne.Z)(function(){ri||Dn()}),Ei=function(){ci.current&&Nt&&ts&&Vr(!1)};Qe(Tr,$i,qr,wn,Ei),(0,M.Z)(function(){wn()},[zi,Ne]),(0,M.Z)(function(){Tr&&!(qe!=null&&qe[Ne])&&wn()},[JSON.stringify(ee)]);var as=O.useMemo(function(){var Kr=me(qe,Dt,xn,Nt);return E()(Kr,Ge==null?void 0:Ge(xn))},[xn,Ge,qe,Dt,Nt]);O.useImperativeHandle(wt,function(){return{nativeElement:tt.current,popupElement:Qr.current,forceAlign:wn}});var rs=O.useState(0),os=(0,Pe.Z)(rs,2),zn=os[0],di=os[1],Ts=O.useState(0),tr=(0,Pe.Z)(Ts,2),hn=tr[0],Ps=tr[1],ls=function(){if(Re&&$i){var fi=$i.getBoundingClientRect();di(fi.width),Ps(fi.height)}},Mn=function(){ls(),wn()},us=function(fi){Ri(!1),Dn(),Ve==null||Ve(fi)},oi=function(){return new Promise(function(fi){ls(),Oi(function(){return fi})})};(0,M.Z)(function(){hi&&(Dn(),hi(),Oi(null))},[hi]);function Kn(Kr,fi,Zi,yi){Tt[Kr]=function(_i){var is;yi==null||yi(_i),Vr(fi,Zi);for(var rn=arguments.length,cs=new Array(rn>1?rn-1:0),Pi=1;Pi<rn;Pi++)cs[Pi-1]=arguments[Pi];(is=pt[Kr])===null||is===void 0||is.call.apply(is,[pt,_i].concat(cs))}}(es||ts)&&(Tt.onClick=function(Kr){var fi;ci.current&&ts?Vr(!1):!ci.current&&es&&(jr(Kr),Vr(!0));for(var Zi=arguments.length,yi=new Array(Zi>1?Zi-1:0),_i=1;_i<Zi;_i++)yi[_i-1]=arguments[_i];(fi=pt.onClick)===null||fi===void 0||fi.call.apply(fi,[pt,Kr].concat(yi))});var fs=mr(Tr,ts,$i,qr,Lr,Xt,Ut,Vr),jn=ds.has("hover"),dn=cn.has("hover"),Sn,Bn;jn&&(Kn("onMouseEnter",!0,Bt,function(Kr){jr(Kr)}),Kn("onPointerEnter",!0,Bt,function(Kr){jr(Kr)}),Sn=function(fi){(Tr||ri)&&qr!==null&&qr!==void 0&&qr.contains(fi.target)&&Vr(!0,Bt)},Nt&&(Tt.onMouseMove=function(Kr){var fi;(fi=pt.onMouseMove)===null||fi===void 0||fi.call(pt,Kr)})),dn&&(Kn("onMouseLeave",!1,Kt),Kn("onPointerLeave",!1,Kt),Bn=function(){Vr(!1,Kt)}),ds.has("focus")&&Kn("onFocus",!0,qt),cn.has("focus")&&Kn("onBlur",!1,Gt),ds.has("contextMenu")&&(Tt.onContextMenu=function(Kr){var fi;ci.current&&cn.has("contextMenu")?Vr(!1):(jr(Kr),Vr(!0)),Kr.preventDefault();for(var Zi=arguments.length,yi=new Array(Zi>1?Zi-1:0),_i=1;_i<Zi;_i++)yi[_i-1]=arguments[_i];(fi=pt.onContextMenu)===null||fi===void 0||fi.call.apply(fi,[pt,Kr].concat(yi))}),Di&&(Tt.className=E()(pt.className,Di));var Ln=O.useRef(!1);Ln.current||(Ln.current=C||Tr||ri);var Cs=(0,U.Z)((0,U.Z)({},pt),Tt),Zn={},ia=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];ia.forEach(function(Kr){ar[Kr]&&(Zn[Kr]=function(){for(var fi,Zi=arguments.length,yi=new Array(Zi),_i=0;_i<Zi;_i++)yi[_i]=arguments[_i];(fi=Cs[Kr])===null||fi===void 0||fi.call.apply(fi,[Cs].concat(yi)),ar[Kr].apply(ar,yi)})});var ca=O.cloneElement(dt,(0,U.Z)((0,U.Z)({},Cs),Zn)),Gs={x:Ci,y:Gi},_s=Sr?(0,U.Z)({},Sr!==!0?Sr:{}):null;return O.createElement(O.Fragment,null,O.createElement(Te.Z,{disabled:!Tr,ref:At,onResize:Mn},O.createElement(Se,{getTriggerDOMNode:Ii},ca)),Ln.current&&O.createElement(lt.Provider,{value:ir},O.createElement(De,{portal:et,ref:Mi,prefixCls:Dt,popup:X,className:E()(ue,as),style:br,target:$i,onMouseEnter:Sn,onMouseLeave:Bn,onPointerEnter:Sn,zIndex:de,open:Tr,keepDom:ri,fresh:Z,onClick:Ae,onPointerDownCapture:fs,mask:Lr,motion:Jt,maskMotion:Er,onVisibleChanged:us,onPrepare:oi,forceRender:C,autoDestroy:Wr,getPopupContainer:Ar,align:xn,arrow:_s,arrowPos:Gs,ready:Bi,offsetX:bs,offsetY:Wn,offsetR:un,offsetB:Rr,onAlign:wn,stretch:Re,targetWidth:zn/On,targetHeight:hn/ss})))});return ct}var si=Wt(Me.Z)},46214:function(){"use strict"},29509:function(Fr,Ct,Y){"use strict";Y.d(Ct,{o2:function(){return ae},yT:function(){return E}});var U=Y(77654),Pe=Y(34998);const We=Pe.i.map(Te=>`${Te}-inverse`),Me=["success","processing","error","default","warning"];function ae(Te){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,U.Z)(We),(0,U.Z)(Pe.i)).includes(Te):Pe.i.includes(Te)}function E(Te){return Me.includes(Te)}},99402:function(Fr,Ct,Y){"use strict";Y.d(Ct,{T:function(){return Pe},n:function(){return U}});function U(We){return["small","middle","large"].includes(We)}function Pe(We){return We?typeof We=="number"&&!Number.isNaN(We):!1}},52838:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return E}});var U=Y(37645);function Pe(Te,z,d,ne){if(ne===!1)return{adjustX:!1,adjustY:!1};const q=ne&&typeof ne=="object"?ne:{},M={};switch(Te){case"top":case"bottom":M.shiftX=z.arrowOffsetHorizontal*2+d,M.shiftY=!0,M.adjustY=!0;break;case"left":case"right":M.shiftY=z.arrowOffsetVertical*2+d,M.shiftX=!0,M.adjustX=!0;break}const L=Object.assign(Object.assign({},M),q);return L.shiftX||(L.adjustX=!0),L.shiftY||(L.adjustY=!0),L}const We={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"]}},Me={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"]}},ae=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function E(Te){const{arrowWidth:z,autoAdjustOverflow:d,arrowPointAtCenter:ne,offset:q,borderRadius:M,visibleFirst:L}=Te,O=z/2,G={};return Object.keys(We).forEach(he=>{const le=ne&&Me[he]||We[he],J=Object.assign(Object.assign({},le),{offset:[0,0],dynamicInset:!0});switch(G[he]=J,ae.has(he)&&(J.autoArrow=!1),he){case"top":case"topLeft":case"topRight":J.offset[1]=-O-q;break;case"bottom":case"bottomLeft":case"bottomRight":J.offset[1]=O+q;break;case"left":case"leftTop":case"leftBottom":J.offset[0]=-O-q;break;case"right":case"rightTop":case"rightBottom":J.offset[0]=O+q;break}const B=(0,U.wZ)({contentRadius:M,limitVerticalRadius:!0});if(ne)switch(he){case"topLeft":case"bottomLeft":J.offset[0]=-B.arrowOffsetHorizontal-O;break;case"topRight":case"bottomRight":J.offset[0]=B.arrowOffsetHorizontal+O;break;case"leftTop":case"rightTop":J.offset[1]=-B.arrowOffsetHorizontal*2+O;break;case"leftBottom":case"rightBottom":J.offset[1]=B.arrowOffsetHorizontal*2-O;break}J.overflow=Pe(he,B,z,d),L&&(J.htmlRegion="visibleFirst")}),G}},82855:function(Fr,Ct,Y){"use strict";Y.d(Ct,{F:function(){return ae},Z:function(){return Me}});var U=Y(92310),Pe=Y.n(U);const We=null;function Me(E,Te,z){return Pe()({[`${E}-status-success`]:Te==="success",[`${E}-status-warning`]:Te==="warning",[`${E}-status-error`]:Te==="error",[`${E}-status-validating`]:Te==="validating",[`${E}-has-feedback`]:z})}const ae=(E,Te)=>Te||E},74632:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return We}});var U=Y(59301),Pe=Y(16089);function We(Me){const ae=U.useRef(null),E=()=>{Pe.Z.cancel(ae.current),ae.current=null};return[()=>{E(),ae.current=(0,Pe.Z)(()=>{ae.current=null})},d=>{ae.current&&(d.stopPropagation(),E()),Me==null||Me(d)}]}},24971:function(Fr,Ct,Y){"use strict";var U=Y(59301),Pe=Y(56553),We=Y(48755);const Me=function(ae,E){let Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;var z,d;const{variant:ne,[ae]:q}=U.useContext(We.E_),M=U.useContext(Pe.pg),L=q==null?void 0:q.variant;let O;typeof E!="undefined"?O=E:Te===!1?O="borderless":O=(d=(z=M!=null?M:L)!==null&&z!==void 0?z:ne)!==null&&d!==void 0?d:"outlined";const G=We.tr.includes(O);return[O,G]};Ct.Z=Me},53075:function(Fr,Ct,Y){"use strict";Y.d(Ct,{TI:function(){return V},ik:function(){return M},nz:function(){return z},s7:function(){return L},x0:function(){return q}});var U=Y(36237),Pe=Y(63356),We=Y(56119),Me=Y(16931),ae=Y(51636),E=Y(64910),Te=Y(39082);const z=H=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:H,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),d=H=>({borderColor:H.activeBorderColor,boxShadow:H.activeShadow,outline:0,backgroundColor:H.activeBg}),ne=H=>{const{paddingBlockLG:ie,lineHeightLG:De,borderRadiusLG:$e,paddingInlineLG:Se}=H;return{padding:`${(0,U.unit)(ie)} ${(0,U.unit)(Se)}`,fontSize:H.inputFontSizeLG,lineHeight:De,borderRadius:$e}},q=H=>({padding:`${(0,U.unit)(H.paddingBlockSM)} ${(0,U.unit)(H.paddingInlineSM)}`,fontSize:H.inputFontSizeSM,borderRadius:H.borderRadiusSM}),M=H=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${(0,U.unit)(H.paddingBlock)} ${(0,U.unit)(H.paddingInline)}`,color:H.colorText,fontSize:H.inputFontSize,lineHeight:H.lineHeight,borderRadius:H.borderRadius,transition:`all ${H.motionDurationMid}`},z(H.colorTextPlaceholder)),{"&-lg":Object.assign({},ne(H)),"&-sm":Object.assign({},q(H)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),L=H=>{const{componentCls:ie,antCls:De}=H;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:H.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${ie}, &-lg > ${ie}-group-addon`]:Object.assign({},ne(H)),[`&-sm ${ie}, &-sm > ${ie}-group-addon`]:Object.assign({},q(H)),[`&-lg ${De}-select-single ${De}-select-selector`]:{height:H.controlHeightLG},[`&-sm ${De}-select-single ${De}-select-selector`]:{height:H.controlHeightSM},[`> ${ie}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${ie}-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 ${(0,U.unit)(H.paddingInline)}`,color:H.colorText,fontWeight:"normal",fontSize:H.inputFontSize,textAlign:"center",borderRadius:H.borderRadius,transition:`all ${H.motionDurationSlow}`,lineHeight:1,[`${De}-select`]:{margin:`${(0,U.unit)(H.calc(H.paddingBlock).add(1).mul(-1).equal())} ${(0,U.unit)(H.calc(H.paddingInline).mul(-1).equal())}`,[`&${De}-select-single:not(${De}-select-customize-input):not(${De}-pagination-size-changer)`]:{[`${De}-select-selector`]:{backgroundColor:"inherit",border:`${(0,U.unit)(H.lineWidth)} ${H.lineType} transparent`,boxShadow:"none"}}},[`${De}-cascader-picker`]:{margin:`-9px ${(0,U.unit)(H.calc(H.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${De}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[ie]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${ie}-search-with-button &`]:{zIndex:0}}},[`> ${ie}:first-child, ${ie}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${De}-select ${De}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${ie}-affix-wrapper`]:{[`&:not(:first-child) ${ie}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${ie}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${ie}:last-child, ${ie}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${De}-select ${De}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${ie}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${ie}-search &`]:{borderStartStartRadius:H.borderRadius,borderEndStartRadius:H.borderRadius}},[`&:not(:first-child), ${ie}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${ie}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,Pe.dF)()),{[`${ie}-group-addon, ${ie}-group-wrap, > ${ie}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:H.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${ie}-affix-wrapper,
& > ${ie}-number-affix-wrapper,
& > ${De}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:H.calc(H.lineWidth).mul(-1).equal(),borderInlineEndWidth:H.lineWidth},[ie]:{float:"none"},[`& > ${De}-select > ${De}-select-selector,
& > ${De}-select-auto-complete ${ie},
& > ${De}-cascader-picker ${ie},
& > ${ie}-group-wrapper ${ie}`]:{borderInlineEndWidth:H.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${De}-select-focused`]:{zIndex:1},[`& > ${De}-select > ${De}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${De}-select:first-child > ${De}-select-selector,
& > ${De}-select-auto-complete:first-child ${ie},
& > ${De}-cascader-picker:first-child ${ie}`]:{borderStartStartRadius:H.borderRadius,borderEndStartRadius:H.borderRadius},[`& > *:last-child,
& > ${De}-select:last-child > ${De}-select-selector,
& > ${De}-cascader-picker:last-child ${ie},
& > ${De}-cascader-picker-focused:last-child ${ie}`]:{borderInlineEndWidth:H.lineWidth,borderStartEndRadius:H.borderRadius,borderEndEndRadius:H.borderRadius},[`& > ${De}-select-auto-complete ${ie}`]:{verticalAlign:"top"},[`${ie}-group-wrapper + ${ie}-group-wrapper`]:{marginInlineStart:H.calc(H.lineWidth).mul(-1).equal(),[`${ie}-affix-wrapper`]:{borderRadius:0}},[`${ie}-group-wrapper:not(:last-child)`]:{[`&${ie}-search > ${ie}-group`]:{[`& > ${ie}-group-addon > ${ie}-search-button`]:{borderRadius:0},[`& > ${ie}`]:{borderStartStartRadius:H.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:H.borderRadius}}}})}},O=H=>{const{componentCls:ie,controlHeightSM:De,lineWidth:$e,calc:Se}=H,lt=Se(De).sub(Se($e).mul(2)).sub(16).div(2).equal();return{[ie]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,Pe.Wf)(H)),M(H)),(0,Te.qG)(H)),(0,Te.H8)(H)),(0,Te.Mu)(H)),(0,Te.vc)(H)),{'&[type="color"]':{height:H.controlHeight,[`&${ie}-lg`]:{height:H.controlHeightLG},[`&${ie}-sm`]:{height:De,paddingTop:lt,paddingBottom:lt}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}})}},G=H=>{const{componentCls:ie}=H;return{[`${ie}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:H.colorTextQuaternary,fontSize:H.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${H.motionDurationSlow}`,border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:H.colorTextTertiary},"&:active":{color:H.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${(0,U.unit)(H.inputAffixPadding)}`}}}},he=H=>{const{componentCls:ie,inputAffixPadding:De,colorTextDescription:$e,motionDurationSlow:Se,colorIcon:Ye,colorIconHover:lt,iconCls:Xe}=H,$t=`${ie}-affix-wrapper`,ye=`${ie}-affix-wrapper-disabled`;return{[$t]:Object.assign(Object.assign(Object.assign(Object.assign({},M(H)),{display:"inline-flex",[`&:not(${ie}-disabled):hover`]:{zIndex:1,[`${ie}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${ie}`]:{padding:0},[`> input${ie}, > textarea${ie}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[ie]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:H.paddingXS}},"&-show-count-suffix":{color:$e},"&-show-count-has-suffix":{marginInlineEnd:H.paddingXXS},"&-prefix":{marginInlineEnd:De},"&-suffix":{marginInlineStart:De}}}),G(H)),{[`${Xe}${ie}-password-icon`]:{color:Ye,cursor:"pointer",transition:`all ${Se}`,"&:hover":{color:lt}}}),[`${ie}-underlined`]:{borderRadius:0},[ye]:{[`${Xe}${ie}-password-icon`]:{color:Ye,cursor:"not-allowed","&:hover":{color:Ye}}}}},le=H=>{const{componentCls:ie,borderRadiusLG:De,borderRadiusSM:$e}=H;return{[`${ie}-group`]:Object.assign(Object.assign(Object.assign({},(0,Pe.Wf)(H)),L(H)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${ie}-group-addon`]:{borderRadius:De,fontSize:H.inputFontSizeLG}},"&-sm":{[`${ie}-group-addon`]:{borderRadius:$e}}},(0,Te.ir)(H)),(0,Te.S5)(H)),{[`&:not(${ie}-compact-first-item):not(${ie}-compact-last-item)${ie}-compact-item`]:{[`${ie}, ${ie}-group-addon`]:{borderRadius:0}},[`&:not(${ie}-compact-last-item)${ie}-compact-first-item`]:{[`${ie}, ${ie}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${ie}-compact-first-item)${ie}-compact-last-item`]:{[`${ie}, ${ie}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${ie}-compact-last-item)${ie}-compact-item`]:{[`${ie}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${ie}-compact-first-item)${ie}-compact-item`]:{[`${ie}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},J=H=>{const{componentCls:ie,antCls:De}=H,$e=`${ie}-search`;return{[$e]:{[ie]:{"&:hover, &:focus":{[`+ ${ie}-group-addon ${$e}-button:not(${De}-btn-primary)`]:{borderInlineStartColor:H.colorPrimaryHover}}},[`${ie}-affix-wrapper`]:{height:H.controlHeight,borderRadius:0},[`${ie}-lg`]:{lineHeight:H.calc(H.lineHeightLG).sub(2e-4).equal()},[`> ${ie}-group`]:{[`> ${ie}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${$e}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:"none"},[`${$e}-button:not(${De}-btn-primary)`]:{color:H.colorTextDescription,"&:hover":{color:H.colorPrimaryHover},"&:active":{color:H.colorPrimaryActive},[`&${De}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${$e}-button`]:{height:H.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{[`${ie}-affix-wrapper, ${$e}-button`]:{height:H.controlHeightLG}},"&-small":{[`${ie}-affix-wrapper, ${$e}-button`]:{height:H.controlHeightSM}},"&-rtl":{direction:"rtl"},[`&${ie}-compact-item`]:{[`&:not(${ie}-compact-last-item)`]:{[`${ie}-group-addon`]:{[`${ie}-search-button`]:{marginInlineEnd:H.calc(H.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${ie}-compact-first-item)`]:{[`${ie},${ie}-affix-wrapper`]:{borderRadius:0}},[`> ${ie}-group-addon ${ie}-search-button,
> ${ie},
${ie}-affix-wrapper`]:{"&:hover, &:focus, &:active":{zIndex:2}},[`> ${ie}-affix-wrapper-focused`]:{zIndex:2}}}}},B=H=>{const{componentCls:ie}=H;return{[`${ie}-out-of-range`]:{[`&, & input, & textarea, ${ie}-show-count-suffix, ${ie}-data-count`]:{color:H.colorError}}}},V=(0,Me.I$)(["Input","Shared"],H=>{const ie=(0,ae.mergeToken)(H,(0,E.e)(H));return[O(ie),he(ie)]},E.T,{resetFont:!1});Ct.ZP=(0,Me.I$)(["Input","Component"],H=>{const ie=(0,ae.mergeToken)(H,(0,E.e)(H));return[le(ie),J(ie),B(ie),(0,We.c)(ie)]},E.T,{resetFont:!1})},64910:function(Fr,Ct,Y){"use strict";Y.d(Ct,{T:function(){return We},e:function(){return Pe}});var U=Y(51636);function Pe(Me){return(0,U.mergeToken)(Me,{inputAffixPadding:Me.paddingXXS})}const We=Me=>{const{controlHeight:ae,fontSize:E,lineHeight:Te,lineWidth:z,controlHeightSM:d,controlHeightLG:ne,fontSizeLG:q,lineHeightLG:M,paddingSM:L,controlPaddingHorizontalSM:O,controlPaddingHorizontal:G,colorFillAlter:he,colorPrimaryHover:le,colorPrimary:J,controlOutlineWidth:B,controlOutline:V,colorErrorOutline:H,colorWarningOutline:ie,colorBgContainer:De,inputFontSize:$e,inputFontSizeLG:Se,inputFontSizeSM:Ye}=Me,lt=$e||E,Xe=Ye||lt,$t=Se||q,ye=Math.round((ae-lt*Te)/2*10)/10-z,oe=Math.round((d-Xe*Te)/2*10)/10-z,me=Math.ceil((ne-$t*M)/2*10)/10-z;return{paddingBlock:Math.max(ye,0),paddingBlockSM:Math.max(oe,0),paddingBlockLG:Math.max(me,0),paddingInline:L-z,paddingInlineSM:O-z,paddingInlineLG:G-z,addonBg:he,activeBorderColor:J,hoverBorderColor:le,activeShadow:`0 0 0 ${B}px ${V}`,errorActiveShadow:`0 0 0 ${B}px ${H}`,warningActiveShadow:`0 0 0 ${B}px ${ie}`,hoverBg:De,activeBg:De,inputFontSize:lt,inputFontSizeLG:$t,inputFontSizeSM:Xe}}},39082:function(Fr,Ct,Y){"use strict";Y.d(Ct,{$U:function(){return ae},H8:function(){return L},Mu:function(){return ne},S5:function(){return G},Xy:function(){return Me},ir:function(){return d},qG:function(){return Te},vc:function(){return J}});var U=Y(36237),Pe=Y(51636);const We=B=>({borderColor:B.hoverBorderColor,backgroundColor:B.hoverBg}),Me=B=>({color:B.colorTextDisabled,backgroundColor:B.colorBgContainerDisabled,borderColor:B.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},We((0,Pe.mergeToken)(B,{hoverBorderColor:B.colorBorder,hoverBg:B.colorBgContainerDisabled})))}),ae=(B,V)=>({background:B.colorBgContainer,borderWidth:B.lineWidth,borderStyle:B.lineType,borderColor:V.borderColor,"&:hover":{borderColor:V.hoverBorderColor,backgroundColor:B.hoverBg},"&:focus, &:focus-within":{borderColor:V.activeBorderColor,boxShadow:V.activeShadow,outline:0,backgroundColor:B.activeBg}}),E=(B,V)=>({[`&${B.componentCls}-status-${V.status}:not(${B.componentCls}-disabled)`]:Object.assign(Object.assign({},ae(B,V)),{[`${B.componentCls}-prefix, ${B.componentCls}-suffix`]:{color:V.affixColor}}),[`&${B.componentCls}-status-${V.status}${B.componentCls}-disabled`]:{borderColor:V.borderColor}}),Te=(B,V)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ae(B,{borderColor:B.colorBorder,hoverBorderColor:B.hoverBorderColor,activeBorderColor:B.activeBorderColor,activeShadow:B.activeShadow})),{[`&${B.componentCls}-disabled, &[disabled]`]:Object.assign({},Me(B))}),E(B,{status:"error",borderColor:B.colorError,hoverBorderColor:B.colorErrorBorderHover,activeBorderColor:B.colorError,activeShadow:B.errorActiveShadow,affixColor:B.colorError})),E(B,{status:"warning",borderColor:B.colorWarning,hoverBorderColor:B.colorWarningBorderHover,activeBorderColor:B.colorWarning,activeShadow:B.warningActiveShadow,affixColor:B.colorWarning})),V)}),z=(B,V)=>({[`&${B.componentCls}-group-wrapper-status-${V.status}`]:{[`${B.componentCls}-group-addon`]:{borderColor:V.addonBorderColor,color:V.addonColor}}}),d=B=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${B.componentCls}-group`]:{"&-addon":{background:B.addonBg,border:`${(0,U.unit)(B.lineWidth)} ${B.lineType} ${B.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},z(B,{status:"error",addonBorderColor:B.colorError,addonColor:B.colorErrorText})),z(B,{status:"warning",addonBorderColor:B.colorWarning,addonColor:B.colorWarningText})),{[`&${B.componentCls}-group-wrapper-disabled`]:{[`${B.componentCls}-group-addon`]:Object.assign({},Me(B))}})}),ne=(B,V)=>{const{componentCls:H}=B;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${H}-disabled, &[disabled]`]:{color:B.colorTextDisabled,cursor:"not-allowed"},[`&${H}-status-error`]:{"&, & input, & textarea":{color:B.colorError}},[`&${H}-status-warning`]:{"&, & input, & textarea":{color:B.colorWarning}}},V)}},q=(B,V)=>{var H;return{background:V.bg,borderWidth:B.lineWidth,borderStyle:B.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:(H=V==null?void 0:V.inputColor)!==null&&H!==void 0?H:"unset"},"&:hover":{background:V.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:V.activeBorderColor,backgroundColor:B.activeBg}}},M=(B,V)=>({[`&${B.componentCls}-status-${V.status}:not(${B.componentCls}-disabled)`]:Object.assign(Object.assign({},q(B,V)),{[`${B.componentCls}-prefix, ${B.componentCls}-suffix`]:{color:V.affixColor}})}),L=(B,V)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},q(B,{bg:B.colorFillTertiary,hoverBg:B.colorFillSecondary,activeBorderColor:B.activeBorderColor})),{[`&${B.componentCls}-disabled, &[disabled]`]:Object.assign({},Me(B))}),M(B,{status:"error",bg:B.colorErrorBg,hoverBg:B.colorErrorBgHover,activeBorderColor:B.colorError,inputColor:B.colorErrorText,affixColor:B.colorError})),M(B,{status:"warning",bg:B.colorWarningBg,hoverBg:B.colorWarningBgHover,activeBorderColor:B.colorWarning,inputColor:B.colorWarningText,affixColor:B.colorWarning})),V)}),O=(B,V)=>({[`&${B.componentCls}-group-wrapper-status-${V.status}`]:{[`${B.componentCls}-group-addon`]:{background:V.addonBg,color:V.addonColor}}}),G=B=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${B.componentCls}-group`]:{"&-addon":{background:B.colorFillTertiary},[`${B.componentCls}-filled:not(:focus):not(:focus-within)`]:{"&:not(:first-child)":{borderInlineStart:`${(0,U.unit)(B.lineWidth)} ${B.lineType} ${B.colorSplit}`},"&:not(:last-child)":{borderInlineEnd:`${(0,U.unit)(B.lineWidth)} ${B.lineType} ${B.colorSplit}`}}}},O(B,{status:"error",addonBg:B.colorErrorBg,addonColor:B.colorErrorText})),O(B,{status:"warning",addonBg:B.colorWarningBg,addonColor:B.colorWarningText})),{[`&${B.componentCls}-group-wrapper-disabled`]:{[`${B.componentCls}-group`]:{"&-addon":{background:B.colorFillTertiary,color:B.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${(0,U.unit)(B.lineWidth)} ${B.lineType} ${B.colorBorder}`,borderTop:`${(0,U.unit)(B.lineWidth)} ${B.lineType} ${B.colorBorder}`,borderBottom:`${(0,U.unit)(B.lineWidth)} ${B.lineType} ${B.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${(0,U.unit)(B.lineWidth)} ${B.lineType} ${B.colorBorder}`,borderTop:`${(0,U.unit)(B.lineWidth)} ${B.lineType} ${B.colorBorder}`,borderBottom:`${(0,U.unit)(B.lineWidth)} ${B.lineType} ${B.colorBorder}`}}}})}),he=(B,V)=>({background:B.colorBgContainer,borderWidth:`${(0,U.unit)(B.lineWidth)} 0`,borderStyle:`${B.lineType} none`,borderColor:`transparent transparent ${V.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${V.borderColor} transparent`,backgroundColor:B.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${V.borderColor} transparent`,outline:0,backgroundColor:B.activeBg}}),le=(B,V)=>({[`&${B.componentCls}-status-${V.status}:not(${B.componentCls}-disabled)`]:Object.assign(Object.assign({},he(B,V)),{[`${B.componentCls}-prefix, ${B.componentCls}-suffix`]:{color:V.affixColor}}),[`&${B.componentCls}-status-${V.status}${B.componentCls}-disabled`]:{borderColor:`transparent transparent ${V.borderColor} transparent`}}),J=(B,V)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},he(B,{borderColor:B.colorBorder,hoverBorderColor:B.hoverBorderColor,activeBorderColor:B.activeBorderColor,activeShadow:B.activeShadow})),{[`&${B.componentCls}-disabled, &[disabled]`]:{color:B.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${B.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),le(B,{status:"error",borderColor:B.colorError,hoverBorderColor:B.colorErrorBorderHover,activeBorderColor:B.colorError,activeShadow:B.errorActiveShadow,affixColor:B.colorError})),le(B,{status:"warning",borderColor:B.colorWarning,hoverBorderColor:B.colorWarningBorderHover,activeBorderColor:B.colorWarning,activeShadow:B.warningActiveShadow,affixColor:B.colorWarning})),V)})},47889:function(Fr,Ct,Y){"use strict";Y.d(Ct,{ZP:function(){return Et}});var U=Y(59301),Pe=Y(92310),We=Y.n(Pe),Me=Y(18929),ae=Y(26112),E=Y(48755),Te=Y(83397),z=Y(31756);const d=U.createContext(null),ne=d.Provider;var q=d;const M=U.createContext(null),L=M.Provider;var O=Y(16632),G=Y(8654),he=Y(12919),le=Y(63872),J=Y(74632),B=Y(2171),V=Y(56553),H=Y(36237),ie=Y(63356),De=Y(16931),$e=Y(51636);const Se=bt=>{const{componentCls:He,antCls:Ht}=bt,gt=`${He}-group`;return{[gt]:Object.assign(Object.assign({},(0,ie.Wf)(bt)),{display:"inline-block",fontSize:0,[`&${gt}-rtl`]:{direction:"rtl"},[`&${gt}-block`]:{display:"flex"},[`${Ht}-badge ${Ht}-badge-count`]:{zIndex:1},[`> ${Ht}-badge:not(:first-child) > ${Ht}-button-wrapper`]:{borderInlineStart:"none"}})}},Ye=bt=>{const{componentCls:He,wrapperMarginInlineEnd:Ht,colorPrimary:gt,radioSize:Qe,motionDurationSlow:xr,motionDurationMid:mr,motionEaseInOutCirc:pi,colorBgContainer:Wt,colorBorder:si,lineWidth:et,colorBgContainerDisabled:ct,colorTextDisabled:Ue,paddingXS:wt,dotColorDisabled:Rt,lineType:Dt,radioColor:fe,radioBgColor:ze,calc:it}=bt,ut=`${He}-inner`,Ft=it(Qe).sub(it(4).mul(2)),nr=it(1).mul(Qe).equal({unit:!0});return{[`${He}-wrapper`]:Object.assign(Object.assign({},(0,ie.Wf)(bt)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:Ht,cursor:"pointer","&:last-child":{marginInlineEnd:0},[`&${He}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:bt.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},"&-block":{flex:1,justifyContent:"center"},[`${He}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${(0,H.unit)(et)} ${Dt} ${gt}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[He]:Object.assign(Object.assign({},(0,ie.Wf)(bt)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${He}-wrapper:hover &,
&:hover ${ut}`]:{borderColor:gt},[`${He}-input:focus-visible + ${ut}`]:Object.assign({},(0,ie.oN)(bt)),[`${He}:hover::after, ${He}-wrapper:hover &::after`]:{visibility:"visible"},[`${He}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:nr,height:nr,marginBlockStart:it(1).mul(Qe).div(-2).equal({unit:!0}),marginInlineStart:it(1).mul(Qe).div(-2).equal({unit:!0}),backgroundColor:fe,borderBlockStart:0,borderInlineStart:0,borderRadius:nr,transform:"scale(0)",opacity:0,transition:`all ${xr} ${pi}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:nr,height:nr,backgroundColor:Wt,borderColor:si,borderStyle:"solid",borderWidth:et,borderRadius:"50%",transition:`all ${mr}`},[`${He}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${He}-checked`]:{[ut]:{borderColor:gt,backgroundColor:ze,"&::after":{transform:`scale(${bt.calc(bt.dotSize).div(Qe).equal()})`,opacity:1,transition:`all ${xr} ${pi}`}}},[`${He}-disabled`]:{cursor:"not-allowed",[ut]:{backgroundColor:ct,borderColor:si,cursor:"not-allowed","&::after":{backgroundColor:Rt}},[`${He}-input`]:{cursor:"not-allowed"},[`${He}-disabled + span`]:{color:Ue,cursor:"not-allowed"},[`&${He}-checked`]:{[ut]:{"&::after":{transform:`scale(${it(Ft).div(Qe).equal()})`}}}},[`span${He} + *`]:{paddingInlineStart:wt,paddingInlineEnd:wt}})}},lt=bt=>{const{buttonColor:He,controlHeight:Ht,componentCls:gt,lineWidth:Qe,lineType:xr,colorBorder:mr,motionDurationSlow:pi,motionDurationMid:Wt,buttonPaddingInline:si,fontSize:et,buttonBg:ct,fontSizeLG:Ue,controlHeightLG:wt,controlHeightSM:Rt,paddingXS:Dt,borderRadius:fe,borderRadiusSM:ze,borderRadiusLG:it,buttonCheckedBg:ut,buttonSolidCheckedColor:_t,colorTextDisabled:Ft,colorBgContainerDisabled:nr,buttonCheckedBgDisabled:Pt,buttonCheckedColorDisabled:Ve,colorPrimary:Bt,colorPrimaryHover:gr,colorPrimaryActive:Kt,buttonSolidCheckedBg:qt,buttonSolidCheckedHoverBg:Gt,buttonSolidCheckedActiveBg:Lr,calc:wr}=bt;return{[`${gt}-button-wrapper`]:{position:"relative",display:"inline-block",height:Ht,margin:0,paddingInline:si,paddingBlock:0,color:He,fontSize:et,lineHeight:(0,H.unit)(wr(Ht).sub(wr(Qe).mul(2)).equal()),background:ct,border:`${(0,H.unit)(Qe)} ${xr} ${mr}`,borderBlockStartWidth:wr(Qe).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:Qe,cursor:"pointer",transition:[`color ${Wt}`,`background ${Wt}`,`box-shadow ${Wt}`].join(","),a:{color:He},[`> ${gt}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:wr(Qe).mul(-1).equal(),insetInlineStart:wr(Qe).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:Qe,paddingInline:0,backgroundColor:mr,transition:`background-color ${pi}`,content:'""'}},"&:first-child":{borderInlineStart:`${(0,H.unit)(Qe)} ${xr} ${mr}`,borderStartStartRadius:fe,borderEndStartRadius:fe},"&:last-child":{borderStartEndRadius:fe,borderEndEndRadius:fe},"&:first-child:last-child":{borderRadius:fe},[`${gt}-group-large &`]:{height:wt,fontSize:Ue,lineHeight:(0,H.unit)(wr(wt).sub(wr(Qe).mul(2)).equal()),"&:first-child":{borderStartStartRadius:it,borderEndStartRadius:it},"&:last-child":{borderStartEndRadius:it,borderEndEndRadius:it}},[`${gt}-group-small &`]:{height:Rt,paddingInline:wr(Dt).sub(Qe).equal(),paddingBlock:0,lineHeight:(0,H.unit)(wr(Rt).sub(wr(Qe).mul(2)).equal()),"&:first-child":{borderStartStartRadius:ze,borderEndStartRadius:ze},"&:last-child":{borderStartEndRadius:ze,borderEndEndRadius:ze}},"&:hover":{position:"relative",color:Bt},"&:has(:focus-visible)":Object.assign({},(0,ie.oN)(bt)),[`${gt}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${gt}-button-wrapper-disabled)`]:{zIndex:1,color:Bt,background:ut,borderColor:Bt,"&::before":{backgroundColor:Bt},"&:first-child":{borderColor:Bt},"&:hover":{color:gr,borderColor:gr,"&::before":{backgroundColor:gr}},"&:active":{color:Kt,borderColor:Kt,"&::before":{backgroundColor:Kt}}},[`${gt}-group-solid &-checked:not(${gt}-button-wrapper-disabled)`]:{color:_t,background:qt,borderColor:qt,"&:hover":{color:_t,background:Gt,borderColor:Gt},"&:active":{color:_t,background:Lr,borderColor:Lr}},"&-disabled":{color:Ft,backgroundColor:nr,borderColor:mr,cursor:"not-allowed","&:first-child, &:hover":{color:Ft,backgroundColor:nr,borderColor:mr}},[`&-disabled${gt}-button-wrapper-checked`]:{color:Ve,backgroundColor:Pt,borderColor:mr,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}},Xe=bt=>{const{wireframe:He,padding:Ht,marginXS:gt,lineWidth:Qe,fontSizeLG:xr,colorText:mr,colorBgContainer:pi,colorTextDisabled:Wt,controlItemBgActiveDisabled:si,colorTextLightSolid:et,colorPrimary:ct,colorPrimaryHover:Ue,colorPrimaryActive:wt,colorWhite:Rt}=bt,Dt=4,fe=xr,ze=He?fe-Dt*2:fe-(Dt+Qe)*2;return{radioSize:fe,dotSize:ze,dotColorDisabled:Wt,buttonSolidCheckedColor:et,buttonSolidCheckedBg:ct,buttonSolidCheckedHoverBg:Ue,buttonSolidCheckedActiveBg:wt,buttonBg:pi,buttonCheckedBg:pi,buttonColor:mr,buttonCheckedBgDisabled:si,buttonCheckedColorDisabled:Wt,buttonPaddingInline:Ht-Qe,wrapperMarginInlineEnd:gt,radioColor:He?ct:Rt,radioBgColor:He?pi:ct}};var $t=(0,De.I$)("Radio",bt=>{const{controlOutline:He,controlOutlineWidth:Ht}=bt,gt=`0 0 0 ${(0,H.unit)(Ht)} ${He}`,Qe=gt,xr=(0,$e.mergeToken)(bt,{radioFocusShadow:gt,radioButtonFocusShadow:Qe});return[Se(xr),Ye(xr),lt(xr)]},Xe,{unitless:{radioSize:!0,dotSize:!0}}),ye=function(bt,He){var Ht={};for(var gt in bt)Object.prototype.hasOwnProperty.call(bt,gt)&&He.indexOf(gt)<0&&(Ht[gt]=bt[gt]);if(bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Qe=0,gt=Object.getOwnPropertySymbols(bt);Qe<gt.length;Qe++)He.indexOf(gt[Qe])<0&&Object.prototype.propertyIsEnumerable.call(bt,gt[Qe])&&(Ht[gt[Qe]]=bt[gt[Qe]]);return Ht};const oe=(bt,He)=>{var Ht,gt;const Qe=U.useContext(q),xr=U.useContext(M),{getPrefixCls:mr,direction:pi,radio:Wt}=U.useContext(E.E_),si=U.useRef(null),et=(0,G.sQ)(He,si),{isFormItemInput:ct}=U.useContext(V.aM),Ue=Xt=>{var Ar,C;(Ar=bt.onChange)===null||Ar===void 0||Ar.call(bt,Xt),(C=Qe==null?void 0:Qe.onChange)===null||C===void 0||C.call(Qe,Xt)},{prefixCls:wt,className:Rt,rootClassName:Dt,children:fe,style:ze,title:it}=bt,ut=ye(bt,["prefixCls","className","rootClassName","children","style","title"]),_t=mr("radio",wt),Ft=((Qe==null?void 0:Qe.optionType)||xr)==="button",nr=Ft?`${_t}-button`:_t,Pt=(0,Te.Z)(_t),[Ve,Bt,gr]=$t(_t,Pt),Kt=Object.assign({},ut),qt=U.useContext(B.Z);Qe&&(Kt.name=Qe.name,Kt.onChange=Ue,Kt.checked=bt.value===Qe.value,Kt.disabled=(Ht=Kt.disabled)!==null&&Ht!==void 0?Ht:Qe.disabled),Kt.disabled=(gt=Kt.disabled)!==null&&gt!==void 0?gt:qt;const Gt=We()(`${nr}-wrapper`,{[`${nr}-wrapper-checked`]:Kt.checked,[`${nr}-wrapper-disabled`]:Kt.disabled,[`${nr}-wrapper-rtl`]:pi==="rtl",[`${nr}-wrapper-in-form-item`]:ct,[`${nr}-wrapper-block`]:!!(Qe!=null&&Qe.block)},Wt==null?void 0:Wt.className,Rt,Dt,Bt,gr,Pt),[Lr,wr]=(0,J.Z)(Kt.onClick);return Ve(U.createElement(he.Z,{component:"Radio",disabled:Kt.disabled},U.createElement("label",{className:Gt,style:Object.assign(Object.assign({},Wt==null?void 0:Wt.style),ze),onMouseEnter:bt.onMouseEnter,onMouseLeave:bt.onMouseLeave,title:it,onClick:Lr},U.createElement(O.Z,Object.assign({},Kt,{className:We()(Kt.className,{[le.A]:!Ft}),type:"radio",prefixCls:nr,ref:et,onClick:wr})),fe!==void 0?U.createElement("span",{className:`${nr}-label`},fe):null)))};var ge=U.forwardRef(oe),Ee=Y(80402);const be=U.forwardRef((bt,He)=>{const{getPrefixCls:Ht,direction:gt}=U.useContext(E.E_),Qe=(0,Ee.Z)(),{prefixCls:xr,className:mr,rootClassName:pi,options:Wt,buttonStyle:si="outline",disabled:et,children:ct,size:Ue,style:wt,id:Rt,optionType:Dt,name:fe=Qe,defaultValue:ze,value:it,block:ut=!1,onChange:_t,onMouseEnter:Ft,onMouseLeave:nr,onFocus:Pt,onBlur:Ve}=bt,[Bt,gr]=(0,Me.Z)(ze,{value:it}),Kt=U.useCallback(ue=>{const br=Bt,Ne=ue.target.value;"value"in bt||gr(Ne),Ne!==br&&(_t==null||_t(ue))},[Bt,gr,_t]),qt=Ht("radio",xr),Gt=`${qt}-group`,Lr=(0,Te.Z)(qt),[wr,Xt,Ar]=$t(qt,Lr);let C=ct;Wt&&Wt.length>0&&(C=Wt.map(ue=>typeof ue=="string"||typeof ue=="number"?U.createElement(ge,{key:ue.toString(),prefixCls:qt,disabled:et,value:ue,checked:Bt===ue},ue):U.createElement(ge,{key:`radio-group-value-options-${ue.value}`,prefixCls:qt,disabled:ue.disabled||et,value:ue.value,checked:Bt===ue.value,title:ue.title,style:ue.style,id:ue.id,required:ue.required},ue.label)));const N=(0,z.Z)(Ue),yt=We()(Gt,`${Gt}-${si}`,{[`${Gt}-${N}`]:N,[`${Gt}-rtl`]:gt==="rtl",[`${Gt}-block`]:ut},mr,pi,Xt,Ar,Lr),X=U.useMemo(()=>({onChange:Kt,value:Bt,disabled:et,name:fe,optionType:Dt,block:ut}),[Kt,Bt,et,fe,Dt,ut]);return wr(U.createElement("div",Object.assign({},(0,ae.Z)(bt,{aria:!0,data:!0}),{className:yt,style:wt,onMouseEnter:Ft,onMouseLeave:nr,onFocus:Pt,onBlur:Ve,id:Rt,ref:He}),U.createElement(ne,{value:X},C)))});var D=U.memo(be),R=function(bt,He){var Ht={};for(var gt in bt)Object.prototype.hasOwnProperty.call(bt,gt)&&He.indexOf(gt)<0&&(Ht[gt]=bt[gt]);if(bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Qe=0,gt=Object.getOwnPropertySymbols(bt);Qe<gt.length;Qe++)He.indexOf(gt[Qe])<0&&Object.prototype.propertyIsEnumerable.call(bt,gt[Qe])&&(Ht[gt[Qe]]=bt[gt[Qe]]);return Ht};const se=(bt,He)=>{const{getPrefixCls:Ht}=U.useContext(E.E_),{prefixCls:gt}=bt,Qe=R(bt,["prefixCls"]),xr=Ht("radio",gt);return U.createElement(L,{value:"button"},U.createElement(ge,Object.assign({prefixCls:xr},Qe,{type:"radio",ref:He})))};var Ie=U.forwardRef(se);const at=ge;at.Button=Ie,at.Group=D,at.__ANT_RADIO=!0;var Et=at},44104:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return he}});var U=Y(59301),Pe=Y(92310),We=Y.n(Pe),Me=Y(11592),ae=Y(99402),E=Y(48755),Te=Y(70045);const z=U.createContext({latestIndex:0}),d=z.Provider;var q=le=>{let{className:J,index:B,children:V,split:H,style:ie}=le;const{latestIndex:De}=U.useContext(z);return V==null?null:U.createElement(U.Fragment,null,U.createElement("div",{className:J,style:ie},V),B<De&&H&&U.createElement("span",{className:`${J}-split`},H))},M=Y(31547),L=function(le,J){var B={};for(var V in le)Object.prototype.hasOwnProperty.call(le,V)&&J.indexOf(V)<0&&(B[V]=le[V]);if(le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var H=0,V=Object.getOwnPropertySymbols(le);H<V.length;H++)J.indexOf(V[H])<0&&Object.prototype.propertyIsEnumerable.call(le,V[H])&&(B[V[H]]=le[V[H]]);return B};const G=U.forwardRef((le,J)=>{var B;const{getPrefixCls:V,direction:H,size:ie,className:De,style:$e,classNames:Se,styles:Ye}=(0,E.dj)("space"),{size:lt=ie!=null?ie:"small",align:Xe,className:$t,rootClassName:ye,children:oe,direction:me="horizontal",prefixCls:ge,split:Ee,style:be,wrap:D=!1,classNames:R,styles:se}=le,Ie=L(le,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[at,Et]=Array.isArray(lt)?lt:[lt,lt],bt=(0,ae.n)(Et),He=(0,ae.n)(at),Ht=(0,ae.T)(Et),gt=(0,ae.T)(at),Qe=(0,Me.Z)(oe,{keepEmpty:!0}),xr=Xe===void 0&&me==="horizontal"?"center":Xe,mr=V("space",ge),[pi,Wt,si]=(0,M.Z)(mr),et=We()(mr,De,Wt,`${mr}-${me}`,{[`${mr}-rtl`]:H==="rtl",[`${mr}-align-${xr}`]:xr,[`${mr}-gap-row-${Et}`]:bt,[`${mr}-gap-col-${at}`]:He},$t,ye,si),ct=We()(`${mr}-item`,(B=R==null?void 0:R.item)!==null&&B!==void 0?B:Se.item);let Ue=0;const wt=Qe.map((fe,ze)=>{var it;fe!=null&&(Ue=ze);const ut=(fe==null?void 0:fe.key)||`${ct}-${ze}`;return U.createElement(q,{className:ct,key:ut,index:ze,split:Ee,style:(it=se==null?void 0:se.item)!==null&&it!==void 0?it:Ye.item},fe)}),Rt=U.useMemo(()=>({latestIndex:Ue}),[Ue]);if(Qe.length===0)return null;const Dt={};return D&&(Dt.flexWrap="wrap"),!He&&gt&&(Dt.columnGap=at),!bt&&Ht&&(Dt.rowGap=Et),pi(U.createElement("div",Object.assign({ref:J,className:et,style:Object.assign(Object.assign(Object.assign({},Dt),$e),be)},Ie),U.createElement(d,{value:Rt},wt)))});G.Compact=Te.ZP;var he=G},93873:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Fm:function(){return M}});var U=Y(36237),Pe=Y(48746);const We=new U.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Me=new U.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),ae=new U.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),E=new U.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Te=new U.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),z=new U.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),d=new U.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ne=new U.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),q={"move-up":{inKeyframes:d,outKeyframes:ne},"move-down":{inKeyframes:We,outKeyframes:Me},"move-left":{inKeyframes:ae,outKeyframes:E},"move-right":{inKeyframes:Te,outKeyframes:z}},M=(L,O)=>{const{antCls:G}=L,he=`${G}-${O}`,{inKeyframes:le,outKeyframes:J}=q[O];return[(0,Pe.R)(he,le,J,L.motionDurationMid),{[`
${he}-enter,
${he}-appear
`]:{opacity:0,animationTimingFunction:L.motionEaseOutCirc},[`${he}-leave`]:{animationTimingFunction:L.motionEaseInOutCirc}}]}},46e3:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Qt:function(){return ae},Uw:function(){return Me},fJ:function(){return We},ly:function(){return E},oN:function(){return M}});var U=Y(36237),Pe=Y(48746);const We=new U.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),Me=new U.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),ae=new U.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),E=new U.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Te=new U.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),z=new U.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),d=new U.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),ne=new U.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),q={"slide-up":{inKeyframes:We,outKeyframes:Me},"slide-down":{inKeyframes:ae,outKeyframes:E},"slide-left":{inKeyframes:Te,outKeyframes:z},"slide-right":{inKeyframes:d,outKeyframes:ne}},M=(L,O)=>{const{antCls:G}=L,he=`${G}-${O}`,{inKeyframes:le,outKeyframes:J}=q[O];return[(0,Pe.R)(he,le,J,L.motionDurationMid),{[`
${he}-enter,
${he}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:L.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${he}-leave`]:{animationTimingFunction:L.motionEaseInQuint}}]}},37645:function(Fr,Ct,Y){"use strict";Y.d(Ct,{ZP:function(){return E},qN:function(){return We},wZ:function(){return Me}});var U=Y(36237),Pe=Y(36305);const We=8;function Me(Te){const{contentRadius:z,limitVerticalRadius:d}=Te,ne=z>12?z+2:12;return{arrowOffsetHorizontal:ne,arrowOffsetVertical:d?We:ne}}function ae(Te,z){return Te?z:{}}function E(Te,z,d){const{componentCls:ne,boxShadowPopoverArrow:q,arrowOffsetVertical:M,arrowOffsetHorizontal:L}=Te,{arrowDistance:O=0,arrowPlacement:G={left:!0,right:!0,top:!0,bottom:!0}}=d||{};return{[ne]:Object.assign(Object.assign(Object.assign(Object.assign({[`${ne}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,Pe.W)(Te,z,q)),{"&:before":{background:z}})]},ae(!!G.top,{[[`&-placement-top > ${ne}-arrow`,`&-placement-topLeft > ${ne}-arrow`,`&-placement-topRight > ${ne}-arrow`].join(",")]:{bottom:O,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${ne}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":L,[`> ${ne}-arrow`]:{left:{_skip_check_:!0,value:L}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,U.unit)(L)})`,[`> ${ne}-arrow`]:{right:{_skip_check_:!0,value:L}}}})),ae(!!G.bottom,{[[`&-placement-bottom > ${ne}-arrow`,`&-placement-bottomLeft > ${ne}-arrow`,`&-placement-bottomRight > ${ne}-arrow`].join(",")]:{top:O,transform:"translateY(-100%)"},[`&-placement-bottom > ${ne}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":L,[`> ${ne}-arrow`]:{left:{_skip_check_:!0,value:L}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,U.unit)(L)})`,[`> ${ne}-arrow`]:{right:{_skip_check_:!0,value:L}}}})),ae(!!G.left,{[[`&-placement-left > ${ne}-arrow`,`&-placement-leftTop > ${ne}-arrow`,`&-placement-leftBottom > ${ne}-arrow`].join(",")]:{right:{_skip_check_:!0,value:O},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${ne}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${ne}-arrow`]:{top:M},[`&-placement-leftBottom > ${ne}-arrow`]:{bottom:M}})),ae(!!G.right,{[[`&-placement-right > ${ne}-arrow`,`&-placement-rightTop > ${ne}-arrow`,`&-placement-rightBottom > ${ne}-arrow`].join(",")]:{left:{_skip_check_:!0,value:O},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${ne}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${ne}-arrow`]:{top:M},[`&-placement-rightBottom > ${ne}-arrow`]:{bottom:M}}))}}},36305:function(Fr,Ct,Y){"use strict";Y.d(Ct,{W:function(){return We},w:function(){return Pe}});var U=Y(36237);function Pe(Me){const{sizePopupArrow:ae,borderRadiusXS:E,borderRadiusOuter:Te}=Me,z=ae/2,d=0,ne=z,q=Te*1/Math.sqrt(2),M=z-Te*(1-1/Math.sqrt(2)),L=z-E*(1/Math.sqrt(2)),O=Te*(Math.sqrt(2)-1)+E*(1/Math.sqrt(2)),G=2*z-L,he=O,le=2*z-q,J=M,B=2*z-d,V=ne,H=z*Math.sqrt(2)+Te*(Math.sqrt(2)-2),ie=Te*(Math.sqrt(2)-1),De=`polygon(${ie}px 100%, 50% ${ie}px, ${2*z-ie}px 100%, ${ie}px 100%)`,$e=`path('M ${d} ${ne} A ${Te} ${Te} 0 0 0 ${q} ${M} L ${L} ${O} A ${E} ${E} 0 0 1 ${G} ${he} L ${le} ${J} A ${Te} ${Te} 0 0 0 ${B} ${V} Z')`;return{arrowShadowWidth:H,arrowPath:$e,arrowPolygon:De}}const We=(Me,ae,E)=>{const{sizePopupArrow:Te,arrowPolygon:z,arrowPath:d,arrowShadowWidth:ne,borderRadiusXS:q,calc:M}=Me;return{pointerEvents:"none",width:Te,height:Te,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:Te,height:M(Te).div(2).equal(),background:ae,clipPath:{_multi_value_:!0,value:[z,d]},content:'""'},"&::after":{content:'""',position:"absolute",width:ne,height:ne,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${(0,U.unit)(q)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:E,zIndex:0,background:"transparent"}}}},31691:function(Fr,Ct,Y){"use strict";Y.d(Ct,{default:function(){return Wr}});var U=Y(59301),Pe=Y(99267),We=Y(18785),Me=Y(62772),ae=Y(92310),E=Y.n(ae),Te=Y(60499),z=Y(18642),d=Y(85899),ne=Y(72190),q=Y(43749),M=Y(42244),L=Y(18929),O=Y(49658),G=(0,U.createContext)(null),he=Y(77654),le=Y(29301),J=Y(6089),B=Y(8654),V=Y(16089),H=function(we){var kt=we.activeTabOffset,Ot=we.horizontal,Yt=we.rtl,rr=we.indicator,ir=rr===void 0?{}:rr,or=ir.size,dr=ir.align,Nr=dr===void 0?"center":dr,qr=(0,U.useState)(),xi=(0,ne.Z)(qr,2),Qr=xi[0],Mi=xi[1],Qi=(0,U.useRef)(),wi=U.useCallback(function(je){return typeof or=="function"?or(je):typeof or=="number"?or:je},[or]);function $i(){V.Z.cancel(Qi.current)}return(0,U.useEffect)(function(){var je={};if(kt)if(Ot){je.width=wi(kt.width);var tt=Yt?"right":"left";Nr==="start"&&(je[tt]=kt[tt]),Nr==="center"&&(je[tt]=kt[tt]+kt.width/2,je.transform=Yt?"translateX(50%)":"translateX(-50%)"),Nr==="end"&&(je[tt]=kt[tt]+kt.width,je.transform="translateX(-100%)")}else je.height=wi(kt.height),Nr==="start"&&(je.top=kt.top),Nr==="center"&&(je.top=kt.top+kt.height/2,je.transform="translateY(-50%)"),Nr==="end"&&(je.top=kt.top+kt.height,je.transform="translateY(-100%)");return $i(),Qi.current=(0,V.Z)(function(){Mi(je)}),$i},[kt,Ot,Yt,Nr,wi]),{style:Qr}},ie=H,De={width:0,height:0,left:0,top:0};function $e(pe,we,kt){return(0,U.useMemo)(function(){for(var Ot,Yt=new Map,rr=we.get((Ot=pe[0])===null||Ot===void 0?void 0:Ot.key)||De,ir=rr.left+rr.width,or=0;or<pe.length;or+=1){var dr=pe[or].key,Nr=we.get(dr);if(!Nr){var qr;Nr=we.get((qr=pe[or-1])===null||qr===void 0?void 0:qr.key)||De}var xi=Yt.get(dr)||(0,d.Z)({},Nr);xi.right=ir-xi.left-xi.width,Yt.set(dr,xi)}return Yt},[pe.map(function(Ot){return Ot.key}).join("_"),we,kt])}function Se(pe,we){var kt=U.useRef(pe),Ot=U.useState({}),Yt=(0,ne.Z)(Ot,2),rr=Yt[1];function ir(or){var dr=typeof or=="function"?or(kt.current):or;dr!==kt.current&&we(dr,kt.current),kt.current=dr,rr({})}return[kt.current,ir]}var Ye=.1,lt=.01,Xe=20,$t=Math.pow(.995,Xe);function ye(pe,we){var kt=(0,U.useState)(),Ot=(0,ne.Z)(kt,2),Yt=Ot[0],rr=Ot[1],ir=(0,U.useState)(0),or=(0,ne.Z)(ir,2),dr=or[0],Nr=or[1],qr=(0,U.useState)(0),xi=(0,ne.Z)(qr,2),Qr=xi[0],Mi=xi[1],Qi=(0,U.useState)(),wi=(0,ne.Z)(Qi,2),$i=wi[0],je=wi[1],tt=(0,U.useRef)();function At(Er){var kr=Er.touches[0],Or=kr.screenX,vr=kr.screenY;rr({x:Or,y:vr}),window.clearInterval(tt.current)}function dt(Er){if(Yt){var kr=Er.touches[0],Or=kr.screenX,vr=kr.screenY;rr({x:Or,y:vr});var cr=Or-Yt.x,Tr=vr-Yt.y;we(cr,Tr);var gi=Date.now();Nr(gi),Mi(gi-dr),je({x:cr,y:Tr})}}function pt(){if(Yt&&(rr(null),je(null),$i)){var Er=$i.x/Qr,kr=$i.y/Qr,Or=Math.abs(Er),vr=Math.abs(kr);if(Math.max(Or,vr)<Ye)return;var cr=Er,Tr=kr;tt.current=window.setInterval(function(){if(Math.abs(cr)<lt&&Math.abs(Tr)<lt){window.clearInterval(tt.current);return}cr*=$t,Tr*=$t,we(cr*Xe,Tr*Xe)},Xe)}}var Tt=(0,U.useRef)();function Ut(Er){var kr=Er.deltaX,Or=Er.deltaY,vr=0,cr=Math.abs(kr),Tr=Math.abs(Or);cr===Tr?vr=Tt.current==="x"?kr:Or:cr>Tr?(vr=kr,Tt.current="x"):(vr=Or,Tt.current="y"),we(-vr,-vr)&&Er.preventDefault()}var Jt=(0,U.useRef)(null);Jt.current={onTouchStart:At,onTouchMove:dt,onTouchEnd:pt,onWheel:Ut},U.useEffect(function(){function Er(cr){Jt.current.onTouchStart(cr)}function kr(cr){Jt.current.onTouchMove(cr)}function Or(cr){Jt.current.onTouchEnd(cr)}function vr(cr){Jt.current.onWheel(cr)}return document.addEventListener("touchmove",kr,{passive:!1}),document.addEventListener("touchend",Or,{passive:!0}),pe.current.addEventListener("touchstart",Er,{passive:!0}),pe.current.addEventListener("wheel",vr,{passive:!1}),function(){document.removeEventListener("touchmove",kr),document.removeEventListener("touchend",Or)}},[])}var oe=Y(34280);function me(pe){var we=(0,U.useState)(0),kt=(0,ne.Z)(we,2),Ot=kt[0],Yt=kt[1],rr=(0,U.useRef)(0),ir=(0,U.useRef)();return ir.current=pe,(0,oe.o)(function(){var or;(or=ir.current)===null||or===void 0||or.call(ir)},[Ot]),function(){rr.current===Ot&&(rr.current+=1,Yt(rr.current))}}function ge(pe){var we=(0,U.useRef)([]),kt=(0,U.useState)({}),Ot=(0,ne.Z)(kt,2),Yt=Ot[1],rr=(0,U.useRef)(typeof pe=="function"?pe():pe),ir=me(function(){var dr=rr.current;we.current.forEach(function(Nr){dr=Nr(dr)}),we.current=[],rr.current=dr,Yt({})});function or(dr){we.current.push(dr),ir()}return[rr.current,or]}var Ee={width:0,height:0,left:0,top:0,right:0};function be(pe,we,kt,Ot,Yt,rr,ir){var or=ir.tabs,dr=ir.tabPosition,Nr=ir.rtl,qr,xi,Qr;return["top","bottom"].includes(dr)?(qr="width",xi=Nr?"right":"left",Qr=Math.abs(kt)):(qr="height",xi="top",Qr=-kt),(0,U.useMemo)(function(){if(!or.length)return[0,0];for(var Mi=or.length,Qi=Mi,wi=0;wi<Mi;wi+=1){var $i=pe.get(or[wi].key)||Ee;if(Math.floor($i[xi]+$i[qr])>Math.floor(Qr+we)){Qi=wi-1;break}}for(var je=0,tt=Mi-1;tt>=0;tt-=1){var At=pe.get(or[tt].key)||Ee;if(At[xi]<Qr){je=tt+1;break}}return je>=Qi?[0,0]:[je,Qi]},[pe,we,Ot,Yt,rr,Qr,dr,or.map(function(Mi){return Mi.key}).join("_"),Nr])}function D(pe){var we;return pe instanceof Map?(we={},pe.forEach(function(kt,Ot){we[Ot]=kt})):we=pe,JSON.stringify(we)}var R="TABS_DQ";function se(pe){return String(pe).replace(/"/g,R)}function Ie(pe,we,kt,Ot){return!(!kt||Ot||pe===!1||pe===void 0&&(we===!1||we===null))}var at=U.forwardRef(function(pe,we){var kt=pe.prefixCls,Ot=pe.editable,Yt=pe.locale,rr=pe.style;return!Ot||Ot.showAdd===!1?null:U.createElement("button",{ref:we,type:"button",className:"".concat(kt,"-nav-add"),style:rr,"aria-label":(Yt==null?void 0:Yt.addAriaLabel)||"Add tab",onClick:function(or){Ot.onEdit("add",{event:or})}},Ot.addIcon||"+")}),Et=at,bt=U.forwardRef(function(pe,we){var kt=pe.position,Ot=pe.prefixCls,Yt=pe.extra;if(!Yt)return null;var rr,ir={};return(0,q.Z)(Yt)==="object"&&!U.isValidElement(Yt)?ir=Yt:ir.right=Yt,kt==="right"&&(rr=ir.right),kt==="left"&&(rr=ir.left),rr?U.createElement("div",{className:"".concat(Ot,"-extra-content"),ref:we},rr):null}),He=bt,Ht=Y(96478),gt=Y(28321),Qe=Y(10228),xr=U.forwardRef(function(pe,we){var kt=pe.prefixCls,Ot=pe.id,Yt=pe.tabs,rr=pe.locale,ir=pe.mobile,or=pe.more,dr=or===void 0?{}:or,Nr=pe.style,qr=pe.className,xi=pe.editable,Qr=pe.tabBarGutter,Mi=pe.rtl,Qi=pe.removeAriaLabel,wi=pe.onTabClick,$i=pe.getPopupContainer,je=pe.popupClassName,tt=(0,U.useState)(!1),At=(0,ne.Z)(tt,2),dt=At[0],pt=At[1],Tt=(0,U.useState)(null),Ut=(0,ne.Z)(Tt,2),Jt=Ut[0],Er=Ut[1],kr=dr.icon,Or=kr===void 0?"More":kr,vr="".concat(Ot,"-more-popup"),cr="".concat(kt,"-dropdown"),Tr=Jt!==null?"".concat(vr,"-").concat(Jt):null,gi=rr==null?void 0:rr.dropdownAriaLabel;function ci(Ur,ri){Ur.preventDefault(),Ur.stopPropagation(),xi.onEdit("remove",{key:ri,event:Ur})}var hr=U.createElement(gt.ZP,{onClick:function(ri){var Ri=ri.key,st=ri.domEvent;wi(Ri,st),pt(!1)},prefixCls:"".concat(cr,"-menu"),id:vr,tabIndex:-1,role:"listbox","aria-activedescendant":Tr,selectedKeys:[Jt],"aria-label":gi!==void 0?gi:"expanded dropdown"},Yt.map(function(Ur){var ri=Ur.closable,Ri=Ur.disabled,st=Ur.closeIcon,Ir=Ur.key,hi=Ur.label,Oi=Ie(ri,st,xi,Ri);return U.createElement(gt.sN,{key:Ir,id:"".concat(vr,"-").concat(Ir),role:"option","aria-controls":Ot&&"".concat(Ot,"-panel-").concat(Ir),disabled:Ri},U.createElement("span",null,hi),Oi&&U.createElement("button",{type:"button","aria-label":Qi||"remove",tabIndex:0,className:"".concat(cr,"-menu-item-remove"),onClick:function(tn){tn.stopPropagation(),ci(tn,Ir)}},st||xi.removeIcon||"\xD7"))}));function Zr(Ur){for(var ri=Yt.filter(function(Oi){return!Oi.disabled}),Ri=ri.findIndex(function(Oi){return Oi.key===Jt})||0,st=ri.length,Ir=0;Ir<st;Ir+=1){Ri=(Ri+Ur+st)%st;var hi=ri[Ri];if(!hi.disabled){Er(hi.key);return}}}function Si(Ur){var ri=Ur.which;if(!dt){[Qe.Z.DOWN,Qe.Z.SPACE,Qe.Z.ENTER].includes(ri)&&(pt(!0),Ur.preventDefault());return}switch(ri){case Qe.Z.UP:Zr(-1),Ur.preventDefault();break;case Qe.Z.DOWN:Zr(1),Ur.preventDefault();break;case Qe.Z.ESC:pt(!1);break;case Qe.Z.SPACE:case Qe.Z.ENTER:Jt!==null&&wi(Jt,Ur);break}}(0,U.useEffect)(function(){var Ur=document.getElementById(Tr);Ur&&Ur.scrollIntoView&&Ur.scrollIntoView(!1)},[Jt]),(0,U.useEffect)(function(){dt||Er(null)},[dt]);var ti=(0,z.Z)({},Mi?"marginRight":"marginLeft",Qr);Yt.length||(ti.visibility="hidden",ti.order=1);var Vr=E()((0,z.Z)({},"".concat(cr,"-rtl"),Mi)),Ti=ir?null:U.createElement(Ht.Z,(0,Te.Z)({prefixCls:cr,overlay:hr,visible:Yt.length?dt:!1,onVisibleChange:pt,overlayClassName:E()(Vr,je),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:$i},dr),U.createElement("button",{type:"button",className:"".concat(kt,"-nav-more"),style:ti,"aria-haspopup":"listbox","aria-controls":vr,id:"".concat(Ot,"-more"),"aria-expanded":dt,onKeyDown:Si},Or));return U.createElement("div",{className:E()("".concat(kt,"-nav-operations"),qr),style:Nr,ref:we},Ti,U.createElement(Et,{prefixCls:kt,locale:rr,editable:xi}))}),mr=U.memo(xr,function(pe,we){return we.tabMoving}),pi=function(we){var kt=we.prefixCls,Ot=we.id,Yt=we.active,rr=we.focus,ir=we.tab,or=ir.key,dr=ir.label,Nr=ir.disabled,qr=ir.closeIcon,xi=ir.icon,Qr=we.closable,Mi=we.renderWrapper,Qi=we.removeAriaLabel,wi=we.editable,$i=we.onClick,je=we.onFocus,tt=we.onBlur,At=we.onKeyDown,dt=we.onMouseDown,pt=we.onMouseUp,Tt=we.style,Ut=we.tabCount,Jt=we.currentPosition,Er="".concat(kt,"-tab"),kr=Ie(Qr,qr,wi,Nr);function Or(ci){Nr||$i(ci)}function vr(ci){ci.preventDefault(),ci.stopPropagation(),wi.onEdit("remove",{key:or,event:ci})}var cr=U.useMemo(function(){return xi&&typeof dr=="string"?U.createElement("span",null,dr):dr},[dr,xi]),Tr=U.useRef(null);U.useEffect(function(){rr&&Tr.current&&Tr.current.focus()},[rr]);var gi=U.createElement("div",{key:or,"data-node-key":se(or),className:E()(Er,(0,z.Z)((0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(Er,"-with-remove"),kr),"".concat(Er,"-active"),Yt),"".concat(Er,"-disabled"),Nr),"".concat(Er,"-focus"),rr)),style:Tt,onClick:Or},U.createElement("div",{ref:Tr,role:"tab","aria-selected":Yt,id:Ot&&"".concat(Ot,"-tab-").concat(or),className:"".concat(Er,"-btn"),"aria-controls":Ot&&"".concat(Ot,"-panel-").concat(or),"aria-disabled":Nr,tabIndex:Nr?null:Yt?0:-1,onClick:function(hr){hr.stopPropagation(),Or(hr)},onKeyDown:At,onMouseDown:dt,onMouseUp:pt,onFocus:je,onBlur:tt},rr&&U.createElement("div",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"Tab ".concat(Jt," of ").concat(Ut)),xi&&U.createElement("span",{className:"".concat(Er,"-icon")},xi),dr&&cr),kr&&U.createElement("button",{type:"button",role:"tab","aria-label":Qi||"remove",tabIndex:Yt?0:-1,className:"".concat(Er,"-remove"),onClick:function(hr){hr.stopPropagation(),vr(hr)}},qr||wi.removeIcon||"\xD7"));return Mi?Mi(gi):gi},Wt=pi,si=function(we,kt){var Ot=we.offsetWidth,Yt=we.offsetHeight,rr=we.offsetTop,ir=we.offsetLeft,or=we.getBoundingClientRect(),dr=or.width,Nr=or.height,qr=or.left,xi=or.top;return Math.abs(dr-Ot)<1?[dr,Nr,qr-kt.left,xi-kt.top]:[Ot,Yt,ir,rr]},et=function(we){var kt=we.current||{},Ot=kt.offsetWidth,Yt=Ot===void 0?0:Ot,rr=kt.offsetHeight,ir=rr===void 0?0:rr;if(we.current){var or=we.current.getBoundingClientRect(),dr=or.width,Nr=or.height;if(Math.abs(dr-Yt)<1)return[dr,Nr]}return[Yt,ir]},ct=function(we,kt){return we[kt?0:1]},Ue=U.forwardRef(function(pe,we){var kt=pe.className,Ot=pe.style,Yt=pe.id,rr=pe.animated,ir=pe.activeKey,or=pe.rtl,dr=pe.extra,Nr=pe.editable,qr=pe.locale,xi=pe.tabPosition,Qr=pe.tabBarGutter,Mi=pe.children,Qi=pe.onTabClick,wi=pe.onTabScroll,$i=pe.indicator,je=U.useContext(G),tt=je.prefixCls,At=je.tabs,dt=(0,U.useRef)(null),pt=(0,U.useRef)(null),Tt=(0,U.useRef)(null),Ut=(0,U.useRef)(null),Jt=(0,U.useRef)(null),Er=(0,U.useRef)(null),kr=(0,U.useRef)(null),Or=xi==="top"||xi==="bottom",vr=Se(0,function(Pi,bi){Or&&wi&&wi({direction:Pi>bi?"left":"right"})}),cr=(0,ne.Z)(vr,2),Tr=cr[0],gi=cr[1],ci=Se(0,function(Pi,bi){!Or&&wi&&wi({direction:Pi>bi?"top":"bottom"})}),hr=(0,ne.Z)(ci,2),Zr=hr[0],Si=hr[1],ti=(0,U.useState)([0,0]),Vr=(0,ne.Z)(ti,2),Ti=Vr[0],Ur=Vr[1],ri=(0,U.useState)([0,0]),Ri=(0,ne.Z)(ri,2),st=Ri[0],Ir=Ri[1],hi=(0,U.useState)([0,0]),Oi=(0,ne.Z)(hi,2),ln=Oi[0],tn=Oi[1],zi=(0,U.useState)([0,0]),$r=(0,ne.Z)(zi,2),jr=$r[0],qi=$r[1],Ki=ge(new Map),Bi=(0,ne.Z)(Ki,2),bs=Bi[0],Wn=Bi[1],un=$e(At,bs,st[0]),Rr=ct(Ti,Or),Ci=ct(st,Or),Gi=ct(ln,Or),On=ct(jr,Or),ss=Math.floor(Rr)<Math.floor(Ci+Gi),xn=ss?Rr-On:Rr-Gi,Dn="".concat(tt,"-nav-operations-hidden"),vn=0,Fi=0;Or&&or?(vn=0,Fi=Math.max(0,Ci-xn)):(vn=Math.min(0,xn-Ci),Fi=0);function ds(Pi){return Pi<vn?vn:Pi>Fi?Fi:Pi}var cn=(0,U.useRef)(null),es=(0,U.useState)(),ts=(0,ne.Z)(es,2),wn=ts[0],Ei=ts[1];function as(){Ei(Date.now())}function rs(){cn.current&&clearTimeout(cn.current)}ye(Ut,function(Pi,bi){function yn(fn,pn){fn(function(En){var Vi=ds(En+pn);return Vi})}return ss?(Or?yn(gi,Pi):yn(Si,bi),rs(),as(),!0):!1}),(0,U.useEffect)(function(){return rs(),wn&&(cn.current=setTimeout(function(){Ei(0)},100)),rs},[wn]);var os=be(un,xn,Or?Tr:Zr,Ci,Gi,On,(0,d.Z)((0,d.Z)({},pe),{},{tabs:At})),zn=(0,ne.Z)(os,2),di=zn[0],Ts=zn[1],tr=(0,J.Z)(function(){var Pi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ir,bi=un.get(Pi)||{width:0,height:0,left:0,right:0,top:0};if(Or){var yn=Tr;or?bi.right<Tr?yn=bi.right:bi.right+bi.width>Tr+xn&&(yn=bi.right+bi.width-xn):bi.left<-Tr?yn=-bi.left:bi.left+bi.width>-Tr+xn&&(yn=-(bi.left+bi.width-xn)),Si(0),gi(ds(yn))}else{var fn=Zr;bi.top<-Zr?fn=-bi.top:bi.top+bi.height>-Zr+xn&&(fn=-(bi.top+bi.height-xn)),gi(0),Si(ds(fn))}}),hn=(0,U.useState)(),Ps=(0,ne.Z)(hn,2),ls=Ps[0],Mn=Ps[1],us=(0,U.useState)(!1),oi=(0,ne.Z)(us,2),Kn=oi[0],fs=oi[1],jn=At.filter(function(Pi){return!Pi.disabled}).map(function(Pi){return Pi.key}),dn=function(bi){var yn=jn.indexOf(ls||ir),fn=jn.length,pn=(yn+bi+fn)%fn,En=jn[pn];Mn(En)},Sn=function(bi){var yn=bi.code,fn=or&&Or,pn=jn[0],En=jn[jn.length-1];switch(yn){case"ArrowLeft":{Or&&dn(fn?1:-1);break}case"ArrowRight":{Or&&dn(fn?-1:1);break}case"ArrowUp":{bi.preventDefault(),Or||dn(-1);break}case"ArrowDown":{bi.preventDefault(),Or||dn(1);break}case"Home":{bi.preventDefault(),Mn(pn);break}case"End":{bi.preventDefault(),Mn(En);break}case"Enter":case"Space":{bi.preventDefault(),Qi(ir,bi);break}case"Backspace":case"Delete":{var Vi=jn.indexOf(ls),Yn=At.find(function(ns){return ns.key===ls}),Zs=Ie(Yn==null?void 0:Yn.closable,Yn==null?void 0:Yn.closeIcon,Nr,Yn==null?void 0:Yn.disabled);Zs&&(bi.preventDefault(),bi.stopPropagation(),Nr.onEdit("remove",{key:ls,event:bi}),Vi===jn.length-1?dn(-1):dn(1));break}}},Bn={};Or?Bn[or?"marginRight":"marginLeft"]=Qr:Bn.marginTop=Qr;var Ln=At.map(function(Pi,bi){var yn=Pi.key;return U.createElement(Wt,{id:Yt,prefixCls:tt,key:yn,tab:Pi,style:bi===0?void 0:Bn,closable:Pi.closable,editable:Nr,active:yn===ir,focus:yn===ls,renderWrapper:Mi,removeAriaLabel:qr==null?void 0:qr.removeAriaLabel,tabCount:jn.length,currentPosition:bi+1,onClick:function(pn){Qi(yn,pn)},onKeyDown:Sn,onFocus:function(){Kn||Mn(yn),tr(yn),as(),Ut.current&&(or||(Ut.current.scrollLeft=0),Ut.current.scrollTop=0)},onBlur:function(){Mn(void 0)},onMouseDown:function(){fs(!0)},onMouseUp:function(){fs(!1)}})}),Cs=function(){return Wn(function(){var bi,yn=new Map,fn=(bi=Jt.current)===null||bi===void 0?void 0:bi.getBoundingClientRect();return At.forEach(function(pn){var En,Vi=pn.key,Yn=(En=Jt.current)===null||En===void 0?void 0:En.querySelector('[data-node-key="'.concat(se(Vi),'"]'));if(Yn){var Zs=si(Yn,fn),ns=(0,ne.Z)(Zs,4),ja=ns[0],Na=ns[1],Os=ns[2],Da=ns[3];yn.set(Vi,{width:ja,height:Na,left:Os,top:Da})}}),yn})};(0,U.useEffect)(function(){Cs()},[At.map(function(Pi){return Pi.key}).join("_")]);var Zn=me(function(){var Pi=et(dt),bi=et(pt),yn=et(Tt);Ur([Pi[0]-bi[0]-yn[0],Pi[1]-bi[1]-yn[1]]);var fn=et(kr);tn(fn);var pn=et(Er);qi(pn);var En=et(Jt);Ir([En[0]-fn[0],En[1]-fn[1]]),Cs()}),ia=At.slice(0,di),ca=At.slice(Ts+1),Gs=[].concat((0,he.Z)(ia),(0,he.Z)(ca)),_s=un.get(ir),Kr=ie({activeTabOffset:_s,horizontal:Or,indicator:$i,rtl:or}),fi=Kr.style;(0,U.useEffect)(function(){tr()},[ir,vn,Fi,D(_s),D(un),Or]),(0,U.useEffect)(function(){Zn()},[or]);var Zi=!!Gs.length,yi="".concat(tt,"-nav-wrap"),_i,is,rn,cs;return Or?or?(is=Tr>0,_i=Tr!==Fi):(_i=Tr<0,is=Tr!==vn):(rn=Zr<0,cs=Zr!==vn),U.createElement(le.Z,{onResize:Zn},U.createElement("div",{ref:(0,B.x1)(we,dt),role:"tablist","aria-orientation":Or?"horizontal":"vertical",className:E()("".concat(tt,"-nav"),kt),style:Ot,onKeyDown:function(){as()}},U.createElement(He,{ref:pt,position:"left",extra:dr,prefixCls:tt}),U.createElement(le.Z,{onResize:Zn},U.createElement("div",{className:E()(yi,(0,z.Z)((0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(yi,"-ping-left"),_i),"".concat(yi,"-ping-right"),is),"".concat(yi,"-ping-top"),rn),"".concat(yi,"-ping-bottom"),cs)),ref:Ut},U.createElement(le.Z,{onResize:Zn},U.createElement("div",{ref:Jt,className:"".concat(tt,"-nav-list"),style:{transform:"translate(".concat(Tr,"px, ").concat(Zr,"px)"),transition:wn?"none":void 0}},Ln,U.createElement(Et,{ref:kr,prefixCls:tt,locale:qr,editable:Nr,style:(0,d.Z)((0,d.Z)({},Ln.length===0?void 0:Bn),{},{visibility:Zi?"hidden":null})}),U.createElement("div",{className:E()("".concat(tt,"-ink-bar"),(0,z.Z)({},"".concat(tt,"-ink-bar-animated"),rr.inkBar)),style:fi}))))),U.createElement(mr,(0,Te.Z)({},pe,{removeAriaLabel:qr==null?void 0:qr.removeAriaLabel,ref:Er,prefixCls:tt,tabs:Gs,className:!Zi&&Dn,tabMoving:!!wn})),U.createElement(He,{ref:Tt,position:"right",extra:dr,prefixCls:tt})))}),wt=Ue,Rt=U.forwardRef(function(pe,we){var kt=pe.prefixCls,Ot=pe.className,Yt=pe.style,rr=pe.id,ir=pe.active,or=pe.tabKey,dr=pe.children;return U.createElement("div",{id:rr&&"".concat(rr,"-panel-").concat(or),role:"tabpanel",tabIndex:ir?0:-1,"aria-labelledby":rr&&"".concat(rr,"-tab-").concat(or),"aria-hidden":!ir,style:Yt,className:E()(kt,ir&&"".concat(kt,"-active"),Ot),ref:we},dr)}),Dt=Rt,fe=["renderTabBar"],ze=["label","key"],it=function(we){var kt=we.renderTabBar,Ot=(0,M.Z)(we,fe),Yt=U.useContext(G),rr=Yt.tabs;if(kt){var ir=(0,d.Z)((0,d.Z)({},Ot),{},{panes:rr.map(function(or){var dr=or.label,Nr=or.key,qr=(0,M.Z)(or,ze);return U.createElement(Dt,(0,Te.Z)({tab:dr,key:Nr,tabKey:Nr},qr))})});return kt(ir,wt)}return U.createElement(wt,Ot)},ut=it,_t=Y(77900),Ft=["key","forceRender","style","className","destroyInactiveTabPane"],nr=function(we){var kt=we.id,Ot=we.activeKey,Yt=we.animated,rr=we.tabPosition,ir=we.destroyInactiveTabPane,or=U.useContext(G),dr=or.prefixCls,Nr=or.tabs,qr=Yt.tabPane,xi="".concat(dr,"-tabpane");return U.createElement("div",{className:E()("".concat(dr,"-content-holder"))},U.createElement("div",{className:E()("".concat(dr,"-content"),"".concat(dr,"-content-").concat(rr),(0,z.Z)({},"".concat(dr,"-content-animated"),qr))},Nr.map(function(Qr){var Mi=Qr.key,Qi=Qr.forceRender,wi=Qr.style,$i=Qr.className,je=Qr.destroyInactiveTabPane,tt=(0,M.Z)(Qr,Ft),At=Mi===Ot;return U.createElement(_t.default,(0,Te.Z)({key:Mi,visible:At,forceRender:Qi,removeOnLeave:!!(ir||je),leavedClassName:"".concat(xi,"-hidden")},Yt.tabPaneMotion),function(dt,pt){var Tt=dt.style,Ut=dt.className;return U.createElement(Dt,(0,Te.Z)({},tt,{prefixCls:xi,id:kt,tabKey:Mi,animated:qr,active:At,style:(0,d.Z)((0,d.Z)({},wi),Tt),className:E()($i,Ut),ref:pt}))})})))},Pt=nr,Ve=Y(48736);function Bt(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},we;return pe===!1?we={inkBar:!1,tabPane:!1}:pe===!0?we={inkBar:!0,tabPane:!1}:we=(0,d.Z)({inkBar:!0},(0,q.Z)(pe)==="object"?pe:{}),we.tabPaneMotion&&we.tabPane===void 0&&(we.tabPane=!0),!we.tabPaneMotion&&we.tabPane&&(we.tabPane=!1),we}var gr=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],Kt=0,qt=U.forwardRef(function(pe,we){var kt=pe.id,Ot=pe.prefixCls,Yt=Ot===void 0?"rc-tabs":Ot,rr=pe.className,ir=pe.items,or=pe.direction,dr=pe.activeKey,Nr=pe.defaultActiveKey,qr=pe.editable,xi=pe.animated,Qr=pe.tabPosition,Mi=Qr===void 0?"top":Qr,Qi=pe.tabBarGutter,wi=pe.tabBarStyle,$i=pe.tabBarExtraContent,je=pe.locale,tt=pe.more,At=pe.destroyInactiveTabPane,dt=pe.renderTabBar,pt=pe.onChange,Tt=pe.onTabClick,Ut=pe.onTabScroll,Jt=pe.getPopupContainer,Er=pe.popupClassName,kr=pe.indicator,Or=(0,M.Z)(pe,gr),vr=U.useMemo(function(){return(ir||[]).filter(function(jr){return jr&&(0,q.Z)(jr)==="object"&&"key"in jr})},[ir]),cr=or==="rtl",Tr=Bt(xi),gi=(0,U.useState)(!1),ci=(0,ne.Z)(gi,2),hr=ci[0],Zr=ci[1];(0,U.useEffect)(function(){Zr((0,O.Z)())},[]);var Si=(0,L.Z)(function(){var jr;return(jr=vr[0])===null||jr===void 0?void 0:jr.key},{value:dr,defaultValue:Nr}),ti=(0,ne.Z)(Si,2),Vr=ti[0],Ti=ti[1],Ur=(0,U.useState)(function(){return vr.findIndex(function(jr){return jr.key===Vr})}),ri=(0,ne.Z)(Ur,2),Ri=ri[0],st=ri[1];(0,U.useEffect)(function(){var jr=vr.findIndex(function(Ki){return Ki.key===Vr});if(jr===-1){var qi;jr=Math.max(0,Math.min(Ri,vr.length-1)),Ti((qi=vr[jr])===null||qi===void 0?void 0:qi.key)}st(jr)},[vr.map(function(jr){return jr.key}).join("_"),Vr,Ri]);var Ir=(0,L.Z)(null,{value:kt}),hi=(0,ne.Z)(Ir,2),Oi=hi[0],ln=hi[1];(0,U.useEffect)(function(){kt||(ln("rc-tabs-".concat(Kt)),Kt+=1)},[]);function tn(jr,qi){Tt==null||Tt(jr,qi);var Ki=jr!==Vr;Ti(jr),Ki&&(pt==null||pt(jr))}var zi={id:Oi,activeKey:Vr,animated:Tr,tabPosition:Mi,rtl:cr,mobile:hr},$r=(0,d.Z)((0,d.Z)({},zi),{},{editable:qr,locale:je,more:tt,tabBarGutter:Qi,onTabClick:tn,onTabScroll:Ut,extra:$i,style:wi,panes:null,getPopupContainer:Jt,popupClassName:Er,indicator:kr});return U.createElement(G.Provider,{value:{tabs:vr,prefixCls:Yt}},U.createElement("div",(0,Te.Z)({ref:we,id:kt,className:E()(Yt,"".concat(Yt,"-").concat(Mi),(0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(Yt,"-mobile"),hr),"".concat(Yt,"-editable"),qr),"".concat(Yt,"-rtl"),cr),rr)},Or),U.createElement(ut,(0,Te.Z)({},$r,{renderTabBar:dt})),U.createElement(Pt,(0,Te.Z)({destroyInactiveTabPane:At},zi,{animated:Tr}))))}),Gt=qt,Lr=Gt,wr=Y(48755),Xt=Y(83397),Ar=Y(31756),C=Y(86641);const N={motionAppear:!1,motionEnter:!0,motionLeave:!0};function yt(pe){let we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},kt;return we===!1?kt={inkBar:!1,tabPane:!1}:we===!0?kt={inkBar:!0,tabPane:!0}:kt=Object.assign({inkBar:!0},typeof we=="object"?we:{}),kt.tabPane&&(kt.tabPaneMotion=Object.assign(Object.assign({},N),{motionName:(0,C.m)(pe,"switch")})),kt}var X=Y(11592),ue=function(pe,we){var kt={};for(var Ot in pe)Object.prototype.hasOwnProperty.call(pe,Ot)&&we.indexOf(Ot)<0&&(kt[Ot]=pe[Ot]);if(pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Yt=0,Ot=Object.getOwnPropertySymbols(pe);Yt<Ot.length;Yt++)we.indexOf(Ot[Yt])<0&&Object.prototype.propertyIsEnumerable.call(pe,Ot[Yt])&&(kt[Ot[Yt]]=pe[Ot[Yt]]);return kt};function br(pe){return pe.filter(we=>we)}function Ne(pe,we){if(pe)return pe;const kt=(0,X.Z)(we).map(Ot=>{if(U.isValidElement(Ot)){const{key:Yt,props:rr}=Ot,ir=rr||{},{tab:or}=ir,dr=ue(ir,["tab"]);return Object.assign(Object.assign({key:String(Yt)},dr),{label:or})}return null});return br(kt)}var Fe=Y(36237),qe=Y(63356),ee=Y(16931),de=Y(51636),Re=Y(46e3),Z=pe=>{const{componentCls:we,motionDurationSlow:kt}=pe;return[{[we]:{[`${we}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${kt}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${kt}`}}}}},[(0,Re.oN)(pe,"slide-up"),(0,Re.oN)(pe,"slide-down")]]};const Nt=pe=>{const{componentCls:we,tabsCardPadding:kt,cardBg:Ot,cardGutter:Yt,colorBorderSecondary:rr,itemSelectedColor:ir}=pe;return{[`${we}-card`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-tab`]:{margin:0,padding:kt,background:Ot,border:`${(0,Fe.unit)(pe.lineWidth)} ${pe.lineType} ${rr}`,transition:`all ${pe.motionDurationSlow} ${pe.motionEaseInOut}`},[`${we}-tab-active`]:{color:ir,background:pe.colorBgContainer},[`${we}-tab-focus`]:Object.assign({},(0,qe.oN)(pe,-3)),[`${we}-ink-bar`]:{visibility:"hidden"},[`& ${we}-tab${we}-tab-focus ${we}-tab-btn`]:{outline:"none"}},[`&${we}-top, &${we}-bottom`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-tab + ${we}-tab`]:{marginLeft:{_skip_check_:!0,value:(0,Fe.unit)(Yt)}}}},[`&${we}-top`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-tab`]:{borderRadius:`${(0,Fe.unit)(pe.borderRadiusLG)} ${(0,Fe.unit)(pe.borderRadiusLG)} 0 0`},[`${we}-tab-active`]:{borderBottomColor:pe.colorBgContainer}}},[`&${we}-bottom`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-tab`]:{borderRadius:`0 0 ${(0,Fe.unit)(pe.borderRadiusLG)} ${(0,Fe.unit)(pe.borderRadiusLG)}`},[`${we}-tab-active`]:{borderTopColor:pe.colorBgContainer}}},[`&${we}-left, &${we}-right`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-tab + ${we}-tab`]:{marginTop:(0,Fe.unit)(Yt)}}},[`&${we}-left`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-tab`]:{borderRadius:{_skip_check_:!0,value:`${(0,Fe.unit)(pe.borderRadiusLG)} 0 0 ${(0,Fe.unit)(pe.borderRadiusLG)}`}},[`${we}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:pe.colorBgContainer}}}},[`&${we}-right`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${(0,Fe.unit)(pe.borderRadiusLG)} ${(0,Fe.unit)(pe.borderRadiusLG)} 0`}},[`${we}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:pe.colorBgContainer}}}}}}},Ae=pe=>{const{componentCls:we,itemHoverColor:kt,dropdownEdgeChildVerticalPadding:Ot}=pe;return{[`${we}-dropdown`]:Object.assign(Object.assign({},(0,qe.Wf)(pe)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:pe.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${we}-dropdown-menu`]:{maxHeight:pe.tabsDropdownHeight,margin:0,padding:`${(0,Fe.unit)(Ot)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:pe.colorBgContainer,backgroundClip:"padding-box",borderRadius:pe.borderRadiusLG,outline:"none",boxShadow:pe.boxShadowSecondary,"&-item":Object.assign(Object.assign({},qe.vS),{display:"flex",alignItems:"center",minWidth:pe.tabsDropdownWidth,margin:0,padding:`${(0,Fe.unit)(pe.paddingXXS)} ${(0,Fe.unit)(pe.paddingSM)}`,color:pe.colorText,fontWeight:"normal",fontSize:pe.fontSize,lineHeight:pe.lineHeight,cursor:"pointer",transition:`all ${pe.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:pe.marginSM},color:pe.colorTextDescription,fontSize:pe.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:kt}},"&:hover":{background:pe.controlItemBgHover},"&-disabled":{"&, &:hover":{color:pe.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},sr=pe=>{const{componentCls:we,margin:kt,colorBorderSecondary:Ot,horizontalMargin:Yt,verticalItemPadding:rr,verticalItemMargin:ir,calc:or}=pe;return{[`${we}-top, ${we}-bottom`]:{flexDirection:"column",[`> ${we}-nav, > div > ${we}-nav`]:{margin:Yt,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${(0,Fe.unit)(pe.lineWidth)} ${pe.lineType} ${Ot}`,content:"''"},[`${we}-ink-bar`]:{height:pe.lineWidthBold,"&-animated":{transition:`width ${pe.motionDurationSlow}, left ${pe.motionDurationSlow},
right ${pe.motionDurationSlow}`}},[`${we}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:pe.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:pe.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:pe.boxShadowTabsOverflowRight},[`&${we}-nav-wrap-ping-left::before`]:{opacity:1},[`&${we}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${we}-top`]:{[`> ${we}-nav,
> div > ${we}-nav`]:{"&::before":{bottom:0},[`${we}-ink-bar`]:{bottom:0}}},[`${we}-bottom`]:{[`> ${we}-nav, > div > ${we}-nav`]:{order:1,marginTop:kt,marginBottom:0,"&::before":{top:0},[`${we}-ink-bar`]:{top:0}},[`> ${we}-content-holder, > div > ${we}-content-holder`]:{order:0}},[`${we}-left, ${we}-right`]:{[`> ${we}-nav, > div > ${we}-nav`]:{flexDirection:"column",minWidth:or(pe.controlHeight).mul(1.25).equal(),[`${we}-tab`]:{padding:rr,textAlign:"center"},[`${we}-tab + ${we}-tab`]:{margin:ir},[`${we}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:pe.controlHeight},"&::before":{top:0,boxShadow:pe.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:pe.boxShadowTabsOverflowBottom},[`&${we}-nav-wrap-ping-top::before`]:{opacity:1},[`&${we}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${we}-ink-bar`]:{width:pe.lineWidthBold,"&-animated":{transition:`height ${pe.motionDurationSlow}, top ${pe.motionDurationSlow}`}},[`${we}-nav-list, ${we}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${we}-left`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${we}-content-holder, > div > ${we}-content-holder`]:{marginLeft:{_skip_check_:!0,value:(0,Fe.unit)(or(pe.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${(0,Fe.unit)(pe.lineWidth)} ${pe.lineType} ${pe.colorBorder}`},[`> ${we}-content > ${we}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:pe.paddingLG}}}},[`${we}-right`]:{[`> ${we}-nav, > div > ${we}-nav`]:{order:1,[`${we}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${we}-content-holder, > div > ${we}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:or(pe.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${(0,Fe.unit)(pe.lineWidth)} ${pe.lineType} ${pe.colorBorder}`},[`> ${we}-content > ${we}-tabpane`]:{paddingRight:{_skip_check_:!0,value:pe.paddingLG}}}}}},Sr=pe=>{const{componentCls:we,cardPaddingSM:kt,cardPaddingLG:Ot,horizontalItemPaddingSM:Yt,horizontalItemPaddingLG:rr}=pe;return{[we]:{"&-small":{[`> ${we}-nav`]:{[`${we}-tab`]:{padding:Yt,fontSize:pe.titleFontSizeSM}}},"&-large":{[`> ${we}-nav`]:{[`${we}-tab`]:{padding:rr,fontSize:pe.titleFontSizeLG}}}},[`${we}-card`]:{[`&${we}-small`]:{[`> ${we}-nav`]:{[`${we}-tab`]:{padding:kt}},[`&${we}-bottom`]:{[`> ${we}-nav ${we}-tab`]:{borderRadius:`0 0 ${(0,Fe.unit)(pe.borderRadius)} ${(0,Fe.unit)(pe.borderRadius)}`}},[`&${we}-top`]:{[`> ${we}-nav ${we}-tab`]:{borderRadius:`${(0,Fe.unit)(pe.borderRadius)} ${(0,Fe.unit)(pe.borderRadius)} 0 0`}},[`&${we}-right`]:{[`> ${we}-nav ${we}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${(0,Fe.unit)(pe.borderRadius)} ${(0,Fe.unit)(pe.borderRadius)} 0`}}},[`&${we}-left`]:{[`> ${we}-nav ${we}-tab`]:{borderRadius:{_skip_check_:!0,value:`${(0,Fe.unit)(pe.borderRadius)} 0 0 ${(0,Fe.unit)(pe.borderRadius)}`}}}},[`&${we}-large`]:{[`> ${we}-nav`]:{[`${we}-tab`]:{padding:Ot}}}}}},mi=pe=>{const{componentCls:we,itemActiveColor:kt,itemHoverColor:Ot,iconCls:Yt,tabsHorizontalItemMargin:rr,horizontalItemPadding:ir,itemSelectedColor:or,itemColor:dr}=pe,Nr=`${we}-tab`;return{[Nr]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:ir,fontSize:pe.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:dr,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:kt}},"&-btn":{outline:"none",transition:`all ${pe.motionDurationSlow}`,[`${Nr}-icon:not(:last-child)`]:{marginInlineEnd:pe.marginSM}},"&-remove":Object.assign({flex:"none",marginRight:{_skip_check_:!0,value:pe.calc(pe.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:pe.marginXS},color:pe.colorTextDescription,fontSize:pe.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${pe.motionDurationSlow}`,"&:hover":{color:pe.colorTextHeading}},(0,qe.Qy)(pe)),"&:hover":{color:Ot},[`&${Nr}-active ${Nr}-btn`]:{color:or,textShadow:pe.tabsActiveTextShadow},[`&${Nr}-focus ${Nr}-btn`]:Object.assign({},(0,qe.oN)(pe)),[`&${Nr}-disabled`]:{color:pe.colorTextDisabled,cursor:"not-allowed"},[`&${Nr}-disabled ${Nr}-btn, &${Nr}-disabled ${we}-remove`]:{"&:focus, &:active":{color:pe.colorTextDisabled}},[`& ${Nr}-remove ${Yt}`]:{margin:0},[`${Yt}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:pe.marginSM}}},[`${Nr} + ${Nr}`]:{margin:{_skip_check_:!0,value:rr}}}},Hi=pe=>{const{componentCls:we,tabsHorizontalItemMarginRTL:kt,iconCls:Ot,cardGutter:Yt,calc:rr}=pe;return{[`${we}-rtl`]:{direction:"rtl",[`${we}-nav`]:{[`${we}-tab`]:{margin:{_skip_check_:!0,value:kt},[`${we}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[Ot]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:(0,Fe.unit)(pe.marginSM)}},[`${we}-tab-remove`]:{marginRight:{_skip_check_:!0,value:(0,Fe.unit)(pe.marginXS)},marginLeft:{_skip_check_:!0,value:(0,Fe.unit)(rr(pe.marginXXS).mul(-1).equal())},[Ot]:{margin:0}}}},[`&${we}-left`]:{[`> ${we}-nav`]:{order:1},[`> ${we}-content-holder`]:{order:0}},[`&${we}-right`]:{[`> ${we}-nav`]:{order:0},[`> ${we}-content-holder`]:{order:1}},[`&${we}-card${we}-top, &${we}-card${we}-bottom`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-tab + ${we}-tab`]:{marginRight:{_skip_check_:!0,value:Yt},marginLeft:{_skip_check_:!0,value:0}}}}},[`${we}-dropdown-rtl`]:{direction:"rtl"},[`${we}-menu-item`]:{[`${we}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},Ai=pe=>{const{componentCls:we,tabsCardPadding:kt,cardHeight:Ot,cardGutter:Yt,itemHoverColor:rr,itemActiveColor:ir,colorBorderSecondary:or}=pe;return{[we]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,qe.Wf)(pe)),{display:"flex",[`> ${we}-nav, > div > ${we}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${we}-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 ${pe.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${we}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${pe.motionDurationSlow}`},[`${we}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${we}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${we}-nav-more`]:{position:"relative",padding:kt,background:"transparent",border:0,color:pe.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:pe.calc(pe.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${we}-nav-add`]:Object.assign({minWidth:Ot,marginLeft:{_skip_check_:!0,value:Yt},padding:(0,Fe.unit)(pe.paddingXS),background:"transparent",border:`${(0,Fe.unit)(pe.lineWidth)} ${pe.lineType} ${or}`,borderRadius:`${(0,Fe.unit)(pe.borderRadiusLG)} ${(0,Fe.unit)(pe.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:pe.colorText,transition:`all ${pe.motionDurationSlow} ${pe.motionEaseInOut}`,"&:hover":{color:rr},"&:active, &:focus:not(:focus-visible)":{color:ir}},(0,qe.Qy)(pe,-3))},[`${we}-extra-content`]:{flex:"none"},[`${we}-ink-bar`]:{position:"absolute",background:pe.inkBarColor,pointerEvents:"none"}}),mi(pe)),{[`${we}-content`]:{position:"relative",width:"100%"},[`${we}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${we}-tabpane`]:Object.assign(Object.assign({},(0,qe.Qy)(pe)),{"&-hidden":{display:"none"}})}),[`${we}-centered`]:{[`> ${we}-nav, > div > ${we}-nav`]:{[`${we}-nav-wrap`]:{[`&:not([class*='${we}-nav-wrap-ping']) > ${we}-nav-list`]:{margin:"auto"}}}}}},zr=pe=>{const we=pe.controlHeightLG;return{zIndexPopup:pe.zIndexPopupBase+50,cardBg:pe.colorFillAlter,cardHeight:we,cardPadding:`${(we-Math.round(pe.fontSize*pe.lineHeight))/2-pe.lineWidth}px ${pe.padding}px`,cardPaddingSM:`${pe.paddingXXS*1.5}px ${pe.padding}px`,cardPaddingLG:`${pe.paddingXS}px ${pe.padding}px ${pe.paddingXXS*1.5}px`,titleFontSize:pe.fontSize,titleFontSizeLG:pe.fontSizeLG,titleFontSizeSM:pe.fontSize,inkBarColor:pe.colorPrimary,horizontalMargin:`0 0 ${pe.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${pe.paddingSM}px 0`,horizontalItemPaddingSM:`${pe.paddingXS}px 0`,horizontalItemPaddingLG:`${pe.padding}px 0`,verticalItemPadding:`${pe.paddingXS}px ${pe.paddingLG}px`,verticalItemMargin:`${pe.margin}px 0 0 0`,itemColor:pe.colorText,itemSelectedColor:pe.colorPrimary,itemHoverColor:pe.colorPrimaryHover,itemActiveColor:pe.colorPrimaryActive,cardGutter:pe.marginXXS/2}};var Ji=(0,ee.I$)("Tabs",pe=>{const we=(0,de.mergeToken)(pe,{tabsCardPadding:pe.cardPadding,dropdownEdgeChildVerticalPadding:pe.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${(0,Fe.unit)(pe.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${(0,Fe.unit)(pe.horizontalItemGutter)}`});return[Sr(we),Hi(we),sr(we),Ae(we),Nt(we),Ai(we),Z(we)]},zr),Di=()=>null,Ii=function(pe,we){var kt={};for(var Ot in pe)Object.prototype.hasOwnProperty.call(pe,Ot)&&we.indexOf(Ot)<0&&(kt[Ot]=pe[Ot]);if(pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Yt=0,Ot=Object.getOwnPropertySymbols(pe);Yt<Ot.length;Yt++)we.indexOf(Ot[Yt])<0&&Object.prototype.propertyIsEnumerable.call(pe,Ot[Yt])&&(kt[Ot[Yt]]=pe[Ot[Yt]]);return kt};const ar=pe=>{var we,kt,Ot,Yt,rr,ir,or,dr,Nr,qr,xi;const{type:Qr,className:Mi,rootClassName:Qi,size:wi,onEdit:$i,hideAdd:je,centered:tt,addIcon:At,removeIcon:dt,moreIcon:pt,more:Tt,popupClassName:Ut,children:Jt,items:Er,animated:kr,style:Or,indicatorSize:vr,indicator:cr}=pe,Tr=Ii(pe,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","removeIcon","moreIcon","more","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:gi}=Tr,{direction:ci,tabs:hr,getPrefixCls:Zr,getPopupContainer:Si}=U.useContext(wr.E_),ti=Zr("tabs",gi),Vr=(0,Xt.Z)(ti),[Ti,Ur,ri]=Ji(ti,Vr);let Ri;Qr==="editable-card"&&(Ri={onEdit:(zi,$r)=>{let{key:jr,event:qi}=$r;$i==null||$i(zi==="add"?qi:jr,zi)},removeIcon:(we=dt!=null?dt:hr==null?void 0:hr.removeIcon)!==null&&we!==void 0?we:U.createElement(Pe.Z,null),addIcon:(At!=null?At:hr==null?void 0:hr.addIcon)||U.createElement(Me.Z,null),showAdd:je!==!0});const st=Zr(),Ir=(0,Ar.Z)(wi),hi=Ne(Er,Jt),Oi=yt(ti,kr),ln=Object.assign(Object.assign({},hr==null?void 0:hr.style),Or),tn={align:(kt=cr==null?void 0:cr.align)!==null&&kt!==void 0?kt:(Ot=hr==null?void 0:hr.indicator)===null||Ot===void 0?void 0:Ot.align,size:(or=(rr=(Yt=cr==null?void 0:cr.size)!==null&&Yt!==void 0?Yt:vr)!==null&&rr!==void 0?rr:(ir=hr==null?void 0:hr.indicator)===null||ir===void 0?void 0:ir.size)!==null&&or!==void 0?or:hr==null?void 0:hr.indicatorSize};return Ti(U.createElement(Lr,Object.assign({direction:ci,getPopupContainer:Si},Tr,{items:hi,className:E()({[`${ti}-${Ir}`]:Ir,[`${ti}-card`]:["card","editable-card"].includes(Qr),[`${ti}-editable-card`]:Qr==="editable-card",[`${ti}-centered`]:tt},hr==null?void 0:hr.className,Mi,Qi,Ur,ri,Vr),popupClassName:E()(Ut,Ur,ri,Vr),style:ln,editable:Ri,more:Object.assign({icon:(xi=(qr=(Nr=(dr=hr==null?void 0:hr.more)===null||dr===void 0?void 0:dr.icon)!==null&&Nr!==void 0?Nr:hr==null?void 0:hr.moreIcon)!==null&&qr!==void 0?qr:pt)!==null&&xi!==void 0?xi:U.createElement(We.Z,null),transitionName:`${st}-slide-up`},Tt),prefixCls:ti,animated:Oi,indicator:tn})))};ar.TabPane=Di;var Wr=ar},93427:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return Pe}});var U=Y(34998);function Pe(We,Me){return U.i.reduce((ae,E)=>{const Te=We[`${E}1`],z=We[`${E}3`],d=We[`${E}6`],ne=We[`${E}7`];return Object.assign(Object.assign({},ae),Me(E,{lightColor:Te,lightBorderColor:z,darkColor:d,textColor:ne}))},{})}},25399:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return ge}});var U=Y(59301),Pe=Y(92310),We=Y.n(Pe),Me=Y(29125),ae=Y(18929),E=Y(62487),Te=Y(75030),z=Y(86641),d=Y(52838),ne=Y(22703),q=Y(32383),M=Y(55743),L=Y(57700),O=Y(48755),G=Y(36237),he=Y(63356),le=Y(34925),J=Y(37645),B=Y(36305),V=Y(93427),H=Y(51636),ie=Y(16931);const De=Ee=>{const{calc:be,componentCls:D,tooltipMaxWidth:R,tooltipColor:se,tooltipBg:Ie,tooltipBorderRadius:at,zIndexPopup:Et,controlHeight:bt,boxShadowSecondary:He,paddingSM:Ht,paddingXS:gt,arrowOffsetHorizontal:Qe,sizePopupArrow:xr}=Ee,mr=be(at).add(xr).add(Qe).equal(),pi=be(at).mul(2).add(xr).equal();return[{[D]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,he.Wf)(Ee)),{position:"absolute",zIndex:Et,display:"block",width:"max-content",maxWidth:R,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":Ie,[`${D}-inner`]:{minWidth:pi,minHeight:bt,padding:`${(0,G.unit)(Ee.calc(Ht).div(2).equal())} ${(0,G.unit)(gt)}`,color:se,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:Ie,borderRadius:at,boxShadow:He,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:mr},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${D}-inner`]:{borderRadius:Ee.min(at,J.qN)}},[`${D}-content`]:{position:"relative"}}),(0,V.Z)(Ee,(Wt,si)=>{let{darkColor:et}=si;return{[`&${D}-${Wt}`]:{[`${D}-inner`]:{backgroundColor:et},[`${D}-arrow`]:{"--antd-arrow-background-color":et}}}})),{"&-rtl":{direction:"rtl"}})},(0,J.ZP)(Ee,"var(--antd-arrow-background-color)"),{[`${D}-pure`]:{position:"relative",maxWidth:"none",margin:Ee.sizePopupArrow}}]},$e=Ee=>Object.assign(Object.assign({zIndexPopup:Ee.zIndexPopupBase+70},(0,J.wZ)({contentRadius:Ee.borderRadius,limitVerticalRadius:!0})),(0,B.w)((0,H.mergeToken)(Ee,{borderRadiusOuter:Math.min(Ee.borderRadiusOuter,4)})));var Se=function(Ee){let be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return(0,ie.I$)("Tooltip",R=>{const{borderRadius:se,colorTextLightSolid:Ie,colorBgSpotlight:at}=R,Et=(0,H.mergeToken)(R,{tooltipMaxWidth:250,tooltipColor:Ie,tooltipBorderRadius:se,tooltipBg:at});return[De(Et),(0,le._y)(R,"zoom-big-fast")]},$e,{resetStyle:!1,injectStyle:be})(Ee)},Ye=Y(29509);function lt(Ee,be){const D=(0,Ye.o2)(be),R=We()({[`${Ee}-${be}`]:be&&D}),se={},Ie={};return be&&!D&&(se.background=be,Ie["--antd-arrow-background-color"]=be),{className:R,overlayStyle:se,arrowStyle:Ie}}var $t=Ee=>{const{prefixCls:be,className:D,placement:R="top",title:se,color:Ie,overlayInnerStyle:at}=Ee,{getPrefixCls:Et}=U.useContext(O.E_),bt=Et("tooltip",be),[He,Ht,gt]=Se(bt),Qe=lt(bt,Ie),xr=Qe.arrowStyle,mr=Object.assign(Object.assign({},at),Qe.overlayStyle),pi=We()(Ht,gt,bt,`${bt}-pure`,`${bt}-placement-${R}`,D,Qe.className);return He(U.createElement("div",{className:pi,style:xr},U.createElement("div",{className:`${bt}-arrow`}),U.createElement(Me.G,Object.assign({},Ee,{className:Ht,prefixCls:bt,overlayInnerStyle:mr}),se)))},ye=function(Ee,be){var D={};for(var R in Ee)Object.prototype.hasOwnProperty.call(Ee,R)&&be.indexOf(R)<0&&(D[R]=Ee[R]);if(Ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var se=0,R=Object.getOwnPropertySymbols(Ee);se<R.length;se++)be.indexOf(R[se])<0&&Object.prototype.propertyIsEnumerable.call(Ee,R[se])&&(D[R[se]]=Ee[R[se]]);return D};const me=U.forwardRef((Ee,be)=>{var D,R;const{prefixCls:se,openClassName:Ie,getTooltipContainer:at,color:Et,overlayInnerStyle:bt,children:He,afterOpenChange:Ht,afterVisibleChange:gt,destroyTooltipOnHide:Qe,arrow:xr=!0,title:mr,overlay:pi,builtinPlacements:Wt,arrowPointAtCenter:si=!1,autoAdjustOverflow:et=!0,motion:ct,getPopupContainer:Ue,placement:wt="top",mouseEnterDelay:Rt=.1,mouseLeaveDelay:Dt=.1,overlayStyle:fe,rootClassName:ze,overlayClassName:it,styles:ut,classNames:_t}=Ee,Ft=ye(Ee,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),nr=!!xr,[,Pt]=(0,L.ZP)(),{getPopupContainer:Ve,getPrefixCls:Bt,direction:gr,className:Kt,style:qt,classNames:Gt,styles:Lr}=(0,O.dj)("tooltip"),wr=(0,q.ln)("Tooltip"),Xt=U.useRef(null),Ar=()=>{var Di;(Di=Xt.current)===null||Di===void 0||Di.forceAlign()};U.useImperativeHandle(be,()=>{var Di,Ii;return{forceAlign:Ar,forcePopupAlign:()=>{wr.deprecated(!1,"forcePopupAlign","forceAlign"),Ar()},nativeElement:(Di=Xt.current)===null||Di===void 0?void 0:Di.nativeElement,popupElement:(Ii=Xt.current)===null||Ii===void 0?void 0:Ii.popupElement}});const[C,N]=(0,ae.Z)(!1,{value:(D=Ee.open)!==null&&D!==void 0?D:Ee.visible,defaultValue:(R=Ee.defaultOpen)!==null&&R!==void 0?R:Ee.defaultVisible}),yt=!mr&&!pi&&mr!==0,X=Di=>{var Ii,ar;N(yt?!1:Di),yt||((Ii=Ee.onOpenChange)===null||Ii===void 0||Ii.call(Ee,Di),(ar=Ee.onVisibleChange)===null||ar===void 0||ar.call(Ee,Di))},ue=U.useMemo(()=>{var Di,Ii;let ar=si;return typeof xr=="object"&&(ar=(Ii=(Di=xr.pointAtCenter)!==null&&Di!==void 0?Di:xr.arrowPointAtCenter)!==null&&Ii!==void 0?Ii:si),Wt||(0,d.Z)({arrowPointAtCenter:ar,autoAdjustOverflow:et,arrowWidth:nr?Pt.sizePopupArrow:0,borderRadius:Pt.borderRadius,offset:Pt.marginXXS,visibleFirst:!0})},[si,xr,Wt,Pt]),br=U.useMemo(()=>mr===0?mr:pi||mr||"",[pi,mr]),Ne=U.createElement(E.Z,{space:!0},typeof br=="function"?br():br),Fe=Bt("tooltip",se),qe=Bt(),ee=Ee["data-popover-inject"];let de=C;!("open"in Ee)&&!("visible"in Ee)&&yt&&(de=!1);const Re=U.isValidElement(He)&&!(0,ne.M2)(He)?He:U.createElement("span",null,He),Ge=Re.props,Z=!Ge.className||typeof Ge.className=="string"?We()(Ge.className,Ie||`${Fe}-open`):Ge.className,[Nt,Ae,sr]=Se(Fe,!ee),Sr=lt(Fe,Et),mi=Sr.arrowStyle,Hi=We()(it,{[`${Fe}-rtl`]:gr==="rtl"},Sr.className,ze,Ae,sr,Kt,Gt.root,_t==null?void 0:_t.root),Ai=We()(Gt.body,_t==null?void 0:_t.body),[zr,Ji]=(0,Te.Cn)("Tooltip",Ft.zIndex),Cn=U.createElement(Me.Z,Object.assign({},Ft,{zIndex:zr,showArrow:nr,placement:wt,mouseEnterDelay:Rt,mouseLeaveDelay:Dt,prefixCls:Fe,classNames:{root:Hi,body:Ai},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},mi),Lr.root),qt),fe),ut==null?void 0:ut.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},Lr.body),bt),ut==null?void 0:ut.body),Sr.overlayStyle)},getTooltipContainer:Ue||at||Ve,ref:Xt,builtinPlacements:ue,overlay:Ne,visible:de,onVisibleChange:X,afterVisibleChange:Ht!=null?Ht:gt,arrowContent:U.createElement("span",{className:`${Fe}-arrow-content`}),motion:{motionName:(0,z.m)(qe,"zoom-big-fast",Ee.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!Qe}),de?(0,ne.Tm)(Re,{className:Z}):Re);return Nt(U.createElement(M.Z.Provider,{value:Ji},Cn))});me._InternalPanelDoNotUseOrYouWillBeFired=$t;var ge=me},64018:function(){var Fr,Ct,Y,U=!1,Pe,We;window.PR_SHOULD_USE_CONTINUATION=!0;var Me,ae;(function(){var E=window,Te=["break,continue,do,else,for,if,return,while"],z=[Te,"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"],d=[z,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],ne=[d,"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"],q=[d,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],M=[d,"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"],L="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",O=[d,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],G="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",he=[Te,"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"],le=[Te,"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"],J=[Te,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],B=[ne,M,q,O,G,he,le,J],V=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,H="str",ie="kwd",De="com",$e="typ",Se="lit",Ye="pun",lt="pln",Xe="tag",$t="dec",ye="src",oe="atn",me="atv",ge="nocode",Ee="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function be(ct){for(var Ue=0,wt=!1,Rt=!1,Dt=0,fe=ct.length;Dt<fe;++Dt){var ze=ct[Dt];if(ze.ignoreCase)Rt=!0;else if(/[a-z]/i.test(ze.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){wt=!0,Rt=!1;break}}var it={b:8,t:9,n:10,v:11,f:12,r:13};function ut(Ve){var Bt=Ve.charCodeAt(0);if(Bt!==92)return Bt;var gr=Ve.charAt(1);return Bt=it[gr],Bt||("0"<=gr&&gr<="7"?parseInt(Ve.substring(1),8):gr==="u"||gr==="x"?parseInt(Ve.substring(2),16):Ve.charCodeAt(1))}function _t(Ve){if(Ve<32)return(Ve<16?"\\x0":"\\x")+Ve.toString(16);var Bt=String.fromCharCode(Ve);return Bt==="\\"||Bt==="-"||Bt==="]"||Bt==="^"?"\\"+Bt:Bt}function Ft(Ve){var Bt=Ve.substring(1,Ve.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")),gr=[],Kt=Bt[0]==="^",qt=["["];Kt&&qt.push("^");for(var Gt=Kt?1:0,Lr=Bt.length;Gt<Lr;++Gt){var wr=Bt[Gt];if(/\\[bdsw]/i.test(wr))qt.push(wr);else{var Xt=ut(wr),Ar;Gt+2<Lr&&Bt[Gt+1]==="-"?(Ar=ut(Bt[Gt+2]),Gt+=2):Ar=Xt,gr.push([Xt,Ar]),Ar<65||Xt>122||(Ar<65||Xt>90||gr.push([Math.max(65,Xt)|32,Math.min(Ar,90)|32]),Ar<97||Xt>122||gr.push([Math.max(97,Xt)&-33,Math.min(Ar,122)&-33]))}}gr.sort(function(X,ue){return X[0]-ue[0]||ue[1]-X[1]});for(var C=[],N=[],Gt=0;Gt<gr.length;++Gt){var yt=gr[Gt];yt[0]<=N[1]+1?N[1]=Math.max(N[1],yt[1]):C.push(N=yt)}for(var Gt=0;Gt<C.length;++Gt){var yt=C[Gt];qt.push(_t(yt[0])),yt[1]>yt[0]&&(yt[1]+1>yt[0]&&qt.push("-"),qt.push(_t(yt[1])))}return qt.push("]"),qt.join("")}function nr(Ve){for(var Bt=Ve.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")),gr=Bt.length,Kt=[],qt=0,Gt=0;qt<gr;++qt){var Lr=Bt[qt];if(Lr==="(")++Gt;else if(Lr.charAt(0)==="\\"){var wr=+Lr.substring(1);wr&&(wr<=Gt?Kt[wr]=-1:Bt[qt]=_t(wr))}}for(var qt=1;qt<Kt.length;++qt)Kt[qt]===-1&&(Kt[qt]=++Ue);for(var qt=0,Gt=0;qt<gr;++qt){var Lr=Bt[qt];if(Lr==="(")++Gt,Kt[Gt]||(Bt[qt]="(?:");else if(Lr.charAt(0)==="\\"){var wr=+Lr.substring(1);wr&&wr<=Gt&&(Bt[qt]="\\"+Kt[wr])}}for(var qt=0;qt<gr;++qt)Bt[qt]==="^"&&Bt[qt+1]!=="^"&&(Bt[qt]="");if(Ve.ignoreCase&&wt)for(var qt=0;qt<gr;++qt){var Lr=Bt[qt],Xt=Lr.charAt(0);Lr.length>=2&&Xt==="["?Bt[qt]=Ft(Lr):Xt!=="\\"&&(Bt[qt]=Lr.replace(/[a-zA-Z]/g,function(N){var yt=N.charCodeAt(0);return"["+String.fromCharCode(yt&-33,yt|32)+"]"}))}return Bt.join("")}for(var Pt=[],Dt=0,fe=ct.length;Dt<fe;++Dt){var ze=ct[Dt];if(ze.global||ze.multiline)throw new Error(""+ze);Pt.push("(?:"+nr(ze)+")")}return new RegExp(Pt.join("|"),Rt?"gi":"g")}function D(ct,Ue){var wt=/(?:^|\s)nocode(?:\s|$)/,Rt=[],Dt=0,fe=[],ze=0;function it(ut){var _t=ut.nodeType;if(_t==1){if(wt.test(ut.className))return;for(var Ft=ut.firstChild;Ft;Ft=Ft.nextSibling)it(Ft);var nr=ut.nodeName.toLowerCase();(nr==="br"||nr==="li")&&(Rt[ze]=`
`,fe[ze<<1]=Dt++,fe[ze++<<1|1]=ut)}else if(_t==3||_t==4){var Pt=ut.nodeValue;Pt.length&&(Ue?Pt=Pt.replace(/\r\n?/g,`
`):Pt=Pt.replace(/[ \t\r\n]+/g," "),Rt[ze]=Pt,fe[ze<<1]=Dt,Dt+=Pt.length,fe[ze++<<1|1]=ut)}}return it(ct),{sourceCode:Rt.join("").replace(/\n$/,""),spans:fe}}function R(ct,Ue,wt,Rt,Dt){if(wt){var fe={sourceNode:ct,pre:1,langExtension:null,numberLines:null,sourceCode:wt,spans:null,basePos:Ue,decorations:null};Rt(fe),Dt.push.apply(Dt,fe.decorations)}}var se=/\S/;function Ie(ct){for(var Ue=void 0,wt=ct.firstChild;wt;wt=wt.nextSibling){var Rt=wt.nodeType;Ue=Rt===1?Ue?ct:wt:Rt===3&&se.test(wt.nodeValue)?ct:Ue}return Ue===ct?void 0:Ue}function at(ct,Ue){var wt={},Rt;(function(){for(var ze=ct.concat(Ue),it=[],ut={},_t=0,Ft=ze.length;_t<Ft;++_t){var nr=ze[_t],Pt=nr[3];if(Pt)for(var Ve=Pt.length;--Ve>=0;)wt[Pt.charAt(Ve)]=nr;var Bt=nr[1],gr=""+Bt;ut.hasOwnProperty(gr)||(it.push(Bt),ut[gr]=null)}it.push(/[\0-\uffff]/),Rt=be(it)})();var Dt=Ue.length,fe=function(ze){for(var it=ze.sourceCode,ut=ze.basePos,_t=ze.sourceNode,Ft=[ut,lt],nr=0,Pt=it.match(Rt)||[],Ve={},Bt=0,gr=Pt.length;Bt<gr;++Bt){var Kt=Pt[Bt],qt=Ve[Kt],Gt=void 0,Lr;if(typeof qt=="string")Lr=!1;else{var wr=wt[Kt.charAt(0)];if(wr)Gt=Kt.match(wr[1]),qt=wr[0];else{for(var Xt=0;Xt<Dt;++Xt)if(wr=Ue[Xt],Gt=Kt.match(wr[1]),Gt){qt=wr[0];break}Gt||(qt=lt)}Lr=qt.length>=5&&qt.substring(0,5)==="lang-",Lr&&!(Gt&&typeof Gt[1]=="string")&&(Lr=!1,qt=ye),Lr||(Ve[Kt]=qt)}var Ar=nr;if(nr+=Kt.length,!Lr)Ft.push(ut+Ar,qt);else{var C=Gt[1],N=Kt.indexOf(C),yt=N+C.length;Gt[2]&&(yt=Kt.length-Gt[2].length,N=yt-C.length);var X=qt.substring(5);R(_t,ut+Ar,Kt.substring(0,N),fe,Ft),R(_t,ut+Ar+N,C,xr(X,C),Ft),R(_t,ut+Ar+yt,Kt.substring(yt),fe,Ft)}}ze.decorations=Ft};return fe}function Et(ct){var Ue=[],wt=[];ct.tripleQuotedStrings?Ue.push([H,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ct.multiLineStrings?Ue.push([H,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ue.push([H,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ct.verbatimStrings&&wt.push([H,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Rt=ct.hashComments;Rt&&(ct.cStyleComments?(Rt>1?Ue.push([De,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ue.push([De,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),wt.push([H,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ue.push([De,/^#[^\r\n]*/,null,"#"])),ct.cStyleComments&&(wt.push([De,/^\/\/[^\r\n]*/,null]),wt.push([De,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Dt=ct.regexLiterals;if(Dt){var fe=Dt>1?"":`
\r`,ze=fe?".":"[\\S\\s]",it="/(?=[^/*"+fe+"])(?:[^/\\x5B\\x5C"+fe+"]|\\x5C"+ze+"|\\x5B(?:[^\\x5C\\x5D"+fe+"]|\\x5C"+ze+")*(?:\\x5D|$))+/";wt.push(["lang-regex",RegExp("^"+Ee+"("+it+")")])}var ut=ct.types;ut&&wt.push([$e,ut]);var _t=(""+ct.keywords).replace(/^ | $/g,"");_t.length&&wt.push([ie,new RegExp("^(?:"+_t.replace(/[\s,]+/g,"|")+")\\b"),null]),Ue.push([lt,/^\s+/,null,` \r
\xA0`]);var Ft="^.[^\\s\\w.$@'\"`/\\\\]*";return ct.regexLiterals&&(Ft+="(?!s*/)"),wt.push([Se,/^@[a-z_$][a-z_$@0-9]*/i,null],[$e,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[lt,/^[a-z_$][a-z_$@0-9]*/i,null],[Se,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[lt,/^\\[\s\S]?/,null],[Ye,new RegExp(Ft),null]),at(Ue,wt)}var bt=Et({keywords:B,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function He(ct,Ue,wt){for(var Rt=/(?:^|\s)nocode(?:\s|$)/,Dt=/\r\n?|\n/,fe=ct.ownerDocument,ze=fe.createElement("li");ct.firstChild;)ze.appendChild(ct.firstChild);var it=[ze];function ut(Bt){var gr=Bt.nodeType;if(gr==1&&!Rt.test(Bt.className))if(Bt.nodeName==="br")_t(Bt),Bt.parentNode&&Bt.parentNode.removeChild(Bt);else for(var Kt=Bt.firstChild;Kt;Kt=Kt.nextSibling)ut(Kt);else if((gr==3||gr==4)&&wt){var qt=Bt.nodeValue,Gt=qt.match(Dt);if(Gt){var Lr=qt.substring(0,Gt.index);Bt.nodeValue=Lr;var wr=qt.substring(Gt.index+Gt[0].length);if(wr){var Xt=Bt.parentNode;Xt.insertBefore(fe.createTextNode(wr),Bt.nextSibling)}_t(Bt),Lr||Bt.parentNode.removeChild(Bt)}}}function _t(Bt){for(;!Bt.nextSibling;)if(Bt=Bt.parentNode,!Bt)return;function gr(Gt,Lr){var wr=Lr?Gt.cloneNode(!1):Gt,Xt=Gt.parentNode;if(Xt){var Ar=gr(Xt,1),C=Gt.nextSibling;Ar.appendChild(wr);for(var N=C;N;N=C)C=N.nextSibling,Ar.appendChild(N)}return wr}for(var Kt=gr(Bt.nextSibling,0),qt;(qt=Kt.parentNode)&&qt.nodeType===1;)Kt=qt;it.push(Kt)}for(var Ft=0;Ft<it.length;++Ft)ut(it[Ft]);Ue===(Ue|0)&&it[0].setAttribute("value",Ue);var nr=fe.createElement("ol");nr.className="linenums";for(var Pt=Math.max(0,Ue-1|0)||0,Ft=0,Ve=it.length;Ft<Ve;++Ft)ze=it[Ft],ze.className="L"+(Ft+Pt)%10,ze.firstChild||ze.appendChild(fe.createTextNode("\xA0")),nr.appendChild(ze);ct.appendChild(nr)}function Ht(ct){var Ue=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ue=Ue&&+Ue[1]<=8;var wt=/\n/g,Rt=ct.sourceCode,Dt=Rt.length,fe=0,ze=ct.spans,it=ze.length,ut=0,_t=ct.decorations,Ft=_t.length,nr=0;_t[Ft]=Dt;var Pt,Ve;for(Ve=Pt=0;Ve<Ft;)_t[Ve]!==_t[Ve+2]?(_t[Pt++]=_t[Ve++],_t[Pt++]=_t[Ve++]):Ve+=2;for(Ft=Pt,Ve=Pt=0;Ve<Ft;){for(var Bt=_t[Ve],gr=_t[Ve+1],Kt=Ve+2;Kt+2<=Ft&&_t[Kt+1]===gr;)Kt+=2;_t[Pt++]=Bt,_t[Pt++]=gr,Ve=Kt}Ft=_t.length=Pt;var qt=ct.sourceNode,Gt="";qt&&(Gt=qt.style.display,qt.style.display="none");try{for(var Lr=null;ut<it;){var wr=ze[ut],Xt=ze[ut+2]||Dt,Ar=_t[nr+2]||Dt,Kt=Math.min(Xt,Ar),C=ze[ut+1],N;if(C.nodeType!==1&&(N=Rt.substring(fe,Kt))){Ue&&(N=N.replace(wt,"\r")),C.nodeValue=N;var yt=C.ownerDocument,X=yt.createElement("span");X.className=_t[nr+1];var ue=C.parentNode;ue.replaceChild(X,C),X.appendChild(C),fe<Xt&&(ze[ut+1]=C=yt.createTextNode(Rt.substring(Kt,Xt)),ue.insertBefore(C,X.nextSibling))}fe=Kt,fe>=Xt&&(ut+=2),fe>=Ar&&(nr+=2)}}finally{qt&&(qt.style.display=Gt)}}var gt={};function Qe(ct,Ue){for(var wt=Ue.length;--wt>=0;){var Rt=Ue[wt];gt.hasOwnProperty(Rt)?E.console&&console.warn("cannot override language handler %s",Rt):gt[Rt]=ct}}function xr(ct,Ue){return ct&&gt.hasOwnProperty(ct)||(ct=/^\s*</.test(Ue)?"default-markup":"default-code"),gt[ct]}Qe(bt,["default-code"]),Qe(at([],[[lt,/^[^<?]+/],[$t,/^<!\w[^>]*(?:>|$)/],[De,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[Ye,/^(?:<[%?]|[%?]>)/],["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"]),Qe(at([[lt,/^[\s]+/,null,` \r
`],[me,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Xe,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[oe,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[Ye,/^[=<>\/]+/],["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"]),Qe(at([],[[me,/^[\s\S]+/]]),["uq.val"]),Qe(Et({keywords:ne,hashComments:!0,cStyleComments:!0,types:V}),["c","cc","cpp","cxx","cyc","m"]),Qe(Et({keywords:"null,true,false"}),["json"]),Qe(Et({keywords:M,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:V}),["cs"]),Qe(Et({keywords:q,cStyleComments:!0}),["java"]),Qe(Et({keywords:J,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Qe(Et({keywords:he,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Qe(Et({keywords:G,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Qe(Et({keywords:le,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Qe(Et({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Qe(Et({keywords:L,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Qe(at([],[[H,/^[\s\S]+/]]),["regex"]);function mr(ct){var Ue=ct.langExtension;try{var wt=D(ct.sourceNode,ct.pre),Rt=wt.sourceCode;ct.sourceCode=Rt,ct.spans=wt.spans,ct.basePos=0,xr(Ue,Rt)(ct),Ht(ct)}catch(Dt){E.console&&console.log(Dt&&Dt.stack||Dt)}}function pi(ct,Ue,wt){var Rt=wt||!1,Dt=Ue||null,fe=document.createElement("div");fe.innerHTML="<pre>"+ct+"</pre>",fe=fe.firstChild,Rt&&He(fe,Rt,!0);var ze={langExtension:Dt,numberLines:Rt,sourceNode:fe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return mr(ze),fe.innerHTML}function Wt(ct,Ue){var wt=Ue||document.body,Rt=wt.ownerDocument||document;function Dt(wr){return wt.getElementsByTagName(wr)}for(var fe=[Dt("pre"),Dt("code"),Dt("xmp")],ze=[],it=0;it<fe.length;++it)for(var ut=0,_t=fe[it].length;ut<_t;++ut)ze.push(fe[it][ut]);fe=null;var Ft=Date;Ft.now||(Ft={now:function(){return+new Date}});var nr=0,Pt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ve=/\bprettyprint\b/,Bt=/\bprettyprinted\b/,gr=/pre|xmp/i,Kt=/^code$/i,qt=/^(?:pre|code|xmp)$/i,Gt={};function Lr(){for(var wr=E.PR_SHOULD_USE_CONTINUATION?Ft.now()+250:1/0;nr<ze.length&&Ft.now()<wr;nr++){for(var Xt=ze[nr],Ar=Gt,C=Xt;C=C.previousSibling;){var N=C.nodeType,yt=(N===7||N===8)&&C.nodeValue;if(yt?!/^\??prettify\b/.test(yt):N!==3||/\S/.test(C.nodeValue))break;if(yt){Ar={},yt.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ae,sr,Sr){Ar[sr]=Sr});break}}var X=Xt.className;if((Ar!==Gt||Ve.test(X))&&!Bt.test(X)){for(var ue=!1,br=Xt.parentNode;br;br=br.parentNode){var Ne=br.tagName;if(qt.test(Ne)&&br.className&&Ve.test(br.className)){ue=!0;break}}if(!ue){Xt.className+=" prettyprinted";var Fe=Ar.lang;if(!Fe){Fe=X.match(Pt);var qe;!Fe&&(qe=Ie(Xt))&&Kt.test(qe.tagName)&&(Fe=qe.className.match(Pt)),Fe&&(Fe=Fe[1])}var ee;if(gr.test(Xt.tagName))ee=1;else{var de=Xt.currentStyle,Re=Rt.defaultView,Ge=de?de.whiteSpace:Re&&Re.getComputedStyle?Re.getComputedStyle(Xt,null).getPropertyValue("white-space"):0;ee=Ge&&Ge.substring(0,3)==="pre"}var Z=Ar.linenums;(Z=Z==="true"||+Z)||(Z=X.match(/\blinenums\b(?::(\d+))?/),Z=Z?Z[1]&&Z[1].length?+Z[1]:!0:!1),Z&&He(Xt,Z,ee);var Nt={langExtension:Fe,sourceNode:Xt,numberLines:Z,pre:ee,sourceCode:null,basePos:null,spans:null,decorations:null};mr(Nt)}}}nr<ze.length?E.setTimeout(Lr,250):typeof ct=="function"&&ct()}Lr()}var si=E.PR={createSimpleLexer:at,registerLangHandler:Qe,sourceDecorator:Et,PR_ATTRIB_NAME:oe,PR_ATTRIB_VALUE:me,PR_COMMENT:De,PR_DECLARATION:$t,PR_KEYWORD:ie,PR_LITERAL:Se,PR_NOCODE:ge,PR_PLAIN:lt,PR_PUNCTUATION:Ye,PR_SOURCE:ye,PR_STRING:H,PR_TAG:Xe,PR_TYPE:$e,prettyPrintOne:U?E.prettyPrintOne=pi:Me=pi,prettyPrint:ae=U?E.prettyPrint=Wt:ae=Wt},et=E.define;typeof et=="function"&&et.amd&&et("google-code-prettify",[],function(){return si})})()},25769:function(Fr,Ct,Y){"use strict";var U=Y(98040),Pe={"text/plain":"Text","text/html":"Url",default:"Text"},We="Copy to clipboard: #{key}, Enter";function Me(E){var Te=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return E.replace(/#{\s*key\s*}/g,Te)}function ae(E,Te){var z,d,ne,q,M,L,O=!1;Te||(Te={}),z=Te.debug||!1;try{ne=U(),q=document.createRange(),M=document.getSelection(),L=document.createElement("span"),L.textContent=E,L.ariaHidden="true",L.style.all="unset",L.style.position="fixed",L.style.top=0,L.style.clip="rect(0, 0, 0, 0)",L.style.whiteSpace="pre",L.style.webkitUserSelect="text",L.style.MozUserSelect="text",L.style.msUserSelect="text",L.style.userSelect="text",L.addEventListener("copy",function(he){if(he.stopPropagation(),Te.format)if(he.preventDefault(),typeof he.clipboardData=="undefined"){z&&console.warn("unable to use e.clipboardData"),z&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var le=Pe[Te.format]||Pe.default;window.clipboardData.setData(le,E)}else he.clipboardData.clearData(),he.clipboardData.setData(Te.format,E);Te.onCopy&&(he.preventDefault(),Te.onCopy(he.clipboardData))}),document.body.appendChild(L),q.selectNodeContents(L),M.addRange(q);var G=document.execCommand("copy");if(!G)throw new Error("copy command was unsuccessful");O=!0}catch(he){z&&console.error("unable to copy using execCommand: ",he),z&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(Te.format||"text",E),Te.onCopy&&Te.onCopy(window.clipboardData),O=!0}catch(le){z&&console.error("unable to copy using clipboardData: ",le),z&&console.error("falling back to prompt"),d=Me("message"in Te?Te.message:We),window.prompt(d,E)}}finally{M&&(typeof M.removeRange=="function"?M.removeRange(q):M.removeAllRanges()),L&&document.body.removeChild(L),ne()}return O}Fr.exports=ae},53184:function(Fr,Ct,Y){"use strict";var U,Pe;function We(Me,ae,E){var Te=function(z,d){return Me.js_beautify(z,d)};return Te.js=Me.js_beautify,Te.css=ae.css_beautify,Te.html=E.html_beautify,Te.js_beautify=Me.js_beautify,Te.css_beautify=ae.css_beautify,Te.html_beautify=E.html_beautify,Te}U=[Y(58553),Y(87804),Y(40998)],Pe=function(Me,ae,E){return We(Me,ae,E)}.apply(Ct,U),Pe!==void 0&&(Fr.exports=Pe)},87804:function(Fr,Ct){var Y,U;(function(){var Pe;(function(){"use strict";var Me=[,,function(z){function d(M){this.__parent=M,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=[]}d.prototype.clone_empty=function(){var M=new d(this.__parent);return M.set_indent(this.__indent_count,this.__alignment_count),M},d.prototype.item=function(M){return M<0?this.__items[this.__items.length+M]:this.__items[M]},d.prototype.has_match=function(M){for(var L=this.__items.length-1;L>=0;L--)if(this.__items[L].match(M))return!0;return!1},d.prototype.set_indent=function(M,L){this.is_empty()&&(this.__indent_count=M||0,this.__alignment_count=L||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.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)},d.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},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var M=this.__parent.current_line;return M.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),M.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),M.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,M.__items[0]===" "&&(M.__items.splice(0,1),M.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(M){this.__items.push(M);var L=M.lastIndexOf(`
`);L!==-1?this.__character_count=M.length-L:this.__character_count+=M.length},d.prototype.pop=function(){var M=null;return this.is_empty()||(M=this.__items.pop(),this.__character_count-=M.length),M},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var M="";return this.is_empty()?this.__parent.indent_empty_lines&&(M=this.__parent.get_indent_string(this.__indent_count)):(M=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),M+=this.__items.join("")),M};function ne(M,L){this.__cache=[""],this.__indent_size=M.indent_size,this.__indent_string=M.indent_char,M.indent_with_tabs||(this.__indent_string=new Array(M.indent_size+1).join(M.indent_char)),L=L||"",M.indent_level>0&&(L=new Array(M.indent_level+1).join(this.__indent_string)),this.__base_string=L,this.__base_string_length=L.length}ne.prototype.get_indent_size=function(M,L){var O=this.__base_string_length;return L=L||0,M<0&&(O=0),O+=M*this.__indent_size,O+=L,O},ne.prototype.get_indent_string=function(M,L){var O=this.__base_string;return L=L||0,M<0&&(M=0,O=""),L+=M*this.__indent_size,this.__ensure_cache(L),O+=this.__cache[L],O},ne.prototype.__ensure_cache=function(M){for(;M>=this.__cache.length;)this.__add_column()},ne.prototype.__add_column=function(){var M=this.__cache.length,L=0,O="";this.__indent_size&&M>=this.__indent_size&&(L=Math.floor(M/this.__indent_size),M-=L*this.__indent_size,O=new Array(L+1).join(this.__indent_string)),M&&(O+=new Array(M+1).join(" ")),this.__cache.push(O)};function q(M,L){this.__indent_cache=new ne(M,L),this.raw=!1,this._end_with_newline=M.end_with_newline,this.indent_size=M.indent_size,this.wrap_line_length=M.wrap_line_length,this.indent_empty_lines=M.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}q.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},q.prototype.get_line_number=function(){return this.__lines.length},q.prototype.get_indent_string=function(M,L){return this.__indent_cache.get_indent_string(M,L)},q.prototype.get_indent_size=function(M,L){return this.__indent_cache.get_indent_size(M,L)},q.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},q.prototype.add_new_line=function(M){return this.is_empty()||!M&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},q.prototype.get_code=function(M){this.trim(!0);var L=this.current_line.pop();L&&(L[L.length-1]===`
`&&(L=L.replace(/\n+$/g,"")),this.current_line.push(L)),this._end_with_newline&&this.__add_outputline();var O=this.__lines.join(`
`);return M!==`
`&&(O=O.replace(/[\n]/g,M)),O},q.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},q.prototype.set_indent=function(M,L){return M=M||0,L=L||0,this.next_line.set_indent(M,L),this.__lines.length>1?(this.current_line.set_indent(M,L),!0):(this.current_line.set_indent(),!1)},q.prototype.add_raw_token=function(M){for(var L=0;L<M.newlines;L++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(M.whitespace_before),this.current_line.push(M.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},q.prototype.add_token=function(M){this.__add_space_before_token(),this.current_line.push(M),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},q.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(" "))},q.prototype.remove_indent=function(M){for(var L=this.__lines.length;M<L;)this.__lines[M]._remove_indent(),M++;this.current_line._remove_wrap_indent()},q.prototype.trim=function(M){for(M=M===void 0?!1:M,this.current_line.trim();M&&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},q.prototype.just_added_newline=function(){return this.current_line.is_empty()},q.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},q.prototype.ensure_empty_line_above=function(M,L){for(var O=this.__lines.length-2;O>=0;){var G=this.__lines[O];if(G.is_empty())break;if(G.item(0).indexOf(M)!==0&&G.item(-1)!==L){this.__lines.splice(O+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}O--}},z.exports.Output=q},,,,function(z){function d(M,L){this.raw_options=ne(M,L),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"])}d.prototype._get_array=function(M,L){var O=this.raw_options[M],G=L||[];return typeof O=="object"?O!==null&&typeof O.concat=="function"&&(G=O.concat()):typeof O=="string"&&(G=O.split(/[^a-zA-Z0-9_\/\-]+/)),G},d.prototype._get_boolean=function(M,L){var O=this.raw_options[M],G=O===void 0?!!L:!!O;return G},d.prototype._get_characters=function(M,L){var O=this.raw_options[M],G=L||"";return typeof O=="string"&&(G=O.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),G},d.prototype._get_number=function(M,L){var O=this.raw_options[M];L=parseInt(L,10),isNaN(L)&&(L=0);var G=parseInt(O,10);return isNaN(G)&&(G=L),G},d.prototype._get_selection=function(M,L,O){var G=this._get_selection_list(M,L,O);if(G.length!==1)throw new Error("Invalid Option Value: The option '"+M+`' can only be one of the following values:
`+L+`
You passed in: '`+this.raw_options[M]+"'");return G[0]},d.prototype._get_selection_list=function(M,L,O){if(!L||L.length===0)throw new Error("Selection list cannot be empty.");if(O=O||[L[0]],!this._is_valid_selection(O,L))throw new Error("Invalid Default Value!");var G=this._get_array(M,O);if(!this._is_valid_selection(G,L))throw new Error("Invalid Option Value: The option '"+M+`' can contain only the following values:
`+L+`
You passed in: '`+this.raw_options[M]+"'");return G},d.prototype._is_valid_selection=function(M,L){return M.length&&L.length&&!M.some(function(O){return L.indexOf(O)===-1})};function ne(M,L){var O={};M=q(M);var G;for(G in M)G!==L&&(O[G]=M[G]);if(L&&M[L])for(G in M[L])O[G]=M[L][G];return O}function q(M){var L={},O;for(O in M){var G=O.replace(/-/g,"_");L[G]=M[O]}return L}z.exports.Options=d,z.exports.normalizeOpts=q,z.exports.mergeOpts=ne},,function(z){var d=RegExp.prototype.hasOwnProperty("sticky");function ne(q){this.__input=q||"",this.__input_length=this.__input.length,this.__position=0}ne.prototype.restart=function(){this.__position=0},ne.prototype.back=function(){this.__position>0&&(this.__position-=1)},ne.prototype.hasNext=function(){return this.__position<this.__input_length},ne.prototype.next=function(){var q=null;return this.hasNext()&&(q=this.__input.charAt(this.__position),this.__position+=1),q},ne.prototype.peek=function(q){var M=null;return q=q||0,q+=this.__position,q>=0&&q<this.__input_length&&(M=this.__input.charAt(q)),M},ne.prototype.__match=function(q,M){q.lastIndex=M;var L=q.exec(this.__input);return L&&!(d&&q.sticky)&&L.index!==M&&(L=null),L},ne.prototype.test=function(q,M){return M=M||0,M+=this.__position,M>=0&&M<this.__input_length?!!this.__match(q,M):!1},ne.prototype.testChar=function(q,M){var L=this.peek(M);return q.lastIndex=0,L!==null&&q.test(L)},ne.prototype.match=function(q){var M=this.__match(q,this.__position);return M?this.__position+=M[0].length:M=null,M},ne.prototype.read=function(q,M,L){var O="",G;return q&&(G=this.match(q),G&&(O+=G[0])),M&&(G||!q)&&(O+=this.readUntil(M,L)),O},ne.prototype.readUntil=function(q,M){var L="",O=this.__position;q.lastIndex=this.__position;var G=q.exec(this.__input);return G?(O=G.index,M&&(O+=G[0].length)):O=this.__input_length,L=this.__input.substring(this.__position,O),this.__position=O,L},ne.prototype.readUntilAfter=function(q){return this.readUntil(q,!0)},ne.prototype.get_regexp=function(q,M){var L=null,O="g";return M&&d&&(O="y"),typeof q=="string"&&q!==""?L=new RegExp(q,O):q&&(L=new RegExp(q.source,O)),L},ne.prototype.get_literal_regexp=function(q){return RegExp(q.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},ne.prototype.peekUntilAfter=function(q){var M=this.__position,L=this.readUntilAfter(q);return this.__position=M,L},ne.prototype.lookBack=function(q){var M=this.__position-1;return M>=q.length&&this.__input.substring(M-q.length,M).toLowerCase()===q},z.exports.InputScanner=ne},,,,,function(z){function d(ne,q){ne=typeof ne=="string"?ne:ne.source,q=typeof q=="string"?q:q.source,this.__directives_block_pattern=new RegExp(ne+/ beautify( \w+[:]\w+)+ /.source+q,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(ne+/\sbeautify\signore:end\s/.source+q,"g")}d.prototype.get_directives=function(ne){if(!ne.match(this.__directives_block_pattern))return null;var q={};this.__directive_pattern.lastIndex=0;for(var M=this.__directive_pattern.exec(ne);M;)q[M[1]]=M[2],M=this.__directive_pattern.exec(ne);return q},d.prototype.readIgnored=function(ne){return ne.readUntilAfter(this.__directives_end_ignore_pattern)},z.exports.Directives=d},,function(z,d,ne){var q=ne(16).Beautifier,M=ne(17).Options;function L(O,G){var he=new q(O,G);return he.beautify()}z.exports=L,z.exports.defaultOptions=function(){return new M}},function(z,d,ne){var q=ne(17).Options,M=ne(2).Output,L=ne(8).InputScanner,O=ne(13).Directives,G=new O(/\/\*/,/\*\//),he=/\r\n|[\r\n]/,le=/\r\n|[\r\n]/g,J=/\s/,B=/(?:\s|\n)+/g,V=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,H=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function ie(De,$e){this._source_text=De||"",this._options=new q($e),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"]}ie.prototype.eatString=function(De){var $e="";for(this._ch=this._input.next();this._ch;){if($e+=this._ch,this._ch==="\\")$e+=this._input.next();else if(De.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return $e},ie.prototype.eatWhitespace=function(De){for(var $e=J.test(this._input.peek()),Se=0;J.test(this._input.peek());)this._ch=this._input.next(),De&&this._ch===`
`&&(Se===0||Se<this._options.max_preserve_newlines)&&(Se++,this._output.add_new_line(!0));return $e},ie.prototype.foundNestedPseudoClass=function(){for(var De=0,$e=1,Se=this._input.peek($e);Se;){if(Se==="{")return!0;if(Se==="(")De+=1;else if(Se===")"){if(De===0)return!1;De-=1}else if(Se===";"||Se==="}")return!1;$e++,Se=this._input.peek($e)}return!1},ie.prototype.print_string=function(De){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(De)},ie.prototype.preserveSingleSpace=function(De){De&&(this._output.space_before_token=!0)},ie.prototype.indent=function(){this._indentLevel++},ie.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},ie.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var De=this._source_text,$e=this._options.eol;$e==="auto"&&($e=`
`,De&&he.test(De||"")&&($e=De.match(he)[0])),De=De.replace(le,`
`);var Se=De.match(/^[\t ]*/)[0];this._output=new M(this._options,Se),this._input=new L(De),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var Ye=0,lt=!1,Xe=!1,$t=!1,ye=!1,oe=!1,me=this._ch,ge=!1,Ee,be,D;Ee=this._input.read(B),be=Ee!=="",D=me,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),me=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var R=this._input.read(V),se=G.get_directives(R);se&&se.ignore==="start"&&(R+=G.readIgnored(this._input)),this.print_string(R),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(H)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(be),this.print_string(this._ch);var Ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Ie.match(/[ :]$/)&&(Ie=this.eatString(": ").replace(/\s+$/,""),this.print_string(Ie),this._output.space_before_token=!0),Ye===0&&Ie.indexOf(":")!==-1&&(Xe=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(be),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var at=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);at.match(/[ :]$/)&&(at=this.eatString(": ").replace(/\s+$/,""),this.print_string(at),this._output.space_before_token=!0),Ye===0&&at.indexOf(":")!==-1?(Xe=!0,this.indent()):at in this.NESTED_AT_RULE?(this._nestedLevel+=1,at in this.CONDITIONAL_GROUP_RULE&&($t=!0)):Ye===0&&!Xe&&(ye=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(be),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")Xe&&(Xe=!1,this.outdent()),ye=!1,$t?($t=!1,lt=this._indentLevel>=this._nestedLevel):lt=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&lt&&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)):(D==="("?this._output.space_before_token=!1:D!==","&&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(),D==="{"&&this._output.trim(!0),Xe&&(this.outdent(),Xe=!1),this.print_string(this._ch),lt=!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 Et=0;Et<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Et++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Et])){ge=!0;break}(lt||$t)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!ye&&Ye===0?(this.print_string(":"),Xe||(Xe=!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 bt=D==='"'||D==="'";this.preserveSingleSpace(bt||be),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")ge=!1,Ye===0?(Xe&&(this.outdent(),Xe=!1),ye=!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(),Ye++,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(")")),Ye&&(Ye--,this.outdent()));else{var He=!1;this._input.lookBack("with")&&(He=!0),this.preserveSingleSpace(be||He),this.print_string(this._ch),Xe&&D==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),oe=!0):(this.eatWhitespace(),Ye++,this.indent())}else if(this._ch===")")Ye&&(Ye--,this.outdent()),oe&&this._input.peek()===";"&&this._options.selector_separator_newline&&(oe=!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&&(!Xe||oe)&&Ye===0&&!ye?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!Xe&&Ye===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&&J.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(be),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),J.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 Ht=D==='"'||D==="'";this.preserveSingleSpace(Ht||be),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&ge&&this._output.add_new_line()}var gt=this._output.get_code($e);return gt},z.exports.Beautifier=ie},function(z,d,ne){var q=ne(6).Options;function M(L){q.call(this,L,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var O=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||O;var G=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var he=0;he<G.length;he++)G[he]!=="expand"?this.brace_style="collapse":this.brace_style=G[he]}M.prototype=new q,z.exports.Options=M}],ae={};function E(z){var d=ae[z];if(d!==void 0)return d.exports;var ne=ae[z]={exports:{}};return Me[z](ne,ne.exports,E),ne.exports}var Te=E(15);Pe=Te})();var We=Pe;Y=[],U=function(){return{css_beautify:We}}.apply(Ct,Y),U!==void 0&&(Fr.exports=U)})()},40998:function(Fr,Ct,Y){var U,Pe;(function(){var We;(function(){"use strict";var Te=[,,function(q){function M(G){this.__parent=G,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=[]}M.prototype.clone_empty=function(){var G=new M(this.__parent);return G.set_indent(this.__indent_count,this.__alignment_count),G},M.prototype.item=function(G){return G<0?this.__items[this.__items.length+G]:this.__items[G]},M.prototype.has_match=function(G){for(var he=this.__items.length-1;he>=0;he--)if(this.__items[he].match(G))return!0;return!1},M.prototype.set_indent=function(G,he){this.is_empty()&&(this.__indent_count=G||0,this.__alignment_count=he||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},M.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)},M.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},M.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var G=this.__parent.current_line;return G.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),G.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),G.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,G.__items[0]===" "&&(G.__items.splice(0,1),G.__character_count-=1),!0}return!1},M.prototype.is_empty=function(){return this.__items.length===0},M.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},M.prototype.push=function(G){this.__items.push(G);var he=G.lastIndexOf(`
`);he!==-1?this.__character_count=G.length-he:this.__character_count+=G.length},M.prototype.pop=function(){var G=null;return this.is_empty()||(G=this.__items.pop(),this.__character_count-=G.length),G},M.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},M.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},M.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},M.prototype.toString=function(){var G="";return this.is_empty()?this.__parent.indent_empty_lines&&(G=this.__parent.get_indent_string(this.__indent_count)):(G=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),G+=this.__items.join("")),G};function L(G,he){this.__cache=[""],this.__indent_size=G.indent_size,this.__indent_string=G.indent_char,G.indent_with_tabs||(this.__indent_string=new Array(G.indent_size+1).join(G.indent_char)),he=he||"",G.indent_level>0&&(he=new Array(G.indent_level+1).join(this.__indent_string)),this.__base_string=he,this.__base_string_length=he.length}L.prototype.get_indent_size=function(G,he){var le=this.__base_string_length;return he=he||0,G<0&&(le=0),le+=G*this.__indent_size,le+=he,le},L.prototype.get_indent_string=function(G,he){var le=this.__base_string;return he=he||0,G<0&&(G=0,le=""),he+=G*this.__indent_size,this.__ensure_cache(he),le+=this.__cache[he],le},L.prototype.__ensure_cache=function(G){for(;G>=this.__cache.length;)this.__add_column()},L.prototype.__add_column=function(){var G=this.__cache.length,he=0,le="";this.__indent_size&&G>=this.__indent_size&&(he=Math.floor(G/this.__indent_size),G-=he*this.__indent_size,le=new Array(he+1).join(this.__indent_string)),G&&(le+=new Array(G+1).join(" ")),this.__cache.push(le)};function O(G,he){this.__indent_cache=new L(G,he),this.raw=!1,this._end_with_newline=G.end_with_newline,this.indent_size=G.indent_size,this.wrap_line_length=G.wrap_line_length,this.indent_empty_lines=G.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new M(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}O.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},O.prototype.get_line_number=function(){return this.__lines.length},O.prototype.get_indent_string=function(G,he){return this.__indent_cache.get_indent_string(G,he)},O.prototype.get_indent_size=function(G,he){return this.__indent_cache.get_indent_size(G,he)},O.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},O.prototype.add_new_line=function(G){return this.is_empty()||!G&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},O.prototype.get_code=function(G){this.trim(!0);var he=this.current_line.pop();he&&(he[he.length-1]===`
`&&(he=he.replace(/\n+$/g,"")),this.current_line.push(he)),this._end_with_newline&&this.__add_outputline();var le=this.__lines.join(`
`);return G!==`
`&&(le=le.replace(/[\n]/g,G)),le},O.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},O.prototype.set_indent=function(G,he){return G=G||0,he=he||0,this.next_line.set_indent(G,he),this.__lines.length>1?(this.current_line.set_indent(G,he),!0):(this.current_line.set_indent(),!1)},O.prototype.add_raw_token=function(G){for(var he=0;he<G.newlines;he++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(G.whitespace_before),this.current_line.push(G.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},O.prototype.add_token=function(G){this.__add_space_before_token(),this.current_line.push(G),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},O.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(" "))},O.prototype.remove_indent=function(G){for(var he=this.__lines.length;G<he;)this.__lines[G]._remove_indent(),G++;this.current_line._remove_wrap_indent()},O.prototype.trim=function(G){for(G=G===void 0?!1:G,this.current_line.trim();G&&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},O.prototype.just_added_newline=function(){return this.current_line.is_empty()},O.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},O.prototype.ensure_empty_line_above=function(G,he){for(var le=this.__lines.length-2;le>=0;){var J=this.__lines[le];if(J.is_empty())break;if(J.item(0).indexOf(G)!==0&&J.item(-1)!==he){this.__lines.splice(le+1,0,new M(this)),this.previous_line=this.__lines[this.__lines.length-2];break}le--}},q.exports.Output=O},function(q){function M(L,O,G,he){this.type=L,this.text=O,this.comments_before=null,this.newlines=G||0,this.whitespace_before=he||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}q.exports.Token=M},,,function(q){function M(G,he){this.raw_options=L(G,he),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"])}M.prototype._get_array=function(G,he){var le=this.raw_options[G],J=he||[];return typeof le=="object"?le!==null&&typeof le.concat=="function"&&(J=le.concat()):typeof le=="string"&&(J=le.split(/[^a-zA-Z0-9_\/\-]+/)),J},M.prototype._get_boolean=function(G,he){var le=this.raw_options[G],J=le===void 0?!!he:!!le;return J},M.prototype._get_characters=function(G,he){var le=this.raw_options[G],J=he||"";return typeof le=="string"&&(J=le.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),J},M.prototype._get_number=function(G,he){var le=this.raw_options[G];he=parseInt(he,10),isNaN(he)&&(he=0);var J=parseInt(le,10);return isNaN(J)&&(J=he),J},M.prototype._get_selection=function(G,he,le){var J=this._get_selection_list(G,he,le);if(J.length!==1)throw new Error("Invalid Option Value: The option '"+G+`' can only be one of the following values:
`+he+`
You passed in: '`+this.raw_options[G]+"'");return J[0]},M.prototype._get_selection_list=function(G,he,le){if(!he||he.length===0)throw new Error("Selection list cannot be empty.");if(le=le||[he[0]],!this._is_valid_selection(le,he))throw new Error("Invalid Default Value!");var J=this._get_array(G,le);if(!this._is_valid_selection(J,he))throw new Error("Invalid Option Value: The option '"+G+`' can contain only the following values:
`+he+`
You passed in: '`+this.raw_options[G]+"'");return J},M.prototype._is_valid_selection=function(G,he){return G.length&&he.length&&!G.some(function(le){return he.indexOf(le)===-1})};function L(G,he){var le={};G=O(G);var J;for(J in G)J!==he&&(le[J]=G[J]);if(he&&G[he])for(J in G[he])le[J]=G[he][J];return le}function O(G){var he={},le;for(le in G){var J=le.replace(/-/g,"_");he[J]=G[le]}return he}q.exports.Options=M,q.exports.normalizeOpts=O,q.exports.mergeOpts=L},,function(q){var M=RegExp.prototype.hasOwnProperty("sticky");function L(O){this.__input=O||"",this.__input_length=this.__input.length,this.__position=0}L.prototype.restart=function(){this.__position=0},L.prototype.back=function(){this.__position>0&&(this.__position-=1)},L.prototype.hasNext=function(){return this.__position<this.__input_length},L.prototype.next=function(){var O=null;return this.hasNext()&&(O=this.__input.charAt(this.__position),this.__position+=1),O},L.prototype.peek=function(O){var G=null;return O=O||0,O+=this.__position,O>=0&&O<this.__input_length&&(G=this.__input.charAt(O)),G},L.prototype.__match=function(O,G){O.lastIndex=G;var he=O.exec(this.__input);return he&&!(M&&O.sticky)&&he.index!==G&&(he=null),he},L.prototype.test=function(O,G){return G=G||0,G+=this.__position,G>=0&&G<this.__input_length?!!this.__match(O,G):!1},L.prototype.testChar=function(O,G){var he=this.peek(G);return O.lastIndex=0,he!==null&&O.test(he)},L.prototype.match=function(O){var G=this.__match(O,this.__position);return G?this.__position+=G[0].length:G=null,G},L.prototype.read=function(O,G,he){var le="",J;return O&&(J=this.match(O),J&&(le+=J[0])),G&&(J||!O)&&(le+=this.readUntil(G,he)),le},L.prototype.readUntil=function(O,G){var he="",le=this.__position;O.lastIndex=this.__position;var J=O.exec(this.__input);return J?(le=J.index,G&&(le+=J[0].length)):le=this.__input_length,he=this.__input.substring(this.__position,le),this.__position=le,he},L.prototype.readUntilAfter=function(O){return this.readUntil(O,!0)},L.prototype.get_regexp=function(O,G){var he=null,le="g";return G&&M&&(le="y"),typeof O=="string"&&O!==""?he=new RegExp(O,le):O&&(he=new RegExp(O.source,le)),he},L.prototype.get_literal_regexp=function(O){return RegExp(O.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},L.prototype.peekUntilAfter=function(O){var G=this.__position,he=this.readUntilAfter(O);return this.__position=G,he},L.prototype.lookBack=function(O){var G=this.__position-1;return G>=O.length&&this.__input.substring(G-O.length,G).toLowerCase()===O},q.exports.InputScanner=L},function(q,M,L){var O=L(8).InputScanner,G=L(3).Token,he=L(10).TokenStream,le=L(11).WhitespacePattern,J={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},B=function(V,H){this._input=new O(V),this._options=H||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new le(this._input)};B.prototype.tokenize=function(){this._input.restart(),this.__tokens=new he,this._reset();for(var V,H=new G(J.START,""),ie=null,De=[],$e=new he;H.type!==J.EOF;){for(V=this._get_next_token(H,ie);this._is_comment(V);)$e.add(V),V=this._get_next_token(H,ie);$e.isEmpty()||(V.comments_before=$e,$e=new he),V.parent=ie,this._is_opening(V)?(De.push(ie),ie=V):ie&&this._is_closing(V,ie)&&(V.opened=ie,ie.closed=V,ie=De.pop(),V.parent=ie),V.previous=H,H.next=V,this.__tokens.add(V),H=V}return this.__tokens},B.prototype._is_first_token=function(){return this.__tokens.isEmpty()},B.prototype._reset=function(){},B.prototype._get_next_token=function(V,H){this._readWhitespace();var ie=this._input.read(/.+/g);return ie?this._create_token(J.RAW,ie):this._create_token(J.EOF,"")},B.prototype._is_comment=function(V){return!1},B.prototype._is_opening=function(V){return!1},B.prototype._is_closing=function(V,H){return!1},B.prototype._create_token=function(V,H){var ie=new G(V,H,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return ie},B.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},q.exports.Tokenizer=B,q.exports.TOKEN=J},function(q){function M(L){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=L}M.prototype.restart=function(){this.__position=0},M.prototype.isEmpty=function(){return this.__tokens_length===0},M.prototype.hasNext=function(){return this.__position<this.__tokens_length},M.prototype.next=function(){var L=null;return this.hasNext()&&(L=this.__tokens[this.__position],this.__position+=1),L},M.prototype.peek=function(L){var O=null;return L=L||0,L+=this.__position,L>=0&&L<this.__tokens_length&&(O=this.__tokens[L]),O},M.prototype.add=function(L){this.__parent_token&&(L.parent=this.__parent_token),this.__tokens.push(L),this.__tokens_length+=1},q.exports.TokenStream=M},function(q,M,L){var O=L(12).Pattern;function G(he,le){O.call(this,he,le),le?this._line_regexp=this._input.get_regexp(le._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}G.prototype=new O,G.prototype.__set_whitespace_patterns=function(he,le){he+="\\t ",le+="\\n\\r",this._match_pattern=this._input.get_regexp("["+he+le+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+le+"]")},G.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var he=this._input.read(this._match_pattern);if(he===" ")this.whitespace_before_token=" ";else if(he){var le=this.__split(this._newline_regexp,he);this.newline_count=le.length-1,this.whitespace_before_token=le[this.newline_count]}return he},G.prototype.matching=function(he,le){var J=this._create();return J.__set_whitespace_patterns(he,le),J._update(),J},G.prototype._create=function(){return new G(this._input,this)},G.prototype.__split=function(he,le){he.lastIndex=0;for(var J=0,B=[],V=he.exec(le);V;)B.push(le.substring(J,V.index)),J=V.index+V[0].length,V=he.exec(le);return J<le.length?B.push(le.substring(J,le.length)):B.push(""),B},q.exports.WhitespacePattern=G},function(q){function M(L,O){this._input=L,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,O&&(this._starting_pattern=this._input.get_regexp(O._starting_pattern,!0),this._match_pattern=this._input.get_regexp(O._match_pattern,!0),this._until_pattern=this._input.get_regexp(O._until_pattern),this._until_after=O._until_after)}M.prototype.read=function(){var L=this._input.read(this._starting_pattern);return(!this._starting_pattern||L)&&(L+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),L},M.prototype.read_match=function(){return this._input.match(this._match_pattern)},M.prototype.until_after=function(L){var O=this._create();return O._until_after=!0,O._until_pattern=this._input.get_regexp(L),O._update(),O},M.prototype.until=function(L){var O=this._create();return O._until_after=!1,O._until_pattern=this._input.get_regexp(L),O._update(),O},M.prototype.starting_with=function(L){var O=this._create();return O._starting_pattern=this._input.get_regexp(L,!0),O._update(),O},M.prototype.matching=function(L){var O=this._create();return O._match_pattern=this._input.get_regexp(L,!0),O._update(),O},M.prototype._create=function(){return new M(this._input,this)},M.prototype._update=function(){},q.exports.Pattern=M},function(q){function M(L,O){L=typeof L=="string"?L:L.source,O=typeof O=="string"?O:O.source,this.__directives_block_pattern=new RegExp(L+/ beautify( \w+[:]\w+)+ /.source+O,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(L+/\sbeautify\signore:end\s/.source+O,"g")}M.prototype.get_directives=function(L){if(!L.match(this.__directives_block_pattern))return null;var O={};this.__directive_pattern.lastIndex=0;for(var G=this.__directive_pattern.exec(L);G;)O[G[1]]=G[2],G=this.__directive_pattern.exec(L);return O},M.prototype.readIgnored=function(L){return L.readUntilAfter(this.__directives_end_ignore_pattern)},q.exports.Directives=M},function(q,M,L){var O=L(12).Pattern,G={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function he(le,J){O.call(this,le,J),this.__template_pattern=null,this._disabled=Object.assign({},G),this._excluded=Object.assign({},G),J&&(this.__template_pattern=this._input.get_regexp(J.__template_pattern),this._excluded=Object.assign(this._excluded,J._excluded),this._disabled=Object.assign(this._disabled,J._disabled));var B=new O(le);this.__patterns={handlebars_comment:B.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:B.starting_with(/{{{/).until_after(/}}}/),handlebars:B.starting_with(/{{/).until_after(/}}/),php:B.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:B.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:B.starting_with(/{%/).until_after(/%}/),django_value:B.starting_with(/{{/).until_after(/}}/),django_comment:B.starting_with(/{#/).until_after(/#}/),smarty:B.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:B.starting_with(/{\*/).until_after(/\*}/),smarty_literal:B.starting_with(/{literal}/).until_after(/{\/literal}/)}}he.prototype=new O,he.prototype._create=function(){return new he(this._input,this)},he.prototype._update=function(){this.__set_templated_pattern()},he.prototype.disable=function(le){var J=this._create();return J._disabled[le]=!0,J._update(),J},he.prototype.read_options=function(le){var J=this._create();for(var B in G)J._disabled[B]=le.templating.indexOf(B)===-1;return J._update(),J},he.prototype.exclude=function(le){var J=this._create();return J._excluded[le]=!0,J._update(),J},he.prototype.read=function(){var le="";this._match_pattern?le=this._input.read(this._starting_pattern):le=this._input.read(this._starting_pattern,this.__template_pattern);for(var J=this._read_template();J;)this._match_pattern?J+=this._input.read(this._match_pattern):J+=this._input.readUntil(this.__template_pattern),le+=J,J=this._read_template();return this._until_after&&(le+=this._input.readUntilAfter(this._until_pattern)),le},he.prototype.__set_templated_pattern=function(){var le=[];this._disabled.php||le.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||le.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||le.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||le.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(le.push(this.__patterns.django._starting_pattern.source),le.push(this.__patterns.django_value._starting_pattern.source),le.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||le.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&le.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+le.join("|")+")")},he.prototype._read_template=function(){var le="",J=this._input.peek();if(J==="<"){var B=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&B==="?"&&(le=le||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&B==="%"&&(le=le||this.__patterns.erb.read())}else J==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(le=le||this.__patterns.handlebars_comment.read(),le=le||this.__patterns.handlebars_unescaped.read(),le=le||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(le=le||this.__patterns.django_value.read()),this._excluded.django||(le=le||this.__patterns.django_comment.read(),le=le||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(le=le||this.__patterns.smarty_comment.read(),le=le||this.__patterns.smarty_literal.read(),le=le||this.__patterns.smarty.read()));return le},q.exports.TemplatablePattern=he},,,,function(q,M,L){var O=L(19).Beautifier,G=L(20).Options;function he(le,J,B,V){var H=new O(le,J,B,V);return H.beautify()}q.exports=he,q.exports.defaultOptions=function(){return new G}},function(q,M,L){var O=L(20).Options,G=L(2).Output,he=L(21).Tokenizer,le=L(21).TOKEN,J=/\r\n|[\r\n]/,B=/\r\n|[\r\n]/g,V=function(ye,oe){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=ye.max_preserve_newlines,this.preserve_newlines=ye.preserve_newlines,this._output=new G(ye,oe)};V.prototype.current_line_has_match=function(ye){return this._output.current_line.has_match(ye)},V.prototype.set_space_before_token=function(ye,oe){this._output.space_before_token=ye,this._output.non_breaking_space=oe},V.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},V.prototype.add_raw_token=function(ye){this._output.add_raw_token(ye)},V.prototype.print_preserved_newlines=function(ye){var oe=0;ye.type!==le.TEXT&&ye.previous.type!==le.TEXT&&(oe=ye.newlines?1:0),this.preserve_newlines&&(oe=ye.newlines<this.max_preserve_newlines+1?ye.newlines:this.max_preserve_newlines+1);for(var me=0;me<oe;me++)this.print_newline(me>0);return oe!==0},V.prototype.traverse_whitespace=function(ye){return ye.whitespace_before||ye.newlines?(this.print_preserved_newlines(ye)||(this._output.space_before_token=!0),!0):!1},V.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},V.prototype.print_newline=function(ye){this._output.add_new_line(ye)},V.prototype.print_token=function(ye){ye.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(ye.text))},V.prototype.indent=function(){this.indent_level++},V.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},V.prototype.get_full_indent=function(ye){return ye=this.indent_level+(ye||0),ye<1?"":this._output.get_indent_string(ye)};var H=function(ye){for(var oe=null,me=ye.next;me.type!==le.EOF&&ye.closed!==me;){if(me.type===le.ATTRIBUTE&&me.text==="type"){me.next&&me.next.type===le.EQUALS&&me.next.next&&me.next.next.type===le.VALUE&&(oe=me.next.next.text);break}me=me.next}return oe},ie=function(ye,oe){var me=null,ge=null;return oe.closed?(ye==="script"?me="text/javascript":ye==="style"&&(me="text/css"),me=H(oe)||me,me.search("text/css")>-1?ge="css":me.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?ge="javascript":me.search(/(text|application|dojo)\/(x-)?(html)/)>-1?ge="html":me.search(/test\/null/)>-1&&(ge="null"),ge):null};function De(ye,oe){return oe.indexOf(ye)!==-1}function $e(ye,oe,me){this.parent=ye||null,this.tag=oe?oe.tag_name:"",this.indent_level=me||0,this.parser_token=oe||null}function Se(ye){this._printer=ye,this._current_frame=null}Se.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},Se.prototype.record_tag=function(ye){var oe=new $e(this._current_frame,ye,this._printer.indent_level);this._current_frame=oe},Se.prototype._try_pop_frame=function(ye){var oe=null;return ye&&(oe=ye.parser_token,this._printer.indent_level=ye.indent_level,this._current_frame=ye.parent),oe},Se.prototype._get_frame=function(ye,oe){for(var me=this._current_frame;me&&ye.indexOf(me.tag)===-1;){if(oe&&oe.indexOf(me.tag)!==-1){me=null;break}me=me.parent}return me},Se.prototype.try_pop=function(ye,oe){var me=this._get_frame([ye],oe);return this._try_pop_frame(me)},Se.prototype.indent_to_tag=function(ye){var oe=this._get_frame(ye);oe&&(this._printer.indent_level=oe.indent_level)};function Ye(ye,oe,me,ge){this._source_text=ye||"",oe=oe||{},this._js_beautify=me,this._css_beautify=ge,this._tag_stack=null;var Ee=new O(oe,"html");this._options=Ee,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"}Ye.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var ye=this._source_text,oe=this._options.eol;this._options.eol==="auto"&&(oe=`
`,ye&&J.test(ye)&&(oe=ye.match(J)[0])),ye=ye.replace(B,`
`);var me=ye.match(/^[\t ]*/)[0],ge={text:"",type:""},Ee=new lt(this._options),be=new V(this._options,me),D=new he(ye,this._options).tokenize();this._tag_stack=new Se(be);for(var R=null,se=D.next();se.type!==le.EOF;)se.type===le.TAG_OPEN||se.type===le.COMMENT?(R=this._handle_tag_open(be,se,Ee,ge,D),Ee=R):se.type===le.ATTRIBUTE||se.type===le.EQUALS||se.type===le.VALUE||se.type===le.TEXT&&!Ee.tag_complete?R=this._handle_inside_tag(be,se,Ee,ge):se.type===le.TAG_CLOSE?R=this._handle_tag_close(be,se,Ee):se.type===le.TEXT?R=this._handle_text(be,se,Ee):se.type===le.CONTROL_FLOW_OPEN?R=this._handle_control_flow_open(be,se):se.type===le.CONTROL_FLOW_CLOSE?R=this._handle_control_flow_close(be,se):be.add_raw_token(se),ge=R,se=D.next();var Ie=be._output.get_code(oe);return Ie},Ye.prototype._handle_control_flow_open=function(ye,oe){var me={text:oe.text,type:oe.type};return ye.set_space_before_token(oe.newlines||oe.whitespace_before!=="",!0),oe.newlines?ye.print_preserved_newlines(oe):ye.set_space_before_token(oe.newlines||oe.whitespace_before!=="",!0),ye.print_token(oe),ye.indent(),me},Ye.prototype._handle_control_flow_close=function(ye,oe){var me={text:oe.text,type:oe.type};return ye.deindent(),oe.newlines?ye.print_preserved_newlines(oe):ye.set_space_before_token(oe.newlines||oe.whitespace_before!=="",!0),ye.print_token(oe),me},Ye.prototype._handle_tag_close=function(ye,oe,me){var ge={text:oe.text,type:oe.type};return ye.alignment_size=0,me.tag_complete=!0,ye.set_space_before_token(oe.newlines||oe.whitespace_before!=="",!0),me.is_unformatted?ye.add_raw_token(oe):(me.tag_start_char==="<"&&(ye.set_space_before_token(oe.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&me.has_wrapped_attrs&&ye.print_newline(!1)),ye.print_token(oe)),me.indent_content&&!(me.is_unformatted||me.is_content_unformatted)&&(ye.indent(),me.indent_content=!1),!me.is_inline_element&&!(me.is_unformatted||me.is_content_unformatted)&&ye.set_wrap_point(),ge},Ye.prototype._handle_inside_tag=function(ye,oe,me,ge){var Ee=me.has_wrapped_attrs,be={text:oe.text,type:oe.type};return ye.set_space_before_token(oe.newlines||oe.whitespace_before!=="",!0),me.is_unformatted?ye.add_raw_token(oe):me.tag_start_char==="{"&&oe.type===le.TEXT?ye.print_preserved_newlines(oe)?(oe.newlines=0,ye.add_raw_token(oe)):ye.print_token(oe):(oe.type===le.ATTRIBUTE?ye.set_space_before_token(!0):(oe.type===le.EQUALS||oe.type===le.VALUE&&oe.previous.type===le.EQUALS)&&ye.set_space_before_token(!1),oe.type===le.ATTRIBUTE&&me.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(ye.traverse_whitespace(oe),Ee=Ee||oe.newlines!==0),this._is_wrap_attributes_force&&me.attr_count>=this._options.wrap_attributes_min_attrs&&(ge.type!==le.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(ye.print_newline(!1),Ee=!0)),ye.print_token(oe),Ee=Ee||ye.previous_token_wrapped(),me.has_wrapped_attrs=Ee),be},Ye.prototype._handle_text=function(ye,oe,me){var ge={text:oe.text,type:"TK_CONTENT"};return me.custom_beautifier_name?this._print_custom_beatifier_text(ye,oe,me):me.is_unformatted||me.is_content_unformatted?ye.add_raw_token(oe):(ye.traverse_whitespace(oe),ye.print_token(oe)),ge},Ye.prototype._print_custom_beatifier_text=function(ye,oe,me){var ge=this;if(oe.text!==""){var Ee=oe.text,be,D=1,R="",se="";me.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?be=this._js_beautify:me.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?be=this._css_beautify:me.custom_beautifier_name==="html"&&(be=function(Ht,gt){var Qe=new Ye(Ht,gt,ge._js_beautify,ge._css_beautify);return Qe.beautify()}),this._options.indent_scripts==="keep"?D=0:this._options.indent_scripts==="separate"&&(D=-ye.indent_level);var Ie=ye.get_full_indent(D);if(Ee=Ee.replace(/\n[ \t]*$/,""),me.custom_beautifier_name!=="html"&&Ee[0]==="<"&&Ee.match(/^(<!--|<!\[CDATA\[)/)){var at=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(Ee);if(!at){ye.add_raw_token(oe);return}R=Ie+at[1]+`
`,Ee=at[4],at[5]&&(se=Ie+at[5]),Ee=Ee.replace(/\n[ \t]*$/,""),(at[2]||at[3].indexOf(`
`)!==-1)&&(at=at[3].match(/[ \t]+$/),at&&(oe.whitespace_before=at[0]))}if(Ee)if(be){var Et=function(){this.eol=`
`};Et.prototype=this._options.raw_options;var bt=new Et;Ee=be(Ie+Ee,bt)}else{var He=oe.whitespace_before;He&&(Ee=Ee.replace(new RegExp(`
(`+He+")?","g"),`
`)),Ee=Ie+Ee.replace(/\n/g,`
`+Ie)}R&&(Ee?Ee=R+Ee+`
`+se:Ee=R+se),ye.print_newline(!1),Ee&&(oe.text=Ee,oe.whitespace_before="",oe.newlines=0,ye.add_raw_token(oe),ye.print_newline(!0))}},Ye.prototype._handle_tag_open=function(ye,oe,me,ge,Ee){var be=this._get_tag_open_token(oe);if((me.is_unformatted||me.is_content_unformatted)&&!me.is_empty_element&&oe.type===le.TAG_OPEN&&!be.is_start_tag?(ye.add_raw_token(oe),be.start_tag_token=this._tag_stack.try_pop(be.tag_name)):(ye.traverse_whitespace(oe),this._set_tag_position(ye,oe,be,me,ge),be.is_inline_element||ye.set_wrap_point(),ye.print_token(oe)),be.is_start_tag&&this._is_wrap_attributes_force){var D=0,R;do R=Ee.peek(D),R.type===le.ATTRIBUTE&&(be.attr_count+=1),D+=1;while(R.type!==le.EOF&&R.type!==le.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(be.alignment_size=oe.text.length+1),!be.tag_complete&&!be.is_unformatted&&(ye.alignment_size=be.alignment_size),be};var lt=function(ye,oe,me){if(this.parent=oe||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="",!me)this.tag_complete=!0;else{var ge;this.tag_start_char=me.text[0],this.text=me.text,this.tag_start_char==="<"?(ge=me.text.match(/^<([^\s>]*)/),this.tag_check=ge?ge[1]:""):(ge=me.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=ge?ge[1]:"",(me.text.startsWith("{{#>")||me.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&me.next!==null?this.tag_check=me.next.text.split(" ")[0]:this.tag_check=me.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),me.type===le.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||me.closed&&me.closed.text==="/>";var Ee=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(Ee=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!ye.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(Ee)))}};Ye.prototype._get_tag_open_token=function(ye){var oe=new lt(this._options,this._tag_stack.get_parser_token(),ye);return oe.alignment_size=this._options.wrap_attributes_indent_size,oe.is_end_tag=oe.is_end_tag||De(oe.tag_check,this._options.void_elements),oe.is_empty_element=oe.tag_complete||oe.is_start_tag&&oe.is_end_tag,oe.is_unformatted=!oe.tag_complete&&De(oe.tag_check,this._options.unformatted),oe.is_content_unformatted=!oe.is_empty_element&&De(oe.tag_check,this._options.content_unformatted),oe.is_inline_element=De(oe.tag_name,this._options.inline)||this._options.inline_custom_elements&&oe.tag_name.includes("-")||oe.tag_start_char==="{",oe},Ye.prototype._set_tag_position=function(ye,oe,me,ge,Ee){if(me.is_empty_element||(me.is_end_tag?me.start_tag_token=this._tag_stack.try_pop(me.tag_name):(this._do_optional_end_element(me)&&(me.is_inline_element||ye.print_newline(!1)),this._tag_stack.record_tag(me),(me.tag_name==="script"||me.tag_name==="style")&&!(me.is_unformatted||me.is_content_unformatted)&&(me.custom_beautifier_name=ie(me.tag_check,oe)))),De(me.tag_check,this._options.extra_liners)&&(ye.print_newline(!1),ye._output.just_added_blankline()||ye.print_newline(!0)),me.is_empty_element){if(me.tag_start_char==="{"&&me.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),me.indent_content=!0;var be=ye.current_line_has_match(/{{#if/);be||ye.print_newline(!1)}me.tag_name==="!--"&&Ee.type===le.TAG_CLOSE&&ge.is_end_tag&&me.text.indexOf(`
`)===-1||(me.is_inline_element||me.is_unformatted||ye.print_newline(!1),this._calcluate_parent_multiline(ye,me))}else if(me.is_end_tag){var D=!1;D=me.start_tag_token&&me.start_tag_token.multiline_content,D=D||!me.is_inline_element&&!(ge.is_inline_element||ge.is_unformatted)&&!(Ee.type===le.TAG_CLOSE&&me.start_tag_token===ge)&&Ee.type!=="TK_CONTENT",(me.is_content_unformatted||me.is_unformatted)&&(D=!1),D&&ye.print_newline(!1)}else me.indent_content=!me.custom_beautifier_name,me.tag_start_char==="<"&&(me.tag_name==="html"?me.indent_content=this._options.indent_inner_html:me.tag_name==="head"?me.indent_content=this._options.indent_head_inner_html:me.tag_name==="body"&&(me.indent_content=this._options.indent_body_inner_html)),!(me.is_inline_element||me.is_unformatted)&&(Ee.type!=="TK_CONTENT"||me.is_content_unformatted)&&ye.print_newline(!1),this._calcluate_parent_multiline(ye,me)},Ye.prototype._calcluate_parent_multiline=function(ye,oe){oe.parent&&ye._output.just_added_newline()&&!((oe.is_inline_element||oe.is_unformatted)&&oe.parent.is_inline_element)&&(oe.parent.multiline_content=!0)};var Xe=["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"],$t=["a","audio","del","ins","map","noscript","video"];Ye.prototype._do_optional_end_element=function(ye){var oe=null;if(!(ye.is_empty_element||!ye.is_start_tag||!ye.parent)){if(ye.tag_name==="body")oe=oe||this._tag_stack.try_pop("head");else if(ye.tag_name==="li")oe=oe||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(ye.tag_name==="dd"||ye.tag_name==="dt")oe=oe||this._tag_stack.try_pop("dt",["dl"]),oe=oe||this._tag_stack.try_pop("dd",["dl"]);else if(ye.parent.tag_name==="p"&&Xe.indexOf(ye.tag_name)!==-1){var me=ye.parent.parent;(!me||$t.indexOf(me.tag_name)===-1)&&(oe=oe||this._tag_stack.try_pop("p"))}else ye.tag_name==="rp"||ye.tag_name==="rt"?(oe=oe||this._tag_stack.try_pop("rt",["ruby","rtc"]),oe=oe||this._tag_stack.try_pop("rp",["ruby","rtc"])):ye.tag_name==="optgroup"?oe=oe||this._tag_stack.try_pop("optgroup",["select"]):ye.tag_name==="option"?oe=oe||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):ye.tag_name==="colgroup"?oe=oe||this._tag_stack.try_pop("caption",["table"]):ye.tag_name==="thead"?(oe=oe||this._tag_stack.try_pop("caption",["table"]),oe=oe||this._tag_stack.try_pop("colgroup",["table"])):ye.tag_name==="tbody"||ye.tag_name==="tfoot"?(oe=oe||this._tag_stack.try_pop("caption",["table"]),oe=oe||this._tag_stack.try_pop("colgroup",["table"]),oe=oe||this._tag_stack.try_pop("thead",["table"]),oe=oe||this._tag_stack.try_pop("tbody",["table"])):ye.tag_name==="tr"?(oe=oe||this._tag_stack.try_pop("caption",["table"]),oe=oe||this._tag_stack.try_pop("colgroup",["table"]),oe=oe||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(ye.tag_name==="th"||ye.tag_name==="td")&&(oe=oe||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),oe=oe||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return ye.parent=this._tag_stack.get_parser_token(),oe}},q.exports.Beautifier=Ye},function(q,M,L){var O=L(6).Options;function G(he){O.call(this,he,"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"])}G.prototype=new O,q.exports.Options=G},function(q,M,L){var O=L(9).Tokenizer,G=L(9).TOKEN,he=L(13).Directives,le=L(14).TemplatablePattern,J=L(12).Pattern,B={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:G.START,RAW:G.RAW,EOF:G.EOF},V=new he(/<\!--/,/-->/),H=function(ie,De){O.call(this,ie,De),this._current_tag_name="";var $e=new le(this._input).read_options(this._options),Se=new J(this._input);if(this.__patterns={word:$e.until(/[\n\r\t <]/),word_control_flow_close_excluded:$e.until(/[\n\r\t <}]/),single_quote:$e.until_after(/'/),double_quote:$e.until_after(/"/),attribute:$e.until(/[\n\r\t =>]|\/>/),element_name:$e.until(/[\n\r\t >\/]/),angular_control_flow_start:Se.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:Se.starting_with(/{{!--/).until_after(/--}}/),handlebars:Se.starting_with(/{{/).until_after(/}}/),handlebars_open:Se.until(/[\n\r\t }]/),handlebars_raw_close:Se.until(/}}/),comment:Se.starting_with(/<!--/).until_after(/-->/),cdata:Se.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:Se.starting_with(/<!\[/).until_after(/]>/),processing:Se.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 Ye=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=Se.matching(Ye).until_after(Ye)}};H.prototype=new O,H.prototype._is_comment=function(ie){return!1},H.prototype._is_opening=function(ie){return ie.type===B.TAG_OPEN||ie.type===B.CONTROL_FLOW_OPEN},H.prototype._is_closing=function(ie,De){return ie.type===B.TAG_CLOSE&&De&&((ie.text===">"||ie.text==="/>")&&De.text[0]==="<"||ie.text==="}}"&&De.text[0]==="{"&&De.text[1]==="{")||ie.type===B.CONTROL_FLOW_CLOSE&&ie.text==="}"&&De.text.endsWith("{")},H.prototype._reset=function(){this._current_tag_name=""},H.prototype._get_next_token=function(ie,De){var $e=null;this._readWhitespace();var Se=this._input.peek();return Se===null?this._create_token(B.EOF,""):($e=$e||this._read_open_handlebars(Se,De),$e=$e||this._read_attribute(Se,ie,De),$e=$e||this._read_close(Se,De),$e=$e||this._read_script_and_style(Se,ie),$e=$e||this._read_control_flows(Se,De),$e=$e||this._read_raw_content(Se,ie,De),$e=$e||this._read_content_word(Se,De),$e=$e||this._read_comment_or_cdata(Se),$e=$e||this._read_processing(Se),$e=$e||this._read_open(Se,De),$e=$e||this._create_token(B.UNKNOWN,this._input.next()),$e)},H.prototype._read_comment_or_cdata=function(ie){var De=null,$e=null,Se=null;if(ie==="<"){var Ye=this._input.peek(1);Ye==="!"&&($e=this.__patterns.comment.read(),$e?(Se=V.get_directives($e),Se&&Se.ignore==="start"&&($e+=V.readIgnored(this._input))):$e=this.__patterns.cdata.read()),$e&&(De=this._create_token(B.COMMENT,$e),De.directives=Se)}return De},H.prototype._read_processing=function(ie){var De=null,$e=null,Se=null;if(ie==="<"){var Ye=this._input.peek(1);(Ye==="!"||Ye==="?")&&($e=this.__patterns.conditional_comment.read(),$e=$e||this.__patterns.processing.read()),$e&&(De=this._create_token(B.COMMENT,$e),De.directives=Se)}return De},H.prototype._read_open=function(ie,De){var $e=null,Se=null;return(!De||De.type===B.CONTROL_FLOW_OPEN)&&ie==="<"&&($e=this._input.next(),this._input.peek()==="/"&&($e+=this._input.next()),$e+=this.__patterns.element_name.read(),Se=this._create_token(B.TAG_OPEN,$e)),Se},H.prototype._read_open_handlebars=function(ie,De){var $e=null,Se=null;return(!De||De.type===B.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&ie==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?($e=this.__patterns.handlebars_comment.read(),$e=$e||this.__patterns.handlebars.read(),Se=this._create_token(B.COMMENT,$e)):($e=this.__patterns.handlebars_open.read(),Se=this._create_token(B.TAG_OPEN,$e))),Se},H.prototype._read_control_flows=function(ie,De){var $e="",Se=null;if(!this._options.templating.includes("angular"))return Se;if(ie==="@"){if($e=this.__patterns.angular_control_flow_start.read(),$e==="")return Se;for(var Ye=$e.endsWith("(")?1:0,lt=0;!($e.endsWith("{")&&Ye===lt);){var Xe=this._input.next();if(Xe===null)break;Xe==="("?Ye++:Xe===")"&&lt++,$e+=Xe}Se=this._create_token(B.CONTROL_FLOW_OPEN,$e)}else ie==="}"&&De&&De.type===B.CONTROL_FLOW_OPEN&&($e=this._input.next(),Se=this._create_token(B.CONTROL_FLOW_CLOSE,$e));return Se},H.prototype._read_close=function(ie,De){var $e=null,Se=null;return De&&De.type===B.TAG_OPEN&&(De.text[0]==="<"&&(ie===">"||ie==="/"&&this._input.peek(1)===">")?($e=this._input.next(),ie==="/"&&($e+=this._input.next()),Se=this._create_token(B.TAG_CLOSE,$e)):De.text[0]==="{"&&ie==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),Se=this._create_token(B.TAG_CLOSE,"}}"))),Se},H.prototype._read_attribute=function(ie,De,$e){var Se=null,Ye="";if($e&&$e.text[0]==="<")if(ie==="=")Se=this._create_token(B.EQUALS,this._input.next());else if(ie==='"'||ie==="'"){var lt=this._input.next();ie==='"'?lt+=this.__patterns.double_quote.read():lt+=this.__patterns.single_quote.read(),Se=this._create_token(B.VALUE,lt)}else Ye=this.__patterns.attribute.read(),Ye&&(De.type===B.EQUALS?Se=this._create_token(B.VALUE,Ye):Se=this._create_token(B.ATTRIBUTE,Ye));return Se},H.prototype._is_content_unformatted=function(ie){return this._options.void_elements.indexOf(ie)===-1&&(this._options.content_unformatted.indexOf(ie)!==-1||this._options.unformatted.indexOf(ie)!==-1)},H.prototype._read_raw_content=function(ie,De,$e){var Se="";if($e&&$e.text[0]==="{")Se=this.__patterns.handlebars_raw_close.read();else if(De.type===B.TAG_CLOSE&&De.opened.text[0]==="<"&&De.text[0]!=="/"){var Ye=De.opened.text.substr(1).toLowerCase();this._is_content_unformatted(Ye)&&(Se=this._input.readUntil(new RegExp("</"+Ye+"[\\n\\r\\t ]*?>","ig")))}return Se?this._create_token(B.TEXT,Se):null},H.prototype._read_script_and_style=function(ie,De){if(De.type===B.TAG_CLOSE&&De.opened.text[0]==="<"&&De.text[0]!=="/"){var $e=De.opened.text.substr(1).toLowerCase();if($e==="script"||$e==="style"){var Se=this._read_comment_or_cdata(ie);if(Se)return Se.type=B.TEXT,Se;var Ye=this._input.readUntil(new RegExp("</"+$e+"[\\n\\r\\t ]*?>","ig"));if(Ye)return this._create_token(B.TEXT,Ye)}}return null},H.prototype._read_content_word=function(ie,De){var $e="";return this._options.unformatted_content_delimiter&&ie===this._options.unformatted_content_delimiter[0]&&($e=this.__patterns.unformatted_content_delimiter.read()),$e||($e=De&&De.type===B.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),$e?this._create_token(B.TEXT,$e):null},q.exports.Tokenizer=H,q.exports.TOKEN=B}],z={};function d(q){var M=z[q];if(M!==void 0)return M.exports;var L=z[q]={exports:{}};return Te[q](L,L.exports,d),L.exports}var ne=d(18);We=ne})();var Me=We;if(1)U=[Y,Y(58553),Y(87804)],Pe=function(Te){var z=Y(58553),d=Y(87804);return{html_beautify:function(ne,q){return Me(ne,q,z.js_beautify,d.css_beautify)}}}.apply(Ct,U),Pe!==void 0&&(Fr.exports=Pe);else var ae,E})()},58553:function(Fr,Ct){var Y,U;(function(){var Pe;(function(){"use strict";var Me=[function(z,d,ne){var q=ne(1).Beautifier,M=ne(5).Options;function L(O,G){var he=new q(O,G);return he.beautify()}z.exports=L,z.exports.defaultOptions=function(){return new M}},function(z,d,ne){var q=ne(2).Output,M=ne(3).Token,L=ne(4),O=ne(5).Options,G=ne(7).Tokenizer,he=ne(7).line_starters,le=ne(7).positionable_operators,J=ne(7).TOKEN;function B(R,se){return se.indexOf(R)!==-1}function V(R){return R.replace(/^\s+/g,"")}function H(R){for(var se={},Ie=0;Ie<R.length;Ie++)se[R[Ie].replace(/-/g,"_")]=R[Ie];return se}function ie(R,se){return R&&R.type===J.RESERVED&&R.text===se}function De(R,se){return R&&R.type===J.RESERVED&&B(R.text,se)}var $e=["case","return","do","if","throw","else","await","break","continue","async"],Se=["before-newline","after-newline","preserve-newline"],Ye=H(Se),lt=[Ye.before_newline,Ye.preserve_newline],Xe={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function $t(R,se){se.multiline_frame||se.mode===Xe.ForInitializer||se.mode===Xe.Conditional||R.remove_indent(se.start_line_index)}function ye(R){R=R.replace(L.allLineBreaks,`
`);for(var se=[],Ie=R.indexOf(`
`);Ie!==-1;)se.push(R.substring(0,Ie)),R=R.substring(Ie+1),Ie=R.indexOf(`
`);return R.length&&se.push(R),se}function oe(R){return R===Xe.ArrayLiteral}function me(R){return B(R,[Xe.Expression,Xe.ForInitializer,Xe.Conditional])}function ge(R,se){for(var Ie=0;Ie<R.length;Ie++){var at=R[Ie].trim();if(at.charAt(0)!==se)return!1}return!0}function Ee(R,se){for(var Ie=0,at=R.length,Et;Ie<at;Ie++)if(Et=R[Ie],Et&&Et.indexOf(se)!==0)return!1;return!0}function be(R,se){se=se||{},this._source_text=R||"",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 O(se)}be.prototype.create_flags=function(R,se){var Ie=0;R&&(Ie=R.indentation_level,!this._output.just_added_newline()&&R.line_indent_level>Ie&&(Ie=R.line_indent_level));var at={mode:se,parent:R,last_token:R?R.last_token:new M(J.START_BLOCK,""),last_word:R?R.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:Ie,alignment:0,line_indent_level:R?R.line_indent_level:Ie,start_line_index:this._output.get_line_number(),ternary_depth:0};return at},be.prototype._reset=function(R){var se=R.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new q(this._options,se),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Xe.BlockStatement);var Ie=new G(R,this._options);return this._tokens=Ie.tokenize(),R},be.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R,se=this._reset(this._source_text),Ie=this._options.eol;this._options.eol==="auto"&&(Ie=`
`,se&&L.lineBreak.test(se||"")&&(Ie=se.match(L.lineBreak)[0]));for(var at=this._tokens.next();at;)this.handle_token(at),this._last_last_text=this._flags.last_token.text,this._flags.last_token=at,at=this._tokens.next();return R=this._output.get_code(Ie),R},be.prototype.handle_token=function(R,se){R.type===J.START_EXPR?this.handle_start_expr(R):R.type===J.END_EXPR?this.handle_end_expr(R):R.type===J.START_BLOCK?this.handle_start_block(R):R.type===J.END_BLOCK?this.handle_end_block(R):R.type===J.WORD?this.handle_word(R):R.type===J.RESERVED?this.handle_word(R):R.type===J.SEMICOLON?this.handle_semicolon(R):R.type===J.STRING?this.handle_string(R):R.type===J.EQUALS?this.handle_equals(R):R.type===J.OPERATOR?this.handle_operator(R):R.type===J.COMMA?this.handle_comma(R):R.type===J.BLOCK_COMMENT?this.handle_block_comment(R,se):R.type===J.COMMENT?this.handle_comment(R,se):R.type===J.DOT?this.handle_dot(R):R.type===J.EOF?this.handle_eof(R):R.type===J.UNKNOWN?this.handle_unknown(R,se):this.handle_unknown(R,se)},be.prototype.handle_whitespace_and_comments=function(R,se){var Ie=R.newlines,at=this._options.keep_array_indentation&&oe(this._flags.mode);if(R.comments_before)for(var Et=R.comments_before.next();Et;)this.handle_whitespace_and_comments(Et,se),this.handle_token(Et,se),Et=R.comments_before.next();if(at)for(var bt=0;bt<Ie;bt+=1)this.print_newline(bt>0,se);else if(this._options.max_preserve_newlines&&Ie>this._options.max_preserve_newlines&&(Ie=this._options.max_preserve_newlines),this._options.preserve_newlines&&Ie>1){this.print_newline(!1,se);for(var He=1;He<Ie;He+=1)this.print_newline(!0,se)}};var D=["async","break","continue","return","throw","yield"];be.prototype.allow_wrap_or_preserved_newline=function(R,se){if(se=se===void 0?!1:se,!this._output.just_added_newline()){var Ie=this._options.preserve_newlines&&R.newlines||se,at=B(this._flags.last_token.text,le)||B(R.text,le);if(at){var Et=B(this._flags.last_token.text,le)&&B(this._options.operator_position,lt)||B(R.text,le);Ie=Ie&&Et}if(Ie)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(De(this._flags.last_token,D))return;this._output.set_wrap_point()}}},be.prototype.print_newline=function(R,se){if(!se&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==J.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var Ie=this._tokens.peek();this._flags.mode===Xe.Statement&&!(this._flags.if_block&&ie(Ie,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(R)&&(this._flags.multiline_frame=!0)},be.prototype.print_token_line_indentation=function(R){this._output.just_added_newline()&&(this._options.keep_array_indentation&&R.newlines&&(R.text==="["||oe(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(R.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))},be.prototype.print_token=function(R){if(this._output.raw){this._output.add_raw_token(R);return}if(this._options.comma_first&&R.previous&&R.previous.type===J.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var se=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(se),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(R),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(R),this._output.non_breaking_space=!0,this._output.add_token(R.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},be.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},be.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))},be.prototype.set_mode=function(R){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,R),this._flags=this.create_flags(this._previous_flags,R),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},be.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Xe.Statement&&$t(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},be.prototype.start_of_object_property=function(){return this._flags.parent.mode===Xe.ObjectLiteral&&this._flags.mode===Xe.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||De(this._flags.last_token,["get","set"]))},be.prototype.start_of_statement=function(R){var se=!1;return se=se||De(this._flags.last_token,["var","let","const"])&&R.type===J.WORD,se=se||ie(this._flags.last_token,"do"),se=se||!(this._flags.parent.mode===Xe.ObjectLiteral&&this._flags.mode===Xe.Statement)&&De(this._flags.last_token,D)&&!R.newlines,se=se||ie(this._flags.last_token,"else")&&!(ie(R,"if")&&!R.comments_before),se=se||this._flags.last_token.type===J.END_EXPR&&(this._previous_flags.mode===Xe.ForInitializer||this._previous_flags.mode===Xe.Conditional),se=se||this._flags.last_token.type===J.WORD&&this._flags.mode===Xe.BlockStatement&&!this._flags.in_case&&!(R.text==="--"||R.text==="++")&&this._last_last_text!=="function"&&R.type!==J.WORD&&R.type!==J.RESERVED,se=se||this._flags.mode===Xe.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||De(this._flags.last_token,["get","set"])),se?(this.set_mode(Xe.Statement),this.indent(),this.handle_whitespace_and_comments(R,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R,De(R,["do","for","if","while"])),!0):!1},be.prototype.handle_start_expr=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R);var se=Xe.Expression;if(R.text==="["){if(this._flags.last_token.type===J.WORD||this._flags.last_token.text===")"){De(this._flags.last_token,he)&&(this._output.space_before_token=!0),this.print_token(R),this.set_mode(se),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}se=Xe.ArrayLiteral,oe(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()),B(this._flags.last_token.type,[J.START_EXPR,J.END_EXPR,J.WORD,J.OPERATOR,J.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===J.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,se=Xe.ForInitializer):B(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,se=Xe.Conditional):B(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&R.whitespace_before===""?this._output.space_before_token=!1:(B(this._flags.last_token.text,he)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===J.EQUALS||this._flags.last_token.type===J.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R);else if(this._flags.last_token.type===J.WORD){this._output.space_before_token=!1;var Ie=this._tokens.peek(-3);if(this._options.space_after_named_function&&Ie){var at=this._tokens.peek(-4);De(Ie,["async","function"])||Ie.text==="*"&&De(at,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Xe.ObjectLiteral?(Ie.text==="{"||Ie.text===","||Ie.text==="*"&&(at.text==="{"||at.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(R);(this._flags.last_token.type===J.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(B(this._last_last_text,["function","yield"])||this._flags.mode===Xe.ObjectLiteral&&B(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===J.START_BLOCK?this.print_newline():(this._flags.last_token.type===J.END_EXPR||this._flags.last_token.type===J.START_EXPR||this._flags.last_token.type===J.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===J.COMMA)&&this.allow_wrap_or_preserved_newline(R,R.newlines),this.print_token(R),this.set_mode(se),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},be.prototype.handle_end_expr=function(R){for(;this._flags.mode===Xe.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(R,R.text==="]"&&oe(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===J.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(R),this.restore_mode(),$t(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Xe.Conditional&&(this._previous_flags.mode=Xe.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},be.prototype.handle_start_block=function(R){this.handle_whitespace_and_comments(R);var se=this._tokens.peek(),Ie=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===J.END_EXPR?(this.set_mode(Xe.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Xe.BlockStatement):Ie&&(B(Ie.text,[":",","])&&B(se.type,[J.STRING,J.WORD,J.RESERVED])||B(se.text,["get","set","..."])&&B(Ie.type,[J.WORD,J.RESERVED]))?B(this._last_last_text,["class","interface"])&&!B(Ie.text,[":",","])?this.set_mode(Xe.BlockStatement):this.set_mode(Xe.ObjectLiteral):this._flags.last_token.type===J.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Xe.BlockStatement):B(this._flags.last_token.type,[J.EQUALS,J.START_EXPR,J.COMMA,J.OPERATOR])||De(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Xe.ObjectLiteral):this.set_mode(Xe.BlockStatement),this._flags.last_token&&De(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var at=!se.comments_before&&se.text==="}",Et=at&&this._flags.last_word==="function"&&this._flags.last_token.type===J.END_EXPR;if(this._options.brace_preserve_inline){var bt=0,He=null;this._flags.inline_frame=!0;do if(bt+=1,He=this._tokens.peek(bt-1),He.newlines){this._flags.inline_frame=!1;break}while(He.type!==J.EOF&&!(He.type===J.END_BLOCK&&He.opened===R))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==J.OPERATOR&&(Et||this._flags.last_token.type===J.EQUALS||De(this._flags.last_token,$e)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(oe(this._previous_flags.mode)&&(this._flags.last_token.type===J.START_EXPR||this._flags.last_token.type===J.COMMA)&&((this._flags.last_token.type===J.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===J.COMMA||this._flags.last_token.type===J.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(R),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==J.OPERATOR&&this._flags.last_token.type!==J.START_EXPR&&(B(this._flags.last_token.type,[J.START_BLOCK,J.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(R),this.indent(),!at&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},be.prototype.handle_end_block=function(R){for(this.handle_whitespace_and_comments(R);this._flags.mode===Xe.Statement;)this.restore_mode();var se=this._flags.last_token.type===J.START_BLOCK;this._flags.inline_frame&&!se?this._output.space_before_token=!0:this._options.brace_style==="expand"?se||this.print_newline():se||(oe(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(R)},be.prototype.handle_word=function(R){if(R.type===J.RESERVED){if(B(R.text,["set","get"])&&this._flags.mode!==Xe.ObjectLiteral)R.type=J.WORD;else if(R.text==="import"&&B(this._tokens.peek().text,["(","."]))R.type=J.WORD;else if(B(R.text,["as","from"])&&!this._flags.import_block)R.type=J.WORD;else if(this._flags.mode===Xe.ObjectLiteral){var se=this._tokens.peek();se.text===":"&&(R.type=J.WORD)}}if(this.start_of_statement(R)?De(this._flags.last_token,["var","let","const"])&&R.type===J.WORD&&(this._flags.declaration_statement=!0):R.newlines&&!me(this._flags.mode)&&(this._flags.last_token.type!==J.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==J.EQUALS&&(this._options.preserve_newlines||!De(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(R),this.print_newline()):this.handle_whitespace_and_comments(R),this._flags.do_block&&!this._flags.do_while)if(ie(R,"while")){this._output.space_before_token=!0,this.print_token(R),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&&ie(R,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Xe.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&De(R,["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(R),this._flags.in_case=!0;return}if((this._flags.last_token.type===J.COMMA||this._flags.last_token.type===J.START_EXPR||this._flags.last_token.type===J.EQUALS||this._flags.last_token.type===J.OPERATOR)&&!this.start_of_object_property()&&!(B(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===Xe.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(R),ie(R,"function")){(B(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(B(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===J.OPERATOR))&&!this._output.just_added_blankline()&&!R.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===J.RESERVED||this._flags.last_token.type===J.WORD?De(this._flags.last_token,["get","set","new","export"])||De(this._flags.last_token,D)?this._output.space_before_token=!0:ie(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===J.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(me(this._flags.mode)||oe(this._flags.mode))||this.print_newline(),this.print_token(R),this._flags.last_word=R.text;return}var Ie="NONE";if(this._flags.last_token.type===J.END_BLOCK?this._previous_flags.inline_frame?Ie="SPACE":De(R,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines?Ie="NEWLINE":(Ie="SPACE",this._output.space_before_token=!0):Ie="NEWLINE":this._flags.last_token.type===J.SEMICOLON&&this._flags.mode===Xe.BlockStatement?Ie="NEWLINE":this._flags.last_token.type===J.SEMICOLON&&me(this._flags.mode)?Ie="SPACE":this._flags.last_token.type===J.STRING?Ie="NEWLINE":this._flags.last_token.type===J.RESERVED||this._flags.last_token.type===J.WORD||this._flags.last_token.text==="*"&&(B(this._last_last_text,["function","yield"])||this._flags.mode===Xe.ObjectLiteral&&B(this._last_last_text,["{",","]))?Ie="SPACE":this._flags.last_token.type===J.START_BLOCK?this._flags.inline_frame?Ie="SPACE":Ie="NEWLINE":this._flags.last_token.type===J.END_EXPR&&(this._output.space_before_token=!0,Ie="NEWLINE"),De(R,he)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Ie="SPACE":Ie="NEWLINE"),De(R,["else","catch","finally"]))if((!(this._flags.last_token.type===J.END_BLOCK&&this._previous_flags.mode===Xe.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var at=this._output.current_line;at.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Ie==="NEWLINE"?De(this._flags.last_token,$e)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&De(R,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==J.END_EXPR?(this._flags.last_token.type!==J.START_EXPR||!De(R,["var","let","const"]))&&this._flags.last_token.text!==":"&&(ie(R,"if")&&ie(R.previous,"else")?this._output.space_before_token=!0:this.print_newline()):De(R,he)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&oe(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Ie==="SPACE"&&(this._output.space_before_token=!0);R.previous&&(R.previous.type===J.WORD||R.previous.type===J.RESERVED)&&(this._output.space_before_token=!0),this.print_token(R),this._flags.last_word=R.text,R.type===J.RESERVED&&(R.text==="do"?this._flags.do_block=!0:R.text==="if"?this._flags.if_block=!0:R.text==="import"?this._flags.import_block=!0:this._flags.import_block&&ie(R,"from")&&(this._flags.import_block=!1))},be.prototype.handle_semicolon=function(R){this.start_of_statement(R)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(R);for(var se=this._tokens.peek();this._flags.mode===Xe.Statement&&!(this._flags.if_block&&ie(se,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(R)},be.prototype.handle_string=function(R){R.text.startsWith("`")&&R.newlines===0&&R.whitespace_before===""&&(R.previous.text===")"||this._flags.last_token.type===J.WORD)||(this.start_of_statement(R)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(R),this._flags.last_token.type===J.RESERVED||this._flags.last_token.type===J.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===J.COMMA||this._flags.last_token.type===J.START_EXPR||this._flags.last_token.type===J.EQUALS||this._flags.last_token.type===J.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R):R.text.startsWith("`")&&this._flags.last_token.type===J.END_EXPR&&(R.previous.text==="]"||R.previous.text===")")&&R.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(R)},be.prototype.handle_equals=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0},be.prototype.handle_comma=function(R){this.handle_whitespace_and_comments(R,!0),this.print_token(R),this._output.space_before_token=!0,this._flags.declaration_statement?(me(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(R)):this._flags.mode===Xe.ObjectLiteral||this._flags.mode===Xe.Statement&&this._flags.parent.mode===Xe.ObjectLiteral?(this._flags.mode===Xe.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)},be.prototype.handle_operator=function(R){var se=R.text==="*"&&(De(this._flags.last_token,["function","yield"])||B(this._flags.last_token.type,[J.START_BLOCK,J.COMMA,J.END_BLOCK,J.SEMICOLON])),Ie=B(R.text,["-","+"])&&(B(this._flags.last_token.type,[J.START_BLOCK,J.START_EXPR,J.EQUALS,J.OPERATOR])||B(this._flags.last_token.text,he)||this._flags.last_token.text===",");if(!this.start_of_statement(R)){var at=!se;this.handle_whitespace_and_comments(R,at)}if(R.text==="*"&&this._flags.last_token.type===J.DOT){this.print_token(R);return}if(R.text==="::"){this.print_token(R);return}if(B(R.text,["-","+"])&&this.start_of_object_property()){this.print_token(R);return}if(this._flags.last_token.type===J.OPERATOR&&B(this._options.operator_position,lt)&&this.allow_wrap_or_preserved_newline(R),R.text===":"&&this._flags.in_case){this.print_token(R),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==J.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 Et=!0,bt=!0,He=!1;if(R.text===":"?this._flags.ternary_depth===0?Et=!1:(this._flags.ternary_depth-=1,He=!0):R.text==="?"&&(this._flags.ternary_depth+=1),!Ie&&!se&&this._options.preserve_newlines&&B(R.text,le)){var Ht=R.text===":",gt=Ht&&He,Qe=Ht&&!He;switch(this._options.operator_position){case Ye.before_newline:this._output.space_before_token=!Qe,this.print_token(R),(!Ht||gt)&&this.allow_wrap_or_preserved_newline(R),this._output.space_before_token=!0;return;case Ye.after_newline:this._output.space_before_token=!0,!Ht||gt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(R):this._output.space_before_token=!1,this.print_token(R),this._output.space_before_token=!0;return;case Ye.preserve_newline:Qe||this.allow_wrap_or_preserved_newline(R),Et=!(this._output.just_added_newline()||Qe),this._output.space_before_token=Et,this.print_token(R),this._output.space_before_token=!0;return}}if(se){this.allow_wrap_or_preserved_newline(R),Et=!1;var xr=this._tokens.peek();bt=xr&&B(xr.type,[J.WORD,J.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),Et=this._flags.last_token.type===J.START_BLOCK,bt=!1;else if(B(R.text,["--","++","!","~"])||Ie){if((this._flags.last_token.type===J.COMMA||this._flags.last_token.type===J.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),Et=!1,bt=!1,R.newlines&&(R.text==="--"||R.text==="++"||R.text==="~")){var mr=De(this._flags.last_token,$e)&&R.newlines;mr&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(mr,!0)}this._flags.last_token.text===";"&&me(this._flags.mode)&&(Et=!0),this._flags.last_token.type===J.RESERVED?Et=!0:this._flags.last_token.type===J.END_EXPR?Et=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===J.OPERATOR&&(Et=B(R.text,["--","-","++","+"])&&B(this._flags.last_token.text,["--","-","++","+"]),B(R.text,["+","-"])&&B(this._flags.last_token.text,["--","++"])&&(bt=!0)),(this._flags.mode===Xe.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Xe.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Et,this.print_token(R),this._output.space_before_token=bt},be.prototype.handle_block_comment=function(R,se){if(this._output.raw){this._output.add_raw_token(R),R.directives&&R.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(R.directives){this.print_newline(!1,se),this.print_token(R),R.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!L.newline.test(R.text)&&!R.newlines){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0;return}else this.print_block_commment(R,se)},be.prototype.print_block_commment=function(R,se){var Ie=ye(R.text),at,Et=!1,bt=!1,He=R.whitespace_before,Ht=He.length;if(this.print_newline(!1,se),this.print_token_line_indentation(R),this._output.add_token(Ie[0]),this.print_newline(!1,se),Ie.length>1){for(Ie=Ie.slice(1),Et=ge(Ie,"*"),bt=Ee(Ie,He),Et&&(this._flags.alignment=1),at=0;at<Ie.length;at++)Et?(this.print_token_line_indentation(R),this._output.add_token(V(Ie[at]))):bt&&Ie[at]?(this.print_token_line_indentation(R),this._output.add_token(Ie[at].substring(Ht))):(this._output.current_line.set_indent(-1),this._output.add_token(Ie[at])),this.print_newline(!1,se);this._flags.alignment=0}},be.prototype.handle_comment=function(R,se){R.newlines?this.print_newline(!1,se):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(R),this.print_newline(!1,se)},be.prototype.handle_dot=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),De(this._flags.last_token,$e)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(R,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(R)},be.prototype.handle_unknown=function(R,se){this.print_token(R),R.text[R.text.length-1]===`
`&&this.print_newline(!1,se)},be.prototype.handle_eof=function(R){for(;this._flags.mode===Xe.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R)},z.exports.Beautifier=be},function(z){function d(M){this.__parent=M,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=[]}d.prototype.clone_empty=function(){var M=new d(this.__parent);return M.set_indent(this.__indent_count,this.__alignment_count),M},d.prototype.item=function(M){return M<0?this.__items[this.__items.length+M]:this.__items[M]},d.prototype.has_match=function(M){for(var L=this.__items.length-1;L>=0;L--)if(this.__items[L].match(M))return!0;return!1},d.prototype.set_indent=function(M,L){this.is_empty()&&(this.__indent_count=M||0,this.__alignment_count=L||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.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)},d.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},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var M=this.__parent.current_line;return M.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),M.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),M.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,M.__items[0]===" "&&(M.__items.splice(0,1),M.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(M){this.__items.push(M);var L=M.lastIndexOf(`
`);L!==-1?this.__character_count=M.length-L:this.__character_count+=M.length},d.prototype.pop=function(){var M=null;return this.is_empty()||(M=this.__items.pop(),this.__character_count-=M.length),M},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var M="";return this.is_empty()?this.__parent.indent_empty_lines&&(M=this.__parent.get_indent_string(this.__indent_count)):(M=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),M+=this.__items.join("")),M};function ne(M,L){this.__cache=[""],this.__indent_size=M.indent_size,this.__indent_string=M.indent_char,M.indent_with_tabs||(this.__indent_string=new Array(M.indent_size+1).join(M.indent_char)),L=L||"",M.indent_level>0&&(L=new Array(M.indent_level+1).join(this.__indent_string)),this.__base_string=L,this.__base_string_length=L.length}ne.prototype.get_indent_size=function(M,L){var O=this.__base_string_length;return L=L||0,M<0&&(O=0),O+=M*this.__indent_size,O+=L,O},ne.prototype.get_indent_string=function(M,L){var O=this.__base_string;return L=L||0,M<0&&(M=0,O=""),L+=M*this.__indent_size,this.__ensure_cache(L),O+=this.__cache[L],O},ne.prototype.__ensure_cache=function(M){for(;M>=this.__cache.length;)this.__add_column()},ne.prototype.__add_column=function(){var M=this.__cache.length,L=0,O="";this.__indent_size&&M>=this.__indent_size&&(L=Math.floor(M/this.__indent_size),M-=L*this.__indent_size,O=new Array(L+1).join(this.__indent_string)),M&&(O+=new Array(M+1).join(" ")),this.__cache.push(O)};function q(M,L){this.__indent_cache=new ne(M,L),this.raw=!1,this._end_with_newline=M.end_with_newline,this.indent_size=M.indent_size,this.wrap_line_length=M.wrap_line_length,this.indent_empty_lines=M.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}q.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},q.prototype.get_line_number=function(){return this.__lines.length},q.prototype.get_indent_string=function(M,L){return this.__indent_cache.get_indent_string(M,L)},q.prototype.get_indent_size=function(M,L){return this.__indent_cache.get_indent_size(M,L)},q.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},q.prototype.add_new_line=function(M){return this.is_empty()||!M&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},q.prototype.get_code=function(M){this.trim(!0);var L=this.current_line.pop();L&&(L[L.length-1]===`
`&&(L=L.replace(/\n+$/g,"")),this.current_line.push(L)),this._end_with_newline&&this.__add_outputline();var O=this.__lines.join(`
`);return M!==`
`&&(O=O.replace(/[\n]/g,M)),O},q.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},q.prototype.set_indent=function(M,L){return M=M||0,L=L||0,this.next_line.set_indent(M,L),this.__lines.length>1?(this.current_line.set_indent(M,L),!0):(this.current_line.set_indent(),!1)},q.prototype.add_raw_token=function(M){for(var L=0;L<M.newlines;L++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(M.whitespace_before),this.current_line.push(M.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},q.prototype.add_token=function(M){this.__add_space_before_token(),this.current_line.push(M),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},q.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(" "))},q.prototype.remove_indent=function(M){for(var L=this.__lines.length;M<L;)this.__lines[M]._remove_indent(),M++;this.current_line._remove_wrap_indent()},q.prototype.trim=function(M){for(M=M===void 0?!1:M,this.current_line.trim();M&&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},q.prototype.just_added_newline=function(){return this.current_line.is_empty()},q.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},q.prototype.ensure_empty_line_above=function(M,L){for(var O=this.__lines.length-2;O>=0;){var G=this.__lines[O];if(G.is_empty())break;if(G.item(0).indexOf(M)!==0&&G.item(-1)!==L){this.__lines.splice(O+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}O--}},z.exports.Output=q},function(z){function d(ne,q,M,L){this.type=ne,this.text=q,this.comments_before=null,this.newlines=M||0,this.whitespace_before=L||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}z.exports.Token=d},function(z,d){var ne="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",q="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",M="\\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",L="\\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",O="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",G="(?:"+O+"|["+ne+M+"])",he="(?:"+O+"|["+q+M+L+"])*";d.identifier=new RegExp(G+he,"g"),d.identifierStart=new RegExp(G),d.identifierMatch=new RegExp("(?:"+O+"|["+q+M+L+"])+");var le=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;d.newline=/[\n\r\u2028\u2029]/,d.lineBreak=new RegExp(`\r
|`+d.newline.source),d.allLineBreaks=new RegExp(d.lineBreak.source,"g")},function(z,d,ne){var q=ne(6).Options,M=["before-newline","after-newline","preserve-newline"];function L(O){q.call(this,O,"js");var G=this.raw_options.brace_style||null;G==="expand-strict"?this.raw_options.brace_style="expand":G==="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 he=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var le=0;le<he.length;le++)he[le]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=he[le];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",M),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}L.prototype=new q,z.exports.Options=L},function(z){function d(M,L){this.raw_options=ne(M,L),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"])}d.prototype._get_array=function(M,L){var O=this.raw_options[M],G=L||[];return typeof O=="object"?O!==null&&typeof O.concat=="function"&&(G=O.concat()):typeof O=="string"&&(G=O.split(/[^a-zA-Z0-9_\/\-]+/)),G},d.prototype._get_boolean=function(M,L){var O=this.raw_options[M],G=O===void 0?!!L:!!O;return G},d.prototype._get_characters=function(M,L){var O=this.raw_options[M],G=L||"";return typeof O=="string"&&(G=O.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),G},d.prototype._get_number=function(M,L){var O=this.raw_options[M];L=parseInt(L,10),isNaN(L)&&(L=0);var G=parseInt(O,10);return isNaN(G)&&(G=L),G},d.prototype._get_selection=function(M,L,O){var G=this._get_selection_list(M,L,O);if(G.length!==1)throw new Error("Invalid Option Value: The option '"+M+`' can only be one of the following values:
`+L+`
You passed in: '`+this.raw_options[M]+"'");return G[0]},d.prototype._get_selection_list=function(M,L,O){if(!L||L.length===0)throw new Error("Selection list cannot be empty.");if(O=O||[L[0]],!this._is_valid_selection(O,L))throw new Error("Invalid Default Value!");var G=this._get_array(M,O);if(!this._is_valid_selection(G,L))throw new Error("Invalid Option Value: The option '"+M+`' can contain only the following values:
`+L+`
You passed in: '`+this.raw_options[M]+"'");return G},d.prototype._is_valid_selection=function(M,L){return M.length&&L.length&&!M.some(function(O){return L.indexOf(O)===-1})};function ne(M,L){var O={};M=q(M);var G;for(G in M)G!==L&&(O[G]=M[G]);if(L&&M[L])for(G in M[L])O[G]=M[L][G];return O}function q(M){var L={},O;for(O in M){var G=O.replace(/-/g,"_");L[G]=M[O]}return L}z.exports.Options=d,z.exports.normalizeOpts=q,z.exports.mergeOpts=ne},function(z,d,ne){var q=ne(8).InputScanner,M=ne(9).Tokenizer,L=ne(9).TOKEN,O=ne(13).Directives,G=ne(4),he=ne(12).Pattern,le=ne(14).TemplatablePattern;function J(ge,Ee){return Ee.indexOf(ge)!==-1}var B={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:L.START,RAW:L.RAW,EOF:L.EOF},V=new O(/\/\*/,/\*\//),H=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,ie=/[0-9]/,De=/[^\d\.]/,$e=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),Se=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";Se=Se.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),Se="\\?\\.(?!\\d) "+Se,Se=Se.replace(/ /g,"|");var Ye=new RegExp(Se),lt="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),Xe=lt.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),$t=new RegExp("^(?:"+Xe.join("|")+")$"),ye,oe=function(ge,Ee){M.call(this,ge,Ee),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var be=new he(this._input),D=new le(this._input).read_options(this._options);this.__patterns={template:D,identifier:D.starting_with(G.identifier).matching(G.identifierMatch),number:be.matching(H),punct:be.matching(Ye),comment:be.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:be.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:be.matching(/<!--/),html_comment_end:be.matching(/-->/),include:be.starting_with(/#include/).until_after(G.lineBreak),shebang:be.starting_with(/#!/).until_after(G.lineBreak),xml:be.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:D.until(/['\\\n\r\u2028\u2029]/),double_quote:D.until(/["\\\n\r\u2028\u2029]/),template_text:D.until(/[`\\$]/),template_expression:D.until(/[`}\\]/)}};oe.prototype=new M,oe.prototype._is_comment=function(ge){return ge.type===B.COMMENT||ge.type===B.BLOCK_COMMENT||ge.type===B.UNKNOWN},oe.prototype._is_opening=function(ge){return ge.type===B.START_BLOCK||ge.type===B.START_EXPR},oe.prototype._is_closing=function(ge,Ee){return(ge.type===B.END_BLOCK||ge.type===B.END_EXPR)&&Ee&&(ge.text==="]"&&Ee.text==="["||ge.text===")"&&Ee.text==="("||ge.text==="}"&&Ee.text==="{")},oe.prototype._reset=function(){ye=!1},oe.prototype._get_next_token=function(ge,Ee){var be=null;this._readWhitespace();var D=this._input.peek();return D===null?this._create_token(B.EOF,""):(be=be||this._read_non_javascript(D),be=be||this._read_string(D),be=be||this._read_pair(D,this._input.peek(1)),be=be||this._read_word(ge),be=be||this._read_singles(D),be=be||this._read_comment(D),be=be||this._read_regexp(D,ge),be=be||this._read_xml(D,ge),be=be||this._read_punctuation(),be=be||this._create_token(B.UNKNOWN,this._input.next()),be)},oe.prototype._read_word=function(ge){var Ee;if(Ee=this.__patterns.identifier.read(),Ee!=="")return Ee=Ee.replace(G.allLineBreaks,`
`),!(ge.type===B.DOT||ge.type===B.RESERVED&&(ge.text==="set"||ge.text==="get"))&&$t.test(Ee)?(Ee==="in"||Ee==="of")&&(ge.type===B.WORD||ge.type===B.STRING)?this._create_token(B.OPERATOR,Ee):this._create_token(B.RESERVED,Ee):this._create_token(B.WORD,Ee);if(Ee=this.__patterns.number.read(),Ee!=="")return this._create_token(B.WORD,Ee)},oe.prototype._read_singles=function(ge){var Ee=null;return ge==="("||ge==="["?Ee=this._create_token(B.START_EXPR,ge):ge===")"||ge==="]"?Ee=this._create_token(B.END_EXPR,ge):ge==="{"?Ee=this._create_token(B.START_BLOCK,ge):ge==="}"?Ee=this._create_token(B.END_BLOCK,ge):ge===";"?Ee=this._create_token(B.SEMICOLON,ge):ge==="."&&De.test(this._input.peek(1))?Ee=this._create_token(B.DOT,ge):ge===","&&(Ee=this._create_token(B.COMMA,ge)),Ee&&this._input.next(),Ee},oe.prototype._read_pair=function(ge,Ee){var be=null;return ge==="#"&&Ee==="{"&&(be=this._create_token(B.START_BLOCK,ge+Ee)),be&&(this._input.next(),this._input.next()),be},oe.prototype._read_punctuation=function(){var ge=this.__patterns.punct.read();if(ge!=="")return ge==="="?this._create_token(B.EQUALS,ge):ge==="?."?this._create_token(B.DOT,ge):this._create_token(B.OPERATOR,ge)},oe.prototype._read_non_javascript=function(ge){var Ee="";if(ge==="#"){if(this._is_first_token()&&(Ee=this.__patterns.shebang.read(),Ee))return this._create_token(B.UNKNOWN,Ee.trim()+`
`);if(Ee=this.__patterns.include.read(),Ee)return this._create_token(B.UNKNOWN,Ee.trim()+`
`);ge=this._input.next();var be="#";if(this._input.hasNext()&&this._input.testChar(ie)){do ge=this._input.next(),be+=ge;while(this._input.hasNext()&&ge!=="#"&&ge!=="=");return ge==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(be+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(be+="{}",this._input.next(),this._input.next())),this._create_token(B.WORD,be)}this._input.back()}else if(ge==="<"&&this._is_first_token()){if(Ee=this.__patterns.html_comment_start.read(),Ee){for(;this._input.hasNext()&&!this._input.testChar(G.newline);)Ee+=this._input.next();return ye=!0,this._create_token(B.COMMENT,Ee)}}else if(ye&&ge==="-"&&(Ee=this.__patterns.html_comment_end.read(),Ee))return ye=!1,this._create_token(B.COMMENT,Ee);return null},oe.prototype._read_comment=function(ge){var Ee=null;if(ge==="/"){var be="";if(this._input.peek(1)==="*"){be=this.__patterns.block_comment.read();var D=V.get_directives(be);D&&D.ignore==="start"&&(be+=V.readIgnored(this._input)),be=be.replace(G.allLineBreaks,`
`),Ee=this._create_token(B.BLOCK_COMMENT,be),Ee.directives=D}else this._input.peek(1)==="/"&&(be=this.__patterns.comment.read(),Ee=this._create_token(B.COMMENT,be))}return Ee},oe.prototype._read_string=function(ge){if(ge==="`"||ge==="'"||ge==='"'){var Ee=this._input.next();return this.has_char_escapes=!1,ge==="`"?Ee+=this._read_string_recursive("`",!0,"${"):Ee+=this._read_string_recursive(ge),this.has_char_escapes&&this._options.unescape_strings&&(Ee=me(Ee)),this._input.peek()===ge&&(Ee+=this._input.next()),Ee=Ee.replace(G.allLineBreaks,`
`),this._create_token(B.STRING,Ee)}return null},oe.prototype._allow_regexp_or_xml=function(ge){return ge.type===B.RESERVED&&J(ge.text,["return","case","throw","else","do","typeof","yield"])||ge.type===B.END_EXPR&&ge.text===")"&&ge.opened.previous.type===B.RESERVED&&J(ge.opened.previous.text,["if","while","for"])||J(ge.type,[B.COMMENT,B.START_EXPR,B.START_BLOCK,B.START,B.END_BLOCK,B.OPERATOR,B.EQUALS,B.EOF,B.SEMICOLON,B.COMMA])},oe.prototype._read_regexp=function(ge,Ee){if(ge==="/"&&this._allow_regexp_or_xml(Ee)){for(var be=this._input.next(),D=!1,R=!1;this._input.hasNext()&&(D||R||this._input.peek()!==ge)&&!this._input.testChar(G.newline);)be+=this._input.peek(),D?D=!1:(D=this._input.peek()==="\\",this._input.peek()==="["?R=!0:this._input.peek()==="]"&&(R=!1)),this._input.next();return this._input.peek()===ge&&(be+=this._input.next(),be+=this._input.read(G.identifier)),this._create_token(B.STRING,be)}return null},oe.prototype._read_xml=function(ge,Ee){if(this._options.e4x&&ge==="<"&&this._allow_regexp_or_xml(Ee)){var be="",D=this.__patterns.xml.read_match();if(D){for(var R=D[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),se=R.indexOf("{")===0,Ie=0;D;){var at=!!D[1],Et=D[2],bt=!!D[D.length-1]||Et.slice(0,8)==="![CDATA[";if(!bt&&(Et===R||se&&Et.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(at?--Ie:++Ie),be+=D[0],Ie<=0)break;D=this.__patterns.xml.read_match()}return D||(be+=this._input.match(/[\s\S]*/g)[0]),be=be.replace(G.allLineBreaks,`
`),this._create_token(B.STRING,be)}}return null};function me(ge){for(var Ee="",be=0,D=new q(ge),R=null;D.hasNext();)if(R=D.match(/([\s]|[^\\]|\\\\)+/g),R&&(Ee+=R[0]),D.peek()==="\\"){if(D.next(),D.peek()==="x")R=D.match(/x([0-9A-Fa-f]{2})/g);else if(D.peek()==="u")R=D.match(/u([0-9A-Fa-f]{4})/g),R||(R=D.match(/u\{([0-9A-Fa-f]+)\}/g));else{Ee+="\\",D.hasNext()&&(Ee+=D.next());continue}if(!R||(be=parseInt(R[1],16),be>126&&be<=255&&R[0].indexOf("x")===0))return ge;be>=0&&be<32||be>1114111?Ee+="\\"+R[0]:be===34||be===39||be===92?Ee+="\\"+String.fromCharCode(be):Ee+=String.fromCharCode(be)}return Ee}oe.prototype._read_string_recursive=function(ge,Ee,be){var D,R;ge==="'"?R=this.__patterns.single_quote:ge==='"'?R=this.__patterns.double_quote:ge==="`"?R=this.__patterns.template_text:ge==="}"&&(R=this.__patterns.template_expression);for(var se=R.read(),Ie="";this._input.hasNext();){if(Ie=this._input.next(),Ie===ge||!Ee&&G.newline.test(Ie)){this._input.back();break}else Ie==="\\"&&this._input.hasNext()?(D=this._input.peek(),D==="x"||D==="u"?this.has_char_escapes=!0:D==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Ie+=this._input.next()):be&&(be==="${"&&Ie==="$"&&this._input.peek()==="{"&&(Ie+=this._input.next()),be===Ie&&(ge==="`"?Ie+=this._read_string_recursive("}",Ee,"`"):Ie+=this._read_string_recursive("`",Ee,"${"),this._input.hasNext()&&(Ie+=this._input.next())));Ie+=R.read(),se+=Ie}return se},z.exports.Tokenizer=oe,z.exports.TOKEN=B,z.exports.positionable_operators=$e.slice(),z.exports.line_starters=lt.slice()},function(z){var d=RegExp.prototype.hasOwnProperty("sticky");function ne(q){this.__input=q||"",this.__input_length=this.__input.length,this.__position=0}ne.prototype.restart=function(){this.__position=0},ne.prototype.back=function(){this.__position>0&&(this.__position-=1)},ne.prototype.hasNext=function(){return this.__position<this.__input_length},ne.prototype.next=function(){var q=null;return this.hasNext()&&(q=this.__input.charAt(this.__position),this.__position+=1),q},ne.prototype.peek=function(q){var M=null;return q=q||0,q+=this.__position,q>=0&&q<this.__input_length&&(M=this.__input.charAt(q)),M},ne.prototype.__match=function(q,M){q.lastIndex=M;var L=q.exec(this.__input);return L&&!(d&&q.sticky)&&L.index!==M&&(L=null),L},ne.prototype.test=function(q,M){return M=M||0,M+=this.__position,M>=0&&M<this.__input_length?!!this.__match(q,M):!1},ne.prototype.testChar=function(q,M){var L=this.peek(M);return q.lastIndex=0,L!==null&&q.test(L)},ne.prototype.match=function(q){var M=this.__match(q,this.__position);return M?this.__position+=M[0].length:M=null,M},ne.prototype.read=function(q,M,L){var O="",G;return q&&(G=this.match(q),G&&(O+=G[0])),M&&(G||!q)&&(O+=this.readUntil(M,L)),O},ne.prototype.readUntil=function(q,M){var L="",O=this.__position;q.lastIndex=this.__position;var G=q.exec(this.__input);return G?(O=G.index,M&&(O+=G[0].length)):O=this.__input_length,L=this.__input.substring(this.__position,O),this.__position=O,L},ne.prototype.readUntilAfter=function(q){return this.readUntil(q,!0)},ne.prototype.get_regexp=function(q,M){var L=null,O="g";return M&&d&&(O="y"),typeof q=="string"&&q!==""?L=new RegExp(q,O):q&&(L=new RegExp(q.source,O)),L},ne.prototype.get_literal_regexp=function(q){return RegExp(q.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},ne.prototype.peekUntilAfter=function(q){var M=this.__position,L=this.readUntilAfter(q);return this.__position=M,L},ne.prototype.lookBack=function(q){var M=this.__position-1;return M>=q.length&&this.__input.substring(M-q.length,M).toLowerCase()===q},z.exports.InputScanner=ne},function(z,d,ne){var q=ne(8).InputScanner,M=ne(3).Token,L=ne(10).TokenStream,O=ne(11).WhitespacePattern,G={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},he=function(le,J){this._input=new q(le),this._options=J||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new O(this._input)};he.prototype.tokenize=function(){this._input.restart(),this.__tokens=new L,this._reset();for(var le,J=new M(G.START,""),B=null,V=[],H=new L;J.type!==G.EOF;){for(le=this._get_next_token(J,B);this._is_comment(le);)H.add(le),le=this._get_next_token(J,B);H.isEmpty()||(le.comments_before=H,H=new L),le.parent=B,this._is_opening(le)?(V.push(B),B=le):B&&this._is_closing(le,B)&&(le.opened=B,B.closed=le,B=V.pop(),le.parent=B),le.previous=J,J.next=le,this.__tokens.add(le),J=le}return this.__tokens},he.prototype._is_first_token=function(){return this.__tokens.isEmpty()},he.prototype._reset=function(){},he.prototype._get_next_token=function(le,J){this._readWhitespace();var B=this._input.read(/.+/g);return B?this._create_token(G.RAW,B):this._create_token(G.EOF,"")},he.prototype._is_comment=function(le){return!1},he.prototype._is_opening=function(le){return!1},he.prototype._is_closing=function(le,J){return!1},he.prototype._create_token=function(le,J){var B=new M(le,J,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return B},he.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},z.exports.Tokenizer=he,z.exports.TOKEN=G},function(z){function d(ne){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=ne}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position<this.__tokens_length},d.prototype.next=function(){var ne=null;return this.hasNext()&&(ne=this.__tokens[this.__position],this.__position+=1),ne},d.prototype.peek=function(ne){var q=null;return ne=ne||0,ne+=this.__position,ne>=0&&ne<this.__tokens_length&&(q=this.__tokens[ne]),q},d.prototype.add=function(ne){this.__parent_token&&(ne.parent=this.__parent_token),this.__tokens.push(ne),this.__tokens_length+=1},z.exports.TokenStream=d},function(z,d,ne){var q=ne(12).Pattern;function M(L,O){q.call(this,L,O),O?this._line_regexp=this._input.get_regexp(O._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}M.prototype=new q,M.prototype.__set_whitespace_patterns=function(L,O){L+="\\t ",O+="\\n\\r",this._match_pattern=this._input.get_regexp("["+L+O+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+O+"]")},M.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var L=this._input.read(this._match_pattern);if(L===" ")this.whitespace_before_token=" ";else if(L){var O=this.__split(this._newline_regexp,L);this.newline_count=O.length-1,this.whitespace_before_token=O[this.newline_count]}return L},M.prototype.matching=function(L,O){var G=this._create();return G.__set_whitespace_patterns(L,O),G._update(),G},M.prototype._create=function(){return new M(this._input,this)},M.prototype.__split=function(L,O){L.lastIndex=0;for(var G=0,he=[],le=L.exec(O);le;)he.push(O.substring(G,le.index)),G=le.index+le[0].length,le=L.exec(O);return G<O.length?he.push(O.substring(G,O.length)):he.push(""),he},z.exports.WhitespacePattern=M},function(z){function d(ne,q){this._input=ne,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,q&&(this._starting_pattern=this._input.get_regexp(q._starting_pattern,!0),this._match_pattern=this._input.get_regexp(q._match_pattern,!0),this._until_pattern=this._input.get_regexp(q._until_pattern),this._until_after=q._until_after)}d.prototype.read=function(){var ne=this._input.read(this._starting_pattern);return(!this._starting_pattern||ne)&&(ne+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),ne},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(ne){var q=this._create();return q._until_after=!0,q._until_pattern=this._input.get_regexp(ne),q._update(),q},d.prototype.until=function(ne){var q=this._create();return q._until_after=!1,q._until_pattern=this._input.get_regexp(ne),q._update(),q},d.prototype.starting_with=function(ne){var q=this._create();return q._starting_pattern=this._input.get_regexp(ne,!0),q._update(),q},d.prototype.matching=function(ne){var q=this._create();return q._match_pattern=this._input.get_regexp(ne,!0),q._update(),q},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},z.exports.Pattern=d},function(z){function d(ne,q){ne=typeof ne=="string"?ne:ne.source,q=typeof q=="string"?q:q.source,this.__directives_block_pattern=new RegExp(ne+/ beautify( \w+[:]\w+)+ /.source+q,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(ne+/\sbeautify\signore:end\s/.source+q,"g")}d.prototype.get_directives=function(ne){if(!ne.match(this.__directives_block_pattern))return null;var q={};this.__directive_pattern.lastIndex=0;for(var M=this.__directive_pattern.exec(ne);M;)q[M[1]]=M[2],M=this.__directive_pattern.exec(ne);return q},d.prototype.readIgnored=function(ne){return ne.readUntilAfter(this.__directives_end_ignore_pattern)},z.exports.Directives=d},function(z,d,ne){var q=ne(12).Pattern,M={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function L(O,G){q.call(this,O,G),this.__template_pattern=null,this._disabled=Object.assign({},M),this._excluded=Object.assign({},M),G&&(this.__template_pattern=this._input.get_regexp(G.__template_pattern),this._excluded=Object.assign(this._excluded,G._excluded),this._disabled=Object.assign(this._disabled,G._disabled));var he=new q(O);this.__patterns={handlebars_comment:he.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:he.starting_with(/{{{/).until_after(/}}}/),handlebars:he.starting_with(/{{/).until_after(/}}/),php:he.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:he.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:he.starting_with(/{%/).until_after(/%}/),django_value:he.starting_with(/{{/).until_after(/}}/),django_comment:he.starting_with(/{#/).until_after(/#}/),smarty:he.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:he.starting_with(/{\*/).until_after(/\*}/),smarty_literal:he.starting_with(/{literal}/).until_after(/{\/literal}/)}}L.prototype=new q,L.prototype._create=function(){return new L(this._input,this)},L.prototype._update=function(){this.__set_templated_pattern()},L.prototype.disable=function(O){var G=this._create();return G._disabled[O]=!0,G._update(),G},L.prototype.read_options=function(O){var G=this._create();for(var he in M)G._disabled[he]=O.templating.indexOf(he)===-1;return G._update(),G},L.prototype.exclude=function(O){var G=this._create();return G._excluded[O]=!0,G._update(),G},L.prototype.read=function(){var O="";this._match_pattern?O=this._input.read(this._starting_pattern):O=this._input.read(this._starting_pattern,this.__template_pattern);for(var G=this._read_template();G;)this._match_pattern?G+=this._input.read(this._match_pattern):G+=this._input.readUntil(this.__template_pattern),O+=G,G=this._read_template();return this._until_after&&(O+=this._input.readUntilAfter(this._until_pattern)),O},L.prototype.__set_templated_pattern=function(){var O=[];this._disabled.php||O.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||O.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||O.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||O.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(O.push(this.__patterns.django._starting_pattern.source),O.push(this.__patterns.django_value._starting_pattern.source),O.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||O.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&O.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+O.join("|")+")")},L.prototype._read_template=function(){var O="",G=this._input.peek();if(G==="<"){var he=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&he==="?"&&(O=O||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&he==="%"&&(O=O||this.__patterns.erb.read())}else G==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(O=O||this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars_unescaped.read(),O=O||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(O=O||this.__patterns.django_value.read()),this._excluded.django||(O=O||this.__patterns.django_comment.read(),O=O||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(O=O||this.__patterns.smarty_comment.read(),O=O||this.__patterns.smarty_literal.read(),O=O||this.__patterns.smarty.read()));return O},z.exports.TemplatablePattern=L}],ae={};function E(z){var d=ae[z];if(d!==void 0)return d.exports;var ne=ae[z]={exports:{}};return Me[z](ne,ne.exports,E),ne.exports}var Te=E(0);Pe=Te})();var We=Pe;Y=[],U=function(){return{js_beautify:We}}.apply(Ct,Y),U!==void 0&&(Fr.exports=U)})()},15342:function(Fr){(function(Y,U){Fr.exports=U()})(typeof self!="undefined"?self:this,function(){return function(Ct){var Y={};function U(Pe){if(Y[Pe])return Y[Pe].exports;var We=Y[Pe]={i:Pe,l:!1,exports:{}};return Ct[Pe].call(We.exports,We,We.exports,U),We.l=!0,We.exports}return U.m=Ct,U.c=Y,U.d=function(Pe,We,Me){U.o(Pe,We)||Object.defineProperty(Pe,We,{enumerable:!0,get:Me})},U.r=function(Pe){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Pe,"__esModule",{value:!0})},U.t=function(Pe,We){if(We&1&&(Pe=U(Pe)),We&8||We&4&&typeof Pe=="object"&&Pe&&Pe.__esModule)return Pe;var Me=Object.create(null);if(U.r(Me),Object.defineProperty(Me,"default",{enumerable:!0,value:Pe}),We&2&&typeof Pe!="string")for(var ae in Pe)U.d(Me,ae,function(E){return Pe[E]}.bind(null,ae));return Me},U.n=function(Pe){var We=Pe&&Pe.__esModule?function(){return Pe.default}:function(){return Pe};return U.d(We,"a",We),We},U.o=function(Pe,We){return Object.prototype.hasOwnProperty.call(Pe,We)},U.p="",U(U.s=1)}([function(Ct,Y,U){},function(Ct,Y,U){"use strict";U.r(Y);var Pe=U(0),We=function(){function j(m,b,_){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=m,this.start=b,this.end=_}return j.range=function(b,_){return _?!b||!b.loc||!_.loc||b.loc.lexer!==_.loc.lexer?null:new j(b.loc.lexer,b.loc.start,_.loc.end):b&&b.loc},j}(),Me=function(){function j(b,_){this.text=void 0,this.loc=void 0,this.text=b,this.loc=_}var m=j.prototype;return m.range=function(_,S){return new j(S,We.range(this,_))},j}(),ae=function j(m,b){this.position=void 0;var _="KaTeX parse error: "+m,S,P=b&&b.loc;if(P&&P.start<=P.end){var W=P.lexer.input;S=P.start;var ce=P.end;S===W.length?_+=" at end of input: ":_+=" at position "+(S+1)+": ";var _e=W.slice(S,ce).replace(/[^]/g,"$&\u0332"),Be;S>15?Be="\u2026"+W.slice(S-15,S):Be=W.slice(0,S);var Je;ce+15<W.length?Je=W.slice(ce,ce+15)+"\u2026":Je=W.slice(ce),_+=Be+_e+Je}var ft=new Error(_);return ft.name="ParseError",ft.__proto__=j.prototype,ft.position=S,ft};ae.prototype.__proto__=Error.prototype;var E=ae,Te=function(m,b){return m.indexOf(b)!==-1},z=function(m,b){return m===void 0?b:m},d=/([A-Z])/g,ne=function(m){return m.replace(d,"-$1").toLowerCase()},q={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},M=/[&><"']/g;function L(j){return String(j).replace(M,function(m){return q[m]})}var O=function j(m){return m.type==="ordgroup"||m.type==="color"?m.body.length===1?j(m.body[0]):m:m.type==="font"?j(m.body):m},G=function(m){var b=O(m);return b.type==="mathord"||b.type==="textord"||b.type==="atom"},he=function(m){if(!m)throw new Error("Expected non-null, but got "+String(m));return m},le=function(m){var b=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(m);return b!=null?b[1]:"_relative"},J={contains:Te,deflt:z,escape:L,hyphenate:ne,getBaseElem:O,isCharacterBox:G,protocolFromUrl:le},B=function(){function j(b){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,b=b||{},this.displayMode=J.deflt(b.displayMode,!1),this.output=J.deflt(b.output,"htmlAndMathml"),this.leqno=J.deflt(b.leqno,!1),this.fleqn=J.deflt(b.fleqn,!1),this.throwOnError=J.deflt(b.throwOnError,!0),this.errorColor=J.deflt(b.errorColor,"#cc0000"),this.macros=b.macros||{},this.minRuleThickness=Math.max(0,J.deflt(b.minRuleThickness,0)),this.colorIsTextColor=J.deflt(b.colorIsTextColor,!1),this.strict=J.deflt(b.strict,"warn"),this.trust=J.deflt(b.trust,!1),this.maxSize=Math.max(0,J.deflt(b.maxSize,1/0)),this.maxExpand=Math.max(0,J.deflt(b.maxExpand,1e3))}var m=j.prototype;return m.reportNonstrict=function(_,S,P){var W=this.strict;if(typeof W=="function"&&(W=W(_,S,P)),!(!W||W==="ignore")){if(W===!0||W==="error")throw new E("LaTeX-incompatible input and strict mode is set to 'error': "+(S+" ["+_+"]"),P);W==="warn"?typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(S+" ["+_+"]")):typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+W+"': "+S+" ["+_+"]"))}},m.useStrictBehavior=function(_,S,P){var W=this.strict;if(typeof W=="function")try{W=W(_,S,P)}catch(ce){W="error"}return!W||W==="ignore"?!1:W===!0||W==="error"?!0:W==="warn"?(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(S+" ["+_+"]")),!1):(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+W+"': "+S+" ["+_+"]")),!1)},m.isTrusted=function(_){_.url&&!_.protocol&&(_.protocol=J.protocolFromUrl(_.url));var S=typeof this.trust=="function"?this.trust(_):this.trust;return!!S},j}(),V=function(){function j(b,_,S){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=b,this.size=_,this.cramped=S}var m=j.prototype;return m.sup=function(){return $t[ye[this.id]]},m.sub=function(){return $t[oe[this.id]]},m.fracNum=function(){return $t[me[this.id]]},m.fracDen=function(){return $t[ge[this.id]]},m.cramp=function(){return $t[Ee[this.id]]},m.text=function(){return $t[be[this.id]]},m.isTight=function(){return this.size>=2},j}(),H=0,ie=1,De=2,$e=3,Se=4,Ye=5,lt=6,Xe=7,$t=[new V(H,0,!1),new V(ie,0,!0),new V(De,1,!1),new V($e,1,!0),new V(Se,2,!1),new V(Ye,2,!0),new V(lt,3,!1),new V(Xe,3,!0)],ye=[Se,Ye,Se,Ye,lt,Xe,lt,Xe],oe=[Ye,Ye,Ye,Ye,Xe,Xe,Xe,Xe],me=[De,$e,Se,Ye,lt,Xe,lt,Xe],ge=[$e,$e,Ye,Ye,Xe,Xe,Xe,Xe],Ee=[ie,ie,$e,$e,Ye,Ye,Xe,Xe],be=[H,ie,De,$e,De,$e,De,$e],D={DISPLAY:$t[H],TEXT:$t[De],SCRIPT:$t[Se],SCRIPTSCRIPT:$t[lt]},R=[{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 se(j){for(var m=0;m<R.length;m++)for(var b=R[m],_=0;_<b.blocks.length;_++){var S=b.blocks[_];if(j>=S[0]&&j<=S[1])return b.name}return null}var Ie=[];R.forEach(function(j){return j.blocks.forEach(function(m){return Ie.push.apply(Ie,m)})});function at(j){for(var m=0;m<Ie.length;m+=2)if(j>=Ie[m]&&j<=Ie[m+1])return!0;return!1}var Et=80,bt=function(m,b){return"M95,"+(622+m+b)+`
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`+m/2.075+" -"+m+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+m)+`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+m)+" "+b+"h400000v"+(40+m)+"h-400000z"},He=function(m,b){return"M263,"+(601+m+b)+`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`+m/2.084+" -"+m+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+m)+`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+m)+" "+b+"h400000v"+(40+m)+"h-400000z"},Ht=function(m,b){return"M983 "+(10+m+b)+`
l`+m/3.13+" -"+m+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+m)+`
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+m)+" "+b+"h400000v"+(40+m)+"h-400000z"},gt=function(m,b){return"M424,"+(2398+m+b)+`
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`+m/4.223+" -"+m+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+m)+`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+m)+" "+b+`
h400000v`+(40+m)+"h-400000z"},Qe=function(m,b){return"M473,"+(2713+m+b)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+m/5.298+" -"+m+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+m)+`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+m)+" "+b+"h400000v"+(40+m)+"H1017.7z"},xr=function(m,b,_){var S=_-54-b-m;return"M702 "+(m+b)+"H400000"+(40+m)+`
H742v`+S+`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 `+b+"H400000v"+(40+m)+"H742z"},mr=function(m,b,_){b=1e3*b;var S="";switch(m){case"sqrtMain":S=bt(b,Et);break;case"sqrtSize1":S=He(b,Et);break;case"sqrtSize2":S=Ht(b,Et);break;case"sqrtSize3":S=gt(b,Et);break;case"sqrtSize4":S=Qe(b,Et);break;case"sqrtTall":S=xr(b,Et,_)}return S},pi={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`},Wt=function(){function j(b){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=b,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var m=j.prototype;return m.hasClass=function(_){return J.contains(this.classes,_)},m.toNode=function(){for(var _=document.createDocumentFragment(),S=0;S<this.children.length;S++)_.appendChild(this.children[S].toNode());return _},m.toMarkup=function(){for(var _="",S=0;S<this.children.length;S++)_+=this.children[S].toMarkup();return _},m.toText=function(){var _=function(P){return P.toText()};return this.children.map(_).join("")},j}(),si=function(m){return m.filter(function(b){return b}).join(" ")},et=function(m,b,_){if(this.classes=m||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=_||{},b){b.style.isTight()&&this.classes.push("mtight");var S=b.getColor();S&&(this.style.color=S)}},ct=function(m){var b=document.createElement(m);b.className=si(this.classes);for(var _ in this.style)this.style.hasOwnProperty(_)&&(b.style[_]=this.style[_]);for(var S in this.attributes)this.attributes.hasOwnProperty(S)&&b.setAttribute(S,this.attributes[S]);for(var P=0;P<this.children.length;P++)b.appendChild(this.children[P].toNode());return b},Ue=function(m){var b="<"+m;this.classes.length&&(b+=' class="'+J.escape(si(this.classes))+'"');var _="";for(var S in this.style)this.style.hasOwnProperty(S)&&(_+=J.hyphenate(S)+":"+this.style[S]+";");_&&(b+=' style="'+J.escape(_)+'"');for(var P in this.attributes)this.attributes.hasOwnProperty(P)&&(b+=" "+P+'="'+J.escape(this.attributes[P])+'"');b+=">";for(var W=0;W<this.children.length;W++)b+=this.children[W].toMarkup();return b+="</"+m+">",b},wt=function(){function j(b,_,S,P){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,et.call(this,b,S,P),this.children=_||[]}var m=j.prototype;return m.setAttribute=function(_,S){this.attributes[_]=S},m.hasClass=function(_){return J.contains(this.classes,_)},m.toNode=function(){return ct.call(this,"span")},m.toMarkup=function(){return Ue.call(this,"span")},j}(),Rt=function(){function j(b,_,S,P){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,et.call(this,_,P),this.children=S||[],this.setAttribute("href",b)}var m=j.prototype;return m.setAttribute=function(_,S){this.attributes[_]=S},m.hasClass=function(_){return J.contains(this.classes,_)},m.toNode=function(){return ct.call(this,"a")},m.toMarkup=function(){return Ue.call(this,"a")},j}(),Dt=function(){function j(b,_,S){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=_,this.src=b,this.classes=["mord"],this.style=S}var m=j.prototype;return m.hasClass=function(_){return J.contains(this.classes,_)},m.toNode=function(){var _=document.createElement("img");_.src=this.src,_.alt=this.alt,_.className="mord";for(var S in this.style)this.style.hasOwnProperty(S)&&(_.style[S]=this.style[S]);return _},m.toMarkup=function(){var _="<img src='"+this.src+" 'alt='"+this.alt+"' ",S="";for(var P in this.style)this.style.hasOwnProperty(P)&&(S+=J.hyphenate(P)+":"+this.style[P]+";");return S&&(_+=' style="'+J.escape(S)+'"'),_+="'/>",_},j}(),fe={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},ze=function(){function j(b,_,S,P,W,ce,_e,Be){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=b,this.height=_||0,this.depth=S||0,this.italic=P||0,this.skew=W||0,this.width=ce||0,this.classes=_e||[],this.style=Be||{},this.maxFontSize=0;var Je=se(this.text.charCodeAt(0));Je&&this.classes.push(Je+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=fe[this.text])}var m=j.prototype;return m.hasClass=function(_){return J.contains(this.classes,_)},m.toNode=function(){var _=document.createTextNode(this.text),S=null;this.italic>0&&(S=document.createElement("span"),S.style.marginRight=this.italic+"em"),this.classes.length>0&&(S=S||document.createElement("span"),S.className=si(this.classes));for(var P in this.style)this.style.hasOwnProperty(P)&&(S=S||document.createElement("span"),S.style[P]=this.style[P]);return S?(S.appendChild(_),S):_},m.toMarkup=function(){var _=!1,S="<span";this.classes.length&&(_=!0,S+=' class="',S+=J.escape(si(this.classes)),S+='"');var P="";this.italic>0&&(P+="margin-right:"+this.italic+"em;");for(var W in this.style)this.style.hasOwnProperty(W)&&(P+=J.hyphenate(W)+":"+this.style[W]+";");P&&(_=!0,S+=' style="'+J.escape(P)+'"');var ce=J.escape(this.text);return _?(S+=">",S+=ce,S+="</span>",S):ce},j}(),it=function(){function j(b,_){this.children=void 0,this.attributes=void 0,this.children=b||[],this.attributes=_||{}}var m=j.prototype;return m.toNode=function(){var _="http://www.w3.org/2000/svg",S=document.createElementNS(_,"svg");for(var P in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,P)&&S.setAttribute(P,this.attributes[P]);for(var W=0;W<this.children.length;W++)S.appendChild(this.children[W].toNode());return S},m.toMarkup=function(){var _="<svg";for(var S in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,S)&&(_+=" "+S+"='"+this.attributes[S]+"'");_+=">";for(var P=0;P<this.children.length;P++)_+=this.children[P].toMarkup();return _+="</svg>",_},j}(),ut=function(){function j(b,_){this.pathName=void 0,this.alternate=void 0,this.pathName=b,this.alternate=_}var m=j.prototype;return m.toNode=function(){var _="http://www.w3.org/2000/svg",S=document.createElementNS(_,"path");return this.alternate?S.setAttribute("d",this.alternate):S.setAttribute("d",pi[this.pathName]),S},m.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+pi[this.pathName]+"'/>"},j}(),_t=function(){function j(b){this.attributes=void 0,this.attributes=b||{}}var m=j.prototype;return m.toNode=function(){var _="http://www.w3.org/2000/svg",S=document.createElementNS(_,"line");for(var P in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,P)&&S.setAttribute(P,this.attributes[P]);return S},m.toMarkup=function(){var _="<line";for(var S in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,S)&&(_+=" "+S+"='"+this.attributes[S]+"'");return _+="/>",_},j}();function Ft(j){if(j instanceof ze)return j;throw new Error("Expected symbolNode but got "+String(j)+".")}function nr(j){if(j instanceof wt)return j;throw new Error("Expected span<HtmlDomNode> but got "+String(j)+".")}var Pt={"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]}},Ve={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]},Bt={\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 gr(j,m){Pt[j]=m}function Kt(j,m,b){if(!Pt[m])throw new Error("Font metrics not found for font: "+m+".");var _=j.charCodeAt(0),S=Pt[m][_];if(!S&&j[0]in Bt&&(_=Bt[j[0]].charCodeAt(0),S=Pt[m][_]),!S&&b==="text"&&at(_)&&(S=Pt[m][77]),S)return{depth:S[0],height:S[1],italic:S[2],skew:S[3],width:S[4]}}var qt={};function Gt(j){var m;if(j>=5?m=0:j>=3?m=1:m=2,!qt[m]){var b=qt[m]={cssEmPerMu:Ve.quad[m]/18};for(var _ in Ve)Ve.hasOwnProperty(_)&&(b[_]=Ve[_][m])}return qt[m]}var Lr={bin:1,close:1,inner:1,open:1,punct:1,rel:1},wr={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Xt={math:{},text:{}},Ar=Xt;function C(j,m,b,_,S,P){Xt[j][S]={font:m,group:b,replace:_},P&&_&&(Xt[j][_]=Xt[j][S])}var N="math",yt="text",X="main",ue="ams",br="accent-token",Ne="bin",Fe="close",qe="inner",ee="mathord",de="op-token",Re="open",Ge="punct",Z="rel",Nt="spacing",Ae="textord";C(N,X,Z,"\u2261","\\equiv",!0),C(N,X,Z,"\u227A","\\prec",!0),C(N,X,Z,"\u227B","\\succ",!0),C(N,X,Z,"\u223C","\\sim",!0),C(N,X,Z,"\u22A5","\\perp"),C(N,X,Z,"\u2AAF","\\preceq",!0),C(N,X,Z,"\u2AB0","\\succeq",!0),C(N,X,Z,"\u2243","\\simeq",!0),C(N,X,Z,"\u2223","\\mid",!0),C(N,X,Z,"\u226A","\\ll",!0),C(N,X,Z,"\u226B","\\gg",!0),C(N,X,Z,"\u224D","\\asymp",!0),C(N,X,Z,"\u2225","\\parallel"),C(N,X,Z,"\u22C8","\\bowtie",!0),C(N,X,Z,"\u2323","\\smile",!0),C(N,X,Z,"\u2291","\\sqsubseteq",!0),C(N,X,Z,"\u2292","\\sqsupseteq",!0),C(N,X,Z,"\u2250","\\doteq",!0),C(N,X,Z,"\u2322","\\frown",!0),C(N,X,Z,"\u220B","\\ni",!0),C(N,X,Z,"\u221D","\\propto",!0),C(N,X,Z,"\u22A2","\\vdash",!0),C(N,X,Z,"\u22A3","\\dashv",!0),C(N,X,Z,"\u220B","\\owns"),C(N,X,Ge,".","\\ldotp"),C(N,X,Ge,"\u22C5","\\cdotp"),C(N,X,Ae,"#","\\#"),C(yt,X,Ae,"#","\\#"),C(N,X,Ae,"&","\\&"),C(yt,X,Ae,"&","\\&"),C(N,X,Ae,"\u2135","\\aleph",!0),C(N,X,Ae,"\u2200","\\forall",!0),C(N,X,Ae,"\u210F","\\hbar",!0),C(N,X,Ae,"\u2203","\\exists",!0),C(N,X,Ae,"\u2207","\\nabla",!0),C(N,X,Ae,"\u266D","\\flat",!0),C(N,X,Ae,"\u2113","\\ell",!0),C(N,X,Ae,"\u266E","\\natural",!0),C(N,X,Ae,"\u2663","\\clubsuit",!0),C(N,X,Ae,"\u2118","\\wp",!0),C(N,X,Ae,"\u266F","\\sharp",!0),C(N,X,Ae,"\u2662","\\diamondsuit",!0),C(N,X,Ae,"\u211C","\\Re",!0),C(N,X,Ae,"\u2661","\\heartsuit",!0),C(N,X,Ae,"\u2111","\\Im",!0),C(N,X,Ae,"\u2660","\\spadesuit",!0),C(yt,X,Ae,"\xA7","\\S",!0),C(yt,X,Ae,"\xB6","\\P",!0),C(N,X,Ae,"\u2020","\\dag"),C(yt,X,Ae,"\u2020","\\dag"),C(yt,X,Ae,"\u2020","\\textdagger"),C(N,X,Ae,"\u2021","\\ddag"),C(yt,X,Ae,"\u2021","\\ddag"),C(yt,X,Ae,"\u2021","\\textdaggerdbl"),C(N,X,Fe,"\u23B1","\\rmoustache",!0),C(N,X,Re,"\u23B0","\\lmoustache",!0),C(N,X,Fe,"\u27EF","\\rgroup",!0),C(N,X,Re,"\u27EE","\\lgroup",!0),C(N,X,Ne,"\u2213","\\mp",!0),C(N,X,Ne,"\u2296","\\ominus",!0),C(N,X,Ne,"\u228E","\\uplus",!0),C(N,X,Ne,"\u2293","\\sqcap",!0),C(N,X,Ne,"\u2217","\\ast"),C(N,X,Ne,"\u2294","\\sqcup",!0),C(N,X,Ne,"\u25EF","\\bigcirc"),C(N,X,Ne,"\u2219","\\bullet"),C(N,X,Ne,"\u2021","\\ddagger"),C(N,X,Ne,"\u2240","\\wr",!0),C(N,X,Ne,"\u2A3F","\\amalg"),C(N,X,Ne,"&","\\And"),C(N,X,Z,"\u27F5","\\longleftarrow",!0),C(N,X,Z,"\u21D0","\\Leftarrow",!0),C(N,X,Z,"\u27F8","\\Longleftarrow",!0),C(N,X,Z,"\u27F6","\\longrightarrow",!0),C(N,X,Z,"\u21D2","\\Rightarrow",!0),C(N,X,Z,"\u27F9","\\Longrightarrow",!0),C(N,X,Z,"\u2194","\\leftrightarrow",!0),C(N,X,Z,"\u27F7","\\longleftrightarrow",!0),C(N,X,Z,"\u21D4","\\Leftrightarrow",!0),C(N,X,Z,"\u27FA","\\Longleftrightarrow",!0),C(N,X,Z,"\u21A6","\\mapsto",!0),C(N,X,Z,"\u27FC","\\longmapsto",!0),C(N,X,Z,"\u2197","\\nearrow",!0),C(N,X,Z,"\u21A9","\\hookleftarrow",!0),C(N,X,Z,"\u21AA","\\hookrightarrow",!0),C(N,X,Z,"\u2198","\\searrow",!0),C(N,X,Z,"\u21BC","\\leftharpoonup",!0),C(N,X,Z,"\u21C0","\\rightharpoonup",!0),C(N,X,Z,"\u2199","\\swarrow",!0),C(N,X,Z,"\u21BD","\\leftharpoondown",!0),C(N,X,Z,"\u21C1","\\rightharpoondown",!0),C(N,X,Z,"\u2196","\\nwarrow",!0),C(N,X,Z,"\u21CC","\\rightleftharpoons",!0),C(N,ue,Z,"\u226E","\\nless",!0),C(N,ue,Z,"\uE010","\\@nleqslant"),C(N,ue,Z,"\uE011","\\@nleqq"),C(N,ue,Z,"\u2A87","\\lneq",!0),C(N,ue,Z,"\u2268","\\lneqq",!0),C(N,ue,Z,"\uE00C","\\@lvertneqq"),C(N,ue,Z,"\u22E6","\\lnsim",!0),C(N,ue,Z,"\u2A89","\\lnapprox",!0),C(N,ue,Z,"\u2280","\\nprec",!0),C(N,ue,Z,"\u22E0","\\npreceq",!0),C(N,ue,Z,"\u22E8","\\precnsim",!0),C(N,ue,Z,"\u2AB9","\\precnapprox",!0),C(N,ue,Z,"\u2241","\\nsim",!0),C(N,ue,Z,"\uE006","\\@nshortmid"),C(N,ue,Z,"\u2224","\\nmid",!0),C(N,ue,Z,"\u22AC","\\nvdash",!0),C(N,ue,Z,"\u22AD","\\nvDash",!0),C(N,ue,Z,"\u22EA","\\ntriangleleft"),C(N,ue,Z,"\u22EC","\\ntrianglelefteq",!0),C(N,ue,Z,"\u228A","\\subsetneq",!0),C(N,ue,Z,"\uE01A","\\@varsubsetneq"),C(N,ue,Z,"\u2ACB","\\subsetneqq",!0),C(N,ue,Z,"\uE017","\\@varsubsetneqq"),C(N,ue,Z,"\u226F","\\ngtr",!0),C(N,ue,Z,"\uE00F","\\@ngeqslant"),C(N,ue,Z,"\uE00E","\\@ngeqq"),C(N,ue,Z,"\u2A88","\\gneq",!0),C(N,ue,Z,"\u2269","\\gneqq",!0),C(N,ue,Z,"\uE00D","\\@gvertneqq"),C(N,ue,Z,"\u22E7","\\gnsim",!0),C(N,ue,Z,"\u2A8A","\\gnapprox",!0),C(N,ue,Z,"\u2281","\\nsucc",!0),C(N,ue,Z,"\u22E1","\\nsucceq",!0),C(N,ue,Z,"\u22E9","\\succnsim",!0),C(N,ue,Z,"\u2ABA","\\succnapprox",!0),C(N,ue,Z,"\u2246","\\ncong",!0),C(N,ue,Z,"\uE007","\\@nshortparallel"),C(N,ue,Z,"\u2226","\\nparallel",!0),C(N,ue,Z,"\u22AF","\\nVDash",!0),C(N,ue,Z,"\u22EB","\\ntriangleright"),C(N,ue,Z,"\u22ED","\\ntrianglerighteq",!0),C(N,ue,Z,"\uE018","\\@nsupseteqq"),C(N,ue,Z,"\u228B","\\supsetneq",!0),C(N,ue,Z,"\uE01B","\\@varsupsetneq"),C(N,ue,Z,"\u2ACC","\\supsetneqq",!0),C(N,ue,Z,"\uE019","\\@varsupsetneqq"),C(N,ue,Z,"\u22AE","\\nVdash",!0),C(N,ue,Z,"\u2AB5","\\precneqq",!0),C(N,ue,Z,"\u2AB6","\\succneqq",!0),C(N,ue,Z,"\uE016","\\@nsubseteqq"),C(N,ue,Ne,"\u22B4","\\unlhd"),C(N,ue,Ne,"\u22B5","\\unrhd"),C(N,ue,Z,"\u219A","\\nleftarrow",!0),C(N,ue,Z,"\u219B","\\nrightarrow",!0),C(N,ue,Z,"\u21CD","\\nLeftarrow",!0),C(N,ue,Z,"\u21CF","\\nRightarrow",!0),C(N,ue,Z,"\u21AE","\\nleftrightarrow",!0),C(N,ue,Z,"\u21CE","\\nLeftrightarrow",!0),C(N,ue,Z,"\u25B3","\\vartriangle"),C(N,ue,Ae,"\u210F","\\hslash"),C(N,ue,Ae,"\u25BD","\\triangledown"),C(N,ue,Ae,"\u25CA","\\lozenge"),C(N,ue,Ae,"\u24C8","\\circledS"),C(N,ue,Ae,"\xAE","\\circledR"),C(yt,ue,Ae,"\xAE","\\circledR"),C(N,ue,Ae,"\u2221","\\measuredangle",!0),C(N,ue,Ae,"\u2204","\\nexists"),C(N,ue,Ae,"\u2127","\\mho"),C(N,ue,Ae,"\u2132","\\Finv",!0),C(N,ue,Ae,"\u2141","\\Game",!0),C(N,ue,Ae,"\u2035","\\backprime"),C(N,ue,Ae,"\u25B2","\\blacktriangle"),C(N,ue,Ae,"\u25BC","\\blacktriangledown"),C(N,ue,Ae,"\u25A0","\\blacksquare"),C(N,ue,Ae,"\u29EB","\\blacklozenge"),C(N,ue,Ae,"\u2605","\\bigstar"),C(N,ue,Ae,"\u2222","\\sphericalangle",!0),C(N,ue,Ae,"\u2201","\\complement",!0),C(N,ue,Ae,"\xF0","\\eth",!0),C(N,ue,Ae,"\u2571","\\diagup"),C(N,ue,Ae,"\u2572","\\diagdown"),C(N,ue,Ae,"\u25A1","\\square"),C(N,ue,Ae,"\u25A1","\\Box"),C(N,ue,Ae,"\u25CA","\\Diamond"),C(N,ue,Ae,"\xA5","\\yen",!0),C(yt,ue,Ae,"\xA5","\\yen",!0),C(N,ue,Ae,"\u2713","\\checkmark",!0),C(yt,ue,Ae,"\u2713","\\checkmark"),C(N,ue,Ae,"\u2136","\\beth",!0),C(N,ue,Ae,"\u2138","\\daleth",!0),C(N,ue,Ae,"\u2137","\\gimel",!0),C(N,ue,Ae,"\u03DD","\\digamma",!0),C(N,ue,Ae,"\u03F0","\\varkappa"),C(N,ue,Re,"\u250C","\\ulcorner",!0),C(N,ue,Fe,"\u2510","\\urcorner",!0),C(N,ue,Re,"\u2514","\\llcorner",!0),C(N,ue,Fe,"\u2518","\\lrcorner",!0),C(N,ue,Z,"\u2266","\\leqq",!0),C(N,ue,Z,"\u2A7D","\\leqslant",!0),C(N,ue,Z,"\u2A95","\\eqslantless",!0),C(N,ue,Z,"\u2272","\\lesssim",!0),C(N,ue,Z,"\u2A85","\\lessapprox",!0),C(N,ue,Z,"\u224A","\\approxeq",!0),C(N,ue,Ne,"\u22D6","\\lessdot"),C(N,ue,Z,"\u22D8","\\lll",!0),C(N,ue,Z,"\u2276","\\lessgtr",!0),C(N,ue,Z,"\u22DA","\\lesseqgtr",!0),C(N,ue,Z,"\u2A8B","\\lesseqqgtr",!0),C(N,ue,Z,"\u2251","\\doteqdot"),C(N,ue,Z,"\u2253","\\risingdotseq",!0),C(N,ue,Z,"\u2252","\\fallingdotseq",!0),C(N,ue,Z,"\u223D","\\backsim",!0),C(N,ue,Z,"\u22CD","\\backsimeq",!0),C(N,ue,Z,"\u2AC5","\\subseteqq",!0),C(N,ue,Z,"\u22D0","\\Subset",!0),C(N,ue,Z,"\u228F","\\sqsubset",!0),C(N,ue,Z,"\u227C","\\preccurlyeq",!0),C(N,ue,Z,"\u22DE","\\curlyeqprec",!0),C(N,ue,Z,"\u227E","\\precsim",!0),C(N,ue,Z,"\u2AB7","\\precapprox",!0),C(N,ue,Z,"\u22B2","\\vartriangleleft"),C(N,ue,Z,"\u22B4","\\trianglelefteq"),C(N,ue,Z,"\u22A8","\\vDash",!0),C(N,ue,Z,"\u22AA","\\Vvdash",!0),C(N,ue,Z,"\u2323","\\smallsmile"),C(N,ue,Z,"\u2322","\\smallfrown"),C(N,ue,Z,"\u224F","\\bumpeq",!0),C(N,ue,Z,"\u224E","\\Bumpeq",!0),C(N,ue,Z,"\u2267","\\geqq",!0),C(N,ue,Z,"\u2A7E","\\geqslant",!0),C(N,ue,Z,"\u2A96","\\eqslantgtr",!0),C(N,ue,Z,"\u2273","\\gtrsim",!0),C(N,ue,Z,"\u2A86","\\gtrapprox",!0),C(N,ue,Ne,"\u22D7","\\gtrdot"),C(N,ue,Z,"\u22D9","\\ggg",!0),C(N,ue,Z,"\u2277","\\gtrless",!0),C(N,ue,Z,"\u22DB","\\gtreqless",!0),C(N,ue,Z,"\u2A8C","\\gtreqqless",!0),C(N,ue,Z,"\u2256","\\eqcirc",!0),C(N,ue,Z,"\u2257","\\circeq",!0),C(N,ue,Z,"\u225C","\\triangleq",!0),C(N,ue,Z,"\u223C","\\thicksim"),C(N,ue,Z,"\u2248","\\thickapprox"),C(N,ue,Z,"\u2AC6","\\supseteqq",!0),C(N,ue,Z,"\u22D1","\\Supset",!0),C(N,ue,Z,"\u2290","\\sqsupset",!0),C(N,ue,Z,"\u227D","\\succcurlyeq",!0),C(N,ue,Z,"\u22DF","\\curlyeqsucc",!0),C(N,ue,Z,"\u227F","\\succsim",!0),C(N,ue,Z,"\u2AB8","\\succapprox",!0),C(N,ue,Z,"\u22B3","\\vartriangleright"),C(N,ue,Z,"\u22B5","\\trianglerighteq"),C(N,ue,Z,"\u22A9","\\Vdash",!0),C(N,ue,Z,"\u2223","\\shortmid"),C(N,ue,Z,"\u2225","\\shortparallel"),C(N,ue,Z,"\u226C","\\between",!0),C(N,ue,Z,"\u22D4","\\pitchfork",!0),C(N,ue,Z,"\u221D","\\varpropto"),C(N,ue,Z,"\u25C0","\\blacktriangleleft"),C(N,ue,Z,"\u2234","\\therefore",!0),C(N,ue,Z,"\u220D","\\backepsilon"),C(N,ue,Z,"\u25B6","\\blacktriangleright"),C(N,ue,Z,"\u2235","\\because",!0),C(N,ue,Z,"\u22D8","\\llless"),C(N,ue,Z,"\u22D9","\\gggtr"),C(N,ue,Ne,"\u22B2","\\lhd"),C(N,ue,Ne,"\u22B3","\\rhd"),C(N,ue,Z,"\u2242","\\eqsim",!0),C(N,X,Z,"\u22C8","\\Join"),C(N,ue,Z,"\u2251","\\Doteq",!0),C(N,ue,Ne,"\u2214","\\dotplus",!0),C(N,ue,Ne,"\u2216","\\smallsetminus"),C(N,ue,Ne,"\u22D2","\\Cap",!0),C(N,ue,Ne,"\u22D3","\\Cup",!0),C(N,ue,Ne,"\u2A5E","\\doublebarwedge",!0),C(N,ue,Ne,"\u229F","\\boxminus",!0),C(N,ue,Ne,"\u229E","\\boxplus",!0),C(N,ue,Ne,"\u22C7","\\divideontimes",!0),C(N,ue,Ne,"\u22C9","\\ltimes",!0),C(N,ue,Ne,"\u22CA","\\rtimes",!0),C(N,ue,Ne,"\u22CB","\\leftthreetimes",!0),C(N,ue,Ne,"\u22CC","\\rightthreetimes",!0),C(N,ue,Ne,"\u22CF","\\curlywedge",!0),C(N,ue,Ne,"\u22CE","\\curlyvee",!0),C(N,ue,Ne,"\u229D","\\circleddash",!0),C(N,ue,Ne,"\u229B","\\circledast",!0),C(N,ue,Ne,"\u22C5","\\centerdot"),C(N,ue,Ne,"\u22BA","\\intercal",!0),C(N,ue,Ne,"\u22D2","\\doublecap"),C(N,ue,Ne,"\u22D3","\\doublecup"),C(N,ue,Ne,"\u22A0","\\boxtimes",!0),C(N,ue,Z,"\u21E2","\\dashrightarrow",!0),C(N,ue,Z,"\u21E0","\\dashleftarrow",!0),C(N,ue,Z,"\u21C7","\\leftleftarrows",!0),C(N,ue,Z,"\u21C6","\\leftrightarrows",!0),C(N,ue,Z,"\u21DA","\\Lleftarrow",!0),C(N,ue,Z,"\u219E","\\twoheadleftarrow",!0),C(N,ue,Z,"\u21A2","\\leftarrowtail",!0),C(N,ue,Z,"\u21AB","\\looparrowleft",!0),C(N,ue,Z,"\u21CB","\\leftrightharpoons",!0),C(N,ue,Z,"\u21B6","\\curvearrowleft",!0),C(N,ue,Z,"\u21BA","\\circlearrowleft",!0),C(N,ue,Z,"\u21B0","\\Lsh",!0),C(N,ue,Z,"\u21C8","\\upuparrows",!0),C(N,ue,Z,"\u21BF","\\upharpoonleft",!0),C(N,ue,Z,"\u21C3","\\downharpoonleft",!0),C(N,ue,Z,"\u22B8","\\multimap",!0),C(N,ue,Z,"\u21AD","\\leftrightsquigarrow",!0),C(N,ue,Z,"\u21C9","\\rightrightarrows",!0),C(N,ue,Z,"\u21C4","\\rightleftarrows",!0),C(N,ue,Z,"\u21A0","\\twoheadrightarrow",!0),C(N,ue,Z,"\u21A3","\\rightarrowtail",!0),C(N,ue,Z,"\u21AC","\\looparrowright",!0),C(N,ue,Z,"\u21B7","\\curvearrowright",!0),C(N,ue,Z,"\u21BB","\\circlearrowright",!0),C(N,ue,Z,"\u21B1","\\Rsh",!0),C(N,ue,Z,"\u21CA","\\downdownarrows",!0),C(N,ue,Z,"\u21BE","\\upharpoonright",!0),C(N,ue,Z,"\u21C2","\\downharpoonright",!0),C(N,ue,Z,"\u21DD","\\rightsquigarrow",!0),C(N,ue,Z,"\u21DD","\\leadsto"),C(N,ue,Z,"\u21DB","\\Rrightarrow",!0),C(N,ue,Z,"\u21BE","\\restriction"),C(N,X,Ae,"\u2018","`"),C(N,X,Ae,"$","\\$"),C(yt,X,Ae,"$","\\$"),C(yt,X,Ae,"$","\\textdollar"),C(N,X,Ae,"%","\\%"),C(yt,X,Ae,"%","\\%"),C(N,X,Ae,"_","\\_"),C(yt,X,Ae,"_","\\_"),C(yt,X,Ae,"_","\\textunderscore"),C(N,X,Ae,"\u2220","\\angle",!0),C(N,X,Ae,"\u221E","\\infty",!0),C(N,X,Ae,"\u2032","\\prime"),C(N,X,Ae,"\u25B3","\\triangle"),C(N,X,Ae,"\u0393","\\Gamma",!0),C(N,X,Ae,"\u0394","\\Delta",!0),C(N,X,Ae,"\u0398","\\Theta",!0),C(N,X,Ae,"\u039B","\\Lambda",!0),C(N,X,Ae,"\u039E","\\Xi",!0),C(N,X,Ae,"\u03A0","\\Pi",!0),C(N,X,Ae,"\u03A3","\\Sigma",!0),C(N,X,Ae,"\u03A5","\\Upsilon",!0),C(N,X,Ae,"\u03A6","\\Phi",!0),C(N,X,Ae,"\u03A8","\\Psi",!0),C(N,X,Ae,"\u03A9","\\Omega",!0),C(N,X,Ae,"A","\u0391"),C(N,X,Ae,"B","\u0392"),C(N,X,Ae,"E","\u0395"),C(N,X,Ae,"Z","\u0396"),C(N,X,Ae,"H","\u0397"),C(N,X,Ae,"I","\u0399"),C(N,X,Ae,"K","\u039A"),C(N,X,Ae,"M","\u039C"),C(N,X,Ae,"N","\u039D"),C(N,X,Ae,"O","\u039F"),C(N,X,Ae,"P","\u03A1"),C(N,X,Ae,"T","\u03A4"),C(N,X,Ae,"X","\u03A7"),C(N,X,Ae,"\xAC","\\neg",!0),C(N,X,Ae,"\xAC","\\lnot"),C(N,X,Ae,"\u22A4","\\top"),C(N,X,Ae,"\u22A5","\\bot"),C(N,X,Ae,"\u2205","\\emptyset"),C(N,ue,Ae,"\u2205","\\varnothing"),C(N,X,ee,"\u03B1","\\alpha",!0),C(N,X,ee,"\u03B2","\\beta",!0),C(N,X,ee,"\u03B3","\\gamma",!0),C(N,X,ee,"\u03B4","\\delta",!0),C(N,X,ee,"\u03F5","\\epsilon",!0),C(N,X,ee,"\u03B6","\\zeta",!0),C(N,X,ee,"\u03B7","\\eta",!0),C(N,X,ee,"\u03B8","\\theta",!0),C(N,X,ee,"\u03B9","\\iota",!0),C(N,X,ee,"\u03BA","\\kappa",!0),C(N,X,ee,"\u03BB","\\lambda",!0),C(N,X,ee,"\u03BC","\\mu",!0),C(N,X,ee,"\u03BD","\\nu",!0),C(N,X,ee,"\u03BE","\\xi",!0),C(N,X,ee,"\u03BF","\\omicron",!0),C(N,X,ee,"\u03C0","\\pi",!0),C(N,X,ee,"\u03C1","\\rho",!0),C(N,X,ee,"\u03C3","\\sigma",!0),C(N,X,ee,"\u03C4","\\tau",!0),C(N,X,ee,"\u03C5","\\upsilon",!0),C(N,X,ee,"\u03D5","\\phi",!0),C(N,X,ee,"\u03C7","\\chi",!0),C(N,X,ee,"\u03C8","\\psi",!0),C(N,X,ee,"\u03C9","\\omega",!0),C(N,X,ee,"\u03B5","\\varepsilon",!0),C(N,X,ee,"\u03D1","\\vartheta",!0),C(N,X,ee,"\u03D6","\\varpi",!0),C(N,X,ee,"\u03F1","\\varrho",!0),C(N,X,ee,"\u03C2","\\varsigma",!0),C(N,X,ee,"\u03C6","\\varphi",!0),C(N,X,Ne,"\u2217","*"),C(N,X,Ne,"+","+"),C(N,X,Ne,"\u2212","-"),C(N,X,Ne,"\u22C5","\\cdot",!0),C(N,X,Ne,"\u2218","\\circ"),C(N,X,Ne,"\xF7","\\div",!0),C(N,X,Ne,"\xB1","\\pm",!0),C(N,X,Ne,"\xD7","\\times",!0),C(N,X,Ne,"\u2229","\\cap",!0),C(N,X,Ne,"\u222A","\\cup",!0),C(N,X,Ne,"\u2216","\\setminus"),C(N,X,Ne,"\u2227","\\land"),C(N,X,Ne,"\u2228","\\lor"),C(N,X,Ne,"\u2227","\\wedge",!0),C(N,X,Ne,"\u2228","\\vee",!0),C(N,X,Ae,"\u221A","\\surd"),C(N,X,Re,"(","("),C(N,X,Re,"[","["),C(N,X,Re,"\u27E8","\\langle",!0),C(N,X,Re,"\u2223","\\lvert"),C(N,X,Re,"\u2225","\\lVert"),C(N,X,Fe,")",")"),C(N,X,Fe,"]","]"),C(N,X,Fe,"?","?"),C(N,X,Fe,"!","!"),C(N,X,Fe,"\u27E9","\\rangle",!0),C(N,X,Fe,"\u2223","\\rvert"),C(N,X,Fe,"\u2225","\\rVert"),C(N,X,Z,"=","="),C(N,X,Z,"<","<"),C(N,X,Z,">",">"),C(N,X,Z,":",":"),C(N,X,Z,"\u2248","\\approx",!0),C(N,X,Z,"\u2245","\\cong",!0),C(N,X,Z,"\u2265","\\ge"),C(N,X,Z,"\u2265","\\geq",!0),C(N,X,Z,"\u2190","\\gets"),C(N,X,Z,">","\\gt"),C(N,X,Z,"\u2208","\\in",!0),C(N,X,Z,"\uE020","\\@not"),C(N,X,Z,"\u2282","\\subset",!0),C(N,X,Z,"\u2283","\\supset",!0),C(N,X,Z,"\u2286","\\subseteq",!0),C(N,X,Z,"\u2287","\\supseteq",!0),C(N,ue,Z,"\u2288","\\nsubseteq",!0),C(N,ue,Z,"\u2289","\\nsupseteq",!0),C(N,X,Z,"\u22A8","\\models"),C(N,X,Z,"\u2190","\\leftarrow",!0),C(N,X,Z,"\u2264","\\le"),C(N,X,Z,"\u2264","\\leq",!0),C(N,X,Z,"<","\\lt"),C(N,X,Z,"\u2192","\\rightarrow",!0),C(N,X,Z,"\u2192","\\to"),C(N,ue,Z,"\u2271","\\ngeq",!0),C(N,ue,Z,"\u2270","\\nleq",!0),C(N,X,Nt,"\xA0","\\ "),C(N,X,Nt,"\xA0","~"),C(N,X,Nt,"\xA0","\\space"),C(N,X,Nt,"\xA0","\\nobreakspace"),C(yt,X,Nt,"\xA0","\\ "),C(yt,X,Nt,"\xA0","~"),C(yt,X,Nt,"\xA0","\\space"),C(yt,X,Nt,"\xA0","\\nobreakspace"),C(N,X,Nt,null,"\\nobreak"),C(N,X,Nt,null,"\\allowbreak"),C(N,X,Ge,",",","),C(N,X,Ge,";",";"),C(N,ue,Ne,"\u22BC","\\barwedge",!0),C(N,ue,Ne,"\u22BB","\\veebar",!0),C(N,X,Ne,"\u2299","\\odot",!0),C(N,X,Ne,"\u2295","\\oplus",!0),C(N,X,Ne,"\u2297","\\otimes",!0),C(N,X,Ae,"\u2202","\\partial",!0),C(N,X,Ne,"\u2298","\\oslash",!0),C(N,ue,Ne,"\u229A","\\circledcirc",!0),C(N,ue,Ne,"\u22A1","\\boxdot",!0),C(N,X,Ne,"\u25B3","\\bigtriangleup"),C(N,X,Ne,"\u25BD","\\bigtriangledown"),C(N,X,Ne,"\u2020","\\dagger"),C(N,X,Ne,"\u22C4","\\diamond"),C(N,X,Ne,"\u22C6","\\star"),C(N,X,Ne,"\u25C3","\\triangleleft"),C(N,X,Ne,"\u25B9","\\triangleright"),C(N,X,Re,"{","\\{"),C(yt,X,Ae,"{","\\{"),C(yt,X,Ae,"{","\\textbraceleft"),C(N,X,Fe,"}","\\}"),C(yt,X,Ae,"}","\\}"),C(yt,X,Ae,"}","\\textbraceright"),C(N,X,Re,"{","\\lbrace"),C(N,X,Fe,"}","\\rbrace"),C(N,X,Re,"[","\\lbrack"),C(yt,X,Ae,"[","\\lbrack"),C(N,X,Fe,"]","\\rbrack"),C(yt,X,Ae,"]","\\rbrack"),C(N,X,Re,"(","\\lparen"),C(N,X,Fe,")","\\rparen"),C(yt,X,Ae,"<","\\textless"),C(yt,X,Ae,">","\\textgreater"),C(N,X,Re,"\u230A","\\lfloor",!0),C(N,X,Fe,"\u230B","\\rfloor",!0),C(N,X,Re,"\u2308","\\lceil",!0),C(N,X,Fe,"\u2309","\\rceil",!0),C(N,X,Ae,"\\","\\backslash"),C(N,X,Ae,"\u2223","|"),C(N,X,Ae,"\u2223","\\vert"),C(yt,X,Ae,"|","\\textbar"),C(N,X,Ae,"\u2225","\\|"),C(N,X,Ae,"\u2225","\\Vert"),C(yt,X,Ae,"\u2225","\\textbardbl"),C(yt,X,Ae,"~","\\textasciitilde"),C(yt,X,Ae,"\\","\\textbackslash"),C(yt,X,Ae,"^","\\textasciicircum"),C(N,X,Z,"\u2191","\\uparrow",!0),C(N,X,Z,"\u21D1","\\Uparrow",!0),C(N,X,Z,"\u2193","\\downarrow",!0),C(N,X,Z,"\u21D3","\\Downarrow",!0),C(N,X,Z,"\u2195","\\updownarrow",!0),C(N,X,Z,"\u21D5","\\Updownarrow",!0),C(N,X,de,"\u2210","\\coprod"),C(N,X,de,"\u22C1","\\bigvee"),C(N,X,de,"\u22C0","\\bigwedge"),C(N,X,de,"\u2A04","\\biguplus"),C(N,X,de,"\u22C2","\\bigcap"),C(N,X,de,"\u22C3","\\bigcup"),C(N,X,de,"\u222B","\\int"),C(N,X,de,"\u222B","\\intop"),C(N,X,de,"\u222C","\\iint"),C(N,X,de,"\u222D","\\iiint"),C(N,X,de,"\u220F","\\prod"),C(N,X,de,"\u2211","\\sum"),C(N,X,de,"\u2A02","\\bigotimes"),C(N,X,de,"\u2A01","\\bigoplus"),C(N,X,de,"\u2A00","\\bigodot"),C(N,X,de,"\u222E","\\oint"),C(N,X,de,"\u222F","\\oiint"),C(N,X,de,"\u2230","\\oiiint"),C(N,X,de,"\u2A06","\\bigsqcup"),C(N,X,de,"\u222B","\\smallint"),C(yt,X,qe,"\u2026","\\textellipsis"),C(N,X,qe,"\u2026","\\mathellipsis"),C(yt,X,qe,"\u2026","\\ldots",!0),C(N,X,qe,"\u2026","\\ldots",!0),C(N,X,qe,"\u22EF","\\@cdots",!0),C(N,X,qe,"\u22F1","\\ddots",!0),C(N,X,Ae,"\u22EE","\\varvdots"),C(N,X,br,"\u02CA","\\acute"),C(N,X,br,"\u02CB","\\grave"),C(N,X,br,"\xA8","\\ddot"),C(N,X,br,"~","\\tilde"),C(N,X,br,"\u02C9","\\bar"),C(N,X,br,"\u02D8","\\breve"),C(N,X,br,"\u02C7","\\check"),C(N,X,br,"^","\\hat"),C(N,X,br,"\u20D7","\\vec"),C(N,X,br,"\u02D9","\\dot"),C(N,X,br,"\u02DA","\\mathring"),C(N,X,ee,"\u0131","\\imath",!0),C(N,X,ee,"\u0237","\\jmath",!0),C(yt,X,Ae,"\u0131","\\i",!0),C(yt,X,Ae,"\u0237","\\j",!0),C(yt,X,Ae,"\xDF","\\ss",!0),C(yt,X,Ae,"\xE6","\\ae",!0),C(yt,X,Ae,"\xE6","\\ae",!0),C(yt,X,Ae,"\u0153","\\oe",!0),C(yt,X,Ae,"\xF8","\\o",!0),C(yt,X,Ae,"\xC6","\\AE",!0),C(yt,X,Ae,"\u0152","\\OE",!0),C(yt,X,Ae,"\xD8","\\O",!0),C(yt,X,br,"\u02CA","\\'"),C(yt,X,br,"\u02CB","\\`"),C(yt,X,br,"\u02C6","\\^"),C(yt,X,br,"\u02DC","\\~"),C(yt,X,br,"\u02C9","\\="),C(yt,X,br,"\u02D8","\\u"),C(yt,X,br,"\u02D9","\\."),C(yt,X,br,"\u02DA","\\r"),C(yt,X,br,"\u02C7","\\v"),C(yt,X,br,"\xA8",'\\"'),C(yt,X,br,"\u02DD","\\H"),C(yt,X,br,"\u25EF","\\textcircled");var sr={"--":!0,"---":!0,"``":!0,"''":!0};C(yt,X,Ae,"\u2013","--"),C(yt,X,Ae,"\u2013","\\textendash"),C(yt,X,Ae,"\u2014","---"),C(yt,X,Ae,"\u2014","\\textemdash"),C(yt,X,Ae,"\u2018","`"),C(yt,X,Ae,"\u2018","\\textquoteleft"),C(yt,X,Ae,"\u2019","'"),C(yt,X,Ae,"\u2019","\\textquoteright"),C(yt,X,Ae,"\u201C","``"),C(yt,X,Ae,"\u201C","\\textquotedblleft"),C(yt,X,Ae,"\u201D","''"),C(yt,X,Ae,"\u201D","\\textquotedblright"),C(N,X,Ae,"\xB0","\\degree",!0),C(yt,X,Ae,"\xB0","\\degree"),C(yt,X,Ae,"\xB0","\\textdegree",!0),C(N,X,ee,"\xA3","\\pounds"),C(N,X,ee,"\xA3","\\mathsterling",!0),C(yt,X,ee,"\xA3","\\pounds"),C(yt,X,ee,"\xA3","\\textsterling",!0),C(N,ue,Ae,"\u2720","\\maltese"),C(yt,ue,Ae,"\u2720","\\maltese"),C(yt,X,Nt,"\xA0","\\ "),C(yt,X,Nt,"\xA0"," "),C(yt,X,Nt,"\xA0","~");for(var Sr='0123456789/@."',mi=0;mi<Sr.length;mi++){var Hi=Sr.charAt(mi);C(N,X,Ae,Hi,Hi)}for(var Ai='0123456789!@*()-=+[]<>|";:?/.,',zr=0;zr<Ai.length;zr++){var Ji=Ai.charAt(zr);C(yt,X,Ae,Ji,Ji)}for(var Cn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Di=0;Di<Cn.length;Di++){var Ii=Cn.charAt(Di);C(N,X,ee,Ii,Ii),C(yt,X,Ae,Ii,Ii)}C(N,ue,Ae,"C","\u2102"),C(yt,ue,Ae,"C","\u2102"),C(N,ue,Ae,"H","\u210D"),C(yt,ue,Ae,"H","\u210D"),C(N,ue,Ae,"N","\u2115"),C(yt,ue,Ae,"N","\u2115"),C(N,ue,Ae,"P","\u2119"),C(yt,ue,Ae,"P","\u2119"),C(N,ue,Ae,"Q","\u211A"),C(yt,ue,Ae,"Q","\u211A"),C(N,ue,Ae,"R","\u211D"),C(yt,ue,Ae,"R","\u211D"),C(N,ue,Ae,"Z","\u2124"),C(yt,ue,Ae,"Z","\u2124"),C(N,X,ee,"h","\u210E"),C(yt,X,ee,"h","\u210E");for(var ar="",Wr=0;Wr<Cn.length;Wr++){var pe=Cn.charAt(Wr);ar=String.fromCharCode(55349,56320+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar),ar=String.fromCharCode(55349,56372+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar),ar=String.fromCharCode(55349,56424+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar),ar=String.fromCharCode(55349,56580+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar),ar=String.fromCharCode(55349,56736+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar),ar=String.fromCharCode(55349,56788+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar),ar=String.fromCharCode(55349,56840+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar),ar=String.fromCharCode(55349,56944+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar),Wr<26&&(ar=String.fromCharCode(55349,56632+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar),ar=String.fromCharCode(55349,56476+Wr),C(N,X,ee,pe,ar),C(yt,X,Ae,pe,ar))}ar="\u{1D55C}",C(N,X,ee,"k",ar),C(yt,X,Ae,"k",ar);for(var we=0;we<10;we++){var kt=we.toString();ar=String.fromCharCode(55349,57294+we),C(N,X,ee,kt,ar),C(yt,X,Ae,kt,ar),ar=String.fromCharCode(55349,57314+we),C(N,X,ee,kt,ar),C(yt,X,Ae,kt,ar),ar=String.fromCharCode(55349,57324+we),C(N,X,ee,kt,ar),C(yt,X,Ae,kt,ar),ar=String.fromCharCode(55349,57334+we),C(N,X,ee,kt,ar),C(yt,X,Ae,kt,ar)}for(var Ot="\xC7\xD0\xDE\xE7\xFE",Yt=0;Yt<Ot.length;Yt++){var rr=Ot.charAt(Yt);C(N,X,ee,rr,rr),C(yt,X,Ae,rr,rr)}C(yt,X,Ae,"\xF0","\xF0"),C(yt,X,Ae,"\u2013","\u2013"),C(yt,X,Ae,"\u2014","\u2014"),C(yt,X,Ae,"\u2018","\u2018"),C(yt,X,Ae,"\u2019","\u2019"),C(yt,X,Ae,"\u201C","\u201C"),C(yt,X,Ae,"\u201D","\u201D");var ir=[["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"]],or=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],dr=function(m,b){var _=m.charCodeAt(0),S=m.charCodeAt(1),P=(_-55296)*1024+(S-56320)+65536,W=b==="math"?0:1;if(119808<=P&&P<120484){var ce=Math.floor((P-119808)/26);return[ir[ce][2],ir[ce][W]]}else if(120782<=P&&P<=120831){var _e=Math.floor((P-120782)/10);return[or[_e][2],or[_e][W]]}else{if(P===120485||P===120486)return[ir[0][2],ir[0][W]];if(120486<P&&P<120782)return["",""];throw new E("Unsupported character: "+m)}},Nr=[[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]],qr=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],xi=function(m,b){return b.size<2?m:Nr[m-1][b.size-1]},Qr=function(){function j(b){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=b.style,this.color=b.color,this.size=b.size||j.BASESIZE,this.textSize=b.textSize||this.size,this.phantom=!!b.phantom,this.font=b.font||"",this.fontFamily=b.fontFamily||"",this.fontWeight=b.fontWeight||"",this.fontShape=b.fontShape||"",this.sizeMultiplier=qr[this.size-1],this.maxSize=b.maxSize,this.minRuleThickness=b.minRuleThickness,this._fontMetrics=void 0}var m=j.prototype;return m.extend=function(_){var S={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 P in _)_.hasOwnProperty(P)&&(S[P]=_[P]);return new j(S)},m.havingStyle=function(_){return this.style===_?this:this.extend({style:_,size:xi(this.textSize,_)})},m.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},m.havingSize=function(_){return this.size===_&&this.textSize===_?this:this.extend({style:this.style.text(),size:_,textSize:_,sizeMultiplier:qr[_-1]})},m.havingBaseStyle=function(_){_=_||this.style.text();var S=xi(j.BASESIZE,_);return this.size===S&&this.textSize===j.BASESIZE&&this.style===_?this:this.extend({style:_,size:S})},m.havingBaseSizing=function(){var _;switch(this.style.id){case 4:case 5:_=3;break;case 6:case 7:_=1;break;default:_=6}return this.extend({style:this.style.text(),size:_})},m.withColor=function(_){return this.extend({color:_})},m.withPhantom=function(){return this.extend({phantom:!0})},m.withFont=function(_){return this.extend({font:_})},m.withTextFontFamily=function(_){return this.extend({fontFamily:_,font:""})},m.withTextFontWeight=function(_){return this.extend({fontWeight:_,font:""})},m.withTextFontShape=function(_){return this.extend({fontShape:_,font:""})},m.sizingClasses=function(_){return _.size!==this.size?["sizing","reset-size"+_.size,"size"+this.size]:[]},m.baseSizingClasses=function(){return this.size!==j.BASESIZE?["sizing","reset-size"+this.size,"size"+j.BASESIZE]:[]},m.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=Gt(this.size)),this._fontMetrics},m.getColor=function(){return this.phantom?"transparent":this.color},j}();Qr.BASESIZE=6;var Mi=Qr,Qi={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},wi={ex:!0,em:!0,mu:!0},$i=function(m){return typeof m!="string"&&(m=m.unit),m in Qi||m in wi||m==="ex"},je=function(m,b){var _;if(m.unit in Qi)_=Qi[m.unit]/b.fontMetrics().ptPerEm/b.sizeMultiplier;else if(m.unit==="mu")_=b.fontMetrics().cssEmPerMu;else{var S;if(b.style.isTight()?S=b.havingStyle(b.style.text()):S=b,m.unit==="ex")_=S.fontMetrics().xHeight;else if(m.unit==="em")_=S.fontMetrics().quad;else throw new E("Invalid unit: '"+m.unit+"'");S!==b&&(_*=S.sizeMultiplier/b.sizeMultiplier)}return Math.min(m.number*_,b.maxSize)},tt=["\\imath","\u0131","\\jmath","\u0237","\\pounds","\\mathsterling","\\textsterling","\xA3"],At=function(m,b,_){return Ar[_][m]&&Ar[_][m].replace&&(m=Ar[_][m].replace),{value:m,metrics:Kt(m,b,_)}},dt=function(m,b,_,S,P){var W=At(m,b,_),ce=W.metrics;m=W.value;var _e;if(ce){var Be=ce.italic;(_==="text"||S&&S.font==="mathit")&&(Be=0),_e=new ze(m,ce.height,ce.depth,Be,ce.skew,ce.width,P)}else typeof console!="undefined"&&console.warn("No character metrics "+("for '"+m+"' in style '"+b+"' and mode '"+_+"'")),_e=new ze(m,0,0,0,0,0,P);if(S){_e.maxFontSize=S.sizeMultiplier,S.style.isTight()&&_e.classes.push("mtight");var Je=S.getColor();Je&&(_e.style.color=Je)}return _e},pt=function(m,b,_,S){return S===void 0&&(S=[]),_.font==="boldsymbol"&&At(m,"Main-Bold",b).metrics?dt(m,"Main-Bold",b,_,S.concat(["mathbf"])):m==="\\"||Ar[b][m].font==="main"?dt(m,"Main-Regular",b,_,S):dt(m,"AMS-Regular",b,_,S.concat(["amsrm"]))},Tt=function(m,b,_,S){return/[0-9]/.test(m.charAt(0))||J.contains(tt,m)?{fontName:"Main-Italic",fontClass:"mathit"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},Ut=function(m,b,_,S){return J.contains(tt,m)?{fontName:"Main-Italic",fontClass:"mathit"}:/[0-9]/.test(m.charAt(0))?{fontName:"Caligraphic-Regular",fontClass:"mathcal"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},Jt=function(m,b,_,S){return At(m,"Math-BoldItalic",b).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Er=function(m,b,_){var S=m.mode,P=m.text,W=["mord"],ce=S==="math"||S==="text"&&b.font,_e=ce?b.font:b.fontFamily;if(P.charCodeAt(0)===55349){var Be=dr(P,S),Je=Be[0],ft=Be[1];return dt(P,Je,S,b,W.concat(ft))}else if(_e){var It,Qt;if(_e==="boldsymbol"||_e==="mathnormal"){var lr=_e==="boldsymbol"?Jt(P,S,b,W):Ut(P,S,b,W);It=lr.fontName,Qt=[lr.fontClass]}else J.contains(tt,P)?(It="Main-Italic",Qt=["mathit"]):ce?(It=Ur[_e].fontName,Qt=[_e]):(It=Ti(_e,b.fontWeight,b.fontShape),Qt=[_e,b.fontWeight,b.fontShape]);if(At(P,It,S).metrics)return dt(P,It,S,b,W.concat(Qt));if(sr.hasOwnProperty(P)&&It.substr(0,10)==="Typewriter"){for(var Dr=[],Jr=0;Jr<P.length;Jr++)Dr.push(dt(P[Jr],It,S,b,W.concat(Qt)));return hr(Dr)}}if(_==="mathord"){var ai=Tt(P,S,b,W);return dt(P,ai.fontName,S,b,W.concat([ai.fontClass]))}else if(_==="textord"){var ki=Ar[S][P]&&Ar[S][P].font;if(ki==="ams"){var Ni=Ti("amsrm",b.fontWeight,b.fontShape);return dt(P,Ni,S,b,W.concat("amsrm",b.fontWeight,b.fontShape))}else if(ki==="main"||!ki){var An=Ti("textrm",b.fontWeight,b.fontShape);return dt(P,An,S,b,W.concat(b.fontWeight,b.fontShape))}else{var mn=Ti(ki,b.fontWeight,b.fontShape);return dt(P,mn,S,b,W.concat(mn,b.fontWeight,b.fontShape))}}else throw new Error("unexpected type: "+_+" in makeOrd")},kr=function(m,b){if(si(m.classes)!==si(b.classes)||m.skew!==b.skew||m.maxFontSize!==b.maxFontSize)return!1;for(var _ in m.style)if(m.style.hasOwnProperty(_)&&m.style[_]!==b.style[_])return!1;for(var S in b.style)if(b.style.hasOwnProperty(S)&&m.style[S]!==b.style[S])return!1;return!0},Or=function(m){for(var b=0;b<m.length-1;b++){var _=m[b],S=m[b+1];_ instanceof ze&&S instanceof ze&&kr(_,S)&&(_.text+=S.text,_.height=Math.max(_.height,S.height),_.depth=Math.max(_.depth,S.depth),_.italic=S.italic,m.splice(b+1,1),b--)}return m},vr=function(m){for(var b=0,_=0,S=0,P=0;P<m.children.length;P++){var W=m.children[P];W.height>b&&(b=W.height),W.depth>_&&(_=W.depth),W.maxFontSize>S&&(S=W.maxFontSize)}m.height=b,m.depth=_,m.maxFontSize=S},cr=function(m,b,_,S){var P=new wt(m,b,_,S);return vr(P),P},Tr=function(m,b,_,S){return new wt(m,b,_,S)},gi=function(m,b,_){var S=cr([m],[],b);return S.height=Math.max(_||b.fontMetrics().defaultRuleThickness,b.minRuleThickness),S.style.borderBottomWidth=S.height+"em",S.maxFontSize=1,S},ci=function(m,b,_,S){var P=new Rt(m,b,_,S);return vr(P),P},hr=function(m){var b=new Wt(m);return vr(b),b},Zr=function(m,b){return m instanceof Wt?cr([],[m],b):m},Si=function(m){if(m.positionType==="individualShift"){for(var b=m.children,_=[b[0]],S=-b[0].shift-b[0].elem.depth,P=S,W=1;W<b.length;W++){var ce=-b[W].shift-P-b[W].elem.depth,_e=ce-(b[W-1].elem.height+b[W-1].elem.depth);P=P+ce,_.push({type:"kern",size:_e}),_.push(b[W])}return{children:_,depth:S}}var Be;if(m.positionType==="top"){for(var Je=m.positionData,ft=0;ft<m.children.length;ft++){var It=m.children[ft];Je-=It.type==="kern"?It.size:It.elem.height+It.elem.depth}Be=Je}else if(m.positionType==="bottom")Be=-m.positionData;else{var Qt=m.children[0];if(Qt.type!=="elem")throw new Error('First child must have type "elem".');if(m.positionType==="shift")Be=-Qt.elem.depth-m.positionData;else if(m.positionType==="firstBaseline")Be=-Qt.elem.depth;else throw new Error("Invalid positionType "+m.positionType+".")}return{children:m.children,depth:Be}},ti=function(m,b){for(var _=Si(m),S=_.children,P=_.depth,W=0,ce=0;ce<S.length;ce++){var _e=S[ce];if(_e.type==="elem"){var Be=_e.elem;W=Math.max(W,Be.maxFontSize,Be.height)}}W+=2;var Je=cr(["pstrut"],[]);Je.style.height=W+"em";for(var ft=[],It=P,Qt=P,lr=P,Dr=0;Dr<S.length;Dr++){var Jr=S[Dr];if(Jr.type==="kern")lr+=Jr.size;else{var ai=Jr.elem,ki=Jr.wrapperClasses||[],Ni=Jr.wrapperStyle||{},An=cr(ki,[Je,ai],void 0,Ni);An.style.top=-W-lr-ai.depth+"em",Jr.marginLeft&&(An.style.marginLeft=Jr.marginLeft),Jr.marginRight&&(An.style.marginRight=Jr.marginRight),ft.push(An),lr+=ai.height+ai.depth}It=Math.min(It,lr),Qt=Math.max(Qt,lr)}var mn=cr(["vlist"],ft);mn.style.height=Qt+"em";var kn;if(It<0){var Tn=cr([],[]),In=cr(["vlist"],[Tn]);In.style.height=-It+"em";var As=cr(["vlist-s"],[new ze("\u200B")]);kn=[cr(["vlist-r"],[mn,As]),cr(["vlist-r"],[In])]}else kn=[cr(["vlist-r"],[mn])];var Fn=cr(["vlist-t"],kn);return kn.length===2&&Fn.classes.push("vlist-t2"),Fn.height=Qt,Fn.depth=-It,Fn},Vr=function(m,b){var _=cr(["mspace"],[],b),S=je(m,b);return _.style.marginRight=S+"em",_},Ti=function(m,b,_){var S="";switch(m){case"amsrm":S="AMS";break;case"textrm":S="Main";break;case"textsf":S="SansSerif";break;case"texttt":S="Typewriter";break;default:S=m}var P;return b==="textbf"&&_==="textit"?P="BoldItalic":b==="textbf"?P="Bold":b==="textit"?P="Italic":P="Regular",S+"-"+P},Ur={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"}},ri={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Ri=function(m,b){var _=ri[m],S=_[0],P=_[1],W=_[2],ce=new ut(S),_e=new it([ce],{width:P+"em",height:W+"em",style:"width:"+P+"em",viewBox:"0 0 "+1e3*P+" "+1e3*W,preserveAspectRatio:"xMinYMin"}),Be=Tr(["overlay"],[_e],b);return Be.height=W,Be.style.height=W+"em",Be.style.width=P+"em",Be},st={fontMap:Ur,makeSymbol:dt,mathsym:pt,makeSpan:cr,makeSvgSpan:Tr,makeLineSpan:gi,makeAnchor:ci,makeFragment:hr,wrapFragment:Zr,makeVList:ti,makeOrd:Er,makeGlue:Vr,staticSvg:Ri,svgData:ri,tryCombineChars:Or};function Ir(j,m){var b=hi(j,m);if(!b)throw new Error("Expected node of type "+m+", but got "+(j?"node of type "+j.type:String(j)));return b}function hi(j,m){return j&&j.type===m?j:null}function Oi(j,m){var b=ln(j,m);if(!b)throw new Error('Expected node of type "atom" and family "'+m+'", but got '+(j?j.type==="atom"?"atom of family "+j.family:"node of type "+j.type:String(j)));return b}function ln(j,m){return j&&j.type==="atom"&&j.family===m?j:null}function tn(j){var m=zi(j);if(!m)throw new Error("Expected node of symbol group type, but got "+(j?"node of type "+j.type:String(j)));return m}function zi(j){return j&&(j.type==="atom"||wr.hasOwnProperty(j.type))?j:null}var $r={number:3,unit:"mu"},jr={number:4,unit:"mu"},qi={number:5,unit:"mu"},Ki={mord:{mop:$r,mbin:jr,mrel:qi,minner:$r},mop:{mord:$r,mop:$r,mrel:qi,minner:$r},mbin:{mord:jr,mop:jr,mopen:jr,minner:jr},mrel:{mord:qi,mop:qi,mopen:qi,minner:qi},mopen:{},mclose:{mop:$r,mbin:jr,mrel:qi,minner:$r},mpunct:{mord:$r,mop:$r,mrel:qi,mopen:$r,mclose:$r,mpunct:$r,minner:$r},minner:{mord:$r,mop:$r,mbin:jr,mrel:qi,mopen:$r,mpunct:$r,minner:$r}},Bi={mord:{mop:$r},mop:{mord:$r,mop:$r},mbin:{},mrel:{},mopen:{},mclose:{mop:$r},mpunct:{},minner:{mop:$r}},bs={},Wn={},un={};function Rr(j){for(var m=j.type,b=j.names,_=j.props,S=j.handler,P=j.htmlBuilder,W=j.mathmlBuilder,ce={type:m,numArgs:_.numArgs,argTypes:_.argTypes,greediness:_.greediness===void 0?1:_.greediness,allowedInText:!!_.allowedInText,allowedInMath:_.allowedInMath===void 0?!0:_.allowedInMath,numOptionalArgs:_.numOptionalArgs||0,infix:!!_.infix,handler:S},_e=0;_e<b.length;++_e)bs[b[_e]]=ce;m&&(P&&(Wn[m]=P),W&&(un[m]=W))}function Ci(j){var m=j.type,b=j.htmlBuilder,_=j.mathmlBuilder;Rr({type:m,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:b,mathmlBuilder:_})}var Gi=function(m){var b=hi(m,"ordgroup");return b?b.body:[m]},On=st.makeSpan,ss=["leftmost","mbin","mopen","mrel","mop","mpunct"],xn=["rightmost","mrel","mclose","mpunct"],Dn={display:D.DISPLAY,text:D.TEXT,script:D.SCRIPT,scriptscript:D.SCRIPTSCRIPT},vn={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Fi=function(m,b,_,S){S===void 0&&(S=[null,null]);for(var P=[],W=0;W<m.length;W++){var ce=Ei(m[W],b);if(ce instanceof Wt){var _e=ce.children;P.push.apply(P,_e)}else P.push(ce)}if(!_)return P;var Be=b;if(m.length===1){var Je=hi(m[0],"sizing")||hi(m[0],"styling");Je&&(Je.type==="sizing"?Be=b.havingSize(Je.size):Je.type==="styling"&&(Be=b.havingStyle(Dn[Je.style])))}var ft=On([S[0]||"leftmost"],[],b),It=On([S[1]||"rightmost"],[],b);return ds(P,function(Qt,lr){var Dr=lr.classes[0],Jr=Qt.classes[0];Dr==="mbin"&&J.contains(xn,Jr)?lr.classes[0]="mord":Jr==="mbin"&&J.contains(ss,Dr)&&(Qt.classes[0]="mord")},{node:ft},It),ds(P,function(Qt,lr){var Dr=ts(lr),Jr=ts(Qt),ai=Dr&&Jr?Qt.hasClass("mtight")?Bi[Dr][Jr]:Ki[Dr][Jr]:null;if(ai)return st.makeGlue(ai,Be)},{node:ft},It),P},ds=function j(m,b,_,S){S&&m.push(S);for(var P=0;P<m.length;P++){var W=m[P],ce=cn(W);if(ce){j(ce.children,b,_);continue}if(W.classes[0]!=="mspace"){var _e=b(W,_.node);_e&&(_.insertAfter?_.insertAfter(_e):(m.unshift(_e),P++)),_.node=W,_.insertAfter=function(Be){return function(Je){m.splice(Be+1,0,Je),P++}}(P)}}S&&m.pop()},cn=function(m){return m instanceof Wt||m instanceof Rt?m:null},es=function j(m,b){var _=cn(m);if(_){var S=_.children;if(S.length){if(b==="right")return j(S[S.length-1],"right");if(b==="left")return j(S[0],"left")}}return m},ts=function(m,b){return m?(b&&(m=es(m,b)),vn[m.classes[0]]||null):null},wn=function(m,b){var _=["nulldelimiter"].concat(m.baseSizingClasses());return On(b.concat(_))},Ei=function(m,b,_){if(!m)return On();if(Wn[m.type]){var S=Wn[m.type](m,b);if(_&&b.size!==_.size){S=On(b.sizingClasses(_),[S],b);var P=b.sizeMultiplier/_.sizeMultiplier;S.height*=P,S.depth*=P}return S}else throw new E("Got group of unknown type: '"+m.type+"'")};function as(j,m){var b=On(["base"],j,m),_=On(["strut"]);return _.style.height=b.height+b.depth+"em",_.style.verticalAlign=-b.depth+"em",b.children.unshift(_),b}function rs(j,m){var b=null;j.length===1&&j[0].type==="tag"&&(b=j[0].tag,j=j[0].body);for(var _=Fi(j,m,!0),S=[],P=[],W=0;W<_.length;W++)if(P.push(_[W]),_[W].hasClass("mbin")||_[W].hasClass("mrel")||_[W].hasClass("allowbreak")){for(var ce=!1;W<_.length-1&&_[W+1].hasClass("mspace")&&!_[W+1].hasClass("newline");)W++,P.push(_[W]),_[W].hasClass("nobreak")&&(ce=!0);ce||(S.push(as(P,m)),P=[])}else _[W].hasClass("newline")&&(P.pop(),P.length>0&&(S.push(as(P,m)),P=[]),S.push(_[W]));P.length>0&&S.push(as(P,m));var _e;b&&(_e=as(Fi(b,m,!0)),_e.classes=["tag"],S.push(_e));var Be=On(["katex-html"],S);if(Be.setAttribute("aria-hidden","true"),_e){var Je=_e.children[0];Je.style.height=Be.height+Be.depth+"em",Je.style.verticalAlign=-Be.depth+"em"}return Be}function os(j){return new Wt(j)}var zn=function(){function j(b,_){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=b,this.attributes={},this.children=_||[]}var m=j.prototype;return m.setAttribute=function(_,S){this.attributes[_]=S},m.getAttribute=function(_){return this.attributes[_]},m.toNode=function(){var _=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var S in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,S)&&_.setAttribute(S,this.attributes[S]);for(var P=0;P<this.children.length;P++)_.appendChild(this.children[P].toNode());return _},m.toMarkup=function(){var _="<"+this.type;for(var S in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,S)&&(_+=" "+S+'="',_+=J.escape(this.attributes[S]),_+='"');_+=">";for(var P=0;P<this.children.length;P++)_+=this.children[P].toMarkup();return _+="</"+this.type+">",_},m.toText=function(){return this.children.map(function(_){return _.toText()}).join("")},j}(),di=function(){function j(b){this.text=void 0,this.text=b}var m=j.prototype;return m.toNode=function(){return document.createTextNode(this.text)},m.toMarkup=function(){return J.escape(this.toText())},m.toText=function(){return this.text},j}(),Ts=function(){function j(b){this.width=void 0,this.character=void 0,this.width=b,b>=.05555&&b<=.05556?this.character="\u200A":b>=.1666&&b<=.1667?this.character="\u2009":b>=.2222&&b<=.2223?this.character="\u2005":b>=.2777&&b<=.2778?this.character="\u2005\u200A":b>=-.05556&&b<=-.05555?this.character="\u200A\u2063":b>=-.1667&&b<=-.1666?this.character="\u2009\u2063":b>=-.2223&&b<=-.2222?this.character="\u205F\u2063":b>=-.2778&&b<=-.2777?this.character="\u2005\u2063":this.character=null}var m=j.prototype;return m.toNode=function(){if(this.character)return document.createTextNode(this.character);var _=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return _.setAttribute("width",this.width+"em"),_},m.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+this.width+'em"/>'},m.toText=function(){return this.character?this.character:" "},j}(),tr={MathNode:zn,TextNode:di,SpaceNode:Ts,newDocumentFragment:os},hn=function(m,b,_){return Ar[b][m]&&Ar[b][m].replace&&m.charCodeAt(0)!==55349&&!(sr.hasOwnProperty(m)&&_&&(_.fontFamily&&_.fontFamily.substr(4,2)==="tt"||_.font&&_.font.substr(4,2)==="tt"))&&(m=Ar[b][m].replace),new tr.TextNode(m)},Ps=function(m){return m.length===1?m[0]:new tr.MathNode("mrow",m)},ls=function(m,b){if(b.fontFamily==="texttt")return"monospace";if(b.fontFamily==="textsf")return b.fontShape==="textit"&&b.fontWeight==="textbf"?"sans-serif-bold-italic":b.fontShape==="textit"?"sans-serif-italic":b.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(b.fontShape==="textit"&&b.fontWeight==="textbf")return"bold-italic";if(b.fontShape==="textit")return"italic";if(b.fontWeight==="textbf")return"bold";var _=b.font;if(!_||_==="mathnormal")return null;var S=m.mode;if(_==="mathit")return"italic";if(_==="boldsymbol")return"bold-italic";if(_==="mathbf")return"bold";if(_==="mathbb")return"double-struck";if(_==="mathfrak")return"fraktur";if(_==="mathscr"||_==="mathcal")return"script";if(_==="mathsf")return"sans-serif";if(_==="mathtt")return"monospace";var P=m.text;if(J.contains(["\\imath","\\jmath"],P))return null;Ar[S][P]&&Ar[S][P].replace&&(P=Ar[S][P].replace);var W=st.fontMap[_].fontName;return Kt(P,W,S)?st.fontMap[_].variant:null},Mn=function(m,b,_){if(m.length===1){var S=oi(m[0],b);return _&&S instanceof zn&&S.type==="mo"&&(S.setAttribute("lspace","0em"),S.setAttribute("rspace","0em")),[S]}for(var P=[],W,ce=0;ce<m.length;ce++){var _e=oi(m[ce],b);if(_e instanceof zn&&W instanceof zn){if(_e.type==="mtext"&&W.type==="mtext"&&_e.getAttribute("mathvariant")===W.getAttribute("mathvariant")){var Be;(Be=W.children).push.apply(Be,_e.children);continue}else if(_e.type==="mn"&&W.type==="mn"){var Je;(Je=W.children).push.apply(Je,_e.children);continue}else if(_e.type==="mi"&&_e.children.length===1&&W.type==="mn"){var ft=_e.children[0];if(ft instanceof di&&ft.text==="."){var It;(It=W.children).push.apply(It,_e.children);continue}}else if(W.type==="mi"&&W.children.length===1){var Qt=W.children[0];if(Qt instanceof di&&Qt.text==="\u0338"&&(_e.type==="mo"||_e.type==="mi"||_e.type==="mn")){var lr=_e.children[0];lr instanceof di&&lr.text.length>0&&(lr.text=lr.text.slice(0,1)+"\u0338"+lr.text.slice(1),P.pop())}}}P.push(_e),W=_e}return P},us=function(m,b,_){return Ps(Mn(m,b,_))},oi=function(m,b){if(!m)return new tr.MathNode("mrow");if(un[m.type]){var _=un[m.type](m,b);return _}else throw new E("Got group of unknown type: '"+m.type+"'")};function Kn(j,m,b,_){var S=Mn(j,b),P;S.length===1&&S[0]instanceof zn&&J.contains(["mrow","mtable"],S[0].type)?P=S[0]:P=new tr.MathNode("mrow",S);var W=new tr.MathNode("annotation",[new tr.TextNode(m)]);W.setAttribute("encoding","application/x-tex");var ce=new tr.MathNode("semantics",[P,W]),_e=new tr.MathNode("math",[ce]);_e.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var Be=_?"katex":"katex-mathml";return st.makeSpan([Be],[_e])}var fs=function(m){return new Mi({style:m.displayMode?D.DISPLAY:D.TEXT,maxSize:m.maxSize,minRuleThickness:m.minRuleThickness})},jn=function(m,b){if(b.displayMode){var _=["katex-display"];b.leqno&&_.push("leqno"),b.fleqn&&_.push("fleqn"),m=st.makeSpan(_,[m])}return m},dn=function(m,b,_){var S=fs(_),P;if(_.output==="mathml")return Kn(m,b,S,!0);if(_.output==="html"){var W=rs(m,S);P=st.makeSpan(["katex"],[W])}else{var ce=Kn(m,b,S,!1),_e=rs(m,S);P=st.makeSpan(["katex"],[ce,_e])}return jn(P,_)},Sn=function(m,b,_){var S=fs(_),P=rs(m,S),W=st.makeSpan(["katex"],[P]);return jn(W,_)},Bn=dn,Ln={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"},Cs=function(m){var b=new tr.MathNode("mo",[new tr.TextNode(Ln[m.substr(1)])]);return b.setAttribute("stretchy","true"),b},Zn={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]},ia=function(m){return m.type==="ordgroup"?m.body.length:1},ca=function(m,b){function _(){var _e=4e5,Be=m.label.substr(1);if(J.contains(["widehat","widecheck","widetilde","utilde"],Be)){var Je=m,ft=ia(Je.base),It,Qt,lr;if(ft>5)Be==="widehat"||Be==="widecheck"?(It=420,_e=2364,lr=.42,Qt=Be+"4"):(It=312,_e=2340,lr=.34,Qt="tilde4");else{var Dr=[1,1,2,2,3,3][ft];Be==="widehat"||Be==="widecheck"?(_e=[0,1062,2364,2364,2364][Dr],It=[0,239,300,360,420][Dr],lr=[0,.24,.3,.3,.36,.42][Dr],Qt=Be+Dr):(_e=[0,600,1033,2339,2340][Dr],It=[0,260,286,306,312][Dr],lr=[0,.26,.286,.3,.306,.34][Dr],Qt="tilde"+Dr)}var Jr=new ut(Qt),ai=new it([Jr],{width:"100%",height:lr+"em",viewBox:"0 0 "+_e+" "+It,preserveAspectRatio:"none"});return{span:st.makeSvgSpan([],[ai],b),minWidth:0,height:lr}}else{var ki=[],Ni=Zn[Be],An=Ni[0],mn=Ni[1],kn=Ni[2],Tn=kn/1e3,In=An.length,As,Fn;if(In===1){var nt=Ni[3];As=["hide-tail"],Fn=[nt]}else if(In===2)As=["halfarrow-left","halfarrow-right"],Fn=["xMinYMin","xMaxYMin"];else if(In===3)As=["brace-left","brace-center","brace-right"],Fn=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+In+" children.");for(var Qs=0;Qs<In;Qs++){var wa=new ut(An[Qs]),pa=new it([wa],{width:"400em",height:Tn+"em",viewBox:"0 0 "+_e+" "+kn,preserveAspectRatio:Fn[Qs]+" slice"}),Xn=st.makeSvgSpan([As[Qs]],[pa],b);if(In===1)return{span:Xn,minWidth:mn,height:Tn};Xn.style.height=Tn+"em",ki.push(Xn)}return{span:st.makeSpan(["stretchy"],ki,b),minWidth:mn,height:Tn}}}var S=_(),P=S.span,W=S.minWidth,ce=S.height;return P.height=ce,P.style.height=ce+"em",W>0&&(P.style.minWidth=W+"em"),P},Gs=function(m,b,_,S){var P,W=m.height+m.depth+2*_;if(/fbox|color/.test(b)){if(P=st.makeSpan(["stretchy",b],[],S),b==="fbox"){var ce=S.color&&S.getColor();ce&&(P.style.borderColor=ce)}}else{var _e=[];/^[bx]cancel$/.test(b)&&_e.push(new _t({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(b)&&_e.push(new _t({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var Be=new it(_e,{width:"100%",height:W+"em"});P=st.makeSvgSpan([],[Be],S)}return P.height=W,P.style.height=W+"em",P},_s={encloseSpan:Gs,mathMLnode:Cs,svgSpan:ca},Kr=function(m,b){var _,S,P=hi(m,"supsub"),W;P?(S=Ir(P.base,"accent"),_=S.base,P.base=_,W=nr(Ei(P,b)),P.base=S):(S=Ir(m,"accent"),_=S.base);var ce=Ei(_,b.havingCrampedStyle()),_e=S.isShifty&&J.isCharacterBox(_),Be=0;if(_e){var Je=J.getBaseElem(_),ft=Ei(Je,b.havingCrampedStyle());Be=Ft(ft).skew}var It=Math.min(ce.height,b.fontMetrics().xHeight),Qt;if(S.isStretchy)Qt=_s.svgSpan(S,b),Qt=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:ce},{type:"elem",elem:Qt,wrapperClasses:["svg-align"],wrapperStyle:Be>0?{width:"calc(100% - "+2*Be+"em)",marginLeft:2*Be+"em"}:void 0}]},b);else{var lr,Dr;S.label==="\\vec"?(lr=st.staticSvg("vec",b),Dr=st.svgData.vec[1]):(lr=st.makeOrd({mode:S.mode,text:S.label},b,"textord"),lr=Ft(lr),lr.italic=0,Dr=lr.width),Qt=st.makeSpan(["accent-body"],[lr]);var Jr=S.label==="\\textcircled";Jr&&(Qt.classes.push("accent-full"),It=ce.height);var ai=Be;Jr||(ai-=Dr/2),Qt.style.left=ai+"em",S.label==="\\textcircled"&&(Qt.style.top=".2em"),Qt=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:ce},{type:"kern",size:-It},{type:"elem",elem:Qt}]},b)}var ki=st.makeSpan(["mord","accent"],[Qt],b);return W?(W.children[0]=ki,W.height=Math.max(ki.height,W.height),W.classes[0]="mord",W):ki},fi=function(m,b){var _=m.isStretchy?_s.mathMLnode(m.label):new tr.MathNode("mo",[hn(m.label,m.mode)]),S=new tr.MathNode("mover",[oi(m.base,b),_]);return S.setAttribute("accent","true"),S},Zi=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(j){return"\\"+j}).join("|"));Rr({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(m,b){var _=b[0],S=!Zi.test(m.funcName),P=!S||m.funcName==="\\widehat"||m.funcName==="\\widetilde"||m.funcName==="\\widecheck";return{type:"accent",mode:m.parser.mode,label:m.funcName,isStretchy:S,isShifty:P,base:_}},htmlBuilder:Kr,mathmlBuilder:fi}),Rr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!1},handler:function(m,b){var _=b[0];return{type:"accent",mode:m.parser.mode,label:m.funcName,isStretchy:!1,isShifty:!0,base:_}},htmlBuilder:Kr,mathmlBuilder:fi}),Rr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[0];return{type:"accentUnder",mode:_.mode,label:S,base:P}},htmlBuilder:function(m,b){var _=Ei(m.base,b),S=_s.svgSpan(m,b),P=m.label==="\\utilde"?.12:0,W=st.makeVList({positionType:"bottom",positionData:S.height+P,children:[{type:"elem",elem:S,wrapperClasses:["svg-align"]},{type:"kern",size:P},{type:"elem",elem:_}]},b);return st.makeSpan(["mord","accentunder"],[W],b)},mathmlBuilder:function(m,b){var _=_s.mathMLnode(m.label),S=new tr.MathNode("munder",[oi(m.base,b),_]);return S.setAttribute("accentunder","true"),S}});var yi=function(m){var b=new tr.MathNode("mpadded",m?[m]:[]);return b.setAttribute("width","+0.6em"),b.setAttribute("lspace","0.3em"),b};Rr({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(m,b,_){var S=m.parser,P=m.funcName;return{type:"xArrow",mode:S.mode,label:P,body:b[0],below:_[0]}},htmlBuilder:function(m,b){var _=b.style,S=b.havingStyle(_.sup()),P=st.wrapFragment(Ei(m.body,S,b),b);P.classes.push("x-arrow-pad");var W;m.below&&(S=b.havingStyle(_.sub()),W=st.wrapFragment(Ei(m.below,S,b),b),W.classes.push("x-arrow-pad"));var ce=_s.svgSpan(m,b),_e=-b.fontMetrics().axisHeight+.5*ce.height,Be=-b.fontMetrics().axisHeight-.5*ce.height-.111;(P.depth>.25||m.label==="\\xleftequilibrium")&&(Be-=P.depth);var Je;if(W){var ft=-b.fontMetrics().axisHeight+W.height+.5*ce.height+.111;Je=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:P,shift:Be},{type:"elem",elem:ce,shift:_e},{type:"elem",elem:W,shift:ft}]},b)}else Je=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:P,shift:Be},{type:"elem",elem:ce,shift:_e}]},b);return Je.children[0].children[0].children[1].classes.push("svg-align"),st.makeSpan(["mrel","x-arrow"],[Je],b)},mathmlBuilder:function(m,b){var _=_s.mathMLnode(m.label),S;if(m.body){var P=yi(oi(m.body,b));if(m.below){var W=yi(oi(m.below,b));S=new tr.MathNode("munderover",[_,W,P])}else S=new tr.MathNode("mover",[_,P])}else if(m.below){var ce=yi(oi(m.below,b));S=new tr.MathNode("munder",[_,ce])}else S=yi(),S=new tr.MathNode("mover",[_,S]);return S}}),Rr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){for(var _=m.parser,S=Ir(b[0],"ordgroup"),P=S.body,W="",ce=0;ce<P.length;ce++){var _e=Ir(P[ce],"textord");W+=_e.text}var Be=parseInt(W);if(isNaN(Be))throw new E("\\@char has non-numeric argument "+W);return{type:"textord",mode:_.mode,text:String.fromCharCode(Be)}}});var _i=function(m,b){var _=Fi(m.body,b.withColor(m.color),!1);return st.makeFragment(_)},is=function(m,b){var _=Mn(m.body,b.withColor(m.color)),S=new tr.MathNode("mstyle",_);return S.setAttribute("mathcolor",m.color),S};Rr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(m,b){var _=m.parser,S=Ir(b[0],"color-token").color,P=b[1];return{type:"color",mode:_.mode,color:S,body:Gi(P)}},htmlBuilder:_i,mathmlBuilder:is}),Rr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(m,b){var _=m.parser,S=m.breakOnTokenText,P=Ir(b[0],"color-token").color;_.gullet.macros.set("\\current@color",P);var W=_.parseExpression(!0,S);return{type:"color",mode:_.mode,color:P,body:W}},htmlBuilder:_i,mathmlBuilder:is}),Rr({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(m,b,_){var S=m.parser,P=m.funcName,W=_[0],ce=P==="\\cr",_e=!1;return ce||(S.settings.displayMode&&S.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")?_e=!1:_e=!0),{type:"cr",mode:S.mode,newLine:_e,newRow:ce,size:W&&Ir(W,"size").value}},htmlBuilder:function(m,b){if(m.newRow)throw new E("\\cr valid only within a tabular/array environment");var _=st.makeSpan(["mspace"],[],b);return m.newLine&&(_.classes.push("newline"),m.size&&(_.style.marginTop=je(m.size,b)+"em")),_},mathmlBuilder:function(m,b){var _=new tr.MathNode("mspace");return m.newLine&&(_.setAttribute("linebreak","newline"),m.size&&_.setAttribute("height",je(m.size,b)+"em")),_}});var rn=function(m,b,_){var S=Ar.math[m]&&Ar.math[m].replace,P=Kt(S||m,b,_);if(!P)throw new Error("Unsupported symbol "+m+" and font size "+b+".");return P},cs=function(m,b,_,S){var P=_.havingBaseStyle(b),W=st.makeSpan(S.concat(P.sizingClasses(_)),[m],_),ce=P.sizeMultiplier/_.sizeMultiplier;return W.height*=ce,W.depth*=ce,W.maxFontSize=P.sizeMultiplier,W},Pi=function(m,b,_){var S=b.havingBaseStyle(_),P=(1-b.sizeMultiplier/S.sizeMultiplier)*b.fontMetrics().axisHeight;m.classes.push("delimcenter"),m.style.top=P+"em",m.height-=P,m.depth+=P},bi=function(m,b,_,S,P,W){var ce=st.makeSymbol(m,"Main-Regular",P,S),_e=cs(ce,b,S,W);return _&&Pi(_e,S,b),_e},yn=function(m,b,_,S){return st.makeSymbol(m,"Size"+b+"-Regular",_,S)},fn=function(m,b,_,S,P,W){var ce=yn(m,b,P,S),_e=cs(st.makeSpan(["delimsizing","size"+b],[ce],S),D.TEXT,S,W);return _&&Pi(_e,S,D.TEXT),_e},pn=function(m,b,_){var S;b==="Size1-Regular"?S="delim-size1":S="delim-size4";var P=st.makeSpan(["delimsizinginner",S],[st.makeSpan([],[st.makeSymbol(m,b,_)])]);return{type:"elem",elem:P}},En={type:"kern",size:-.005},Vi=function(m,b,_,S,P,W){var ce,_e,Be,Je;ce=Be=Je=m,_e=null;var ft="Size1-Regular";m==="\\uparrow"?Be=Je="\u23D0":m==="\\Uparrow"?Be=Je="\u2016":m==="\\downarrow"?ce=Be="\u23D0":m==="\\Downarrow"?ce=Be="\u2016":m==="\\updownarrow"?(ce="\\uparrow",Be="\u23D0",Je="\\downarrow"):m==="\\Updownarrow"?(ce="\\Uparrow",Be="\u2016",Je="\\Downarrow"):m==="["||m==="\\lbrack"?(ce="\u23A1",Be="\u23A2",Je="\u23A3",ft="Size4-Regular"):m==="]"||m==="\\rbrack"?(ce="\u23A4",Be="\u23A5",Je="\u23A6",ft="Size4-Regular"):m==="\\lfloor"||m==="\u230A"?(Be=ce="\u23A2",Je="\u23A3",ft="Size4-Regular"):m==="\\lceil"||m==="\u2308"?(ce="\u23A1",Be=Je="\u23A2",ft="Size4-Regular"):m==="\\rfloor"||m==="\u230B"?(Be=ce="\u23A5",Je="\u23A6",ft="Size4-Regular"):m==="\\rceil"||m==="\u2309"?(ce="\u23A4",Be=Je="\u23A5",ft="Size4-Regular"):m==="("||m==="\\lparen"?(ce="\u239B",Be="\u239C",Je="\u239D",ft="Size4-Regular"):m===")"||m==="\\rparen"?(ce="\u239E",Be="\u239F",Je="\u23A0",ft="Size4-Regular"):m==="\\{"||m==="\\lbrace"?(ce="\u23A7",_e="\u23A8",Je="\u23A9",Be="\u23AA",ft="Size4-Regular"):m==="\\}"||m==="\\rbrace"?(ce="\u23AB",_e="\u23AC",Je="\u23AD",Be="\u23AA",ft="Size4-Regular"):m==="\\lgroup"||m==="\u27EE"?(ce="\u23A7",Je="\u23A9",Be="\u23AA",ft="Size4-Regular"):m==="\\rgroup"||m==="\u27EF"?(ce="\u23AB",Je="\u23AD",Be="\u23AA",ft="Size4-Regular"):m==="\\lmoustache"||m==="\u23B0"?(ce="\u23A7",Je="\u23AD",Be="\u23AA",ft="Size4-Regular"):(m==="\\rmoustache"||m==="\u23B1")&&(ce="\u23AB",Je="\u23A9",Be="\u23AA",ft="Size4-Regular");var It=rn(ce,ft,P),Qt=It.height+It.depth,lr=rn(Be,ft,P),Dr=lr.height+lr.depth,Jr=rn(Je,ft,P),ai=Jr.height+Jr.depth,ki=0,Ni=1;if(_e!==null){var An=rn(_e,ft,P);ki=An.height+An.depth,Ni=2}var mn=Qt+ai+ki,kn=Math.max(0,Math.ceil((b-mn)/(Ni*Dr))),Tn=mn+kn*Ni*Dr,In=S.fontMetrics().axisHeight;_&&(In*=S.sizeMultiplier);var As=Tn/2-In,Fn=(kn+1)*.005-Dr,nt=[];if(nt.push(pn(Je,ft,P)),_e===null)for(var Qs=0;Qs<kn;Qs++)nt.push(En),nt.push(pn(Be,ft,P));else{for(var wa=0;wa<kn;wa++)nt.push(En),nt.push(pn(Be,ft,P));nt.push({type:"kern",size:Fn}),nt.push(pn(Be,ft,P)),nt.push(En),nt.push(pn(_e,ft,P));for(var pa=0;pa<kn;pa++)nt.push(En),nt.push(pn(Be,ft,P))}nt.push({type:"kern",size:Fn}),nt.push(pn(Be,ft,P)),nt.push(En),nt.push(pn(ce,ft,P));var Xn=S.havingBaseStyle(D.TEXT),Mr=st.makeVList({positionType:"bottom",positionData:As,children:nt},Xn);return cs(st.makeSpan(["delimsizing","mult"],[Mr],Xn),D.TEXT,S,W)},Yn=80,Zs=.08,ns=function(m,b,_,S,P){var W=mr(m,S,_),ce=new ut(m,W),_e=new it([ce],{width:"400em",height:b+"em",viewBox:"0 0 400000 "+_,preserveAspectRatio:"xMinYMin slice"});return st.makeSvgSpan(["hide-tail"],[_e],P)},ja=function(m,b){var _=b.havingBaseSizing(),S=po("\\surd",m*_.sizeMultiplier,fo,_),P=_.sizeMultiplier,W=Math.max(0,b.minRuleThickness-b.fontMetrics().sqrtRuleThickness),ce,_e=0,Be=0,Je=0,ft;return S.type==="small"?(Je=1e3+1e3*W+Yn,m<1?P=1:m<1.4&&(P=.7),_e=(1+W+Zs)/P,Be=(1+W)/P,ce=ns("sqrtMain",_e,Je,W,b),ce.style.minWidth="0.853em",ft=.833/P):S.type==="large"?(Je=(1e3+Yn)*ho[S.size],Be=(ho[S.size]+W)/P,_e=(ho[S.size]+W+Zs)/P,ce=ns("sqrtSize"+S.size,_e,Je,W,b),ce.style.minWidth="1.02em",ft=1/P):(_e=m+W+Zs,Be=m+W,Je=Math.floor(1e3*m+W)+Yn,ce=ns("sqrtTall",_e,Je,W,b),ce.style.minWidth="0.742em",ft=1.056),ce.height=Be,ce.style.height=_e+"em",{span:ce,advanceWidth:ft,ruleWidth:(b.fontMetrics().sqrtRuleThickness+W)*P}},Na=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],Os=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],Da=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ho=[0,1.2,1.8,2.4,3],Ys=function(m,b,_,S,P){if(m==="<"||m==="\\lt"||m==="\u27E8"?m="\\langle":(m===">"||m==="\\gt"||m==="\u27E9")&&(m="\\rangle"),J.contains(Na,m)||J.contains(Da,m))return fn(m,b,!1,_,S,P);if(J.contains(Os,m))return Vi(m,ho[b],!1,_,S,P);throw new E("Illegal delimiter: '"+m+"'")},al=[{type:"small",style:D.SCRIPTSCRIPT},{type:"small",style:D.SCRIPT},{type:"small",style:D.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Kl=[{type:"small",style:D.SCRIPTSCRIPT},{type:"small",style:D.SCRIPT},{type:"small",style:D.TEXT},{type:"stack"}],fo=[{type:"small",style:D.SCRIPTSCRIPT},{type:"small",style:D.SCRIPT},{type:"small",style:D.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],qa=function(m){if(m.type==="small")return"Main-Regular";if(m.type==="large")return"Size"+m.size+"-Regular";if(m.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+m.type+"' here.")},po=function(m,b,_,S){for(var P=Math.min(2,3-S.style.size),W=P;W<_.length&&_[W].type!=="stack";W++){var ce=rn(m,qa(_[W]),"math"),_e=ce.height+ce.depth;if(_[W].type==="small"){var Be=S.havingBaseStyle(_[W].style);_e*=Be.sizeMultiplier}if(_e>b)return _[W]}return _[_.length-1]},na=function(m,b,_,S,P,W){m==="<"||m==="\\lt"||m==="\u27E8"?m="\\langle":(m===">"||m==="\\gt"||m==="\u27E9")&&(m="\\rangle");var ce;J.contains(Da,m)?ce=al:J.contains(Na,m)?ce=fo:ce=Kl;var _e=po(m,b,ce,S);return _e.type==="small"?bi(m,_e.style,_,S,P,W):_e.type==="large"?fn(m,_e.size,_,S,P,W):Vi(m,b,_,S,P,W)},Io=function(m,b,_,S,P,W){var ce=S.fontMetrics().axisHeight*S.sizeMultiplier,_e=901,Be=5/S.fontMetrics().ptPerEm,Je=Math.max(b-ce,_+ce),ft=Math.max(Je/500*_e,2*Je-Be);return na(m,ft,!0,S,P,W)},Xs={sqrtImage:ja,sizedDelim:Ys,customSizedDelim:na,leftRightDelim:Io},mo={"\\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}},ol=["(","\\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 Bs(j,m){var b=zi(j);if(b&&J.contains(ol,b.text))return b;throw new E("Invalid delimiter: '"+(b?b.text:JSON.stringify(j))+"' after '"+m.funcName+"'",j)}Rr({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1},handler:function(m,b){var _=Bs(b[0],m);return{type:"delimsizing",mode:m.parser.mode,size:mo[m.funcName].size,mclass:mo[m.funcName].mclass,delim:_.text}},htmlBuilder:function(m,b){return m.delim==="."?st.makeSpan([m.mclass]):Xs.sizedDelim(m.delim,m.size,b,m.mode,[m.mclass])},mathmlBuilder:function(m){var b=[];m.delim!=="."&&b.push(hn(m.delim,m.mode));var _=new tr.MathNode("mo",b);return m.mclass==="mopen"||m.mclass==="mclose"?_.setAttribute("fence","true"):_.setAttribute("fence","false"),_}});function Ma(j){if(!j.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Rr({type:"leftright-right",names:["\\right"],props:{numArgs:1},handler:function(m,b){var _=m.parser.gullet.macros.get("\\current@color");if(_&&typeof _!="string")throw new E("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:m.parser.mode,delim:Bs(b[0],m).text,color:_}}}),Rr({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(m,b){var _=Bs(b[0],m),S=m.parser;++S.leftrightDepth;var P=S.parseExpression(!1);--S.leftrightDepth,S.expect("\\right",!1);var W=Ir(S.parseFunction(),"leftright-right");return{type:"leftright",mode:S.mode,body:P,left:_.text,right:W.delim,rightColor:W.color}},htmlBuilder:function(m,b){Ma(m);for(var _=Fi(m.body,b,!0,["mopen","mclose"]),S=0,P=0,W=!1,ce=0;ce<_.length;ce++)_[ce].isMiddle?W=!0:(S=Math.max(_[ce].height,S),P=Math.max(_[ce].depth,P));S*=b.sizeMultiplier,P*=b.sizeMultiplier;var _e;if(m.left==="."?_e=wn(b,["mopen"]):_e=Xs.leftRightDelim(m.left,S,P,b,m.mode,["mopen"]),_.unshift(_e),W)for(var Be=1;Be<_.length;Be++){var Je=_[Be],ft=Je.isMiddle;ft&&(_[Be]=Xs.leftRightDelim(ft.delim,S,P,ft.options,m.mode,[]))}var It;if(m.right===".")It=wn(b,["mclose"]);else{var Qt=m.rightColor?b.withColor(m.rightColor):b;It=Xs.leftRightDelim(m.right,S,P,Qt,m.mode,["mclose"])}return _.push(It),st.makeSpan(["minner"],_,b)},mathmlBuilder:function(m,b){Ma(m);var _=Mn(m.body,b);if(m.left!=="."){var S=new tr.MathNode("mo",[hn(m.left,m.mode)]);S.setAttribute("fence","true"),_.unshift(S)}if(m.right!=="."){var P=new tr.MathNode("mo",[hn(m.right,m.mode)]);P.setAttribute("fence","true"),m.rightColor&&P.setAttribute("mathcolor",m.rightColor),_.push(P)}return Ps(_)}}),Rr({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(m,b){var _=Bs(b[0],m);if(!m.parser.leftrightDepth)throw new E("\\middle without preceding \\left",_);return{type:"middle",mode:m.parser.mode,delim:_.text}},htmlBuilder:function(m,b){var _;if(m.delim===".")_=wn(b,[]);else{_=Xs.sizedDelim(m.delim,1,b,m.mode,[]);var S={delim:m.delim,options:b};_.isMiddle=S}return _},mathmlBuilder:function(m,b){var _=m.delim==="\\vert"||m.delim==="|"?hn("|","text"):hn(m.delim,m.mode),S=new tr.MathNode("mo",[_]);return S.setAttribute("fence","true"),S.setAttribute("lspace","0.05em"),S.setAttribute("rspace","0.05em"),S}});var Za=function(m,b){var _=st.wrapFragment(Ei(m.body,b),b),S=m.label.substr(1),P=b.sizeMultiplier,W,ce=0,_e=J.isCharacterBox(m.body);if(S==="sout")W=st.makeSpan(["stretchy","sout"]),W.height=b.fontMetrics().defaultRuleThickness/P,ce=-.5*b.fontMetrics().xHeight;else{/cancel/.test(S)?_e||_.classes.push("cancel-pad"):_.classes.push("boxpad");var Be=0,Je=0;/box/.test(S)?(Je=Math.max(b.fontMetrics().fboxrule,b.minRuleThickness),Be=b.fontMetrics().fboxsep+(S==="colorbox"?0:Je)):Be=_e?.2:0,W=_s.encloseSpan(_,S,Be,b),/fbox|boxed|fcolorbox/.test(S)&&(W.style.borderStyle="solid",W.style.borderWidth=Je+"em"),ce=_.depth+Be,m.backgroundColor&&(W.style.backgroundColor=m.backgroundColor,m.borderColor&&(W.style.borderColor=m.borderColor))}var ft;return m.backgroundColor?ft=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:W,shift:ce},{type:"elem",elem:_,shift:0}]},b):ft=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:_,shift:0},{type:"elem",elem:W,shift:ce,wrapperClasses:/cancel/.test(S)?["svg-align"]:[]}]},b),/cancel/.test(S)&&(ft.height=_.height,ft.depth=_.depth),/cancel/.test(S)&&!_e?st.makeSpan(["mord","cancel-lap"],[ft],b):st.makeSpan(["mord"],[ft],b)},ha=function(m,b){var _=0,S=new tr.MathNode(m.label.indexOf("colorbox")>-1?"mpadded":"menclose",[oi(m.body,b)]);switch(m.label){case"\\cancel":S.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":S.setAttribute("notation","downdiagonalstrike");break;case"\\sout":S.setAttribute("notation","horizontalstrike");break;case"\\fbox":S.setAttribute("notation","box");break;case"\\fcolorbox":case"\\colorbox":if(_=b.fontMetrics().fboxsep*b.fontMetrics().ptPerEm,S.setAttribute("width","+"+2*_+"pt"),S.setAttribute("height","+"+2*_+"pt"),S.setAttribute("lspace",_+"pt"),S.setAttribute("voffset",_+"pt"),m.label==="\\fcolorbox"){var P=Math.max(b.fontMetrics().fboxrule,b.minRuleThickness);S.setAttribute("style","border: "+P+"em solid "+String(m.borderColor))}break;case"\\xcancel":S.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return m.backgroundColor&&S.setAttribute("mathbackground",m.backgroundColor),S};Rr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(m,b,_){var S=m.parser,P=m.funcName,W=Ir(b[0],"color-token").color,ce=b[1];return{type:"enclose",mode:S.mode,label:P,backgroundColor:W,body:ce}},htmlBuilder:Za,mathmlBuilder:ha}),Rr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(m,b,_){var S=m.parser,P=m.funcName,W=Ir(b[0],"color-token").color,ce=Ir(b[1],"color-token").color,_e=b[2];return{type:"enclose",mode:S.mode,label:P,backgroundColor:ce,borderColor:W,body:_e}},htmlBuilder:Za,mathmlBuilder:ha}),Rr({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(m,b){var _=m.parser;return{type:"enclose",mode:_.mode,label:"\\fbox",body:b[0]}}}),Rr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(m,b,_){var S=m.parser,P=m.funcName,W=b[0];return{type:"enclose",mode:S.mode,label:P,body:W}},htmlBuilder:Za,mathmlBuilder:ha});var go={};function da(j){for(var m=j.type,b=j.names,_=j.props,S=j.handler,P=j.htmlBuilder,W=j.mathmlBuilder,ce={type:m,numArgs:_.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:S},_e=0;_e<b.length;++_e)go[b[_e]]=ce;P&&(Wn[m]=P),W&&(un[m]=W)}function ll(j){var m=[];j.consumeSpaces();for(var b=j.fetch().text;b==="\\hline"||b==="\\hdashline";)j.consume(),m.push(b==="\\hdashline"),j.consumeSpaces(),b=j.fetch().text;return m}function Fs(j,m,b){var _=m.hskipBeforeAndAfter,S=m.addJot,P=m.cols,W=m.arraystretch,ce=m.colSeparationType;if(j.gullet.beginGroup(),j.gullet.macros.set("\\\\","\\cr"),!W){var _e=j.gullet.expandMacroAsText("\\arraystretch");if(_e==null)W=1;else if(W=parseFloat(_e),!W||W<0)throw new E("Invalid \\arraystretch: "+_e)}j.gullet.beginGroup();var Be=[],Je=[Be],ft=[],It=[];for(It.push(ll(j));;){var Qt=j.parseExpression(!1,"\\cr");j.gullet.endGroup(),j.gullet.beginGroup(),Qt={type:"ordgroup",mode:j.mode,body:Qt},b&&(Qt={type:"styling",mode:j.mode,style:b,body:[Qt]}),Be.push(Qt);var lr=j.fetch().text;if(lr==="&")j.consume();else if(lr==="\\end"){Be.length===1&&Qt.type==="styling"&&Qt.body[0].body.length===0&&Je.pop(),It.length<Je.length+1&&It.push([]);break}else if(lr==="\\cr"){var Dr=Ir(j.parseFunction(),"cr");ft.push(Dr.size),It.push(ll(j)),Be=[],Je.push(Be)}else throw new E("Expected & or \\\\ or \\cr or \\end",j.nextToken)}return j.gullet.endGroup(),j.gullet.endGroup(),{type:"array",mode:j.mode,addJot:S,arraystretch:W,body:Je,cols:P,rowGaps:ft,hskipBeforeAndAfter:_,hLinesBeforeRow:It,colSeparationType:ce}}function $a(j){return j.substr(0,1)==="d"?"display":"text"}var Js=function(m,b){var _,S,P=m.body.length,W=m.hLinesBeforeRow,ce=0,_e=new Array(P),Be=[],Je=Math.max(b.fontMetrics().arrayRuleWidth,b.minRuleThickness),ft=1/b.fontMetrics().ptPerEm,It=5*ft;if(m.colSeparationType&&m.colSeparationType==="small"){var Qt=b.havingStyle(D.SCRIPT).sizeMultiplier;It=.2778*(Qt/b.sizeMultiplier)}var lr=12*ft,Dr=3*ft,Jr=m.arraystretch*lr,ai=.7*Jr,ki=.3*Jr,Ni=0;function An(wo){for(var yl=0;yl<wo.length;++yl)yl>0&&(Ni+=.25),Be.push({pos:Ni,isDashed:wo[yl]})}for(An(W[0]),_=0;_<m.body.length;++_){var mn=m.body[_],kn=ai,Tn=ki;ce<mn.length&&(ce=mn.length);var In=new Array(mn.length);for(S=0;S<mn.length;++S){var As=Ei(mn[S],b);Tn<As.depth&&(Tn=As.depth),kn<As.height&&(kn=As.height),In[S]=As}var Fn=m.rowGaps[_],nt=0;Fn&&(nt=je(Fn,b),nt>0&&(nt+=ki,Tn<nt&&(Tn=nt),nt=0)),m.addJot&&(Tn+=Dr),In.height=kn,In.depth=Tn,Ni+=kn,In.pos=Ni,Ni+=Tn+nt,_e[_]=In,An(W[_+1])}var Qs=Ni/2+b.fontMetrics().axisHeight,wa=m.cols||[],pa=[],Xn,Mr;for(S=0,Mr=0;S<ce||Mr<wa.length;++S,++Mr){for(var ps=wa[Mr]||{},Bu=!0;ps.type==="separator";){if(Bu||(Xn=st.makeSpan(["arraycolsep"],[]),Xn.style.width=b.fontMetrics().doubleRuleSep+"em",pa.push(Xn)),ps.separator==="|"||ps.separator===":"){var A0=ps.separator==="|"?"solid":"dashed",ms=st.makeSpan(["vertical-separator"],[],b);ms.style.height=Ni+"em",ms.style.borderRightWidth=Je+"em",ms.style.borderRightStyle=A0,ms.style.margin="0 -"+Je/2+"em",ms.style.verticalAlign=-(Ni-Qs)+"em",pa.push(ms)}else throw new E("Invalid separator type: "+ps.separator);Mr++,ps=wa[Mr]||{},Bu=!1}if(!(S>=ce)){var Ra=void 0;(S>0||m.hskipBeforeAndAfter)&&(Ra=J.deflt(ps.pregap,It),Ra!==0&&(Xn=st.makeSpan(["arraycolsep"],[]),Xn.style.width=Ra+"em",pa.push(Xn)));var ma=[];for(_=0;_<P;++_){var Ko=_e[_],vl=Ko[S];if(vl){var Ua=Ko.pos-Qs;vl.depth=Ko.depth,vl.height=Ko.height,ma.push({type:"elem",elem:vl,shift:Ua})}}ma=st.makeVList({positionType:"individualShift",children:ma},b),ma=st.makeSpan(["col-align-"+(ps.align||"c")],[ma]),pa.push(ma),(S<ce-1||m.hskipBeforeAndAfter)&&(Ra=J.deflt(ps.postgap,It),Ra!==0&&(Xn=st.makeSpan(["arraycolsep"],[]),Xn.style.width=Ra+"em",pa.push(Xn)))}}if(_e=st.makeSpan(["mtable"],pa),Be.length>0){for(var Jn=st.makeLineSpan("hline",b,Je),mc=st.makeLineSpan("hdashline",b,Je),Sa=[{type:"elem",elem:_e,shift:0}];Be.length>0;){var Ql=Be.pop(),eu=Ql.pos-Qs;Ql.isDashed?Sa.push({type:"elem",elem:mc,shift:eu}):Sa.push({type:"elem",elem:Jn,shift:eu})}_e=st.makeVList({positionType:"individualShift",children:Sa},b)}return st.makeSpan(["mord"],[_e],b)},Ro={c:"center ",l:"left ",r:"right "},en=function(m,b){var _=new tr.MathNode("mtable",m.body.map(function(Ni){return new tr.MathNode("mtr",Ni.map(function(An){return new tr.MathNode("mtd",[oi(An,b)])}))})),S=m.arraystretch===.5?.1:.16+m.arraystretch-1+(m.addJot?.09:0);_.setAttribute("rowspacing",S+"em");var P="",W="";if(m.cols){var ce=m.cols,_e="",Be=!1,Je=0,ft=ce.length;ce[0].type==="separator"&&(P+="top ",Je=1),ce[ce.length-1].type==="separator"&&(P+="bottom ",ft-=1);for(var It=Je;It<ft;It++)ce[It].type==="align"?(W+=Ro[ce[It].align],Be&&(_e+="none "),Be=!0):ce[It].type==="separator"&&Be&&(_e+=ce[It].separator==="|"?"solid ":"dashed ",Be=!1);_.setAttribute("columnalign",W.trim()),/[sd]/.test(_e)&&_.setAttribute("columnlines",_e.trim())}if(m.colSeparationType==="align"){for(var Qt=m.cols||[],lr="",Dr=1;Dr<Qt.length;Dr++)lr+=Dr%2?"0em ":"1em ";_.setAttribute("columnspacing",lr.trim())}else m.colSeparationType==="alignat"?_.setAttribute("columnspacing","0em"):m.colSeparationType==="small"?_.setAttribute("columnspacing","0.2778em"):_.setAttribute("columnspacing","1em");var Jr="",ai=m.hLinesBeforeRow;P+=ai[0].length>0?"left ":"",P+=ai[ai.length-1].length>0?"right ":"";for(var ki=1;ki<ai.length-1;ki++)Jr+=ai[ki].length===0?"none ":ai[ki][0]?"dashed ":"solid ";return/[sd]/.test(Jr)&&_.setAttribute("rowlines",Jr.trim()),P!==""&&(_=new tr.MathNode("menclose",[_]),_.setAttribute("notation",P.trim())),m.arraystretch&&m.arraystretch<1&&(_=new tr.MathNode("mstyle",[_]),_.setAttribute("scriptlevel","1")),_},sn=function(m,b){var _=[],S=Fs(m.parser,{cols:_,addJot:!0},"display"),P,W=0,ce={type:"ordgroup",mode:m.mode,body:[]},_e=hi(b[0],"ordgroup");if(_e){for(var Be="",Je=0;Je<_e.body.length;Je++){var ft=Ir(_e.body[Je],"textord");Be+=ft.text}P=Number(Be),W=P*2}var It=!W;S.body.forEach(function(Jr){for(var ai=1;ai<Jr.length;ai+=2){var ki=Ir(Jr[ai],"styling"),Ni=Ir(ki.body[0],"ordgroup");Ni.body.unshift(ce)}if(It)W<Jr.length&&(W=Jr.length);else{var An=Jr.length/2;if(P<An)throw new E("Too many math in a row: "+("expected "+P+", but got "+An),Jr[0])}});for(var Qt=0;Qt<W;++Qt){var lr="r",Dr=0;Qt%2===1?lr="l":Qt>0&&It&&(Dr=1),_[Qt]={type:"align",align:lr,pregap:Dr,postgap:0}}return S.colSeparationType=It?"align":"alignat",S};da({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(m,b){var _=zi(b[0]),S=_?[b[0]]:Ir(b[0],"ordgroup").body,P=S.map(function(ce){var _e=tn(ce),Be=_e.text;if("lcr".indexOf(Be)!==-1)return{type:"align",align:Be};if(Be==="|")return{type:"separator",separator:"|"};if(Be===":")return{type:"separator",separator:":"};throw new E("Unknown column alignment: "+Be,ce)}),W={cols:P,hskipBeforeAndAfter:!0};return Fs(m.parser,W,$a(m.envName))},htmlBuilder:Js,mathmlBuilder:en}),da({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"],props:{numArgs:0},handler:function(m){var b={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[m.envName],_={hskipBeforeAndAfter:!1},S=Fs(m.parser,_,$a(m.envName));return b?{type:"leftright",mode:m.mode,body:[S],left:b[0],right:b[1],rightColor:void 0}:S},htmlBuilder:Js,mathmlBuilder:en}),da({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(m){var b={arraystretch:.5},_=Fs(m.parser,b,"script");return _.colSeparationType="small",_},htmlBuilder:Js,mathmlBuilder:en}),da({type:"array",names:["subarray"],props:{numArgs:1},handler:function(m,b){var _=zi(b[0]),S=_?[b[0]]:Ir(b[0],"ordgroup").body,P=S.map(function(ce){var _e=tn(ce),Be=_e.text;if("lc".indexOf(Be)!==-1)return{type:"align",align:Be};throw new E("Unknown column alignment: "+Be,ce)});if(P.length>1)throw new E("{subarray} can contain only one column");var W={cols:P,hskipBeforeAndAfter:!1,arraystretch:.5};if(W=Fs(m.parser,W,"script"),W.body[0].length>1)throw new E("{subarray} can contain only one column");return W},htmlBuilder:Js,mathmlBuilder:en}),da({type:"array",names:["cases","dcases"],props:{numArgs:0},handler:function(m){var b={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},_=Fs(m.parser,b,$a(m.envName));return{type:"leftright",mode:m.mode,body:[_],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:Js,mathmlBuilder:en}),da({type:"array",names:["aligned"],props:{numArgs:0},handler:sn,htmlBuilder:Js,mathmlBuilder:en}),da({type:"array",names:["gathered"],props:{numArgs:0},handler:function(m){var b={cols:[{type:"align",align:"c"}],addJot:!0};return Fs(m.parser,b,"display")},htmlBuilder:Js,mathmlBuilder:en}),da({type:"array",names:["alignedat"],props:{numArgs:1},handler:sn,htmlBuilder:Js,mathmlBuilder:en}),Rr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(m,b){throw new E(m.funcName+" valid only within array environment")}});var bn=go,Ss=bn;Rr({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[0];if(P.type!=="ordgroup")throw new E("Invalid environment name",P);for(var W="",ce=0;ce<P.body.length;++ce)W+=Ir(P.body[ce],"textord").text;if(S==="\\begin"){if(!Ss.hasOwnProperty(W))throw new E("No such environment: "+W,P);var _e=Ss[W],Be=_.parseArguments("\\begin{"+W+"}",_e),Je=Be.args,ft=Be.optArgs,It={mode:_.mode,envName:W,parser:_},Qt=_e.handler(It,Je,ft);_.expect("\\end",!1);var lr=_.nextToken,Dr=Ir(_.parseFunction(),"environment");if(Dr.name!==W)throw new E("Mismatch: \\begin{"+W+"} matched by \\end{"+Dr.name+"}",lr);return Qt}return{type:"environment",mode:_.mode,name:W,nameGroup:P}}});var Ds=st.makeSpan;function Ya(j,m){var b=Fi(j.body,m,!0);return Ds([j.mclass],b,m)}function La(j,m){var b,_=Mn(j.body,m);return j.mclass==="minner"?tr.newDocumentFragment(_):(j.mclass==="mord"?j.isCharacterBox?(b=_[0],b.type="mi"):b=new tr.MathNode("mi",_):(j.isCharacterBox?(b=_[0],b.type="mo"):b=new tr.MathNode("mo",_),j.mclass==="mbin"?(b.attributes.lspace="0.22em",b.attributes.rspace="0.22em"):j.mclass==="mpunct"?(b.attributes.lspace="0em",b.attributes.rspace="0.17em"):(j.mclass==="mopen"||j.mclass==="mclose")&&(b.attributes.lspace="0em",b.attributes.rspace="0em")),b)}Rr({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[0];return{type:"mclass",mode:_.mode,mclass:"m"+S.substr(5),body:Gi(P),isCharacterBox:J.isCharacterBox(P)}},htmlBuilder:Ya,mathmlBuilder:La});var sa=function(m){var b=m.type==="ordgroup"&&m.body.length?m.body[0]:m;return b.type==="atom"&&(b.family==="bin"||b.family==="rel")?"m"+b.family:"mord"};Rr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(m,b){var _=m.parser;return{type:"mclass",mode:_.mode,mclass:sa(b[0]),body:[b[1]],isCharacterBox:J.isCharacterBox(b[1])}}}),Rr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[1],W=b[0],ce;S!=="\\stackrel"?ce=sa(P):ce="mrel";var _e={type:"op",mode:P.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:S!=="\\stackrel",body:Gi(P)},Be={type:"supsub",mode:W.mode,base:_e,sup:S==="\\underset"?null:W,sub:S==="\\underset"?W:null};return{type:"mclass",mode:_.mode,mclass:ce,body:[Be],isCharacterBox:J.isCharacterBox(Be)}},htmlBuilder:Ya,mathmlBuilder:La});var Po=function(m,b){var _=m.font,S=b.withFont(_);return Ei(m.body,S)},vo=function(m,b){var _=m.font,S=b.withFont(_);return oi(m.body,S)},Ia={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Rr({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,greediness:2},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[0],W=S;return W in Ia&&(W=Ia[W]),{type:"font",mode:_.mode,font:W.slice(1),body:P}},htmlBuilder:Po,mathmlBuilder:vo}),Rr({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(m,b){var _=m.parser,S=b[0],P=J.isCharacterBox(S);return{type:"mclass",mode:_.mode,mclass:sa(S),body:[{type:"font",mode:_.mode,font:"boldsymbol",body:S}],isCharacterBox:P}}}),Rr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(m,b){var _=m.parser,S=m.funcName,P=m.breakOnTokenText,W=_.mode,ce=_.parseExpression(!0,P),_e="math"+S.slice(1);return{type:"font",mode:W,font:_e,body:{type:"ordgroup",mode:_.mode,body:ce}}},htmlBuilder:Po,mathmlBuilder:vo});var yo=function(m,b){var _=b;return m==="display"?_=_.id>=D.SCRIPT.id?_.text():D.DISPLAY:m==="text"&&_.size===D.DISPLAY.size?_=D.TEXT:m==="script"?_=D.SCRIPT:m==="scriptscript"&&(_=D.SCRIPTSCRIPT),_},bo=function(m,b){var _=yo(m.size,b.style),S=_.fracNum(),P=_.fracDen(),W;W=b.havingStyle(S);var ce=Ei(m.numer,W,b);if(m.continued){var _e=8.5/b.fontMetrics().ptPerEm,Be=3.5/b.fontMetrics().ptPerEm;ce.height=ce.height<_e?_e:ce.height,ce.depth=ce.depth<Be?Be:ce.depth}W=b.havingStyle(P);var Je=Ei(m.denom,W,b),ft,It,Qt;m.hasBarLine?(m.barSize?(It=je(m.barSize,b),ft=st.makeLineSpan("frac-line",b,It)):ft=st.makeLineSpan("frac-line",b),It=ft.height,Qt=ft.height):(ft=null,It=0,Qt=b.fontMetrics().defaultRuleThickness);var lr,Dr,Jr;_.size===D.DISPLAY.size||m.size==="display"?(lr=b.fontMetrics().num1,It>0?Dr=3*Qt:Dr=7*Qt,Jr=b.fontMetrics().denom1):(It>0?(lr=b.fontMetrics().num2,Dr=Qt):(lr=b.fontMetrics().num3,Dr=3*Qt),Jr=b.fontMetrics().denom2);var ai;if(ft){var Ni=b.fontMetrics().axisHeight;lr-ce.depth-(Ni+.5*It)<Dr&&(lr+=Dr-(lr-ce.depth-(Ni+.5*It))),Ni-.5*It-(Je.height-Jr)<Dr&&(Jr+=Dr-(Ni-.5*It-(Je.height-Jr)));var An=-(Ni-.5*It);ai=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Je,shift:Jr},{type:"elem",elem:ft,shift:An},{type:"elem",elem:ce,shift:-lr}]},b)}else{var ki=lr-ce.depth-(Je.height-Jr);ki<Dr&&(lr+=.5*(Dr-ki),Jr+=.5*(Dr-ki)),ai=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Je,shift:Jr},{type:"elem",elem:ce,shift:-lr}]},b)}W=b.havingStyle(_),ai.height*=W.sizeMultiplier/b.sizeMultiplier,ai.depth*=W.sizeMultiplier/b.sizeMultiplier;var mn;_.size===D.DISPLAY.size?mn=b.fontMetrics().delim1:mn=b.fontMetrics().delim2;var kn,Tn;return m.leftDelim==null?kn=wn(b,["mopen"]):kn=Xs.customSizedDelim(m.leftDelim,mn,!0,b.havingStyle(_),m.mode,["mopen"]),m.continued?Tn=st.makeSpan([]):m.rightDelim==null?Tn=wn(b,["mclose"]):Tn=Xs.customSizedDelim(m.rightDelim,mn,!0,b.havingStyle(_),m.mode,["mclose"]),st.makeSpan(["mord"].concat(W.sizingClasses(b)),[kn,st.makeSpan(["mfrac"],[ai]),Tn],b)},_o=function(m,b){var _=new tr.MathNode("mfrac",[oi(m.numer,b),oi(m.denom,b)]);if(!m.hasBarLine)_.setAttribute("linethickness","0px");else if(m.barSize){var S=je(m.barSize,b);_.setAttribute("linethickness",S+"em")}var P=yo(m.size,b.style);if(P.size!==b.style.size){_=new tr.MathNode("mstyle",[_]);var W=P.size===D.DISPLAY.size?"true":"false";_.setAttribute("displaystyle",W),_.setAttribute("scriptlevel","0")}if(m.leftDelim!=null||m.rightDelim!=null){var ce=[];if(m.leftDelim!=null){var _e=new tr.MathNode("mo",[new tr.TextNode(m.leftDelim.replace("\\",""))]);_e.setAttribute("fence","true"),ce.push(_e)}if(ce.push(_),m.rightDelim!=null){var Be=new tr.MathNode("mo",[new tr.TextNode(m.rightDelim.replace("\\",""))]);Be.setAttribute("fence","true"),ce.push(Be)}return Ps(ce)}return _};Rr({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,greediness:2},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[0],W=b[1],ce,_e=null,Be=null,Je="auto";switch(S){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":ce=!0;break;case"\\\\atopfrac":ce=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":ce=!1,_e="(",Be=")";break;case"\\\\bracefrac":ce=!1,_e="\\{",Be="\\}";break;case"\\\\brackfrac":ce=!1,_e="[",Be="]";break;default:throw new Error("Unrecognized genfrac command")}switch(S){case"\\cfrac":case"\\dfrac":case"\\dbinom":Je="display";break;case"\\tfrac":case"\\tbinom":Je="text";break}return{type:"genfrac",mode:_.mode,continued:S==="\\cfrac",numer:P,denom:W,hasBarLine:ce,leftDelim:_e,rightDelim:Be,size:Je,barSize:null}},htmlBuilder:bo,mathmlBuilder:_o}),Rr({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(m){var b=m.parser,_=m.funcName,S=m.token,P;switch(_){case"\\over":P="\\frac";break;case"\\choose":P="\\binom";break;case"\\atop":P="\\\\atopfrac";break;case"\\brace":P="\\\\bracefrac";break;case"\\brack":P="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:b.mode,replaceWith:P,token:S}}});var Ms=["display","text","script","scriptscript"],xs=function(m){var b=null;return m.length>0&&(b=m,b=b==="."?null:b),b};Rr({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(m,b){var _=m.parser,S=b[4],P=b[5],W=hi(b[0],"atom");W&&(W=Oi(b[0],"open"));var ce=W?xs(W.text):null,_e=hi(b[1],"atom");_e&&(_e=Oi(b[1],"close"));var Be=_e?xs(_e.text):null,Je=Ir(b[2],"size"),ft,It=null;Je.isBlank?ft=!0:(It=Je.value,ft=It.number>0);var Qt="auto",lr=hi(b[3],"ordgroup");if(lr){if(lr.body.length>0){var Dr=Ir(lr.body[0],"textord");Qt=Ms[Number(Dr.text)]}}else lr=Ir(b[3],"textord"),Qt=Ms[Number(lr.text)];return{type:"genfrac",mode:_.mode,numer:S,denom:P,continued:!1,hasBarLine:ft,barSize:It,leftDelim:ce,rightDelim:Be,size:Qt}},htmlBuilder:bo,mathmlBuilder:_o}),Rr({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(m,b){var _=m.parser,S=m.funcName,P=m.token;return{type:"infix",mode:_.mode,replaceWith:"\\\\abovefrac",size:Ir(b[0],"size").value,token:P}}}),Rr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[0],W=he(Ir(b[1],"infix").size),ce=b[2],_e=W.number>0;return{type:"genfrac",mode:_.mode,numer:P,denom:ce,continued:!1,hasBarLine:_e,barSize:W,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:bo,mathmlBuilder:_o});var _u=function(m,b){var _=b.style,S,P,W=hi(m,"supsub");W?(S=W.sup?Ei(W.sup,b.havingStyle(_.sup()),b):Ei(W.sub,b.havingStyle(_.sub()),b),P=Ir(W.base,"horizBrace")):P=Ir(m,"horizBrace");var ce=Ei(P.base,b.havingBaseStyle(D.DISPLAY)),_e=_s.svgSpan(P,b),Be;if(P.isOver?(Be=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:ce},{type:"kern",size:.1},{type:"elem",elem:_e}]},b),Be.children[0].children[0].children[1].classes.push("svg-align")):(Be=st.makeVList({positionType:"bottom",positionData:ce.depth+.1+_e.height,children:[{type:"elem",elem:_e},{type:"kern",size:.1},{type:"elem",elem:ce}]},b),Be.children[0].children[0].children[0].classes.push("svg-align")),S){var Je=st.makeSpan(["mord",P.isOver?"mover":"munder"],[Be],b);P.isOver?Be=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:Je},{type:"kern",size:.2},{type:"elem",elem:S}]},b):Be=st.makeVList({positionType:"bottom",positionData:Je.depth+.2+S.height+S.depth,children:[{type:"elem",elem:S},{type:"kern",size:.2},{type:"elem",elem:Je}]},b)}return st.makeSpan(["mord",P.isOver?"mover":"munder"],[Be],b)},Vt=function(m,b){var _=_s.mathMLnode(m.label);return new tr.MathNode(m.isOver?"mover":"munder",[oi(m.base,b),_])};Rr({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(m,b){var _=m.parser,S=m.funcName;return{type:"horizBrace",mode:_.mode,label:S,isOver:/^\\over/.test(S),base:b[0]}},htmlBuilder:_u,mathmlBuilder:Vt}),Rr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(m,b){var _=m.parser,S=b[1],P=Ir(b[0],"url").url;return _.settings.isTrusted({command:"\\href",url:P})?{type:"href",mode:_.mode,href:P,body:Gi(S)}:_.formatUnsupportedCmd("\\href")},htmlBuilder:function(m,b){var _=Fi(m.body,b,!1);return st.makeAnchor(m.href,[],_,b)},mathmlBuilder:function(m,b){var _=us(m.body,b);return _ instanceof zn||(_=new zn("mrow",[_])),_.setAttribute("href",m.href),_}}),Rr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(m,b){var _=m.parser,S=Ir(b[0],"url").url;if(!_.settings.isTrusted({command:"\\url",url:S}))return _.formatUnsupportedCmd("\\url");for(var P=[],W=0;W<S.length;W++){var ce=S[W];ce==="~"&&(ce="\\textasciitilde"),P.push({type:"textord",mode:"text",text:ce})}var _e={type:"text",mode:_.mode,font:"\\texttt",body:P};return{type:"href",mode:_.mode,href:S,body:Gi(_e)}}}),Rr({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(m,b){var _=m.parser;return{type:"htmlmathml",mode:_.mode,html:Gi(b[0]),mathml:Gi(b[1])}},htmlBuilder:function(m,b){var _=Fi(m.html,b,!1);return st.makeFragment(_)},mathmlBuilder:function(m,b){return us(m.mathml,b)}});var Oo=function(m){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(m))return{number:+m,unit:"bp"};var b=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(m);if(!b)throw new E("Invalid size: '"+m+"' in \\includegraphics");var _={number:+(b[1]+b[2]),unit:b[3]};if(!$i(_))throw new E("Invalid unit: '"+_.unit+"' in \\includegraphics.");return _};Rr({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(m,b,_){var S=m.parser,P={number:0,unit:"em"},W={number:.9,unit:"em"},ce={number:0,unit:"em"},_e="";if(_[0])for(var Be=Ir(_[0],"raw").string,Je=Be.split(","),ft=0;ft<Je.length;ft++){var It=Je[ft].split("=");if(It.length===2){var Qt=It[1].trim();switch(It[0].trim()){case"alt":_e=Qt;break;case"width":P=Oo(Qt);break;case"height":W=Oo(Qt);break;case"totalheight":ce=Oo(Qt);break;default:throw new E("Invalid key: '"+It[0]+"' in \\includegraphics.")}}}var lr=Ir(b[0],"url").url;return _e===""&&(_e=lr,_e=_e.replace(/^.*[\\/]/,""),_e=_e.substring(0,_e.lastIndexOf("."))),S.settings.isTrusted({command:"\\includegraphics",url:lr})?{type:"includegraphics",mode:S.mode,alt:_e,width:P,height:W,totalheight:ce,src:lr}:S.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(m,b){var _=je(m.height,b),S=0;m.totalheight.number>0&&(S=je(m.totalheight,b)-_,S=Number(S.toFixed(2)));var P=0;m.width.number>0&&(P=je(m.width,b));var W={height:_+S+"em"};P>0&&(W.width=P+"em"),S>0&&(W.verticalAlign=-S+"em");var ce=new Dt(m.src,m.alt,W);return ce.height=_,ce.depth=S,ce},mathmlBuilder:function(m,b){var _=new tr.MathNode("mglyph",[]);_.setAttribute("alt",m.alt);var S=je(m.height,b),P=0;if(m.totalheight.number>0&&(P=je(m.totalheight,b)-S,P=P.toFixed(2),_.setAttribute("valign","-"+P+"em")),_.setAttribute("height",S+P+"em"),m.width.number>0){var W=je(m.width,b);_.setAttribute("width",W+"em")}return _.setAttribute("src",m.src),_}}),Rr({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(m,b){var _=m.parser,S=m.funcName,P=Ir(b[0],"size");if(_.settings.strict){var W=S[1]==="m",ce=P.value.unit==="mu";W?(ce||_.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+S+" supports only mu units, "+("not "+P.value.unit+" units")),_.mode!=="math"&&_.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+S+" works only in math mode")):ce&&_.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+S+" doesn't support mu units")}return{type:"kern",mode:_.mode,dimension:P.value}},htmlBuilder:function(m,b){return st.makeGlue(m.dimension,b)},mathmlBuilder:function(m,b){var _=je(m.dimension,b);return new tr.SpaceNode(_)}}),Rr({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[0];return{type:"lap",mode:_.mode,alignment:S.slice(5),body:P}},htmlBuilder:function(m,b){var _;m.alignment==="clap"?(_=st.makeSpan([],[Ei(m.body,b)]),_=st.makeSpan(["inner"],[_],b)):_=st.makeSpan(["inner"],[Ei(m.body,b)]);var S=st.makeSpan(["fix"],[]),P=st.makeSpan([m.alignment],[_,S],b),W=st.makeSpan(["strut"]);return W.style.height=P.height+P.depth+"em",W.style.verticalAlign=-P.depth+"em",P.children.unshift(W),P=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:P}]},b),st.makeSpan(["mord"],[P],b)},mathmlBuilder:function(m,b){var _=new tr.MathNode("mpadded",[oi(m.body,b)]);if(m.alignment!=="rlap"){var S=m.alignment==="llap"?"-1":"-0.5";_.setAttribute("lspace",S+"width")}return _.setAttribute("width","0px"),_}}),Rr({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(m,b){var _=m.funcName,S=m.parser,P=S.mode;S.switchMode("math");var W=_==="\\("?"\\)":"$",ce=S.parseExpression(!1,W);return S.expect(W),S.switchMode(P),{type:"styling",mode:S.mode,style:"text",body:ce}}}),Rr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(m,b){throw new E("Mismatched "+m.funcName)}});var Ul=function(m,b){switch(b.style.size){case D.DISPLAY.size:return m.display;case D.TEXT.size:return m.text;case D.SCRIPT.size:return m.script;case D.SCRIPTSCRIPT.size:return m.scriptscript;default:return m.text}};Rr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(m,b){var _=m.parser;return{type:"mathchoice",mode:_.mode,display:Gi(b[0]),text:Gi(b[1]),script:Gi(b[2]),scriptscript:Gi(b[3])}},htmlBuilder:function(m,b){var _=Ul(m,b),S=Fi(_,b,!1);return st.makeFragment(S)},mathmlBuilder:function(m,b){var _=Ul(m,b);return us(_,b)}});var Hl=function(m,b,_,S,P,W,ce){m=st.makeSpan([],[m]);var _e,Be;if(b){var Je=Ei(b,S.havingStyle(P.sup()),S);Be={elem:Je,kern:Math.max(S.fontMetrics().bigOpSpacing1,S.fontMetrics().bigOpSpacing3-Je.depth)}}if(_){var ft=Ei(_,S.havingStyle(P.sub()),S);_e={elem:ft,kern:Math.max(S.fontMetrics().bigOpSpacing2,S.fontMetrics().bigOpSpacing4-ft.height)}}var It;if(Be&&_e){var Qt=S.fontMetrics().bigOpSpacing5+_e.elem.height+_e.elem.depth+_e.kern+m.depth+ce;It=st.makeVList({positionType:"bottom",positionData:Qt,children:[{type:"kern",size:S.fontMetrics().bigOpSpacing5},{type:"elem",elem:_e.elem,marginLeft:-W+"em"},{type:"kern",size:_e.kern},{type:"elem",elem:m},{type:"kern",size:Be.kern},{type:"elem",elem:Be.elem,marginLeft:W+"em"},{type:"kern",size:S.fontMetrics().bigOpSpacing5}]},S)}else if(_e){var lr=m.height-ce;It=st.makeVList({positionType:"top",positionData:lr,children:[{type:"kern",size:S.fontMetrics().bigOpSpacing5},{type:"elem",elem:_e.elem,marginLeft:-W+"em"},{type:"kern",size:_e.kern},{type:"elem",elem:m}]},S)}else if(Be){var Dr=m.depth+ce;It=st.makeVList({positionType:"bottom",positionData:Dr,children:[{type:"elem",elem:m},{type:"kern",size:Be.kern},{type:"elem",elem:Be.elem,marginLeft:W+"em"},{type:"kern",size:S.fontMetrics().bigOpSpacing5}]},S)}else return m;return st.makeSpan(["mop","op-limits"],[It],S)},Es=["\\smallint"],Ns=function(m,b){var _,S,P=!1,W,ce=hi(m,"supsub");ce?(_=ce.sup,S=ce.sub,W=Ir(ce.base,"op"),P=!0):W=Ir(m,"op");var _e=b.style,Be=!1;_e.size===D.DISPLAY.size&&W.symbol&&!J.contains(Es,W.name)&&(Be=!0);var Je;if(W.symbol){var ft=Be?"Size2-Regular":"Size1-Regular",It="";if((W.name==="\\oiint"||W.name==="\\oiiint")&&(It=W.name.substr(1),W.name=It==="oiint"?"\\iint":"\\iiint"),Je=st.makeSymbol(W.name,ft,"math",b,["mop","op-symbol",Be?"large-op":"small-op"]),It.length>0){var Qt=Je.italic,lr=st.staticSvg(It+"Size"+(Be?"2":"1"),b);Je=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Je,shift:0},{type:"elem",elem:lr,shift:Be?.08:0}]},b),W.name="\\"+It,Je.classes.unshift("mop"),Je.italic=Qt}}else if(W.body){var Dr=Fi(W.body,b,!0);Dr.length===1&&Dr[0]instanceof ze?(Je=Dr[0],Je.classes[0]="mop"):Je=st.makeSpan(["mop"],st.tryCombineChars(Dr),b)}else{for(var Jr=[],ai=1;ai<W.name.length;ai++)Jr.push(st.mathsym(W.name[ai],W.mode,b));Je=st.makeSpan(["mop"],Jr,b)}var ki=0,Ni=0;return(Je instanceof ze||W.name==="\\oiint"||W.name==="\\oiiint")&&!W.suppressBaseShift&&(ki=(Je.height-Je.depth)/2-b.fontMetrics().axisHeight,Ni=Je.italic),P?Hl(Je,_,S,b,_e,Ni,ki):(ki&&(Je.style.position="relative",Je.style.top=ki+"em"),Je)},aa=function(m,b){var _;if(m.symbol)_=new zn("mo",[hn(m.name,m.mode)]),J.contains(Es,m.name)&&_.setAttribute("largeop","false");else if(m.body)_=new zn("mo",Mn(m.body,b));else{_=new zn("mi",[new di(m.name.slice(1))]);var S=new zn("mo",[hn("\u2061","text")]);m.parentIsSupSub?_=new zn("mo",[_,S]):_=os([_,S])}return _},b0={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Rr({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(m,b){var _=m.parser,S=m.funcName,P=S;return P.length===1&&(P=b0[P]),{type:"op",mode:_.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:P}},htmlBuilder:Ns,mathmlBuilder:aa}),Rr({type:"op",names:["\\mathop"],props:{numArgs:1},handler:function(m,b){var _=m.parser,S=b[0];return{type:"op",mode:_.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Gi(S)}},htmlBuilder:Ns,mathmlBuilder:aa});var xu={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Rr({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(m){var b=m.parser,_=m.funcName;return{type:"op",mode:b.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:_}},htmlBuilder:Ns,mathmlBuilder:aa}),Rr({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(m){var b=m.parser,_=m.funcName;return{type:"op",mode:b.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:_}},htmlBuilder:Ns,mathmlBuilder:aa}),Rr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler:function(m){var b=m.parser,_=m.funcName,S=_;return S.length===1&&(S=xu[S]),{type:"op",mode:b.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:S}},htmlBuilder:Ns,mathmlBuilder:aa});var ul=function(m,b){var _,S,P=!1,W,ce=hi(m,"supsub");ce?(_=ce.sup,S=ce.sub,W=Ir(ce.base,"operatorname"),P=!0):W=Ir(m,"operatorname");var _e;if(W.body.length>0){for(var Be=W.body.map(function(Qt){var lr=Qt.text;return typeof lr=="string"?{type:"textord",mode:Qt.mode,text:lr}:Qt}),Je=Fi(Be,b.withFont("mathrm"),!0),ft=0;ft<Je.length;ft++){var It=Je[ft];It instanceof ze&&(It.text=It.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}_e=st.makeSpan(["mop"],Je,b)}else _e=st.makeSpan(["mop"],[],b);return P?Hl(_e,_,S,b,b.style,0,0):_e},Bo=function(m,b){for(var _=Mn(m.body,b.withFont("mathrm")),S=!0,P=0;P<_.length;P++){var W=_[P];if(!(W instanceof tr.SpaceNode))if(W instanceof tr.MathNode)switch(W.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var ce=W.children[0];W.children.length===1&&ce instanceof tr.TextNode?ce.text=ce.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):S=!1;break}default:S=!1}else S=!1}if(S){var _e=_.map(function(ft){return ft.toText()}).join("");_=[new tr.TextNode(_e)]}var Be=new tr.MathNode("mi",_);Be.setAttribute("mathvariant","normal");var Je=new tr.MathNode("mo",[hn("\u2061","text")]);return m.parentIsSupSub?new tr.MathNode("mo",[Be,Je]):tr.newDocumentFragment([Be,Je])};Rr({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[0];return{type:"operatorname",mode:_.mode,body:Gi(P),alwaysHandleSupSub:S==="\\operatorname*",limits:!1,parentIsSupSub:!1}},htmlBuilder:ul,mathmlBuilder:Bo}),Ci({type:"ordgroup",htmlBuilder:function(m,b){return m.semisimple?st.makeFragment(Fi(m.body,b,!1)):st.makeSpan(["mord"],Fi(m.body,b,!0),b)},mathmlBuilder:function(m,b){return us(m.body,b,!0)}}),Rr({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(m,b){var _=m.parser,S=b[0];return{type:"overline",mode:_.mode,body:S}},htmlBuilder:function(m,b){var _=Ei(m.body,b.havingCrampedStyle()),S=st.makeLineSpan("overline-line",b),P=b.fontMetrics().defaultRuleThickness,W=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_},{type:"kern",size:3*P},{type:"elem",elem:S},{type:"kern",size:P}]},b);return st.makeSpan(["mord","overline"],[W],b)},mathmlBuilder:function(m,b){var _=new tr.MathNode("mo",[new tr.TextNode("\u203E")]);_.setAttribute("stretchy","true");var S=new tr.MathNode("mover",[oi(m.body,b),_]);return S.setAttribute("accent","true"),S}}),Rr({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser,S=b[0];return{type:"phantom",mode:_.mode,body:Gi(S)}},htmlBuilder:function(m,b){var _=Fi(m.body,b.withPhantom(),!1);return st.makeFragment(_)},mathmlBuilder:function(m,b){var _=Mn(m.body,b);return new tr.MathNode("mphantom",_)}}),Rr({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser,S=b[0];return{type:"hphantom",mode:_.mode,body:S}},htmlBuilder:function(m,b){var _=st.makeSpan([],[Ei(m.body,b.withPhantom())]);if(_.height=0,_.depth=0,_.children)for(var S=0;S<_.children.length;S++)_.children[S].height=0,_.children[S].depth=0;return _=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_}]},b),st.makeSpan(["mord"],[_],b)},mathmlBuilder:function(m,b){var _=Mn(Gi(m.body),b),S=new tr.MathNode("mphantom",_),P=new tr.MathNode("mpadded",[S]);return P.setAttribute("height","0px"),P.setAttribute("depth","0px"),P}}),Rr({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser,S=b[0];return{type:"vphantom",mode:_.mode,body:S}},htmlBuilder:function(m,b){var _=st.makeSpan(["inner"],[Ei(m.body,b.withPhantom())]),S=st.makeSpan(["fix"],[]);return st.makeSpan(["mord","rlap"],[_,S],b)},mathmlBuilder:function(m,b){var _=Mn(Gi(m.body),b),S=new tr.MathNode("mphantom",_),P=new tr.MathNode("mpadded",[S]);return P.setAttribute("width","0px"),P}}),Rr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(m,b){var _=m.parser,S=Ir(b[0],"size").value,P=b[1];return{type:"raisebox",mode:_.mode,dy:S,body:P}},htmlBuilder:function(m,b){var _=Ei(m.body,b),S=je(m.dy,b);return st.makeVList({positionType:"shift",positionData:-S,children:[{type:"elem",elem:_}]},b)},mathmlBuilder:function(m,b){var _=new tr.MathNode("mpadded",[oi(m.body,b)]),S=m.dy.number+m.dy.unit;return _.setAttribute("voffset",S),_}}),Rr({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(m,b,_){var S=m.parser,P=_[0],W=Ir(b[0],"size"),ce=Ir(b[1],"size");return{type:"rule",mode:S.mode,shift:P&&Ir(P,"size").value,width:W.value,height:ce.value}},htmlBuilder:function(m,b){var _=st.makeSpan(["mord","rule"],[],b),S=je(m.width,b),P=je(m.height,b),W=m.shift?je(m.shift,b):0;return _.style.borderRightWidth=S+"em",_.style.borderTopWidth=P+"em",_.style.bottom=W+"em",_.width=S,_.height=P+W,_.depth=-W,_.maxFontSize=P*1.125*b.sizeMultiplier,_},mathmlBuilder:function(m,b){var _=je(m.width,b),S=je(m.height,b),P=m.shift?je(m.shift,b):0,W=b.color&&b.getColor()||"black",ce=new tr.MathNode("mspace");ce.setAttribute("mathbackground",W),ce.setAttribute("width",_+"em"),ce.setAttribute("height",S+"em");var _e=new tr.MathNode("mpadded",[ce]);return P>=0?_e.setAttribute("height","+"+P+"em"):(_e.setAttribute("height",P+"em"),_e.setAttribute("depth","+"+-P+"em")),_e.setAttribute("voffset",P+"em"),_e}});function za(j,m,b){for(var _=Fi(j,m,!1),S=m.sizeMultiplier/b.sizeMultiplier,P=0;P<_.length;P++){var W=_[P].classes.indexOf("sizing");W<0?Array.prototype.push.apply(_[P].classes,m.sizingClasses(b)):_[P].classes[W+1]==="reset-size"+m.size&&(_[P].classes[W+1]="reset-size"+b.size),_[P].height*=S,_[P].depth*=S}return st.makeFragment(_)}var wu=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],_0=function(m,b){var _=b.havingSize(m.size);return za(m.body,_,b)};Rr({type:"sizing",names:wu,props:{numArgs:0,allowedInText:!0},handler:function(m,b){var _=m.breakOnTokenText,S=m.funcName,P=m.parser,W=P.parseExpression(!1,_);return{type:"sizing",mode:P.mode,size:wu.indexOf(S)+1,body:W}},htmlBuilder:_0,mathmlBuilder:function(m,b){var _=b.havingSize(m.size),S=Mn(m.body,_),P=new tr.MathNode("mstyle",S);return P.setAttribute("mathsize",_.sizeMultiplier+"em"),P}}),Rr({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(m,b,_){var S=m.parser,P=!1,W=!1,ce=_[0]&&Ir(_[0],"ordgroup");if(ce)for(var _e="",Be=0;Be<ce.body.length;++Be){var Je=ce.body[Be];if(_e=Je.text,_e==="t")P=!0;else if(_e==="b")W=!0;else{P=!1,W=!1;break}}else P=!0,W=!0;var ft=b[0];return{type:"smash",mode:S.mode,body:ft,smashHeight:P,smashDepth:W}},htmlBuilder:function(m,b){var _=st.makeSpan([],[Ei(m.body,b)]);if(!m.smashHeight&&!m.smashDepth)return _;if(m.smashHeight&&(_.height=0,_.children))for(var S=0;S<_.children.length;S++)_.children[S].height=0;if(m.smashDepth&&(_.depth=0,_.children))for(var P=0;P<_.children.length;P++)_.children[P].depth=0;var W=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_}]},b);return st.makeSpan(["mord"],[W],b)},mathmlBuilder:function(m,b){var _=new tr.MathNode("mpadded",[oi(m.body,b)]);return m.smashHeight&&_.setAttribute("height","0px"),m.smashDepth&&_.setAttribute("depth","0px"),_}}),Rr({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(m,b,_){var S=m.parser,P=_[0],W=b[0];return{type:"sqrt",mode:S.mode,body:W,index:P}},htmlBuilder:function(m,b){var _=Ei(m.body,b.havingCrampedStyle());_.height===0&&(_.height=b.fontMetrics().xHeight),_=st.wrapFragment(_,b);var S=b.fontMetrics(),P=S.defaultRuleThickness,W=P;b.style.id<D.TEXT.id&&(W=b.fontMetrics().xHeight);var ce=P+W/4,_e=_.height+_.depth+ce+P,Be=Xs.sqrtImage(_e,b),Je=Be.span,ft=Be.ruleWidth,It=Be.advanceWidth,Qt=Je.height-ft;Qt>_.height+_.depth+ce&&(ce=(ce+Qt-_.height-_.depth)/2);var lr=Je.height-_.height-ce-ft;_.style.paddingLeft=It+"em";var Dr=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_,wrapperClasses:["svg-align"]},{type:"kern",size:-(_.height+lr)},{type:"elem",elem:Je},{type:"kern",size:ft}]},b);if(m.index){var Jr=b.havingStyle(D.SCRIPTSCRIPT),ai=Ei(m.index,Jr,b),ki=.6*(Dr.height-Dr.depth),Ni=st.makeVList({positionType:"shift",positionData:-ki,children:[{type:"elem",elem:ai}]},b),An=st.makeSpan(["root"],[Ni]);return st.makeSpan(["mord","sqrt"],[An,Dr],b)}else return st.makeSpan(["mord","sqrt"],[Dr],b)},mathmlBuilder:function(m,b){var _=m.body,S=m.index;return S?new tr.MathNode("mroot",[oi(_,b),oi(S,b)]):new tr.MathNode("msqrt",[oi(_,b)])}});var Su={display:D.DISPLAY,text:D.TEXT,script:D.SCRIPT,scriptscript:D.SCRIPTSCRIPT};Rr({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(m,b){var _=m.breakOnTokenText,S=m.funcName,P=m.parser,W=P.parseExpression(!0,_),ce=S.slice(1,S.length-5);return{type:"styling",mode:P.mode,style:ce,body:W}},htmlBuilder:function(m,b){var _=Su[m.style],S=b.havingStyle(_).withFont("");return za(m.body,S,b)},mathmlBuilder:function(m,b){var _=Su[m.style],S=b.havingStyle(_),P=Mn(m.body,S),W=new tr.MathNode("mstyle",P),ce={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},_e=ce[m.style];return W.setAttribute("scriptlevel",_e[0]),W.setAttribute("displaystyle",_e[1]),W}});var Gl=function(m,b){var _=m.base;if(_)if(_.type==="op"){var S=_.limits&&(b.style.size===D.DISPLAY.size||_.alwaysHandleSupSub);return S?Ns:null}else if(_.type==="operatorname"){var P=_.alwaysHandleSupSub&&(b.style.size===D.DISPLAY.size||_.limits);return P?ul:null}else{if(_.type==="accent")return J.isCharacterBox(_.base)?Kr:null;if(_.type==="horizBrace"){var W=!m.sub;return W===_.isOver?_u:null}else return null}else return null};Ci({type:"supsub",htmlBuilder:function(m,b){var _=Gl(m,b);if(_)return _(m,b);var S=m.base,P=m.sup,W=m.sub,ce=Ei(S,b),_e,Be,Je=b.fontMetrics(),ft=0,It=0,Qt=S&&J.isCharacterBox(S);if(P){var lr=b.havingStyle(b.style.sup());_e=Ei(P,lr,b),Qt||(ft=ce.height-lr.fontMetrics().supDrop*lr.sizeMultiplier/b.sizeMultiplier)}if(W){var Dr=b.havingStyle(b.style.sub());Be=Ei(W,Dr,b),Qt||(It=ce.depth+Dr.fontMetrics().subDrop*Dr.sizeMultiplier/b.sizeMultiplier)}var Jr;b.style===D.DISPLAY?Jr=Je.sup1:b.style.cramped?Jr=Je.sup3:Jr=Je.sup2;var ai=b.sizeMultiplier,ki=.5/Je.ptPerEm/ai+"em",Ni=null;if(Be){var An=m.base&&m.base.type==="op"&&m.base.name&&(m.base.name==="\\oiint"||m.base.name==="\\oiiint");(ce instanceof ze||An)&&(Ni=-ce.italic+"em")}var mn;if(_e&&Be){ft=Math.max(ft,Jr,_e.depth+.25*Je.xHeight),It=Math.max(It,Je.sub2);var kn=Je.defaultRuleThickness,Tn=4*kn;if(ft-_e.depth-(Be.height-It)<Tn){It=Tn-(ft-_e.depth)+Be.height;var In=.8*Je.xHeight-(ft-_e.depth);In>0&&(ft+=In,It-=In)}var As=[{type:"elem",elem:Be,shift:It,marginRight:ki,marginLeft:Ni},{type:"elem",elem:_e,shift:-ft,marginRight:ki}];mn=st.makeVList({positionType:"individualShift",children:As},b)}else if(Be){It=Math.max(It,Je.sub1,Be.height-.8*Je.xHeight);var Fn=[{type:"elem",elem:Be,marginLeft:Ni,marginRight:ki}];mn=st.makeVList({positionType:"shift",positionData:It,children:Fn},b)}else if(_e)ft=Math.max(ft,Jr,_e.depth+.25*Je.xHeight),mn=st.makeVList({positionType:"shift",positionData:-ft,children:[{type:"elem",elem:_e,marginRight:ki}]},b);else throw new Error("supsub must have either sup or sub.");var nt=ts(ce,"right")||"mord";return st.makeSpan([nt],[ce,st.makeSpan(["msupsub"],[mn])],b)},mathmlBuilder:function(m,b){var _=!1,S,P,W=hi(m.base,"horizBrace");W&&(P=!!m.sup,P===W.isOver&&(_=!0,S=W.isOver)),m.base&&(m.base.type==="op"||m.base.type==="operatorname")&&(m.base.parentIsSupSub=!0);var ce=[oi(m.base,b)];m.sub&&ce.push(oi(m.sub,b)),m.sup&&ce.push(oi(m.sup,b));var _e;if(_)_e=S?"mover":"munder";else if(m.sub)if(m.sup){var ft=m.base;ft&&ft.type==="op"&&ft.limits&&b.style===D.DISPLAY||ft&&ft.type==="operatorname"&&ft.alwaysHandleSupSub&&(b.style===D.DISPLAY||ft.limits)?_e="munderover":_e="msubsup"}else{var Je=m.base;Je&&Je.type==="op"&&Je.limits&&(b.style===D.DISPLAY||Je.alwaysHandleSupSub)||Je&&Je.type==="operatorname"&&Je.alwaysHandleSupSub&&(Je.limits||b.style===D.DISPLAY)?_e="munder":_e="msub"}else{var Be=m.base;Be&&Be.type==="op"&&Be.limits&&(b.style===D.DISPLAY||Be.alwaysHandleSupSub)||Be&&Be.type==="operatorname"&&Be.alwaysHandleSupSub&&(Be.limits||b.style===D.DISPLAY)?_e="mover":_e="msup"}var It=new tr.MathNode(_e,ce);return It}}),Ci({type:"atom",htmlBuilder:function(m,b){return st.mathsym(m.text,m.mode,b,["m"+m.family])},mathmlBuilder:function(m,b){var _=new tr.MathNode("mo",[hn(m.text,m.mode)]);if(m.family==="bin"){var S=ls(m,b);S==="bold-italic"&&_.setAttribute("mathvariant",S)}else m.family==="punct"?_.setAttribute("separator","true"):(m.family==="open"||m.family==="close")&&_.setAttribute("stretchy","false");return _}});var Vl={mi:"italic",mn:"normal",mtext:"normal"};Ci({type:"mathord",htmlBuilder:function(m,b){return st.makeOrd(m,b,"mathord")},mathmlBuilder:function(m,b){var _=new tr.MathNode("mi",[hn(m.text,m.mode,b)]),S=ls(m,b)||"italic";return S!==Vl[_.type]&&_.setAttribute("mathvariant",S),_}}),Ci({type:"textord",htmlBuilder:function(m,b){return st.makeOrd(m,b,"textord")},mathmlBuilder:function(m,b){var _=hn(m.text,m.mode,b),S=ls(m,b)||"normal",P;return m.mode==="text"?P=new tr.MathNode("mtext",[_]):/[0-9]/.test(m.text)?P=new tr.MathNode("mn",[_]):m.text==="\\prime"?P=new tr.MathNode("mo",[_]):P=new tr.MathNode("mi",[_]),S!==Vl[P.type]&&P.setAttribute("mathvariant",S),P}});var Fo={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Xa={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ci({type:"spacing",htmlBuilder:function(m,b){if(Xa.hasOwnProperty(m.text)){var _=Xa[m.text].className||"";if(m.mode==="text"){var S=st.makeOrd(m,b,"textord");return S.classes.push(_),S}else return st.makeSpan(["mspace",_],[st.mathsym(m.text,m.mode,b)],b)}else{if(Fo.hasOwnProperty(m.text))return st.makeSpan(["mspace",Fo[m.text]],[],b);throw new E('Unknown type of space "'+m.text+'"')}},mathmlBuilder:function(m,b){var _;if(Xa.hasOwnProperty(m.text))_=new tr.MathNode("mtext",[new tr.TextNode("\xA0")]);else{if(Fo.hasOwnProperty(m.text))return new tr.MathNode("mspace");throw new E('Unknown type of space "'+m.text+'"')}return _}});var Ja=function(){var m=new tr.MathNode("mtd",[]);return m.setAttribute("width","50%"),m};Ci({type:"tag",mathmlBuilder:function(m,b){var _=new tr.MathNode("mtable",[new tr.MathNode("mtr",[Ja(),new tr.MathNode("mtd",[us(m.body,b)]),Ja(),new tr.MathNode("mtd",[us(m.tag,b)])])]);return _.setAttribute("width","100%"),_}});var xa={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},cl={"\\textbf":"textbf","\\textmd":"textmd"},Wl={"\\textit":"textit","\\textup":"textup"},hl=function(m,b){var _=m.font;return _?xa[_]?b.withTextFontFamily(xa[_]):cl[_]?b.withTextFontWeight(cl[_]):b.withTextFontShape(Wl[_]):b};Rr({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],greediness:2,allowedInText:!0},handler:function(m,b){var _=m.parser,S=m.funcName,P=b[0];return{type:"text",mode:_.mode,body:Gi(P),font:S}},htmlBuilder:function(m,b){var _=hl(m,b),S=Fi(m.body,_,!0);return st.makeSpan(["mord","text"],st.tryCombineChars(S),_)},mathmlBuilder:function(m,b){var _=hl(m,b);return us(m.body,_)}}),Rr({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser;return{type:"underline",mode:_.mode,body:b[0]}},htmlBuilder:function(m,b){var _=Ei(m.body,b),S=st.makeLineSpan("underline-line",b),P=b.fontMetrics().defaultRuleThickness,W=st.makeVList({positionType:"top",positionData:_.height,children:[{type:"kern",size:P},{type:"elem",elem:S},{type:"kern",size:3*P},{type:"elem",elem:_}]},b);return st.makeSpan(["mord","underline"],[W],b)},mathmlBuilder:function(m,b){var _=new tr.MathNode("mo",[new tr.TextNode("\u203E")]);_.setAttribute("stretchy","true");var S=new tr.MathNode("munder",[oi(m.body,b),_]);return S.setAttribute("accentunder","true"),S}}),Rr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(m,b,_){throw new E("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(m,b){for(var _=Eu(m),S=[],P=b.havingStyle(b.style.text()),W=0;W<_.length;W++){var ce=_[W];ce==="~"&&(ce="\\textasciitilde"),S.push(st.makeSymbol(ce,"Typewriter-Regular",m.mode,P,["mord","texttt"]))}return st.makeSpan(["mord","text"].concat(P.sizingClasses(b)),st.tryCombineChars(S),P)},mathmlBuilder:function(m,b){var _=new tr.TextNode(Eu(m)),S=new tr.MathNode("mtext",[_]);return S.setAttribute("mathvariant","monospace"),S}});var Eu=function(m){return m.body.replace(/ /g,m.star?"\u2423":"\xA0")},dl=bs,No=dl,fl=`[ \r
]`,jl="\\\\[a-zA-Z@]+",Au="\\\\[^\uD800-\uDFFF]",x0=""+jl+fl+"*",ku=new RegExp("^("+jl+")"+fl+"*$"),ql="[\u0300-\u036F]",w0=new RegExp(ql+"+$"),fa="("+fl+"+)|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(ql+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(ql+"*")+"|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*"+("|"+x0)+("|"+Au+")"),Zl=function(){function j(b,_){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=b,this.settings=_,this.tokenRegex=new RegExp(fa,"g"),this.catcodes={"%":14}}var m=j.prototype;return m.setCatcode=function(_,S){this.catcodes[_]=S},m.lex=function(){var _=this.input,S=this.tokenRegex.lastIndex;if(S===_.length)return new Me("EOF",new We(this,S,S));var P=this.tokenRegex.exec(_);if(P===null||P.index!==S)throw new E("Unexpected character: '"+_[S]+"'",new Me(_[S],new We(this,S,S+1)));var W=P[2]||" ";if(this.catcodes[W]===14){var ce=_.indexOf(`
`,this.tokenRegex.lastIndex);return ce===-1?(this.tokenRegex.lastIndex=_.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=ce+1,this.lex()}var _e=W.match(ku);return _e&&(W=_e[1]),new Me(W,new We(this,S,this.tokenRegex.lastIndex))},j}(),Ka=function(){function j(b,_){b===void 0&&(b={}),_===void 0&&(_={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=_,this.builtins=b,this.undefStack=[]}var m=j.prototype;return m.beginGroup=function(){this.undefStack.push({})},m.endGroup=function(){if(this.undefStack.length===0)throw new E("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var _=this.undefStack.pop();for(var S in _)_.hasOwnProperty(S)&&(_[S]===void 0?delete this.current[S]:this.current[S]=_[S])},m.has=function(_){return this.current.hasOwnProperty(_)||this.builtins.hasOwnProperty(_)},m.get=function(_){return this.current.hasOwnProperty(_)?this.current[_]:this.builtins[_]},m.set=function(_,S,P){if(P===void 0&&(P=!1),P){for(var W=0;W<this.undefStack.length;W++)delete this.undefStack[W][_];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][_]=S)}else{var ce=this.undefStack[this.undefStack.length-1];ce&&!ce.hasOwnProperty(_)&&(ce[_]=this.current[_])}this.current[_]=S},j}(),Tu={},Cu=Tu;function Ce(j,m){Tu[j]=m}Ce("\\@firstoftwo",function(j){var m=j.consumeArgs(2);return{tokens:m[0],numArgs:0}}),Ce("\\@secondoftwo",function(j){var m=j.consumeArgs(2);return{tokens:m[1],numArgs:0}}),Ce("\\@ifnextchar",function(j){var m=j.consumeArgs(3),b=j.future();return m[0].length===1&&m[0][0].text===b.text?{tokens:m[1],numArgs:0}:{tokens:m[2],numArgs:0}}),Ce("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Ce("\\TextOrMath",function(j){var m=j.consumeArgs(2);return j.mode==="text"?{tokens:m[0],numArgs:0}:{tokens:m[1],numArgs:0}});var Du={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};Ce("\\char",function(j){var m=j.popToken(),b,_="";if(m.text==="'")b=8,m=j.popToken();else if(m.text==='"')b=16,m=j.popToken();else if(m.text==="`")if(m=j.popToken(),m.text[0]==="\\")_=m.text.charCodeAt(1);else{if(m.text==="EOF")throw new E("\\char` missing argument");_=m.text.charCodeAt(0)}else b=10;if(b){if(_=Du[m.text],_==null||_>=b)throw new E("Invalid base-"+b+" digit "+m.text);for(var S;(S=Du[j.future().text])!=null&&S<b;)_*=b,_+=S,j.popToken()}return"\\@char{"+_+"}"});var pl=function(m,b){var _=m.consumeArgs(1)[0];if(_.length!==1)throw new E("\\gdef's first argument must be a macro name");var S=_[0].text,P=0;for(_=m.consumeArgs(1)[0];_.length===1&&_[0].text==="#";){if(_=m.consumeArgs(1)[0],_.length!==1)throw new E('Invalid argument number length "'+_.length+'"');if(!/^[1-9]$/.test(_[0].text))throw new E('Invalid argument number "'+_[0].text+'"');if(P++,parseInt(_[0].text)!==P)throw new E('Argument number "'+_[0].text+'" out of order');_=m.consumeArgs(1)[0]}return m.macros.set(S,{tokens:_,numArgs:P},b),""};Ce("\\gdef",function(j){return pl(j,!0)}),Ce("\\def",function(j){return pl(j,!1)}),Ce("\\global",function(j){var m=j.consumeArgs(1)[0];if(m.length!==1)throw new E("Invalid command after \\global");var b=m[0].text;if(b==="\\def")return pl(j,!0);throw new E("Invalid command '"+b+"' after \\global")});var Yl=function(m,b,_){var S=m.consumeArgs(1)[0];if(S.length!==1)throw new E("\\newcommand's first argument must be a macro name");var P=S[0].text,W=m.isDefined(P);if(W&&!b)throw new E("\\newcommand{"+P+"} attempting to redefine "+(P+"; use \\renewcommand"));if(!W&&!_)throw new E("\\renewcommand{"+P+"} when command "+P+" does not yet exist; use \\newcommand");var ce=0;if(S=m.consumeArgs(1)[0],S.length===1&&S[0].text==="["){for(var _e="",Be=m.expandNextToken();Be.text!=="]"&&Be.text!=="EOF";)_e+=Be.text,Be=m.expandNextToken();if(!_e.match(/^\s*[0-9]+\s*$/))throw new E("Invalid number of arguments: "+_e);ce=parseInt(_e),S=m.consumeArgs(1)[0]}return m.macros.set(P,{tokens:S,numArgs:ce}),""};Ce("\\newcommand",function(j){return Yl(j,!1,!0)}),Ce("\\renewcommand",function(j){return Yl(j,!0,!1)}),Ce("\\providecommand",function(j){return Yl(j,!0,!0)}),Ce("\\bgroup","{"),Ce("\\egroup","}"),Ce("\\lq","`"),Ce("\\rq","'"),Ce("\\aa","\\r a"),Ce("\\AA","\\r A"),Ce("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),Ce("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Ce("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),Ce("\u212C","\\mathscr{B}"),Ce("\u2130","\\mathscr{E}"),Ce("\u2131","\\mathscr{F}"),Ce("\u210B","\\mathscr{H}"),Ce("\u2110","\\mathscr{I}"),Ce("\u2112","\\mathscr{L}"),Ce("\u2133","\\mathscr{M}"),Ce("\u211B","\\mathscr{R}"),Ce("\u212D","\\mathfrak{C}"),Ce("\u210C","\\mathfrak{H}"),Ce("\u2128","\\mathfrak{Z}"),Ce("\\Bbbk","\\Bbb{k}"),Ce("\xB7","\\cdotp"),Ce("\\llap","\\mathllap{\\textrm{#1}}"),Ce("\\rlap","\\mathrlap{\\textrm{#1}}"),Ce("\\clap","\\mathclap{\\textrm{#1}}"),Ce("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Ce("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),Ce("\\ne","\\neq"),Ce("\u2260","\\neq"),Ce("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),Ce("\u2209","\\notin"),Ce("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),Ce("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),Ce("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),Ce("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),Ce("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),Ce("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),Ce("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),Ce("\u27C2","\\perp"),Ce("\u203C","\\mathclose{!\\mkern-0.8mu!}"),Ce("\u220C","\\notni"),Ce("\u231C","\\ulcorner"),Ce("\u231D","\\urcorner"),Ce("\u231E","\\llcorner"),Ce("\u231F","\\lrcorner"),Ce("\xA9","\\copyright"),Ce("\xAE","\\textregistered"),Ce("\uFE0F","\\textregistered"),Ce("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),Ce("\u22EE","\\vdots"),Ce("\\varGamma","\\mathit{\\Gamma}"),Ce("\\varDelta","\\mathit{\\Delta}"),Ce("\\varTheta","\\mathit{\\Theta}"),Ce("\\varLambda","\\mathit{\\Lambda}"),Ce("\\varXi","\\mathit{\\Xi}"),Ce("\\varPi","\\mathit{\\Pi}"),Ce("\\varSigma","\\mathit{\\Sigma}"),Ce("\\varUpsilon","\\mathit{\\Upsilon}"),Ce("\\varPhi","\\mathit{\\Phi}"),Ce("\\varPsi","\\mathit{\\Psi}"),Ce("\\varOmega","\\mathit{\\Omega}"),Ce("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Ce("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),Ce("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Ce("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Ce("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Ce("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Mu={",":"\\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"};Ce("\\dots",function(j){var m="\\dotso",b=j.expandAfterFuture().text;return b in Mu?m=Mu[b]:(b.substr(0,4)==="\\not"||b in Ar.math&&J.contains(["bin","rel"],Ar.math[b].group))&&(m="\\dotsb"),m});var xo={")":!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};Ce("\\dotso",function(j){var m=j.future().text;return m in xo?"\\ldots\\,":"\\ldots"}),Ce("\\dotsc",function(j){var m=j.future().text;return m in xo&&m!==","?"\\ldots\\,":"\\ldots"}),Ce("\\cdots",function(j){var m=j.future().text;return m in xo?"\\@cdots\\,":"\\@cdots"}),Ce("\\dotsb","\\cdots"),Ce("\\dotsm","\\cdots"),Ce("\\dotsi","\\!\\cdots"),Ce("\\dotsx","\\ldots\\,"),Ce("\\DOTSI","\\relax"),Ce("\\DOTSB","\\relax"),Ce("\\DOTSX","\\relax"),Ce("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Ce("\\,","\\tmspace+{3mu}{.1667em}"),Ce("\\thinspace","\\,"),Ce("\\>","\\mskip{4mu}"),Ce("\\:","\\tmspace+{4mu}{.2222em}"),Ce("\\medspace","\\:"),Ce("\\;","\\tmspace+{5mu}{.2777em}"),Ce("\\thickspace","\\;"),Ce("\\!","\\tmspace-{3mu}{.1667em}"),Ce("\\negthinspace","\\!"),Ce("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Ce("\\negthickspace","\\tmspace-{5mu}{.277em}"),Ce("\\enspace","\\kern.5em "),Ce("\\enskip","\\hskip.5em\\relax"),Ce("\\quad","\\hskip1em\\relax"),Ce("\\qquad","\\hskip2em\\relax"),Ce("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Ce("\\tag@paren","\\tag@literal{({#1})}"),Ce("\\tag@literal",function(j){if(j.macros.get("\\df@tag"))throw new E("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Ce("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Ce("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Ce("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Ce("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Ce("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),Ce("\\\\","\\newline"),Ce("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Lu=Pt["Main-Regular"][84][1]-.7*Pt["Main-Regular"][65][1]+"em";Ce("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Lu+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),Ce("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Lu+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),Ce("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Ce("\\@hspace","\\hskip #1\\relax"),Ce("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Ce("\\ordinarycolon",":"),Ce("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Ce("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Ce("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Ce("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Ce("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Ce("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Ce("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Ce("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Ce("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Ce("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Ce("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Ce("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Ce("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Ce("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Ce("\u2237","\\dblcolon"),Ce("\u2239","\\eqcolon"),Ce("\u2254","\\coloneqq"),Ce("\u2255","\\eqqcolon"),Ce("\u2A74","\\Coloneqq"),Ce("\\ratio","\\vcentcolon"),Ce("\\coloncolon","\\dblcolon"),Ce("\\colonequals","\\coloneqq"),Ce("\\coloncolonequals","\\Coloneqq"),Ce("\\equalscolon","\\eqqcolon"),Ce("\\equalscoloncolon","\\Eqqcolon"),Ce("\\colonminus","\\coloneq"),Ce("\\coloncolonminus","\\Coloneq"),Ce("\\minuscolon","\\eqcolon"),Ce("\\minuscoloncolon","\\Eqcolon"),Ce("\\coloncolonapprox","\\Colonapprox"),Ce("\\coloncolonsim","\\Colonsim"),Ce("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ce("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ce("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ce("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ce("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),Ce("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Ce("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Ce("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),Ce("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),Ce("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),Ce("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),Ce("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),Ce("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),Ce("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),Ce("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),Ce("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),Ce("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),Ce("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),Ce("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),Ce("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),Ce("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),Ce("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),Ce("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),Ce("\u27E6","\\llbracket"),Ce("\u27E7","\\rrbracket"),Ce("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),Ce("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),Ce("\u2983","\\lBrace"),Ce("\u2984","\\rBrace"),Ce("\\darr","\\downarrow"),Ce("\\dArr","\\Downarrow"),Ce("\\Darr","\\Downarrow"),Ce("\\lang","\\langle"),Ce("\\rang","\\rangle"),Ce("\\uarr","\\uparrow"),Ce("\\uArr","\\Uparrow"),Ce("\\Uarr","\\Uparrow"),Ce("\\N","\\mathbb{N}"),Ce("\\R","\\mathbb{R}"),Ce("\\Z","\\mathbb{Z}"),Ce("\\alef","\\aleph"),Ce("\\alefsym","\\aleph"),Ce("\\Alpha","\\mathrm{A}"),Ce("\\Beta","\\mathrm{B}"),Ce("\\bull","\\bullet"),Ce("\\Chi","\\mathrm{X}"),Ce("\\clubs","\\clubsuit"),Ce("\\cnums","\\mathbb{C}"),Ce("\\Complex","\\mathbb{C}"),Ce("\\Dagger","\\ddagger"),Ce("\\diamonds","\\diamondsuit"),Ce("\\empty","\\emptyset"),Ce("\\Epsilon","\\mathrm{E}"),Ce("\\Eta","\\mathrm{H}"),Ce("\\exist","\\exists"),Ce("\\harr","\\leftrightarrow"),Ce("\\hArr","\\Leftrightarrow"),Ce("\\Harr","\\Leftrightarrow"),Ce("\\hearts","\\heartsuit"),Ce("\\image","\\Im"),Ce("\\infin","\\infty"),Ce("\\Iota","\\mathrm{I}"),Ce("\\isin","\\in"),Ce("\\Kappa","\\mathrm{K}"),Ce("\\larr","\\leftarrow"),Ce("\\lArr","\\Leftarrow"),Ce("\\Larr","\\Leftarrow"),Ce("\\lrarr","\\leftrightarrow"),Ce("\\lrArr","\\Leftrightarrow"),Ce("\\Lrarr","\\Leftrightarrow"),Ce("\\Mu","\\mathrm{M}"),Ce("\\natnums","\\mathbb{N}"),Ce("\\Nu","\\mathrm{N}"),Ce("\\Omicron","\\mathrm{O}"),Ce("\\plusmn","\\pm"),Ce("\\rarr","\\rightarrow"),Ce("\\rArr","\\Rightarrow"),Ce("\\Rarr","\\Rightarrow"),Ce("\\real","\\Re"),Ce("\\reals","\\mathbb{R}"),Ce("\\Reals","\\mathbb{R}"),Ce("\\Rho","\\mathrm{P}"),Ce("\\sdot","\\cdot"),Ce("\\sect","\\S"),Ce("\\spades","\\spadesuit"),Ce("\\sub","\\subset"),Ce("\\sube","\\subseteq"),Ce("\\supe","\\supseteq"),Ce("\\Tau","\\mathrm{T}"),Ce("\\thetasym","\\vartheta"),Ce("\\weierp","\\wp"),Ce("\\Zeta","\\mathrm{Z}"),Ce("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Ce("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Ce("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Ce("\\blue","\\textcolor{##6495ed}{#1}"),Ce("\\orange","\\textcolor{##ffa500}{#1}"),Ce("\\pink","\\textcolor{##ff00af}{#1}"),Ce("\\red","\\textcolor{##df0030}{#1}"),Ce("\\green","\\textcolor{##28ae7b}{#1}"),Ce("\\gray","\\textcolor{gray}{#1}"),Ce("\\purple","\\textcolor{##9d38bd}{#1}"),Ce("\\blueA","\\textcolor{##ccfaff}{#1}"),Ce("\\blueB","\\textcolor{##80f6ff}{#1}"),Ce("\\blueC","\\textcolor{##63d9ea}{#1}"),Ce("\\blueD","\\textcolor{##11accd}{#1}"),Ce("\\blueE","\\textcolor{##0c7f99}{#1}"),Ce("\\tealA","\\textcolor{##94fff5}{#1}"),Ce("\\tealB","\\textcolor{##26edd5}{#1}"),Ce("\\tealC","\\textcolor{##01d1c1}{#1}"),Ce("\\tealD","\\textcolor{##01a995}{#1}"),Ce("\\tealE","\\textcolor{##208170}{#1}"),Ce("\\greenA","\\textcolor{##b6ffb0}{#1}"),Ce("\\greenB","\\textcolor{##8af281}{#1}"),Ce("\\greenC","\\textcolor{##74cf70}{#1}"),Ce("\\greenD","\\textcolor{##1fab54}{#1}"),Ce("\\greenE","\\textcolor{##0d923f}{#1}"),Ce("\\goldA","\\textcolor{##ffd0a9}{#1}"),Ce("\\goldB","\\textcolor{##ffbb71}{#1}"),Ce("\\goldC","\\textcolor{##ff9c39}{#1}"),Ce("\\goldD","\\textcolor{##e07d10}{#1}"),Ce("\\goldE","\\textcolor{##a75a05}{#1}"),Ce("\\redA","\\textcolor{##fca9a9}{#1}"),Ce("\\redB","\\textcolor{##ff8482}{#1}"),Ce("\\redC","\\textcolor{##f9685d}{#1}"),Ce("\\redD","\\textcolor{##e84d39}{#1}"),Ce("\\redE","\\textcolor{##bc2612}{#1}"),Ce("\\maroonA","\\textcolor{##ffbde0}{#1}"),Ce("\\maroonB","\\textcolor{##ff92c6}{#1}"),Ce("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Ce("\\maroonD","\\textcolor{##ca337c}{#1}"),Ce("\\maroonE","\\textcolor{##9e034e}{#1}"),Ce("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Ce("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Ce("\\purpleC","\\textcolor{##aa87ff}{#1}"),Ce("\\purpleD","\\textcolor{##7854ab}{#1}"),Ce("\\purpleE","\\textcolor{##543b78}{#1}"),Ce("\\mintA","\\textcolor{##f5f9e8}{#1}"),Ce("\\mintB","\\textcolor{##edf2df}{#1}"),Ce("\\mintC","\\textcolor{##e0e5cc}{#1}"),Ce("\\grayA","\\textcolor{##f6f7f7}{#1}"),Ce("\\grayB","\\textcolor{##f0f1f2}{#1}"),Ce("\\grayC","\\textcolor{##e3e5e6}{#1}"),Ce("\\grayD","\\textcolor{##d6d8da}{#1}"),Ce("\\grayE","\\textcolor{##babec2}{#1}"),Ce("\\grayF","\\textcolor{##888d93}{#1}"),Ce("\\grayG","\\textcolor{##626569}{#1}"),Ce("\\grayH","\\textcolor{##3b3e40}{#1}"),Ce("\\grayI","\\textcolor{##21242c}{#1}"),Ce("\\kaBlue","\\textcolor{##314453}{#1}"),Ce("\\kaGreen","\\textcolor{##71B307}{#1}");var Xl={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Iu=function(){function j(b,_,S){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=_,this.expansionCount=0,this.feed(b),this.macros=new Ka(Cu,_.macros),this.mode=S,this.stack=[]}var m=j.prototype;return m.feed=function(_){this.lexer=new Zl(_,this.settings)},m.switchMode=function(_){this.mode=_},m.beginGroup=function(){this.macros.beginGroup()},m.endGroup=function(){this.macros.endGroup()},m.future=function(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},m.popToken=function(){return this.future(),this.stack.pop()},m.pushToken=function(_){this.stack.push(_)},m.pushTokens=function(_){var S;(S=this.stack).push.apply(S,_)},m.consumeSpaces=function(){for(;;){var _=this.future();if(_.text===" ")this.stack.pop();else break}},m.consumeArgs=function(_){for(var S=[],P=0;P<_;++P){this.consumeSpaces();var W=this.popToken();if(W.text==="{"){for(var ce=[],_e=1;_e!==0;){var Be=this.popToken();if(ce.push(Be),Be.text==="{")++_e;else if(Be.text==="}")--_e;else if(Be.text==="EOF")throw new E("End of input in macro argument",W)}ce.pop(),ce.reverse(),S[P]=ce}else{if(W.text==="EOF")throw new E("End of input expecting macro argument");S[P]=[W]}}return S},m.expandOnce=function(){var _=this.popToken(),S=_.text,P=this._getExpansion(S);if(P==null)return this.pushToken(_),_;if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new E("Too many expansions: infinite loop or need to increase maxExpand setting");var W=P.tokens;if(P.numArgs){var ce=this.consumeArgs(P.numArgs);W=W.slice();for(var _e=W.length-1;_e>=0;--_e){var Be=W[_e];if(Be.text==="#"){if(_e===0)throw new E("Incomplete placeholder at end of macro body",Be);if(Be=W[--_e],Be.text==="#")W.splice(_e+1,1);else if(/^[1-9]$/.test(Be.text)){var Je;(Je=W).splice.apply(Je,[_e,2].concat(ce[+Be.text-1]))}else throw new E("Not a valid argument number",Be)}}}return this.pushTokens(W),W},m.expandAfterFuture=function(){return this.expandOnce(),this.future()},m.expandNextToken=function(){for(;;){var _=this.expandOnce();if(_ instanceof Me)if(_.text==="\\relax")this.stack.pop();else return this.stack.pop()}throw new Error},m.expandMacro=function(_){if(this.macros.get(_)){var S=[],P=this.stack.length;for(this.pushToken(new Me(_));this.stack.length>P;){var W=this.expandOnce();W instanceof Me&&S.push(this.stack.pop())}return S}},m.expandMacroAsText=function(_){var S=this.expandMacro(_);return S&&S.map(function(P){return P.text}).join("")},m._getExpansion=function(_){var S=this.macros.get(_);if(S==null)return S;var P=typeof S=="function"?S(this):S;if(typeof P=="string"){var W=0;if(P.indexOf("#")!==-1)for(var ce=P.replace(/##/g,"");ce.indexOf("#"+(W+1))!==-1;)++W;for(var _e=new Zl(P,this.settings),Be=[],Je=_e.lex();Je.text!=="EOF";)Be.push(Je),Je=_e.lex();Be.reverse();var ft={tokens:Be,numArgs:W};return ft}return P},m.isDefined=function(_){return this.macros.has(_)||No.hasOwnProperty(_)||Ar.math.hasOwnProperty(_)||Ar.text.hasOwnProperty(_)||Xl.hasOwnProperty(_)},j}(),Ru={"\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"}},ml={\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"},Ls=function(){function j(b,_){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 Iu(b,_,this.mode),this.settings=_,this.leftrightDepth=0}var m=j.prototype;return m.expect=function(_,S){if(S===void 0&&(S=!0),this.fetch().text!==_)throw new E("Expected '"+_+"', got '"+this.fetch().text+"'",this.fetch());S&&this.consume()},m.consume=function(){this.nextToken=null},m.fetch=function(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},m.switchMode=function(_){this.mode=_,this.gullet.switchMode(_)},m.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var _=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),_},m.parseExpression=function(_,S){for(var P=[];;){this.mode==="math"&&this.consumeSpaces();var W=this.fetch();if(j.endOfExpression.indexOf(W.text)!==-1||S&&W.text===S||_&&No[W.text]&&No[W.text].infix)break;var ce=this.parseAtom(S);if(!ce)break;P.push(ce)}return this.mode==="text"&&this.formLigatures(P),this.handleInfixNodes(P)},m.handleInfixNodes=function(_){for(var S=-1,P,W=0;W<_.length;W++){var ce=hi(_[W],"infix");if(ce){if(S!==-1)throw new E("only one infix operator per group",ce.token);S=W,P=ce.replaceWith}}if(S!==-1&&P){var _e,Be,Je=_.slice(0,S),ft=_.slice(S+1);Je.length===1&&Je[0].type==="ordgroup"?_e=Je[0]:_e={type:"ordgroup",mode:this.mode,body:Je},ft.length===1&&ft[0].type==="ordgroup"?Be=ft[0]:Be={type:"ordgroup",mode:this.mode,body:ft};var It;return P==="\\\\abovefrac"?It=this.callFunction(P,[_e,_[S],Be],[]):It=this.callFunction(P,[_e,Be],[]),[It]}else return _},m.handleSupSubscript=function(_){var S=this.fetch(),P=S.text;this.consume();var W=this.parseGroup(_,!1,j.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!W)throw new E("Expected group after '"+P+"'",S);return W},m.formatUnsupportedCmd=function(_){for(var S=[],P=0;P<_.length;P++)S.push({type:"textord",mode:"text",text:_[P]});var W={type:"text",mode:this.mode,body:S},ce={type:"color",mode:this.mode,color:this.settings.errorColor,body:[W]};return ce},m.parseAtom=function(_){var S=this.parseGroup("atom",!1,null,_);if(this.mode==="text")return S;for(var P,W;;){this.consumeSpaces();var ce=this.fetch();if(ce.text==="\\limits"||ce.text==="\\nolimits"){var _e=hi(S,"op");if(_e){var Be=ce.text==="\\limits";_e.limits=Be,_e.alwaysHandleSupSub=!0}else if(_e=hi(S,"operatorname"),_e&&_e.alwaysHandleSupSub){var Je=ce.text==="\\limits";_e.limits=Je}else throw new E("Limit controls must follow a math operator",ce);this.consume()}else if(ce.text==="^"){if(P)throw new E("Double superscript",ce);P=this.handleSupSubscript("superscript")}else if(ce.text==="_"){if(W)throw new E("Double subscript",ce);W=this.handleSupSubscript("subscript")}else if(ce.text==="'"){if(P)throw new E("Double superscript",ce);var ft={type:"textord",mode:this.mode,text:"\\prime"},It=[ft];for(this.consume();this.fetch().text==="'";)It.push(ft),this.consume();this.fetch().text==="^"&&It.push(this.handleSupSubscript("superscript")),P={type:"ordgroup",mode:this.mode,body:It}}else break}return P||W?{type:"supsub",mode:this.mode,base:S,sup:P,sub:W}:S},m.parseFunction=function(_,S,P){var W=this.fetch(),ce=W.text,_e=No[ce];if(!_e)return null;if(this.consume(),P!=null&&_e.greediness<=P)throw new E("Got function '"+ce+"' with no arguments"+(S?" as "+S:""),W);if(this.mode==="text"&&!_e.allowedInText)throw new E("Can't use function '"+ce+"' in text mode",W);if(this.mode==="math"&&_e.allowedInMath===!1)throw new E("Can't use function '"+ce+"' in math mode",W);var Be=this.parseArguments(ce,_e),Je=Be.args,ft=Be.optArgs;return this.callFunction(ce,Je,ft,W,_)},m.callFunction=function(_,S,P,W,ce){var _e={funcName:_,parser:this,token:W,breakOnTokenText:ce},Be=No[_];if(Be&&Be.handler)return Be.handler(_e,S,P);throw new E("No function handler for "+_)},m.parseArguments=function(_,S){var P=S.numArgs+S.numOptionalArgs;if(P===0)return{args:[],optArgs:[]};for(var W=S.greediness,ce=[],_e=[],Be=0;Be<P;Be++){var Je=S.argTypes&&S.argTypes[Be],ft=Be<S.numOptionalArgs,It=Be>0&&!ft||Be===0&&!ft&&this.mode==="math",Qt=this.parseGroupOfType("argument to '"+_+"'",Je,ft,W,It);if(!Qt){if(ft){_e.push(null);continue}throw new E("Expected group after '"+_+"'",this.fetch())}(ft?_e:ce).push(Qt)}return{args:ce,optArgs:_e}},m.parseGroupOfType=function(_,S,P,W,ce){switch(S){case"color":return ce&&this.consumeSpaces(),this.parseColorGroup(P);case"size":return ce&&this.consumeSpaces(),this.parseSizeGroup(P);case"url":return this.parseUrlGroup(P,ce);case"math":case"text":return this.parseGroup(_,P,W,void 0,S,ce);case"hbox":{var _e=this.parseGroup(_,P,W,void 0,"text",ce);if(!_e)return _e;var Be={type:"styling",mode:_e.mode,body:[_e],style:"text"};return Be}case"raw":{if(ce&&this.consumeSpaces(),P&&this.fetch().text==="{")return null;var Je=this.parseStringGroup("raw",P,!0);if(Je)return{type:"raw",mode:"text",string:Je.text};throw new E("Expected raw group",this.fetch())}case"original":case null:case void 0:return this.parseGroup(_,P,W,void 0,void 0,ce);default:throw new E("Unknown group type as "+_,this.fetch())}},m.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},m.parseStringGroup=function(_,S,P){var W=S?"[":"{",ce=S?"]":"}",_e=this.fetch();if(_e.text!==W){if(S)return null;if(P&&_e.text!=="EOF"&&/[^{}[\]]/.test(_e.text))return this.consume(),_e}var Be=this.mode;this.mode="text",this.expect(W);for(var Je="",ft=this.fetch(),It=0,Qt=ft,lr;(lr=this.fetch()).text!==ce||P&&It>0;){switch(lr.text){case"EOF":throw new E("Unexpected end of input in "+_,ft.range(Qt,Je));case W:It++;break;case ce:It--;break}Qt=lr,Je+=Qt.text,this.consume()}return this.expect(ce),this.mode=Be,ft.range(Qt,Je)},m.parseRegexGroup=function(_,S){var P=this.mode;this.mode="text";for(var W=this.fetch(),ce=W,_e="",Be;(Be=this.fetch()).text!=="EOF"&&_.test(_e+Be.text);)ce=Be,_e+=ce.text,this.consume();if(_e==="")throw new E("Invalid "+S+": '"+W.text+"'",W);return this.mode=P,W.range(ce,_e)},m.parseColorGroup=function(_){var S=this.parseStringGroup("color",_);if(!S)return null;var P=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(S.text);if(!P)throw new E("Invalid color: '"+S.text+"'",S);var W=P[0];return/^[0-9a-f]{6}$/i.test(W)&&(W="#"+W),{type:"color-token",mode:this.mode,color:W}},m.parseSizeGroup=function(_){var S,P=!1;if(!_&&this.fetch().text!=="{"?S=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):S=this.parseStringGroup("size",_),!S)return null;!_&&S.text.length===0&&(S.text="0pt",P=!0);var W=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(S.text);if(!W)throw new E("Invalid size: '"+S.text+"'",S);var ce={number:+(W[1]+W[2]),unit:W[3]};if(!$i(ce))throw new E("Invalid unit: '"+ce.unit+"'",S);return{type:"size",mode:this.mode,value:ce,isBlank:P}},m.parseUrlGroup=function(_,S){this.gullet.lexer.setCatcode("%",13);var P=this.parseStringGroup("url",_,!0);if(this.gullet.lexer.setCatcode("%",14),!P)return null;var W=P.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:W}},m.parseGroup=function(_,S,P,W,ce,_e){var Be=this.mode;ce&&this.switchMode(ce),_e&&this.consumeSpaces();var Je=this.fetch(),ft=Je.text,It;if(S?ft==="[":ft==="{"||ft==="\\begingroup"){this.consume();var Qt=j.endOfGroup[ft];this.gullet.beginGroup();var lr=this.parseExpression(!1,Qt),Dr=this.fetch();this.expect(Qt),this.gullet.endGroup(),It={type:"ordgroup",mode:this.mode,loc:We.range(Je,Dr),body:lr,semisimple:ft==="\\begingroup"||void 0}}else if(S)It=null;else if(It=this.parseFunction(W,_,P)||this.parseSymbol(),It==null&&ft[0]==="\\"&&!Xl.hasOwnProperty(ft)){if(this.settings.throwOnError)throw new E("Undefined control sequence: "+ft,Je);It=this.formatUnsupportedCmd(ft),this.consume()}return ce&&this.switchMode(Be),It},m.formLigatures=function(_){for(var S=_.length-1,P=0;P<S;++P){var W=_[P],ce=W.text;ce==="-"&&_[P+1].text==="-"&&(P+1<S&&_[P+2].text==="-"?(_.splice(P,3,{type:"textord",mode:"text",loc:We.range(W,_[P+2]),text:"---"}),S-=2):(_.splice(P,2,{type:"textord",mode:"text",loc:We.range(W,_[P+1]),text:"--"}),S-=1)),(ce==="'"||ce==="`")&&_[P+1].text===ce&&(_.splice(P,2,{type:"textord",mode:"text",loc:We.range(W,_[P+1]),text:ce+ce}),S-=1)}},m.parseSymbol=function(){var _=this.fetch(),S=_.text;if(/^\\verb[^a-zA-Z]/.test(S)){this.consume();var P=S.slice(5),W=P.charAt(0)==="*";if(W&&(P=P.slice(1)),P.length<2||P.charAt(0)!==P.slice(-1))throw new E(`\\verb assertion failed --
please report what input caused this bug`);return P=P.slice(1,-1),{type:"verb",mode:"text",body:P,star:W}}ml.hasOwnProperty(S[0])&&!Ar[this.mode][S[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+S[0]+'" used in math mode',_),S=ml[S[0]]+S.substr(1));var ce=w0.exec(S);ce&&(S=S.substring(0,ce.index),S==="i"?S="\u0131":S==="j"&&(S="\u0237"));var _e;if(Ar[this.mode][S]){this.settings.strict&&this.mode==="math"&&Ot.indexOf(S)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+S[0]+'" used in math mode',_);var Be=Ar[this.mode][S].group,Je=We.range(_),ft;if(Lr.hasOwnProperty(Be)){var It=Be;ft={type:"atom",mode:this.mode,family:It,loc:Je,text:S}}else ft={type:Be,mode:this.mode,loc:Je,text:S};_e=ft}else if(S.charCodeAt(0)>=128)this.settings.strict&&(at(S.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+S[0]+'" used in math mode',_):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+S[0]+'"'+(" ("+S.charCodeAt(0)+")"),_)),_e={type:"textord",mode:"text",loc:We.range(_),text:S};else return null;if(this.consume(),ce)for(var Qt=0;Qt<ce[0].length;Qt++){var lr=ce[0][Qt];if(!Ru[lr])throw new E("Unknown accent ' "+lr+"'",_);var Dr=Ru[lr][this.mode];if(!Dr)throw new E("Accent "+lr+" unsupported in "+this.mode+" mode",_);_e={type:"accent",mode:this.mode,loc:We.range(_),label:Dr,isStretchy:!1,isShifty:!0,base:_e}}return _e},j}();Ls.endOfExpression=["}","\\endgroup","\\end","\\right","&"],Ls.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},Ls.SUPSUB_GREEDINESS=1;var oa=function(m,b){if(!(typeof m=="string"||m instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var _=new Ls(m,b);delete _.gullet.macros.current["\\df@tag"];var S=_.parse();if(_.gullet.macros.get("\\df@tag")){if(!b.displayMode)throw new E("\\tag works only in display equations");_.gullet.feed("\\df@tag"),S=[{type:"tag",mode:"text",body:S,tag:_.parse()}]}return S},$o=oa,Pu=function(m,b,_){b.textContent="";var S=Qa(m,_).toNode();b.appendChild(S)};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."),Pu=function(){throw new E("KaTeX doesn't work in quirks mode.")});var gl=function(m,b){var _=Qa(m,b).toMarkup();return _},S0=function(m,b){var _=new B(b);return $o(m,_)},Ou=function(m,b,_){if(_.throwOnError||!(m instanceof E))throw m;var S=st.makeSpan(["katex-error"],[new ze(b)]);return S.setAttribute("title",m.toString()),S.setAttribute("style","color:"+_.errorColor),S},Qa=function(m,b){var _=new B(b);try{var S=$o(m,_);return dn(S,m,_)}catch(P){return Ou(P,m,_)}},zo=function(m,b){var _=new B(b);try{var S=$o(m,_);return Sn(S,m,_)}catch(P){return Ou(P,m,_)}},Jl={version:"0.11.1",render:Pu,renderToString:gl,ParseError:E,__parse:S0,__renderToDomTree:Qa,__renderToHTMLTree:zo,__setFontMetrics:gr,__defineSymbol:C,__defineMacro:Ce,__domTree:{Span:wt,Anchor:Rt,SymbolNode:ze,SvgNode:it,PathNode:ut,LineNode:_t}},E0=Y.default=Jl}]).default})},32834:function(Fr){(function(Ct,Y){Fr.exports=Y()})(this,function(){"use strict";function Ct(Ne,Fe){for(var qe=0;qe<Fe.length;qe++){var ee=Fe[qe];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(Ne,ee.key,ee)}}function Y(Ne,Fe,qe){return Fe&&Ct(Ne.prototype,Fe),qe&&Ct(Ne,qe),Ne}function U(Ne,Fe){if(Ne){if(typeof Ne=="string")return Pe(Ne,Fe);var qe=Object.prototype.toString.call(Ne).slice(8,-1);if(qe==="Object"&&Ne.constructor&&(qe=Ne.constructor.name),qe==="Map"||qe==="Set")return Array.from(Ne);if(qe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(qe))return Pe(Ne,Fe)}}function Pe(Ne,Fe){(Fe==null||Fe>Ne.length)&&(Fe=Ne.length);for(var qe=0,ee=new Array(Fe);qe<Fe;qe++)ee[qe]=Ne[qe];return ee}function We(Ne,Fe){var qe=typeof Symbol!="undefined"&&Ne[Symbol.iterator]||Ne["@@iterator"];if(qe)return(qe=qe.call(Ne)).next.bind(qe);if(Array.isArray(Ne)||(qe=U(Ne))||Fe&&Ne&&typeof Ne.length=="number"){qe&&(Ne=qe);var ee=0;return function(){return ee>=Ne.length?{done:!0}:{done:!1,value:Ne[ee++]}}}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 Me={exports:{}};function ae(){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 E(Ne){Me.exports.defaults=Ne}Me.exports={defaults:ae(),getDefaults:ae,changeDefaults:E};var Te=/[&<>"']/,z=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,ne=/[<>"']|&(?!#?\w+;)/g,q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},M=function(Fe){return q[Fe]};function L(Ne,Fe){if(Fe){if(Te.test(Ne))return Ne.replace(z,M)}else if(d.test(Ne))return Ne.replace(ne,M);return Ne}var O=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function G(Ne){return Ne.replace(O,function(Fe,qe){return qe=qe.toLowerCase(),qe==="colon"?":":qe.charAt(0)==="#"?qe.charAt(1)==="x"?String.fromCharCode(parseInt(qe.substring(2),16)):String.fromCharCode(+qe.substring(1)):""})}var he=/(^|[^\[])\^/g;function le(Ne,Fe){Ne=Ne.source||Ne,Fe=Fe||"";var qe={replace:function(de,Re){return Re=Re.source||Re,Re=Re.replace(he,"$1"),Ne=Ne.replace(de,Re),qe},getRegex:function(){return new RegExp(Ne,Fe)}};return qe}var J=/[^\w:]/g,B=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(Ne,Fe,qe){if(Ne){var ee;try{ee=decodeURIComponent(G(qe)).replace(J,"").toLowerCase()}catch(de){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}Fe&&!B.test(qe)&&(qe=Se(Fe,qe));try{qe=encodeURI(qe).replace(/%25/g,"%")}catch(de){return null}return qe}var H={},ie=/^[^:]+:\/*[^/]*$/,De=/^([^:]+:)[\s\S]*$/,$e=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Se(Ne,Fe){H[" "+Ne]||(ie.test(Ne)?H[" "+Ne]=Ne+"/":H[" "+Ne]=$t(Ne,"/",!0)),Ne=H[" "+Ne];var qe=Ne.indexOf(":")===-1;return Fe.substring(0,2)==="//"?qe?Fe:Ne.replace(De,"$1")+Fe:Fe.charAt(0)==="/"?qe?Fe:Ne.replace($e,"$1")+Fe:Ne+Fe}var Ye={exec:function(){}};function lt(Ne){for(var Fe=1,qe,ee;Fe<arguments.length;Fe++){qe=arguments[Fe];for(ee in qe)Object.prototype.hasOwnProperty.call(qe,ee)&&(Ne[ee]=qe[ee])}return Ne}function Xe(Ne,Fe){var qe=Ne.replace(/\|/g,function(Re,Ge,Z){for(var Nt=!1,Ae=Ge;--Ae>=0&&Z[Ae]==="\\";)Nt=!Nt;return Nt?"|":" |"}),ee=qe.split(/ \|/),de=0;if(ee.length>Fe)ee.splice(Fe);else for(;ee.length<Fe;)ee.push("");for(;de<ee.length;de++)ee[de]=ee[de].trim().replace(/\\\|/g,"|");return ee}function $t(Ne,Fe,qe){var ee=Ne.length;if(ee===0)return"";for(var de=0;de<ee;){var Re=Ne.charAt(ee-de-1);if(Re===Fe&&!qe)de++;else if(Re!==Fe&&qe)de++;else break}return Ne.substr(0,ee-de)}function ye(Ne,Fe){if(Ne.indexOf(Fe[1])===-1)return-1;for(var qe=Ne.length,ee=0,de=0;de<qe;de++)if(Ne[de]==="\\")de++;else if(Ne[de]===Fe[0])ee++;else if(Ne[de]===Fe[1]&&(ee--,ee<0))return de;return-1}function oe(Ne){Ne&&Ne.sanitize&&!Ne.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 me(Ne,Fe){if(Fe<1)return"";for(var qe="";Fe>1;)Fe&1&&(qe+=Ne),Fe>>=1,Ne+=Ne;return qe+Ne}var ge={escape:L,unescape:G,edit:le,cleanUrl:V,resolveUrl:Se,noopTest:Ye,merge:lt,splitCells:Xe,rtrim:$t,findClosingBracket:ye,checkSanitizeDeprecation:oe,repeatString:me},Ee=Me.exports.defaults,be=ge.rtrim,D=ge.splitCells,R=ge.escape,se=ge.findClosingBracket;function Ie(Ne,Fe,qe){var ee=Fe.href,de=Fe.title?R(Fe.title):null,Re=Ne[1].replace(/\\([\[\]])/g,"$1");return Ne[0].charAt(0)!=="!"?{type:"link",raw:qe,href:ee,title:de,text:Re}:{type:"image",raw:qe,href:ee,title:de,text:R(Re)}}function at(Ne,Fe){var qe=Ne.match(/^(\s+)(?:```)/);if(qe===null)return Fe;var ee=qe[1];return Fe.split(`
`).map(function(de){var Re=de.match(/^\s+/);if(Re===null)return de;var Ge=Re[0];return Ge.length>=ee.length?de.slice(ee.length):de}).join(`
`)}var Et=function(){function Ne(qe){this.options=qe||Ee}var Fe=Ne.prototype;return Fe.space=function(ee){var de=this.rules.block.newline.exec(ee);if(de)return de[0].length>1?{type:"space",raw:de[0]}:{raw:`
`}},Fe.code=function(ee){var de=this.rules.block.code.exec(ee);if(de){var Re=de[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?Re:be(Re,`
`)}}},Fe.fences=function(ee){var de=this.rules.block.fences.exec(ee);if(de){var Re=de[0],Ge=at(Re,de[3]||"");return{type:"code",raw:Re,lang:de[2]?de[2].trim():de[2],text:Ge}}},Fe.heading=function(ee){var de=this.rules.block.heading.exec(ee);if(de){var Re=de[2].trim();if(/#$/.test(Re)){var Ge=be(Re,"#");(this.options.pedantic||!Ge||/ $/.test(Ge))&&(Re=Ge.trim())}return{type:"heading",raw:de[0],depth:de[1].length,text:Re}}},Fe.nptable=function(ee){var de=this.rules.block.nptable.exec(ee);if(de){var Re={type:"table",header:D(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
`):[],raw:de[0]};if(Re.header.length===Re.align.length){var Ge=Re.align.length,Z;for(Z=0;Z<Ge;Z++)/^ *-+: *$/.test(Re.align[Z])?Re.align[Z]="right":/^ *:-+: *$/.test(Re.align[Z])?Re.align[Z]="center":/^ *:-+ *$/.test(Re.align[Z])?Re.align[Z]="left":Re.align[Z]=null;for(Ge=Re.cells.length,Z=0;Z<Ge;Z++)Re.cells[Z]=D(Re.cells[Z],Re.header.length);return Re}}},Fe.hr=function(ee){var de=this.rules.block.hr.exec(ee);if(de)return{type:"hr",raw:de[0]}},Fe.blockquote=function(ee){var de=this.rules.block.blockquote.exec(ee);if(de){var Re=de[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:de[0],text:Re}}},Fe.list=function(ee){var de=this.rules.block.list.exec(ee);if(de){var Re=de[0],Ge=de[2],Z=Ge.length>1,Nt={type:"list",raw:Re,ordered:Z,start:Z?+Ge.slice(0,-1):"",loose:!1,items:[]},Ae=de[0].match(this.rules.block.item),sr=!1,Sr,mi,Hi,Ai,zr,Ji,Cn,Di,Ii,ar=Ae.length;Hi=this.rules.block.listItemStart.exec(Ae[0]);for(var Wr=0;Wr<ar;Wr++){if(Sr=Ae[Wr],Re=Sr,this.options.pedantic||(Ii=Sr.match(new RegExp("\\n\\s*\\n {0,"+(Hi[0].length-1)+"}\\S")),Ii&&(zr=Sr.length-Ii.index+Ae.slice(Wr+1).join(`
`).length,Nt.raw=Nt.raw.substring(0,Nt.raw.length-zr),Sr=Sr.substring(0,Ii.index),Re=Sr,ar=Wr+1)),Wr!==ar-1){if(Ai=this.rules.block.listItemStart.exec(Ae[Wr+1]),this.options.pedantic?Ai[1].length>Hi[1].length:Ai[1].length>=Hi[0].length||Ai[1].length>3){Ae.splice(Wr,2,Ae[Wr]+(!this.options.pedantic&&Ai[1].length<Hi[0].length&&!Ae[Wr].match(/\n$/)?"":`
`)+Ae[Wr+1]),Wr--,ar--;continue}else(!this.options.pedantic||this.options.smartLists?Ai[2][Ai[2].length-1]!==Ge[Ge.length-1]:Z===(Ai[2].length===1))&&(zr=Ae.slice(Wr+1).join(`
`).length,Nt.raw=Nt.raw.substring(0,Nt.raw.length-zr),Wr=ar-1);Hi=Ai}mi=Sr.length,Sr=Sr.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Sr.indexOf(`
`)&&(mi-=Sr.length,Sr=this.options.pedantic?Sr.replace(/^ {1,4}/gm,""):Sr.replace(new RegExp("^ {1,"+mi+"}","gm"),"")),Sr=be(Sr,`
`),Wr!==ar-1&&(Re=Re+`
`),Ji=sr||/\n\n(?!\s*$)/.test(Re),Wr!==ar-1&&(sr=Re.slice(-2)===`
`,Ji||(Ji=sr)),Ji&&(Nt.loose=!0),this.options.gfm&&(Cn=/^\[[ xX]\] /.test(Sr),Di=void 0,Cn&&(Di=Sr[1]!==" ",Sr=Sr.replace(/^\[[ xX]\] +/,""))),Nt.items.push({type:"list_item",raw:Re,task:Cn,checked:Di,loose:Ji,text:Sr})}return Nt}},Fe.html=function(ee){var de=this.rules.block.html.exec(ee);if(de)return{type:this.options.sanitize?"paragraph":"html",raw:de[0],pre:!this.options.sanitizer&&(de[1]==="pre"||de[1]==="script"||de[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):R(de[0]):de[0]}},Fe.def=function(ee){var de=this.rules.block.def.exec(ee);if(de){de[3]&&(de[3]=de[3].substring(1,de[3].length-1));var Re=de[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:Re,raw:de[0],href:de[2],title:de[3]}}},Fe.table=function(ee){var de=this.rules.block.table.exec(ee);if(de){var Re={type:"table",header:D(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
`):[]};if(Re.header.length===Re.align.length){Re.raw=de[0];var Ge=Re.align.length,Z;for(Z=0;Z<Ge;Z++)/^ *-+: *$/.test(Re.align[Z])?Re.align[Z]="right":/^ *:-+: *$/.test(Re.align[Z])?Re.align[Z]="center":/^ *:-+ *$/.test(Re.align[Z])?Re.align[Z]="left":Re.align[Z]=null;for(Ge=Re.cells.length,Z=0;Z<Ge;Z++)Re.cells[Z]=D(Re.cells[Z].replace(/^ *\| *| *\| *$/g,""),Re.header.length);return Re}}},Fe.lheading=function(ee){var de=this.rules.block.lheading.exec(ee);if(de)return{type:"heading",raw:de[0],depth:de[2].charAt(0)==="="?1:2,text:de[1]}},Fe.paragraph=function(ee){var de=this.rules.block.paragraph.exec(ee);if(de)return{type:"paragraph",raw:de[0],text:de[1].charAt(de[1].length-1)===`
`?de[1].slice(0,-1):de[1]}},Fe.text=function(ee){var de=this.rules.block.text.exec(ee);if(de)return{type:"text",raw:de[0],text:de[0]}},Fe.escape=function(ee){var de=this.rules.inline.escape.exec(ee);if(de)return{type:"escape",raw:de[0],text:R(de[1])}},Fe.tag=function(ee,de,Re){var Ge=this.rules.inline.tag.exec(ee);if(Ge)return!de&&/^<a /i.test(Ge[0])?de=!0:de&&/^<\/a>/i.test(Ge[0])&&(de=!1),!Re&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ge[0])?Re=!0:Re&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ge[0])&&(Re=!1),{type:this.options.sanitize?"text":"html",raw:Ge[0],inLink:de,inRawBlock:Re,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ge[0]):R(Ge[0]):Ge[0]}},Fe.link=function(ee){var de=this.rules.inline.link.exec(ee);if(de){var Re=de[2].trim();if(!this.options.pedantic&&/^</.test(Re)){if(!/>$/.test(Re))return;var Ge=be(Re.slice(0,-1),"\\");if((Re.length-Ge.length)%2===0)return}else{var Z=se(de[2],"()");if(Z>-1){var Nt=de[0].indexOf("!")===0?5:4,Ae=Nt+de[1].length+Z;de[2]=de[2].substring(0,Z),de[0]=de[0].substring(0,Ae).trim(),de[3]=""}}var sr=de[2],Sr="";if(this.options.pedantic){var mi=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(sr);mi&&(sr=mi[1],Sr=mi[3])}else Sr=de[3]?de[3].slice(1,-1):"";return sr=sr.trim(),/^</.test(sr)&&(this.options.pedantic&&!/>$/.test(Re)?sr=sr.slice(1):sr=sr.slice(1,-1)),Ie(de,{href:sr&&sr.replace(this.rules.inline._escapes,"$1"),title:Sr&&Sr.replace(this.rules.inline._escapes,"$1")},de[0])}},Fe.reflink=function(ee,de){var Re;if((Re=this.rules.inline.reflink.exec(ee))||(Re=this.rules.inline.nolink.exec(ee))){var Ge=(Re[2]||Re[1]).replace(/\s+/g," ");if(Ge=de[Ge.toLowerCase()],!Ge||!Ge.href){var Z=Re[0].charAt(0);return{type:"text",raw:Z,text:Z}}return Ie(Re,Ge,Re[0])}},Fe.emStrong=function(ee,de,Re){Re===void 0&&(Re="");var Ge=this.rules.inline.emStrong.lDelim.exec(ee);if(Ge&&!(Ge[3]&&Re.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 Z=Ge[1]||Ge[2]||"";if(!Z||Z&&(Re===""||this.rules.inline.punctuation.exec(Re))){var Nt=Ge[0].length-1,Ae,sr,Sr=Nt,mi=0,Hi=Ge[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Hi.lastIndex=0,de=de.slice(-1*ee.length+Nt);(Ge=Hi.exec(de))!=null;)if(Ae=Ge[1]||Ge[2]||Ge[3]||Ge[4]||Ge[5]||Ge[6],!!Ae){if(sr=Ae.length,Ge[3]||Ge[4]){Sr+=sr;continue}else if((Ge[5]||Ge[6])&&Nt%3&&!((Nt+sr)%3)){mi+=sr;continue}if(Sr-=sr,!(Sr>0))return sr=Math.min(sr,sr+Sr+mi),Math.min(Nt,sr)%2?{type:"em",raw:ee.slice(0,Nt+Ge.index+sr+1),text:ee.slice(1,Nt+Ge.index+sr)}:{type:"strong",raw:ee.slice(0,Nt+Ge.index+sr+1),text:ee.slice(2,Nt+Ge.index+sr-1)}}}}},Fe.codespan=function(ee){var de=this.rules.inline.code.exec(ee);if(de){var Re=de[2].replace(/\n/g," "),Ge=/[^ ]/.test(Re),Z=/^ /.test(Re)&&/ $/.test(Re);return Ge&&Z&&(Re=Re.substring(1,Re.length-1)),Re=R(Re,!0),{type:"codespan",raw:de[0],text:Re}}},Fe.br=function(ee){var de=this.rules.inline.br.exec(ee);if(de)return{type:"br",raw:de[0]}},Fe.del=function(ee){var de=this.rules.inline.del.exec(ee);if(de)return{type:"del",raw:de[0],text:de[2]}},Fe.autolink=function(ee,de){var Re=this.rules.inline.autolink.exec(ee);if(Re){var Ge,Z;return Re[2]==="@"?(Ge=R(this.options.mangle?de(Re[1]):Re[1]),Z="mailto:"+Ge):(Ge=R(Re[1]),Z=Ge),{type:"link",raw:Re[0],text:Ge,href:Z,tokens:[{type:"text",raw:Ge,text:Ge}]}}},Fe.url=function(ee,de){var Re;if(Re=this.rules.inline.url.exec(ee)){var Ge,Z;if(Re[2]==="@")Ge=R(this.options.mangle?de(Re[0]):Re[0]),Z="mailto:"+Ge;else{var Nt;do Nt=Re[0],Re[0]=this.rules.inline._backpedal.exec(Re[0])[0];while(Nt!==Re[0]);Ge=R(Re[0]),Re[1]==="www."?Z="http://"+Ge:Z=Ge}return{type:"link",raw:Re[0],text:Ge,href:Z,tokens:[{type:"text",raw:Ge,text:Ge}]}}},Fe.inlineText=function(ee,de,Re){var Ge=this.rules.inline.text.exec(ee);if(Ge){var Z;return de?Z=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ge[0]):R(Ge[0]):Ge[0]:Z=R(this.options.smartypants?Re(Ge[0]):Ge[0]),{type:"text",raw:Ge[0],text:Z}}},Ne}(),bt=ge.noopTest,He=ge.edit,Ht=ge.merge,gt={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:bt,table:bt,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};gt._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,gt._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,gt.def=He(gt.def).replace("label",gt._label).replace("title",gt._title).getRegex(),gt.bullet=/(?:[*+-]|\d{1,9}[.)])/,gt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,gt.item=He(gt.item,"gm").replace(/bull/g,gt.bullet).getRegex(),gt.listItemStart=He(/^( *)(bull) */).replace("bull",gt.bullet).getRegex(),gt.list=He(gt.list).replace(/bull/g,gt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+gt.def.source+")").getRegex(),gt._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",gt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,gt.html=He(gt.html,"i").replace("comment",gt._comment).replace("tag",gt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gt.paragraph=He(gt._paragraph).replace("hr",gt.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",gt._tag).getRegex(),gt.blockquote=He(gt.blockquote).replace("paragraph",gt.paragraph).getRegex(),gt.normal=Ht({},gt),gt.gfm=Ht({},gt.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*|$)"}),gt.gfm.nptable=He(gt.gfm.nptable).replace("hr",gt.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",gt._tag).getRegex(),gt.gfm.table=He(gt.gfm.table).replace("hr",gt.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",gt._tag).getRegex(),gt.pedantic=Ht({},gt.normal,{html:He(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",gt._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:bt,paragraph:He(gt.normal._paragraph).replace("hr",gt.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",gt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Qe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:bt,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:bt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Qe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Qe.punctuation=He(Qe.punctuation).replace(/punctuation/g,Qe._punctuation).getRegex(),Qe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Qe.escapedEmSt=/\\\*|\\_/g,Qe._comment=He(gt._comment).replace("(?:-->|$)","-->").getRegex(),Qe.emStrong.lDelim=He(Qe.emStrong.lDelim).replace(/punct/g,Qe._punctuation).getRegex(),Qe.emStrong.rDelimAst=He(Qe.emStrong.rDelimAst,"g").replace(/punct/g,Qe._punctuation).getRegex(),Qe.emStrong.rDelimUnd=He(Qe.emStrong.rDelimUnd,"g").replace(/punct/g,Qe._punctuation).getRegex(),Qe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Qe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Qe._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])?)+(?![-_])/,Qe.autolink=He(Qe.autolink).replace("scheme",Qe._scheme).replace("email",Qe._email).getRegex(),Qe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Qe.tag=He(Qe.tag).replace("comment",Qe._comment).replace("attribute",Qe._attribute).getRegex(),Qe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Qe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Qe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Qe.link=He(Qe.link).replace("label",Qe._label).replace("href",Qe._href).replace("title",Qe._title).getRegex(),Qe.reflink=He(Qe.reflink).replace("label",Qe._label).getRegex(),Qe.reflinkSearch=He(Qe.reflinkSearch,"g").replace("reflink",Qe.reflink).replace("nolink",Qe.nolink).getRegex(),Qe.normal=Ht({},Qe),Qe.pedantic=Ht({},Qe.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:He(/^!?\[(label)\]\((.*?)\)/).replace("label",Qe._label).getRegex(),reflink:He(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qe._label).getRegex()}),Qe.gfm=Ht({},Qe.normal,{escape:He(Qe.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Qe.gfm.url=He(Qe.gfm.url,"i").replace("email",Qe.gfm._extended_email).getRegex(),Qe.breaks=Ht({},Qe.gfm,{br:He(Qe.br).replace("{2,}","*").getRegex(),text:He(Qe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var xr={block:gt,inline:Qe},mr=Et,pi=Me.exports.defaults,Wt=xr.block,si=xr.inline,et=ge.repeatString;function ct(Ne){return Ne.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 Ue(Ne){var Fe="",qe,ee,de=Ne.length;for(qe=0;qe<de;qe++)ee=Ne.charCodeAt(qe),Math.random()>.5&&(ee="x"+ee.toString(16)),Fe+="&#"+ee+";";return Fe}var wt=function(){function Ne(qe){this.tokens=[],this.tokens.links=Object.create(null),this.options=qe||pi,this.options.tokenizer=this.options.tokenizer||new mr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:Wt.normal,inline:si.normal};this.options.pedantic?(ee.block=Wt.pedantic,ee.inline=si.pedantic):this.options.gfm&&(ee.block=Wt.gfm,this.options.breaks?ee.inline=si.breaks:ee.inline=si.gfm),this.tokenizer.rules=ee}Ne.lex=function(ee,de){var Re=new Ne(de);return Re.lex(ee)},Ne.lexInline=function(ee,de){var Re=new Ne(de);return Re.inlineTokens(ee)};var Fe=Ne.prototype;return Fe.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},Fe.blockTokens=function(ee,de,Re){de===void 0&&(de=[]),Re===void 0&&(Re=!0),this.options.pedantic&&(ee=ee.replace(/^ +$/gm,""));for(var Ge,Z,Nt,Ae;ee;){if(Ge=this.tokenizer.space(ee)){ee=ee.substring(Ge.raw.length),Ge.type&&de.push(Ge);continue}if(Ge=this.tokenizer.code(ee)){ee=ee.substring(Ge.raw.length),Ae=de[de.length-1],Ae&&Ae.type==="paragraph"?(Ae.raw+=`
`+Ge.raw,Ae.text+=`
`+Ge.text):de.push(Ge);continue}if(Ge=this.tokenizer.fences(ee)){ee=ee.substring(Ge.raw.length),de.push(Ge);continue}if(Ge=this.tokenizer.heading(ee)){ee=ee.substring(Ge.raw.length),de.push(Ge);continue}if(Ge=this.tokenizer.nptable(ee)){ee=ee.substring(Ge.raw.length),de.push(Ge);continue}if(Ge=this.tokenizer.hr(ee)){ee=ee.substring(Ge.raw.length),de.push(Ge);continue}if(Ge=this.tokenizer.blockquote(ee)){ee=ee.substring(Ge.raw.length),Ge.tokens=this.blockTokens(Ge.text,[],Re),de.push(Ge);continue}if(Ge=this.tokenizer.list(ee)){for(ee=ee.substring(Ge.raw.length),Nt=Ge.items.length,Z=0;Z<Nt;Z++)Ge.items[Z].tokens=this.blockTokens(Ge.items[Z].text,[],!1);de.push(Ge);continue}if(Ge=this.tokenizer.html(ee)){ee=ee.substring(Ge.raw.length),de.push(Ge);continue}if(Re&&(Ge=this.tokenizer.def(ee))){ee=ee.substring(Ge.raw.length),this.tokens.links[Ge.tag]||(this.tokens.links[Ge.tag]={href:Ge.href,title:Ge.title});continue}if(Ge=this.tokenizer.table(ee)){ee=ee.substring(Ge.raw.length),de.push(Ge);continue}if(Ge=this.tokenizer.lheading(ee)){ee=ee.substring(Ge.raw.length),de.push(Ge);continue}if(Re&&(Ge=this.tokenizer.paragraph(ee))){ee=ee.substring(Ge.raw.length),de.push(Ge);continue}if(Ge=this.tokenizer.text(ee)){ee=ee.substring(Ge.raw.length),Ae=de[de.length-1],Ae&&Ae.type==="text"?(Ae.raw+=`
`+Ge.raw,Ae.text+=`
`+Ge.text):de.push(Ge);continue}if(ee){var sr="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(sr);break}else throw new Error(sr)}}return de},Fe.inline=function(ee){var de,Re,Ge,Z,Nt,Ae,sr=ee.length;for(de=0;de<sr;de++)switch(Ae=ee[de],Ae.type){case"paragraph":case"text":case"heading":{Ae.tokens=[],this.inlineTokens(Ae.text,Ae.tokens);break}case"table":{for(Ae.tokens={header:[],cells:[]},Z=Ae.header.length,Re=0;Re<Z;Re++)Ae.tokens.header[Re]=[],this.inlineTokens(Ae.header[Re],Ae.tokens.header[Re]);for(Z=Ae.cells.length,Re=0;Re<Z;Re++)for(Nt=Ae.cells[Re],Ae.tokens.cells[Re]=[],Ge=0;Ge<Nt.length;Ge++)Ae.tokens.cells[Re][Ge]=[],this.inlineTokens(Nt[Ge],Ae.tokens.cells[Re][Ge]);break}case"blockquote":{this.inline(Ae.tokens);break}case"list":{for(Z=Ae.items.length,Re=0;Re<Z;Re++)this.inline(Ae.items[Re].tokens);break}}return ee},Fe.inlineTokens=function(ee,de,Re,Ge){de===void 0&&(de=[]),Re===void 0&&(Re=!1),Ge===void 0&&(Ge=!1);var Z,Nt,Ae=ee,sr,Sr,mi;if(this.tokens.links){var Hi=Object.keys(this.tokens.links);if(Hi.length>0)for(;(sr=this.tokenizer.rules.inline.reflinkSearch.exec(Ae))!=null;)Hi.includes(sr[0].slice(sr[0].lastIndexOf("[")+1,-1))&&(Ae=Ae.slice(0,sr.index)+"["+et("a",sr[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(sr=this.tokenizer.rules.inline.blockSkip.exec(Ae))!=null;)Ae=Ae.slice(0,sr.index)+"["+et("a",sr[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(sr=this.tokenizer.rules.inline.escapedEmSt.exec(Ae))!=null;)Ae=Ae.slice(0,sr.index)+"++"+Ae.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ee;){if(Sr||(mi=""),Sr=!1,Z=this.tokenizer.escape(ee)){ee=ee.substring(Z.raw.length),de.push(Z);continue}if(Z=this.tokenizer.tag(ee,Re,Ge)){ee=ee.substring(Z.raw.length),Re=Z.inLink,Ge=Z.inRawBlock;var Ai=de[de.length-1];Ai&&Z.type==="text"&&Ai.type==="text"?(Ai.raw+=Z.raw,Ai.text+=Z.text):de.push(Z);continue}if(Z=this.tokenizer.link(ee)){ee=ee.substring(Z.raw.length),Z.type==="link"&&(Z.tokens=this.inlineTokens(Z.text,[],!0,Ge)),de.push(Z);continue}if(Z=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(Z.raw.length);var zr=de[de.length-1];Z.type==="link"?(Z.tokens=this.inlineTokens(Z.text,[],!0,Ge),de.push(Z)):zr&&Z.type==="text"&&zr.type==="text"?(zr.raw+=Z.raw,zr.text+=Z.text):de.push(Z);continue}if(Z=this.tokenizer.emStrong(ee,Ae,mi)){ee=ee.substring(Z.raw.length),Z.tokens=this.inlineTokens(Z.text,[],Re,Ge),de.push(Z);continue}if(Z=this.tokenizer.codespan(ee)){ee=ee.substring(Z.raw.length),de.push(Z);continue}if(Z=this.tokenizer.br(ee)){ee=ee.substring(Z.raw.length),de.push(Z);continue}if(Z=this.tokenizer.del(ee)){ee=ee.substring(Z.raw.length),Z.tokens=this.inlineTokens(Z.text,[],Re,Ge),de.push(Z);continue}if(Z=this.tokenizer.autolink(ee,Ue)){ee=ee.substring(Z.raw.length),de.push(Z);continue}if(!Re&&(Z=this.tokenizer.url(ee,Ue))){ee=ee.substring(Z.raw.length),de.push(Z);continue}if(Z=this.tokenizer.inlineText(ee,Ge,ct)){ee=ee.substring(Z.raw.length),Z.raw.slice(-1)!=="_"&&(mi=Z.raw.slice(-1)),Sr=!0,Nt=de[de.length-1],Nt&&Nt.type==="text"?(Nt.raw+=Z.raw,Nt.text+=Z.text):de.push(Z);continue}if(ee){var Ji="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(Ji);break}else throw new Error(Ji)}}return de},Y(Ne,null,[{key:"rules",get:function(){return{block:Wt,inline:si}}}]),Ne}(),Rt=Me.exports.defaults,Dt=ge.cleanUrl,fe=ge.escape,ze=function(){function Ne(qe){this.options=qe||Rt}var Fe=Ne.prototype;return Fe.code=function(ee,de,Re){var Ge=(de||"").match(/\S*/)[0];if(this.options.highlight){var Z=this.options.highlight(ee,Ge);Z!=null&&Z!==ee&&(Re=!0,ee=Z)}return ee=ee.replace(/\n$/,"")+`
`,Ge?'<pre><code class="'+this.options.langPrefix+fe(Ge,!0)+'">'+(Re?ee:fe(ee,!0))+`</code></pre>
`:"<pre><code>"+(Re?ee:fe(ee,!0))+`</code></pre>
`},Fe.blockquote=function(ee){return`<blockquote>
`+ee+`</blockquote>
`},Fe.html=function(ee){return ee},Fe.heading=function(ee,de,Re,Ge){return this.options.headerIds?"<h"+de+' id="'+this.options.headerPrefix+Ge.slug(Re)+'">'+ee+"</h"+de+`>
`:"<h"+de+">"+ee+"</h"+de+`>
`},Fe.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Fe.list=function(ee,de,Re){var Ge=de?"ol":"ul",Z=de&&Re!==1?' start="'+Re+'"':"";return"<"+Ge+Z+`>
`+ee+"</"+Ge+`>
`},Fe.listitem=function(ee){return"<li>"+ee+`</li>
`},Fe.checkbox=function(ee){return"<input "+(ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Fe.paragraph=function(ee){return"<p>"+ee+`</p>
`},Fe.table=function(ee,de){return de&&(de="<tbody>"+de+"</tbody>"),`<table>
<thead>
`+ee+`</thead>
`+de+`</table>
`},Fe.tablerow=function(ee){return`<tr>
`+ee+`</tr>
`},Fe.tablecell=function(ee,de){var Re=de.header?"th":"td",Ge=de.align?"<"+Re+' align="'+de.align+'">':"<"+Re+">";return Ge+ee+"</"+Re+`>
`},Fe.strong=function(ee){return"<strong>"+ee+"</strong>"},Fe.em=function(ee){return"<em>"+ee+"</em>"},Fe.codespan=function(ee){return"<code>"+ee+"</code>"},Fe.br=function(){return this.options.xhtml?"<br/>":"<br>"},Fe.del=function(ee){return"<del>"+ee+"</del>"},Fe.link=function(ee,de,Re){if(ee=Dt(this.options.sanitize,this.options.baseUrl,ee),ee===null)return Re;var Ge='<a href="'+fe(ee)+'"';return de&&(Ge+=' title="'+de+'"'),Ge+=">"+Re+"</a>",Ge},Fe.image=function(ee,de,Re){if(ee=Dt(this.options.sanitize,this.options.baseUrl,ee),ee===null)return Re;var Ge='<img src="'+ee+'" alt="'+Re+'"';return de&&(Ge+=' title="'+de+'"'),Ge+=this.options.xhtml?"/>":">",Ge},Fe.text=function(ee){return ee},Ne}(),it=function(){function Ne(){}var Fe=Ne.prototype;return Fe.strong=function(ee){return ee},Fe.em=function(ee){return ee},Fe.codespan=function(ee){return ee},Fe.del=function(ee){return ee},Fe.html=function(ee){return ee},Fe.text=function(ee){return ee},Fe.link=function(ee,de,Re){return""+Re},Fe.image=function(ee,de,Re){return""+Re},Fe.br=function(){return""},Ne}(),ut=function(){function Ne(){this.seen={}}var Fe=Ne.prototype;return Fe.serialize=function(ee){return ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Fe.getNextSafeSlug=function(ee,de){var Re=ee,Ge=0;if(this.seen.hasOwnProperty(Re)){Ge=this.seen[ee];do Ge++,Re=ee+"-"+Ge;while(this.seen.hasOwnProperty(Re))}return de||(this.seen[ee]=Ge,this.seen[Re]=0),Re},Fe.slug=function(ee,de){de===void 0&&(de={});var Re=this.serialize(ee);return this.getNextSafeSlug(Re,de.dryrun)},Ne}(),_t=ze,Ft=it,nr=ut,Pt=Me.exports.defaults,Ve=ge.unescape,Bt=function(){function Ne(qe){this.options=qe||Pt,this.options.renderer=this.options.renderer||new _t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ft,this.slugger=new nr}Ne.parse=function(ee,de){var Re=new Ne(de);return Re.parse(ee)},Ne.parseInline=function(ee,de){var Re=new Ne(de);return Re.parseInline(ee)};var Fe=Ne.prototype;return Fe.parse=function(ee,de){de===void 0&&(de=!0);var Re="",Ge,Z,Nt,Ae,sr,Sr,mi,Hi,Ai,zr,Ji,Cn,Di,Ii,ar,Wr,pe,we,kt=ee.length;for(Ge=0;Ge<kt;Ge++)switch(zr=ee[Ge],zr.type){case"space":continue;case"hr":{Re+=this.renderer.hr();continue}case"heading":{Re+=this.renderer.heading(this.parseInline(zr.tokens),zr.depth,Ve(this.parseInline(zr.tokens,this.textRenderer)),this.slugger);continue}case"code":{Re+=this.renderer.code(zr.text,zr.lang,zr.escaped);continue}case"table":{for(Hi="",mi="",Ae=zr.header.length,Z=0;Z<Ae;Z++)mi+=this.renderer.tablecell(this.parseInline(zr.tokens.header[Z]),{header:!0,align:zr.align[Z]});for(Hi+=this.renderer.tablerow(mi),Ai="",Ae=zr.cells.length,Z=0;Z<Ae;Z++){for(Sr=zr.tokens.cells[Z],mi="",sr=Sr.length,Nt=0;Nt<sr;Nt++)mi+=this.renderer.tablecell(this.parseInline(Sr[Nt]),{header:!1,align:zr.align[Nt]});Ai+=this.renderer.tablerow(mi)}Re+=this.renderer.table(Hi,Ai);continue}case"blockquote":{Ai=this.parse(zr.tokens),Re+=this.renderer.blockquote(Ai);continue}case"list":{for(Ji=zr.ordered,Cn=zr.start,Di=zr.loose,Ae=zr.items.length,Ai="",Z=0;Z<Ae;Z++)ar=zr.items[Z],Wr=ar.checked,pe=ar.task,Ii="",ar.task&&(we=this.renderer.checkbox(Wr),Di?ar.tokens.length>0&&ar.tokens[0].type==="text"?(ar.tokens[0].text=we+" "+ar.tokens[0].text,ar.tokens[0].tokens&&ar.tokens[0].tokens.length>0&&ar.tokens[0].tokens[0].type==="text"&&(ar.tokens[0].tokens[0].text=we+" "+ar.tokens[0].tokens[0].text)):ar.tokens.unshift({type:"text",text:we}):Ii+=we),Ii+=this.parse(ar.tokens,Di),Ai+=this.renderer.listitem(Ii,pe,Wr);Re+=this.renderer.list(Ai,Ji,Cn);continue}case"html":{Re+=this.renderer.html(zr.text);continue}case"paragraph":{Re+=this.renderer.paragraph(this.parseInline(zr.tokens));continue}case"text":{for(Ai=zr.tokens?this.parseInline(zr.tokens):zr.text;Ge+1<kt&&ee[Ge+1].type==="text";)zr=ee[++Ge],Ai+=`
`+(zr.tokens?this.parseInline(zr.tokens):zr.text);Re+=de?this.renderer.paragraph(Ai):Ai;continue}default:{var Ot='Token with "'+zr.type+'" type was not found.';if(this.options.silent){console.error(Ot);return}else throw new Error(Ot)}}return Re},Fe.parseInline=function(ee,de){de=de||this.renderer;var Re="",Ge,Z,Nt=ee.length;for(Ge=0;Ge<Nt;Ge++)switch(Z=ee[Ge],Z.type){case"escape":{Re+=de.text(Z.text);break}case"html":{Re+=de.html(Z.text);break}case"link":{Re+=de.link(Z.href,Z.title,this.parseInline(Z.tokens,de));break}case"image":{Re+=de.image(Z.href,Z.title,Z.text);break}case"strong":{Re+=de.strong(this.parseInline(Z.tokens,de));break}case"em":{Re+=de.em(this.parseInline(Z.tokens,de));break}case"codespan":{Re+=de.codespan(Z.text);break}case"br":{Re+=de.br();break}case"del":{Re+=de.del(this.parseInline(Z.tokens,de));break}case"text":{Re+=de.text(Z.text);break}default:{var Ae='Token with "'+Z.type+'" type was not found.';if(this.options.silent){console.error(Ae);return}else throw new Error(Ae)}}return Re},Ne}(),gr=wt,Kt=Bt,qt=Et,Gt=ze,Lr=it,wr=ut,Xt=ge.merge,Ar=ge.checkSanitizeDeprecation,C=ge.escape,N=Me.exports.getDefaults,yt=Me.exports.changeDefaults,X=Me.exports.defaults;function ue(Ne,Fe,qe){if(typeof Ne=="undefined"||Ne===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ne!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ne)+", string expected");if(typeof Fe=="function"&&(qe=Fe,Fe=null),Fe=Xt({},ue.defaults,Fe||{}),Ar(Fe),qe){var ee=Fe.highlight,de;try{de=gr.lex(Ne,Fe)}catch(Nt){return qe(Nt)}var Re=function(Ae){var sr;if(!Ae)try{Fe.walkTokens&&ue.walkTokens(de,Fe.walkTokens),sr=Kt.parse(de,Fe)}catch(Sr){Ae=Sr}return Fe.highlight=ee,Ae?qe(Ae):qe(null,sr)};if(!ee||ee.length<3||(delete Fe.highlight,!de.length))return Re();var Ge=0;ue.walkTokens(de,function(Nt){Nt.type==="code"&&(Ge++,setTimeout(function(){ee(Nt.text,Nt.lang,function(Ae,sr){if(Ae)return Re(Ae);sr!=null&&sr!==Nt.text&&(Nt.text=sr,Nt.escaped=!0),Ge--,Ge===0&&Re()})},0))}),Ge===0&&Re();return}try{var Z=gr.lex(Ne,Fe);return Fe.walkTokens&&ue.walkTokens(Z,Fe.walkTokens),Kt.parse(Z,Fe)}catch(Nt){if(Nt.message+=`
Please report this to https://github.com/markedjs/marked.`,Fe.silent)return"<p>An error occurred:</p><pre>"+C(Nt.message+"",!0)+"</pre>";throw Nt}}ue.options=ue.setOptions=function(Ne){return Xt(ue.defaults,Ne),yt(ue.defaults),ue},ue.getDefaults=N,ue.defaults=X,ue.use=function(Ne){var Fe=Xt({},Ne);if(Ne.renderer&&function(){var ee=ue.defaults.renderer||new Gt,de=function(Z){var Nt=ee[Z];ee[Z]=function(){for(var Ae=arguments.length,sr=new Array(Ae),Sr=0;Sr<Ae;Sr++)sr[Sr]=arguments[Sr];var mi=Ne.renderer[Z].apply(ee,sr);return mi===!1&&(mi=Nt.apply(ee,sr)),mi}};for(var Re in Ne.renderer)de(Re);Fe.renderer=ee}(),Ne.tokenizer&&function(){var ee=ue.defaults.tokenizer||new qt,de=function(Z){var Nt=ee[Z];ee[Z]=function(){for(var Ae=arguments.length,sr=new Array(Ae),Sr=0;Sr<Ae;Sr++)sr[Sr]=arguments[Sr];var mi=Ne.tokenizer[Z].apply(ee,sr);return mi===!1&&(mi=Nt.apply(ee,sr)),mi}};for(var Re in Ne.tokenizer)de(Re);Fe.tokenizer=ee}(),Ne.walkTokens){var qe=ue.defaults.walkTokens;Fe.walkTokens=function(ee){Ne.walkTokens(ee),qe&&qe(ee)}}ue.setOptions(Fe)},ue.walkTokens=function(Ne,Fe){for(var qe=We(Ne),ee;!(ee=qe()).done;){var de=ee.value;switch(Fe(de),de.type){case"table":{for(var Re=We(de.tokens.header),Ge;!(Ge=Re()).done;){var Z=Ge.value;ue.walkTokens(Z,Fe)}for(var Nt=We(de.tokens.cells),Ae;!(Ae=Nt()).done;)for(var sr=Ae.value,Sr=We(sr),mi;!(mi=Sr()).done;){var Hi=mi.value;ue.walkTokens(Hi,Fe)}break}case"list":{ue.walkTokens(de.items,Fe);break}default:de.tokens&&ue.walkTokens(de.tokens,Fe)}}},ue.parseInline=function(Ne,Fe){if(typeof Ne=="undefined"||Ne===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Ne!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Ne)+", string expected");Fe=Xt({},ue.defaults,Fe||{}),Ar(Fe);try{var qe=gr.lexInline(Ne,Fe);return Fe.walkTokens&&ue.walkTokens(qe,Fe.walkTokens),Kt.parseInline(qe,Fe)}catch(ee){if(ee.message+=`
Please report this to https://github.com/markedjs/marked.`,Fe.silent)return"<p>An error occurred:</p><pre>"+C(ee.message+"",!0)+"</pre>";throw ee}},ue.Parser=Kt,ue.parser=Kt.parse,ue.Renderer=Gt,ue.TextRenderer=Lr,ue.Lexer=gr,ue.lexer=gr.lex,ue.Tokenizer=qt,ue.Slugger=wr,ue.parse=ue;var br=ue;return br})},11690:function(Fr){const Ct=/[&<>"']/,Y=/[&<>"']/g,U=/[<>"']|&(?!#?\w+;)/,Pe=/[<>"']|&(?!#?\w+;)/g,We={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Me=Se=>We[Se];function ae(Se,Ye){if(Ye){if(Ct.test(Se))return Se.replace(Y,Me)}else if(U.test(Se))return Se.replace(Pe,Me);return Se}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Te(Se){return Se.replace(E,(Ye,lt)=>(lt=lt.toLowerCase(),lt==="colon"?":":lt.charAt(0)==="#"?lt.charAt(1)==="x"?String.fromCharCode(parseInt(lt.substring(2),16)):String.fromCharCode(+lt.substring(1)):""))}const z=/(^|[^\[])\^/g;function d(Se,Ye){Se=Se.source||Se,Ye=Ye||"";const lt={replace:(Xe,$t)=>($t=$t.source||$t,$t=$t.replace(z,"$1"),Se=Se.replace(Xe,$t),lt),getRegex:()=>new RegExp(Se,Ye)};return lt}const ne=/[^\w:]/g,q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function M(Se,Ye,lt){if(Se){let Xe;try{Xe=decodeURIComponent(Te(lt)).replace(ne,"").toLowerCase()}catch($t){return null}if(Xe.indexOf("javascript:")===0||Xe.indexOf("vbscript:")===0||Xe.indexOf("data:")===0)return null}Ye&&!q.test(lt)&&(lt=le(Ye,lt));try{lt=encodeURI(lt).replace(/%25/g,"%")}catch(Xe){return null}return lt}const L={},O=/^[^:]+:\/*[^/]*$/,G=/^([^:]+:)[\s\S]*$/,he=/^([^:]+:\/*[^/]*)[\s\S]*$/;function le(Se,Ye){L[" "+Se]||(O.test(Se)?L[" "+Se]=Se+"/":L[" "+Se]=H(Se,"/",!0)),Se=L[" "+Se];const lt=Se.indexOf(":")===-1;return Ye.substring(0,2)==="//"?lt?Ye:Se.replace(G,"$1")+Ye:Ye.charAt(0)==="/"?lt?Ye:Se.replace(he,"$1")+Ye:Se+Ye}const J={exec:function(){}};function B(Se){let Ye=1,lt,Xe;for(;Ye<arguments.length;Ye++){lt=arguments[Ye];for(Xe in lt)Object.prototype.hasOwnProperty.call(lt,Xe)&&(Se[Xe]=lt[Xe])}return Se}function V(Se,Ye){const lt=Se.replace(/\|/g,(ye,oe,me)=>{let ge=!1,Ee=oe;for(;--Ee>=0&&me[Ee]==="\\";)ge=!ge;return ge?"|":" |"}),Xe=lt.split(/ \|/);let $t=0;if(Xe.length>Ye)Xe.splice(Ye);else for(;Xe.length<Ye;)Xe.push("");for(;$t<Xe.length;$t++)Xe[$t]=Xe[$t].trim().replace(/\\\|/g,"|");return Xe}function H(Se,Ye,lt){const Xe=Se.length;if(Xe===0)return"";let $t=0;for(;$t<Xe;){const ye=Se.charAt(Xe-$t-1);if(ye===Ye&&!lt)$t++;else if(ye!==Ye&&lt)$t++;else break}return Se.substr(0,Xe-$t)}function ie(Se,Ye){if(Se.indexOf(Ye[1])===-1)return-1;const lt=Se.length;let Xe=0,$t=0;for(;$t<lt;$t++)if(Se[$t]==="\\")$t++;else if(Se[$t]===Ye[0])Xe++;else if(Se[$t]===Ye[1]&&(Xe--,Xe<0))return $t;return-1}function De(Se){Se&&Se.sanitize&&!Se.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 $e(Se,Ye){if(Ye<1)return"";let lt="";for(;Ye>1;)Ye&1&&(lt+=Se),Ye>>=1,Se+=Se;return lt+Se}Fr.exports={escape:ae,unescape:Te,edit:d,cleanUrl:M,resolveUrl:le,noopTest:J,merge:B,splitCells:V,rtrim:H,findClosingBracket:ie,checkSanitizeDeprecation:De,repeatString:$e}},75918:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Wi:function(){return E},Z0:function(){return Te},aU:function(){return ae},eZ:function(){return d},wY:function(){return z}});var U=Y(4348),Pe=Y(69323),We=Y(13268),Me=function(ne,q,M,L){function O(G){return G instanceof M?G:new M(function(he){he(G)})}return new(M||(M=Promise))(function(G,he){function le(V){try{B(L.next(V))}catch(H){he(H)}}function J(V){try{B(L.throw(V))}catch(H){he(H)}}function B(V){V.done?G(V.value):O(V.value).then(le,J)}B((L=L.apply(ne,q||[])).next())})};class ae extends Pe.JT{constructor(q,M="",L="",O=!0,G){super(),this._onDidChange=this._register(new U.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=q,this._label=M,this._cssClass=L,this._enabled=O,this._actionCallback=G}get id(){return this._id}get label(){return this._label}set label(q){this._setLabel(q)}_setLabel(q){this._label!==q&&(this._label=q,this._onDidChange.fire({label:q}))}get tooltip(){return this._tooltip||""}set tooltip(q){this._setTooltip(q)}_setTooltip(q){this._tooltip!==q&&(this._tooltip=q,this._onDidChange.fire({tooltip:q}))}get class(){return this._cssClass}set class(q){this._setClass(q)}_setClass(q){this._cssClass!==q&&(this._cssClass=q,this._onDidChange.fire({class:q}))}get enabled(){return this._enabled}set enabled(q){this._setEnabled(q)}_setEnabled(q){this._enabled!==q&&(this._enabled=q,this._onDidChange.fire({enabled:q}))}get checked(){return this._checked}set checked(q){this._setChecked(q)}_setChecked(q){this._checked!==q&&(this._checked=q,this._onDidChange.fire({checked:q}))}run(q,M){return Me(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(q))})}}class E extends Pe.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new U.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new U.Q5),this.onDidRun=this._onDidRun.event}run(q,M){return Me(this,void 0,void 0,function*(){if(!q.enabled)return;this._onBeforeRun.fire({action:q});let L;try{yield this.runAction(q,M)}catch(O){L=O}this._onDidRun.fire({action:q,error:L})})}runAction(q,M){return Me(this,void 0,void 0,function*(){yield q.run(M)})}}class Te extends ae{constructor(q){super(Te.ID,q,q?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Te.ID="vs.actions.separator";class z{constructor(q,M,L,O){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=q,this.label=M,this.class=O,this._actions=L}get actions(){return this._actions}dispose(){}run(){return Me(this,void 0,void 0,function*(){})}}class d extends ae{constructor(){super(d.ID,We.N("submenu.empty","(empty)"),void 0,!1)}}d.ID="vs.actions.empty"},76068:function(Fr,Ct,Y){"use strict";Y.d(Ct,{ok:function(){return U}});function U(Pe,We){if(!Pe)throw new Error(We?`Assertion failed (${We})`:"Assertion Failed")}},52615:function(Fr,Ct,Y){"use strict";Y.d(Ct,{CM:function(){return ae},JL:function(){return E},dT:function(){return z},fK:function(){return Me},lA:function(){return Te}});var U=Y(4348);class Pe{constructor(){this._icons=new Map,this._onDidRegister=new U.Q5}add(ne){const q=this._icons.get(ne.id);q?ne.description?q.description=ne.description:console.error(`Duplicate registration of codicon ${ne.id}`):(this._icons.set(ne.id,ne),this._onDidRegister.fire(ne))}get(ne){return this._icons.get(ne)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const We=new Pe,Me=We;function ae(d,ne){return new Te(d,ne)}function E(d){return d?d.replace(/\$\((.*?)\)/g,(ne,q)=>` ${q} `).trim():""}class Te{constructor(ne,q,M){this.id=ne,this.definition=q,this.description=M,We.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var z;(function(d){d.iconNameSegment="[A-Za-z0-9]+",d.iconNameExpression="[A-Za-z0-9\\-]+",d.iconModifierExpression="~[A-Za-z]+";const ne=new RegExp(`^(${d.iconNameExpression})(${d.iconModifierExpression})?$`);function q(O){if(O instanceof Te)return["codicon","codicon-"+O.id];const G=ne.exec(O.id);if(!G)return q(Te.error);let[,he,le]=G;const J=["codicon","codicon-"+he];return le&&J.push("codicon-modifier-"+le.substr(1)),J}d.asClassNameArray=q;function M(O){return q(O).join(" ")}d.asClassName=M;function L(O){return"."+q(O).join(".")}d.asCSSSelector=L})(z||(z={})),function(d){d.add=new d("add",{fontCharacter:"\\ea60"}),d.plus=new d("plus",d.add.definition),d.gistNew=new d("gist-new",d.add.definition),d.repoCreate=new d("repo-create",d.add.definition),d.lightbulb=new d("lightbulb",{fontCharacter:"\\ea61"}),d.lightBulb=new d("light-bulb",{fontCharacter:"\\ea61"}),d.repo=new d("repo",{fontCharacter:"\\ea62"}),d.repoDelete=new d("repo-delete",{fontCharacter:"\\ea62"}),d.gistFork=new d("gist-fork",{fontCharacter:"\\ea63"}),d.repoForked=new d("repo-forked",{fontCharacter:"\\ea63"}),d.gitPullRequest=new d("git-pull-request",{fontCharacter:"\\ea64"}),d.gitPullRequestAbandoned=new d("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),d.recordKeys=new d("record-keys",{fontCharacter:"\\ea65"}),d.keyboard=new d("keyboard",{fontCharacter:"\\ea65"}),d.tag=new d("tag",{fontCharacter:"\\ea66"}),d.tagAdd=new d("tag-add",{fontCharacter:"\\ea66"}),d.tagRemove=new d("tag-remove",{fontCharacter:"\\ea66"}),d.person=new d("person",{fontCharacter:"\\ea67"}),d.personFollow=new d("person-follow",{fontCharacter:"\\ea67"}),d.personOutline=new d("person-outline",{fontCharacter:"\\ea67"}),d.personFilled=new d("person-filled",{fontCharacter:"\\ea67"}),d.gitBranch=new d("git-branch",{fontCharacter:"\\ea68"}),d.gitBranchCreate=new d("git-branch-create",{fontCharacter:"\\ea68"}),d.gitBranchDelete=new d("git-branch-delete",{fontCharacter:"\\ea68"}),d.sourceControl=new d("source-control",{fontCharacter:"\\ea68"}),d.mirror=new d("mirror",{fontCharacter:"\\ea69"}),d.mirrorPublic=new d("mirror-public",{fontCharacter:"\\ea69"}),d.star=new d("star",{fontCharacter:"\\ea6a"}),d.starAdd=new d("star-add",{fontCharacter:"\\ea6a"}),d.starDelete=new d("star-delete",{fontCharacter:"\\ea6a"}),d.starEmpty=new d("star-empty",{fontCharacter:"\\ea6a"}),d.comment=new d("comment",{fontCharacter:"\\ea6b"}),d.commentAdd=new d("comment-add",{fontCharacter:"\\ea6b"}),d.alert=new d("alert",{fontCharacter:"\\ea6c"}),d.warning=new d("warning",{fontCharacter:"\\ea6c"}),d.search=new d("search",{fontCharacter:"\\ea6d"}),d.searchSave=new d("search-save",{fontCharacter:"\\ea6d"}),d.logOut=new d("log-out",{fontCharacter:"\\ea6e"}),d.signOut=new d("sign-out",{fontCharacter:"\\ea6e"}),d.logIn=new d("log-in",{fontCharacter:"\\ea6f"}),d.signIn=new d("sign-in",{fontCharacter:"\\ea6f"}),d.eye=new d("eye",{fontCharacter:"\\ea70"}),d.eyeUnwatch=new d("eye-unwatch",{fontCharacter:"\\ea70"}),d.eyeWatch=new d("eye-watch",{fontCharacter:"\\ea70"}),d.circleFilled=new d("circle-filled",{fontCharacter:"\\ea71"}),d.primitiveDot=new d("primitive-dot",{fontCharacter:"\\ea71"}),d.closeDirty=new d("close-dirty",{fontCharacter:"\\ea71"}),d.debugBreakpoint=new d("debug-breakpoint",{fontCharacter:"\\ea71"}),d.debugBreakpointDisabled=new d("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),d.debugHint=new d("debug-hint",{fontCharacter:"\\ea71"}),d.primitiveSquare=new d("primitive-square",{fontCharacter:"\\ea72"}),d.edit=new d("edit",{fontCharacter:"\\ea73"}),d.pencil=new d("pencil",{fontCharacter:"\\ea73"}),d.info=new d("info",{fontCharacter:"\\ea74"}),d.issueOpened=new d("issue-opened",{fontCharacter:"\\ea74"}),d.gistPrivate=new d("gist-private",{fontCharacter:"\\ea75"}),d.gitForkPrivate=new d("git-fork-private",{fontCharacter:"\\ea75"}),d.lock=new d("lock",{fontCharacter:"\\ea75"}),d.mirrorPrivate=new d("mirror-private",{fontCharacter:"\\ea75"}),d.close=new d("close",{fontCharacter:"\\ea76"}),d.removeClose=new d("remove-close",{fontCharacter:"\\ea76"}),d.x=new d("x",{fontCharacter:"\\ea76"}),d.repoSync=new d("repo-sync",{fontCharacter:"\\ea77"}),d.sync=new d("sync",{fontCharacter:"\\ea77"}),d.clone=new d("clone",{fontCharacter:"\\ea78"}),d.desktopDownload=new d("desktop-download",{fontCharacter:"\\ea78"}),d.beaker=new d("beaker",{fontCharacter:"\\ea79"}),d.microscope=new d("microscope",{fontCharacter:"\\ea79"}),d.vm=new d("vm",{fontCharacter:"\\ea7a"}),d.deviceDesktop=new d("device-desktop",{fontCharacter:"\\ea7a"}),d.file=new d("file",{fontCharacter:"\\ea7b"}),d.fileText=new d("file-text",{fontCharacter:"\\ea7b"}),d.more=new d("more",{fontCharacter:"\\ea7c"}),d.ellipsis=new d("ellipsis",{fontCharacter:"\\ea7c"}),d.kebabHorizontal=new d("kebab-horizontal",{fontCharacter:"\\ea7c"}),d.mailReply=new d("mail-reply",{fontCharacter:"\\ea7d"}),d.reply=new d("reply",{fontCharacter:"\\ea7d"}),d.organization=new d("organization",{fontCharacter:"\\ea7e"}),d.organizationFilled=new d("organization-filled",{fontCharacter:"\\ea7e"}),d.organizationOutline=new d("organization-outline",{fontCharacter:"\\ea7e"}),d.newFile=new d("new-file",{fontCharacter:"\\ea7f"}),d.fileAdd=new d("file-add",{fontCharacter:"\\ea7f"}),d.newFolder=new d("new-folder",{fontCharacter:"\\ea80"}),d.fileDirectoryCreate=new d("file-directory-create",{fontCharacter:"\\ea80"}),d.trash=new d("trash",{fontCharacter:"\\ea81"}),d.trashcan=new d("trashcan",{fontCharacter:"\\ea81"}),d.history=new d("history",{fontCharacter:"\\ea82"}),d.clock=new d("clock",{fontCharacter:"\\ea82"}),d.folder=new d("folder",{fontCharacter:"\\ea83"}),d.fileDirectory=new d("file-directory",{fontCharacter:"\\ea83"}),d.symbolFolder=new d("symbol-folder",{fontCharacter:"\\ea83"}),d.logoGithub=new d("logo-github",{fontCharacter:"\\ea84"}),d.markGithub=new d("mark-github",{fontCharacter:"\\ea84"}),d.github=new d("github",{fontCharacter:"\\ea84"}),d.terminal=new d("terminal",{fontCharacter:"\\ea85"}),d.console=new d("console",{fontCharacter:"\\ea85"}),d.repl=new d("repl",{fontCharacter:"\\ea85"}),d.zap=new d("zap",{fontCharacter:"\\ea86"}),d.symbolEvent=new d("symbol-event",{fontCharacter:"\\ea86"}),d.error=new d("error",{fontCharacter:"\\ea87"}),d.stop=new d("stop",{fontCharacter:"\\ea87"}),d.variable=new d("variable",{fontCharacter:"\\ea88"}),d.symbolVariable=new d("symbol-variable",{fontCharacter:"\\ea88"}),d.array=new d("array",{fontCharacter:"\\ea8a"}),d.symbolArray=new d("symbol-array",{fontCharacter:"\\ea8a"}),d.symbolModule=new d("symbol-module",{fontCharacter:"\\ea8b"}),d.symbolPackage=new d("symbol-package",{fontCharacter:"\\ea8b"}),d.symbolNamespace=new d("symbol-namespace",{fontCharacter:"\\ea8b"}),d.symbolObject=new d("symbol-object",{fontCharacter:"\\ea8b"}),d.symbolMethod=new d("symbol-method",{fontCharacter:"\\ea8c"}),d.symbolFunction=new d("symbol-function",{fontCharacter:"\\ea8c"}),d.symbolConstructor=new d("symbol-constructor",{fontCharacter:"\\ea8c"}),d.symbolBoolean=new d("symbol-boolean",{fontCharacter:"\\ea8f"}),d.symbolNull=new d("symbol-null",{fontCharacter:"\\ea8f"}),d.symbolNumeric=new d("symbol-numeric",{fontCharacter:"\\ea90"}),d.symbolNumber=new d("symbol-number",{fontCharacter:"\\ea90"}),d.symbolStructure=new d("symbol-structure",{fontCharacter:"\\ea91"}),d.symbolStruct=new d("symbol-struct",{fontCharacter:"\\ea91"}),d.symbolParameter=new d("symbol-parameter",{fontCharacter:"\\ea92"}),d.symbolTypeParameter=new d("symbol-type-parameter",{fontCharacter:"\\ea92"}),d.symbolKey=new d("symbol-key",{fontCharacter:"\\ea93"}),d.symbolText=new d("symbol-text",{fontCharacter:"\\ea93"}),d.symbolReference=new d("symbol-reference",{fontCharacter:"\\ea94"}),d.goToFile=new d("go-to-file",{fontCharacter:"\\ea94"}),d.symbolEnum=new d("symbol-enum",{fontCharacter:"\\ea95"}),d.symbolValue=new d("symbol-value",{fontCharacter:"\\ea95"}),d.symbolRuler=new d("symbol-ruler",{fontCharacter:"\\ea96"}),d.symbolUnit=new d("symbol-unit",{fontCharacter:"\\ea96"}),d.activateBreakpoints=new d("activate-breakpoints",{fontCharacter:"\\ea97"}),d.archive=new d("archive",{fontCharacter:"\\ea98"}),d.arrowBoth=new d("arrow-both",{fontCharacter:"\\ea99"}),d.arrowDown=new d("arrow-down",{fontCharacter:"\\ea9a"}),d.arrowLeft=new d("arrow-left",{fontCharacter:"\\ea9b"}),d.arrowRight=new d("arrow-right",{fontCharacter:"\\ea9c"}),d.arrowSmallDown=new d("arrow-small-down",{fontCharacter:"\\ea9d"}),d.arrowSmallLeft=new d("arrow-small-left",{fontCharacter:"\\ea9e"}),d.arrowSmallRight=new d("arrow-small-right",{fontCharacter:"\\ea9f"}),d.arrowSmallUp=new d("arrow-small-up",{fontCharacter:"\\eaa0"}),d.arrowUp=new d("arrow-up",{fontCharacter:"\\eaa1"}),d.bell=new d("bell",{fontCharacter:"\\eaa2"}),d.bold=new d("bold",{fontCharacter:"\\eaa3"}),d.book=new d("book",{fontCharacter:"\\eaa4"}),d.bookmark=new d("bookmark",{fontCharacter:"\\eaa5"}),d.debugBreakpointConditionalUnverified=new d("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),d.debugBreakpointConditional=new d("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),d.debugBreakpointConditionalDisabled=new d("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),d.debugBreakpointDataUnverified=new d("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),d.debugBreakpointData=new d("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),d.debugBreakpointDataDisabled=new d("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),d.debugBreakpointLogUnverified=new d("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),d.debugBreakpointLog=new d("debug-breakpoint-log",{fontCharacter:"\\eaab"}),d.debugBreakpointLogDisabled=new d("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),d.briefcase=new d("briefcase",{fontCharacter:"\\eaac"}),d.broadcast=new d("broadcast",{fontCharacter:"\\eaad"}),d.browser=new d("browser",{fontCharacter:"\\eaae"}),d.bug=new d("bug",{fontCharacter:"\\eaaf"}),d.calendar=new d("calendar",{fontCharacter:"\\eab0"}),d.caseSensitive=new d("case-sensitive",{fontCharacter:"\\eab1"}),d.check=new d("check",{fontCharacter:"\\eab2"}),d.checklist=new d("checklist",{fontCharacter:"\\eab3"}),d.chevronDown=new d("chevron-down",{fontCharacter:"\\eab4"}),d.dropDownButton=new d("drop-down-button",d.chevronDown.definition),d.chevronLeft=new d("chevron-left",{fontCharacter:"\\eab5"}),d.chevronRight=new d("chevron-right",{fontCharacter:"\\eab6"}),d.chevronUp=new d("chevron-up",{fontCharacter:"\\eab7"}),d.chromeClose=new d("chrome-close",{fontCharacter:"\\eab8"}),d.chromeMaximize=new d("chrome-maximize",{fontCharacter:"\\eab9"}),d.chromeMinimize=new d("chrome-minimize",{fontCharacter:"\\eaba"}),d.chromeRestore=new d("chrome-restore",{fontCharacter:"\\eabb"}),d.circleOutline=new d("circle-outline",{fontCharacter:"\\eabc"}),d.debugBreakpointUnverified=new d("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),d.circleSlash=new d("circle-slash",{fontCharacter:"\\eabd"}),d.circuitBoard=new d("circuit-board",{fontCharacter:"\\eabe"}),d.clearAll=new d("clear-all",{fontCharacter:"\\eabf"}),d.clippy=new d("clippy",{fontCharacter:"\\eac0"}),d.closeAll=new d("close-all",{fontCharacter:"\\eac1"}),d.cloudDownload=new d("cloud-download",{fontCharacter:"\\eac2"}),d.cloudUpload=new d("cloud-upload",{fontCharacter:"\\eac3"}),d.code=new d("code",{fontCharacter:"\\eac4"}),d.collapseAll=new d("collapse-all",{fontCharacter:"\\eac5"}),d.colorMode=new d("color-mode",{fontCharacter:"\\eac6"}),d.commentDiscussion=new d("comment-discussion",{fontCharacter:"\\eac7"}),d.compareChanges=new d("compare-changes",{fontCharacter:"\\eafd"}),d.creditCard=new d("credit-card",{fontCharacter:"\\eac9"}),d.dash=new d("dash",{fontCharacter:"\\eacc"}),d.dashboard=new d("dashboard",{fontCharacter:"\\eacd"}),d.database=new d("database",{fontCharacter:"\\eace"}),d.debugContinue=new d("debug-continue",{fontCharacter:"\\eacf"}),d.debugDisconnect=new d("debug-disconnect",{fontCharacter:"\\ead0"}),d.debugPause=new d("debug-pause",{fontCharacter:"\\ead1"}),d.debugRestart=new d("debug-restart",{fontCharacter:"\\ead2"}),d.debugStart=new d("debug-start",{fontCharacter:"\\ead3"}),d.debugStepInto=new d("debug-step-into",{fontCharacter:"\\ead4"}),d.debugStepOut=new d("debug-step-out",{fontCharacter:"\\ead5"}),d.debugStepOver=new d("debug-step-over",{fontCharacter:"\\ead6"}),d.debugStop=new d("debug-stop",{fontCharacter:"\\ead7"}),d.debug=new d("debug",{fontCharacter:"\\ead8"}),d.deviceCameraVideo=new d("device-camera-video",{fontCharacter:"\\ead9"}),d.deviceCamera=new d("device-camera",{fontCharacter:"\\eada"}),d.deviceMobile=new d("device-mobile",{fontCharacter:"\\eadb"}),d.diffAdded=new d("diff-added",{fontCharacter:"\\eadc"}),d.diffIgnored=new d("diff-ignored",{fontCharacter:"\\eadd"}),d.diffModified=new d("diff-modified",{fontCharacter:"\\eade"}),d.diffRemoved=new d("diff-removed",{fontCharacter:"\\eadf"}),d.diffRenamed=new d("diff-renamed",{fontCharacter:"\\eae0"}),d.diff=new d("diff",{fontCharacter:"\\eae1"}),d.discard=new d("discard",{fontCharacter:"\\eae2"}),d.editorLayout=new d("editor-layout",{fontCharacter:"\\eae3"}),d.emptyWindow=new d("empty-window",{fontCharacter:"\\eae4"}),d.exclude=new d("exclude",{fontCharacter:"\\eae5"}),d.extensions=new d("extensions",{fontCharacter:"\\eae6"}),d.eyeClosed=new d("eye-closed",{fontCharacter:"\\eae7"}),d.fileBinary=new d("file-binary",{fontCharacter:"\\eae8"}),d.fileCode=new d("file-code",{fontCharacter:"\\eae9"}),d.fileMedia=new d("file-media",{fontCharacter:"\\eaea"}),d.filePdf=new d("file-pdf",{fontCharacter:"\\eaeb"}),d.fileSubmodule=new d("file-submodule",{fontCharacter:"\\eaec"}),d.fileSymlinkDirectory=new d("file-symlink-directory",{fontCharacter:"\\eaed"}),d.fileSymlinkFile=new d("file-symlink-file",{fontCharacter:"\\eaee"}),d.fileZip=new d("file-zip",{fontCharacter:"\\eaef"}),d.files=new d("files",{fontCharacter:"\\eaf0"}),d.filter=new d("filter",{fontCharacter:"\\eaf1"}),d.flame=new d("flame",{fontCharacter:"\\eaf2"}),d.foldDown=new d("fold-down",{fontCharacter:"\\eaf3"}),d.foldUp=new d("fold-up",{fontCharacter:"\\eaf4"}),d.fold=new d("fold",{fontCharacter:"\\eaf5"}),d.folderActive=new d("folder-active",{fontCharacter:"\\eaf6"}),d.folderOpened=new d("folder-opened",{fontCharacter:"\\eaf7"}),d.gear=new d("gear",{fontCharacter:"\\eaf8"}),d.gift=new d("gift",{fontCharacter:"\\eaf9"}),d.gistSecret=new d("gist-secret",{fontCharacter:"\\eafa"}),d.gist=new d("gist",{fontCharacter:"\\eafb"}),d.gitCommit=new d("git-commit",{fontCharacter:"\\eafc"}),d.gitCompare=new d("git-compare",{fontCharacter:"\\eafd"}),d.gitMerge=new d("git-merge",{fontCharacter:"\\eafe"}),d.githubAction=new d("github-action",{fontCharacter:"\\eaff"}),d.githubAlt=new d("github-alt",{fontCharacter:"\\eb00"}),d.globe=new d("globe",{fontCharacter:"\\eb01"}),d.grabber=new d("grabber",{fontCharacter:"\\eb02"}),d.graph=new d("graph",{fontCharacter:"\\eb03"}),d.gripper=new d("gripper",{fontCharacter:"\\eb04"}),d.heart=new d("heart",{fontCharacter:"\\eb05"}),d.home=new d("home",{fontCharacter:"\\eb06"}),d.horizontalRule=new d("horizontal-rule",{fontCharacter:"\\eb07"}),d.hubot=new d("hubot",{fontCharacter:"\\eb08"}),d.inbox=new d("inbox",{fontCharacter:"\\eb09"}),d.issueClosed=new d("issue-closed",{fontCharacter:"\\eba4"}),d.issueReopened=new d("issue-reopened",{fontCharacter:"\\eb0b"}),d.issues=new d("issues",{fontCharacter:"\\eb0c"}),d.italic=new d("italic",{fontCharacter:"\\eb0d"}),d.jersey=new d("jersey",{fontCharacter:"\\eb0e"}),d.json=new d("json",{fontCharacter:"\\eb0f"}),d.kebabVertical=new d("kebab-vertical",{fontCharacter:"\\eb10"}),d.key=new d("key",{fontCharacter:"\\eb11"}),d.law=new d("law",{fontCharacter:"\\eb12"}),d.lightbulbAutofix=new d("lightbulb-autofix",{fontCharacter:"\\eb13"}),d.linkExternal=new d("link-external",{fontCharacter:"\\eb14"}),d.link=new d("link",{fontCharacter:"\\eb15"}),d.listOrdered=new d("list-ordered",{fontCharacter:"\\eb16"}),d.listUnordered=new d("list-unordered",{fontCharacter:"\\eb17"}),d.liveShare=new d("live-share",{fontCharacter:"\\eb18"}),d.loading=new d("loading",{fontCharacter:"\\eb19"}),d.location=new d("location",{fontCharacter:"\\eb1a"}),d.mailRead=new d("mail-read",{fontCharacter:"\\eb1b"}),d.mail=new d("mail",{fontCharacter:"\\eb1c"}),d.markdown=new d("markdown",{fontCharacter:"\\eb1d"}),d.megaphone=new d("megaphone",{fontCharacter:"\\eb1e"}),d.mention=new d("mention",{fontCharacter:"\\eb1f"}),d.milestone=new d("milestone",{fontCharacter:"\\eb20"}),d.mortarBoard=new d("mortar-board",{fontCharacter:"\\eb21"}),d.move=new d("move",{fontCharacter:"\\eb22"}),d.multipleWindows=new d("multiple-windows",{fontCharacter:"\\eb23"}),d.mute=new d("mute",{fontCharacter:"\\eb24"}),d.noNewline=new d("no-newline",{fontCharacter:"\\eb25"}),d.note=new d("note",{fontCharacter:"\\eb26"}),d.octoface=new d("octoface",{fontCharacter:"\\eb27"}),d.openPreview=new d("open-preview",{fontCharacter:"\\eb28"}),d.package_=new d("package",{fontCharacter:"\\eb29"}),d.paintcan=new d("paintcan",{fontCharacter:"\\eb2a"}),d.pin=new d("pin",{fontCharacter:"\\eb2b"}),d.play=new d("play",{fontCharacter:"\\eb2c"}),d.run=new d("run",{fontCharacter:"\\eb2c"}),d.plug=new d("plug",{fontCharacter:"\\eb2d"}),d.preserveCase=new d("preserve-case",{fontCharacter:"\\eb2e"}),d.preview=new d("preview",{fontCharacter:"\\eb2f"}),d.project=new d("project",{fontCharacter:"\\eb30"}),d.pulse=new d("pulse",{fontCharacter:"\\eb31"}),d.question=new d("question",{fontCharacter:"\\eb32"}),d.quote=new d("quote",{fontCharacter:"\\eb33"}),d.radioTower=new d("radio-tower",{fontCharacter:"\\eb34"}),d.reactions=new d("reactions",{fontCharacter:"\\eb35"}),d.references=new d("references",{fontCharacter:"\\eb36"}),d.refresh=new d("refresh",{fontCharacter:"\\eb37"}),d.regex=new d("regex",{fontCharacter:"\\eb38"}),d.remoteExplorer=new d("remote-explorer",{fontCharacter:"\\eb39"}),d.remote=new d("remote",{fontCharacter:"\\eb3a"}),d.remove=new d("remove",{fontCharacter:"\\eb3b"}),d.replaceAll=new d("replace-all",{fontCharacter:"\\eb3c"}),d.replace=new d("replace",{fontCharacter:"\\eb3d"}),d.repoClone=new d("repo-clone",{fontCharacter:"\\eb3e"}),d.repoForcePush=new d("repo-force-push",{fontCharacter:"\\eb3f"}),d.repoPull=new d("repo-pull",{fontCharacter:"\\eb40"}),d.repoPush=new d("repo-push",{fontCharacter:"\\eb41"}),d.report=new d("report",{fontCharacter:"\\eb42"}),d.requestChanges=new d("request-changes",{fontCharacter:"\\eb43"}),d.rocket=new d("rocket",{fontCharacter:"\\eb44"}),d.rootFolderOpened=new d("root-folder-opened",{fontCharacter:"\\eb45"}),d.rootFolder=new d("root-folder",{fontCharacter:"\\eb46"}),d.rss=new d("rss",{fontCharacter:"\\eb47"}),d.ruby=new d("ruby",{fontCharacter:"\\eb48"}),d.saveAll=new d("save-all",{fontCharacter:"\\eb49"}),d.saveAs=new d("save-as",{fontCharacter:"\\eb4a"}),d.save=new d("save",{fontCharacter:"\\eb4b"}),d.screenFull=new d("screen-full",{fontCharacter:"\\eb4c"}),d.screenNormal=new d("screen-normal",{fontCharacter:"\\eb4d"}),d.searchStop=new d("search-stop",{fontCharacter:"\\eb4e"}),d.server=new d("server",{fontCharacter:"\\eb50"}),d.settingsGear=new d("settings-gear",{fontCharacter:"\\eb51"}),d.settings=new d("settings",{fontCharacter:"\\eb52"}),d.shield=new d("shield",{fontCharacter:"\\eb53"}),d.smiley=new d("smiley",{fontCharacter:"\\eb54"}),d.sortPrecedence=new d("sort-precedence",{fontCharacter:"\\eb55"}),d.splitHorizontal=new d("split-horizontal",{fontCharacter:"\\eb56"}),d.splitVertical=new d("split-vertical",{fontCharacter:"\\eb57"}),d.squirrel=new d("squirrel",{fontCharacter:"\\eb58"}),d.starFull=new d("star-full",{fontCharacter:"\\eb59"}),d.starHalf=new d("star-half",{fontCharacter:"\\eb5a"}),d.symbolClass=new d("symbol-class",{fontCharacter:"\\eb5b"}),d.symbolColor=new d("symbol-color",{fontCharacter:"\\eb5c"}),d.symbolConstant=new d("symbol-constant",{fontCharacter:"\\eb5d"}),d.symbolEnumMember=new d("symbol-enum-member",{fontCharacter:"\\eb5e"}),d.symbolField=new d("symbol-field",{fontCharacter:"\\eb5f"}),d.symbolFile=new d("symbol-file",{fontCharacter:"\\eb60"}),d.symbolInterface=new d("symbol-interface",{fontCharacter:"\\eb61"}),d.symbolKeyword=new d("symbol-keyword",{fontCharacter:"\\eb62"}),d.symbolMisc=new d("symbol-misc",{fontCharacter:"\\eb63"}),d.symbolOperator=new d("symbol-operator",{fontCharacter:"\\eb64"}),d.symbolProperty=new d("symbol-property",{fontCharacter:"\\eb65"}),d.wrench=new d("wrench",{fontCharacter:"\\eb65"}),d.wrenchSubaction=new d("wrench-subaction",{fontCharacter:"\\eb65"}),d.symbolSnippet=new d("symbol-snippet",{fontCharacter:"\\eb66"}),d.tasklist=new d("tasklist",{fontCharacter:"\\eb67"}),d.telescope=new d("telescope",{fontCharacter:"\\eb68"}),d.textSize=new d("text-size",{fontCharacter:"\\eb69"}),d.threeBars=new d("three-bars",{fontCharacter:"\\eb6a"}),d.thumbsdown=new d("thumbsdown",{fontCharacter:"\\eb6b"}),d.thumbsup=new d("thumbsup",{fontCharacter:"\\eb6c"}),d.tools=new d("tools",{fontCharacter:"\\eb6d"}),d.triangleDown=new d("triangle-down",{fontCharacter:"\\eb6e"}),d.triangleLeft=new d("triangle-left",{fontCharacter:"\\eb6f"}),d.triangleRight=new d("triangle-right",{fontCharacter:"\\eb70"}),d.triangleUp=new d("triangle-up",{fontCharacter:"\\eb71"}),d.twitter=new d("twitter",{fontCharacter:"\\eb72"}),d.unfold=new d("unfold",{fontCharacter:"\\eb73"}),d.unlock=new d("unlock",{fontCharacter:"\\eb74"}),d.unmute=new d("unmute",{fontCharacter:"\\eb75"}),d.unverified=new d("unverified",{fontCharacter:"\\eb76"}),d.verified=new d("verified",{fontCharacter:"\\eb77"}),d.versions=new d("versions",{fontCharacter:"\\eb78"}),d.vmActive=new d("vm-active",{fontCharacter:"\\eb79"}),d.vmOutline=new d("vm-outline",{fontCharacter:"\\eb7a"}),d.vmRunning=new d("vm-running",{fontCharacter:"\\eb7b"}),d.watch=new d("watch",{fontCharacter:"\\eb7c"}),d.whitespace=new d("whitespace",{fontCharacter:"\\eb7d"}),d.wholeWord=new d("whole-word",{fontCharacter:"\\eb7e"}),d.window=new d("window",{fontCharacter:"\\eb7f"}),d.wordWrap=new d("word-wrap",{fontCharacter:"\\eb80"}),d.zoomIn=new d("zoom-in",{fontCharacter:"\\eb81"}),d.zoomOut=new d("zoom-out",{fontCharacter:"\\eb82"}),d.listFilter=new d("list-filter",{fontCharacter:"\\eb83"}),d.listFlat=new d("list-flat",{fontCharacter:"\\eb84"}),d.listSelection=new d("list-selection",{fontCharacter:"\\eb85"}),d.selection=new d("selection",{fontCharacter:"\\eb85"}),d.listTree=new d("list-tree",{fontCharacter:"\\eb86"}),d.debugBreakpointFunctionUnverified=new d("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),d.debugBreakpointFunction=new d("debug-breakpoint-function",{fontCharacter:"\\eb88"}),d.debugBreakpointFunctionDisabled=new d("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),d.debugStackframeActive=new d("debug-stackframe-active",{fontCharacter:"\\eb89"}),d.debugStackframeDot=new d("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),d.debugStackframe=new d("debug-stackframe",{fontCharacter:"\\eb8b"}),d.debugStackframeFocused=new d("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),d.debugBreakpointUnsupported=new d("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),d.symbolString=new d("symbol-string",{fontCharacter:"\\eb8d"}),d.debugReverseContinue=new d("debug-reverse-continue",{fontCharacter:"\\eb8e"}),d.debugStepBack=new d("debug-step-back",{fontCharacter:"\\eb8f"}),d.debugRestartFrame=new d("debug-restart-frame",{fontCharacter:"\\eb90"}),d.callIncoming=new d("call-incoming",{fontCharacter:"\\eb92"}),d.callOutgoing=new d("call-outgoing",{fontCharacter:"\\eb93"}),d.menu=new d("menu",{fontCharacter:"\\eb94"}),d.expandAll=new d("expand-all",{fontCharacter:"\\eb95"}),d.feedback=new d("feedback",{fontCharacter:"\\eb96"}),d.groupByRefType=new d("group-by-ref-type",{fontCharacter:"\\eb97"}),d.ungroupByRefType=new d("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),d.account=new d("account",{fontCharacter:"\\eb99"}),d.bellDot=new d("bell-dot",{fontCharacter:"\\eb9a"}),d.debugConsole=new d("debug-console",{fontCharacter:"\\eb9b"}),d.library=new d("library",{fontCharacter:"\\eb9c"}),d.output=new d("output",{fontCharacter:"\\eb9d"}),d.runAll=new d("run-all",{fontCharacter:"\\eb9e"}),d.syncIgnored=new d("sync-ignored",{fontCharacter:"\\eb9f"}),d.pinned=new d("pinned",{fontCharacter:"\\eba0"}),d.githubInverted=new d("github-inverted",{fontCharacter:"\\eba1"}),d.debugAlt=new d("debug-alt",{fontCharacter:"\\eb91"}),d.serverProcess=new d("server-process",{fontCharacter:"\\eba2"}),d.serverEnvironment=new d("server-environment",{fontCharacter:"\\eba3"}),d.pass=new d("pass",{fontCharacter:"\\eba4"}),d.stopCircle=new d("stop-circle",{fontCharacter:"\\eba5"}),d.playCircle=new d("play-circle",{fontCharacter:"\\eba6"}),d.record=new d("record",{fontCharacter:"\\eba7"}),d.debugAltSmall=new d("debug-alt-small",{fontCharacter:"\\eba8"}),d.vmConnect=new d("vm-connect",{fontCharacter:"\\eba9"}),d.cloud=new d("cloud",{fontCharacter:"\\ebaa"}),d.merge=new d("merge",{fontCharacter:"\\ebab"}),d.exportIcon=new d("export",{fontCharacter:"\\ebac"}),d.graphLeft=new d("graph-left",{fontCharacter:"\\ebad"}),d.magnet=new d("magnet",{fontCharacter:"\\ebae"}),d.notebook=new d("notebook",{fontCharacter:"\\ebaf"}),d.redo=new d("redo",{fontCharacter:"\\ebb0"}),d.checkAll=new d("check-all",{fontCharacter:"\\ebb1"}),d.pinnedDirty=new d("pinned-dirty",{fontCharacter:"\\ebb2"}),d.passFilled=new d("pass-filled",{fontCharacter:"\\ebb3"}),d.circleLargeFilled=new d("circle-large-filled",{fontCharacter:"\\ebb4"}),d.circleLargeOutline=new d("circle-large-outline",{fontCharacter:"\\ebb5"}),d.combine=new d("combine",{fontCharacter:"\\ebb6"}),d.gather=new d("gather",{fontCharacter:"\\ebb6"}),d.table=new d("table",{fontCharacter:"\\ebb7"}),d.variableGroup=new d("variable-group",{fontCharacter:"\\ebb8"}),d.typeHierarchy=new d("type-hierarchy",{fontCharacter:"\\ebb9"}),d.typeHierarchySub=new d("type-hierarchy-sub",{fontCharacter:"\\ebba"}),d.typeHierarchySuper=new d("type-hierarchy-super",{fontCharacter:"\\ebbb"}),d.gitPullRequestCreate=new d("git-pull-request-create",{fontCharacter:"\\ebbc"}),d.runAbove=new d("run-above",{fontCharacter:"\\ebbd"}),d.runBelow=new d("run-below",{fontCharacter:"\\ebbe"}),d.notebookTemplate=new d("notebook-template",{fontCharacter:"\\ebbf"}),d.debugRerun=new d("debug-rerun",{fontCharacter:"\\ebc0"}),d.workspaceTrusted=new d("workspace-trusted",{fontCharacter:"\\ebc1"}),d.workspaceUntrusted=new d("workspace-untrusted",{fontCharacter:"\\ebc2"}),d.workspaceUnspecified=new d("workspace-unspecified",{fontCharacter:"\\ebc3"}),d.terminalCmd=new d("terminal-cmd",{fontCharacter:"\\ebc4"}),d.terminalDebian=new d("terminal-debian",{fontCharacter:"\\ebc5"}),d.terminalLinux=new d("terminal-linux",{fontCharacter:"\\ebc6"}),d.terminalPowershell=new d("terminal-powershell",{fontCharacter:"\\ebc7"}),d.terminalTmux=new d("terminal-tmux",{fontCharacter:"\\ebc8"}),d.terminalUbuntu=new d("terminal-ubuntu",{fontCharacter:"\\ebc9"}),d.terminalBash=new d("terminal-bash",{fontCharacter:"\\ebca"}),d.arrowSwap=new d("arrow-swap",{fontCharacter:"\\ebcb"}),d.copy=new d("copy",{fontCharacter:"\\ebcc"}),d.personAdd=new d("person-add",{fontCharacter:"\\ebcd"}),d.filterFilled=new d("filter-filled",{fontCharacter:"\\ebce"}),d.wand=new d("wand",{fontCharacter:"\\ebcf"}),d.debugLineByLine=new d("debug-line-by-line",{fontCharacter:"\\ebd0"}),d.inspect=new d("inspect",{fontCharacter:"\\ebd1"}),d.layers=new d("layers",{fontCharacter:"\\ebd2"}),d.layersDot=new d("layers-dot",{fontCharacter:"\\ebd3"}),d.layersActive=new d("layers-active",{fontCharacter:"\\ebd4"}),d.compass=new d("compass",{fontCharacter:"\\ebd5"}),d.compassDot=new d("compass-dot",{fontCharacter:"\\ebd6"}),d.compassActive=new d("compass-active",{fontCharacter:"\\ebd7"}),d.azure=new d("azure",{fontCharacter:"\\ebd8"}),d.issueDraft=new d("issue-draft",{fontCharacter:"\\ebd9"}),d.gitPullRequestClosed=new d("git-pull-request-closed",{fontCharacter:"\\ebda"}),d.gitPullRequestDraft=new d("git-pull-request-draft",{fontCharacter:"\\ebdb"}),d.debugAll=new d("debug-all",{fontCharacter:"\\ebdc"}),d.debugCoverage=new d("debug-coverage",{fontCharacter:"\\ebdd"}),d.runErrors=new d("run-errors",{fontCharacter:"\\ebde"}),d.folderLibrary=new d("folder-library",{fontCharacter:"\\ebdf"}),d.debugContinueSmall=new d("debug-continue-small",{fontCharacter:"\\ebe0"}),d.beakerStop=new d("beaker-stop",{fontCharacter:"\\ebe1"}),d.graphLine=new d("graph-line",{fontCharacter:"\\ebe2"}),d.graphScatter=new d("graph-scatter",{fontCharacter:"\\ebe3"}),d.pieChart=new d("pie-chart",{fontCharacter:"\\ebe4"}),d.bracket=new d("bracket",d.json.definition),d.bracketDot=new d("bracket-dot",{fontCharacter:"\\ebe5"}),d.bracketError=new d("bracket-error",{fontCharacter:"\\ebe6"}),d.lockSmall=new d("lock-small",{fontCharacter:"\\ebe7"}),d.azureDevops=new d("azure-devops",{fontCharacter:"\\ebe8"}),d.verifiedFilled=new d("verified-filled",{fontCharacter:"\\ebe9"})}(Te||(Te={}))},79881:function(Fr,Ct,Y){"use strict";Y.d(Ct,{B8:function(){return q},Cp:function(){return Me},F0:function(){return z},L6:function(){return ne},VV:function(){return Te},b1:function(){return d},dL:function(){return We},ri:function(){return ae}});class U{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(L){setTimeout(()=>{throw L.stack?new Error(L.message+`
`+L.stack):L},0)}}emit(L){this.listeners.forEach(O=>{O(L)})}onUnexpectedError(L){this.unexpectedErrorHandler(L),this.emit(L)}onUnexpectedExternalError(L){this.unexpectedErrorHandler(L)}}const Pe=new U;function We(M){Te(M)||Pe.onUnexpectedError(M)}function Me(M){Te(M)||Pe.onUnexpectedExternalError(M)}function ae(M){if(M instanceof Error){let{name:L,message:O}=M;const G=M.stacktrace||M.stack;return{$isError:!0,name:L,message:O,stack:G}}return M}const E="Canceled";function Te(M){return M instanceof Error&&M.name===E&&M.message===E}function z(){const M=new Error(E);return M.name=M.message,M}function d(M){return M?new Error(`Illegal argument: ${M}`):new Error("Illegal argument")}function ne(M){return M?new Error(`Illegal state: ${M}`):new Error("Illegal state")}class q extends Error{constructor(L){super("NotSupported"),L&&(this.message=L)}}},4348:function(Fr,Ct,Y){"use strict";Y.d(Ct,{D0:function(){return q},E7:function(){return M},K3:function(){return ne},Q5:function(){return d},ZD:function(){return L},ju:function(){return ae}});var U=Y(79881),Pe=Y(69323),We=Y(34502),Me=Y(95830),ae;(function(O){O.None=()=>Pe.JT.None;function G(me){return(ge,Ee=null,be)=>{let D=!1,R;return R=me(se=>{if(!D)return R?R.dispose():D=!0,ge.call(Ee,se)},null,be),D&&R.dispose(),R}}O.once=G;function he(me,ge){return ie((Ee,be=null,D)=>me(R=>Ee.call(be,ge(R)),null,D))}O.map=he;function le(me,ge){return ie((Ee,be=null,D)=>me(R=>{ge(R),Ee.call(be,R)},null,D))}O.forEach=le;function J(me,ge){return ie((Ee,be=null,D)=>me(R=>ge(R)&&Ee.call(be,R),null,D))}O.filter=J;function B(me){return me}O.signal=B;function V(...me){return(ge,Ee=null,be)=>(0,Pe.F8)(...me.map(D=>D(R=>ge.call(Ee,R),null,be)))}O.any=V;function H(me,ge,Ee){let be=Ee;return he(me,D=>(be=ge(be,D),be))}O.reduce=H;function ie(me){let ge;const Ee=new d({onFirstListenerAdd(){ge=me(Ee.fire,Ee)},onLastListenerRemove(){ge.dispose()}});return Ee.event}function De(me,ge,Ee=100,be=!1,D){let R,se,Ie,at=0;const Et=new d({leakWarningThreshold:D,onFirstListenerAdd(){R=me(bt=>{at++,se=ge(se,bt),be&&!Ie&&(Et.fire(se),se=void 0),clearTimeout(Ie),Ie=setTimeout(()=>{const He=se;se=void 0,Ie=void 0,(!be||at>1)&&Et.fire(He),at=0},Ee)})},onLastListenerRemove(){R.dispose()}});return Et.event}O.debounce=De;function $e(me,ge=(Ee,be)=>Ee===be){let Ee=!0,be;return J(me,D=>{const R=Ee||!ge(D,be);return Ee=!1,be=D,R})}O.latch=$e;function Se(me,ge){return[O.filter(me,ge),O.filter(me,Ee=>!ge(Ee))]}O.split=Se;function Ye(me,ge=!1,Ee=[]){let be=Ee.slice(),D=me(Ie=>{be?be.push(Ie):se.fire(Ie)});const R=()=>{be&&be.forEach(Ie=>se.fire(Ie)),be=null},se=new d({onFirstListenerAdd(){D||(D=me(Ie=>se.fire(Ie)))},onFirstListenerDidAdd(){be&&(ge?setTimeout(R):R())},onLastListenerRemove(){D&&D.dispose(),D=null}});return se.event}O.buffer=Ye;class lt{constructor(ge){this.event=ge}map(ge){return new lt(he(this.event,ge))}forEach(ge){return new lt(le(this.event,ge))}filter(ge){return new lt(J(this.event,ge))}reduce(ge,Ee){return new lt(H(this.event,ge,Ee))}latch(){return new lt($e(this.event))}debounce(ge,Ee=100,be=!1,D){return new lt(De(this.event,ge,Ee,be,D))}on(ge,Ee,be){return this.event(ge,Ee,be)}once(ge,Ee,be){return G(this.event)(ge,Ee,be)}}function Xe(me){return new lt(me)}O.chain=Xe;function $t(me,ge,Ee=be=>be){const be=(...Ie)=>se.fire(Ee(...Ie)),D=()=>me.on(ge,be),R=()=>me.removeListener(ge,be),se=new d({onFirstListenerAdd:D,onLastListenerRemove:R});return se.event}O.fromNodeEventEmitter=$t;function ye(me,ge,Ee=be=>be){const be=(...Ie)=>se.fire(Ee(...Ie)),D=()=>me.addEventListener(ge,be),R=()=>me.removeEventListener(ge,be),se=new d({onFirstListenerAdd:D,onLastListenerRemove:R});return se.event}O.fromDOMEventEmitter=ye;function oe(me){return new Promise(ge=>G(me)(ge))}O.toPromise=oe})(ae||(ae={}));class E{constructor(G){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${G}_${E._idPool++}`}start(G){this._stopWatch=new Me.G(!0),this._listenerCount=G}stop(){if(this._stopWatch){const G=this._stopWatch.elapsed();this._elapsedOverall+=G,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${G.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}E._idPool=0;let Te=-1;class z{constructor(G,he=Math.random().toString(18).slice(2,5)){this.customThreshold=G,this.name=he,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(G){let he=Te;if(typeof this.customThreshold=="number"&&(he=this.customThreshold),he<=0||G<he)return;this._stacks||(this._stacks=new Map);const le=new Error().stack.split(`
`).slice(3).join(`
`),J=this._stacks.get(le)||0;if(this._stacks.set(le,J+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=he*.5;let B,V=0;for(const[H,ie]of this._stacks)(!B||V<ie)&&(B=H,V=ie);console.warn(`[${this.name}] potential listener LEAK detected, having ${G} listeners already. MOST frequent listener (${V}):`),console.warn(B)}return()=>{const B=this._stacks.get(le)||0;this._stacks.set(le,B-1)}}}class d{constructor(G){var he;this._disposed=!1,this._options=G,this._leakageMon=Te>0?new z(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((he=this._options)===null||he===void 0)&&he._profName?new E(this._options._profName):void 0}get event(){return this._event||(this._event=(G,he,le)=>{var J;this._listeners||(this._listeners=new We.S);const B=this._listeners.isEmpty();B&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const V=this._listeners.push(he?[G,he]:G);B&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,G,he);const H=(J=this._leakageMon)===null||J===void 0?void 0:J.check(this._listeners.size),ie=(0,Pe.OF)(()=>{H&&H(),this._disposed||(V(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return le instanceof Pe.SL?le.add(ie):Array.isArray(le)&&le.push(ie),ie}),this._event}fire(G){var he,le;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new We.S);for(let J of this._listeners)this._deliveryQueue.push([J,G]);for((he=this._perfMon)===null||he===void 0||he.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[J,B]=this._deliveryQueue.shift();try{typeof J=="function"?J.call(void 0,B):J[0].call(J[1],B)}catch(V){(0,U.dL)(V)}}(le=this._perfMon)===null||le===void 0||le.stop()}}dispose(){var G,he,le,J,B;this._disposed||(this._disposed=!0,(G=this._listeners)===null||G===void 0||G.clear(),(he=this._deliveryQueue)===null||he===void 0||he.clear(),(J=(le=this._options)===null||le===void 0?void 0:le.onLastListenerRemove)===null||J===void 0||J.call(le),(B=this._leakageMon)===null||B===void 0||B.dispose())}}class ne extends d{constructor(G){super(G),this._isPaused=0,this._eventQueue=new We.S,this._mergeFn=G==null?void 0:G.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const G=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(G))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(G){this._listeners&&(this._isPaused!==0?this._eventQueue.push(G):super.fire(G))}}class q extends ne{constructor(G){var he;super(G),this._delay=(he=G.delay)!==null&&he!==void 0?he:100}fire(G){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(G)}}class M{constructor(){this.buffers=[]}wrapEvent(G){return(he,le,J)=>G(B=>{const V=this.buffers[this.buffers.length-1];V?V.push(()=>he.call(le,B)):he.call(le,B)},void 0,J)}bufferEvents(G){const he=[];this.buffers.push(he);const le=G();return this.buffers.pop(),he.forEach(J=>J()),le}}class L{constructor(){this.listening=!1,this.inputEvent=ae.None,this.inputEventListener=Pe.JT.None,this.emitter=new d({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(G){this.inputEvent=G,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=G(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(Fr,Ct,Y){"use strict";Y.d(Ct,{I:function(){return U}});function U(Pe){const We=this;let Me=!1,ae;return function(){return Me||(Me=!0,ae=Pe.apply(We,arguments)),ae}}},88226:function(Fr,Ct,Y){"use strict";Y.d(Ct,{$:function(){return U}});var U;(function(Pe){function We(V){return V&&typeof V=="object"&&typeof V[Symbol.iterator]=="function"}Pe.is=We;const Me=Object.freeze([]);function ae(){return Me}Pe.empty=ae;function*E(V){yield V}Pe.single=E;function Te(V){return V||Me}Pe.from=Te;function z(V){return!V||V[Symbol.iterator]().next().done===!0}Pe.isEmpty=z;function d(V){return V[Symbol.iterator]().next().value}Pe.first=d;function ne(V,H){for(const ie of V)if(H(ie))return!0;return!1}Pe.some=ne;function q(V,H){for(const ie of V)if(H(ie))return ie}Pe.find=q;function*M(V,H){for(const ie of V)H(ie)&&(yield ie)}Pe.filter=M;function*L(V,H){let ie=0;for(const De of V)yield H(De,ie++)}Pe.map=L;function*O(...V){for(const H of V)for(const ie of H)yield ie}Pe.concat=O;function*G(V){for(const H of V)for(const ie of H)yield ie}Pe.concatNested=G;function he(V,H,ie){let De=ie;for(const $e of V)De=H(De,$e);return De}Pe.reduce=he;function*le(V,H,ie=V.length){for(H<0&&(H+=V.length),ie<0?ie+=V.length:ie>V.length&&(ie=V.length);H<ie;H++)yield V[H]}Pe.slice=le;function J(V,H=Number.POSITIVE_INFINITY){const ie=[];if(H===0)return[ie,V];const De=V[Symbol.iterator]();for(let $e=0;$e<H;$e++){const Se=De.next();if(Se.done)return[ie,Pe.empty()];ie.push(Se.value)}return[ie,{[Symbol.iterator](){return De}}]}Pe.consume=J;function B(V,H,ie=(De,$e)=>De===$e){const De=V[Symbol.iterator](),$e=H[Symbol.iterator]();for(;;){const Se=De.next(),Ye=$e.next();if(Se.done!==Ye.done)return!1;if(Se.done)return!0;if(!ie(Se.value,Ye.value))return!1}}Pe.equals=B})(U||(U={}))},69323:function(Fr,Ct,Y){"use strict";Y.d(Ct,{B9:function(){return L},F8:function(){return O},JT:function(){return le},Jz:function(){return B},OF:function(){return G},SL:function(){return he},Wf:function(){return M},XK:function(){return J},dk:function(){return ne}});var U=Y(17845),Pe=Y(88226);const We=!1;let Me=null;function ae(V){Me=V}if(We){const V="__is_disposable_tracked__";ae(new class{trackDisposable(H){const ie=new Error("Potentially leaked disposable").stack;setTimeout(()=>{H[V]||console.log(ie)},3e3)}setParent(H,ie){if(H&&H!==le.None)try{H[V]=!0}catch(De){}}markAsDisposed(H){if(H&&H!==le.None)try{H[V]=!0}catch(ie){}}markAsSingleton(H){}})}function E(V){return Me==null||Me.trackDisposable(V),V}function Te(V){Me==null||Me.markAsDisposed(V)}function z(V,H){Me==null||Me.setParent(V,H)}function d(V,H){if(Me)for(const ie of V)Me.setParent(ie,H)}function ne(V){return Me==null||Me.markAsSingleton(V),V}class q extends Error{constructor(H){super(`Encountered errors while disposing of store. Errors: [${H.join(", ")}]`),this.errors=H}}function M(V){return typeof V.dispose=="function"&&V.dispose.length===0}function L(V){if(Pe.$.is(V)){let H=[];for(const ie of V)if(ie)try{ie.dispose()}catch(De){H.push(De)}if(H.length===1)throw H[0];if(H.length>1)throw new q(H);return Array.isArray(V)?[]:V}else if(V)return V.dispose(),V}function O(...V){const H=G(()=>L(V));return d(V,H),H}function G(V){const H=E({dispose:(0,U.I)(()=>{Te(H),V()})});return H}class he{constructor(){this._toDispose=new Set,this._isDisposed=!1,E(this)}dispose(){this._isDisposed||(Te(this),this._isDisposed=!0,this.clear())}clear(){try{L(this._toDispose.values())}finally{this._toDispose.clear()}}add(H){if(!H)return H;if(H===this)throw new Error("Cannot register a disposable on itself!");return z(H,this),this._isDisposed?he.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(H),H}}he.DISABLE_DISPOSED_WARNING=!1;class le{constructor(){this._store=new he,E(this),z(this._store,this)}dispose(){Te(this),this._store.dispose()}_register(H){if(H===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(H)}}le.None=Object.freeze({dispose(){}});class J{constructor(){this._isDisposed=!1,E(this)}get value(){return this._isDisposed?void 0:this._value}set value(H){var ie;this._isDisposed||H===this._value||((ie=this._value)===null||ie===void 0||ie.dispose(),H&&z(H,this),this._value=H)}clear(){this.value=void 0}dispose(){var H;this._isDisposed=!0,Te(this),(H=this._value)===null||H===void 0||H.dispose(),this._value=void 0}clearAndLeak(){const H=this._value;return this._value=void 0,H&&z(H,null),H}}class B{constructor(H){this.object=H}dispose(){}}},34502:function(Fr,Ct,Y){"use strict";Y.d(Ct,{S:function(){return Pe}});class U{constructor(Me){this.element=Me,this.next=U.Undefined,this.prev=U.Undefined}}U.Undefined=new U(void 0);class Pe{constructor(){this._first=U.Undefined,this._last=U.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===U.Undefined}clear(){let Me=this._first;for(;Me!==U.Undefined;){const ae=Me.next;Me.prev=U.Undefined,Me.next=U.Undefined,Me=ae}this._first=U.Undefined,this._last=U.Undefined,this._size=0}unshift(Me){return this._insert(Me,!1)}push(Me){return this._insert(Me,!0)}_insert(Me,ae){const E=new U(Me);if(this._first===U.Undefined)this._first=E,this._last=E;else if(ae){const z=this._last;this._last=E,E.prev=z,z.next=E}else{const z=this._first;this._first=E,E.next=z,z.prev=E}this._size+=1;let Te=!1;return()=>{Te||(Te=!0,this._remove(E))}}shift(){if(this._first!==U.Undefined){const Me=this._first.element;return this._remove(this._first),Me}}pop(){if(this._last!==U.Undefined){const Me=this._last.element;return this._remove(this._last),Me}}_remove(Me){if(Me.prev!==U.Undefined&&Me.next!==U.Undefined){const ae=Me.prev;ae.next=Me.next,Me.next.prev=ae}else Me.prev===U.Undefined&&Me.next===U.Undefined?(this._first=U.Undefined,this._last=U.Undefined):Me.next===U.Undefined?(this._last=this._last.prev,this._last.next=U.Undefined):Me.prev===U.Undefined&&(this._first=this._first.next,this._first.prev=U.Undefined);this._size-=1}*[Symbol.iterator](){let Me=this._first;for(;Me!==U.Undefined;)yield Me.element,Me=Me.next}}},23345:function(Fr,Ct,Y){"use strict";Y.d(Ct,{$L:function(){return De},ED:function(){return B},IJ:function(){return H},OS:function(){return lt},WE:function(){return Se},dz:function(){return V},gn:function(){return $e},li:function(){return G},r:function(){return ye},tY:function(){return ie},xS:function(){return Ye}});var U=Y(97671),Pe;const We="en";let Me=!1,ae=!1,E=!1,Te=!1,z=!1,d=!1,ne=!1,q,M=null,L=null,O;const G=typeof self=="object"?self:typeof Y.g=="object"?Y.g:{};let he;typeof G.vscode!="undefined"&&typeof G.vscode.process!="undefined"?he=G.vscode.process:typeof U!="undefined"&&(he=U);const le=typeof((Pe=he==null?void 0:he.versions)===null||Pe===void 0?void 0:Pe.electron)=="string"&&he.type==="renderer";if(typeof navigator=="object"&&!le)O=navigator.userAgent,Me=O.indexOf("Windows")>=0,ae=O.indexOf("Macintosh")>=0,ne=(O.indexOf("Macintosh")>=0||O.indexOf("iPad")>=0||O.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,E=O.indexOf("Linux")>=0,d=!0,q=navigator.language,M=q;else if(typeof he=="object"){Me=he.platform==="win32",ae=he.platform==="darwin",E=he.platform==="linux",Te=E&&!!he.env.SNAP&&!!he.env.SNAP_REVISION,q=We,M=We;const oe=he.env.VSCODE_NLS_CONFIG;if(oe)try{const me=JSON.parse(oe),ge=me.availableLanguages["*"];q=me.locale,M=ge||We,L=me._translationsConfigFile}catch(me){}z=!0}else console.error("Unable to resolve platform.");let J=0;ae?J=1:Me?J=3:E&&(J=2);const B=Me,V=ae,H=E,ie=z,De=d,$e=ne,Se=O,Ye=function(){if(G.setImmediate)return G.setImmediate.bind(G);if(typeof G.postMessage=="function"&&!G.importScripts){let ge=[];G.addEventListener("message",be=>{if(be.data&&be.data.vscodeSetImmediateId)for(let D=0,R=ge.length;D<R;D++){const se=ge[D];if(se.id===be.data.vscodeSetImmediateId){ge.splice(D,1),se.callback();return}}});let Ee=0;return be=>{const D=++Ee;ge.push({id:D,callback:be}),G.postMessage({vscodeSetImmediateId:D},"*")}}if(typeof(he==null?void 0:he.nextTick)=="function")return he.nextTick.bind(he);const me=Promise.resolve();return ge=>me.then(ge)}(),lt=ae||ne?2:Me?1:3;let Xe=!0,$t=!1;function ye(){if(!$t){$t=!0;const oe=new Uint8Array(2);oe[0]=1,oe[1]=2,Xe=new Uint16Array(oe.buffer)[0]===513}return Xe}},95830:function(Fr,Ct,Y){"use strict";Y.d(Ct,{G:function(){return We}});var U=Y(23345);const Pe=U.li.performance&&typeof U.li.performance.now=="function";class We{constructor(ae){this._highResolution=Pe&&ae,this._startTime=this._now(),this._stopTime=-1}static create(ae=!0){return new We(ae)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?U.li.performance.now():Date.now()}}},82983:function(Fr,Ct,Y){"use strict";Y.d(Ct,{$i:function(){return at},C8:function(){return gt},GF:function(){return q},HO:function(){return Ee},IO:function(){return M},K7:function(){return Ht},Kw:function(){return mr},LC:function(){return G},Mh:function(){return Ye},P1:function(){return lt},PJ:function(){return pi},Qe:function(){return Et},R1:function(){return ne},RP:function(){return se},S6:function(){return Wt},TT:function(){return B},Ut:function(){return D},V8:function(){return he},WU:function(){return We},YK:function(){return $t},YU:function(){return Me},ZG:function(){return Xe},ZH:function(){return oe},ab:function(){return bt},c1:function(){return Qe},df:function(){return De},ec:function(){return ae},fi:function(){return si},fy:function(){return E},j3:function(){return Te},j_:function(){return H},m5:function(){return U},mK:function(){return ie},mr:function(){return L},oH:function(){return Ue},oL:function(){return z},ok:function(){return Se},ow:function(){return le},qq:function(){return $e},qu:function(){return J},rL:function(){return ye},uS:function(){return xr},un:function(){return d},uq:function(){return O},vH:function(){return ge},xe:function(){return He},zY:function(){return V}});function U(fe){return!fe||typeof fe!="string"?!0:fe.trim().length===0}const Pe=/{(\d+)}/g;function We(fe,...ze){return ze.length===0?fe:fe.replace(Pe,function(it,ut){const _t=parseInt(ut,10);return isNaN(_t)||_t<0||_t>=ze.length?it:ze[_t]})}function Me(fe){return fe.replace(/[<>&]/g,function(ze){switch(ze){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return ze}})}function ae(fe){return fe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function E(fe,ze=" "){const it=Te(fe,ze);return z(it,ze)}function Te(fe,ze){if(!fe||!ze)return fe;const it=ze.length;if(it===0||fe.length===0)return fe;let ut=0;for(;fe.indexOf(ze,ut)===ut;)ut=ut+it;return fe.substring(ut)}function z(fe,ze){if(!fe||!ze)return fe;const it=ze.length,ut=fe.length;if(it===0||ut===0)return fe;let _t=ut,Ft=-1;for(;Ft=fe.lastIndexOf(ze,_t-1),!(Ft===-1||Ft+it!==_t);){if(Ft===0)return"";_t=Ft}return fe.substring(0,_t)}function d(fe){return fe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function ne(fe){return fe.replace(/\*/g,"")}function q(fe,ze,it={}){if(!fe)throw new Error("Cannot create regex from empty string");ze||(fe=ae(fe)),it.wholeWord&&(/\B/.test(fe.charAt(0))||(fe="\\b"+fe),/\B/.test(fe.charAt(fe.length-1))||(fe=fe+"\\b"));let ut="";return it.global&&(ut+="g"),it.matchCase||(ut+="i"),it.multiline&&(ut+="m"),it.unicode&&(ut+="u"),new RegExp(fe,ut)}function M(fe){return fe.source==="^"||fe.source==="^$"||fe.source==="$"||fe.source==="^\\s*$"?!1:!!(fe.exec("")&&fe.lastIndex===0)}function L(fe){return(fe.global?"g":"")+(fe.ignoreCase?"i":"")+(fe.multiline?"m":"")+(fe.unicode?"u":"")}function O(fe){return fe.split(/\r\n|\r|\n/)}function G(fe){for(let ze=0,it=fe.length;ze<it;ze++){const ut=fe.charCodeAt(ze);if(ut!==32&&ut!==9)return ze}return-1}function he(fe,ze=0,it=fe.length){for(let ut=ze;ut<it;ut++){const _t=fe.charCodeAt(ut);if(_t!==32&&_t!==9)return fe.substring(ze,ut)}return fe.substring(ze,it)}function le(fe,ze=fe.length-1){for(let it=ze;it>=0;it--){const ut=fe.charCodeAt(it);if(ut!==32&&ut!==9)return it}return-1}function J(fe,ze){return fe<ze?-1:fe>ze?1:0}function B(fe,ze,it=0,ut=fe.length,_t=0,Ft=ze.length){for(;it<ut&&_t<Ft;it++,_t++){let Ve=fe.charCodeAt(it),Bt=ze.charCodeAt(_t);if(Ve<Bt)return-1;if(Ve>Bt)return 1}const nr=ut-it,Pt=Ft-_t;return nr<Pt?-1:nr>Pt?1:0}function V(fe,ze){return H(fe,ze,0,fe.length,0,ze.length)}function H(fe,ze,it=0,ut=fe.length,_t=0,Ft=ze.length){for(;it<ut&&_t<Ft;it++,_t++){let Ve=fe.charCodeAt(it),Bt=ze.charCodeAt(_t);if(Ve===Bt)continue;if(Ve>=128||Bt>=128)return B(fe.toLowerCase(),ze.toLowerCase(),it,ut,_t,Ft);ie(Ve)&&(Ve-=32),ie(Bt)&&(Bt-=32);const gr=Ve-Bt;if(gr!==0)return gr}const nr=ut-it,Pt=Ft-_t;return nr<Pt?-1:nr>Pt?1:0}function ie(fe){return fe>=97&&fe<=122}function De(fe){return fe>=65&&fe<=90}function $e(fe,ze){return fe.length===ze.length&&H(fe,ze)===0}function Se(fe,ze){const it=ze.length;return ze.length>fe.length?!1:H(fe,ze,0,it)===0}function Ye(fe,ze){let it,ut=Math.min(fe.length,ze.length);for(it=0;it<ut;it++)if(fe.charCodeAt(it)!==ze.charCodeAt(it))return it;return ut}function lt(fe,ze){let it,ut=Math.min(fe.length,ze.length);const _t=fe.length-1,Ft=ze.length-1;for(it=0;it<ut;it++)if(fe.charCodeAt(_t-it)!==ze.charCodeAt(Ft-it))return it;return ut}function Xe(fe){return 55296<=fe&&fe<=56319}function $t(fe){return 56320<=fe&&fe<=57343}function ye(fe,ze){return(fe-55296<<10)+(ze-56320)+65536}function oe(fe,ze,it){const ut=fe.charCodeAt(it);if(Xe(ut)&&it+1<ze){const _t=fe.charCodeAt(it+1);if($t(_t))return ye(ut,_t)}return ut}function me(fe,ze){const it=fe.charCodeAt(ze-1);if($t(it)&&ze>1){const ut=fe.charCodeAt(ze-2);if(Xe(ut))return ye(ut,it)}return it}function ge(fe,ze){const it=et.getInstance(),ut=ze,_t=fe.length,Ft=oe(fe,_t,ze);ze+=Ft>=65536?2:1;let nr=it.getGraphemeBreakType(Ft);for(;ze<_t;){const Pt=oe(fe,_t,ze),Ve=it.getGraphemeBreakType(Pt);if(si(nr,Ve))break;ze+=Pt>=65536?2:1,nr=Ve}return ze-ut}function Ee(fe,ze){const it=et.getInstance(),ut=ze,_t=me(fe,ze);ze-=_t>=65536?2:1;let Ft=it.getGraphemeBreakType(_t);for(;ze>0;){const nr=me(fe,ze),Pt=it.getGraphemeBreakType(nr);if(si(Pt,Ft))break;ze-=nr>=65536?2:1,Ft=Pt}return ut-ze}const be=/(?:[\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 D(fe){return be.test(fe)}const R=/(?:[\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 se(fe){return R.test(fe)}const Ie=/^[\t\n\r\x20-\x7E]*$/;function at(fe){return Ie.test(fe)}const Et=/[\u2028\u2029]/;function bt(fe){return Et.test(fe)}function He(fe){for(let ze=0,it=fe.length;ze<it;ze++)if(Ht(fe.charCodeAt(ze)))return!0;return!1}function Ht(fe){return fe=+fe,fe>=11904&&fe<=55215||fe>=63744&&fe<=64255||fe>=65281&&fe<=65374}function gt(fe){return fe>=127462&&fe<=127487||fe===8986||fe===8987||fe===9200||fe===9203||fe>=9728&&fe<=10175||fe===11088||fe===11093||fe>=127744&&fe<=128591||fe>=128640&&fe<=128764||fe>=128992&&fe<=129003||fe>=129280&&fe<=129535||fe>=129648&&fe<=129750}const Qe="\uFEFF";function xr(fe){return!!(fe&&fe.length>0&&fe.charCodeAt(0)===65279)}function mr(fe,ze=!1){return fe?(ze&&(fe=fe.replace(/\\./g,"")),fe.toLowerCase()!==fe):!1}function pi(fe){return fe=fe%(2*26),fe<26?String.fromCharCode(97+fe):String.fromCharCode(65+fe-26)}function Wt(fe){return et.getInstance().getGraphemeBreakType(fe)}function si(fe,ze){return fe===0?ze!==5&&ze!==7:fe===2&&ze===3?!1:fe===4||fe===2||fe===3||ze===4||ze===2||ze===3?!0:!(fe===8&&(ze===8||ze===9||ze===11||ze===12)||(fe===11||fe===9)&&(ze===9||ze===10)||(fe===12||fe===10)&&ze===10||ze===5||ze===13||ze===7||fe===1||fe===13&&ze===14||fe===6&&ze===6)}class et{constructor(){this._data=ct()}static getInstance(){return et._INSTANCE||(et._INSTANCE=new et),et._INSTANCE}getGraphemeBreakType(ze){if(ze<32)return ze===10?3:ze===13?2:4;if(ze<127)return 0;const it=this._data,ut=it.length/3;let _t=1;for(;_t<=ut;)if(ze<it[3*_t])_t=2*_t;else if(ze>it[3*_t+1])_t=2*_t+1;else return it[3*_t+2];return 0}}et._INSTANCE=null;function ct(){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 Ue(fe,ze){if(fe===0)return 0;const it=wt(fe,ze);if(it!==void 0)return it;const ut=me(ze,fe);return fe-=Rt(ut),fe}function wt(fe,ze){let it=me(ze,fe);for(fe-=Rt(it);Dt(it)||it===65039||it===8419;){if(fe===0)return;it=me(ze,fe),fe-=Rt(it)}if(gt(it)){if(fe>=0){const ut=me(ze,fe);ut===8205&&(fe-=Rt(ut))}return fe}}function Rt(fe){return fe>=65536?2:1}function Dt(fe){return 127995<=fe&&fe<=127999}},72999:function(Fr,Ct,Y){"use strict";Y.d(Ct,{$E:function(){return G},$K:function(){return Te},D8:function(){return M},HD:function(){return Pe},IU:function(){return he},Jp:function(){return z},Kn:function(){return We},cW:function(){return ne},f6:function(){return le},hj:function(){return Me},jn:function(){return ae},kJ:function(){return U},mf:function(){return q},o8:function(){return E},p_:function(){return d},vE:function(){return J}});function U(B){return Array.isArray(B)}function Pe(B){return typeof B=="string"}function We(B){return typeof B=="object"&&B!==null&&!Array.isArray(B)&&!(B instanceof RegExp)&&!(B instanceof Date)}function Me(B){return typeof B=="number"&&!isNaN(B)}function ae(B){return B===!0||B===!1}function E(B){return typeof B=="undefined"}function Te(B){return!z(B)}function z(B){return E(B)||B===null}function d(B,V){if(!B)throw new Error(V?`Unexpected type, expected '${V}'`:"Unexpected type")}function ne(B){if(z(B))throw new Error("Assertion Failed: argument is undefined or null");return B}function q(B){return typeof B=="function"}function M(B,V){const H=Math.min(B.length,V.length);for(let ie=0;ie<H;ie++)L(B[ie],V[ie])}function L(B,V){if(Pe(V)){if(typeof B!==V)throw new Error(`argument does not match constraint: typeof ${V}`)}else if(q(V)){try{if(B instanceof V)return}catch(H){}if(!z(B)&&B.constructor===V||V.length===1&&V.call(void 0,B)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function O(B){let V=[],H=Object.getPrototypeOf(B);for(;Object.prototype!==H;)V=V.concat(Object.getOwnPropertyNames(H)),H=Object.getPrototypeOf(H);return V}function G(B){const V=[];for(const H of O(B))typeof B[H]=="function"&&V.push(H);return V}function he(B,V){const H=De=>function(){const $e=Array.prototype.slice.call(arguments,0);return V(De,$e)};let ie={};for(const De of B)ie[De]=H(De);return ie}function le(B){return B===null?void 0:B}function J(B,V="Unreachable"){throw new Error(V)}},13268:function(Fr,Ct,Y){"use strict";Y.d(Ct,{N:function(){return Pe}});function U(We,Me){let ae;return Me.length===0?ae=We:ae=We.replace(/\{(\d+)\}/g,function(E,Te){const z=Te[0];return typeof Me[z]!="undefined"?Me[z]:E}),ae}function Pe(We,Me,...ae){return U(Me,ae)}},96236:function(Fr,Ct,Y){"use strict";Y.d(Ct,{BH:function(){return he},NZ:function(){return le},U8:function(){return J},co:function(){return G},eH:function(){return O},vr:function(){return L}});var U=Y(75918),Pe=Y(52615),We=Y(4348),Me=Y(88226),ae=Y(69323),E=Y(34502),Te=Y(35884),z=Y(90689),d=Y(16925),ne=Y(49055),q=function(B,V,H,ie){var De=arguments.length,$e=De<3?V:ie===null?ie=Object.getOwnPropertyDescriptor(V,H):ie,Se;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$e=Reflect.decorate(B,V,H,ie);else for(var Ye=B.length-1;Ye>=0;Ye--)(Se=B[Ye])&&($e=(De<3?Se($e):De>3?Se(V,H,$e):Se(V,H))||$e);return De>3&&$e&&Object.defineProperty(V,H,$e),$e},M=function(B,V){return function(H,ie){V(H,ie,B)}};function L(B){return B.command!==void 0}class O{constructor(V){this.id=O._idPool++,this._debugName=V}}O._idPool=0,O.CommandPalette=new O("CommandPalette"),O.EditorContext=new O("EditorContext"),O.SimpleEditorContext=new O("SimpleEditorContext"),O.EditorContextCopy=new O("EditorContextCopy"),O.EditorContextPeek=new O("EditorContextPeek"),O.MenubarEditMenu=new O("MenubarEditMenu"),O.MenubarCopy=new O("MenubarCopy"),O.MenubarGoMenu=new O("MenubarGoMenu"),O.MenubarSelectionMenu=new O("MenubarSelectionMenu"),O.InlineCompletionsActions=new O("InlineCompletionsActions");const G=(0,d.yh)("menuService"),he=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new We.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:B=>B===O.CommandPalette}}addCommand(B){return this.addCommands(Me.$.single(B))}addCommands(B){for(const V of B)this._commands.set(V.id,V);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,ae.OF)(()=>{let V=!1;for(const H of B)V=this._commands.delete(H.id)||V;V&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(B){return this._commands.get(B)}getCommands(){const B=new Map;return this._commands.forEach((V,H)=>B.set(H,V)),B}appendMenuItem(B,V){return this.appendMenuItems(Me.$.single({id:B,item:V}))}appendMenuItems(B){const V=new Set,H=new E.S;for(const{id:ie,item:De}of B){let $e=this._menuItems.get(ie);$e||($e=new E.S,this._menuItems.set(ie,$e)),H.push($e.push(De)),V.add(ie)}return this._onDidChangeMenu.fire(V),(0,ae.OF)(()=>{if(H.size>0){for(let ie of H)ie();this._onDidChangeMenu.fire(V),H.clear()}})}getMenuItems(B){let V;return this._menuItems.has(B)?V=[...this._menuItems.get(B)]:V=[],B===O.CommandPalette&&this._appendImplicitItems(V),V}_appendImplicitItems(B){const V=new Set;for(const H of B)L(H)&&(V.add(H.command.id),H.alt&&V.add(H.alt.id));this._commands.forEach((H,ie)=>{V.has(ie)||B.push({command:H})})}};class le extends U.wY{constructor(V,H,ie,De){super(`submenuitem.${V.submenu.id}`,typeof V.title=="string"?V.title:V.title.value,[],"submenu"),this.item=V,this._menuService=H,this._contextKeyService=ie,this._options=De}get actions(){const V=[],H=this._menuService.createMenu(this.item.submenu,this._contextKeyService),ie=H.getActions(this._options);H.dispose();for(const[,De]of ie)De.length>0&&(V.push(...De),V.push(new U.Z0));return V.length&&V.pop(),V}}let J=class Up{constructor(V,H,ie,De,$e){var Se,Ye;if(this._commandService=$e,this.id=V.id,this.label=ie!=null&&ie.renderShortTitle&&V.shortTitle?typeof V.shortTitle=="string"?V.shortTitle:V.shortTitle.value:typeof V.title=="string"?V.title:V.title.value,this.tooltip=(Ye=typeof V.tooltip=="string"?V.tooltip:(Se=V.tooltip)===null||Se===void 0?void 0:Se.value)!==null&&Ye!==void 0?Ye:"",this.enabled=!V.precondition||De.contextMatchesRules(V.precondition),this.checked=void 0,V.toggled){const lt=V.toggled.condition?V.toggled:{condition:V.toggled};this.checked=De.contextMatchesRules(lt.condition),this.checked&&lt.tooltip&&(this.tooltip=typeof lt.tooltip=="string"?lt.tooltip:lt.tooltip.value),lt.title&&(this.label=typeof lt.title=="string"?lt.title:lt.title.value)}this.item=V,this.alt=H?new Up(H,void 0,ie,De,$e):void 0,this._options=ie,ne.kS.isThemeIcon(V.icon)&&(this.class=Pe.dT.asClassName(V.icon))}dispose(){}run(...V){var H,ie;let De=[];return!((H=this._options)===null||H===void 0)&&H.arg&&(De=[...De,this._options.arg]),!((ie=this._options)===null||ie===void 0)&&ie.shouldForwardArgs&&(De=[...De,...V]),this._commandService.executeCommand(this.id,...De)}};J=q([M(3,z.i6),M(4,Te.H)],J)},35884:function(Fr,Ct,Y){"use strict";Y.d(Ct,{H:function(){return Te},P:function(){return z}});var U=Y(4348),Pe=Y(88226),We=Y(69323),Me=Y(34502),ae=Y(72999),E=Y(16925);const Te=(0,E.yh)("commandService"),z=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new U.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(d,ne){if(!d)throw new Error("invalid command");if(typeof d=="string"){if(!ne)throw new Error("invalid command");return this.registerCommand({id:d,handler:ne})}if(d.description){const G=[];for(let le of d.description.args)G.push(le.constraint);const he=d.handler;d.handler=function(le,...J){return(0,ae.D8)(J,G),he(le,...J)}}const{id:q}=d;let M=this._commands.get(q);M||(M=new Me.S,this._commands.set(q,M));let L=M.unshift(d),O=(0,We.OF)(()=>{L();const G=this._commands.get(q);G!=null&&G.isEmpty()&&this._commands.delete(q)});return this._onDidRegisterCommand.fire(q),O}registerCommandAlias(d,ne){return z.registerCommand(d,(q,...M)=>q.get(Te).executeCommand(ne,...M))}getCommand(d){const ne=this._commands.get(d);if(!(!ne||ne.isEmpty()))return Pe.$.first(ne)}getCommands(){const d=new Map;for(const ne of this._commands.keys()){const q=this.getCommand(ne);q&&d.set(ne,q)}return d}};z.registerCommand("noop",()=>{})},90689:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Ao:function(){return Te},Eq:function(){return ye},Fb:function(){return z},K8:function(){return ge},i6:function(){return $t},uy:function(){return Xe}});var U=Y(23345),Pe=Y(82983),We=Y(16925);let Me=U.WE||"";const ae=new Map;ae.set("false",!1),ae.set("true",!0),ae.set("isMac",U.dz),ae.set("isLinux",U.IJ),ae.set("isWindows",U.ED),ae.set("isWeb",U.$L),ae.set("isMacNative",U.dz&&!U.$L),ae.set("isEdge",Me.indexOf("Edg/")>=0),ae.set("isFirefox",Me.indexOf("Firefox")>=0),ae.set("isChrome",Me.indexOf("Chrome")>=0),ae.set("isSafari",Me.indexOf("Safari")>=0);const E=Object.prototype.hasOwnProperty;class Te{static has(D){return M.create(D)}static equals(D,R){return L.create(D,R)}static regex(D,R){return De.create(D,R)}static not(D){return le.create(D)}static and(...D){return Ye.create(D,null)}static or(...D){return lt.create(D,null,!0)}static deserialize(D,R=!1){if(D)return this._deserializeOrExpression(D,R)}static _deserializeOrExpression(D,R){let se=D.split("||");return lt.create(se.map(Ie=>this._deserializeAndExpression(Ie,R)),null,!0)}static _deserializeAndExpression(D,R){let se=D.split("&&");return Ye.create(se.map(Ie=>this._deserializeOne(Ie,R)),null)}static _deserializeOne(D,R){if(D=D.trim(),D.indexOf("!=")>=0){let se=D.split("!=");return he.create(se[0].trim(),this._deserializeValue(se[1],R))}if(D.indexOf("==")>=0){let se=D.split("==");return L.create(se[0].trim(),this._deserializeValue(se[1],R))}if(D.indexOf("=~")>=0){let se=D.split("=~");return De.create(se[0].trim(),this._deserializeRegexValue(se[1],R))}if(D.indexOf(" in ")>=0){let se=D.split(" in ");return O.create(se[0].trim(),se[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(D)){const se=D.split(">=");return V.create(se[0].trim(),se[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(D)){const se=D.split(">");return B.create(se[0].trim(),se[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(D)){const se=D.split("<=");return ie.create(se[0].trim(),se[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(D)){const se=D.split("<");return H.create(se[0].trim(),se[1].trim())}return/^\!\s*/.test(D)?le.create(D.substr(1).trim()):M.create(D)}static _deserializeValue(D,R){if(D=D.trim(),D==="true")return!0;if(D==="false")return!1;let se=/^'([^']*)'$/.exec(D);return se?se[1].trim():D}static _deserializeRegexValue(D,R){if((0,Pe.m5)(D)){if(R)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let se=D.indexOf("/"),Ie=D.lastIndexOf("/");if(se===Ie||se<0){if(R)throw new Error(`bad regexp-value '${D}', missing /-enclosure`);return console.warn(`bad regexp-value '${D}', missing /-enclosure`),null}let at=D.slice(se+1,Ie),Et=D[Ie+1]==="i"?"i":"";try{return new RegExp(at,Et)}catch(bt){if(R)throw new Error(`bad regexp-value '${D}', parse error: ${bt}`);return console.warn(`bad regexp-value '${D}', parse error: ${bt}`),null}}}function z(be,D){const R=be?be.substituteConstants():void 0,se=D?D.substituteConstants():void 0;return!R&&!se?!0:!R||!se?!1:R.equals(se)}function d(be,D){return be.cmp(D)}class ne{constructor(){this.type=0}cmp(D){return this.type-D.type}equals(D){return D.type===this.type}substituteConstants(){return this}evaluate(D){return!1}serialize(){return"false"}keys(){return[]}negate(){return q.INSTANCE}}ne.INSTANCE=new ne;class q{constructor(){this.type=1}cmp(D){return this.type-D.type}equals(D){return D.type===this.type}substituteConstants(){return this}evaluate(D){return!0}serialize(){return"true"}keys(){return[]}negate(){return ne.INSTANCE}}q.INSTANCE=new q;class M{constructor(D,R){this.key=D,this.negated=R,this.type=2}static create(D,R=null){const se=ae.get(D);return typeof se=="boolean"?se?q.INSTANCE:ne.INSTANCE:new M(D,R)}cmp(D){return D.type!==this.type?this.type-D.type:oe(this.key,D.key)}equals(D){return D.type===this.type?this.key===D.key:!1}substituteConstants(){const D=ae.get(this.key);return typeof D=="boolean"?D?q.INSTANCE:ne.INSTANCE:this}evaluate(D){return!!D.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=le.create(this.key,this)),this.negated}}class L{constructor(D,R,se){this.key=D,this.value=R,this.negated=se,this.type=4}static create(D,R,se=null){if(typeof R=="boolean")return R?M.create(D,se):le.create(D,se);const Ie=ae.get(D);return typeof Ie=="boolean"?R===(Ie?"true":"false")?q.INSTANCE:ne.INSTANCE:new L(D,R,se)}cmp(D){return D.type!==this.type?this.type-D.type:me(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){const D=ae.get(this.key);if(typeof D=="boolean"){const R=D?"true":"false";return this.value===R?q.INSTANCE:ne.INSTANCE}return this}evaluate(D){return D.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=he.create(this.key,this.value,this)),this.negated}}class O{constructor(D,R){this.key=D,this.valueKey=R,this.type=10,this.negated=null}static create(D,R){return new O(D,R)}cmp(D){return D.type!==this.type?this.type-D.type:me(this.key,this.valueKey,D.key,D.valueKey)}equals(D){return D.type===this.type?this.key===D.key&&this.valueKey===D.valueKey:!1}substituteConstants(){return this}evaluate(D){const R=D.getValue(this.valueKey),se=D.getValue(this.key);return Array.isArray(R)?R.indexOf(se)>=0:typeof se=="string"&&typeof R=="object"&&R!==null?E.call(R,se):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=G.create(this)),this.negated}}class G{constructor(D){this._actual=D,this.type=11}static create(D){return new G(D)}cmp(D){return D.type!==this.type?this.type-D.type:this._actual.cmp(D._actual)}equals(D){return D.type===this.type?this._actual.equals(D._actual):!1}substituteConstants(){return this}evaluate(D){return!this._actual.evaluate(D)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class he{constructor(D,R,se){this.key=D,this.value=R,this.negated=se,this.type=5}static create(D,R,se=null){if(typeof R=="boolean")return R?le.create(D,se):M.create(D,se);const Ie=ae.get(D);return typeof Ie=="boolean"?R===(Ie?"true":"false")?ne.INSTANCE:q.INSTANCE:new he(D,R,se)}cmp(D){return D.type!==this.type?this.type-D.type:me(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){const D=ae.get(this.key);if(typeof D=="boolean"){const R=D?"true":"false";return this.value===R?ne.INSTANCE:q.INSTANCE}return this}evaluate(D){return D.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this.key,this.value,this)),this.negated}}class le{constructor(D,R){this.key=D,this.negated=R,this.type=3}static create(D,R=null){const se=ae.get(D);return typeof se=="boolean"?se?ne.INSTANCE:q.INSTANCE:new le(D,R)}cmp(D){return D.type!==this.type?this.type-D.type:oe(this.key,D.key)}equals(D){return D.type===this.type?this.key===D.key:!1}substituteConstants(){const D=ae.get(this.key);return typeof D=="boolean"?D?ne.INSTANCE:q.INSTANCE:this}evaluate(D){return!D.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=M.create(this.key,this)),this.negated}}function J(be,D){if(typeof be=="string"){const R=parseFloat(be);isNaN(R)||(be=R)}return typeof be=="string"||typeof be=="number"?D(be):ne.INSTANCE}class B{constructor(D,R,se){this.key=D,this.value=R,this.negated=se,this.type=12}static create(D,R,se=null){return J(R,Ie=>new B(D,Ie,se))}cmp(D){return D.type!==this.type?this.type-D.type:me(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){return this}evaluate(D){return typeof this.value=="string"?!1:parseFloat(D.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ie.create(this.key,this.value,this)),this.negated}}class V{constructor(D,R,se){this.key=D,this.value=R,this.negated=se,this.type=13}static create(D,R,se=null){return J(R,Ie=>new V(D,Ie,se))}cmp(D){return D.type!==this.type?this.type-D.type:me(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){return this}evaluate(D){return typeof this.value=="string"?!1:parseFloat(D.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=H.create(this.key,this.value,this)),this.negated}}class H{constructor(D,R,se){this.key=D,this.value=R,this.negated=se,this.type=14}static create(D,R,se=null){return J(R,Ie=>new H(D,Ie,se))}cmp(D){return D.type!==this.type?this.type-D.type:me(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){return this}evaluate(D){return typeof this.value=="string"?!1:parseFloat(D.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=V.create(this.key,this.value,this)),this.negated}}class ie{constructor(D,R,se){this.key=D,this.value=R,this.negated=se,this.type=15}static create(D,R,se=null){return J(R,Ie=>new ie(D,Ie,se))}cmp(D){return D.type!==this.type?this.type-D.type:me(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){return this}evaluate(D){return typeof this.value=="string"?!1:parseFloat(D.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 De{constructor(D,R){this.key=D,this.regexp=R,this.type=7,this.negated=null}static create(D,R){return new De(D,R)}cmp(D){if(D.type!==this.type)return this.type-D.type;if(this.key<D.key)return-1;if(this.key>D.key)return 1;const R=this.regexp?this.regexp.source:"",se=D.regexp?D.regexp.source:"";return R<se?-1:R>se?1:0}equals(D){if(D.type===this.type){const R=this.regexp?this.regexp.source:"",se=D.regexp?D.regexp.source:"";return this.key===D.key&&R===se}return!1}substituteConstants(){return this}evaluate(D){let R=D.getValue(this.key);return this.regexp?this.regexp.test(R):!1}serialize(){const D=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${D}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=$e.create(this)),this.negated}}class $e{constructor(D){this._actual=D,this.type=8}static create(D){return new $e(D)}cmp(D){return D.type!==this.type?this.type-D.type:this._actual.cmp(D._actual)}equals(D){return D.type===this.type?this._actual.equals(D._actual):!1}substituteConstants(){return this}evaluate(D){return!this._actual.evaluate(D)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function Se(be){let D=null;for(let R=0,se=be.length;R<se;R++){const Ie=be[R].substituteConstants();if(be[R]!==Ie&&D===null){D=[];for(let at=0;at<R;at++)D[at]=be[at]}D!==null&&(D[R]=Ie)}return D===null?be:D}class Ye{constructor(D,R){this.expr=D,this.negated=R,this.type=6}static create(D,R){return Ye._normalizeArr(D,R)}cmp(D){if(D.type!==this.type)return this.type-D.type;if(this.expr.length<D.expr.length)return-1;if(this.expr.length>D.expr.length)return 1;for(let R=0,se=this.expr.length;R<se;R++){const Ie=d(this.expr[R],D.expr[R]);if(Ie!==0)return Ie}return 0}equals(D){if(D.type===this.type){if(this.expr.length!==D.expr.length)return!1;for(let R=0,se=this.expr.length;R<se;R++)if(!this.expr[R].equals(D.expr[R]))return!1;return!0}return!1}substituteConstants(){const D=Se(this.expr);return D===this.expr?this:Ye.create(D,this.negated)}evaluate(D){for(let R=0,se=this.expr.length;R<se;R++)if(!this.expr[R].evaluate(D))return!1;return!0}static _normalizeArr(D,R){const se=[];let Ie=!1;for(const at of D)if(at){if(at.type===1){Ie=!0;continue}if(at.type===0)return ne.INSTANCE;if(at.type===6){se.push(...at.expr);continue}se.push(at)}if(se.length===0&&Ie)return q.INSTANCE;if(se.length!==0){if(se.length===1)return se[0];se.sort(d);for(let at=1;at<se.length;at++)se[at-1].equals(se[at])&&(se.splice(at,1),at--);if(se.length===1)return se[0];for(;se.length>1;){const at=se[se.length-1];if(at.type!==9)break;se.pop();const Et=se.pop(),bt=se.length===0,He=lt.create(at.expr.map(Ht=>Ye.create([Ht,Et],null)),null,bt);He&&(se.push(He),se.sort(d))}return se.length===1?se[0]:new Ye(se,R)}}serialize(){return this.expr.map(D=>D.serialize()).join(" && ")}keys(){const D=[];for(let R of this.expr)D.push(...R.keys());return D}negate(){if(!this.negated){const D=[];for(let R of this.expr)D.push(R.negate());this.negated=lt.create(D,this,!0)}return this.negated}}class lt{constructor(D,R){this.expr=D,this.negated=R,this.type=9}static create(D,R,se){return lt._normalizeArr(D,R,se)}cmp(D){if(D.type!==this.type)return this.type-D.type;if(this.expr.length<D.expr.length)return-1;if(this.expr.length>D.expr.length)return 1;for(let R=0,se=this.expr.length;R<se;R++){const Ie=d(this.expr[R],D.expr[R]);if(Ie!==0)return Ie}return 0}equals(D){if(D.type===this.type){if(this.expr.length!==D.expr.length)return!1;for(let R=0,se=this.expr.length;R<se;R++)if(!this.expr[R].equals(D.expr[R]))return!1;return!0}return!1}substituteConstants(){const D=Se(this.expr);return D===this.expr?this:lt.create(D,this.negated,!1)}evaluate(D){for(let R=0,se=this.expr.length;R<se;R++)if(this.expr[R].evaluate(D))return!0;return!1}static _normalizeArr(D,R,se){let Ie=[],at=!1;if(D){for(let Et=0,bt=D.length;Et<bt;Et++){const He=D[Et];if(He){if(He.type===0){at=!0;continue}if(He.type===1)return q.INSTANCE;if(He.type===9){Ie=Ie.concat(He.expr);continue}Ie.push(He)}}if(Ie.length===0&&at)return ne.INSTANCE;Ie.sort(d)}if(Ie.length!==0){if(Ie.length===1)return Ie[0];for(let Et=1;Et<Ie.length;Et++)Ie[Et-1].equals(Ie[Et])&&(Ie.splice(Et,1),Et--);if(Ie.length===1)return Ie[0];if(se){for(let Et=0;Et<Ie.length;Et++)for(let bt=Et+1;bt<Ie.length;bt++)ge(Ie[Et],Ie[bt])&&(Ie.splice(bt,1),bt--);if(Ie.length===1)return Ie[0]}return new lt(Ie,R)}}serialize(){return this.expr.map(D=>D.serialize()).join(" || ")}keys(){const D=[];for(let R of this.expr)D.push(...R.keys());return D}negate(){if(!this.negated){let D=[];for(let R of this.expr)D.push(R.negate());for(;D.length>1;){const R=D.shift(),se=D.shift(),Ie=[];for(const Et of Ee(R))for(const bt of Ee(se))Ie.push(Ye.create([Et,bt],null));const at=D.length===0;D.unshift(lt.create(Ie,null,at))}this.negated=D[0]}return this.negated}}class Xe extends M{constructor(D,R,se){super(D,null),this._defaultValue=R,typeof se=="object"?Xe._info.push(Object.assign(Object.assign({},se),{key:D})):se!==!0&&Xe._info.push({key:D,description:se,type:R!=null?typeof R:void 0})}static all(){return Xe._info.values()}bindTo(D){return D.createKey(this.key,this._defaultValue)}getValue(D){return D.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(D){return L.create(this.key,D)}}Xe._info=[];const $t=(0,We.yh)("contextKeyService"),ye="setContext";function oe(be,D){return be<D?-1:be>D?1:0}function me(be,D,R,se){return be<R?-1:be>R?1:D<se?-1:D>se?1:0}function ge(be,D){if(D.type===6&&be.type!==9&&be.type!==6){for(const Ie of D.expr)if(be.equals(Ie))return!0}const R=be.negate(),se=Ee(R).concat(Ee(D));se.sort(d);for(let Ie=0;Ie<se.length;Ie++){const Et=se[Ie].negate();for(let bt=Ie+1;bt<se.length;bt++){const He=se[bt];if(Et.equals(He))return!0}}return!1}function Ee(be){return be.type===9?be.expr:[be]}},16925:function(Fr,Ct,Y){"use strict";Y.d(Ct,{I8:function(){return U},TG:function(){return Pe},jt:function(){return ae},yh:function(){return Me}});var U;(function(E){E.serviceIds=new Map,E.DI_TARGET="$di$target",E.DI_DEPENDENCIES="$di$dependencies";function Te(z){return z[E.DI_DEPENDENCIES]||[]}E.getServiceDependencies=Te})(U||(U={}));const Pe=Me("instantiationService");function We(E,Te,z,d){Te[U.DI_TARGET]===Te?Te[U.DI_DEPENDENCIES].push({id:E,index:z,optional:d}):(Te[U.DI_DEPENDENCIES]=[{id:E,index:z,optional:d}],Te[U.DI_TARGET]=Te)}function Me(E){if(U.serviceIds.has(E))return U.serviceIds.get(E);const Te=function(z,d,ne){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");We(Te,z,ne,!1)};return Te.toString=()=>E,U.serviceIds.set(E,Te),Te}function ae(E){return function(Te,z,d){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");We(E,Te,d,!0)}}},44650:function(Fr,Ct,Y){"use strict";Y.d(Ct,{B:function(){return Me}});var U=Y(76068),Pe=Y(72999);class We{constructor(){this.data=new Map}add(E,Te){U.ok(Pe.HD(E)),U.ok(Pe.Kn(Te)),U.ok(!this.data.has(E),"There is already an extension with this id"),this.data.set(E,Te)}as(E){return this.data.get(E)||null}}const Me=new We},66213:function(Fr,Ct,Y){"use strict";Y.d(Ct,{e:function(){return U}});var U;(function(Pe){Pe.DARK="dark",Pe.LIGHT="light",Pe.HIGH_CONTRAST="hc"})(U||(U={}))},49055:function(Fr,Ct,Y){"use strict";Y.d(Ct,{EN:function(){return d},IP:function(){return M},Ic:function(){return G},XE:function(){return Te},bB:function(){return he},kS:function(){return ne},m6:function(){return q}});var U=Y(52615),Pe=Y(4348),We=Y(69323),Me=Y(16925),ae=Y(44650),E=Y(66213);const Te=(0,Me.yh)("themeService");var z;(function(le){function J(B){return B&&typeof B=="object"&&typeof B.id=="string"}le.isThemeColor=J})(z||(z={}));function d(le){return{id:le}}var ne;(function(le){function J($e){return $e&&typeof $e=="object"&&typeof $e.id=="string"&&(typeof $e.color=="undefined"||z.isThemeColor($e.color))}le.isThemeIcon=J;const B=new RegExp(`^\\$\\((${U.dT.iconNameExpression}(?:${U.dT.iconModifierExpression})?)\\)$`);function V($e){const Se=B.exec($e);if(!Se)return;let[,Ye]=Se;return{id:Ye}}le.fromString=V;function H($e,Se){let Ye=$e.id;const lt=Ye.lastIndexOf("~");return lt!==-1&&(Ye=Ye.substring(0,lt)),Se&&(Ye=`${Ye}~${Se}`),{id:Ye}}le.modify=H;function ie($e,Se){var Ye,lt;return $e.id===Se.id&&((Ye=$e.color)===null||Ye===void 0?void 0:Ye.id)===((lt=Se.color)===null||lt===void 0?void 0:lt.id)}le.isEqual=ie;function De($e,Se){return{id:$e.id,color:Se?d(Se):void 0}}le.asThemeIcon=De,le.asClassNameArray=U.dT.asClassNameArray,le.asClassName=U.dT.asClassName,le.asCSSSelector=U.dT.asCSSSelector})(ne||(ne={}));function q(le){switch(le){case E.e.DARK:return"vs-dark";case E.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const M={ThemingContribution:"base.contributions.theming"};class L{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Pe.Q5}onColorThemeChange(J){return this.themingParticipants.push(J),this.onThemingParticipantAddedEmitter.fire(J),(0,We.OF)(()=>{const B=this.themingParticipants.indexOf(J);this.themingParticipants.splice(B,1)})}getThemingParticipants(){return this.themingParticipants}}let O=new L;ae.B.add(M.ThemingContribution,O);function G(le){return O.onColorThemeChange(le)}class he extends We.JT{constructor(J){super(),this.themeService=J,this.theme=J.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(B=>this.onThemeChange(B)))}onThemeChange(J){this.theme=J,this.updateStyles()}updateStyles(){}}},16632:function(Fr,Ct,Y){"use strict";var U=Y(60499),Pe=Y(85899),We=Y(18642),Me=Y(72190),ae=Y(42244),E=Y(92310),Te=Y.n(E),z=Y(18929),d=Y(59301),ne=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],q=(0,d.forwardRef)(function(M,L){var O=M.prefixCls,G=O===void 0?"rc-checkbox":O,he=M.className,le=M.style,J=M.checked,B=M.disabled,V=M.defaultChecked,H=V===void 0?!1:V,ie=M.type,De=ie===void 0?"checkbox":ie,$e=M.title,Se=M.onChange,Ye=(0,ae.Z)(M,ne),lt=(0,d.useRef)(null),Xe=(0,d.useRef)(null),$t=(0,z.Z)(H,{value:J}),ye=(0,Me.Z)($t,2),oe=ye[0],me=ye[1];(0,d.useImperativeHandle)(L,function(){return{focus:function(D){var R;(R=lt.current)===null||R===void 0||R.focus(D)},blur:function(){var D;(D=lt.current)===null||D===void 0||D.blur()},input:lt.current,nativeElement:Xe.current}});var ge=Te()(G,he,(0,We.Z)((0,We.Z)({},"".concat(G,"-checked"),oe),"".concat(G,"-disabled"),B)),Ee=function(D){B||("checked"in M||me(D.target.checked),Se==null||Se({target:(0,Pe.Z)((0,Pe.Z)({},M),{},{type:De,checked:D.target.checked}),stopPropagation:function(){D.stopPropagation()},preventDefault:function(){D.preventDefault()},nativeEvent:D.nativeEvent}))};return d.createElement("span",{className:ge,title:$e,style:le,ref:Xe},d.createElement("input",(0,U.Z)({},Ye,{className:"".concat(G,"-input"),ref:lt,onChange:Ee,disabled:B,checked:!!oe,type:De})),d.createElement("span",{className:"".concat(G,"-inner")}))});Ct.Z=q},96478:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return $e}});var U=Y(60499),Pe=Y(18642),We=Y(72190),Me=Y(42244),ae=Y(68196),E=Y(92310),Te=Y.n(E),z=Y(8654),d=Y(59301),ne=Y(10228),q=Y(16089),M=ne.Z.ESC,L=ne.Z.TAB;function O(Se){var Ye=Se.visible,lt=Se.triggerRef,Xe=Se.onVisibleChange,$t=Se.autoFocus,ye=Se.overlayRef,oe=d.useRef(!1),me=function(){if(Ye){var D,R;(D=lt.current)===null||D===void 0||(R=D.focus)===null||R===void 0||R.call(D),Xe==null||Xe(!1)}},ge=function(){var D;return(D=ye.current)!==null&&D!==void 0&&D.focus?(ye.current.focus(),oe.current=!0,!0):!1},Ee=function(D){switch(D.keyCode){case M:me();break;case L:{var R=!1;oe.current||(R=ge()),R?D.preventDefault():me();break}}};d.useEffect(function(){return Ye?(window.addEventListener("keydown",Ee),$t&&(0,q.Z)(ge,3),function(){window.removeEventListener("keydown",Ee),oe.current=!1}):function(){oe.current=!1}},[Ye])}var G=(0,d.forwardRef)(function(Se,Ye){var lt=Se.overlay,Xe=Se.arrow,$t=Se.prefixCls,ye=(0,d.useMemo)(function(){var me;return typeof lt=="function"?me=lt():me=lt,me},[lt]),oe=(0,z.sQ)(Ye,(0,z.C4)(ye));return d.createElement(d.Fragment,null,Xe&&d.createElement("div",{className:"".concat($t,"-arrow")}),d.cloneElement(ye,{ref:(0,z.Yr)(ye)?oe:void 0}))}),he=G,le={adjustX:1,adjustY:1},J=[0,0],B={topLeft:{points:["bl","tl"],overflow:le,offset:[0,-4],targetOffset:J},top:{points:["bc","tc"],overflow:le,offset:[0,-4],targetOffset:J},topRight:{points:["br","tr"],overflow:le,offset:[0,-4],targetOffset:J},bottomLeft:{points:["tl","bl"],overflow:le,offset:[0,4],targetOffset:J},bottom:{points:["tc","bc"],overflow:le,offset:[0,4],targetOffset:J},bottomRight:{points:["tr","br"],overflow:le,offset:[0,4],targetOffset:J}},V=B,H=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function ie(Se,Ye){var lt,Xe=Se.arrow,$t=Xe===void 0?!1:Xe,ye=Se.prefixCls,oe=ye===void 0?"rc-dropdown":ye,me=Se.transitionName,ge=Se.animation,Ee=Se.align,be=Se.placement,D=be===void 0?"bottomLeft":be,R=Se.placements,se=R===void 0?V:R,Ie=Se.getPopupContainer,at=Se.showAction,Et=Se.hideAction,bt=Se.overlayClassName,He=Se.overlayStyle,Ht=Se.visible,gt=Se.trigger,Qe=gt===void 0?["hover"]:gt,xr=Se.autoFocus,mr=Se.overlay,pi=Se.children,Wt=Se.onVisibleChange,si=(0,Me.Z)(Se,H),et=d.useState(),ct=(0,We.Z)(et,2),Ue=ct[0],wt=ct[1],Rt="visible"in Se?Ht:Ue,Dt=d.useRef(null),fe=d.useRef(null),ze=d.useRef(null);d.useImperativeHandle(Ye,function(){return Dt.current});var it=function(Kt){wt(Kt),Wt==null||Wt(Kt)};O({visible:Rt,triggerRef:ze,onVisibleChange:it,autoFocus:xr,overlayRef:fe});var ut=function(Kt){var qt=Se.onOverlayClick;wt(!1),qt&&qt(Kt)},_t=function(){return d.createElement(he,{ref:fe,overlay:mr,prefixCls:oe,arrow:$t})},Ft=function(){return typeof mr=="function"?_t:_t()},nr=function(){var Kt=Se.minOverlayWidthMatchTrigger,qt=Se.alignPoint;return"minOverlayWidthMatchTrigger"in Se?Kt:!qt},Pt=function(){var Kt=Se.openClassName;return Kt!==void 0?Kt:"".concat(oe,"-open")},Ve=d.cloneElement(pi,{className:Te()((lt=pi.props)===null||lt===void 0?void 0:lt.className,Rt&&Pt()),ref:(0,z.Yr)(pi)?(0,z.sQ)(ze,(0,z.C4)(pi)):void 0}),Bt=Et;return!Bt&&Qe.indexOf("contextMenu")!==-1&&(Bt=["click"]),d.createElement(ae.Z,(0,U.Z)({builtinPlacements:se},si,{prefixCls:oe,ref:Dt,popupClassName:Te()(bt,(0,Pe.Z)({},"".concat(oe,"-show-arrow"),$t)),popupStyle:He,action:Qe,showAction:at,hideAction:Bt,popupPlacement:D,popupAlign:Ee,popupTransitionName:me,popupAnimation:ge,popupVisible:Rt,stretch:nr()?"minWidth":"",popup:Ft(),onPopupVisibleChange:it,onPopupClick:ut,getPopupContainer:Ie}),Ve)}var De=d.forwardRef(ie),$e=De},66003:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return Te}});var U=Y(42244),Pe=Y(85899),We=Y(43749),Me=Y(59301),ae=["show"];function E(z,d){if(!d.max)return!0;var ne=d.strategy(z);return ne<=d.max}function Te(z,d){return Me.useMemo(function(){var ne={};d&&(ne.show=(0,We.Z)(d)==="object"&&d.formatter?d.formatter:!!d),ne=(0,Pe.Z)((0,Pe.Z)({},ne),z);var q=ne,M=q.show,L=(0,U.Z)(q,ae);return(0,Pe.Z)((0,Pe.Z)({},L),{},{show:!!M,showFormatter:typeof M=="function"?M:void 0,strategy:L.strategy||function(O){return O.length}})},[z,d])}},36901:function(Fr,Ct,Y){"use strict";Y.r(Ct),Y.d(Ct,{BaseInput:function(){return ne},default:function(){return V}});var U=Y(85899),Pe=Y(60499),We=Y(18642),Me=Y(43749),ae=Y(92310),E=Y.n(ae),Te=Y(59301),z=Y(30292),d=Te.forwardRef(function(H,ie){var De,$e,Se,Ye=H.inputElement,lt=H.children,Xe=H.prefixCls,$t=H.prefix,ye=H.suffix,oe=H.addonBefore,me=H.addonAfter,ge=H.className,Ee=H.style,be=H.disabled,D=H.readOnly,R=H.focused,se=H.triggerFocus,Ie=H.allowClear,at=H.value,Et=H.handleReset,bt=H.hidden,He=H.classes,Ht=H.classNames,gt=H.dataAttrs,Qe=H.styles,xr=H.components,mr=H.onClear,pi=lt!=null?lt:Ye,Wt=(xr==null?void 0:xr.affixWrapper)||"span",si=(xr==null?void 0:xr.groupWrapper)||"span",et=(xr==null?void 0:xr.wrapper)||"span",ct=(xr==null?void 0:xr.groupAddon)||"span",Ue=(0,Te.useRef)(null),wt=function(Lr){var wr;(wr=Ue.current)!==null&&wr!==void 0&&wr.contains(Lr.target)&&(se==null||se())},Rt=(0,z.X3)(H),Dt=(0,Te.cloneElement)(pi,{value:at,className:E()((De=pi.props)===null||De===void 0?void 0:De.className,!Rt&&(Ht==null?void 0:Ht.variant))||null}),fe=(0,Te.useRef)(null);if(Te.useImperativeHandle(ie,function(){return{nativeElement:fe.current||Ue.current}}),Rt){var ze=null;if(Ie){var it=!be&&!D&&at,ut="".concat(Xe,"-clear-icon"),_t=(0,Me.Z)(Ie)==="object"&&Ie!==null&&Ie!==void 0&&Ie.clearIcon?Ie.clearIcon:"\u2716";ze=Te.createElement("button",{type:"button",tabIndex:-1,onClick:function(Lr){Et==null||Et(Lr),mr==null||mr()},onMouseDown:function(Lr){return Lr.preventDefault()},className:E()(ut,(0,We.Z)((0,We.Z)({},"".concat(ut,"-hidden"),!it),"".concat(ut,"-has-suffix"),!!ye))},_t)}var Ft="".concat(Xe,"-affix-wrapper"),nr=E()(Ft,(0,We.Z)((0,We.Z)((0,We.Z)((0,We.Z)((0,We.Z)({},"".concat(Xe,"-disabled"),be),"".concat(Ft,"-disabled"),be),"".concat(Ft,"-focused"),R),"".concat(Ft,"-readonly"),D),"".concat(Ft,"-input-with-clear-btn"),ye&&Ie&&at),He==null?void 0:He.affixWrapper,Ht==null?void 0:Ht.affixWrapper,Ht==null?void 0:Ht.variant),Pt=(ye||Ie)&&Te.createElement("span",{className:E()("".concat(Xe,"-suffix"),Ht==null?void 0:Ht.suffix),style:Qe==null?void 0:Qe.suffix},ze,ye);Dt=Te.createElement(Wt,(0,Pe.Z)({className:nr,style:Qe==null?void 0:Qe.affixWrapper,onClick:wt},gt==null?void 0:gt.affixWrapper,{ref:Ue}),$t&&Te.createElement("span",{className:E()("".concat(Xe,"-prefix"),Ht==null?void 0:Ht.prefix),style:Qe==null?void 0:Qe.prefix},$t),Dt,Pt)}if((0,z.He)(H)){var Ve="".concat(Xe,"-group"),Bt="".concat(Ve,"-addon"),gr="".concat(Ve,"-wrapper"),Kt=E()("".concat(Xe,"-wrapper"),Ve,He==null?void 0:He.wrapper,Ht==null?void 0:Ht.wrapper),qt=E()(gr,(0,We.Z)({},"".concat(gr,"-disabled"),be),He==null?void 0:He.group,Ht==null?void 0:Ht.groupWrapper);Dt=Te.createElement(si,{className:qt,ref:fe},Te.createElement(et,{className:Kt},oe&&Te.createElement(ct,{className:Bt},oe),Dt,me&&Te.createElement(ct,{className:Bt},me)))}return Te.cloneElement(Dt,{className:E()(($e=Dt.props)===null||$e===void 0?void 0:$e.className,ge)||null,style:(0,U.Z)((0,U.Z)({},(Se=Dt.props)===null||Se===void 0?void 0:Se.style),Ee),hidden:bt})}),ne=d,q=Y(77654),M=Y(72190),L=Y(42244),O=Y(18929),G=Y(2738),he=Y(66003),le=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],J=(0,Te.forwardRef)(function(H,ie){var De=H.autoComplete,$e=H.onChange,Se=H.onFocus,Ye=H.onBlur,lt=H.onPressEnter,Xe=H.onKeyDown,$t=H.onKeyUp,ye=H.prefixCls,oe=ye===void 0?"rc-input":ye,me=H.disabled,ge=H.htmlSize,Ee=H.className,be=H.maxLength,D=H.suffix,R=H.showCount,se=H.count,Ie=H.type,at=Ie===void 0?"text":Ie,Et=H.classes,bt=H.classNames,He=H.styles,Ht=H.onCompositionStart,gt=H.onCompositionEnd,Qe=(0,L.Z)(H,le),xr=(0,Te.useState)(!1),mr=(0,M.Z)(xr,2),pi=mr[0],Wt=mr[1],si=(0,Te.useRef)(!1),et=(0,Te.useRef)(!1),ct=(0,Te.useRef)(null),Ue=(0,Te.useRef)(null),wt=function(br){ct.current&&(0,z.nH)(ct.current,br)},Rt=(0,O.Z)(H.defaultValue,{value:H.value}),Dt=(0,M.Z)(Rt,2),fe=Dt[0],ze=Dt[1],it=fe==null?"":String(fe),ut=(0,Te.useState)(null),_t=(0,M.Z)(ut,2),Ft=_t[0],nr=_t[1],Pt=(0,he.Z)(se,R),Ve=Pt.max||be,Bt=Pt.strategy(it),gr=!!Ve&&Bt>Ve;(0,Te.useImperativeHandle)(ie,function(){var ue;return{focus:wt,blur:function(){var Ne;(Ne=ct.current)===null||Ne===void 0||Ne.blur()},setSelectionRange:function(Ne,Fe,qe){var ee;(ee=ct.current)===null||ee===void 0||ee.setSelectionRange(Ne,Fe,qe)},select:function(){var Ne;(Ne=ct.current)===null||Ne===void 0||Ne.select()},input:ct.current,nativeElement:((ue=Ue.current)===null||ue===void 0?void 0:ue.nativeElement)||ct.current}}),(0,Te.useEffect)(function(){et.current&&(et.current=!1),Wt(function(ue){return ue&&me?!1:ue})},[me]);var Kt=function(br,Ne,Fe){var qe=Ne;if(!si.current&&Pt.exceedFormatter&&Pt.max&&Pt.strategy(Ne)>Pt.max){if(qe=Pt.exceedFormatter(Ne,{max:Pt.max}),Ne!==qe){var ee,de;nr([((ee=ct.current)===null||ee===void 0?void 0:ee.selectionStart)||0,((de=ct.current)===null||de===void 0?void 0:de.selectionEnd)||0])}}else if(Fe.source==="compositionEnd")return;ze(qe),ct.current&&(0,z.rJ)(ct.current,br,$e,qe)};(0,Te.useEffect)(function(){if(Ft){var ue;(ue=ct.current)===null||ue===void 0||ue.setSelectionRange.apply(ue,(0,q.Z)(Ft))}},[Ft]);var qt=function(br){Kt(br,br.target.value,{source:"change"})},Gt=function(br){si.current=!1,Kt(br,br.currentTarget.value,{source:"compositionEnd"}),gt==null||gt(br)},Lr=function(br){lt&&br.key==="Enter"&&!et.current&&(et.current=!0,lt(br)),Xe==null||Xe(br)},wr=function(br){br.key==="Enter"&&(et.current=!1),$t==null||$t(br)},Xt=function(br){Wt(!0),Se==null||Se(br)},Ar=function(br){et.current&&(et.current=!1),Wt(!1),Ye==null||Ye(br)},C=function(br){ze(""),wt(),ct.current&&(0,z.rJ)(ct.current,br,$e)},N=gr&&"".concat(oe,"-out-of-range"),yt=function(){var br=(0,G.Z)(H,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return Te.createElement("input",(0,Pe.Z)({autoComplete:De},br,{onChange:qt,onFocus:Xt,onBlur:Ar,onKeyDown:Lr,onKeyUp:wr,className:E()(oe,(0,We.Z)({},"".concat(oe,"-disabled"),me),bt==null?void 0:bt.input),style:He==null?void 0:He.input,ref:ct,size:ge,type:at,onCompositionStart:function(Fe){si.current=!0,Ht==null||Ht(Fe)},onCompositionEnd:Gt}))},X=function(){var br=Number(Ve)>0;if(D||Pt.show){var Ne=Pt.showFormatter?Pt.showFormatter({value:it,count:Bt,maxLength:Ve}):"".concat(Bt).concat(br?" / ".concat(Ve):"");return Te.createElement(Te.Fragment,null,Pt.show&&Te.createElement("span",{className:E()("".concat(oe,"-show-count-suffix"),(0,We.Z)({},"".concat(oe,"-show-count-has-suffix"),!!D),bt==null?void 0:bt.count),style:(0,U.Z)({},He==null?void 0:He.count)},Ne),D)}return null};return Te.createElement(ne,(0,Pe.Z)({},Qe,{prefixCls:oe,className:E()(Ee,N),handleReset:C,value:it,focused:pi,triggerFocus:wt,suffix:X(),disabled:me,classes:Et,classNames:bt,styles:He}),yt())}),B=J,V=B},30292:function(Fr,Ct,Y){"use strict";Y.d(Ct,{He:function(){return U},X3:function(){return Pe},nH:function(){return ae},rJ:function(){return Me}});function U(E){return!!(E.addonBefore||E.addonAfter)}function Pe(E){return!!(E.prefix||E.suffix||E.allowClear)}function We(E,Te,z){var d=Te.cloneNode(!0),ne=Object.create(E,{target:{value:d},currentTarget:{value:d}});return d.value=z,typeof Te.selectionStart=="number"&&typeof Te.selectionEnd=="number"&&(d.selectionStart=Te.selectionStart,d.selectionEnd=Te.selectionEnd),d.setSelectionRange=function(){Te.setSelectionRange.apply(Te,arguments)},ne}function Me(E,Te,z,d){if(z){var ne=Te;if(Te.type==="click"){ne=We(Te,E,""),z(ne);return}if(E.type!=="file"&&d!==void 0){ne=We(Te,E,d),z(ne);return}z(ne)}}function ae(E,Te){if(E){E.focus(Te);var z=Te||{},d=z.cursor;if(d){var ne=E.value.length;switch(d){case"start":E.setSelectionRange(0,0);break;case"end":E.setSelectionRange(ne,ne);break;default:E.setSelectionRange(0,ne)}}}}},28321:function(Fr,Ct,Y){"use strict";Y.d(Ct,{iz:function(){return Ot},ck:function(){return qe},BW:function(){return or},sN:function(){return qe},Wd:function(){return we},ZP:function(){return $i},Xl:function(){return lt}});var U=Y(60499),Pe=Y(18642),We=Y(85899),Me=Y(77654),ae=Y(72190),E=Y(42244),Te=Y(92310),z=Y.n(Te),d=Y(83836),ne=Y(18929),q=Y(13697),M=Y(48736),L=Y(59301),O=Y(4676),G=L.createContext(null);function he(je,tt){return je===void 0?null:"".concat(je,"-").concat(tt)}function le(je){var tt=L.useContext(G);return he(tt,je)}var J=Y(80547),B=["children","locked"],V=L.createContext(null);function H(je,tt){var At=(0,We.Z)({},je);return Object.keys(tt).forEach(function(dt){var pt=tt[dt];pt!==void 0&&(At[dt]=pt)}),At}function ie(je){var tt=je.children,At=je.locked,dt=(0,E.Z)(je,B),pt=L.useContext(V),Tt=(0,J.Z)(function(){return H(pt,dt)},[pt,dt],function(Ut,Jt){return!At&&(Ut[0]!==Jt[0]||!(0,q.Z)(Ut[1],Jt[1],!0))});return L.createElement(V.Provider,{value:Tt},tt)}var De=[],$e=L.createContext(null);function Se(){return L.useContext($e)}var Ye=L.createContext(De);function lt(je){var tt=L.useContext(Ye);return L.useMemo(function(){return je!==void 0?[].concat((0,Me.Z)(tt),[je]):tt},[tt,je])}var Xe=L.createContext(null),$t=L.createContext({}),ye=$t,oe=Y(29194);function me(je){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,oe.Z)(je)){var At=je.nodeName.toLowerCase(),dt=["input","select","textarea","button"].includes(At)||je.isContentEditable||At==="a"&&!!je.getAttribute("href"),pt=je.getAttribute("tabindex"),Tt=Number(pt),Ut=null;return pt&&!Number.isNaN(Tt)?Ut=Tt:dt&&Ut===null&&(Ut=0),dt&&je.disabled&&(Ut=null),Ut!==null&&(Ut>=0||tt&&Ut<0)}return!1}function ge(je){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,At=(0,Me.Z)(je.querySelectorAll("*")).filter(function(dt){return me(dt,tt)});return me(je,tt)&&At.unshift(je),At}var Ee=null;function be(){Ee=document.activeElement}function D(){Ee=null}function R(){if(Ee)try{Ee.focus()}catch(je){}}function se(je,tt){if(tt.keyCode===9){var At=ge(je),dt=At[tt.shiftKey?0:At.length-1],pt=dt===document.activeElement||je===document.activeElement;if(pt){var Tt=At[tt.shiftKey?At.length-1:0];Tt.focus(),tt.preventDefault()}}}var Ie=Y(10228),at=Y(16089),Et=Ie.Z.LEFT,bt=Ie.Z.RIGHT,He=Ie.Z.UP,Ht=Ie.Z.DOWN,gt=Ie.Z.ENTER,Qe=Ie.Z.ESC,xr=Ie.Z.HOME,mr=Ie.Z.END,pi=[He,Ht,Et,bt];function Wt(je,tt,At,dt){var pt,Tt="prev",Ut="next",Jt="children",Er="parent";if(je==="inline"&&dt===gt)return{inlineTrigger:!0};var kr=(0,Pe.Z)((0,Pe.Z)({},He,Tt),Ht,Ut),Or=(0,Pe.Z)((0,Pe.Z)((0,Pe.Z)((0,Pe.Z)({},Et,At?Ut:Tt),bt,At?Tt:Ut),Ht,Jt),gt,Jt),vr=(0,Pe.Z)((0,Pe.Z)((0,Pe.Z)((0,Pe.Z)((0,Pe.Z)((0,Pe.Z)({},He,Tt),Ht,Ut),gt,Jt),Qe,Er),Et,At?Jt:Er),bt,At?Er:Jt),cr={inline:kr,horizontal:Or,vertical:vr,inlineSub:kr,horizontalSub:vr,verticalSub:vr},Tr=(pt=cr["".concat(je).concat(tt?"":"Sub")])===null||pt===void 0?void 0:pt[dt];switch(Tr){case Tt:return{offset:-1,sibling:!0};case Ut:return{offset:1,sibling:!0};case Er:return{offset:-1,sibling:!1};case Jt:return{offset:1,sibling:!1};default:return null}}function si(je){for(var tt=je;tt;){if(tt.getAttribute("data-menu-list"))return tt;tt=tt.parentElement}return null}function et(je,tt){for(var At=je||document.activeElement;At;){if(tt.has(At))return At;At=At.parentElement}return null}function ct(je,tt){var At=ge(je,!0);return At.filter(function(dt){return tt.has(dt)})}function Ue(je,tt,At){var dt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!je)return null;var pt=ct(je,tt),Tt=pt.length,Ut=pt.findIndex(function(Jt){return At===Jt});return dt<0?Ut===-1?Ut=Tt-1:Ut-=1:dt>0&&(Ut+=1),Ut=(Ut+Tt)%Tt,pt[Ut]}var wt=function(tt,At){var dt=new Set,pt=new Map,Tt=new Map;return tt.forEach(function(Ut){var Jt=document.querySelector("[data-menu-id='".concat(he(At,Ut),"']"));Jt&&(dt.add(Jt),Tt.set(Jt,Ut),pt.set(Ut,Jt))}),{elements:dt,key2element:pt,element2key:Tt}};function Rt(je,tt,At,dt,pt,Tt,Ut,Jt,Er,kr){var Or=L.useRef(),vr=L.useRef();vr.current=tt;var cr=function(){at.Z.cancel(Or.current)};return L.useEffect(function(){return function(){cr()}},[]),function(Tr){var gi=Tr.which;if([].concat(pi,[gt,Qe,xr,mr]).includes(gi)){var ci=Tt(),hr=wt(ci,dt),Zr=hr,Si=Zr.elements,ti=Zr.key2element,Vr=Zr.element2key,Ti=ti.get(tt),Ur=et(Ti,Si),ri=Vr.get(Ur),Ri=Wt(je,Ut(ri,!0).length===1,At,gi);if(!Ri&&gi!==xr&&gi!==mr)return;(pi.includes(gi)||[xr,mr].includes(gi))&&Tr.preventDefault();var st=function(jr){if(jr){var qi=jr,Ki=jr.querySelector("a");Ki!=null&&Ki.getAttribute("href")&&(qi=Ki);var Bi=Vr.get(jr);Jt(Bi),cr(),Or.current=(0,at.Z)(function(){vr.current===Bi&&qi.focus()})}};if([xr,mr].includes(gi)||Ri.sibling||!Ur){var Ir;!Ur||je==="inline"?Ir=pt.current:Ir=si(Ur);var hi,Oi=ct(Ir,Si);gi===xr?hi=Oi[0]:gi===mr?hi=Oi[Oi.length-1]:hi=Ue(Ir,Si,Ur,Ri.offset),st(hi)}else if(Ri.inlineTrigger)Er(ri);else if(Ri.offset>0)Er(ri,!0),cr(),Or.current=(0,at.Z)(function(){hr=wt(ci,dt);var $r=Ur.getAttribute("aria-controls"),jr=document.getElementById($r),qi=Ue(jr,hr.elements);st(qi)},5);else if(Ri.offset<0){var ln=Ut(ri,!0),tn=ln[ln.length-2],zi=ti.get(tn);Er(tn,!1),st(zi)}}kr==null||kr(Tr)}}function Dt(je){Promise.resolve().then(je)}var fe="__RC_UTIL_PATH_SPLIT__",ze=function(tt){return tt.join(fe)},it=function(tt){return tt.split(fe)},ut="rc-menu-more";function _t(){var je=L.useState({}),tt=(0,ae.Z)(je,2),At=tt[1],dt=(0,L.useRef)(new Map),pt=(0,L.useRef)(new Map),Tt=L.useState([]),Ut=(0,ae.Z)(Tt,2),Jt=Ut[0],Er=Ut[1],kr=(0,L.useRef)(0),Or=(0,L.useRef)(!1),vr=function(){Or.current||At({})},cr=(0,L.useCallback)(function(ti,Vr){var Ti=ze(Vr);pt.current.set(Ti,ti),dt.current.set(ti,Ti),kr.current+=1;var Ur=kr.current;Dt(function(){Ur===kr.current&&vr()})},[]),Tr=(0,L.useCallback)(function(ti,Vr){var Ti=ze(Vr);pt.current.delete(Ti),dt.current.delete(ti)},[]),gi=(0,L.useCallback)(function(ti){Er(ti)},[]),ci=(0,L.useCallback)(function(ti,Vr){var Ti=dt.current.get(ti)||"",Ur=it(Ti);return Vr&&Jt.includes(Ur[0])&&Ur.unshift(ut),Ur},[Jt]),hr=(0,L.useCallback)(function(ti,Vr){return ti.filter(function(Ti){return Ti!==void 0}).some(function(Ti){var Ur=ci(Ti,!0);return Ur.includes(Vr)})},[ci]),Zr=function(){var Vr=(0,Me.Z)(dt.current.keys());return Jt.length&&Vr.push(ut),Vr},Si=(0,L.useCallback)(function(ti){var Vr="".concat(dt.current.get(ti)).concat(fe),Ti=new Set;return(0,Me.Z)(pt.current.keys()).forEach(function(Ur){Ur.startsWith(Vr)&&Ti.add(pt.current.get(Ur))}),Ti},[]);return L.useEffect(function(){return function(){Or.current=!0}},[]),{registerPath:cr,unregisterPath:Tr,refreshOverflowKeys:gi,isSubPathKey:hr,getKeyPath:ci,getKeys:Zr,getSubPathKeys:Si}}function Ft(je){var tt=L.useRef(je);tt.current=je;var At=L.useCallback(function(){for(var dt,pt=arguments.length,Tt=new Array(pt),Ut=0;Ut<pt;Ut++)Tt[Ut]=arguments[Ut];return(dt=tt.current)===null||dt===void 0?void 0:dt.call.apply(dt,[tt].concat(Tt))},[]);return je?At:void 0}var nr=Math.random().toFixed(5).toString().slice(2),Pt=0;function Ve(je){var tt=(0,ne.Z)(je,{value:je}),At=(0,ae.Z)(tt,2),dt=At[0],pt=At[1];return L.useEffect(function(){Pt+=1;var Tt="".concat(nr,"-").concat(Pt);pt("rc-menu-uuid-".concat(Tt))},[]),dt}var Bt=Y(38705),gr=Y(17212),Kt=Y(39153),qt=Y(55401),Gt=Y(2738),Lr=Y(8654);function wr(je,tt,At,dt){var pt=L.useContext(V),Tt=pt.activeKey,Ut=pt.onActive,Jt=pt.onInactive,Er={active:Tt===je};return tt||(Er.onMouseEnter=function(kr){At==null||At({key:je,domEvent:kr}),Ut(je)},Er.onMouseLeave=function(kr){dt==null||dt({key:je,domEvent:kr}),Jt(je)}),Er}function Xt(je){var tt=L.useContext(V),At=tt.mode,dt=tt.rtl,pt=tt.inlineIndent;if(At!=="inline")return null;var Tt=je;return dt?{paddingRight:Tt*pt}:{paddingLeft:Tt*pt}}function Ar(je){var tt=je.icon,At=je.props,dt=je.children,pt;return tt===null||tt===!1?null:(typeof tt=="function"?pt=L.createElement(tt,(0,We.Z)({},At)):typeof tt!="boolean"&&(pt=tt),pt||dt||null)}var C=["item"];function N(je){var tt=je.item,At=(0,E.Z)(je,C);return Object.defineProperty(At,"item",{get:function(){return(0,M.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),tt}}),At}var yt=["title","attribute","elementRef"],X=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],ue=["active"],br=function(je){(0,Kt.Z)(At,je);var tt=(0,qt.Z)(At);function At(){return(0,Bt.Z)(this,At),tt.apply(this,arguments)}return(0,gr.Z)(At,[{key:"render",value:function(){var pt=this.props,Tt=pt.title,Ut=pt.attribute,Jt=pt.elementRef,Er=(0,E.Z)(pt,yt),kr=(0,Gt.Z)(Er,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,M.ZP)(!Ut,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),L.createElement(d.Z.Item,(0,U.Z)({},Ut,{title:typeof Tt=="string"?Tt:void 0},kr,{ref:Jt}))}}]),At}(L.Component),Ne=L.forwardRef(function(je,tt){var At=je.style,dt=je.className,pt=je.eventKey,Tt=je.warnKey,Ut=je.disabled,Jt=je.itemIcon,Er=je.children,kr=je.role,Or=je.onMouseEnter,vr=je.onMouseLeave,cr=je.onClick,Tr=je.onKeyDown,gi=je.onFocus,ci=(0,E.Z)(je,X),hr=le(pt),Zr=L.useContext(V),Si=Zr.prefixCls,ti=Zr.onItemClick,Vr=Zr.disabled,Ti=Zr.overflowDisabled,Ur=Zr.itemIcon,ri=Zr.selectedKeys,Ri=Zr.onActive,st=L.useContext(ye),Ir=st._internalRenderMenuItem,hi="".concat(Si,"-item"),Oi=L.useRef(),ln=L.useRef(),tn=Vr||Ut,zi=(0,Lr.x1)(tt,ln),$r=lt(pt),jr=function(Dn){return{key:pt,keyPath:(0,Me.Z)($r).reverse(),item:Oi.current,domEvent:Dn}},qi=Jt||Ur,Ki=wr(pt,tn,Or,vr),Bi=Ki.active,bs=(0,E.Z)(Ki,ue),Wn=ri.includes(pt),un=Xt($r.length),Rr=function(Dn){if(!tn){var vn=jr(Dn);cr==null||cr(N(vn)),ti(vn)}},Ci=function(Dn){if(Tr==null||Tr(Dn),Dn.which===Ie.Z.ENTER){var vn=jr(Dn);cr==null||cr(N(vn)),ti(vn)}},Gi=function(Dn){Ri(pt),gi==null||gi(Dn)},On={};je.role==="option"&&(On["aria-selected"]=Wn);var ss=L.createElement(br,(0,U.Z)({ref:Oi,elementRef:zi,role:kr===null?"none":kr||"menuitem",tabIndex:Ut?null:-1,"data-menu-id":Ti&&hr?null:hr},(0,Gt.Z)(ci,["extra"]),bs,On,{component:"li","aria-disabled":Ut,style:(0,We.Z)((0,We.Z)({},un),At),className:z()(hi,(0,Pe.Z)((0,Pe.Z)((0,Pe.Z)({},"".concat(hi,"-active"),Bi),"".concat(hi,"-selected"),Wn),"".concat(hi,"-disabled"),tn),dt),onClick:Rr,onKeyDown:Ci,onFocus:Gi}),Er,L.createElement(Ar,{props:(0,We.Z)((0,We.Z)({},je),{},{isSelected:Wn}),icon:qi}));return Ir&&(ss=Ir(ss,je,{selected:Wn})),ss});function Fe(je,tt){var At=je.eventKey,dt=Se(),pt=lt(At);return L.useEffect(function(){if(dt)return dt.registerPath(At,pt),function(){dt.unregisterPath(At,pt)}},[pt]),dt?null:L.createElement(Ne,(0,U.Z)({},je,{ref:tt}))}var qe=L.forwardRef(Fe),ee=["className","children"],de=function(tt,At){var dt=tt.className,pt=tt.children,Tt=(0,E.Z)(tt,ee),Ut=L.useContext(V),Jt=Ut.prefixCls,Er=Ut.mode,kr=Ut.rtl;return L.createElement("ul",(0,U.Z)({className:z()(Jt,kr&&"".concat(Jt,"-rtl"),"".concat(Jt,"-sub"),"".concat(Jt,"-").concat(Er==="inline"?"inline":"vertical"),dt),role:"menu"},Tt,{"data-menu-list":!0,ref:At}),pt)},Re=L.forwardRef(de);Re.displayName="SubMenuList";var Ge=Re,Z=Y(11592);function Nt(je,tt){return(0,Z.Z)(je).map(function(At,dt){if(L.isValidElement(At)){var pt,Tt,Ut=At.key,Jt=(pt=(Tt=At.props)===null||Tt===void 0?void 0:Tt.eventKey)!==null&&pt!==void 0?pt:Ut,Er=Jt==null;Er&&(Jt="tmp_key-".concat([].concat((0,Me.Z)(tt),[dt]).join("-")));var kr={key:Jt,eventKey:Jt};return L.cloneElement(At,kr)}return At})}var Ae=Y(68196),sr={adjustX:1,adjustY:1},Sr={topLeft:{points:["bl","tl"],overflow:sr},topRight:{points:["br","tr"],overflow:sr},bottomLeft:{points:["tl","bl"],overflow:sr},bottomRight:{points:["tr","br"],overflow:sr},leftTop:{points:["tr","tl"],overflow:sr},leftBottom:{points:["br","bl"],overflow:sr},rightTop:{points:["tl","tr"],overflow:sr},rightBottom:{points:["bl","br"],overflow:sr}},mi={topLeft:{points:["bl","tl"],overflow:sr},topRight:{points:["br","tr"],overflow:sr},bottomLeft:{points:["tl","bl"],overflow:sr},bottomRight:{points:["tr","br"],overflow:sr},rightTop:{points:["tr","tl"],overflow:sr},rightBottom:{points:["br","bl"],overflow:sr},leftTop:{points:["tl","tr"],overflow:sr},leftBottom:{points:["bl","br"],overflow:sr}},Hi=null;function Ai(je,tt,At){if(tt)return tt;if(At)return At[je]||At.other}var zr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Ji(je){var tt=je.prefixCls,At=je.visible,dt=je.children,pt=je.popup,Tt=je.popupStyle,Ut=je.popupClassName,Jt=je.popupOffset,Er=je.disabled,kr=je.mode,Or=je.onVisibleChange,vr=L.useContext(V),cr=vr.getPopupContainer,Tr=vr.rtl,gi=vr.subMenuOpenDelay,ci=vr.subMenuCloseDelay,hr=vr.builtinPlacements,Zr=vr.triggerSubMenuAction,Si=vr.forceSubMenuRender,ti=vr.rootClassName,Vr=vr.motion,Ti=vr.defaultMotions,Ur=L.useState(!1),ri=(0,ae.Z)(Ur,2),Ri=ri[0],st=ri[1],Ir=Tr?(0,We.Z)((0,We.Z)({},mi),hr):(0,We.Z)((0,We.Z)({},Sr),hr),hi=zr[kr],Oi=Ai(kr,Vr,Ti),ln=L.useRef(Oi);kr!=="inline"&&(ln.current=Oi);var tn=(0,We.Z)((0,We.Z)({},ln.current),{},{leavedClassName:"".concat(tt,"-hidden"),removeOnLeave:!1,motionAppear:!0}),zi=L.useRef();return L.useEffect(function(){return zi.current=(0,at.Z)(function(){st(At)}),function(){at.Z.cancel(zi.current)}},[At]),L.createElement(Ae.Z,{prefixCls:tt,popupClassName:z()("".concat(tt,"-popup"),(0,Pe.Z)({},"".concat(tt,"-rtl"),Tr),Ut,ti),stretch:kr==="horizontal"?"minWidth":null,getPopupContainer:cr,builtinPlacements:Ir,popupPlacement:hi,popupVisible:Ri,popup:pt,popupStyle:Tt,popupAlign:Jt&&{offset:Jt},action:Er?[]:[Zr],mouseEnterDelay:gi,mouseLeaveDelay:ci,onPopupVisibleChange:Or,forceRender:Si,popupMotion:tn,fresh:!0},dt)}var Cn=Y(77900);function Di(je){var tt=je.id,At=je.open,dt=je.keyPath,pt=je.children,Tt="inline",Ut=L.useContext(V),Jt=Ut.prefixCls,Er=Ut.forceSubMenuRender,kr=Ut.motion,Or=Ut.defaultMotions,vr=Ut.mode,cr=L.useRef(!1);cr.current=vr===Tt;var Tr=L.useState(!cr.current),gi=(0,ae.Z)(Tr,2),ci=gi[0],hr=gi[1],Zr=cr.current?At:!1;L.useEffect(function(){cr.current&&hr(!1)},[vr]);var Si=(0,We.Z)({},Ai(Tt,kr,Or));dt.length>1&&(Si.motionAppear=!1);var ti=Si.onVisibleChanged;return Si.onVisibleChanged=function(Vr){return!cr.current&&!Vr&&hr(!0),ti==null?void 0:ti(Vr)},ci?null:L.createElement(ie,{mode:Tt,locked:!cr.current},L.createElement(Cn.default,(0,U.Z)({visible:Zr},Si,{forceRender:Er,removeOnLeave:!1,leavedClassName:"".concat(Jt,"-hidden")}),function(Vr){var Ti=Vr.className,Ur=Vr.style;return L.createElement(Ge,{id:tt,className:Ti,style:Ur},pt)}))}var Ii=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],ar=["active"],Wr=L.forwardRef(function(je,tt){var At=je.style,dt=je.className,pt=je.title,Tt=je.eventKey,Ut=je.warnKey,Jt=je.disabled,Er=je.internalPopupClose,kr=je.children,Or=je.itemIcon,vr=je.expandIcon,cr=je.popupClassName,Tr=je.popupOffset,gi=je.popupStyle,ci=je.onClick,hr=je.onMouseEnter,Zr=je.onMouseLeave,Si=je.onTitleClick,ti=je.onTitleMouseEnter,Vr=je.onTitleMouseLeave,Ti=(0,E.Z)(je,Ii),Ur=le(Tt),ri=L.useContext(V),Ri=ri.prefixCls,st=ri.mode,Ir=ri.openKeys,hi=ri.disabled,Oi=ri.overflowDisabled,ln=ri.activeKey,tn=ri.selectedKeys,zi=ri.itemIcon,$r=ri.expandIcon,jr=ri.onItemClick,qi=ri.onOpenChange,Ki=ri.onActive,Bi=L.useContext(ye),bs=Bi._internalRenderSubMenuItem,Wn=L.useContext(Xe),un=Wn.isSubPathKey,Rr=lt(),Ci="".concat(Ri,"-submenu"),Gi=hi||Jt,On=L.useRef(),ss=L.useRef(),xn=Or!=null?Or:zi,Dn=vr!=null?vr:$r,vn=Ir.includes(Tt),Fi=!Oi&&vn,ds=un(tn,Tt),cn=wr(Tt,Gi,ti,Vr),es=cn.active,ts=(0,E.Z)(cn,ar),wn=L.useState(!1),Ei=(0,ae.Z)(wn,2),as=Ei[0],rs=Ei[1],os=function(Bn){Gi||rs(Bn)},zn=function(Bn){os(!0),hr==null||hr({key:Tt,domEvent:Bn})},di=function(Bn){os(!1),Zr==null||Zr({key:Tt,domEvent:Bn})},Ts=L.useMemo(function(){return es||(st!=="inline"?as||un([ln],Tt):!1)},[st,es,ln,as,Tt,un]),tr=Xt(Rr.length),hn=function(Bn){Gi||(Si==null||Si({key:Tt,domEvent:Bn}),st==="inline"&&qi(Tt,!vn))},Ps=Ft(function(Sn){ci==null||ci(N(Sn)),jr(Sn)}),ls=function(Bn){st!=="inline"&&qi(Tt,Bn)},Mn=function(){Ki(Tt)},us=Ur&&"".concat(Ur,"-popup"),oi=L.useMemo(function(){return L.createElement(Ar,{icon:st!=="horizontal"?Dn:void 0,props:(0,We.Z)((0,We.Z)({},je),{},{isOpen:Fi,isSubMenu:!0})},L.createElement("i",{className:"".concat(Ci,"-arrow")}))},[st,Dn,je,Fi,Ci]),Kn=L.createElement("div",(0,U.Z)({role:"menuitem",style:tr,className:"".concat(Ci,"-title"),tabIndex:Gi?null:-1,ref:On,title:typeof pt=="string"?pt:null,"data-menu-id":Oi&&Ur?null:Ur,"aria-expanded":Fi,"aria-haspopup":!0,"aria-controls":us,"aria-disabled":Gi,onClick:hn,onFocus:Mn},ts),pt,oi),fs=L.useRef(st);if(st!=="inline"&&Rr.length>1?fs.current="vertical":fs.current=st,!Oi){var jn=fs.current;Kn=L.createElement(Ji,{mode:jn,prefixCls:Ci,visible:!Er&&Fi&&st!=="inline",popupClassName:cr,popupOffset:Tr,popupStyle:gi,popup:L.createElement(ie,{mode:jn==="horizontal"?"vertical":jn},L.createElement(Ge,{id:us,ref:ss},kr)),disabled:Gi,onVisibleChange:ls},Kn)}var dn=L.createElement(d.Z.Item,(0,U.Z)({ref:tt,role:"none"},Ti,{component:"li",style:At,className:z()(Ci,"".concat(Ci,"-").concat(st),dt,(0,Pe.Z)((0,Pe.Z)((0,Pe.Z)((0,Pe.Z)({},"".concat(Ci,"-open"),Fi),"".concat(Ci,"-active"),Ts),"".concat(Ci,"-selected"),ds),"".concat(Ci,"-disabled"),Gi)),onMouseEnter:zn,onMouseLeave:di}),Kn,!Oi&&L.createElement(Di,{id:us,open:Fi,keyPath:Rr},kr));return bs&&(dn=bs(dn,je,{selected:ds,active:Ts,open:Fi,disabled:Gi})),L.createElement(ie,{onItemClick:Ps,mode:st==="horizontal"?"vertical":st,itemIcon:xn,expandIcon:Dn},dn)}),pe=L.forwardRef(function(je,tt){var At=je.eventKey,dt=je.children,pt=lt(At),Tt=Nt(dt,pt),Ut=Se();L.useEffect(function(){if(Ut)return Ut.registerPath(At,pt),function(){Ut.unregisterPath(At,pt)}},[pt]);var Jt;return Ut?Jt=Tt:Jt=L.createElement(Wr,(0,U.Z)({ref:tt},je),Tt),L.createElement(Ye.Provider,{value:pt},Jt)}),we=pe,kt=Y(43749);function Ot(je){var tt=je.className,At=je.style,dt=L.useContext(V),pt=dt.prefixCls,Tt=Se();return Tt?null:L.createElement("li",{role:"separator",className:z()("".concat(pt,"-item-divider"),tt),style:At})}var Yt=["className","title","eventKey","children"],rr=L.forwardRef(function(je,tt){var At=je.className,dt=je.title,pt=je.eventKey,Tt=je.children,Ut=(0,E.Z)(je,Yt),Jt=L.useContext(V),Er=Jt.prefixCls,kr="".concat(Er,"-item-group");return L.createElement("li",(0,U.Z)({ref:tt,role:"presentation"},Ut,{onClick:function(vr){return vr.stopPropagation()},className:z()(kr,At)}),L.createElement("div",{role:"presentation",className:"".concat(kr,"-title"),title:typeof dt=="string"?dt:void 0},dt),L.createElement("ul",{role:"group",className:"".concat(kr,"-list")},Tt))}),ir=L.forwardRef(function(je,tt){var At=je.eventKey,dt=je.children,pt=lt(At),Tt=Nt(dt,pt),Ut=Se();return Ut?Tt:L.createElement(rr,(0,U.Z)({ref:tt},(0,Gt.Z)(je,["warnKey"])),Tt)}),or=ir,dr=["label","children","key","type","extra"];function Nr(je,tt,At){var dt=tt.item,pt=tt.group,Tt=tt.submenu,Ut=tt.divider;return(je||[]).map(function(Jt,Er){if(Jt&&(0,kt.Z)(Jt)==="object"){var kr=Jt,Or=kr.label,vr=kr.children,cr=kr.key,Tr=kr.type,gi=kr.extra,ci=(0,E.Z)(kr,dr),hr=cr!=null?cr:"tmp-".concat(Er);return vr||Tr==="group"?Tr==="group"?L.createElement(pt,(0,U.Z)({key:hr},ci,{title:Or}),Nr(vr,tt,At)):L.createElement(Tt,(0,U.Z)({key:hr},ci,{title:Or}),Nr(vr,tt,At)):Tr==="divider"?L.createElement(Ut,(0,U.Z)({key:hr},ci)):L.createElement(dt,(0,U.Z)({key:hr},ci,{extra:gi}),Or,(!!gi||gi===0)&&L.createElement("span",{className:"".concat(At,"-item-extra")},gi))}return null}).filter(function(Jt){return Jt})}function qr(je,tt,At,dt,pt){var Tt=je,Ut=(0,We.Z)({divider:Ot,item:qe,group:or,submenu:we},dt);return tt&&(Tt=Nr(tt,Ut,pt)),Nt(Tt,At)}var xi=["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","_internalComponents"],Qr=[],Mi=L.forwardRef(function(je,tt){var At,dt=je,pt=dt.prefixCls,Tt=pt===void 0?"rc-menu":pt,Ut=dt.rootClassName,Jt=dt.style,Er=dt.className,kr=dt.tabIndex,Or=kr===void 0?0:kr,vr=dt.items,cr=dt.children,Tr=dt.direction,gi=dt.id,ci=dt.mode,hr=ci===void 0?"vertical":ci,Zr=dt.inlineCollapsed,Si=dt.disabled,ti=dt.disabledOverflow,Vr=dt.subMenuOpenDelay,Ti=Vr===void 0?.1:Vr,Ur=dt.subMenuCloseDelay,ri=Ur===void 0?.1:Ur,Ri=dt.forceSubMenuRender,st=dt.defaultOpenKeys,Ir=dt.openKeys,hi=dt.activeKey,Oi=dt.defaultActiveFirst,ln=dt.selectable,tn=ln===void 0?!0:ln,zi=dt.multiple,$r=zi===void 0?!1:zi,jr=dt.defaultSelectedKeys,qi=dt.selectedKeys,Ki=dt.onSelect,Bi=dt.onDeselect,bs=dt.inlineIndent,Wn=bs===void 0?24:bs,un=dt.motion,Rr=dt.defaultMotions,Ci=dt.triggerSubMenuAction,Gi=Ci===void 0?"hover":Ci,On=dt.builtinPlacements,ss=dt.itemIcon,xn=dt.expandIcon,Dn=dt.overflowedIndicator,vn=Dn===void 0?"...":Dn,Fi=dt.overflowedIndicatorPopupClassName,ds=dt.getPopupContainer,cn=dt.onClick,es=dt.onOpenChange,ts=dt.onKeyDown,wn=dt.openAnimation,Ei=dt.openTransitionName,as=dt._internalRenderMenuItem,rs=dt._internalRenderSubMenuItem,os=dt._internalComponents,zn=(0,E.Z)(dt,xi),di=L.useMemo(function(){return[qr(cr,vr,Qr,os,Tt),qr(cr,vr,Qr,{},Tt)]},[cr,vr,os]),Ts=(0,ae.Z)(di,2),tr=Ts[0],hn=Ts[1],Ps=L.useState(!1),ls=(0,ae.Z)(Ps,2),Mn=ls[0],us=ls[1],oi=L.useRef(),Kn=Ve(gi),fs=Tr==="rtl",jn=(0,ne.Z)(st,{value:Ir,postState:function(sn){return sn||Qr}}),dn=(0,ae.Z)(jn,2),Sn=dn[0],Bn=dn[1],Ln=function(sn){var bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Ss(){Bn(sn),es==null||es(sn)}bn?(0,O.flushSync)(Ss):Ss()},Cs=L.useState(Sn),Zn=(0,ae.Z)(Cs,2),ia=Zn[0],ca=Zn[1],Gs=L.useRef(!1),_s=L.useMemo(function(){return(hr==="inline"||hr==="vertical")&&Zr?["vertical",Zr]:[hr,!1]},[hr,Zr]),Kr=(0,ae.Z)(_s,2),fi=Kr[0],Zi=Kr[1],yi=fi==="inline",_i=L.useState(fi),is=(0,ae.Z)(_i,2),rn=is[0],cs=is[1],Pi=L.useState(Zi),bi=(0,ae.Z)(Pi,2),yn=bi[0],fn=bi[1];L.useEffect(function(){cs(fi),fn(Zi),Gs.current&&(yi?Bn(ia):Ln(Qr))},[fi,Zi]);var pn=L.useState(0),En=(0,ae.Z)(pn,2),Vi=En[0],Yn=En[1],Zs=Vi>=tr.length-1||rn!=="horizontal"||ti;L.useEffect(function(){yi&&ca(Sn)},[Sn]),L.useEffect(function(){return Gs.current=!0,function(){Gs.current=!1}},[]);var ns=_t(),ja=ns.registerPath,Na=ns.unregisterPath,Os=ns.refreshOverflowKeys,Da=ns.isSubPathKey,ho=ns.getKeyPath,Ys=ns.getKeys,al=ns.getSubPathKeys,Kl=L.useMemo(function(){return{registerPath:ja,unregisterPath:Na}},[ja,Na]),fo=L.useMemo(function(){return{isSubPathKey:Da}},[Da]);L.useEffect(function(){Os(Zs?Qr:tr.slice(Vi+1).map(function(en){return en.key}))},[Vi,Zs]);var qa=(0,ne.Z)(hi||Oi&&((At=tr[0])===null||At===void 0?void 0:At.key),{value:hi}),po=(0,ae.Z)(qa,2),na=po[0],Io=po[1],Xs=Ft(function(en){Io(en)}),mo=Ft(function(){Io(void 0)});(0,L.useImperativeHandle)(tt,function(){return{list:oi.current,focus:function(sn){var bn,Ss=Ys(),Ds=wt(Ss,Kn),Ya=Ds.elements,La=Ds.key2element,sa=Ds.element2key,Po=ct(oi.current,Ya),vo=na!=null?na:Po[0]?sa.get(Po[0]):(bn=tr.find(function(bo){return!bo.props.disabled}))===null||bn===void 0?void 0:bn.key,Ia=La.get(vo);if(vo&&Ia){var yo;Ia==null||(yo=Ia.focus)===null||yo===void 0||yo.call(Ia,sn)}}}});var ol=(0,ne.Z)(jr||[],{value:qi,postState:function(sn){return Array.isArray(sn)?sn:sn==null?Qr:[sn]}}),Bs=(0,ae.Z)(ol,2),Ma=Bs[0],Za=Bs[1],ha=function(sn){if(tn){var bn=sn.key,Ss=Ma.includes(bn),Ds;$r?Ss?Ds=Ma.filter(function(La){return La!==bn}):Ds=[].concat((0,Me.Z)(Ma),[bn]):Ds=[bn],Za(Ds);var Ya=(0,We.Z)((0,We.Z)({},sn),{},{selectedKeys:Ds});Ss?Bi==null||Bi(Ya):Ki==null||Ki(Ya)}!$r&&Sn.length&&rn!=="inline"&&Ln(Qr)},go=Ft(function(en){cn==null||cn(N(en)),ha(en)}),da=Ft(function(en,sn){var bn=Sn.filter(function(Ds){return Ds!==en});if(sn)bn.push(en);else if(rn!=="inline"){var Ss=al(en);bn=bn.filter(function(Ds){return!Ss.has(Ds)})}(0,q.Z)(Sn,bn,!0)||Ln(bn,!0)}),ll=function(sn,bn){var Ss=bn!=null?bn:!Sn.includes(sn);da(sn,Ss)},Fs=Rt(rn,na,fs,Kn,oi,Ys,ho,Io,ll,ts);L.useEffect(function(){us(!0)},[]);var $a=L.useMemo(function(){return{_internalRenderMenuItem:as,_internalRenderSubMenuItem:rs}},[as,rs]),Js=rn!=="horizontal"||ti?tr:tr.map(function(en,sn){return L.createElement(ie,{key:en.key,overflowDisabled:sn>Vi},en)}),Ro=L.createElement(d.Z,(0,U.Z)({id:gi,ref:oi,prefixCls:"".concat(Tt,"-overflow"),component:"ul",itemComponent:qe,className:z()(Tt,"".concat(Tt,"-root"),"".concat(Tt,"-").concat(rn),Er,(0,Pe.Z)((0,Pe.Z)({},"".concat(Tt,"-inline-collapsed"),yn),"".concat(Tt,"-rtl"),fs),Ut),dir:Tr,style:Jt,role:"menu",tabIndex:Or,data:Js,renderRawItem:function(sn){return sn},renderRawRest:function(sn){var bn=sn.length,Ss=bn?tr.slice(-bn):null;return L.createElement(we,{eventKey:ut,title:vn,disabled:Zs,internalPopupClose:bn===0,popupClassName:Fi},Ss)},maxCount:rn!=="horizontal"||ti?d.Z.INVALIDATE:d.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(sn){Yn(sn)},onKeyDown:Fs},zn));return L.createElement(ye.Provider,{value:$a},L.createElement(G.Provider,{value:Kn},L.createElement(ie,{prefixCls:Tt,rootClassName:Ut,mode:rn,openKeys:Sn,rtl:fs,disabled:Si,motion:Mn?un:null,defaultMotions:Mn?Rr:null,activeKey:na,onActive:Xs,onInactive:mo,selectedKeys:Ma,inlineIndent:Wn,subMenuOpenDelay:Ti,subMenuCloseDelay:ri,forceSubMenuRender:Ri,builtinPlacements:On,triggerSubMenuAction:Gi,getPopupContainer:ds,itemIcon:ss,expandIcon:xn,onItemClick:go,onOpenChange:da},L.createElement(Xe.Provider,{value:fo},Ro),L.createElement("div",{style:{display:"none"},"aria-hidden":!0},L.createElement($e.Provider,{value:Kl},hn)))))}),Qi=Mi,wi=Qi;wi.Item=qe,wi.SubMenu=we,wi.ItemGroup=or,wi.Divider=Ot;var $i=wi},83836:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return be}});var U=Y(60499),Pe=Y(85899),We=Y(72190),Me=Y(42244),ae=Y(59301),E=Y(92310),Te=Y.n(E),z=Y(29301),d=Y(34280),ne=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],q=void 0;function M(D,R){var se=D.prefixCls,Ie=D.invalidate,at=D.item,Et=D.renderItem,bt=D.responsive,He=D.responsiveDisabled,Ht=D.registerSize,gt=D.itemKey,Qe=D.className,xr=D.style,mr=D.children,pi=D.display,Wt=D.order,si=D.component,et=si===void 0?"div":si,ct=(0,Me.Z)(D,ne),Ue=bt&&!pi;function wt(it){Ht(gt,it)}ae.useEffect(function(){return function(){wt(null)}},[]);var Rt=Et&&at!==q?Et(at,{index:Wt}):mr,Dt;Ie||(Dt={opacity:Ue?0:1,height:Ue?0:q,overflowY:Ue?"hidden":q,order:bt?Wt:q,pointerEvents:Ue?"none":q,position:Ue?"absolute":q});var fe={};Ue&&(fe["aria-hidden"]=!0);var ze=ae.createElement(et,(0,U.Z)({className:Te()(!Ie&&se,Qe),style:(0,Pe.Z)((0,Pe.Z)({},Dt),xr)},fe,ct,{ref:R}),Rt);return bt&&(ze=ae.createElement(z.Z,{onResize:function(ut){var _t=ut.offsetWidth;wt(_t)},disabled:He},ze)),ze}var L=ae.forwardRef(M);L.displayName="Item";var O=L,G=Y(6089),he=Y(4676),le=Y(16089);function J(D){if(typeof MessageChannel=="undefined")(0,le.Z)(D);else{var R=new MessageChannel;R.port1.onmessage=function(){return D()},R.port2.postMessage(void 0)}}function B(){var D=ae.useRef(null),R=function(Ie){D.current||(D.current=[],J(function(){(0,he.unstable_batchedUpdates)(function(){D.current.forEach(function(at){at()}),D.current=null})})),D.current.push(Ie)};return R}function V(D,R){var se=ae.useState(R),Ie=(0,We.Z)(se,2),at=Ie[0],Et=Ie[1],bt=(0,G.Z)(function(He){D(function(){Et(He)})});return[at,bt]}var H=ae.createContext(null),ie=["component"],De=["className"],$e=["className"],Se=function(R,se){var Ie=ae.useContext(H);if(!Ie){var at=R.component,Et=at===void 0?"div":at,bt=(0,Me.Z)(R,ie);return ae.createElement(Et,(0,U.Z)({},bt,{ref:se}))}var He=Ie.className,Ht=(0,Me.Z)(Ie,De),gt=R.className,Qe=(0,Me.Z)(R,$e);return ae.createElement(H.Provider,{value:null},ae.createElement(O,(0,U.Z)({ref:se,className:Te()(He,gt)},Ht,Qe)))},Ye=ae.forwardRef(Se);Ye.displayName="RawItem";var lt=Ye,Xe=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],$t="responsive",ye="invalidate";function oe(D){return"+ ".concat(D.length," ...")}function me(D,R){var se=D.prefixCls,Ie=se===void 0?"rc-overflow":se,at=D.data,Et=at===void 0?[]:at,bt=D.renderItem,He=D.renderRawItem,Ht=D.itemKey,gt=D.itemWidth,Qe=gt===void 0?10:gt,xr=D.ssr,mr=D.style,pi=D.className,Wt=D.maxCount,si=D.renderRest,et=D.renderRawRest,ct=D.prefix,Ue=D.suffix,wt=D.component,Rt=wt===void 0?"div":wt,Dt=D.itemComponent,fe=D.onVisibleChange,ze=(0,Me.Z)(D,Xe),it=xr==="full",ut=B(),_t=V(ut,null),Ft=(0,We.Z)(_t,2),nr=Ft[0],Pt=Ft[1],Ve=nr||0,Bt=V(ut,new Map),gr=(0,We.Z)(Bt,2),Kt=gr[0],qt=gr[1],Gt=V(ut,0),Lr=(0,We.Z)(Gt,2),wr=Lr[0],Xt=Lr[1],Ar=V(ut,0),C=(0,We.Z)(Ar,2),N=C[0],yt=C[1],X=V(ut,0),ue=(0,We.Z)(X,2),br=ue[0],Ne=ue[1],Fe=V(ut,0),qe=(0,We.Z)(Fe,2),ee=qe[0],de=qe[1],Re=(0,ae.useState)(null),Ge=(0,We.Z)(Re,2),Z=Ge[0],Nt=Ge[1],Ae=(0,ae.useState)(null),sr=(0,We.Z)(Ae,2),Sr=sr[0],mi=sr[1],Hi=ae.useMemo(function(){return Sr===null&&it?Number.MAX_SAFE_INTEGER:Sr||0},[Sr,nr]),Ai=(0,ae.useState)(!1),zr=(0,We.Z)(Ai,2),Ji=zr[0],Cn=zr[1],Di="".concat(Ie,"-item"),Ii=Math.max(wr,N),ar=Wt===$t,Wr=Et.length&&ar,pe=Wt===ye,we=Wr||typeof Wt=="number"&&Et.length>Wt,kt=(0,ae.useMemo)(function(){var pt=Et;return Wr?nr===null&&it?pt=Et:pt=Et.slice(0,Math.min(Et.length,Ve/Qe)):typeof Wt=="number"&&(pt=Et.slice(0,Wt)),pt},[Et,Qe,nr,Wt,Wr]),Ot=(0,ae.useMemo)(function(){return Wr?Et.slice(Hi+1):Et.slice(kt.length)},[Et,kt,Wr,Hi]),Yt=(0,ae.useCallback)(function(pt,Tt){var Ut;return typeof Ht=="function"?Ht(pt):(Ut=Ht&&(pt==null?void 0:pt[Ht]))!==null&&Ut!==void 0?Ut:Tt},[Ht]),rr=(0,ae.useCallback)(bt||function(pt){return pt},[bt]);function ir(pt,Tt,Ut){Sr===pt&&(Tt===void 0||Tt===Z)||(mi(pt),Ut||(Cn(pt<Et.length-1),fe==null||fe(pt)),Tt!==void 0&&Nt(Tt))}function or(pt,Tt){Pt(Tt.clientWidth)}function dr(pt,Tt){qt(function(Ut){var Jt=new Map(Ut);return Tt===null?Jt.delete(pt):Jt.set(pt,Tt),Jt})}function Nr(pt,Tt){yt(Tt),Xt(N)}function qr(pt,Tt){Ne(Tt)}function xi(pt,Tt){de(Tt)}function Qr(pt){return Kt.get(Yt(kt[pt],pt))}(0,d.Z)(function(){if(Ve&&typeof Ii=="number"&&kt){var pt=br+ee,Tt=kt.length,Ut=Tt-1;if(!Tt){ir(0,null);return}for(var Jt=0;Jt<Tt;Jt+=1){var Er=Qr(Jt);if(it&&(Er=Er||0),Er===void 0){ir(Jt-1,void 0,!0);break}if(pt+=Er,Ut===0&&pt<=Ve||Jt===Ut-1&&pt+Qr(Ut)<=Ve){ir(Ut,null);break}else if(pt+Ii>Ve){ir(Jt-1,pt-Er-ee+N);break}}Ue&&Qr(0)+ee>Ve&&Nt(null)}},[Ve,Kt,N,br,ee,Yt,kt]);var Mi=Ji&&!!Ot.length,Qi={};Z!==null&&Wr&&(Qi={position:"absolute",left:Z,top:0});var wi={prefixCls:Di,responsive:Wr,component:Dt,invalidate:pe},$i=He?function(pt,Tt){var Ut=Yt(pt,Tt);return ae.createElement(H.Provider,{key:Ut,value:(0,Pe.Z)((0,Pe.Z)({},wi),{},{order:Tt,item:pt,itemKey:Ut,registerSize:dr,display:Tt<=Hi})},He(pt,Tt))}:function(pt,Tt){var Ut=Yt(pt,Tt);return ae.createElement(O,(0,U.Z)({},wi,{order:Tt,key:Ut,item:pt,renderItem:rr,itemKey:Ut,registerSize:dr,display:Tt<=Hi}))},je={order:Mi?Hi:Number.MAX_SAFE_INTEGER,className:"".concat(Di,"-rest"),registerSize:Nr,display:Mi},tt=si||oe,At=et?ae.createElement(H.Provider,{value:(0,Pe.Z)((0,Pe.Z)({},wi),je)},et(Ot)):ae.createElement(O,(0,U.Z)({},wi,je),typeof tt=="function"?tt(Ot):tt),dt=ae.createElement(Rt,(0,U.Z)({className:Te()(!pe&&Ie,pi),style:mr,ref:R},ze),ct&&ae.createElement(O,(0,U.Z)({},wi,{responsive:ar,responsiveDisabled:!Wr,order:-1,className:"".concat(Di,"-prefix"),registerSize:qr,display:!0}),ct),kt.map($i),we?At:null,Ue&&ae.createElement(O,(0,U.Z)({},wi,{responsive:ar,responsiveDisabled:!Wr,order:Hi,className:"".concat(Di,"-suffix"),registerSize:xi,display:!0,style:Qi}),Ue));return ar?ae.createElement(z.Z,{onResize:or,disabled:!Wr},dt):dt}var ge=ae.forwardRef(me);ge.displayName="Overflow",ge.Item=lt,ge.RESPONSIVE=$t,ge.INVALIDATE=ye;var Ee=ge,be=Ee},29301:function(Fr,Ct,Y){"use strict";Y.d(Ct,{Z:function(){return ye}});var U=Y(60499),Pe=Y(59301),We=Y(11592),Me=Y(48736),ae=Y(85899),E=Y(43749),Te=Y(76846),z=Y(8654),d=Pe.createContext(null);function ne(oe){var me=oe.children,ge=oe.onBatchResize,Ee=Pe.useRef(0),be=Pe.useRef([]),D=Pe.useContext(d),R=Pe.useCallback(function(se,Ie,at){Ee.current+=1;var Et=Ee.current;be.current.push({size:se,element:Ie,data:at}),Promise.resolve().then(function(){Et===Ee.current&&(ge==null||ge(be.current),be.current=[])}),D==null||D(se,Ie,at)},[ge,D]);return Pe.createElement(d.Provider,{value:R},me)}var q=Y(76374),M=new Map;function L(oe){oe.forEach(function(me){var ge,Ee=me.target;(ge=M.get(Ee))===null||ge===void 0||ge.forEach(function(be){return be(Ee)})})}var O=new q.Z(L),G=null,he=null;function le(oe,me){M.has(oe)||(M.set(oe,new Set),O.observe(oe)),M.get(oe).add(me)}function J(oe,me){M.has(oe)&&(M.get(oe).delete(me),M.get(oe).size||(O.unobserve(oe),M.delete(oe)))}var B=Y(38705),V=Y(17212),H=Y(39153),ie=Y(55401),De=function(oe){(0,H.Z)(ge,oe);var me=(0,ie.Z)(ge);function ge(){return(0,B.Z)(this,ge),me.apply(this,arguments)}return(0,V.Z)(ge,[{key:"render",value:function(){return this.props.children}}]),ge}(Pe.Component);function $e(oe,me){var ge=oe.children,Ee=oe.disabled,be=Pe.useRef(null),D=Pe.useRef(null),R=Pe.useContext(d),se=typeof ge=="function",Ie=se?ge(be):ge,at=Pe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Et=!se&&Pe.isValidElement(Ie)&&(0,z.Yr)(Ie),bt=Et?(0,z.C4)(Ie):null,He=(0,z.x1)(bt,be),Ht=function(){var mr;return(0,Te.ZP)(be.current)||(be.current&&(0,E.Z)(be.current)==="object"?(0,Te.ZP)((mr=be.current)===null||mr===void 0?void 0:mr.nativeElement):null)||(0,Te.ZP)(D.current)};Pe.useImperativeHandle(me,function(){return Ht()});var gt=Pe.useRef(oe);gt.current=oe;var Qe=Pe.useCallback(function(xr){var mr=gt.current,pi=mr.onResize,Wt=mr.data,si=xr.getBoundingClientRect(),et=si.width,ct=si.height,Ue=xr.offsetWidth,wt=xr.offsetHeight,Rt=Math.floor(et),Dt=Math.floor(ct);if(at.current.width!==Rt||at.current.height!==Dt||at.current.offsetWidth!==Ue||at.current.offsetHeight!==wt){var fe={width:Rt,height:Dt,offsetWidth:Ue,offsetHeight:wt};at.current=fe;var ze=Ue===Math.round(et)?et:Ue,it=wt===Math.round(ct)?ct:wt,ut=(0,ae.Z)((0,ae.Z)({},fe),{},{offsetWidth:ze,offsetHeight:it});R==null||R(ut,xr,Wt),pi&&Promise.resolve().then(function(){pi(ut,xr)})}},[]);return Pe.useEffect(function(){var xr=Ht();return xr&&!Ee&&le(xr,Qe),function(){return J(xr,Qe)}},[be.current,Ee]),Pe.createElement(De,{ref:D},Et?Pe.cloneElement(Ie,{ref:He}):Ie)}var Se=Pe.forwardRef($e),Ye=Se,lt="rc-observer-key";function Xe(oe,me){var ge=oe.children,Ee=typeof ge=="function"?[ge]:(0,We.Z)(ge);return Ee.map(function(be,D){var R=(be==null?void 0:be.key)||"".concat(lt,"-").concat(D);return Pe.createElement(Ye,(0,U.Z)({},oe,{key:R,ref:D===0?me:void 0}),be)})}var $t=Pe.forwardRef(Xe);$t.Collection=ne;var ye=$t},29125:function(Fr,Ct,Y){"use strict";Y.d(Ct,{G:function(){return Me},Z:function(){return J}});var U=Y(92310),Pe=Y.n(U),We=Y(59301);function Me(B){var V=B.children,H=B.prefixCls,ie=B.id,De=B.overlayInnerStyle,$e=B.bodyClassName,Se=B.className,Ye=B.style;return We.createElement("div",{className:Pe()("".concat(H,"-content"),Se),style:Ye},We.createElement("div",{className:Pe()("".concat(H,"-inner"),$e),id:ie,role:"tooltip",style:De},typeof V=="function"?V():V))}var ae=Y(60499),E=Y(85899),Te=Y(42244),z=Y(68196),d={shiftX:64,adjustY:1},ne={adjustX:1,shiftY:!0},q=[0,0],M={left:{points:["cr","cl"],overflow:ne,offset:[-4,0],targetOffset:q},right:{points:["cl","cr"],overflow:ne,offset:[4,0],targetOffset:q},top:{points:["bc","tc"],overflow:d,offset:[0,-4],targetOffset:q},bottom:{points:["tc","bc"],overflow:d,offset:[0,4],targetOffset:q},topLeft:{points:["bl","tl"],overflow:d,offset:[0,-4],targetOffset:q},leftTop:{points:["tr","tl"],overflow:ne,offset:[-4,0],targetOffset:q},topRight:{points:["br","tr"],overflow:d,offset:[0,-4],targetOffset:q},rightTop:{points:["tl","tr"],overflow:ne,offset:[4,0],targetOffset:q},bottomRight:{points:["tr","br"],overflow:d,offset:[0,4],targetOffset:q},rightBottom:{points:["bl","br"],overflow:ne,offset:[4,0],targetOffset:q},bottomLeft:{points:["tl","bl"],overflow:d,offset:[0,4],targetOffset:q},leftBottom:{points:["br","bl"],overflow:ne,offset:[-4,0],targetOffset:q}},L=null,O=Y(80402),G=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],he=function(V,H){var ie=V.overlayClassName,De=V.trigger,$e=De===void 0?["hover"]:De,Se=V.mouseEnterDelay,Ye=Se===void 0?0:Se,lt=V.mouseLeaveDelay,Xe=lt===void 0?.1:lt,$t=V.overlayStyle,ye=V.prefixCls,oe=ye===void 0?"rc-tooltip":ye,me=V.children,ge=V.onVisibleChange,Ee=V.afterVisibleChange,be=V.transitionName,D=V.animation,R=V.motion,se=V.placement,Ie=se===void 0?"right":se,at=V.align,Et=at===void 0?{}:at,bt=V.destroyTooltipOnHide,He=bt===void 0?!1:bt,Ht=V.defaultVisible,gt=V.getTooltipContainer,Qe=V.overlayInnerStyle,xr=V.arrowContent,mr=V.overlay,pi=V.id,Wt=V.showArrow,si=Wt===void 0?!0:Wt,et=V.classNames,ct=V.styles,Ue=(0,Te.Z)(V,G),wt=(0,O.Z)(pi),Rt=(0,We.useRef)(null);(0,We.useImperativeHandle)(H,function(){return Rt.current});var Dt=(0,E.Z)({},Ue);"visible"in V&&(Dt.popupVisible=V.visible);var fe=function(){return We.createElement(Me,{key:"content",prefixCls:oe,id:wt,bodyClassName:et==null?void 0:et.body,overlayInnerStyle:(0,E.Z)((0,E.Z)({},Qe),ct==null?void 0:ct.body)},mr)},ze=function(){var ut=We.Children.only(me),_t=(ut==null?void 0:ut.props)||{},Ft=(0,E.Z)((0,E.Z)({},_t),{},{"aria-describedby":mr?wt:null});return We.cloneElement(me,Ft)};return We.createElement(z.Z,(0,ae.Z)({popupClassName:Pe()(ie,et==null?void 0:et.root),prefixCls:oe,popup:fe,action:$e,builtinPlacements:M,popupPlacement:Ie,ref:Rt,popupAlign:Et,getPopupContainer:gt,onPopupVisibleChange:ge,afterPopupVisibleChange:Ee,popupTransitionName:be,popupAnimation:D,popupMotion:R,defaultPopupVisible:Ht,autoDestroy:He,mouseLeaveDelay:Xe,popupStyle:(0,E.Z)((0,E.Z)({},$t),ct==null?void 0:ct.root),mouseEnterDelay:Ye,arrow:si},Dt),ze())},le=(0,We.forwardRef)(he),J=le},49658:function(Fr,Ct){"use strict";Ct.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(Fr,Ct,Y){"use strict";Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.CopyToClipboard=void 0;var U=We(Y(59301)),Pe=We(Y(25769));function We(B){return B&&B.__esModule?B:{default:B}}function Me(B){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Me=function(H){return typeof H}:Me=function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},Me(B)}function ae(B,V){var H=Object.keys(B);if(Object.getOwnPropertySymbols){var ie=Object.getOwnPropertySymbols(B);V&&(ie=ie.filter(function(De){return Object.getOwnPropertyDescriptor(B,De).enumerable})),H.push.apply(H,ie)}return H}function E(B){for(var V=1;V<arguments.length;V++){var H=arguments[V]!=null?arguments[V]:{};V%2?ae(H,!0).forEach(function(ie){le(B,ie,H[ie])}):Object.getOwnPropertyDescriptors?Object.defineProperties(B,Object.getOwnPropertyDescriptors(H)):ae(H).forEach(function(ie){Object.defineProperty(B,ie,Object.getOwnPropertyDescriptor(H,ie))})}return B}function Te(B,V){if(B==null)return{};var H=z(B,V),ie,De;if(Object.getOwnPropertySymbols){var $e=Object.getOwnPropertySymbols(B);for(De=0;De<$e.length;De++)ie=$e[De],!(V.indexOf(ie)>=0)&&Object.prototype.propertyIsEnumerable.call(B,ie)&&(H[ie]=B[ie])}return H}function z(B,V){if(B==null)return{};var H={},ie=Object.keys(B),De,$e;for($e=0;$e<ie.length;$e++)De=ie[$e],!(V.indexOf(De)>=0)&&(H[De]=B[De]);return H}function d(B,V){if(!(B instanceof V))throw new TypeError("Cannot call a class as a function")}function ne(B,V){for(var H=0;H<V.length;H++){var ie=V[H];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(B,ie.key,ie)}}function q(B,V,H){return V&&ne(B.prototype,V),H&&ne(B,H),B}function M(B,V){return V&&(Me(V)==="object"||typeof V=="function")?V:O(B)}function L(B){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(H){return H.__proto__||Object.getPrototypeOf(H)},L(B)}function O(B){if(B===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B}function G(B,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(V&&V.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),V&&he(B,V)}function he(B,V){return he=Object.setPrototypeOf||function(ie,De){return ie.__proto__=De,ie},he(B,V)}function le(B,V,H){return V in B?Object.defineProperty(B,V,{value:H,enumerable:!0,configurable:!0,writable:!0}):B[V]=H,B}var J=function(B){G(V,B);function V(){var H,ie;d(this,V);for(var De=arguments.length,$e=new Array(De),Se=0;Se<De;Se++)$e[Se]=arguments[Se];return ie=M(this,(H=L(V)).call.apply(H,[this].concat($e))),le(O(ie),"onClick",function(Ye){var lt=ie.props,Xe=lt.text,$t=lt.onCopy,ye=lt.children,oe=lt.options,me=U.default.Children.only(ye),ge=(0,Pe.default)(Xe,oe);$t&&$t(Xe,ge),me&&me.props&&typeof me.props.onClick=="function"&&me.props.onClick(Ye)}),ie}return q(V,[{key:"render",value:function(){var ie=this.props,De=ie.text,$e=ie.onCopy,Se=ie.options,Ye=ie.children,lt=Te(ie,["text","onCopy","options","children"]),Xe=U.default.Children.only(Ye);return U.default.cloneElement(Xe,E({},lt,{onClick:this.onClick}))}}]),V}(U.default.PureComponent);Ct.CopyToClipboard=J,le(J,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Fr,Ct,Y){"use strict";var U=Y(83145),Pe=U.CopyToClipboard;Pe.CopyToClipboard=Pe,Fr.exports=Pe},76374:function(Fr,Ct,Y){"use strict";var U=function(){if(typeof Map!="undefined")return Map;function ye(oe,me){var ge=-1;return oe.some(function(Ee,be){return Ee[0]===me?(ge=be,!0):!1}),ge}return function(){function oe(){this.__entries__=[]}return Object.defineProperty(oe.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),oe.prototype.get=function(me){var ge=ye(this.__entries__,me),Ee=this.__entries__[ge];return Ee&&Ee[1]},oe.prototype.set=function(me,ge){var Ee=ye(this.__entries__,me);~Ee?this.__entries__[Ee][1]=ge:this.__entries__.push([me,ge])},oe.prototype.delete=function(me){var ge=this.__entries__,Ee=ye(ge,me);~Ee&&ge.splice(Ee,1)},oe.prototype.has=function(me){return!!~ye(this.__entries__,me)},oe.prototype.clear=function(){this.__entries__.splice(0)},oe.prototype.forEach=function(me,ge){ge===void 0&&(ge=null);for(var Ee=0,be=this.__entries__;Ee<be.length;Ee++){var D=be[Ee];me.call(ge,D[1],D[0])}},oe}()}(),Pe=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,We=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")()}(),Me=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(We):function(ye){return setTimeout(function(){return ye(Date.now())},1e3/60)}}(),ae=2;function E(ye,oe){var me=!1,ge=!1,Ee=0;function be(){me&&(me=!1,ye()),ge&&R()}function D(){Me(be)}function R(){var se=Date.now();if(me){if(se-Ee<ae)return;ge=!0}else me=!0,ge=!1,setTimeout(D,oe);Ee=se}return R}var Te=20,z=["top","right","bottom","left","width","height","size","weight"],d=typeof MutationObserver!="undefined",ne=function(){function ye(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=E(this.refresh.bind(this),Te)}return ye.prototype.addObserver=function(oe){~this.observers_.indexOf(oe)||this.observers_.push(oe),this.connected_||this.connect_()},ye.prototype.removeObserver=function(oe){var me=this.observers_,ge=me.indexOf(oe);~ge&&me.splice(ge,1),!me.length&&this.connected_&&this.disconnect_()},ye.prototype.refresh=function(){var oe=this.updateObservers_();oe&&this.refresh()},ye.prototype.updateObservers_=function(){var oe=this.observers_.filter(function(me){return me.gatherActive(),me.hasActive()});return oe.forEach(function(me){return me.broadcastActive()}),oe.length>0},ye.prototype.connect_=function(){!Pe||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),d?(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)},ye.prototype.disconnect_=function(){!Pe||!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)},ye.prototype.onTransitionEnd_=function(oe){var me=oe.propertyName,ge=me===void 0?"":me,Ee=z.some(function(be){return!!~ge.indexOf(be)});Ee&&this.refresh()},ye.getInstance=function(){return this.instance_||(this.instance_=new ye),this.instance_},ye.instance_=null,ye}(),q=function(ye,oe){for(var me=0,ge=Object.keys(oe);me<ge.length;me++){var Ee=ge[me];Object.defineProperty(ye,Ee,{value:oe[Ee],enumerable:!1,writable:!1,configurable:!0})}return ye},M=function(ye){var oe=ye&&ye.ownerDocument&&ye.ownerDocument.defaultView;return oe||We},L=De(0,0,0,0);function O(ye){return parseFloat(ye)||0}function G(ye){for(var oe=[],me=1;me<arguments.length;me++)oe[me-1]=arguments[me];return oe.reduce(function(ge,Ee){var be=ye["border-"+Ee+"-width"];return ge+O(be)},0)}function he(ye){for(var oe=["top","right","bottom","left"],me={},ge=0,Ee=oe;ge<Ee.length;ge++){var be=Ee[ge],D=ye["padding-"+be];me[be]=O(D)}return me}function le(ye){var oe=ye.getBBox();return De(0,0,oe.width,oe.height)}function J(ye){var oe=ye.clientWidth,me=ye.clientHeight;if(!oe&&!me)return L;var ge=M(ye).getComputedStyle(ye),Ee=he(ge),be=Ee.left+Ee.right,D=Ee.top+Ee.bottom,R=O(ge.width),se=O(ge.height);if(ge.boxSizing==="border-box"&&(Math.round(R+be)!==oe&&(R-=G(ge,"left","right")+be),Math.round(se+D)!==me&&(se-=G(ge,"top","bottom")+D)),!V(ye)){var Ie=Math.round(R+be)-oe,at=Math.round(se+D)-me;Math.abs(Ie)!==1&&(R-=Ie),Math.abs(at)!==1&&(se-=at)}return De(Ee.left,Ee.top,R,se)}var B=function(){return typeof SVGGraphicsElement!="undefined"?function(ye){return ye instanceof M(ye).SVGGraphicsElement}:function(ye){return ye instanceof M(ye).SVGElement&&typeof ye.getBBox=="function"}}();function V(ye){return ye===M(ye).document.documentElement}function H(ye){return Pe?B(ye)?le(ye):J(ye):L}function ie(ye){var oe=ye.x,me=ye.y,ge=ye.width,Ee=ye.height,be=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,D=Object.create(be.prototype);return q(D,{x:oe,y:me,width:ge,height:Ee,top:me,right:oe+ge,bottom:Ee+me,left:oe}),D}function De(ye,oe,me,ge){return{x:ye,y:oe,width:me,height:ge}}var $e=function(){function ye(oe){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=De(0,0,0,0),this.target=oe}return ye.prototype.isActive=function(){var oe=H(this.target);return this.contentRect_=oe,oe.width!==this.broadcastWidth||oe.height!==this.broadcastHeight},ye.prototype.broadcastRect=function(){var oe=this.contentRect_;return this.broadcastWidth=oe.width,this.broadcastHeight=oe.height,oe},ye}(),Se=function(){function ye(oe,me){var ge=ie(me);q(this,{target:oe,contentRect:ge})}return ye}(),Ye=function(){function ye(oe,me,ge){if(this.activeObservations_=[],this.observations_=new U,typeof oe!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=oe,this.controller_=me,this.callbackCtx_=ge}return ye.prototype.observe=function(oe){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(oe instanceof M(oe).Element))throw new TypeError('parameter 1 is not of type "Element".');var me=this.observations_;me.has(oe)||(me.set(oe,new $e(oe)),this.controller_.addObserver(this),this.controller_.refresh())}},ye.prototype.unobserve=function(oe){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(oe instanceof M(oe).Element))throw new TypeError('parameter 1 is not of type "Element".');var me=this.observations_;me.has(oe)&&(me.delete(oe),me.size||this.controller_.removeObserver(this))}},ye.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},ye.prototype.gatherActive=function(){var oe=this;this.clearActive(),this.observations_.forEach(function(me){me.isActive()&&oe.activeObservations_.push(me)})},ye.prototype.broadcastActive=function(){if(this.hasActive()){var oe=this.callbackCtx_,me=this.activeObservations_.map(function(ge){return new Se(ge.target,ge.broadcastRect())});this.callback_.call(oe,me,oe),this.clearActive()}},ye.prototype.clearActive=function(){this.activeObservations_.splice(0)},ye.prototype.hasActive=function(){return this.activeObservations_.length>0},ye}(),lt=typeof WeakMap!="undefined"?new WeakMap:new U,Xe=function(){function ye(oe){if(!(this instanceof ye))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var me=ne.getInstance(),ge=new Ye(oe,me,this);lt.set(this,ge)}return ye}();["observe","unobserve","disconnect"].forEach(function(ye){Xe.prototype[ye]=function(){var oe;return(oe=lt.get(this))[ye].apply(oe,arguments)}});var $t=function(){return typeof We.ResizeObserver!="undefined"?We.ResizeObserver:Xe}();Ct.Z=$t},98040:function(Fr){Fr.exports=function(){var Ct=document.getSelection();if(!Ct.rangeCount)return function(){};for(var Y=document.activeElement,U=[],Pe=0;Pe<Ct.rangeCount;Pe++)U.push(Ct.getRangeAt(Pe));switch(Y.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":Y.blur();break;default:Y=null;break}return Ct.removeAllRanges(),function(){Ct.type==="Caret"&&Ct.removeAllRanges(),Ct.rangeCount||U.forEach(function(We){Ct.addRange(We)}),Y&&Y.focus()}}},16471:function(Fr,Ct,Y){"use strict";Y.d(Ct,{ZP:function(){return qo}});const U=Number.isFinite||function(h){return typeof h=="number"&&isFinite(h)},Pe=Number.isSafeInteger||function(h){return typeof h=="number"&&Math.abs(h)<=We},We=Number.MAX_SAFE_INTEGER||9007199254740991;let Me=function(h){return h.NETWORK_ERROR="networkError",h.MEDIA_ERROR="mediaError",h.KEY_SYSTEM_ERROR="keySystemError",h.MUX_ERROR="muxError",h.OTHER_ERROR="otherError",h}({}),ae=function(h){return h.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",h.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",h.KEY_SYSTEM_NO_SESSION="keySystemNoSession",h.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",h.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",h.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",h.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",h.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",h.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",h.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",h.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",h.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",h.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",h.MANIFEST_LOAD_ERROR="manifestLoadError",h.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",h.MANIFEST_PARSING_ERROR="manifestParsingError",h.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",h.LEVEL_EMPTY_ERROR="levelEmptyError",h.LEVEL_LOAD_ERROR="levelLoadError",h.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",h.LEVEL_PARSING_ERROR="levelParsingError",h.LEVEL_SWITCH_ERROR="levelSwitchError",h.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",h.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",h.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",h.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",h.FRAG_LOAD_ERROR="fragLoadError",h.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",h.FRAG_DECRYPT_ERROR="fragDecryptError",h.FRAG_PARSING_ERROR="fragParsingError",h.FRAG_GAP="fragGap",h.REMUX_ALLOC_ERROR="remuxAllocError",h.KEY_LOAD_ERROR="keyLoadError",h.KEY_LOAD_TIMEOUT="keyLoadTimeOut",h.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",h.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",h.BUFFER_APPEND_ERROR="bufferAppendError",h.BUFFER_APPENDING_ERROR="bufferAppendingError",h.BUFFER_STALLED_ERROR="bufferStalledError",h.BUFFER_FULL_ERROR="bufferFullError",h.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",h.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",h.ASSET_LIST_LOAD_ERROR="assetListLoadError",h.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",h.ASSET_LIST_PARSING_ERROR="assetListParsingError",h.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",h.INTERNAL_EXCEPTION="internalException",h.INTERNAL_ABORTED="aborted",h.ATTACH_MEDIA_ERROR="attachMediaError",h.UNKNOWN="unknown",h}({}),E=function(h){return h.MEDIA_ATTACHING="hlsMediaAttaching",h.MEDIA_ATTACHED="hlsMediaAttached",h.MEDIA_DETACHING="hlsMediaDetaching",h.MEDIA_DETACHED="hlsMediaDetached",h.MEDIA_ENDED="hlsMediaEnded",h.STALL_RESOLVED="hlsStallResolved",h.BUFFER_RESET="hlsBufferReset",h.BUFFER_CODECS="hlsBufferCodecs",h.BUFFER_CREATED="hlsBufferCreated",h.BUFFER_APPENDING="hlsBufferAppending",h.BUFFER_APPENDED="hlsBufferAppended",h.BUFFER_EOS="hlsBufferEos",h.BUFFERED_TO_END="hlsBufferedToEnd",h.BUFFER_FLUSHING="hlsBufferFlushing",h.BUFFER_FLUSHED="hlsBufferFlushed",h.MANIFEST_LOADING="hlsManifestLoading",h.MANIFEST_LOADED="hlsManifestLoaded",h.MANIFEST_PARSED="hlsManifestParsed",h.LEVEL_SWITCHING="hlsLevelSwitching",h.LEVEL_SWITCHED="hlsLevelSwitched",h.LEVEL_LOADING="hlsLevelLoading",h.LEVEL_LOADED="hlsLevelLoaded",h.LEVEL_UPDATED="hlsLevelUpdated",h.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",h.LEVELS_UPDATED="hlsLevelsUpdated",h.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",h.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",h.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",h.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",h.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",h.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",h.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",h.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",h.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",h.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",h.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",h.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",h.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",h.CUES_PARSED="hlsCuesParsed",h.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",h.INIT_PTS_FOUND="hlsInitPtsFound",h.FRAG_LOADING="hlsFragLoading",h.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",h.FRAG_LOADED="hlsFragLoaded",h.FRAG_DECRYPTED="hlsFragDecrypted",h.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",h.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",h.FRAG_PARSING_METADATA="hlsFragParsingMetadata",h.FRAG_PARSED="hlsFragParsed",h.FRAG_BUFFERED="hlsFragBuffered",h.FRAG_CHANGED="hlsFragChanged",h.FPS_DROP="hlsFpsDrop",h.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",h.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",h.ERROR="hlsError",h.DESTROYING="hlsDestroying",h.KEY_LOADING="hlsKeyLoading",h.KEY_LOADED="hlsKeyLoaded",h.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",h.BACK_BUFFER_REACHED="hlsBackBufferReached",h.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",h.ASSET_LIST_LOADING="hlsAssetListLoading",h.ASSET_LIST_LOADED="hlsAssetListLoaded",h.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",h.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",h.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",h.INTERSTITIAL_STARTED="hlsInterstitialStarted",h.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",h.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",h.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",h.INTERSTITIAL_ENDED="hlsInterstitialEnded",h.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",h.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",h.EVENT_CUE_ENTER="hlsEventCueEnter",h}({});var Te={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},z={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class d{constructor(t,i=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=i,this.totalWeight_=s}sample(t,i){const s=Math.pow(this.alpha_,t);this.estimate_=i*(1-s)+s*this.estimate_,this.totalWeight_+=t}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_}}class ne{constructor(t,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 d(t),this.fast_=new d(i),this.defaultTTFB_=o,this.ttfb_=new d(t)}update(t,i){const{slow_:s,fast_:o,ttfb_:l}=this;s.halfLife!==t&&(this.slow_=new d(t,s.getEstimate(),s.getTotalWeight())),o.halfLife!==i&&(this.fast_=new d(i,o.getEstimate(),o.getTotalWeight())),l.halfLife!==t&&(this.ttfb_=new d(t,l.getEstimate(),l.getTotalWeight()))}sample(t,i){t=Math.max(t,this.minDelayMs_);const s=8*i,o=t/1e3,l=s/o;this.fast_.sample(o,l),this.slow_.sample(o,l)}sampleTTFB(t){const i=t/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(i,2)/2);this.ttfb_.sample(s,Math.max(t,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_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function q(h,t,i){return(t=he(t))in h?Object.defineProperty(h,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):h[t]=i,h}function M(){return M=Object.assign?Object.assign.bind():function(h){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(h[s]=i[s])}return h},M.apply(null,arguments)}function L(h,t){var i=Object.keys(h);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(h);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(h,o).enumerable})),i.push.apply(i,s)}return i}function O(h){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?L(Object(i),!0).forEach(function(s){q(h,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach(function(s){Object.defineProperty(h,s,Object.getOwnPropertyDescriptor(i,s))})}return h}function G(h,t){if(typeof h!="object"||!h)return h;var i=h[Symbol.toPrimitive];if(i!==void 0){var s=i.call(h,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(h)}function he(h){var t=G(h,"string");return typeof t=="symbol"?t:t+""}class le{constructor(t,i){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const s=`[${t}]:`;this.trace=J,this.debug=i.debug.bind(null,s),this.log=i.log.bind(null,s),this.warn=i.warn.bind(null,s),this.info=i.info.bind(null,s),this.error=i.error.bind(null,s)}}const J=function(){},B={trace:J,debug:J,log:J,warn:J,info:J,error:J};function V(){return M({},B)}function H(h,t){const i=self.console[h];return i?i.bind(self.console,`${t?"["+t+"] ":""}[${h}] >`):J}function ie(h,t,i){return t[h]?t[h].bind(t):H(h,i)}const De=V();function $e(h,t,i){const s=V();if(typeof console=="object"&&h===!0||typeof h=="object"){const o=["debug","log","info","warn","error"];o.forEach(l=>{s[l]=ie(l,h,i)});try{s.log(`Debug logs enabled for "${t}" in hls.js version 1.6.15`)}catch(l){return V()}o.forEach(l=>{De[l]=ie(l,h)})}else M(De,s);return s}const Se=De;function Ye(h=!0){return typeof self=="undefined"?void 0:(h||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function lt(h){return typeof self!="undefined"&&h===self.ManagedMediaSource}function Xe(h,t){const i=Object.keys(h),s=Object.keys(t),o=i.length,l=s.length;return!o||!l||o===l&&!i.some(u=>s.indexOf(u)===-1)}function $t(h,t=!1){if(typeof TextDecoder!="undefined"){const v=new TextDecoder("utf-8").decode(h);if(t){const x=v.indexOf("\0");return x!==-1?v.substring(0,x):v}return v.replace(/\0/g,"")}const i=h.length;let s,o,l,u="",f=0;for(;f<i;){if(s=h[f++],s===0&&t)return u;if(s===0||s===3)continue;switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:u+=String.fromCharCode(s);break;case 12:case 13:o=h[f++],u+=String.fromCharCode((s&31)<<6|o&63);break;case 14:o=h[f++],l=h[f++],u+=String.fromCharCode((s&15)<<12|(o&63)<<6|(l&63)<<0);break}}return u}function ye(h){let t="";for(let i=0;i<h.length;i++){let s=h[i].toString(16);s.length<2&&(s="0"+s),t+=s}return t}function oe(h){return Uint8Array.from(h.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function me(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var ge={exports:{}},Ee;function be(){return Ee||(Ee=1,function(h,t){(function(i){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,o=/^(?=([^\/?#]*))\1([^]*)$/,l=/(?:\/|^)\.(?=\/)/g,u=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,f={buildAbsoluteURL:function(y,v,x){if(x=x||{},y=y.trim(),v=v.trim(),!v){if(!x.alwaysNormalize)return y;var w=f.parseURL(y);if(!w)throw new Error("Error trying to parse base URL.");return w.path=f.normalizePath(w.path),f.buildURLFromParts(w)}var k=f.parseURL(v);if(!k)throw new Error("Error trying to parse relative URL.");if(k.scheme)return x.alwaysNormalize?(k.path=f.normalizePath(k.path),f.buildURLFromParts(k)):v;var F=f.parseURL(y);if(!F)throw new Error("Error trying to parse base URL.");if(!F.netLoc&&F.path&&F.path[0]!=="/"){var $=o.exec(F.path);F.netLoc=$[1],F.path=$[2]}F.netLoc&&!F.path&&(F.path="/");var Q={scheme:F.scheme,netLoc:k.netLoc,path:null,params:k.params,query:k.query,fragment:k.fragment};if(!k.netLoc&&(Q.netLoc=F.netLoc,k.path[0]!=="/"))if(!k.path)Q.path=F.path,k.params||(Q.params=F.params,k.query||(Q.query=F.query));else{var te=F.path,xe=te.substring(0,te.lastIndexOf("/")+1)+k.path;Q.path=f.normalizePath(xe)}return Q.path===null&&(Q.path=x.alwaysNormalize?f.normalizePath(k.path):k.path),f.buildURLFromParts(Q)},parseURL:function(y){var v=s.exec(y);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(y){for(y=y.split("").reverse().join("").replace(l,"");y.length!==(y=y.replace(u,"")).length;);return y.split("").reverse().join("")},buildURLFromParts:function(y){return y.scheme+y.netLoc+y.path+y.params+y.query+y.fragment}};h.exports=f})()}(ge)),ge.exports}var D=be();class R{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 se={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Ie{constructor(t){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof t=="string"&&(t={url:t}),this.base=t,Ht(this,"stats")}setByteRange(t,i){const s=t.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 baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[se.AUDIO]:null,[se.VIDEO]:null,[se.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(t){this._streams=t}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new R),this._stats}set stats(t){this._stats=t}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=D.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[se.AUDIO]=null,t[se.VIDEO]=null,t[se.AUDIOVIDEO]=null}}function at(h){return h.sn!=="initSegment"}class Et extends Ie{constructor(t,i){super(i),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=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.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,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=t}get byteLength(){if(this.hasStats){const t=this.stats.total;if(t)return t}if(this.byteRange.length){const t=this.byteRange[0],i=this.byteRange[1];if(U(t)&&U(i))return i-t}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(t){this._bitrate=t}get decryptdata(){var t;const{levelkeys:i}=this;if(!i||i.NONE)return null;if(i.identity)this._decryptdata||(this._decryptdata=i.identity.getDecryptData(this.sn));else if(!((t=this._decryptdata)!=null&&t.keyId)){const s=Object.keys(i);if(s.length===1){const o=this._decryptdata=i[s[0]]||null;o&&(this._decryptdata=o.getDecryptData(this.sn,i))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const t=U(this.duration)?this.duration:0;return this.programDateTime+t*1e3}get encrypted(){var t;if((t=this._decryptdata)!=null&&t.encrypted)return!0;if(this.levelkeys){var i;const s=Object.keys(this.levelkeys),o=s.length;if(o>1||o===1&&(i=this.levelkeys[s[0]])!=null&&i.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(t){if(!U(t)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=t}get ref(){return at(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(t){this.setStart(this.start+t)}setStart(t){this.start=t,this._ref&&(this._ref.start=t)}setDuration(t){this.duration=t,this._ref&&(this._ref.duration=t)}setKeyFormat(t){const i=this.levelkeys;if(i){var s;const o=i[t];o&&!((s=this._decryptdata)!=null&&s.keyId)&&(this._decryptdata=o.getDecryptData(this.sn,i))}}abortRequests(){var t,i;(t=this.loader)==null||t.abort(),(i=this.keyLoader)==null||i.abort()}setElementaryStreamInfo(t,i,s,o,l,u=!1){const{elementaryStreams:f}=this,y=f[t];if(!y){f[t]={startPTS:i,endPTS:s,startDTS:o,endDTS:l,partial:u};return}y.startPTS=Math.min(y.startPTS,i),y.endPTS=Math.max(y.endPTS,s),y.startDTS=Math.min(y.startDTS,o),y.endDTS=Math.max(y.endDTS,l)}}class bt extends Ie{constructor(t,i,s,o,l){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.duration=t.decimalFloatingPoint("DURATION"),this.gap=t.bool("GAP"),this.independent=t.bool("INDEPENDENT"),this.relurl=t.enumeratedString("URI"),this.fragment=i,this.index=o;const u=t.enumeratedString("BYTERANGE");u&&this.setByteRange(u,l),l&&(this.fragOffset=l.fragOffset+l.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:t}=this;return!!(t.audio||t.video||t.audiovideo)}}function He(h,t){const i=Object.getPrototypeOf(h);if(i){const s=Object.getOwnPropertyDescriptor(i,t);return s||He(i,t)}}function Ht(h,t){const i=He(h,t);i&&(i.enumerable=!0,Object.defineProperty(h,t,i))}const gt=Math.pow(2,32)-1,Qe=[].push,xr={video:1,audio:2,id3:3,text:4};function mr(h){return String.fromCharCode.apply(null,h)}function pi(h,t){const i=h[t]<<8|h[t+1];return i<0?65536+i:i}function Wt(h,t){const i=et(h,t);return i<0?4294967296+i:i}function si(h,t){let i=Wt(h,t);return i*=Math.pow(2,32),i+=Wt(h,t+4),i}function et(h,t){return h[t]<<24|h[t+1]<<16|h[t+2]<<8|h[t+3]}function ct(h){const t=h.byteLength;for(let i=0;i<t;){const s=Wt(h,i);if(s>8&&h[i+4]===109&&h[i+5]===111&&h[i+6]===111&&h[i+7]===102)return!0;i=s>1?i+s:t}return!1}function Ue(h,t){const i=[];if(!t.length)return i;const s=h.byteLength;for(let o=0;o<s;){const l=Wt(h,o),u=mr(h.subarray(o+4,o+8)),f=l>1?o+l:s;if(u===t[0])if(t.length===1)i.push(h.subarray(o+8,f));else{const y=Ue(h.subarray(o+8,f),t.slice(1));y.length&&Qe.apply(i,y)}o=f}return i}function wt(h){const t=[],i=h[0];let s=8;const o=Wt(h,s);s+=4;let l=0,u=0;i===0?(l=Wt(h,s),u=Wt(h,s+4),s+=8):(l=si(h,s),u=si(h,s+8),s+=16),s+=2;let f=h.length+u;const y=pi(h,s);s+=2;for(let v=0;v<y;v++){let x=s;const w=Wt(h,x);x+=4;const k=w&2147483647;if((w&2147483648)>>>31===1)return Se.warn("SIDX has hierarchical references (not supported)"),null;const $=Wt(h,x);x+=4,t.push({referenceSize:k,subsegmentDuration:$,info:{duration:$/o,start:f,end:f+k-1}}),f+=k,x+=4,s=x}return{earliestPresentationTime:l,timescale:o,version:i,referencesCount:y,references:t}}function Rt(h){const t=[],i=Ue(h,["moov","trak"]);for(let o=0;o<i.length;o++){const l=i[o],u=Ue(l,["tkhd"])[0];if(u){let f=u[0];const y=Wt(u,f===0?12:20),v=Ue(l,["mdia","mdhd"])[0];if(v){f=v[0];const x=Wt(v,f===0?12:20),w=Ue(l,["mdia","hdlr"])[0];if(w){const k=mr(w.subarray(8,12)),F={soun:se.AUDIO,vide:se.VIDEO}[k],$=Ue(l,["mdia","minf","stbl","stsd"])[0],Q=Dt($);F?(t[y]={timescale:x,type:F,stsd:Q},t[F]=O({timescale:x,id:y},Q)):t[y]={timescale:x,type:k,stsd:Q}}}}}return Ue(h,["moov","mvex","trex"]).forEach(o=>{const l=Wt(o,4),u=t[l];u&&(u.default={duration:Wt(o,12),flags:Wt(o,20)})}),t}function Dt(h){const t=h.subarray(8),i=t.subarray(86),s=mr(t.subarray(4,8));let o=s,l;const u=s==="enca"||s==="encv";if(u){const v=Ue(t,[s])[0].subarray(s==="enca"?28:78);Ue(v,["sinf"]).forEach(w=>{const k=Ue(w,["schm"])[0];if(k){const F=mr(k.subarray(4,8));if(F==="cbcs"||F==="cenc"){const $=Ue(w,["frma"])[0];$&&(o=mr($))}}})}const f=o;switch(o){case"avc1":case"avc2":case"avc3":case"avc4":{const y=Ue(i,["avcC"])[0];y&&y.length>3&&(o+="."+ut(y[1])+ut(y[2])+ut(y[3]),l=fe(f==="avc1"?"dva1":"dvav",i));break}case"mp4a":{const y=Ue(t,[s])[0],v=Ue(y.subarray(28),["esds"])[0];if(v&&v.length>7){let x=4;if(v[x++]!==3)break;x=it(v,x),x+=2;const w=v[x++];if(w&128&&(x+=2),w&64&&(x+=v[x++]),v[x++]!==4)break;x=it(v,x);const k=v[x++];if(k===64)o+="."+ut(k);else break;if(x+=12,v[x++]!==5)break;x=it(v,x);const F=v[x++];let $=(F&248)>>3;$===31&&($+=1+((F&7)<<3)+((v[x]&224)>>5)),o+="."+$}break}case"hvc1":case"hev1":{const y=Ue(i,["hvcC"])[0];if(y&&y.length>12){const v=y[1],x=["","A","B","C"][v>>6],w=v&31,k=Wt(y,2),F=(v&32)>>5?"H":"L",$=y[12],Q=y.subarray(6,12);o+="."+x+w,o+="."+ze(k).toString(16).toUpperCase(),o+="."+F+$;let te="";for(let xe=Q.length;xe--;){const ke=Q[xe];(ke||te)&&(te="."+ke.toString(16).toUpperCase()+te)}o+=te}l=fe(f=="hev1"?"dvhe":"dvh1",i);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{o=fe(o,i)||o;break}case"vp09":{const y=Ue(i,["vpcC"])[0];if(y&&y.length>6){const v=y[4],x=y[5],w=y[6]>>4&15;o+="."+_t(v)+"."+_t(x)+"."+_t(w)}break}case"av01":{const y=Ue(i,["av1C"])[0];if(y&&y.length>2){const v=y[1]>>>5,x=y[1]&31,w=y[2]>>>7?"H":"M",k=(y[2]&64)>>6,F=(y[2]&32)>>5,$=v===2&&k?F?12:10:k?10:8,Q=(y[2]&16)>>4,te=(y[2]&8)>>3,xe=(y[2]&4)>>2,ke=y[2]&3;o+="."+v+"."+_t(x)+w+"."+_t($)+"."+Q+"."+te+xe+ke+"."+_t(1)+"."+_t(1)+"."+_t(1)+"."+0,l=fe("dav1",i)}break}}return{codec:o,encrypted:u,supplemental:l}}function fe(h,t){const i=Ue(t,["dvvC"]),s=i.length?i[0]:Ue(t,["dvcC"])[0];if(s){const o=s[2]>>1&127,l=s[2]<<5&32|s[3]>>3&31;return h+"."+_t(o)+"."+_t(l)}}function ze(h){let t=0;for(let i=0;i<32;i++)t|=(h>>i&1)<<31-i;return t>>>0}function it(h,t){const i=t+5;for(;h[t++]&128&&t<i;);return t}function ut(h){return("0"+h.toString(16).toUpperCase()).slice(-2)}function _t(h){return(h<10?"0":"")+h}function Ft(h,t){if(!h||!t)return;const i=t.keyId;i&&t.isCommonEncryption&&Pt(h,(s,o)=>{const l=s.subarray(8,24);l.some(u=>u!==0)||(Se.log(`[eme] Patching keyId in 'enc${o?"a":"v"}>sinf>>tenc' box: ${ye(l)} -> ${ye(i)}`),s.set(i,8))})}function nr(h){const t=[];return Pt(h,i=>t.push(i.subarray(8,24))),t}function Pt(h,t){Ue(h,["moov","trak"]).forEach(s=>{const o=Ue(s,["mdia","minf","stbl","stsd"])[0];if(!o)return;const l=o.subarray(8);let u=Ue(l,["enca"]);const f=u.length>0;f||(u=Ue(l,["encv"])),u.forEach(y=>{const v=f?y.subarray(28):y.subarray(78);Ue(v,["sinf"]).forEach(w=>{const k=Ve(w);k&&t(k,f)})})})}function Ve(h){const t=Ue(h,["schm"])[0];if(t){const i=mr(t.subarray(4,8));if(i==="cbcs"||i==="cenc"){const s=Ue(h,["schi","tenc"])[0];if(s)return s}}}function Bt(h,t,i){const s={},o=Ue(h,["moof","traf"]);for(let l=0;l<o.length;l++){const u=o[l],f=Ue(u,["tfhd"])[0],y=Wt(f,4),v=t[y];if(!v)continue;s[y]||(s[y]={start:NaN,duration:0,sampleCount:0,timescale:v.timescale,type:v.type});const x=s[y],w=Ue(u,["tfdt"])[0];if(w){const Le=w[0];let Ze=Wt(w,4);Le===1&&(Ze===gt?i.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(Ze*=gt+1,Ze+=Wt(w,8))),U(Ze)&&(!U(x.start)||Ze<x.start)&&(x.start=Ze)}const k=v.default,F=Wt(f,0)|(k==null?void 0:k.flags);let $=(k==null?void 0:k.duration)||0;F&8&&(F&2?$=Wt(f,12):$=Wt(f,8));const Q=Ue(u,["trun"]);let te=x.start||0,xe=0,ke=$;for(let Le=0;Le<Q.length;Le++){const Ze=Q[Le],rt=Wt(Ze,4),Lt=x.sampleCount;x.sampleCount+=rt;const ot=Ze[3]&1,St=Ze[3]&4,xt=Ze[2]&1,ht=Ze[2]&2,jt=Ze[2]&4,Br=Ze[2]&8;let ei=8,vi=rt;for(ot&&(ei+=4),St&&rt&&(!(Ze[ei+1]&1)&&x.keyFrameIndex===void 0&&(x.keyFrameIndex=Lt),ei+=4,xt?(ke=Wt(Ze,ei),ei+=4):ke=$,ht&&(ei+=4),Br&&(ei+=4),te+=ke,xe+=ke,vi--);vi--;)xt?(ke=Wt(Ze,ei),ei+=4):ke=$,ht&&(ei+=4),jt&&(Ze[ei+1]&1||x.keyFrameIndex===void 0&&(x.keyFrameIndex=x.sampleCount-(vi+1),x.keyFrameStart=te),ei+=4),Br&&(ei+=4),te+=ke,xe+=ke;!xe&&$&&(xe+=$*rt)}x.duration+=xe}if(!Object.keys(s).some(l=>s[l].duration)){let l=1/0,u=0;const f=Ue(h,["sidx"]);for(let y=0;y<f.length;y++){const v=wt(f[y]);if(v!=null&&v.references){l=Math.min(l,v.earliestPresentationTime/v.timescale);const x=v.references.reduce((w,k)=>w+k.info.duration||0,0);u=Math.max(u,x+v.earliestPresentationTime/v.timescale)}}u&&U(u)&&Object.keys(s).forEach(y=>{s[y].duration||(s[y].duration=u*s[y].timescale-s[y].start)})}return s}function gr(h){const t={valid:null,remainder:null},i=Ue(h,["moof"]);if(i.length<2)return t.remainder=h,t;const s=i[i.length-1];return t.valid=h.slice(0,s.byteOffset-8),t.remainder=h.slice(s.byteOffset-8),t}function Kt(h,t){const i=new Uint8Array(h.length+t.length);return i.set(h),i.set(t,h.length),i}function qt(h,t){const i=[],s=t.samples,o=t.timescale,l=t.id;let u=!1;return Ue(s,["moof"]).map(y=>{const v=y.byteOffset-8;Ue(y,["traf"]).map(w=>{const k=Ue(w,["tfdt"]).map(F=>{const $=F[0];let Q=Wt(F,4);return $===1&&(Q*=Math.pow(2,32),Q+=Wt(F,8)),Q/o})[0];return k!==void 0&&(h=k),Ue(w,["tfhd"]).map(F=>{const $=Wt(F,4),Q=Wt(F,0)&16777215,te=(Q&1)!==0,xe=(Q&2)!==0,ke=(Q&8)!==0;let Le=0;const Ze=(Q&16)!==0;let rt=0;const Lt=(Q&32)!==0;let ot=8;$===l&&(te&&(ot+=8),xe&&(ot+=4),ke&&(Le=Wt(F,ot),ot+=4),Ze&&(rt=Wt(F,ot),ot+=4),Lt&&(ot+=4),t.type==="video"&&(u=Gt(t.codec)),Ue(w,["trun"]).map(St=>{const xt=St[0],ht=Wt(St,0)&16777215,jt=(ht&1)!==0;let Br=0;const ei=(ht&4)!==0,vi=(ht&256)!==0;let Xr=0;const Cr=(ht&512)!==0;let ii=0;const Gr=(ht&1024)!==0,li=(ht&2048)!==0;let Li=0;const _r=Wt(St,4);let Pr=8;jt&&(Br=Wt(St,Pr),Pr+=4),ei&&(Pr+=4);let Ui=Br+v;for(let Rn=0;Rn<_r;Rn++){if(vi?(Xr=Wt(St,Pr),Pr+=4):Xr=Le,Cr?(ii=Wt(St,Pr),Pr+=4):ii=rt,Gr&&(Pr+=4),li&&(xt===0?Li=Wt(St,Pr):Li=et(St,Pr),Pr+=4),t.type===se.VIDEO){let ui=0;for(;ui<ii;){const an=Wt(s,Ui);if(Ui+=4,Lr(u,s[Ui])){const js=s.subarray(Ui,Ui+an);wr(js,u?2:1,h+Li/o,i)}Ui+=an,ui+=an+4}}h+=Xr/o}}))})})}),i}function Gt(h){if(!h)return!1;const t=h.substring(0,4);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function Lr(h,t){if(h){const i=t>>1&63;return i===39||i===40}else return(t&31)===6}function wr(h,t,i,s){const o=Xt(h);let l=0;l+=t;let u=0,f=0,y=0;for(;l<o.length;){u=0;do{if(l>=o.length)break;y=o[l++],u+=y}while(y===255);f=0;do{if(l>=o.length)break;y=o[l++],f+=y}while(y===255);const v=o.length-l;let x=l;if(f<v)l+=f;else if(f>v){Se.error(`Malformed SEI payload. ${f} is too small, only ${v} bytes left to parse.`);break}if(u===4){if(o[x++]===181){const k=pi(o,x);if(x+=2,k===49){const F=Wt(o,x);if(x+=4,F===1195456820){const $=o[x++];if($===3){const Q=o[x++],te=31&Q,xe=64&Q,ke=xe?2+te*3:0,Le=new Uint8Array(ke);if(xe){Le[0]=Q;for(let Ze=1;Ze<ke;Ze++)Le[Ze]=o[x++]}s.push({type:$,payloadType:u,pts:i,bytes:Le})}}}}}else if(u===5&&f>16){const w=[];for(let $=0;$<16;$++){const Q=o[x++].toString(16);w.push(Q.length==1?"0"+Q:Q),($===3||$===5||$===7||$===9)&&w.push("-")}const k=f-16,F=new Uint8Array(k);for(let $=0;$<k;$++)F[$]=o[x++];s.push({payloadType:u,pts:i,uuid:w.join(""),userData:$t(F),userDataBytes:F})}}}function Xt(h){const t=h.byteLength,i=[];let s=1;for(;s<t-2;)h[s]===0&&h[s+1]===0&&h[s+2]===3?(i.push(s+2),s+=2):s++;if(i.length===0)return h;const o=t-i.length,l=new Uint8Array(o);let u=0;for(s=0;s<o;u++,s++)u===i[0]&&(u++,i.shift()),l[s]=h[u];return l}function Ar(h){const t=h[0];let i="",s="",o=0,l=0,u=0,f=0,y=0,v=0;if(t===0){for(;mr(h.subarray(v,v+1))!=="\0";)i+=mr(h.subarray(v,v+1)),v+=1;for(i+=mr(h.subarray(v,v+1)),v+=1;mr(h.subarray(v,v+1))!=="\0";)s+=mr(h.subarray(v,v+1)),v+=1;s+=mr(h.subarray(v,v+1)),v+=1,o=Wt(h,12),l=Wt(h,16),f=Wt(h,20),y=Wt(h,24),v=28}else if(t===1){v+=4,o=Wt(h,v),v+=4;const w=Wt(h,v);v+=4;const k=Wt(h,v);for(v+=4,u=Lo(2,32)*w+k,Pe(u)||(u=Number.MAX_SAFE_INTEGER,Se.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),f=Wt(h,v),v+=4,y=Wt(h,v),v+=4;mr(h.subarray(v,v+1))!=="\0";)i+=mr(h.subarray(v,v+1)),v+=1;for(i+=mr(h.subarray(v,v+1)),v+=1;mr(h.subarray(v,v+1))!=="\0";)s+=mr(h.subarray(v,v+1)),v+=1;s+=mr(h.subarray(v,v+1)),v+=1}const x=h.subarray(v,h.byteLength);return{schemeIdUri:i,value:s,timeScale:o,presentationTime:u,presentationTimeDelta:l,eventDuration:f,id:y,payload:x}}function C(h,...t){const i=t.length;let s=8,o=i;for(;o--;)s+=t[o].byteLength;const l=new Uint8Array(s);for(l[0]=s>>24&255,l[1]=s>>16&255,l[2]=s>>8&255,l[3]=s&255,l.set(h,4),o=0,s=8;o<i;o++)l.set(t[o],s),s+=t[o].byteLength;return l}function N(h,t,i){if(h.byteLength!==16)throw new RangeError("Invalid system id");let s,o;s=0,o=new Uint8Array;let l;s>0?(l=new Uint8Array(4),t.length>0&&new DataView(l.buffer).setUint32(0,t.length,!1)):l=new Uint8Array;const u=new Uint8Array(4);return i.byteLength>0&&new DataView(u.buffer).setUint32(0,i.byteLength,!1),C([112,115,115,104],new Uint8Array([s,0,0,0]),h,l,o,u,i)}function yt(h){const t=[];if(h instanceof ArrayBuffer){const i=h.byteLength;let s=0;for(;s+32<i;){const o=new DataView(h,s),l=X(o);t.push(l),s+=l.size}}return t}function X(h){const t=h.getUint32(0),i=h.byteOffset,s=h.byteLength;if(s<t)return{offset:i,size:s};if(h.getUint32(4)!==1886614376)return{offset:i,size:t};const l=h.getUint32(8)>>>24;if(l!==0&&l!==1)return{offset:i,size:t};const u=h.buffer,f=ye(new Uint8Array(u,i+12,16));let y=null,v=null,x=0;if(l===0)x=28;else{const k=h.getUint32(28);if(!k||s<32+k*16)return{offset:i,size:t};y=[];for(let F=0;F<k;F++)y.push(new Uint8Array(u,i+32+F*16,16));x=32+k*16}if(!x)return{offset:i,size:t};const w=h.getUint32(x);return t-32<w?{offset:i,size:t}:(v=new Uint8Array(u,i+x+4,w),{version:l,systemId:f,kids:y,data:v,offset:i,size:t})}const ue=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),br={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,dav1:.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 Ne(h,t){const i=br[t];return!!i&&!!i[h.slice(0,4)]}function Fe(h,t,i=!0){return!h.split(",").some(s=>!qe(s,t,i))}function qe(h,t,i=!0){var s;const o=Ye(i);return(s=o==null?void 0:o.isTypeSupported(ee(h,t)))!=null?s:!1}function ee(h,t){return`${t}/mp4;codecs=${h}`}function de(h){if(h){const t=h.substring(0,4);return br.video[t]}return 2}function Re(h){const t=ue();return h.split(",").reduce((i,s)=>{const l=t&&Gt(s)?9:br.video[s];return l?(l*2+i)/(i?3:2):(br.audio[s]+i)/(i?2:1)},0)}const Ge={};function Z(h,t=!0){if(Ge[h])return Ge[h];const i={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[h];for(let o=0;o<i.length;o++){var s;if(qe(i[o],"audio",t))return Ge[h]=i[o],i[o];if(i[o]==="mp3"&&(s=Ye(t))!=null&&s.isTypeSupported("audio/mpeg"))return""}return h}const Nt=/flac|opus|mp4a\.40\.34/i;function Ae(h,t=!0){return h.replace(Nt,i=>Z(i.toLowerCase(),t))}function sr(h,t){const i=[];if(h){const s=h.split(",");for(let o=0;o<s.length;o++)Ne(s[o],"video")||i.push(s[o])}return t&&i.push(t),i.join(",")}function Sr(h,t){if(h&&(h.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(h)!==-1)&&(mi(h,"audio")||mi(h,"video")))return h;if(t){const i=t.split(",");if(i.length>1){if(h){for(let s=i.length;s--;)if(i[s].substring(0,4)===h.substring(0,4))return i[s]}return i[0]}}return t||h}function mi(h,t){return Ne(h,t)&&qe(h,t)}function Hi(h){const t=h.split(",");for(let i=0;i<t.length;i++){const s=t[i].split(".");s.length>2&&s[0]==="avc1"&&(t[i]=`avc1.${parseInt(s[1]).toString(16)}${("000"+parseInt(s[2]).toString(16)).slice(-4)}`)}return t.join(",")}function Ai(h){if(h.startsWith("av01.")){const t=h.split("."),i=["0","111","01","01","01","0"];for(let s=t.length;s>4&&s<10;s++)t[s]=i[s-4];return t.join(".")}return h}function zr(h){const t=Ye(h)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:t.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Ji(h){return h.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Cn={supported:!0,powerEfficient:!0,smooth:!0},Di={supported:!1,smooth:!1,powerEfficient:!1},Ii={supported:!0,configurations:[],decodingInfoResults:[Cn]};function ar(h,t){return{supported:!1,configurations:t,decodingInfoResults:[Di],error:h}}function Wr(h,t,i,s,o,l){const u=h.videoCodec,f=h.audioCodec?h.audioGroups:null,y=l==null?void 0:l.audioCodec,v=l==null?void 0:l.channels,x=v?parseInt(v):y?1/0:2;let w=null;if(f!=null&&f.length)try{f.length===1&&f[0]?w=t.groups[f[0]].channels:w=f.reduce((k,F)=>{if(F){const $=t.groups[F];if(!$)throw new Error(`Audio track group ${F} not found`);Object.keys($.channels).forEach(Q=>{k[Q]=(k[Q]||0)+$.channels[Q]})}return k},{2:0})}catch(k){return!0}return u!==void 0&&(u.split(",").some(k=>Gt(k))||h.width>1920&&h.height>1088||h.height>1920&&h.width>1088||h.frameRate>Math.max(s,30)||h.videoRange!=="SDR"&&h.videoRange!==i||h.bitrate>Math.max(o,8e6))||!!w&&U(x)&&Object.keys(w).some(k=>parseInt(k)>x)}function pe(h,t,i,s={}){const o=h.videoCodec;if(!o&&!h.audioCodec||!i)return Promise.resolve(Ii);const l=[],u=we(h),f=u.length,y=kt(h,t,f>0),v=y.length;for(let x=f||1*v||1;x--;){const w={type:"media-source"};if(f&&(w.video=u[x%f]),v){w.audio=y[x%v];const k=w.audio.bitrate;w.video&&k&&(w.video.bitrate-=k)}l.push(w)}if(o){const x=navigator.userAgent;if(o.split(",").some(w=>Gt(w))&&ue())return Promise.resolve(ar(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${x})`),l))}return Promise.all(l.map(x=>{const w=rr(x);return s[w]||(s[w]=i.decodingInfo(x))})).then(x=>({supported:!x.some(w=>!w.supported),configurations:l,decodingInfoResults:x})).catch(x=>({supported:!1,configurations:l,decodingInfoResults:[],error:x}))}function we(h){var t;const i=(t=h.videoCodec)==null?void 0:t.split(","),s=Yt(h),o=h.width||640,l=h.height||480,u=h.frameRate||30,f=h.videoRange.toLowerCase();return i?i.map(y=>{const v={contentType:ee(Ai(y),"video"),width:o,height:l,bitrate:s,framerate:u};return f!=="sdr"&&(v.transferFunction=f),v}):[]}function kt(h,t,i){var s;const o=(s=h.audioCodec)==null?void 0:s.split(","),l=Yt(h);return o&&h.audioGroups?h.audioGroups.reduce((u,f)=>{var y;const v=f?(y=t.groups[f])==null?void 0:y.tracks:null;return v?v.reduce((x,w)=>{if(w.groupId===f){const k=parseFloat(w.channels||"");o.forEach(F=>{const $={contentType:ee(F,"audio"),bitrate:i?Ot(F,l):l};k&&($.channels=""+k),x.push($)})}return x},u):u},[]):[]}function Ot(h,t){if(t<=1)return 1;let i=128e3;return h==="ec-3"?i=768e3:h==="ac-3"&&(i=64e4),Math.min(t/2,i)}function Yt(h){return Math.ceil(Math.max(h.bitrate*.9,h.averageBitrate)/1e3)*1e3||1}function rr(h){let t="";const{audio:i,video:s}=h;if(s){const o=Ji(s.contentType);t+=`${o}_r${s.height}x${s.width}f${Math.ceil(s.framerate)}${s.transferFunction||"sd"}_${Math.ceil(s.bitrate/1e5)}`}if(i){const o=Ji(i.contentType);t+=`${s?"_":""}${o}_c${i.channels}`}return t}const ir=["NONE","TYPE-0","TYPE-1",null];function or(h){return ir.indexOf(h)>-1}const dr=["SDR","PQ","HLG"];function Nr(h){return!!h&&dr.indexOf(h)>-1}var qr={No:"",Yes:"YES",v2:"v2"};function xi(h){const{canSkipUntil:t,canSkipDateRanges:i,age:s}=h,o=s<t/2;return t&&o?i?qr.v2:qr.Yes:qr.No}class Qr{constructor(t,i,s){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=i,this.skip=s}addDirectives(t){const i=new self.URL(t);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 Mi{constructor(t){if(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.supplemental=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=[t.url],this._attrs=[t.attrs],this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.frameRate=t.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=t.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.codecSet=[t.videoCodec,t.audioCodec].filter(s=>!!s).map(s=>s.substring(0,4)).join(","),"supplemental"in t){var i;this.supplemental=t.supplemental;const s=(i=t.supplemental)==null?void 0:i.videoCodec;s&&s!==t.videoCodec&&(this.codecSet+=`,${s.substring(0,4)}`)}this.addGroupId("audio",t.attrs.AUDIO),this.addGroupId("text",t.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(t){return Qi(this._audioGroups,t)}hasSubtitleGroup(t){return Qi(this._subtitleGroups,t)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(t,i){if(i){if(t==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(i)===-1&&s.push(i)}else if(t==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(i)===-1&&s.push(i)}}}get urlId(){return 0}set urlId(t){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var t;return(t=this.audioGroups)==null?void 0:t[0]}get textGroupId(){var t;return(t=this.subtitleGroups)==null?void 0:t[0]}addFallback(){}}function Qi(h,t){return!t||!h?!1:h.indexOf(t)!==-1}function wi(){if(typeof matchMedia=="function"){const h=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(h.media!==t.media)return h.matches===!0}return!1}function $i(h,t){let i=!1,s=[];if(h&&(i=h!=="SDR",s=[h]),t){s=t.allowedVideoRanges||dr.slice(0);const o=s.join("")!=="SDR"&&!t.videoCodec;i=t.preferHDR!==void 0?t.preferHDR:o&&wi(),i||(s=["SDR"])}return{preferHDR:i,allowedVideoRanges:s}}const je=h=>{const t=new WeakSet;return(i,s)=>{if(h&&(s=h(i,s)),typeof s=="object"&&s!==null){if(t.has(s))return;t.add(s)}return s}},tt=(h,t)=>JSON.stringify(h,je(t));function At(h,t,i,s,o){const l=Object.keys(h),u=s==null?void 0:s.channels,f=s==null?void 0:s.audioCodec,y=o==null?void 0:o.videoCodec,v=u&&parseInt(u)===2;let x=!1,w=!1,k=1/0,F=1/0,$=1/0,Q=1/0,te=0,xe=[];const{preferHDR:ke,allowedVideoRanges:Le}=$i(t,o);for(let St=l.length;St--;){const xt=h[l[St]];x||(x=xt.channels[2]>0),k=Math.min(k,xt.minHeight),F=Math.min(F,xt.minFramerate),$=Math.min($,xt.minBitrate),Le.filter(jt=>xt.videoRanges[jt]>0).length>0&&(w=!0)}k=U(k)?k:0,F=U(F)?F:0;const Ze=Math.max(1080,k),rt=Math.max(30,F);$=U($)?$:i,i=Math.max($,i),w||(t=void 0);const Lt=l.length>1;return{codecSet:l.reduce((St,xt)=>{const ht=h[xt];if(xt===St)return St;if(xe=w?Le.filter(jt=>ht.videoRanges[jt]>0):[],Lt){if(ht.minBitrate>i)return dt(xt,`min bitrate of ${ht.minBitrate} > current estimate of ${i}`),St;if(!ht.hasDefaultAudio)return dt(xt,"no renditions with default or auto-select sound found"),St;if(f&&xt.indexOf(f.substring(0,4))%5!==0)return dt(xt,`audio codec preference "${f}" not found`),St;if(u&&!v){if(!ht.channels[u])return dt(xt,`no renditions with ${u} channel sound found (channels options: ${Object.keys(ht.channels)})`),St}else if((!f||v)&&x&&ht.channels[2]===0)return dt(xt,"no renditions with stereo sound found"),St;if(ht.minHeight>Ze)return dt(xt,`min resolution of ${ht.minHeight} > maximum of ${Ze}`),St;if(ht.minFramerate>rt)return dt(xt,`min framerate of ${ht.minFramerate} > maximum of ${rt}`),St;if(!xe.some(jt=>ht.videoRanges[jt]>0))return dt(xt,`no variants with VIDEO-RANGE of ${tt(xe)} found`),St;if(y&&xt.indexOf(y.substring(0,4))%5!==0)return dt(xt,`video codec preference "${y}" not found`),St;if(ht.maxScore<te)return dt(xt,`max score of ${ht.maxScore} < selected max of ${te}`),St}return St&&(Re(xt)>=Re(St)||ht.fragmentError>h[St].fragmentError)?St:(Q=ht.minIndex,te=ht.maxScore,xt)},void 0),videoRanges:xe,preferHDR:ke,minFramerate:F,minBitrate:$,minIndex:Q}}function dt(h,t){Se.log(`[abr] start candidates with "${h}" ignored because ${t}`)}function pt(h){return h.reduce((t,i)=>{let s=t.groups[i.groupId];s||(s=t.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&&(t.hasDefaultAudio=!0),s.hasAutoSelect&&(t.hasAutoSelectAudio=!0),t},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Tt(h,t,i,s){return h.slice(i,s+1).reduce((o,l,u)=>{if(!l.codecSet)return o;const f=l.audioGroups;let y=o[l.codecSet];y||(o[l.codecSet]=y={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:u,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!f,fragmentError:0}),y.minBitrate=Math.min(y.minBitrate,l.bitrate);const v=Math.min(l.height,l.width);return y.minHeight=Math.min(y.minHeight,v),y.minFramerate=Math.min(y.minFramerate,l.frameRate),y.minIndex=Math.min(y.minIndex,u),y.maxScore=Math.max(y.maxScore,l.score),y.fragmentError+=l.fragmentError,y.videoRanges[l.videoRange]=(y.videoRanges[l.videoRange]||0)+1,f&&f.forEach(x=>{if(!x)return;const w=t.groups[x];w&&(y.hasDefaultAudio=y.hasDefaultAudio||t.hasDefaultAudio?w.hasDefault:w.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(w.channels).forEach(k=>{y.channels[k]=(y.channels[k]||0)+w.channels[k]}))}),o},{})}function Ut(h){if(!h)return h;const{lang:t,assocLang:i,characteristics:s,channels:o,audioCodec:l}=h;return{lang:t,assocLang:i,characteristics:s,channels:o,audioCodec:l}}function Jt(h,t,i){if("attrs"in h){const s=t.indexOf(h);if(s!==-1)return s}for(let s=0;s<t.length;s++){const o=t[s];if(Er(h,o,i))return s}return-1}function Er(h,t,i){const{groupId:s,name:o,lang:l,assocLang:u,default:f}=h,y=h.forced;return(s===void 0||t.groupId===s)&&(o===void 0||t.name===o)&&(l===void 0||kr(l,t.lang))&&(l===void 0||t.assocLang===u)&&(f===void 0||t.default===f)&&(y===void 0||t.forced===y)&&(!("characteristics"in h)||Or(h.characteristics||"",t.characteristics))&&(i===void 0||i(h,t))}function kr(h,t="--"){return h.length===t.length?h===t:h.startsWith(t)||t.startsWith(h)}function Or(h,t=""){const i=h.split(","),s=t.split(",");return i.length===s.length&&!i.some(o=>s.indexOf(o)===-1)}function vr(h,t){const{audioCodec:i,channels:s}=h;return(i===void 0||(t.audioCodec||"").substring(0,4)===i.substring(0,4))&&(s===void 0||s===(t.channels||"2"))}function cr(h,t,i,s,o){const l=t[s],f=t.reduce((k,F,$)=>{const Q=F.uri;return(k[Q]||(k[Q]=[])).push($),k},{})[l.uri];f.length>1&&(s=Math.max.apply(Math,f));const y=l.videoRange,v=l.frameRate,x=l.codecSet.substring(0,4),w=Tr(t,s,k=>{if(k.videoRange!==y||k.frameRate!==v||k.codecSet.substring(0,4)!==x)return!1;const F=k.audioGroups,$=i.filter(Q=>!F||F.indexOf(Q.groupId)!==-1);return Jt(h,$,o)>-1});return w>-1?w:Tr(t,s,k=>{const F=k.audioGroups,$=i.filter(Q=>!F||F.indexOf(Q.groupId)!==-1);return Jt(h,$,o)>-1})}function Tr(h,t,i){for(let s=t;s>-1;s--)if(i(h[s]))return s;for(let s=t+1;s<h.length;s++)if(i(h[s]))return s;return-1}function gi(h,t){var i;return!!h&&h!==((i=t.loadLevelObj)==null?void 0:i.uri)}class ci extends le{constructor(t){super("abr",t.logger),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.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=i=>{var s;const{fragCurrent:o,partCurrent:l,hls:u}=this,{autoLevelEnabled:f,media:y}=u;if(!o||!y)return;const v=performance.now(),x=l?l.stats:o.stats,w=l?l.duration:o.duration,k=v-x.loading.start,F=u.minAutoLevel,$=o.level,Q=this._nextAutoLevel;if(x.aborted||x.loaded&&x.loaded===x.total||$<=F){this.clearTimer(),this._nextAutoLevel=-1;return}if(!f)return;const te=Q>-1&&Q!==$,xe=!!i||te;if(!xe&&(y.paused||!y.playbackRate||!y.readyState))return;const ke=u.mainForwardBufferInfo;if(!xe&&ke===null)return;const Le=this.bwEstimator.getEstimateTTFB(),Ze=Math.abs(y.playbackRate);if(k<=Math.max(Le,1e3*(w/(Ze*2))))return;const rt=ke?ke.len/Ze:0,Lt=x.loading.first?x.loading.first-x.loading.start:-1,ot=x.loaded&&Lt>-1,St=this.getBwEstimate(),xt=u.levels,ht=xt[$],jt=Math.max(x.loaded,Math.round(w*(o.bitrate||ht.averageBitrate)/8));let Br=ot?k-Lt:k;Br<1&&ot&&(Br=Math.min(k,x.loaded*8/St));const ei=ot?x.loaded*1e3/Br:0,vi=Le/1e3,Xr=ei?(jt-x.loaded)/ei:jt*8/St+vi;if(Xr<=rt)return;const Cr=ei?ei*8:St,ii=((s=(i==null?void 0:i.details)||this.hls.latestLevelDetails)==null?void 0:s.live)===!0,Gr=this.hls.config.abrBandWidthUpFactor;let li=Number.POSITIVE_INFINITY,Li;for(Li=$-1;Li>F;Li--){const Rn=xt[Li].maxBitrate,ui=!xt[Li].details||ii;if(li=this.getTimeToLoadFrag(vi,Cr,w*Rn,ui),li<Math.min(rt,w+vi))break}if(li>=Xr||li>w*10)return;ot?this.bwEstimator.sample(k-Math.min(Le,Lt),x.loaded):this.bwEstimator.sampleTTFB(k);const _r=xt[Li].maxBitrate;this.getBwEstimate()*Gr>_r&&this.resetEstimator(_r);const Pr=this.findBestLevel(_r,F,Li,0,rt,1,1);Pr>-1&&(Li=Pr),this.warn(`Fragment ${o.sn}${l?" part "+l.index:""} of level ${$} is loading too slowly;
Fragment duration: ${o.duration.toFixed(3)}
Time to underbuffer: ${rt.toFixed(3)} s
Estimated load time for current fragment: ${Xr.toFixed(3)} s
Estimated load time for down switch fragment: ${li.toFixed(3)} s
TTFB estimate: ${Lt|0} ms
Current BW estimate: ${U(St)?St|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${Li} @ ${_r|0} bps`),u.nextLoadLevel=u.nextAutoLevel=Li,this.clearTimer();const Ui=()=>{if(this.clearTimer(),this.fragCurrent===o&&this.hls.loadLevel===Li&&Li>0){const Rn=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Li>0?"and switching down":""}
Fragment duration: ${o.duration.toFixed(3)} s
Time to underbuffer: ${Rn.toFixed(3)} s`),o.abortRequests(),this.fragCurrent=this.partCurrent=null,Li>F){let ui=this.findBestLevel(this.hls.levels[F].bitrate,F,Li,0,Rn,1,1);ui===-1&&(ui=F),this.hls.nextLoadLevel=this.hls.nextAutoLevel=ui,this.resetEstimator(this.hls.levels[ui].bitrate)}}};te||Xr>li*2?Ui():this.timer=self.setInterval(Ui,li*1e3),u.trigger(E.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:l,stats:x})},this.hls=t,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(t){t&&(this.log(`setting initial bwe to ${t}`),this.hls.config.abrEwmaDefaultEstimate=t),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const t=this.hls.config;return new ne(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate)}registerListeners(){const{hls:t}=this;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.FRAG_LOADING,this.onFragLoading,this),t.on(E.FRAG_LOADED,this.onFragLoaded,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this),t.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(E.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t&&(t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.FRAG_LOADING,this.onFragLoading,this),t.off(E.FRAG_LOADED,this.onFragLoaded,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this),t.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(E.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.off(E.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(t,i){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},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(t,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(t,i){this.clearTimer()}onError(t,i){if(!i.fatal)switch(i.details){case ae.BUFFER_ADD_CODEC_ERROR:case ae.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case ae.FRAG_LOAD_TIMEOUT:{const s=i.frag,{fragCurrent:o,partCurrent:l}=this;if(s&&o&&s.sn===o.sn&&s.level===o.level){const u=performance.now(),f=l?l.stats:s.stats,y=u-f.loading.start,v=f.loading.first?f.loading.first-f.loading.start:-1;if(f.loaded&&v>-1){const w=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(y-Math.min(w,v),f.loaded)}else this.bwEstimator.sampleTTFB(y)}break}}}getTimeToLoadFrag(t,i,s,o){const l=t+s/i,u=o?t+this.lastLevelLoadSec:0;return l+u}onLevelLoaded(t,i){const s=this.hls.config,{loading:o}=i.stats,l=o.end-o.first;U(l)&&(this.lastLevelLoadSec=l/1e3),i.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(i.levelInfo)}onFragLoaded(t,{frag:i,part:s}){const o=s?s.stats:i.stats;if(i.type===z.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 l=s?s.duration:i.duration,u=this.hls.levels[i.level],f=(u.loaded?u.loaded.bytes:0)+o.loaded,y=(u.loaded?u.loaded.duration:0)+l;u.loaded={bytes:f,duration:y},u.realBitrate=Math.round(8*f/y)}if(i.bitrateTest){const l={stats:o,frag:i,part:s,id:i.type};this.onFragBuffered(E.FRAG_BUFFERED,l),i.bitrateTest=!1}else this.lastLoadedFragLevel=i.level}}onFragBuffered(t,i){const{frag:s,part:o}=i,l=o!=null&&o.stats.loaded?o.stats:s.stats;if(l.aborted||this.ignoreFragment(s))return;const u=l.parsing.end-l.loading.start-Math.min(l.loading.first-l.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(u,l.loaded),l.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=u/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==z.MAIN||t.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:t,minAutoLevel:i}=this.hls,s=this.getBwEstimate(),o=this.hls.config.maxStarvationDelay,l=this.findBestLevel(s,i,t,0,o,1,1);if(l>-1)return l;const u=this.hls.firstLevel,f=Math.min(Math.max(u,i),t);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${u} clamped to ${f}`),f}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const t=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),o=this.lastLoadedFragLevel>-1;if(t!==-1&&(!s||!o||this.nextAutoLevelKey===this.getAutoLevelKey()))return t;const l=s&&o?this.getNextABRAutoLevel():this.firstAutoLevel;if(t!==-1){const u=this.hls.levels;if(u.length>Math.max(t,l)&&u[t].loadError<=u[l].loadError)return t}return this._nextAutoLevel=l,this.nextAutoLevelKey=this.getAutoLevelKey(),l}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:t,partCurrent:i,hls:s}=this;if(s.levels.length<=1)return s.loadLevel;const{maxAutoLevel:o,config:l,minAutoLevel:u}=s,f=i?i.duration:t?t.duration:0,y=this.getBwEstimate(),v=this.getStarvationDelay();let x=l.abrBandWidthFactor,w=l.abrBandWidthUpFactor;if(v){const te=this.findBestLevel(y,u,o,v,0,x,w);if(te>=0)return this.rebufferNotice=-1,te}let k=f?Math.min(f,l.maxStarvationDelay):l.maxStarvationDelay;if(!v){const te=this.bitrateTestDelay;te&&(k=(f?Math.min(f,l.maxLoadingDelay):l.maxLoadingDelay)-te,this.info(`bitrate test took ${Math.round(1e3*te)}ms, set first fragment max fetchDuration to ${Math.round(1e3*k)} ms`),x=w=1)}const F=this.findBestLevel(y,u,o,v,k,x,w);if(this.rebufferNotice!==F&&(this.rebufferNotice=F,this.info(`${v?"rebuffering expected":"buffer is empty"}, optimal quality level ${F}`)),F>-1)return F;const $=s.levels[u],Q=s.loadLevelObj;return Q&&($==null?void 0:$.bitrate)<Q.bitrate?u:s.loadLevel}getStarvationDelay(){const t=this.hls,i=t.media;if(!i)return 1/0;const s=i&&i.playbackRate!==0?Math.abs(i.playbackRate):1,o=t.mainForwardBufferInfo;return(o?o.len:0)/s}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(t,i,s,o,l,u,f){var y;const v=o+l,x=this.lastLoadedFragLevel,w=x===-1?this.hls.firstLevel:x,{fragCurrent:k,partCurrent:F}=this,{levels:$,allAudioTracks:Q,loadLevel:te,config:xe}=this.hls;if($.length===1)return 0;const ke=$[w],Le=!!((y=this.hls.latestLevelDetails)!=null&&y.live),Ze=te===-1||x===-1;let rt,Lt="SDR",ot=(ke==null?void 0:ke.frameRate)||0;const{audioPreference:St,videoPreference:xt}=xe,ht=this.audioTracksByGroup||(this.audioTracksByGroup=pt(Q));let jt=-1;if(Ze){if(this.firstSelection!==-1)return this.firstSelection;const Cr=this.codecTiers||(this.codecTiers=Tt($,ht,i,s)),ii=At(Cr,Lt,t,St,xt),{codecSet:Gr,videoRanges:li,minFramerate:Li,minBitrate:_r,minIndex:Pr,preferHDR:Ui}=ii;jt=Pr,rt=Gr,Lt=Ui?li[li.length-1]:li[0],ot=Li,t=Math.max(t,_r),this.log(`picked start tier ${tt(ii)}`)}else rt=ke==null?void 0:ke.codecSet,Lt=ke==null?void 0:ke.videoRange;const Br=F?F.duration:k?k.duration:0,ei=this.bwEstimator.getEstimateTTFB()/1e3,vi=[];for(let Cr=s;Cr>=i;Cr--){var Xr;const ii=$[Cr],Gr=Cr>w;if(!ii)continue;if(xe.useMediaCapabilities&&!ii.supportedResult&&!ii.supportedPromise){const ui=navigator.mediaCapabilities;typeof(ui==null?void 0:ui.decodingInfo)=="function"&&Wr(ii,ht,Lt,ot,t,St)?(ii.supportedPromise=pe(ii,ht,ui,this.supportedCache),ii.supportedPromise.then(an=>{if(!this.hls)return;ii.supportedResult=an;const js=this.hls.levels,hs=js.indexOf(ii);an.error?this.warn(`MediaCapabilities decodingInfo error: "${an.error}" for level ${hs} ${tt(an)}`):an.supported?an.decodingInfoResults.some(ua=>ua.smooth===!1||ua.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${hs} not smooth or powerEfficient: ${tt(an)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${hs} ${tt(an)}`),hs>-1&&js.length>1&&(this.log(`Removing unsupported level ${hs}`),this.hls.removeLevel(hs),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(an=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${an}`)})):ii.supportedResult=Ii}if((rt&&ii.codecSet!==rt||Lt&&ii.videoRange!==Lt||Gr&&ot>ii.frameRate||!Gr&&ot>0&&ot<ii.frameRate||(Xr=ii.supportedResult)!=null&&(Xr=Xr.decodingInfoResults)!=null&&Xr.some(ui=>ui.smooth===!1))&&(!Ze||Cr!==jt)){vi.push(Cr);continue}const li=ii.details,Li=(F?li==null?void 0:li.partTarget:li==null?void 0:li.averagetargetduration)||Br;let _r;Gr?_r=f*t:_r=u*t;const Pr=Br&&o>=Br*2&&l===0?ii.averageBitrate:ii.maxBitrate,Ui=this.getTimeToLoadFrag(ei,_r,Pr*Li,li===void 0);if(_r>=Pr&&(Cr===x||ii.loadError===0&&ii.fragmentError===0)&&(Ui<=ei||!U(Ui)||Le&&!this.bitrateTestDelay||Ui<v)){const ui=this.forcedAutoLevel;return Cr!==te&&(ui===-1||ui!==te)&&(vi.length&&this.trace(`Skipped level(s) ${vi.join(",")} of ${s} max with CODECS and VIDEO-RANGE:"${$[vi[0]].codecs}" ${$[vi[0]].videoRange}; not compatible with "${rt}" ${Lt}`),this.info(`switch candidate:${w}->${Cr} adjustedbw(${Math.round(_r)})-bitrate=${Math.round(_r-Pr)} ttfb:${ei.toFixed(1)} avgDuration:${Li.toFixed(1)} maxFetchDuration:${v.toFixed(1)} fetchDuration:${Ui.toFixed(1)} firstSelection:${Ze} codecSet:${ii.codecSet} videoRange:${ii.videoRange} hls.loadLevel:${te}`)),Ze&&(this.firstSelection=Cr),Cr}}return-1}set nextAutoLevel(t){const i=this.deriveNextAutoLevel(t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}deriveNextAutoLevel(t){const{maxAutoLevel:i,minAutoLevel:s}=this.hls;return Math.min(Math.max(t,s),i)}}const hr={search:function(h,t){let i=0,s=h.length-1,o=null,l=null;for(;i<=s;){o=(i+s)/2|0,l=h[o];const u=t(l);if(u>0)i=o+1;else if(u<0)s=o-1;else return l}return null}};function Zr(h,t,i){if(t===null||!Array.isArray(h)||!h.length||!U(t))return null;const s=h[0].programDateTime;if(t<(s||0))return null;const o=h[h.length-1].endProgramDateTime;if(t>=(o||0))return null;for(let l=0;l<h.length;++l){const u=h[l];if(Ti(t,i,u))return u}return null}function Si(h,t,i=0,s=0,o=.005){let l=null;if(h){l=t[1+h.sn-t[0].sn]||null;const f=h.endDTS-i;f>0&&f<15e-7&&(i+=15e-7),l&&h.level!==l.level&&l.end<=h.end&&(l=t[2+h.sn-t[0].sn]||null)}else i===0&&t[0].start===0&&(l=t[0]);if(l&&((!h||h.level===l.level)&&Vr(i,s,l)===0||ti(l,h,Math.min(o,s))))return l;const u=hr.search(t,Vr.bind(null,i,s));return u&&(u!==h||!l)?u:l}function ti(h,t,i){if(t&&t.start===0&&t.level<h.level&&(t.endPTS||0)>0){const s=t.tagList.reduce((o,l)=>(l[0]==="INF"&&(o+=parseFloat(l[1])),o),i);return h.start<=s}return!1}function Vr(h=0,t=0,i){if(i.start<=h&&i.start+i.duration>h)return 0;const s=Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-s<=h?1:i.start-s>h&&i.start?-1:0}function Ti(h,t,i){const s=Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3;return(i.endProgramDateTime||0)-s>h}function Ur(h,t,i){if(h&&h.startCC<=t&&h.endCC>=t){let s=h.fragments;const{fragmentHint:o}=h;o&&(s=s.concat(o));let l;return hr.search(s,u=>u.cc<t?1:u.cc>t?-1:(l=u,u.end<=i?1:u.start>i?-1:0)),l||null}return null}function ri(h){switch(h.details){case ae.FRAG_LOAD_TIMEOUT:case ae.KEY_LOAD_TIMEOUT:case ae.LEVEL_LOAD_TIMEOUT:case ae.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Ri(h){return h.details.startsWith("key")}function st(h){return Ri(h)&&!!h.frag&&!h.frag.decryptdata}function Ir(h,t){const i=ri(t);return h.default[`${i?"timeout":"error"}Retry`]}function hi(h,t){const i=h.backoff==="linear"?1:Math.pow(2,t);return Math.min(i*h.retryDelayMs,h.maxRetryDelayMs)}function Oi(h){return O(O({},h),{errorRetry:null,timeoutRetry:null})}function ln(h,t,i,s){if(!h)return!1;const o=s==null?void 0:s.code,l=t<h.maxNumRetry&&(tn(o)||!!i);return h.shouldRetry?h.shouldRetry(h,t,i,s,l):l}function tn(h){return zi(h)||!!h&&(h<400||h>499)}function zi(h){return h===0&&navigator.onLine===!1}var $r={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},jr={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4,SwitchToSDR:8};class qi extends le{constructor(t){super("error-controller",t.logger),this.hls=void 0,this.playlistError=0,this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(E.ERROR,this.onError,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(E.ERROR,this.onError,this),t.off(E.ERROR,this.onErrorOut,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(t){}stopLoad(){this.playlistError=0}getVariantLevelIndex(t){return(t==null?void 0:t.type)===z.MAIN?t.level:this.getVariantIndex()}getVariantIndex(){var t;const i=this.hls,s=i.currentLevel;return(t=i.loadLevelObj)!=null&&t.details||s===-1?i.loadLevel:s}variantHasKey(t,i){if(t){var s;if((s=t.details)!=null&&s.hasKey(i))return!0;const o=t.audioGroups;if(o)return this.hls.allAudioTracks.filter(u=>o.indexOf(u.groupId)>=0).some(u=>{var f;return(f=u.details)==null?void 0:f.hasKey(i)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(t,i){var s;if(i.fatal)return;const o=this.hls,l=i.context;switch(i.details){case ae.FRAG_LOAD_ERROR:case ae.FRAG_LOAD_TIMEOUT:case ae.KEY_LOAD_ERROR:case ae.KEY_LOAD_TIMEOUT:i.errorAction=this.getFragRetryOrSwitchAction(i);return;case ae.FRAG_PARSING_ERROR:if((s=i.frag)!=null&&s.gap){i.errorAction=Ki();return}case ae.FRAG_GAP:case ae.FRAG_DECRYPT_ERROR:{i.errorAction=this.getFragRetryOrSwitchAction(i),i.errorAction.action=$r.SendAlternateToPenaltyBox;return}case ae.LEVEL_EMPTY_ERROR:case ae.LEVEL_PARSING_ERROR:{var u;const y=i.parent===z.MAIN?i.level:o.loadLevel;i.details===ae.LEVEL_EMPTY_ERROR&&((u=i.context)!=null&&(u=u.levelDetails)!=null&&u.live)?i.errorAction=this.getPlaylistRetryOrSwitchAction(i,y):(i.levelRetry=!1,i.errorAction=this.getLevelSwitchAction(i,y))}return;case ae.LEVEL_LOAD_ERROR:case ae.LEVEL_LOAD_TIMEOUT:typeof(l==null?void 0:l.level)=="number"&&(i.errorAction=this.getPlaylistRetryOrSwitchAction(i,l.level));return;case ae.AUDIO_TRACK_LOAD_ERROR:case ae.AUDIO_TRACK_LOAD_TIMEOUT:case ae.SUBTITLE_LOAD_ERROR:case ae.SUBTITLE_TRACK_LOAD_TIMEOUT:if(l){const y=o.loadLevelObj;if(y&&(l.type===Te.AUDIO_TRACK&&y.hasAudioGroup(l.groupId)||l.type===Te.SUBTITLE_TRACK&&y.hasSubtitleGroup(l.groupId))){i.errorAction=this.getPlaylistRetryOrSwitchAction(i,o.loadLevel),i.errorAction.action=$r.SendAlternateToPenaltyBox,i.errorAction.flags=jr.MoveAllAlternatesMatchingHost;return}}return;case ae.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:i.errorAction={action:$r.SendAlternateToPenaltyBox,flags:jr.MoveAllAlternatesMatchingHDCP};return;case ae.KEY_SYSTEM_SESSION_UPDATE_FAILED:case ae.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case ae.KEY_SYSTEM_NO_SESSION:i.errorAction={action:$r.SendAlternateToPenaltyBox,flags:jr.MoveAllAlternatesMatchingKey};return;case ae.BUFFER_ADD_CODEC_ERROR:case ae.REMUX_ALLOC_ERROR:case ae.BUFFER_APPEND_ERROR:if(!i.errorAction){var f;i.errorAction=this.getLevelSwitchAction(i,(f=i.level)!=null?f:o.loadLevel)}return;case ae.INTERNAL_EXCEPTION:case ae.BUFFER_APPENDING_ERROR:case ae.BUFFER_FULL_ERROR:case ae.LEVEL_SWITCH_ERROR:case ae.BUFFER_STALLED_ERROR:case ae.BUFFER_SEEK_OVER_HOLE:case ae.BUFFER_NUDGE_ON_STALL:i.errorAction=Ki();return}i.type===Me.KEY_SYSTEM_ERROR&&(i.levelRetry=!1,i.errorAction=Ki())}getPlaylistRetryOrSwitchAction(t,i){const s=this.hls,o=Ir(s.config.playlistLoadPolicy,t),l=this.playlistError++;if(ln(o,l,ri(t),t.response))return{action:$r.RetryRequest,flags:jr.None,retryConfig:o,retryCount:l};const f=this.getLevelSwitchAction(t,i);return o&&(f.retryConfig=o,f.retryCount=l),f}getFragRetryOrSwitchAction(t){const i=this.hls,s=this.getVariantLevelIndex(t.frag),o=i.levels[s],{fragLoadPolicy:l,keyLoadPolicy:u}=i.config,f=Ir(Ri(t)?u:l,t),y=i.levels.reduce((x,w)=>x+w.fragmentError,0);if(o&&(t.details!==ae.FRAG_GAP&&o.fragmentError++,!st(t)&&ln(f,y,ri(t),t.response)))return{action:$r.RetryRequest,flags:jr.None,retryConfig:f,retryCount:y};const v=this.getLevelSwitchAction(t,s);return f&&(v.retryConfig=f,v.retryCount=y),v}getLevelSwitchAction(t,i){const s=this.hls;i==null&&(i=s.loadLevel);const o=this.hls.levels[i];if(o){var l,u;const v=t.details;o.loadError++,v===ae.BUFFER_APPEND_ERROR&&o.fragmentError++;let x=-1;const{levels:w,loadLevel:k,minAutoLevel:F,maxAutoLevel:$}=s;!s.autoLevelEnabled&&!s.config.preserveManualLevelOnError&&(s.loadLevel=-1);const Q=(l=t.frag)==null?void 0:l.type,xe=(Q===z.AUDIO&&v===ae.FRAG_PARSING_ERROR||t.sourceBufferName==="audio"&&(v===ae.BUFFER_ADD_CODEC_ERROR||v===ae.BUFFER_APPEND_ERROR))&&w.some(({audioCodec:Lt})=>o.audioCodec!==Lt),Le=t.sourceBufferName==="video"&&(v===ae.BUFFER_ADD_CODEC_ERROR||v===ae.BUFFER_APPEND_ERROR)&&w.some(({codecSet:Lt,audioCodec:ot})=>o.codecSet!==Lt&&o.audioCodec===ot),{type:Ze,groupId:rt}=(u=t.context)!=null?u:{};for(let Lt=w.length;Lt--;){const ot=(Lt+k)%w.length;if(ot!==k&&ot>=F&&ot<=$&&w[ot].loadError===0){var f,y;const St=w[ot];if(v===ae.FRAG_GAP&&Q===z.MAIN&&t.frag){const xt=w[ot].details;if(xt){const ht=Si(t.frag,xt.fragments,t.frag.start);if(ht!=null&&ht.gap)continue}}else{if(Ze===Te.AUDIO_TRACK&&St.hasAudioGroup(rt)||Ze===Te.SUBTITLE_TRACK&&St.hasSubtitleGroup(rt))continue;if(Q===z.AUDIO&&(f=o.audioGroups)!=null&&f.some(xt=>St.hasAudioGroup(xt))||Q===z.SUBTITLE&&(y=o.subtitleGroups)!=null&&y.some(xt=>St.hasSubtitleGroup(xt))||xe&&o.audioCodec===St.audioCodec||Le&&o.codecSet===St.codecSet||!xe&&o.codecSet!==St.codecSet)continue}x=ot;break}}if(x>-1&&s.loadLevel!==x)return t.levelRetry=!0,this.playlistError=0,{action:$r.SendAlternateToPenaltyBox,flags:jr.None,nextAutoLevel:x}}return{action:$r.SendAlternateToPenaltyBox,flags:jr.MoveAllAlternatesMatchingHost}}onErrorOut(t,i){var s;switch((s=i.errorAction)==null?void 0:s.action){case $r.DoNothing:break;case $r.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(i),!i.errorAction.resolved&&i.details!==ae.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 $r.RetryRequest:break}if(i.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(t){const i=this.hls,s=t.errorAction;if(!s)return;const{flags:o}=s,l=s.nextAutoLevel;switch(o){case jr.None:this.switchLevel(t,l);break;case jr.MoveAllAlternatesMatchingHDCP:{const y=this.getVariantLevelIndex(t.frag),v=i.levels[y],x=v==null?void 0:v.attrs["HDCP-LEVEL"];if(s.hdcpLevel=x,x==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(x){i.maxHdcpLevel=ir[ir.indexOf(x)-1],s.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${i.maxHdcpLevel}" or lower`);break}}case jr.MoveAllAlternatesMatchingKey:{const y=t.decryptdata;if(y){const v=this.hls.levels,x=v.length;for(let k=x;k--;)if(this.variantHasKey(v[k],y)){var u,f;this.log(`Banned key found in level ${k} (${v[k].bitrate}bps) or audio group "${(u=v[k].audioGroups)==null?void 0:u.join(",")}" (${(f=t.frag)==null?void 0:f.type} fragment) ${ye(y.keyId||[])}`),v[k].fragmentError++,v[k].loadError++,this.log(`Removing level ${k} with key error (${t.error})`),this.hls.removeLevel(k)}const w=t.frag;if(this.hls.levels.length<x)s.resolved=!0;else if(w&&w.type!==z.MAIN){const k=w.decryptdata;k&&!y.matches(k)&&(s.resolved=!0)}}break}}s.resolved||this.switchLevel(t,l)}switchLevel(t,i){if(i!==void 0&&t.errorAction&&(this.warn(`switching to level ${i} after ${t.details}`),this.hls.nextAutoLevel=i,t.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,t.details===ae.BUFFER_ADD_CODEC_ERROR&&t.mimeType&&t.sourceBufferName!=="audiovideo")){const s=Ji(t.mimeType),o=this.hls.levels;for(let l=o.length;l--;)o[l][`${t.sourceBufferName}Codec`]===s&&(this.log(`Removing level ${l} for ${t.details} ("${s}" not supported)`),this.hls.removeLevel(l))}}}function Ki(h){const t={action:$r.DoNothing,flags:jr.None};return h&&(t.resolved=!0),t}var Bi={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class bs{constructor(t){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=t,this._registerListeners()}_registerListeners(){const{hls:t}=this;t&&(t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.BUFFER_APPENDED,this.onBufferAppended,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this),t.on(E.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.BUFFER_APPENDED,this.onBufferAppended,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this),t.off(E.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(t,i){const s=this.activePartLists[i];if(s)for(let o=s.length;o--;){const l=s[o];if(!l)break;if(l.start<=t&&t<=l.end&&l.loaded)return l}return this.getBufferedFrag(t,i)}getBufferedFrag(t,i){return this.getFragAtPos(t,i,!0)}getFragAtPos(t,i,s){const{fragments:o}=this,l=Object.keys(o);for(let u=l.length;u--;){const f=o[l[u]];if((f==null?void 0:f.body.type)===i&&(!s||f.buffered)){const y=f.body;if(y.start<=t&&t<=y.end)return y}}return null}detectEvictedFragments(t,i,s,o,l){this.timeRanges&&(this.timeRanges[t]=i);const u=(o==null?void 0:o.fragment.sn)||-1;Object.keys(this.fragments).forEach(f=>{const y=this.fragments[f];if(!y||u>=y.body.sn)return;if(!y.buffered&&(!y.loaded||l)){y.body.type===s&&this.removeFragment(y.body);return}const v=y.range[t];if(v){if(v.time.length===0){this.removeFragment(y.body);return}v.time.some(x=>{const w=!this.isTimeBuffered(x.startPTS,x.endPTS,i);return w&&this.removeFragment(y.body),w})}})}detectPartialFragments(t){const i=this.timeRanges;if(!i||t.frag.sn==="initSegment")return;const s=t.frag,o=un(s),l=this.fragments[o];if(!l||l.buffered&&s.gap)return;const u=!s.relurl;Object.keys(i).forEach(f=>{const y=s.elementaryStreams[f];if(!y)return;const v=i[f],x=u||y.partial===!0;l.range[f]=this.getBufferedTimes(s,t.part,x,v)}),l.loaded=null,Object.keys(l.range).length?(this.bufferedEnd(l,s),Wn(l)||this.removeParts(s.sn-1,s.type)):this.removeFragment(l.body)}bufferedEnd(t,i){t.buffered=!0,(t.body.endList=i.endList||t.body.endList)&&(this.endListFragments[t.body.type]=t)}removeParts(t,i){const s=this.activePartLists[i];s&&(this.activePartLists[i]=Rr(s,o=>o.fragment.sn>=t))}fragBuffered(t,i){const s=un(t);let o=this.fragments[s];!o&&i&&(o=this.fragments[s]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),o&&(o.loaded=null,this.bufferedEnd(o,t))}getBufferedTimes(t,i,s,o){const l={time:[],partial:s},u=t.start,f=t.end,y=t.minEndPTS||f,v=t.maxStartPTS||u;for(let x=0;x<o.length;x++){const w=o.start(x)-this.bufferPadding,k=o.end(x)+this.bufferPadding;if(v>=w&&y<=k){l.time.push({startPTS:Math.max(u,o.start(x)),endPTS:Math.min(f,o.end(x))});break}else if(u<k&&f>w){const F=Math.max(u,o.start(x)),$=Math.min(f,o.end(x));$>F&&(l.partial=!0,l.time.push({startPTS:F,endPTS:$}))}else if(f<=w)break}return l}getPartialFragment(t){let i=null,s,o,l,u=0;const{bufferPadding:f,fragments:y}=this;return Object.keys(y).forEach(v=>{const x=y[v];x&&Wn(x)&&(o=x.body.start-f,l=x.body.end+f,t>=o&&t<=l&&(s=Math.min(t-o,l-t),u<=s&&(i=x.body,u=s)))}),i}isEndListAppended(t){const i=this.endListFragments[t];return i!==void 0&&(i.buffered||Wn(i))}getState(t){const i=un(t),s=this.fragments[i];return s?s.buffered?Wn(s)?Bi.PARTIAL:Bi.OK:Bi.APPENDING:Bi.NOT_LOADED}isTimeBuffered(t,i,s){let o,l;for(let u=0;u<s.length;u++){if(o=s.start(u)-this.bufferPadding,l=s.end(u)+this.bufferPadding,t>=o&&i<=l)return!0;if(i<=o)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(t,i){if(i.frag.sn==="initSegment"||i.frag.bitrateTest)return;const s=i.frag,o=i.part?null:i,l=un(s);this.fragments[l]={body:s,appendedPTS:null,loaded:o,buffered:!1,range:Object.create(null)}}onBufferAppended(t,i){const{frag:s,part:o,timeRanges:l,type:u}=i;if(s.sn==="initSegment")return;const f=s.type;if(o){let v=this.activePartLists[f];v||(this.activePartLists[f]=v=[]),v.push(o)}this.timeRanges=l;const y=l[u];this.detectEvictedFragments(u,y,f,o)}onFragBuffered(t,i){this.detectPartialFragments(i)}hasFragment(t){const i=un(t);return!!this.fragments[i]}hasFragments(t){const{fragments:i}=this,s=Object.keys(i);if(!t)return s.length>0;for(let o=s.length;o--;){const l=i[s[o]];if((l==null?void 0:l.body.type)===t)return!0}return!1}hasParts(t){var i;return!!((i=this.activePartLists[t])!=null&&i.length)}removeFragmentsInRange(t,i,s,o,l){o&&!this.hasGaps||Object.keys(this.fragments).forEach(u=>{const f=this.fragments[u];if(!f)return;const y=f.body;y.type!==s||o&&!y.gap||y.start<i&&y.end>t&&(f.buffered||l)&&this.removeFragment(y)})}removeFragment(t){const i=un(t);t.clearElementaryStreamInfo();const s=this.activePartLists[t.type];if(s){const o=t.sn;this.activePartLists[t.type]=Rr(s,l=>l.fragment.sn!==o)}delete this.fragments[i],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){var t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const i=(t=this.hls)==null||(t=t.latestLevelDetails)==null?void 0:t.partList;i&&i.forEach(s=>s.clearElementaryStreamInfo())}}function Wn(h){var t,i,s;return h.buffered&&!!(h.body.gap||(t=h.range.video)!=null&&t.partial||(i=h.range.audio)!=null&&i.partial||(s=h.range.audiovideo)!=null&&s.partial)}function un(h){return`${h.type}_${h.level}_${h.sn}`}function Rr(h,t){return h.filter(i=>{const s=t(i);return s||i.clearElementaryStreamInfo(),s})}var Ci={cbc:0,ctr:1};class Gi{constructor(t,i,s){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=t,this.aesIV=i,this.aesMode=s}decrypt(t,i){switch(this.aesMode){case Ci.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,t);case Ci.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},i,t);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function On(h){const t=h.byteLength,i=t&&new DataView(h.buffer).getUint8(t-1);return i?h.slice(0,t-i):h}class ss{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_(t){const i=new DataView(t),s=new Uint32Array(4);for(let o=0;o<4;o++)s[o]=i.getUint32(o*4);return s}initTable(){const t=this.sBox,i=this.invSBox,s=this.subMix,o=s[0],l=s[1],u=s[2],f=s[3],y=this.invSubMix,v=y[0],x=y[1],w=y[2],k=y[3],F=new Uint32Array(256);let $=0,Q=0,te=0;for(te=0;te<256;te++)te<128?F[te]=te<<1:F[te]=te<<1^283;for(te=0;te<256;te++){let xe=Q^Q<<1^Q<<2^Q<<3^Q<<4;xe=xe>>>8^xe&255^99,t[$]=xe,i[xe]=$;const ke=F[$],Le=F[ke],Ze=F[Le];let rt=F[xe]*257^xe*16843008;o[$]=rt<<24|rt>>>8,l[$]=rt<<16|rt>>>16,u[$]=rt<<8|rt>>>24,f[$]=rt,rt=Ze*16843009^Le*65537^ke*257^$*16843008,v[xe]=rt<<24|rt>>>8,x[xe]=rt<<16|rt>>>16,w[xe]=rt<<8|rt>>>24,k[xe]=rt,$?($=ke^F[F[F[Ze^ke]]],Q^=F[F[Q]]):$=Q=1}}expandKey(t){const i=this.uint8ArrayToUint32Array_(t);let s=!0,o=0;for(;o<i.length&&s;)s=i[o]===this.key[o],o++;if(s)return;this.key=i;const l=this.keySize=i.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);const u=this.ksRows=(l+6+1)*4;let f,y;const v=this.keySchedule=new Uint32Array(u),x=this.invKeySchedule=new Uint32Array(u),w=this.sBox,k=this.rcon,F=this.invSubMix,$=F[0],Q=F[1],te=F[2],xe=F[3];let ke,Le;for(f=0;f<u;f++){if(f<l){ke=v[f]=i[f];continue}Le=ke,f%l===0?(Le=Le<<8|Le>>>24,Le=w[Le>>>24]<<24|w[Le>>>16&255]<<16|w[Le>>>8&255]<<8|w[Le&255],Le^=k[f/l|0]<<24):l>6&&f%l===4&&(Le=w[Le>>>24]<<24|w[Le>>>16&255]<<16|w[Le>>>8&255]<<8|w[Le&255]),v[f]=ke=(v[f-l]^Le)>>>0}for(y=0;y<u;y++)f=u-y,y&3?Le=v[f]:Le=v[f-4],y<4||f<=4?x[y]=Le:x[y]=$[w[Le>>>24]]^Q[w[Le>>>16&255]]^te[w[Le>>>8&255]]^xe[w[Le&255]],x[y]=x[y]>>>0}networkToHostOrderSwap(t){return t<<24|(t&65280)<<8|(t&16711680)>>8|t>>>24}decrypt(t,i,s){const o=this.keySize+6,l=this.invKeySchedule,u=this.invSBox,f=this.invSubMix,y=f[0],v=f[1],x=f[2],w=f[3],k=this.uint8ArrayToUint32Array_(s);let F=k[0],$=k[1],Q=k[2],te=k[3];const xe=new Int32Array(t),ke=new Int32Array(xe.length);let Le,Ze,rt,Lt,ot,St,xt,ht,jt,Br,ei,vi,Xr,Cr;const ii=this.networkToHostOrderSwap;for(;i<xe.length;){for(jt=ii(xe[i]),Br=ii(xe[i+1]),ei=ii(xe[i+2]),vi=ii(xe[i+3]),ot=jt^l[0],St=vi^l[1],xt=ei^l[2],ht=Br^l[3],Xr=4,Cr=1;Cr<o;Cr++)Le=y[ot>>>24]^v[St>>16&255]^x[xt>>8&255]^w[ht&255]^l[Xr],Ze=y[St>>>24]^v[xt>>16&255]^x[ht>>8&255]^w[ot&255]^l[Xr+1],rt=y[xt>>>24]^v[ht>>16&255]^x[ot>>8&255]^w[St&255]^l[Xr+2],Lt=y[ht>>>24]^v[ot>>16&255]^x[St>>8&255]^w[xt&255]^l[Xr+3],ot=Le,St=Ze,xt=rt,ht=Lt,Xr=Xr+4;Le=u[ot>>>24]<<24^u[St>>16&255]<<16^u[xt>>8&255]<<8^u[ht&255]^l[Xr],Ze=u[St>>>24]<<24^u[xt>>16&255]<<16^u[ht>>8&255]<<8^u[ot&255]^l[Xr+1],rt=u[xt>>>24]<<24^u[ht>>16&255]<<16^u[ot>>8&255]<<8^u[St&255]^l[Xr+2],Lt=u[ht>>>24]<<24^u[ot>>16&255]<<16^u[St>>8&255]<<8^u[xt&255]^l[Xr+3],ke[i]=ii(Le^F),ke[i+1]=ii(Lt^$),ke[i+2]=ii(rt^Q),ke[i+3]=ii(Ze^te),F=jt,$=Br,Q=ei,te=vi,i=i+4}return ke.buffer}}class xn{constructor(t,i,s){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=t,this.key=i,this.aesMode=s}expandKey(){const t=Dn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:t},!1,["encrypt","decrypt"])}}function Dn(h){switch(h){case Ci.cbc:return"AES-CBC";case Ci.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${h}`)}}const vn=16;class Fi{constructor(t,{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.enableSoftwareAES=void 0,this.enableSoftwareAES=t.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:t,remainderData:i}=this;if(!t||i)return this.reset(),null;const s=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?On(s):s}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(t,i,s,o){return this.useSoftware?new Promise((l,u)=>{const f=ArrayBuffer.isView(t)?t:new Uint8Array(t);this.softwareDecrypt(f,i,s,o);const y=this.flush();y?l(y.buffer):u(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(t),i,s,o)}softwareDecrypt(t,i,s,o){const{currentIV:l,currentResult:u,remainderData:f}=this;if(o!==Ci.cbc||i.byteLength!==16)return Se.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),f&&(t=Kt(f,t),this.remainderData=null);const y=this.getValidChunk(t);if(!y.length)return null;l&&(s=l);let v=this.softwareDecrypter;v||(v=this.softwareDecrypter=new ss),v.expandKey(i);const x=u;return this.currentResult=v.decrypt(y.buffer,0,s),this.currentIV=y.slice(-16).buffer,x||null}webCryptoDecrypt(t,i,s,o){if(this.key!==i||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(t,i,s,o));this.key=i,this.fastAesKey=new xn(this.subtle,i,o)}return this.fastAesKey.expandKey().then(l=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Gi(this.subtle,new Uint8Array(s),o).decrypt(t.buffer,l)):Promise.reject(new Error("web crypto not initialized"))).catch(l=>(Se.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${l.name}: ${l.message}`),this.onWebCryptoError(t,i,s,o)))}onWebCryptoError(t,i,s,o){const l=this.enableSoftwareAES;if(l){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,i,s,o);const u=this.flush();if(u)return u.buffer}throw new Error("WebCrypto"+(l?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(t){let i=t;const s=t.length-t.length%vn;return s!==t.length&&(i=t.slice(0,s),this.remainderData=t.slice(s)),i}logOnce(t){this.logEnabled&&(Se.log(`[decrypter]: ${t}`),this.logEnabled=!1)}}const ds=Math.pow(2,17);class cn{constructor(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(t,i){const s=t.url;if(!s)return Promise.reject(new Ei({type:Me.NETWORK_ERROR,details:ae.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error(`Fragment does not have a ${s?"part list":"url"}`),networkDetails:null}));this.abort();const o=this.config,l=o.fLoader,u=o.loader;return new Promise((f,y)=>{if(this.loader&&this.loader.destroy(),t.gap)if(t.tagList.some($=>$[0]==="GAP")){y(ts(t));return}else t.gap=!1;const v=this.loader=l?new l(o):new u(o),x=es(t);t.loader=v;const w=Oi(o.fragLoadPolicy.default),k={loadPolicy:w,timeout:w.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:t.sn==="initSegment"?1/0:ds};t.stats=v.stats;const F={onSuccess:($,Q,te,xe)=>{this.resetLoader(t,v);let ke=$.data;te.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(ke.slice(0,16)),ke=ke.slice(16)),f({frag:t,part:null,payload:ke,networkDetails:xe})},onError:($,Q,te,xe)=>{this.resetLoader(t,v),y(new Ei({type:Me.NETWORK_ERROR,details:ae.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:O({url:s,data:void 0},$),error:new Error(`HTTP Error ${$.code} ${$.text}`),networkDetails:te,stats:xe}))},onAbort:($,Q,te)=>{this.resetLoader(t,v),y(new Ei({type:Me.NETWORK_ERROR,details:ae.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:te,stats:$}))},onTimeout:($,Q,te)=>{this.resetLoader(t,v),y(new Ei({type:Me.NETWORK_ERROR,details:ae.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error(`Timeout after ${k.timeout}ms`),networkDetails:te,stats:$}))}};i&&(F.onProgress=($,Q,te,xe)=>i({frag:t,part:null,payload:te,networkDetails:xe})),v.load(x,k,F)})}loadPart(t,i,s){this.abort();const o=this.config,l=o.fLoader,u=o.loader;return new Promise((f,y)=>{if(this.loader&&this.loader.destroy(),t.gap||i.gap){y(ts(t,i));return}const v=this.loader=l?new l(o):new u(o),x=es(t,i);t.loader=v;const w=Oi(o.fragLoadPolicy.default),k={loadPolicy:w,timeout:w.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:ds};i.stats=v.stats,v.load(x,k,{onSuccess:(F,$,Q,te)=>{this.resetLoader(t,v),this.updateStatsFromPart(t,i);const xe={frag:t,part:i,payload:F.data,networkDetails:te};s(xe),f(xe)},onError:(F,$,Q,te)=>{this.resetLoader(t,v),y(new Ei({type:Me.NETWORK_ERROR,details:ae.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:i,response:O({url:x.url,data:void 0},F),error:new Error(`HTTP Error ${F.code} ${F.text}`),networkDetails:Q,stats:te}))},onAbort:(F,$,Q)=>{t.stats.aborted=i.stats.aborted,this.resetLoader(t,v),y(new Ei({type:Me.NETWORK_ERROR,details:ae.INTERNAL_ABORTED,fatal:!1,frag:t,part:i,error:new Error("Aborted"),networkDetails:Q,stats:F}))},onTimeout:(F,$,Q)=>{this.resetLoader(t,v),y(new Ei({type:Me.NETWORK_ERROR,details:ae.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:i,error:new Error(`Timeout after ${k.timeout}ms`),networkDetails:Q,stats:F}))}})})}updateStatsFromPart(t,i){const s=t.stats,o=i.stats,l=o.total;if(s.loaded+=o.loaded,l){const y=Math.round(t.duration/i.duration),v=Math.min(Math.round(s.loaded/l),y),w=(y-v)*Math.round(s.loaded/v);s.total=s.loaded+w}else s.total=Math.max(s.loaded,s.total);const u=s.loading,f=o.loading;u.start?u.first+=f.first-f.start:(u.start=f.start,u.first=f.first),u.end=f.end}resetLoader(t,i){t.loader=null,this.loader===i&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),i.destroy()}}function es(h,t=null){const i=t||h,s={frag:h,part:t,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},o=i.byteRangeStartOffset,l=i.byteRangeEndOffset;if(U(o)&&U(l)){var u;let f=o,y=l;if(h.sn==="initSegment"&&wn((u=h.decryptdata)==null?void 0:u.method)){const v=l-o;v%16&&(y=l+(16-v%16)),o!==0&&(s.resetIV=!0,f=o-16)}s.rangeStart=f,s.rangeEnd=y}return s}function ts(h,t){const i=new Error(`GAP ${h.gap?"tag":"attribute"} found`),s={type:Me.MEDIA_ERROR,details:ae.FRAG_GAP,fatal:!1,frag:h,error:i,networkDetails:null};return t&&(s.part=t),(t||h).stats.aborted=!0,new Ei(s)}function wn(h){return h==="AES-128"||h==="AES-256"}class Ei extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class as extends le{constructor(t,i){super(t,i),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(t){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!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(){}}class rs{constructor(t,i,s,o=0,l=-1,u=!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=os(),this.buffering={audio:os(),video:os(),audiovideo:os()},this.level=t,this.sn=i,this.id=s,this.size=o,this.part=l,this.partial=u}}function os(){return{start:0,executeStart:0,executeEnd:0,end:0}}const zn={length:0,start:()=>0,end:()=>0};class di{static isBuffered(t,i){if(t){const s=di.getBuffered(t);for(let o=s.length;o--;)if(i>=s.start(o)&&i<=s.end(o))return!0}return!1}static bufferedRanges(t){if(t){const i=di.getBuffered(t);return di.timeRangesToArray(i)}return[]}static timeRangesToArray(t){const i=[];for(let s=0;s<t.length;s++)i.push({start:t.start(s),end:t.end(s)});return i}static bufferInfo(t,i,s){if(t){const o=di.bufferedRanges(t);if(o.length)return di.bufferedInfo(o,i,s)}return{len:0,start:i,end:i,bufferedIndex:-1}}static bufferedInfo(t,i,s){i=Math.max(0,i),t.length>1&&t.sort((x,w)=>x.start-w.start||w.end-x.end);let o=-1,l=[];if(s)for(let x=0;x<t.length;x++){i>=t[x].start&&i<=t[x].end&&(o=x);const w=l.length;if(w){const k=l[w-1].end;t[x].start-k<s?t[x].end>k&&(l[w-1].end=t[x].end):l.push(t[x])}else l.push(t[x])}else l=t;let u=0,f,y=i,v=i;for(let x=0;x<l.length;x++){const w=l[x].start,k=l[x].end;if(o===-1&&i>=w&&i<=k&&(o=x),i+s>=w&&i<k)y=w,v=k,u=v-i;else if(i+s<w){f=w;break}}return{len:u,start:y||0,end:v||0,nextStart:f,buffered:t,bufferedIndex:o}}static getBuffered(t){try{return t.buffered||zn}catch(i){return Se.log("failed to get media.buffered",i),zn}}}const Ts=/\{\$([a-zA-Z0-9-_]+)\}/g;function tr(h){return Ts.test(h)}function hn(h,t){if(h.variableList!==null||h.hasVariableRefs){const i=h.variableList;return t.replace(Ts,s=>{const o=s.substring(2,s.length-1),l=i==null?void 0:i[o];return l===void 0?(h.playlistParsingError||(h.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${o}"`)),s):l})}return t}function Ps(h,t,i){let s=h.variableList;s||(h.variableList=s={});let o,l;if("QUERYPARAM"in t){o=t.QUERYPARAM;try{const u=new self.URL(i).searchParams;if(u.has(o))l=u.get(o);else throw new Error(`"${o}" does not match any query parameter in URI: "${i}"`)}catch(u){h.playlistParsingError||(h.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${u.message}`))}}else o=t.NAME,l=t.VALUE;o in s?h.playlistParsingError||(h.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${o}"`)):s[o]=l||""}function ls(h,t,i){const s=t.IMPORT;if(i&&s in i){let o=h.variableList;o||(h.variableList=o={}),o[s]=i[s]}else h.playlistParsingError||(h.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}const Mn=/^(\d+)x(\d+)$/,us=/(.+?)=(".*?"|.*?)(?:,|$)/g;class oi{constructor(t,i){typeof t=="string"&&(t=oi.parseAttrList(t,i)),M(this,t)}get clientAttrs(){return Object.keys(this).filter(t=>t.substring(0,2)==="X-")}decimalInteger(t){const i=parseInt(this[t],10);return i>Number.MAX_SAFE_INTEGER?1/0:i}hexadecimalInteger(t){if(this[t]){let i=(this[t]||"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}return null}hexadecimalIntegerAsNumber(t){const i=parseInt(this[t],16);return i>Number.MAX_SAFE_INTEGER?1/0:i}decimalFloatingPoint(t){return parseFloat(this[t])}optionalFloat(t,i){const s=this[t];return s?parseFloat(s):i}enumeratedString(t){return this[t]}enumeratedStringList(t,i){const s=this[t];return(s?s.split(/[ ,]+/):[]).reduce((o,l)=>(o[l.toLowerCase()]=!0,o),i)}bool(t){return this[t]==="YES"}decimalResolution(t){const i=Mn.exec(this[t]);if(i!==null)return{width:parseInt(i[1],10),height:parseInt(i[2],10)}}static parseAttrList(t,i){let s;const o={},l='"';for(us.lastIndex=0;(s=us.exec(t))!==null;){const u=s[1].trim();let f=s[2];const y=f.indexOf(l)===0&&f.lastIndexOf(l)===f.length-1;let v=!1;if(y)f=f.slice(1,-1);else switch(u){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":v=!0}if(i&&(y||v))f=hn(i,f);else if(!v&&!y)switch(u){case"CLOSED-CAPTIONS":if(f==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":Se.warn(`${t}: attribute ${u} is missing quotes`)}o[u]=f}return o}}const Kn="com.apple.hls.interstitial";function fs(h){return h!=="ID"&&h!=="CLASS"&&h!=="CUE"&&h!=="START-DATE"&&h!=="DURATION"&&h!=="END-DATE"&&h!=="END-ON-NEXT"}function jn(h){return h==="SCTE35-OUT"||h==="SCTE35-IN"||h==="SCTE35-CMD"}class dn{constructor(t,i,s=0){var o;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(i==null?void 0:i.tagAnchor)||null,this.tagOrder=(o=i==null?void 0:i.tagOrder)!=null?o:s,i){const l=i.attr;for(const u in l)if(Object.prototype.hasOwnProperty.call(t,u)&&t[u]!==l[u]){Se.warn(`DATERANGE tag attribute: "${u}" does not match for tags with ID: "${t.ID}"`),this._badValueForSameId=u;break}t=M(new oi({}),l,t)}if(this.attr=t,i?(this._startDate=i._startDate,this._cue=i._cue,this._endDate=i._endDate,this._dateAtEnd=i._dateAtEnd):this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const l=(i==null?void 0:i.endDate)||new Date(this.attr["END-DATE"]);U(l.getTime())&&(this._endDate=l)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const t=this._cue;return t===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):t}get startTime(){const{tagAnchor:t}=this;return t===null||t.programDateTime===null?(Se.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${t}`),NaN):t.start+(this.startDate.getTime()-t.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const t=this._endDate||this._dateAtEnd;if(t)return t;const i=this.duration;return i!==null?this._dateAtEnd=new Date(this._startDate.getTime()+i*1e3):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(U(t))return t}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 isInterstitial(){return this.class===Kn}get isValid(){return!!this.id&&!this._badValueForSameId&&U(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const Sn=10;class Bn{constructor(t){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.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!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.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}reloaded(t){if(!t){this.advanced=!0,this.updated=!0;return}const i=this.lastPartSn-t.lastPartSn,s=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!s||!!i||!this.live,this.advanced=this.endSN>t.endSN||i>0||i===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(t.misses*.6):this.misses=t.misses+1}hasKey(t){return this.encryptedFragments.some(i=>{let s=i.decryptdata;return s||(i.setKeyFormat(t.keyFormat),s=i.decryptdata),!!s&&t.matches(s)})}get hasProgramDateTime(){return this.fragments.length?U(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Sn}get drift(){const t=this.driftEndTime-this.driftStartTime;return t>0?(this.driftEnd-this.driftStart)*1e3/t:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const t=this.partList;if(t){const i=this.lastPartIndex;if(i!==-1){for(let s=t.length;s--;)if(t[s].index>i)return t[s].index;return i}}return 0}get lastPartSn(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const t=this.partEnd-this.fragmentStart;return this.age>Math.max(t,this.totalduration)+this.levelTargetDuration}return!1}}function Ln(h,t){return h.length===t.length?!h.some((i,s)=>i!==t[s]):!1}function Cs(h,t){return!h&&!t?!0:!h||!t?!1:Ln(h,t)}function Zn(h){return h==="AES-128"||h==="AES-256"||h==="AES-256-CTR"}function ia(h){switch(h){case"AES-128":case"AES-256":return Ci.cbc;case"AES-256-CTR":return Ci.ctr;default:throw new Error(`invalid full segment method ${h}`)}}function ca(h){return Uint8Array.from(atob(h),t=>t.charCodeAt(0))}function Gs(h){return Uint8Array.from(unescape(encodeURIComponent(h)),t=>t.charCodeAt(0))}function _s(h){const t=Gs(h).subarray(0,16),i=new Uint8Array(16);return i.set(t,16-t.length),i}function Kr(h){const t=function(s,o,l){const u=s[o];s[o]=s[l],s[l]=u};t(h,0,3),t(h,1,2),t(h,4,5),t(h,6,7)}function fi(h){const t=h.split(":");let i=null;if(t[0]==="data"&&t.length===2){const s=t[1].split(";"),o=s[s.length-1].split(",");if(o.length===2){const l=o[0]==="base64",u=o[1];l?(s.splice(-1,1),i=ca(u)):i=_s(u)}}return i}const Zi=typeof self!="undefined"?self:void 0;var yi={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},_i={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function is(h){switch(h){case _i.FAIRPLAY:return yi.FAIRPLAY;case _i.PLAYREADY:return yi.PLAYREADY;case _i.WIDEVINE:return yi.WIDEVINE;case _i.CLEARKEY:return yi.CLEARKEY}}function rn(h){switch(h){case yi.FAIRPLAY:return _i.FAIRPLAY;case yi.PLAYREADY:return _i.PLAYREADY;case yi.WIDEVINE:return _i.WIDEVINE;case yi.CLEARKEY:return _i.CLEARKEY}}function cs(h){const{drmSystems:t,widevineLicenseUrl:i}=h,s=t?[yi.FAIRPLAY,yi.WIDEVINE,yi.PLAYREADY,yi.CLEARKEY].filter(o=>!!t[o]):[];return!s[yi.WIDEVINE]&&i&&s.push(yi.WIDEVINE),s}const Pi=function(h){return Zi!=null&&(h=Zi.navigator)!=null&&h.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function bi(h,t,i,s){let o;switch(h){case yi.FAIRPLAY:o=["cenc","sinf"];break;case yi.WIDEVINE:case yi.PLAYREADY:o=["cenc"];break;case yi.CLEARKEY:o=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${h}`)}return yn(o,t,i,s)}function yn(h,t,i,s){return[{initDataTypes:h,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:t.map(l=>({contentType:`audio/mp4; codecs=${l}`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:i.map(l=>({contentType:`video/mp4; codecs=${l}`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function fn(h){var t;return!!h&&(h.sessionType==="persistent-license"||!!((t=h.sessionTypes)!=null&&t.some(i=>i==="persistent-license")))}function pn(h){const t=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/2),i=String.fromCharCode.apply(null,Array.from(t)),s=i.substring(i.indexOf("<"),i.length),u=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(u){const f=u.childNodes[0]?u.childNodes[0].nodeValue:u.getAttribute("VALUE");if(f){const y=ca(f).subarray(0,16);return Kr(y),y}}return null}let En={};class Vi{static clearKeyUriToKeyIdMap(){En={}}static setKeyIdForUri(t,i){En[t]=i}static addKeyIdForUri(t){const i=Object.keys(En).length%Number.MAX_SAFE_INTEGER,s=new Uint8Array(16);return new DataView(s.buffer,12,4).setUint32(0,i),En[t]=s,s}constructor(t,i,s,o=[1],l=null,u){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=t,this.uri=i,this.keyFormat=s,this.keyFormatVersions=o,this.iv=l,this.encrypted=t?t!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Zn(t),u!=null&&u.startsWith("0x")&&(this.keyId=new Uint8Array(oe(u)))}matches(t){return t.uri===this.uri&&t.method===this.method&&t.encrypted===this.encrypted&&t.keyFormat===this.keyFormat&&Ln(t.keyFormatVersions,this.keyFormatVersions)&&Cs(t.iv,this.iv)&&Cs(t.keyId,this.keyId)}isSupported(){if(this.method){if(Zn(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case _i.FAIRPLAY:case _i.WIDEVINE:case _i.PLAYREADY:case _i.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(t,i){if(!this.encrypted||!this.uri)return null;if(Zn(this.method)){let l=this.iv;return l||(typeof t!="number"&&(Se.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),t=0),l=ns(t)),new Vi(this.method,this.uri,"identity",this.keyFormatVersions,l)}if(this.keyId){const l=En[this.uri];if(l&&!Ln(this.keyId,l)&&Vi.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const s=fi(this.uri);if(s)switch(this.keyFormat){case _i.WIDEVINE:if(this.pssh=s,!this.keyId){const l=yt(s.buffer);if(l.length){var o;const u=l[0];this.keyId=(o=u.kids)!=null&&o.length?u.kids[0]:null}}this.keyId||(this.keyId=Zs(i));break;case _i.PLAYREADY:{const l=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=N(l,null,s),this.keyId=pn(s);break}default:{let l=s.subarray(0,16);if(l.length!==16){const u=new Uint8Array(16);u.set(l,16-l.length),l=u}this.keyId=l;break}}if(!this.keyId||this.keyId.byteLength!==16){let l;l=Yn(i),l||(l=Zs(i),l||(l=En[this.uri])),l&&(this.keyId=l,Vi.setKeyIdForUri(this.uri,l))}return this}}function Yn(h){const t=h==null?void 0:h[_i.WIDEVINE];return t?t.keyId:null}function Zs(h){const t=h==null?void 0:h[_i.PLAYREADY];if(t){const i=fi(t.uri);if(i)return pn(i)}return null}function ns(h){const t=new Uint8Array(16);for(let i=12;i<16;i++)t[i]=h>>8*(15-i)&255;return t}const ja=/#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,Na=/#EXT-X-MEDIA:(.*)/g,Os=/^#EXT(?:INF|-X-TARGETDURATION):/m,Da=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),ho=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|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 Ys{static findGroup(t,i){for(let s=0;s<t.length;s++){const o=t[s];if(o.id===i)return o}}static resolve(t,i){return D.buildAbsoluteURL(i,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return Os.test(t)}static parseMasterPlaylist(t,i){const s=tr(t),o={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:s},l=[];if(ja.lastIndex=0,!t.startsWith("#EXTM3U"))return o.playlistParsingError=new Error("no EXTM3U delimiter"),o;let u;for(;(u=ja.exec(t))!=null;)if(u[1]){var f;const v=new oi(u[1],o),x=hn(o,u[2]),w={attrs:v,bitrate:v.decimalInteger("BANDWIDTH")||v.decimalInteger("AVERAGE-BANDWIDTH"),name:v.NAME,url:Ys.resolve(x,i)},k=v.decimalResolution("RESOLUTION");k&&(w.width=k.width,w.height=k.height),po(v.CODECS,w);const F=v["SUPPLEMENTAL-CODECS"];F&&(w.supplemental={},po(F,w.supplemental)),(f=w.unknownCodecs)!=null&&f.length||l.push(w),o.levels.push(w)}else if(u[3]){const v=u[3],x=u[4];switch(v){case"SESSION-DATA":{const w=new oi(x,o),k=w["DATA-ID"];k&&(o.sessionData===null&&(o.sessionData={}),o.sessionData[k]=w);break}case"SESSION-KEY":{const w=fo(x,i,o);w.encrypted&&w.isSupported()?(o.sessionKeys===null&&(o.sessionKeys=[]),o.sessionKeys.push(w)):Se.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${x}"`);break}case"DEFINE":{{const w=new oi(x,o);Ps(o,w,i)}break}case"CONTENT-STEERING":{const w=new oi(x,o);o.contentSteering={uri:Ys.resolve(w["SERVER-URI"],i),pathwayId:w["PATHWAY-ID"]||"."};break}case"START":{o.startTimeOffset=qa(x);break}}}const y=l.length>0&&l.length<o.levels.length;return o.levels=y?l:o.levels,o.levels.length===0&&(o.playlistParsingError=new Error("no levels found in manifest")),o}static parseMasterPlaylistMedia(t,i,s){let o;const l={},u=s.levels,f={AUDIO:u.map(v=>({id:v.attrs.AUDIO,audioCodec:v.audioCodec})),SUBTITLES:u.map(v=>({id:v.attrs.SUBTITLES,textCodec:v.textCodec})),"CLOSED-CAPTIONS":[]};let y=0;for(Na.lastIndex=0;(o=Na.exec(t))!==null;){const v=new oi(o[1],s),x=v.TYPE;if(x){const w=f[x],k=l[x]||[];l[x]=k;const F=v.LANGUAGE,$=v["ASSOC-LANGUAGE"],Q=v.CHANNELS,te=v.CHARACTERISTICS,xe=v["INSTREAM-ID"],ke={attrs:v,bitrate:0,id:y++,groupId:v["GROUP-ID"]||"",name:v.NAME||F||"",type:x,default:v.bool("DEFAULT"),autoselect:v.bool("AUTOSELECT"),forced:v.bool("FORCED"),lang:F,url:v.URI?Ys.resolve(v.URI,i):""};if($&&(ke.assocLang=$),Q&&(ke.channels=Q),te&&(ke.characteristics=te),xe&&(ke.instreamId=xe),w!=null&&w.length){const Le=Ys.findGroup(w,ke.groupId)||w[0];na(ke,Le,"audioCodec"),na(ke,Le,"textCodec")}k.push(ke)}}return l}static parseLevelPlaylist(t,i,s,o,l,u){var f;const y={url:i},v=new Bn(i),x=v.fragments,w=[];let k=null,F=0,$=0,Q=0,te=0,xe=0,ke=null,Le=new Et(o,y),Ze,rt,Lt,ot=-1,St=!1,xt=null,ht;if(Da.lastIndex=0,v.m3u8=t,v.hasVariableRefs=tr(t),((f=Da.exec(t))==null?void 0:f[0])!=="#EXTM3U")return v.playlistParsingError=new Error("Missing format identifier #EXTM3U"),v;for(;(Ze=Da.exec(t))!==null;){St&&(St=!1,Le=new Et(o,y),Le.playlistOffset=Q,Le.setStart(Q),Le.sn=F,Le.cc=te,xe&&(Le.bitrate=xe),Le.level=s,k&&(Le.initSegment=k,k.rawProgramDateTime&&(Le.rawProgramDateTime=k.rawProgramDateTime,k.rawProgramDateTime=null),xt&&(Le.setByteRange(xt),xt=null)));const vi=Ze[1];if(vi){Le.duration=parseFloat(vi);const Xr=(" "+Ze[2]).slice(1);Le.title=Xr||null,Le.tagList.push(Xr?["INF",vi,Xr]:["INF",vi])}else if(Ze[3]){if(U(Le.duration)){Le.playlistOffset=Q,Le.setStart(Q),Lt&&ol(Le,Lt,v),Le.sn=F,Le.level=s,Le.cc=te,x.push(Le);const Xr=(" "+Ze[3]).slice(1);Le.relurl=hn(v,Xr),Xs(Le,ke,w),ke=Le,Q+=Le.duration,F++,$=0,St=!0}}else{if(Ze=Ze[0].match(ho),!Ze){Se.warn("No matches on slow regex match for level playlist!");continue}for(rt=1;rt<Ze.length&&Ze[rt]===void 0;rt++);const Xr=(" "+Ze[rt]).slice(1),Cr=(" "+Ze[rt+1]).slice(1),ii=Ze[rt+2]?(" "+Ze[rt+2]).slice(1):null;switch(Xr){case"BYTERANGE":ke?Le.setByteRange(Cr,ke):Le.setByteRange(Cr);break;case"PROGRAM-DATE-TIME":Le.rawProgramDateTime=Cr,Le.tagList.push(["PROGRAM-DATE-TIME",Cr]),ot===-1&&(ot=x.length);break;case"PLAYLIST-TYPE":v.type&&Bs(v,Xr,Ze),v.type=Cr.toUpperCase();break;case"MEDIA-SEQUENCE":v.startSN!==0?Bs(v,Xr,Ze):x.length>0&&Ma(v,Xr,Ze),F=v.startSN=parseInt(Cr);break;case"SKIP":{v.skippedSegments&&Bs(v,Xr,Ze);const Gr=new oi(Cr,v),li=Gr.decimalInteger("SKIPPED-SEGMENTS");if(U(li)){v.skippedSegments+=li;for(let _r=li;_r--;)x.push(null);F+=li}const Li=Gr.enumeratedString("RECENTLY-REMOVED-DATERANGES");Li&&(v.recentlyRemovedDateranges=(v.recentlyRemovedDateranges||[]).concat(Li.split(" ")));break}case"TARGETDURATION":v.targetduration!==0&&Bs(v,Xr,Ze),v.targetduration=Math.max(parseInt(Cr),1);break;case"VERSION":v.version!==null&&Bs(v,Xr,Ze),v.version=parseInt(Cr);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":v.live||Bs(v,Xr,Ze),v.live=!1;break;case"#":(Cr||ii)&&Le.tagList.push(ii?[Cr,ii]:[Cr]);break;case"DISCONTINUITY":te++,Le.tagList.push(["DIS"]);break;case"GAP":Le.gap=!0,Le.tagList.push([Xr]);break;case"BITRATE":Le.tagList.push([Xr,Cr]),xe=parseInt(Cr)*1e3,U(xe)?Le.bitrate=xe:xe=0;break;case"DATERANGE":{const Gr=new oi(Cr,v),li=new dn(Gr,v.dateRanges[Gr.ID],v.dateRangeTagCount);v.dateRangeTagCount++,li.isValid||v.skippedSegments?v.dateRanges[li.id]=li:Se.warn(`Ignoring invalid DATERANGE tag: "${Cr}"`),Le.tagList.push(["EXT-X-DATERANGE",Cr]);break}case"DEFINE":{{const Gr=new oi(Cr,v);"IMPORT"in Gr?ls(v,Gr,u):Ps(v,Gr,i)}break}case"DISCONTINUITY-SEQUENCE":v.startCC!==0?Bs(v,Xr,Ze):x.length>0&&Ma(v,Xr,Ze),v.startCC=te=parseInt(Cr);break;case"KEY":{const Gr=fo(Cr,i,v);if(Gr.isSupported()){if(Gr.method==="NONE"){Lt=void 0;break}Lt||(Lt={});const li=Lt[Gr.keyFormat];li!=null&&li.matches(Gr)||(li&&(Lt=M({},Lt)),Lt[Gr.keyFormat]=Gr)}else Se.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${Cr}"`);break}case"START":v.startTimeOffset=qa(Cr);break;case"MAP":{const Gr=new oi(Cr,v);if(Le.duration){const li=new Et(o,y);mo(li,Gr,s,Lt),k=li,Le.initSegment=k,k.rawProgramDateTime&&!Le.rawProgramDateTime&&(Le.rawProgramDateTime=k.rawProgramDateTime)}else{const li=Le.byteRangeEndOffset;if(li){const Li=Le.byteRangeStartOffset;xt=`${li-Li}@${Li}`}else xt=null;mo(Le,Gr,s,Lt),k=Le,St=!0}k.cc=te;break}case"SERVER-CONTROL":{ht&&Bs(v,Xr,Ze),ht=new oi(Cr),v.canBlockReload=ht.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=ht.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&ht.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=ht.optionalFloat("PART-HOLD-BACK",0),v.holdBack=ht.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{v.partTarget&&Bs(v,Xr,Ze);const Gr=new oi(Cr);v.partTarget=Gr.decimalFloatingPoint("PART-TARGET");break}case"PART":{let Gr=v.partList;Gr||(Gr=v.partList=[]);const li=$>0?Gr[Gr.length-1]:void 0,Li=$++,_r=new oi(Cr,v),Pr=new bt(_r,Le,y,Li,li);Gr.push(Pr),Le.duration+=Pr.duration;break}case"PRELOAD-HINT":{const Gr=new oi(Cr,v);v.preloadHint=Gr;break}case"RENDITION-REPORT":{const Gr=new oi(Cr,v);v.renditionReports=v.renditionReports||[],v.renditionReports.push(Gr);break}default:Se.warn(`line parsed but not handled: ${Ze}`);break}}}ke&&!ke.relurl?(x.pop(),Q-=ke.duration,v.partList&&(v.fragmentHint=ke)):v.partList&&(Xs(Le,ke,w),Le.cc=te,v.fragmentHint=Le,Lt&&ol(Le,Lt,v)),v.targetduration||(v.playlistParsingError=new Error("Missing Target Duration"));const jt=x.length,Br=x[0],ei=x[jt-1];if(Q+=v.skippedSegments*v.targetduration,Q>0&&jt&&ei){v.averagetargetduration=Q/jt;const vi=ei.sn;v.endSN=vi!=="initSegment"?vi:0,v.live||(ei.endList=!0),ot>0&&(Io(x,ot),Br&&w.unshift(Br))}return v.fragmentHint&&(Q+=v.fragmentHint.duration),v.totalduration=Q,w.length&&v.dateRangeTagCount&&Br&&al(w,v),v.endCC=te,v}}function al(h,t){let i=h.length;if(!i)if(t.hasProgramDateTime){const f=t.fragments[t.fragments.length-1];h.push(f),i++}else return;const s=h[i-1],o=t.live?1/0:t.totalduration,l=Object.keys(t.dateRanges);for(let f=l.length;f--;){const y=t.dateRanges[l[f]],v=y.startDate.getTime();y.tagAnchor=s.ref;for(let x=i;x--;){var u;if(((u=h[x])==null?void 0:u.sn)<t.startSN)break;const w=Kl(t,v,h,x,o);if(w!==-1){y.tagAnchor=t.fragments[w].ref;break}}}}function Kl(h,t,i,s,o){const l=i[s];if(l){const f=l.programDateTime;if(t>=f||s===0){var u;const y=(((u=i[s+1])==null?void 0:u.start)||o)-l.start;if(t<=f+y*1e3){const v=i[s].sn-h.startSN;if(v<0)return-1;const x=h.fragments;if(x.length>i.length){const k=(i[s+1]||x[x.length-1]).sn-h.startSN;for(let F=k;F>v;F--){const $=x[F].programDateTime;if(t>=$&&t<$+x[F].duration*1e3)return F}}return v}}}return-1}function fo(h,t,i){var s,o;const l=new oi(h,i),u=(s=l.METHOD)!=null?s:"",f=l.URI,y=l.hexadecimalInteger("IV"),v=l.KEYFORMATVERSIONS,x=(o=l.KEYFORMAT)!=null?o:"identity";f&&l.IV&&!y&&Se.error(`Invalid IV: ${l.IV}`);const w=f?Ys.resolve(f,t):"",k=(v||"1").split("/").map(Number).filter(Number.isFinite);return new Vi(u,w,x,k,y,l.KEYID)}function qa(h){const i=new oi(h).decimalFloatingPoint("TIME-OFFSET");return U(i)?i:null}function po(h,t){let i=(h||"").split(/[ ,]+/).filter(s=>s);["video","audio","text"].forEach(s=>{const o=i.filter(l=>Ne(l,s));o.length&&(t[`${s}Codec`]=o.map(l=>l.split("/")[0]).join(","),i=i.filter(l=>o.indexOf(l)===-1))}),t.unknownCodecs=i}function na(h,t,i){const s=t[i];s&&(h[i]=s)}function Io(h,t){let i=h[t];for(let s=t;s--;){const o=h[s];if(!o)return;o.programDateTime=i.programDateTime-o.duration*1e3,i=o}}function Xs(h,t,i){h.rawProgramDateTime?i.push(h):t!=null&&t.programDateTime&&(h.programDateTime=t.endProgramDateTime)}function mo(h,t,i,s){h.relurl=t.URI,t.BYTERANGE&&h.setByteRange(t.BYTERANGE),h.level=i,h.sn="initSegment",s&&(h.levelkeys=s),h.initSegment=null}function ol(h,t,i){h.levelkeys=t;const{encryptedFragments:s}=i;(!s.length||s[s.length-1].levelkeys!==t)&&Object.keys(t).some(o=>t[o].isCommonEncryption)&&s.push(h)}function Bs(h,t,i){h.playlistParsingError=new Error(`#EXT-X-${t} must not appear more than once (${i[0]})`)}function Ma(h,t,i){h.playlistParsingError=new Error(`#EXT-X-${t} must appear before the first Media Segment (${i[0]})`)}function Za(h,t){const i=t.startPTS;if(U(i)){let s=0,o;t.sn>h.sn?(s=i-h.start,o=h):(s=h.start-i,o=t),o.duration!==s&&o.setDuration(s)}else t.sn>h.sn?h.cc===t.cc&&h.minEndPTS?t.setStart(h.start+(h.minEndPTS-h.start)):t.setStart(h.start+h.duration):t.setStart(Math.max(h.start-t.duration,0))}function ha(h,t,i,s,o,l,u){s-i<=0&&(u.warn("Fragment should have a positive duration",t),s=i+t.duration,l=o+t.duration);let y=i,v=s;const x=t.startPTS,w=t.endPTS;if(U(x)){const xe=Math.abs(x-i);h&&xe>h.totalduration?u.warn(`media timestamps and playlist times differ by ${xe}s for level ${t.level} ${h.url}`):U(t.deltaPTS)?t.deltaPTS=Math.max(xe,t.deltaPTS):t.deltaPTS=xe,y=Math.max(i,x),i=Math.min(i,x),o=t.startDTS!==void 0?Math.min(o,t.startDTS):o,v=Math.min(s,w),s=Math.max(s,w),l=t.endDTS!==void 0?Math.max(l,t.endDTS):l}const k=i-t.start;t.start!==0&&t.setStart(i),t.setDuration(s-t.start),t.startPTS=i,t.maxStartPTS=y,t.startDTS=o,t.endPTS=s,t.minEndPTS=v,t.endDTS=l;const F=t.sn;if(!h||F<h.startSN||F>h.endSN)return 0;let $;const Q=F-h.startSN,te=h.fragments;for(te[Q]=t,$=Q;$>0;$--)Za(te[$],te[$-1]);for($=Q;$<te.length-1;$++)Za(te[$],te[$+1]);return h.fragmentHint&&Za(te[te.length-1],h.fragmentHint),h.PTSKnown=h.alignedSliding=!0,k}function go(h,t,i){if(h===t)return;let s=null;const o=h.fragments;for(let x=o.length-1;x>=0;x--){const w=o[x].initSegment;if(w){s=w;break}}h.fragmentHint&&delete h.fragmentHint.endPTS;let l;Fs(h,t,(x,w,k,F)=>{if((!t.startCC||t.skippedSegments)&&w.cc!==x.cc){const $=x.cc-w.cc;for(let Q=k;Q<F.length;Q++)F[Q].cc+=$;t.endCC=F[F.length-1].cc}U(x.startPTS)&&U(x.endPTS)&&(w.setStart(w.startPTS=x.startPTS),w.startDTS=x.startDTS,w.maxStartPTS=x.maxStartPTS,w.endPTS=x.endPTS,w.endDTS=x.endDTS,w.minEndPTS=x.minEndPTS,w.setDuration(x.endPTS-x.startPTS),w.duration&&(l=w),t.PTSKnown=t.alignedSliding=!0),x.hasStreams&&(w.elementaryStreams=x.elementaryStreams),w.loader=x.loader,x.hasStats&&(w.stats=x.stats),x.initSegment&&(w.initSegment=x.initSegment,s=x.initSegment)});const u=t.fragments,f=t.fragmentHint?u.concat(t.fragmentHint):u;if(s&&f.forEach(x=>{var w;x&&(!x.initSegment||x.initSegment.relurl===((w=s)==null?void 0:w.relurl))&&(x.initSegment=s)}),t.skippedSegments){if(t.deltaUpdateFailed=u.some(x=>!x),t.deltaUpdateFailed){i.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let x=t.skippedSegments;x--;)u.shift();t.startSN=u[0].sn}else{t.canSkipDateRanges&&(t.dateRanges=da(h.dateRanges,t,i));const x=h.fragments.filter(w=>w.rawProgramDateTime);if(h.hasProgramDateTime&&!t.hasProgramDateTime)for(let w=1;w<f.length;w++)f[w].programDateTime===null&&Xs(f[w],f[w-1],x);al(x,t)}t.endCC=u[u.length-1].cc}if(!t.startCC){var y;const x=sn(h,t.startSN-1);t.startCC=(y=x==null?void 0:x.cc)!=null?y:u[0].cc}ll(h.partList,t.partList,(x,w)=>{w.elementaryStreams=x.elementaryStreams,w.stats=x.stats}),l?ha(t,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS,i):Js(h,t),u.length&&(t.totalduration=t.edge-u[0].start),t.driftStartTime=h.driftStartTime,t.driftStart=h.driftStart;const v=t.advancedDateTime;if(t.advanced&&v){const x=t.edge;t.driftStart||(t.driftStartTime=v,t.driftStart=x),t.driftEndTime=v,t.driftEnd=x}else t.driftEndTime=h.driftEndTime,t.driftEnd=h.driftEnd,t.advancedDateTime=h.advancedDateTime;t.requestScheduled===-1&&(t.requestScheduled=h.requestScheduled)}function da(h,t,i){const{dateRanges:s,recentlyRemovedDateranges:o}=t,l=M({},h);o&&o.forEach(y=>{delete l[y]});const f=Object.keys(l).length;return f?(Object.keys(s).forEach(y=>{const v=l[y],x=new dn(s[y].attr,v);x.isValid?(l[y]=x,v||(x.tagOrder+=f)):i.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${tt(s[y].attr)}"`)}),l):s}function ll(h,t,i){if(h&&t){let s=0;for(let o=0,l=h.length;o<=l;o++){const u=h[o],f=t[o+s];u&&f&&u.index===f.index&&u.fragment.sn===f.fragment.sn?i(u,f):s--}}}function Fs(h,t,i){const s=t.skippedSegments,o=Math.max(h.startSN,t.startSN)-t.startSN,l=(h.fragmentHint?1:0)+(s?t.endSN:Math.min(h.endSN,t.endSN))-t.startSN,u=t.startSN-h.startSN,f=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,y=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;for(let v=o;v<=l;v++){const x=y[u+v];let w=f[v];if(s&&!w&&x&&(w=t.fragments[v]=x),x&&w){i(x,w,v,f);const k=x.relurl,F=w.relurl;if(k&&Ya(k,F)){t.playlistParsingError=$a(`media sequence mismatch ${w.sn}:`,h,t,x,w);return}else if(x.cc!==w.cc){t.playlistParsingError=$a(`discontinuity sequence mismatch (${x.cc}!=${w.cc})`,h,t,x,w);return}}}}function $a(h,t,i,s,o){return new Error(`${h} ${o.url}
Playlist starting @${t.startSN}
${t.m3u8}
Playlist starting @${i.startSN}
${i.m3u8}`)}function Js(h,t,i=!0){const s=t.startSN+t.skippedSegments-h.startSN,o=h.fragments,l=s>=0;let u=0;if(l&&s<o.length)u=o[s].start;else if(l&&t.startSN===h.endSN+1)u=h.fragmentEnd;else if(l&&i)u=h.fragmentStart+s*t.levelTargetDuration;else if(!t.skippedSegments&&t.fragmentStart===0)u=h.fragmentStart;else return;Ro(t,u)}function Ro(h,t){if(t){const i=h.fragments;for(let s=h.skippedSegments;s<i.length;s++)i[s].addStart(t);h.fragmentHint&&h.fragmentHint.addStart(t)}}function en(h,t=1/0){let i=1e3*h.targetduration;if(h.updated){const s=h.fragments;if(s.length&&i*4>t){const l=s[s.length-1].duration*1e3;l<i&&(i=l)}}else i/=2;return Math.round(i)}function sn(h,t,i){if(!h)return null;let s=h.fragments[t-h.startSN];return s||(s=h.fragmentHint,s&&s.sn===t)?s:t<h.startSN&&i&&i.sn===t?i:null}function bn(h,t,i){return h?Ss(h.partList,t,i):null}function Ss(h,t,i){if(h)for(let s=h.length;s--;){const o=h[s];if(o.index===i&&o.fragment.sn===t)return o}return null}function Ds(h){h.forEach((t,i)=>{var s;(s=t.details)==null||s.fragments.forEach(o=>{o.level=i,o.initSegment&&(o.initSegment.level=i)})})}function Ya(h,t){return h!==t&&t?La(h)!==La(t):!1}function La(h){return h.replace(/\?[^?]*$/,"")}function sa(h,t){for(let s=0,o=h.length;s<o;s++){var i;if(((i=h[s])==null?void 0:i.cc)===t)return h[s]}return null}function Po(h,t){return!!(h&&t.startCC<h.endCC&&t.endCC>h.startCC)}function vo(h,t){const i=h.start+t;h.startPTS=i,h.setStart(i),h.endPTS=i+h.duration}function Ia(h,t){const i=t.fragments;for(let s=0,o=i.length;s<o;s++)vo(i[s],h);t.fragmentHint&&vo(t.fragmentHint,h),t.alignedSliding=!0}function yo(h,t){h&&(bo(t,h),t.alignedSliding||_o(t,h),!t.alignedSliding&&!t.skippedSegments&&Js(h,t,!1))}function bo(h,t){if(!Po(t,h))return;const i=Math.min(t.endCC,h.endCC),s=sa(t.fragments,i),o=sa(h.fragments,i);if(!s||!o)return;Se.log(`Aligning playlist at start of dicontinuity sequence ${i}`);const l=s.start-o.start;Ia(l,h)}function _o(h,t){if(!h.hasProgramDateTime||!t.hasProgramDateTime)return;const i=h.fragments,s=t.fragments;if(!i.length||!s.length)return;let o,l;const u=Math.min(t.endCC,h.endCC);t.startCC<u&&h.startCC<u&&(o=sa(s,u),l=sa(i,u)),(!o||!l)&&(o=s[Math.floor(s.length/2)],l=sa(i,o.cc)||i[Math.floor(i.length/2)]);const f=o.programDateTime,y=l.programDateTime;if(!f||!y)return;const v=(y-f)/1e3-(l.start-o.start);Ia(v,h)}function Ms(h,t,i){xs(h,t,i),h.addEventListener(t,i)}function xs(h,t,i){h.removeEventListener(t,i)}const _u={toString:function(h){let t="";const i=h.length;for(let s=0;s<i;s++)t+=`[${h.start(s).toFixed(3)}-${h.end(s).toFixed(3)}]`;return t}},Vt={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 Oo extends as{constructor(t,i,s,o,l){super(o,t.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Vt.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.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.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:u,fragCurrent:f,media:y,mediaBuffer:v,state:x}=this,w=y?y.currentTime:0,k=di.bufferInfo(v||y,w,u.maxBufferHole),F=!k.len;if(this.log(`Media seeking to ${U(w)?w.toFixed(3):w}, state: ${x}, ${F?"out of":"in"} buffer`),this.state===Vt.ENDED)this.resetLoadingState();else if(f){const $=u.maxFragLookUpTolerance,Q=f.start-$,te=f.start+f.duration+$;if(F||te<k.start||Q>k.end){const xe=w>te;(w<Q||xe)&&(xe&&f.loader&&(this.log(`Cancelling fragment load for seek (sn: ${f.sn})`),f.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(y){this.fragmentTracker.removeFragmentsInRange(w,1/0,this.playlistType,!0);const $=this.lastCurrentTime;if(w>$&&(this.lastCurrentTime=w),!this.loadingParts){const Q=Math.max(k.end,w),te=this.shouldLoadParts(this.getLevelDetails(),Q);te&&(this.log(`LL-Part loading ON after seeking to ${w.toFixed(2)} with buffer @${Q.toFixed(2)}`),this.loadingParts=te)}}this.hls.hasEnoughToStart||(this.log(`Setting ${F?"startPosition":"nextLoadPosition"} to ${w} for seek without enough to start`),this.nextLoadPosition=w,F&&(this.startPosition=w)),F&&this.state===Vt.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=l,this.hls=t,this.fragmentLoader=new cn(t.config),this.keyLoader=s,this.fragmentTracker=i,this.config=t.config,this.decrypter=new Fi(t.config)}registerListeners(){const{hls:t}=this;t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(E.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(t){}stopLoad(){if(this.state===Vt.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const t=this.fragCurrent;t!=null&&t.loader&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Vt.STOPPED}get startPositionValue(){const{nextLoadPosition:t,startPosition:i}=this;return i===-1&&t?t:i}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(t,i){if(i.live||!this.media)return!1;const s=t.end||0,o=this.config.timelineOffset||0;if(s<=o)return!1;const l=t.buffered;this.config.maxBufferHole&&l&&l.length>1&&(t=di.bufferedInfo(l,t.start,0));const u=t.nextStart;if(u&&u>o&&u<i.edge||this.media.currentTime<t.start)return!1;const y=i.partList;if(y!=null&&y.length){const x=y[y.length-1];return di.isBuffered(this.media,x.start+x.duration/2)}const v=i.fragments[i.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(v)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const t=this.config.timelineOffset;if(t){var i;return((i=this.getLevelDetails())==null?void 0:i.appliedTimelineOffset)||t}return 0}onMediaAttached(t,i){const s=this.media=this.mediaBuffer=i.media;Ms(s,"seeking",this.onMediaSeeking),Ms(s,"ended",this.onMediaEnded);const o=this.config;this.levels&&o.autoStartLoad&&this.state===Vt.STOPPED&&this.startLoad(o.startPosition)}onMediaDetaching(t,i){const s=!!i.transferMedia,o=this.media;if(o!==null){if(o.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),xs(o,"seeking",this.onMediaSeeking),xs(o,"ended",this.onMediaEnded),this.keyLoader&&!s&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,s){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(t,i){}onManifestLoaded(t,i){this.startTimeOffset=i.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=Vt.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(t,i,s){this.startFragRequested=!0,this._loadFragForPlayback(t,i,s)}_loadFragForPlayback(t,i,s){const o=l=>{const u=l.frag;if(this.fragContextChanged(u)){this.warn(`${u.type} sn: ${u.sn}${l.part?" part: "+l.part.index:""} of ${this.fragInfo(u,!1,l.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(u);return}u.stats.chunkCount++,this._handleFragmentLoadProgress(l)};this._doFragLoad(t,i,s,o).then(l=>{if(!l)return;const u=this.state,f=l.frag;if(this.fragContextChanged(f)){(u===Vt.FRAG_LOADING||!this.fragCurrent&&u===Vt.PARSING)&&(this.fragmentTracker.removeFragment(f),this.state=Vt.IDLE);return}"payload"in l&&(this.log(`Loaded ${f.type} sn: ${f.sn} of ${this.playlistLabel()} ${f.level}`),this.hls.trigger(E.FRAG_LOADED,l)),this._handleFragmentLoadComplete(l)}).catch(l=>{this.state===Vt.STOPPED||this.state===Vt.ERROR||(this.warn(`Frag error: ${(l==null?void 0:l.message)||l}`),this.resetFragmentLoading(t))})}clearTrackerIfNeeded(t){var i;const{fragmentTracker:s}=this;if(s.getState(t)===Bi.APPENDING){const l=t.type,u=this.getFwdBufferInfo(this.mediaBuffer,l),f=Math.max(t.duration,u?u.len:this.config.maxBufferLength),y=this.backtrackFragment;((y?t.sn-y.sn:0)===1||this.reduceMaxBufferLength(f,t.duration))&&s.removeFragment(t)}else((i=this.mediaBuffer)==null?void 0:i.buffered.length)===0?s.removeAllFragments():s.hasParts(t.type)&&(s.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type}),s.getState(t)===Bi.PARTIAL&&s.removeFragment(t))}checkLiveUpdate(t){if(t.updated&&!t.live){const i=t.fragments[t.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:i,part:null,stats:i.stats,id:i.type})}t.fragments[0]||(t.deltaUpdateFailed=!0)}waitForLive(t){const i=t.details;return(i==null?void 0:i.live)&&i.type!=="EVENT"&&(this.levelLastLoaded!==t||i.expired)}flushMainBuffer(t,i,s=null){if(!(t-i))return;const o={startOffset:t,endOffset:i,type:s};this.hls.trigger(E.BUFFER_FLUSHING,o)}_loadInitSegment(t,i){this._doFragLoad(t,i).then(s=>{const o=s==null?void 0:s.frag;if(!o||this.fragContextChanged(o)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:o}=this,{frag:l,payload:u}=s,f=l.decryptdata;if(u&&u.byteLength>0&&f!=null&&f.key&&f.iv&&Zn(f.method)){const y=self.performance.now();return this.decrypter.decrypt(new Uint8Array(u),f.key.buffer,f.iv.buffer,ia(f.method)).catch(v=>{throw o.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.FRAG_DECRYPT_ERROR,fatal:!1,error:v,reason:v.message,frag:l}),v}).then(v=>{const x=self.performance.now();return o.trigger(E.FRAG_DECRYPTED,{frag:l,payload:v,stats:{tstart:y,tdecrypt:x}}),s.payload=v,this.completeInitSegmentLoad(s)})}return this.completeInitSegmentLoad(s)}).catch(s=>{this.state===Vt.STOPPED||this.state===Vt.ERROR||(this.warn(s),this.resetFragmentLoading(t))})}completeInitSegmentLoad(t){const{levels:i}=this;if(!i)throw new Error("init load aborted, missing levels");const s=t.frag.stats;this.state!==Vt.STOPPED&&(this.state=Vt.IDLE),t.frag.data=new Uint8Array(t.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(t,i){var s,o;const l=t.tracks;if(l&&!i.encrypted&&((s=l.audio)!=null&&s.encrypted||(o=l.video)!=null&&o.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const u=this.media,f=new Error(`Encrypted track with no key in ${this.fragInfo(i)} (media ${u?"attached mediaKeys: "+u.mediaKeys:"detached"})`);return this.warn(f.message),!u||u.mediaKeys?!1:(this.hls.trigger(E.ERROR,{type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_NO_KEYS,fatal:!1,error:f,frag:i}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(t){const{fragCurrent:i}=this;return!t||!i||t.sn!==i.sn||t.level!==i.level}fragBufferedComplete(t,i){const s=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${t.type} sn: ${t.sn}${i?" part: "+i.index:""} of ${this.fragInfo(t,!1,i)} > buffer:${s?_u.toString(di.getBuffered(s)):"(detached)"})`),at(t)){var o;if(t.type!==z.SUBTITLE){const u=t.elementaryStreams;if(!Object.keys(u).some(f=>!!u[f])){this.state=Vt.IDLE;return}}const l=(o=this.levels)==null?void 0:o[t.level];l!=null&&l.fragmentError&&(this.log(`Resetting level fragment error count of ${l.fragmentError} on frag buffered`),l.fragmentError=0)}this.state=Vt.IDLE}_handleFragmentLoadComplete(t){const{transmuxer:i}=this;if(!i)return;const{frag:s,part:o,partsLoaded:l}=t,u=!l||l.length===0||l.some(y=>!y),f=new rs(s.level,s.sn,s.stats.chunkCount+1,0,o?o.index:-1,!u);i.flush(f)}_handleFragmentLoadProgress(t){}_doFragLoad(t,i,s=null,o){var l;this.fragCurrent=t;const u=i.details;if(!this.levels||!u)throw new Error(`frag load aborted, missing level${u?"":" detail"}s`);let f=null;if(t.encrypted&&!((l=t.decryptdata)!=null&&l.key)){if(this.log(`Loading key for ${t.sn} of [${u.startSN}-${u.endSN}], ${this.playlistLabel()} ${t.level}`),this.state=Vt.KEY_LOADING,this.fragCurrent=t,f=this.keyLoader.load(t).then(k=>{if(!this.fragContextChanged(k.frag))return this.hls.trigger(E.KEY_LOADED,k),this.state===Vt.KEY_LOADING&&(this.state=Vt.IDLE),k}),this.hls.trigger(E.KEY_LOADING,{frag:t}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else t.encrypted||(f=this.keyLoader.loadClear(t,u.encryptedFragments,this.startFragRequested),f&&this.log("[eme] blocking frag load until media-keys acquired"));const y=this.fragPrevious;if(at(t)&&(!y||t.sn!==y.sn)){const k=this.shouldLoadParts(i.details,t.end);k!==this.loadingParts&&(this.log(`LL-Part loading ${k?"ON":"OFF"} loading sn ${y==null?void 0:y.sn}->${t.sn}`),this.loadingParts=k)}if(s=Math.max(t.start,s||0),this.loadingParts&&at(t)){const k=u.partList;if(k&&o){s>u.fragmentEnd&&u.fragmentHint&&(t=u.fragmentHint);const F=this.getNextPart(k,t,s);if(F>-1){const $=k[F];t=this.fragCurrent=$.fragment,this.log(`Loading ${t.type} sn: ${t.sn} part: ${$.index} (${F}/${k.length-1}) of ${this.fragInfo(t,!1,$)}) cc: ${t.cc} [${u.startSN}-${u.endSN}], target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=$.start+$.duration,this.state=Vt.FRAG_LOADING;let Q;return f?Q=f.then(te=>!te||this.fragContextChanged(te.frag)?null:this.doFragPartsLoad(t,$,i,o)).catch(te=>this.handleFragLoadError(te)):Q=this.doFragPartsLoad(t,$,i,o).catch(te=>this.handleFragLoadError(te)),this.hls.trigger(E.FRAG_LOADING,{frag:t,part:$,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):Q}else if(!t.url||this.loadedEndOfParts(k,s))return Promise.resolve(null)}}if(at(t)&&this.loadingParts){var v;this.log(`LL-Part loading OFF after next part miss @${s.toFixed(2)} Check buffer at sn: ${t.sn} loaded parts: ${(v=u.partList)==null?void 0:v.filter(k=>k.loaded).map(k=>`[${k.start}-${k.end}]`)}`),this.loadingParts=!1}else if(!t.url)return Promise.resolve(null);this.log(`Loading ${t.type} sn: ${t.sn} of ${this.fragInfo(t,!1)}) cc: ${t.cc} ${"["+u.startSN+"-"+u.endSN+"]"}, target: ${parseFloat(s.toFixed(3))}`),U(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=Vt.FRAG_LOADING;const x=this.config.progressive&&t.type!==z.SUBTITLE;let w;return x&&f?w=f.then(k=>!k||this.fragContextChanged(k.frag)?null:this.fragmentLoader.load(t,o)).catch(k=>this.handleFragLoadError(k)):w=Promise.all([this.fragmentLoader.load(t,x?o:void 0),f]).then(([k])=>(!x&&o&&o(k),k)).catch(k=>this.handleFragLoadError(k)),this.hls.trigger(E.FRAG_LOADING,{frag:t,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):w}doFragPartsLoad(t,i,s,o){return new Promise((l,u)=>{var f;const y=[],v=(f=s.details)==null?void 0:f.partList,x=w=>{this.fragmentLoader.loadPart(t,w,o).then(k=>{y[w.index]=k;const F=k.part;this.hls.trigger(E.FRAG_LOADED,k);const $=bn(s.details,t.sn,w.index+1)||Ss(v,t.sn,w.index+1);if($)x($);else return l({frag:t,part:F,partsLoaded:y})}).catch(u)};x(i)})}handleFragLoadError(t){if("data"in t){const i=t.data;i.frag&&i.details===ae.INTERNAL_ABORTED?this.handleFragLoadAborted(i.frag,i.part):i.frag&&i.type===Me.KEY_SYSTEM_ERROR?(i.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(i.frag)):this.hls.trigger(E.ERROR,i)}else this.hls.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:ae.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const i=this.getCurrentContext(t);if(!i||this.state!==Vt.PARSING){!this.fragCurrent&&this.state!==Vt.STOPPED&&this.state!==Vt.ERROR&&(this.state=Vt.IDLE);return}const{frag:s,part:o,level:l}=i,u=self.performance.now();s.stats.parsing.end=u,o&&(o.stats.parsing.end=u);const f=this.getLevelDetails(),v=f&&s.sn>f.endSN||this.shouldLoadParts(f,s.end);v!==this.loadingParts&&(this.log(`LL-Part loading ${v?"ON":"OFF"} after parsing segment ending @${s.end.toFixed(2)}`),this.loadingParts=v),this.updateLevelTiming(s,o,l,t.partial)}shouldLoadParts(t,i){if(this.config.lowLatencyMode){if(!t)return this.loadingParts;if(t.partList){var s;const l=t.partList[0];if(l.fragment.type===z.SUBTITLE)return!1;const u=l.end+(((s=t.fragmentHint)==null?void 0:s.duration)||0);if(i>=u){var o;if((this.hls.hasEnoughToStart?((o=this.media)==null?void 0:o.currentTime)||this.lastCurrentTime:this.getLoadPosition())>l.start-l.fragment.duration)return!0}}}return!1}getCurrentContext(t){const{levels:i,fragCurrent:s}=this,{level:o,sn:l,part:u}=t;if(!(i!=null&&i[o]))return this.warn(`Levels object was unset while buffering fragment ${l} of ${this.playlistLabel()} ${o}. The current chunk will not be buffered.`),null;const f=i[o],y=f.details,v=u>-1?bn(y,l,u):null,x=v?v.fragment:sn(y,l,s);return x?(s&&s!==x&&(x.stats=s.stats),{frag:x,part:v,level:f}):null}bufferFragmentData(t,i,s,o,l){if(this.state!==Vt.PARSING)return;const{data1:u,data2:f}=t;let y=u;if(f&&(y=Kt(u,f)),!y.length)return;const v=this.initPTS[i.cc],x=v?-v.baseTime/v.timescale:void 0,w={type:t.type,frag:i,part:s,chunkMeta:o,offset:x,parent:i.type,data:y};if(this.hls.trigger(E.BUFFER_APPENDING,w),t.dropped&&t.independent&&!s){if(l)return;this.flushBufferGap(i)}}flushBufferGap(t){const i=this.media;if(!i)return;if(!di.isBuffered(i,i.currentTime)){this.flushMainBuffer(0,t.start);return}const s=i.currentTime,o=di.bufferInfo(i,s,0),l=t.duration,u=Math.min(this.config.maxFragLookUpTolerance*2,l*.25),f=Math.max(Math.min(t.start-u,o.end-u),s+u);t.start-f>u&&this.flushMainBuffer(f,t.start)}getFwdBufferInfo(t,i){var s;const o=this.getLoadPosition();if(!U(o))return null;const u=this.lastCurrentTime>o||(s=this.media)!=null&&s.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(t,o,i,u)}getFwdBufferInfoAtPos(t,i,s,o){const l=di.bufferInfo(t,i,o);if(l.len===0&&l.nextStart!==void 0){const u=this.fragmentTracker.getBufferedFrag(i,s);if(u&&(l.nextStart<=u.end||u.gap)){const f=Math.max(Math.min(l.nextStart,u.end)-i,o);return di.bufferInfo(t,i,f)}}return l}getMaxBufferLength(t){const{config:i}=this;let s;return t?s=Math.max(8*i.maxBufferSize/t,i.maxBufferLength):s=i.maxBufferLength,Math.min(s,i.maxMaxBufferLength)}reduceMaxBufferLength(t,i){const s=this.config,o=Math.max(Math.min(t-i,s.maxBufferLength),i),l=Math.max(t-i*3,s.maxMaxBufferLength/2,o);return l>=o?(s.maxMaxBufferLength=l,this.warn(`Reduce max buffer length to ${l}s`),!0):!1}getAppendedFrag(t,i=z.MAIN){const s=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(t,i):null;return s&&"fragment"in s?s.fragment:s}getNextFragment(t,i){const s=i.fragments,o=s.length;if(!o)return null;const{config:l}=this,u=s[0].start,f=l.lowLatencyMode&&!!i.partList;let y=null;if(i.live){const w=l.initialLiveManifestSize;if(o<w)return this.warn(`Not enough fragments to start playback (have: ${o}, need: ${w})`),null;if(!i.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||t<u){var v;f&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),y=this.getInitialLiveFragment(i);const k=this.hls.startPosition,F=this.hls.liveSyncPosition,$=y?(k!==-1&&k>=u?k:F)||y.start:t;this.log(`Setting startPosition to ${$} to match start frag at live edge. mainStart: ${k} liveSyncPosition: ${F} frag.start: ${(v=y)==null?void 0:v.start}`),this.startPosition=this.nextLoadPosition=$}}else t<=u&&(y=s[0]);if(!y){const w=this.loadingParts?i.partEnd:i.fragmentEnd;y=this.getFragmentAtPosition(t,w,i)}let x=this.filterReplacedPrimary(y,i);if(!x&&y){const w=y.sn-i.startSN;x=this.filterReplacedPrimary(s[w+1]||null,i)}return this.mapToInitFragWhenRequired(x)}isLoopLoading(t,i){const s=this.fragmentTracker.getState(t);return(s===Bi.OK||s===Bi.PARTIAL&&!!t.gap)&&this.nextLoadPosition>i}getNextFragmentLoopLoading(t,i,s,o,l){let u=null;if(t.gap&&(u=this.getNextFragment(this.nextLoadPosition,i),u&&!u.gap&&s.nextStart)){const f=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,o,0);if(f!==null&&s.len+f.len>=l){const y=u.sn;return this.loopSn!==y&&(this.log(`buffer full after gaps in "${o}" playlist starting at sn: ${y}`),this.loopSn=y),null}}return this.loopSn=void 0,u}get primaryPrefetch(){if(Ul(this.config)){var t;if((t=this.hls.interstitialsManager)==null||(t=t.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(t,i){if(!t)return t;if(Ul(this.config)&&t.type!==z.SUBTITLE){const s=this.hls.interstitialsManager,o=s==null?void 0:s.bufferingItem;if(o){const u=o.event;if(u){if(u.appendInPlace||Math.abs(t.start-o.start)>1||o.start===0)return null}else if(t.end<=o.start&&(i==null?void 0:i.live)===!1||t.start>o.end&&o.nextEvent&&(o.nextEvent.appendInPlace||t.start-o.end>1))return null}const l=s==null?void 0:s.playerQueue;if(l)for(let u=l.length;u--;){const f=l[u].interstitial;if(f.appendInPlace&&t.start>=f.startTime&&t.end<=f.resumeTime)return null}}return t}mapToInitFragWhenRequired(t){return t!=null&&t.initSegment&&!t.initSegment.data&&!this.bitrateTest?t.initSegment:t}getNextPart(t,i,s){let o=-1,l=!1,u=!0;for(let f=0,y=t.length;f<y;f++){const v=t[f];if(u=u&&!v.independent,o>-1&&s<v.start)break;const x=v.loaded;x?o=-1:(l||(v.independent||u)&&v.fragment===i)&&(v.fragment!==i&&this.warn(`Need buffer at ${s} but next unloaded part starts at ${v.start}`),o=f),l=x}return o}loadedEndOfParts(t,i){let s;for(let o=t.length;o--;){if(s=t[o],!s.loaded)return!1;if(i>s.start)return!0}return!1}getInitialLiveFragment(t){const i=t.fragments,s=this.fragPrevious;let o=null;if(s){if(t.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${s.programDateTime}`),o=Zr(i,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!o){const l=s.sn+1;if(l>=t.startSN&&l<=t.endSN){const u=i[l-t.startSN];s.cc===u.cc&&(o=u,this.log(`Live playlist, switching playlist, load frag with next SN: ${o.sn}`))}o||(o=Ur(t,s.cc,s.end),o&&this.log(`Live playlist, switching playlist, load frag with same CC: ${o.sn}`))}}else{const l=this.hls.liveSyncPosition;l!==null&&(o=this.getFragmentAtPosition(l,this.bitrateTest?t.fragmentEnd:t.edge,t))}return o}getFragmentAtPosition(t,i,s){const{config:o}=this;let{fragPrevious:l}=this,{fragments:u,endSN:f}=s;const{fragmentHint:y}=s,{maxFragLookUpTolerance:v}=o,x=s.partList,w=!!(this.loadingParts&&x!=null&&x.length&&y);w&&!this.bitrateTest&&x[x.length-1].fragment.sn===y.sn&&(u=u.concat(y),f=y.sn);let k;if(t<i){var F;const Q=t<this.lastCurrentTime||t>i-v||(F=this.media)!=null&&F.paused||!this.startFragRequested?0:v;k=Si(l,u,t,Q)}else k=u[u.length-1];if(k){const $=k.sn-s.startSN,Q=this.fragmentTracker.getState(k);if((Q===Bi.OK||Q===Bi.PARTIAL&&k.gap)&&(l=k),l&&k.sn===l.sn&&(!w||x[0].fragment.sn>k.sn||!s.live)&&k.level===l.level){const xe=u[$+1];k.sn<f&&this.fragmentTracker.getState(xe)!==Bi.OK?k=xe:k=null}}return k}alignPlaylists(t,i,s){const o=t.fragments.length;if(!o)return this.warn("No fragments in live playlist"),0;const l=t.fragmentStart,u=!i,f=t.alignedSliding&&U(l);if(u||!f&&!l){yo(s,t);const y=t.fragmentStart;return this.log(`Live playlist sliding: ${y.toFixed(2)} start-sn: ${i?i.startSN:"na"}->${t.startSN} fragments: ${o}`),y}return l}waitForCdnTuneIn(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,t.partTarget*3)}setStartPosition(t,i){let s=this.startPosition;s<i&&(s=-1);const o=this.timelineOffset;if(s===-1){const l=this.startTimeOffset!==null,u=l?this.startTimeOffset:t.startTimeOffset;u!==null&&U(u)?(s=i+u,u<0&&(s+=t.edge),s=Math.min(Math.max(i,s),i+t.totalduration),this.log(`Setting startPosition to ${s} for start time offset ${u} found in ${l?"multivariant":"media"} playlist`),this.startPosition=s):t.live?(s=this.hls.liveSyncPosition||i,this.log(`Setting startPosition to -1 to start at live edge ${s}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=s=0),this.lastCurrentTime=s+o}this.nextLoadPosition=s+o}getLoadPosition(){var t;const{media:i}=this;let s=0;return(t=this.hls)!=null&&t.hasEnoughToStart&&i?s=i.currentTime:this.nextLoadPosition>=0&&(s=this.nextLoadPosition),s}handleFragLoadAborted(t,i){this.transmuxer&&t.type===this.playlistType&&at(t)&&t.stats.aborted&&(this.log(`Fragment ${t.sn}${i?" part "+i.index:""} of ${this.playlistLabel()} ${t.level} was aborted`),this.resetFragmentLoading(t))}resetFragmentLoading(t){(!this.fragCurrent||!this.fragContextChanged(t)&&this.state!==Vt.FRAG_LOADING_WAITING_RETRY)&&(this.state=Vt.IDLE)}onFragmentOrKeyLoadError(t,i){var s;if(i.chunkMeta&&!i.frag){const xe=this.getCurrentContext(i.chunkMeta);xe&&(i.frag=xe.frag)}const o=i.frag;if(!o||o.type!==t||!this.levels)return;if(this.fragContextChanged(o)){var l;this.warn(`Frag load error must match current frag to retry ${o.url} > ${(l=this.fragCurrent)==null?void 0:l.url}`);return}const u=i.details===ae.FRAG_GAP;u&&this.fragmentTracker.fragBuffered(o,!0);const f=i.errorAction;if(!f){this.state=Vt.ERROR;return}const{action:y,flags:v,retryCount:x=0,retryConfig:w}=f,k=!!w,F=k&&y===$r.RetryRequest,$=k&&!f.resolved&&v===jr.MoveAllAlternatesMatchingHost,Q=(s=this.hls.latestLevelDetails)==null?void 0:s.live;if(!F&&$&&at(o)&&!o.endList&&Q&&!st(i))this.resetFragmentErrors(t),this.treatAsGap(o),f.resolved=!0;else if((F||$)&&x<w.maxNumRetry){var te;const xe=zi((te=i.response)==null?void 0:te.code),ke=hi(w,x);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+ke,this.state=Vt.FRAG_LOADING_WAITING_RETRY,f.resolved=!0,xe){this.log("Waiting for connection (offline)"),this.retryDate=1/0,i.reason="offline";return}this.warn(`Fragment ${o.sn} of ${t} ${o.level} errored with ${i.details}, retrying loading ${x+1}/${w.maxNumRetry} in ${ke}ms`)}else if(w)if(this.resetFragmentErrors(t),x<w.maxNumRetry)!u&&y!==$r.RemoveAlternatePermanently&&(f.resolved=!0);else{this.warn(`${i.details} reached or exceeded max retry (${x})`);return}else y===$r.SendAlternateToPenaltyBox?this.state=Vt.WAITING_LEVEL:this.state=Vt.ERROR;this.tickImmediate()}checkRetryDate(){const t=self.performance.now(),i=this.retryDate,s=i===1/0;(!i||t>=i||s&&!zi(0))&&(s&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=Vt.IDLE)}reduceLengthAndFlushBuffer(t){if(this.state===Vt.PARSING||this.state===Vt.PARSED){const i=t.frag,s=t.parent,o=this.getFwdBufferInfo(this.mediaBuffer,s),l=o&&o.len>.5;l&&this.reduceMaxBufferLength(o.len,(i==null?void 0:i.duration)||10);const u=!l;return u&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${s} buffer`),i&&(this.fragmentTracker.removeFragment(i),this.nextLoadPosition=i.start),this.resetLoadingState(),u}return!1}resetFragmentErrors(t){t===z.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Vt.STOPPED&&(this.state=Vt.IDLE)}afterBufferFlushed(t,i,s){if(!t)return;const o=di.getBuffered(t);this.fragmentTracker.detectEvictedFragments(i,o,s),this.state===Vt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Vt.STOPPED&&(this.state=Vt.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=this.levelLastLoaded,i=t?t.details:null;i!=null&&i.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(i,i.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){this.log(`Loading context changed while buffering sn ${t.sn} of ${this.playlistLabel()} ${t.level===-1?"<removed>":t.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(t=0){this.fragmentTracker.removeFragmentsInRange(t,1/0,this.playlistType,!1,!0)}updateLevelTiming(t,i,s,o){const l=s.details;if(!l){this.warn("level.details undefined");return}if(!Object.keys(t.elementaryStreams).reduce((y,v)=>{const x=t.elementaryStreams[v];if(x){const w=x.endPTS-x.startPTS;if(w<=0)return this.warn(`Could not parse fragment ${t.sn} ${v} duration reliably (${w})`),y||!1;const k=o?0:ha(l,t,x.startPTS,x.endPTS,x.startDTS,x.endDTS,this);return this.hls.trigger(E.LEVEL_PTS_UPDATED,{details:l,level:s,drift:k,type:v,frag:t,start:x.startPTS,end:x.endPTS}),!0}return y},!1)){var f;const y=((f=this.transmuxer)==null?void 0:f.error)===null;if((s.fragmentError===0||y&&(s.fragmentError<2||t.endList))&&this.treatAsGap(t,s),y){const v=new Error(`Found no media in fragment ${t.sn} of ${this.playlistLabel()} ${t.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(v.message),this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.FRAG_PARSING_ERROR,fatal:!1,error:v,frag:t,reason:`Found no media in msn ${t.sn} of ${this.playlistLabel()} "${s.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Vt.PARSED,this.log(`Parsed ${t.type} sn: ${t.sn}${i?" part: "+i.index:""} of ${this.fragInfo(t,!1,i)})`),this.hls.trigger(E.FRAG_PARSED,{frag:t,part:i})}playlistLabel(){return this.playlistType===z.MAIN?"level":"track"}fragInfo(t,i=!0,s){var o,l;return`${this.playlistLabel()} ${t.level} (${s?"part":"frag"}:[${((o=i&&!s?t.startPTS:(s||t).start)!=null?o:NaN).toFixed(3)}-${((l=i&&!s?t.endPTS:(s||t).end)!=null?l:NaN).toFixed(3)}]${s&&t.type==="main"?"INDEPENDENT="+(s.independent?"YES":"NO"):""}`}treatAsGap(t,i){i&&i.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)}resetTransmuxer(){var t;(t=this.transmuxer)==null||t.reset()}recoverWorkerError(t){t.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(t){const i=this._state;i!==t&&(this._state=t,this.log(`${i}->${t}`))}get state(){return this._state}}function Ul(h){return!!h.interstitialsController&&h.enableInterstitialPlayback!==!1}class Hl{constructor(){this.chunks=[],this.dataLength=0}push(t){this.chunks.push(t),this.dataLength+=t.length}flush(){const{chunks:t,dataLength:i}=this;let s;if(t.length)t.length===1?s=t[0]:s=Es(t,i);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function Es(h,t){const i=new Uint8Array(t);let s=0;for(let o=0;o<h.length;o++){const l=h[o];i.set(l,s),s+=l.length}return i}var Ns={exports:{}},aa;function b0(){return aa||(aa=1,function(h){var t=Object.prototype.hasOwnProperty,i="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(i=!1));function o(y,v,x){this.fn=y,this.context=v,this.once=x||!1}function l(y,v,x,w,k){if(typeof x!="function")throw new TypeError("The listener must be a function");var F=new o(x,w||y,k),$=i?i+v:v;return y._events[$]?y._events[$].fn?y._events[$]=[y._events[$],F]:y._events[$].push(F):(y._events[$]=F,y._eventsCount++),y}function u(y,v){--y._eventsCount===0?y._events=new s:delete y._events[v]}function f(){this._events=new s,this._eventsCount=0}f.prototype.eventNames=function(){var v=[],x,w;if(this._eventsCount===0)return v;for(w in x=this._events)t.call(x,w)&&v.push(i?w.slice(1):w);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(x)):v},f.prototype.listeners=function(v){var x=i?i+v:v,w=this._events[x];if(!w)return[];if(w.fn)return[w.fn];for(var k=0,F=w.length,$=new Array(F);k<F;k++)$[k]=w[k].fn;return $},f.prototype.listenerCount=function(v){var x=i?i+v:v,w=this._events[x];return w?w.fn?1:w.length:0},f.prototype.emit=function(v,x,w,k,F,$){var Q=i?i+v:v;if(!this._events[Q])return!1;var te=this._events[Q],xe=arguments.length,ke,Le;if(te.fn){switch(te.once&&this.removeListener(v,te.fn,void 0,!0),xe){case 1:return te.fn.call(te.context),!0;case 2:return te.fn.call(te.context,x),!0;case 3:return te.fn.call(te.context,x,w),!0;case 4:return te.fn.call(te.context,x,w,k),!0;case 5:return te.fn.call(te.context,x,w,k,F),!0;case 6:return te.fn.call(te.context,x,w,k,F,$),!0}for(Le=1,ke=new Array(xe-1);Le<xe;Le++)ke[Le-1]=arguments[Le];te.fn.apply(te.context,ke)}else{var Ze=te.length,rt;for(Le=0;Le<Ze;Le++)switch(te[Le].once&&this.removeListener(v,te[Le].fn,void 0,!0),xe){case 1:te[Le].fn.call(te[Le].context);break;case 2:te[Le].fn.call(te[Le].context,x);break;case 3:te[Le].fn.call(te[Le].context,x,w);break;case 4:te[Le].fn.call(te[Le].context,x,w,k);break;default:if(!ke)for(rt=1,ke=new Array(xe-1);rt<xe;rt++)ke[rt-1]=arguments[rt];te[Le].fn.apply(te[Le].context,ke)}}return!0},f.prototype.on=function(v,x,w){return l(this,v,x,w,!1)},f.prototype.once=function(v,x,w){return l(this,v,x,w,!0)},f.prototype.removeListener=function(v,x,w,k){var F=i?i+v:v;if(!this._events[F])return this;if(!x)return u(this,F),this;var $=this._events[F];if($.fn)$.fn===x&&(!k||$.once)&&(!w||$.context===w)&&u(this,F);else{for(var Q=0,te=[],xe=$.length;Q<xe;Q++)($[Q].fn!==x||k&&!$[Q].once||w&&$[Q].context!==w)&&te.push($[Q]);te.length?this._events[F]=te.length===1?te[0]:te:u(this,F)}return this},f.prototype.removeAllListeners=function(v){var x;return v?(x=i?i+v:v,this._events[x]&&u(this,x)):(this._events=new s,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=i,f.EventEmitter=f,h.exports=f}(Ns)),Ns.exports}var xu=b0(),ul=me(xu);const Bo="1.6.15",za={};function wu(){return typeof __HLS_WORKER_BUNDLE__=="function"}function _0(){const h=za[Bo];if(h)return h.clientCount++,h;const t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),i=self.URL.createObjectURL(t),o={worker:new self.Worker(i),objectURL:i,clientCount:1};return za[Bo]=o,o}function Su(h){const t=za[h];if(t)return t.clientCount++,t;const i=new self.URL(h,self.location.href).href,o={worker:new self.Worker(i),scriptURL:i,clientCount:1};return za[h]=o,o}function Gl(h){const t=za[h||Bo];if(t&&t.clientCount--===1){const{worker:s,objectURL:o}=t;delete za[h||Bo],o&&self.URL.revokeObjectURL(o),s.terminate()}}function Vl(h,t){return t+10<=h.length&&h[t]===51&&h[t+1]===68&&h[t+2]===73&&h[t+3]<255&&h[t+4]<255&&h[t+6]<128&&h[t+7]<128&&h[t+8]<128&&h[t+9]<128}function Fo(h,t){return t+10<=h.length&&h[t]===73&&h[t+1]===68&&h[t+2]===51&&h[t+3]<255&&h[t+4]<255&&h[t+6]<128&&h[t+7]<128&&h[t+8]<128&&h[t+9]<128}function Xa(h,t){let i=0;return i=(h[t]&127)<<21,i|=(h[t+1]&127)<<14,i|=(h[t+2]&127)<<7,i|=h[t+3]&127,i}function Ja(h,t){const i=t;let s=0;for(;Fo(h,t);){s+=10;const o=Xa(h,t+6);s+=o,Vl(h,t+10)&&(s+=10),t+=s}if(s>0)return h.subarray(i,i+s)}function xa(h,t,i,s){const o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],l=t[i+2],u=l>>2&15;if(u>12){const F=new Error(`invalid ADTS sampling index:${u}`);h.emit(E.ERROR,E.ERROR,{type:Me.MEDIA_ERROR,details:ae.FRAG_PARSING_ERROR,fatal:!0,error:F,reason:F.message});return}const f=(l>>6&3)+1,y=t[i+3]>>6&3|(l&1)<<2,v="mp4a.40."+f,x=o[u];let w=u;(f===5||f===29)&&(w-=3);const k=[f<<3|(w&14)>>1,(w&1)<<7|y<<3];return Se.log(`manifest codec:${s}, parsed codec:${v}, channels:${y}, rate:${x} (ADTS object type:${f} sampling index:${u})`),{config:k,samplerate:x,channelCount:y,codec:v,parsedCodec:v,manifestCodec:s}}function cl(h,t){return h[t]===255&&(h[t+1]&246)===240}function Wl(h,t){return h[t+1]&1?7:9}function hl(h,t){return(h[t+3]&3)<<11|h[t+4]<<3|(h[t+5]&224)>>>5}function Eu(h,t){return t+5<h.length}function dl(h,t){return t+1<h.length&&cl(h,t)}function No(h,t){return Eu(h,t)&&cl(h,t)&&hl(h,t)<=h.length-t}function fl(h,t){if(dl(h,t)){const i=Wl(h,t);if(t+i>=h.length)return!1;const s=hl(h,t);if(s<=i)return!1;const o=t+s;return o===h.length||dl(h,o)}return!1}function jl(h,t,i,s,o){if(!h.samplerate){const l=xa(t,i,s,o);if(!l)return;M(h,l)}}function Au(h){return 1024*9e4/h}function x0(h,t){const i=Wl(h,t);if(t+i<=h.length){const s=hl(h,t)-i;if(s>0)return{headerLength:i,frameLength:s}}}function ku(h,t,i,s,o){const l=Au(h.samplerate),u=s+o*l,f=x0(t,i);let y;if(f){const{frameLength:w,headerLength:k}=f,F=k+w,$=Math.max(0,i+F-t.length);$?(y=new Uint8Array(F-k),y.set(t.subarray(i+k,t.length),0)):y=t.subarray(i+k,i+F);const Q={unit:y,pts:u};return $||h.samples.push(Q),{sample:Q,length:F,missing:$}}const v=t.length-i;return y=new Uint8Array(v),y.set(t.subarray(i,t.length),0),{sample:{unit:y,pts:u},length:v,missing:-1}}function ql(h,t){return Fo(h,t)&&Xa(h,t+6)+10<=h.length-t}function w0(h){return h instanceof ArrayBuffer?h:h.byteOffset==0&&h.byteLength==h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer}function fa(h,t=0,i=1/0){return Zl(h,t,i,Uint8Array)}function Zl(h,t,i,s){const o=Ka(h);let l=1;"BYTES_PER_ELEMENT"in s&&(l=s.BYTES_PER_ELEMENT);const u=Tu(h)?h.byteOffset:0,f=(u+h.byteLength)/l,y=(u+t)/l,v=Math.floor(Math.max(0,Math.min(y,f))),x=Math.floor(Math.min(v+Math.max(i,0),f));return new s(o,v,x-v)}function Ka(h){return h instanceof ArrayBuffer?h:h.buffer}function Tu(h){return h&&h.buffer instanceof ArrayBuffer&&h.byteLength!==void 0&&h.byteOffset!==void 0}function Cu(h){const t={key:h.type,description:"",data:"",mimeType:null,pictureType:null},i=3;if(h.size<2)return;if(h.data[0]!==i){console.log("Ignore frame with unrecognized character encoding");return}const s=h.data.subarray(1).indexOf(0);if(s===-1)return;const o=$t(fa(h.data,1,s)),l=h.data[2+s],u=h.data.subarray(3+s).indexOf(0);if(u===-1)return;const f=$t(fa(h.data,3+s,u));let y;return o==="-->"?y=$t(fa(h.data,4+s+u)):y=w0(h.data.subarray(4+s+u)),t.mimeType=o,t.pictureType=l,t.description=f,t.data=y,t}function Ce(h){if(h.size<2)return;const t=$t(h.data,!0),i=new Uint8Array(h.data.subarray(t.length+1));return{key:h.type,info:t,data:i.buffer}}function Du(h){if(h.size<2)return;if(h.type==="TXXX"){let i=1;const s=$t(h.data.subarray(i),!0);i+=s.length+1;const o=$t(h.data.subarray(i));return{key:h.type,info:s,data:o}}const t=$t(h.data.subarray(1));return{key:h.type,info:"",data:t}}function pl(h){if(h.type==="WXXX"){if(h.size<2)return;let i=1;const s=$t(h.data.subarray(i),!0);i+=s.length+1;const o=$t(h.data.subarray(i));return{key:h.type,info:s,data:o}}const t=$t(h.data);return{key:h.type,info:"",data:t}}function Yl(h){return h.type==="PRIV"?Ce(h):h.type[0]==="W"?pl(h):h.type==="APIC"?Cu(h):Du(h)}function Mu(h){const t=String.fromCharCode(h[0],h[1],h[2],h[3]),i=Xa(h,4),s=10;return{type:t,size:i,data:h.subarray(s,s+i)}}const xo=10,Lu=10;function Xl(h){let t=0;const i=[];for(;Fo(h,t);){const s=Xa(h,t+6);h[t+5]>>6&1&&(t+=xo),t+=xo;const o=t+s;for(;t+Lu<o;){const l=Mu(h.subarray(t)),u=Yl(l);u&&i.push(u),t+=l.size+xo}Vl(h,t)&&(t+=xo)}return i}function Iu(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"}function Ru(h){if(h.data.byteLength===8){const t=new Uint8Array(h.data),i=t[3]&1;let s=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return s/=45,i&&(s+=4772185884e-2),Math.round(s)}}function ml(h){const t=Xl(h);for(let i=0;i<t.length;i++){const s=t[i];if(Iu(s))return Ru(s)}}let Ls=function(h){return h.audioId3="org.id3",h.dateRange="com.apple.quicktime.HLS",h.emsg="https://aomedia.org/emsg/ID3",h.misbklv="urn:misb:KLV:bin:1910.1",h}({});function oa(h="",t=9e4){return{type:h,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class $o{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(t,i,s,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(t){this.initPTS=t,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(t,i){return!1}appendFrame(t,i,s){}demux(t,i){this.cachedData&&(t=Kt(this.cachedData,t),this.cachedData=null);let s=Ja(t,0),o=s?s.length:0,l;const u=this._audioTrack,f=this._id3Track,y=s?ml(s):void 0,v=t.length;for((this.basePTS===null||this.frameIndex===0&&U(y))&&(this.basePTS=Pu(y,i,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),s&&s.length>0&&f.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Ls.audioId3,duration:Number.POSITIVE_INFINITY});o<v;){if(this.canParse(t,o)){const x=this.appendFrame(u,t,o);x?(this.frameIndex++,this.lastPTS=x.sample.pts,o+=x.length,l=o):o=v}else ql(t,o)?(s=Ja(t,o),f.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Ls.audioId3,duration:Number.POSITIVE_INFINITY}),o+=s.length,l=o):o++;if(o===v&&l!==v){const x=t.slice(l);this.cachedData?this.cachedData=Kt(this.cachedData,x):this.cachedData=x}}return{audioTrack:u,videoTrack:oa(),id3Track:f,textTrack:oa()}}demuxSampleAes(t,i,s){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(t){const i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),{audioTrack:this._audioTrack,videoTrack:oa(),id3Track:this._id3Track,textTrack:oa()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Pu=(h,t,i)=>{if(U(h))return h*90;const s=i?i.baseTime*9e4/i.timescale:0;return t*9e4+s};let gl=null;const S0=[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],Ou=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Qa=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],zo=[0,1,1,4];function Jl(h,t,i,s,o){if(i+24>t.length)return;const l=E0(t,i);if(l&&i+l.frameLength<=t.length){const u=l.samplesPerFrame*9e4/l.sampleRate,f=s+o*u,y={unit:t.subarray(i,i+l.frameLength),pts:f,dts:f};return h.config=[],h.channelCount=l.channelCount,h.samplerate=l.sampleRate,h.samples.push(y),{sample:y,length:l.frameLength,missing:0}}}function E0(h,t){const i=h[t+1]>>3&3,s=h[t+1]>>1&3,o=h[t+2]>>4&15,l=h[t+2]>>2&3;if(i!==1&&o!==0&&o!==15&&l!==3){const u=h[t+2]>>1&1,f=h[t+3]>>6,y=i===3?3-s:s===3?3:4,v=S0[y*14+o-1]*1e3,w=Ou[(i===3?0:i===2?1:2)*3+l],k=f===3?1:2,F=Qa[i][s],$=zo[s],Q=F*8*$,te=Math.floor(F*v/w+u)*$;if(gl===null){const Le=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);gl=Le?parseInt(Le[1]):0}return!!gl&&gl<=87&&s===2&&v>=224e3&&f===0&&(h[t+3]=h[t+3]|128),{sampleRate:w,channelCount:k,frameLength:te,samplesPerFrame:Q}}}function j(h,t){return h[t]===255&&(h[t+1]&224)===224&&(h[t+1]&6)!==0}function m(h,t){return t+1<h.length&&j(h,t)}function b(h,t){return j(h,t)&&4<=h.length-t}function _(h,t){if(t+1<h.length&&j(h,t)){const s=E0(h,t);let o=4;s!=null&&s.frameLength&&(o=s.frameLength);const l=t+o;return l===h.length||m(h,l)}return!1}class S extends $o{constructor(t,i){super(),this.observer=void 0,this.config=void 0,this.observer=t,this.config=i}resetInitSegment(t,i,s,o){super.resetInitSegment(t,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(t,i){if(!t)return!1;const s=Ja(t,0);let o=(s==null?void 0:s.length)||0;if(_(t,o))return!1;for(let l=t.length;o<l;o++)if(fl(t,o))return i.log("ADTS sync word found !"),!0;return!1}canParse(t,i){return No(t,i)}appendFrame(t,i,s){jl(t,this.observer,i,s,t.manifestCodec);const o=ku(t,i,s,this.basePTS,this.frameIndex);if(o&&o.missing===0)return o}}const P=(h,t)=>{let i=0,s=5;t+=s;const o=new Uint32Array(1),l=new Uint32Array(1),u=new Uint8Array(1);for(;s>0;){u[0]=h[t];const f=Math.min(s,8),y=8-f;l[0]=4278190080>>>24+y<<y,o[0]=(u[0]&l[0])>>y,i=i?i<<f|o[0]:o[0],t+=1,s-=f}return i};class W extends $o{constructor(t){super(),this.observer=void 0,this.observer=t}resetInitSegment(t,i,s,o){super.resetInitSegment(t,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(t,i){return i+64<t.length}appendFrame(t,i,s){const o=ce(t,i,s,this.basePTS,this.frameIndex);if(o!==-1)return{sample:t.samples[t.samples.length-1],length:o,missing:0}}static probe(t){if(!t)return!1;const i=Ja(t,0);if(!i)return!1;const s=i.length;return t[s]===11&&t[s+1]===119&&ml(i)!==void 0&&P(t,s)<16}}function ce(h,t,i,s,o){if(i+8>t.length||t[i]!==11||t[i+1]!==119)return-1;const l=t[i+4]>>6;if(l>=3)return-1;const f=[48e3,44100,32e3][l],y=t[i+4]&63,x=[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][y*3+l]*2;if(i+x>t.length)return-1;const w=t[i+6]>>5;let k=0;w===2?k+=2:(w&1&&w!==1&&(k+=2),w&4&&(k+=2));const F=(t[i+6]<<8|t[i+7])>>12-k&1,Q=[2,1,2,3,3,4,4,5][w]+F,te=t[i+5]>>3,xe=t[i+5]&7,ke=new Uint8Array([l<<6|te<<1|xe>>2,(xe&3)<<6|w<<3|F<<2|y>>4,y<<4&224]),Le=1536/f*9e4,Ze=s+o*Le,rt=t.subarray(i,i+x);return h.config=ke,h.channelCount=Q,h.samplerate=f,h.samples.push({unit:rt,pts:Ze}),x}class _e extends $o{resetInitSegment(t,i,s,o){super.resetInitSegment(t,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(t){if(!t)return!1;const i=Ja(t,0);let s=(i==null?void 0:i.length)||0;if(i&&t[s]===11&&t[s+1]===119&&ml(i)!==void 0&&P(t,s)<=16)return!1;for(let o=t.length;s<o;s++)if(_(t,s))return Se.log("MPEG Audio sync word found !"),!0;return!1}canParse(t,i){return b(t,i)}appendFrame(t,i,s){if(this.basePTS!==null)return Jl(t,i,s,this.basePTS,this.frameIndex)}}const Be=/\/emsg[-/]ID3/i;class Je{constructor(t,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(t,i,s,o){const l=this.videoTrack=oa("video",1),u=this.audioTrack=oa("audio",1),f=this.txtTrack=oa("text",1);if(this.id3Track=oa("id3",1),this.timeOffset=0,!(t!=null&&t.byteLength))return;const y=Rt(t);if(y.video){const{id:v,timescale:x,codec:w,supplemental:k}=y.video;l.id=v,l.timescale=f.timescale=x,l.codec=w,l.supplemental=k}if(y.audio){const{id:v,timescale:x,codec:w}=y.audio;u.id=v,u.timescale=x,u.codec=w}f.id=xr.text,l.sampleDuration=0,l.duration=u.duration=o}resetContiguity(){this.remainderData=null}static probe(t){return ct(t)}demux(t,i){this.timeOffset=i;let s=t;const o=this.videoTrack,l=this.txtTrack;if(this.config.progressive){this.remainderData&&(s=Kt(this.remainderData,t));const f=gr(s);this.remainderData=f.remainder,o.samples=f.valid||new Uint8Array}else o.samples=s;const u=this.extractID3Track(o,i);return l.samples=qt(i,o),{videoTrack:o,audioTrack:this.audioTrack,id3Track:u,textTrack:this.txtTrack}}flush(){const t=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=qt(t,i),{videoTrack:i,audioTrack:oa(),id3Track:o,textTrack:oa()}}extractID3Track(t,i){const s=this.id3Track;if(t.samples.length){const o=Ue(t.samples,["emsg"]);o&&o.forEach(l=>{const u=Ar(l);if(Be.test(u.schemeIdUri)){const f=ft(u,i);let y=u.eventDuration===4294967295?Number.POSITIVE_INFINITY:u.eventDuration/u.timeScale;y<=.001&&(y=Number.POSITIVE_INFINITY);const v=u.payload;s.samples.push({data:v,len:v.byteLength,dts:f,pts:f,type:Ls.emsg,duration:y})}else if(this.config.enableEmsgKLVMetadata&&u.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const f=ft(u,i);s.samples.push({data:u.payload,len:u.payload.byteLength,dts:f,pts:f,type:Ls.misbklv,duration:Number.POSITIVE_INFINITY})}})}return s}demuxSampleAes(t,i,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function ft(h,t){return U(h.presentationTime)?h.presentationTime/h.timeScale:t+h.presentationTimeDelta/h.timeScale}class It{constructor(t,i,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new Fi(i,{removePKCS7Padding:!1})}decryptBuffer(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,Ci.cbc)}decryptAacSample(t,i,s){const o=t[i].unit;if(o.length<=16)return;const l=o.subarray(16,o.length-o.length%16),u=l.buffer.slice(l.byteOffset,l.byteOffset+l.length);this.decryptBuffer(u).then(f=>{const y=new Uint8Array(f);o.set(y,16),this.decrypter.isSync()||this.decryptAacSamples(t,i+1,s)}).catch(s)}decryptAacSamples(t,i,s){for(;;i++){if(i>=t.length){s();return}if(!(t[i].unit.length<32)&&(this.decryptAacSample(t,i,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(t){const i=Math.floor((t.length-48)/160)*16+16,s=new Int8Array(i);let o=0;for(let l=32;l<t.length-16;l+=160,o+=16)s.set(t.subarray(l,l+16),o);return s}getAvcDecryptedUnit(t,i){const s=new Uint8Array(i);let o=0;for(let l=32;l<t.length-16;l+=160,o+=16)t.set(s.subarray(o,o+16),l);return t}decryptAvcSample(t,i,s,o,l){const u=Xt(l.data),f=this.getAvcEncryptedData(u);this.decryptBuffer(f.buffer).then(y=>{l.data=this.getAvcDecryptedUnit(u,y),this.decrypter.isSync()||this.decryptAvcSamples(t,i,s+1,o)}).catch(o)}decryptAvcSamples(t,i,s,o){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;i++,s=0){if(i>=t.length){o();return}const l=t[i].units;for(;!(s>=l.length);s++){const u=l[s];if(!(u.data.length<=48||u.type!==1&&u.type!==5)&&(this.decryptAvcSample(t,i,s,o,u),!this.decrypter.isSync()))return}}}}class Qt{constructor(){this.VideoSample=null}createVideoSample(t,i,s){return{key:t,frame:!1,pts:i,dts:s,units:[],length:0}}getLastNalUnit(t){var i;let s=this.VideoSample,o;if((!s||s.units.length===0)&&(s=t[t.length-1]),(i=s)!=null&&i.units){const l=s.units;o=l[l.length-1]}return o}pushAccessUnit(t,i){if(t.units.length&&t.frame){if(t.pts===void 0){const s=i.samples,o=s.length;if(o){const l=s[o-1];t.pts=l.pts,t.dts=l.dts}else{i.dropped++;return}}i.samples.push(t)}}parseNALu(t,i,s){const o=i.byteLength;let l=t.naluState||0;const u=l,f=[];let y=0,v,x,w,k=-1,F=0;for(l===-1&&(k=0,F=this.getNALuType(i,0),l=0,y=1);y<o;){if(v=i[y++],!l){l=v?0:1;continue}if(l===1){l=v?0:2;continue}if(!v)l=3;else if(v===1){if(x=y-l-1,k>=0){const $={data:i.subarray(k,x),type:F};f.push($)}else{const $=this.getLastNalUnit(t.samples);$&&(u&&y<=4-u&&$.state&&($.data=$.data.subarray(0,$.data.byteLength-u)),x>0&&($.data=Kt($.data,i.subarray(0,x)),$.state=0))}y<o?(w=this.getNALuType(i,y),k=y,F=w,l=0):l=-1}else l=0}if(k>=0&&l>=0){const $={data:i.subarray(k,o),type:F,state:l};f.push($)}if(f.length===0){const $=this.getLastNalUnit(t.samples);$&&($.data=Kt($.data,i))}return t.naluState=l,f}}class lr{constructor(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const t=this.data,i=this.bytesAvailable,s=t.byteLength-i,o=new Uint8Array(4),l=Math.min(4,i);if(l===0)throw new Error("no bytes available");o.set(t.subarray(s,s+l)),this.word=new DataView(o.buffer).getUint32(0),this.bitsAvailable=l*8,this.bytesAvailable-=l}skipBits(t){let i;t=Math.min(t,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,i=t>>3,t-=i<<3,this.bytesAvailable-=i,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let i=Math.min(this.bitsAvailable,t);const s=this.word>>>32-i;if(t>32&&Se.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=t-i,i>0&&this.bitsAvailable?s<<i|this.readBits(i):s}skipLZ(){let t;for(t=0;t<this.bitsAvailable;++t)if(this.word&2147483648>>>t)return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const t=this.skipLZ();return this.readBits(t+1)-1}readEG(){const t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Dr extends Qt{parsePES(t,i,s,o){const l=this.parseNALu(t,s.data,o);let u=this.VideoSample,f,y=!1;s.data=null,u&&l.length&&!t.audFound&&(this.pushAccessUnit(u,t),u=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),l.forEach(v=>{var x,w;switch(v.type){case 1:{let Q=!1;f=!0;const te=v.data;if(y&&te.length>4){const xe=this.readSliceType(te);(xe===2||xe===4||xe===7||xe===9)&&(Q=!0)}if(Q){var k;(k=u)!=null&&k.frame&&!u.key&&(this.pushAccessUnit(u,t),u=this.VideoSample=null)}u||(u=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),u.frame=!0,u.key=Q;break}case 5:f=!0,(x=u)!=null&&x.frame&&!u.key&&(this.pushAccessUnit(u,t),u=this.VideoSample=null),u||(u=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),u.key=!0,u.frame=!0;break;case 6:{f=!0,wr(v.data,1,s.pts,i.samples);break}case 7:{var F,$;f=!0,y=!0;const Q=v.data,te=this.readSPS(Q);if(!t.sps||t.width!==te.width||t.height!==te.height||((F=t.pixelRatio)==null?void 0:F[0])!==te.pixelRatio[0]||(($=t.pixelRatio)==null?void 0:$[1])!==te.pixelRatio[1]){t.width=te.width,t.height=te.height,t.pixelRatio=te.pixelRatio,t.sps=[Q];const xe=Q.subarray(1,4);let ke="avc1.";for(let Le=0;Le<3;Le++){let Ze=xe[Le].toString(16);Ze.length<2&&(Ze="0"+Ze),ke+=Ze}t.codec=ke}break}case 8:f=!0,t.pps=[v.data];break;case 9:f=!0,t.audFound=!0,(w=u)!=null&&w.frame&&(this.pushAccessUnit(u,t),u=null),u||(u=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts));break;case 12:f=!0;break;default:f=!1;break}u&&f&&u.units.push(v)}),o&&u&&(this.pushAccessUnit(u,t),this.VideoSample=null)}getNALuType(t,i){return t[i]&31}readSliceType(t){const i=new lr(t);return i.readUByte(),i.readUEG(),i.readUEG()}skipScalingList(t,i){let s=8,o=8,l;for(let u=0;u<t;u++)o!==0&&(l=i.readEG(),o=(s+l+256)%256),s=o===0?s:o}readSPS(t){const i=new lr(t);let s=0,o=0,l=0,u=0,f,y,v;const x=i.readUByte.bind(i),w=i.readBits.bind(i),k=i.readUEG.bind(i),F=i.readBoolean.bind(i),$=i.skipBits.bind(i),Q=i.skipEG.bind(i),te=i.skipUEG.bind(i),xe=this.skipScalingList.bind(this);x();const ke=x();if(w(5),$(3),x(),te(),ke===100||ke===110||ke===122||ke===244||ke===44||ke===83||ke===86||ke===118||ke===128){const St=k();if(St===3&&$(1),te(),te(),$(1),F())for(y=St!==3?8:12,v=0;v<y;v++)F()&&(v<6?xe(16,i):xe(64,i))}te();const Le=k();if(Le===0)k();else if(Le===1)for($(1),Q(),Q(),f=k(),v=0;v<f;v++)Q();te(),$(1);const Ze=k(),rt=k(),Lt=w(1);Lt===0&&$(1),$(1),F()&&(s=k(),o=k(),l=k(),u=k());let ot=[1,1];if(F()&&F())switch(x()){case 1:ot=[1,1];break;case 2:ot=[12,11];break;case 3:ot=[10,11];break;case 4:ot=[16,11];break;case 5:ot=[40,33];break;case 6:ot=[24,11];break;case 7:ot=[20,11];break;case 8:ot=[32,11];break;case 9:ot=[80,33];break;case 10:ot=[18,11];break;case 11:ot=[15,11];break;case 12:ot=[64,33];break;case 13:ot=[160,99];break;case 14:ot=[4,3];break;case 15:ot=[3,2];break;case 16:ot=[2,1];break;case 255:{ot=[x()<<8|x(),x()<<8|x()];break}}return{width:Math.ceil((Ze+1)*16-s*2-o*2),height:(2-Lt)*(rt+1)*16-(Lt?2:4)*(l+u),pixelRatio:ot}}}class Jr extends Qt{constructor(...t){super(...t),this.initVPS=null}parsePES(t,i,s,o){const l=this.parseNALu(t,s.data,o);let u=this.VideoSample,f,y=!1;s.data=null,u&&l.length&&!t.audFound&&(this.pushAccessUnit(u,t),u=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),l.forEach(v=>{var x,w;switch(v.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:u||(u=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),u.frame=!0,f=!0;break;case 16:case 17:case 18:case 21:if(f=!0,y){var k;(k=u)!=null&&k.frame&&!u.key&&(this.pushAccessUnit(u,t),u=this.VideoSample=null)}u||(u=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),u.key=!0,u.frame=!0;break;case 19:case 20:f=!0,(x=u)!=null&&x.frame&&!u.key&&(this.pushAccessUnit(u,t),u=this.VideoSample=null),u||(u=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),u.key=!0,u.frame=!0;break;case 39:f=!0,wr(v.data,2,s.pts,i.samples);break;case 32:f=!0,t.vps||(typeof t.params!="object"&&(t.params={}),t.params=M(t.params,this.readVPS(v.data)),this.initVPS=v.data),t.vps=[v.data];break;case 33:if(f=!0,y=!0,t.vps!==void 0&&t.vps[0]!==this.initVPS&&t.sps!==void 0&&!this.matchSPS(t.sps[0],v.data)&&(this.initVPS=t.vps[0],t.sps=t.pps=void 0),!t.sps){const F=this.readSPS(v.data);t.width=F.width,t.height=F.height,t.pixelRatio=F.pixelRatio,t.codec=F.codecString,t.sps=[],typeof t.params!="object"&&(t.params={});for(const $ in F.params)t.params[$]=F.params[$]}this.pushParameterSet(t.sps,v.data,t.vps),u||(u=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),u.key=!0;break;case 34:if(f=!0,typeof t.params=="object"){if(!t.pps){t.pps=[];const F=this.readPPS(v.data);for(const $ in F)t.params[$]=F[$]}this.pushParameterSet(t.pps,v.data,t.vps)}break;case 35:f=!0,t.audFound=!0,(w=u)!=null&&w.frame&&(this.pushAccessUnit(u,t),u=null),u||(u=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts));break;default:f=!1;break}u&&f&&u.units.push(v)}),o&&u&&(this.pushAccessUnit(u,t),this.VideoSample=null)}pushParameterSet(t,i,s){(s&&s[0]===this.initVPS||!s&&!t.length)&&t.push(i)}getNALuType(t,i){return(t[i]&126)>>>1}ebsp2rbsp(t){const i=new Uint8Array(t.byteLength);let s=0;for(let o=0;o<t.byteLength;o++)o>=2&&t[o]===3&&t[o-1]===0&&t[o-2]===0||(i[s]=t[o],s++);return new Uint8Array(i.buffer,0,s)}pushAccessUnit(t,i){super.pushAccessUnit(t,i),this.initVPS&&(this.initVPS=null)}readVPS(t){const i=new lr(t);i.readUByte(),i.readUByte(),i.readBits(4),i.skipBits(2),i.readBits(6);const s=i.readBits(3),o=i.readBoolean();return{numTemporalLayers:s+1,temporalIdNested:o}}readSPS(t){const i=new lr(this.ebsp2rbsp(t));i.readUByte(),i.readUByte(),i.readBits(4);const s=i.readBits(3);i.readBoolean();const o=i.readBits(2),l=i.readBoolean(),u=i.readBits(5),f=i.readUByte(),y=i.readUByte(),v=i.readUByte(),x=i.readUByte(),w=i.readUByte(),k=i.readUByte(),F=i.readUByte(),$=i.readUByte(),Q=i.readUByte(),te=i.readUByte(),xe=i.readUByte(),ke=[],Le=[];for(let _n=0;_n<s;_n++)ke.push(i.readBoolean()),Le.push(i.readBoolean());if(s>0)for(let _n=s;_n<8;_n++)i.readBits(2);for(let _n=0;_n<s;_n++)ke[_n]&&(i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte()),Le[_n]&&i.readUByte();i.readUEG();const Ze=i.readUEG();Ze==3&&i.skipBits(1);const rt=i.readUEG(),Lt=i.readUEG(),ot=i.readBoolean();let St=0,xt=0,ht=0,jt=0;ot&&(St+=i.readUEG(),xt+=i.readUEG(),ht+=i.readUEG(),jt+=i.readUEG());const Br=i.readUEG(),ei=i.readUEG(),vi=i.readUEG(),Xr=i.readBoolean();for(let _n=Xr?0:s;_n<=s;_n++)i.skipUEG(),i.skipUEG(),i.skipUEG();if(i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG(),i.readBoolean()&&i.readBoolean())for(let ra=0;ra<4;ra++)for(let Fa=0;Fa<(ra===3?2:6);Fa++)if(!i.readBoolean())i.readUEG();else{const ba=Math.min(64,1<<4+(ra<<1));ra>1&&i.readEG();for(let Yo=0;Yo<ba;Yo++)i.readEG()}i.readBoolean(),i.readBoolean(),i.readBoolean()&&(i.readUByte(),i.skipUEG(),i.skipUEG(),i.readBoolean());const Gr=i.readUEG();let li=0;for(let _n=0;_n<Gr;_n++){let ra=!1;if(_n!==0&&(ra=i.readBoolean()),ra){_n===Gr&&i.readUEG(),i.readBoolean(),i.readUEG();let Fa=0;for(let Pl=0;Pl<=li;Pl++){const ba=i.readBoolean();let Yo=!1;ba||(Yo=i.readBoolean()),(ba||Yo)&&Fa++}li=Fa}else{const Fa=i.readUEG(),Pl=i.readUEG();li=Fa+Pl;for(let ba=0;ba<Fa;ba++)i.readUEG(),i.readBoolean();for(let ba=0;ba<Pl;ba++)i.readUEG(),i.readBoolean()}}if(i.readBoolean()){const _n=i.readUEG();for(let ra=0;ra<_n;ra++){for(let Fa=0;Fa<vi+4;Fa++)i.readBits(1);i.readBits(1)}}let _r=0,Pr=1,Ui=1,Rn=!0,ui=1,an=0;i.readBoolean(),i.readBoolean();let js=!1;if(i.readBoolean()){if(i.readBoolean()){const Ol=i.readUByte(),Uc=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Bl=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Ol>0&&Ol<16?(Pr=Uc[Ol-1],Ui=Bl[Ol-1]):Ol===255&&(Pr=i.readBits(16),Ui=i.readBits(16))}if(i.readBoolean()&&i.readBoolean(),i.readBoolean()&&(i.readBits(3),i.readBoolean(),i.readBoolean()&&(i.readUByte(),i.readUByte(),i.readUByte())),i.readBoolean()&&(i.readUEG(),i.readUEG()),i.readBoolean(),i.readBoolean(),i.readBoolean(),js=i.readBoolean(),js&&(i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG()),i.readBoolean()&&(ui=i.readBits(32),an=i.readBits(32),i.readBoolean()&&i.readUEG(),i.readBoolean())){const Bl=i.readBoolean(),du=i.readBoolean();let fu=!1;(Bl||du)&&(fu=i.readBoolean(),fu&&(i.readUByte(),i.readBits(5),i.readBoolean(),i.readBits(5)),i.readBits(4),i.readBits(4),fu&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5));for(let pu=0;pu<=s;pu++){Rn=i.readBoolean();const df=Rn||i.readBoolean();let Hc=!1;df?i.readEG():Hc=i.readBoolean();const jh=Hc?1:i.readUEG()+1;if(Bl)for(let l0=0;l0<jh;l0++)i.readUEG(),i.readUEG(),fu&&(i.readUEG(),i.readUEG()),i.skipBits(1);if(du)for(let l0=0;l0<jh;l0++)i.readUEG(),i.readUEG(),fu&&(i.readUEG(),i.readUEG()),i.skipBits(1)}}i.readBoolean()&&(i.readBoolean(),i.readBoolean(),i.readBoolean(),_r=i.readUEG())}let ua=rt,ao=Lt;if(ot){let _n=1,ra=1;Ze===1?_n=ra=2:Ze==2&&(_n=2),ua=rt-_n*xt-_n*St,ao=Lt-ra*jt-ra*ht}const Zo=o?["A","B","C"][o]:"",oo=f<<24|y<<16|v<<8|x;let ta=0;for(let _n=0;_n<32;_n++)ta=(ta|(oo>>_n&1)<<31-_n)>>>0;let a0=ta.toString(16);return u===1&&a0==="2"&&(a0="6"),{codecString:`hvc1.${Zo}${u}.${a0}.${l?"H":"L"}${xe}.B0`,params:{general_tier_flag:l,general_profile_idc:u,general_profile_space:o,general_profile_compatibility_flags:[f,y,v,x],general_constraint_indicator_flags:[w,k,F,$,Q,te],general_level_idc:xe,bit_depth:Br+8,bit_depth_luma_minus8:Br,bit_depth_chroma_minus8:ei,min_spatial_segmentation_idc:_r,chroma_format_idc:Ze,frame_rate:{fixed:Rn,fps:an/ui}},width:ua,height:ao,pixelRatio:[Pr,Ui]}}readPPS(t){const i=new lr(this.ebsp2rbsp(t));i.readUByte(),i.readUByte(),i.skipUEG(),i.skipUEG(),i.skipBits(2),i.skipBits(3),i.skipBits(2),i.skipUEG(),i.skipUEG(),i.skipEG(),i.skipBits(2),i.readBoolean()&&i.skipUEG(),i.skipEG(),i.skipEG(),i.skipBits(4);const o=i.readBoolean(),l=i.readBoolean();let u=1;return l&&o?u=0:l?u=3:o&&(u=2),{parallelismType:u}}matchSPS(t,i){return String.fromCharCode.apply(null,t).substr(3)===String.fromCharCode.apply(null,i).substr(3)}}const ai=188;class ki{constructor(t,i,s,o){this.logger=void 0,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._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=t,this.config=i,this.typeSupported=s,this.logger=o,this.videoParser=null}static probe(t,i){const s=ki.syncOffset(t);return s>0&&i.warn(`MPEG2-TS detected but first sync word found @ offset ${s}`),s!==-1}static syncOffset(t){const i=t.length;let s=Math.min(ai*5,i-ai)+1,o=0;for(;o<s;){let l=!1,u=-1,f=0;for(let y=o;y<i;y+=ai)if(t[y]===71&&(i-y===ai||t[y+ai]===71)){if(f++,u===-1&&(u=y,u!==0&&(s=Math.min(u+ai*99,t.length-ai)+1)),l||(l=Ni(t,y)===0),l&&f>1&&(u===0&&f>2||y+ai>s))return u}else{if(f)return-1;break}o++}return-1}static createTrack(t,i){return{container:t==="video"||t==="audio"?"video/mp2t":void 0,type:t,id:xr[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:t==="audio"?i:void 0}}resetInitSegment(t,i,s,o){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=ki.createTrack("video"),this._videoTrack.duration=o,this._audioTrack=ki.createTrack("audio",o),this._id3Track=ki.createTrack("id3"),this._txtTrack=ki.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=i,this.videoCodec=s}resetTimeStamp(){}resetContiguity(){const{_audioTrack:t,_videoTrack:i,_id3Track:s}=this;t&&(t.pesData=null),i&&(i.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(t,i,s=!1,o=!1){s||(this.sampleAes=null);let l;const u=this._videoTrack,f=this._audioTrack,y=this._id3Track,v=this._txtTrack;let x=u.pid,w=u.pesData,k=f.pid,F=y.pid,$=f.pesData,Q=y.pesData,te=null,xe=this.pmtParsed,ke=this._pmtId,Le=t.length;if(this.remainderData&&(t=Kt(this.remainderData,t),Le=t.length,this.remainderData=null),Le<ai&&!o)return this.remainderData=t,{audioTrack:f,videoTrack:u,id3Track:y,textTrack:v};const Ze=Math.max(0,ki.syncOffset(t));Le-=(Le-Ze)%ai,Le<t.byteLength&&!o&&(this.remainderData=new Uint8Array(t.buffer,Le,t.buffer.byteLength-Le));let rt=0;for(let ot=Ze;ot<Le;ot+=ai)if(t[ot]===71){const St=!!(t[ot+1]&64),xt=Ni(t,ot),ht=(t[ot+3]&48)>>4;let jt;if(ht>1){if(jt=ot+5+t[ot+4],jt===ot+ai)continue}else jt=ot+4;switch(xt){case x:St&&(w&&(l=In(w,this.logger))&&(this.readyVideoParser(u.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(u,v,l,!1)),w={data:[],size:0}),w&&(w.data.push(t.subarray(jt,ot+ai)),w.size+=ot+ai-jt);break;case k:if(St){if($&&(l=In($,this.logger)))switch(f.segmentCodec){case"aac":this.parseAACPES(f,l);break;case"mp3":this.parseMPEGPES(f,l);break;case"ac3":this.parseAC3PES(f,l);break}$={data:[],size:0}}$&&($.data.push(t.subarray(jt,ot+ai)),$.size+=ot+ai-jt);break;case F:St&&(Q&&(l=In(Q,this.logger))&&this.parseID3PES(y,l),Q={data:[],size:0}),Q&&(Q.data.push(t.subarray(jt,ot+ai)),Q.size+=ot+ai-jt);break;case 0:St&&(jt+=t[jt]+1),ke=this._pmtId=An(t,jt);break;case ke:{St&&(jt+=t[jt]+1);const Br=mn(t,jt,this.typeSupported,s,this.observer,this.logger);x=Br.videoPid,x>0&&(u.pid=x,u.segmentCodec=Br.segmentVideoCodec),k=Br.audioPid,k>0&&(f.pid=k,f.segmentCodec=Br.segmentAudioCodec),F=Br.id3Pid,F>0&&(y.pid=F),te!==null&&!xe&&(this.logger.warn(`MPEG-TS PMT found at ${ot} after unknown PID '${te}'. Backtracking to sync byte @${Ze} to parse all TS packets.`),te=null,ot=Ze-188),xe=this.pmtParsed=!0;break}case 17:case 8191:break;default:te=xt;break}}else rt++;rt>0&&kn(this.observer,new Error(`Found ${rt} TS packet/s that do not start with 0x47`),void 0,this.logger),u.pesData=w,f.pesData=$,y.pesData=Q;const Lt={audioTrack:f,videoTrack:u,id3Track:y,textTrack:v};return o&&this.extractRemainingSamples(Lt),Lt}flush(){const{remainderData:t}=this;this.remainderData=null;let i;return t?i=this.demux(t,-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(t){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:l}=t,u=s.pesData,f=i.pesData,y=o.pesData;let v;if(u&&(v=In(u,this.logger))?(this.readyVideoParser(s.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(s,l,v,!0),s.pesData=null)):s.pesData=u,f&&(v=In(f,this.logger))){switch(i.segmentCodec){case"aac":this.parseAACPES(i,v);break;case"mp3":this.parseMPEGPES(i,v);break;case"ac3":this.parseAC3PES(i,v);break}i.pesData=null}else f!=null&&f.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=f;y&&(v=In(y,this.logger))?(this.parseID3PES(o,v),o.pesData=null):o.pesData=y}demuxSampleAes(t,i,s){const o=this.demux(t,s,!0,!this.config.progressive),l=this.sampleAes=new It(this.observer,this.config,i);return this.decrypt(o,l)}readyVideoParser(t){this.videoParser===null&&(t==="avc"?this.videoParser=new Dr:t==="hevc"&&(this.videoParser=new Jr))}decrypt(t,i){return new Promise(s=>{const{audioTrack:o,videoTrack:l}=t;o.samples&&o.segmentCodec==="aac"?i.decryptAacSamples(o.samples,0,()=>{l.samples?i.decryptAvcSamples(l.samples,0,0,()=>{s(t)}):s(t)}):l.samples&&i.decryptAvcSamples(l.samples,0,0,()=>{s(t)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(t,i){let s=0;const o=this.aacOverFlow;let l=i.data;if(o){this.aacOverFlow=null;const w=o.missing,k=o.sample.unit.byteLength;if(w===-1)l=Kt(o.sample.unit,l);else{const F=k-w;o.sample.unit.set(l.subarray(0,w),F),t.samples.push(o.sample),s=o.missing}}let u,f;for(u=s,f=l.length;u<f-1&&!dl(l,u);u++);if(u!==s){let w;const k=u<f-1;if(k?w=`AAC PES did not start with ADTS header,offset:${u}`:w="No ADTS header found in AAC PES",kn(this.observer,new Error(w),k,this.logger),!k)return}jl(t,this.observer,l,u,this.audioCodec);let y;if(i.pts!==void 0)y=i.pts;else if(o){const w=Au(t.samplerate);y=o.sample.pts+w}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let v=0,x;for(;u<f;)if(x=ku(t,l,u,y,v),u+=x.length,x.missing){this.aacOverFlow=x;break}else for(v++;u<f-1&&!dl(l,u);u++);}parseMPEGPES(t,i){const s=i.data,o=s.length;let l=0,u=0;const f=i.pts;if(f===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;u<o;)if(m(s,u)){const y=Jl(t,s,u,f,l);if(y)u+=y.length,l++;else break}else u++}parseAC3PES(t,i){{const s=i.data,o=i.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const l=s.length;let u=0,f=0,y;for(;f<l&&(y=ce(t,s,f,o,u++))>0;)f+=y}}parseID3PES(t,i){if(i.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const s=M({},i,{type:this._videoTrack?Ls.emsg:Ls.audioId3,duration:Number.POSITIVE_INFINITY});t.samples.push(s)}}function Ni(h,t){return((h[t+1]&31)<<8)+h[t+2]}function An(h,t){return(h[t+10]&31)<<8|h[t+11]}function mn(h,t,i,s,o,l){const u={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},f=(h[t+1]&15)<<8|h[t+2],y=t+3+f-4,v=(h[t+10]&15)<<8|h[t+11];for(t+=12+v;t<y;){const x=Ni(h,t),w=(h[t+3]&15)<<8|h[t+4];switch(h[t]){case 207:if(!s){Tn("ADTS AAC",l);break}case 15:u.audioPid===-1&&(u.audioPid=x);break;case 21:u.id3Pid===-1&&(u.id3Pid=x);break;case 219:if(!s){Tn("H.264",l);break}case 27:u.videoPid===-1&&(u.videoPid=x);break;case 3:case 4:!i.mpeg&&!i.mp3?l.log("MPEG audio found, not supported in this browser"):u.audioPid===-1&&(u.audioPid=x,u.segmentAudioCodec="mp3");break;case 193:if(!s){Tn("AC-3",l);break}case 129:i.ac3?u.audioPid===-1&&(u.audioPid=x,u.segmentAudioCodec="ac3"):l.log("AC-3 audio found, not supported in this browser");break;case 6:if(u.audioPid===-1&&w>0){let k=t+5,F=w;for(;F>2;){switch(h[k]){case 106:i.ac3!==!0?l.log("AC-3 audio found, not supported in this browser for now"):(u.audioPid=x,u.segmentAudioCodec="ac3");break}const Q=h[k+1]+2;k+=Q,F-=Q}}break;case 194:case 135:return kn(o,new Error("Unsupported EC-3 in M2TS found"),void 0,l),u;case 36:u.videoPid===-1&&(u.videoPid=x,u.segmentVideoCodec="hevc",l.log("HEVC in M2TS found"));break}t+=w+5}return u}function kn(h,t,i,s){s.warn(`parsing error: ${t.message}`),h.emit(E.ERROR,E.ERROR,{type:Me.MEDIA_ERROR,details:ae.FRAG_PARSING_ERROR,fatal:!1,levelRetry:i,error:t,reason:t.message})}function Tn(h,t){t.log(`${h} with AES-128-CBC encryption found in unencrypted stream`)}function In(h,t){let i=0,s,o,l,u,f;const y=h.data;if(!h||h.size===0)return null;for(;y[0].length<19&&y.length>1;)y[0]=Kt(y[0],y[1]),y.splice(1,1);if(s=y[0],(s[0]<<16)+(s[1]<<8)+s[2]===1){if(o=(s[4]<<8)+s[5],o&&o>h.size-6)return null;const x=s[7];x&192&&(u=(s[9]&14)*536870912+(s[10]&255)*4194304+(s[11]&254)*16384+(s[12]&255)*128+(s[13]&254)/2,x&64?(f=(s[14]&14)*536870912+(s[15]&255)*4194304+(s[16]&254)*16384+(s[17]&255)*128+(s[18]&254)/2,u-f>60*9e4&&(t.warn(`${Math.round((u-f)/9e4)}s delta between PTS and DTS, align them`),u=f)):f=u),l=s[8];let w=l+9;if(h.size<=w)return null;h.size-=w;const k=new Uint8Array(h.size);for(let F=0,$=y.length;F<$;F++){s=y[F];let Q=s.byteLength;if(w)if(w>Q){w-=Q;continue}else s=s.subarray(w),Q-=w,w=0;k.set(s,i),i+=Q}return o&&(o-=l+3),{data:k,pts:u,dts:f,len:o}}return null}class As{static getSilentFrame(t,i){switch(t){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 Fn=Math.pow(2,32)-1;class nt{static init(){nt.types={avc1:[],avcC:[],hvc1:[],hvcC:[],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 t;for(t in nt.types)nt.types.hasOwnProperty(t)&&(nt.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.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]);nt.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]),l=new Uint8Array([0,0,0,0,0,0,0,0]);nt.STTS=nt.STSC=nt.STCO=l,nt.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),nt.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),nt.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),nt.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const u=new Uint8Array([105,115,111,109]),f=new Uint8Array([97,118,99,49]),y=new Uint8Array([0,0,0,1]);nt.FTYP=nt.box(nt.types.ftyp,u,y,u,f),nt.DINF=nt.box(nt.types.dinf,nt.box(nt.types.dref,o))}static box(t,...i){let s=8,o=i.length;const l=o;for(;o--;)s+=i[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(t,4),o=0,s=8;o<l;o++)u.set(i[o],s),s+=i[o].byteLength;return u}static hdlr(t){return nt.box(nt.types.hdlr,nt.HDLR_TYPES[t])}static mdat(t){return nt.box(nt.types.mdat,t)}static mdhd(t,i){i*=t;const s=Math.floor(i/(Fn+1)),o=Math.floor(i%(Fn+1));return nt.box(nt.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&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(t){return nt.box(nt.types.mdia,nt.mdhd(t.timescale||0,t.duration||0),nt.hdlr(t.type),nt.minf(t))}static mfhd(t){return nt.box(nt.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255]))}static minf(t){return t.type==="audio"?nt.box(nt.types.minf,nt.box(nt.types.smhd,nt.SMHD),nt.DINF,nt.stbl(t)):nt.box(nt.types.minf,nt.box(nt.types.vmhd,nt.VMHD),nt.DINF,nt.stbl(t))}static moof(t,i,s){return nt.box(nt.types.moof,nt.mfhd(t),nt.traf(s,i))}static moov(t){let i=t.length;const s=[];for(;i--;)s[i]=nt.trak(t[i]);return nt.box.apply(null,[nt.types.moov,nt.mvhd(t[0].timescale||0,t[0].duration||0)].concat(s).concat(nt.mvex(t)))}static mvex(t){let i=t.length;const s=[];for(;i--;)s[i]=nt.trex(t[i]);return nt.box.apply(null,[nt.types.mvex,...s])}static mvhd(t,i){i*=t;const s=Math.floor(i/(Fn+1)),o=Math.floor(i%(Fn+1)),l=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&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 nt.box(nt.types.mvhd,l)}static sdtp(t){const i=t.samples||[],s=new Uint8Array(4+i.length);let o,l;for(o=0;o<i.length;o++)l=i[o].flags,s[o+4]=l.dependsOn<<4|l.isDependedOn<<2|l.hasRedundancy;return nt.box(nt.types.sdtp,s)}static stbl(t){return nt.box(nt.types.stbl,nt.stsd(t),nt.box(nt.types.stts,nt.STTS),nt.box(nt.types.stsc,nt.STSC),nt.box(nt.types.stsz,nt.STSZ),nt.box(nt.types.stco,nt.STCO))}static avc1(t){let i=[],s=[],o,l,u;for(o=0;o<t.sps.length;o++)l=t.sps[o],u=l.byteLength,i.push(u>>>8&255),i.push(u&255),i=i.concat(Array.prototype.slice.call(l));for(o=0;o<t.pps.length;o++)l=t.pps[o],u=l.byteLength,s.push(u>>>8&255),s.push(u&255),s=s.concat(Array.prototype.slice.call(l));const f=nt.box(nt.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|t.sps.length].concat(i).concat([t.pps.length]).concat(s))),y=t.width,v=t.height,x=t.pixelRatio[0],w=t.pixelRatio[1];return nt.box(nt.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,y>>8&255,y&255,v>>8&255,v&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]),f,nt.box(nt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),nt.box(nt.types.pasp,new Uint8Array([x>>24,x>>16&255,x>>8&255,x&255,w>>24,w>>16&255,w>>8&255,w&255])))}static esds(t){const i=t.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...i,6,1,2])}static audioStsd(t){const i=t.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount||0,0,16,0,0,0,0,i>>8&255,i&255,0,0])}static mp4a(t){return nt.box(nt.types.mp4a,nt.audioStsd(t),nt.box(nt.types.esds,nt.esds(t)))}static mp3(t){return nt.box(nt.types[".mp3"],nt.audioStsd(t))}static ac3(t){return nt.box(nt.types["ac-3"],nt.audioStsd(t),nt.box(nt.types.dac3,t.config))}static stsd(t){const{segmentCodec:i}=t;if(t.type==="audio"){if(i==="aac")return nt.box(nt.types.stsd,nt.STSD,nt.mp4a(t));if(i==="ac3"&&t.config)return nt.box(nt.types.stsd,nt.STSD,nt.ac3(t));if(i==="mp3"&&t.codec==="mp3")return nt.box(nt.types.stsd,nt.STSD,nt.mp3(t))}else if(t.pps&&t.sps){if(i==="avc")return nt.box(nt.types.stsd,nt.STSD,nt.avc1(t));if(i==="hevc"&&t.vps)return nt.box(nt.types.stsd,nt.STSD,nt.hvc1(t))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${t.type} segment codec (${i}/${t.codec})`)}static tkhd(t){const i=t.id,s=(t.duration||0)*(t.timescale||0),o=t.width||0,l=t.height||0,u=Math.floor(s/(Fn+1)),f=Math.floor(s%(Fn+1));return nt.box(nt.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,u>>24,u>>16&255,u>>8&255,u&255,f>>24,f>>16&255,f>>8&255,f&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,l>>8&255,l&255,0,0]))}static traf(t,i){const s=nt.sdtp(t),o=t.id,l=Math.floor(i/(Fn+1)),u=Math.floor(i%(Fn+1));return nt.box(nt.types.traf,nt.box(nt.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),nt.box(nt.types.tfdt,new Uint8Array([1,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,u>>24,u>>16&255,u>>8&255,u&255])),nt.trun(t,s.length+16+20+8+16+8+8),s)}static trak(t){return t.duration=t.duration||4294967295,nt.box(nt.types.trak,nt.tkhd(t),nt.mdia(t))}static trex(t){const i=t.id;return nt.box(nt.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(t,i){const s=t.samples||[],o=s.length,l=12+16*o,u=new Uint8Array(l);let f,y,v,x,w,k;for(i+=8+l,u.set([t.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),f=0;f<o;f++)y=s[f],v=y.duration,x=y.size,w=y.flags,k=y.cts,u.set([v>>>24&255,v>>>16&255,v>>>8&255,v&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,w.isLeading<<2|w.dependsOn,w.isDependedOn<<6|w.hasRedundancy<<4|w.paddingValue<<1|w.isNonSync,w.degradPrio&61440,w.degradPrio&15,k>>>24&255,k>>>16&255,k>>>8&255,k&255],12+16*f);return nt.box(nt.types.trun,u)}static initSegment(t){nt.types||nt.init();const i=nt.moov(t);return Kt(nt.FTYP,i)}static hvc1(t){const i=t.params,s=[t.vps,t.sps,t.pps],o=4,l=new Uint8Array([1,i.general_profile_space<<6|(i.general_tier_flag?32:0)|i.general_profile_idc,i.general_profile_compatibility_flags[0],i.general_profile_compatibility_flags[1],i.general_profile_compatibility_flags[2],i.general_profile_compatibility_flags[3],i.general_constraint_indicator_flags[0],i.general_constraint_indicator_flags[1],i.general_constraint_indicator_flags[2],i.general_constraint_indicator_flags[3],i.general_constraint_indicator_flags[4],i.general_constraint_indicator_flags[5],i.general_level_idc,240|i.min_spatial_segmentation_idc>>8,255&i.min_spatial_segmentation_idc,252|i.parallelismType,252|i.chroma_format_idc,248|i.bit_depth_luma_minus8,248|i.bit_depth_chroma_minus8,0,parseInt(i.frame_rate.fps),o-1|i.temporal_id_nested<<2|i.num_temporal_layers<<3|(i.frame_rate.fixed?64:0),s.length]);let u=l.length;for(let $=0;$<s.length;$+=1){u+=3;for(let Q=0;Q<s[$].length;Q+=1)u+=2+s[$][Q].length}const f=new Uint8Array(u);f.set(l,0),u=l.length;const y=s.length-1;for(let $=0;$<s.length;$+=1){f.set(new Uint8Array([32+$|($===y?128:0),0,s[$].length]),u),u+=3;for(let Q=0;Q<s[$].length;Q+=1)f.set(new Uint8Array([s[$][Q].length>>8,s[$][Q].length&255]),u),u+=2,f.set(s[$][Q],u),u+=s[$][Q].length}const v=nt.box(nt.types.hvcC,f),x=t.width,w=t.height,k=t.pixelRatio[0],F=t.pixelRatio[1];return nt.box(nt.types.hvc1,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,x>>8&255,x&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]),v,nt.box(nt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),nt.box(nt.types.pasp,new Uint8Array([k>>24,k>>16&255,k>>8&255,k&255,F>>24,F>>16&255,F>>8&255,F&255])))}}nt.types=void 0,nt.HDLR_TYPES=void 0,nt.STTS=void 0,nt.STSC=void 0,nt.STCO=void 0,nt.STSZ=void 0,nt.VMHD=void 0,nt.SMHD=void 0,nt.STSD=void 0,nt.FTYP=void 0,nt.DINF=void 0;const Qs=9e4;function wa(h,t,i=1,s=!1){const o=h*t*i;return s?Math.round(o):o}function pa(h,t,i=1,s=!1){return wa(h,t,1/i,s)}function Xn(h,t=!1){return wa(h,1e3,1/Qs,t)}function Mr(h,t=1){return wa(h,Qs,1/t)}function ps(h){const{baseTime:t,timescale:i,trackId:s}=h;return`${t/i} (${t}/${i}) trackId: ${s}`}const Bu=10*1e3,A0=1024,ms=1152,Ra=1536;let ma=null,Ko=null;function vl(h,t,i,s){return{duration:t,size:i,cts:s,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:h?2:1,isNonSync:h?0:1}}}class Ua extends le{constructor(t,i,s,o){if(super("mp4-remuxer",o),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=t,this.config=i,this.typeSupported=s,this.ISGenerated=!1,ma===null){const u=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ma=u?parseInt(u[1]):0}if(Ko===null){const l=navigator.userAgent.match(/Safari\/(\d+)/i);Ko=l?parseInt(l[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(t){const i=this._initPTS;(!i||!t||t.trackId!==i.trackId||t.baseTime!==i.baseTime||t.timescale!==i.timescale)&&this.log(`Reset initPTS: ${i&&ps(i)} > ${t&&ps(t)}`),this._initPTS=this._initDTS=t}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(t){let i=!1;const s=t[0].pts,o=t.reduce((l,u)=>{let f=u.pts,y=f-l;return y<-4294967296&&(i=!0,f=Jn(f,s),y=f-l),y>0?l:f},s);return i&&this.debug("PTS rollover detected"),o}remux(t,i,s,o,l,u,f,y){let v,x,w,k,F,$,Q=l,te=l;const xe=t.pid>-1,ke=i.pid>-1,Le=i.samples.length,Ze=t.samples.length>0,rt=f&&Le>0||Le>1;if((!xe||Ze)&&(!ke||rt)||this.ISGenerated||f){if(this.ISGenerated){var ot,St,xt,ht;const vi=this.videoTrackConfig;(vi&&(i.width!==vi.width||i.height!==vi.height||((ot=i.pixelRatio)==null?void 0:ot[0])!==((St=vi.pixelRatio)==null?void 0:St[0])||((xt=i.pixelRatio)==null?void 0:xt[1])!==((ht=vi.pixelRatio)==null?void 0:ht[1]))||!vi&&rt||this.nextAudioTs===null&&Ze)&&this.resetInitSegment()}this.ISGenerated||(w=this.generateIS(t,i,l,u));const jt=this.isVideoContiguous;let Br=-1,ei;if(rt&&(Br=mc(i.samples),!jt&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,Br>0){this.warn(`Dropped ${Br} out of ${Le} video samples due to a missing keyframe`);const vi=this.getVideoStartPts(i.samples);i.samples=i.samples.slice(Br),i.dropped+=Br,te+=(i.samples[0].pts-vi)/i.inputTimeScale,ei=te}else Br===-1&&(this.warn(`No keyframe found out of ${Le} video samples`),$=!1);if(this.ISGenerated){if(Ze&&rt){const vi=this.getVideoStartPts(i.samples),Cr=(Jn(t.samples[0].pts,vi)-vi)/i.inputTimeScale;Q+=Math.max(0,Cr),te+=Math.max(0,-Cr)}if(Ze){if(t.samplerate||(this.warn("regenerate InitSegment as audio detected"),w=this.generateIS(t,i,l,u)),x=this.remuxAudio(t,Q,this.isAudioContiguous,u,ke||rt||y===z.AUDIO?te:void 0),rt){const vi=x?x.endPTS-x.startPTS:0;i.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),w=this.generateIS(t,i,l,u)),v=this.remuxVideo(i,te,jt,vi)}}else rt&&(v=this.remuxVideo(i,te,jt,0));v&&(v.firstKeyFrame=Br,v.independent=Br!==-1,v.firstKeyFramePTS=ei)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(F=Sa(s,l,this._initPTS,this._initDTS)),o.samples.length&&(k=Ql(o,l,this._initPTS))),{audio:x,video:v,initSegment:w,independent:$,text:k,id3:F}}computeInitPts(t,i,s,o){const l=Math.round(s*i);let u=Jn(t,l);if(u<l+i)for(this.log(`Adjusting PTS for rollover in timeline near ${(l-u)/i} ${o}`);u<l+i;)u+=8589934592;return u-l}generateIS(t,i,s,o){const l=t.samples,u=i.samples,f=this.typeSupported,y={},v=this._initPTS;let x=!v||o,w="audio/mp4",k,F,$,Q=-1;if(x&&(k=F=1/0),t.config&&l.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":f.mpeg?(w="audio/mpeg",t.codec=""):f.mp3&&(t.codec="mp3");break;case"ac3":t.codec="ac-3";break}y.audio={id:"audio",container:w,codec:t.codec,initSegment:t.segmentCodec==="mp3"&&f.mpeg?new Uint8Array(0):nt.initSegment([t]),metadata:{channelCount:t.channelCount}},x&&(Q=t.id,$=t.inputTimeScale,!v||$!==v.timescale?k=F=this.computeInitPts(l[0].pts,$,s,"audio"):x=!1)}if(i.sps&&i.pps&&u.length){if(i.timescale=i.inputTimeScale,y.video={id:"main",container:"video/mp4",codec:i.codec,initSegment:nt.initSegment([i]),metadata:{width:i.width,height:i.height}},x)if(Q=i.id,$=i.inputTimeScale,!v||$!==v.timescale){const te=this.getVideoStartPts(u),xe=Jn(u[0].dts,te),ke=this.computeInitPts(xe,$,s,"video"),Le=this.computeInitPts(te,$,s,"video");F=Math.min(F,ke),k=Math.min(k,Le)}else x=!1;this.videoTrackConfig={width:i.width,height:i.height,pixelRatio:i.pixelRatio}}if(Object.keys(y).length)return this.ISGenerated=!0,x?(v&&this.warn(`Timestamps at playlist time: ${o?"":"~"}${s} ${k/$} != initPTS: ${v.baseTime/v.timescale} (${v.baseTime}/${v.timescale}) trackId: ${v.trackId}`),this.log(`Found initPTS at playlist time: ${s} offset: ${k/$} (${k}/${$}) trackId: ${Q}`),this._initPTS={baseTime:k,timescale:$,trackId:Q},this._initDTS={baseTime:F,timescale:$,trackId:Q}):k=$=void 0,{tracks:y,initPTS:k,timescale:$,trackId:Q}}remuxVideo(t,i,s,o){const l=t.inputTimeScale,u=t.samples,f=[],y=u.length,v=this._initPTS,x=v.baseTime*l/v.timescale;let w=this.nextVideoTs,k=8,F=this.videoSampleDuration,$,Q,te=Number.POSITIVE_INFINITY,xe=Number.NEGATIVE_INFINITY,ke=!1;if(!s||w===null){const _r=x+i*l,Pr=u[0].pts-Jn(u[0].dts,u[0].pts);ma&&w!==null&&Math.abs(_r-Pr-(w+x))<15e3?s=!0:w=_r-Pr-x}const Le=w+x;for(let _r=0;_r<y;_r++){const Pr=u[_r];Pr.pts=Jn(Pr.pts,Le),Pr.dts=Jn(Pr.dts,Le),Pr.dts<u[_r>0?_r-1:_r].dts&&(ke=!0)}ke&&u.sort(function(_r,Pr){const Ui=_r.dts-Pr.dts,Rn=_r.pts-Pr.pts;return Ui||Rn}),$=u[0].dts,Q=u[u.length-1].dts;const Ze=Q-$,rt=Ze?Math.round(Ze/(y-1)):F||t.inputTimeScale/30;if(s){const _r=$-Le,Pr=_r>rt,Ui=_r<-1;if((Pr||Ui)&&(Pr?this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${Xn(_r,!0)} ms (${_r}dts) hole between fragments detected at ${i.toFixed(3)}`):this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${Xn(-_r,!0)} ms (${_r}dts) overlapping between fragments detected at ${i.toFixed(3)}`),!Ui||Le>=u[0].pts||ma)){$=Le;const Rn=u[0].pts-_r;if(Pr)u[0].dts=$,u[0].pts=Rn;else{let ui=!0;for(let an=0;an<u.length&&!(u[an].dts>Rn&&ui);an++){const js=u[an].pts;if(u[an].dts-=_r,u[an].pts-=_r,an<u.length-1){const hs=u[an+1].pts,ua=u[an].pts,ao=hs<=ua,Zo=hs<=js;ui=ao==Zo}}}this.log(`Video: Initial PTS/DTS adjusted: ${Xn(Rn,!0)}/${Xn($,!0)}, delta: ${Xn(_r,!0)} ms`)}}$=Math.max(0,$);let Lt=0,ot=0,St=$;for(let _r=0;_r<y;_r++){const Pr=u[_r],Ui=Pr.units,Rn=Ui.length;let ui=0;for(let an=0;an<Rn;an++)ui+=Ui[an].data.length;ot+=ui,Lt+=Rn,Pr.length=ui,Pr.dts<St?(Pr.dts=St,St+=rt/4|0||1):St=Pr.dts,te=Math.min(Pr.pts,te),xe=Math.max(Pr.pts,xe)}Q=u[y-1].dts;const xt=ot+4*Lt+8;let ht;try{ht=new Uint8Array(xt)}catch(_r){this.observer.emit(E.ERROR,E.ERROR,{type:Me.MUX_ERROR,details:ae.REMUX_ALLOC_ERROR,fatal:!1,error:_r,bytes:xt,reason:`fail allocating video mdat ${xt}`});return}const jt=new DataView(ht.buffer);jt.setUint32(0,xt),ht.set(nt.types.mdat,4);let Br=!1,ei=Number.POSITIVE_INFINITY,vi=Number.POSITIVE_INFINITY,Xr=Number.NEGATIVE_INFINITY,Cr=Number.NEGATIVE_INFINITY;for(let _r=0;_r<y;_r++){const Pr=u[_r],Ui=Pr.units;let Rn=0;for(let js=0,hs=Ui.length;js<hs;js++){const ua=Ui[js],ao=ua.data,Zo=ua.data.byteLength;jt.setUint32(k,Zo),k+=4,ht.set(ao,k),k+=Zo,Rn+=4+Zo}let ui;if(_r<y-1)F=u[_r+1].dts-Pr.dts,ui=u[_r+1].pts-Pr.pts;else{const js=this.config,hs=_r>0?Pr.dts-u[_r-1].dts:rt;if(ui=_r>0?Pr.pts-u[_r-1].pts:rt,js.stretchShortVideoTrack&&this.nextAudioTs!==null){const ua=Math.floor(js.maxBufferHole*l),ao=(o?te+o*l:this.nextAudioTs+x)-Pr.pts;ao>ua?(F=ao-hs,F<0?F=hs:Br=!0,this.log(`It is approximately ${ao/90} ms to the next segment; using duration ${F/90} ms for the last video frame.`)):F=hs}else F=hs}const an=Math.round(Pr.pts-Pr.dts);ei=Math.min(ei,F),Xr=Math.max(Xr,F),vi=Math.min(vi,ui),Cr=Math.max(Cr,ui),f.push(vl(Pr.key,F,Rn,an))}if(f.length){if(ma){if(ma<70){const _r=f[0].flags;_r.dependsOn=2,_r.isNonSync=0}}else if(Ko&&Cr-vi<Xr-ei&&rt/Xr<.025&&f[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let _r=$;for(let Pr=0,Ui=f.length;Pr<Ui;Pr++){const Rn=_r+f[Pr].duration,ui=_r+f[Pr].cts;if(Pr<Ui-1){const an=Rn+f[Pr+1].cts;f[Pr].duration=an-ui}else f[Pr].duration=Pr?f[Pr-1].duration:rt;f[Pr].cts=0,_r=Rn}}}F=Br||!F?rt:F;const ii=Q+F;this.nextVideoTs=w=ii-x,this.videoSampleDuration=F,this.isVideoContiguous=!0;const Li={data1:nt.moof(t.sequenceNumber++,$,M(t,{samples:f})),data2:ht,startPTS:(te-x)/l,endPTS:(xe+F-x)/l,startDTS:($-x)/l,endDTS:w/l,type:"video",hasAudio:!1,hasVideo:!0,nb:f.length,dropped:t.dropped};return t.samples=[],t.dropped=0,Li}getSamplesPerFrame(t){switch(t.segmentCodec){case"mp3":return ms;case"ac3":return Ra;default:return A0}}remuxAudio(t,i,s,o,l){const u=t.inputTimeScale,f=t.samplerate?t.samplerate:u,y=u/f,v=this.getSamplesPerFrame(t),x=v*y,w=this._initPTS,k=t.segmentCodec==="mp3"&&this.typeSupported.mpeg,F=[],$=l!==void 0;let Q=t.samples,te=k?0:8,xe=this.nextAudioTs||-1;const ke=w.baseTime*u/w.timescale,Le=ke+i*u;if(this.isAudioContiguous=s=s||Q.length&&xe>0&&(o&&Math.abs(Le-(xe+ke))<9e3||Math.abs(Jn(Q[0].pts,Le)-(xe+ke))<20*x),Q.forEach(function(Cr){Cr.pts=Jn(Cr.pts,Le)}),!s||xe<0){const Cr=Q.length;if(Q=Q.filter(ii=>ii.pts>=0),Cr!==Q.length&&this.warn(`Removed ${Q.length-Cr} of ${Cr} samples (initPTS ${ke} / ${u})`),!Q.length)return;l===0?xe=0:o&&!$?xe=Math.max(0,Le-ke):xe=Q[0].pts-ke}if(t.segmentCodec==="aac"){const Cr=this.config.maxAudioFramesDrift;for(let ii=0,Gr=xe+ke;ii<Q.length;ii++){const li=Q[ii],Li=li.pts,_r=Li-Gr,Pr=Math.abs(1e3*_r/u);if(_r<=-Cr*x&&$)ii===0&&(this.warn(`Audio frame @ ${(Li/u).toFixed(3)}s overlaps marker by ${Math.round(1e3*_r/u)} ms.`),this.nextAudioTs=xe=Li-ke,Gr=Li);else if(_r>=Cr*x&&Pr<Bu&&$){let Ui=Math.round(_r/x);for(Gr=Li-Ui*x;Gr<0&&Ui&&x;)Ui--,Gr+=x;ii===0&&(this.nextAudioTs=xe=Gr-ke),this.warn(`Injecting ${Ui} audio frames @ ${((Gr-ke)/u).toFixed(3)}s due to ${Math.round(1e3*_r/u)} ms gap.`);for(let Rn=0;Rn<Ui;Rn++){let ui=As.getSilentFrame(t.parsedCodec||t.manifestCodec||t.codec,t.channelCount);ui||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),ui=li.unit.subarray()),Q.splice(ii,0,{unit:ui,pts:Gr}),Gr+=x,ii++}}li.pts=Gr,Gr+=x}}let Ze=null,rt=null,Lt,ot=0,St=Q.length;for(;St--;)ot+=Q[St].unit.byteLength;for(let Cr=0,ii=Q.length;Cr<ii;Cr++){const Gr=Q[Cr],li=Gr.unit;let Li=Gr.pts;if(rt!==null){const Pr=F[Cr-1];Pr.duration=Math.round((Li-rt)/y)}else if(s&&t.segmentCodec==="aac"&&(Li=xe+ke),Ze=Li,ot>0){ot+=te;try{Lt=new Uint8Array(ot)}catch(Pr){this.observer.emit(E.ERROR,E.ERROR,{type:Me.MUX_ERROR,details:ae.REMUX_ALLOC_ERROR,fatal:!1,error:Pr,bytes:ot,reason:`fail allocating audio mdat ${ot}`});return}k||(new DataView(Lt.buffer).setUint32(0,ot),Lt.set(nt.types.mdat,4))}else return;Lt.set(li,te);const _r=li.byteLength;te+=_r,F.push(vl(!0,v,_r,0)),rt=Li}const xt=F.length;if(!xt)return;const ht=F[F.length-1];xe=rt-ke,this.nextAudioTs=xe+y*ht.duration;const jt=k?new Uint8Array(0):nt.moof(t.sequenceNumber++,Ze/y,M({},t,{samples:F}));t.samples=[];const Br=(Ze-ke)/u,ei=this.nextAudioTs/u,Xr={data1:jt,data2:Lt,startPTS:Br,endPTS:ei,startDTS:Br,endDTS:ei,type:"audio",hasAudio:!0,hasVideo:!1,nb:xt};return this.isAudioContiguous=!0,Xr}}function Jn(h,t){let i;if(t===null)return h;for(t<h?i=-8589934592:i=8589934592;Math.abs(h-t)>4294967296;)h+=i;return h}function mc(h){for(let t=0;t<h.length;t++)if(h[t].key)return t;return-1}function Sa(h,t,i,s){const o=h.samples.length;if(!o)return;const l=h.inputTimeScale;for(let f=0;f<o;f++){const y=h.samples[f];y.pts=Jn(y.pts-i.baseTime*l/i.timescale,t*l)/l,y.dts=Jn(y.dts-s.baseTime*l/s.timescale,t*l)/l}const u=h.samples;return h.samples=[],{samples:u}}function Ql(h,t,i){const s=h.samples.length;if(!s)return;const o=h.inputTimeScale;for(let u=0;u<s;u++){const f=h.samples[u];f.pts=Jn(f.pts-i.baseTime*o/i.timescale,t*o)/o}h.samples.sort((u,f)=>u.pts-f.pts);const l=h.samples;return h.samples=[],{samples:l}}class eu extends le{constructor(t,i,s,o){super("passthrough-remuxer",o),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,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(t){this.lastEndTime=null;const i=this.initPTS;i&&t&&i.baseTime===t.baseTime&&i.timescale===t.timescale||(this.initPTS=t)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(t,i,s,o){this.audioCodec=i,this.videoCodec=s,this.generateInitSegment(t,o),this.emitInitSegment=!0}generateInitSegment(t,i){let{audioCodec:s,videoCodec:o}=this;if(!(t!=null&&t.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:l,video:u}=this.initData=Rt(t);if(i)Ft(t,i);else{const y=l||u;y!=null&&y.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${y.codec}")!`)}l&&(s=bl(l,se.AUDIO,this)),u&&(o=bl(u,se.VIDEO,this));const f={};l&&u?f.audiovideo={container:"video/mp4",codec:s+","+o,supplemental:u.supplemental,encrypted:u.encrypted,initSegment:t,id:"main"}:l?f.audio={container:"audio/mp4",codec:s,encrypted:l.encrypted,initSegment:t,id:"audio"}:u?f.video={container:"video/mp4",codec:o,supplemental:u.supplemental,encrypted:u.encrypted,initSegment:t,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=f}remux(t,i,s,o,l,u){var f,y;let{initPTS:v,lastEndTime:x}=this;const w={audio:void 0,video:void 0,text:o,id3:s,initSegment:void 0};U(x)||(x=this.lastEndTime=l||0);const k=i.samples;if(!k.length)return w;const F={initPTS:void 0,timescale:void 0,trackId:void 0};let $=this.initData;if((f=$)!=null&&f.length||(this.generateInitSegment(k),$=this.initData),!((y=$)!=null&&y.length))return this.warn("Failed to generate initSegment."),w;this.emitInitSegment&&(F.tracks=this.initTracks,this.emitInitSegment=!1);const Q=Bt(k,$,this),te=$.audio?Q[$.audio.id]:null,xe=$.video?Q[$.video.id]:null,ke=wo(xe,1/0),Le=wo(te,1/0),Ze=wo(xe,0,!0),rt=wo(te,0,!0);let Lt=l,ot=0;const St=te&&(!xe||!v&&Le<ke||v&&v.trackId===$.audio.id),xt=St?te:xe;if(xt){const Gr=xt.timescale,li=xt.start-l*Gr,Li=St?$.audio.id:$.video.id;Lt=xt.start/Gr,ot=St?rt-Le:Ze-ke,(u||!v)&&(yl(v,Lt,l,ot)||Gr!==v.timescale)&&(v&&this.warn(`Timestamps at playlist time: ${u?"":"~"}${l} ${li/Gr} != initPTS: ${v.baseTime/v.timescale} (${v.baseTime}/${v.timescale}) trackId: ${v.trackId}`),this.log(`Found initPTS at playlist time: ${l} offset: ${Lt-l} (${li}/${Gr}) trackId: ${Li}`),v=null,F.initPTS=li,F.timescale=Gr,F.trackId=Li)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${l}`);v?(F.initPTS=v.baseTime,F.timescale=v.timescale,F.trackId=v.trackId):((!F.timescale||F.trackId===void 0||F.initPTS===void 0)&&(this.warn("Could not set initPTS"),F.initPTS=Lt,F.timescale=1,F.trackId=-1),this.initPTS=v={baseTime:F.initPTS,timescale:F.timescale,trackId:F.trackId});const ht=Lt-v.baseTime/v.timescale,jt=ht+ot;ot>0?this.lastEndTime=jt:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Br=!!$.audio,ei=!!$.video;let vi="";Br&&(vi+="audio"),ei&&(vi+="video");const Xr=($.audio?$.audio.encrypted:!1)||($.video?$.video.encrypted:!1),Cr={data1:k,startPTS:ht,startDTS:ht,endPTS:jt,endDTS:jt,type:vi,hasAudio:Br,hasVideo:ei,nb:1,dropped:0,encrypted:Xr};w.audio=Br&&!ei?Cr:void 0,w.video=ei?Cr:void 0;const ii=xe==null?void 0:xe.sampleCount;if(ii){const Gr=xe.keyFrameIndex,li=Gr!==-1;Cr.nb=ii,Cr.dropped=Gr===0||this.isVideoContiguous?0:li?Gr:ii,Cr.independent=li,Cr.firstKeyFrame=Gr,li&&xe.keyFrameStart&&(Cr.firstKeyFramePTS=(xe.keyFrameStart-v.baseTime)/v.timescale),this.isVideoContiguous||(w.independent=li),this.isVideoContiguous||(this.isVideoContiguous=li),Cr.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${Gr}/${ii} dropped: ${Cr.dropped} start: ${Cr.firstKeyFramePTS||"NA"}`)}return w.initSegment=F,w.id3=Sa(s,l,v,v),o.samples.length&&(w.text=Ql(o,l,v)),w}}function wo(h,t,i=!1){return(h==null?void 0:h.start)!==void 0?(h.start+(i?h.duration:0))/h.timescale:t}function yl(h,t,i,s){if(h===null)return!0;const o=Math.max(s,1),l=t-h.baseTime/h.timescale;return Math.abs(l-i)>o}function bl(h,t,i){const s=h.codec;return s&&s.length>4?s:t===se.AUDIO?s==="ec-3"||s==="ac-3"||s==="alac"?s:s==="fLaC"||s==="Opus"?Ae(s,!1):(i.warn(`Unhandled audio codec "${s}" in mp4 MAP`),s||"mp4a"):(i.warn(`Unhandled video codec "${s}" in mp4 MAP`),s||"avc1")}let Ha;try{Ha=self.performance.now.bind(self.performance)}catch(h){Ha=Date.now}const tu=[{demux:Je,remux:eu},{demux:ki,remux:Ua},{demux:S,remux:Ua},{demux:_e,remux:Ua}];tu.splice(2,0,{demux:W,remux:Ua});class gc{constructor(t,i,s,o,l,u){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=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=t,this.typeSupported=i,this.config=s,this.id=l,this.logger=u}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(t,i,s,o){const l=s.transmuxing;l.executeStart=Ha();let u=new Uint8Array(t);const{currentTransmuxState:f,transmuxConfig:y}=this;o&&(this.currentTransmuxState=o);const{contiguous:v,discontinuity:x,trackSwitch:w,accurateTimeOffset:k,timeOffset:F,initSegmentChange:$}=o||f,{audioCodec:Q,videoCodec:te,defaultInitPts:xe,duration:ke,initSegmentData:Le}=y,Ze=gd(u,i);if(Ze&&Zn(Ze.method)){const St=this.getDecrypter(),xt=ia(Ze.method);if(St.isSync()){let ht=St.softwareDecrypt(u,Ze.key.buffer,Ze.iv.buffer,xt);if(s.part>-1){const Br=St.flush();ht=Br&&Br.buffer}if(!ht)return l.executeEnd=Ha(),vc(s);u=new Uint8Array(ht)}else return this.asyncResult=!0,this.decryptionPromise=St.webCryptoDecrypt(u,Ze.key.buffer,Ze.iv.buffer,xt).then(ht=>{const jt=this.push(ht,null,s);return this.decryptionPromise=null,jt}),this.decryptionPromise}const rt=this.needsProbing(x,w);if(rt){const St=this.configureTransmuxer(u);if(St)return this.logger.warn(`[transmuxer] ${St.message}`),this.observer.emit(E.ERROR,E.ERROR,{type:Me.MEDIA_ERROR,details:ae.FRAG_PARSING_ERROR,fatal:!1,error:St,reason:St.message}),l.executeEnd=Ha(),vc(s)}(x||w||$||rt)&&this.resetInitSegment(Le,Q,te,ke,i),(x||$||rt)&&this.resetInitialTimestamp(xe),v||this.resetContiguity();const Lt=this.transmux(u,Ze,F,k,s);this.asyncResult=Fu(Lt);const ot=this.currentTransmuxState;return ot.contiguous=!0,ot.discontinuity=!1,ot.trackSwitch=!1,l.executeEnd=Ha(),Lt}flush(t){const i=t.transmuxing;i.executeStart=Ha();const{decrypter:s,currentTransmuxState:o,decryptionPromise:l}=this;if(l)return this.asyncResult=!0,l.then(()=>this.flush(t));const u=[],{timeOffset:f}=o;if(s){const w=s.flush();w&&u.push(this.push(w.buffer,null,t))}const{demuxer:y,remuxer:v}=this;if(!y||!v){i.executeEnd=Ha();const w=[vc(t)];return this.asyncResult?Promise.resolve(w):w}const x=y.flush(f);return Fu(x)?(this.asyncResult=!0,x.then(w=>(this.flushRemux(u,w,t),u))):(this.flushRemux(u,x,t),this.asyncResult?Promise.resolve(u):u)}flushRemux(t,i,s){const{audioTrack:o,videoTrack:l,id3Track:u,textTrack:f}=i,{accurateTimeOffset:y,timeOffset:v}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${s.sn}${s.part>-1?" part: "+s.part:""} of ${this.id===z.MAIN?"level":"track"} ${s.level}`);const x=this.remuxer.remux(o,l,u,f,v,y,!0,this.id);t.push({remuxResult:x,chunkMeta:s}),s.transmuxing.executeEnd=Ha()}resetInitialTimestamp(t){const{demuxer:i,remuxer:s}=this;!i||!s||(i.resetTimeStamp(t),s.resetTimeStamp(t))}resetContiguity(){const{demuxer:t,remuxer:i}=this;!t||!i||(t.resetContiguity(),i.resetNextTimestamp())}resetInitSegment(t,i,s,o,l){const{demuxer:u,remuxer:f}=this;!u||!f||(u.resetInitSegment(t,i,s,o),f.resetInitSegment(t,i,s,l))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(t,i,s,o,l){let u;return i&&i.method==="SAMPLE-AES"?u=this.transmuxSampleAes(t,i,s,o,l):u=this.transmuxUnencrypted(t,s,o,l),u}transmuxUnencrypted(t,i,s,o){const{audioTrack:l,videoTrack:u,id3Track:f,textTrack:y}=this.demuxer.demux(t,i,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(l,u,f,y,i,s,!1,this.id),chunkMeta:o}}transmuxSampleAes(t,i,s,o,l){return this.demuxer.demuxSampleAes(t,i,s).then(u=>({remuxResult:this.remuxer.remux(u.audioTrack,u.videoTrack,u.id3Track,u.textTrack,s,o,!1,this.id),chunkMeta:l}))}configureTransmuxer(t){const{config:i,observer:s,typeSupported:o}=this;let l;for(let w=0,k=tu.length;w<k;w++){var u;if((u=tu[w].demux)!=null&&u.probe(t,this.logger)){l=tu[w];break}}if(!l)return new Error("Failed to find demuxer by probing fragment data");const f=this.demuxer,y=this.remuxer,v=l.remux,x=l.demux;(!y||!(y instanceof v))&&(this.remuxer=new v(s,i,o,this.logger)),(!f||!(f instanceof x))&&(this.demuxer=new x(s,i,o,this.logger),this.probe=x.probe)}needsProbing(t,i){return!this.demuxer||!this.remuxer||t||i}getDecrypter(){let t=this.decrypter;return t||(t=this.decrypter=new Fi(this.config)),t}}function gd(h,t){let i=null;return h.byteLength>0&&(t==null?void 0:t.key)!=null&&t.iv!==null&&t.method!=null&&(i=t),i}const vc=h=>({remuxResult:{},chunkMeta:h});function Fu(h){return"then"in h&&h.then instanceof Function}class k0{constructor(t,i,s,o,l){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=i,this.initSegmentData=s,this.duration=o,this.defaultInitPts=l||null}}class vd{constructor(t,i,s,o,l,u){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=t,this.contiguous=i,this.accurateTimeOffset=s,this.trackSwitch=o,this.timeOffset=l,this.initSegmentChange=u}}let Nu=0;class yc{constructor(t,i,s,o){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Nu++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=y=>{const v=y.data,x=this.hls;if(!(!x||!(v!=null&&v.event)||v.instanceNo!==this.instanceNo))switch(v.event){case"init":{var w;const k=(w=this.workerContext)==null?void 0:w.objectURL;k&&self.URL.revokeObjectURL(k);break}case"transmuxComplete":{this.handleTransmuxComplete(v.data);break}case"flush":{this.onFlush(v.data);break}case"workerLog":{x.logger[v.data.logType]&&x.logger[v.data.logType](v.data.message);break}default:{v.data=v.data||{},v.data.frag=this.frag,v.data.part=this.part,v.data.id=this.id,x.trigger(v.event,v.data);break}}},this.onWorkerError=y=>{if(!this.hls)return;const v=new Error(`${y.message} (${y.filename}:${y.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:ae.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:v})};const l=t.config;this.hls=t,this.id=i,this.useWorker=!!l.enableWorker,this.onTransmuxComplete=s,this.onFlush=o;const u=(y,v)=>{v=v||{},v.frag=this.frag||void 0,y===E.ERROR&&(v=v,v.parent=this.id,v.part=this.part,this.error=v.error),this.hls.trigger(y,v)};this.observer=new ul,this.observer.on(E.FRAG_DECRYPTED,u),this.observer.on(E.ERROR,u);const f=zr(l.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const y=this.hls.logger;if(l.workerPath||wu()){try{l.workerPath?(y.log(`loading Web Worker ${l.workerPath} for "${i}"`),this.workerContext=Su(l.workerPath)):(y.log(`injecting Web Worker for "${i}"`),this.workerContext=_0());const{worker:x}=this.workerContext;x.addEventListener("message",this.onWorkerMessage),x.addEventListener("error",this.onWorkerError),x.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:f,id:i,config:tt(l)})}catch(x){y.warn(`Error setting up "${i}" Web Worker, fallback to inline`,x),this.terminateWorker(),this.error=null,this.transmuxer=new gc(this.observer,f,l,"",i,t.logger)}return}}this.transmuxer=new gc(this.observer,f,l,"",i,t.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const t=this.instanceNo;this.instanceNo=Nu++;const i=this.hls.config,s=zr(i.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:t,typeSupported:s,id:this.id,config:tt(i)})}}terminateWorker(){if(this.workerContext){const{worker:t}=this.workerContext;this.workerContext=null,t.removeEventListener("message",this.onWorkerMessage),t.removeEventListener("error",this.onWorkerError),Gl(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}const t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(t,i,s,o,l,u,f,y,v,x){var w,k;v.transmuxing.start=self.performance.now();const{instanceNo:F,transmuxer:$}=this,Q=u?u.start:l.start,te=l.decryptdata,xe=this.frag,ke=!(xe&&l.cc===xe.cc),Le=!(xe&&v.level===xe.level),Ze=xe?v.sn-xe.sn:-1,rt=this.part?v.part-this.part.index:-1,Lt=Ze===0&&v.id>1&&v.id===(xe==null?void 0:xe.stats.chunkCount),ot=!Le&&(Ze===1||Ze===0&&(rt===1||Lt&&rt<=0)),St=self.performance.now();(Le||Ze||l.stats.parsing.start===0)&&(l.stats.parsing.start=St),u&&(rt||!ot)&&(u.stats.parsing.start=St);const xt=!(xe&&((w=l.initSegment)==null?void 0:w.url)===((k=xe.initSegment)==null?void 0:k.url)),ht=new vd(ke,ot,y,Le,Q,xt);if(!ot||ke||xt){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${l.type} sn: ${v.sn}${v.part>-1?" part: "+v.part:""} ${this.id===z.MAIN?"level":"track"}: ${v.level} id: ${v.id}
discontinuity: ${ke}
trackSwitch: ${Le}
contiguous: ${ot}
accurateTimeOffset: ${y}
timeOffset: ${Q}
initSegmentChange: ${xt}`);const jt=new k0(s,o,i,f,x);this.configureTransmuxer(jt)}if(this.frag=l,this.part=u,this.workerContext)this.workerContext.worker.postMessage({instanceNo:F,cmd:"demux",data:t,decryptdata:te,chunkMeta:v,state:ht},t instanceof ArrayBuffer?[t]:[]);else if($){const jt=$.push(t,te,v,ht);Fu(jt)?jt.then(Br=>{this.handleTransmuxComplete(Br)}).catch(Br=>{this.transmuxerError(Br,v,"transmuxer-interface push error")}):this.handleTransmuxComplete(jt)}}flush(t){t.transmuxing.start=self.performance.now();const{instanceNo:i,transmuxer:s}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:i,cmd:"flush",chunkMeta:t});else if(s){const o=s.flush(t);Fu(o)?o.then(l=>{this.handleFlushResult(l,t)}).catch(l=>{this.transmuxerError(l,t,"transmuxer-interface flush error")}):this.handleFlushResult(o,t)}}transmuxerError(t,i,s){this.hls&&(this.error=t,this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.FRAG_PARSING_ERROR,chunkMeta:i,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:t,err:t,reason:s}))}handleFlushResult(t,i){t.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(i)}configureTransmuxer(t){const{instanceNo:i,transmuxer:s}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:i,cmd:"configure",config:t}):s&&s.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}const bc=100;class yd extends Oo{constructor(t,i,s){super(t,i,s,"audio-stream-controller",z.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!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.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(E.BUFFER_RESET,this.onBufferReset,this),t.on(E.BUFFER_CREATED,this.onBufferCreated,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(E.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(E.FRAG_LOADING,this.onFragLoading,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:t}=this;t&&(super.unregisterListeners(),t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(E.BUFFER_RESET,this.onBufferReset,this),t.off(E.BUFFER_CREATED,this.onBufferCreated,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(E.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(E.FRAG_LOADING,this.onFragLoading,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(t,{frag:i,id:s,initPTS:o,timescale:l,trackId:u}){if(s===z.MAIN){const f=i.cc,y=this.fragCurrent;if(this.initPTS[f]={baseTime:o,timescale:l,trackId:u},this.log(`InitPTS for cc: ${f} found from main: ${o/l} (${o}/${l}) trackId: ${u}`),this.mainAnchor=i,this.state===Vt.WAITING_INIT_PTS){const v=this.waitingData;(!v&&!this.loadingParts||v&&v.frag.cc!==f)&&this.syncWithAnchor(i,v==null?void 0:v.frag)}else!this.hls.hasEnoughToStart&&y&&y.cc!==f?(y.abortRequests(),this.syncWithAnchor(i,y)):this.state===Vt.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(t,i){var s;const o=((s=this.mainFragLoading)==null?void 0:s.frag)||null;if(i&&(o==null?void 0:o.cc)===i.cc)return;const l=(o||t).cc,u=this.getLevelDetails(),f=this.getLoadPosition(),y=Ur(u,l,f);y&&(this.log(`Syncing with main frag at ${y.start} cc ${y.cc}`),this.startFragRequested=!1,this.nextLoadPosition=y.start,this.resetLoadingState(),this.state===Vt.IDLE&&this.doTickIdle())}startLoad(t,i){if(!this.levels){this.startPosition=t,this.state=Vt.STOPPED;return}const s=this.lastCurrentTime;this.stopLoad(),this.setInterval(bc),s>0&&t===-1?(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),t=s,this.state=Vt.IDLE):this.state=Vt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=i?-1:t,this.tick()}doTick(){switch(this.state){case Vt.IDLE:this.doTickIdle();break;case Vt.WAITING_TRACK:{const{levels:t,trackId:i}=this,s=t==null?void 0:t[i],o=s==null?void 0:s.details;if(o&&!this.waitForLive(s)){if(this.waitForCdnTuneIn(o))break;this.state=Vt.WAITING_INIT_PTS}break}case Vt.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case Vt.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:i,part:s,cache:o,complete:l}=t,u=this.mainAnchor;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.state=Vt.FRAG_LOADING;const f=o.flush().buffer,y={frag:i,part:s,payload:f,networkDetails:null};this._handleFragmentLoadProgress(y),l&&super._handleFragmentLoadComplete(y)}else u&&u.cc!==t.frag.cc&&this.syncWithAnchor(u,t.frag)}else this.state=Vt.IDLE}}this.onTickEnd()}resetLoadingState(){const t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:t}=this;t!=null&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){var t;const{hls:i,levels:s,media:o,trackId:l}=this,u=i.config;if(!this.buffering||!o&&!this.primaryPrefetch&&(this.startFragRequested||!u.startFragPrefetch)||!(s!=null&&s[l]))return;const f=s[l],y=f.details;if(!y||this.waitForLive(f)||this.waitForCdnTuneIn(y)){this.state=Vt.WAITING_TRACK,this.startFragRequested=!1;return}const v=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&v&&(this.bufferFlushed=!1,this.afterBufferFlushed(v,se.AUDIO,z.AUDIO));const x=this.getFwdBufferInfo(v,z.AUDIO);if(x===null)return;if(!this.switchingTrack&&this._streamEnded(x,y)){i.trigger(E.BUFFER_EOS,{type:"audio"}),this.state=Vt.ENDED;return}const w=x.len,k=i.maxBufferLength,F=y.fragments,$=F[0].start,Q=this.getLoadPosition(),te=this.flushing?Q:x.end;if(this.switchingTrack&&o){const Le=Q;y.PTSKnown&&Le<$&&(x.end>$||x.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=$+.05)}if(w>=k&&!this.switchingTrack&&te<F[F.length-1].start)return;let xe=this.getNextFragment(te,y);if(xe&&this.isLoopLoading(xe,te)&&(xe=this.getNextFragmentLoopLoading(xe,y,x,z.MAIN,k)),!xe){this.bufferFlushed=!0;return}let ke=((t=this.mainFragLoading)==null?void 0:t.frag)||null;if(!this.audioOnly&&this.startFragRequested&&ke&&at(xe)&&!xe.endList&&(!y.live||!this.loadingParts&&te<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(ke)===Bi.OK&&(this.mainFragLoading=ke=null),ke&&at(ke))){if(xe.start>ke.end){const Ze=this.fragmentTracker.getFragAtPos(te,z.MAIN);Ze&&Ze.end>ke.end&&(ke=Ze,this.mainFragLoading={frag:Ze,targetBufferTime:null})}if(xe.start>ke.end)return}this.loadFragment(xe,f,te)}onMediaDetaching(t,i){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(t,i)}onAudioTracksUpdated(t,{audioTracks:i}){this.resetTransmuxer(),this.levels=i.map(s=>new Mi(s))}onAudioTrackSwitching(t,i){const s=!!i.url;this.trackId=i.id;const{fragCurrent:o}=this;o&&(o.abortRequests(),this.removeUnbufferedFrags(o.start)),this.resetLoadingState(),s?(this.switchingTrack=i,this.flushAudioIfNeeded(i),this.state!==Vt.STOPPED&&(this.setInterval(bc),this.state=Vt.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=i,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(t,i){this.mainDetails=i.details;const s=this.cachedTrackLoadedData;s&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(E.AUDIO_TRACK_LOADED,s))}onAudioTrackLoaded(t,i){var s;const{levels:o}=this,{details:l,id:u,groupId:f,track:y}=i;if(!o){this.warn(`Audio tracks reset while loading track ${u} "${y.name}" of "${f}"`);return}const v=this.mainDetails;if(!v||l.endCC>v.endCC||v.expired){this.cachedTrackLoadedData=i,this.state!==Vt.STOPPED&&(this.state=Vt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${u} "${y.name}" of "${f}" loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""},duration:${l.totalduration}`);const x=o[u];let w=0;if(l.live||(s=x.details)!=null&&s.live){if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;if(x.details){var k;w=this.alignPlaylists(l,x.details,(k=this.levelLastLoaded)==null?void 0:k.details)}l.alignedSliding||(bo(l,v),l.alignedSliding||_o(l,v),w=l.fragmentStart)}x.details=l,this.levelLastLoaded=x,this.startFragRequested||this.setStartPosition(v,w),this.hls.trigger(E.AUDIO_TRACK_UPDATED,{details:l,id:u,groupId:i.groupId}),this.state===Vt.WAITING_TRACK&&!this.waitForCdnTuneIn(l)&&(this.state=Vt.IDLE),this.tick()}_handleFragmentLoadProgress(t){var i;const s=t.frag,{part:o,payload:l}=t,{config:u,trackId:f,levels:y}=this;if(!y){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 v=y[f];if(!v){this.warn("Audio track is undefined on fragment load progress");return}const x=v.details;if(!x){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const w=u.defaultAudioCodec||v.audioCodec||"mp4a.40.2";let k=this.transmuxer;k||(k=this.transmuxer=new yc(this.hls,z.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const F=this.initPTS[s.cc],$=(i=s.initSegment)==null?void 0:i.data;if(F!==void 0){const te=o?o.index:-1,xe=te!==-1,ke=new rs(s.level,s.sn,s.stats.chunkCount,l.byteLength,te,xe);k.push(l,$,w,"",s,o,x.totalduration,!1,ke,F)}else{this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${x.startSN} ,${x.endSN}],track ${f}`);const{cache:Q}=this.waitingData=this.waitingData||{frag:s,part:o,cache:new Hl,complete:!1};Q.push(new Uint8Array(l)),this.state!==Vt.STOPPED&&(this.state=Vt.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(t){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(t,i){this.bufferFlushed=this.flushing=!1;const s=i.tracks.audio;s&&(this.mediaBuffer=s.buffer||null)}onFragLoading(t,i){!this.audioOnly&&i.frag.type===z.MAIN&&at(i.frag)&&(this.mainFragLoading=i,this.state===Vt.IDLE&&this.tick())}onFragBuffered(t,i){const{frag:s,part:o}=i;if(s.type!==z.AUDIO){!this.audioOnly&&s.type===z.MAIN&&!s.elementaryStreams.video&&!s.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);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(at(s)){this.fragPrevious=s;const l=this.switchingTrack;l&&(this.bufferedTrack=l,this.switchingTrack=null,this.hls.trigger(E.AUDIO_TRACK_SWITCHED,O({},l)))}this.fragBufferedComplete(s,o),this.media&&this.tick()}onError(t,i){var s;if(i.fatal){this.state=Vt.ERROR;return}switch(i.details){case ae.FRAG_GAP:case ae.FRAG_PARSING_ERROR:case ae.FRAG_DECRYPT_ERROR:case ae.FRAG_LOAD_ERROR:case ae.FRAG_LOAD_TIMEOUT:case ae.KEY_LOAD_ERROR:case ae.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(z.AUDIO,i);break;case ae.AUDIO_TRACK_LOAD_ERROR:case ae.AUDIO_TRACK_LOAD_TIMEOUT:case ae.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===Vt.WAITING_TRACK&&((s=i.context)==null?void 0:s.type)===Te.AUDIO_TRACK&&(this.state=Vt.IDLE);break;case ae.BUFFER_ADD_CODEC_ERROR:case ae.BUFFER_APPEND_ERROR:if(i.parent!=="audio")return;this.reduceLengthAndFlushBuffer(i)||this.resetLoadingState();break;case ae.BUFFER_FULL_ERROR:if(i.parent!=="audio")return;this.reduceLengthAndFlushBuffer(i)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case ae.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}onBufferFlushing(t,{type:i}){i!==se.VIDEO&&(this.flushing=!0)}onBufferFlushed(t,{type:i}){if(i!==se.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Vt.ENDED&&(this.state=Vt.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,i,z.AUDIO),this.tick())}}_handleTransmuxComplete(t){var i;const s="audio",{hls:o}=this,{remuxResult:l,chunkMeta:u}=t,f=this.getCurrentContext(u);if(!f){this.resetWhenMissingContext(u);return}const{frag:y,part:v,level:x}=f,{details:w}=x,{audio:k,text:F,id3:$,initSegment:Q}=l;if(this.fragContextChanged(y)||!w){this.fragmentTracker.removeFragment(y);return}if(this.state=Vt.PARSING,this.switchingTrack&&k&&this.completeAudioSwitch(this.switchingTrack),Q!=null&&Q.tracks){const te=y.initSegment||y;if(this.unhandledEncryptionError(Q,y))return;this._bufferInitSegment(x,Q.tracks,te,u),o.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:te,id:s,tracks:Q.tracks})}if(k){const{startPTS:te,endPTS:xe,startDTS:ke,endDTS:Le}=k;v&&(v.elementaryStreams[se.AUDIO]={startPTS:te,endPTS:xe,startDTS:ke,endDTS:Le}),y.setElementaryStreamInfo(se.AUDIO,te,xe,ke,Le),this.bufferFragmentData(k,y,v,u)}if($!=null&&(i=$.samples)!=null&&i.length){const te=M({id:s,frag:y,details:w},$);o.trigger(E.FRAG_PARSING_METADATA,te)}if(F){const te=M({id:s,frag:y,details:w},F);o.trigger(E.FRAG_PARSING_USERDATA,te)}}_bufferInitSegment(t,i,s,o){if(this.state!==Vt.PARSING||(i.video&&delete i.video,i.audiovideo&&delete i.audiovideo,!i.audio))return;const l=i.audio;l.id=z.AUDIO;const u=t.audioCodec;this.log(`Init audio buffer, container:${l.container}, codecs[level/parsed]=[${u}/${l.codec}]`),u&&u.split(",").length===1&&(l.levelCodec=u),this.hls.trigger(E.BUFFER_CODECS,i);const f=l.initSegment;if(f!=null&&f.byteLength){const y={type:"audio",frag:s,part:null,chunkMeta:o,parent:s.type,data:f};this.hls.trigger(E.BUFFER_APPENDING,y)}this.tickImmediate()}loadFragment(t,i,s){const o=this.fragmentTracker.getState(t);if(this.switchingTrack||o===Bi.NOT_LOADED||o===Bi.PARTIAL){var l;if(!at(t))this._loadInitSegment(t,i);else if((l=i.details)!=null&&l.live&&!this.initPTS[t.cc]){this.log(`Waiting for video PTS in continuity counter ${t.cc} of live stream before loading audio fragment ${t.sn} of level ${this.trackId}`),this.state=Vt.WAITING_INIT_PTS;const u=this.mainDetails;u&&u.fragmentStart!==i.details.fragmentStart&&_o(i.details,u)}else super.loadFragment(t,i,s)}else this.clearTrackerIfNeeded(t)}flushAudioIfNeeded(t){if(this.media&&this.bufferedTrack){const{name:i,lang:s,assocLang:o,characteristics:l,audioCodec:u,channels:f}=this.bufferedTrack;Er({name:i,lang:s,assocLang:o,characteristics:l,audioCodec:u,channels:f},t,vr)||(gi(t.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=t)}}completeAudioSwitch(t){const{hls:i}=this;this.flushAudioIfNeeded(t),this.bufferedTrack=t,this.switchingTrack=null,i.trigger(E.AUDIO_TRACK_SWITCHED,O({},t))}}class T0 extends le{constructor(t,i){super(i,t.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=t}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.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,i,s){const o=i==null?void 0:i.renditionReports;if(o){let l=-1;for(let u=0;u<o.length;u++){const f=o[u];let y;try{y=new self.URL(f.URI,i.url).href}catch(v){this.warn(`Could not construct new URL for Rendition Report: ${v}`),y=f.URI||""}if(y===t){l=u;break}else y===t.substring(0,y.length)&&(l=u)}if(l!==-1){const u=o[l],f=parseInt(u["LAST-MSN"])||i.lastPartSn;let y=parseInt(u["LAST-PART"])||i.lastPartIndex;if(this.hls.config.lowLatencyMode){const x=Math.min(i.age-i.partTarget,i.targetduration);y>=0&&x>i.partTarget&&(y+=1)}const v=s&&xi(s);return new Qr(f,y>=0?y:void 0,v)}}}loadPlaylist(t){this.clearTimer()}loadingPlaylist(t,i){this.clearTimer()}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}getUrlWithDirectives(t,i){if(i)try{return i.addDirectives(t)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}return t}playlistLoaded(t,i,s){const{details:o,stats:l}=i,u=self.performance.now(),f=l.loading.first?Math.max(0,u-l.loading.first):0;o.advancedDateTime=Date.now()-f;const y=this.hls.config.timelineOffset;if(y!==o.appliedTimelineOffset){const x=Math.max(y||0,0);o.appliedTimelineOffset=x,o.fragments.forEach(w=>{w.setStart(w.playlistOffset+x)})}if(o.live||s!=null&&s.live){const x="levelInfo"in i?i.levelInfo:i.track;if(o.reloaded(s),s&&o.fragments.length>0){go(s,o,this);const ke=o.playlistParsingError;if(ke){this.warn(ke);const Le=this.hls;if(!Le.config.ignorePlaylistParsingErrors){var v;const{networkDetails:Ze}=i;Le.trigger(E.ERROR,{type:Me.NETWORK_ERROR,details:ae.LEVEL_PARSING_ERROR,fatal:!1,url:o.url,error:ke,reason:ke.message,level:i.level||void 0,parent:(v=o.fragments[0])==null?void 0:v.type,networkDetails:Ze,stats:l});return}o.playlistParsingError=null}}o.requestScheduled===-1&&(o.requestScheduled=l.loading.start);const w=this.hls.mainForwardBufferInfo,k=w?w.end-w.len:0,F=(o.edge-k)*1e3,$=en(o,F);if(o.requestScheduled+$<u?o.requestScheduled=u:o.requestScheduled+=$,this.log(`live playlist ${t} ${o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:o.updated?"UPDATED":"MISSED"}`),!this.canLoad||!o.live)return;let Q,te,xe;if(o.canBlockReload&&o.endSN&&o.advanced){const ke=this.hls.config.lowLatencyMode,Le=o.lastPartSn,Ze=o.endSN,rt=o.lastPartIndex,Lt=rt!==-1,ot=Le===Ze;Lt?ot?(te=Ze+1,xe=ke?0:rt):(te=Le,xe=ke?rt+1:o.maxPartIndex):te=Ze+1;const St=o.age,xt=St+o.ageHeader;let ht=Math.min(xt-o.partTarget,o.targetduration*1.5);if(ht>0){if(xt>o.targetduration*3)this.log(`Playlist last advanced ${St.toFixed(2)}s ago. Omitting segment and part directives.`),te=void 0,xe=void 0;else if(s!=null&&s.tuneInGoal&&xt-o.partTarget>s.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${ht} with playlist age: ${o.age}`),ht=0;else{const jt=Math.floor(ht/o.targetduration);if(te+=jt,xe!==void 0){const Br=Math.round(ht%o.targetduration/o.partTarget);xe+=Br}this.log(`CDN Tune-in age: ${o.ageHeader}s last advanced ${St.toFixed(2)}s goal: ${ht} skip sn ${jt} to part ${xe}`)}o.tuneInGoal=ht}if(Q=this.getDeliveryDirectives(o,i.deliveryDirectives,te,xe),ke||!ot){o.requestScheduled=u,this.loadingPlaylist(x,Q);return}}else(o.canBlockReload||o.canSkipUntil)&&(Q=this.getDeliveryDirectives(o,i.deliveryDirectives,te,xe));Q&&te!==void 0&&o.canBlockReload&&(o.requestScheduled=l.loading.first+Math.max($-f*2,$/2)),this.scheduleLoading(x,Q,o)}else this.clearTimer()}scheduleLoading(t,i,s){const o=s||t.details;if(!o){this.loadingPlaylist(t,i);return}const l=self.performance.now(),u=o.requestScheduled;if(l>=u){this.loadingPlaylist(t,i);return}const f=u-l;this.log(`reload live playlist ${t.name||t.bitrate+"bps"} in ${Math.round(f)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(t,i),f)}getDeliveryDirectives(t,i,s,o){let l=xi(t);return i!=null&&i.skip&&t.deltaUpdateFailed&&(s=i.msn,o=i.part,l=qr.No),new Qr(s,o,l)}checkRetry(t){const i=t.details,s=ri(t),o=t.errorAction,{action:l,retryCount:u=0,retryConfig:f}=o||{},y=!!o&&!!f&&(l===$r.RetryRequest||!o.resolved&&l===$r.SendAlternateToPenaltyBox);if(y){var v;if(u>=f.maxNumRetry)return!1;if(s&&(v=t.context)!=null&&v.deliveryDirectives)this.warn(`Retrying playlist loading ${u+1}/${f.maxNumRetry} after "${i}" without delivery-directives`),this.loadPlaylist();else{const x=hi(f,u);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),x),this.warn(`Retrying playlist loading ${u+1}/${f.maxNumRetry} after "${i}" in ${x}ms`)}t.levelRetry=!0,o.resolved=!0}return y}}function ih(h,t){if(h.length!==t.length)return!1;for(let i=0;i<h.length;i++)if(!$u(h[i].attrs,t[i].attrs))return!1;return!0}function $u(h,t,i){const s=h["STABLE-RENDITION-ID"];return s&&!i?s===t["STABLE-RENDITION-ID"]:!(i||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(o=>h[o]!==t[o])}function ru(h,t){return t.label.toLowerCase()===h.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(h.lang||"").toLowerCase())}class Yi extends T0{constructor(t){super(t,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.LEVEL_LOADING,this.onLevelLoading,this),t.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.LEVEL_LOADING,this.onLevelLoading,this),t.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(E.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(t,i){this.tracks=i.audioTracks||[]}onAudioTrackLoaded(t,i){const{id:s,groupId:o,details:l}=i,u=this.tracksInGroup[s];if(!u||u.groupId!==o){this.warn(`Audio track with id:${s} and group:${o} not found in active group ${u==null?void 0:u.groupId}`);return}const f=u.details;u.details=i.details,this.log(`Audio track ${s} "${u.name}" lang:${u.lang} group:${o} loaded [${l.startSN}-${l.endSN}]`),s===this.trackId&&this.playlistLoaded(s,i,f)}onLevelLoading(t,i){this.switchLevel(i.level)}onLevelSwitching(t,i){this.switchLevel(i.level)}switchLevel(t){const i=this.hls.levels[t];if(!i)return;const s=i.audioGroups||null,o=this.groupIds;let l=this.currentTrack;if(!s||(o==null?void 0:o.length)!==(s==null?void 0:s.length)||s!=null&&s.some(f=>(o==null?void 0:o.indexOf(f))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const f=this.tracks.filter(k=>!s||s.indexOf(k.groupId)!==-1);if(f.length)this.selectDefaultTrack&&!f.some(k=>k.default)&&(this.selectDefaultTrack=!1),f.forEach((k,F)=>{k.id=F});else if(!l&&!this.tracksInGroup.length)return;this.tracksInGroup=f;const y=this.hls.config.audioPreference;if(!l&&y){const k=Jt(y,f,vr);if(k>-1)l=f[k];else{const F=Jt(y,this.tracks);l=this.tracks[F]}}let v=this.findTrackId(l);v===-1&&l&&(v=this.findTrackId(null));const x={audioTracks:f};this.log(`Updating audio tracks, ${f.length} track(s) found in group(s): ${s==null?void 0:s.join(",")}`),this.hls.trigger(E.AUDIO_TRACKS_UPDATED,x);const w=this.trackId;if(v!==-1&&w===-1)this.setAudioTrack(v);else if(f.length&&w===-1){var u;const k=new Error(`No audio track selected for current audio group-ID(s): ${(u=this.groupIds)==null?void 0:u.join(",")} track count: ${f.length}`);this.warn(k.message),this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:k})}}}onError(t,i){i.fatal||!i.context||i.context.type===Te.AUDIO_TRACK&&i.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(i.context.groupId)!==-1)&&this.checkRetry(i)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}setAudioOption(t){const i=this.hls;if(i.config.audioPreference=t,t){const s=this.allAudioTracks;if(this.selectDefaultTrack=!1,s.length){const o=this.currentTrack;if(o&&Er(t,o,vr))return o;const l=Jt(t,this.tracksInGroup,vr);if(l>-1){const u=this.tracksInGroup[l];return this.setAudioTrack(l),u}else if(o){let u=i.loadLevel;u===-1&&(u=i.firstAutoLevel);const f=cr(t,i.levels,s,u,vr);if(f===-1)return null;i.nextLoadLevel=f}if(t.channels||t.audioCodec){const u=Jt(t,s);if(u>-1)return s[u]}}}return null}setAudioTrack(t){const i=this.tracksInGroup;if(t<0||t>=i.length){this.warn(`Invalid audio track id: ${t}`);return}this.selectDefaultTrack=!1;const s=this.currentTrack,o=i[t],l=o.details&&!o.details.live;if(t===this.trackId&&o===s&&l||(this.log(`Switching to audio-track ${t} "${o.name}" lang:${o.lang} group:${o.groupId} channels:${o.channels}`),this.trackId=t,this.currentTrack=o,this.hls.trigger(E.AUDIO_TRACK_SWITCHING,O({},o)),l))return;const u=this.switchParams(o.url,s==null?void 0:s.details,o.details);this.loadPlaylist(u)}findTrackId(t){const i=this.tracksInGroup;for(let s=0;s<i.length;s++){const o=i[s];if(!(this.selectDefaultTrack&&!o.default)&&(!t||Er(t,o,vr)))return s}if(t){const{name:s,lang:o,assocLang:l,characteristics:u,audioCodec:f,channels:y}=t;for(let v=0;v<i.length;v++){const x=i[v];if(Er({name:s,lang:o,assocLang:l,characteristics:u,audioCodec:f,channels:y},x,vr))return v}for(let v=0;v<i.length;v++){const x=i[v];if($u(t.attrs,x.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return v}for(let v=0;v<i.length;v++){const x=i[v];if($u(t.attrs,x.attrs,["LANGUAGE"]))return v}}return-1}loadPlaylist(t){super.loadPlaylist();const i=this.currentTrack;this.shouldLoadPlaylist(i)&&gi(i.url,this.hls)&&this.scheduleLoading(i,t)}loadingPlaylist(t,i){super.loadingPlaylist(t,i);const s=t.id,o=t.groupId,l=this.getUrlWithDirectives(t.url,i),u=t.details,f=u==null?void 0:u.age;this.log(`Loading audio-track ${s} "${t.name}" lang:${t.lang} group:${o}${(i==null?void 0:i.msn)!==void 0?" at sn "+i.msn+" part "+i.part:""}${f&&u.live?" age "+f.toFixed(1)+(u.type?" "+u.type||0:""):""} ${l}`),this.hls.trigger(E.AUDIO_TRACK_LOADING,{url:l,id:s,groupId:o,deliveryDirectives:i||null,track:t})}}class Gn{constructor(t){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=t}destroy(){this.tracks=this.queues=null}append(t,i,s){if(this.queues===null||this.tracks===null)return;const o=this.queues[i];o.push(t),o.length===1&&!s&&this.executeNext(i)}appendBlocker(t){return new Promise(i=>{const s={label:"async-blocker",execute:i,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(s,t)})}prependBlocker(t){return new Promise(i=>{if(this.queues){const s={label:"async-blocker-prepend",execute:i,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[t].unshift(s)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(t=>{var i;const s=(i=t[0])==null?void 0:i.label;(s==="async-blocker"||s==="async-blocker-prepend")&&(t[0].execute(),t.splice(0,1))})}unblockAudio(t){if(this.queues===null)return;this.queues.audio[0]===t&&this.shiftAndExecuteNext("audio")}executeNext(t){if(this.queues===null||this.tracks===null)return;const i=this.queues[t];if(i.length){const o=i[0];try{o.execute()}catch(l){var s;if(o.onError(l),this.queues===null||this.tracks===null)return;const u=(s=this.tracks[t])==null?void 0:s.buffer;u!=null&&u.updating||this.shiftAndExecuteNext(t)}}}shiftAndExecuteNext(t){this.queues!==null&&(this.queues[t].shift(),this.executeNext(t))}current(t){var i;return((i=this.queues)==null?void 0:i[t][0])||null}toString(){const{queues:t,tracks:i}=this;return t===null||i===null?"<destroyed>":`
${this.list("video")}
${this.list("audio")}
${this.list("audiovideo")}}`}list(t){var i,s;return(i=this.queues)!=null&&i[t]||(s=this.tracks)!=null&&s[t]?`${t}: (${this.listSbInfo(t)}) ${this.listOps(t)}`:""}listSbInfo(t){var i;const s=(i=this.tracks)==null?void 0:i[t],o=s==null?void 0:s.buffer;return o?`SourceBuffer${o.updating?" updating":""}${s.ended?" ended":""}${s.ending?" ending":""}`:"none"}listOps(t){var i;return((i=this.queues)==null?void 0:i[t].map(s=>s.label).join(", "))||""}}const Uo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,_c="HlsJsTrackRemovedError";class Ea extends Error{constructor(t){super(t),this.name=_c}}class nh extends le{constructor(t,i){super("buffer-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=s=>{var o;this.hls&&((o=this.mediaSource)==null?void 0:o.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=s=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=s=>{const{media:o,mediaSource:l}=this;s&&this.log("Media source opened"),!(!o||!l)&&(l.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(E.MEDIA_ATTACHED,{media:o,mediaSource:l}),this.mediaSource!==null&&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&&this.error(`Media element src was set while attaching MediaSource (${o} > ${s})`)},this.hls=t,this.fragmentTracker=i,this.appendSource=lt(Ye(t.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:t}=this;t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.BUFFER_RESET,this.onBufferReset,this),t.on(E.BUFFER_APPENDING,this.onBufferAppending,this),t.on(E.BUFFER_CODECS,this.onBufferCodecs,this),t.on(E.BUFFER_EOS,this.onBufferEos,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(E.FRAG_PARSED,this.onFragParsed,this),t.on(E.FRAG_CHANGED,this.onFragChanged,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.BUFFER_RESET,this.onBufferReset,this),t.off(E.BUFFER_APPENDING,this.onBufferAppending,this),t.off(E.BUFFER_CODECS,this.onBufferCodecs,this),t.off(E.BUFFER_EOS,this.onBufferEos,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(E.FRAG_PARSED,this.onFragParsed,this),t.off(E.FRAG_CHANGED,this.onFragChanged,this),t.off(E.ERROR,this.onError,this)}transferMedia(){const{media:t,mediaSource:i}=this;if(!t)return null;const s={};if(this.operationQueue){const l=this.isUpdating();l||this.operationQueue.removeBlockers();const u=this.isQueued();(l||u)&&this.warn(`Transfering MediaSource with${u?" operations in queue":""}${l?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const o=this.transferData;return!this.sourceBufferCount&&o&&o.mediaSource===i?M(s,o.tracks):this.sourceBuffers.forEach(l=>{const[u]=l;u&&(s[u]=M({},this.tracks[u]),this.removeBuffer(u)),l[0]=l[1]=null}),{media:t,mediaSource:i,tracks:s}}initTracks(){const t={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=t,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,i){var s;let o=2;(i.audio&&!i.video||!i.altAudio)&&(o=1),this.bufferCodecEventsTotal=o,this.log(`${o} bufferCodec event(s) expected.`),(s=this.transferData)!=null&&s.mediaSource&&this.sourceBufferCount&&o&&this.bufferCreated()}onMediaAttaching(t,i){const s=this.media=i.media;this.transferData=this.overrides=void 0;const o=Ye(this.appendSource);if(o){const l=!!i.mediaSource;(l||i.overrides)&&(this.transferData=i,this.overrides=i.overrides);const u=this.mediaSource=i.mediaSource||new o;if(this.assignMediaSource(u),l)this._objectUrl=s.src,this.attachTransferred();else{const f=this._objectUrl=self.URL.createObjectURL(u);if(this.appendSource)try{s.removeAttribute("src");const y=self.ManagedMediaSource;s.disableRemotePlayback=s.disableRemotePlayback||y&&u instanceof y,So(s),sh(s,f),s.load()}catch(y){s.src=f}else s.src=f}s.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(t){var i,s;this.log(`${((i=this.transferData)==null?void 0:i.mediaSource)===t?"transferred":"created"} media source: ${(s=t.constructor)==null?void 0:s.name}`),t.addEventListener("sourceopen",this._onMediaSourceOpen),t.addEventListener("sourceended",this._onMediaSourceEnded),t.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.addEventListener("startstreaming",this._onStartStreaming),t.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const t=this.media,i=this.transferData;if(!i||!t)return;const s=this.tracks,o=i.tracks,l=o?Object.keys(o):null,u=l?l.length:0,f=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(o&&l&&u){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
required tracks: ${tt(s,(y,v)=>y==="initSegment"?void 0:v)};
transfer tracks: ${tt(o,(y,v)=>y==="initSegment"?void 0:v)}}`),!Xe(o,s)){i.mediaSource=null,i.tracks=void 0;const y=t.currentTime,v=this.details,x=Math.max(y,(v==null?void 0:v.fragments[0].start)||0);if(x-y>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${y} -> ${x}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(o)}"->"${Object.keys(s)}") start time: ${x} currentTime: ${y}`),this.onMediaDetaching(E.MEDIA_DETACHING,{}),this.onMediaAttaching(E.MEDIA_ATTACHING,i),t.currentTime=x;return}this.transferData=void 0,l.forEach(y=>{const v=y,x=o[v];if(x){const w=x.buffer;if(w){const k=this.fragmentTracker,F=x.id;if(k.hasFragments(F)||k.hasParts(F)){const te=di.getBuffered(w);k.detectEvictedFragments(v,te,F,null,!0)}const $=xc(v),Q=[v,w];this.sourceBuffers[$]=Q,w.updating&&this.operationQueue&&this.operationQueue.prependBlocker(v),this.trackSourceBuffer(v,x)}}}),f(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),f()}get mediaSourceOpenOrEnded(){var t;const i=(t=this.mediaSource)==null?void 0:t.readyState;return i==="open"||i==="ended"}onMediaDetaching(t,i){const s=!!i.transferMedia;this.transferData=this.overrides=void 0;const{media:o,mediaSource:l,_objectUrl:u}=this;if(l){if(this.log(`media source ${s?"transferring":"detaching"}`),s)this.sourceBuffers.forEach(([f])=>{f&&this.removeBuffer(f)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const f=l.readyState==="open";try{const y=l.sourceBuffers;for(let v=y.length;v--;)f&&y[v].abort(),l.removeSourceBuffer(y[v]);f&&l.endOfStream()}catch(y){this.warn(`onMediaDetaching: ${y.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(l.removeEventListener("startstreaming",this._onStartStreaming),l.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}o&&(o.removeEventListener("emptied",this._onMediaEmptied),s||(u&&self.URL.revokeObjectURL(u),this.mediaSrc===u?(o.removeAttribute("src"),this.appendSource&&So(o),o.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(E.MEDIA_DETACHED,i)}onBufferReset(){this.sourceBuffers.forEach(([t])=>{t&&this.resetBuffer(t)}),this.initTracks()}resetBuffer(t){var i;const s=(i=this.tracks[t])==null?void 0:i.buffer;if(this.removeBuffer(t),s)try{var o;(o=this.mediaSource)!=null&&o.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(s)}catch(l){this.warn(`onBufferReset ${t}`,l)}delete this.tracks[t]}removeBuffer(t){this.removeBufferListeners(t),this.sourceBuffers[xc(t)]=[null,null];const i=this.tracks[t];i&&(i.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Gn(this.tracks)}onBufferCodecs(t,i){var s;const o=this.tracks,l=Object.keys(i);this.log(`BUFFER_CODECS: "${l}" (current SB count ${this.sourceBufferCount})`);const u="audiovideo"in i&&(o.audio||o.video)||o.audiovideo&&("audio"in i||"video"in i),f=!u&&this.sourceBufferCount&&this.media&&l.some(y=>!o[y]);if(u||f){this.warn(`Unsupported transition between "${Object.keys(o)}" and "${l}" SourceBuffers`);return}l.forEach(y=>{var v,x;const w=i[y],{id:k,codec:F,levelCodec:$,container:Q,metadata:te,supplemental:xe}=w;let ke=o[y];const Le=(v=this.transferData)==null||(v=v.tracks)==null?void 0:v[y],Ze=Le!=null&&Le.buffer?Le:ke,rt=(Ze==null?void 0:Ze.pendingCodec)||(Ze==null?void 0:Ze.codec),Lt=Ze==null?void 0:Ze.levelCodec;ke||(ke=o[y]={buffer:void 0,listeners:[],codec:F,supplemental:xe,container:Q,levelCodec:$,metadata:te,id:k});const ot=Sr(rt,Lt),St=ot==null?void 0:ot.replace(Uo,"$1");let xt=Sr(F,$);const ht=(x=xt)==null?void 0:x.replace(Uo,"$1");xt&&ot&&St!==ht&&(y.slice(0,5)==="audio"&&(xt=Ae(xt,this.appendSource)),this.log(`switching codec ${rt} to ${xt}`),xt!==(ke.pendingCodec||ke.codec)&&(ke.pendingCodec=xt),ke.container=Q,this.appendChangeType(y,Q,xt))}),(this.tracksReady||this.sourceBufferCount)&&(i.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!i.video&&((s=i.audio)==null?void 0:s.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((t,i)=>{const s=this.tracks[i];return t[i]={id:s.id,container:s.container,codec:s.codec,levelCodec:s.levelCodec},t},{})}appendChangeType(t,i,s){const o=`${i};codecs=${s}`,l={label:`change-type=${o}`,execute:()=>{const u=this.tracks[t];if(u){const f=u.buffer;f!=null&&f.changeType&&(this.log(`changing ${t} sourceBuffer type to ${o}`),f.changeType(o),u.codec=s,u.container=i)}this.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:u=>{this.warn(`Failed to change ${t} SourceBuffer type`,u)}};this.append(l,t,this.isPending(this.tracks[t]))}blockAudio(t){var i;const s=t.start,o=s+t.duration*.05;if(((i=this.fragmentTracker.getAppendedFrag(s,z.MAIN))==null?void 0:i.gap)===!0)return;const u={label:"block-audio",execute:()=>{var f;const y=this.tracks.video;(this.lastVideoAppendEnd>o||y!=null&&y.buffer&&di.isBuffered(y.buffer,o)||((f=this.fragmentTracker.getAppendedFrag(o,z.MAIN))==null?void 0:f.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:f=>{this.warn("Error executing block-audio operation",f)}};this.blockedAudioAppend={op:u,frag:t},this.append(u,"audio",!0)}unblockAudio(){const{blockedAudioAppend:t,operationQueue:i}=this;t&&i&&(this.blockedAudioAppend=null,i.unblockAudio(t.op))}onBufferAppending(t,i){const{tracks:s}=this,{data:o,type:l,parent:u,frag:f,part:y,chunkMeta:v,offset:x}=i,w=v.buffering[l],{sn:k,cc:F}=f,$=self.performance.now();w.start=$;const Q=f.stats.buffering,te=y?y.stats.buffering:null;Q.start===0&&(Q.start=$),te&&te.start===0&&(te.start=$);const xe=s.audio;let ke=!1;l==="audio"&&(xe==null?void 0:xe.container)==="audio/mpeg"&&(ke=!this.lastMpegAudioChunk||v.id===1||this.lastMpegAudioChunk.sn!==v.sn,this.lastMpegAudioChunk=v);const Le=s.video,Ze=Le==null?void 0:Le.buffer;if(Ze&&k!=="initSegment"){const ot=y||f,St=this.blockedAudioAppend;if(l==="audio"&&u!=="main"&&!this.blockedAudioAppend&&!(Le.ending||Le.ended)){const ht=ot.start+ot.duration*.05,jt=Ze.buffered,Br=this.currentOp("video");!jt.length&&!Br?this.blockAudio(ot):!Br&&!di.isBuffered(Ze,ht)&&this.lastVideoAppendEnd<ht&&this.blockAudio(ot)}else if(l==="video"){const xt=ot.end;if(St){const ht=St.frag.start;(xt>ht||xt<this.lastVideoAppendEnd||di.isBuffered(Ze,ht))&&this.unblockAudio()}this.lastVideoAppendEnd=xt}}const rt=(y||f).start,Lt={label:`append-${l}`,execute:()=>{var ot;w.executeStart=self.performance.now();const St=(ot=this.tracks[l])==null?void 0:ot.buffer;St&&(ke?this.updateTimestampOffset(St,rt,.1,l,k,F):x!==void 0&&U(x)&&this.updateTimestampOffset(St,x,1e-6,l,k,F)),this.appendExecutor(o,l)},onStart:()=>{},onComplete:()=>{const ot=self.performance.now();w.executeEnd=w.end=ot,Q.first===0&&(Q.first=ot),te&&te.first===0&&(te.first=ot);const St={};this.sourceBuffers.forEach(([xt,ht])=>{xt&&(St[xt]=di.getBuffered(ht))}),this.appendErrors[l]=0,l==="audio"||l==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(E.BUFFER_APPENDED,{type:l,frag:f,part:y,chunkMeta:v,parent:f.type,timeRanges:St})},onError:ot=>{var St;const xt={type:Me.MEDIA_ERROR,parent:f.type,details:ae.BUFFER_APPEND_ERROR,sourceBufferName:l,frag:f,part:y,chunkMeta:v,error:ot,err:ot,fatal:!1},ht=(St=this.media)==null?void 0:St.error;if(ot.code===DOMException.QUOTA_EXCEEDED_ERR||ot.name=="QuotaExceededError"||"quota"in ot)xt.details=ae.BUFFER_FULL_ERROR;else if(ot.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!ht)xt.errorAction=Ki(!0);else if(ot.name===_c&&this.sourceBufferCount===0)xt.errorAction=Ki(!0);else{const jt=++this.appendErrors[l];this.warn(`Failed ${jt}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${l}" sourceBuffer (${ht||"no media error"})`),(jt>=this.hls.config.appendErrorMaxRetry||ht)&&(xt.fatal=!0)}this.hls.trigger(E.ERROR,xt)}};this.log(`queuing "${l}" append sn: ${k}${y?" p: "+y.index:""} of ${f.type===z.MAIN?"level":"track"} ${f.level} cc: ${F}`),this.append(Lt,l,this.isPending(this.tracks[l]))}getFlushOp(t,i,s){return this.log(`queuing "${t}" remove ${i}-${s}`),{label:"remove",execute:()=>{this.removeExecutor(t,i,s)},onStart:()=>{},onComplete:()=>{this.hls.trigger(E.BUFFER_FLUSHED,{type:t})},onError:o=>{this.warn(`Failed to remove ${i}-${s} from "${t}" SourceBuffer`,o)}}}onBufferFlushing(t,i){const{type:s,startOffset:o,endOffset:l}=i;s?this.append(this.getFlushOp(s,o,l),s):this.sourceBuffers.forEach(([u])=>{u&&this.append(this.getFlushOp(u,o,l),u)})}onFragParsed(t,i){const{frag:s,part:o}=i,l=[],u=o?o.elementaryStreams:s.elementaryStreams;u[se.AUDIOVIDEO]?l.push("audiovideo"):(u[se.AUDIO]&&l.push("audio"),u[se.VIDEO]&&l.push("video"));const f=()=>{const y=self.performance.now();s.stats.buffering.end=y,o&&(o.stats.buffering.end=y);const v=o?o.stats:s.stats;this.hls.trigger(E.FRAG_BUFFERED,{frag:s,part:o,stats:v,id:s.type})};l.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${s.type} level: ${s.level} sn: ${s.sn}`),this.blockBuffers(f,l).catch(y=>{this.warn(`Fragment buffered callback ${y}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(t,i){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([t])=>{if(t){const i=this.tracks[t];if(i)return!i.ended||i.ending}return!1})}onBufferEos(t,i){var s;this.sourceBuffers.forEach(([u])=>{if(u){const f=this.tracks[u];(!i.type||i.type===u)&&(f.ending=!0,f.ended||(f.ended=!0,this.log(`${u} buffer reached EOS`)))}});const o=((s=this.overrides)==null?void 0:s.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([u])=>{var f;return u&&!((f=this.tracks[u])!=null&&f.ended)})?o?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:u}=this;if(!u||u.readyState!=="open"){u&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${u.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),u.endOfStream(),this.hls.trigger(E.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(E.BUFFERED_TO_END,void 0)):i.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([t])=>{if(t!==null){const i=this.tracks[t];i&&(i.ending=!1)}})}onLevelUpdated(t,{details:i}){i.fragments.length&&(this.details=i,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const t=this.getDurationAndRange();t&&this.updateMediaSource(t)})}onError(t,i){if(i.details===ae.BUFFER_APPEND_ERROR&&i.frag){var s;const o=(s=i.errorAction)==null?void 0:s.nextAutoLevel;U(o)&&o!==i.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:t,details:i,media:s}=this;if(!s||i===null||!this.sourceBufferCount)return;const o=t.config,l=s.currentTime,u=i.levelTargetDuration,f=i.live&&o.liveBackBufferLength!==null?o.liveBackBufferLength:o.backBufferLength;if(U(f)&&f>=0){const v=Math.max(f,u),x=Math.floor(l/u)*u-v;this.flushBackBuffer(l,u,x)}const y=o.frontBufferFlushThreshold;if(U(y)&&y>0){const v=Math.max(o.maxBufferLength,y),x=Math.max(v,u),w=Math.floor(l/u)*u+x;this.flushFrontBuffer(l,u,w)}}flushBackBuffer(t,i,s){this.sourceBuffers.forEach(([o,l])=>{if(l){const f=di.getBuffered(l);if(f.length>0&&s>f.start(0)){var u;this.hls.trigger(E.BACK_BUFFER_REACHED,{bufferEnd:s});const y=this.tracks[o];if((u=this.details)!=null&&u.live)this.hls.trigger(E.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(y!=null&&y.ended){this.log(`Cannot flush ${o} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(E.BUFFER_FLUSHING,{startOffset:0,endOffset:s,type:o})}}})}flushFrontBuffer(t,i,s){this.sourceBuffers.forEach(([o,l])=>{if(l){const u=di.getBuffered(l),f=u.length;if(f<2)return;const y=u.start(f-1),v=u.end(f-1);if(s>y||t>=y&&t<=v)return;this.hls.trigger(E.BUFFER_FLUSHING,{startOffset:y,endOffset:1/0,type:o})}})}getDurationAndRange(){var t;const{details:i,mediaSource:s}=this;if(!i||!this.media||(s==null?void 0:s.readyState)!=="open")return null;const o=i.edge;if(i.live&&this.hls.config.liveDurationInfinity){if(i.fragments.length&&s.setLiveSeekableRange){const v=Math.max(0,i.fragmentStart),x=Math.max(v,o);return{duration:1/0,start:v,end:x}}return{duration:1/0}}const l=(t=this.overrides)==null?void 0:t.duration;if(l)return U(l)?{duration:l}:null;const u=this.media.duration,f=U(s.duration)?s.duration:0;return o>f&&o>u||!U(u)?{duration:o}:null}updateMediaSource({duration:t,start:i,end:s}){const o=this.mediaSource;!this.media||!o||o.readyState!=="open"||(o.duration!==t&&(U(t)&&this.log(`Updating MediaSource duration to ${t.toFixed(3)}`),o.duration=t),i!==void 0&&s!==void 0&&(this.log(`MediaSource duration is set to ${o.duration}. Setting seekable range to ${i}-${s}.`),o.setLiveSeekableRange(i,s)))}get tracksReady(){const t=this.pendingTrackCount;return t>0&&(t>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:t,pendingTrackCount:i,tracks:s}=this;if(this.log(`checkPendingTracks (pending: ${i} codec events expected: ${t}) ${tt(s)}`),this.tracksReady){var o;const l=(o=this.transferData)==null?void 0:o.tracks;l&&Object.keys(l).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const t={};this.sourceBuffers.forEach(([i,s])=>{if(i){const o=this.tracks[i];t[i]={buffer:s,container:o.container,codec:o.codec,supplemental:o.supplemental,levelCodec:o.levelCodec,id:o.id,metadata:o.metadata}}}),this.hls.trigger(E.BUFFER_CREATED,{tracks:t}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([i])=>{this.executeNext(i)})}else{const t=new Error("could not create source buffer for media codec(s)");this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:t,reason:t.message})}}createSourceBuffers(){const{tracks:t,sourceBuffers:i,mediaSource:s}=this;if(!s)throw new Error("createSourceBuffers called when mediaSource was null");for(const l in t){const u=l,f=t[u];if(this.isPending(f)){const y=this.getTrackCodec(f,u),v=`${f.container};codecs=${y}`;f.codec=y,this.log(`creating sourceBuffer(${v})${this.currentOp(u)?" Queued":""} ${tt(f)}`);try{const x=s.addSourceBuffer(v),w=xc(u),k=[u,x];i[w]=k,f.buffer=x}catch(x){var o;this.error(`error while trying to add sourceBuffer: ${x.message}`),this.shiftAndExecuteNext(u),(o=this.operationQueue)==null||o.removeBlockers(),delete this.tracks[u],this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,sourceBufferName:u,mimeType:v,parent:f.id});return}this.trackSourceBuffer(u,f)}}this.bufferCreated()}getTrackCodec(t,i){const s=t.supplemental;let o=t.codec;s&&(i==="video"||i==="audiovideo")&&Fe(s,"video")&&(o=sr(o,s));const l=Sr(o,t.levelCodec);return l?i.slice(0,5)==="audio"?Ae(l,this.appendSource):l:""}trackSourceBuffer(t,i){const s=i.buffer;if(!s)return;const o=this.getTrackCodec(i,t);this.tracks[t]={buffer:s,codec:o,container:i.container,levelCodec:i.levelCodec,supplemental:i.supplemental,metadata:i.metadata,id:i.id,listeners:[]},this.removeBufferListeners(t),this.addBufferListener(t,"updatestart",this.onSBUpdateStart),this.addBufferListener(t,"updateend",this.onSBUpdateEnd),this.addBufferListener(t,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(t,"bufferedchange",(l,u)=>{const f=u.removedRanges;f!=null&&f.length&&this.hls.trigger(E.BUFFER_FLUSHED,{type:l})})}get mediaSrc(){var t,i;const s=((t=this.media)==null||(i=t.querySelector)==null?void 0:i.call(t,"source"))||this.media;return s==null?void 0:s.src}onSBUpdateStart(t){const i=this.currentOp(t);i&&i.onStart()}onSBUpdateEnd(t){var i;if(((i=this.mediaSource)==null?void 0:i.readyState)==="closed"){this.resetBuffer(t);return}const s=this.currentOp(t);s&&(s.onComplete(),this.shiftAndExecuteNext(t))}onSBUpdateError(t,i){var s;const o=new Error(`${t} SourceBuffer error. MediaSource readyState: ${(s=this.mediaSource)==null?void 0:s.readyState}`);this.error(`${o}`,i),this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.BUFFER_APPENDING_ERROR,sourceBufferName:t,error:o,fatal:!1});const l=this.currentOp(t);l&&l.onError(o)}updateTimestampOffset(t,i,s,o,l,u){const f=i-t.timestampOffset;Math.abs(f)>=s&&(this.log(`Updating ${o} SourceBuffer timestampOffset to ${i} (sn: ${l} cc: ${u})`),t.timestampOffset=i)}removeExecutor(t,i,s){const{media:o,mediaSource:l}=this,u=this.tracks[t],f=u==null?void 0:u.buffer;if(!o||!l||!f){this.warn(`Attempting to remove from the ${t} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(t);return}const y=U(o.duration)?o.duration:1/0,v=U(l.duration)?l.duration:1/0,x=Math.max(0,i),w=Math.min(s,y,v);w>x&&(!u.ending||u.ended)?(u.ended=!1,this.log(`Removing [${x},${w}] from the ${t} SourceBuffer`),f.remove(x,w)):this.shiftAndExecuteNext(t)}appendExecutor(t,i){const s=this.tracks[i],o=s==null?void 0:s.buffer;if(!o)throw new Ea(`Attempting to append to the ${i} SourceBuffer, but it does not exist`);s.ending=!1,s.ended=!1,o.appendBuffer(t)}blockUntilOpen(t){if(this.isUpdating()||this.isQueued())this.blockBuffers(t).catch(i=>{this.warn(`SourceBuffer blocked callback ${i}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{t()}catch(i){this.warn(`Callback run without blocking ${this.operationQueue} ${i}`)}}isUpdating(){return this.sourceBuffers.some(([t,i])=>t&&i.updating)}isQueued(){return this.sourceBuffers.some(([t])=>t&&!!this.currentOp(t))}isPending(t){return!!t&&!t.buffer}blockBuffers(t,i=this.sourceBufferTypes){if(!i.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);const{operationQueue:s}=this,o=i.map(u=>this.appendBlocker(u));return i.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(o).then(u=>{s===this.operationQueue&&(t(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(t){t.forEach(i=>{var s;const o=(s=this.tracks[i])==null?void 0:s.buffer;!o||o.updating||this.shiftAndExecuteNext(i)})}append(t,i,s){this.operationQueue&&this.operationQueue.append(t,i,s)}appendBlocker(t){if(this.operationQueue)return this.operationQueue.appendBlocker(t)}currentOp(t){return this.operationQueue?this.operationQueue.current(t):null}executeNext(t){t&&this.operationQueue&&this.operationQueue.executeNext(t)}shiftAndExecuteNext(t){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(t)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((t,i)=>t+(this.isPending(this.tracks[i])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((t,[i])=>t+(i?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([t])=>t).filter(t=>!!t)}addBufferListener(t,i,s){const o=this.tracks[t];if(!o)return;const l=o.buffer;if(!l)return;const u=s.bind(this,t);o.listeners.push({event:i,listener:u}),l.addEventListener(i,u)}removeBufferListeners(t){const i=this.tracks[t];if(!i)return;const s=i.buffer;s&&(i.listeners.forEach(o=>{s.removeEventListener(o.event,o.listener)}),i.listeners.length=0)}}function So(h){const t=h.querySelectorAll("source");[].slice.call(t).forEach(i=>{h.removeChild(i)})}function sh(h,t){const i=self.document.createElement("source");i.type="video/mp4",i.src=t,h.appendChild(i)}function xc(h){return h==="audio"?1:0}class wc{constructor(t){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=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(t){this.streamController=t}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:t}=this;t.on(E.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(E.BUFFER_CODECS,this.onBufferCodecs,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:t}=this;t.off(E.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(E.BUFFER_CODECS,this.onBufferCodecs,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(t,i){const s=this.hls.levels[i.droppedLevel];this.isLevelAllowed(s)&&this.restrictedLevels.push({bitrate:s.bitrate,height:s.height,width:s.width})}onMediaAttaching(t,i){this.media=i.media instanceof HTMLVideoElement?i.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(t,i){const s=this.hls;this.restrictedLevels=[],this.firstLevel=i.firstLevel,s.config.capLevelToPlayerSize&&i.video&&this.startCapping()}onLevelsUpdated(t,i){this.timer&&U(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(t,i){this.hls.config.capLevelToPlayerSize&&i.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const t=this.hls.levels;if(t.length){const i=this.hls,s=this.getMaxLevel(t.length-1);s!==this.autoLevelCapping&&i.logger.log(`Setting autoLevelCapping to ${s}: ${t[s].height}p@${t[s].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),i.autoLevelCapping=s,i.autoLevelEnabled&&i.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=i.autoLevelCapping}}}getMaxLevel(t){const i=this.hls.levels;if(!i.length)return-1;const s=i.filter((o,l)=>this.isLevelAllowed(o)&&l<=t);return this.clientRect=null,wc.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 t=this.media,i={width:0,height:0};if(t){const s=t.getBoundingClientRect();i.width=s.width,i.height=s.height,!i.width&&!i.height&&(i.width=s.right-s.left||t.width||0,i.height=s.bottom-s.top||t.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 t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(i){}return Math.min(t,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(t){return!this.restrictedLevels.some(s=>t.bitrate===s.bitrate&&t.width===s.width&&t.height===s.height)}static getMaxLevelByMediaSize(t,i,s){if(!(t!=null&&t.length))return-1;const o=(f,y)=>y?f.width!==y.width||f.height!==y.height:!0;let l=t.length-1;const u=Math.max(i,s);for(let f=0;f<t.length;f+=1){const y=t[f];if((y.width>=u||y.height>=u)&&o(y,t[f+1])){l=f;break}}return l}}const $s={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},fr={HLS:"h"};class Pa{constructor(t,i){Array.isArray(t)&&(t=t.map(s=>s instanceof Pa?s:new Pa(s))),this.value=t,this.params=i}}const D0="Dict";function M0(h){return Array.isArray(h)?JSON.stringify(h):h instanceof Map?"Map{}":h instanceof Set?"Set{}":typeof h=="object"?JSON.stringify(h):String(h)}function L0(h,t,i,s){return new Error(`failed to ${h} "${M0(t)}" as ${i}`,{cause:s})}function eo(h,t,i){return L0("serialize",h,t,i)}class oh{constructor(t){this.description=t}}const lh="Bare Item",ws="Boolean";function bd(h){if(typeof h!="boolean")throw eo(h,ws);return h?"?1":"?0"}function Sc(h){return btoa(String.fromCharCode(...h))}const I0="Byte Sequence";function R0(h){if(ArrayBuffer.isView(h)===!1)throw eo(h,I0);return`:${Sc(h)}:`}const _l="Integer";function iu(h){return h<-999999999999999||999999999999999<h}function ga(h){if(iu(h))throw eo(h,_l);return h.toString()}function xl(h){return`@${ga(h.getTime()/1e3)}`}function Vs(h,t){if(h<0)return-Vs(-h,t);const i=Math.pow(10,t);if(Math.abs(h*i%1-.5)<Number.EPSILON){const o=Math.floor(h*i);return(o%2===0?o:o+1)/i}else return Math.round(h*i)/i}const Ho="Decimal";function zu(h){const t=Vs(h,3);if(Math.floor(Math.abs(t)).toString().length>12)throw eo(h,Ho);const i=t.toString();return i.includes(".")?i:`${i}.0`}const to="String",uh=/[\x00-\x1f\x7f]+/;function ch(h){if(uh.test(h))throw eo(h,to);return`"${h.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ec(h){return h.description||h.toString().slice(7,-1)}const _d="Token";function Is(h){const t=Ec(h);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t)===!1)throw eo(t,_d);return t}function Oa(h){switch(typeof h){case"number":if(!U(h))throw eo(h,lh);return Number.isInteger(h)?ga(h):zu(h);case"string":return ch(h);case"symbol":return Is(h);case"boolean":return bd(h);case"object":if(h instanceof Date)return xl(h);if(h instanceof Uint8Array)return R0(h);if(h instanceof oh)return Is(h);default:throw eo(h,lh)}}const xd="Key";function P0(h){if(/^[a-z*][a-z0-9\-_.*]*$/.test(h)===!1)throw eo(h,xd);return h}function Ku(h){return h==null?"":Object.entries(h).map(([t,i])=>i===!0?`;${P0(t)}`:`;${P0(t)}=${Oa(i)}`).join("")}function ji(h){return h instanceof Pa?`${Oa(h.value)}${Ku(h.params)}`:Oa(h)}function nu(h){return`(${h.value.map(ji).join(" ")})${Ku(h.params)}`}function wl(h,t={whitespace:!0}){if(typeof h!="object"||h==null)throw eo(h,D0);const i=h instanceof Map?h.entries():Object.entries(h),s=t!=null&&t.whitespace?" ":"";return Array.from(i).map(([o,l])=>{l instanceof Pa||(l=new Pa(l));let u=P0(o);return l.value===!0?u+=Ku(l.params):(u+="=",Array.isArray(l.value)?u+=nu(l):u+=ji(l)),u}).join(`,${s}`)}function Uu(h,t){return wl(h,t)}const Mt="CMCD-Object",gs="CMCD-Request",Sl="CMCD-Session",ro="CMCD-Status",wd={br:Mt,ab:Mt,d:Mt,ot:Mt,tb:Mt,tpb:Mt,lb:Mt,tab:Mt,lab:Mt,url:Mt,pb:gs,bl:gs,tbl:gs,dl:gs,ltc:gs,mtp:gs,nor:gs,nrr:gs,rc:gs,sn:gs,sta:gs,su:gs,ttfb:gs,ttfbb:gs,ttlb:gs,cmsdd:gs,cmsds:gs,smrt:gs,df:gs,cs:gs,ts:gs,cid:Sl,pr:Sl,sf:Sl,sid:Sl,st:Sl,v:Sl,msd:Sl,bs:ro,bsd:ro,cdn:ro,rtp:ro,bg:ro,pt:ro,ec:ro,e:ro},Hu={REQUEST:gs};function Sd(h){return Object.keys(h).reduce((t,i)=>{var s;return(s=h[i])===null||s===void 0||s.forEach(o=>t[o]=i),t},{})}function Ed(h,t){const i={};if(!h)return i;const s=Object.keys(h),o=t?Sd(t):{};return s.reduce((l,u)=>{var f;const y=wd[u]||o[u]||Hu.REQUEST,v=(f=l[y])!==null&&f!==void 0?f:l[y]={};return v[u]=h[u],l},i)}function Ws(h){return["ot","sf","st","e","sta"].includes(h)}function Go(h){return typeof h=="number"?U(h):h!=null&&h!==""&&h!==!1}const Gu="event";function O0(h,t){const i=new URL(h),s=new URL(t);if(i.origin!==s.origin)return h;const o=i.pathname.split("/").slice(1),l=s.pathname.split("/").slice(1,-1);for(;o[0]===l[0];)o.shift(),l.shift();for(;l.length;)l.shift(),o.unshift("..");return o.join("/")+i.search+i.hash}const B0=h=>Math.round(h),Ac=(h,t)=>Array.isArray(h)?h.map(i=>Ac(i,t)):h instanceof Pa&&typeof h.value=="string"?new Pa(Ac(h.value,t),h.params):(t.baseUrl&&(h=O0(h,t.baseUrl)),t.version===1?encodeURIComponent(h):h),su=h=>B0(h/100)*100,F0={br:B0,d:B0,bl:su,dl:su,mtp:su,nor:(h,t)=>{let i=h;return t.version>=2&&(h instanceof Pa&&typeof h.value=="string"?i=new Pa([h]):typeof h=="string"&&(i=[h])),Ac(i,t)},rtp:su,tb:B0},ea="request",Vo="response",N0=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],hh=["e"],kc=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function $0(h){return kc.test(h)}function kd(h){return N0.includes(h)||hh.includes(h)||$0(h)}const dh=["d","dl","nor","ot","rtp","su"];function Td(h){return N0.includes(h)||dh.includes(h)||$0(h)}const fh=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function Un(h){return N0.includes(h)||dh.includes(h)||fh.includes(h)||$0(h)}const Cd=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function Dd(h){return Cd.includes(h)||$0(h)}const El={[Vo]:Un,[Gu]:kd,[ea]:Td};function ph(h,t={}){const i={};if(h==null||typeof h!="object")return i;const s=t.version||h.v||1,o=t.reportingMode||ea,l=s===1?Dd:El[o];let u=Object.keys(h).filter(l);const f=t.filter;typeof f=="function"&&(u=u.filter(f));const y=o===Vo||o===Gu;y&&!u.includes("ts")&&u.push("ts"),s>1&&!u.includes("v")&&u.push("v");const v=M({},F0,t.formatters),x={version:s,reportingMode:o,baseUrl:t.baseUrl};return u.sort().forEach(w=>{let k=h[w];const F=v[w];if(typeof F=="function"&&(k=F(k,x)),w==="v"){if(s===1)return;k=s}w=="pr"&&k===1||(y&&w==="ts"&&!U(k)&&(k=Date.now()),Go(k)&&(Ws(w)&&typeof k=="string"&&(k=new oh(k)),i[w]=k))}),i}function Vu(h,t={}){const i={};if(!h)return i;const s=ph(h,t),o=Ed(s,t==null?void 0:t.customHeaderMap);return Object.entries(o).reduce((l,[u,f])=>{const y=Uu(f,{whitespace:!1});return y&&(l[u]=y),l},i)}function Md(h,t,i){return M(h,Vu(t,i))}const mh="CMCD";function gh(h,t={}){return h?Uu(ph(h,t),{whitespace:!1}):""}function Wu(h,t={}){if(!h)return"";const i=gh(h,t);return encodeURIComponent(i)}function Ld(h,t={}){if(!h)return"";const i=Wu(h,t);return`${mh}=${i}`}const Tc=/CMCD=[^&#]+/;function Cc(h,t,i){const s=Ld(t,i);if(!s)return h;if(Tc.test(h))return h.replace(Tc,s);const o=h.includes("?")?"&":"?";return`${h}${o}${s}`}class vh{constructor(t){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:$s.MANIFEST,su:!this.initialized})}catch(l){this.hls.logger.warn("Could not generate manifest CMCD data.",l)}},this.applyFragmentData=o=>{try{const{frag:l,part:u}=o,f=this.hls.levels[l.level],y=this.getObjectType(l),v={d:(u||l).duration*1e3,ot:y};(y===$s.VIDEO||y===$s.AUDIO||y==$s.MUXED)&&(v.br=f.bitrate/1e3,v.tb=this.getTopBandwidth(y)/1e3,v.bl=this.getBufferLength(y));const x=u?this.getNextPart(u):this.getNextFrag(l);x!=null&&x.url&&x.url!==l.url&&(v.nor=x.url),this.apply(o,v)}catch(l){this.hls.logger.warn("Could not generate segment CMCD data.",l)}},this.hls=t;const i=this.config=t.config,{cmcd:s}=i;s!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||t.sessionId,this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.includeKeys=s.includeKeys,this.registerListeners())}registerListeners(){const t=this.hls;t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHED,this.onMediaDetached,this),t.on(E.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHED,this.onMediaDetached,this),t.off(E.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(t,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(t,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 t;return{v:1,sf:fr.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)==null?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,i={}){M(i,this.createData());const s=i.ot===$s.INIT||i.ot===$s.VIDEO||i.ot===$s.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,f)=>(o.includes(f)&&(u[f]=i[f]),u),{}));const l={baseUrl:t.url};this.useHeaders?(t.headers||(t.headers={}),Md(t.headers,i,l)):t.url=Cc(t.url,i,l)}getNextFrag(t){var i;const s=(i=this.hls.levels[t.level])==null?void 0:i.details;if(s){const o=t.sn-s.startSN;return s.fragments[o+1]}}getNextPart(t){var i;const{index:s,fragment:o}=t,l=(i=this.hls.levels[o.level])==null||(i=i.details)==null?void 0:i.partList;if(l){const{sn:u}=o;for(let f=l.length-1;f>=0;f--){const y=l[f];if(y.index===s&&y.fragment.sn===u)return l[f+1]}}}getObjectType(t){const{type:i}=t;if(i==="subtitle")return $s.TIMED_TEXT;if(t.sn==="initSegment")return $s.INIT;if(i==="audio")return $s.AUDIO;if(i==="main")return this.hls.audioTracks.length?$s.VIDEO:$s.MUXED}getTopBandwidth(t){let i=0,s;const o=this.hls;if(t===$s.AUDIO)s=o.audioTracks;else{const l=o.maxAutoLevel,u=l>-1?l+1:o.levels.length;s=o.levels.slice(0,u)}return s.forEach(l=>{l.bitrate>i&&(i=l.bitrate)}),i>0?i:NaN}getBufferLength(t){const i=this.media,s=t===$s.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!i?NaN:di.bufferInfo(s,i.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:t}=this.config,i=this.applyPlaylistData,s=t||this.config.loader;return class{constructor(l){this.loader=void 0,this.loader=new s(l)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(l,u,f){i(l),this.loader.load(l,u,f)}}}createFragmentLoader(){const{fLoader:t}=this.config,i=this.applyFragmentData,s=t||this.config.loader;return class{constructor(l){this.loader=void 0,this.loader=new s(l)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(l,u,f){i(l),this.loader.load(l,u,f)}}}}const Id=3e5;class Rd extends le{constructor(t){super("content-steering",t.logger),this.hls=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=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const t=this.hls;t&&(t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((t,i)=>(t.indexOf(i.pathwayId)===-1&&t.push(i.pathwayId),t),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(t){this.updatePathwayPriority(t)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const t=this.timeToLoad*1e3-(performance.now()-this.updated);if(t>0){this.scheduleRefresh(this.uri,t);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(t){const i=this.levels;i&&(this.levels=i.filter(s=>s!==t))}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(t,i){const{contentSteering:s}=i;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(t,i){this.audioTracks=i.audioTracks,this.subtitleTracks=i.subtitleTracks}onError(t,i){const{errorAction:s}=i;if((s==null?void 0:s.action)===$r.SendAlternateToPenaltyBox&&s.flags===jr.MoveAllAlternatesMatchingHost){const o=this.levels;let l=this._pathwayPriority,u=this.pathwayId;if(i.context){const{groupId:f,pathwayId:y,type:v}=i.context;f&&o?u=this.getPathwayForGroupId(f,v,u):y&&(u=y)}u in this.penalizedPathways||(this.penalizedPathways[u]=performance.now()),!l&&o&&(l=this.pathways()),l&&l.length>1&&(this.updatePathwayPriority(l),s.resolved=this.pathwayId!==u),i.details===ae.BUFFER_APPEND_ERROR&&!i.fatal?s.resolved=!0:s.resolved||this.warn(`Could not resolve ${i.details} ("${i.error.message}") with content-steering for Pathway: ${u} levels: ${o&&o.length} priorities: ${tt(l)} penalized: ${tt(this.penalizedPathways)}`)}}filterParsedLevels(t){this.levels=t;let i=this.getLevelsForPathway(this.pathwayId);if(i.length===0){const s=t[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!==t.length&&this.log(`Found ${i.length}/${t.length} levels in Pathway "${this.pathwayId}"`),i}getLevelsForPathway(t){return this.levels===null?[]:this.levels.filter(i=>t===i.pathwayId)}updatePathwayPriority(t){this._pathwayPriority=t;let i;const s=this.penalizedPathways,o=performance.now();Object.keys(s).forEach(l=>{o-s[l]>Id&&delete s[l]});for(let l=0;l<t.length;l++){const u=t[l];if(u in s)continue;if(u===this.pathwayId)return;const f=this.hls.nextLoadLevel,y=this.hls.levels[f];if(i=this.getLevelsForPathway(u),i.length>0){this.log(`Setting Pathway to "${u}"`),this.pathwayId=u,Ds(i),this.hls.trigger(E.LEVELS_UPDATED,{levels:i});const v=this.hls.levels[f];y&&v&&this.levels&&(v.attrs["STABLE-VARIANT-ID"]!==y.attrs["STABLE-VARIANT-ID"]&&v.bitrate!==y.bitrate&&this.log(`Unstable Pathways change from bitrate ${y.bitrate} to ${v.bitrate}`),this.hls.nextLoadLevel=f);break}}}getPathwayForGroupId(t,i,s){const o=this.getLevelsForPathway(s).concat(this.levels||[]);for(let l=0;l<o.length;l++)if(i===Te.AUDIO_TRACK&&o[l].hasAudioGroup(t)||i===Te.SUBTITLE_TRACK&&o[l].hasSubtitleGroup(t))return o[l].pathwayId;return s}clonePathways(t){const i=this.levels;if(!i)return;const s={},o={};t.forEach(l=>{const{ID:u,"BASE-ID":f,"URI-REPLACEMENT":y}=l;if(i.some(x=>x.pathwayId===u))return;const v=this.getLevelsForPathway(f).map(x=>{const w=new oi(x.attrs);w["PATHWAY-ID"]=u;const k=w.AUDIO&&`${w.AUDIO}_clone_${u}`,F=w.SUBTITLES&&`${w.SUBTITLES}_clone_${u}`;k&&(s[w.AUDIO]=k,w.AUDIO=k),F&&(o[w.SUBTITLES]=F,w.SUBTITLES=F);const $=bh(x.uri,w["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",y),Q=new Mi({attrs:w,audioCodec:x.audioCodec,bitrate:x.bitrate,height:x.height,name:x.name,url:$,videoCodec:x.videoCodec,width:x.width});if(x.audioGroups)for(let te=1;te<x.audioGroups.length;te++)Q.addGroupId("audio",`${x.audioGroups[te]}_clone_${u}`);if(x.subtitleGroups)for(let te=1;te<x.subtitleGroups.length;te++)Q.addGroupId("text",`${x.subtitleGroups[te]}_clone_${u}`);return Q});i.push(...v),yh(this.audioTracks,s,y,u),yh(this.subtitleTracks,o,y,u)})}loadSteeringManifest(t){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(t)}catch(x){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${t}`);return}if(o.protocol!=="data:"){const x=(this.hls.bandwidthEstimate||i.abrEwmaDefaultEstimate)|0;o.searchParams.set("_HLS_pathway",this.pathwayId),o.searchParams.set("_HLS_throughput",""+x)}const l={responseType:"json",url:o.href},u=i.steeringManifestLoadPolicy.default,f=u.errorRetry||u.timeoutRetry||{},y={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:f.maxNumRetry||0,retryDelay:f.retryDelayMs||0,maxRetryDelay:f.maxRetryDelayMs||0},v={onSuccess:(x,w,k,F)=>{this.log(`Loaded steering manifest: "${o}"`);const $=x.data;if(($==null?void 0:$.VERSION)!==1){this.log(`Steering VERSION ${$.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=$.TTL;const{"RELOAD-URI":Q,"PATHWAY-CLONES":te,"PATHWAY-PRIORITY":xe}=$;if(Q)try{this.uri=new self.URL(Q,o).href}catch(Le){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${Q}`);return}this.scheduleRefresh(this.uri||k.url),te&&this.clonePathways(te);const ke={steeringManifest:$,url:o.toString()};this.hls.trigger(E.STEERING_MANIFEST_LOADED,ke),xe&&this.updatePathwayPriority(xe)},onError:(x,w,k,F)=>{if(this.log(`Error loading steering manifest: ${x.code} ${x.text} (${w.url})`),this.stopLoad(),x.code===410){this.enabled=!1,this.log(`Steering manifest ${w.url} no longer available`);return}let $=this.timeToLoad*1e3;if(x.code===429){const Q=this.loader;if(typeof(Q==null?void 0:Q.getResponseHeader)=="function"){const te=Q.getResponseHeader("Retry-After");te&&($=parseFloat(te)*1e3)}this.log(`Steering manifest ${w.url} rate limited`);return}this.scheduleRefresh(this.uri||w.url,$)},onTimeout:(x,w,k)=>{this.log(`Timeout loading steering manifest (${w.url})`),this.scheduleRefresh(this.uri||w.url)}};this.log(`Requesting steering manifest: ${o}`),this.loader.load(l,y,v)}scheduleRefresh(t,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(t);return}this.scheduleRefresh(t,this.timeToLoad*1e3)},i)}}function yh(h,t,i,s){h&&Object.keys(t).forEach(o=>{const l=h.filter(u=>u.groupId===o).map(u=>{const f=M({},u);return f.details=void 0,f.attrs=new oi(f.attrs),f.url=f.attrs.URI=bh(u.url,u.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),f.groupId=f.attrs["GROUP-ID"]=t[o],f.attrs["PATHWAY-ID"]=s,f});h.push(...l)})}function bh(h,t,i,s){const{HOST:o,PARAMS:l,[i]:u}=s;let f;t&&(f=u==null?void 0:u[t],f&&(h=f));const y=new self.URL(h);return o&&!f&&(y.host=o),l&&Object.keys(l).sort().forEach(v=>{v&&y.searchParams.set(v,l[v])}),y.href}class au extends le{constructor(t){super("eme",t.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=au.CDMCleanupPromise?[au.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=i=>{const{initDataType:s,initData:o}=i,l=`"${i.type}" event: init data type: "${s}"`;if(this.debug(l),o!==null){if(!this.keyFormatPromise){let u=Object.keys(this.keySystemAccessPromises);u.length||(u=cs(this.config));const f=u.map(rn).filter(y=>!!y);this.keyFormatPromise=this.getKeyFormatPromise(f)}this.keyFormatPromise.then(u=>{const f=is(u);if(s!=="sinf"||f!==yi.FAIRPLAY){this.log(`Ignoring "${i.type}" event with init data type: "${s}" for selected key-system ${f}`);return}let y;try{const F=mr(new Uint8Array(o)),$=ca(JSON.parse(F).sinf),Q=Ve($);if(!Q)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");y=new Uint8Array(Q.subarray(8,24))}catch(F){this.warn(`${l} Failed to parse sinf: ${F}`);return}const v=ye(y),{keyIdToKeySessionPromise:x,mediaKeySessions:w}=this;let k=x[v];for(let F=0;F<w.length;F++){const $=w[F],Q=$.decryptdata;if(!Q.keyId)continue;const te=ye(Q.keyId);if(Ln(y,Q.keyId)||Q.uri.replace(/-/g,"").indexOf(v)!==-1){if(k=x[te],!k)continue;if(Q.pssh)break;delete x[te],Q.pssh=new Uint8Array(o),Q.keyId=y,k=x[v]=k.then(()=>this.generateRequestWithPreferredKeySession($,s,o,"encrypted-event-key-match")),k.catch(xe=>this.handleError(xe));break}}k||this.handleError(new Error(`Key ID ${v} not encountered in playlist. Key-system sessions ${w.length}.`))}).catch(u=>this.handleError(u))}},this.onWaitingForKey=i=>{this.log(`"${i.type}" event`)},this.hls=t,this.config=t.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(E.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(E.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(E.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(E.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(t){const{drmSystems:i,widevineLicenseUrl:s}=this.config,o=i==null?void 0:i[t];if(o)return o.licenseUrl;if(t===yi.WIDEVINE&&s)return s}getLicenseServerUrlOrThrow(t){const i=this.getLicenseServerUrl(t);if(i===void 0)throw new Error(`no license server URL configured for key-system "${t}"`);return i}getServerCertificateUrl(t){const{drmSystems:i}=this.config,s=i==null?void 0:i[t];if(s)return s.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${t}"]`)}attemptKeySystemAccess(t){const i=this.hls.levels,s=(u,f,y)=>!!u&&y.indexOf(u)===f,o=i.map(u=>u.audioCodec).filter(s),l=i.map(u=>u.videoCodec).filter(s);return o.length+l.length===0&&l.push("avc1.42e01e"),new Promise((u,f)=>{const y=v=>{const x=v.shift();this.getMediaKeysPromise(x,o,l).then(w=>u({keySystem:x,mediaKeys:w})).catch(w=>{v.length?y(v):w instanceof Aa?f(w):f(new Aa({type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_NO_ACCESS,error:w,fatal:!0},w.message))})};y(t)})}requestMediaKeySystemAccess(t,i){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let o=`Configured requestMediaKeySystemAccess is not a function ${s}`;return Pi===null&&self.location.protocol==="http:"&&(o=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(o))}return s(t,i)}getMediaKeysPromise(t,i,s){var o;const l=bi(t,i,s,this.config.drmSystemOptions||{});let u=this.keySystemAccessPromises[t],f=(o=u)==null?void 0:o.keySystemAccess;if(!f){this.log(`Requesting encrypted media "${t}" key-system access with config: ${tt(l)}`),f=this.requestMediaKeySystemAccess(t,l);const y=u=this.keySystemAccessPromises[t]={keySystemAccess:f};return f.catch(v=>{this.log(`Failed to obtain access to key-system "${t}": ${v}`)}),f.then(v=>{this.log(`Access for key-system "${v.keySystem}" obtained`);const x=this.fetchServerCertificate(t);this.log(`Create media-keys for "${t}"`);const w=y.mediaKeys=v.createMediaKeys().then(k=>(this.log(`Media-keys created for "${t}"`),y.hasMediaKeys=!0,x.then(F=>F?this.setMediaKeysServerCertificate(k,t,F):k)));return w.catch(k=>{this.error(`Failed to create media-keys for "${t}"}: ${k}`)}),w})}return f.then(()=>u.mediaKeys)}createMediaKeySessionContext({decryptdata:t,keySystem:i,mediaKeys:s}){this.log(`Creating key-system session "${i}" keyId: ${ye(t.keyId||[])} keyUri: ${t.uri}`);const o=s.createSession(),l={decryptdata:t,keySystem:i,mediaKeys:s,mediaKeysSession:o,keyStatus:"status-pending"};return this.mediaKeySessions.push(l),l}renewKeySession(t){const i=t.decryptdata;if(i.pssh){const s=this.createMediaKeySessionContext(t),o=z0(i),l="cenc";this.keyIdToKeySessionPromise[o]=this.generateRequestWithPreferredKeySession(s,l,i.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)}updateKeySession(t,i){const s=t.mediaKeysSession;return this.log(`Updating key-session "${s.sessionId}" for keyId ${ye(t.decryptdata.keyId||[])}
} (data length: ${i.byteLength})`),s.update(i)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(t=>({keySystem:t,hasMediaKeys:this.keySystemAccessPromises[t].hasMediaKeys})).filter(({hasMediaKeys:t})=>!!t).map(({keySystem:t})=>rn(t)).filter(t=>!!t)}getKeySystemAccess(t){return this.getKeySystemSelectionPromise(t).then(({keySystem:i,mediaKeys:s})=>this.attemptSetMediaKeys(i,s))}selectKeySystem(t){return new Promise((i,s)=>{this.getKeySystemSelectionPromise(t).then(({keySystem:o})=>{const l=rn(o);l?i(l):s(new Error(`Unable to find format for key-system "${o}"`))}).catch(s)})}selectKeySystemFormat(t){const i=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${t.sn} ${t.type}: ${t.level}) key formats ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)),this.keyFormatPromise}getKeyFormatPromise(t){const i=cs(this.config),s=t.map(is).filter(o=>!!o&&i.indexOf(o)!==-1);return this.selectKeySystem(s)}getKeyStatus(t){const{mediaKeySessions:i}=this;for(let s=0;s<i.length;s++){const o=Pd(t,i[s]);if(o)return o}}loadKey(t){const i=t.keyInfo.decryptdata,s=z0(i),o=this.bannedKeyIds[s];if(o||this.getKeyStatus(i)==="internal-error"){const f=Eo(o||"internal-error",i);return this.handleError(f,t.frag),Promise.reject(f)}const l=`(keyId: ${s} format: "${i.keyFormat}" method: ${i.method} uri: ${i.uri})`;this.log(`Starting session for key ${l}`);const u=this.keyIdToKeySessionPromise[s];if(!u){const f=this.getKeySystemForKeyPromise(i).then(({keySystem:y,mediaKeys:v})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${t.frag.sn} ${t.frag.type}: ${t.frag.level} using key ${l}`),this.attemptSetMediaKeys(y,v).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:y,mediaKeys:v,decryptdata:i}))))).then(y=>{const v="cenc",x=i.pssh?i.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(y,v,x,"playlist-key")});return f.catch(y=>this.handleError(y,t.frag)),this.keyIdToKeySessionPromise[s]=f,f}return u.catch(f=>{if(f instanceof Aa){const y=O({},f.data);this.getKeyStatus(i)==="internal-error"&&(y.decryptdata=i);const v=new Aa(y,f.message);this.handleError(v,t.frag)}}),u}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t,i){if(this.hls)if(t instanceof Aa){i&&(t.data.frag=i);const s=t.data.decryptdata;this.error(`${t.message}${s?` (${ye(s.keyId||[])})`:""}`),this.hls.trigger(E.ERROR,t.data)}else this.error(t.message),this.hls.trigger(E.ERROR,{type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0})}getKeySystemForKeyPromise(t){const i=z0(t),s=this.keyIdToKeySessionPromise[i];if(!s){const o=is(t.keyFormat),l=o?[o]:cs(this.config);return this.attemptKeySystemAccess(l)}return s}getKeySystemSelectionPromise(t){if(t.length||(t=cs(this.config)),t.length===0)throw new Aa({type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${tt({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(t)}attemptSetMediaKeys(t,i){if(this.mediaResolved=void 0,this.mediaKeys===i)return Promise.resolve();const s=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${t}"`);const o=Promise.all(s).then(()=>this.media?this.media.setMediaKeys(i):new Promise((l,u)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return u(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=i,this.media.setMediaKeys(i).then(l).catch(u)}}));return this.mediaKeys=i,this.setMediaKeysQueue.push(o),o.then(()=>{this.log(`Media-keys set for "${t}"`),s.push(o),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(l=>s.indexOf(l)===-1)})}generateRequestWithPreferredKeySession(t,i,s,o){var l;const u=(l=this.config.drmSystems)==null||(l=l[t.keySystem])==null?void 0:l.generateRequest;if(u)try{const $=u.call(this.hls,i,s,t);if(!$)throw new Error("Invalid response from configured generateRequest filter");i=$.initDataType,s=$.initData?$.initData:null,t.decryptdata.pssh=s?new Uint8Array(s):null}catch($){if(this.warn($.message),this.hls&&this.hls.config.debug)throw $}if(s===null)return this.log(`Skipping key-session request for "${o}" (no initData)`),Promise.resolve(t);const f=z0(t.decryptdata),y=t.decryptdata.uri;this.log(`Generating key-session request for "${o}" keyId: ${f} URI: ${y} (init data type: ${i} length: ${s.byteLength})`);const v=new ul,x=t._onmessage=$=>{const Q=t.mediaKeysSession;if(!Q){v.emit("error",new Error("invalid state"));return}const{messageType:te,message:xe}=$;this.log(`"${te}" message event for session "${Q.sessionId}" message size: ${xe.byteLength}`),te==="license-request"||te==="license-renewal"?this.renewLicense(t,xe).catch(ke=>{v.eventNames().length?v.emit("error",ke):this.handleError(ke)}):te==="license-release"?t.keySystem===yi.FAIRPLAY&&this.updateKeySession(t,Gs("acknowledged")).then(()=>this.removeSession(t)).catch(ke=>this.handleError(ke)):this.warn(`unhandled media key message type "${te}"`)},w=($,Q)=>{Q.keyStatus=$;let te;$.startsWith("usable")?v.emit("resolved"):$==="internal-error"||$==="output-restricted"||$==="output-downscaled"?te=Eo($,Q.decryptdata):$==="expired"?te=new Error(`key expired (keyId: ${f})`):$==="released"?te=new Error("key released"):$==="status-pending"||this.warn(`unhandled key status change "${$}" (keyId: ${f})`),te&&(v.eventNames().length?v.emit("error",te):this.handleError(te))},k=t._onkeystatuseschange=$=>{if(!t.mediaKeysSession){v.emit("error",new Error("invalid state"));return}const te=this.getKeyStatuses(t);if(!Object.keys(te).some(Ze=>te[Ze]!=="status-pending"))return;if(te[f]==="expired"){this.log(`Expired key ${tt(te)} in key-session "${t.mediaKeysSession.sessionId}"`),this.renewKeySession(t);return}let ke=te[f];if(ke)w(ke,t);else{var Le;t.keyStatusTimeouts||(t.keyStatusTimeouts={}),(Le=t.keyStatusTimeouts)[f]||(Le[f]=self.setTimeout(()=>{if(!t.mediaKeysSession||!this.mediaKeys)return;const rt=this.getKeyStatus(t.decryptdata);if(rt&&rt!=="status-pending")return this.log(`No status for keyId ${f} in key-session "${t.mediaKeysSession.sessionId}". Using session key-status ${rt} from other session.`),w(rt,t);this.log(`key status for ${f} in key-session "${t.mediaKeysSession.sessionId}" timed out after 1000ms`),ke="internal-error",w(ke,t)},1e3)),this.log(`No status for keyId ${f} (${tt(te)}).`)}};Ms(t.mediaKeysSession,"message",x),Ms(t.mediaKeysSession,"keystatuseschange",k);const F=new Promise(($,Q)=>{v.on("error",Q),v.on("resolved",$)});return t.mediaKeysSession.generateRequest(i,s).then(()=>{this.log(`Request generated for key-session "${t.mediaKeysSession.sessionId}" keyId: ${f} URI: ${y}`)}).catch($=>{throw new Aa({type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_NO_SESSION,error:$,decryptdata:t.decryptdata,fatal:!1},`Error generating key-session request: ${$}`)}).then(()=>F).catch($=>(v.removeAllListeners(),this.removeSession(t).then(()=>{throw $}))).then(()=>(v.removeAllListeners(),t))}getKeyStatuses(t){const i={};return t.mediaKeysSession.keyStatuses.forEach((s,o)=>{if(typeof o=="string"&&typeof s=="object"){const f=o;o=s,s=f}const l="buffer"in o?new Uint8Array(o.buffer,o.byteOffset,o.byteLength):new Uint8Array(o);if(t.keySystem===yi.PLAYREADY&&l.length===16){const f=ye(l);i[f]=s,Kr(l)}const u=ye(l);s==="internal-error"&&(this.bannedKeyIds[u]=s),this.log(`key status change "${s}" for keyStatuses keyId: ${u} key-session "${t.mediaKeysSession.sessionId}"`),i[u]=s}),i}fetchServerCertificate(t){const i=this.config,s=i.loader,o=new s(i),l=this.getServerCertificateUrl(t);return l?(this.log(`Fetching server certificate for "${t}"`),new Promise((u,f)=>{const y={responseType:"arraybuffer",url:l},v=i.certLoadPolicy.default,x={loadPolicy:v,timeout:v.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},w={onSuccess:(k,F,$,Q)=>{u(k.data)},onError:(k,F,$,Q)=>{f(new Aa({type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:$,response:O({url:y.url,data:void 0},k)},`"${t}" certificate request failed (${l}). Status: ${k.code} (${k.text})`))},onTimeout:(k,F,$)=>{f(new Aa({type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:$,response:{url:y.url,data:void 0}},`"${t}" certificate request timed out (${l})`))},onAbort:(k,F,$)=>{f(new Error("aborted"))}};o.load(y,x,w)})):Promise.resolve()}setMediaKeysServerCertificate(t,i,s){return new Promise((o,l)=>{t.setServerCertificate(s).then(u=>{this.log(`setServerCertificate ${u?"success":"not supported by CDM"} (${s.byteLength}) on "${i}"`),o(t)}).catch(u=>{l(new Aa({type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:u,fatal:!0},u.message))})})}renewLicense(t,i){return this.requestLicense(t,new Uint8Array(i)).then(s=>this.updateKeySession(t,new Uint8Array(s)).catch(o=>{throw new Aa({type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:t.decryptdata,error:o,fatal:!1},o.message)}))}unpackPlayReadyKeyMessage(t,i){const s=String.fromCharCode.apply(null,new Uint16Array(i.buffer));if(!s.includes("PlayReadyKeyMessage"))return t.setRequestHeader("Content-Type","text/xml; charset=utf-8"),i;const o=new DOMParser().parseFromString(s,"application/xml"),l=o.querySelectorAll("HttpHeader");if(l.length>0){let x;for(let w=0,k=l.length;w<k;w++){var u,f;x=l[w];const F=(u=x.querySelector("name"))==null?void 0:u.textContent,$=(f=x.querySelector("value"))==null?void 0:f.textContent;F&&$&&t.setRequestHeader(F,$)}}const y=o.querySelector("Challenge"),v=y==null?void 0:y.textContent;if(!v)throw new Error("Cannot find <Challenge> in key message");return Gs(atob(v))}setupLicenseXHR(t,i,s,o){const l=this.config.licenseXhrSetup;return l?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return l.call(this.hls,t,i,s,o)}).catch(u=>{if(!s.decryptdata)throw u;return t.open("POST",i,!0),l.call(this.hls,t,i,s,o)}).then(u=>(t.readyState||t.open("POST",i,!0),{xhr:t,licenseChallenge:u||o})):(t.open("POST",i,!0),Promise.resolve({xhr:t,licenseChallenge:o}))}requestLicense(t,i){const s=this.config.keyLoadPolicy.default;return new Promise((o,l)=>{const u=this.getLicenseServerUrlOrThrow(t.keySystem);this.log(`Sending license request to URL: ${u}`);const f=new XMLHttpRequest;f.responseType="arraybuffer",f.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return l(new Error("invalid state"));if(f.readyState===4)if(f.status===200){this._requestLicenseFailureCount=0;let y=f.response;this.log(`License received ${y instanceof ArrayBuffer?y.byteLength:y}`);const v=this.config.licenseResponseCallback;if(v)try{y=v.call(this.hls,f,u,t)}catch(x){this.error(x)}o(y)}else{const y=s.errorRetry,v=y?y.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>v||f.status>=400&&f.status<500)l(new Aa({type:Me.KEY_SYSTEM_ERROR,details:ae.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:t.decryptdata,fatal:!0,networkDetails:f,response:{url:u,data:void 0,code:f.status,text:f.statusText}},`License Request XHR failed (${u}). Status: ${f.status} (${f.statusText})`));else{const x=v-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${x} attempts left`),this.requestLicense(t,i).then(o,l)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=f,this.setupLicenseXHR(f,u,t,i).then(({xhr:y,licenseChallenge:v})=>{t.keySystem==yi.PLAYREADY&&(v=this.unpackPlayReadyKeyMessage(y,v)),y.send(v)}).catch(l)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(t,i){if(!this.config.emeEnabled)return;const s=i.media;this.media=s,Ms(s,"encrypted",this.onMediaEncrypted),Ms(s,"waitingforkey",this.onWaitingForKey);const o=this.mediaResolved;o?o():this.mediaKeys=s.mediaKeys}onMediaDetached(){const t=this.media;t&&(xs(t,"encrypted",this.onMediaEncrypted),xs(t,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var t;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const i=this.mediaResolved;if(i&&i(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const s=this.media,o=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Vi.clearKeyUriToKeyIdMap();const l=o.length;au.CDMCleanupPromise=Promise.all(o.map(u=>this.removeSession(u)).concat((s==null||(t=s.setMediaKeys(null))==null?void 0:t.catch(u=>{this.log(`Could not clear media keys: ${u}`),this.hls&&this.hls.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:ae.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${u}`)})}))||Promise.resolve())).catch(u=>{this.log(`Could not close sessions and clear media keys: ${u}`),this.hls&&this.hls.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:ae.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${u}`)})}).then(()=>{l&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(t,{sessionKeys:i}){if(!(!i||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=i.reduce((o,l)=>(o.indexOf(l.keyFormat)===-1&&o.push(l.keyFormat),o),[]);this.log(`Selecting key-system from session-keys ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(t){const{mediaKeysSession:i,licenseXhr:s,decryptdata:o}=t;if(i){this.log(`Remove licenses and keys and close session "${i.sessionId}" keyId: ${ye((o==null?void 0:o.keyId)||[])}`),t._onmessage&&(i.removeEventListener("message",t._onmessage),t._onmessage=void 0),t._onkeystatuseschange&&(i.removeEventListener("keystatuseschange",t._onkeystatuseschange),t._onkeystatuseschange=void 0),s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;const l=this.mediaKeySessions.indexOf(t);l>-1&&this.mediaKeySessions.splice(l,1);const{keyStatusTimeouts:u}=t;u&&Object.keys(u).forEach(v=>self.clearTimeout(u[v]));const{drmSystemOptions:f}=this.config;return(fn(f)?new Promise((v,x)=>{self.setTimeout(()=>x(new Error("MediaKeySession.remove() timeout")),8e3),i.remove().then(v).catch(x)}):Promise.resolve()).catch(v=>{this.log(`Could not remove session: ${v}`),this.hls&&this.hls.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:ae.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${v}`)})}).then(()=>i.close()).catch(v=>{this.log(`Could not close session: ${v}`),this.hls&&this.hls.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:ae.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${v}`)})})}return Promise.resolve()}}au.CDMCleanupPromise=void 0;function z0(h){if(!h)throw new Error("Could not read keyId of undefined decryptdata");if(h.keyId===null)throw new Error("keyId is null");return ye(h.keyId)}function Pd(h,t){if(h.keyId&&t.mediaKeysSession.keyStatuses.has(h.keyId))return t.mediaKeysSession.keyStatuses.get(h.keyId);if(h.matches(t.decryptdata))return t.keyStatus}class Aa extends Error{constructor(t,i){super(i),this.data=void 0,t.error||(t.error=new Error(i)),this.data=t,t.err=t.error}}function Eo(h,t){const i=h==="output-restricted",s=i?ae.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:ae.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Aa({type:Me.KEY_SYSTEM_ERROR,details:s,fatal:!1,decryptdata:t},i?"HDCP level output restricted":`key status changed to "${h}"`)}class Al{constructor(t){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=t,this.registerListeners()}setStreamController(t){this.streamController=t}registerListeners(){this.hls.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(E.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(E.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(t,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)}}onMediaDetaching(){this.media=null}checkFPS(t,i,s){const o=performance.now();if(i){if(this.lastTime){const l=o-this.lastTime,u=s-this.lastDroppedFrames,f=i-this.lastDecodedFrames,y=1e3*u/l,v=this.hls;if(v.trigger(E.FPS_DROP,{currentDropped:u,currentDecoded:f,totalDroppedFrames:s}),y>0&&u>v.config.fpsDroppedMonitoringThreshold*f){let x=v.currentLevel;v.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+x),x>0&&(v.autoLevelCapping===-1||v.autoLevelCapping>=x)&&(x=x-1,v.trigger(E.FPS_DROP_LEVEL_CAPPING,{level:x,droppedLevel:v.currentLevel}),v.autoLevelCapping=x,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=s,this.lastDecodedFrames=i}}checkFPSInterval(){const t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){const i=t.getVideoPlaybackQuality();this.checkFPS(t,i.totalVideoFrames,i.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}}function kl(h,t){let i;try{i=new Event("addtrack")}catch(s){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=h,t.dispatchEvent(i)}function io(h,t){const i=h.mode;if(i==="disabled"&&(h.mode="hidden"),h.cues&&!h.cues.getCueById(t.id))try{if(h.addCue(t),!h.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(s){Se.debug(`[texttrack-utils]: ${s}`);try{const o=new self.TextTrackCue(t.startTime,t.endTime,t.text);o.id=t.id,h.addCue(o)}catch(o){Se.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${o}`)}}i==="disabled"&&(h.mode=i)}function va(h,t){const i=h.mode;if(i==="disabled"&&(h.mode="hidden"),h.cues)for(let s=h.cues.length;s--;)t&&h.cues[s].removeEventListener("enter",t),h.removeCue(h.cues[s]);i==="disabled"&&(h.mode=i)}function no(h,t,i,s){const o=h.mode;if(o==="disabled"&&(h.mode="hidden"),h.cues&&h.cues.length>0){const l=U0(h.cues,t,i);for(let u=0;u<l.length;u++)(!s||s(l[u]))&&h.removeCue(l[u])}o==="disabled"&&(h.mode=o)}function K0(h,t){if(t<=h[0].startTime)return 0;const i=h.length-1;if(t>h[i].endTime)return-1;let s=0,o=i,l;for(;s<=o;)if(l=Math.floor((o+s)/2),t<h[l].startTime)o=l-1;else if(t>h[l].startTime&&s<i)s=l+1;else return l;return h[s].startTime-t<t-h[o].startTime?s:o}function U0(h,t,i){const s=[],o=K0(h,t);if(o>-1)for(let l=o,u=h.length;l<u;l++){const f=h[l];if(f.startTime>=t&&f.endTime<=i)s.push(f);else if(f.startTime>i)return s}return s}function Tl(h){const t=[];for(let i=0;i<h.length;i++){const s=h[i];(s.kind==="subtitles"||s.kind==="captions")&&s.label&&t.push(h[i])}return t}class H0 extends T0{constructor(t){super(t,"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.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let i=null;const s=Tl(this.media.textTracks);for(let l=0;l<s.length;l++)if(s[l].mode==="hidden")i=s[l];else if(s[l].mode==="showing"){i=s[l];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(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:t}=this;t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.LEVEL_LOADING,this.onLevelLoading,this),t.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.LEVEL_LOADING,this.onLevelLoading,this),t.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(E.ERROR,this.onError,this)}onMediaAttached(t,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(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,t)}onMediaDetaching(t,i){const s=this.media;if(!s)return;const o=!!i.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||s.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,o)return;Tl(s.textTracks).forEach(u=>{va(u)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(t,i){this.tracks=i.subtitleTracks}onSubtitleTrackLoaded(t,i){const{id:s,groupId:o,details:l}=i,u=this.tracksInGroup[s];if(!u||u.groupId!==o){this.warn(`Subtitle track with id:${s} and group:${o} not found in active group ${u==null?void 0:u.groupId}`);return}const f=u.details;u.details=i.details,this.log(`Subtitle track ${s} "${u.name}" lang:${u.lang} group:${o} loaded [${l.startSN}-${l.endSN}]`),s===this.trackId&&this.playlistLoaded(s,i,f)}onLevelLoading(t,i){this.switchLevel(i.level)}onLevelSwitching(t,i){this.switchLevel(i.level)}switchLevel(t){const i=this.hls.levels[t];if(!i)return;const s=i.subtitleGroups||null,o=this.groupIds;let l=this.currentTrack;if(!s||(o==null?void 0:o.length)!==(s==null?void 0:s.length)||s!=null&&s.some(u=>(o==null?void 0:o.indexOf(u))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const u=this.tracks.filter(x=>!s||s.indexOf(x.groupId)!==-1);if(u.length)this.selectDefaultTrack&&!u.some(x=>x.default)&&(this.selectDefaultTrack=!1),u.forEach((x,w)=>{x.id=w});else if(!l&&!this.tracksInGroup.length)return;this.tracksInGroup=u;const f=this.hls.config.subtitlePreference;if(!l&&f){this.selectDefaultTrack=!1;const x=Jt(f,u);if(x>-1)l=u[x];else{const w=Jt(f,this.tracks);l=this.tracks[w]}}let y=this.findTrackId(l);y===-1&&l&&(y=this.findTrackId(null));const v={subtitleTracks:u};this.log(`Updating subtitle tracks, ${u.length} track(s) found in "${s==null?void 0:s.join(",")}" group-id`),this.hls.trigger(E.SUBTITLE_TRACKS_UPDATED,v),y!==-1&&this.trackId===-1&&this.setSubtitleTrack(y)}}findTrackId(t){const i=this.tracksInGroup,s=this.selectDefaultTrack;for(let o=0;o<i.length;o++){const l=i[o];if(!(s&&!l.default||!s&&!t)&&(!t||Er(l,t)))return o}if(t){for(let o=0;o<i.length;o++){const l=i[o];if($u(t.attrs,l.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return o}for(let o=0;o<i.length;o++){const l=i[o];if($u(t.attrs,l.attrs,["LANGUAGE"]))return o}}return-1}findTrackForTextTrack(t){if(t){const i=this.tracksInGroup;for(let s=0;s<i.length;s++){const o=i[s];if(ru(o,t))return s}}return-1}onError(t,i){i.fatal||!i.context||i.context.type===Te.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(t){this.selectDefaultTrack=!1,this.setSubtitleTrack(t)}setSubtitleOption(t){if(this.hls.config.subtitlePreference=t,t){if(t.id===-1)return this.setSubtitleTrack(-1),null;const i=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,i.length){const s=this.currentTrack;if(s&&Er(t,s))return s;const o=Jt(t,this.tracksInGroup);if(o>-1){const l=this.tracksInGroup[o];return this.setSubtitleTrack(o),l}else{if(s)return null;{const l=Jt(t,i);if(l>-1)return i[l]}}}}return null}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,t)}loadingPlaylist(t,i){super.loadingPlaylist(t,i);const s=t.id,o=t.groupId,l=this.getUrlWithDirectives(t.url,i),u=t.details,f=u==null?void 0:u.age;this.log(`Loading subtitle ${s} "${t.name}" lang:${t.lang} group:${o}${(i==null?void 0:i.msn)!==void 0?" at sn "+i.msn+" part "+i.part:""}${f&&u.live?" age "+f.toFixed(1)+(u.type?" "+u.type||0:""):""} ${l}`),this.hls.trigger(E.SUBTITLE_TRACK_LOADING,{url:l,id:s,groupId:o,deliveryDirectives:i||null,track:t})}toggleTrackModes(){const{media:t}=this;if(!t)return;const i=Tl(t.textTracks),s=this.currentTrack;let o;if(s&&(o=i.filter(l=>ru(s,l))[0],o||this.warn(`Unable to find subtitle TextTrack with name "${s.name}" and language "${s.lang}"`)),[].slice.call(i).forEach(l=>{l.mode!=="disabled"&&l!==o&&(l.mode="disabled")}),o){const l=this.subtitleDisplay?"showing":"hidden";o.mode!==l&&(o.mode=l)}}setSubtitleTrack(t){const i=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(t<-1||t>=i.length||!U(t)){this.warn(`Invalid subtitle track id: ${t}`);return}this.selectDefaultTrack=!1;const s=this.currentTrack,o=i[t]||null;if(this.trackId=t,this.currentTrack=o,this.toggleTrackModes(),!o){this.hls.trigger(E.SUBTITLE_TRACK_SWITCH,{id:t});return}const l=!!o.details&&!o.details.live;if(t===this.trackId&&o===s&&l)return;this.log(`Switching to subtitle-track ${t}`+(o?` "${o.name}" lang:${o.lang} group:${o.groupId}`:""));const{id:u,groupId:f="",name:y,type:v,url:x}=o;this.hls.trigger(E.SUBTITLE_TRACK_SWITCH,{id:u,groupId:f,name:y,type:v,url:x});const w=this.switchParams(o.url,s==null?void 0:s.details,o.details);this.loadPlaylist(w)}}function Od(){try{return crypto.randomUUID()}catch(h){try{const t=URL.createObjectURL(new Blob),i=t.toString();return URL.revokeObjectURL(t),i.slice(i.lastIndexOf("/")+1)}catch(t){let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const l=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(o=="x"?l:l&3|8).toString(16)})}}}function ou(h){let t=5381,i=h.length;for(;i;)t=t*33^h.charCodeAt(--i);return(t>>>0).toString()}const Cl=.025;let ju=function(h){return h[h.Point=0]="Point",h[h.Range=1]="Range",h}({});function Bd(h,t,i){return`${h.identifier}-${i+1}-${ou(t)}`}class _h{constructor(t,i){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=i,this.dateRange=t,this.setDateRange(t)}setDateRange(t){this.dateRange=t,this.resumeOffset=t.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=t.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=t.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=t.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var t;this.appendInPlaceStarted=!1,(t=this.assetListLoader)==null||t.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(t){var i;if(t>0&&t>=this.assetList.length)return!0;const s=this.playoutLimit;return t<=0||isNaN(s)?!1:s===0?!0:(((i=this.assetList[t])==null?void 0:i.startOffset)||0)>s}findAssetIndex(t){return this.assetList.indexOf(t)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const t=this.dateRange.startTime;if(this.snapOptions.out){const i=this.dateRange.tagAnchor;if(i)return Dc(t,i)}return t}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const t=this.dateRange.tagAnchor;if(t){const i=this.dateRange.startTime,s=Dc(i,t);return i-s<.1}return!1}get resumptionOffset(){const t=this.resumeOffset,i=U(t)?t:this.duration;return this.cumulativeDuration+i}get resumeTime(){const t=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const i=this.resumeAnchor;if(i)return Dc(t,i)}return t}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<Cl))}set appendInPlace(t){if(this.appendInPlaceStarted){this.resetOnResume=!t;return}this.appendInPlaceDisabled=!t}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(t){this._timelineStart=t}get duration(){const t=this.playoutLimit;let i;return this._duration!==null?i=this._duration:this.dateRange.duration?i=this.dateRange.duration:i=this.dateRange.plannedDuration||0,!isNaN(t)&&t<i&&(i=t),i}set duration(t){this._duration=t}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?ju.Range:ju.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return Fd(this)}}function Dc(h,t){return h-t.start<t.duration/2&&!(Math.abs(h-(t.start+t.duration))<Cl)?t.start:t.start+t.duration}function xh(h,t,i){const s=new self.URL(h,i);return s.protocol!=="data:"&&s.searchParams.set("_HLS_primary_id",t),s}function Mc(h,t){for(;(i=h.assetList[++t])!=null&&i.error;)var i;return t}function Fd(h){return`["${h.identifier}" ${h.cue.pre?"<pre>":h.cue.post?"<post>":""}${h.timelineStart.toFixed(2)}-${h.resumeTime.toFixed(2)}]`}function lu(h){const t=h.timelineStart,i=h.duration||0;return`["${h.identifier}" ${t.toFixed(2)}-${(t+i).toFixed(2)}]`}class Nd{constructor(t,i,s,o){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(E.PLAYOUT_LIMIT_REACHED,{})};const l=this.hls=new t(i);this.interstitial=s,this.assetItem=o;const u=()=>{this.hasDetails=!0};l.once(E.LEVEL_LOADED,u),l.once(E.AUDIO_TRACK_LOADED,u),l.once(E.SUBTITLE_TRACK_LOADED,u),l.on(E.MEDIA_ATTACHING,(f,{media:y})=>{this.removeMediaListeners(),this.mediaAttached=y,this.interstitial.playoutLimit&&(y.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&l.on(E.BUFFER_APPENDED,()=>{const x=this.bufferedEnd;this.reachedPlayout(x)&&(this._bufferedEosTime=x,l.trigger(E.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const t=this.hls;if(t)if(t.url)t.levels.length&&!t.started&&t.startLoad(-1,!0);else{let i=this.assetItem.uri;try{i=xh(i,t.config.primarySessionId||"").href}catch(s){}t.loadSource(i)}}bufferedInPlaceToEnd(t){var i;if(!this.appendInPlace)return!1;if((i=this.hls)!=null&&i.bufferedToEnd)return!0;if(!t)return!1;const s=Math.min(this._bufferedEosTime||1/0,this.duration),o=this.timelineOffset,l=di.bufferInfo(t,o,0);return this.getAssetTime(l.end)>=s-.02}reachedPlayout(t){const s=this.interstitial.playoutLimit;return this.startOffset+t>=s}get destroyed(){var t;return!((t=this.hls)!=null&&t.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var t;return((t=this.hls)==null?void 0:t.media)||null}get bufferedEnd(){const t=this.media||this.mediaAttached;if(!t)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const i=di.bufferInfo(t,t.currentTime,.001);return this.getAssetTime(i.end)}get currentTime(){const t=this.media||this.mediaAttached;return t?this.getAssetTime(t.currentTime):this._currentTime||0}get duration(){const t=this.assetItem.duration;if(!t)return 0;const i=this.interstitial.playoutLimit;if(i){const s=i-this.startOffset;if(s>0&&s<t)return s}return t}get remaining(){const t=this.duration;return t?Math.max(0,t-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var t;return((t=this.hls)==null?void 0:t.config.timelineOffset)||0}set timelineOffset(t){const i=this.timelineOffset;if(t!==i){const s=t-i;if(Math.abs(s)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=t}}}getAssetTime(t){const i=this.timelineOffset,s=this.duration;return Math.min(Math.max(0,t-i),s)}removeMediaListeners(){const t=this.mediaAttached;t&&(this._currentTime=t.currentTime,this.bufferSnapShot(),t.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var t;(t=this.hls)!=null&&t.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(t){var i;this.loadSource(),(i=this.hls)==null||i.attachMedia(t)}detachMedia(){var t;this.removeMediaListeners(),this.mediaAttached=null,(t=this.hls)==null||t.detachMedia()}resumeBuffering(){var t;(t=this.hls)==null||t.resumeBuffering()}pauseBuffering(){var t;(t=this.hls)==null||t.pauseBuffering()}transferMedia(){var t;return this.bufferSnapShot(),((t=this.hls)==null?void 0:t.transferMedia())||null}resetDetails(){const t=this.hls;if(t&&this.hasDetails){t.stopLoad();const i=s=>delete s.details;t.levels.forEach(i),t.allAudioTracks.forEach(i),t.allSubtitleTracks.forEach(i),this.hasDetails=!1}}on(t,i,s){var o;(o=this.hls)==null||o.on(t,i)}once(t,i,s){var o;(o=this.hls)==null||o.once(t,i)}off(t,i,s){var o;(o=this.hls)==null||o.off(t,i)}toString(){var t;return`HlsAssetPlayer: ${lu(this.assetItem)} ${(t=this.hls)==null?void 0:t.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const wh=.033;class G0 extends le{constructor(t,i){super("interstitials-sched",i),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=t}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(t=>t.reset()),this.events=this.items=null}resetErrorsInRange(t,i){return this.events?this.events.reduce((s,o)=>t<=o.startOffset&&i>o.startOffset?(delete o.error,s+1):s,0):0}get duration(){const t=this.items;return t?t[t.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(t){return t&&this.eventMap[t]||null}hasEvent(t){return t in this.eventMap}findItemIndex(t,i){if(t.event)return this.findEventIndex(t.event.identifier);let s=-1;t.nextEvent?s=this.findEventIndex(t.nextEvent.identifier)-1:t.previousEvent&&(s=this.findEventIndex(t.previousEvent.identifier)+1);const o=this.items;if(o)for(o[s]||(i===void 0&&(i=t.start),s=this.findItemIndexAtTime(i));s>=0&&(l=o[s])!=null&&l.event;){var l;s--}return s}findItemIndexAtTime(t,i){const s=this.items;if(s)for(let o=0;o<s.length;o++){let l=s[o];if(i&&i!=="primary"&&(l=l[i]),t===l.start||t>l.start&&t<l.end)return o}return-1}findJumpRestrictedIndex(t,i){const s=this.items;if(s)for(let o=t;o<=i&&s[o];o++){const l=s[o].event;if(l!=null&&l.restrictions.jump&&!l.appendInPlace)return o}return-1}findEventIndex(t){const i=this.items;if(i)for(let o=i.length;o--;){var s;if(((s=i[o].event)==null?void 0:s.identifier)===t)return o}return-1}findAssetIndex(t,i){const s=t.assetList,o=s.length;if(o>1)for(let l=0;l<o;l++){const u=s[l];if(!u.error){const f=u.timelineStart;if(i===f||i>f&&(i<f+(u.duration||0)||l===o-1))return l}}return 0}get assetIdAtEnd(){var t;const i=(t=this.items)==null||(t=t[this.length-1])==null?void 0:t.event;if(i){const s=i.assetList,o=s[s.length-1];if(o)return o.identifier}return null}parseInterstitialDateRanges(t,i){const s=t.main.details,{dateRanges:o}=s,l=this.events,u=this.parseDateRanges(o,{url:s.url},i),f=Object.keys(o),y=l?l.filter(v=>!f.includes(v.identifier)):[];u.length&&u.sort((v,x)=>{const w=v.cue.pre,k=v.cue.post,F=x.cue.pre,$=x.cue.post;if(w&&!F)return-1;if(F&&!w||k&&!$)return 1;if($&&!k)return-1;if(!w&&!F&&!k&&!$){const Q=v.startTime,te=x.startTime;if(Q!==te)return Q-te}return v.dateRange.tagOrder-x.dateRange.tagOrder}),this.events=u,y.forEach(v=>{this.removeEvent(v)}),this.updateSchedule(t,y)}updateSchedule(t,i=[],s=!1){const o=this.events||[];if(o.length||i.length||this.length<2){const l=this.items,u=this.parseSchedule(o,t);(s||i.length||(l==null?void 0:l.length)!==u.length||u.some((y,v)=>Math.abs(y.playout.start-l[v].playout.start)>.005||Math.abs(y.playout.end-l[v].playout.end)>.005))&&(this.items=u,this.onScheduleUpdate(i,l))}}parseDateRanges(t,i,s){const o=[],l=Object.keys(t);for(let u=0;u<l.length;u++){const f=l[u],y=t[f];if(y.isInterstitial){let v=this.eventMap[f];v?v.setDateRange(y):(v=new _h(y,i),this.eventMap[f]=v,s===!1&&(v.appendInPlace=s)),o.push(v)}}return o}parseSchedule(t,i){const s=[],o=i.main.details,l=o.live?1/0:o.edge;let u=0;if(t=t.filter(y=>!y.error&&!(y.cue.once&&y.hasPlayed)),t.length){this.resolveOffsets(t,i);let y=0,v=0;if(t.forEach((x,w)=>{const k=x.cue.pre,F=x.cue.post,$=t[w-1]||null,Q=x.appendInPlace,te=F?l:x.startOffset,xe=x.duration,ke=x.timelineOccupancy===ju.Range?xe:0,Le=x.resumptionOffset,Ze=($==null?void 0:$.startTime)===te,rt=te+x.cumulativeDuration;let Lt=Q?rt+xe:te+Le;if(k||!F&&te<=0){const St=v;v+=ke,x.timelineStart=rt;const xt=u;u+=xe,s.push({event:x,start:rt,end:Lt,playout:{start:xt,end:u},integrated:{start:St,end:v}})}else if(te<=l){if(!Ze){const ht=te-y;if(ht>wh){const jt=y,Br=v;v+=ht;const ei=u;u+=ht;const vi={previousEvent:t[w-1]||null,nextEvent:x,start:jt,end:jt+ht,playout:{start:ei,end:u},integrated:{start:Br,end:v}};s.push(vi)}else ht>0&&$&&($.cumulativeDuration+=ht,s[s.length-1].end=te)}F&&(Lt=rt),x.timelineStart=rt;const St=v;v+=ke;const xt=u;u+=xe,s.push({event:x,start:rt,end:Lt,playout:{start:xt,end:u},integrated:{start:St,end:v}})}else return;const ot=x.resumeTime;F||ot>l?y=l:y=ot}),y<l){var f;const x=y,w=v,k=l-y;v+=k;const F=u;u+=k,s.push({previousEvent:((f=s[s.length-1])==null?void 0:f.event)||null,nextEvent:null,start:y,end:x+k,playout:{start:F,end:u},integrated:{start:w,end:v}})}this.setDurations(l,u,v)}else s.push({previousEvent:null,nextEvent:null,start:0,end:l,playout:{start:0,end:l},integrated:{start:0,end:l}}),this.setDurations(l,l,l);return s}setDurations(t,i,s){this.durations={primary:t,playout:i,integrated:s}}resolveOffsets(t,i){const s=i.main.details,o=s.live?1/0:s.edge;let l=0,u=-1;t.forEach((f,y)=>{const v=f.cue.pre,x=f.cue.post,w=v?0:x?o:f.startTime;this.updateAssetDurations(f),u===w?f.cumulativeDuration=l:(l=0,u=w),!x&&f.snapOptions.in&&(f.resumeAnchor=Si(null,s.fragments,f.startOffset+f.resumptionOffset,0,0)||void 0),f.appendInPlace&&!f.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(f,i)||(f.appendInPlace=!1)),!f.appendInPlace&&y+1<t.length&&t[y+1].startTime-t[y].resumeTime<wh&&(t[y+1].appendInPlace=!1,t[y+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${f}`));const F=U(f.resumeOffset)?f.resumeOffset:f.duration;l+=F})}primaryCanResumeInPlaceAt(t,i){const s=t.resumeTime,o=t.startTime+t.resumptionOffset;return Math.abs(s-o)>Cl?(this.log(`"${t.identifier}" resumption ${s} not aligned with estimated timeline end ${o}`),!1):!Object.keys(i).some(u=>{const f=i[u].details,y=f.edge;if(s>=y)return this.log(`"${t.identifier}" resumption ${s} past ${u} playlist end ${y}`),!1;const v=Si(null,f.fragments,s);if(!v)return this.log(`"${t.identifier}" resumption ${s} does not align with any fragments in ${u} playlist (${f.fragStart}-${f.fragmentEnd})`),!0;const x=u==="audio"?.175:0;return Math.abs(v.start-s)<Cl+x||Math.abs(v.end-s)<Cl+x?!1:(this.log(`"${t.identifier}" resumption ${s} not aligned with ${u} fragment bounds (${v.start}-${v.end} sn: ${v.sn} cc: ${v.cc})`),!0)})}updateAssetDurations(t){if(!t.assetListLoaded)return;const i=t.timelineStart;let s=0,o=!1,l=!1;for(let u=0;u<t.assetList.length;u++){const f=t.assetList[u],y=i+s;f.startOffset=s,f.timelineStart=y,o||(o=f.duration===null),l||(l=!!f.error);const v=f.error?0:f.duration||0;s+=v}o&&!l?t.duration=Math.max(s,t.duration):t.duration=s}removeEvent(t){t.reset(),delete this.eventMap[t.identifier]}}function la(h){return`[${h.event?'"'+h.event.identifier+'"':"primary"}: ${h.start.toFixed(2)}-${h.end.toFixed(2)}]`}class Dl{constructor(t){this.hls=void 0,this.hls=t}destroy(){this.hls=null}loadAssetList(t,i){const s=t.assetListUrl;let o;try{o=xh(s,this.hls.sessionId,t.baseUrl)}catch(k){const F=this.assignAssetListError(t,ae.ASSET_LIST_LOAD_ERROR,k,s);this.hls.trigger(E.ERROR,F);return}i&&o.protocol!=="data:"&&o.searchParams.set("_HLS_start_offset",""+i);const l=this.hls.config,u=l.loader,f=new u(l),y={responseType:"json",url:o.href},v=l.interstitialAssetListLoadPolicy.default,x={loadPolicy:v,timeout:v.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},w={onSuccess:(k,F,$,Q)=>{const te=k.data,xe=te==null?void 0:te.ASSETS;if(!Array.isArray(xe)){const ke=this.assignAssetListError(t,ae.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),$.url,F,Q);this.hls.trigger(E.ERROR,ke);return}t.assetListResponse=te,this.hls.trigger(E.ASSET_LIST_LOADED,{event:t,assetListResponse:te,networkDetails:Q})},onError:(k,F,$,Q)=>{const te=this.assignAssetListError(t,ae.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${k.code} ${k.text} (${F.url})`),F.url,Q,$);this.hls.trigger(E.ERROR,te)},onTimeout:(k,F,$)=>{const Q=this.assignAssetListError(t,ae.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${F.url})`),F.url,k,$);this.hls.trigger(E.ERROR,Q)}};return f.load(y,x,w),this.hls.trigger(E.ASSET_LIST_LOADING,{event:t}),f}assignAssetListError(t,i,s,o,l,u){return t.error=s,{type:Me.NETWORK_ERROR,details:i,fatal:!1,interstitial:t,url:o,error:s,networkDetails:u,stats:l}}}function so(h){var t;h==null||(t=h.play())==null||t.catch(()=>{})}function qu(h,t){return`[${h}] Advancing timeline position to ${t}`}class Sh extends le{constructor(t,i){super("interstitials",t.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const s=this.currentTime;if(s===void 0||this.playbackDisabled||!this.schedule)return;const o=s-this.timelinePos;if(Math.abs(o)<1/7056e5)return;const u=o<=-.01;this.timelinePos=s,this.bufferedPos=s;const f=this.playingItem;if(!f){this.checkBuffer();return}if(u&&this.schedule.resetErrorsInRange(s,s-o)&&this.updateSchedule(!0),this.checkBuffer(),u&&s<f.start||s>=f.end){var y;const F=this.findItemIndex(f);let $=this.schedule.findItemIndexAtTime(s);if($===-1&&($=F+(u?-1:1),this.log(`seeked ${u?"back ":""}to position not covered by schedule ${s} (resolving from ${F} to ${$})`)),!this.isInterstitial(f)&&(y=this.media)!=null&&y.paused&&(this.shouldPlay=!1),!u&&$>F){const Q=this.schedule.findJumpRestrictedIndex(F+1,$);if(Q>F){this.setSchedulePosition(Q);return}}this.setSchedulePosition($);return}const v=this.playingAsset;if(!v){if(this.playingLastItem&&this.isInterstitial(f)){const F=f.event.assetList[0];F&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(s,F))}return}const x=v.timelineStart,w=v.duration||0;if(u&&s<x||s>=x+w){var k;(k=f.event)!=null&&k.appendInPlace&&(this.clearAssetPlayers(f.event,f),this.flushFrontBuffer(s)),this.setScheduleToAssetAtTime(s,v)}},this.onTimeupdate=()=>{const s=this.currentTime;if(s===void 0||this.playbackDisabled)return;if(s>this.timelinePos)this.timelinePos=s,s>this.bufferedPos&&this.checkBuffer();else return;const o=this.playingItem;if(!o||this.playingLastItem)return;if(s>=o.end){this.timelinePos=o.end;const f=this.findItemIndex(o);this.setSchedulePosition(f+1)}const l=this.playingAsset;if(!l)return;const u=l.timelineStart+(l.duration||0);s>=u&&this.setScheduleToAssetAtTime(s,l)},this.onScheduleUpdate=(s,o)=>{const l=this.schedule;if(!l)return;const u=this.playingItem,f=l.events||[],y=l.items||[],v=l.durations,x=s.map(Q=>Q.identifier),w=!!(f.length||x.length);(w||o)&&this.log(`INTERSTITIALS_UPDATED (${f.length}): ${f}
Schedule: ${y.map(Q=>la(Q))} pos: ${this.timelinePos}`),x.length&&this.log(`Removed events ${x}`);let k=null,F=null;u&&(k=this.updateItem(u,this.timelinePos),this.itemsMatch(u,k)?this.playingItem=k:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const $=this.bufferingItem;if($&&(F=this.updateItem($,this.bufferedPos),this.itemsMatch($,F)?this.bufferingItem=F:$.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial($.event,null))),s.forEach(Q=>{Q.assetList.forEach(te=>{this.clearAssetPlayer(te.identifier,null)})}),this.playerQueue.forEach(Q=>{if(Q.interstitial.appendInPlace){const te=Q.assetItem.timelineStart,xe=Q.timelineOffset-te;if(xe)try{Q.timelineOffset=te}catch(ke){Math.abs(xe)>Cl&&this.warn(`${ke} ("${Q.assetId}" ${Q.timelineOffset}->${te})`)}}}),w||o){if(this.hls.trigger(E.INTERSTITIALS_UPDATED,{events:f.slice(0),schedule:y.slice(0),durations:v,removedIds:x}),this.isInterstitial(u)&&x.includes(u.event.identifier)){this.warn(`Interstitial "${u.event.identifier}" removed while playing`),this.primaryFallback(u.event);return}u&&this.trimInPlace(k,u),$&&F!==k&&this.trimInPlace(F,$),this.checkBuffer()}},this.hls=t,this.HlsPlayerClass=i,this.assetListLoader=new Dl(t),this.schedule=new G0(this.onScheduleUpdate,t.logger),this.registerListeners()}registerListeners(){const t=this.hls;t&&(t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(E.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.on(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(E.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.on(E.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.on(E.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.on(E.BUFFER_APPENDED,this.onBufferAppended,this),t.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(E.BUFFERED_TO_END,this.onBufferedToEnd,this),t.on(E.MEDIA_ENDED,this.onMediaEnded,this),t.on(E.ERROR,this.onError,this),t.on(E.DESTROYING,this.onDestroying,this))}unregisterListeners(){const t=this.hls;t&&(t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(E.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.off(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(E.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.off(E.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.off(E.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.off(E.BUFFER_CODECS,this.onBufferCodecs,this),t.off(E.BUFFER_APPENDED,this.onBufferAppended,this),t.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(E.BUFFERED_TO_END,this.onBufferedToEnd,this),t.off(E.MEDIA_ENDED,this.onMediaEnded,this),t.off(E.ERROR,this.onError,this),t.off(E.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var t;(t=this.getBufferingPlayer())==null||t.resumeBuffering()}pauseBuffering(){var t;(t=this.getBufferingPlayer())==null||t.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const t=this.primaryMedia||this.media;t&&this.removeMediaListeners(t)}removeMediaListeners(t){xs(t,"play",this.onPlay),xs(t,"pause",this.onPause),xs(t,"seeking",this.onSeeking),xs(t,"timeupdate",this.onTimeupdate)}onMediaAttaching(t,i){const s=this.media=i.media;Ms(s,"seeking",this.onSeeking),Ms(s,"timeupdate",this.onTimeupdate),Ms(s,"play",this.onPlay),Ms(s,"pause",this.onPause)}onMediaAttached(t,i){const s=this.effectivePlayingItem,o=this.detachedData;if(this.detachedData=null,s===null)this.checkStart();else if(!o){this.clearScheduleState();const l=this.findItemIndex(s);this.setSchedulePosition(l)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(t,i){const s=!!i.transferMedia,o=this.media;if(this.media=null,!s&&(o&&this.removeMediaListeners(o),this.detachedData)){const l=this.getBufferingPlayer();l&&(this.log(`Removing schedule state for detachedData and ${l}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,l.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const t=this,i=()=>t.bufferingItem||t.waitingItem,s=w=>w&&t.getAssetPlayer(w.identifier),o=(w,k,F,$,Q)=>{if(w){let te=w[k].start;const xe=w.event;if(xe){if(k==="playout"||xe.timelineOccupancy!==ju.Point){const ke=s(F);(ke==null?void 0:ke.interstitial)===xe&&(te+=ke.assetItem.startOffset+ke[Q])}}else{const ke=$==="bufferedPos"?u():t[$];te+=ke-w.start}return te}return 0},l=(w,k)=>{var F;if(w!==0&&k!=="primary"&&(F=t.schedule)!=null&&F.length){var $;const Q=t.schedule.findItemIndexAtTime(w),te=($=t.schedule.items)==null?void 0:$[Q];if(te){const xe=te[k].start-te.start;return w+xe}}return w},u=()=>{const w=t.bufferedPos;return w===Number.MAX_VALUE?f("primary"):Math.max(w,0)},f=w=>{var k,F;return(k=t.primaryDetails)!=null&&k.live?t.primaryDetails.edge:((F=t.schedule)==null?void 0:F.durations[w])||0},y=(w,k)=>{var F,$;const Q=t.effectivePlayingItem;if(Q!=null&&(F=Q.event)!=null&&F.restrictions.skip||!t.schedule)return;t.log(`seek to ${w} "${k}"`);const te=t.effectivePlayingItem,xe=t.schedule.findItemIndexAtTime(w,k),ke=($=t.schedule.items)==null?void 0:$[xe],Le=t.getBufferingPlayer(),Ze=Le==null?void 0:Le.interstitial,rt=Ze==null?void 0:Ze.appendInPlace,Lt=te&&t.itemsMatch(te,ke);if(te&&(rt||Lt)){const ot=s(t.playingAsset),St=(ot==null?void 0:ot.media)||t.primaryMedia;if(St){const xt=k==="primary"?St.currentTime:o(te,k,t.playingAsset,"timelinePos","currentTime"),ht=w-xt,jt=(rt?xt:St.currentTime)+ht;if(jt>=0&&(!ot||rt||jt<=ot.duration)){St.currentTime=jt;return}}}if(ke){let ot=w;if(k!=="primary"){const xt=ke[k].start,ht=w-xt;ot=ke.start+ht}const St=!t.isInterstitial(ke);if((!t.isInterstitial(te)||te.event.appendInPlace)&&(St||ke.event.appendInPlace)){const xt=t.media||(rt?Le==null?void 0:Le.media:null);xt&&(xt.currentTime=ot)}else if(te){const xt=t.findItemIndex(te);if(xe>xt){const jt=t.schedule.findJumpRestrictedIndex(xt+1,xe);if(jt>xt){t.setSchedulePosition(jt);return}}let ht=0;if(St)t.timelinePos=ot,t.checkBuffer();else{const jt=ke.event.assetList,Br=w-(ke[k]||ke).start;for(let ei=jt.length;ei--;){const vi=jt[ei];if(vi.duration&&Br>=vi.startOffset&&Br<vi.startOffset+vi.duration){ht=ei;break}}}t.setSchedulePosition(xe,ht)}}},v=()=>{const w=t.effectivePlayingItem;if(t.isInterstitial(w))return w;const k=i();return t.isInterstitial(k)?k:null},x={get bufferedEnd(){const w=i(),k=t.bufferingItem;if(k&&k===w){var F;return o(k,"playout",t.bufferingAsset,"bufferedPos","bufferedEnd")-k.playout.start||((F=t.bufferingAsset)==null?void 0:F.startOffset)||0}return 0},get currentTime(){const w=v(),k=t.effectivePlayingItem;return k&&k===w?o(k,"playout",t.effectivePlayingAsset,"timelinePos","currentTime")-k.playout.start:0},set currentTime(w){const k=v(),F=t.effectivePlayingItem;F&&F===k&&y(w+F.playout.start,"playout")},get duration(){const w=v();return w?w.playout.end-w.playout.start:0},get assetPlayers(){var w;const k=(w=v())==null?void 0:w.event.assetList;return k?k.map(F=>t.getAssetPlayer(F.identifier)):[]},get playingIndex(){var w;const k=(w=v())==null?void 0:w.event;return k&&t.effectivePlayingAsset?k.findAssetIndex(t.effectivePlayingAsset):-1},get scheduleItem(){return v()}};return this.manager={get events(){var w;return((w=t.schedule)==null||(w=w.events)==null?void 0:w.slice(0))||[]},get schedule(){var w;return((w=t.schedule)==null||(w=w.items)==null?void 0:w.slice(0))||[]},get interstitialPlayer(){return v()?x:null},get playerQueue(){return t.playerQueue.slice(0)},get bufferingAsset(){return t.bufferingAsset},get bufferingItem(){return i()},get bufferingIndex(){const w=i();return t.findItemIndex(w)},get playingAsset(){return t.effectivePlayingAsset},get playingItem(){return t.effectivePlayingItem},get playingIndex(){const w=t.effectivePlayingItem;return t.findItemIndex(w)},primary:{get bufferedEnd(){return u()},get currentTime(){const w=t.timelinePos;return w>0?w:0},set currentTime(w){y(w,"primary")},get duration(){return f("primary")},get seekableStart(){var w;return((w=t.primaryDetails)==null?void 0:w.fragmentStart)||0}},integrated:{get bufferedEnd(){return o(i(),"integrated",t.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return o(t.effectivePlayingItem,"integrated",t.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(w){y(w,"integrated")},get duration(){return f("integrated")},get seekableStart(){var w;return l(((w=t.primaryDetails)==null?void 0:w.fragmentStart)||0,"integrated")}},skip:()=>{const w=t.effectivePlayingItem,k=w==null?void 0:w.event;if(k&&!k.restrictions.skip){const F=t.findItemIndex(w);if(k.appendInPlace){const $=w.playout.start+w.event.duration;y($+.001,"playout")}else t.advanceAfterAssetEnded(k,F,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var t;const i=this.playingItem,s=(t=this.schedule)==null?void 0:t.items;return!this.playbackStarted||!i||!s?!1:this.findItemIndex(i)===s.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var t,i;if(this.mediaSelection===null)return;const s=this.waitingItem||this.playingItem;if(this.isInterstitial(s)&&!s.event.appendInPlace)return;let o=this.media;!o&&(t=this.bufferingItem)!=null&&(t=t.event)!=null&&t.appendInPlace&&(o=this.primaryMedia);const l=(i=o)==null?void 0:i.currentTime;if(!(l===void 0||!U(l)))return l}get primaryMedia(){var t;return this.media||((t=this.detachedData)==null?void 0:t.media)||null}isInterstitial(t){return!!(t!=null&&t.event)}retreiveMediaSource(t,i){const s=this.getAssetPlayer(t);s&&this.transferMediaFromPlayer(s,i)}transferMediaFromPlayer(t,i){const s=t.interstitial.appendInPlace,o=t.media;if(s&&o===this.primaryMedia){if(this.bufferingAsset=null,(!i||this.isInterstitial(i)&&!i.event.appendInPlace)&&i&&o){this.detachedData={media:o};return}const l=t.transferMedia();this.log(`transfer MediaSource from ${t} ${tt(l)}`),this.detachedData=l}else i&&o&&(this.shouldPlay||(this.shouldPlay=!o.paused))}transferMediaTo(t,i){var s,o;if(t.media===i)return;let l=null;const u=this.hls,f=t!==u,y=f&&t.interstitial.appendInPlace,v=(s=this.detachedData)==null?void 0:s.mediaSource;let x;if(u.media)y&&(l=u.transferMedia(),this.detachedData=l),x="Primary";else if(v){const $=this.getBufferingPlayer();$?(l=$.transferMedia(),x=`${$}`):x="detached MediaSource"}else x="detached media";if(!l){if(v)l=this.detachedData,this.log(`using detachedData: MediaSource ${tt(l)}`);else if(!this.detachedData||u.media===i){const $=this.playerQueue;$.length>1&&$.forEach(Q=>{if(f&&Q.interstitial.appendInPlace!==y){const te=Q.interstitial;this.clearInterstitial(Q.interstitial,null),te.appendInPlace=!1,te.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${te}`)}}),this.hls.detachMedia(),this.detachedData={media:i}}}const w=l&&"mediaSource"in l&&((o=l.mediaSource)==null?void 0:o.readyState)!=="closed",k=w&&l?l:i;this.log(`${w?"transfering MediaSource":"attaching media"} to ${f?t:"Primary"} from ${x} (media.currentTime: ${i.currentTime})`);const F=this.schedule;if(k===l&&F){const $=f&&t.assetId===F.assetIdAtEnd;k.overrides={duration:F.duration,endOfStream:!f||$,cueRemoval:!f}}t.attachMedia(k)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const t=this.schedule,i=t==null?void 0:t.events;if(!i||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const s=this.timelinePos,o=this.effectivePlayingItem;if(s===-1){const l=this.hls.startPosition;if(this.log(qu("checkStart",l)),this.timelinePos=l,i.length&&i[0].cue.pre){const u=t.findEventIndex(i[0].identifier);this.setSchedulePosition(u)}else if(l>=0||!this.primaryLive){const u=this.timelinePos=l>0?l:0,f=t.findItemIndexAtTime(u);this.setSchedulePosition(f)}}else if(o&&!this.playingItem){const l=t.findItemIndex(o);this.setSchedulePosition(l)}}advanceAssetBuffering(t,i){const s=t.event,o=s.findAssetIndex(i),l=Mc(s,o);if(!s.isAssetPastPlayoutLimit(l))this.bufferedToEvent(t,l);else if(this.schedule){var u;const f=(u=this.schedule.items)==null?void 0:u[this.findItemIndex(t)+1];f&&this.bufferedToItem(f)}}advanceAfterAssetEnded(t,i,s){const o=Mc(t,s);if(t.isAssetPastPlayoutLimit(o)){if(this.schedule){const l=this.schedule.items;if(l){const u=i+1,f=l.length;if(u>=f){this.setSchedulePosition(-1);return}const y=t.resumeTime;this.timelinePos<y&&(this.log(qu("advanceAfterAssetEnded",y)),this.timelinePos=y,t.appendInPlace&&this.advanceInPlace(y),this.checkBuffer(this.bufferedPos<y)),this.setSchedulePosition(u)}}}else{if(t.appendInPlace){const l=t.assetList[o];l&&this.advanceInPlace(l.timelineStart)}this.setSchedulePosition(i,o)}}setScheduleToAssetAtTime(t,i){const s=this.schedule;if(!s)return;const o=i.parentIdentifier,l=s.getEvent(o);if(l){const u=s.findEventIndex(o),f=s.findAssetIndex(l,t);this.advanceAfterAssetEnded(l,u,f-1)}}setSchedulePosition(t,i){var s;const o=(s=this.schedule)==null?void 0:s.items;if(!o||this.playbackDisabled)return;const l=t>=0?o[t]:null;this.log(`setSchedulePosition ${t}, ${i} (${l&&la(l)}) pos: ${this.timelinePos}`);const u=this.waitingItem||this.playingItem,f=this.playingLastItem;if(this.isInterstitial(u)){const x=u.event,w=this.playingAsset,k=w==null?void 0:w.identifier,F=k?this.getAssetPlayer(k):null;if(F&&k&&(!this.eventItemsMatch(u,l)||i!==void 0&&k!==x.assetList[i].identifier)){var y;const $=x.findAssetIndex(w);if(this.log(`INTERSTITIAL_ASSET_ENDED ${$+1}/${x.assetList.length} ${lu(w)}`),this.endedAsset=w,this.playingAsset=null,this.hls.trigger(E.INTERSTITIAL_ASSET_ENDED,{asset:w,assetListIndex:$,event:x,schedule:o.slice(0),scheduleIndex:t,player:F}),u!==this.playingItem){this.itemsMatch(u,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(x,this.findItemIndex(this.playingItem),$);return}this.retreiveMediaSource(k,l),F.media&&!((y=this.detachedData)!=null&&y.mediaSource)&&F.detachMedia()}if(!this.eventItemsMatch(u,l)&&(this.endedItem=u,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${x} ${la(u)}`),x.hasPlayed=!0,this.hls.trigger(E.INTERSTITIAL_ENDED,{event:x,schedule:o.slice(0),scheduleIndex:t}),x.cue.once)){var v;this.updateSchedule();const $=(v=this.schedule)==null?void 0:v.items;if(l&&$){const Q=this.findItemIndex(l);this.advanceSchedule(Q,$,i,u,f)}return}}this.advanceSchedule(t,o,i,u,f)}advanceSchedule(t,i,s,o,l){const u=this.schedule;if(!u)return;const f=i[t]||null,y=this.primaryMedia,v=this.playerQueue;if(v.length&&v.forEach(x=>{const w=x.interstitial,k=u.findEventIndex(w.identifier);(k<t||k>t+1)&&this.clearInterstitial(w,f)}),this.isInterstitial(f)){this.timelinePos=Math.min(Math.max(this.timelinePos,f.start),f.end);const x=f.event;if(s===void 0){s=u.findAssetIndex(x,this.timelinePos);const $=Mc(x,s-1);if(x.isAssetPastPlayoutLimit($)||x.appendInPlace&&this.timelinePos===f.end){this.advanceAfterAssetEnded(x,t,s);return}s=$}const w=this.waitingItem;this.assetsBuffered(f,y)||this.setBufferingItem(f);let k=this.preloadAssets(x,s);if(this.eventItemsMatch(f,w||o)||(this.waitingItem=f,this.log(`INTERSTITIAL_STARTED ${la(f)} ${x.appendInPlace?"append in place":""}`),this.hls.trigger(E.INTERSTITIAL_STARTED,{event:x,schedule:i.slice(0),scheduleIndex:t})),!x.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${x}`);return}if(x.assetListLoader&&(x.assetListLoader.destroy(),x.assetListLoader=void 0),!y){this.log(`Waiting for attachMedia to start Interstitial ${x}`);return}this.waitingItem=this.endedItem=null,this.playingItem=f;const F=x.assetList[s];if(!F){this.advanceAfterAssetEnded(x,t,s||0);return}if(k||(k=this.getAssetPlayer(F.identifier)),k===null||k.destroyed){const $=x.assetList.length;this.warn(`asset ${s+1}/${$} player destroyed ${x}`),k=this.createAssetPlayer(x,F,s),k.loadSource()}if(!this.eventItemsMatch(f,this.bufferingItem)&&x.appendInPlace&&this.isAssetBuffered(F))return;this.startAssetPlayer(k,s,i,t,y),this.shouldPlay&&so(k.media)}else f?(this.resumePrimary(f,t,o),this.shouldPlay&&so(this.hls.media)):l&&this.isInterstitial(o)&&(this.endedItem=null,this.playingItem=o,o.event.appendInPlace||this.attachPrimary(u.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var t;return(t=this.mediaSelection)==null?void 0:t.main.details}get primaryLive(){var t;return!!((t=this.primaryDetails)!=null&&t.live)}resumePrimary(t,i,s){var o,l;if(this.playingItem=t,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(t),this.log(`resuming ${la(t)}`),!((o=this.detachedData)!=null&&o.mediaSource)){let f=this.timelinePos;(f<t.start||f>=t.end)&&(f=this.getPrimaryResumption(t,i),this.log(qu("resumePrimary",f)),this.timelinePos=f),this.attachPrimary(f,t)}if(!s)return;const u=(l=this.schedule)==null?void 0:l.items;u&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${la(t)}`),this.hls.trigger(E.INTERSTITIALS_PRIMARY_RESUMED,{schedule:u.slice(0),scheduleIndex:i}),this.checkBuffer())}getPrimaryResumption(t,i){const s=t.start;if(this.primaryLive){const o=this.primaryDetails;if(i===0)return this.hls.startPosition;if(o&&(s<o.fragmentStart||s>o.edge))return this.hls.liveSyncPosition||-1}return s}isAssetBuffered(t){const i=this.getAssetPlayer(t.identifier);return i!=null&&i.hls?i.hls.bufferedToEnd:di.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=t.timelineStart+(t.duration||0)}attachPrimary(t,i,s){i?this.setBufferingItem(i):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const o=this.primaryMedia;if(!o)return;const l=this.hls;l.media?this.checkBuffer():(this.transferMediaTo(l,o),s&&this.startLoadingPrimaryAt(t,s)),s||(this.log(qu("attachPrimary",t)),this.timelinePos=t,this.startLoadingPrimaryAt(t,s))}startLoadingPrimaryAt(t,i){var s;const o=this.hls;!o.loadingEnabled||!o.media||Math.abs((((s=o.mainForwardBufferInfo)==null?void 0:s.start)||o.media.currentTime)-t)>.5?o.startLoad(t,i):o.bufferingEnabled||o.resumeBuffering()}onManifestLoading(){var t;this.stopLoad(),(t=this.schedule)==null||t.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(E.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(E.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(t,i){if(i.level===-1||!this.schedule)return;const s=this.hls.levels[i.level];if(!s.details)return;const o=O(O({},this.mediaSelection||this.altSelection),{},{main:s});this.mediaSelection=o,this.schedule.parseInterstitialDateRanges(o,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(t,i){const s=this.hls.audioTracks[i.id],o=this.mediaSelection;if(!o){this.altSelection=O(O({},this.altSelection),{},{audio:s});return}const l=O(O({},o),{},{audio:s});this.mediaSelection=l}onSubtitleTrackUpdated(t,i){const s=this.hls.subtitleTracks[i.id],o=this.mediaSelection;if(!o){this.altSelection=O(O({},this.altSelection),{},{subtitles:s});return}const l=O(O({},o),{},{subtitles:s});this.mediaSelection=l}onAudioTrackSwitching(t,i){const s=Ut(i);this.playerQueue.forEach(({hls:o})=>o&&(o.setAudioOption(i)||o.setAudioOption(s)))}onSubtitleTrackSwitch(t,i){const s=Ut(i);this.playerQueue.forEach(({hls:o})=>o&&(o.setSubtitleOption(i)||i.id!==-1&&o.setSubtitleOption(s)))}onBufferCodecs(t,i){const s=i.tracks;s&&(this.requiredTracks=s)}onBufferAppended(t,i){this.checkBuffer()}onBufferFlushed(t,i){const s=this.playingItem;if(s&&!this.itemsMatch(s,this.bufferingItem)&&!this.isInterstitial(s)){const o=this.timelinePos;this.bufferedPos=o,this.checkBuffer()}}onBufferedToEnd(t){if(!this.schedule)return;const i=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&i){for(let o=0;o<i.length;o++){const l=i[o];if(l.cue.post){var s;const u=this.schedule.findEventIndex(l.identifier),f=(s=this.schedule.items)==null?void 0:s[u];this.isInterstitial(f)&&this.eventItemsMatch(f,this.bufferingItem)&&this.bufferedToItem(f,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(t){const i=this.playingItem;if(!this.playingLastItem&&i){const s=this.findItemIndex(i);this.setSchedulePosition(s+1)}else this.shouldPlay=!1}updateItem(t,i){var s;const o=(s=this.schedule)==null?void 0:s.items;if(t&&o){const l=this.findItemIndex(t,i);return o[l]||null}return null}trimInPlace(t,i){if(this.isInterstitial(t)&&t.event.appendInPlace&&i.end-t.end>.25){t.event.assetList.forEach((l,u)=>{t.event.isAssetPastPlayoutLimit(u)&&this.clearAssetPlayer(l.identifier,null)});const s=t.end+.25,o=di.bufferInfo(this.primaryMedia,s,0);(o.end>s||(o.nextStart||0)>s)&&(this.log(`trim buffered interstitial ${la(t)} (was ${la(i)})`),this.attachPrimary(s,null,!0),this.flushFrontBuffer(s))}}itemsMatch(t,i){return!!i&&(t===i||t.event&&i.event&&this.eventItemsMatch(t,i)||!t.event&&!i.event&&this.findItemIndex(t)===this.findItemIndex(i))}eventItemsMatch(t,i){var s;return!!i&&(t===i||t.event.identifier===((s=i.event)==null?void 0:s.identifier))}findItemIndex(t,i){return t&&this.schedule?this.schedule.findItemIndex(t,i):-1}updateSchedule(t=!1){var i;const s=this.mediaSelection;s&&((i=this.schedule)==null||i.updateSchedule(s,[],t))}checkBuffer(t){var i;const s=(i=this.schedule)==null?void 0:i.items;if(!s)return;const o=di.bufferInfo(this.primaryMedia,this.timelinePos,0);t&&(this.bufferedPos=this.timelinePos),t||(t=o.len<1),this.updateBufferedPos(o.end,s,t)}updateBufferedPos(t,i,s){const o=this.schedule,l=this.bufferingItem;if(this.bufferedPos>t||!o)return;if(i.length===1&&this.itemsMatch(i[0],l)){this.bufferedPos=t;return}const u=this.playingItem,f=this.findItemIndex(u);let y=o.findItemIndexAtTime(t);if(this.bufferedPos<t){var v;const x=this.findItemIndex(l),w=Math.min(x+1,i.length-1),k=i[w];if((y===-1&&l&&t>=l.end||(v=k.event)!=null&&v.appendInPlace&&t+.01>=k.start)&&(y=w),this.isInterstitial(l)){const F=l.event;if(w-f>1&&F.appendInPlace===!1||F.assetList.length===0&&F.assetListLoader)return}if(this.bufferedPos=t,y>x&&y>f)this.bufferedToItem(k);else{const F=this.primaryDetails;this.primaryLive&&F&&t>F.edge-F.targetduration&&k.start<F.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(k)&&this.preloadAssets(k.event,0)}}else s&&u&&!this.itemsMatch(u,l)&&(y===f?this.bufferedToItem(u):y===f+1&&this.bufferedToItem(i[y]))}assetsBuffered(t,i){return t.event.assetList.length===0?!1:!t.event.assetList.some(o=>{const l=this.getAssetPlayer(o.identifier);return!(l!=null&&l.bufferedInPlaceToEnd(i))})}setBufferingItem(t){const i=this.bufferingItem,s=this.schedule;if(!this.itemsMatch(t,i)&&s){const{items:o,events:l}=s;if(!o||!l)return i;const u=this.isInterstitial(t),f=this.getBufferingPlayer();this.bufferingItem=t,this.bufferedPos=Math.max(t.start,Math.min(t.end,this.timelinePos));const y=f?f.remaining:i?i.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${la(t)}`+(i?` (${y.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(u){const v=s.findAssetIndex(t.event,this.bufferedPos);t.event.assetList.forEach((x,w)=>{const k=this.getAssetPlayer(x.identifier);k&&(w===v&&k.loadSource(),k.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(v=>v.pauseBuffering());this.hls.trigger(E.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:l.slice(0),schedule:o.slice(0),bufferingIndex:this.findItemIndex(t),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==t&&(this.bufferingItem=t);return i}bufferedToItem(t,i=0){const s=this.setBufferingItem(t);if(!this.playbackDisabled){if(this.isInterstitial(t))this.bufferedToEvent(t,i);else if(s!==null){this.bufferingAsset=null;const o=this.detachedData;o?o.mediaSource?this.attachPrimary(t.start,t,!0):this.preloadPrimary(t):this.preloadPrimary(t)}}}preloadPrimary(t){const i=this.findItemIndex(t),s=this.getPrimaryResumption(t,i);this.startLoadingPrimaryAt(s)}bufferedToEvent(t,i){const s=t.event,o=s.assetList.length===0&&!s.assetListLoader,l=s.cue.once;if(o||!l){const u=this.preloadAssets(s,i);if(u!=null&&u.interstitial.appendInPlace){const f=this.primaryMedia;f&&this.bufferAssetPlayer(u,f)}}}preloadAssets(t,i){const s=t.assetUrl,o=t.assetList.length,l=o===0&&!t.assetListLoader,u=t.cue.once;if(l){const y=t.timelineStart;if(t.appendInPlace){var f;const k=this.playingItem;!this.isInterstitial(k)&&(k==null||(f=k.nextEvent)==null?void 0:f.identifier)===t.identifier&&this.flushFrontBuffer(y+.25)}let v,x=0;if(!this.playingItem&&this.primaryLive&&(x=this.hls.startPosition,x===-1&&(x=this.hls.liveSyncPosition||0)),x&&!(t.cue.pre||t.cue.post)){const k=x-y;k>0&&(v=Math.round(k*1e3)/1e3)}if(this.log(`Load interstitial asset ${i+1}/${s?1:o} ${t}${v?` live-start: ${x} start-offset: ${v}`:""}`),s)return this.createAsset(t,0,0,y,t.duration,s);const w=this.assetListLoader.loadAssetList(t,v);w&&(t.assetListLoader=w)}else if(!u&&o){for(let v=i;v<o;v++){const x=t.assetList[v],w=this.getAssetPlayerQueueIndex(x.identifier);(w===-1||this.playerQueue[w].destroyed)&&!x.error&&this.createAssetPlayer(t,x,v)}const y=t.assetList[i];if(y){const v=this.getAssetPlayer(y.identifier);return v&&v.loadSource(),v}}return null}flushFrontBuffer(t){const i=this.requiredTracks;if(!i)return;this.log(`Removing front buffer starting at ${t}`),Object.keys(i).forEach(o=>{this.hls.trigger(E.BUFFER_FLUSHING,{startOffset:t,endOffset:1/0,type:o})})}getAssetPlayerQueueIndex(t){const i=this.playerQueue;for(let s=0;s<i.length;s++)if(t===i[s].assetId)return s;return-1}getAssetPlayer(t){const i=this.getAssetPlayerQueueIndex(t);return this.playerQueue[i]||null}getBufferingPlayer(){const{playerQueue:t,primaryMedia:i}=this;if(i){for(let s=0;s<t.length;s++)if(t[s].media===i)return t[s]}return null}createAsset(t,i,s,o,l,u){const f={parentIdentifier:t.identifier,identifier:Bd(t,u,i),duration:l,startOffset:s,timelineStart:o,uri:u};return this.createAssetPlayer(t,f,i)}createAssetPlayer(t,i,s){const o=this.hls,l=o.userConfig;let u=l.videoPreference;const f=o.loadLevelObj||o.levels[o.currentLevel];(u||f)&&(u=M({},u),f.videoCodec&&(u.videoCodec=f.videoCodec),f.videoRange&&(u.allowedVideoRanges=[f.videoRange]));const y=o.audioTracks[o.audioTrack],v=o.subtitleTracks[o.subtitleTrack];let x=0;if(this.primaryLive||t.appendInPlace){const Ze=this.timelinePos-i.timelineStart;if(Ze>1){const rt=i.duration;rt&&Ze<rt&&(x=Ze)}}const w=i.identifier,k=O(O({},l),{},{maxMaxBufferLength:Math.min(180,o.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:o.sessionId,assetPlayerId:w,abrEwmaDefaultEstimate:o.bandwidthEstimate,interstitialsController:void 0,startPosition:x,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:u,audioPreference:y||l.audioPreference,subtitlePreference:v||l.subtitlePreference});t.appendInPlace&&(t.appendInPlaceStarted=!0,i.timelineStart&&(k.timelineOffset=i.timelineStart));const F=k.cmcd;F!=null&&F.sessionId&&F.contentId&&(k.cmcd=M({},F,{contentId:ou(i.uri)})),this.getAssetPlayer(w)&&this.warn(`Duplicate date range identifier ${t} and asset ${w}`);const $=new Nd(this.HlsPlayerClass,k,t,i);this.playerQueue.push($),t.assetList[s]=i;let Q=!0;const te=Ze=>{if(Ze.live){var rt;const St=new Error(`Interstitials MUST be VOD assets ${t}`),xt={fatal:!0,type:Me.OTHER_ERROR,details:ae.INTERSTITIAL_ASSET_ITEM_ERROR,error:St},ht=((rt=this.schedule)==null?void 0:rt.findEventIndex(t.identifier))||-1;this.handleAssetItemError(xt,t,ht,s,St.message);return}const Lt=Ze.edge-Ze.fragmentStart,ot=i.duration;(Q||ot===null||Lt>ot)&&(Q=!1,this.log(`Interstitial asset "${w}" duration change ${ot} > ${Lt}`),i.duration=Lt,this.updateSchedule())};$.on(E.LEVEL_UPDATED,(Ze,{details:rt})=>te(rt)),$.on(E.LEVEL_PTS_UPDATED,(Ze,{details:rt})=>te(rt)),$.on(E.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const xe=(Ze,rt)=>{const Lt=this.getAssetPlayer(w);if(Lt&&rt.tracks){Lt.off(E.BUFFER_CODECS,xe),Lt.tracks=rt.tracks;const ot=this.primaryMedia;this.bufferingAsset===Lt.assetItem&&ot&&!Lt.media&&this.bufferAssetPlayer(Lt,ot)}};$.on(E.BUFFER_CODECS,xe);const ke=()=>{var Ze;const rt=this.getAssetPlayer(w);if(this.log(`buffered to end of asset ${rt}`),!rt||!this.schedule)return;const Lt=this.schedule.findEventIndex(t.identifier),ot=(Ze=this.schedule.items)==null?void 0:Ze[Lt];this.isInterstitial(ot)&&this.advanceAssetBuffering(ot,i)};$.on(E.BUFFERED_TO_END,ke);const Le=Ze=>()=>{if(!this.getAssetPlayer(w)||!this.schedule)return;this.shouldPlay=!0;const Lt=this.schedule.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,Lt,Ze)};return $.once(E.MEDIA_ENDED,Le(s)),$.once(E.PLAYOUT_LIMIT_REACHED,Le(1/0)),$.on(E.ERROR,(Ze,rt)=>{if(!this.schedule)return;const Lt=this.getAssetPlayer(w);if(rt.details===ae.BUFFER_STALLED_ERROR){if(Lt!=null&&Lt.appendInPlace){this.handleInPlaceStall(t);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(rt,t,this.schedule.findEventIndex(t.identifier),s,`Asset player error ${rt.error} ${t}`)}),$.on(E.DESTROYING,()=>{if(!this.getAssetPlayer(w)||!this.schedule)return;const rt=new Error(`Asset player destroyed unexpectedly ${w}`),Lt={fatal:!0,type:Me.OTHER_ERROR,details:ae.INTERSTITIAL_ASSET_ITEM_ERROR,error:rt};this.handleAssetItemError(Lt,t,this.schedule.findEventIndex(t.identifier),s,rt.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${lu(i)}`),this.hls.trigger(E.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:i,assetListIndex:s,event:t,player:$}),$}clearInterstitial(t,i){this.clearAssetPlayers(t,i),t.reset()}clearAssetPlayers(t,i){t.assetList.forEach(s=>{this.clearAssetPlayer(s.identifier,i)})}resetAssetPlayer(t){const i=this.getAssetPlayerQueueIndex(t);if(i!==-1){this.log(`reset asset player "${t}" after error`);const s=this.playerQueue[i];this.transferMediaFromPlayer(s,null),s.resetDetails()}}clearAssetPlayer(t,i){const s=this.getAssetPlayerQueueIndex(t);if(s!==-1){const o=this.playerQueue[s];this.log(`clear ${o} toSegment: ${i&&la(i)}`),this.transferMediaFromPlayer(o,i),this.playerQueue.splice(s,1),o.destroy()}}emptyPlayerQueue(){let t;for(;t=this.playerQueue.pop();)t.destroy();this.playerQueue=[]}startAssetPlayer(t,i,s,o,l){const{interstitial:u,assetItem:f,assetId:y}=t,v=u.assetList.length,x=this.playingAsset;this.endedAsset=null,this.playingAsset=f,(!x||x.identifier!==y)&&(x&&(this.clearAssetPlayer(x.identifier,s[o]),delete x.error),this.log(`INTERSTITIAL_ASSET_STARTED ${i+1}/${v} ${lu(f)}`),this.hls.trigger(E.INTERSTITIAL_ASSET_STARTED,{asset:f,assetListIndex:i,event:u,schedule:s.slice(0),scheduleIndex:o,player:t})),this.bufferAssetPlayer(t,l)}bufferAssetPlayer(t,i){var s,o;if(!this.schedule)return;const{interstitial:l,assetItem:u}=t,f=this.schedule.findEventIndex(l.identifier),y=(s=this.schedule.items)==null?void 0:s[f];if(!y)return;t.loadSource(),this.setBufferingItem(y),this.bufferingAsset=u;const v=this.getBufferingPlayer();if(v===t)return;const x=l.appendInPlace;if(x&&(v==null?void 0:v.interstitial.appendInPlace)===!1)return;const w=(v==null?void 0:v.tracks)||((o=this.detachedData)==null?void 0:o.tracks)||this.requiredTracks;if(x&&u!==this.playingAsset){if(!t.tracks){this.log(`Waiting for track info before buffering ${t}`);return}if(w&&!Xe(w,t.tracks)){const k=new Error(`Asset ${lu(u)} SourceBuffer tracks ('${Object.keys(t.tracks)}') are not compatible with primary content tracks ('${Object.keys(w)}')`),F={fatal:!0,type:Me.OTHER_ERROR,details:ae.INTERSTITIAL_ASSET_ITEM_ERROR,error:k},$=l.findAssetIndex(u);this.handleAssetItemError(F,l,f,$,k.message);return}}this.transferMediaTo(t,i)}handleInPlaceStall(t){const i=this.schedule,s=this.primaryMedia;if(!i||!s)return;const o=s.currentTime,l=i.findAssetIndex(t,o),u=t.assetList[l];if(u){const f=this.getAssetPlayer(u.identifier);if(f){const y=f.currentTime||o-u.timelineStart,v=f.duration-y;if(this.warn(`Stalled at ${y} of ${y+v} in ${f} ${t} (media.currentTime: ${o})`),y&&(v/s.playbackRate<.5||f.bufferedInPlaceToEnd(s))&&f.hls){const x=i.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,x,l)}}}}advanceInPlace(t){const i=this.primaryMedia;i&&i.currentTime<t&&(i.currentTime=t)}handleAssetItemError(t,i,s,o,l){if(t.details===ae.BUFFER_STALLED_ERROR)return;const u=i.assetList[o]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${u&&lu(u)} ${t.error}`),!this.schedule)return;const f=(u==null?void 0:u.identifier)||"",y=this.getAssetPlayerQueueIndex(f),v=this.playerQueue[y]||null,x=this.schedule.items,w=M({},t,{fatal:!1,errorAction:Ki(!0),asset:u,assetListIndex:o,event:i,schedule:x,scheduleIndex:s,player:v});if(this.hls.trigger(E.INTERSTITIAL_ASSET_ERROR,w),!t.fatal)return;const k=this.playingAsset,F=this.bufferingAsset,$=new Error(l);if(u&&(this.clearAssetPlayer(f,null),u.error=$),!i.assetList.some(Q=>!Q.error))i.error=$;else for(let Q=o;Q<i.assetList.length;Q++)this.resetAssetPlayer(i.assetList[Q].identifier);this.updateSchedule(!0),i.error?this.primaryFallback(i):k&&k.identifier===f?this.advanceAfterAssetEnded(i,s,o):F&&F.identifier===f&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,F)}primaryFallback(t){const i=t.timelineStart,s=this.effectivePlayingItem;let o=this.timelinePos;if(s){this.log(`Fallback to primary from event "${t.identifier}" start: ${i} pos: ${o} playing: ${la(s)} error: ${t.error}`),o===-1&&(o=this.hls.startPosition);const u=this.updateItem(s,o);this.itemsMatch(s,u)&&this.clearInterstitial(t,null),t.appendInPlace&&(this.attachPrimary(i,null),this.flushFrontBuffer(i))}else if(o===-1){this.checkStart();return}if(!this.schedule)return;const l=this.schedule.findItemIndexAtTime(o);this.setSchedulePosition(l)}onAssetListLoaded(t,i){var s,o;const l=i.event,u=l.identifier,f=i.assetListResponse.ASSETS;if(!((s=this.schedule)!=null&&s.hasEvent(u)))return;const y=l.timelineStart,v=l.duration;let x=0;f.forEach((Q,te)=>{const xe=parseFloat(Q.DURATION);this.createAsset(l,te,x,y+x,xe,Q.URI),x+=xe}),l.duration=x,this.log(`Loaded asset-list with duration: ${x} (was: ${v}) ${l}`);const w=this.waitingItem,k=(w==null?void 0:w.event.identifier)===u;this.updateSchedule();const F=(o=this.bufferingItem)==null?void 0:o.event;if(k){var $;const Q=this.schedule.findEventIndex(u),te=($=this.schedule.items)==null?void 0:$[Q];if(te){if(!this.playingItem&&this.timelinePos>te.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==Q){l.error=new Error(`Interstitial ${f.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${l}`),this.log(l.error.message),this.updateSchedule(!0),this.primaryFallback(l);return}this.setBufferingItem(te)}this.setSchedulePosition(Q)}else if((F==null?void 0:F.identifier)===u){const Q=l.assetList[0];if(Q){const te=this.getAssetPlayer(Q.identifier);if(F.appendInPlace){const xe=this.primaryMedia;te&&xe&&this.bufferAssetPlayer(te,xe)}else te&&te.loadSource()}}}onError(t,i){if(this.schedule)switch(i.details){case ae.ASSET_LIST_PARSING_ERROR:case ae.ASSET_LIST_LOAD_ERROR:case ae.ASSET_LIST_LOAD_TIMEOUT:{const s=i.interstitial;s&&(this.updateSchedule(!0),this.primaryFallback(s));break}case ae.BUFFER_STALLED_ERROR:{const s=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(s)&&s.event.appendInPlace){this.handleInPlaceStall(s.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const Lc=500;class $d extends Oo{constructor(t,i,s){super(t,i,s,"subtitle-stream-controller",z.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(E.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(E.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(t,i){this.stopLoad(),this.state=Vt.IDLE,this.setInterval(Lc),this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=i?-1:t,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(t,i){this.tracksBuffered=[],super.onMediaDetaching(t,i)}onLevelLoaded(t,i){this.mainDetails=i.details}onSubtitleFragProcessed(t,i){const{frag:s,success:o}=i;if(this.fragContextChanged(s)||(at(s)&&(this.fragPrevious=s),this.state=Vt.IDLE),!o)return;const l=this.tracksBuffered[this.currentTrackId];if(!l)return;let u;const f=s.start;for(let v=0;v<l.length;v++)if(f>=l[v].start&&f<=l[v].end){u=l[v];break}const y=s.start+s.duration;u?u.end=y:(u={start:f,end:y},l.push(u)),this.fragmentTracker.fragBuffered(s),this.fragBufferedComplete(s,null),this.media&&this.tick()}onBufferFlushing(t,i){const{startOffset:s,endOffset:o}=i;if(s===0&&o!==Number.POSITIVE_INFINITY){const l=o-1;if(l<=0)return;i.endOffsetSubtitles=Math.max(0,l),this.tracksBuffered.forEach(u=>{for(let f=0;f<u.length;){if(u[f].end<=l){u.shift();continue}else if(u[f].start<l)u[f].start=l;else break;f++}}),this.fragmentTracker.removeFragmentsInRange(s,l,z.SUBTITLE)}}onError(t,i){const s=i.frag;(s==null?void 0:s.type)===z.SUBTITLE&&(i.details===ae.FRAG_GAP&&this.fragmentTracker.fragBuffered(s,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Vt.STOPPED&&(this.state=Vt.IDLE))}onSubtitleTracksUpdated(t,{subtitleTracks:i}){if(this.levels&&ih(this.levels,i)){this.levels=i.map(s=>new Mi(s));return}this.tracksBuffered=[],this.levels=i.map(s=>{const o=new Mi(s);return this.tracksBuffered[o.id]=[],o}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,z.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(t,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.state!==Vt.STOPPED&&this.setInterval(Lc)}onSubtitleTrackLoaded(t,i){var s;const{currentTrackId:o,levels:l}=this,{details:u,id:f}=i;if(!l){this.warn(`Subtitle tracks were reset while loading level ${f}`);return}const y=l[f];if(f>=l.length||!y)return;this.log(`Subtitle track ${f} loaded [${u.startSN},${u.endSN}]${u.lastPartSn?`[part-${u.lastPartSn}-${u.lastPartIndex}]`:""},duration:${u.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let v=0;if(u.live||(s=y.details)!=null&&s.live){if(u.deltaUpdateFailed)return;const w=this.mainDetails;if(!w){this.startFragRequested=!1;return}const k=w.fragments[0];if(!y.details)u.hasProgramDateTime&&w.hasProgramDateTime?(_o(u,w),v=u.fragmentStart):k&&(v=k.start,Ro(u,v));else{var x;v=this.alignPlaylists(u,y.details,(x=this.levelLastLoaded)==null?void 0:x.details),v===0&&k&&(v=k.start,Ro(u,v))}w&&!this.startFragRequested&&this.setStartPosition(w,v)}y.details=u,this.levelLastLoaded=y,f===o&&(this.hls.trigger(E.SUBTITLE_TRACK_UPDATED,{details:u,id:f,groupId:i.groupId}),this.tick(),u.live&&!this.fragCurrent&&this.media&&this.state===Vt.IDLE&&(Si(null,u.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)))}_handleFragmentLoadComplete(t){const{frag:i,payload:s}=t,o=i.decryptdata,l=this.hls;if(!this.fragContextChanged(i)&&s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&Zn(o.method)){const u=performance.now();this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,ia(o.method)).catch(f=>{throw l.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.FRAG_DECRYPT_ERROR,fatal:!1,error:f,reason:f.message,frag:i}),f}).then(f=>{const y=performance.now();l.trigger(E.FRAG_DECRYPTED,{frag:i,payload:f,stats:{tstart:u,tdecrypt:y}})}).catch(f=>{this.warn(`${f.name}: ${f.message}`),this.state=Vt.IDLE})}}doTick(){if(!this.media){this.state=Vt.IDLE;return}if(this.state===Vt.IDLE){const{currentTrackId:t,levels:i}=this,s=i==null?void 0:i[t];if(!s||!i.length||!s.details||this.waitForLive(s))return;const{config:o}=this,l=this.getLoadPosition(),u=di.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],l,o.maxBufferHole),{end:f,len:y}=u,v=s.details,x=this.hls.maxBufferLength+v.levelTargetDuration;if(y>x)return;const w=v.fragments,k=w.length,F=v.edge;let $=null;const Q=this.fragPrevious;if(f<F){const ke=o.maxFragLookUpTolerance,Le=f>F-ke?0:ke;$=Si(Q,w,Math.max(w[0].start,f),Le),!$&&Q&&Q.start<w[0].start&&($=w[0])}else $=w[k-1];if($=this.filterReplacedPrimary($,s.details),!$)return;const te=$.sn-v.startSN,xe=w[te-1];if(xe&&xe.cc===$.cc&&this.fragmentTracker.getState(xe)===Bi.NOT_LOADED&&($=xe),this.fragmentTracker.getState($)===Bi.NOT_LOADED){const ke=this.mapToInitFragWhenRequired($);ke&&this.loadFragment(ke,s,f)}}}loadFragment(t,i,s){at(t)?super.loadFragment(t,i,s):this._loadInitSegment(t,i)}get mediaBufferTimeRanges(){return new zd(this.tracksBuffered[this.currentTrackId]||[])}}class zd{constructor(t){this.buffered=void 0;const i=(s,o,l)=>{if(o=o>>>0,o>l-1)throw new DOMException(`Failed to execute '${s}' on 'TimeRanges': The index provided (${o}) is greater than the maximum bound (${l})`);return t[o][s]};this.buffered={get length(){return t.length},end(s){return i("end",s,t.length)},start(s){return i("start",s,t.length)}}}}const Eh={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},Ah=h=>String.fromCharCode(Eh[h]||h),Ga=15,Ao=100,gn={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},V0={17:2,18:4,21:6,22:8,23:10,19:13,20:15},W0={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Kd={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Wo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class kh{constructor(){this.time=null,this.verboseLevel=0}log(t,i){if(this.verboseLevel>=t){const s=typeof i=="function"?i():i;Se.log(`${this.time} [${t}] ${s}`)}}}const ka=function(t){const i=[];for(let s=0;s<t.length;s++)i.push(t[s].toString(16));return i};class Ic{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(t){const i=["foreground","underline","italics","background","flash"];for(let s=0;s<i.length;s++){const o=i[s];t.hasOwnProperty(o)&&(this[o]=t[o])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash}copy(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class Qn{constructor(){this.uchar=" ",this.penState=new Ic}reset(){this.uchar=" ",this.penState.reset()}setChar(t,i){this.uchar=t,this.penState.copy(i)}setPenState(t){this.penState.copy(t)}equals(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)}copy(t){this.uchar=t.uchar,this.penState.copy(t.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class Th{constructor(t){this.chars=[],this.pos=0,this.currPenState=new Ic,this.cueStartTime=null,this.logger=void 0;for(let i=0;i<Ao;i++)this.chars.push(new Qn);this.logger=t}equals(t){for(let i=0;i<Ao;i++)if(!this.chars[i].equals(t.chars[i]))return!1;return!0}copy(t){for(let i=0;i<Ao;i++)this.chars[i].copy(t.chars[i])}isEmpty(){let t=!0;for(let i=0;i<Ao;i++)if(!this.chars[i].isEmpty()){t=!1;break}return t}setCursor(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Ao&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Ao)}moveCursor(t){const i=this.pos+t;if(t>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(t){t>=144&&this.backSpace();const i=Ah(t);if(this.pos>=Ao){this.logger.log(0,()=>"Cannot insert "+t.toString(16)+" ("+i+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(i,this.currPenState),this.moveCursor(1)}clearFromPos(t){let i;for(i=t;i<Ao;i++)this.chars[i].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const t=[];let i=!0;for(let s=0;s<Ao;s++){const o=this.chars[s].uchar;o!==" "&&(i=!1),t.push(o)}return i?"":t.join("")}setPenStyles(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)}}class j0{constructor(t){this.rows=[],this.currRow=Ga-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let i=0;i<Ga;i++)this.rows.push(new Th(t));this.logger=t}reset(){for(let t=0;t<Ga;t++)this.rows[t].clear();this.currRow=Ga-1}equals(t){let i=!0;for(let s=0;s<Ga;s++)if(!this.rows[s].equals(t.rows[s])){i=!1;break}return i}copy(t){for(let i=0;i<Ga;i++)this.rows[i].copy(t.rows[i])}isEmpty(){let t=!0;for(let i=0;i<Ga;i++)if(!this.rows[i].isEmpty()){t=!1;break}return t}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(t){this.rows[this.currRow].insertChar(t)}setPen(t){this.rows[this.currRow].setPenStyles(t)}moveCursor(t){this.rows[this.currRow].moveCursor(t)}setCursor(t){this.logger.log(2,"setCursor: "+t),this.rows[this.currRow].setCursor(t)}setPAC(t){this.logger.log(2,()=>"pacData = "+tt(t));let i=t.row-1;if(this.nrRollUpRows&&i<this.nrRollUpRows-1&&(i=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==i){for(let f=0;f<Ga;f++)this.rows[f].clear();const l=this.currRow+1-this.nrRollUpRows,u=this.lastOutputScreen;if(u){const f=u.rows[l].cueStartTime,y=this.logger.time;if(f!==null&&y!==null&&f<y)for(let v=0;v<this.nrRollUpRows;v++)this.rows[i-this.nrRollUpRows+v+1].copy(u.rows[l+v])}}this.currRow=i;const s=this.rows[this.currRow];if(t.indent!==null){const l=t.indent,u=Math.max(l-1,0);s.setCursor(t.indent),t.color=s.chars[u].penState.foreground}const o={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(o)}setBkgData(t){this.logger.log(2,()=>"bkgData = "+tt(t)),this.backSpace(),this.setPen(t),this.insertChar(32)}setRollUpRows(t){this.nrRollUpRows=t}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const t=this.currRow+1-this.nrRollUpRows,i=this.rows.splice(t,1)[0];i.clear(),this.rows.splice(this.currRow,0,i),this.logger.log(2,"Rolling up")}getDisplayText(t){t=t||!1;const i=[];let s="",o=-1;for(let l=0;l<Ga;l++){const u=this.rows[l].getTextString();u&&(o=l+1,t?i.push("Row "+o+": '"+u+"'"):i.push(u.trim()))}return i.length>0&&(t?s="["+i.join(" | ")+"]":s=i.join(`
`)),s}getTextAndFormat(){return this.rows}}class Ch{constructor(t,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=t,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new j0(s),this.nonDisplayedMemory=new j0(s),this.lastOutputScreen=new j0(s),this.currRollUpRow=this.displayedMemory.rows[Ga-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[Ga-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(t){this.outputFilter=t}setPAC(t){this.writeScreen.setPAC(t)}setBkgData(t){this.writeScreen.setBkgData(t)}setMode(t){t!==this.mode&&(this.mode=t,this.logger.log(2,()=>"MODE="+t),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=t)}insertChars(t){for(let s=0;s<t.length;s++)this.writeScreen.insertChar(t[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(t){this.logger.log(2,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}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 t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(t){this.logger.log(2,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}ccMIDROW(t){const i={flash:!1};if(i.underline=t%2===1,i.italics=t>=46,i.italics)i.foreground="white";else{const s=Math.floor(t/2)-16,o=["white","green","blue","cyan","red","yellow","magenta"];i.foreground=o[s]}this.logger.log(2,"MIDROW: "+tt(i)),this.writeScreen.setPen(i)}outputDataUpdate(t=!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),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:i),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}class Rc{constructor(t,i,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Dh(),this.logger=void 0;const o=this.logger=new kh;this.channels=[null,new Ch(t,i,o),new Ch(t+1,s,o)]}getHandler(t){return this.channels[t].getHandler()}setHandler(t,i){this.channels[t].setHandler(i)}addData(t,i){this.logger.time=t;for(let s=0;s<i.length;s+=2){const o=i[s]&127,l=i[s+1]&127;let u=!1,f=null;if(o===0&&l===0)continue;this.logger.log(3,()=>"["+ka([i[s],i[s+1]])+"] -> ("+ka([o,l])+")");const y=this.cmdHistory;if(o>=16&&o<=31){if(uu(o,l,y)){Ml(null,null,y),this.logger.log(3,()=>"Repeated command ("+ka([o,l])+") is dropped");continue}Ml(o,l,this.cmdHistory),u=this.parseCmd(o,l),u||(u=this.parseMidrow(o,l)),u||(u=this.parsePAC(o,l)),u||(u=this.parseBackgroundAttributes(o,l))}else Ml(null,null,y);if(!u&&(f=this.parseChars(o,l),f)){const x=this.currentChannel;x&&x>0?this.channels[x].insertChars(f):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!u&&!f&&this.logger.log(2,()=>"Couldn't parse cleaned data "+ka([o,l])+" orig: "+ka([i[s],i[s+1]]))}}parseCmd(t,i){const s=(t===20||t===28||t===21||t===29)&&i>=32&&i<=47,o=(t===23||t===31)&&i>=33&&i<=35;if(!(s||o))return!1;const l=t===20||t===21||t===23?1:2,u=this.channels[l];return t===20||t===21||t===28||t===29?i===32?u.ccRCL():i===33?u.ccBS():i===34?u.ccAOF():i===35?u.ccAON():i===36?u.ccDER():i===37?u.ccRU(2):i===38?u.ccRU(3):i===39?u.ccRU(4):i===40?u.ccFON():i===41?u.ccRDC():i===42?u.ccTR():i===43?u.ccRTD():i===44?u.ccEDM():i===45?u.ccCR():i===46?u.ccENM():i===47&&u.ccEOC():u.ccTO(i-32),this.currentChannel=l,!0}parseMidrow(t,i){let s=0;if((t===17||t===25)&&i>=32&&i<=47){if(t===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 ("+ka([t,i])+")"),!0):!1}return!1}parsePAC(t,i){let s;const o=(t>=17&&t<=23||t>=25&&t<=31)&&i>=64&&i<=127,l=(t===16||t===24)&&i>=64&&i<=95;if(!(o||l))return!1;const u=t<=23?1:2;i>=64&&i<=95?s=u===1?gn[t]:W0[t]:s=u===1?V0[t]:Kd[t];const f=this.channels[u];return f?(f.setPAC(this.interpretPAC(s,i)),this.currentChannel=u,!0):!1}interpretPAC(t,i){let s;const o={color:null,italics:!1,indent:null,underline:!1,row:t};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(t,i){let s,o=null,l=null;if(t>=25?(s=2,l=t-8):(s=1,l=t),l>=17&&l<=19){let u;l===17?u=i+80:l===18?u=i+112:u=i+144,this.logger.log(2,()=>"Special char '"+Ah(u)+"' in channel "+s),o=[u]}else t>=32&&t<=127&&(o=i===0?[t]:[t,i]);return o&&this.logger.log(3,()=>"Char codes = "+ka(o).join(",")),o}parseBackgroundAttributes(t,i){const s=(t===16||t===24)&&i>=32&&i<=47,o=(t===23||t===31)&&i>=45&&i<=47;if(!(s||o))return!1;let l;const u={};t===16||t===24?(l=Math.floor((i-32)/2),u.background=Wo[l],i%2===1&&(u.background=u.background+"_semi")):i===45?u.background="transparent":(u.foreground="black",i===47&&(u.underline=!0));const f=t<=23?1:2;return this.channels[f].setBkgData(u),!0}reset(){for(let t=0;t<Object.keys(this.channels).length;t++){const i=this.channels[t];i&&i.reset()}Ml(null,null,this.cmdHistory)}cueSplitAtTime(t){for(let i=0;i<this.channels.length;i++){const s=this.channels[i];s&&s.cueSplitAtTime(t)}}}function Ml(h,t,i){i.a=h,i.b=t}function uu(h,t,i){return i.a===h&&i.b===t}function Dh(){return{a:null,b:null}}var zs=function(){if(Zi!=null&&Zi.VTTCue)return self.VTTCue;const h=["","lr","rl"],t=["start","middle","end","left","right"];function i(f,y){if(typeof y!="string"||!Array.isArray(f))return!1;const v=y.toLowerCase();return~f.indexOf(v)?v:!1}function s(f){return i(h,f)}function o(f){return i(t,f)}function l(f,...y){let v=1;for(;v<arguments.length;v++){const x=arguments[v];for(const w in x)f[w]=x[w]}return f}function u(f,y,v){const x=this,w={enumerable:!0};x.hasBeenReset=!1;let k="",F=!1,$=f,Q=y,te=v,xe=null,ke="",Le=!0,Ze="auto",rt="start",Lt=50,ot="middle",St=50,xt="middle";Object.defineProperty(x,"id",l({},w,{get:function(){return k},set:function(ht){k=""+ht}})),Object.defineProperty(x,"pauseOnExit",l({},w,{get:function(){return F},set:function(ht){F=!!ht}})),Object.defineProperty(x,"startTime",l({},w,{get:function(){return $},set:function(ht){if(typeof ht!="number")throw new TypeError("Start time must be set to a number.");$=ht,this.hasBeenReset=!0}})),Object.defineProperty(x,"endTime",l({},w,{get:function(){return Q},set:function(ht){if(typeof ht!="number")throw new TypeError("End time must be set to a number.");Q=ht,this.hasBeenReset=!0}})),Object.defineProperty(x,"text",l({},w,{get:function(){return te},set:function(ht){te=""+ht,this.hasBeenReset=!0}})),Object.defineProperty(x,"region",l({},w,{get:function(){return xe},set:function(ht){xe=ht,this.hasBeenReset=!0}})),Object.defineProperty(x,"vertical",l({},w,{get:function(){return ke},set:function(ht){const jt=s(ht);if(jt===!1)throw new SyntaxError("An invalid or illegal string was specified.");ke=jt,this.hasBeenReset=!0}})),Object.defineProperty(x,"snapToLines",l({},w,{get:function(){return Le},set:function(ht){Le=!!ht,this.hasBeenReset=!0}})),Object.defineProperty(x,"line",l({},w,{get:function(){return Ze},set:function(ht){if(typeof ht!="number"&&ht!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Ze=ht,this.hasBeenReset=!0}})),Object.defineProperty(x,"lineAlign",l({},w,{get:function(){return rt},set:function(ht){const jt=o(ht);if(!jt)throw new SyntaxError("An invalid or illegal string was specified.");rt=jt,this.hasBeenReset=!0}})),Object.defineProperty(x,"position",l({},w,{get:function(){return Lt},set:function(ht){if(ht<0||ht>100)throw new Error("Position must be between 0 and 100.");Lt=ht,this.hasBeenReset=!0}})),Object.defineProperty(x,"positionAlign",l({},w,{get:function(){return ot},set:function(ht){const jt=o(ht);if(!jt)throw new SyntaxError("An invalid or illegal string was specified.");ot=jt,this.hasBeenReset=!0}})),Object.defineProperty(x,"size",l({},w,{get:function(){return St},set:function(ht){if(ht<0||ht>100)throw new Error("Size must be between 0 and 100.");St=ht,this.hasBeenReset=!0}})),Object.defineProperty(x,"align",l({},w,{get:function(){return xt},set:function(ht){const jt=o(ht);if(!jt)throw new SyntaxError("An invalid or illegal string was specified.");xt=jt,this.hasBeenReset=!0}})),x.displayState=void 0}return u.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},u}();class Mh{decode(t,i){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function Pc(h){function t(s,o,l,u){return(s|0)*3600+(o|0)*60+(l|0)+parseFloat(u||0)}const i=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?t(i[2],i[3],0,i[4]):t(i[1],i[2],i[3],i[4]):null}class er{constructor(){this.values=Object.create(null)}set(t,i){!this.get(t)&&i!==""&&(this.values[t]=i)}get(t,i,s){return s?this.has(t)?this.values[t]:i[s]:this.has(t)?this.values[t]:i}has(t){return t in this.values}alt(t,i,s){for(let o=0;o<s.length;++o)if(i===s[o]){this.set(t,i);break}}integer(t,i){/^-?\d+$/.test(i)&&this.set(t,parseInt(i,10))}percent(t,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){const s=parseFloat(i);if(s>=0&&s<=100)return this.set(t,s),!0}return!1}}function Hn(h,t,i,s){const o=s?h.split(s):[h];for(const l in o){if(typeof o[l]!="string")continue;const u=o[l].split(i);if(u.length!==2)continue;const f=u[0],y=u[1];t(f,y)}}const Lh=new zs(0,0,""),Oc=Lh.align==="middle"?"middle":"center";function Ih(h,t,i){const s=h;function o(){const f=Pc(h);if(f===null)throw new Error("Malformed timestamp: "+s);return h=h.replace(/^[^\sa-zA-Z-]+/,""),f}function l(f,y){const v=new er;Hn(f,function(k,F){let $;switch(k){case"region":for(let Q=i.length-1;Q>=0;Q--)if(i[Q].id===F){v.set(k,i[Q].region);break}break;case"vertical":v.alt(k,F,["rl","lr"]);break;case"line":$=F.split(","),v.integer(k,$[0]),v.percent(k,$[0])&&v.set("snapToLines",!1),v.alt(k,$[0],["auto"]),$.length===2&&v.alt("lineAlign",$[1],["start",Oc,"end"]);break;case"position":$=F.split(","),v.percent(k,$[0]),$.length===2&&v.alt("positionAlign",$[1],["start",Oc,"end","line-left","line-right","auto"]);break;case"size":v.percent(k,F);break;case"align":v.alt(k,F,["start",Oc,"end","left","right"]);break}},/:/,/\s/),y.region=v.get("region",null),y.vertical=v.get("vertical","");let x=v.get("line","auto");x==="auto"&&Lh.line===-1&&(x=-1),y.line=x,y.lineAlign=v.get("lineAlign","start"),y.snapToLines=v.get("snapToLines",!0),y.size=v.get("size",100),y.align=v.get("align",Oc);let w=v.get("position","auto");w==="auto"&&Lh.position===50&&(w=y.align==="start"||y.align==="left"?0:y.align==="end"||y.align==="right"?100:50),y.position=w}function u(){h=h.replace(/^\s+/,"")}if(u(),t.startTime=o(),u(),h.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);h=h.slice(3),u(),t.endTime=o(),u(),l(h,t)}function Bc(h){return h.replace(/<br(?: \/)?>/gi,`
`)}class Zu{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Mh,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(t){const i=this;t&&(i.buffer+=i.decoder.decode(t,{stream:!0}));function s(){let l=i.buffer,u=0;for(l=Bc(l);u<l.length&&l[u]!=="\r"&&l[u]!==`
`;)++u;const f=l.slice(0,u);return l[u]==="\r"&&++u,l[u]===`
`&&++u,i.buffer=l.slice(u),f}function o(l){Hn(l,function(u,f){},/:/)}try{let l="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;l=s();const f=l.match(/^()?WEBVTT([ \t].*)?$/);if(!(f!=null&&f[0]))throw new Error("Malformed WebVTT signature.");i.state="HEADER"}let u=!1;for(;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(u?u=!1:l=s(),i.state){case"HEADER":/:/.test(l)?o(l):l||(i.state="ID");continue;case"NOTE":l||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(l)){i.state="NOTE";break}if(!l)continue;if(i.cue=new zs(0,0,""),i.state="CUE",l.indexOf("-->")===-1){i.cue.id=l;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{Ih(l,i.cue,i.regionList)}catch(f){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{const f=l.indexOf("-->")!==-1;if(!l||f&&(u=!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+=l}continue;case"BADCUE":l||(i.state="ID")}}}catch(l){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 t=this;try{if((t.cue||t.state==="HEADER")&&(t.buffer+=`
`,t.parse()),t.state==="INITIAL"||t.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){t.onparsingerror&&t.onparsingerror(i)}return t.onflush&&t.onflush(),this}}const q0=/\r\n|\n\r|\n|\r/g,Fc=function(t,i,s=0){return t.slice(s,s+i.length)===i},Ud=function(t){let i=parseInt(t.slice(-3));const s=parseInt(t.slice(-6,-4)),o=parseInt(t.slice(-9,-7)),l=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!U(i)||!U(s)||!U(o)||!U(l))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${t}`);return i+=1e3*s,i+=60*1e3*o,i+=60*60*1e3*l,i};function Z0(h,t,i){return ou(h.toString())+ou(t.toString())+ou(i)}const cu=function(t,i,s){let o=t[i],l=t[o.prevCC];if(!l||!l.new&&o.new){t.ccOffset=t.presentationOffset=o.start,o.new=!1;return}for(;(u=l)!=null&&u.new;){var u;t.ccOffset+=o.start-l.start,o.new=!1,o=l,l=t[o.prevCC]}t.presentationOffset=s};function Rs(h,t,i,s,o,l,u){const f=new Zu,y=$t(new Uint8Array(h)).trim().replace(q0,`
`).split(`
`),v=[],x=t?Mr(t.baseTime,t.timescale):0;let w="00:00.000",k=0,F=0,$,Q=!0;f.oncue=function(te){const xe=i[s];let ke=i.ccOffset;const Le=(k-x)/9e4;if(xe!=null&&xe.new&&(F!==void 0?ke=i.ccOffset=xe.start:cu(i,s,Le)),Le){if(!t){$=new Error("Missing initPTS for VTT MPEGTS");return}ke=Le-i.presentationOffset}const Ze=te.endTime-te.startTime,rt=Jn((te.startTime+ke-F)*9e4,o*9e4)/9e4;te.startTime=Math.max(rt,0),te.endTime=Math.max(rt+Ze,0);const Lt=te.text.trim();te.text=decodeURIComponent(encodeURIComponent(Lt)),te.id||(te.id=Z0(te.startTime,te.endTime,Lt)),te.endTime>0&&v.push(te)},f.onparsingerror=function(te){$=te},f.onflush=function(){if($){u($);return}l(v)},y.forEach(te=>{if(Q)if(Fc(te,"X-TIMESTAMP-MAP=")){Q=!1,te.slice(16).split(",").forEach(xe=>{Fc(xe,"LOCAL:")?w=xe.slice(6):Fc(xe,"MPEGTS:")&&(k=parseInt(xe.slice(7)))});try{F=Ud(w)/1e3}catch(xe){$=xe}return}else te===""&&(Q=!1);f.parse(te+`
`)}),f.flush()}const Ll="stpp.ttml.im1t",Y0=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,jo=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Ba={left:"start",center:"center",right:"end",start:"start",end:"end"};function Rh(h,t,i,s){const o=Ue(new Uint8Array(h),["mdat"]);if(o.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const l=o.map(f=>$t(f)),u=pa(t.baseTime,1,t.timescale);try{l.forEach(f=>i(Yu(f,u)))}catch(f){s(f)}}function Yu(h,t){const o=new DOMParser().parseFromString(h,"text/xml").getElementsByTagName("tt")[0];if(!o)throw new Error("Invalid ttml");const l={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},u=Object.keys(l).reduce((w,k)=>(w[k]=o.getAttribute(`ttp:${k}`)||l[k],w),{}),f=o.getAttribute("xml:space")!=="preserve",y=Nc(Il(o,"styling","style")),v=Nc(Il(o,"layout","region")),x=Il(o,"body","[begin]");return[].map.call(x,w=>{const k=Ph(w,f);if(!k||!w.hasAttribute("begin"))return null;const F=zc(w.getAttribute("begin"),u),$=zc(w.getAttribute("dur"),u);let Q=zc(w.getAttribute("end"),u);if(F===null)throw Oh(w);if(Q===null){if($===null)throw Oh(w);Q=F+$}const te=new zs(F-t,Q-t,k);te.id=Z0(te.startTime,te.endTime,te.text);const xe=v[w.getAttribute("region")],ke=y[w.getAttribute("style")],Le=X0(xe,ke,y),{textAlign:Ze}=Le;if(Ze){const rt=Ba[Ze];rt&&(te.lineAlign=rt),te.align=Ze}return M(te,Le),te}).filter(w=>w!==null)}function Il(h,t,i){const s=h.getElementsByTagName(t)[0];return s?[].slice.call(s.querySelectorAll(i)):[]}function Nc(h){return h.reduce((t,i)=>{const s=i.getAttribute("xml:id");return s&&(t[s]=i),t},{})}function Ph(h,t){return[].slice.call(h.childNodes).reduce((i,s,o)=>{var l;return s.nodeName==="br"&&o?i+`
`:(l=s.childNodes)!=null&&l.length?Ph(s,t):t?i+s.textContent.trim().replace(/\s+/g," "):i+s.textContent},"")}function X0(h,t,i){const s="http://www.w3.org/ns/ttml#styling";let o=null;const l=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],u=h!=null&&h.hasAttribute("style")?h.getAttribute("style"):null;return u&&i.hasOwnProperty(u)&&(o=i[u]),l.reduce((f,y)=>{const v=$c(t,s,y)||$c(h,s,y)||$c(o,s,y);return v&&(f[y]=v),f},{})}function $c(h,t,i){return h&&h.hasAttributeNS(t,i)?h.getAttributeNS(t,i):null}function Oh(h){return new Error(`Could not parse ttml timestamp ${h}`)}function zc(h,t){if(!h)return null;let i=Pc(h);return i===null&&(Y0.test(h)?i=Xu(h,t):jo.test(h)&&(i=Ju(h,t))),i}function Xu(h,t){const i=Y0.exec(h),s=(i[4]|0)+(i[5]|0)/t.subFrameRate;return(i[1]|0)*3600+(i[2]|0)*60+(i[3]|0)+s/t.frameRate}function Ju(h,t){const i=jo.exec(h),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/t.frameRate;case"t":return s/t.tickRate}return s}class hu{constructor(t,i){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=i}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(t,i,s){(this.startTime===null||this.startTime>t)&&(this.startTime=t),this.endTime=i,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class Rl{constructor(t){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=J0(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.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}},t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(E.FRAG_LOADING,this.onFragLoading,this),t.on(E.FRAG_LOADED,this.onFragLoaded,this),t.on(E.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(E.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(E.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(E.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(E.FRAG_LOADING,this.onFragLoading,this),t.off(E.FRAG_LOADED,this.onFragLoaded,this),t.off(E.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(E.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(E.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(E.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const t=new hu(this,"textTrack1"),i=new hu(this,"textTrack2"),s=new hu(this,"textTrack3"),o=new hu(this,"textTrack4");this.cea608Parser1=new Rc(1,t,i),this.cea608Parser2=new Rc(3,s,o)}addCues(t,i,s,o,l){let u=!1;for(let f=l.length;f--;){const y=l[f],v=Fh(y[0],y[1],i,s);if(v>=0&&(y[0]=Math.min(y[0],i),y[1]=Math.max(y[1],s),u=!0,v/(s-i)>.5))return}if(u||l.push([i,s]),this.config.renderTextTracksNatively){const f=this.captionsTracks[t];this.Cues.newCue(f,i,s,o)}else{const f=this.Cues.newCue(null,i,s,o);this.hls.trigger(E.CUES_PARSED,{type:"captions",cues:f,track:t})}}onInitPtsFound(t,{frag:i,id:s,initPTS:o,timescale:l,trackId:u}){const{unparsedVttFrags:f}=this;s===z.MAIN&&(this.initPTS[i.cc]={baseTime:o,timescale:l,trackId:u}),f.length&&(this.unparsedVttFrags=[],f.forEach(y=>{this.initPTS[y.frag.cc]?this.onFragLoaded(E.FRAG_LOADED,y):this.hls.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:y.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(t,i){const{media:s}=this;if(s)for(let o=0;o<s.textTracks.length;o++){const l=s.textTracks[o];if(Bh(l,{name:t,lang:i,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return l}return null}createCaptionsTrack(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)}createNativeTrack(t){if(this.captionsTracks[t])return;const{captionsProperties:i,captionsTracks:s,media:o}=this,{label:l,languageCode:u}=i[t],f=this.getExistingTrack(l,u);if(f)s[t]=f,va(s[t]),kl(s[t],o);else{const y=this.createTextTrack("captions",l,u);y&&(y[t]=!0,s[t]=y)}}createNonNativeTrack(t){if(this.nonNativeCaptionsTracks[t])return;const i=this.captionsProperties[t];if(!i)return;const s=i.label,o={_id:t,label:s,kind:"captions",default:i.media?!!i.media.default:!1,closedCaptions:i.media};this.nonNativeCaptionsTracks[t]=o,this.hls.trigger(E.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[o]})}createTextTrack(t,i,s){const o=this.media;if(o)return o.addTextTrack(t,i,s)}onMediaAttaching(t,i){this.media=i.media,i.mediaSource||this._cleanTracks()}onMediaDetaching(t,i){const s=!!i.transferMedia;if(this.media=null,s)return;const{captionsTracks:o}=this;Object.keys(o).forEach(l=>{va(o[l]),delete o[l]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=J0(),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:t}=this;if(!t)return;const i=t.textTracks;if(i)for(let s=0;s<i.length;s++)va(i[s])}onSubtitleTracksUpdated(t,i){const s=i.subtitleTracks||[],o=s.some(l=>l.textCodec===Ll);if(this.config.enableWebVTT||o&&this.config.enableIMSC1){if(ih(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const u=this.media,f=u?Tl(u.textTracks):null;if(this.tracks.forEach((y,v)=>{let x;if(f){let w=null;for(let k=0;k<f.length;k++)if(f[k]&&Bh(f[k],y)){w=f[k],f[k]=null;break}w&&(x=w)}if(x)va(x);else{const w=ko(y);x=this.createTextTrack(w,y.name,y.lang),x&&(x.mode="disabled")}x&&this.textTracks.push(x)}),f!=null&&f.length){const y=f.filter(v=>v!==null).map(v=>v.label);y.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${y.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const u=this.tracks.map(f=>({label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}));this.hls.trigger(E.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:u})}}}onManifestLoaded(t,i){this.config.enableCEA708Captions&&i.captions&&i.captions.forEach(s=>{const o=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!o)return;const l=`textTrack${o[1]}`,u=this.captionsProperties[l];u&&(u.label=s.name,s.lang&&(u.languageCode=s.lang),u.media=s)})}closedCaptionsForLevel(t){const i=this.hls.levels[t.level];return i==null?void 0:i.attrs["CLOSED-CAPTIONS"]}onFragLoading(t,i){if(this.enabled&&i.frag.type===z.MAIN){var s,o;const{cea608Parser1:l,cea608Parser2:u,lastSn:f}=this,{cc:y,sn:v}=i.frag,x=(s=(o=i.part)==null?void 0:o.index)!=null?s:-1;l&&u&&(v!==f+1||v===f&&x!==this.lastPartIndex+1||y!==this.lastCc)&&(l.reset(),u.reset()),this.lastCc=y,this.lastSn=v,this.lastPartIndex=x}}onFragLoaded(t,i){const{frag:s,payload:o}=i;if(s.type===z.SUBTITLE)if(o.byteLength){const l=s.decryptdata,u="stats"in i;if(l==null||!l.encrypted||u){const f=this.tracks[s.level],y=this.vttCCs;y[s.cc]||(y[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),f&&f.textCodec===Ll?this._parseIMSC1(s,o):this._parseVTTs(i)}}else this.hls.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,i){const s=this.hls;Rh(i,this.initPTS[t.cc],o=>{this._appendCues(o,t.level),s.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},o=>{s.logger.log(`Failed to parse IMSC1: ${o}`),s.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:o})})}_parseVTTs(t){var i;const{frag:s,payload:o}=t,{initPTS:l,unparsedVttFrags:u}=this,f=l.length-1;if(!l[s.cc]&&f===-1){u.push(t);return}const y=this.hls,v=(i=s.initSegment)!=null&&i.data?Kt(s.initSegment.data,new Uint8Array(o)).buffer:o;Rs(v,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,x=>{this._appendCues(x,s.level),y.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},x=>{const w=x.message==="Missing initPTS for VTT MPEGTS";w?u.push(t):this._fallbackToIMSC1(s,o),y.logger.log(`Failed to parse VTT cue: ${x}`),!(w&&f>s.cc)&&y.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:x})})}_fallbackToIMSC1(t,i){const s=this.tracks[t.level];s.textCodec||Rh(i,this.initPTS[t.cc],()=>{s.textCodec=Ll,this._parseIMSC1(t,i)},()=>{s.textCodec="wvtt"})}_appendCues(t,i){const s=this.hls;if(this.config.renderTextTracksNatively){const o=this.textTracks[i];if(!o||o.mode==="disabled")return;t.forEach(l=>io(o,l))}else{const o=this.tracks[i];if(!o)return;const l=o.default?"default":"subtitles"+i;s.trigger(E.CUES_PARSED,{type:"subtitles",cues:t,track:l})}}onFragDecrypted(t,i){const{frag:s}=i;s.type===z.SUBTITLE&&this.onFragLoaded(E.FRAG_LOADED,i)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,i){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:s,samples:o}=i;if(!(s.type===z.MAIN&&this.closedCaptionsForLevel(s)==="NONE"))for(let l=0;l<o.length;l++){const u=o[l].bytes;if(u){this.cea608Parser1||this.initCea608Parsers();const f=this.extractCea608Data(u);this.cea608Parser1.addData(o[l].pts,f[0]),this.cea608Parser2.addData(o[l].pts,f[1])}}}onBufferFlushing(t,{startOffset:i,endOffset:s,endOffsetSubtitles:o,type:l}){const{media:u}=this;if(!(!u||u.currentTime<s)){if(!l||l==="video"){const{captionsTracks:f}=this;Object.keys(f).forEach(y=>no(f[y],i,s))}if(this.config.renderTextTracksNatively&&i===0&&o!==void 0){const{textTracks:f}=this;Object.keys(f).forEach(y=>no(f[y],i,o))}}}extractCea608Data(t){const i=[[],[]],s=t[0]&31;let o=2;for(let l=0;l<s;l++){const u=t[o++],f=127&t[o++],y=127&t[o++];if(f===0&&y===0)continue;if((4&u)!==0){const x=3&u;(x===0||x===1)&&(i[x].push(f),i[x].push(y))}}return i}}function ko(h){return h.characteristics&&/transcribes-spoken-dialog/gi.test(h.characteristics)&&/describes-music-and-sound/gi.test(h.characteristics)?"captions":"subtitles"}function Bh(h,t){return!!h&&h.kind===ko(t)&&ru(t,h)}function Fh(h,t,i,s){return Math.min(t,s)-Math.max(h,i)}function J0(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const Nh=/\s/,Hd={newCue(h,t,i,s){const o=[];let l,u,f,y,v;const x=self.VTTCue||self.TextTrackCue;for(let k=0;k<s.rows.length;k++)if(l=s.rows[k],f=!0,y=0,v="",!l.isEmpty()){var w;for(let Q=0;Q<l.chars.length;Q++)Nh.test(l.chars[Q].uchar)&&f?y++:(v+=l.chars[Q].uchar,f=!1);l.cueStartTime=t,t===i&&(i+=1e-4),y>=16?y--:y++;const F=Bc(v.trim()),$=Z0(t,i,F);h!=null&&(w=h.cues)!=null&&w.getCueById($)||(u=new x(t,i,F),u.id=$,u.line=k+1,u.align="left",u.position=10+Math.min(80,Math.floor(y*8/32)*10),o.push(u))}return h&&o.length&&(o.sort((k,F)=>k.line==="auto"||F.line==="auto"?0:k.line>8&&F.line>8?F.line-k.line:k.line-F.line),o.forEach(k=>io(h,k))),o}};function Gd(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(h){}return!1}const Vd=/(\d+)-(\d+)\/(\d+)/;class $h{constructor(t){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=t.fetchSetup||qd,this.controller=new self.AbortController,this.stats=new R}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 t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(t,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 l=Wd(t,this.controller.signal),u=t.responseType==="arraybuffer",f=u?"byteLength":"length",{maxTimeToFirstByteMs:y,maxLoadTimeMs:v}=i.loadPolicy;this.context=t,this.config=i,this.callbacks=s,this.request=this.fetchSetup(t,l),self.clearTimeout(this.requestTimeout),i.timeout=y&&U(y)?y:v,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(o,t,this.response))},i.timeout),(Fu(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(w=>{var k;this.response=this.loader=w;const F=Math.max(self.performance.now(),o.loading.start);if(self.clearTimeout(this.requestTimeout),i.timeout=v,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(o,t,this.response))},v-(F-o.loading.start)),!w.ok){const{status:Q,statusText:te}=w;throw new Zd(te||"fetch, bad network response",Q,w)}o.loading.first=F,o.total=jd(w.headers)||o.total;const $=(k=this.callbacks)==null?void 0:k.onProgress;return $&&U(i.highWaterMark)?this.loadProgressively(w,o,t,i.highWaterMark,$):u?w.arrayBuffer():t.responseType==="json"?w.json():w.text()}).then(w=>{var k,F;const $=this.response;if(!$)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),o.loading.end=Math.max(self.performance.now(),o.loading.first);const Q=w[f];Q&&(o.loaded=o.total=Q);const te={url:$.url,data:w,code:$.status},xe=(k=this.callbacks)==null?void 0:k.onProgress;xe&&!U(i.highWaterMark)&&xe(o,t,w,$),(F=this.callbacks)==null||F.onSuccess(te,o,t,$)}).catch(w=>{var k;if(self.clearTimeout(this.requestTimeout),o.aborted)return;const F=w&&w.code||0,$=w?w.message:null;(k=this.callbacks)==null||k.onError({code:F,text:$},t,w?w.details:null,o)})}getCacheAge(){let t=null;if(this.response){const i=this.response.headers.get("age");t=i?parseFloat(i):null}return t}getResponseHeader(t){return this.response?this.response.headers.get(t):null}loadProgressively(t,i,s,o=0,l){const u=new Hl,f=t.body.getReader(),y=()=>f.read().then(v=>{if(v.done)return u.dataLength&&l(i,s,u.flush().buffer,t),Promise.resolve(new ArrayBuffer(0));const x=v.value,w=x.length;return i.loaded+=w,w<o||u.dataLength?(u.push(x),u.dataLength>=o&&l(i,s,u.flush().buffer,t)):l(i,s,x.buffer,t),y()}).catch(()=>Promise.reject());return y()}}function Wd(h,t){const i={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(M({},h.headers))};return h.rangeEnd&&i.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),i}function zh(h){const t=Vd.exec(h);if(t)return parseInt(t[2])-parseInt(t[1])+1}function jd(h){const t=h.get("Content-Range");if(t){const s=zh(t);if(U(s))return s}const i=h.get("Content-Length");if(i)return parseInt(i)}function qd(h,t){return new self.Request(h.url,t)}class Zd extends Error{constructor(t,i,s){super(t),this.code=void 0,this.details=void 0,this.code=i,this.details=s}}const Yd=/^age:\s*[\d.]+\s*$/im;class Kh{constructor(t){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=t&&t.xhrSetup||null,this.stats=new R,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,t.readyState!==4&&(this.stats.aborted=!0,t.abort()))}abort(){var t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(t,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=t,this.config=i,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:t,context:i}=this;if(!t||!i)return;const s=this.loader=new self.XMLHttpRequest,o=this.stats;o.loading.first=0,o.loaded=0,o.aborted=!1;const l=this.xhrSetup;l?Promise.resolve().then(()=>{if(!(this.loader!==s||this.stats.aborted))return l(s,i.url)}).catch(u=>{if(!(this.loader!==s||this.stats.aborted))return s.open("GET",i.url,!0),l(s,i.url)}).then(()=>{this.loader!==s||this.stats.aborted||this.openAndSendXhr(s,i,t)}).catch(u=>{var f;(f=this.callbacks)==null||f.onError({code:s.status,text:u.message},i,s,o)}):this.openAndSendXhr(s,i,t)}openAndSendXhr(t,i,s){t.readyState||t.open("GET",i.url,!0);const o=i.headers,{maxTimeToFirstByteMs:l,maxLoadTimeMs:u}=s.loadPolicy;if(o)for(const f in o)t.setRequestHeader(f,o[f]);i.rangeEnd&&t.setRequestHeader("Range","bytes="+i.rangeStart+"-"+(i.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=i.responseType,self.clearTimeout(this.requestTimeout),s.timeout=l&&U(l)?l:u,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),t.send()}readystatechange(){const{context:t,loader:i,stats:s}=this;if(!t||!i)return;const o=i.readyState,l=this.config;if(!s.aborted&&o>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),l.timeout!==l.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),l.timeout=l.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),o===4)){self.clearTimeout(this.requestTimeout),i.onreadystatechange=null,i.onprogress=null;const v=i.status,x=i.responseType==="text"?i.responseText:null;if(v>=200&&v<300){const $=x!=null?x:i.response;if($!=null){var u,f;s.loading.end=Math.max(self.performance.now(),s.loading.first);const Q=i.responseType==="arraybuffer"?$.byteLength:$.length;s.loaded=s.total=Q,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first);const te=(u=this.callbacks)==null?void 0:u.onProgress;te&&te(s,t,$,i);const xe={url:i.responseURL,data:$,code:v};(f=this.callbacks)==null||f.onSuccess(xe,s,t,i);return}}const w=l.loadPolicy.errorRetry,k=s.retry,F={url:t.url,data:void 0,code:v};if(ln(w,k,!1,F))this.retry(w);else{var y;Se.error(`${v} while loading ${t.url}`),(y=this.callbacks)==null||y.onError({code:v,text:i.statusText},t,i,s)}}}loadtimeout(){if(!this.config)return;const t=this.config.loadPolicy.timeoutRetry,i=this.stats.retry;if(ln(t,i,!0))this.retry(t);else{var s;Se.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(t){const{context:i,stats:s}=this;this.retryDelay=hi(t,s.retry),s.retry++,Se.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${i==null?void 0:i.url}, retrying ${s.retry}/${t.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(t){const i=this.stats;i.loaded=t.loaded,t.lengthComputable&&(i.total=t.total)}getCacheAge(){let t=null;if(this.loader&&Yd.test(this.loader.getAllResponseHeaders())){const i=this.loader.getResponseHeader("age");t=i?parseFloat(i):null}return t}getResponseHeader(t){return this.loader&&new RegExp(`^${t}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(t):null}}const Uh={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Xd=O(O({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,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,ignorePlaylistParsingErrors:!1,loader:Kh,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:ci,bufferController:nh,capLevelController:wc,errorController:qi,fpsController:Al,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:Pi,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:Uh},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}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,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},Jd()),{},{subtitleStreamController:$d,subtitleTrackController:H0,timelineController:Rl,audioStreamController:yd,audioTrackController:Yi,emeController:au,cmcdController:vh,contentSteeringController:Rd,interstitialsController:Sh});function Jd(){return{cueHandler:Hd,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 Qd(h,t,i){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const s=Qu(h),o=["manifest","level","frag"],l=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return o.forEach(u=>{const f=`${u==="level"?"playlist":u}LoadPolicy`,y=t[f]===void 0,v=[];l.forEach(x=>{const w=`${u}Loading${x}`,k=t[w];if(k!==void 0&&y){v.push(w);const F=s[f].default;switch(t[f]={default:F},x){case"TimeOut":F.maxLoadTimeMs=k,F.maxTimeToFirstByteMs=k;break;case"MaxRetry":F.errorRetry.maxNumRetry=k,F.timeoutRetry.maxNumRetry=k;break;case"RetryDelay":F.errorRetry.retryDelayMs=k,F.timeoutRetry.retryDelayMs=k;break;case"MaxRetryTimeout":F.errorRetry.maxRetryDelayMs=k,F.timeoutRetry.maxRetryDelayMs=k;break}}}),v.length&&i.warn(`hls.js config: "${v.join('", "')}" setting(s) are deprecated, use "${f}": ${tt(t[f])}`)}),O(O({},s),t)}function Qu(h){return h&&typeof h=="object"?Array.isArray(h)?h.map(Qu):Object.keys(h).reduce((t,i)=>(t[i]=Qu(h[i]),t),{}):h}function Hh(h,t){const i=h.loader;i!==$h&&i!==Kh?(t.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1):Gd()&&(h.loader=$h,h.progressive=!0,h.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}const e0=2,ef=.1,tf=.05,rf=100;class nf extends as{constructor(t,i){super("gap-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var s;(s=this.media)!=null&&s.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var s;this.ended=((s=this.media)==null?void 0:s.currentTime)||1,this.hls.trigger(E.MEDIA_ENDED,{stalled:!1})}},this.hls=t,this.fragmentTracker=i,this.registerListeners()}registerListeners(){const{hls:t}=this;t&&(t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(t,i){this.setInterval(rf),this.mediaSource=i.mediaSource;const s=this.media=i.media;Ms(s,"playing",this.onMediaPlaying),Ms(s,"waiting",this.onMediaWaiting),Ms(s,"ended",this.onMediaEnded)}onMediaDetaching(t,i){this.clearInterval();const{media:s}=this;s&&(xs(s,"playing",this.onMediaPlaying),xs(s,"waiting",this.onMediaWaiting),xs(s,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(t,i){this.buffered=i.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var t;if(!((t=this.media)!=null&&t.readyState)||!this.hasBuffered)return;const i=this.media.currentTime;this.poll(i,this.lastCurrentTime),this.lastCurrentTime=i}poll(t,i){var s,o;const l=(s=this.hls)==null?void 0:s.config;if(!l)return;const u=this.media;if(!u)return;const{seeking:f}=u,y=this.seeking&&!f,v=!this.seeking&&f,x=u.paused&&!f||u.ended||u.playbackRate===0;if(this.seeking=f,t!==i){i&&(this.ended=0),this.moved=!0,f||(this.nudgeRetry=0,l.nudgeOnVideoHole&&!x&&t>i&&this.nudgeOnVideoHole(t,i)),this.waiting===0&&this.stallResolved(t);return}if(v||y){y&&this.stallResolved(t);return}if(x){this.nudgeRetry=0,this.stallResolved(t),!this.ended&&u.ended&&this.hls&&(this.ended=t||1,this.hls.trigger(E.MEDIA_ENDED,{stalled:!1}));return}if(!di.getBuffered(u).length){this.nudgeRetry=0;return}const w=di.bufferInfo(u,t,0),k=w.nextStart||0,F=this.fragmentTracker;if(f&&F&&this.hls){const Lt=Gh(this.hls.inFlightFragments,t),ot=w.len>e0,St=!k||Lt||k-t>e0&&!F.getPartialFragment(t);if(ot||St)return;this.moved=!1}const $=(o=this.hls)==null?void 0:o.latestLevelDetails;if(!this.moved&&this.stalled!==null&&F){if(!(w.len>0)&&!k)return;const ot=Math.max(k,w.start||0)-t,xt=!!($!=null&&$.live)?$.targetduration*2:e0,ht=Q0(t,F);if(ot>0&&(ot<=xt||ht)){u.paused||this._trySkipBufferHole(ht);return}}const Q=l.detectStallWithCurrentTimeMs,te=self.performance.now(),xe=this.waiting;let ke=this.stalled;if(ke===null)if(xe>0&&te-xe<Q)ke=this.stalled=xe;else{this.stalled=te;return}const Le=te-ke;if(!f&&(Le>=Q||xe)&&this.hls){var Ze;if(((Ze=this.mediaSource)==null?void 0:Ze.readyState)==="ended"&&!($!=null&&$.live)&&Math.abs(t-(($==null?void 0:$.edge)||0))<1){if(this.ended)return;this.ended=t||1,this.hls.trigger(E.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(w),!this.media||!this.hls)return}const rt=di.bufferInfo(u,t,l.maxBufferHole);this._tryFixBufferStall(rt,Le,t)}stallResolved(t){const i=this.stalled;if(i&&this.hls&&(this.stalled=null,this.stallReported)){const s=self.performance.now()-i;this.log(`playback not stuck anymore @${t}, after ${Math.round(s)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(E.STALL_RESOLVED,{})}}nudgeOnVideoHole(t,i){var s;const o=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(s=this.buffered.audio)!=null&&s.length&&o&&o.length>1&&t>o.end(0)){const l=di.bufferedInfo(di.timeRangesToArray(this.buffered.audio),t,0);if(l.len>1&&i>=l.start){const u=di.timeRangesToArray(o),f=di.bufferedInfo(u,i,0).bufferedIndex;if(f>-1&&f<u.length-1){const y=di.bufferedInfo(u,t,0).bufferedIndex,v=u[f].end,x=u[f+1].start;if((y===-1||y>f)&&x-v<1&&t-v<2){const w=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${t} hole: ${v} -> ${x} buffered index: ${y}`);this.warn(w.message),this.media.currentTime+=1e-6;let k=Q0(t,this.fragmentTracker);k&&"fragment"in k?k=k.fragment:k||(k=void 0);const F=di.bufferInfo(this.media,t,0);this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:w,reason:w.message,frag:k,buffer:F.len,bufferInfo:F})}}}}}_tryFixBufferStall(t,i,s){var o,l;const{fragmentTracker:u,media:f}=this,y=(o=this.hls)==null?void 0:o.config;if(!f||!u||!y)return;const v=(l=this.hls)==null?void 0:l.latestLevelDetails,x=Q0(s,u);if((x||v!=null&&v.live&&s<v.fragmentStart)&&(this._trySkipBufferHole(x)||!this.media))return;const w=t.buffered,k=this.adjacentTraversal(t,s);(w&&w.length>1&&t.len>y.maxBufferHole||t.nextStart&&(t.nextStart-s<y.maxBufferHole||k))&&(i>y.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(t))}adjacentTraversal(t,i){const s=this.fragmentTracker,o=t.nextStart;if(s&&o){const l=s.getFragAtPos(i,z.MAIN),u=s.getFragAtPos(o,z.MAIN);if(l&&u)return u.sn-l.sn<2}return!1}_reportStall(t){const{hls:i,media:s,stallReported:o,stalled:l}=this;if(!o&&l!==null&&s&&i){this.stallReported=!0;const u=new Error(`Playback stalling at @${s.currentTime} due to low buffer (${tt(t)})`);this.warn(u.message),i.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.BUFFER_STALLED_ERROR,fatal:!1,error:u,buffer:t.len,bufferInfo:t,stalled:{start:l}})}}_trySkipBufferHole(t){var i;const{fragmentTracker:s,media:o}=this,l=(i=this.hls)==null?void 0:i.config;if(!o||!s||!l)return 0;const u=o.currentTime,f=di.bufferInfo(o,u,0),y=u<f.start?f.start:f.nextStart;if(y&&this.hls){const x=f.len<=l.maxBufferHole,w=f.len>0&&f.len<1&&o.readyState<3,k=y-u;if(k>0&&(x||w)){if(k>l.maxBufferHole){let $=!1;if(u===0){const Q=s.getAppendedFrag(0,z.MAIN);Q&&y<Q.end&&($=!0)}if(!$&&t){var v;if(!((v=this.hls.loadLevelObj)!=null&&v.details)||Gh(this.hls.inFlightFragments,y))return 0;let te=!1,xe=t.end;for(;xe<y;){const ke=Q0(xe,s);if(ke)xe+=ke.duration;else{te=!0;break}}if(te)return 0}}const F=Math.max(y+tf,u+ef);if(this.warn(`skipping hole, adjusting currentTime from ${u} to ${F}`),this.moved=!0,o.currentTime=F,!(t!=null&&t.gap)){const $=new Error(`fragment loaded with buffer holes, seeking from ${u} to ${F}`),Q={type:Me.MEDIA_ERROR,details:ae.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:$,reason:$.message,buffer:f.len,bufferInfo:f};t&&("fragment"in t?Q.part=t:Q.frag=t),this.hls.trigger(E.ERROR,Q)}return F}}return 0}_tryNudgeBuffer(t){const{hls:i,media:s,nudgeRetry:o}=this,l=i==null?void 0:i.config;if(!s||!l)return 0;const u=s.currentTime;if(this.nudgeRetry++,o<l.nudgeMaxRetry){const f=u+(o+1)*l.nudgeOffset,y=new Error(`Nudging 'currentTime' from ${u} to ${f}`);this.warn(y.message),s.currentTime=f,i.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.BUFFER_NUDGE_ON_STALL,error:y,fatal:!1,buffer:t.len,bufferInfo:t})}else{const f=new Error(`Playhead still not moving while enough data buffered @${u} after ${l.nudgeMaxRetry} nudges`);this.error(f.message),i.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.BUFFER_STALLED_ERROR,error:f,fatal:!0,buffer:t.len,bufferInfo:t})}}}function Gh(h,t){const i=Vh(h.main);if(i&&i.start<=t)return i;const s=Vh(h.audio);return s&&s.start<=t?s:null}function Vh(h){if(!h)return null;switch(h.state){case Vt.IDLE:case Vt.STOPPED:case Vt.ENDED:case Vt.ERROR:return null}return h.frag}function Q0(h,t){return t.getAppendedFrag(h,z.MAIN)||t.getPartialFragment(h)}const sf=.25;function Kc(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function ec(h,t,i,s,o){let l=new h(t,i,"");try{l.value=s,o&&(l.type=o)}catch(u){l=new h(t,i,tt(o?O({type:o},s):s))}return l}const To=(()=>{const h=Kc();try{h&&new h(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class af{constructor(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(E.EVENT_CUE_ENTER,{})},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:t}=this;t&&(t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(E.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(E.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(t,i){var s;this.media=i.media,((s=i.overrides)==null?void 0:s.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var t;const i=(t=this.hls)==null?void 0:t.latestLevelDetails;i&&this.updateDateRangeCues(i)}onMediaDetaching(t,i){this.media=null,!i.transferMedia&&(this.id3Track&&(this.removeCues&&va(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(t){const i=this.getID3Track(t.textTracks);return i.mode="hidden",i}getID3Track(t){if(this.media){for(let i=0;i<t.length;i++){const s=t[i];if(s.kind==="metadata"&&s.label==="id3")return kl(s,this.media),s}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(t,i){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:s,enableID3MetadataCues:o}=this.hls.config;if(!s&&!o)return;const{samples:l}=i;this.id3Track||(this.id3Track=this.createTrack(this.media));const u=Kc();if(u)for(let f=0;f<l.length;f++){const y=l[f].type;if(y===Ls.emsg&&!s||!o)continue;const v=Xl(l[f].data),x=l[f].pts;let w=x+l[f].duration;w>To&&(w=To),w-x<=0&&(w=x+sf);for(let F=0;F<v.length;F++){const $=v[F];if(!Iu($)){this.updateId3CueEnds(x,y);const Q=ec(u,x,w,$,y);Q&&this.id3Track.addCue(Q)}}}}updateId3CueEnds(t,i){var s;const o=(s=this.id3Track)==null?void 0:s.cues;if(o)for(let l=o.length;l--;){const u=o[l];u.type===i&&u.startTime<t&&u.endTime===To&&(u.endTime=t)}}onBufferFlushing(t,{startOffset:i,endOffset:s,type:o}){const{id3Track:l,hls:u}=this;if(!u)return;const{config:{enableEmsgMetadataCues:f,enableID3MetadataCues:y}}=u;if(l&&(f||y)){let v;o==="audio"?v=x=>x.type===Ls.audioId3&&y:o==="video"?v=x=>x.type===Ls.emsg&&f:v=x=>x.type===Ls.audioId3&&y||x.type===Ls.emsg&&f,no(l,i,s,v)}}onLevelUpdated(t,{details:i}){this.updateDateRangeCues(i,!0)}onLevelPtsUpdated(t,i){Math.abs(i.drift)>.01&&this.updateDateRangeCues(i.details)}updateDateRangeCues(t,i){if(!this.hls||!this.media)return;const{assetPlayerId:s,timelineOffset:o,enableDateRangeMetadataCues:l,interstitialsController:u}=this.hls.config;if(!l)return;const f=Kc();if(s&&o&&!u){const{fragmentStart:Q,fragmentEnd:te}=t;let xe=this.assetCue;xe?(xe.startTime=Q,xe.endTime=te):f&&(xe=this.assetCue=ec(f,Q,te,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),xe&&(xe.id=s,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(xe),xe.addEventListener("enter",this.onEventCueEnter)))}if(!t.hasProgramDateTime)return;const{id3Track:y}=this,{dateRanges:v}=t,x=Object.keys(v);let w=this.dateRangeCuesAppended;if(y&&i){var k;if((k=y.cues)!=null&&k.length){const Q=Object.keys(w).filter(te=>!x.includes(te));for(let te=Q.length;te--;){var F;const xe=Q[te],ke=(F=w[xe])==null?void 0:F.cues;delete w[xe],ke&&Object.keys(ke).forEach(Le=>{const Ze=ke[Le];if(Ze){Ze.removeEventListener("enter",this.onEventCueEnter);try{y.removeCue(Ze)}catch(rt){}}})}}else w=this.dateRangeCuesAppended={}}const $=t.fragments[t.fragments.length-1];if(!(x.length===0||!U($==null?void 0:$.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let Q=0;Q<x.length;Q++){const te=x[Q],xe=v[te],ke=xe.startTime,Le=w[te],Ze=(Le==null?void 0:Le.cues)||{};let rt=(Le==null?void 0:Le.durationKnown)||!1,Lt=To;const{duration:ot,endDate:St}=xe;if(St&&ot!==null)Lt=ke+ot,rt=!0;else if(xe.endOnNext&&!rt){const ht=x.reduce((jt,Br)=>{if(Br!==xe.id){const ei=v[Br];if(ei.class===xe.class&&ei.startDate>xe.startDate&&(!jt||xe.startDate<jt.startDate))return ei}return jt},null);ht&&(Lt=ht.startTime,rt=!0)}const xt=Object.keys(xe.attr);for(let ht=0;ht<xt.length;ht++){const jt=xt[ht];if(!fs(jt))continue;const Br=Ze[jt];if(Br)rt&&!(Le!=null&&Le.durationKnown)?Br.endTime=Lt:Math.abs(Br.startTime-ke)>.01&&(Br.startTime=ke,Br.endTime=Lt);else if(f){let ei=xe.attr[jt];jn(jt)&&(ei=oe(ei));const Xr=ec(f,ke,Lt,{key:jt,data:ei},Ls.dateRange);Xr&&(Xr.id=te,this.id3Track.addCue(Xr),Ze[jt]=Xr,u&&(jt==="X-ASSET-LIST"||jt==="X-ASSET-URL")&&Xr.addEventListener("enter",this.onEventCueEnter))}}w[te]={cues:Ze,dateRange:xe,durationKnown:rt}}}}}class t0{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:i}=this,s=this.levelDetails;if(!i||!s)return;this.currentTime=i.currentTime;const o=this.computeLatency();if(o===null)return;this._latency=o;const{lowLatencyMode:l,maxLiveSyncPlaybackRate:u}=this.config;if(!l||u===1||!s.live)return;const f=this.targetLatency;if(f===null)return;const y=o-f,v=Math.min(this.maxLatency,f+s.targetduration);if(y<v&&y>.05&&this.forwardBufferLength>1){const w=Math.min(2,Math.max(1,u)),k=Math.round(2/(1+Math.exp(-.75*y-this.edgeStalled))*20)/20,F=Math.min(w,Math.max(1,k));this.changeMediaPlaybackRate(i,F)}else i.playbackRate!==1&&i.playbackRate!==0&&this.changeMediaPlaybackRate(i,1)},this.hls=t,this.config=t.config,this.registerListeners()}get levelDetails(){var t;return((t=this.hls)==null?void 0:t.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:t}=this;if(t.liveMaxLatencyDuration!==void 0)return t.liveMaxLatencyDuration;const i=this.levelDetails;return i?t.liveMaxLatencyDurationCount*i.targetduration:0}get targetLatency(){const t=this.levelDetails;if(t===null||this.hls===null)return null;const{holdBack:i,partHoldBack:s,targetduration:o}=t,{liveSyncDuration:l,liveSyncDurationCount:u,lowLatencyMode:f}=this.config,y=this.hls.userConfig;let v=f&&s||i;(this._targetLatencyUpdated||y.liveSyncDuration||y.liveSyncDurationCount||v===0)&&(v=l!==void 0?l:u*o);const x=o;return v+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,x)}set targetLatency(t){this.stallCount=0,this.config.liveSyncDuration=t,this._targetLatencyUpdated=!0}get liveSyncPosition(){const t=this.estimateLiveEdge(),i=this.targetLatency;if(t===null||i===null)return null;const s=this.levelDetails;if(s===null)return null;const o=s.edge,l=t-i-this.edgeStalled,u=o-s.totalduration,f=o-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(u,l),f)}get drift(){const t=this.levelDetails;return t===null?1:t.drift}get edgeStalled(){const t=this.levelDetails;if(t===null)return 0;const i=(this.config.lowLatencyMode&&t.partTarget||t.targetduration)*3;return Math.max(t.age-i,0)}get forwardBufferLength(){const{media:t}=this,i=this.levelDetails;if(!t||!i)return 0;const s=t.buffered.length;return(s?t.buffered.end(s-1):i.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:t}=this;t&&(t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(E.ERROR,this.onError,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(E.ERROR,this.onError,this))}onMediaAttached(t,i){this.media=i.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(t,{details:i}){i.advanced&&this.onTimeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(t,i){var s;i.details===ae.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(s=this.levelDetails)!=null&&s.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(t,i){var s,o;t.playbackRate!==i&&((s=this.hls)==null||s.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(o=this.targetLatency)==null?void 0:o.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${t.playbackRate} to ${i}`),t.playbackRate=i)}estimateLiveEdge(){const t=this.levelDetails;return t===null?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return t===null?null:t-this.currentTime}}class r0 extends T0{constructor(t,i){super(t,"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:t}=this;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this),t.on(E.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this),t.off(E.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(t,i){this.resetLevels()}onManifestLoaded(t,i){const s=this.hls.config.preferManagedMediaSource,o=[],l={},u={};let f=!1,y=!1,v=!1;i.levels.forEach(x=>{const w=x.attrs;let{audioCodec:k,videoCodec:F}=x;k&&(x.audioCodec=k=Ae(k,s)||void 0),F&&(F=x.videoCodec=Hi(F));const{width:$,height:Q,unknownCodecs:te}=x,xe=(te==null?void 0:te.length)||0;if(f||(f=!!($&&Q)),y||(y=!!F),v||(v=!!k),xe||k&&!this.isAudioSupported(k)||F&&!this.isVideoSupported(F)){this.log(`Some or all CODECS not supported "${w.CODECS}"`);return}const{CODECS:ke,"FRAME-RATE":Le,"HDCP-LEVEL":Ze,"PATHWAY-ID":rt,RESOLUTION:Lt,"VIDEO-RANGE":ot}=w,xt=`${`${rt||"."}-`}${x.bitrate}-${Lt}-${Le}-${ke}-${ot}-${Ze}`;if(l[xt])if(l[xt].uri!==x.url&&!x.attrs["PATHWAY-ID"]){const ht=u[xt]+=1;x.attrs["PATHWAY-ID"]=new Array(ht+1).join(".");const jt=this.createLevel(x);l[xt]=jt,o.push(jt)}else l[xt].addGroupId("audio",w.AUDIO),l[xt].addGroupId("text",w.SUBTITLES);else{const ht=this.createLevel(x);l[xt]=ht,u[xt]=1,o.push(ht)}}),this.filterAndSortMediaOptions(o,i,f,y,v)}createLevel(t){const i=new Mi(t),s=t.supplemental;if(s!=null&&s.videoCodec&&!this.isVideoSupported(s.videoCodec)){const o=new Error(`SUPPLEMENTAL-CODECS not supported "${s.videoCodec}"`);this.log(o.message),i.supportedResult=ar(o,[])}return i}isAudioSupported(t){return Fe(t,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(t){return Fe(t,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(t,i,s,o,l){var u;let f=[],y=[],v=t;const x=((u=i.stats)==null?void 0:u.parsing)||{};if((s||o)&&l&&(v=v.filter(({videoCodec:ke,videoRange:Le,width:Ze,height:rt})=>(!!ke||!!(Ze&&rt))&&Nr(Le))),v.length===0){Promise.resolve().then(()=>{if(this.hls){let ke="no level with compatible codecs found in manifest",Le=ke;i.levels.length&&(Le=`one or more CODECS in variant not supported: ${tt(i.levels.map(rt=>rt.attrs.CODECS).filter((rt,Lt,ot)=>ot.indexOf(rt)===Lt))}`,this.warn(Le),ke+=` (${Le})`);const Ze=new Error(ke);this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:ae.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:i.url,error:Ze,reason:Le})}}),x.end=performance.now();return}i.audioTracks&&(f=i.audioTracks.filter(ke=>!ke.audioCodec||this.isAudioSupported(ke.audioCodec)),tc(f)),i.subtitles&&(y=i.subtitles,tc(y));const w=v.slice(0);v.sort((ke,Le)=>{if(ke.attrs["HDCP-LEVEL"]!==Le.attrs["HDCP-LEVEL"])return(ke.attrs["HDCP-LEVEL"]||"")>(Le.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&ke.height!==Le.height)return ke.height-Le.height;if(ke.frameRate!==Le.frameRate)return ke.frameRate-Le.frameRate;if(ke.videoRange!==Le.videoRange)return dr.indexOf(ke.videoRange)-dr.indexOf(Le.videoRange);if(ke.videoCodec!==Le.videoCodec){const Ze=de(ke.videoCodec),rt=de(Le.videoCodec);if(Ze!==rt)return rt-Ze}if(ke.uri===Le.uri&&ke.codecSet!==Le.codecSet){const Ze=Re(ke.codecSet),rt=Re(Le.codecSet);if(Ze!==rt)return rt-Ze}return ke.averageBitrate!==Le.averageBitrate?ke.averageBitrate-Le.averageBitrate:0});let k=w[0];if(this.steering&&(v=this.steering.filterParsedLevels(v),v.length!==w.length)){for(let ke=0;ke<w.length;ke++)if(w[ke].pathwayId===v[0].pathwayId){k=w[ke];break}}this._levels=v;for(let ke=0;ke<v.length;ke++)if(v[ke]===k){var F;this._firstLevel=ke;const Le=k.bitrate,Ze=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${v.length} level(s) found, first bitrate: ${Le}`),((F=this.hls.userConfig)==null?void 0:F.abrEwmaDefaultEstimate)===void 0){const rt=Math.min(Le,this.hls.config.abrEwmaDefaultEstimateMax);rt>Ze&&Ze===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=rt)}break}const $=l&&!o,Q=this.hls.config,te=!!(Q.audioStreamController&&Q.audioTrackController),xe={levels:v,audioTracks:f,subtitleTracks:y,sessionData:i.sessionData,sessionKeys:i.sessionKeys,firstLevel:this._firstLevel,stats:i.stats,audio:l,video:o,altAudio:te&&!$&&f.some(ke=>!!ke.url)};x.end=performance.now(),this.hls.trigger(E.MANIFEST_PARSED,xe)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(t){const i=this._levels;if(i.length===0)return;if(t<0||t>=i.length){const x=new Error("invalid level idx"),w=t<0;if(this.hls.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:ae.LEVEL_SWITCH_ERROR,level:t,fatal:w,error:x,reason:x.message}),w)return;t=Math.min(t,i.length-1)}const s=this.currentLevelIndex,o=this.currentLevel,l=o?o.attrs["PATHWAY-ID"]:void 0,u=i[t],f=u.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=u,s===t&&o&&l===f)return;this.log(`Switching to level ${t} (${u.height?u.height+"p ":""}${u.videoRange?u.videoRange+" ":""}${u.codecSet?u.codecSet+" ":""}@${u.bitrate})${f?" with Pathway "+f:""} from level ${s}${l?" with Pathway "+l:""}`);const y={level:t,attrs:u.attrs,details:u.details,bitrate:u.bitrate,averageBitrate:u.averageBitrate,maxBitrate:u.maxBitrate,realBitrate:u.realBitrate,width:u.width,height:u.height,codecSet:u.codecSet,audioCodec:u.audioCodec,videoCodec:u.videoCodec,audioGroups:u.audioGroups,subtitleGroups:u.subtitleGroups,loaded:u.loaded,loadError:u.loadError,fragmentError:u.fragmentError,name:u.name,id:u.id,uri:u.uri,url:u.url,urlId:0,audioGroupIds:u.audioGroupIds,textGroupIds:u.textGroupIds};this.hls.trigger(E.LEVEL_SWITCHING,y);const v=u.details;if(!v||v.live){const x=this.switchParams(u.uri,o==null?void 0:o.details,v);this.loadPlaylist(x)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(t){this.manualLevelIndex=t,this._startLevel===void 0&&(this._startLevel=t),t!==-1&&(this.level=t)}get firstLevel(){return this._firstLevel}set firstLevel(t){this._firstLevel=t}get startLevel(){if(this._startLevel===void 0){const t=this.hls.config.startLevel;return t!==void 0?t:this.hls.firstAutoLevel}return this._startLevel}set startLevel(t){this._startLevel=t}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(t){if(this.steering){const i=this.steering.pathways(),s=t.filter(o=>i.indexOf(o)!==-1);if(t.length<1){this.warn(`pathwayPriority ${t} should contain at least one pathway from list: ${i}`);return}this.steering.pathwayPriority=s}}onError(t,i){i.fatal||!i.context||i.context.type===Te.LEVEL&&i.context.level===this.level&&this.checkRetry(i)}onFragBuffered(t,{frag:i}){if(i!==void 0&&i.type===z.MAIN){const s=i.elementaryStreams;if(!Object.keys(s).some(l=>!!s[l]))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(t,i){var s;const{level:o,details:l}=i,u=i.levelInfo;if(!u){var f;this.warn(`Invalid level index ${o}`),(f=i.deliveryDirectives)!=null&&f.skip&&(l.deltaUpdateFailed=!0);return}if(u===this.currentLevel||i.withoutMultiVariant){u.fragmentError===0&&(u.loadError=0);let y=u.details;y===i.details&&y.advanced&&(y=void 0),this.playlistLoaded(o,i,y)}else(s=i.deliveryDirectives)!=null&&s.skip&&(l.deltaUpdateFailed=!0)}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,t)}loadingPlaylist(t,i){super.loadingPlaylist(t,i);const s=this.getUrlWithDirectives(t.uri,i),o=this.currentLevelIndex,l=t.attrs["PATHWAY-ID"],u=t.details,f=u==null?void 0:u.age;this.log(`Loading level index ${o}${(i==null?void 0:i.msn)!==void 0?" at sn "+i.msn+" part "+i.part:""}${l?" Pathway "+l:""}${f&&u.live?" age "+f.toFixed(1)+(u.type?" "+u.type||0:""):""} ${s}`),this.hls.trigger(E.LEVEL_LOADING,{url:s,level:o,levelInfo:t,pathwayId:t.attrs["PATHWAY-ID"],id:0,deliveryDirectives:i||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(t){this.level=t,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=t)}removeLevel(t){var i;if(this._levels.length===1)return;const s=this._levels.filter((l,u)=>u!==t?!0:(this.steering&&this.steering.removeLevel(l),l===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,l.details&&l.details.fragments.forEach(f=>f.level=-1)),!1));Ds(s),this._levels=s,this.currentLevelIndex>-1&&(i=this.currentLevel)!=null&&i.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const o=s.length-1;this._firstLevel=Math.min(this._firstLevel,o),this._startLevel&&(this._startLevel=Math.min(this._startLevel,o)),this.hls.trigger(E.LEVELS_UPDATED,{levels:s})}onLevelsUpdated(t,{levels:i}){this._levels=i}checkMaxAutoUpdated(){const{autoLevelCapping:t,maxAutoLevel:i,maxHdcpLevel:s}=this.hls;this._maxAutoLevel!==i&&(this._maxAutoLevel=i,this.hls.trigger(E.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:i,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:s}))}}function tc(h){const t={};h.forEach(i=>{const s=i.groupId||"";i.id=t[s]=t[s]||0,t[s]++})}function ya(){return self.SourceBuffer||self.WebKitSourceBuffer}function Wh(){if(!Ye())return!1;const t=ya();return!t||t.prototype&&typeof t.prototype.appendBuffer=="function"&&typeof t.prototype.remove=="function"}function of(){if(!Wh())return!1;const h=Ye();return typeof(h==null?void 0:h.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(t=>h.isTypeSupported(ee(t,"video")))||["mp4a.40.2","fLaC"].some(t=>h.isTypeSupported(ee(t,"audio"))))}function lf(){var h;const t=ya();return typeof(t==null||(h=t.prototype)==null?void 0:h.changeType)=="function"}const uf=100;class i0 extends Oo{constructor(t,i,s){super(t,i,s,"stream-controller",z.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const o=this.media,l=o?o.currentTime:null;if(l===null||!U(l)||(this.log(`Media seeked to ${l.toFixed(3)}`),!this.getBufferedFrag(l)))return;const u=this.getFwdBufferInfoAtPos(o,l,z.MAIN,0);if(u===null||u.len===0){this.warn(`Main forward buffer length at ${l} on "seeked" event ${u?u.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.LEVEL_LOADING,this.onLevelLoading,this),t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(E.BUFFER_CREATED,this.onBufferCreated,this),t.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(E.BUFFER_CREATED,this.onBufferCreated,this),t.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(t,i){if(this.levels){const{lastCurrentTime:s,hls:o}=this;if(this.stopLoad(),this.setInterval(uf),this.level=-1,!this.startFragRequested){let l=o.startLevel;l===-1&&(o.config.testBandwidth&&this.levels.length>1?(l=0,this.bitrateTest=!0):l=o.firstAutoLevel),o.nextLoadLevel=l,this.level=o.loadLevel,this._hasEnoughToStart=!!i}s>0&&t===-1&&!i&&(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),t=s),this.state=Vt.IDLE,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=i?-1:t,this.tick()}else this._forceStartLoad=!0,this.state=Vt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Vt.WAITING_LEVEL:{const{levels:t,level:i}=this,s=t==null?void 0:t[i],o=s==null?void 0:s.details;if(o&&(!o.live||this.levelLastLoaded===s&&!this.waitForLive(s))){if(this.waitForCdnTuneIn(o))break;this.state=Vt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Vt.IDLE;break}break}case Vt.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===Vt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var t;super.onTickEnd(),(t=this.media)!=null&&t.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:i,levels:s,media:o}=this;if(i===null||!o&&!this.primaryPrefetch&&(this.startFragRequested||!t.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const l=this.buffering?t.nextLoadLevel:t.loadLevel;if(!(s!=null&&s[l]))return;const u=s[l],f=this.getMainFwdBufferInfo();if(f===null)return;const y=this.getLevelDetails();if(y&&this._streamEnded(f,y)){const Q={};this.altAudio===2&&(Q.type="video"),this.hls.trigger(E.BUFFER_EOS,Q),this.state=Vt.ENDED;return}if(!this.buffering)return;t.loadLevel!==l&&t.manualLevel===-1&&this.log(`Adapting to level ${l} from level ${this.level}`),this.level=t.nextLoadLevel=l;const v=u.details;if(!v||this.state===Vt.WAITING_LEVEL||this.waitForLive(u)){this.level=l,this.state=Vt.WAITING_LEVEL,this.startFragRequested=!1;return}const x=f.len,w=this.getMaxBufferLength(u.maxBitrate);if(x>=w)return;this.backtrackFragment&&this.backtrackFragment.start>f.end&&(this.backtrackFragment=null);const k=this.backtrackFragment?this.backtrackFragment.start:f.end;let F=this.getNextFragment(k,v);if(this.couldBacktrack&&!this.fragPrevious&&F&&at(F)&&this.fragmentTracker.getState(F)!==Bi.OK){var $;const te=(($=this.backtrackFragment)!=null?$:F).sn-v.startSN,xe=v.fragments[te-1];xe&&F.cc===xe.cc&&(F=xe,this.fragmentTracker.removeFragment(xe))}else this.backtrackFragment&&f.len&&(this.backtrackFragment=null);if(F&&this.isLoopLoading(F,k)){if(!F.gap){const te=this.audioOnly&&!this.altAudio?se.AUDIO:se.VIDEO,xe=(te===se.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;xe&&this.afterBufferFlushed(xe,te,z.MAIN)}F=this.getNextFragmentLoopLoading(F,v,f,z.MAIN,w)}F&&(F.initSegment&&!F.initSegment.data&&!this.bitrateTest&&(F=F.initSegment),this.loadFragment(F,u,k))}loadFragment(t,i,s){const o=this.fragmentTracker.getState(t);o===Bi.NOT_LOADED||o===Bi.PARTIAL?at(t)?this.bitrateTest?(this.log(`Fragment ${t.sn} of level ${t.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(t,i)):super.loadFragment(t,i,s):this._loadInitSegment(t,i):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,z.MAIN)}followingBufferedFrag(t){return t?this.getBufferedFrag(t.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:t,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 l=this.getLevelDetails();if(l!=null&&l.live){const f=this.getMainFwdBufferInfo();if(!f||f.len<l.targetduration*2)return}if(!i.paused&&t){const f=this.hls.nextLoadLevel,y=t[f],v=this.fragLastKbps;v&&this.fragCurrent?s=this.fragCurrent.duration*y.maxBitrate/(1e3*v)+1:s=0}else s=0;const u=this.getBufferedFrag(i.currentTime+s);if(u){const f=this.followingBufferedFrag(u);if(f){this.abortCurrentFrag();const y=f.maxStartPTS?f.maxStartPTS:f.start,v=f.duration,x=Math.max(u.end,y+Math.min(Math.max(v-this.config.maxFragLookUpTolerance,v*(this.couldBacktrack?.5:.125)),v*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(x,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,t&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.state){case Vt.KEY_LOADING:case Vt.FRAG_LOADING:case Vt.FRAG_LOADING_WAITING_RETRY:case Vt.PARSING:case Vt.PARSED:this.state=Vt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(t,i){super.flushMainBuffer(t,i,this.altAudio===2?"video":null)}onMediaAttached(t,i){super.onMediaAttached(t,i);const s=i.media;Ms(s,"playing",this.onMediaPlaying),Ms(s,"seeked",this.onMediaSeeked)}onMediaDetaching(t,i){const{media:s}=this;s&&(xs(s,"playing",this.onMediaPlaying),xs(s,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(t,i),!i.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(E.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(t,i){let s=!1,o=!1;for(let l=0;l<i.levels.length;l++){const u=i.levels[l].audioCodec;u&&(s=s||u.indexOf("mp4a.40.2")!==-1,o=o||u.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=s&&o&&!lf(),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(t,i){const{levels:s}=this;if(!s||this.state!==Vt.IDLE)return;const o=i.levelInfo;(!o.details||o.details.live&&(this.levelLastLoaded!==o||o.details.expired)||this.waitForCdnTuneIn(o.details))&&(this.state=Vt.WAITING_LEVEL)}onLevelLoaded(t,i){var s;const{levels:o,startFragRequested:l}=this,u=i.level,f=i.details,y=f.totalduration;if(!o){this.warn(`Levels were reset while loading level ${u}`);return}this.log(`Level ${u} loaded [${f.startSN},${f.endSN}]${f.lastPartSn?`[part-${f.lastPartSn}-${f.lastPartIndex}]`:""}, cc [${f.startCC}, ${f.endCC}] duration:${y}`);const v=i.levelInfo,x=this.fragCurrent;x&&(this.state===Vt.FRAG_LOADING||this.state===Vt.FRAG_LOADING_WAITING_RETRY)&&x.level!==i.level&&x.loader&&this.abortCurrentFrag();let w=0;if(f.live||(s=v.details)!=null&&s.live){var k;if(this.checkLiveUpdate(f),f.deltaUpdateFailed)return;w=this.alignPlaylists(f,v.details,(k=this.levelLastLoaded)==null?void 0:k.details)}if(v.details=f,this.levelLastLoaded=v,l||this.setStartPosition(f,w),this.hls.trigger(E.LEVEL_UPDATED,{details:f,level:u}),this.state===Vt.WAITING_LEVEL){if(this.waitForCdnTuneIn(f))return;this.state=Vt.IDLE}l&&f.live&&this.synchronizeToLiveEdge(f),this.tick()}synchronizeToLiveEdge(t){const{config:i,media:s}=this;if(!s)return;const o=this.hls.liveSyncPosition,l=this.getLoadPosition(),u=t.fragmentStart,f=t.edge,y=l>=u-i.maxFragLookUpTolerance&&l<=f;if(o!==null&&s.duration>o&&(l<o||!y)){const x=i.liveMaxLatencyDuration!==void 0?i.liveMaxLatencyDuration:i.liveMaxLatencyDurationCount*t.targetduration;if((!y&&s.readyState<4||l<f-x)&&(this._hasEnoughToStart||(this.nextLoadPosition=o),s.readyState))if(this.warn(`Playback: ${l.toFixed(3)} is located too far from the end of live sliding playlist: ${f}, reset currentTime to : ${o.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var v;const w=di.bufferInfo(s,o,0);if(!((v=w.buffered)!=null&&v.length)){s.currentTime=o;return}if(w.start<=l){s.currentTime=o;return}const{nextStart:F}=di.bufferedInfo(w.buffered,l,0);F&&(s.currentTime=F)}else s.currentTime=o}}_handleFragmentLoadProgress(t){var i;const s=t.frag,{part:o,payload:l}=t,{levels:u}=this;if(!u){this.warn(`Levels were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const f=u[s.level];if(!f){this.warn(`Level ${s.level} not found on progress`);return}const y=f.details;if(!y){this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`),this.fragmentTracker.removeFragment(s);return}const v=f.videoCodec,x=y.PTSKnown||!y.live,w=(i=s.initSegment)==null?void 0:i.data,k=this._getAudioCodec(f),F=this.transmuxer=this.transmuxer||new yc(this.hls,z.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=o?o.index:-1,Q=$!==-1,te=new rs(s.level,s.sn,s.stats.chunkCount,l.byteLength,$,Q),xe=this.initPTS[s.cc];F.push(l,w,k,v,s,o,y.totalduration,x,te,xe)}onAudioTrackSwitching(t,i){const s=this.hls,o=this.altAudio!==0;if(gi(i.url,s))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const u=this.fragCurrent;u&&(this.log("Switching to main audio track, cancel main fragment load"),u.abortRequests(),this.fragmentTracker.removeFragment(u)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(o){this.altAudio=0,this.fragmentTracker.removeAllFragments(),s.once(E.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(E.AUDIO_TRACK_SWITCHED,i)}),s.trigger(E.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}s.trigger(E.AUDIO_TRACK_SWITCHED,i)}}onAudioTrackSwitched(t,i){const s=gi(i.url,this.hls);if(s){const o=this.videoBuffer;o&&this.mediaBuffer!==o&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=o)}this.altAudio=s?2:0,this.tick()}onBufferCreated(t,i){const s=i.tracks;let o,l,u=!1;for(const f in s){const y=s[f];if(y.id==="main"){if(l=f,o=y,f==="video"){const v=s[f];v&&(this.videoBuffer=v.buffer)}}else u=!0}u&&o?(this.log(`Alternate track found, use ${l}.buffered to schedule main fragment loading`),this.mediaBuffer=o.buffer):this.mediaBuffer=this.media}onFragBuffered(t,i){const{frag:s,part:o}=i,l=s.type===z.MAIN;if(l){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===Vt.PARSED&&(this.state=Vt.IDLE);return}const f=o?o.stats:s.stats;this.fragLastKbps=Math.round(8*f.total/(f.buffering.end-f.loading.first)),at(s)&&(this.fragPrevious=s),this.fragBufferedComplete(s,o)}const u=this.media;u&&(!this._hasEnoughToStart&&di.getBuffered(u).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),l&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(t,i){var s;if(i.fatal){this.state=Vt.ERROR;return}switch(i.details){case ae.FRAG_GAP:case ae.FRAG_PARSING_ERROR:case ae.FRAG_DECRYPT_ERROR:case ae.FRAG_LOAD_ERROR:case ae.FRAG_LOAD_TIMEOUT:case ae.KEY_LOAD_ERROR:case ae.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(z.MAIN,i);break;case ae.LEVEL_LOAD_ERROR:case ae.LEVEL_LOAD_TIMEOUT:case ae.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===Vt.WAITING_LEVEL&&((s=i.context)==null?void 0:s.type)===Te.LEVEL&&(this.state=Vt.IDLE);break;case ae.BUFFER_ADD_CODEC_ERROR:case ae.BUFFER_APPEND_ERROR:if(i.parent!=="main")return;this.reduceLengthAndFlushBuffer(i)&&this.resetLoadingState();break;case ae.BUFFER_FULL_ERROR:if(i.parent!=="main")return;this.reduceLengthAndFlushBuffer(i)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case ae.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}onFragLoadEmergencyAborted(){this.state=Vt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(t,{type:i}){if(i!==se.AUDIO||!this.altAudio){const s=(i===se.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;s&&(this.afterBufferFlushed(s,i,z.MAIN),this.tick())}}onLevelsUpdated(t,i){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=i.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:t}=this;if(!t)return;const i=t.currentTime;let s=this.startPosition;if(s>=0&&i<s){if(t.seeking){this.log(`could not seek to ${s}, already seeking at ${i}`);return}const o=this.timelineOffset;o&&s&&(s+=o);const l=this.getLevelDetails(),u=di.getBuffered(t),f=u.length?u.start(0):0,y=f-s,v=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||y>0&&(y<v||this.loadingParts&&y<2*((l==null?void 0:l.partTarget)||0)))&&(this.log(`adjusting start position by ${y} to match buffer start`),s+=y,this.startPosition=s),i<s&&(this.log(`seek to target start position ${s} from current time ${i} buffer start ${f}`),t.currentTime=s)}}_getAudioCodec(t){let i=this.config.defaultAudioCodec||t.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(t,i){t.bitrateTest=!0,this._doFragLoad(t,i).then(s=>{const{hls:o}=this,l=s==null?void 0:s.frag;if(!l||this.fragContextChanged(l))return;i.fragmentError=0,this.state=Vt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const u=l.stats;u.parsing.start=u.parsing.end=u.buffering.start=u.buffering.end=self.performance.now(),o.trigger(E.FRAG_LOADED,s),l.bitrateTest=!1}).catch(s=>{this.state===Vt.STOPPED||this.state===Vt.ERROR||(this.warn(s),this.resetFragmentLoading(t))})}_handleTransmuxComplete(t){const i=this.playlistType,{hls:s}=this,{remuxResult:o,chunkMeta:l}=t,u=this.getCurrentContext(l);if(!u){this.resetWhenMissingContext(l);return}const{frag:f,part:y,level:v}=u,{video:x,text:w,id3:k,initSegment:F}=o,{details:$}=v,Q=this.altAudio?void 0:o.audio;if(this.fragContextChanged(f)){this.fragmentTracker.removeFragment(f);return}if(this.state=Vt.PARSING,F){const te=F.tracks;if(te){const Ze=f.initSegment||f;if(this.unhandledEncryptionError(F,f))return;this._bufferInitSegment(v,te,Ze,l),s.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:Ze,id:i,tracks:te})}const xe=F.initPTS,ke=F.timescale,Le=this.initPTS[f.cc];if(U(xe)&&(!Le||Le.baseTime!==xe||Le.timescale!==ke)){const Ze=F.trackId;this.initPTS[f.cc]={baseTime:xe,timescale:ke,trackId:Ze},s.trigger(E.INIT_PTS_FOUND,{frag:f,id:i,initPTS:xe,timescale:ke,trackId:Ze})}}if(x&&$){Q&&x.type==="audiovideo"&&this.logMuxedErr(f);const te=$.fragments[f.sn-1-$.startSN],xe=f.sn===$.startSN,ke=!te||f.cc>te.cc;if(o.independent!==!1){const{startPTS:Le,endPTS:Ze,startDTS:rt,endDTS:Lt}=x;if(y)y.elementaryStreams[x.type]={startPTS:Le,endPTS:Ze,startDTS:rt,endDTS:Lt};else if(x.firstKeyFrame&&x.independent&&l.id===1&&!ke&&(this.couldBacktrack=!0),x.dropped&&x.independent){const ot=this.getMainFwdBufferInfo(),St=(ot?ot.end:this.getLoadPosition())+this.config.maxBufferHole,xt=x.firstKeyFramePTS?x.firstKeyFramePTS:Le;if(!xe&&St<xt-this.config.maxBufferHole&&!ke){this.backtrack(f);return}else ke&&(f.gap=!0);f.setElementaryStreamInfo(x.type,f.start,Ze,f.start,Lt,!0)}else xe&&Le-($.appliedTimelineOffset||0)>e0&&(f.gap=!0);f.setElementaryStreamInfo(x.type,Le,Ze,rt,Lt),this.backtrackFragment&&(this.backtrackFragment=f),this.bufferFragmentData(x,f,y,l,xe||ke)}else if(xe||ke)f.gap=!0;else{this.backtrack(f);return}}if(Q){const{startPTS:te,endPTS:xe,startDTS:ke,endDTS:Le}=Q;y&&(y.elementaryStreams[se.AUDIO]={startPTS:te,endPTS:xe,startDTS:ke,endDTS:Le}),f.setElementaryStreamInfo(se.AUDIO,te,xe,ke,Le),this.bufferFragmentData(Q,f,y,l)}if($&&k!=null&&k.samples.length){const te={id:i,frag:f,details:$,samples:k.samples};s.trigger(E.FRAG_PARSING_METADATA,te)}if($&&w){const te={id:i,frag:f,details:$,samples:w.samples};s.trigger(E.FRAG_PARSING_USERDATA,te)}}logMuxedErr(t){this.warn(`${at(t)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${t.url}`)}_bufferInitSegment(t,i,s,o){if(this.state!==Vt.PARSING)return;this.audioOnly=!!i.audio&&!i.video,this.altAudio&&!this.audioOnly&&(delete i.audio,i.audiovideo&&this.logMuxedErr(s));const{audio:l,video:u,audiovideo:f}=i;if(l){const v=t.audioCodec;let x=Sr(l.codec,v);x==="mp4a"&&(x="mp4a.40.5");const w=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){x&&(x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5");const k=l.metadata;k&&"channelCount"in k&&(k.channelCount||1)!==1&&w.indexOf("firefox")===-1&&(x="mp4a.40.5")}x&&x.indexOf("mp4a.40.5")!==-1&&w.indexOf("android")!==-1&&l.container!=="audio/mpeg"&&(x="mp4a.40.2",this.log(`Android: force audio codec to ${x}`)),v&&v!==x&&this.log(`Swapping manifest audio codec "${v}" for "${x}"`),l.levelCodec=x,l.id=z.MAIN,this.log(`Init audio buffer, container:${l.container}, codecs[selected/level/parsed]=[${x||""}/${v||""}/${l.codec}]`),delete i.audiovideo}if(u){u.levelCodec=t.videoCodec,u.id=z.MAIN;const v=u.codec;if((v==null?void 0:v.length)===4)switch(v){case"hvc1":case"hev1":u.codec="hvc1.1.6.L120.90";break;case"av01":u.codec="av01.0.04M.08";break;case"avc1":u.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${u.container}, codecs[level/parsed]=[${t.videoCodec||""}/${v}]${u.codec!==v?" parsed-corrected="+u.codec:""}${u.supplemental?" supplemental="+u.supplemental:""}`),delete i.audiovideo}f&&(this.log(`Init audiovideo buffer, container:${f.container}, codecs[level/parsed]=[${t.codecs}/${f.codec}]`),delete i.video,delete i.audio);const y=Object.keys(i);if(y.length){if(this.hls.trigger(E.BUFFER_CODECS,i),!this.hls)return;y.forEach(v=>{const w=i[v].initSegment;w!=null&&w.byteLength&&this.hls.trigger(E.BUFFER_APPENDING,{type:v,data:w,frag:s,part:null,chunkMeta:o,parent:s.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const t=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(t,z.MAIN)}get maxBufferLength(){const{levels:t,level:i}=this,s=t==null?void 0:t[i];return s?this.getMaxBufferLength(s.maxBitrate):this.config.maxBufferLength}backtrack(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=Vt.IDLE}checkFragmentChanged(){const t=this.media;let i=null;if(t&&t.readyState>1&&t.seeking===!1){const s=t.currentTime;if(di.isBuffered(t,s)?i=this.getAppendedFrag(s):di.isBuffered(t,s+.1)&&(i=this.getAppendedFrag(s+.1)),i){this.backtrackFragment=null;const o=this.fragPlaying,l=i.level;(!o||i.sn!==o.sn||o.level!==l)&&(this.fragPlaying=i,this.hls.trigger(E.FRAG_CHANGED,{frag:i}),(!o||o.level!==l)&&this.hls.trigger(E.LEVEL_SWITCHED,{level:l}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){var t;if(this.fragPlaying)return this.fragPlaying;const i=((t=this.media)==null?void 0:t.currentTime)||this.lastCurrentTime;return U(i)?this.getAppendedFrag(i):null}get currentProgramDateTime(){var t;const i=((t=this.media)==null?void 0:t.currentTime)||this.lastCurrentTime;if(U(i)){const s=this.getLevelDetails(),o=this.currentFrag||(s?Si(null,s.fragments,i):null);if(o){const l=o.programDateTime;if(l!==null){const u=l+(i-o.start)*1e3;return new Date(u)}}}return null}get currentLevel(){const t=this.currentFrag;return t?t.level:-1}get nextBufferedFrag(){const t=this.currentFrag;return t?this.followingBufferedFrag(t):null}get forceStartLoad(){return this._forceStartLoad}}class cf extends le{constructor(t,i){super("key-loader",i),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=t}abort(t){for(const s in this.keyIdToKeyInfo){const o=this.keyIdToKeyInfo[s].loader;if(o){var i;if(t&&t!==((i=o.context)==null?void 0:i.frag.type))return;o.abort()}}}detach(){for(const t in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[t];(i.mediaKeySessionContext||i.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[t]}}destroy(){this.detach();for(const t in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[t].loader;i&&i.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(t,i=ae.KEY_LOAD_ERROR,s,o,l){return new Ei({type:Me.NETWORK_ERROR,details:i,fatal:!1,frag:t,response:l,error:s,networkDetails:o})}loadClear(t,i,s){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(i.length)for(let o=0,l=i.length;o<l;o++){const u=i[o];if(t.cc<=u.cc&&(!at(t)||!at(u)||t.sn<u.sn)||!s&&o==l-1)return this.emeController.selectKeySystemFormat(u).then(f=>{if(!this.emeController)return;u.setKeyFormat(f);const y=is(f);if(y)return this.emeController.getKeySystemAccess([y])})}if(this.config.requireKeySystemAccessOnStart){const o=cs(this.config);if(o.length)return this.emeController.getKeySystemAccess(o)}}return null}load(t){return!t.decryptdata&&t.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(t).then(i=>this.loadInternal(t,i)):this.loadInternal(t)}loadInternal(t,i){var s,o;i&&t.setKeyFormat(i);const l=t.decryptdata;if(!l){const v=new Error(i?`Expected frag.decryptdata to be defined after setting format ${i}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(t,ae.KEY_LOAD_ERROR,v))}const u=l.uri;if(!u)return Promise.reject(this.createKeyLoadError(t,ae.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${u}"`)));const f=n0(l);let y=this.keyIdToKeyInfo[f];if((s=y)!=null&&s.decryptdata.key)return l.key=y.decryptdata.key,Promise.resolve({frag:t,keyInfo:y});if(this.emeController&&(o=y)!=null&&o.keyLoadPromise)switch(this.emeController.getKeyStatus(y.decryptdata)){case"usable":case"usable-in-future":return y.keyLoadPromise.then(x=>{const{keyInfo:w}=x;return l.key=w.decryptdata.key,{frag:t,keyInfo:w}})}switch(this.log(`${this.keyIdToKeyInfo[f]?"Rel":"L"}oading${l.keyId?" keyId: "+ye(l.keyId):""} URI: ${l.uri} from ${t.type} ${t.level}`),y=this.keyIdToKeyInfo[f]={decryptdata:l,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},l.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return l.keyFormat==="identity"?this.loadKeyHTTP(y,t):this.loadKeyEME(y,t);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(y,t);default:return Promise.reject(this.createKeyLoadError(t,ae.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${l.method}"`)))}}loadKeyEME(t,i){const s={frag:i,keyInfo:t};if(this.emeController&&this.config.emeEnabled){var o;if(!t.decryptdata.keyId&&(o=i.initSegment)!=null&&o.data){const u=nr(i.initSegment.data);if(u.length){let f=u[0];f.some(y=>y!==0)?(this.log(`Using keyId found in init segment ${ye(f)}`),Vi.setKeyIdForUri(t.decryptdata.uri,f)):(f=Vi.addKeyIdForUri(t.decryptdata.uri),this.log(`Generating keyId to patch media ${ye(f)}`)),t.decryptdata.keyId=f}}if(!t.decryptdata.keyId&&!at(i))return Promise.resolve(s);const l=this.emeController.loadKey(s);return(t.keyLoadPromise=l.then(u=>(t.mediaKeySessionContext=u,s))).catch(u=>{throw t.keyLoadPromise=null,"data"in u&&(u.data.frag=i),u})}return Promise.resolve(s)}loadKeyHTTP(t,i){const s=this.config,o=s.loader,l=new o(s);return i.keyLoader=t.loader=l,t.keyLoadPromise=new Promise((u,f)=>{const y={keyInfo:t,frag:i,responseType:"arraybuffer",url:t.decryptdata.uri},v=s.keyLoadPolicy.default,x={loadPolicy:v,timeout:v.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},w={onSuccess:(k,F,$,Q)=>{const{frag:te,keyInfo:xe}=$,ke=n0(xe.decryptdata);if(!te.decryptdata||xe!==this.keyIdToKeyInfo[ke])return f(this.createKeyLoadError(te,ae.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),Q));xe.decryptdata.key=te.decryptdata.key=new Uint8Array(k.data),te.keyLoader=null,xe.loader=null,u({frag:te,keyInfo:xe})},onError:(k,F,$,Q)=>{this.resetLoader(F),f(this.createKeyLoadError(i,ae.KEY_LOAD_ERROR,new Error(`HTTP Error ${k.code} loading key ${k.text}`),$,O({url:y.url,data:void 0},k)))},onTimeout:(k,F,$)=>{this.resetLoader(F),f(this.createKeyLoadError(i,ae.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),$))},onAbort:(k,F,$)=>{this.resetLoader(F),f(this.createKeyLoadError(i,ae.INTERNAL_ABORTED,new Error("key loading aborted"),$))}};l.load(y,x,w)})}resetLoader(t){const{frag:i,keyInfo:s,url:o}=t,l=s.loader;i.keyLoader===l&&(i.keyLoader=null,s.loader=null);const u=n0(s.decryptdata)||o;delete this.keyIdToKeyInfo[u],l&&l.destroy()}}function n0(h){if(h.keyFormat!==_i.FAIRPLAY){const t=h.keyId;if(t)return ye(t)}return h.uri}function s0(h){const{type:t}=h;switch(t){case Te.AUDIO_TRACK:return z.AUDIO;case Te.SUBTITLE_TRACK:return z.SUBTITLE;default:return z.MAIN}}function Co(h,t){let i=h.url;return(i===void 0||i.indexOf("data:")===0)&&(i=t.url),i}class hf{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.LEVEL_LOADING,this.onLevelLoading,this),t.on(E.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(E.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.LEVEL_LOADING,this.onLevelLoading,this),t.off(E.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(E.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(t){const i=this.hls.config,s=i.pLoader,o=i.loader,l=s||o,u=new l(i);return this.loaders[t.type]=u,u}getInternalLoader(t){return this.loaders[t.type]}resetInternalLoader(t){this.loaders[t]&&delete this.loaders[t]}destroyInternalLoaders(){for(const t in this.loaders){const i=this.loaders[t];i&&i.destroy(),this.resetInternalLoader(t)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(t,i){const{url:s}=i;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Te.MANIFEST,url:s,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(t,i){const{id:s,level:o,pathwayId:l,url:u,deliveryDirectives:f,levelInfo:y}=i;this.load({id:s,level:o,pathwayId:l,responseType:"text",type:Te.LEVEL,url:u,deliveryDirectives:f,levelOrTrack:y})}onAudioTrackLoading(t,i){const{id:s,groupId:o,url:l,deliveryDirectives:u,track:f}=i;this.load({id:s,groupId:o,level:null,responseType:"text",type:Te.AUDIO_TRACK,url:l,deliveryDirectives:u,levelOrTrack:f})}onSubtitleTrackLoading(t,i){const{id:s,groupId:o,url:l,deliveryDirectives:u,track:f}=i;this.load({id:s,groupId:o,level:null,responseType:"text",type:Te.SUBTITLE_TRACK,url:l,deliveryDirectives:u,levelOrTrack:f})}onLevelsUpdated(t,i){const s=this.loaders[Te.LEVEL];if(s){const o=s.context;o&&!i.levels.some(l=>l===o.levelOrTrack)&&(s.abort(),delete this.loaders[Te.LEVEL])}}load(t){var i;const s=this.hls.config;let o=this.getInternalLoader(t);if(o){const v=this.hls.logger,x=o.context;if(x&&x.levelOrTrack===t.levelOrTrack&&(x.url===t.url||x.deliveryDirectives&&!t.deliveryDirectives)){x.url===t.url?v.log(`[playlist-loader]: ignore ${t.url} ongoing request`):v.log(`[playlist-loader]: ignore ${t.url} in favor of ${x.url}`);return}v.log(`[playlist-loader]: aborting previous loader for type: ${t.type}`),o.abort()}let l;if(t.type===Te.MANIFEST?l=s.manifestLoadPolicy.default:l=M({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),o=this.createInternalLoader(t),U((i=t.deliveryDirectives)==null?void 0:i.part)){let v;if(t.type===Te.LEVEL&&t.level!==null?v=this.hls.levels[t.level].details:t.type===Te.AUDIO_TRACK&&t.id!==null?v=this.hls.audioTracks[t.id].details:t.type===Te.SUBTITLE_TRACK&&t.id!==null&&(v=this.hls.subtitleTracks[t.id].details),v){const x=v.partTarget,w=v.targetduration;if(x&&w){const k=Math.max(x*3,w*.8)*1e3;l=M({},l,{maxTimeToFirstByteMs:Math.min(k,l.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(k,l.maxTimeToFirstByteMs)})}}}const u=l.errorRetry||l.timeoutRetry||{},f={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:u.maxNumRetry||0,retryDelay:u.retryDelayMs||0,maxRetryDelay:u.maxRetryDelayMs||0},y={onSuccess:(v,x,w,k)=>{const F=this.getInternalLoader(w);this.resetInternalLoader(w.type);const $=v.data;x.parsing.start=performance.now(),Ys.isMediaPlaylist($)||w.type!==Te.MANIFEST?this.handleTrackOrLevelPlaylist(v,x,w,k||null,F):this.handleMasterPlaylist(v,x,w,k)},onError:(v,x,w,k)=>{this.handleNetworkError(x,w,!1,v,k)},onTimeout:(v,x,w)=>{this.handleNetworkError(x,w,!0,void 0,v)}};o.load(t,f,y)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:t,startPosition:i},forceStartLoad:s}=this.hls;(t||s)&&(this.hls.logger.log(`${t?"auto":"force"} startLoad with configured startPosition ${i}`),this.hls.startLoad(i))}handleMasterPlaylist(t,i,s,o){const l=this.hls,u=t.data,f=Co(t,s),y=Ys.parseMasterPlaylist(u,f);if(y.playlistParsingError){i.parsing.end=performance.now(),this.handleManifestParsingError(t,s,y.playlistParsingError,o,i);return}const{contentSteering:v,levels:x,sessionData:w,sessionKeys:k,startTimeOffset:F,variableList:$}=y;this.variableList=$,x.forEach(ke=>{const{unknownCodecs:Le}=ke;if(Le){const{preferManagedMediaSource:Ze}=this.hls.config;let{audioCodec:rt,videoCodec:Lt}=ke;for(let ot=Le.length;ot--;){const St=Le[ot];Fe(St,"audio",Ze)?(ke.audioCodec=rt=rt?`${rt},${St}`:St,br.audio[rt.substring(0,4)]=2,Le.splice(ot,1)):Fe(St,"video",Ze)&&(ke.videoCodec=Lt=Lt?`${Lt},${St}`:St,br.video[Lt.substring(0,4)]=2,Le.splice(ot,1))}}});const{AUDIO:Q=[],SUBTITLES:te,"CLOSED-CAPTIONS":xe}=Ys.parseMasterPlaylistMedia(u,f,y);Q.length&&!Q.some(Le=>!Le.url)&&x[0].audioCodec&&!x[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),Q.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new oi({}),bitrate:0,url:""})),l.trigger(E.MANIFEST_LOADED,{levels:x,audioTracks:Q,subtitles:te,captions:xe,contentSteering:v,url:f,stats:i,networkDetails:o,sessionData:w,sessionKeys:k,startTimeOffset:F,variableList:$})}handleTrackOrLevelPlaylist(t,i,s,o,l){const u=this.hls,{id:f,level:y,type:v}=s,x=Co(t,s),w=U(y)?y:U(f)?f:0,k=s0(s),F=Ys.parseLevelPlaylist(t.data,x,w,k,0,this.variableList);if(v===Te.MANIFEST){const $={attrs:new oi({}),bitrate:0,details:F,name:"",url:x};F.requestScheduled=i.loading.start+en(F,0),u.trigger(E.MANIFEST_LOADED,{levels:[$],audioTracks:[],url:x,stats:i,networkDetails:o,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}i.parsing.end=performance.now(),s.levelDetails=F,this.handlePlaylistLoaded(F,t,i,s,o,l)}handleManifestParsingError(t,i,s,o,l){this.hls.trigger(E.ERROR,{type:Me.NETWORK_ERROR,details:ae.MANIFEST_PARSING_ERROR,fatal:i.type===Te.MANIFEST,url:t.url,err:s,error:s,reason:s.message,response:t,context:i,networkDetails:o,stats:l})}handleNetworkError(t,i,s=!1,o,l){let u=`A network ${s?"timeout":"error"+(o?" (status "+o.code+")":"")} occurred while loading ${t.type}`;t.type===Te.LEVEL?u+=`: ${t.level} id: ${t.id}`:(t.type===Te.AUDIO_TRACK||t.type===Te.SUBTITLE_TRACK)&&(u+=` id: ${t.id} group-id: "${t.groupId}"`);const f=new Error(u);this.hls.logger.warn(`[playlist-loader]: ${u}`);let y=ae.UNKNOWN,v=!1;const x=this.getInternalLoader(t);switch(t.type){case Te.MANIFEST:y=s?ae.MANIFEST_LOAD_TIMEOUT:ae.MANIFEST_LOAD_ERROR,v=!0;break;case Te.LEVEL:y=s?ae.LEVEL_LOAD_TIMEOUT:ae.LEVEL_LOAD_ERROR,v=!1;break;case Te.AUDIO_TRACK:y=s?ae.AUDIO_TRACK_LOAD_TIMEOUT:ae.AUDIO_TRACK_LOAD_ERROR,v=!1;break;case Te.SUBTITLE_TRACK:y=s?ae.SUBTITLE_TRACK_LOAD_TIMEOUT:ae.SUBTITLE_LOAD_ERROR,v=!1;break}x&&this.resetInternalLoader(t.type);const w={type:Me.NETWORK_ERROR,details:y,fatal:v,url:t.url,loader:x,context:t,error:f,networkDetails:i,stats:l};if(o){const k=(i==null?void 0:i.url)||t.url;w.response=O({url:k,data:void 0},o)}this.hls.trigger(E.ERROR,w)}handlePlaylistLoaded(t,i,s,o,l,u){const f=this.hls,{type:y,level:v,levelOrTrack:x,id:w,groupId:k,deliveryDirectives:F}=o,$=Co(i,o),Q=s0(o);let te=typeof o.level=="number"&&Q===z.MAIN?v:void 0;const xe=t.playlistParsingError;if(xe){if(this.hls.logger.warn(`${xe} ${t.url}`),!f.config.ignorePlaylistParsingErrors){f.trigger(E.ERROR,{type:Me.NETWORK_ERROR,details:ae.LEVEL_PARSING_ERROR,fatal:!1,url:$,error:xe,reason:xe.message,response:i,context:o,level:te,parent:Q,networkDetails:l,stats:s});return}t.playlistParsingError=null}if(!t.fragments.length){const ke=t.playlistParsingError=new Error("No Segments found in Playlist");f.trigger(E.ERROR,{type:Me.NETWORK_ERROR,details:ae.LEVEL_EMPTY_ERROR,fatal:!1,url:$,error:ke,reason:ke.message,response:i,context:o,level:te,parent:Q,networkDetails:l,stats:s});return}switch(t.live&&u&&(u.getCacheAge&&(t.ageHeader=u.getCacheAge()||0),(!u.getCacheAge||isNaN(t.ageHeader))&&(t.ageHeader=0)),y){case Te.MANIFEST:case Te.LEVEL:if(te){if(!x)te=0;else if(x!==f.levels[te]){const ke=f.levels.indexOf(x);ke>-1&&(te=ke)}}f.trigger(E.LEVEL_LOADED,{details:t,levelInfo:x||f.levels[0],level:te||0,id:w||0,stats:s,networkDetails:l,deliveryDirectives:F,withoutMultiVariant:y===Te.MANIFEST});break;case Te.AUDIO_TRACK:f.trigger(E.AUDIO_TRACK_LOADED,{details:t,track:x,id:w||0,groupId:k||"",stats:s,networkDetails:l,deliveryDirectives:F});break;case Te.SUBTITLE_TRACK:f.trigger(E.SUBTITLE_TRACK_LOADED,{details:t,track:x,id:w||0,groupId:k||"",stats:s,networkDetails:l,deliveryDirectives:F});break}}}class qo{static get version(){return Bo}static isMSESupported(){return Wh()}static isSupported(){return of()}static getMediaSource(){return Ye()}static get Events(){return E}static get MetadataSchema(){return Ls}static get ErrorTypes(){return Me}static get ErrorDetails(){return ae}static get DefaultConfig(){return qo.defaultConfig?qo.defaultConfig:Xd}static set DefaultConfig(t){qo.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new ul,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.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const i=this.logger=$e(t.debug||!1,"Hls instance",t.assetPlayerId),s=this.config=Qd(qo.DefaultConfig,t,i);this.userConfig=t,s.progressive&&Hh(s,i);const{abrController:o,bufferController:l,capLevelController:u,errorController:f,fpsController:y}=s,v=new f(this),x=this.abrController=new o(this),w=new bs(this),k=s.interstitialsController,F=k?this.interstitialsController=new k(this,qo):null,$=this.bufferController=new l(this,w),Q=this.capLevelController=new u(this),te=new y(this),xe=new hf(this),ke=s.contentSteeringController,Le=ke?new ke(this):null,Ze=this.levelController=new r0(this,Le),rt=new af(this),Lt=new cf(this.config,this.logger),ot=this.streamController=new i0(this,w,Lt),St=this.gapController=new nf(this,w);Q.setStreamController(ot),te.setStreamController(ot);const xt=[xe,Ze,ot];F&&xt.splice(1,0,F),Le&&xt.splice(1,0,Le),this.networkControllers=xt;const ht=[x,$,St,Q,te,rt,w];this.audioTrackController=this.createController(s.audioTrackController,xt);const jt=s.audioStreamController;jt&&xt.push(this.audioStreamController=new jt(this,w,Lt)),this.subtitleTrackController=this.createController(s.subtitleTrackController,xt);const Br=s.subtitleStreamController;Br&&xt.push(this.subtititleStreamController=new Br(this,w,Lt)),this.createController(s.timelineController,ht),Lt.emeController=this.emeController=this.createController(s.emeController,ht),this.cmcdController=this.createController(s.cmcdController,ht),this.latencyController=this.createController(t0,ht),this.coreComponents=ht,xt.push(v);const ei=v.onErrorOut;typeof ei=="function"&&this.on(E.ERROR,ei,v),this.on(E.MANIFEST_LOADED,xe.onManifestLoaded,xe)}createController(t,i){if(t){const s=new t(this);return i&&i.push(s),s}return null}on(t,i,s=this){this._emitter.on(t,i,s)}once(t,i,s=this){this._emitter.once(t,i,s)}removeAllListeners(t){this._emitter.removeAllListeners(t)}off(t,i,s=this,o){this._emitter.off(t,i,s,o)}listeners(t){return this._emitter.listeners(t)}emit(t,i,s){return this._emitter.emit(t,i,s)}trigger(t,i){if(this.config.debug)return this.emit(t,t,i);try{return this.emit(t,t,i)}catch(s){if(this.logger.error("An internal error happened while handling event "+t+'. Error message: "'+s.message+'". Here is a stacktrace:',s),!this.triggeringException){this.triggeringException=!0;const o=t===E.ERROR;this.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:ae.INTERNAL_EXCEPTION,fatal:o,event:t,error:s}),this.triggeringException=!1}}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){this.logger.log("destroy"),this.trigger(E.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 t=this.config;t.xhrSetup=t.fetchSetup=void 0,this.userConfig=null}attachMedia(t){if(!t||"media"in t&&!t.media){const l=new Error(`attachMedia failed: invalid argument (${t})`);this.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:ae.ATTACH_MEDIA_ERROR,fatal:!0,error:l});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const i="media"in t,s=i?t.media:t,o=i?t:{media:s};this._media=s,this.trigger(E.MEDIA_ATTACHING,o)}detachMedia(){this.logger.log("detachMedia"),this.trigger(E.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const t=this.bufferController.transferMedia();return this.trigger(E.MEDIA_DETACHING,{transferMedia:t}),t}loadSource(t){this.stopLoad();const i=this.media,s=this._url,o=this._url=D.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${o}`),i&&s&&(s!==o||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(i)),this.trigger(E.MANIFEST_LOADING,{url:t})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(t=-1,i){this.logger.log(`startLoad(${t+(i?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let s=0;s<this.networkControllers.length&&(this.networkControllers[s].startLoad(t,i),!(!this.started||!this.networkControllers));s++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].stopLoad(),!(this.started||!this.networkControllers));t++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(t=>{t.resumeBuffering&&t.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(t=>{t.pauseBuffering&&t.pauseBuffering()}))}get inFlightFragments(){const t={[z.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(t[z.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(t[z.SUBTITLE]=this.subtititleStreamController.inFlightFrag),t}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const t=this._media,i=t==null?void 0:t.currentTime;this.detachMedia(),t&&(this.attachMedia(t),i&&this.startLoad(i))}removeLevel(t){this.levelController.removeLevel(t)}get sessionId(){let t=this._sessionId;return t||(t=this._sessionId=Od()),t}get levels(){const t=this.levelController.levels;return t||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){this.logger.log(`set currentLevel:${t}`),this.levelController.manualLevel=t,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){this.logger.log(`set nextLevel:${t}`),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){this.logger.log(`set loadLevel:${t}`),this.levelController.manualLevel=t}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(t){this.levelController.nextLoadLevel=t}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(t){this.logger.log(`set firstLevel:${t}`),this.levelController.firstLevel=t}get startLevel(){const t=this.levelController.startLevel;return t===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:t}set startLevel(t){this.logger.log(`set startLevel:${t}`),t!==-1&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(t){const i=!!t;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:t}=this.abrController;return t?t.getEstimate():NaN}set bandwidthEstimate(t){this.abrController.resetEstimator(t)}get abrEwmaDefaultEstimate(){const{bwEstimator:t}=this.abrController;return t?t.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(this.logger.log(`set autoLevelCapping:${t}`),this._autoLevelCapping=t,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){or(t)&&this._maxHdcpLevel!==t&&(this._maxHdcpLevel=t,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:t,config:{minAutoBitrate:i}}=this;if(!t)return 0;const s=t.length;for(let o=0;o<s;o++)if(t[o].maxBitrate>=i)return o;return 0}get maxAutoLevel(){const{levels:t,autoLevelCapping:i,maxHdcpLevel:s}=this;let o;if(i===-1&&t!=null&&t.length?o=t.length-1:o=i,s)for(let l=o;l--;){const u=t[l].attrs["HDCP-LEVEL"];if(u&&u<=s)return l}return o}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(t){this.abrController.nextAutoLevel=t}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(t){var i;return((i=this.audioTrackController)==null?void 0:i.setAudioOption(t))||null}setSubtitleOption(t){var i;return((i=this.subtitleTrackController)==null?void 0:i.setSubtitleOption(t))||null}get allAudioTracks(){const t=this.audioTrackController;return t?t.allAudioTracks:[]}get audioTracks(){const t=this.audioTrackController;return t?t.audioTracks:[]}get audioTrack(){const t=this.audioTrackController;return t?t.audioTrack:-1}set audioTrack(t){const i=this.audioTrackController;i&&(i.audioTrack=t)}get allSubtitleTracks(){const t=this.subtitleTrackController;return t?t.allSubtitleTracks:[]}get subtitleTracks(){const t=this.subtitleTrackController;return t?t.subtitleTracks:[]}get subtitleTrack(){const t=this.subtitleTrackController;return t?t.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(t){const i=this.subtitleTrackController;i&&(i.subtitleTrack=t)}get subtitleDisplay(){const t=this.subtitleTrackController;return t?t.subtitleDisplay:!1}set subtitleDisplay(t){const i=this.subtitleTrackController;i&&(i.subtitleDisplay=t)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(t){this.config.lowLatencyMode=t}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(t){this.latencyController.targetLatency=t}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(t){this.levelController.pathwayPriority=t}get bufferedToEnd(){var t;return!!((t=this.bufferController)!=null&&t.bufferedToEnd)}get interstitialsManager(){var t;return((t=this.interstitialsController)==null?void 0:t.interstitialsManager)||null}getMediaDecodingInfo(t,i=this.allAudioTracks){const s=pt(i);return pe(t,s,navigator.mediaCapabilities)}}qo.defaultConfig=void 0},48136:function(Fr,Ct,Y){"use strict";var U=Object.defineProperty,Pe=Object.defineProperties,We=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,Te=(e,r,n)=>r in e?U(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,z=(e,r)=>{for(var n in r||(r={}))ae.call(r,n)&&Te(e,n,r[n]);if(Me)for(var n of Me(r))E.call(r,n)&&Te(e,n,r[n]);return e},d=(e,r)=>Pe(e,We(r)),ne=e=>typeof e=="symbol"?e:e+"",q=(e,r)=>{var n={};for(var a in e)ae.call(e,a)&&r.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&Me)for(var a of Me(e))r.indexOf(a)<0&&E.call(e,a)&&(n[a]=e[a]);return n};function M(e){return Array.isArray(e)}var L={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 O(){return"window"in globalThis&&"document"in globalThis}function G(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function he(){return typeof navigator.vibrate=="function"}function le(){var e,r;if(!O())return"other";const n=(r=(e=navigator.userAgentData)==null?void 0:e.platform)!=null?r: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 J(){if(!O())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 B(){return HTMLElement.prototype.hasOwnProperty("popover")}var V={strings:L,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return V._locale||(V._locale=O()?navigator.language.slice(0,5):"en-US"),V._locale},set locale(e){V._locale=e,V._numberFormatter=void 0,V.dirty=!0},get numberFormatter(){return V._numberFormatter||(V._numberFormatter=new Intl.NumberFormat(V.locale)),V._numberFormatter},merge(e,r){if(typeof e=="string"&&r)V.strings[e]=z(z({},V.strings[e]),r),V.dirty=!0;else for(const n of Object.keys(e))V.merge(n,e[n])},get dirty(){return V._dirty},set dirty(e){V._dirty||V._dirty===e||(V._dirty=!0,setTimeout(()=>{V._dirty=!1,this._subscribers.forEach(r=>r==null?void 0:r())},0))},subscribe(e){return V._subscribers.push(e),V._subscribers.length-1},unsubscribe(e){e<0||e>=V._subscribers.length||(V._subscribers[e]=void 0)},update(e){let r=e.querySelectorAll("[data-l10n-tooltip]");for(const n of r){const a=n.getAttribute("data-l10n-tooltip");if(a){const c=H(a);c&&n.setAttribute("data-tooltip",c)}}r=e.querySelectorAll("[data-l10n-arial-label]");for(const n of r){const a=n.getAttribute("data-l10n-arial-label");if(a){const c=H(a);c&&n.setAttribute("aria-label",c)}}}};function H(e,...r){if(e===void 0)return;let n="";const a=V.locale;V.strings[a]&&(n=V.strings[a][e]);const c=a.slice(0,2);if(!n&&V.strings[c]&&(n=V.strings[c][e]),n||(n=V.strings.en[e]),!n)return;const p=/(%@|%([0-9]+)\$@)/g;let g=p.exec(n),A=0;for(;g;){if(r[A++]){const I=g[2]?parseInt(g[2],10)-1:A-1;let K=r[I];typeof K=="number"&&(K=V.numberFormatter.format(K)),n=n.replace(g[1],K)}g=p.exec(n)}return n=n.replace(/%%/g,"%"),n}var ie={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},De={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},$e={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"},Se={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"},Ye={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"},lt={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 Xe(e){var r,n,a,c,p,g;const A=e.split("!");let T,I,K,re=255,ve=255,Oe=255,Ke=-1;const vt=A.length>0&&A[0].startsWith("-");vt&&(A[0]=A[0].slice(1));for(let ur=0;ur<A.length;ur++){T=re,I=ve,K=Oe;const mt=(r=A[ur].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:r[1],zt=mt==null?void 0:mt.toLowerCase(),pr=mt&&(g=(p=(c=(a=(n=Se[zt])!=null?n:Se[Ye[mt]])!=null?a:De[mt])!=null?c:lt[mt])!=null?p:ie[mt])!=null?g:A[ur].trim();let Zt=pr.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(Zt!=null&&Zt[1]&&Zt[2]&&Zt[3])re=Math.max(0,Math.min(255,Number.parseInt(Zt[1],16))),ve=Math.max(0,Math.min(255,Number.parseInt(Zt[2],16))),Oe=Math.max(0,Math.min(255,Number.parseInt(Zt[3],16)));else if(Zt=pr.match(/^#([\da-f]{3})$/i),Zt!=null&&Zt[1]){const Hr=Number.parseInt(Zt[1][0],16),ni=Number.parseInt(Zt[1][1],16),Yr=Number.parseInt(Zt[1][2],16);re=Math.max(0,Math.min(255,Hr*16+Hr)),ve=Math.max(0,Math.min(255,ni*16+ni)),Oe=Math.max(0,Math.min(255,Yr*16+Yr))}else if(Zt=pr.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),Zt!=null&&Zt[1]&&Zt[2]&&Zt[3])re=Math.max(0,Math.min(255,Number.parseInt(Zt[1]))),ve=Math.max(0,Math.min(255,Number.parseInt(Zt[2]))),Oe=Math.max(0,Math.min(255,Number.parseInt(Zt[3])));else return;Ke>=0&&(re=(1-Ke)*re+Ke*T,ve=(1-Ke)*ve+Ke*I,Oe=(1-Ke)*Oe+Ke*K,Ke=-1),ur+1<A.length&&(Ke=Math.max(0,Math.min(100,Number.parseInt(A[++ur])))/100)}return Ke>=0&&(re=Ke*re+(1-Ke)*T,ve=Ke*ve+(1-Ke)*I,Oe=Ke*Oe+(1-Ke)*K),vt&&(re=255-re,ve=255-ve,Oe=255-Oe),"#"+("00"+Math.round(re).toString(16)).slice(-2)+("00"+Math.round(ve).toString(16)).slice(-2)+("00"+Math.round(Oe).toString(16)).slice(-2)}function $t(e){var r,n;return e=e.trim(),(n=(r=$e[e.toLowerCase()])!=null?r:$e[Ye[e]])!=null?n:Xe(e)}function ye(e){if(!e||e[0]!=="#")return;e=e.slice(1);let r;return e.length<=4?(r={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(r.a=parseInt(e[3]+e[3],16)/255)):(r={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(r.a=parseInt(e[6]+e[7],16)/255)),r&&r.a===void 0&&(r.a=1),r}function oe(e,r,n){return n<0&&(n+=6),n>=6&&(n-=6),n<1?(r-e)*n+e:n<3?r:n<4?(r-e)*(4-n)+e:e}function me(e){let[r,n,a]=[e.h,e.s,e.l];r=(r+360)%360/60,a=Math.max(0,Math.min(a,1)),n=Math.max(0,Math.min(n,1));const c=a<=.5?a*(n+1):a+n-a*n,p=a*2-c;return{r:Math.round(255*oe(p,c,r+2)),g:Math.round(255*oe(p,c,r)),b:Math.round(255*oe(p,c,r-2))}}function ge(e){return e<0?0:e>255?255:Math.round(e)}function Ee(e){const{r,g:n,b:a}=e;let c=((1<<24)+(ge(r)<<16)+(ge(n)<<8)+ge(a)).toString(16).slice(1);return c[0]===c[1]&&c[2]===c[3]&&c[4]===c[5]&&c[6]===c[7]&&(c=c[0]+c[2]+c[4]),"#"+c}function be(e){let{r,g:n,b:a}=e;r=r/255,n=n/255,a=a/255;const c=Math.min(r,n,a),p=Math.max(r,n,a),g=p-c;let A,T;p===c?A=0:r===p?A=(n-a)/g:n===p?A=2+(a-r)/g:a===p&&(A=4+(r-n)/g),A=Math.min(A*60,360),A<0&&(A+=360);const I=(c+p)/2;return p===c?T=0:I<=.5?T=g/(p+c):T=g/(2-p-c),{h:A,s:T,l:I}}function D(e){let r=ye(e);if(!r)return e;let{h:n,s:a,l:c}=be(r);return a+=.1,c-=.1,Ee(me({h:n,s:a,l:c}))}var R={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"},se={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},Ie=[{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 at(e,r,n){if(!/[A-Za-z\d]/.test(e)||(n==="up"&&(n=void 0),!r&&!n))return e;const a=e.codePointAt(0);if(a===void 0)return e;for(const c of Ie)if((!r||c.variant===r)&&(!n||c.style===n)&&a>=c.offset&&a<c.offset+c.len){const p=c.start+a-c.offset;return String.fromCodePoint(se[p]||p)}return e}function Et(e){var r;if((e<119808||e>120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const n in se)if(se[n]===e){e=(r=n.codePointAt(0))!=null?r:0;break}for(const n of Ie)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 bt(e){var r;let n="";for(const a of e){if("{}<>[]$&#^_%:'\u02DC".includes(a)){n+=a;continue}const c=(r=a.codePointAt(0))!=null?r:0;let p=R[c];if(p)p.startsWith("\\")?n+=p+" ":n+=p;else{const{char:g,variant:A,style:T}=Et(c);switch(p=g,A){case"double-struck":p=`\\mathbb{${p}}`;break;case"fraktur":p=`\\mathfrak{${p}}`;break;case"script":p=`\\mathscr{${p}}`;break;case"sans-serif":p=`\\mathsf{${p}}`;break;case"monospace":p=`\\mathtt{${p}}`;break;case"calligraphic":p=`\\mathcal{${p}}`;break}switch(T){case"bold":p=`\\mathbf{${p}}`;break;case"italic":p=`\\mathit{${p}}`;break;case"bolditalic":p=`\\mathbfit{${p}}`;break}n+=p}}return n}function He(e){return e?Array.isArray(e)?e:typeof e=="object"&&"group"in e?e.group:[]:[]}var Ht={},gt=z({},R),Qe={},xr={},mr={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}"},pi={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}},Wt={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}},si={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:Wt},"amsmath.sty":{package:pi,primitive:!0},"texvc.sty":{package:mr,primitive:!1}},et={" ":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},ct=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,Ue,wt;J()?(Ue=new RegExp("\\p{Letter}","u"),wt=new RegExp("[0-9\\p{Letter}]","u")):(Ue=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,wt=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function Rt(e,r,n="mord",a){r!==void 0&&(Ht[e]={definitionType:"symbol",type:n,variant:a,codepoint:r},gt[r]||(gt[r]=e))}function Dt(e,r,n){if(typeof e=="string"){for(let a=0;a<e.length;a++){const c=e.charAt(a);Rt(c,c.codePointAt(0))}return}for(const[a,c,p,g]of e)Rt(a,c,p!=null?p:r,g!=null?g:n)}function fe(e,r){for(let n=e;n<=r;n++)Rt(String.fromCodePoint(n),n)}function ze(e){var r;return(r=xr[e])!=null?r:null}function it(e,r){var n,a;if(r.length===0||r==="\\"||!r.startsWith("\\"))return[];const c=[];for(const g in Qe)g.startsWith(r)&&!Qe[g].infix&&c.push({match:g,frequency:(n=Qe[g].frequency)!=null?n:0});for(const g in Ht)g.startsWith(r)&&c.push({match:g,frequency:(a=Ht[g].frequency)!=null?a:0});const p=r.substring(1);for(const g of Object.keys(e.options.macros))g.startsWith(p)&&c.push({match:"\\"+g,frequency:0});return c.sort((g,A)=>{var T,I;return g.frequency===A.frequency?g.match.length===A.match.length?g.match<A.match?-1:1:g.match.length-A.match.length:((T=A.frequency)!=null?T:0)-((I=g.frequency)!=null?I:0)}),c.map(g=>g.match)}function ut(e){let r="auto";const n=e.match(/:([^=]+)/);return n&&(r=n[1].trim()),r}function _t(e){if(!e)return[];const r=[];let n=e.split("]");if(n[0].startsWith("[")){r.push({isOptional:!0,type:ut(n[0].slice(1))});for(let a=1;a<=n.length;a++)r.push(..._t(n[a]))}else if(n=e.split("}"),n[0].startsWith("{")){r.push({isOptional:!1,type:ut(n[0].slice(1))});for(let a=1;a<=n.length;a++)r.push(..._t(n[a]))}return r}function Ft(e){if(!e)return"";let r="",n=!0;for(const a of e)typeof a.value=="string"?r+=a.value:n=!1;return n?r:""}function nr(e,r){typeof e=="string"&&(e=[e]);const n={tabular:!1,params:[],createAtom:r};for(const a of e)xr[a]=n}function Pt(e,r,n){typeof e=="string"&&(e=[e]);const c={tabular:!0,params:_t(r),createAtom:n};for(const p of e)xr[p]=c}function Ve(e,r,n){var a,c;n||(n={});const p={definitionType:"function",params:_t(r),ifMode:n.ifMode,isFunction:(a=n.isFunction)!=null?a:!1,applyMode:n.applyMode,infix:(c=n.infix)!=null?c:!1,parse:n.parse,createAtom:n.createAtom,applyStyle:n.applyStyle,serialize:n.serialize,render:n.render};if(typeof e=="string")Qe["\\"+e]=p;else for(const g of e)Qe["\\"+g]=p}var Bt;function gr(e){return Bt||(Bt=qt(si)),e?qt(z(z({},Bt),e)):Bt}function Kt(e,r){var n,a,c,p;if(typeof e=="string"){let g=0;const A=e;return/(^|[^\\])#1/.test(A)&&(g=1),/(^|[^\\])#2/.test(A)&&(g=2),/(^|[^\\])#3/.test(A)&&(g=3),/(^|[^\\])#4/.test(A)&&(g=4),/(^|[^\\])#5/.test(A)&&(g=5),/(^|[^\\])#6/.test(A)&&(g=6),/(^|[^\\])#7/.test(A)&&(g=7),/(^|[^\\])#8/.test(A)&&(g=8),/(^|[^\\])#9/.test(A)&&(g=9),{expand:(n=r==null?void 0:r.expand)!=null?n:!0,captureSelection:(a=r==null?void 0:r.captureSelection)!=null?a:!0,args:g,def:A}}return z({expand:(c=r==null?void 0:r.expand)!=null?c:!0,captureSelection:(p=r==null?void 0:r.captureSelection)!=null?p:!0,args:0},e)}function qt(e){if(!e)return{};const r={};for(const n of Object.keys(e)){const a=e[n];if(a==null)delete r[n];else if(typeof a=="object"&&"package"in a)for(const c of Object.keys(a.package))r[c]=Kt(a.package[c],{expand:!a.primitive,captureSelection:a.captureSelection});else r[n]=Kt(a)}return r}function Gt(e,r="math"){if(!e||e.length===0)return null;let n=null;if(e.startsWith("\\")){if(n=Qe[e],n)return!n.ifMode||n.ifMode===r?n:null;r==="math"?n=Ht[e]:et[e]&&(n={definitionType:"symbol",type:"mord",codepoint:et[e]})}else if(r==="math"){if(n=Ht[e],!n&&e.length===1){const a=wr("math",e.codePointAt(0));return a.startsWith("\\")?d(z({},Gt(a,"math")),{command:a}):null}}else et[e]?n={definitionType:"symbol",type:"mord",codepoint:et[e]}:r==="text"&&(n={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return n!=null?n:null}function Lr(e,r){if(!e.startsWith("\\"))return null;const n=e.slice(1);return r[n]}function wr(e,r){if(r===void 0)return"";if(e==="math"&&gt[r])return gt[r];if(e==="text"){const n=Object.keys(et).find(a=>et[a]===r);return n||String.fromCodePoint(r)}return String.fromCodePoint(r)}var Xt=[0,.68889,0,0,.72222],Ar=[0,.68889,0,0,.66667],C=[0,.68889,0,0,.77778],N=[0,.68889,0,0,.61111],yt=[.16667,.68889,0,0,.77778],X=[0,.68889,0,0,.55556],ue=[0,0,0,0,.25],br=[0,.825,0,0,2.33334],Ne=[0,.9,0,0,2.33334],Fe=[0,.68889,0,0,.54028],qe=[-.03598,.46402,0,0,.5],ee=[-.13313,.36687,0,0,1],de=[.01354,.52239,0,0,1],Re=[.01354,.52239,0,0,1.11111],Ge=[0,.54986,0,0,1],Z=[0,.69224,0,0,.5],Nt=[0,.43056,0,0,1],Ae=[.08198,.58198,0,0,.77778],sr=[.19444,.69224,0,0,.41667],Sr=[.1808,.675,0,0,1],mi=[.19444,.69224,0,0,.83334],Hi=[.13667,.63667,0,0,1],Ai=[-.064,.437,0,0,1.334],zr=[.08167,.58167,0,0,.77778],Ji=[0,.69224,0,0,.72222],Cn=[0,.69224,0,0,.66667],Di=[-.13313,.36687,0,0,.77778],Ii=[.06062,.54986,0,0,.77778],ar=[0,.69224,0,0,.77778],Wr=[.25583,.75583,0,0,.77778],pe=[.25142,.75726,0,0,.77778],we=[.20576,.70576,0,0,.77778],kt=[.30274,.79383,0,0,.77778],Ot=[.22958,.72958,0,0,.77778],Yt=[.1808,.675,0,0,.77778],rr=[.13667,.63667,0,0,.77778],ir=[.13597,.63597,0,0,.77778],or=[.03517,.54986,0,0,.77778],dr=[0,.675,0,0,.77778],Nr=[.19444,.69224,0,0,.61111],qr=[0,.54986,0,0,.76042],xi=[0,.54986,0,0,.66667],Qr=[.0391,.5391,0,0,.77778],Mi=[.03517,.54986,0,0,1.33334],Qi=[.38569,.88569,0,0,.77778],wi=[.23222,.74111,0,0,.77778],$i=[.19444,.69224,0,0,.77778],je=[0,.37788,0,0,.5],tt=[0,.54986,0,0,.72222],At=[0,.69224,0,0,.83334],dt=[.11111,.69224,0,0,.66667],pt=[.26167,.75726,0,0,.77778],Tt=[.48256,.98256,0,0,.77778],Ut=[.28481,.79383,0,0,.77778],Jt=[.08167,.58167,0,0,.22222],Er=[.08167,.58167,0,0,.38889],kr=[0,.43056,.04028,0,.66667],Or=[.41951,.91951,0,0,.77778],vr=[.24982,.74947,0,0,.38865],cr=[.08319,.58283,0,0,.75623],Tr=[0,.10803,0,0,.27764],gi=[0,.47534,0,0,.50181],ci=[.18906,.47534,0,0,.50181],hr=[0,.69141,0,0,.50181],Zr=[.24982,.74947,0,0,.27764],Si=[0,.69141,0,0,.21471],ti=[.25,.75,0,0,.44722],Vr=[0,.64444,0,0,.575],Ti=[.08556,.58556,0,0,.89444],Ur=[0,.69444,0,0,.89444],ri=[0,.68611,0,0,.9],Ri=[0,.68611,0,0,.86944],st=[.25,.75,0,0,.575],Ir=[.25,.75,0,0,.31944],hi=[0,.69444,0,0,.63889],Oi=[0,.69444,0,0,.31944],ln=[0,.44444,0,0,.63889],tn=[0,.44444,0,0,.51111],zi=[0,.69444,0,0,.575],$r=[.13333,.63333,0,0,.89444],jr=[0,.44444,0,0,.31944],qi=[0,.69444,0,0,.86944],Ki=[0,.68611,0,0,.69166],Bi=[0,.68611,0,0,.83055],bs=[0,.68611,0,0,.89444],Wn=[0,.69444,0,0,.60278],un=[.19444,.69444,0,0,.51111],Rr=[0,.69444,0,0,.83055],Ci=[-.10889,.39111,0,0,1.14999],Gi=[.19444,.69444,0,0,.575],On=[.19444,.69444,0,0,1.14999],ss=[.19444,.69444,0,0,.70277],xn=[.05556,.75,0,0,.575],Dn=[0,.68611,0,0,.95833],vn=[.08556,.58556,0,0,.76666],Fi=[-.02639,.47361,0,0,.575],ds=[0,.44444,0,0,.89444],cn=[0,.55556,0,0,.76666],es=[-.10889,.39111,0,0,.89444],ts=[.00222,.50222,0,0,.89444],wn=[.19667,.69667,0,0,.89444],Ei=[.08556,.58556,0,0,1.14999],as=[0,.69444,0,0,.70277],rs=[-.02778,.47222,0,0,.575],os=[.25,.75,0,0,.51111],zn=[-.13889,.36111,0,0,1.14999],di=[.19444,.69444,0,0,1.02222],Ts=[.12963,.69444,0,0,.89444],tr=[.19444,.69444,0,0,.44722],hn=[0,.64444,.13167,0,.59111],Ps=[.19444,.64444,.13167,0,.59111],ls=[0,.68611,.17208,0,.8961],Mn=[.19444,.44444,.105,0,.53222],us=[0,.44444,.085,0,.82666],oi=[0,.69444,.06709,0,.59111],Kn=[0,.69444,.12945,0,.35555],fs=[0,.69444,0,0,.94888],jn=[0,.69444,.11472,0,.59111],dn=[0,.68611,.10778,0,.88555],Sn=[0,.69444,.07939,0,.62055],Bn=[0,.69444,.12417,0,.30667],Ln=[0,.64444,.13556,0,.51111],Cs=[.19444,.64444,.13556,0,.51111],Zn=[0,.68333,.16389,0,.74333],ia=[.19444,.43056,.08847,0,.46],ca=[0,.43056,.07514,0,.71555],Gs=[0,.69444,.06646,0,.51111],_s=[0,.69444,0,0,.83129],Kr=[0,.69444,.1225,0,.51111],fi=[0,.68333,.09403,0,.76666],Zi=[0,.68333,.11111,0,.76666],yi=[0,.69444,.06961,0,.51444],_i=[0,.69444,0,0,.27778],is=[.25,.75,0,0,.38889],rn=[0,.64444,0,0,.5],cs=[0,.69444,0,0,.77778],Pi=[0,.68333,0,0,.75],bi=[0,.68333,0,0,.77778],yn=[0,.68333,0,0,.68056],fn=[0,.68333,0,0,.72222],pn=[.25,.75,0,0,.5],En=[.25,.75,0,0,.27778],Vi=[0,.69444,0,0,.5],Yn=[0,.69444,0,0,.55556],Zs=[0,.43056,0,0,.44445],ns=[0,.43056,0,0,.5],ja=[.19444,.43056,0,0,.55556],Na=[0,.43056,0,0,.55556],Os=[.08333,.58333,0,0,.77778],Da=[0,.43056,0,0,.27778],ho=[0,.66786,0,0,.27778],Ys=[0,.69444,0,0,.75],al=[0,.66786,0,0,.5],Kl=[0,.68333,0,0,.625],fo=[.19444,.69444,0,0,.44445],qa=[0,.69444,0,0,.72222],po=[.19444,.69444,0,0,.5],na=[.19444,.69444,0,0,1],Io=[.011,.511,0,0,1.126],Xs=[.19444,.69444,0,0,.61111],mo=[.05556,.75,0,0,.5],ol=[0,.68333,0,0,.83334],Bs=[.0391,.5391,0,0,.66667],Ma=[-.05555,.44445,0,0,.5],Za=[0,.43056,0,0,.77778],ha=[0,.55556,0,0,.66667],go=[-.03625,.46375,0,0,.77778],da=[-.01688,.48312,0,0,.77778],ll=[.0391,.5391,0,0,1],Fs=[0,.69444,0,0,.61111],$a=[-.03472,.46528,0,0,.5],Js=[.25,.75,0,0,.44445],Ro=[-.14236,.35764,0,0,1],en=[.244,.744,0,0,.412],sn=[.19444,.69444,0,0,.88889],bn=[.12963,.69444,0,0,.77778],Ss=[.19444,.69444,0,0,.38889],Ds=[.011,.511,0,0,1.638],Ya=[.19444,.69444,0,0,0],La=[0,.44444,0,0,.575],sa=[.19444,.44444,0,0,.575],Po=[0,.68611,0,0,.75555],vo=[0,.69444,0,0,.66759],Ia=[0,.68611,0,0,.80555],yo=[0,.68611,.08229,0,.98229],bo=[0,.68611,0,0,.76666],_o=[0,.44444,0,0,.58472],Ms=[.19444,.44444,0,0,.6118],xs=[.19444,.43056,0,0,.5],_u=[0,.68333,.02778,.08334,.76278],Vt=[0,.68333,.08125,.05556,.83125],Oo=[0,.43056,0,.05556,.48472],Ul=[.19444,.43056,0,.08334,.51702],Hl=[.25,.75,0,0,.42778],Es=[0,.69444,0,0,.55],Ns=[0,.69444,0,0,.73334],aa=[0,.69444,0,0,.79445],b0=[0,.69444,0,0,.51945],xu=[0,.69444,0,0,.70278],ul=[0,.69444,0,0,.76389],Bo=[.25,.75,0,0,.34306],za=[0,.69444,0,0,.56111],wu=[0,.69444,0,0,.25556],_0=[.19444,.45833,0,0,.56111],Su=[0,.45833,0,0,.56111],Gl=[0,.69444,0,0,.30556],Vl=[0,.69444,0,0,.58056],Fo=[0,.69444,0,0,.67223],Xa=[0,.69444,0,0,.85556],Ja=[0,.69444,0,0,.55834],xa=[0,.65556,.11156,0,.5],cl=[0,.69444,.08094,0,.70834],Wl=[.17014,0,0,0,.44445],hl=[0,.69444,.0799,0,.5],Eu=[0,.69444,0,0,.73752],dl=[0,.69444,.09205,0,.5],No=[0,.69444,.09031,0,.77778],fl=[0,.69444,.07816,0,.27778],jl=[0,.69444,.00316,0,.5],Au=[.19444,.69444,0,0,.83334],x0=[.05556,.75,0,0,.83334],ku=[0,.75,0,0,.5],ql=[.125,.08333,0,0,.27778],w0=[0,.08333,0,0,.27778],fa=[0,.65556,0,0,.5],Zl=[0,.69444,0,0,.47222],Ka=[0,.69444,0,0,.66667],Tu=[0,.69444,0,0,.59722],Cu=[0,.69444,0,0,.54167],Ce=[0,.69444,0,0,.70834],Du=[.25,.75,0,0,.28889],pl=[0,.69444,0,0,.51667],Yl=[0,.44444,0,0,.44445],Mu=[.19444,.44444,0,0,.51667],xo=[0,.44444,0,0,.38333],Lu=[0,.44444,0,0,.51667],Xl=[0,.69444,0,0,.83334],Iu=[.35001,.85,0,0,.45834],Ru=[.35001,.85,0,0,.57778],ml=[.35001,.85,0,0,.41667],Ls=[.35001,.85,0,0,.58334],oa=[0,.72222,0,0,.55556],$o=[1e-5,.6,0,0,.66667],Pu=[1e-5,.6,0,0,.77778],gl=[.25001,.75,0,0,.94445],S0=[.306,.805,.19445,0,.47222],Ou=[.30612,.805,.19445,0,.47222],Qa=[.25001,.75,0,0,.83334],zo=[.35001,.85,0,0,.47222],Jl=[.25001,.75,0,0,1.11111],E0=[.65002,1.15,0,0,.59722],j=[.65002,1.15,0,0,.81111],m=[.65002,1.15,0,0,.47222],b=[.65002,1.15,0,0,.66667],_=[0,.75,0,0,1],S=[.55001,1.05,0,0,1.27778],P=[.862,1.36,.44445,0,.55556],W=[.86225,1.36,.44445,0,.55556],ce=[.55001,1.05,0,0,1.11111],_e=[.65002,1.15,0,0,.52778],Be=[.65002,1.15,0,0,.61111],Je=[.55001,1.05,0,0,1.51112],ft=[.95003,1.45,0,0,.73611],It=[.95003,1.45,0,0,1.04445],Qt=[.95003,1.45,0,0,.52778],lr=[.95003,1.45,0,0,.75],Dr=[0,.75,0,0,1.44445],Jr=[.95003,1.45,0,0,.58334],ai=[1.25003,1.75,0,0,.79167],ki=[1.25003,1.75,0,0,1.27778],Ni=[1.25003,1.75,0,0,.58334],An=[1.25003,1.75,0,0,.80556],mn=[0,.825,0,0,1.8889],kn=[1.25003,1.75,0,0,.63889],Tn=[.64502,1.155,0,0,.875],In=[1e-5,.6,0,0,.875],As=[-99e-5,.601,0,0,.66667],Fn=[.64502,1.155,0,0,.66667],nt=[1e-5,.9,0,0,.88889],Qs=[.65002,1.15,0,0,.88889],wa=[.90001,0,0,0,.88889],pa=[-.00499,.605,0,0,1.05556],Xn=[0,.12,0,0,.45],Mr=[0,.61111,0,0,.525],ps=[.08333,.69444,0,0,.525],Bu=[-.08056,.53055,0,0,.525],A0=[-.05556,.55556,0,0,.525],ms=[0,.43056,0,0,.525],Ra=[.22222,.43056,0,0,.525],ma=[0,0,0,0,.525],Ko={"AMS-Regular":{32:ue,65:Xt,66:Ar,67:Xt,68:Xt,69:Ar,70:N,71:C,72:C,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:C,76:Ar,77:[0,.68889,0,0,.94445],78:Xt,79:yt,80:N,81:yt,82:Xt,83:X,84:Ar,85:Xt,86:Xt,87:[0,.68889,0,0,1],88:Xt,89:Xt,90:Ar,107:X,160:ue,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:X,295:Fe,710:br,732:Ne,770:br,771:Ne,989:zr,1008:kr,8245:[0,.54986,0,0,.275],8463:Fe,8487:Xt,8498:X,8502:Ar,8503:[0,.68889,0,0,.44445],8504:Ar,8513:[0,.68889,0,0,.63889],8592:qe,8594:qe,8602:ee,8603:ee,8606:de,8608:de,8610:Re,8611:Re,8619:Ge,8620:Ge,8621:[-.13313,.37788,0,0,1.38889],8622:ee,8624:Z,8625:Z,8630:Nt,8631:Nt,8634:Ae,8635:Ae,8638:sr,8639:sr,8642:sr,8643:sr,8644:Sr,8646:Sr,8647:Sr,8648:mi,8649:Sr,8650:mi,8651:de,8652:de,8653:ee,8654:ee,8655:ee,8666:Hi,8667:Hi,8669:[-.13313,.37788,0,0,1],8672:Ai,8674:Ai,8705:[0,.825,0,0,.5],8708:X,8709:zr,8717:[0,.43056,0,0,.42917],8722:qe,8724:[.08198,.69224,0,0,.77778],8726:zr,8733:ar,8736:Ji,8737:Ji,8738:[.03517,.52239,0,0,.72222],8739:Jt,8740:[.25142,.74111,0,0,.27778],8741:Er,8742:[.25142,.74111,0,0,.5],8756:Cn,8757:Cn,8764:Di,8765:[-.13313,.37788,0,0,.77778],8769:Di,8770:go,8774:kt,8776:da,8778:zr,8782:Ii,8783:Ii,8785:Ae,8786:Ae,8787:Ae,8790:ar,8791:Ot,8796:[.08198,.91667,0,0,.77778],8806:Wr,8807:Wr,8808:pe,8809:pe,8812:[.25583,.75583,0,0,.5],8814:we,8815:we,8816:kt,8817:kt,8818:Ot,8819:Ot,8822:Yt,8823:Yt,8828:rr,8829:rr,8830:Ot,8831:Ot,8832:we,8833:we,8840:kt,8841:kt,8842:ir,8843:ir,8847:or,8848:or,8858:Ae,8859:Ae,8861:Ae,8862:dr,8863:dr,8864:dr,8865:dr,8872:[0,.69224,0,0,.61111],8873:Ji,8874:[0,.69224,0,0,.88889],8876:N,8877:N,8878:Xt,8879:Xt,8882:or,8883:or,8884:rr,8885:rr,8888:[0,.54986,0,0,1.11111],8890:ja,8891:Nr,8892:Nr,8901:[0,.54986,0,0,.27778],8903:zr,8905:zr,8906:zr,8907:ar,8908:ar,8909:[-.03598,.46402,0,0,.77778],8910:qr,8911:qr,8912:or,8913:or,8914:xi,8915:xi,8916:Cn,8918:Qr,8919:Qr,8920:Mi,8921:Mi,8922:Qi,8923:Qi,8926:rr,8927:rr,8928:kt,8929:kt,8934:wi,8935:wi,8936:wi,8937:wi,8938:we,8939:we,8940:kt,8941:kt,8994:$i,8995:$i,9416:[.15559,.69224,0,0,.90222],9484:Z,9488:Z,9492:je,9496:je,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:dr,9633:dr,9650:tt,9651:tt,9654:or,9660:tt,9661:tt,9664:or,9674:dt,9733:[.19444,.69224,0,0,.94445],10003:At,10016:At,10731:dt,10846:[.19444,.75583,0,0,.61111],10877:rr,10878:rr,10885:Wr,10886:Wr,10887:ir,10888:ir,10889:pt,10890:pt,10891:Tt,10892:Tt,10901:rr,10902:rr,10933:pe,10934:pe,10935:pt,10936:pt,10937:pt,10938:pt,10949:Wr,10950:Wr,10955:Ut,10956:Ut,57350:Jt,57351:Er,57352:zr,57353:kr,57356:pe,57357:pe,57358:Or,57359:kt,57360:kt,57361:Or,57366:pe,57367:pe,57368:pe,57369:pe,57370:ir,57371:ir},"Caligraphic-Regular":{32:ue,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:ue},"Fraktur-Regular":{32:ue,33:[0,.69141,0,0,.29574],34:Si,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:vr,41:vr,42:[0,.62119,0,0,.27764],43:cr,44:Tr,45:cr,46:Tr,47:[.24982,.74947,0,0,.50181],48:gi,49:gi,50:gi,51:ci,52:ci,53:ci,54:hr,55:ci,56:hr,57:ci,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:Zr,93:Zr,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:ue,8216:Si,8217:Si,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:ue,33:[0,.69444,0,0,.35],34:Wn,35:[.19444,.69444,0,0,.95833],36:xn,37:[.05556,.75,0,0,.95833],38:Ur,39:Oi,40:ti,41:ti,42:[0,.75,0,0,.575],43:$r,44:[.19444,.15556,0,0,.31944],45:xo,46:[0,.15556,0,0,.31944],47:st,48:Vr,49:Vr,50:Vr,51:Vr,52:Vr,53:Vr,54:Vr,55:Vr,56:Vr,57:Vr,58:jr,59:[.19444,.44444,0,0,.31944],60:Ti,61:es,62:Ti,63:[0,.69444,0,0,.54305],64:Ur,65:Ri,66:[0,.68611,0,0,.81805],67:Bi,68:[0,.68611,0,0,.88194],69:Po,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:ri,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Ki,77:[0,.68611,0,0,1.09166],78:ri,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:Ri,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Ir,92:st,93:Ir,94:zi,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:hi,99:tn,100:hi,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:hi,105:Oi,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Oi,109:[0,.44444,0,0,.95833],110:ln,111:La,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:ln,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:tn,123:st,124:Ir,125:st,126:[.35,.34444,0,0,.575],160:ue,163:[0,.69444,0,0,.86853],168:zi,172:[0,.44444,0,0,.76666],176:qi,177:$r,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:$r,216:[.04861,.73472,0,0,.89444],223:Tu,230:[0,.44444,0,0,.83055],247:$r,248:[.09722,.54167,0,0,.575],305:jr,338:[0,.68611,0,0,1.16944],339:ds,567:[.19444,.44444,0,0,.35139],710:zi,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:zi,715:zi,728:zi,729:Oi,730:qi,732:zi,733:zi,915:Ki,916:Dn,920:bs,923:Ia,926:bo,928:ri,931:Bi,933:bs,934:Bi,936:bs,937:Bi,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Oi,8217:Oi,8220:Wn,8221:Wn,8224:un,8225:un,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:vo,8465:Rr,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Rr,8501:as,8592:Ci,8593:Gi,8594:Ci,8595:Gi,8596:Ci,8597:st,8598:On,8599:On,8600:On,8601:On,8636:Ci,8637:Ci,8640:Ci,8641:Ci,8656:Ci,8657:ss,8658:Ci,8659:ss,8660:Ci,8661:[.25,.75,0,0,.70277],8704:hi,8706:[0,.69444,.06389,0,.62847],8707:hi,8709:xn,8711:Dn,8712:vn,8715:vn,8722:$r,8723:$r,8725:st,8726:st,8727:rs,8728:Fi,8729:Fi,8730:[.18,.82,0,0,.95833],8733:ds,8734:[0,.44444,0,0,1.14999],8736:Ji,8739:Ir,8741:st,8743:cn,8744:cn,8745:cn,8746:cn,8747:[.19444,.69444,.12778,0,.56875],8764:es,8768:[.19444,.69444,0,0,.31944],8771:ts,8776:[.02444,.52444,0,0,.89444],8781:ts,8801:ts,8804:wn,8805:wn,8810:Ei,8811:Ei,8826:Ti,8827:Ti,8834:Ti,8835:Ti,8838:wn,8839:wn,8846:cn,8849:wn,8850:wn,8851:cn,8852:cn,8853:$r,8854:$r,8855:$r,8856:$r,8857:$r,8866:as,8867:as,8868:Ur,8869:Ur,8900:Fi,8901:[-.02639,.47361,0,0,.31944],8902:rs,8968:os,8969:os,8970:os,8971:os,8994:zn,8995:zn,9651:di,9657:rs,9661:di,9667:rs,9711:On,9824:Ts,9825:Ts,9826:Ts,9827:Ts,9837:[0,.75,0,0,.44722],9838:tr,9839:tr,10216:ti,10217:ti,10815:ri,10927:wn,10928:wn,57376:Ya},"Main-BoldItalic":{32:ue,33:[0,.69444,.11417,0,.38611],34:Sn,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:Kn,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:hn,49:hn,50:hn,51:hn,52:Ps,53:hn,54:hn,55:Ps,56:hn,57:hn,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:jn,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:ls,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:ls,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:oi,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:Mn,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:Mn,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:ue,168:[0,.69444,.11473,0,.59111],176:fs,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:us,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:us,567:[.19444,.44444,.04611,0,.385],710:oi,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:Kn,730:fs,732:jn,733:jn,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:ls,931:[0,.68611,.11431,0,.82666],933:dn,934:[0,.68611,.05632,0,.82666],936:dn,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:Kn,8217:Kn,8220:[0,.69444,.16772,0,.62055],8221:Sn},"Main-Italic":{32:ue,33:Bn,34:yi,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Bn,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:Ln,49:Ln,50:Ln,51:Ln,52:Cs,53:Ln,54:Ln,55:Cs,56:Ln,57:Ln,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:Kr,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:Zn,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:Zn,79:fi,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:Zn,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:Gs,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:ia,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:ia,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:ue,168:[0,.66786,.10474,0,.51111],176:_s,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:ca,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:ca,710:Gs,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:_s,732:[0,.66786,.11585,0,.51111],733:Kr,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:fi,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Zn,931:[0,.68333,.12028,0,.71555],933:Zi,934:[0,.68333,.05986,0,.71555],936:Zi,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Bn,8217:Bn,8220:[0,.69444,.1685,0,.51444],8221:yi,8463:Fe},"Main-Regular":{32:ue,33:_i,34:Vi,35:Au,36:mo,37:x0,38:cs,39:_i,40:is,41:is,42:ku,43:Os,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:pn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,58:Da,59:[.19444,.43056,0,0,.27778],60:Qr,61:Di,62:Qr,63:Zl,64:cs,65:Pi,66:[0,.68333,0,0,.70834],67:fn,68:[0,.68333,0,0,.76389],69:yn,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:Pi,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:bi,76:Kl,77:[0,.68333,0,0,.91667],78:Pi,79:bi,80:yn,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:fn,85:Pi,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Pi,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:En,92:pn,93:En,94:Vi,95:[.31,.12056,.02778,0,.5],97:ns,98:Yn,99:Zs,100:Yn,101:Zs,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Yn,105:ho,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:_i,109:[0,.43056,0,0,.83334],110:Na,111:ns,112:ja,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:Na,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:Zs,123:pn,124:En,125:pn,126:[.35,.31786,0,0,.5],160:ue,163:[0,.69444,0,0,.76909],167:fo,168:al,172:[0,.43056,0,0,.66667],176:Ys,177:Os,182:Xs,184:Wl,198:[0,.68333,0,0,.90278],215:Os,216:[.04861,.73194,0,0,.77778],223:Vi,230:[0,.43056,0,0,.72222],247:Os,248:[.09722,.52778,0,0,.5],305:Da,338:[0,.68333,0,0,1.01389],339:Za,567:[.19444,.43056,0,0,.30556],710:Vi,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Vi,715:Vi,728:Vi,729:ho,730:Ys,732:al,733:Vi,915:Kl,916:ol,920:bi,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Pi,931:fn,933:bi,934:fn,936:bi,937:fn,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:_i,8217:_i,8220:Vi,8221:Vi,8224:fo,8225:fo,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Fe,8465:qa,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:qa,8501:Fs,8592:ee,8593:po,8594:ee,8595:po,8596:ee,8597:pn,8598:na,8599:na,8600:na,8601:na,8614:[.011,.511,0,0,1],8617:Io,8618:Io,8636:ee,8637:ee,8640:ee,8641:ee,8652:[.011,.671,0,0,1],8656:ee,8657:Xs,8658:ee,8659:Xs,8660:ee,8661:[.25,.75,0,0,.61111],8704:Yn,8706:[0,.69444,.05556,.08334,.5309],8707:Yn,8709:mo,8711:ol,8712:Bs,8715:Bs,8722:Os,8723:Os,8725:pn,8726:pn,8727:$a,8728:Ma,8729:Ma,8730:[.2,.8,0,0,.83334],8733:Za,8734:Nt,8736:Ji,8739:En,8741:pn,8743:ha,8744:ha,8745:ha,8746:ha,8747:[.19444,.69444,.11111,0,.41667],8764:Di,8768:[.19444,.69444,0,0,.27778],8771:go,8773:[-.022,.589,0,0,1],8776:da,8781:go,8784:[-.133,.67,0,0,.778],8801:go,8804:ir,8805:ir,8810:ll,8811:ll,8826:Qr,8827:Qr,8834:Qr,8835:Qr,8838:ir,8839:ir,8846:ha,8849:ir,8850:ir,8851:ha,8852:ha,8853:Os,8854:Os,8855:Os,8856:Os,8857:Os,8866:Fs,8867:Fs,8868:cs,8869:cs,8872:[.249,.75,0,0,.867],8900:Ma,8901:[-.05555,.44445,0,0,.27778],8902:$a,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:Js,8969:Js,8970:Js,8971:Js,8994:Ro,8995:Ro,9136:en,9137:en,9651:sn,9657:$a,9661:sn,9667:$a,9711:na,9824:bn,9825:bn,9826:bn,9827:bn,9837:[0,.75,0,0,.38889],9838:Ss,9839:Ss,10216:is,10217:is,10222:en,10223:en,10229:[.011,.511,0,0,1.609],10230:Ds,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:Ds,10815:Pi,10927:ir,10928:ir,57376:Ya},"Math-BoldItalic":{32:ue,48:La,49:La,50:La,51:sa,52:sa,53:sa,54:Vr,55:sa,56:Vr,57:sa,65:Ri,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:yo,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Po,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:vo,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:_o,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:ue,915:[0,.68611,.15972,0,.65694],916:Dn,920:[0,.68611,.03194,0,.86722],923:Ia,926:[0,.68611,.07458,0,.84125],928:yo,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:bo,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:_o,960:[0,.44444,.03704,0,.68241],961:Ms,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:Ms,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:ue,48:ns,49:ns,50:ns,51:xs,52:xs,53:xs,54:rn,55:xs,56:rn,57:xs,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:Vt,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:_u,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:Oo,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:ue,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:_u,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Vt,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:Oo,960:[0,.43056,.03588,0,.57003],961:Ul,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:Ul,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:ue,33:[0,.69444,0,0,.36667],34:Ja,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:Gl,40:Hl,41:Hl,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:Es,49:Es,50:Es,51:Es,52:Es,53:Es,54:Es,55:Es,56:Es,57:Es,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:b0,64:Ns,65:Ns,66:Ns,67:xu,68:aa,69:[0,.69444,0,0,.64167],70:Fs,71:Ns,72:aa,73:[0,.69444,0,0,.33056],74:b0,75:ul,76:Vl,77:[0,.69444,0,0,.97778],78:aa,79:aa,80:xu,81:[.10556,.69444,0,0,.79445],82:xu,83:Fs,84:Ns,85:ul,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Ns,89:[0,.69444,.0275,0,.73334],90:Fo,91:Bo,93:Bo,94:Es,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:za,99:[0,.45833,0,0,.48889],100:za,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:za,105:wu,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:wu,109:[0,.45833,0,0,.86667],110:Su,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:Su,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:ue,168:Es,176:Ns,180:Es,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Es,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Es,729:Gl,730:Ns,732:Es,733:Es,915:Vl,916:[0,.69444,0,0,.91667],920:Xa,923:Fo,926:Ns,928:aa,931:aa,933:Xa,934:aa,936:Xa,937:aa,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Gl,8217:Gl,8220:Ja,8221:Ja},"SansSerif-Italic":{32:ue,33:[0,.69444,.05733,0,.31945],34:jl,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:fl,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:ql,45:[0,.44444,.01946,0,.33333],46:w0,47:[.25,.75,.13164,0,.5],48:xa,49:xa,50:xa,51:xa,52:xa,53:xa,54:xa,55:xa,56:xa,57:xa,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:Ka,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:cl,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:Cu,77:[0,.69444,.08094,0,.875],78:cl,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:hl,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:ue,168:[0,.67937,.06385,0,.5],176:Eu,184:Wl,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:hl,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:dl,715:Vi,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Eu,732:[0,.67659,.08826,0,.5],733:dl,915:[0,.69444,.13372,0,.54167],916:Xl,920:[0,.69444,.07555,0,.77778],923:Fs,926:[0,.69444,.12816,0,.66667],928:cl,931:[0,.69444,.11983,0,.72222],933:No,934:[0,.69444,.04603,0,.72222],936:No,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:fl,8217:fl,8220:[0,.69444,.14205,0,.5],8221:jl},"SansSerif-Regular":{32:ue,33:[0,.69444,0,0,.31945],34:Vi,35:Au,36:mo,37:x0,38:[0,.69444,0,0,.75834],39:_i,40:is,41:is,42:ku,43:Os,44:ql,45:[0,.44444,0,0,.33333],46:w0,47:pn,48:fa,49:fa,50:fa,51:fa,52:fa,53:fa,54:fa,55:fa,56:fa,57:fa,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Zl,64:Ka,65:Ka,66:Ka,67:hi,68:[0,.69444,0,0,.72223],69:Tu,70:[0,.69444,0,0,.56945],71:Ka,72:Ce,73:_i,74:Zl,75:[0,.69444,0,0,.69445],76:Cu,77:[0,.69444,0,0,.875],78:Ce,79:[0,.69444,0,0,.73611],80:hi,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Yn,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:Ka,89:[0,.69444,.025,0,.66667],90:Fs,91:Du,93:Du,94:Vi,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:pl,99:Yl,100:pl,101:Yl,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:pl,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:Lu,111:[0,.44444,0,0,.5],112:Mu,113:Mu,114:[0,.44444,.01389,0,.34167],115:xo,116:[0,.57143,0,0,.36111],117:Lu,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:ue,168:[0,.67937,0,0,.5],176:Ka,184:Wl,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Vi,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Vi,715:Vi,728:Vi,729:[0,.67937,0,0,.27778],730:Ka,732:[0,.67659,0,0,.5],733:Vi,915:Cu,916:Xl,920:cs,923:Fs,926:Ka,928:Ce,931:qa,933:cs,934:qa,936:cs,937:qa,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:_i,8217:_i,8220:Vi,8221:Vi},"Script-Regular":{32:ue,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:ue},"Size1-Regular":{32:ue,40:Iu,41:Iu,47:Ru,91:ml,92:Ru,93:ml,123:Ls,125:Ls,160:ue,710:oa,732:oa,770:oa,771:oa,8214:[-99e-5,.601,0,0,.77778],8593:$o,8595:$o,8657:Pu,8659:Pu,8719:gl,8720:gl,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:Ou,8748:S0,8749:S0,8750:Ou,8896:Qa,8897:Qa,8898:Qa,8899:Qa,8968:zo,8969:zo,8970:zo,8971:zo,9168:As,10216:zo,10217:zo,10752:Jl,10753:Jl,10754:Jl,10756:Qa,10758:Qa},"Size2-Regular":{32:ue,40:E0,41:E0,47:j,91:m,92:j,93:m,123:b,125:b,160:ue,710:_,732:_,770:_,771:_,8719:S,8720:S,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:W,8748:P,8749:P,8750:W,8896:ce,8897:ce,8898:ce,8899:ce,8968:_e,8969:_e,8970:_e,8971:_e,10216:Be,10217:Be,10752:Je,10753:Je,10754:Je,10756:ce,10758:ce},"Size3-Regular":{32:ue,40:ft,41:ft,47:It,91:Qt,92:It,93:Qt,123:lr,125:lr,160:ue,710:Dr,732:Dr,770:Dr,771:Dr,8730:[.95003,1.45,0,0,1],8968:Jr,8969:Jr,8970:Jr,8971:Jr,10216:lr,10217:lr},"Size4-Regular":{32:ue,40:ai,41:ai,47:ki,91:Ni,92:ki,93:Ni,123:An,125:An,160:ue,710:mn,732:mn,770:mn,771:mn,8730:[1.25003,1.75,0,0,1],8968:kn,8969:kn,8970:kn,8971:kn,9115:Tn,9116:In,9117:Tn,9118:Tn,9119:In,9120:Tn,9121:Fn,9122:As,9123:Fn,9124:Fn,9125:As,9126:Fn,9127:nt,9128:Qs,9129:wa,9130:[0,.3,0,0,.88889],9131:nt,9132:Qs,9133:wa,9143:[.88502,.915,0,0,1.05556],10216:An,10217:An,57344:pa,57345:pa,57680:Xn,57681:Xn,57682:Xn,57683:Xn},"Typewriter-Regular":{32:ma,33:Mr,34:Mr,35:Mr,36:ps,37:ps,38:Mr,39:Mr,40:ps,41:ps,42:[0,.52083,0,0,.525],43:Bu,44:[.13889,.125,0,0,.525],45:Bu,46:[0,.125,0,0,.525],47:ps,48:Mr,49:Mr,50:Mr,51:Mr,52:Mr,53:Mr,54:Mr,55:Mr,56:Mr,57:Mr,58:ms,59:[.13889,.43056,0,0,.525],60:A0,61:[-.19549,.41562,0,0,.525],62:A0,63:Mr,64:Mr,65:Mr,66:Mr,67:Mr,68:Mr,69:Mr,70:Mr,71:Mr,72:Mr,73:Mr,74:Mr,75:Mr,76:Mr,77:Mr,78:Mr,79:Mr,80:Mr,81:[.13889,.61111,0,0,.525],82:Mr,83:Mr,84:Mr,85:Mr,86:Mr,87:Mr,88:Mr,89:Mr,90:Mr,91:ps,92:ps,93:ps,94:Mr,95:[.09514,0,0,0,.525],96:Mr,97:ms,98:Mr,99:ms,100:Mr,101:ms,102:Mr,103:Ra,104:Mr,105:Mr,106:[.22222,.61111,0,0,.525],107:Mr,108:Mr,109:ms,110:ms,111:ms,112:Ra,113:Ra,114:ms,115:ms,116:[0,.55358,0,0,.525],117:ms,118:ms,119:ms,120:ms,121:Ra,122:ms,123:ps,124:ps,125:ps,126:Mr,127:Mr,160:ma,176:Mr,184:[.19445,0,0,0,.525],305:ms,567:Ra,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Mr,715:Mr,728:Mr,730:Mr,770:Mr,771:Mr,776:Mr,915:Mr,916:Mr,920:Mr,923:Mr,926:Mr,928:Mr,931:Mr,933:Mr,934:Mr,936:Mr,937:Mr,8216:Mr,8217:Mr,8242:Mr,9251:[.11111,.21944,0,0,.525]}},vl=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,Ua=10,Jn=.25,mc=1.2,Sa=.431,Ql={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[Sa,Sa,Sa],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:[Jn,Jn,Jn],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]},eu=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],wo=5,yl={"\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 bl(e,r){e===void 0&&(e=77);const n=Ko[r][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 yl)e=yl[a].codePointAt(0);else if(vl.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 Ha={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]},tu={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]},gc={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 gd(e){if(tu[e]){const[I,K,re]=tu[e],ve=`<span class="stretchy" style="height:${re}em"><svg width="100%" height="${re}em" viewBox="0 0 ${I} ${K}" preserveAspectRatio="none" ><path fill="currentcolor" d="${gc[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*re/2)/100}em;min-width:0">${ve}</span>`}const[r,n,a,c]=Ha[e];let p,g;const A=a/1e3;r.length===3?(p=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],g=["xMinYMin","xMidYMin","xMaxYMin"]):r.length===2?(p=["slice-1-of-2","slice-2-of-2"],g=["xMinYMin","xMaxYMin"]):(p=["slice-1-of-1"],g=[c]);const T=r.map((I,K)=>`<span class="${p[K]}" style=height:${A}em><svg width=400em height=${A}em viewBox="0 0 400000 ${a}" preserveAspectRatio="${g[K]} slice"><path fill="currentcolor" d="${gc[I]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${A}em;min-width:${n}em;">${T}</span>`}function vc(e){return Ha[e]?Ha[e][2]/1e3:tu[e][2]}function Fu(e){const r=[];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 c=e.charCodeAt(n+1);if(c>=56320&&c<=57343){const p=a-55296,g=c-56320;a=Lo(2,16)+p*Lo(2,10)+g,n++}}r.push(a)}return r}var k0=8205,vd=[[k0,1],[65038,2],[127995,5],[129456,4],[917536,96]],Nu,yc=[127462,127487];function bc(e){var r;if(Nu===void 0){Nu={};for(const n of vd)for(let a=n[0];a<=n[0]+n[1]-1;a++)Nu[a]=!0}return(r=Nu[e])!=null?r:!1}function yd(e){return e>=yc[0]&&e<=yc[1]}function T0(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;const r=[],n=Fu(e);let a=0;for(;a<n.length;){const c=n[a++],p=n[a];if(p===k0){const g=a-1;for(a+=2;n[a]===k0;)a+=2;r.push(String.fromCodePoint(...n.slice(g,a-g+1)))}else if(bc(p)){const g=a-1;for(;bc(n[a]);)a+=n[a]===k0?2:1;r.push(String.fromCodePoint(...n.slice(g,2*a-g-1)))}else yd(c)?(a+=1,r.push(String.fromCodePoint(...n.slice(a-2,2)))):r.push(String.fromCodePoint(c))}return r}var ih=class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=T0(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 r=typeof this.s=="string"?e.exec(this.s.slice(this.pos)):e.exec(this.s.slice(this.pos).join(""));return r!=null&&r[0]?(this.pos+=r[0].length,r[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 r=this.match(/^[a-zA-Z\*]+/);return r?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):r=this.get(),"\\"+r}}else{if(e==="{")return"<{>";if(e==="}")return"<}>";if(e==="^"){if(this.peek()==="^"){this.get();const r=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(r)return String.fromCodePoint(Number.parseInt(r.slice(r.lastIndexOf("^")+1),16))}return e}else if(e==="#"){if(!this.end()){let r=!1;if(/[\d?@]/.test(this.peek())&&(r=!0,this.pos+1<this.s.length)){const n=this.s[this.pos+1];r=/[^\dA-Za-z]/.test(n)}return r?"#"+this.get():"#"}}else if(e==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return e}};function $u(e,r){var n,a,c,p;const g=[];let A=e.next();if(A&&A!=="\\relax"){if(A==="\\noexpand")A=e.next(),A&&g.push(A);else if(A==="\\obeyspaces")e.obeyspaces=!0;else if(A==="\\bgroup")g.push("<{>");else if(A==="\\egroup")g.push("<}>");else if(A==="\\string"){if(A=e.next(),A)if(A.startsWith("\\"))for(const T of A)g.push(T==="\\"?"\\backslash":T);else A==="<{>"?g.push("\\{"):A==="<space>"?g.push("~"):A==="<}>"&&g.push("\\}")}else if(A==="\\csname"){for(;e.peek()==="<space>";)e.next();let T="",I=!1,K=[];do{if(K.length===0)if(/^#[\d?@]$/.test(e.peek())){const re=e.get().slice(1);K=ru((a=(n=r==null?void 0:r(re))!=null?n:r==null?void 0:r("?"))!=null?a:"\\placeholder{}",r),A=K[0]}else A=e.next(),K=A?[A]:[];I=K.length===0,!I&&A==="\\endcsname"&&(I=!0,K.shift()),I||(I=A==="<$>"||A==="<$$>"||A==="<{>"||A==="<}>"||typeof A=="string"&&A.length>1&&A.startsWith("\\")),I||(T+=K.shift())}while(!I);T&&g.push("\\"+T),g.push(...K)}else if(A!=="\\endcsname")if(A.length>1&&A.startsWith("#")){const T=A.slice(1);g.push(...ru((p=(c=r==null?void 0:r(T))!=null?c:r==null?void 0:r("?"))!=null?p:"\\placeholder{}",r))}else g.push(A)}return g}function ru(e,r=null){const n=[];let a="";for(const g of e.toString().split(/\r?\n/)){a&&n.push(a),a=" ";const A=g.match(/((?:\\%)|[^%])*/);A!==null&&n.push(A[0])}const c=new ih(bt(n.join(""))),p=[];do p.push(...$u(c,r));while(!c.end());return p}function Yi(e){let r="";const n=[];for(const a of e)a&&(r&&/^[a-zA-Z\*]/.test(a)&&n.push(r),n.push(a),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(a)&&n.push(" "),r=/\\[a-zA-Z]+\*?$/.test(a)?" ":"");return n.join("")}function Gn(e,...r){return console.assert(e.startsWith("\\")),r.length===0?e:Yi([e,...r.map(n=>`{${n}}`)])}function Uo(e){return Yi(e.map(r=>{var n;return(n={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[r])!=null?n:r}))}var _c=class rh{constructor(r){rh._registry[r]=this}static createAtom(r,n,a){return rh._registry[r].createAtom(n,Gt(n,r),a)}static serialize(r,n){var a;if(!r||r.length===0)return"";if((a=n.skipStyles)!=null&&a){const c=[];for(const p of nh(r)){const g=rh._registry[p[0].mode];c.push(...g.serialize(p,n))}return Yi(c)}return Yi(wc(r,n))}static getFont(r,n,a){return rh._registry[r].getFont(n,a)}};_c._registry={};var Ea=_c;function nh(e){const r=[];let n=[],a="NONE";for(const c of e)c.type!=="first"&&(c.mode!==a?(n.length>0&&r.push(n),n=[c],a=c.mode):n.push(c));return n.length>0&&r.push(n),r}function So(e,r){const n=[];let a=[],c;for(const p of e)if(p.type!=="first"&&p.style){let g;r==="variant"?(g=p.style.variant,p.style.variantStyle&&p.style.variantStyle!=="up"&&(g+="-"+p.style.variantStyle)):g=p.style[r],g===c?a.push(p):(a.length>0&&n.push(a),a=[p],c=g)}return a.length>0&&n.push(a),n}function sh(e,r){var n;const{parent:a}=e[0],c=a==null?void 0:a.computedStyle.color,p=[];for(const g of nh(e)){const A=r.defaultMode;for(const T of So(g,"color")){const I=T[0].computedStyle,K=Ea._registry[T[0].mode].serialize(T,d(z({},r),{defaultMode:A==="text"?"text":"math"}));!r.skipStyles&&I.color&&I.color!=="none"&&(!a||c!==I.color)?p.push(Gn("\\textcolor",(n=I.verbatimColor)!=null?n:I.color,Yi(K))):p.push(Yi(K))}}return p}function xc(e,r){const{parent:n}=e[0],a=n==null?void 0:n.computedStyle.backgroundColor;return So(e,"backgroundColor").map(c=>{var p;if(c.length>0||c[0].type!=="box"){const g=c[0].computedStyle;if(g.backgroundColor&&g.backgroundColor!=="none"&&(!n||a!==g.backgroundColor))return Gn("\\colorbox",(p=g.verbatimBackgroundColor)!=null?p:g.backgroundColor,Yi(sh(c,d(z({},r),{defaultMode:"text"}))))}return Yi(sh(c,r))})}function wc(e,r){if(e.length===0)return[];const{parent:n}=e[0],a=n==null?void 0:n.computedStyle.fontSize,c=[];for(const p of So(e,"fontSize")){const g=p[0].computedStyle.fontSize,A=xc(p,r);A&&(g&&g!=="auto"&&(!n||a!==g)?c.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][g],...A):c.push(...A))}return c}function ah(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 $s(e){if(e.length===0)return"ord";const r=ah(e[0].type),n=ah(e[e.length-1].type);return r&&r===n?r:"ord"}function C0(e,r){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()+(r!=null?r:"")}return""}var fr=class Hp{constructor(r,n){var a,c,p,g,A;if(typeof r=="number"?this.value=String.fromCodePoint(r):typeof r=="string"?this.value=r:M(r)?this.children=r.filter(I=>I!==null):r&&r instanceof Hp&&(this.children=[r]),this.children)for(const I of this.children)I.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=(c=n==null?void 0:n.classes)!=null?c:"",this.isTight=(p=n==null?void 0:n.isTight)!=null?p:!1,n!=null&&n.attributes&&(this.attributes=n.attributes);let T=n==null?void 0:n.fontFamily;n!=null&&n.style&&this.value&&(T=(A=Ea.getFont((g=n.mode)!=null?g:"math",this,d(z({variant:"normal"},n.style),{letterShapeStyle:n.letterShapeStyle})))!=null?A: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),eo(this,T)}set atomID(r){r===void 0||r.length===0||(this.id=r)}selected(r){if(this.isSelected!==r&&(this.isSelected=r,this.children))for(const n of this.children)n.selected(r)}setStyle(r,n,a){if(n===void 0)return;const c=C0(n,a);c.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[r]=c)}setTop(r){Number.isFinite(r)&&Math.abs(r)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=C0(r,"em"),this.height-=r,this.depth+=r)}get left(){var r;return(r=this.cssProperties)!=null&&r["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(r){Number.isFinite(r)&&(r===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=C0(r,"em")))}set right(r){Number.isFinite(r)&&(r===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=C0(r,"em")))}set bottom(r){Number.isFinite(r)&&(r===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=C0(r,"em")))}get width(){return this._width*this.scale}set width(r){this._width=r,this.hasExplicitWidth=!0}set softWidth(r){}get height(){return this._height*this.scale}set height(r){this._height=r}get depth(){return this._depth*this.scale}set depth(r){this._depth=r}wrap(r){const n=r.parent;if(!n)return this;r.isPhantom&&this.setStyle("opacity",0);const a=r.color;a&&a!==n.color&&this.setStyle("color",a);let c=r.backgroundColor;this.isSelected&&(c=D(c)),c&&c!==n.backgroundColor&&(this.setStyle("background-color",c),this.setStyle("display","inline-block"));const p=r.scalingFactor;return this.scale=p,this.skew*=p,this.italic*=p,this}toMarkup(){var r,n,a,c;let p=(r=this.value)!=null?r:"";if(this.children)for(const Oe of this.children)p+=Oe.toMarkup();let g="";if(this.svgBody)g=gd(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+=p,g+="</span>",g+='<svg style="position:absolute;overflow:visible;',g+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const Oe=(n=this.cssProperties)==null?void 0:n.padding;Oe?(g+=`top:${Oe};`,g+=`left:${Oe};`,g+=`width:calc(100% - 2 * ${Oe} );`):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 A="";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 I=T.length===1?T[0]:T.filter((Oe,Ke,vt)=>Oe.length>0&&vt.indexOf(Oe)===Ke).join(" ");if(I.length>0&&(A+=` class="${I}"`),this.id&&(A+=` data-atom-id=${this.id}`),this.cssId&&(A+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(A+=" "+Object.keys(this.attributes).map(Oe=>`${Oe}="${this.attributes[Oe]}"`).join(" ")),this.htmlData){const Oe=this.htmlData.split(",");for(const Ke of Oe){const vt=Ke.match(/([^=]+)=(.+$)/);if(vt){const ur=vt[1].trim().replace(/ /g,"-");ur&&(A+=` data-${ur}="${vt[2]}" `)}else{const ur=Ke.trim().replace(/ /g,"-");ur&&(A+=` data-${ur} `)}}}const K=(c=this.cssProperties)!=null?c:{};this.hasExplicitWidth&&K.width===void 0&&(K.width=`${Math.ceil(this._width*100)/100}em`);const re=Object.keys(K).map(Oe=>`${Oe}:${K[Oe]}`);if(this.scale!==void 0&&this.scale!==1&&(p.length>0||g.length>0)&&re.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const Oe=this.htmlStyle.split(";");let Ke="";for(const vt of Oe){const ur=vt.match(/([^=]+):(.+$)/);if(ur){const mt=ur[1].trim().replace(/ /g,"-");mt&&(Ke+=`${mt}:${ur[2]};`)}}Ke&&(A+=` style="${Ke}"`)}re.length>0&&(A+=` style="${re.join(";")}"`);let ve="";return A.length>0||g.length>0?ve=`<span${A}>${p}${g}</span>`:ve=p,this.caret==="text"?ve+='<span class="ML__text-caret"></span>':this.caret==="math"&&(ve+='<span class="ML__caret"></span>'),ve}tryCoalesceWith(r){if(this.svgBody||!this.value||r.svgBody||!r.value)return!1;const n=this.children&&this.children.length>0,a=r.children&&r.children.length>0;if(n||a)return!1;if(r.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(r.cssProperties&&T in r.cssProperties||this.cssProperties&&T in this.cssProperties)return!1}const c=this.cssProperties?Object.keys(this.cssProperties).length:0,p=r.cssProperties?Object.keys(r.cssProperties).length:0;if(c!==p)return!1;if(c>0){for(const T of Object.keys(this.cssProperties))if(this.cssProperties[T]!==r.cssProperties[T])return!1}const g=this.classes.trim().replace(/\s+/g," ").split(" "),A=r.classes.trim().replace(/\s+/g," ").split(" ");if(g.length!==A.length)return!1;g.sort(),A.sort();for(const[T,I]of g.entries())if(I==="vertical-separator"||I!==A[T])return!1;return this.value+=r.value,this.height=Math.max(this.height,r.height),this.depth=Math.max(this.depth,r.depth),this._width=this._width+r._width,this.maxFontSize=Math.max(this.maxFontSize,r.maxFontSize),this.italic=r.italic,!0}};function Pa(e){if(!e||e.length===0)return[];e[0].children=Pa(e[0].children);const r=[e[0]];for(let n=1;n<e.length;n++)r[r.length-1].tryCoalesceWith(e[n])||(e[n].children=Pa(e[n].children),r.push(e[n]));return r}function D0(e){return e.children&&(e.children=Pa(e.children)),e}function M0(e,r){if(!e)return new fr(null,r);const n=new fr(null,{classes:"ML__strut",type:"ignore"});n.setStyle("height",Math.max(0,e.height),"em");const a=[n];if(e.depth!==0){const c=new fr(null,{classes:"ML__strut--bottom",type:"ignore"});c.setStyle("height",e.height+e.depth,"em"),c.setStyle("vertical-align",-e.depth,"em"),a.push(c)}return a.push(e),new fr(a,d(z({},r),{type:"lift"}))}function L0(e){const r=vc(e)/2,n=new fr(null,{maxFontSize:0});return n.height=r+.166,n.depth=r-.166,n.svgBody=e,n}function eo(e,r){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 c=bl(e.value.codePointAt(a),r);e.height=Math.max(e.height,c.height),e.depth=Math.max(e.depth,c.depth),e._width+=c.width,e.skew=c.skew,e.italic=c.italic}return}if(e.children&&e.children.length>0){let a=-1/0,c=-1/0,p=0;for(const g of e.children)g.height>a&&(a=g.height),g.depth>c&&(c=g.depth),p=Math.max(p,(n=g.maxFontSize)!=null?n:0);e.height=a,e.depth=c,e._width=e.children.reduce((g,A)=>g+A.width,0),e.maxFontSize=p}}function oh(e){if("individualShift"in e){const r=e.individualShift;let n=r[0];const a=[n],c=-n.shift-n.box.depth;let p=c;for(let g=1;g<r.length;g++){const A=r[g],T=-A.shift-p-A.box.depth,I=T-(n.box.height+n.box.depth);p=p+T,a.push(I),a.push(A),n=A}return[a,c]}if("top"in e){let r=e.top;for(const n of e.children)r-=typeof n=="number"?n:n.box.height+n.box.depth;return[e.children,r]}else{if("bottom"in e)return[e.children,-e.bottom];if("firstBaseline"in e){const r=e.firstBaseline[0];if(typeof r=="number")throw new Error("First child must be an element.");return[e.firstBaseline,-r.box.depth]}else if("shift"in e){const r=e.children[0];if(typeof r=="number")throw new Error("First child must be an element.");return[e.children,-r.box.depth-e.shift]}}return[null,0]}function lh(e){var r;const[n,a]=oh(e);if(!n)return[[],0,0];const c=new fr(null,{classes:"pstrut"});let p=0;for(const Ke of n)if(typeof Ke!="number"){const vt=Ke.box;p=Math.max(p,vt.maxFontSize,vt.height)}p+=2,c.height=p,c.setStyle("height",p,"em");const g=[];let A=a,T=a,I=a,K=0;for(const Ke of n){if(typeof Ke=="number")I+=Ke;else{const vt=Ke.box,ur=(r=Ke.classes)!=null?r:[],mt=new fr([c,vt],{classes:ur.join(" "),style:Ke.style});vt.setStyle("height",vt.height+vt.depth,"em"),vt.setStyle("display","inline-block"),mt.setStyle("top",-p-I-vt.depth,"em"),Ke.marginLeft&&mt.setStyle("margin-left",Ke.marginLeft,"em"),Ke.marginRight&&mt.setStyle("margin-right",Ke.marginRight,"em"),g.push(mt),I+=vt.height+vt.depth,K=Math.max(K,mt.width)}A=Math.min(A,I),T=Math.max(T,I)}g.forEach(Ke=>{Ke.softWidth=K});const re=new fr(g,{classes:"vlist"});if(re.softWidth=K,re.height=T,re.setStyle("height",T,"em"),A>=0)return[[new fr(re,{classes:"vlist-r"})],T,-A];const ve=new fr(new fr(null),{classes:"vlist"});ve.height=-A,ve.setStyle("height",-A,"em");const Oe=new fr(8203,{classes:"vlist-s",maxFontSize:0});return Oe.softWidth=0,Oe.height=0,Oe.depth=0,[[new fr([re,Oe],{classes:"vlist-r"}),new fr(ve,{classes:"vlist-r"})],T,-A]}var ws=class extends fr{constructor(e,r){var n;const[a,c,p]=lh(e);super(a.length===1?a[0]:a,{type:r==null?void 0:r.type,classes:((n=r==null?void 0:r.classes)!=null?n:"")+" vlist-t"+(a.length===2?" vlist-t2":"")}),this.height=c,this.depth=p,this.softWidth=a.reduce((g,A)=>Math.max(g,A.width),0)}};function bd(e,r){var n,a,c,p,g;const A=e.metrics,T=new fr(r.base),I=(n=r.baseShift)!=null?n:0,K=(a=r.slant)!=null?a:0;let re=0,ve=0;r.above&&(re=(c=r.aboveShift)!=null?c:Math.max(A.bigOpSpacing1,A.bigOpSpacing3-r.above.depth)),r.below&&(ve=(p=r.belowShift)!=null?p:Math.max(A.bigOpSpacing2,A.bigOpSpacing4-r.below.height));let Oe=null;if(r.below&&r.above){const Ke=A.bigOpSpacing5+r.below.height+r.below.depth+ve+T.depth+I;Oe=new ws({bottom:Ke,children:[A.bigOpSpacing5,{box:r.below,marginLeft:-K,classes:["ML__center"]},ve,{box:T,classes:["ML__center"]},re,{box:r.above,marginLeft:K,classes:["ML__center"]},A.bigOpSpacing5]}).wrap(e)}else if(r.below&&!r.above)Oe=new ws({top:T.height-I,children:[A.bigOpSpacing5,{box:r.below,marginLeft:-K,classes:["ML__center"]},ve,{box:T,classes:["ML__center"]}]}).wrap(e);else if(!r.below&&r.above){const Ke=T.depth+I;Oe=new ws({bottom:Ke,children:[{box:T,classes:["ML__center"]},re,{box:r.above,marginLeft:K,classes:["ML__center"]},A.bigOpSpacing5]}).wrap(e)}else{const Ke=T.depth+I;Oe=new ws({bottom:Ke,children:[{box:T},A.bigOpSpacing5]}).wrap(e)}return new fr(Oe,{type:(g=r.type)!=null?g:"op"})}var Sc=7,I0=6,R0=5,_l=4,iu=3,ga=2,xl=1,Vs=0,Ho=class{constructor(e,r,n){this.id=e,this.sizeDelta=r,this.cramped=n;const a={"-4":2,"-3":1,0:0}[r];this.metrics=Object.keys(Ql).reduce((c,p)=>d(z({},c),{[p]:Ql[p][a]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return to[[Vs,xl,Vs,xl,ga,iu,ga,iu][this.id]]}get sub(){return to[[Vs,Vs,Vs,Vs,ga,ga,ga,ga][this.id]]}get fracNum(){return to[[Vs,xl,Vs,xl,ga,iu,_l,R0][this.id]]}get fracDen(){return to[[Vs,Vs,Vs,Vs,ga,ga,_l,_l][this.id]]}get cramp(){return to[[Vs,Vs,ga,ga,_l,_l,I0,I0][this.id]]}get isTight(){return this.sizeDelta<0}},zu={7:new Ho(Sc,0,!1),6:new Ho(I0,0,!0),5:new Ho(R0,0,!1),4:new Ho(_l,0,!0),3:new Ho(iu,-3,!1),2:new Ho(ga,-3,!0),1:new Ho(xl,-4,!1),0:new Ho(Vs,-4,!0)},to=d(z({},zu),{displaystyle:zu[Sc],textstyle:zu[R0],scriptstyle:zu[iu],scriptscriptstyle:zu[xl]});function uh(e,r){var n;if(!e)return 0;const a={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:Ua,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(n=e.unit)!=null?n:"pt"];if(Number.isFinite(r)){const c=Lo(10,r);return Math.round(e.dimension/Ua*a*c)/c}return e.dimension*a}function ch(e,r){if(e===null)return 0;const n=uh(e)/Ua;if(Number.isFinite(r)){const a=Lo(10,r);return Math.round(n*a)/a}return n}function Ec(e){var r;return`${e.dimension}${(r=e.unit)!=null?r:"pt"}`}function _d(e){let r=Ec(e.glue);return e.grow&&e.grow.dimension!==0&&(r+=` plus ${Ec(e.grow)}`),e.shrink&&e.shrink.dimension!==0&&(r+=` minus ${Ec(e.shrink)}`),r}function Is(e){var r,n;if(e==null)return null;let a="";if("dimension"in e&&(a=`${e.dimension}${(r=e.unit)!=null?r:"pt"}`),"glue"in e&&(a=_d(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 c=Math.round(e.number)>>>0;e.base==="hexadecimal"?(a=Number(c).toString(16).toUpperCase(),c<=255?a=a.padStart(2,"0"):c<=65535?a=a.padStart(4,"0"):c<=16777215?a=a.padStart(6,"0"):a=a.padStart(8,"0"),a=`"${a}`):e.base==="octal"&&(a=Number(c).toString(8),c<=63?a=a.padStart(2,"0"):c<=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 Oa(e,r){return e==null?null:"number"in e?d(z({},e),{number:e.number*r}):"register"in e?"factor"in e&&e.factor?d(z({},e),{factor:e.factor*r}):d(z({},e),{factor:r}):"dimension"in e?d(z({},e),{dimension:e.dimension*r}):"glue"in e?e.shrink&&e.grow?{glue:Oa(e.glue,r),shrink:Oa(e.shrink,r),grow:Oa(e.grow,r)}:e.shrink?{glue:Oa(e.glue,r),shrink:Oa(e.shrink,r)}:e.grow?{glue:Oa(e.glue,r),grow:Oa(e.grow,r)}:{glue:Oa(e.glue,r)}:null}var xd={"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 P0(){return z({},xd)}function Ku(){return{registers:P0(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:V.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Xe,backgroundColorMap:$t,getMacro:e=>Lr(e,gr())}}var ji=class Gp{constructor(r,n){var a,c,p,g,A,T,I,K,re,ve,Oe,Ke,vt,ur,mt;let zt;r!=null&&r.parent?(this.parent=r.parent,zt=r.parent,this.registers={}):(zt=z(z({},Ku()),(a=r==null?void 0:r.from)!=null?a:{}),this.registers=zt.registers),zt.atomIdsSettings&&(this.atomIdsSettings=z({},zt.atomIdsSettings)),this.renderPlaceholder=zt.renderPlaceholder,this.isPhantom=(g=(p=r==null?void 0:r.isPhantom)!=null?p:(c=this.parent)==null?void 0:c.isPhantom)!=null?g:!1,this.letterShapeStyle=zt.letterShapeStyle,this.minFontScale=zt.minFontScale,n!=null&&n.color&&n.color!=="none"?this.color=n.color:this.color=(T=(A=this.parent)==null?void 0:A.color)!=null?T:"",n!=null&&n.backgroundColor&&n.backgroundColor!=="none"?this.backgroundColor=n.backgroundColor:this.backgroundColor=(K=(I=this.parent)==null?void 0:I.backgroundColor)!=null?K:"",n!=null&&n.fontSize&&n.fontSize!=="auto"&&n.fontSize!==((re=this.parent)==null?void 0:re.size)?this.size=n.fontSize:this.size=(Oe=(ve=this.parent)==null?void 0:ve.size)!=null?Oe:wo;let pr=(vt=(Ke=this.parent)==null?void 0:Ke.mathstyle)!=null?vt:to.displaystyle;if(typeof(r==null?void 0:r.mathstyle)=="string"){if(zt instanceof Gp)switch(r.mathstyle){case"cramp":pr=pr.cramp;break;case"superscript":pr=pr.sup;break;case"subscript":pr=pr.sub;break;case"numerator":pr=pr.fracNum;break;case"denominator":pr=pr.fracDen;break}switch(r.mathstyle){case"textstyle":pr=to.textstyle;break;case"displaystyle":pr=to.displaystyle;break;case"scriptstyle":pr=to.scriptstyle;break;case"scriptscriptstyle":pr=to.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=pr,this.smartFence=zt.smartFence,this.placeholderSymbol=zt.placeholderSymbol,this.colorMap=(ur=zt.colorMap)!=null?ur:Zt=>Zt,this.backgroundColorMap=(mt=zt.backgroundColorMap)!=null?mt:Zt=>Zt,this.getMacro=zt.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 r=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,r}scale(r){return r*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===Sc||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(eu[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(r){var n;if((n=this.registers)!=null&&n[r])return this.registers[r];if(this.parent)return this.parent.getRegister(r)}getRegisterAsNumber(r){const n=this.getRegister(r);if(typeof n=="number")return n;if(typeof n=="string")return Number(n)}getRegisterAsGlue(r){var n;if((n=this.registers)!=null&&n[r]){const a=this.registers[r];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(r)}getRegisterAsEm(r,n){return ch(this.getRegisterAsDimension(r),n)}getRegisterAsDimension(r){var n;if((n=this.registers)!=null&&n[r]){const a=this.registers[r];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(r)}setRegister(r,n){if(n===void 0){delete this.registers[r];return}this.registers[r]=n}evaluate(r){if(!r||!("register"in r))return r;let n=this;if("global"in r&&r.global)for(;n.parent;)n=n.parent;let a=1;"factor"in r&&r.factor!==1&&r.factor!==void 0&&(a=r.factor);const c=n.getRegister(r.register);if(c===void 0)return;if(typeof c=="string")return{string:Number(c).toString()+c};if(typeof c=="number")return{number:a*c};const p=n.evaluate(c);if(p!==void 0)return"string"in p?{string:Number(c).toString()+p.string}:"number"in p?{number:a*p.number}:"dimension"in p?d(z({},p),{dimension:a*p.dimension}):"glue"in p?d(z({},p),{glue:d(z({},p.glue),{dimension:a*p.glue.dimension}),shrink:p.shrink?d(z({},p.shrink),{dimension:a*p.shrink.dimension}):void 0,grow:p.grow?d(z({},p.grow),{dimension:a*p.grow.dimension}):void 0}):r}toDimension(r){const n=this.evaluate(r);return n===void 0?null:"dimension"in n?n:"glue"in n?n.glue:"number"in n?{dimension:n.number}:null}toEm(r,n){if(r===null)return 0;const a=this.toDimension(r);return a===null?0:uh(a,n)/Ua}toNumber(r){if(r===null)return null;const n=this.evaluate(r);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(r){var n,a;if(r===null)return null;const c=this.evaluate(r);return c===void 0?null:"string"in c?(a=(n=this.colorMap)==null?void 0:n.call(this,c.string))!=null?a:c.string:null}toBackgroundColor(r){var n,a;if(r===null)return null;const c=this.evaluate(r);return c===void 0?null:"string"in c?(a=(n=this.backgroundColorMap)==null?void 0:n.call(this,c.string))!=null?a:c.string:null}},nu=["body","above","below","superscript","subscript"];function wl(e){return typeof e=="string"&&nu.includes(e)}function Uu(e){return e!==void 0&&Array.isArray(e)&&e.length===2}var Mt=class $l{constructor(r){var n,a,c,p,g,A;this.type=r.type,typeof r.value=="string"&&(this.value=r.value),this.command=(a=(n=r.command)!=null?n:this.value)!=null?a:"",this.mode=(c=r.mode)!=null?c:"math",r.isFunction&&(this.isFunction=!0),r.limits&&(this.subsupPlacement=r.limits),this.style=z({},r.style),this.displayContainsHighlight=(p=r.displayContainsHighlight)!=null?p:!1,this.captureSelection=(g=r.captureSelection)!=null?g:!1,this.skipBoundary=(A=r.skipBoundary)!=null?A:!1,r.verbatimLatex!==void 0&&r.verbatimLatex!==null&&(this.verbatimLatex=r.verbatimLatex),r.args&&(this.args=r.args),r.body&&(this.body=r.body),this._changeCounter=0}static createBox(r,n,a){var c;if(!n)return null;const p=gs(n),g=[];for(const T of p){const I=T[0].style,K=Sl(r,T,{style:{color:I.color,backgroundColor:I.backgroundColor,fontSize:I.fontSize}});K&&g.push(K)}if(g.length===0)return null;const A=((c=a==null?void 0:a.classes)!=null?c:"").trim();return g.length===1&&!A&&!(a!=null&&a.type)?g[0].wrap(r):new fr(g,{classes:A,type:a==null?void 0:a.type}).wrap(r)}static serialize(r,n){return Ea.serialize(r,n)}static commonAncestor(r,n){if(r===n||r.parent===n.parent)return r.parent;const a=new WeakSet;let{parent:c}=r;for(;c;)a.add(c),c=c.parent;for(c=n.parent;c;){if(a.has(c))return c;c=c.parent}console.assert(!!c)}static fromJson(r){return typeof r=="string"?new $l({type:"mord",value:r,mode:"math"}):new $l(r)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const r={};if(this.type&&(r.type=this.type),this.mode!=="math"&&(r.mode=this.mode),this.command&&this.command!==this.value&&(r.command=this.command),this.value!==void 0&&(r.value=this.value),this.style&&Object.keys(this.style).length>0&&(r.style=z({},this.style)),this.verbatimLatex!==void 0&&(r.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(r.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(r.explicitSubsupPlacement=!0),this.isFunction&&(r.isFunction=!0),this.displayContainsHighlight&&(r.displayContainsHighlight=!0),this.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),this.skipBoundary&&(r.skipBoundary=!0),this.captureSelection&&(r.captureSelection=!0),this.args&&(r.args=wd(this.args)),this._branches)for(const n of Object.keys(this._branches))this._branches[n]&&(r[n]=this._branches[n].filter(a=>a.type!=="first").map(a=>a.toJson()));return r.type==="mord"&&Object.keys(r).length===2&&"value"in r?r.value:r}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(r){if(r){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(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=Gt(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,r):this.body&&this.command?Yi([Gn(this.command,this.bodyToLatex(r)),this.supsubToLatex(r)]):this.body?Yi([this.bodyToLatex(r),this.supsubToLatex(r)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(r){var n;return Ea.serialize(this.body,d(z({},r),{defaultMode:(n=r.defaultMode)!=null?n:this.latexMode}))}aboveToLatex(r){return Ea.serialize(this.above,r)}belowToLatex(r){return Ea.serialize(this.below,r)}supsubToLatex(r){let n="";if(r=d(z({},r),{defaultMode:"math"}),this.branch("subscript")!==void 0){const a=Ea.serialize(this.subscript,r);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=Ea.serialize(this.superscript,r);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 r=1,n=this.parent;for(;n;)n=n.parent,r+=1;return r}get inCaptureSelection(){let r=this;for(;r;){if(r.captureSelection)return!0;r=r.parent}return!1}get parentPrompt(){let r=this.parent;for(;r;){if(r.type==="prompt"&&!r.captureSelection)return r;r=r.parent}return null}branch(r){if(wl(r)&&this._branches)return this._branches[r]}get branches(){if(!this._branches)return[];const r=[];for(const n of nu)this._branches[n]&&r.push(n);return r}createBranch(r){return console.assert(wl(r)),wl(r)?(this._branches?this._branches[r]||(this._branches[r]=[this.makeFirstAtom(r)]):this._branches={[r]:[this.makeFirstAtom(r)]},this.isDirty=!0,this._branches[r]):[]}get row(){return Uu(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Uu(this.parentBranch)?this.parentBranch[1]:-1}get body(){var r;return(r=this._branches)==null?void 0:r.body}set body(r){this.setChildren(r,"body")}get superscript(){var r;return(r=this._branches)==null?void 0:r.superscript}set superscript(r){this.setChildren(r,"superscript")}get subscript(){var r;return(r=this._branches)==null?void 0:r.subscript}set subscript(r){this.setChildren(r,"subscript")}get above(){var r;return(r=this._branches)==null?void 0:r.above}set above(r){this.setChildren(r,"above")}get below(){var r;return(r=this._branches)==null?void 0:r.below}set below(r){this.setChildren(r,"below")}get computedStyle(){var r,n;const a=typeof this.style.verbatimColor=="string",c=typeof this.style.verbatimBackgroundColor=="string",p=z(z({},(n=(r=this.parent)==null?void 0:r.computedStyle)!=null?n:{}),this.style);return delete p.variant,delete p.variantStyle,c||delete p.verbatimBackgroundColor,a||delete p.verbatimColor,p}applyStyle(r){this.isDirty=!0,this.style=z(z({},this.style),r),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(r)}getInitialBaseElement(){var r,n,a;return this.hasEmptyBranch("body")?this:(console.assert(((r=this.body)==null?void 0:r[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(r){const n=this.branch(r);return n?(console.assert(n.length>0),console.assert(n[0].type==="first"),n.length===1):!0}setChildren(r,n){var a;if(!r||(console.assert(wl(n)),!wl(n)))return;console.assert(((a=r[0])==null?void 0:a.type)!=="first");const c=[this.makeFirstAtom(n),...r];this._branches?this._branches[n]=c:this._branches={[n]:c};for(const p of r)p.parent=this,p.parentBranch=n;this.isDirty=!0}makeFirstAtom(r){const n=new $l({type:"first",mode:this.mode});return n.parent=this,n.parentBranch=r,n}addChild(r,n){console.assert(r.type!=="first"),this.createBranch(n).push(r),this.isDirty=!0,r.parent=this,r.parentBranch=n}addChildBefore(r,n){console.assert(n.parentBranch!==void 0);const a=this.createBranch(n.parentBranch);a.splice(a.indexOf(n),0,r),this.isDirty=!0,r.parent=this,r.parentBranch=n.parentBranch}addChildAfter(r,n){console.assert(n.parentBranch!==void 0);const a=this.createBranch(n.parentBranch);a.splice(a.indexOf(n)+1,0,r),this.isDirty=!0,r.parent=this,r.parentBranch=n.parentBranch}addChildren(r,n){const a=this.createBranch(n);for(const c of r)c.parent=this,c.parentBranch=n,a.push(c);this.isDirty=!0}addChildrenAfter(r,n){console.assert(r.length===0||r[0].type!=="first"),console.assert(n.parentBranch!==void 0);const a=this.createBranch(n.parentBranch);a.splice(a.indexOf(n)+1,0,...r),this.isDirty=!0;for(const c of r)c.parent=this,c.parentBranch=n.parentBranch;return r[r.length-1]}removeBranch(r){const n=this.branch(r);if(wl(r)&&(this._branches[r]=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(r){if(console.assert(r.parent===this),r.type==="first")return;const n=this.branch(r.parentBranch),a=n.indexOf(r);console.assert(a>=0),n.splice(a,1),this.isDirty=!0,r.parent=void 0,r.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:r}=this;return r[r.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 r=this.parent.branch(this.parentBranch);return r[r.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const r=this.parent.branch(this.parentBranch);return r[r.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:r}=this;return r[r.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const r=[];for(const n of nu)if(this._branches[n])for(const a of this._branches[n])r.push(...a.children),r.push(a);return this._children=r,r}render(r){if(this.type==="first"&&!r.atomIdsSettings)return null;const n=Gt(this.command,this.mode);if(n!=null&&n.render)return n.render(this,r);const a=new ji({parent:r},this.style);let c=this.createBox(a,{classes:this.parent?"":"ML__base"});return c?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(c=this.attachSupsub(a,{base:c})),c.wrap(a)):null}attachSupsub(r,n){var a;const c=n.base,p=this.superscript,g=this.subscript;if(!p&&!g)return c;let A=null,T=null;const I=(a=n.isCharacterBox)!=null?a:this.isCharacterBox();let K=0;if(p){const vt=new ji({parent:r,mathstyle:"superscript"});A=$l.createBox(vt,p),I||(K=c.height-r.metrics.supDrop*vt.scalingFactor)}let re=0;if(g){const vt=new ji({parent:r,mathstyle:"subscript"});T=$l.createBox(vt,g),I||(re=c.depth+r.metrics.subDrop*vt.scalingFactor)}let ve;r.isDisplayStyle?ve=r.metrics.sup1:r.isCramped?ve=r.metrics.sup3:ve=r.metrics.sup2;const Oe=.5/Ua/r.scalingFactor;let Ke=null;if(T&&A){K=Math.max(K,ve,A.depth+.25*r.metrics.xHeight),re=Math.max(re,r.metrics.sub2);const vt=r.metrics.defaultRuleThickness;if(K-A.depth-(T.height-re)<4*vt){re=4*vt-(K-A.depth)+T.height;const mt=.8*r.metrics.xHeight-(K-A.depth);mt>0&&(K+=mt,re-=mt)}const ur=this.isExtensibleSymbol&&c.italic?-c.italic:0;Ke=new ws({individualShift:[{box:T,shift:re,marginLeft:ur},{box:A,shift:-K}]}).wrap(r)}else T&&!A?(re=Math.max(re,r.metrics.sub1,T.height-.8*Sa),Ke=new ws({shift:re,children:[{box:T,marginRight:Oe,marginLeft:this.isCharacterBox()?-c.italic:0}]})):!T&&A&&(K=Math.max(K,ve,A.depth+.25*Sa),Ke=new ws({shift:-K,children:[{box:A,marginRight:Oe}]}));return new fr([c,new fr(Ke,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:n.type})}attachLimits(r,n){const a=this.superscript?$l.createBox(new ji({parent:r,mathstyle:"superscript"},this.style),this.superscript):null,c=this.subscript?$l.createBox(new ji({parent:r,mathstyle:"subscript"},this.style),this.subscript):null;return!a&&!c?n.base.wrap(r):bd(r,d(z({},n),{above:a,below:c}))}bind(r,n){if(!n||r.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=r.makeID()),n.atomID=this.id),n}createBox(r,n){var a,c,p,g;const A=(a=this.value)!=null?a:this.body,T=(c=n==null?void 0:n.boxType)!=null?c:ah(this.type);let I=(p=n==null?void 0:n.classes)!=null?p:"";this.mode==="text"&&(I+=" ML__text");const K=typeof A=="string"||A===void 0?new fr(A!=null?A:null,{type:T,isSelected:this.isSelected,mode:this.mode,maxFontSize:r.scalingFactor,style:d(z({variant:"normal"},this.style),{fontSize:Math.max(1,r.size+r.mathstyle.sizeDelta)}),letterShapeStyle:r.letterShapeStyle,classes:I}):(g=$l.createBox(r,A,{type:T,classes:I}))!=null?g:new fr(null);return r.isTight&&(K.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(K.italic=0),K.right=K.italic,this.bind(r,K),this.caret&&!this.superscript&&!this.subscript&&(K.caret=this.caret),K}isDigit(){var r;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((r=this.body)==null?void 0:r.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var r;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((r=this.body)==null?void 0:r.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function gs(e){let r;const n=[];let a=[];for(const c of e)if(!r&&!c.style)a.push(c);else{const p=c.computedStyle;r&&p.color===r.color&&p.backgroundColor===r.backgroundColor&&p.fontSize===r.fontSize?a.push(c):(a.length>0&&n.push(a),a=[c],r=p)}return a.length>0&&n.push(a),n}function Sl(e,r,n){var a,c,p,g,A;if(!r||r.length===0)return null;const T=new ji({parent:e},n.style),I=!((a=T.atomIdsSettings)!=null&&a.groupNumbers);let K=[];if(r.length===1){const ve=r[0],Oe=ve.render(T);Oe&&(I&&ve.isSelected&&Oe.selected(!0),K=[Oe])}else{let ve="",Oe=!0;for(const Ke of r){(c=T.atomIdsSettings)!=null&&c.groupNumbers&&ve&&(Oe&&Ke.isDigit()||!Oe&&ro(Ke))&&(T.atomIdsSettings.overrideID=ve);const vt=Ke.render(T);T.atomIdsSettings&&(T.atomIdsSettings.overrideID=void 0),vt&&((p=T.atomIdsSettings)!=null&&p.groupNumbers&&((Ke.isDigit()||ro(Ke))&&(!ve||Oe!==Ke.isDigit())&&(Oe=Ke.isDigit(),ve=(g=Ke.id)!=null?g:""),ve&&(!(Ke.isDigit()||ro(Ke))||!Ke.hasEmptyBranch("superscript")||!Ke.hasEmptyBranch("subscript"))&&(ve="")),I&&Ke.isSelected&&vt.selected(!0),K.push(vt))}}if(K.length===0)return null;const re=new fr(K,d(z({isTight:T.isTight},n),{type:(A=n.type)!=null?A:"lift"}));return re.isSelected=K.every(ve=>ve.isSelected),re.wrap(T)}function ro(e){return e.mode==="text"}function wd(e){return e.map(r=>r===null?"<null>":Array.isArray(r)&&r[0]instanceof Mt?{atoms:r.map(n=>n.toJson())}:typeof r=="object"&&"group"in r?{group:r.group.map(n=>n.toJson())}:r)}var Hu=class Vp extends Mt{constructor(r,n,a){super({type:"text",command:r,mode:"text",displayContainsHighlight:!0}),this.value=n,this.verbatimLatex=n,this.applyStyle(a)}static fromJson(r){return new Vp(r.command,r.value,r.style)}render(r){const n=this.createBox(r);return this.caret&&(n.caret=this.caret),n}_serialize(r){var n;return(n=this.verbatimLatex)!=null?n:wr("text",this.value.codePointAt(0))}};function Sd(e,r){if(e.direction===r.direction){const n=e.ranges.length;if(r.ranges.length===n){let a=0;for(;a<n&&Ed(e.ranges[a],r.ranges[a])==="equal";)a++;return a===n?"equal":"different"}}return"different"}function Ed(e,r){return e[0]===r[0]&&e[1]===r[1]?"equal":"different"}function Ws(e){let r=1/0,n=-1/0;for(const a of e.ranges)r=Math.min(r,a[0],a[1]),n=Math.max(n,a[0],a[1]);return[r,n]}function Go(e){return typeof e=="number"&&!Number.isNaN(e)}function Gu(e){return Array.isArray(e)&&e.length===2}function O0(e){return e!=null&&typeof e=="object"&&"ranges"in e&&Array.isArray(e.ranges)}function B0(e,r){const n=e.at(r);let a;if(n){a=n.mode;let c=n.parent;for(;!a&&c;)c&&(a=c.mode),c=c.parent}return a}function Ac(e,r){if(!r)return"";if(typeof r=="string")return r;if(!e||r.after===void 0)return r.value;let n=!1,a=!1,c=!1,p=!1,g=!1,A=!1,T=!1,I=!1,K=!1,re=!1,ve=!1,Oe=!1,Ke=!1,vt=!1,ur=!1,mt=e[0],zt=0;for(;mt!=null&&mt.type&&/^(subsup|placeholder)$/.test(mt.type);)zt+=1,mt=e[zt];return n=!mt||mt.type==="first",mt&&(vt=mt.mode==="text",a=!vt&&mt.type==="mord"&&Ue.test(mt.value),c=!vt&&mt.type==="mord"&&/\d+$/.test(mt.value),p=!vt&&mt.isFunction,g=mt.type==="genfrac",A=mt.type==="surd",T=mt.type==="mbin",I=mt.type==="mrel",K=mt.type==="mop"||mt.type==="operator"||mt.type==="extensible-symbol",re=mt.type==="mpunct"||mt.type==="minner",ve=mt.type==="array",Oe=mt.type==="mopen",Ke=mt.type==="mclose"||mt.type==="leftright",ur=mt.type==="space"),r.after.includes("nothing")&&n||r.after.includes("letter")&&a||r.after.includes("digit")&&c||r.after.includes("function")&&p||r.after.includes("frac")&&g||r.after.includes("surd")&&A||r.after.includes("binop")&&T||r.after.includes("relop")&&I||r.after.includes("operator")&&K||r.after.includes("punct")&&re||r.after.includes("array")&&ve||r.after.includes("openfence")&&Oe||r.after.includes("closefence")&&Ke||r.after.includes("text")&&vt||r.after.includes("space")&&ur?r.value:""}function su(e,r,n){return n?Ac(e,n[r]):""}var Ad={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\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 F0(e,r){var n;let a=(n=r==null?void 0:r.format)!=null?n:"auto";return a==="auto"&&([a,e]=$0(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",ea(e,{inlineShortcuts:r==null?void 0:r.inlineShortcuts})]):["latex",e]}function ea(e,r){var n,a,c;if(!e)return"";let p=!1,g;const A=(n=r.inlineShortcuts)!=null?n:Ad;if(!p&&(e.startsWith("^")||e.startsWith("_"))&&(g=Vo(e.slice(1),{inlineShortcuts:A,noWrap:!0}),e=e[0]+"{"+g.match+"}",e+=ea(g.rest,r),p=!0),p||(g=e.match(/^(sqrt|\u221A)(.*)/),g&&(g=Vo(g[2],{inlineShortcuts:A,noWrap:!0}),e="\\sqrt{"+((a=g.match)!=null?a:"\\placeholder{}")+"}",e+=ea(g.rest,r),p=!0)),p||(g=e.match(/^(\\cbrt|\u221B)(.*)/),g&&(g=Vo(g[2],{inlineShortcuts:A,noWrap:!0}),e="\\sqrt[3]{"+((c=g.match)!=null?c:"\\placeholder{}")+"}",e+=ea(g.rest,r),p=!0)),p||(g=e.match(/^abs(.*)/),g&&(g=Vo(g[1],{inlineShortcuts:A,noWrap:!0}),e="\\left|"+g.match+"\\right|",e+=ea(g.rest,r),p=!0)),p||(g=e.match(/^["”“](.*?)["”“](.*)/),g&&(e="\\text{"+g[1]+"}",e+=ea(g[2],r),p=!0)),p||(g=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),g&&(e=N0(g[1],A),e+=ea(g[2],r),p=!0)),!p&&/^([fgh])[^a-zA-Z]/.test(e)&&(g=Vo(e.slice(1),{inlineShortcuts:A,noWrap:!0}),e=e[1]==="("?e[0]+"\\left("+g.match+"\\right)":e[0]+g.match,e+=ea(g.rest,r),p=!0),p||(g=e.match(/^([a-zA-Z]+)(.*)/),g&&(e=N0(g[1],A),e+=ea(g[2],r),p=!0)),!p)if(g=Vo(e,{inlineShortcuts:A,noWrap:!0}),g.match&&g.rest[0]==="/"){const T=Vo(g.rest.slice(1),{inlineShortcuts:A,noWrap:!0});T.match&&(e="\\frac{"+g.match+"}{"+T.match+"}"+ea(T.rest,r)),p=!0}else g.match&&(e=e.startsWith("(")?"\\left("+g.match+"\\right)"+ea(g.rest,r):g.match+ea(g.rest,r),p=!0);return p||(g=e.match(/^(\s+)(.*)$/),g&&(e=" "+ea(g[2],r),p=!0)),e}function Vo(e,r){let n="";e=e.trim();let a=e,c=e.charAt(0),p={"(":")","{":"}","[":"]"}[c];if(p){let g=1,A=1;for(;A<e.length&&g>0;)e[A]===c&&g++,e[A]===p&&g--,A++;g===0?(r.noWrap&&c==="("?n=ea(e.substring(1,A-1),r):(c==="{"&&p==="}"&&(c="\\{",p="\\}"),n="\\left"+c+ea(e.substring(1,A-1),r)+"\\right"+p),a=e.slice(Math.max(0,A))):(n=e.substring(1,A),a="")}else{let g=e.match(/^([a-zA-Z]+)/);if(g){let A=su(null,e,r.inlineShortcuts);if(A)return A=A.replace("_{#?}",""),A=A.replace("^{#?}",""),{match:A,rest:e.slice(A.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 N0(e,r){let n=su(null,e,r);return n?(n=n.replace("_{#?}",""),n=n.replace("^{#?}",""),n+=" "):n=e,n}var hh=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function kc(e){const r=e.trim();for(const n of hh)if(r.startsWith(n[0])&&r.endsWith(n[1]))return[!0,r.substring(n[0].length,r.length-n[1].length)];return[!1,e]}function $0(e){if(e=e.trim(),e.length<=1)return["latex",e];let r;return[r,e]=kc(e),r?["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 kd="$$",dh="$$",Td=(e,r,n)=>(hh.some(a=>r.startsWith(a[0])&&r.endsWith(a[1]))||(r=`${kd} ${r} ${dh}`),r),fh=class md{constructor(r){md._modes[r]=this}static onPaste(r,n,a){var c;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 p=new ClipboardEvent("paste",{clipboardData:a,cancelable:!0});return(c=n.host)!=null&&c.dispatchEvent(p)?md._modes[r].onPaste(n,a):!1}static copyToClipboard(r,n){if(!r.contentEditable&&r.userSelect==="none"){r.model.announce("plonk");return}const a=r.model,c=a.selectionIsCollapsed?[0,a.lastOffset]:Ws(a.selection),p=a.getValue(c,n);navigator.clipboard.writeText(p).then(()=>{},()=>r.model.announce("plonk"))}static onCopy(r,n){var a;if(!n.clipboardData)return;if(!r.contentEditable&&r.userSelect==="none"){r.model.announce("plonk");return}const c=r.model,p=c.selectionIsCollapsed?[0,c.lastOffset]:Ws(c.selection);let g=c.getAtoms(p);if(g.every(A=>A.mode==="text"||!A.mode))n.clipboardData.setData("text/plain",g.filter(A=>A instanceof Hu).map(A=>A.value).join(""));else if(g.every(A=>A.mode==="latex"))n.clipboardData.setData("text/plain",c.getAtoms(p,{includeChildren:!0}).map(A=>{var T;return(T=A.value)!=null?T:""}).join(""));else{let A;g.length===1&&g[0].verbatimLatex!==void 0?A=g[0].verbatimLatex:A=c.getValue(p,"latex-expanded"),n.clipboardData.setData("application/x-latex",A);try{n.clipboardData.setData("text/plain",r.options.onExport(r,A,p))}catch(T){}if(g.length===1){const T=g[0];(T.type==="root"||T.type==="group")&&(g=T.body.filter(I=>I.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 I=T.jsonSerializationOptions;T.jsonSerializationOptions={metadata:["latex"]};const K=T.parse(c.getValue(p,"latex-unstyled"));T.jsonSerializationOptions=I;const re=JSON.stringify(K.json);re&&n.clipboardData.setData("application/json",re)}catch(I){}}}n.preventDefault()}static insert(r,n,a={}){var c;const p=a.mode==="auto"?r.mode:(c=a.mode)!=null?c:r.mode;return md._modes[p].insert(r,n,a)}onPaste(r,n){return!1}insert(r,n,a){return!1}};fh._modes={};var Un=fh,Cd=[{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","^"]}],Dd={"\\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 El(e){var r;return((r=e.element)==null?void 0:r.mathfield)===e}function ph(e){var r,n;return(n=(r=e.querySelector(".ML__caret"))!=null?r:e.querySelector(".ML__text-caret"))!=null?n:e.querySelector(".ML__latex-caret")}function Vu(e){const r=ph(e);if(!r)return null;const n=r.getBoundingClientRect();return{x:n.right,y:n.bottom,height:n.height}}function Md(e){var r;if(!e.parent)return"root";let n=(r=e.parent.id)!=null?r:"";return n+=typeof e.parentBranch=="string"?"-"+e.parentBranch:`-${e.parentBranch[0]}/${e.parentBranch[0]}`,n}function mh(e,r,n){if(!r)return null;const a=e.field.getBoundingClientRect(),c=r.right-r.left,p=r.bottom-r.top,g=Math.ceil(r.left-a.left+e.field.scrollLeft*n),A=Math.ceil(r.top-a.top);return{left:g,right:g+c,top:A,bottom:A+p}}function gh(e){const r=e.getBoundingClientRect(),n=parseInt(getComputedStyle(e).marginRight),a={top:r.top-1,bottom:r.bottom,left:r.left,right:r.right-1+n};if(e.children.length===0||e.tagName.toUpperCase()==="SVG")return a;for(const c of e.children)if(c.nodeType===1&&"atomId"in c.dataset&&!c.classList.contains("pstrut")){const p=gh(c);a.left=Math.min(a.left,p.left),a.right=Math.max(a.right,p.right),a.top=Math.min(a.top,p.top),a.bottom=Math.max(a.bottom,p.bottom)}return a}function Wu(e,r){var n,a;if(!r.id)return null;let c=(a=(n=e.atomBoundsCache)==null?void 0:n.get(r.id))!=null?a:null;if(c!==null)return c;const p=e.field.querySelector(`[data-atom-id="${r.id}"]`);return c=p?gh(p):null,e.atomBoundsCache&&(c?e.atomBoundsCache.set(r.id,c):e.atomBoundsCache.delete(r.id)),c!=null?c:null}function Ld(e,r,n){const a=new Map;for(const c of e.model.getAtoms(r,{includeChildren:!0})){if(n!=null&&n.excludeAtomsWithBackground&&c.style.backgroundColor)continue;const p=e.field,g=p.offsetWidth;let T=Math.floor(p.getBoundingClientRect().width)/g;T=isNaN(T)?1:T;const I=mh(e,Wu(e,c),T);if(I){const K=Md(c);if(a.has(K)){const re=a.get(K);a.set(K,{left:Math.min(re.left,I.left),right:Math.max(re.right,I.right),top:Math.min(re.top,I.top),bottom:Math.max(re.bottom,I.bottom)})}else a.set(K,I)}}return[...a.values()]}function Tc(e,r){return e.model.selection.ranges.reduce((n,a)=>n.concat(...Ld(e,a,r)),[])}function Cc(e,r){return e==="*"||r==="none"?!0:r==="same-origin"?!window.origin||e===window.origin:typeof r=="function"?r(e):!1}function vh(e){let r=0,n=0;const a=e.offsetWidth,c=e.offsetHeight;for(;e instanceof HTMLElement;)r+=e.offsetTop,n+=e.offsetLeft,e=e.offsetParent;return new DOMRect(n,r,a,c)}var Id=`@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;
}
`,Rd=`.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);
}
`,yh=`#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);
}
`,bh=`/* 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;
}
`,au=`/* 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);*/
}
`,z0=`.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));
}
`,Pd=`: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;
}
`,Aa=`.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;
}
`,Eo;function Al(e){let r="";switch(e){case"mathfield-element":r=`
: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":r=Rd;break;case"mathfield":r=Id;break;case"environment-popover":r=yh;break;case"suggestion-popover":r=bh;break;case"keystroke-caption":r=au;break;case"virtual-keyboard":r=z0;break;case"ui":r=Pd;break;case"menu":r=Aa;break;default:debugger}return r}function kl(e){return Eo||(Eo={}),Eo[e]||(Eo[e]=new CSSStyleSheet,Eo[e].replaceSync(Al(e))),Eo[e]}var io;function va(e){var r;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(Al(e))),window.document.head.appendChild(n);return}if(io||(io={}),((r=io[e])!=null?r:0)!==0)io[e]+=1;else{const n=kl(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,n],io[e]=1}}function no(e){if("adoptedStyleSheets"in document&&io!=null&&io[e]&&(io[e]-=1,io[e]<=0)){const r=Eo[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>n!==r)}}var K0=class Wp extends Mt{constructor(r){var n;super(d(z({},r),{type:"accent",body:(n=r.body)!=null?n:void 0})),r.accentChar?this.accent=r.accentChar:this.svgAccent=r==null?void 0:r.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(r){return new Wp(r)}toJson(){return d(z({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(r){var n;const a=new ji({parent:r,mathstyle:"cramp"},this.style),c=(n=Mt.createBox(a,this.body))!=null?n:new fr("\u25A2",{style:this.style});let p=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(p=c.skew);let g=Math.min(c.height,Sa),A;if(this.svgAccent)A=L0(this.svgAccent),g=a.metrics.bigOpSpacing1-g;else if(this.accent){const I=new fr(this.accent,{fontFamily:"Main-Regular"});I.italic=0;const K=this.accent===8407?" ML__accent-vec":"";A=new fr(new fr(I),{classes:"ML__accent-body"+K})}A=new ws({shift:0,children:[{box:new fr(c)},-g,{box:A,marginLeft:c.left+2*p,classes:["ML__center"]}]});const T=new fr(A,{type:"lift"});return this.caret&&(T.caret=this.caret),this.bind(a,T.wrap(a)),this.attachSupsub(a,{base:T})}},U0={"(":")","{":"}","[":"]","|":"|","\\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"},Tl=Object.fromEntries(Object.entries(U0).map(([e,r])=>[r,e]));function H0(e){var r;return(r={"[":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?r:e.codePointAt(0)}function Od(e,r,n,a){var c;const g=new fr(H0(e),{fontFamily:"Main-Regular",isSelected:a.isSelected,classes:"ML__small-delim "+((c=a.classes)!=null?c:"")}).wrap(r);return n&&g.setTop((1-r.scalingFactor)*Jn),g}function ou(e,r,n,a,c){var p,g;const A=new ji({parent:a,mathstyle:"textstyle"},c==null?void 0:c.style),T=new fr(H0(e),{fontFamily:`Size${r}-Regular`,isSelected:c.isSelected,classes:((p=c.classes)!=null?p:"")+` ML__delim-size${r}`,type:(g=c.type)!=null?g:"ignore"}).wrap(A);return n&&T.setTop((1-A.scalingFactor)*Jn),T}function Cl(e,r,n,a,c){var p;let g,A,T,I;g=T=I=H0(e),A=null;let K="Size1-Regular";e==="\\vert"||e==="\\lvert"||e==="\\rvert"||e==="\\mvert"||e==="\\mid"?T=g=I=8739:e==="\\Vert"||e==="\\lVert"||e==="\\rVert"||e==="\\mVert"||e==="\\|"?T=g=I=8741:e==="\\uparrow"?T=I=9168:e==="\\Uparrow"?T=I=8214:e==="\\downarrow"?g=T=9168:e==="\\Downarrow"?g=T=8214:e==="\\updownarrow"?(g=8593,T=9168,I=8595):e==="\\Updownarrow"?(g=8657,T=8214,I=8659):e==="["||e==="\\lbrack"?(g=9121,T=9122,I=9123,K="Size4-Regular"):e==="]"||e==="\\rbrack"?(g=9124,T=9125,I=9126,K="Size4-Regular"):e==="\\lfloor"||e==="\u230A"?(T=g=9122,I=9123,K="Size4-Regular"):e==="\\lceil"||e==="\u2308"?(g=9121,T=I=9122,K="Size4-Regular"):e==="\\rfloor"||e==="\u230B"?(T=g=9125,I=9126,K="Size4-Regular"):e==="\\rceil"||e==="\u2309"?(g=9124,T=I=9125,K="Size4-Regular"):e==="("||e==="\\lparen"?(g=9115,T=9116,I=9117,K="Size4-Regular"):e===")"||e==="\\rparen"?(g=9118,T=9119,I=9120,K="Size4-Regular"):e==="\\{"||e==="\\lbrace"?(g=9127,A=9128,I=9129,T=9130,K="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(g=9131,A=9132,I=9133,T=9130,K="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(g=9127,I=9129,T=9130,K="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(g=9131,I=9133,T=9130,K="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(g=9127,I=9133,T=9130,K="Size4-Regular"):e==="\\rmoustache"||e==="\u23B1"?(g=9131,I=9129,T=9130,K="Size4-Regular"):e==="\\surd"?(g=57345,I=9143,T=57344,K="Size4-Regular"):e==="\\ulcorner"?(g=9484,T=I=32):e==="\\urcorner"?(g=9488,T=I=32):e==="\\llcorner"?(I=9492,T=g=32):e==="\\lrcorner"&&(g=9496,T=g=32);const re=bl(g,K),ve=re.height+re.depth,Oe=bl(T,K),Ke=Oe.height+Oe.depth,vt=bl(I,K),ur=vt.height+vt.depth;let mt=0,zt=1;if(A!==null){const Us=bl(A,K);mt=Us.height+Us.depth,zt=2}const pr=ve+ur+mt,Zt=Math.max(0,Math.ceil((r-pr)/(zt*Ke))),Hr=pr+Zt*zt*Ke;let ni=Jn;n&&(ni=ni*a.scalingFactor);const Yr=Hr/2-ni,Xi=.008,Pn=[];Pn.push({box:new fr(I,{fontFamily:K})}),Pn.push(-Xi);const yr=new fr(T,{fontFamily:K});if(A===null)for(let Us=0;Us<Zt;Us++)Pn.push({box:yr});else{for(let Us=0;Us<Zt;Us++)Pn.push({box:yr});Pn.push(-Xi),Pn.push({box:new fr(A,{fontFamily:K})}),Pn.push(-Xi);for(let Us=0;Us<Zt;Us++)Pn.push({box:yr})}Pn.push(-Xi),Pn.push({box:new fr(g,{fontFamily:K})});let Va="";K==="Size1-Regular"?Va=" delim-size1":K==="Size4-Regular"&&(Va=" delim-size4");const tl=new ws({bottom:Yr,children:Pn},{classes:Va});return new fr(tl,d(z({},c!=null?c:{}),{classes:((p=c==null?void 0:c.classes)!=null?p:"")+" ML__delim-mult"}))}var ju=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),Bd=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),_h=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Dc=[0,1.2,1.8,2.4,3];function xh(e,r,n,a){return e===void 0||e==="."?Dl(n,a.classes):(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),ju.has(e)||_h.has(e)?ou(e,r,!1,n,a):Bd.has(e)?Cl(e,Dc[r],!1,n,a):(console.assert(!1,"Unknown delimiter '"+e+"'"),null))}var Mc=[{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}],Fd=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],lu=[{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 Nd(e){return e.type==="small"?"Main-Regular":e.type==="large"?"Size"+e.size+"-Regular":(console.assert(e.type==="stack"),"Size4-Regular")}function wh(e,r,n,a){const c={"-4":0,"-3":1,0:2}[a.mathstyle.sizeDelta];for(let p=c;p<n.length&&n[p].type!=="stack";p++){const g=bl(e,Nd(n[p]));if(g.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let A=g.height+g.depth;if(n[p].type==="small"&&(n[p].mathstyle==="scriptscriptstyle"?A*=Math.max(eu[Math.max(1,a.size-2)],a.minFontScale):n[p].mathstyle==="scriptstyle"&&(A*=Math.max(eu[Math.max(1,a.size-1)],a.minFontScale))),A>r)return n[p]}return n[n.length-1]}function G0(e,r,n,a,c,p){if(!r||r.length===0||r===".")return Dl(c);r==="<"||r==="\\lt"?r="\\langle":(r===">"||r==="\\gt")&&(r="\\rangle");let g;_h.has(r)?g=Mc:ju.has(r)?g=lu:g=Fd;const A=wh(H0(r),n,g,c),T=new ji({parent:c,mathstyle:A.mathstyle},p==null?void 0:p.style);return A.type==="small"?Od(r,T,a,d(z({},p),{type:e})):A.type==="large"?ou(r,A.size,a,T,d(z({},p),{type:e})):(console.assert(A.type==="stack"),Cl(r,n,a,T,d(z({},p),{type:e})))}function la(e,r,n,a,c,p){if(r===".")return Dl(c,p==null?void 0:p.classes);const g=Jn*c.scalingFactor,A=901,T=5/Ua,I=Math.max(n-g,a+g),K=Math.max(I/500*A,2*I-T);return G0(e,r,K,!0,c,p)}function Dl(e,r){const n=new fr(null,{classes:" nulldelimiter "+(r!=null?r:""),type:"ignore"});return n.width=e.getRegisterAsEm("nulldelimiterspace"),n.wrap(new ji({parent:e,mathstyle:"textstyle"}))}var so=class jp extends Mt{constructor(r){var n;super({type:"placeholder",command:"\\placeholder",mode:(n=r==null?void 0:r.mode)!=null?n:"math",style:r==null?void 0:r.style}),this.captureSelection=!0}static fromJson(r){return new jp(r)}toJson(){return super.toJson()}render(r){let n;return this.value=r.placeholderSymbol,typeof r.renderPlaceholder=="function"?n=r.renderPlaceholder(r):n=this.createBox(r),this.caret&&(n.classes+=" ML__placeholder-selected"),n}_serialize(r){return r.skipPlaceholders?"":"\\placeholder{}"}},qu=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],Sh=["cases","dcases","rcases"],Lc=["align","align*","aligned","gather","gathered","split"],$d=["array","subequations","eqnarray"];function zd(e){return $d.concat(Lc).concat(Sh).concat(qu).includes(e)}function Eh(e){return qu.includes(e)}function Ah(e){return Sh.includes(e)}function Ga(e){return Lc.includes(e)}function Ao(e,r,n){let a=0;for(const I of n)"align"in I&&(a+=1);let c=0;const p=[];for(const I of r){let K=0;for(c=Math.max(c,Math.min(I.length,a));K<I.length;){const re=[],ve=Math.min(I.length,K+a);for(;K<ve;){const Oe=I[K];Oe.length===0?re.push([new Mt({type:"first",mode:e.mode})]):Oe[0].type!=="first"?re.push([new Mt({type:"first",mode:e.mode}),...Oe]):(console.assert(!Oe.slice(1).some(Ke=>Ke.type==="first")),re.push(Oe)),K+=1}p.push(re)}}p.length>0&&p[p.length-1].length===1&&p[p.length-1][0].length===1&&p[p.length-1][0][0].type==="first"&&p.pop();const g=[];for(const I of p){if(I.length!==c)for(let K=I.length;K<c;K++)I.push([new Mt({type:"first",mode:e.mode}),new so]);g.push(I)}let A=0,T=0;for(const I of g){T=0;for(const K of I){for(const re of K)re.parent=e,re.parentBranch=[A,T];T+=1}A+=1}return e.isDirty=!0,g}var gn=class qp extends Mt{constructor(r,n,a,c={}){var p;super({type:"array"}),this.environmentName=r,this.rowGaps=a,c.mathstyleName&&(this.mathstyleName=c.mathstyleName),c.columns&&(c.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=c.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=Ao(this,n,this.colFormat),c.leftDelim&&(this.leftDelim=c.leftDelim),c.rightDelim&&(this.rightDelim=c.rightDelim),c.arraycolsep!==void 0&&(this.arraycolsep=c.arraycolsep),this.colSeparationType=c.colSeparationType,c.arraystretch!==void 0&&(this.arraystretch=c.arraystretch),this.minColumns=(p=c.minColumns)!=null?p:1}static fromJson(r){return new qp(r.environmentName,r.array,r.rowGaps,r)}toJson(){const r=d(z({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(n=>n.map(a=>a.map(c=>c.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(r.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(r.arraycolsep=this.arraycolsep),this.leftDelim&&(r.leftDelim=this.leftDelim),this.rightDelim&&(r.rightDelim=this.rightDelim),r}branch(r){var n;if(Uu(r))return(n=this.array[r[0]][r[1]])!=null?n:void 0}createBranch(r){var n;return Uu(r)?(this.isDirty=!0,(n=this.branch(r))!=null?n:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(r=>!!r.align).length}removeBranch(r){if(wl(r))return super.removeBranch(r);const n=this.branch(r);return this.array[r[0]][r[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 r=[];for(const n of this.array)for(const a of n)if(a)for(const c of a)r.push(...c.children),r.push(c);return[...r,...super.children]}render(r){var n,a,c,p,g,A;const T=new ji({parent:r,mathstyle:this.mathstyleName},this.style),I=T.getRegisterAsEm("arrayrulewidth"),K=T.getRegisterAsEm("arraycolsep"),re=T.getRegisterAsEm("doublerulesep"),ve=(a=(n=this.arraystretch)!=null?n:T.getRegisterAsNumber("arraystretch"))!=null?a:1;let Oe=typeof this.arraycolsep=="number"?this.arraycolsep:K;this.colSeparationType==="small"&&(Oe=.2778*(new ji({parent:r,mathstyle:"scriptstyle"}).scalingFactor/r.scalingFactor));const Ke=ve*mc,vt=.7*Ke,ur=.3*Ke;let mt=0;const zt=[];let pr=0;const Zt=this.array.length;for(let $n=0;$n<Zt;++$n){const ys=this.array[$n];pr=Math.max(pr,ys.length);const Hs=new ji({parent:T,mathstyle:this.mathstyleName},this.style);let rl=vt/Hs.scalingFactor,il=ur/Hs.scalingFactor;const nl={cells:[],height:0,depth:0,pos:0};for(const Mo of ys){const Hf=(c=Mt.createBox(Hs,Mo,{type:"ignore"}))!=null?c:new fr(null,{type:"ignore"});il=Math.max(il,Hf.depth),rl=Math.max(rl,Hf.height),nl.cells.push(Hf)}let sl=(p=ch(this.rowGaps[$n]))!=null?p:0;sl>0&&(sl+=ur,il=Math.max(il,sl),sl=0),$n<Zt-1&&!Eh(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(il+=T.getRegisterAsEm("jot")),nl.height=rl,nl.depth=il,mt+=rl,nl.pos=mt,mt+=il+sl,zt.push(nl)}const Hr=mt/2+Jn,ni=[];for(let $n=0;$n<pr;$n++){const ys=[];for(const Hs of zt){const rl=Hs.cells[$n];rl.depth=Hs.depth,rl.height=Hs.height,ys.push({box:rl,shift:Hs.pos-Hr})}ys.length>0&&ni.push(new ws({individualShift:ys}))}const Yr=[];let Xi=!1,Pn=!1,yr=0,Va=!this.leftDelim;const{colFormat:tl}=this;for(const $n of tl){if("align"in $n&&yr>=ni.length)break;if("align"in $n)Xi?Yr.push(W0(2*Oe)):(Pn||Va)&&Yr.push(W0(Oe)),Yr.push(new fr(ni[yr],{classes:"col-align-"+$n.align})),yr++,Xi=!0,Pn=!1,Va=!1;else if("gap"in $n){if(typeof $n.gap=="number")Yr.push(W0($n.gap));else{const ys=Kd(r,zt,Hr,$n.gap);ys&&Yr.push(ys)}Xi=!1,Pn=!1,Va=!1}else if("separator"in $n){const ys=new fr(null,{classes:"vertical-separator"});ys.height=mt,ys.setStyle("height",mt,"em"),ys.setStyle("border-right",`${I}em ${$n.separator} currentColor`),ys.setStyle("vertical-align",-(mt-Hr),"em");let Hs=0;Pn?Hs=re-I:Xi&&(Hs=Oe-I),ys.left=Hs,Yr.push(ys),Xi=!1,Pn=!0,Va=!1}}Xi&&!this.rightDelim&&Yr.push(W0(Oe));const uo=new fr(Yr,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(uo.caret=this.caret),this.bind(r,uo);const Us=uo.height,Wa=uo.depth,Ca=this.bind(r,new fr([this.bind(r,la("open",(g=this.leftDelim)!=null?g:".",Us,Wa,T,{isSelected:this.isSelected})),uo,this.bind(r,la("close",(A=this.rightDelim)!=null?A:".",Us,Wa,T,{isSelected:this.isSelected}))],{type:"ord"}));return Ca?(Ca.setStyle("display","inline-block"),this.caret&&(Ca.caret=this.caret),this.bind(r,this.attachSupsub(r,{base:Ca}))):null}_serialize(r){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 c of this.colFormat)"align"in c&&typeof c.align=="string"?a.push(c.align):"separator"in c&&c.separator==="solid"?a.push("|"):"separator"in c&&c.separator==="dashed"&&a.push(":");a.push("}")}for(let c=0;c<this.array.length;c++){for(let p=0;p<this.array[c].length;p++)p>0&&a.push(" & "),a.push(Mt.serialize(this.array[c][p],r));if(c<this.array.length-1){const p=this.rowGaps[c];p!=null&&p.dimension?a.push(`\\\\[${p.dimension} ${(n=p.unit)!=null?n:"pt"}] `):a.push("\\\\ ")}}return this.environmentName==="lines"?a.push("}"):a.push(`\\end{${this.environmentName}}`),Yi(a)}getCell(r,n){return this.array[r][n]}setCell(r,n,a){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[r][n]!==void 0);for(const p of this.array[r][n])p.parent=void 0,p.parentBranch=void 0;let c=a;(a.length===0||a[0].type!=="first")&&(c=[new Mt({type:"first",mode:this.mode}),...a]),this.array[r][n]=c;for(const p of c)p.parent=this,p.parentBranch=[r,n];this.isDirty=!0}addRowBefore(r){console.assert(this.type==="array"&&Array.isArray(this.array));const n=[];for(let a=0;a<this.colCount;a++)n.push(V0(this));this.array.splice(r,0,n);for(let a=r;a<this.rowCount;a++)for(let c=0;c<this.colCount;c++){const p=this.array[a][c];if(p)for(const g of p)g.parentBranch=[a,c]}this.isDirty=!0}addRowAfter(r){console.assert(this.type==="array"&&Array.isArray(this.array));const n=[];for(let a=0;a<this.colCount;a++)n.push(V0(this));this.array.splice(r+1,0,n);for(let a=r+1;a<this.rowCount;a++)for(let c=0;c<this.colCount;c++){const p=this.array[a][c];if(p)for(const g of p)g.parentBranch=[a,c]}this.isDirty=!0}removeRow(r){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>r);const n=this.array.splice(r,1);for(const a of n)for(const c of a)if(c)for(const p of c)p.parent=void 0,p.parentBranch=void 0;for(let a=r;a<this.rowCount;a++)for(let c=0;c<this.colCount;c++){const p=this.array[a][c];if(p)for(const g of p)g.parentBranch=[a,c]}this.isDirty=!0}addColumnBefore(r){console.assert(this.type==="array"&&Array.isArray(this.array));for(const n of this.array)n.splice(r,0,V0(this));for(let n=0;n<this.rowCount;n++)for(let a=r;a<this.colCount;a++){const c=this.array[n][a];if(c)for(const p of c)p.parentBranch=[n,a]}this.isDirty=!0}addColumnAfter(r){console.assert(this.type==="array"&&Array.isArray(this.array));for(const n of this.array)n.splice(r+1,0,V0(this));for(let n=0;n<this.rowCount;n++)for(let a=r+1;a<this.colCount;a++){const c=this.array[n][a];if(c)for(const p of c)p.parentBranch=[n,a]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(r){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>r);for(const n of this.array){const a=n.splice(r,1);for(const c of a)if(c)for(const p of c)p.parent=void 0,p.parentBranch=void 0}for(let n=0;n<this.rowCount;n++)for(let a=r;a<this.colCount;a++){const c=this.array[n][a];if(c)for(const p of c)p.parentBranch=[n,a]}this.isDirty=!0}get cells(){const r=[];for(const n of this.array)for(const a of n)a&&r.push(a.filter(c=>c.type!=="first"));return r}};function V0(e){const r=new Mt({type:"first",mode:e.mode});r.parent=e;const n=new so;return n.parent=e,[r,n]}function W0(e){const r=new fr(null,{classes:"arraycolsep"});return r.width=e,r}function Kd(e,r,n,a){if(!a)return null;const c=[];for(const p of r){const g=Mt.createBox(e,a,{type:"ignore"});g&&(g.depth=p.depth,g.height=p.height,c.push({box:g,shift:p.pos-n}))}return new ws({individualShift:c}).wrap(e)}var Wo=class Zp extends Mt{constructor(r){super({mode:r.mode,command:r.command,style:r.style,body:r.body,type:"box"}),this.framecolor=r.framecolor,this.backgroundcolor=r.backgroundcolor,this.padding=r.padding,this.offset=r.offset,this.border=r.border}static fromJson(r){return new Zp(r)}toJson(){return d(z({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(r){var n,a,c,p;const g=Mt.createBox(r,this.body,{type:"lift"});if(!g)return null;const A=r.toEm((n=this.offset)!=null?n:{dimension:0});g.depth+=A,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 ji({parent:r},this.style),I=T.toEm((a=this.padding)!=null?a:{register:"fboxsep"}),K=new fr(null,{classes:"ML__box"});K.height=g.height+I,K.depth=g.depth+I,K.setStyle("box-sizing","border-box"),K.setStyle("position","absolute"),K.setStyle("top",-I+.3,"em"),K.setStyle("left",0),K.setStyle("height",K.height+K.depth,"em"),K.setStyle("width","100%"),this.backgroundcolor&&K.setStyle("background-color",(c=T.toColor(this.backgroundcolor))!=null?c:"transparent"),this.framecolor&&K.setStyle("border",`${T.getRegisterAsEm("fboxrule",2)}em solid ${(p=T.toColor(this.framecolor))!=null?p:"black"}`),this.border&&K.setStyle("border",this.border);const re=new fr([K,g],{type:"lift"});return re.setStyle("display","inline-block"),re.setStyle("position","relative"),re.setStyle("line-height",0),re.height=g.height+I+(A>0?A:0),re.depth=g.depth+I+(A<0?-A:0),re.setStyle("padding-left",I,"em"),re.setStyle("padding-right",I,"em"),re.setStyle("height",Math.floor(100*(g.height+g.depth+2*I+Math.abs(A)))/100,"em"),re.setStyle("margin-top",-I,"em"),re.setStyle("top",Math.floor(100*(g.depth-g.height+2*I-A))/100,"em"),re.setStyle("vertical-align",Math.floor(100*(g.depth+2*I))/100,"em"),this.caret&&(re.caret=this.caret),this.attachSupsub(r,{base:re})}_serialize(r){return r.skipStyles?Yi([this.bodyToLatex(r),this.supsubToLatex(r)]):super._serialize(r)}},kh=class Yp extends Mt{constructor(r,n){var a;super({type:"composition",mode:(a=n==null?void 0:n.mode)!=null?a:"math",value:r})}static fromJson(r){return new Yp(r.value,r)}toJson(){return super.toJson()}get computedStyle(){return{}}render(r){const n=new fr(this.value,{classes:"ML__composition",type:"composition"});return this.bind(r,n),this.caret&&(n.caret=this.caret),n}_serialize(r){return""}},ka=class Xp extends Mt{constructor(r){super({type:"error",value:r,command:r,mode:"math"}),this.verbatimLatex=r}static fromJson(r){return new Xp(r.command)}toJson(){return super.toJson()}render(r){const n=this.createBox(r,{classes:"ML__error"});return this.caret&&(n.caret=this.caret),n}},Ic=class Jp extends Mt{constructor(r,n,a){super({type:"group",mode:n,style:a}),this.body=r,this.boxType=r.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,r&&r.length===1&&r[0].command===","&&(this.captureSelection=!0)}static fromJson(r){return new Jp(r.body,r.mode,r.style)}render(r){const n=Mt.createBox(r,this.body,{type:this.boxType});return n?(this.caret&&(n.caret=this.caret),this.bind(r,n)):null}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=Gt(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,r):`{${this.bodyToLatex(r)}}`}},Qn=class Qp extends Mt{constructor(r,n,a){super({type:"leftright",style:a.style,displayContainsHighlight:!0}),this.variant=r,this.body=n,this.leftDelim=a.leftDelim,this.rightDelim=a.rightDelim}static fromJson(r){var n;return new Qp((n=r.variant)!=null?n:"",r.body,r)}toJson(){const r=super.toJson();return this.variant&&(r.variant=this.variant),this.leftDelim&&(r.leftDelim=this.leftDelim),this.rightDelim&&(r.rightDelim=this.rightDelim),r}_serialize(r){var n,a;const c=this.matchingRightDelim();return this.variant==="left...right"?Yi(["\\left",(n=this.leftDelim)!=null?n:".",this.bodyToLatex(r),"\\right",c]):this.variant==="mleft...mright"?Yi(["\\mleft",(a=this.leftDelim)!=null?a:".",this.bodyToLatex(r),"\\mright",c]):Yi([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(r),c])}matchingRightDelim(){var r,n;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const a=(r=this.leftDelim)!=null?r:".";return(n=U0[a])!=null?n:a}render(r){var n,a;const c=new ji({parent:r},this.style);console.assert(this.body!==void 0);const p=new ji({parent:r,mathstyle:"textstyle"},this.style),g=(n=Mt.createBox(c,this.body,{type:"inner"}))!=null?n:new fr(null,{type:"inner"}),A=g.height/p.scalingFactor,T=g.depth/p.scalingFactor,I=[];if(this.leftDelim&&I.push(this.bind(p,la("open",this.leftDelim,A,T,p,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),g&&(Th(g.children,this,c,A,T),I.push(g)),this.rightDelim){let Oe=this.containsCaret?" ML__contains-caret":"",Ke=this.rightDelim;Ke==="?"&&(c.smartFence?(Ke=this.matchingRightDelim(),Oe+=" ML__smart-fence__close"):Ke="."),I.push(this.bind(p,la("close",Ke,A,T,p,{isSelected:this.isSelected,classes:Oe+" ML__close",mode:this.mode,style:this.style})))}let K=this.variant==="mleft...mright";const re=this.leftSibling;re&&(!K&&re.isFunction&&(K=!0),!K&&re.type==="subsup"&&((a=re.leftSibling)!=null&&a.isFunction)&&(K=!0));const ve=new fr(I,{type:K?"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(c,ve.wrap(c))}};function Th(e,r,n,a,c){if(e)for(let p=0;p<e.length;p++){const g=e[p];g.type==="middle"?(e[p]=r.bind(n,la("inner",g.value,a,c,n,{isSelected:r.isSelected})),e[p].caret=g.caret,e[p].isSelected=g.isSelected,e[p].cssId=g.cssId,e[p].htmlData=g.htmlData,e[p].htmlStyle=g.htmlStyle,e[p].attributes=g.attributes,e[p].cssProperties=g.cssProperties):g.children&&Th(g.children,r,n,a,c)}}var j0=class e1 extends Mt{constructor(r,n){var a;super({type:"macro",command:r,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(r){return new e1(r.command,r)}toJson(){const r=super.toJson();return this.expand&&(r.expand=!0),this.captureSelection!==void 0&&(r.captureSelection=this.captureSelection),this.macroArgs&&(r.args=this.macroArgs),r}_serialize(r){var n;return r.expandMacro&&this.expand?this.bodyToLatex(r):this.command+((n=this.macroArgs)!=null?n:"")}render(r){const n=Mt.createBox(r,this.body);return n?(this.caret&&(n.caret=this.caret),this.bind(r,n)):null}},Ch=class t1 extends Mt{constructor(){super({type:"macro-argument"})}static fromJson(r){return new t1}toJson(){return super.toJson()}_serialize(r){return""}render(r){return null}},Rc=class r1 extends Mt{constructor(r,n,a=!1,c,p){var g;super({type:"prompt",mode:(g=p==null?void 0:p.mode)!=null?g:"math",style:p==null?void 0:p.style,command:"\\placeholder"}),this.body=c,this.correctness=n,this.placeholderId=r,this.locked=a,this.captureSelection=this.locked}static fromJson(r){return new r1(r.placeholderId,r.correctness,r.locked,r.body,r)}toJson(){const r=super.toJson();return this.placeholderId&&(r.placeholderId=this.placeholderId),this.body||delete r.body,this.body&&(r.body=this.body.filter(n=>n.type!=="first").map(n=>n.toJson())),this.correctness&&(r.correctness=this.correctness),r.locked=this.locked,r}render(r){const n=new ji({parent:r}),a=n.getRegisterAsEm("fboxsep"),c=a,p=a,g=Mt.createBox(r,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 A=new fr(g,{type:"ord"});A.setStyle("display","inline-block"),A.setStyle("height",g.height+g.depth,"em"),A.setStyle("vertical-align",-p,"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 I=new fr(null,{classes:T,attributes:{part:"prompt"}});I.height=A.height+p,I.depth=A.depth+p,I.width=A.width+2*c,I.setStyle("box-sizing","border-box"),I.setStyle("position","absolute"),I.setStyle("height",A.height+A.depth+2*p,"em"),c===0&&I.setStyle("width","100%"),c!==0&&(I.setStyle("width",`calc(100% + ${2*c}em)`),I.setStyle("top",a,"em"),I.setStyle("left",-c,"em")),(!this.body||this.body.length===1)&&(I.width=3*c,I.setStyle("width",`calc(100% + ${3*c}em)`),I.setStyle("left",-1.5*c,"em"));let K="";this.correctness==="incorrect"&&(K+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),K&&(I.svgOverlay=K);const re=new fr([I,A],{classes:"ML__prompt-atom"});return re.setStyle("position","relative"),re.setStyle("display","inline-block"),re.setStyle("line-height",0),re.height=A.height+p+.2,re.depth=A.depth+p,re.left=c,re.right=c,re.setStyle("height",A.height+p,"em"),re.setStyle("top",A.depth-A.height,"em"),re.setStyle("vertical-align",A.depth+p,"em"),re.setStyle("margin-left",.5,"em"),re.setStyle("margin-right",.5,"em"),this.caret&&(re.caret=this.caret),this.bind(n,this.attachSupsub(r,{base:re}))}_serialize(r){var n;const a=(n=this.bodyToLatex(r))!=null?n:"";if(r.skipPlaceholders)return a;let c="\\placeholder";return this.placeholderId&&(c+=`[${this.placeholderId}]`),this.correctness==="correct"?c+="[correct]":this.correctness==="incorrect"&&(c+="[incorrect]"),this.locked&&(c+="[locked]"),Gn(c,a)}},Ml=class i1 extends Mt{constructor(r){super({type:"subsup",style:r==null?void 0:r.style}),this.subsupPlacement="auto"}static fromJson(r){const n=new i1(r);for(const a of nu)r[a]&&n.setChildren(r[a],a);return n}render(r){var n;const a=new ji({parent:r,isPhantom:!0}),c=this.leftSibling,p=(n=c.render(a))!=null?n:new fr(null),g=new fr(null);return g.height=p.height,g.depth=p.depth,this.attachSupsub(r,{base:g,isCharacterBox:c.isCharacterBox(),type:"ignore"})}_serialize(r){return this.supsubToLatex(r)}};function uu(e){return e?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(e):!1}var Dh=class{constructor(e,r,n){this.errors=[],this.index=0,this.endCount=0;var a,c,p,g;n!=null||(n={}),this.tokens=e,this.context=r instanceof ji&&!(n!=null&&n.parseMode)&&!n.mathstyle?r:new ji({from:r,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:(c=n.style)!=null?c:{},parseMode:(p=n.parseMode)!=null?p:"math",mathstyle:(g=n.mathstyle)!=null?g:"displaystyle",tabular:!1}}beginContext(e){var r,n,a;const c=this.parsingContext,p={parent:c,mathlist:[],style:z({},c.style),parseMode:(r=e==null?void 0:e.mode)!=null?r:c.parseMode,mathstyle:(n=e==null?void 0:e.mathstyle)!=null?n:c.mathstyle,tabular:(a=e==null?void 0:e.tabular)!=null?a:!1};this.parsingContext=p}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push(z({before:Uo(this.tokens.slice(this.index,this.index+10)),after:Uo(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 z({},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 Ml({style:this.style}),this.mathlist.push(e)),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var e;const{index:r}=this;if(r<this.tokens.length&&this.tokens[r].startsWith("\\")){const n=Gt(this.tokens[r],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 r=(e=this.args)==null?void 0:e.call(this,"?");return r?zs(r,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new so({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(e){let r=this.tokens[this.index];for(;r&&r!==e;)r=this.tokens[++this.index];r===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(e){const r=this.index;let n=this.end(),a="";for(;!n;){const p=this.get();uu(p)?(a+=p,n=this.end()||a.length>=e.length):n=!0}const c=e.toUpperCase()===a.toUpperCase();return c||(this.index=r),c}scanString(){let e="";for(;!this.end();){const r=this.peek();if(r==="]")return e;if(r==="<space>")e+=" ";else if(r.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=r.substring(1);else if(uu(r))e+=r;else return e;this.next()}return e}scanBalancedString(){let e="",r=this.end(),n=1;for(;!r;){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,r=n===0||this.end()}return e}scanLiteralGroup(){var e;if(!this.match("<{>"))return"";let r="",n=1;for(;n>0&&!this.end();){const a=this.get();a==="<}>"?(n-=1,n>0&&(r+="}")):a==="<{>"?(n+=1,r+="{"):(/\\[a-zA-Z]+$/.test(r)&&/^[a-zA-Z]/.test(a)&&(r+=" "),r+=(e={"<space>":" ","<$$>":"$$","<$>":"$"}[a])!=null?e:a)}return r}scanNumber(e=!0){var r,n;let a=!1,c=this.peek();for(;c==="<space>"||c==="+"||c==="-";)this.get(),c==="-"&&(a=!a),c=this.peek();e=!!e;let p=10,g=/\d/;if(this.match("'"))p=8,g=/[0-7]/,e=!0;else if(this.match('"'))p=16,g=/[\dA-F]/,e=!0;else if(this.match("x"))p=16,g=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return c=this.get(),c?c.length===2&&c.startsWith("\\")?{number:(a?-1:1)*((r=c.codePointAt(1))!=null?r:0),base:"alpha"}:{number:(a?-1:1)*((n=c.codePointAt(0))!=null?n:0),base:"alpha"}:null;let A="";for(;this.hasPattern(g);)A+=this.get();if(!e&&(this.match(".")||this.match(",")))for(A+=".";this.hasPattern(g);)A+=this.get();const T=e?Number.parseInt(A,p):Number.parseFloat(A);return Number.isNaN(T)?null:{number:a?-T:T,base:p===16?"hexadecimal":p===8?"octal":"decimal"}}scanRegister(){var e;const r=this.index,n=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return n;let a=!1;if(n===null)for(;;){const p=this.peek();if(p==="-")a=!a;else if(p!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const p=this.get();return p.startsWith("\\")?n?{register:p,global:!0,factor:(a?-1:1)*n.number}:a?{register:p,global:!0,factor:-1}:{register:p,global:!0}:(this.index=r,null)}let c=this.get();return c!=null&&c.startsWith("\\")?(c=c.substring(1),this.context.registers[c]?!a||n!==null?{register:c,factor:(a?-1:1)*((e=n==null?void 0:n.number)!=null?e:1)}:{register:c}:(this.index=r,null)):(this.index=r,null)}scanValue(){const e=this.scanRegister();if(e)return e;const r=this.index,n=this.scanGlueOrDimen();if(n&&("unit"in n||"glue"in n&&"unit"in n.glue))return n;this.index=r;const a=this.scanNumber();if(a)return a;if(this.end()||!uu(this.peek()))return null;const c=this.scanString();return c.length>0?{string:c}:null}scanDimen(){const e=this.scanNumber(!1);if(e===null)return null;const r=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:r,unit:n}:{dimension:r}}scanGlueOrDimen(){const e=this.scanDimen();if(e===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;const r={glue:e};if(this.matchKeyword("plus")){const n=this.scanDimen();if(n)r.grow=n;else return r}if(this.skipWhitespace(),this.match("\\relax"))return r;if(this.skipWhitespace(),this.matchKeyword("minus")){const n=this.scanDimen();if(n)r.shrink=n;else return r}return!r.grow&&!r.shrink?e:r}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const r=this.get();r==="c"||r==="r"||r==="l"?e.push({align:r}):r==="|"?e.push({separator:"solid"}):r===":"?e.push({separator:"dashed"}):r==="@"&&(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 r=this.scan(n=>n===(e==="displaystyle"?"\\]":"\\)"));return this.match(e==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),r}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const r=this.scan(n=>n===e);return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),r}scanEnvironment(){if(!this.match("\\begin"))return null;const e=this.scanArgument("string");if(!e)return null;const r=ze(e);if(!r)return this.onError({code:"unknown-environment",arg:e}),null;const n=[];if(r.params)for(const A of r.params)if(A.isOptional)n.push(this.scanOptionalArgument(A.type));else{const T=this.scanArgument(A.type);T||this.onError({code:"missing-argument",arg:e}),n.push(T)}this.beginContext({tabular:r.tabular});const a=[],c=[];let p=[],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())p.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){p.push(this.mathlist),this.mathlist=[];let A=null;this.skipWhitespace(),this.match("[")&&(A=this.scanDimen(),this.skipWhitespace(),this.match("]")),c.push(A!=null?A:{dimension:0}),a.push(p),p=[]}else this.mathlist.push(...this.scan(A=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(A)));while(!g);return p.push(this.mathlist),p.length>0&&a.push(p),this.endContext(),r.createAtom(e,a,c,n)}scanExpression(){const e=this.mathlist;if(this.mathlist=[],this.parseExpression()){const r=this.mathlist;return this.mathlist=e,r}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=g=>g==="<}>");let r="",n=null,a=[],c=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!r?(r=this.get(),n=Gt(r,"math"),n&&(a=this.scanArguments(n)[1]),c=this.mathlist,this.mathlist=[]):this.parseExpression();let p;return r?(console.assert(!!n),a.unshift(this.mathlist),c&&a.unshift(c),p=[n.createAtom({command:r,args:a,style:this.style,mode:this.parseMode})]):p=this.mathlist,this.endContext(),p}scanGroup(){const e=this.index;if(!this.match("<{>"))return null;const r=this.scan(a=>a==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const n=new Ic(r,this.parseMode,this.style);return n.verbatimLatex=Uo(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 r=new Qn("",this.mathlist,{leftDelim:"(",rightDelim:e===0?")":"?"});return this.endContext(),r}scanDelim(){this.skipWhitespace();const e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!uu(e)&&!e.startsWith("\\"))return null;this.next();const r=Gt(e,"math");return r?r.definitionType==="function"&&r.ifMode&&!r.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):r.definitionType==="symbol"&&(r.type==="mopen"||r.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 ka("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new ka("\\mright");let r="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;r="\\mright"}const n=this.scanDelim();if(!n)return this.onError({code:"unexpected-delimiter"}),new ka(r==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(r);)this.parseExpression();const a=this.mathlist;this.endContext();const c=(e=this.scanDelim())!=null?e:".";return new Qn(r==="\\right"?"left...right":"mleft...mright",a,{leftDelim:n,rightDelim:c,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let e=this.peek();if(e!=="^"&&e!=="_"&&e!=="'")return!1;const r=this.lastSubsupAtom();for(;e==="^"||e==="_"||e==="'";)this.match("'")?this.match("'")?r.addChild(new Mt({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):r.addChild(new Mt({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&r.addChildren(He(this.scanArgument("expression")),e==="_"?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const e=this.match("\\limits"),r=!e&&this.match("\\nolimits"),n=!r&&!e&&this.match("\\displaylimits");if(!e&&!r&&!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"),r&&(a.subsupPlacement="adjacent"),n&&(a.subsupPlacement="auto"),!0)}scanArguments(e){if(!(e!=null&&e.params))return[void 0,[]];let r;const n=[];let a=e.infix?2:0;for(;a<e.params.length;){const c=e.params[a];c.type==="rest"?n.push(this.scan(p=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(p))):c.isOptional?n.push(this.scanOptionalArgument(c.type)):c.type.endsWith("*")?r=c.type.slice(0,-1):n.push(this.scanArgument(c.type)),a+=1}return[r,n]}scanSymbolOrLiteral(){const e=this.peek();if(!e)return null;this.next();let r;if(uu(e)){const n=Ea.createAtom(this.parseMode,e,z({},this.style));return n?[n]:null}if(r=this.scanMacro(e),r)return[r];if(e.startsWith("\\")){const n=Gt(e,this.parseMode);if(!n)return this.onError({code:"unknown-command",arg:e}),[new ka(e)];if(n.definitionType==="symbol"){const a=z({},this.style);n.variant&&(a.variant=n.variant),r=new Mt({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 ka(e)];n.createAtom&&(r=n.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return r?[r]:null}scanArgument(e){var r;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(r=this.scanDelim())!=null?r:".";if(e==="expression")return this.scanExpression();if(e==="math"){e!==n&&this.beginContext({mode:"math"});const c=this.scanSymbolOrLiteral();return e!==n&&this.endContext(),c}if(e==="text"){e!==n&&this.beginContext({mode:"text"});const c=this.scanSymbolOrLiteral();return e!==n&&this.endContext(),c}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 c=this.mathlist;return this.endContext(),{group:c}}if(e==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const c=this.mathlist;return this.endContext(),{group:c}}let a=null;if(e==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const c=this.mathlist;return this.endContext(),{group:c}}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 r=null;for(;!this.end()&&!this.match("]");)if(e==="string")r=this.scanString();else if(e==="value")r=this.scanValue();else if(e==="colspec")r=this.scanColspec();else if(e==="bbox"){const n={},a=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const c of a){const p=c.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(p)n.padding={dimension:parseInt(p[1]),unit:p[2]};else{const g=c.match(/^\s*border\s*:\s*(.*)/);g?n.border=g[1]:n.backgroundcolor={string:c}}}r=n}else e==="math"&&(this.beginContext({mode:"math"}),r=this.mathlist.concat(this.scan(n=>n==="]")),this.endContext());return r}scanSymbolOrCommand(e){var r,n,a;if(e==="\\placeholder"){const A=this.scanOptionalArgument("string"),T=this.scanOptionalArgument("math"),I=Mt.serialize(T,{defaultMode:"math"});let K=[],re;!re&&I==="correct"?re="correct":!re&&I==="incorrect"?re="incorrect":I!==""&&(K=T);const ve=this.scanOptionalArgument("string")==="locked",Oe=this.scanArgument("auto");let Ke;return Oe&&Array.isArray(Oe)&&Oe.length>0?Ke=Oe:Oe&&typeof Oe=="object"&&"group"in Oe?Ke=Oe.group:Ke=K,A?[new Rc(A,re,ve,Ke!=null?Ke:K,{mode:this.parseMode,style:this.style})]:[new so({mode:this.parseMode,style:this.style})]}if(e==="\\renewcommand"||e==="\\newcommand"||e==="\\providecommand"||e==="\\def"){const A=this.index,T=this.scanLiteralGroup()||this.next();if(!T)return null;if(this.context.registers[T.substring(1)]){const I=this.scanArgument("string");I!==null&&(this.context.registers[T.substring(1)]=I);const K=Yi([e,Uo(this.tokens.slice(A,this.index))]);return[new Mt({type:"text",value:"",verbatimLatex:K})]}}let c=this.scanMacro(e);if(c)return[c];const p=Gt(e,this.parseMode);if(!p)return this.parseMode==="text"?(/[a-zA-Z]/.test((r=this.peek())!=null?r:"")&&(e+=" "),[...e].map(A=>new Mt({type:"text",value:A,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:e}),[new ka(e)]);const g=this.index;if(p.definitionType==="symbol"){const A=z({},this.style);p.variant&&(A.variant=p.variant),c=new Mt({type:p.type,command:e,style:A,value:String.fromCodePoint(p.codepoint),mode:this.parseMode})}else{if(p.ifMode&&!p.ifMode.includes(this.parseMode))return[];const A=this.parseMode;p.applyMode&&(this.parseMode=p.applyMode);let T,I=[];if(p.parse?I=p.parse(this):[T,I]=this.scanArguments(p),this.parseMode=A,p.applyMode&&!p.applyStyle&&!p.createAtom)return He(I[0]);if(p.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if(typeof p.createAtom=="function")c=p.createAtom({command:e,args:I,style:this.style,mode:this.parseMode}),T&&(c.body=He(this.scanArgument(T)));else if(typeof p.applyStyle=="function"){const K=z(z({},this.style),p.applyStyle(e,I,this.context)),re=this.parseMode;if(p.applyMode&&(this.parseMode=p.applyMode),T){const ve=this.style;this.style=K;const Oe=this.scanArgument(T);return this.style=ve,this.parseMode=re,He(Oe)}this.style=K}else c=new Mt({type:"mord",command:(n=p.command)!=null?n:e,style:z({},this.style),value:e,mode:(a=p.applyMode)!=null?a:this.parseMode})}if(!c)return null;if(c instanceof Mt&&c.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){const A=Yi([e,Uo(this.tokens.slice(g,this.index))]);A&&(c.verbatimLatex=A)}if(c.verbatimLatex===null&&(c.verbatimLatex=void 0),c.isFunction&&this.smartFence){const A=this.scanSmartFence();if(A)return[c,A]}return[c]}scanSymbolCommandOrLiteral(){const e=this.get();if(!e)return null;if(uu(e)){const r=Ea.createAtom(this.parseMode,e,z({},this.style));if(!r)return null;if(r.isFunction&&this.smartFence){const n=this.scanSmartFence();if(n)return[r,n]}return[r]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):e==="<space>"?this.parseMode==="text"?[new Hu(" "," ",this.style)]:null:(e==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var r;const n=this.context.getMacro(e);if(!n)return null;const a=this.index,c=n.args,p={"?":(r=this.args)==null?void 0:r.call(this,"?")};for(let g=1;g<=c;g++){let A=this.scanLiteralGroup();if(!A){const T=this.index;this.scanExpression(),A=Uo(this.tokens.slice(T,this.index))}p[g]=A}return new j0(e,{expand:n.expand,captureSelection:n.captureSelection,args:a===this.index?null:Uo(this.tokens.slice(a,this.index)),style:this.parsingContext.style,body:zs(n.def,{context:this.context,parseMode:this.parseMode,args:g=>p[g],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var e,r,n,a;let c=(a=(n=(r=(e=this.scanEnvironment())!=null?e:this.scanModeShift())!=null?r:this.scanModeSet())!=null?n:this.scanGroup())!=null?a:this.scanLeftRight();if(c===null){if(this.parseSupSub()||this.parseLimits())return!0;c=this.scanSymbolCommandOrLiteral()}return c?(Array.isArray(c)?this.mathlist.push(...c):this.mathlist.push(c),!0):!1}};function zs(e,r){var n,a,c,p;const g=(n=r==null?void 0:r.args)!=null?n:void 0,A=new Dh(ru(e,g),r==null?void 0:r.context,{args:g,mathstyle:(a=r==null?void 0:r.mathstyle)!=null?a:"displaystyle",parseMode:(c=r==null?void 0:r.parseMode)!=null?c:"math",style:(p=r==null?void 0:r.style)!=null?p:{}}),T=[];for(;!A.end();)T.push(...A.scan(()=>!1));return T}function Mh(e,r){var n;const a=new Dh(ru(e,null),r==null?void 0:r.context,{mathstyle:"displaystyle",parseMode:(n=r==null?void 0:r.parseMode)!=null?n:"math"});for(;!a.end();)a.scan();return a.errors}var Pc=class n1 extends Mt{constructor(r,n){super({type:"chem"},{command:r,mode:"math"});const a=Hn.go(er.go(n,r==="\\pu"?"pu":"ce"),!1);this.body=zs(a),this._verbatimLatex=r+"{"+n+"}",this.arg=n,this.captureSelection=!0}static fromJson(r){return new n1(r.command,r.arg)}set verbatimLatex(r){}get verbatimLatex(){return this._verbatimLatex}toJson(){return d(z({},super.toJson()),{arg:this.arg})}render(r){const n=Mt.createBox(r,this.body,{type:"inner"});return this.caret&&(n.caret=this.caret),this.bind(r,n)}_serialize(r){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};Ve(["ce","pu"],"{chemformula:balanced-string}",{createAtom:e=>{var r;return new Pc(e.command,(r=e.args[0])!=null?r:"")}});var er={go:function(e,r){if(!e)return[];r===void 0&&(r="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 c,p=10,g=[];;){c!==e?(p=10,c=e):p--;var A=er.stateMachines[r],T=A.transitions[n]||A.transitions["*"];e:for(var I=0;I<T.length;I++){var K=er.patterns.match_(T[I].pattern,e);if(K){for(var re=T[I].task,ve=0;ve<re.action_.length;ve++){var Oe;if(A.actions[re.action_[ve].type_])Oe=A.actions[re.action_[ve].type_](a,K.match_,re.action_[ve].option);else if(er.actions[re.action_[ve].type_])Oe=er.actions[re.action_[ve].type_](a,K.match_,re.action_[ve].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+re.action_[ve].type_+")"];er.concatArray(g,Oe)}if(n=re.nextState||n,e.length>0){if(re.revisit||(e=K.remainder),!re.toContinue)break e}else return g}}if(p<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,r){if(r)if(Object.prototype.toString.call(r)==="[object Array]")for(var n=0;n<r.length;n++)e.push(r[n]);else e.push(r)},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 r=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 r&&r[0]?{match_:r.slice(1),remainder:e.substr(r[0].length)}:null},"(-)(9)^(-9)":function(e){var r=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return r&&r[0]?{match_:r.slice(1),remainder:e.substr(r[0].length)}:null},"state of aggregation $":function(e){var r=er.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(r&&r.remainder.match(/^($|[\s,;\)\]\}])/))return r;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 er.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return er.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return er.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return er.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return er.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return er.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return er.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return er.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return er.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return er.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return er.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return er.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return er.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 er.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return er.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return er.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return er.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 er.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return er.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return er.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return er.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return er.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return er.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return er.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return er.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 r;if(r=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))/),r)return{match_:r[0],remainder:e.substr(r[0].length)};var n=er.patterns.findObserveGroups(e,"","$","$","");return n&&(r=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),r)?{match_:r[0],remainder:e.substr(r[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 r=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return r?{match_:r[0],remainder:e.substr(r[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,r,n,a,c,p,g,A,T,I){var K=function(mt,zt){if(typeof zt=="string")return mt.indexOf(zt)!==0?null:zt;var pr=mt.match(zt);return pr?pr[0]:null},re=function(mt,zt,pr){for(var Zt=0;zt<mt.length;){var Hr=mt.charAt(zt),ni=K(mt.substr(zt),pr);if(ni!==null&&Zt===0)return{endMatchBegin:zt,endMatchEnd:zt+ni.length};if(Hr==="{")Zt++;else if(Hr==="}"){if(Zt===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];Zt--}zt++}return Zt>0,null},ve=K(e,r);if(ve===null||(e=e.substr(ve.length),ve=K(e,n),ve===null))return null;var Oe=re(e,ve.length,a||c);if(Oe===null)return null;var Ke=e.substring(0,a?Oe.endMatchEnd:Oe.endMatchBegin);if(p||g){var vt=this.findObserveGroups(e.substr(Oe.endMatchEnd),p,g,A,T);if(vt===null)return null;var ur=[Ke,vt.match_];return{match_:I?ur.join(""):ur,remainder:vt.remainder}}else return{match_:Ke,remainder:e.substr(Oe.endMatchEnd)}},match_:function(e,r){var n=er.patterns.patterns[e];if(n===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if(typeof n=="function")return er.patterns.patterns[e](r);var a=r.match(n);if(a){var c;return a[2]?c=[a[1],a[2]]:a[1]?c=a[1]:c=a[0],{match_:c,remainder:r.substr(a[0].length)}}return null}},actions:{"a=":function(e,r){e.a=(e.a||"")+r},"b=":function(e,r){e.b=(e.b||"")+r},"p=":function(e,r){e.p=(e.p||"")+r},"o=":function(e,r){e.o=(e.o||"")+r},"q=":function(e,r){e.q=(e.q||"")+r},"d=":function(e,r){e.d=(e.d||"")+r},"rm=":function(e,r){e.rm=(e.rm||"")+r},"text=":function(e,r){e.text_=(e.text_||"")+r},insert:function(e,r,n){return{type_:n}},"insert+p1":function(e,r,n){return{type_:n,p1:r}},"insert+p1+p2":function(e,r,n){return{type_:n,p1:r[0],p2:r[1]}},copy:function(e,r){return r},rm:function(e,r){return{type_:"rm",p1:r||""}},text:function(e,r){return er.go(r,"text")},"{text}":function(e,r){var n=["{"];return er.concatArray(n,er.go(r,"text")),n.push("}"),n},"tex-math":function(e,r){return er.go(r,"tex-math")},"tex-math tight":function(e,r){return er.go(r,"tex-math tight")},bond:function(e,r,n){return{type_:"bond",kind_:n||r}},"color0-output":function(e,r){return{type_:"color0",color:r[0]}},ce:function(e,r){return er.go(r)},"1/2":function(e,r){var n=[];r.match(/^[+\-]/)&&(n.push(r.substr(0,1)),r=r.substr(1));var a=r.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,r){return er.go(r,"9,9")}},createTransitions:function(e){var r,n,a,c,p={};for(r in e)for(n in e[r])for(a=n.split("|"),e[r][n].stateArray=a,c=0;c<a.length;c++)p[a[c]]=[];for(r in e)for(n in e[r])for(a=e[r][n].stateArray||[],c=0;c<a.length;c++){var g=e[r][n];if(g.action_){g.action_=[].concat(g.action_);for(var A=0;A<g.action_.length;A++)typeof g.action_[A]=="string"&&(g.action_[A]={type_:g.action_[A]})}else g.action_=[];for(var T=r.split("|"),I=0;I<T.length;I++)if(a[c]==="*")for(var K in p)p[K].push({pattern:T[I],task:g});else p[a[c]].push({pattern:T[I],task:g})}return p},stateMachines:{}};er.stateMachines={ce:{transitions:er.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,r){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 er.actions["o="](e,r),n},"d= kv":function(e,r){e.d=r,e.dType="kv"},"charge or bond":function(e,r){if(e.beginsWithBond){var n=[];return er.concatArray(n,this.output(e)),er.concatArray(n,er.actions.bond(e,r,"-")),n}else e.d=r},"- after o/d":function(e,r,n){var a=er.patterns.match_("orbital",e.o||""),c=er.patterns.match_("one lowercase greek letter $",e.o||""),p=er.patterns.match_("one lowercase latin letter $",e.o||""),g=er.patterns.match_("$one lowercase latin letter$ $",e.o||""),A=r==="-"&&(a&&a.remainder===""||c||p||g);A&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!a&&p&&(e.o="$"+e.o+"$");var T=[];return A?(er.concatArray(T,this.output(e)),T.push({type_:"hyphen"})):(a=er.patterns.match_("digits",e.d||""),n&&a&&a.remainder===""?(er.concatArray(T,er.actions["d="](e,r)),er.concatArray(T,this.output(e))):(er.concatArray(T,this.output(e)),er.concatArray(T,er.actions.bond(e,r,"-")))),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,r){return{type_:"state of aggregation",p1:er.go(r,"o")}},comma:function(e,r){var n=r.replace(/\s*$/,""),a=n!==r;return a&&e.parenthesisLevel===0?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(e,r,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"&&er.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:er.go(e.a,"a"),b:er.go(e.b,"bd"),p:er.go(e.p,"pq"),o:er.go(e.o,"o"),q:er.go(e.q,"pq"),d:er.go(e.d,e.dType==="oxidation"?"oxidation":"bd"),dType:e.dType}));else{var c;e.rdt==="M"?c=er.go(e.rd,"tex-math"):e.rdt==="T"?c=[{type_:"text",p1:e.rd||""}]:c=er.go(e.rd);var p;e.rqt==="M"?p=er.go(e.rq,"tex-math"):e.rqt==="T"?p=[{type_:"text",p1:e.rq||""}]:p=er.go(e.rq),a={type_:"arrow",r:e.r,rd:c,rq:p}}for(var g in e)g!=="parenthesisLevel"&&g!=="beginsWithBond"&&delete e[g];return a},"oxidation-output":function(e,r){var n=["{"];return er.concatArray(n,er.go(r,"oxidation")),n.push("}"),n},"frac-output":function(e,r){return{type_:"frac-ce",p1:er.go(r[0]),p2:er.go(r[1])}},"overset-output":function(e,r){return{type_:"overset",p1:er.go(r[0]),p2:er.go(r[1])}},"underset-output":function(e,r){return{type_:"underset",p1:er.go(r[0]),p2:er.go(r[1])}},"underbrace-output":function(e,r){return{type_:"underbrace",p1:er.go(r[0]),p2:er.go(r[1])}},"color-output":function(e,r){return{type_:"color",color1:r[0],color2:er.go(r[1])}},"r=":function(e,r){e.r=r},"rdt=":function(e,r){e.rdt=r},"rd=":function(e,r){e.rd=r},"rqt=":function(e,r){e.rqt=r},"rq=":function(e,r){e.rq=r},operator:function(e,r,n){return{type_:"operator",kind_:n||r}}}},a:{transitions:er.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:er.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:er.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 r={type_:"text",p1:e.text_};for(var n in e)delete e[n];return r}}}},pq:{transitions:er.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,r){return{type_:"state of aggregation subscript",p1:er.go(r,"o")}},"color-output":function(e,r){return{type_:"color",color1:r[0],color2:er.go(r[1],"pq")}}}},bd:{transitions:er.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,r){return{type_:"color",color1:r[0],color2:er.go(r[1],"bd")}}}},oxidation:{transitions:er.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,r){return{type_:"roman numeral",p1:r||""}}}},"tex-math":{transitions:er.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var r={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return r}}}},"tex-math tight":{transitions:er.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,r){e.o=(e.o||"")+"{"+r+"}"},output:function(e){if(e.o){var r={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return r}}}},"9,9":{transitions:er.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:er.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,r){var n=[];return r[0]==="+-"||r[0]==="+/-"?n.push("\\pm "):r[0]&&n.push(r[0]),r[1]&&(er.concatArray(n,er.go(r[1],"pu-9,9")),r[2]&&(r[2].match(/[,.]/)?er.concatArray(n,er.go(r[2],"pu-9,9")):n.push(r[2])),(r[3]||r[4])&&(r[3]==="e"||r[4]==="*"?n.push({type_:"cdot"}):n.push({type_:"times"}))),r[5]&&n.push("10^{"+r[5]+"}"),n},"number^":function(e,r){var n=[];return r[0]==="+-"||r[0]==="+/-"?n.push("\\pm "):r[0]&&n.push(r[0]),er.concatArray(n,er.go(r[1],"pu-9,9")),n.push("^{"+r[2]+"}"),n},operator:function(e,r,n){return{type_:"operator",kind_:n||r}},space:function(){return{type_:"pu-space-1"}},output:function(e){var r,n=er.patterns.match_("{(...)}",e.d||"");n&&n.remainder===""&&(e.d=n.match_);var a=er.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 c={d:er.go(e.d,"pu"),q:er.go(e.q,"pu")};e.o==="//"?r={type_:"pu-frac",p1:c.d,p2:c.q}:(r=c.d,c.d.length>1||c.q.length>1?r.push({type_:" / "}):r.push({type_:"/"}),er.concatArray(r,c.q))}else r=er.go(e.d,"pu-2");for(var p in e)delete e[p];return r}}},"pu-2":{transitions:er.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,r){e.rm+="^{"+r+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var r=[];if(e.rm){var n=er.patterns.match_("{(...)}",e.rm||"");n&&n.remainder===""?r=er.go(n.match_,"pu"):r={type_:"rm",p1:e.rm}}for(var a in e)delete e[a];return r}}},"pu-9,9":{transitions:er.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 r=[];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)r.push(e.text_.substr(a,3)),r.push({type_:"1000 separator"});r.push(e.text_.substr(0,n)),r.reverse()}else r.push(e.text_);for(var c in e)delete e[c];return r},"output-o":function(e){var r=[];if(e.text_=e.text_||"",e.text_.length>4){for(var n=e.text_.length-3,a=0;a<n;a+=3)r.push(e.text_.substr(a,3)),r.push({type_:"1000 separator"});r.push(e.text_.substr(a))}else r.push(e.text_);for(var c in e)delete e[c];return r}}}};var Hn={go:function(e,r){if(!e)return"";for(var n="",a=!1,c=0;c<e.length;c++){var p=e[c];typeof p=="string"?n+=p:(n+=Hn._go2(p),p.type_==="1st-level escape"&&(a=!0))}return!r&&!a&&n&&(n="{"+n+"}"),n},_goInner:function(e){return e&&Hn.go(e,!0)},_go2:function(e){var r;switch(e.type_){case"chemfive":r="";var n={a:Hn._goInner(e.a),b:Hn._goInner(e.b),p:Hn._goInner(e.p),o:Hn._goInner(e.o),q:Hn._goInner(e.q),d:Hn._goInner(e.d)};n.a&&(n.a.match(/^[+\-]/)&&(n.a="{"+n.a+"}"),r+=n.a+"\\,"),(n.b||n.p)&&(r+="{\\vphantom{X}}",r+="^{\\hphantom{"+(n.b||"")+"}}_{\\hphantom{"+(n.p||"")+"}}",r+="{\\vphantom{X}}",r+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(n.b||"")+"}}",r+="_{\\vphantom{2}\\llap{\\smash[t]{"+(n.p||"")+"}}}"),n.o&&(n.o.match(/^[+\-]/)&&(n.o="{"+n.o+"}"),r+=n.o),e.dType==="kv"?((n.d||n.q)&&(r+="{\\vphantom{X}}"),n.d&&(r+="^{"+n.d+"}"),n.q&&(r+="_{\\smash[t]{"+n.q+"}}")):e.dType==="oxidation"?(n.d&&(r+="{\\vphantom{X}}",r+="^{"+n.d+"}"),n.q&&(r+="{\\vphantom{X}}",r+="_{\\smash[t]{"+n.q+"}}")):(n.q&&(r+="{\\vphantom{X}}",r+="_{\\smash[t]{"+n.q+"}}"),n.d&&(r+="{\\vphantom{X}}",r+="^{"+n.d+"}"));break;case"rm":r="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),r="\\mathrm{"+e.p1+"}"):r="\\text{"+e.p1+"}";break;case"roman numeral":r="\\mathrm{"+e.p1+"}";break;case"state of aggregation":r="\\mskip2mu "+Hn._goInner(e.p1);break;case"state of aggregation subscript":r="\\mskip1mu "+Hn._goInner(e.p1);break;case"bond":if(r=Hn._getBond(e.kind_),!r)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var a="\\frac{"+e.p1+"}{"+e.p2+"}";r="\\mathchoice{\\textstyle"+a+"}{"+a+"}{"+a+"}{"+a+"}";break;case"pu-frac":var c="\\frac{"+Hn._goInner(e.p1)+"}{"+Hn._goInner(e.p2)+"}";r="\\mathchoice{\\textstyle"+c+"}{"+c+"}{"+c+"}{"+c+"}";break;case"tex-math":r=e.p1+" ";break;case"frac-ce":r="\\frac{"+Hn._goInner(e.p1)+"}{"+Hn._goInner(e.p2)+"}";break;case"overset":r="\\overset{"+Hn._goInner(e.p1)+"}{"+Hn._goInner(e.p2)+"}";break;case"underset":r="\\underset{"+Hn._goInner(e.p1)+"}{"+Hn._goInner(e.p2)+"}";break;case"underbrace":r="\\underbrace{"+Hn._goInner(e.p1)+"}_{"+Hn._goInner(e.p2)+"}";break;case"color":r="{\\color{"+e.color1+"}{"+Hn._goInner(e.color2)+"}}";break;case"color0":r="\\color{"+e.color+"}";break;case"arrow":var p={rd:Hn._goInner(e.rd),rq:Hn._goInner(e.rq)},g=Hn._getArrow(e.r);p.rd||p.rq?e.r==="<=>"||e.r==="<=>>"||e.r==="<<=>"||e.r==="<-->"?(g="\\long"+g,p.rd&&(g="\\overset{"+p.rd+"}{"+g+"}"),p.rq&&(e.r==="<-->"?g="\\underset{\\lower2mu{"+p.rq+"}}{"+g+"}":g="\\underset{\\lower6mu{"+p.rq+"}}{"+g+"}"),g=" {}\\mathrel{"+g+"}{} "):(p.rq&&(g+="[{"+p.rq+"}]"),g+="{"+p.rd+"}",g=" {}\\mathrel{\\x"+g+"}{} "):g=" {}\\mathrel{\\long"+g+"}{} ",r=g;break;case"operator":r=Hn._getOperator(e.kind_);break;case"1st-level escape":r=e.p1+" ";break;case"space":r=" ";break;case"entitySkip":r="~";break;case"pu-space-1":r="~";break;case"pu-space-2":r="\\mkern3mu ";break;case"1000 separator":r="\\mkern2mu ";break;case"commaDecimal":r="{,}";break;case"comma enumeration L":r="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":r="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":r="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":r="\\text{-}";break;case"addition compound":r="\\,{\\cdot}\\,";break;case"electron dot":r="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":r="{\\times}";break;case"prime":r="\\prime ";break;case"cdot":r="\\cdot ";break;case"tight cdot":r="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":r="\\times ";break;case"circa":r="{\\sim}";break;case"^":r="uparrow";break;case"v":r="downarrow";break;case"ellipsis":r="\\ldots ";break;case"/":r="/";break;case" / ":r="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return r},_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 Lh(e){}function Oc(e){}var Ih=class s1 extends Mt{constructor(r){super(d(z({},r),{type:"delim"})),this.value=r.delim,this.size=r.size}static fromJson(r){return new s1(r)}toJson(){return d(z({},super.toJson()),{delim:this.value,size:this.size})}render(r){return new fr(this.value,{type:"middle"})}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=Gt(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,r):Gn(this.command,this.value)}},Bc=class a1 extends Mt{constructor(r){super(d(z({},r),{type:"sizeddelim",value:r.delim})),this.delimType=r.delimType,this.size=r.size}static fromJson(r){return new a1(r)}toJson(){return d(z({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(r){let n=xh(this.value,this.size,r,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return n?(n=this.bind(r,n),this.caret&&(n.caret=this.caret),n):null}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=Gt(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,r):Gn(this.command,this.value)}},Zu=class o1 extends Mt{constructor(r,n,a,c){var p,g;super({type:"enclose",command:r,style:c.style}),this.body=n,this.backgroundcolor=c.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=(p=c.shadow)!=null?p:"none",this.strokeWidth=(g=c.strokeWidth)!=null?g:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=c.strokeStyle,this.svgStrokeStyle=c.svgStrokeStyle,this.strokeColor=c.strokeColor,this.borderStyle=c.borderStyle,this.padding=c.padding,this.captureSelection=!1}static fromJson(r){return new o1(r.command,r.body,r.notation,r)}toJson(){return d(z({},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(r){var n;if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const a=Gt(this.command,this.mode);if(a!=null&&a.serialize)return a.serialize(this,r);let c=(n=this.command)!=null?n:"";if(this.command==="\\enclose"){c+="{"+Object.keys(this.notation).join(" ")+"}";let p="",g="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(p+=g+'mathbackground="'+this.backgroundcolor+'"',g=","),this.shadow&&this.shadow!=="auto"&&(p+=g+'shadow="'+this.shadow+'"',g=","),this.strokeWidth||this.strokeStyle!=="solid"?(p+=g+this.borderStyle,g=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(p+=g+'mathcolor="'+this.strokeColor+'"',g=","),p&&(c+=`[${p}]`)}return Gn(c,this.bodyToLatex(r))}render(r){const n=new ji({parent:r},this.style),a=Mt.createBox(n,this.body);if(!a)return null;const c=Fc(this.borderStyle),p=n.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});a.setStyle("position","relative"),a.setStyle("display","inline-block"),a.setStyle("top",p,"em"),a.setStyle("height",a.height+a.depth,"em"),a.setStyle("width",a.width,"em");const g=new fr(null,{classes:"ML__notation"});let A=a.height+a.depth+2*p;const T=a.width+2*p;let I="";if(this.notation.horizontalstrike&&(I+=this.line(3,50,97,50)),this.notation.verticalstrike&&(I+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(I+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(I+=this.line(3,3,97,97)),this.notation.updiagonalarrow){I+=this.line(p.toString(),(p+a.depth+a.height).toString(),(p+a.width).toString(),p.toString());const Ke=.03*Math.sqrt(T*T+A*A)*1,vt=a.width*Ke,ur=(a.depth+a.height)*Ke,mt=p+a.width;let zt=p;zt+ur-.4*vt<0&&(zt=.4*vt-ur),I+='<polygon points="',I+=`${mt},${zt} ${mt-vt-.4*ur},${zt+ur-.4*vt} `,I+=`${mt-.7*vt},${zt+.7*ur} ${mt-vt+.4*ur},${zt+ur+.4*vt} `,I+=`${mt},${zt}`,I+=`" stroke='none' fill="${this.strokeColor}"`,I+="/>"}let K=0;if(this.notation.phasorangle){const ve=Z0(n),Oe=(a.height+a.depth+2*ve+p).toString(),Ke=(a.height+a.depth)/2;I+=this.line(p.toString(),Oe,(p+Ke+a.width).toString(),Oe),I+=this.line(p.toString(),Oe,(p+Ke).toString(),(p-ve).toString()),A+=ve,K=Ke,a.left+=A/2-p}if(this.notation.longdiv){const ve=Z0(n);A+=ve,I+=this.line(p.toString(),p.toString(),(p+a.width).toString(),p.toString());const Oe=.3;K=Oe+ve,a.left+=Oe+ve,a.setTop(p+ve),I+='<path d="',I+=`M ${p} ${p} a${Oe} ${(a.depth+a.height+2*ve)/2}, 0, 1, 1, 0 ${a.depth+a.height+2*ve} "`,I+=` stroke-width="${Ud(n)}" stroke="${this.strokeColor}" fill="none"`,I+="/>"}if(g.width=a.width+2*p+K,g.height=a.height+p,g.depth=a.depth+p,g.setStyle("box-sizing","border-box"),g.setStyle("left",`calc(-${c} / 2 )`),g.setStyle("height",`${Math.floor(100*A)/100}em`),g.setStyle("top",`calc(${c} / 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),I){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=I}const re=new fr([g,a]);return re.setStyle("position","relative"),re.setStyle("vertical-align",p,"em"),re.setStyle("height",`${Math.floor(100*(a.height+a.depth+2*p))/100}em`),re.setStyle("display","inline-block"),re.height=g.height,re.depth=g.depth,re.width=g.width-2*p,re.left=p,re.right=p,this.caret&&(re.caret=this.caret),re.wrap(n)}line(r,n,a,c){return`<line x1="${q0(r)}" y1="${q0(n)}" x2="${q0(a)}" y2="${q0(c)}" vector-effect="non-scaling-stroke"></line>`}};function q0(e){return typeof e=="number"?`${Math.floor(100*e)/100}%`:e}function Fc(e){if(!e)return"1px";const r=e.match(/([0-9][a-zA-Z\%]+)/);return r===null?"1px":r[1]}function Ud(e){return(Math.floor(100*e.metrics.sqrtRuleThickness/e.scalingFactor)/100/10).toString()+"em"}function Z0(e){const r=e.isDisplayStyle?Sa:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*r/4}var cu=class l1 extends Mt{constructor(r,n,a){var c,p;super(d(z({},a),{type:"genfrac",displayContainsHighlight:!0})),this.above=r,this.below=n,this.hasBarLine=(c=a==null?void 0:a.hasBarLine)!=null?c:!0,this.continuousFraction=(p=a==null?void 0:a.continuousFraction)!=null?p:!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(r){return new l1(r.above,r.below,r)}toJson(){const r={};return this.continuousFraction&&(r.continuousFraction=!0),this.numerPrefix&&(r.numerPrefix=this.numerPrefix),this.denomPrefix&&(r.denomPrefix=this.denomPrefix),this.leftDelim&&(r.leftDelim=this.leftDelim),this.rightDelim&&(r.rightDelim=this.rightDelim),this.hasBarLine||(r.hasBarLine=!1),this.mathstyleName&&(r.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(r.fractionNavigationOrder=this.fractionNavigationOrder),z(z({},super.toJson()),r)}get children(){if(this._children)return this._children;const r=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const n of this.below)r.push(...n.children),r.push(n);for(const n of this.above)r.push(...n.children),r.push(n)}else{for(const n of this.above)r.push(...n.children),r.push(n);for(const n of this.below)r.push(...n.children),r.push(n)}return this._children=r,r}render(r){var n,a;const c=new ji({parent:r,mathstyle:this.mathstyleName},this.style),p=c.metrics,g=new ji({parent:c,mathstyle:this.continuousFraction?"":"numerator"},this.style),A=this.numerPrefix?new fr([new fr(this.numerPrefix),Mt.createBox(g,this.above)],{isTight:g.isTight,type:"ignore"}):(n=Mt.createBox(g,this.above,{type:"ignore"}))!=null?n:new fr(null,{type:"ignore"}),T=new ji({parent:c,mathstyle:this.continuousFraction?"":"denominator"},this.style),I=this.denomPrefix?new fr([new fr(this.denomPrefix),Mt.createBox(T,this.below,{type:"ignore"})]):(a=Mt.createBox(T,this.below,{type:"ignore"}))!=null?a:new fr(null,{type:"ignore"}),K=this.hasBarLine?p.defaultRuleThickness:0;let re,ve=0,Oe;c.isDisplayStyle?(re=g.metrics.num1,ve=K>0?3*K:7*K,Oe=T.metrics.denom1):(K>0?(re=g.metrics.num2,ve=K):(re=g.metrics.num3,ve=3*p.defaultRuleThickness),Oe=T.metrics.denom2);const Ke=[];this.isSelected&&Ke.push("ML__selected");const vt=A.depth,ur=I.height;let mt;if(K<=0){const Yr=re-vt-(ur-Oe);Yr<ve&&(re+=(ve-Yr)/2,Oe+=(ve-Yr)/2),mt=new ws({individualShift:[{box:A,shift:-re,classes:[...Ke,"ML__center"]},{box:I,shift:Oe,classes:[...Ke,"ML__center"]}]}).wrap(c)}else{const Yr=new fr(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Yr.softWidth=Math.max(A.width,I.width),Yr.height=K/2,Yr.depth=K/2;const Xi=Jn+K/2;re<ve+vt+Xi&&(re=ve+vt+Xi);const Pn=Jn-K/2;Oe<ve+ur-Pn&&(Oe=ve+ur-Pn),mt=new ws({individualShift:[{box:I,shift:Oe,classes:[...Ke,"ML__center"]},{box:Yr,shift:-Pn,classes:Ke},{box:A,shift:-re,classes:[...Ke,"ML__center"]}]}).wrap(c)}const zt=c.isDisplayStyle?p.delim1:p.delim2,pr=this.leftDelim?this.bind(r,G0("open",this.leftDelim,zt,!0,r,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Dl(c,"open");let Zt=null;this.continuousFraction?Zt=new fr(null,{type:"close"}):this.rightDelim?Zt=this.bind(r,G0("close",this.rightDelim,zt,!0,r,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Zt=Dl(c,"close");const Hr=new fr([pr,mt,Zt],{isTight:c.isTight,type:"inner",classes:"mfrac"}),ni=this.bind(r,Hr);return this.caret&&(ni.caret=this.caret),this.attachSupsub(r,{base:ni})}},Rs=class u1 extends Mt{constructor(r,n){var a;super({type:"latex",value:r,mode:"latex"}),this.isSuggestion=(a=n==null?void 0:n.isSuggestion)!=null?a:!1,this.isError=!1}static fromJson(r){const n=new u1(r.value);return r.isSuggestion&&(n.isSuggestion=!0),r.isError&&(n.isError=!0),n}toJson(){const r={};return this.isSuggestion&&(r.isSuggestion=!0),this.isError&&(r.isError=!0),z({type:"latex",value:this.value},r)}get computedStyle(){return{}}render(r){const n=new fr(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(r,n)):null}},Ll=class c1 extends Mt{constructor(r){super({type:"latexgroup",mode:"latex"}),this.body=[...r].map(n=>new Rs(n)),this.skipBoundary=!1}static fromJson(r){return new c1("")}toJson(){return super.toJson()}render(r){const n=Mt.createBox(r,this.body);return n?(this.caret&&(n.caret=this.caret),this.bind(r,n)):null}_serialize(r){var n,a;return(a=(n=this.body)==null?void 0:n.map(c=>c.value).join(""))!=null?a:""}},Y0=class h1 extends Mt{constructor(r,n){super(d(z({},n),{type:"extensible-symbol",isFunction:n==null?void 0:n.isFunction})),this.value=r,this.variant=n==null?void 0:n.variant,this.subsupPlacement=n==null?void 0:n.limits}static fromJson(r){return new h1(r.symbol,r)}toJson(){const r=super.toJson();return this.variant&&(r.variant=this.variant),this.subsupPlacement&&(r.limits=this.subsupPlacement),this.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),this.value&&(r.symbol=this.value),r}render(r){var n;const a=r.isDisplayStyle&&this.value!=="\\smallint",c=new fr(this.value,{fontFamily:a?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(a?"large-op":"small-op"),type:"op",maxFontSize:r.scalingFactor,isSelected:this.isSelected});if(!c)return null;c.right=c.italic;const p=(c.height-c.depth)/2-Jn*r.scalingFactor,g=c.italic;c.setTop(p);let A=c;if(this.superscript||this.subscript){const T=(n=this.subsupPlacement)!=null?n:"auto";A=T==="over-under"||T==="auto"&&r.isDisplayStyle?this.attachLimits(r,{base:c,baseShift:p,slant:g}):this.attachSupsub(r,{base:c})}return new fr(this.bind(r,A),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(r)}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=Gt(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,r);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(r)),Yi(a)}},jo=class d1 extends Mt{constructor(r){const n=r.body;super(d(z({},r),{type:"overlap",body:typeof n=="string"?[new Mt({value:n})]:n,style:r==null?void 0:r.style})),this.skipBoundary=!0,this.align=r==null?void 0:r.align,this.boxType=r==null?void 0:r.boxType}static fromJson(r){return new d1(r)}toJson(){const r={};return this.align&&(r.align=this.align),this.boxType&&(r.boxType=this.boxType),z(z({},super.toJson()),r)}render(r){const n=Mt.createBox(r,this.body,{classes:"inner"});return n?(this.caret&&(n.caret=this.caret),this.bind(r,new fr([n,new fr(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Ba=class f1 extends Mt{constructor(r){var n,a,c,p;super({type:"overunder",command:r.command,style:r.style,mode:r.mode,body:r.body,skipBoundary:(n=r.skipBoundary)!=null?n:!0}),this.subsupPlacement=r.supsubPlacement,this.svgAbove=r.svgAbove,this.svgBelow=r.svgBelow,this.svgBody=r.svgBody,this.above=r.above,this.below=r.below,this.boxType=(a=r.boxType)!=null?a:"ord",this.paddedBody=(c=r.paddedBody)!=null?c:!1,this.paddedLabels=(p=r.paddedLabels)!=null?p:!1}static fromJson(r){return new f1(r)}toJson(){const r=super.toJson();return this.skipBoundary||(r.skipBoundary=!1),this.subsupPlacement&&(r.subsupPlacement=this.subsupPlacement),this.svgAbove&&(r.svgAbove=this.svgAbove),this.svgBelow&&(r.svgBelow=this.svgBelow),this.svgBody&&(r.svgBody=this.svgBody),this.boxType!=="ord"&&(r.boxType=this.boxType),this.paddedBody&&(r.paddedBody=!0),this.paddedLabels&&(r.paddedLabels=!0),r}render(r){let n=this.svgBody?L0(this.svgBody):Mt.createBox(r,this.body,{type:"ignore"});const a=new ji({parent:r,mathstyle:"scriptstyle"},this.style);let c=null;this.svgAbove?c=L0(this.svgAbove):this.above&&(c=Mt.createBox(a,this.above,{type:"ignore"}));let p=null;this.svgBelow?p=L0(this.svgBelow):this.below&&(p=Mt.createBox(a,this.below,{type:"ignore"})),this.paddedBody&&(n=new fr([Dl(r,"open"),n,Dl(r,"close")],{type:"ignore"}));let g=Rh(r,{base:n,above:c,below:p,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return g?(this.subsupPlacement==="over-under"?g=this.attachLimits(r,{base:g,type:g.type}):g=this.attachSupsub(r,{base:g}),this.caret&&(g.caret=this.caret),this.bind(r,g)):null}};function Rh(e,r){if(!r.base)return null;if(!r.above&&!r.below){const A=new fr(r.base,{type:r.type});return A.setStyle("position","relative"),A}let n=0;r.above&&(n=e.metrics.bigOpSpacing5);let a=null;const c=r.base,p=0,g=["ML__center"];if(r.paddedAboveBelow&&g.push("ML__label_padding"),r.below&&r.above){const A=e.metrics.bigOpSpacing5+r.below.height+r.below.depth+c.depth+p;a=new ws({bottom:A,children:[e.metrics.bigOpSpacing5,{box:r.below,classes:g},{box:c,classes:["ML__center"]},n,{box:r.above,classes:g},e.metrics.bigOpSpacing5]})}else r.below?a=new ws({top:c.height-p,children:[e.metrics.bigOpSpacing5,{box:r.below,classes:g},{box:c,classes:["ML__center"]}]}):r.above&&(a=new ws({bottom:c.depth+p,children:[{box:c,classes:["ML__center"]},n,{box:r.above,classes:g},e.metrics.bigOpSpacing5]}));return new fr(a,{type:r.type})}var Yu=class p1 extends Mt{constructor(r){var n,a,c,p;super(d(z({},r),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(n=r.isInvisible)!=null?n:!1,this.smashDepth=(a=r.smashDepth)!=null?a:!1,this.smashHeight=(c=r.smashHeight)!=null?c:!1,this.smashWidth=(p=r.smashWidth)!=null?p:!1}static fromJson(r){return new p1(r)}toJson(){const r={};return this.isInvisible&&(r.isInvisible=!0),this.smashDepth&&(r.smashDepth=!0),this.smashHeight&&(r.smashHeight=!0),this.smashWidth&&(r.smashWidth=!0),z(z({},super.toJson()),r)}render(r){const n=new ji({parent:r,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Mt.createBox(n,this.body,{classes:"inner"});const a=Mt.createBox(this.isInvisible?n:r,this.body);if(!a)return null;if(this.smashWidth){const c=new fr(null,{classes:"fix"});return new fr([a,c],{classes:"rlap"}).wrap(r)}if(!this.smashHeight&&!this.smashDepth)return a;if(this.smashHeight&&(a.height=0),this.smashDepth&&(a.depth=0),a.children)for(const c of a.children)this.smashHeight&&(c.height=0),this.smashDepth&&(c.depth=0);return new ws({firstBaseline:[{box:a}]},{type:a.type}).wrap(r)}},Il=class m1 extends Mt{constructor(r){var n;super(z({type:"spacing"},r)),this.width=r==null?void 0:r.width,this._braced=(n=r==null?void 0:r.braced)!=null?n:!1}static fromJson(r){return new m1(r)}toJson(){const r=super.toJson();return this.width!==void 0&&(r.width=this.width),this._braced&&(r.braced=!0),r}render(r){var n;if(this.command==="space")return new fr(this.mode==="math"?null:" ");let a;if(this.width!==void 0)a=new fr(null,{classes:"mspace"}),a.left=r.toEm(this.width);else{const c=(n={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?n:"mediumspace";a=new fr(null,{classes:c})}return a=this.bind(r,a),this.caret&&(a.caret=this.caret),a}_serialize(r){var n;if(!r.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const a=Gt(this.command,this.mode);if(a!=null&&a.serialize)return a.serialize(this,r);const c=(n=this.command)!=null?n:"";return this.width===void 0?c:this._braced&&!("register"in this.width)?`${c}{${Is(this.width)}}`:`${c}${Is(this.width)}`}},Nc=class g1 extends Mt{constructor(r){var n;super(d(z({},r),{type:"surd",mode:(n=r.mode)!=null?n:"math",style:r.style,displayContainsHighlight:!0,body:r.body})),this.above=r.index}static fromJson(r){return new g1(d(z({},r),{index:r.above}))}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=Gt(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,r);const a=this.command,c=this.bodyToLatex(r);return this.above&&!this.hasEmptyBranch("above")?Gn(`${a}[${this.aboveToLatex(r)}]`,c):/^[0-9]$/.test(c)?`${a}${c}`:Gn(a,c)}get children(){if(this._children)return this._children;const r=[];if(this.above)for(const n of this.above)r.push(...n.children),r.push(n);if(this.body)for(const n of this.body)r.push(...n.children),r.push(n);return this._children=r,r}render(r){var n;const a=new ji({parent:r,mathstyle:"cramp"},this.style),c=(n=Mt.createBox(a,this.body,{type:"inner"}))!=null?n:new fr(null),p=a.scalingFactor,g=a.metrics.defaultRuleThickness/p,A=r.isDisplayStyle?Sa:g,T=new fr(null,{classes:"ML__sqrt-line",style:this.style});T.height=g,T.softWidth=c.width;let I=p*(g+A/4);const re=Math.max(p*2*A,c.height+c.depth)+I+g,ve=new ji({parent:r},this.style),Oe=this.bind(ve,new fr(G0("inner","\\surd",re,!1,ve,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!Oe)return null;const Ke=Oe.height+Oe.depth-g;Ke>c.height+c.depth+I&&(I=(I+Ke-(c.height+c.depth))/2),Oe.setTop(Oe.height-c.height-I);const vt=this.bind(r,new ws({firstBaseline:[{box:new fr(c)},I-2*g,{box:T},g]})),ur=Mt.createBox(new ji({parent:r,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!ur){const pr=new fr([Oe,vt],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return pr.setStyle("display","inline-block"),pr.setStyle("height",pr.height+pr.depth,"em"),this.caret&&(pr.caret=this.caret),this.bind(r,pr)}const mt=new ws({shift:-.6*(Math.max(Oe.height,vt.height)-Math.max(Oe.depth,vt.depth)),children:[{box:ur}]}),zt=new fr([new fr(mt,{classes:"ML__sqrt-index",type:"ignore"}),Oe,vt],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return zt.height=Oe.height,zt.depth=Oe.depth,this.caret&&(zt.caret=this.caret),this.bind(r,zt)}},Ph=class extends fr{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 X0(e,r){if(!e.parent)return;const n=e.parent.children,a=n.indexOf(e);let c=a-1;for(;c>=0&&n[c].type==="ignore";)c-=1;if(c<0&&e.parent.parent&&e.parent.type==="lift"){X0(e.parent,r);return}a>0&&n[a-1].type==="skip"?n[a-1].width+=r:n.splice(a,0,new Ph(r))}var $c={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}},Oh={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function zc(e){Ju(e,(r,n)=>{n.type==="bin"&&(!r||/^(middle|bin|op|rel|open|punct)$/.test(r.type))&&(n.type="ord"),(r==null?void 0:r.type)==="bin"&&/^(rel|close|punct)$/.test(n.type)&&(r.type="ord"),n.type!=="ignore"&&(r=n)})}function Xu(e,r){if(!e.children)return e;const n=e.children;zc(n);const a=r.getRegisterAsEm("thinmuskip"),c=r.getRegisterAsEm("medmuskip"),p=r.getRegisterAsEm("thickmuskip");return Ju(n,(g,A)=>{var T,I,K;if(!g)return;const re=g.type,ve=A.isTight?(T=Oh[re])!=null?T:null:(I=$c[re])!=null?I:null,Oe=(K=ve==null?void 0:ve[A.type])!=null?K:null;Oe===3&&X0(A,a),Oe===4&&X0(A,c),Oe===5&&X0(A,p)}),e}function Ju(e,r,n=void 0){if(!e)return n;e=[...e];for(const a of e)a.type==="lift"?n=Ju(a.children,r,n):a.type==="ignore"?Ju(a.children,r):(r(n,a),Ju(a.children,r),n=a);return n}var hu=class v1 extends Mt{constructor(r){super({type:"tooltip",command:r.command,mode:r.mode,style:r.style,body:r.body,displayContainsHighlight:!0}),this.tooltip=new Mt({type:"root",mode:r.content,body:r.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(r){return new v1(d(z({},r),{tooltip:ko(r.tooltip)}))}toJson(){var r;const n=(r=this.tooltip.body)==null?void 0:r.filter(a=>a.type!=="first").map(a=>a.toJson());return d(z({},super.toJson()),{tooltip:n})}render(r){const n=Mt.createBox(new ji,this.body);if(!n)return null;const a=new ji({parent:r,mathstyle:"displaystyle"},{fontSize:wo}),c=D0(Xu(new fr(this.tooltip.render(a),{classes:"ML__tooltip-content"}),a)),p=new fr([c,n],{classes:"ML__tooltip-container"});return this.caret&&(p.caret=this.caret),this.bind(r,p)}},Rl=class y1 extends Mt{constructor(r,n){super(d(z({},n),{type:"operator",isFunction:n==null?void 0:n.isFunction})),this.value=r,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(r){return new y1(r.symbol,r)}toJson(){const r=super.toJson();return this.variant&&(r.variant=this.variant),this.variantStyle&&(r.variantStyle=this.variantStyle),this.subsupPlacement&&(r.limits=this.subsupPlacement),this.value&&(r.symbol=this.value),r}render(r){var n;const a=new fr(this.value,{type:"op",mode:"math",maxFontSize:r.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:r.letterShapeStyle});let c=a;if(this.superscript||this.subscript){const p=(n=this.subsupPlacement)!=null?n:"auto";c=p==="over-under"||p==="auto"&&r.isDisplayStyle?this.attachLimits(r,{base:a}):this.attachSupsub(r,{base:a})}return new fr(this.bind(r,c),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(r)}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=Gt(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,r);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(r)),Yi(a)}};function ko(e){if(M(e))return e.map(a=>ko(a));if(typeof e=="string")return Mt.fromJson(e);e=z({},e);for(const a of nu)e[a]&&(e[a]=ko(e[a]));e.args&&(e.args=Bh(e.args)),e.array&&(e.array=ko(e.array));const r=e.type;let n;r==="accent"&&(n=K0.fromJson(e)),r==="array"&&(n=gn.fromJson(e)),r==="box"&&(n=Wo.fromJson(e)),r==="chem"&&(n=Pc.fromJson(e)),r==="composition"&&(n=kh.fromJson(e)),r==="delim"&&(n=Ih.fromJson(e)),r==="enclose"&&(n=Zu.fromJson(e)),r==="error"&&(n=ka.fromJson(e)),r==="extensible-symbol"&&(n=Y0.fromJson(e)),r==="genfrac"&&(n=cu.fromJson(e)),r==="group"&&(n=Ic.fromJson(e)),r==="latex"&&(n=Rs.fromJson(e)),r==="latexgroup"&&(n=Ll.fromJson(e)),r==="leftright"&&(n=Qn.fromJson(e)),r==="macro"&&(n=j0.fromJson(e)),r==="macro-argument"&&(n=Ch.fromJson(e)),r==="operator"&&(n=Rl.fromJson(e)),r==="overlap"&&(n=jo.fromJson(e)),r==="overunder"&&(n=Ba.fromJson(e)),r==="placeholder"&&(n=so.fromJson(e)),r==="prompt"&&(n=Rc.fromJson(e)),r==="phantom"&&(n=Yu.fromJson(e)),r==="sizeddelim"&&(n=Bc.fromJson(e)),r==="spacing"&&(n=Il.fromJson(e)),r==="subsup"&&(n=Ml.fromJson(e)),r==="surd"&&(n=Nc.fromJson(e)),r==="text"&&(n=Hu.fromJson(e)),r==="tooltip"&&(n=hu.fromJson(e)),n||(console.assert(!r||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(r),`MathLive 0.98.5: an unexpected atom type "${r}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),n=Mt.fromJson(e));for(const a of nu)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 Bh(e){if(e&&Array.isArray(e))return e.map(r=>r==="<null>"?null:typeof r=="object"&&"group"in r?{group:r.group.map(n=>ko(n))}:typeof r=="object"&&"atoms"in r?r.atoms.map(n=>ko(n)):r)}var Fh={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"]},J0={"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]$/},Nh=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,Hd=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,Gd=[/^[a-z]$/,/^[A-Z]$/,Nh,Hd],Vd={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},$h=class extends Ea{constructor(){super("math")}createAtom(e,r,n){var a,c,p,g;if(r===null)return new Mt({type:"mord",mode:"math",command:e,value:e,style:n});const A=window.MathfieldElement.isFunction((a=r.command)!=null?a:e);if(r.definitionType==="symbol"){const I=new Mt({type:(c=r.type)!=null?c:"mord",mode:"math",command:(p=r.command)!=null?p:e,value:String.fromCodePoint(r.codepoint),style:n});return A&&(I.isFunction=!0),e.startsWith("\\")&&(I.verbatimLatex=e),I}const T=new Mt({type:"mord",mode:"math",command:(g=r.command)!=null?g:e,value:e,style:n});return A&&(T.isFunction=!0),e.startsWith("\\")&&(T.verbatimLatex=e),T}serialize(e,r){const n=Wd(e,d(z({},r),{defaultMode:"math"}));return n.length===0||r.defaultMode!=="text"?n:["$ ",...n," $"]}getFont(e,r){console.assert(r.variant!==void 0);let{variant:n}=r,{variantStyle:a}=r;n==="normal"&&!a&&/[\u00A3\u0131\u0237]/.test(e.value)&&(n="main",a="italic"),n==="normal"&&!a&&e.value.length===1&&Gd.forEach((A,T)=>{var I;A.test(e.value)&&Vd[(I=r.letterShapeStyle)!=null?I:"tex"][T]==="it"&&(a="italic")}),a==="up"&&(a=void 0);const c=a?n+"-"+a:n;console.assert(Fh[c]!==void 0);const[p,g]=Fh[c];return J0[n]&&!J0[n].test(e.value)?(e.value=at(e.value,n,a),null):(Nh.test(e.value)&&(e.classes+=" lcGreek"),g&&(e.classes+=" "+g),p)}};function Wd(e,r){const{parent:n}=e[0],a=zh(n);return So(e,"variant").map(c=>{const p=zh(c[0]);let g="";p&&p!==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"}[p],console.assert(g!==void 0));const A=Yi(c.map(T=>T._serialize(r)));return g?Gn(g,A):A})}function zh(e){if(!e)return"";const{style:r}=e;if(r.variant===void 0)return"";let n=r.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(r.variant)&&r.variantStyle&&r.variantStyle!=="up"&&(n+="-"+r.variantStyle),n}new $h;function jd(e,r){return e.map(n=>n._serialize(r))}function qd(e,r){return So(e,"fontShape").map(n=>{const a=jd(n,r),{fontShape:c}=n[0].style;let p="";return c==="it"&&(p="\\textit"),c==="sl"&&(p="\\textsl"),c==="sc"&&(p="\\textsc"),c==="n"&&(p="\\textup"),!p&&c?`{${Gn("\\fontshape",c)}${Yi(a)}}`:p?Gn(p,Yi(a)):Yi(a)})}function Zd(e,r){return So(e,"fontSeries").map(n=>{const a=qd(n,r),{fontSeries:c}=n[0].style;let p="";return c==="b"&&(p="\\textbf"),c==="l"&&(p="\\textlf"),c==="m"&&(p="\\textmd"),c&&!p?`{${Gn("\\fontseries",c)}${Yi(a)}}`:p?Gn(p,Yi(a)):Yi(a)})}function Yd(e,r){return So(e,"fontSize").map(n=>{var a,c;const p=Zd(n,r),g=(c=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(a=n[0].style.fontSize)!=null?a:""])!=null?c:"";return g?`${g} ${Yi(p)}`:Yi(p)})}function Kh(e,r,n){return So(e,"fontFamily").map(a=>{var c,p;const g=Yd(a,r),A=(p={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(c=a[0].style.fontFamily)!=null?c:""])!=null?p:"";return A?`\\${A}{${Yi(g)}}`:a[0].style.fontFamily?`{\\fontfamily{${a[0].style.fontFamily}} ${Yi(g)}}`:n?`\\text{${Yi(g)}}`:Yi(g)})}var Uh={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Xd=class extends Ea{constructor(){super("text")}createAtom(e,r,n){return r&&r.definitionType==="symbol"?new Hu(e,String.fromCodePoint(r.codepoint),n!=null?n:{}):null}serialize(e,r){return Kh(e,d(z({},r),{defaultMode:"text"}),r.defaultMode!=="text")}getFont(e,r){var n,a,c,p,g;const{fontFamily:A}=r;if(Uh[A]?e.classes+=" "+Uh[A]:A&&e.setStyle("font-family",A),r.fontShape&&(e.classes+=" ",e.classes+=(n={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[r.fontShape])!=null?n:""),r.fontSeries){const T=r.fontSeries.match(/(.?[lbm])?(.?[cx])?/);T&&(e.classes+=" ",e.classes+=(c={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?c:"",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"}[(p=T[2])!=null?p:""])!=null?g:"")}return"Main-Regular"}};new Xd;var Jd=class extends Ea{constructor(){super("latex")}createAtom(e){return new Rs(e)}serialize(e,r){return e.filter(n=>n instanceof Rs&&!n.isSuggestion).map(n=>n.value)}getFont(){return null}};new Jd;var Qd={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:["","=","","="]}},Qu={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:["","=","","="]}},Hh={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:["\\","|","",""]}},e0={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:[")",")",")",")"]}},ef={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:["=","=","=","="]}},tf={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:["<",">","",""]}},rf={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"]}},nf={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:["=","=","=","="]}},Gh={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:["<",">","|",""]}},Vh={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:[".",".",".","."]}},Q0={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"]}},sf={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:["<",">","",""]}},Kc={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 ec(e){const r=e.split("+"),n={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:r.pop()};return r.includes("shift")&&(n.shift=!0),r.includes("alt")&&(n.alt=!0),r.includes("ctrl")&&(n.ctrl=!0),r.includes("cmd")&&(n.cmd=!0),r.includes("win")&&(n.win=!0),r.includes("meta")&&(n.meta=!0),n}function To(e){let r="";return e.shift&&(r+="shift+"),e.alt&&(r+="alt+"),e.ctrl&&(r+="ctrl+"),e.cmd&&(r+="cmd+"),e.win&&(r+="win+"),e.meta&&(r+="meta+"),r+e.key}var af={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]"},t0=[],r0;function tc(){switch(le()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function ya(e){(!e.platform||e.platform===tc())&&t0.push(e)}function Wh(e,r){var n;const a={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!e)return a;for(const[c,p]of Object.entries(r.mapping)){if(p[0]===e)return a.key=`[${c}]`,a;if(p[1]===e)return a.shift=!0,a.key=`[${c}]`,a;if(p[2]===e)return a.alt=!0,a.key=`[${c}]`,a;if(p[3]===e)return a.shift=!0,a.alt=!0,a.key=`[${c}]`,a}return a.key=(n=af[e])!=null?n:"",a}function of(e){if(e.code)return e;const r=Object.entries(i0().mapping);let n=!1,a=!1,c="";for(let p=0;p<4;p++){for(const[g,A]of r)if(A[p]===e.key){c=g,p===3?(n=!0,a=!0):p===2?n=!0:p===1&&(a=!0);break}if(c)break}return new KeyboardEvent(e.type,d(z({},e),{altKey:n,shiftKey:a,code:c}))}function lf(e){var r,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 c of t0)((r=c.mapping[e.code])==null?void 0:r[a])===e.key?c.score+=1:(n=c.mapping[e.code])!=null&&n[a]&&(c.score=0);t0.sort((c,p)=>p.score-c.score)}function uf(e){r0=t0.find(r=>e.startsWith(r.locale))}function i0(){return r0!=null?r0:t0[0]}function cf(){switch(tc()){case"apple":return Qu;case"windows":return Hh;case"linux":return e0}return Qu}switch(tc()){case"apple":ya(Qu),ya(ef),ya(Q0),ya(nf);break;case"windows":ya(Hh),ya(tf),ya(sf),ya(Gh);break;case"linux":ya(e0),ya(rf),ya(Kc),ya(Vh);break}ya(Qd);function n0(e){var r;const n=/macos|ios/.test(le()),a=e.split("+");let c="";for(const p of a)c&&(c+=n?"\u2009":'<span class="ML__shortcut-join">+</span>'),p.startsWith("[Key")?c+=p.slice(4,5):p.startsWith("Key")?c+=p.slice(3,4):p.startsWith("[Digit")?c+=p.slice(6,7):p.startsWith("Digit")?c+=p.slice(5,6):c+=(r={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"}[p.toLowerCase()])!=null?r:p.toUpperCase();return c}function s0(e){if(e instanceof MouseEvent||e instanceof PointerEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const r=[...e.touches].reduce((a,c)=>({x:a.x+c.clientX,y:a.y+c.clientY}),{x:0,y:0}),n=e.touches.length;return{x:r.x/n,y:r.y/n}}}function Co(e){const r={alt:!1,control:!1,shift:!1,meta:!1};return(e instanceof MouseEvent||e instanceof PointerEvent||e instanceof TouchEvent||e instanceof KeyboardEvent)&&(e.altKey&&(r.alt=!0),e.ctrlKey&&(r.control=!0),e.metaKey&&(r.meta=!0),e.shiftKey&&(r.shift=!0)),r}function hf(e,r){return!e&&r||e&&!r?!1:!e||!r?!0:e.alt===r.alt&&e.control===r.control&&e.shift===r.shift&&e.meta===r.meta}var qo=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 h(e){return e.ctrlKey||e.metaKey||["Dead","Process"].includes(e.key)?!1:e.code===""?!0:qo.has(e.code)}function t(){var e;let r=document.activeElement;for(;(e=r==null?void 0:r.shadowRoot)!=null&&e.activeElement;)r=r.shadowRoot.activeElement;return r}var i=class zl{static get scrim(){return zl._scrim||(zl._scrim=new zl),zl._scrim}static open(r){zl.scrim.open(r)}static close(){zl.scrim.close()}static get state(){return zl.scrim.state}static get element(){return zl.scrim.element}constructor(r){var n,a;this.lightDismiss=(n=r==null?void 0:r.lightDismiss)!=null?n:!0,this.translucent=(a=r==null?void 0:r.translucent)!=null?a:!1,this.state="closed"}get element(){if(this._element)return this._element;const r=document.createElement("div");return r.setAttribute("role","presentation"),r.style.position="fixed",r.style.contain="content",r.style.top="0",r.style.left="0",r.style.right="0",r.style.bottom="0",r.style.zIndex="var(--scrim-zindex, 10099)",r.style.outline="none",this.translucent?(r.style.background="rgba(255, 255, 255, .2)",r.style.backdropFilter="contrast(40%)"):r.style.background="transparent",this._element=r,r}open(r){var n;if(this.state!=="closed")return;this.state="opening",this.onDismiss=r==null?void 0:r.onDismiss,this.savedActiveElement=t();const{element:a}=this;((n=r==null?void 0:r.root)!=null?n:document.body).appendChild(a),a.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const c=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const p=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${p+c}px`,r!=null&&r.child&&a.append(r.child),this.state="open"}close(){var r,n,a,c;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:p}=this;p.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),p.remove(),document.body.style.overflow=(r=this.savedOverflow)!=null?r:"",document.body.style.marginRight=(n=this.savedMarginRight)!=null?n:"",t()!==this.savedActiveElement&&((c=(a=this.savedActiveElement)==null?void 0:a.focus)==null||c.call(a)),p.innerHTML="",this.state="closed"}handleEvent(r){this.lightDismiss&&(r.target===this._element&&r.type==="click"?(this.close(),r.preventDefault(),r.stopPropagation()):r.target===document&&(r.type==="touchmove"||r.type==="scroll")&&(this.close(),r.preventDefault(),r.stopPropagation()))}};function s(e,r,n){let a=null,c=null,p=!1,g=!1,A=!1;const T=new AbortController,I=T.signal;return e.addEventListener("keydown",K=>{if(p||K.key==="Process"||K.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(K.code)){a=null;return}a=K,c=null,n.onKeystroke(K)?e.textContent="":a=null},{capture:!0,signal:I}),e.addEventListener("keypress",K=>{p||(a&&c&&n.onKeystroke(a),c=K)},{capture:!0,signal:I}),e.addEventListener("compositionstart",K=>{e.textContent="",p=!0,n.onCompositionStart(K.data)},{capture:!0,signal:I}),e.addEventListener("compositionupdate",K=>{p&&n.onCompositionUpdate(K.data)},{capture:!0,signal:I}),e.addEventListener("compositionend",K=>{e.textContent="",p&&(p=!1,n.onCompositionEnd(K.data))},{capture:!0,signal:I}),e.addEventListener("beforeinput",K=>K.stopImmediatePropagation(),{signal:I}),e.addEventListener("input",K=>{var re;if(!p&&(e.textContent="",K.inputType!=="insertCompositionText")){if(K.inputType==="insertFromPaste"){K.preventDefault(),K.stopPropagation();return}n.onInput((re=K.data)!=null?re:""),K.preventDefault(),K.stopPropagation()}},{signal:I}),e.addEventListener("paste",K=>{e.focus({preventScroll:!0}),e.textContent="",n.onPaste(K)||K.preventDefault(),K.stopImmediatePropagation()},{signal:I}),e.addEventListener("cut",K=>n.onCut(K),{capture:!0,signal:I}),e.addEventListener("copy",K=>n.onCopy(K),{capture:!0,signal:I}),e.addEventListener("blur",K=>{var re,ve;if(((ve=(re=K.relatedTarget)==null?void 0:re._mathfield)==null?void 0:ve.element)===r){e.focus({preventScroll:!0}),K.preventDefault(),K.stopPropagation();return}const Oe=i.state;if(Oe==="open"||Oe==="opening"){K.preventDefault(),K.stopPropagation();return}if(K.relatedTarget===K.target.getRootNode().host){K.preventDefault(),K.stopPropagation();return}A||g||(A=!0,a=null,c=null,n.onBlur(),A=!1)},{capture:!0,signal:I}),e.addEventListener("focus",K=>{A||g||(g=!0,n.onFocus(),g=!1)},{capture:!0,signal:I}),{dispose:()=>T.abort(),cancelComposition:()=>{p&&(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:()=>t()===e,setAriaLabel:K=>e.setAttribute("aria-label",K),setValue:K=>{var re;e.textContent=K,e.style.left="-1000px",(re=window.getSelection())==null||re.selectAllChildren(e)},moveTo:(K,re)=>{e.style.top=`${re}px`,e.style.left=`${K}px`}}}function o(e){var r;if(!e||!h(e))return"";let n;return e.key==="Unidentified"&&e.target&&(n=e.target.value),n=(r=n!=null?n:e.key)!=null?r:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(n)&&(n=""),n}function l(e){e=of(e);const r=[];return e.ctrlKey&&r.push("ctrl"),e.metaKey&&r.push("meta"),e.altKey&&r.push("alt"),e.shiftKey&&r.push("shift"),r.length===0?`[${e.code}]`:(r.push(`[${e.code}]`),r.join("+"))}function u(e){if(O()){const r=le(),n=e.startsWith("!"),a=e.endsWith(r);if(n&&!a||!n&&a)return!0}return e==="!other"?!1:e==="other"}function f(e,r,n){if(e.length===0)return"";const a=To(ec(l(n))),c=To({key:n.key,shift:n.shiftKey,alt:n.altKey,ctrl:n.ctrlKey,meta:n.metaKey||n.ctrlKey&&/macos|ios/.test(le()),cmd:!1,win:!1});for(let p=e.length-1;p>=0;p--)if((e[p].key===a||e[p].key===c)&&(!e[p].ifMode||e[p].ifMode===r))return e[p].command;return""}function y(e){let r=e;return M(r)&&(r=r.length>0?r[0]+"("+r.slice(1).join("")+")":""),r}function v(e,r){let n=[];if(typeof r=="string"){const p=Dd[r];M(p)?n=p.slice():p&&n.push(p)}const a=y(r),c=new RegExp("^"+a.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const p of e)c.test(y(p.command))&&n.push(p.key);return n.map(n0)}function x(e,r){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&&(r.score===0||!e.ifLayout.includes(r.id)))return;const n=ec(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=le()==="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&&!u(a))return;if(/^\[.+\]$/.test(n.key))return d(z({},e),{key:To(n)});const c=Wh(n.key,r);if(!c)return d(z({},e),{key:To(n)});if(c.shift&&n.shift||c.alt&&n.alt)throw new Error(`The keybinding ${e.key} (${w(e.command)}) is conflicting with the key combination ${To(c)} using the ${r.displayName} keyboard layout`);return c.shift=c.shift||n.shift,c.alt=c.alt||n.alt,c.meta=n.meta,c.ctrl=n.ctrl,d(z({},e),{key:To(c)})}function w(e){if(Array.isArray(e)){const r=[...e];return r.shift()+"("+r.map(n=>typeof n=="string"?`"${n}"`:n.toString()).join(", ")+")"}return e}function k(e,r){const n=[],a=[];for(const c of e)try{const p=x(c,r);if(!p)continue;const g=a.find(A=>A.key===p.key&&A.ifMode===p.ifMode);if(g)throw new Error(`Ambiguous key binding ${c.key} (${w(c.command)}) matches ${g.key} (${w(g.command)}) with the ${r.displayName} keyboard layout`);a.push(p)}catch(p){p instanceof Error&&n.push(p.message)}return[a,n]}var F=class extends Un{constructor(){super("latex")}createAtom(e){return new Rs(e)}onPaste(e,r){if(!r)return!1;const n=typeof r=="string"?r:r.getData("application/x-latex")||r.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"}),ui(e)),e.startRecording(),!0):!1}insert(e,r,n){if(!e.contentWillChange({data:r,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 c=e.silenceNotifications;e.silenceNotifications=!0,n.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ws(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 p=[];for(const T of r)ct.test(T)&&p.push(new Rs(T));let g=e.at(e.position);if(g instanceof Ll&&(g=g.lastChild),!(g.parent instanceof Ll)){const T=new Ll("");g.parent.addChildAfter(T,g),g=T.firstChild}const A=g.parent.addChildrenAfter(p,g);return e.silenceNotifications=c,n.selectionMode==="before"||(n.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(A)):A&&(e.position=e.offsetOf(A))),e.contentDidChange({data:r,inputType:"insertText"}),e.silenceNotifications=a,!0}};function $(e){return e.atoms.find(r=>r.type==="latexgroup")}function Q(e){var r,n;const a=e.atoms.find(c=>c.type==="latexgroup");return a?(n=(r=a.body)==null?void 0:r.filter(c=>c.type==="latex"))!=null?n:[]:[]}function te(e,r){var n;let a=0,c=!1;const p=Number.isFinite(r==null?void 0:r.before)?(n=r==null?void 0:r.before)!=null?n:0:e.lastOffset;for(;a<=p&&!c;){const T=e.at(a);c=T instanceof Rs&&T.isSuggestion,c||a++}if(!c)return[void 0,void 0];let g=a,A=!1;for(;g<=p&&!A;){const T=e.at(g);A=!(T instanceof Rs&&T.isSuggestion),A||g++}return[a-1,g-1]}new F;function xe(e){const r=Q(e.model).filter(n=>n.isSuggestion);if(r.length!==0){e.model.position=e.model.offsetOf(r[0].leftSibling);for(const n of r)n.parent.removeChild(n)}}function ke(e,r){var n;const{model:a}=e;xe(e);for(const K of Q(a))K.isError=!1;if(!a.selectionIsCollapsed||e.options.popoverPolicy==="off"){jt(e);return}const c=[];let p=a.at(a.position);for(;p&&p instanceof Rs&&/^[a-zA-Z\*]$/.test(p.value);)p=p.leftSibling;if(p&&p instanceof Rs&&p.value==="\\")for(c.push(p),p=p.rightSibling;p&&p instanceof Rs&&/^[a-zA-Z\*]$/.test(p.value);)c.push(p),p=p.rightSibling;const g=c.map(K=>K.value).join(""),A=it(e,g);if(A.length===0){if(/^\\[a-zA-Z\*]+$/.test(g))for(const K of c)K.isError=!0;jt(e);return}const T=(n=r==null?void 0:r.atIndex)!=null?n:0;e.suggestionIndex=T<0?A.length-1:T%A.length;const I=A[e.suggestionIndex];if(I!==g){const K=c[c.length-1];K.parent.addChildrenAfter([...I.slice(g.length-I.length)].map(re=>new Rs(re,{isSuggestion:!0})),K),hs(e,{interactive:!0})}St(e,A)}function Le(e){const[r,n]=te(e,{before:e.position});if(r===void 0||n===void 0)return!1;let a=!1;return e.getAtoms([r,n]).forEach(c=>{c.isSuggestion&&(c.isSuggestion=!1,a=!0)}),a}function Ze(e,r="accept",n){var a,c;jt(e);const p=$(e.model);if(!p)return!1;if(r==="accept-suggestion"||r==="accept-all"){const I=Q(e.model).filter(K=>K.isSuggestion);if(I.length!==0){for(const K of I)K.isSuggestion=!1;e.model.position=e.model.offsetOf(I[I.length-1])}if(r==="accept-suggestion")return I.length!==0}const A=Q(e.model).filter(I=>!I.isSuggestion).map(I=>I.value).join(""),T=p.leftSibling;return p.parent.removeChild(p),e.model.position=e.model.offsetOf(T),e.switchMode((a=n==null?void 0:n.mode)!=null?a:"math"),r==="reject"||(Un.insert(e.model,A,{selectionMode:(c=n==null?void 0:n.selectItem)!=null&&c?"item":"placeholder",format:"latex",mode:"math"}),e.snapshot(),e.model.announce("replacement"),e.switchMode("math")),!0}function rt(e){var r;let n=document.getElementById(e);return n?n.dataset.refcount=Number(Number.parseInt((r=n.dataset.refcount)!=null?r:"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 Lt(e){var r;const n=document.getElementById(e);if(!n)return;const a=Number.parseInt((r=n.getAttribute("data-refcount"))!=null?r:"0");a<=1?n.remove():n.dataset.refcount=Number(a-1).toString()}function ot(e,r){const n=new ji({from:e.context}),a=new Mt({mode:"math",type:"root",body:zs(r,{context:n})}),c=D0(Xu(new fr(a.render(n),{classes:"ML__base"}),n));return M0(c,{classes:"ML__latex"}).toMarkup()}function St(e,r){var n;if(r.length===0){jt(e);return}let a="";for(const[p,g]of r.entries()){const A=g,T=ot(e,g),I=v(e.keybindings,A).join("<br>");a+=`<li role="button" data-command="${A}" ${p===e.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${A}</span><span class="ML__popover__command">${T}</span>`,I&&(a+=`<span class="ML__popover__keybinding">${I}</span>`),a+="</li>"}const c=Br(e,`<ul>${a}</ul>`);xt()&&((n=c.querySelector(".ML__popover__current"))==null||n.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var p;c&&!xt()&&(c.classList.add("is-visible"),ht(e),(p=c.querySelector(".ML__popover__current"))==null||p.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function xt(){const e=document.getElementById("mathlive-suggestion-popover");return e?e.classList.contains("is-visible"):!1}function ht(e,r){var n;if(!e.element||e.element.mathfield!==e||!xt())return;if(((n=e.model.at(e.model.position))==null?void 0:n.type)!=="latex"){jt(e);return}if(r!=null&&r.deferred){setTimeout(()=>ht(e),32);return}const a=Vu(e.field);if(!a)return;const c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=window.innerWidth-document.documentElement.clientWidth,A=window.innerHeight-document.documentElement.clientHeight,T=window.mathVirtualKeyboard.boundingRect.height,I=document.getElementById("mathlive-suggestion-popover");a.x+I.offsetWidth/2>p-g?I.style.left=`${p-I.offsetWidth-g}px`:a.x-I.offsetWidth/2<0?I.style.left="0":I.style.left=`${a.x-I.offsetWidth/2}px`;const K=a.y-a.height;c-A-T-a.y<K?(I.classList.add("ML__popover--reverse-direction"),I.classList.remove("top-tip"),I.classList.add("bottom-tip"),I.style.top=`${a.y-a.height-I.offsetHeight-15}px`):(I.classList.remove("ML__popover--reverse-direction"),I.classList.add("top-tip"),I.classList.remove("bottom-tip"),I.style.top=`${a.y+15}px`)}function jt(e){e.suggestionIndex=0;const r=document.getElementById("mathlive-suggestion-popover");r&&(r.classList.remove("is-visible"),r.innerHTML="")}function Br(e,r){let n=document.getElementById("mathlive-suggestion-popover");return n||(n=rt("mathlive-suggestion-popover"),va("suggestion-popover"),va("core"),n.addEventListener("pointerdown",a=>a.preventDefault()),n.addEventListener("click",a=>{let c=a.target;for(;c&&!c.dataset.command;)c=c.parentElement;c&&(Ze(e,"reject"),Un.insert(e.model,c.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),e.dirty=!0,e.focus())})),n.innerHTML=window.MathfieldElement.createHTML(r),n}function ei(){document.getElementById("mathlive-suggestion-popover")&&(Lt("mathlive-suggestion-popover"),no("suggestion-popover"),no("core"))}function vi(){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 r=e[1],n=r.match(/http.*\.ts[\?:]/);return n&&(r=e[2]),n=r.match(/(https?:.*):[0-9]+:[0-9]+/),n||(n=r.match(/at (.*(\.ts))[\?:]/),n||(n=r.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 "${r}").`),"")}var Xr=null,Cr,ii,Gr=((ii=(Cr=globalThis==null?void 0:globalThis.document)==null?void 0:Cr.currentScript)==null?void 0:ii.src)||vi();function li(e){return bu(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(Xr===null)try{const r=yield fetch(Gr,{method:"HEAD"});r.status===200&&(Xr=r.url)}catch(r){console.error(`Invalid URL "${e}" (relative to "${Gr}")`)}return new URL(e,Xr!=null?Xr:Gr).href})}function Li(e,r,n={}){return new FontFace(e,`url(${r}.woff2) format('woff2')`,n)}var _r="not-loaded";function Pr(){return bu(this,null,function*(){return _r="not-loaded",Ui()})}function Ui(){return bu(this,null,function*(){var e;if(_r!=="not-loaded")return;if(_r="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){_r="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))){_r="ready";return}if(!window.MathfieldElement.fontsDirectory){_r="not-loaded";return}const c=yield li(window.MathfieldElement.fontsDirectory);if(!c){document.body.classList.add("ML__fonts-did-not-load"),_r="error";return}const p=[["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=>Li(g[0].replace(/-[a-zA-Z]+$/,""),`${c}/${g[0]}`,g[1]));try{(yield Promise.all(p.map(A=>{try{return A.load()}catch(T){}}))).forEach(A=>document.fonts.add(A)),_r="ready";return}catch(g){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${c}"`,{cause:g}),document.body.classList.add("ML__fonts-did-not-load")}_r="error"}})}function Rn(e){let r=0;for(let n=0;n<e.length;n++)r=r*31+e.charCodeAt(n),r=r|0;return Math.abs(r)}function ui(e,r){e&&(e.dirty||(e.dirty=!0,requestAnimationFrame(()=>{El(e)&&e.dirty&&(e.atomBoundsCache=new Map,hs(e,r),e.atomBoundsCache=void 0)})))}function an(e,r){var n;r=r!=null?r:{};const a=new ji({from:d(z({},e.context),{atomIdsSettings:{seed:r.forHighlighting?Rn(Mt.serialize([e.model.root],{expandMacro:!1,defaultMode:e.options.defaultMode})):"random",groupNumbers:(n=r.forHighlighting)!=null?n:!1},letterShapeStyle:e.options.letterShapeStyle}),mathstyle:e.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),c=e.model.root.render(a);return M0(Xu(c,a),{classes:e.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function js(e,r){const{model:n}=e;n.root.caret=void 0,n.root.isSelected=!1,n.root.containsCaret=!0;for(const c of n.atoms)c.caret=void 0,c.isSelected=!1,c.containsCaret=!1;if(n.selectionIsCollapsed){const c=n.at(n.position);c.caret=e.model.mode;let p=c.parent;for(;p;)p.containsCaret=!0,p=p.parent}else{const c=n.getAtoms(n.selection,{includeChildren:!0});for(const p of c)p.isSelected=!0}return an(e,r).toMarkup()}function hs(e,r){if(!El(e))return;r!=null||(r={});const n=e.element.querySelector("[part=virtual-keyboard-toggle]");n&&(n.style.display=e.hasEditableContent?"":"none");const a=e.field;if(!a)return;const c=e.isSelectionEditable&&e.hasFocus(),p=a.classList.contains("ML__focused");p&&!c?a.classList.remove("ML__focused"):!p&&c&&a.classList.add("ML__focused");let g=js(e,r);const A=e.element.querySelector("[part=menu-toggle]");if(A&&(e.model.atoms.length<=1||e.disabled||e.readOnly&&!e.hasEditableContent||e.userSelect==="none"?A.style.display="none":A.style.display=""),e.model.atoms.length<=1){const T=e.options.contentPlaceholder;T&&(g+=`<span part=placeholder class="ML__content-placeholder">${Ks(T)}</span>`)}a.innerHTML=window.MathfieldElement.createHTML(g),ua(e,r.interactive),e.dirty=!1}function ua(e,r){const n=e.field;if(!n)return;for(const A of n.querySelectorAll(".ML__selection, .ML__contains-highlight"))A.remove();!(r!=null&&r)&&_r!=="error"&&_r!=="ready"&&setTimeout(()=>{_r==="ready"?ua(e):setTimeout(()=>ua(e),128)},32);const a=e.model,c=n.offsetWidth,p=n.getBoundingClientRect().width;let g=Math.floor(p)/c;if(g=isNaN(g)?1:g,a.selectionIsCollapsed){ht(e,{deferred:!0});let A=a.at(a.position);for(;A&&A.type!=="prompt"&&!(A.containsCaret&&A.displayContainsHighlight);)A=A.parent;if(A!=null&&A.containsCaret&&A.displayContainsHighlight){const T=mh(e,Wu(e,A),g);if(T){T.left/=g,T.right/=g,T.top/=g,T.bottom/=g;const I=document.createElement("div");I.classList.add("ML__contains-highlight"),I.style.position="absolute",I.style.left=`${T.left+1}px`,I.style.top=`${Math.ceil(T.top)}px`,I.style.width=`${Math.ceil(T.right-T.left)}px`,I.style.height=`${Math.ceil(T.bottom-T.top)}px`,n.insertBefore(I,n.childNodes[0])}}return}for(const A of ao(Tc(e,{excludeAtomsWithBackground:!0}))){A.left/=g,A.right/=g,A.top/=g,A.bottom/=g;const T=document.createElement("div");T.classList.add("ML__selection"),T.style.position="absolute",T.style.left=`${A.left}px`,T.style.top=`${A.top}px`,T.style.width=`${Math.ceil(A.right-A.left)}px`,T.style.height=`${Math.ceil(A.bottom-A.top-1)}px`,n.insertBefore(T,n.childNodes[0])}}function ao(e){let r=[];for(const n of e){let a=!1;for(const c of r)if(n.left===c.left&&n.right===c.right&&n.top===c.top&&n.bottom===c.bottom){a=!0;break}a||r.push(n)}e=r,r=[];for(const n of e){let a=0;for(const c of e)if(n.left>=c.left&&n.right<=c.right&&n.top>=c.top&&n.bottom<=c.bottom&&(a+=1,a>1))break;a===1&&r.push(n)}return r}var Zo=3,oo;function ta(e,r){r=z({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},r!=null?r:{}),oo||(oo={});for(const n of Object.keys(e))console.assert(!oo[n],"Selector already defined: ",n),oo[n]=d(z({},r),{fn:e[n]})}function a0(e){let r;if(Array.isArray(e)){if(e[0]==="performWithFeedback")return a0(e[1]);r=e[0]}else r=e;return r=r.replace(/-\w/g,n=>n[1].toUpperCase()),oo[r]}function o0(e){var r;return(r=a0(e))==null?void 0:r.target}function _n(e,r){var n;if(!r)return!1;let a,c=[],p=!1,g=!1;M(r)?(a=r[0],c=r.slice(1)):a=r,a=a.replace(/-\w/g,I=>I[1].toUpperCase());const A=oo[a],T=A==null?void 0:A.target;if(T==="model"){if(!e.isSelectionEditable&&(A!=null&&A.changeContent))return e.model.announce("plonk"),!1;/^(delete|add)/.test(a)&&(a!=="deleteBackward"&&e.flushInlineShortcutBuffer(),e.snapshot(a)),/^complete/.test(a)||xe(e),oo[a].fn(e.model,...c),ke(e),g=!0,p=!0}else if(T==="virtual-keyboard")g=(n=window.mathVirtualKeyboard.executeCommand(r))!=null?n:!1,p=!0;else if(oo[a]){if(!e.isSelectionEditable&&(A!=null&&A.changeContent))return e.model.announce("plonk"),!1;/^(undo|redo)/.test(a)&&e.flushInlineShortcutBuffer(),g=oo[a].fn(e,...c),p=!0}else throw new Error(`Unknown command "${a}"`);return T!=="virtual-keyboard"&&(!e.model.selectionIsCollapsed||A!=null&&A.changeSelection&&r!=="deleteBackward")&&(e.flushInlineShortcutBuffer(),A!=null&&A.changeContent||e.stopCoalescingUndo(),e.defaultStyle={}),g&&ui(e),p}function ra(e,r){var n;if(!e)return!1;e.focus(),Op.keypressVibration&&he()&&navigator.vibrate(Zo);const a=a0(r);window.MathfieldElement.playSound((n=a==null?void 0:a.audioFeedback)!=null?n:"keypress");const c=e.executeCommand(r);return e.scrollIntoView(),c}ta({performWithFeedback:(e,r)=>ra(e,r)});function Fa(e){return ke(e,{atIndex:e.suggestionIndex+1}),!1}function Pl(e){return ke(e,{atIndex:e.suggestionIndex-1}),!1}ta({complete:Ze},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),ta({nextSuggestion:Fa,previousSuggestion:Pl},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var ba="mathlive#virtual-keyboard-message";function Yo(e){var r;return e.type!=="message"?!1:((r=e.data)==null?void 0:r.type)===ba}var Ol=class b1{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 b1),this._singleton}set alphabeticLayout(r){this.sendMessage("update-setting",{alphabeticLayout:r})}set layouts(r){this.sendMessage("update-setting",{layouts:r})}get normalizedLayouts(){return[]}set editToolbar(r){this.sendMessage("update-setting",{editToolbar:r})}set actionKeycap(r){this.sendMessage("update-setting",{actionKeycap:r})}set shiftKeycap(r){this.sendMessage("update-setting",{shiftKeycap:r})}set backspaceKeycap(r){this.sendMessage("update-setting",{backspaceKeycap:r})}set tabKeycap(r){this.sendMessage("update-setting",{tabKeycap:r})}set container(r){throw new Error("Container inside an iframe cannot be changed")}show(r){this.sendMessage("show",r)}hide(r){this.sendMessage("hide",r)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(r){r?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(r){return this.sendMessage("execute-command",{command:r}),!0}updateToolbar(r){this.sendMessage("update-toolbar",r)}update(r){this.sendMessage("update-setting",r)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(r,n,a){this.listeners[r]||(this.listeners[r]=new Set),this.listeners[r].has(n)||this.listeners[r].add(n)}dispatchEvent(r){return!this.listeners[r.type]||this.listeners[r.type].size===0?!0:(this.listeners[r.type].forEach(n=>{typeof n=="function"?n(r):n==null||n.handleEvent(r)}),!r.defaultPrevented)}removeEventListener(r,n,a){this.listeners[r]&&this.listeners[r].delete(n)}handleEvent(r){if(Yo(r)){if(!Cc(r.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${r.origin}) cannot be handled`,"SecurityError");this.handleMessage(r.data)}}handleMessage(r){const{action:n}=r;if(n==="execute-command"){const{command:a}=r;o0(a)==="virtual-keyboard"&&this.executeCommand(a);return}if(n==="synchronize-proxy"){this._boundingRect=r.boundingRect,this._isShifted=r.isShifted;return}if(n==="geometry-changed"){this._boundingRect=r.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(r,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(z({type:ba,action:r},n),this.targetOrigin)}},Uc={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]"]]}},Bl={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"}]},du;function fu(e,r){var n,a,c;const p=mu.singleton;if(!p)return;const g=rc(e),A=(a=(n=p.getKeycap(g==null?void 0:g.id))==null?void 0:n.variants)!=null?a:"";if(typeof A=="string"&&!Hc(A)||Array.isArray(A)&&A.length===0){r==null||r();return}const T={};let I="";for(const vt of jh(A)){const ur=Vf(vt),mt=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);T[mt]=ur;const[zt,pr]=qh(ur);I+=`<div id=${mt} class="item ${pr}">${zt}</div>`}const K=document.createElement("div");K.setAttribute("aria-hidden","true"),K.className="MLK__variant-panel",K.style.height="auto";const re=Object.keys(T).length;let ve=5;re===1?ve=1:re===2||re===4?ve=2:re===3||re===5||re===6?ve=3:re>=7&&re<14&&(ve=4),K.style.width=`calc(var(--variant-keycap-length) * ${ve} + 12px)`,K.innerHTML=Op.createHTML(I),i.open({root:(c=p==null?void 0:p.container)==null?void 0:c.querySelector(".ML__keyboard"),child:K}),du=new AbortController;const{signal:Oe}=du,Ke=e==null?void 0:e.getBoundingClientRect();if(Ke){Ke.top-K.clientHeight<0&&(K.style.width="auto",re<=6?K.style.height="56px":re<=12?K.style.height="108px":re<=18?K.style.height="205px":K.classList.add("compact"));const vt=Math.max(0,Math.min(window.innerWidth-K.offsetWidth,(Ke.left+Ke.right-K.offsetWidth)/2)),ur=Ke.top-K.clientHeight+5;K.style.transform=`translate(${vt}px, ${ur}px)`,K.classList.add("is-visible"),requestAnimationFrame(()=>{K.addEventListener("pointerup",mt=>{const zt=rc(mt.target);!(zt!=null&&zt.id)||!T[zt.id]||(ff(T[zt.id]),pu(),r==null||r(),mt.preventDefault())},{capture:!0,passive:!1,signal:Oe}),K.addEventListener("pointerenter",mt=>{const zt=rc(mt.target);!(zt!=null&&zt.id)||!T[zt.id]||zt.classList.add("is-active")},{capture:!0,signal:Oe}),K.addEventListener("pointerleave",mt=>{const zt=rc(mt.target);!(zt!=null&&zt.id)||!T[zt.id]||zt.classList.remove("is-active")},{capture:!0,signal:Oe}),window.addEventListener("pointercancel",()=>{pu(),r==null||r()},{signal:Oe}),window.addEventListener("pointerup",()=>{pu(),r==null||r()},{signal:Oe})})}}function pu(){du==null||du.abort(),du=null,i.state==="open"&&i.close()}function df(e){if(e==="foreground-color"){const r=[];for(const n of Object.keys(Se))r.push({class:"swatch-button",label:'<span style="border: 3px solid '+Se[n]+'"></span>',command:["applyStyle",{color:n}]});return r}if(e==="background-color"){const r=[];for(const n of Object.keys($e))r.push({class:"swatch-button",label:'<span style="background:'+$e[n]+'"></span>',command:["applyStyle",{backgroundColor:n}]});return r}}function Hc(e){return Bl[e]!==void 0}function jh(e){var r;return typeof e!="string"?e:(Bl[e]||(Bl[e]=(r=df(e))!=null?r:[]),Bl[e])}function l0(e){return typeof e=="string"?e:Object.entries(e).map(([r,n])=>`${r}:${n} !important`).join(";")}function S1(e){return Object.keys(e).map(r=>`${r} {${l0(e[r])}}`).join("")}function Gc(e){if(!e)return"";const r=new ji,n=new Mt({mode:"math",type:"root",body:zs(e,{context:r,args:c=>c==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),a=D0(Xu(new fr(n.render(r),{classes:"ML__base"}),r));return M0(a,{classes:"ML__latex"}).toMarkup()}function Vc(e){var r;if(Array.isArray(e))return e.map(a=>Vc(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(c=>Vf(c)))),(r=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,r;let a=window.mathVirtualKeyboard.alphabeticLayout;if(a==="auto"){const A=i0();A&&(a=A.virtualLayout),(!a||a==="auto")&&(a=(e={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[V.locale.slice(0,2)])!=null?e:"qwerty")}const c={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},p=(r=c[a])!=null?r:c.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 A of p){const T=[];for(const I of A)/[a-z]/.test(I)?T.push({label:I,class:"hide-shift",shift:{label:I.toUpperCase()},variants:Hc(I)?I:void 0}):I==="~"?a!=="dvorak"?T.push("[backspace]"):T.push({label:"[backspace]",width:1}):I==="^"?T.push("[shift]"):I===" "&&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:Vc({rows:g})}}function Gf(e){if(e==="alphabetic")return E1();if(typeof e=="string")return console.assert(Uc[e]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${e}"`),Gf(Uc[e]);let r;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 c=e,{rows:p}=c,g=q(c,["rows"]);r=d(z({},g),{layers:Vc({rows:e.rows})})}else if("markup"in e&&typeof e.markup=="string"){const c=e,{markup:p}=c,g=q(c,["markup"]);r=d(z({},g),{layers:Vc(e.markup)})}else r=z({},e),"layers"in e?r.layers=Vc(e.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let n=!1,a=!1;for(const c of r.layers)if(c.rows)for(const p of c.rows.flat()){ic(p)&&(n=!0);const g=p.command;typeof g=="string"&&["undo","redo","cut","copy","paste"].includes(g)&&(a=!0)}return(!("displayShiftedKeycaps"in e)||e.displayShiftedKeycaps===void 0)&&(r.displayShiftedKeycaps=n),(!("displayEditToolbar"in e)||e.displayEditToolbar===void 0)&&(r.displayEditToolbar=!a),r}function A1(e,r){var n,a;let c='<div class="left">';if(e.normalizedLayouts.length>1)for(const[p,g]of e.normalizedLayouts.entries()){const A=g,T=[p===r?"selected":"layer-switch"];A.tooltip&&T.push("MLK__tooltip"),A.labelClass&&T.push(...A.labelClass.split(" ")),c+=`<div class="${T.join(" ")}"`,A.tooltip&&(c+=" data-tooltip='"+((n=H(A.tooltip))!=null?n:A.tooltip)+"' "),p!==r&&(c+=`data-layer="${A.layers[0].id}"`),c+=`>${(a=A.label)!=null?a:"untitled"}</div>`}return c+="</div>",c}function k1(e,r){let n="";if(e.editToolbar==="none")return"";const c=[];r.selectionIsCollapsed?c.push("undo","redo","pasteFromClipboard"):c.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const p={undo:`<div class='action ${r.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${H("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${r.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${H("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${H("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${H("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${H("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return n+=c.map(g=>p[g]).join(""),n}function T1(e){for(const r of e)C1(r)}function C1(e){const r=mu.singleton;if(!r)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=r.registerKeycap(n)}if(!e.innerHTML){const[a,c]=qh(n);e.innerHTML=window.MathfieldElement.createHTML(a)}}function D1(){va("virtual-keyboard"),va("core"),Ui()}function M1(){no("core"),no("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 I1(e){e.resetKeycapRegistry(),D1();const r=document.createElement("div");r.className="ML__keyboard";const n=document.createElement("div");n.className="MLK__plate",n.innerHTML=window.MathfieldElement.createHTML(L1+e.normalizedLayouts.map((g,A)=>R1(e,g,A)).join(""));const a=document.createElement("div");a.className="MLK__backdrop",a.appendChild(n),r.appendChild(a),r.addEventListener("pointerdown",O1,{passive:!1});const c=r.querySelectorAll(".ML__edit-toolbar");if(c)for(const g of c)g.addEventListener("click",A=>{var T,I;let K=A.target,re="";for(;K&&!re;)re=(T=K==null?void 0:K.getAttribute("data-command"))!=null?T:"",K=(I=K==null?void 0:K.parentElement)!=null?I:null;re&&e.executeCommand(JSON.parse(re))});T1(r.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const p=r.querySelectorAll(".MLK__layer");console.assert(p.length>0,"No virtual keyboards available");for(const g of p)g.addEventListener("pointerdown",A=>A.preventDefault());return e.currentLayer=e.latentLayer,r}function R1(e,r,n){const a=[];if(!("layers"in r))return"";for(const c of r.layers)a.push(`<div tabindex="-1" class="MLK__layer" id="${c.id}">`),(e.normalizedLayouts.length>1||r.displayEditToolbar)&&(a.push("<div class='MLK__toolbar' role='toolbar'>"),a.push(A1(e,n)),r.displayEditToolbar&&a.push('<div class="ML__edit-toolbar right"></div>'),a.push("</div>")),a.push(P1(e,c)),a.push("</div>");return a.join("")}function P1(e,r){if(typeof r=="string")return r;let n="";if(typeof r.style=="string"?n+=`<style>${r.style}</style>`:typeof r.style=="object"&&(n+=`<style>${S1(r.style)}</style>`),r.backdrop&&(n+=`<div class='${r.backdrop}'>`),r.container&&(n+=`<div class='${r.container}'>`),r.rows){n+="<div class=MLK__rows>";for(const a of r.rows){n+="<div dir='ltr' class=MLK__row>";for(const c of a)if(c){const p=e.registerKeycap(c),[g,A]=qh(c);/(^|\s)separator/.test(A)?n+=`<div class="${A}"`:n+=`<div tabindex="-1" id="${p}" class="${A}"`,c.tooltip&&(n+=` data-tooltip="${c.tooltip}"`),n+=`>${g}</div>`}n+="</div>"}n+="</div>"}else r.markup&&(n+=r.markup);return r.container&&(n+="</div>"),r.backdrop&&(n+="</div>"),n}function qh(e,r={shifted:!1}){var n,a,c,p,g,A,T;let I="",K=(n=e.class)!=null?n:"";if(r.shifted&&ic(e)&&(K+=" is-active"),r.shifted&&"shift"in e)typeof e.shift=="string"?I=Gc(e.shift):typeof e.shift=="object"&&(I=e.shift.label?e.shift.label:(a=Gc(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?a:""),typeof e.shift=="object"&&(K=(p=(c=e.shift.class)!=null?c:e.class)!=null?p:"");else{if(I=e.label?e.label:(g=Gc(e.latex||e.insert||"")||e.key)!=null?g:"",e.shift){let re;typeof e.shift=="string"?re=Gc(e.shift):e.shift.label?re=e.shift.label:re=(A=Gc(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?A:"",I+=`<span class="MLK__shift">${re}</span>`}e.aside&&(I+=`<aside>${e.aside}</aside>`)}return e.layer&&!/layer-switch/.test(K)&&(K+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(K)||(K+=" MLK__keycap"),!/\bw[0-9]+\b/.test(K)&&e.width&&(K+=(T={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[e.width])!=null?T:""),[I,K||"MLK__keycap"]}var u0={"[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 Vf(e){var r;if(typeof e=="string"){if(e==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(e="[,]"),!u0[e])return{latex:e};e={label:e}}let n;return"label"in e&&e.label&&u0[e.label]&&(n=d(z(z({},u0[e.label]),e),{label:u0[e.label].label})),"key"in e&&e.key&&u0[e.key]&&(n=d(z(z({},u0[e.key]),e),{key:u0[e.key].key})),n?(n.command==="insertDecimalSeparator"&&(n.label=(r=window.MathfieldElement.decimalSeparator)!=null?r:"."),e.label==="[action]"&&(n=z(z({},n),window.mathVirtualKeyboard.actionKeycap)),e.label==="[shift]"&&(n=z(z({},n),window.mathVirtualKeyboard.shiftKeycap)),e.label==="[backspace]"&&(n=z(z({},n),window.mathVirtualKeyboard.backspaceKeycap)),e.label==="[tab]"&&(n=z(z({},n),window.mathVirtualKeyboard.tabKeycap)),n):e}var Wc;function O1(e){var r;if(e.button!==0)return;const n=mu.singleton;if(!n)return;let a=e.target;for(;a&&!a.getAttribute("data-layer");)a=a.parentElement;if(a){n.currentLayer=(r=a.getAttribute("data-layer"))!=null?r:"",e.preventDefault();return}const c=rc(e.target);if(!(c!=null&&c.id))return;const p=n.getKeycap(c.id);if(!p)return;console.assert(e.type==="pointerdown");const g=new AbortController,A=g.signal;c.classList.add("is-pressed"),c.addEventListener("pointerenter",Zh(g),{capture:!0,signal:A}),c.addEventListener("pointerleave",Zh(g),{capture:!0,signal:A}),c.addEventListener("pointercancel",Zh(g),{signal:A}),c.addEventListener("pointerup",Zh(g),{signal:A}),ic(p)&&(c.classList.add("is-active"),n.shiftPressCount++),p.variants&&(Wc&&clearTimeout(Wc),Wc=setTimeout(()=>{c.classList.contains("is-pressed")&&(c.classList.remove("is-pressed"),c.classList.add("is-active"),e.target&&"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId),fu(c,()=>{g.abort(),c==null||c.classList.remove("is-active")}))},300)),e.preventDefault()}function Zh(e){return r=>{const n=rc(r.target);if(!(n!=null&&n.id))return;const a=mu.singleton;if(!a)return;const c=a.getKeycap(n.id);if(c){if(r.type==="pointerenter"&&r.target===n&&r.isPrimary&&n.classList.add("is-pressed"),r.type==="pointercancel"){n.classList.remove("is-pressed"),ic(c)&&(a.shiftPressCount--,n.classList.toggle("is-active",a.isShifted)),e.abort();return}if(r.type==="pointerleave"&&r.target===n){n.classList.remove("is-pressed"),ic(c)&&(a.shiftPressCount--,n.classList.toggle("is-active",a.isShifted));return}if(r.type==="pointerup"){Wc&&clearTimeout(Wc),ic(c)?n.classList.toggle("is-active",a.isShifted):n.classList.contains("is-pressed")&&(n.classList.remove("is-pressed"),a.isShifted&&c.shift?typeof c.shift=="string"?a.executeCommand(["insert",c.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):ff(c.shift):ff(c),a.shiftPressCount===1&&!r.shiftKey&&(a.shiftPressCount=0)),e.abort(),r.preventDefault();return}}}}function ff(e){var r;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}]),(r=mu.singleton)==null||r.executeCommand(n)}function B1(e){if(e.nodeType!==1)return!1;const r=e.classList;return r.contains("MLK__keycap")||r.contains("shift")||r.contains("action")||r.contains("fnbutton")||r.contains("bigfnbutton")}function rc(e){if(!e)return;let r=e;for(;r&&!B1(r);)r=r.parentElement;return r!=null?r:void 0}function ic(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var mu=class _1{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var r,n,a;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(n=(r=window.document)==null?void 0:r.body)!=null?n:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(c=>{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(c){window.addEventListener("message",this)}document.body.addEventListener("focusin",c=>{const p=c.target;p!=null&&p.isConnected&&setTimeout(()=>{const g=Wf();g&&!g.readOnly&&g.mathVirtualKeyboardPolicy==="auto"&&G()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",c=>{c.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{Wf()||this.hide()},300)})}get currentLayer(){var r,n,a;return(a=(n=(r=this._element)==null?void 0:r.querySelector(".MLK__layer.is-visible"))==null?void 0:n.id)!=null?a:""}set currentLayer(r){var n;if(!this._element){this.latentLayer=r;return}let a=r?this._element.querySelector(`#${r}.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(r){var n;this._shiftPressCount=r>2||r<0?0:r,(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(r){const n="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[n]=r,n}getKeycap(r){return r?this.keycapRegistry[r]:void 0}getLayer(r){const n=this.normalizedLayouts;for(const a of n)for(const c of a.layers)if(c.id===r)return c}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(r){this._alphabeticLayout=r,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(r){this._actionKeycap=typeof r=="string"?{label:r}:r}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(r){this._shiftKeycap=typeof r=="string"?{label:r}:r}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(r){this._backspaceKeycap=typeof r=="string"?{label:r}:r}get tabKeycap(){return this._tabKeycap}set tabKeycap(r){this._tabKeycap=typeof r=="string"?{label:r}:r}get layouts(){return this._layouts}set layouts(r){this.updateNormalizedLayouts(r),this.rebuild()}updateNormalizedLayouts(r){const n=Array.isArray(r)?[...r]:[r],a=n.findIndex(c=>c==="default");a>=0&&n.splice(a,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(n),this._normalizedLayouts=n.map(c=>Gf(c))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(r){this._editToolbar=r,this.rebuild()}get container(){return this._container}set container(r){this._container=r,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new _1}catch(r){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(r,n,a){this.listeners[r]||(this.listeners[r]=new Set),this.listeners[r].has(n)||this.listeners[r].add(n)}dispatchEvent(r){return!this.listeners[r.type]||this.listeners[r.type].size===0?!0:(this.listeners[r.type].forEach(n=>{typeof n=="function"?n(r):n==null||n.handleEvent(r)}),!r.defaultPrevented)}removeEventListener(r,n,a){this.listeners[r]&&this.listeners[r].delete(n)}get element(){return this._element}set element(r){var n;this._element!==r&&((n=this._element)==null||n.remove(),this._element=r)}get visible(){return this._visible}set visible(r){r?this.show():this.hide()}get boundingRect(){var r;if(!this._visible)return new DOMRect;const n=(r=this._element)==null?void 0:r.getElementsByClassName("MLK__plate")[0];return n?n.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var r,n;const a=this.boundingRect.height;if(this.container===document.body){(r=this._element)==null||r.style.setProperty("--_keyboard-height",`calc(${a}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const c=a-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${c}px)`:`${c}px`}else(n=this._element)==null||n.style.setProperty("--_keyboard-height",`${a}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const r=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=r,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const r=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(r&&(r.backdrop||r.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 c=this.getKeycap(a.id);if(c){const[p,g]=qh(c,{shifted:this.isShifted});a.innerHTML=window.MathfieldElement.createHTML(p),a.className=g}}}show(r){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 c=this._element.getElementsByClassName("MLK__plate")[0];if(c&&this.observer.observe(c),a===window.document.body){const p=a.style.paddingBottom;this.originalContainerBottomPadding=p;const g=c.offsetHeight-1;a.style.paddingBottom=p?`calc(${p} + ${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,r!=null&&r.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var c;return(c=this._element)==null?void 0:c.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(r){var n;const a=this.container;if(a&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const c=this._element.getElementsByClassName("MLK__plate")[0];c&&this.observer.unobserve(c),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}),pu(),M1(),(n=this._element)==null||n.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(a.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var r,n;return(n=(r=this.element)==null?void 0:r.offsetHeight)!=null?n:0}buildAndAttachElement(){var r;console.assert(!this.element),this.element=I1(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",n=>{n.shiftKey||((n.ctrlKey||n.button===2)&&fu(n.target),n.preventDefault(),n.stopPropagation())},{capture:!0}),(r=this.container)==null||r.appendChild(this.element)}handleEvent(r){if(Yo(r)){if(!Cc(r.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${r.origin}) cannot be handled`,"SecurityError");r.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:r.data.action!=="update-setting"&&r.data.action!=="proxy-created"&&r.data.action!=="execute-command"&&(console.assert(r.source!==void 0),this.connectedMathfieldWindow=r.source),this.handleMessage(r.data,r.source)}if(this._element)switch(r.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":r.button!==2&&r.preventDefault();break;case"keydown":{r.key==="Shift"&&!r.repeat&&(this.shiftPressCount=1);break}case"keyup":{(r.key==="Shift"||!r.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(r,n){const{action:a}=r;if(a==="execute-command"){const{command:c}=r,p=o0(c);if(window.top!==void 0&&p!=="virtual-keyboard")return;this.executeCommand(c);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 r.animate!="undefined"?this.show({animate:r.animate}):this.show();return}if(a==="hide"){typeof r.animate!="undefined"?this.hide({animate:r.animate}):this.hide();return}if(a==="update-setting"){r.alphabeticLayout&&(this.alphabeticLayout=r.alphabeticLayout),r.layouts&&(this.layouts=r.layouts),r.editToolbar&&(this.editToolbar=r.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(r,n,a){if(a||(a=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||a===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:z({type:ba,action:r},n)}));return}if(a)a.postMessage(z({type:ba,action:r},n),{targetOrigin:this.targetOrigin});else if(n.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:n.command})),r==="execute-command"&&Array.isArray(n.command)&&n.command[0]==="insert"){const c=n.command[1].split("");for(const p of c)this.dispatchEvent(new KeyboardEvent("keydown",{key:p,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:p,bubbles:!0}))}}stateWillChange(r){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:r},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(r){const n=this._element;if(!n)return;n.classList.toggle("is-math-mode",r.mode==="math"),n.classList.toggle("is-text-mode",r.mode==="text"),n.classList.toggle("can-undo",r.canUndo),n.classList.toggle("can-redo",r.canRedo),n.classList.toggle("can-copy",!r.selectionIsCollapsed),n.classList.toggle("can-copy",!r.selectionIsCollapsed),n.classList.toggle("can-paste",!0);const a=n.querySelectorAll(".ML__edit-toolbar");if(a)for(const c of a)c.innerHTML=k1(this,r)}update(r){this._style=r.style,this.updateToolbar(r)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(r){let n,a=[],c=o0(r);return M(r)?(n=r[0],n==="performWithFeedback"&&(r=r.slice(1),c=o0(r)),a=r.slice(1)):n=r,n=n.replace(/-\w/g,p=>p[1].toUpperCase()),c==="virtual-keyboard"?oo[n].fn(void 0,...a):(this.sendMessage("execute-command",{command:r}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function Wf(){var e,r;let n=t(),a=null;for(;n;){if("host"in n&&((r=(e=n.host)==null?void 0:e.tagName)==null?void 0:r.toLowerCase())==="math-field"){a=n.host;break}n=n.parentNode}return a}if(O()&&!("mathVirtualKeyboard"in window))if(window===window.top){const e=mu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>Ol.singleton,configurable:!0});function Yh(e){const r={};for(const n of Object.keys(e))switch(n){case"scriptDepth":const a=e.scriptDepth;if(M(a))r.scriptDepth=[a[0],a[1]];else if(typeof a=="number")r.scriptDepth=[a,a];else if(typeof a=="string"){const[p,g]=a.split(",").map(A=>parseInt(A.trim()));r.scriptDepth=[p,g]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let c=e.mathVirtualKeyboardPolicy.toLowerCase();if(c==="sandboxed"){if(window!==window.top){const p=mu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>p})}c="manual"}r.mathVirtualKeyboardPolicy=c;break;case"letterShapeStyle":e.letterShapeStyle==="auto"?V.locale.startsWith("fr")?r.letterShapeStyle="french":r.letterShapeStyle="tex":r.letterShapeStyle=e.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(e.defaultMode)?r.defaultMode=e.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),r.defaultMode="math");break;case"macros":r.macros=qt(e.macros);break;default:M(e[n])?r[n]=[...e[n]]:typeof e[n]=="object"&&!(e[n]instanceof Element)&&n!=="computeEngine"?r[n]=z({},e[n]):r[n]=e[n]}return r}function c0(e,r){let n;typeof r=="string"?n=[r]:r===void 0?n=Object.keys(e):n=r;const a={};for(const c of n)e[c]===null?a[c]=null:M(e[c])?a[c]=[...e[c]]:typeof e[c]=="object"&&!(e[c]instanceof Element)&&c!=="computeEngine"?a[c]=z({},e[c]):a[c]=e[c];return typeof r=="string"?a[r]:a}function Xh(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Xe,backgroundColorMap:$t,letterShapeStyle:V.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:Cd,inlineShortcuts:Ad,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:Td,value:""}}function jf(e){return e.defaultMode==="inline-math"?"math":e.defaultMode}function gu(e,r){!e||!r||(M(e)?e.forEach(n=>gu(n,r)):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(r),gu(e.body,r),gu(e.above,r),gu(e.below,r),gu(e.subscript,r),gu(e.superscript,r)))}function pf(e,r,n,a){function c(g,A){for(const T of p)if(T.style[g]!==A)return!1;return!0}if(r=e.normalizeRange(r),r[0]===r[1])return!1;const p=e.getAtoms(r,{includeChildren:!0});a.operation==="toggle"&&(n.color&&c("color",n.color)&&(n.color="none",delete n.verbatimColor),n.backgroundColor&&c("backgroundColor",n.backgroundColor)&&(n.backgroundColor="none",delete n.verbatimBackgroundColor),n.fontFamily&&c("fontFamily",n.fontFamily)&&(n.fontFamily="none"),n.fontSeries&&c("fontSeries",n.fontSeries)&&(n.fontSeries="auto"),n.fontShape&&c("fontShape",n.fontShape)&&(n.fontShape="auto"),n.fontSize&&c("fontSize",n.fontSize)&&(n.fontSize=wo),n.variant&&c("variant",n.variant)&&(n.variant="normal"),n.variantStyle&&c("variantStyle",n.variantStyle)&&(n.variantStyle=""));for(const g of p)g.applyStyle(n);return!0}function F1(e,r){const n=e.at(e.position);if(n.type==="composition")n.value=r;else{const{caret:a}=n;n.caret=void 0;const c=new kh(r,{mode:n.mode});c.caret=a,n.parent.addChildAfter(c,n),e.position+=1}}function N1(e){const r=e.at(e.position);r.type==="composition"&&(r.parent.removeChild(r),e.position-=1)}nr(["math","displaymath"],lo),nr("center",lo),Ve("displaylines","",{parse:e=>{const r=[];let n=[];e.beginContext({tabular:!0});do{if(e.end()||e.match("<}>"))break;e.matchColumnSeparator()||e.matchRowSeparator()?(r.push([n]),n=[]):n.push(...e.scan(a=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(a)))}while(!0);return e.endContext(),r.push([n]),r},createAtom:e=>new gn("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Pt("array","{columns:colspec}",(e,r,n,a)=>new gn(e,mf(r),n,{columns:a[0],mathstyleName:"textstyle"})),Pt(["equation","equation*","subequations"],"",(e,r,n)=>new gn(e,mf(r),n,{columns:[{align:"c"}]})),Pt(["multline","multline*"],"",lo),Pt(["align","align*","aligned","eqnarray"],"",lo),Pt("split","",lo),Pt(["gather","gathered"],"",lo),Pt(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",lo),Pt(["smallmatrix","smallmatrix*"],"[columns:colspec]",lo),Pt(["cases","dcases","rcases"],"",lo);function $1(e){for(const r of e)for(const n of r)if(n.length>0)return!1;return!0}function mf(e,r=1){return $1(e)?Array(r).fill([[new Mt({type:"first"}),new so]]):e.map(n=>n.length===0?[[new Mt({type:"first"})]]:n.map(a=>a.length===0?[new Mt({type:"first"})]:(a[0].type!=="first"&&a.unshift(new Mt({type:"first"})),a)))}function lo(e,r=[[[]]],n=[],a=[]){switch(r=mf(r,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":return new gn(e,r,n,{mathstyleName:"textstyle"});case"displaymath":return new gn(e,r,n,{mathstyleName:"textstyle"});case"center":return new gn(e,r,n,{columns:[{align:"c"}]});case"multline":case"multline*":return new gn(e,r,n,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new gn(e,r,n,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new gn(e,r,n,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new gn(e,r,n,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:h0(a[0])});case"bmatrix":case"bmatrix*":return new gn(e,r,n,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:h0(a[0])});case"Bmatrix":case"Bmatrix*":return new gn(e,r,n,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:h0(a[0])});case"vmatrix":case"vmatrix*":return new gn(e,r,n,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:h0(a[0])});case"Vmatrix":case"Vmatrix*":return new gn(e,r,n,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:h0(a[0])});case"matrix":case"matrix*":return new gn(e,r,n,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:h0(a==null?void 0:a[0])});case"smallmatrix":case"smallmatrix*":return new gn(e,r,n,{mathstyleName:"scriptstyle",columns:h0(a==null?void 0:a[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new gn(e,r,n,{mathstyleName:e==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new gn(e,r,n,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new gn(e,r,n,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let c=0;for(const A of r)c=Math.max(c,A.length);const p=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let g=2;for(;g<c;)p.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),g+=2;return p.push({gap:0}),new gn(e,r,n,{arraycolsep:0,columns:p,minColumns:2})}}return new gn(e,r,n,{mathstyleName:"textstyle"})}function h0(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,r){let n=e.at(e.position);for(;n&&!(n.parent instanceof gn);)n=n.parent;if(n&&n.type==="array"&&n.environmentName,!n||!(n.parent instanceof gn)){const a=e.at(e.position);if(n=a,!n.parent.parent){let c=e.extractAtoms([e.position,e.lastOffset]),p=e.extractAtoms([0,e.position]);p.length===0&&(p=ed()),c.length===0&&(c=ed());let g;return r.endsWith("column")?(g=lo("split",[[p,c]]),e.root=g,d0(g,0,0)?f0(e,g,0,0):d0(g,0,1)?f0(e,g,0,1):e.position=e.offsetOf(a)):(g=lo("lines",[[p],[c]]),e.root=g,d0(g,0,0)?f0(e,g,0,0):d0(g,1,0)?f0(e,g,1,0):e.position=e.offsetOf(a)),[void 0,[0,0]]}if(n.parent instanceof Qn){const c=n.parent;let p=e.extractAtoms([e.position,e.offsetOf(c.lastChild)]),g=e.extractAtoms([e.offsetOf(c.firstChild),e.position]);g.length===0&&(g=ed()),p.length===0&&(p=ed());let A="pmatrix";const T=c.leftDelim,I=c.rightDelim;T==="("&&(I===")"||I==="?")?A="pmatrix":(T==="["||T==="\\lbrack")&&(I==="]"||I==="\\rbrack"||I==="?")?A="bmatrix":T==="\\vert"&&I==="\\vert"?A="vmatrix":T==="\\Vert"&&I==="\\Vert"?A="Vmatrix":(T==="{"||T==="\\lbrace")&&(I==="."||I==="?")&&(A="cases");const K=lo(A,r.endsWith("column")?[[g,p]]:[[g],[p]]);return c.parent.addChildBefore(K,c),c.parent.removeChild(c),d0(K,0,0)?f0(e,K,0,0):r.endsWith("column")?d0(K,0,1)?f0(e,K,0,1):e.position=e.offsetOf(n):d0(K,1,0)?f0(e,K,1,0):e.position=e.offsetOf(n),[void 0,[0,0]]}}return n&&n.parent instanceof gn?[n.parent,n.parentBranch]:[void 0,[0,0]]}function d0(e,r,n){const a=e.getCell(r,n);return!a||a.length!==2?!1:a[1].type==="placeholder"}function K1(e,r,n,a){const c=r.getCell(n,a);return c?[e.offsetOf(c[0]),e.offsetOf(c[c.length-1])]:-1}function f0(e,r,n,a){const c=K1(e,r,n,a);typeof c!="number"&&e.setSelection(c)}function Jh(e,r,n,a,c){const p=r.getCell(n,a);p&&e.setPositionHandlingPlaceholder(e.offsetOf(p[c==="start"?0:p.length-1]))}function Qh(e,r){const[n,[a,c]]=z1(e,r);if(n)switch(r){case"after row":n.addRowAfter(a),Jh(e,n,a+1,0,"end");break;case"after column":if(n.maxColumns<=n.colCount){e.announce("plonk");return}n.addColumnAfter(c),Jh(e,n,a,c+1,"end");break;case"before row":n.addRowBefore(a),Jh(e,n,a,0,"start");break;case"before column":if(n.maxColumns<=n.colCount){e.announce("plonk");return}n.addColumnBefore(c),Jh(e,n,a,c,"start");break}}function qf(e){return e.contentWillChange({inputType:"insertText"})?(Qh(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function U1(e){return e.contentWillChange({inputType:"insertText"})?(Qh(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Zf(e){return e.contentWillChange({inputType:"insertText"})?(Qh(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function H1(e){return e.contentWillChange({inputType:"insertText"})?(Qh(e,"before column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Yf(e,r){if(!e.contentWillChange({}))return!1;e.mathfield.snapshot();let n=".",a=".";switch(r){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 c=e.at(e.position),p=c.type==="array"?c:e.parentEnvironment;return p.environmentName=r,p.leftDelim=n,p.rightDelim=a,e.contentDidChange({}),!0}function Xf(e,r){let n=e.at(e.position);for(;n&&!(Array.isArray(n.parentBranch)&&n.parent instanceof gn);)n=n.parent;if(Array.isArray(n==null?void 0:n.parentBranch)&&(n==null?void 0:n.parent)instanceof gn){const a=n.parent,c=n.parentBranch;let p;switch(r){case"row":if(a.rowCount>1){a.removeRow(c[0]);const g=a.getCell(Math.max(0,c[0]-1),c[1]);p=e.offsetOf(g[g.length-1])}break;case"column":if(a.colCount>a.minColumns){a.removeColumn(c[1]);const g=a.getCell(c[0],Math.max(0,c[1]-1));p=e.offsetOf(g[g.length-1])}break}p&&e.setPositionHandlingPlaceholder(p)}}function G1(e){return e.contentWillChange({inputType:"deleteContent"})?(Xf(e,"row"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}function V1(e){return e.contentWillChange({inputType:"deleteContent"})?(Xf(e,"column"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}ta({addRowAfter:qf,addColumnAfter:Zf,addRowBefore:U1,addColumnBefore:H1,removeRow:G1,removeColumn:V1,setEnvironment:Yf},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function ed(){return[new so]}var Jf=class x1{constructor(r){this.recording=!1,this.model=r,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(r){r&&this.index>=0&&(this.stack[this.index].selection=r),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(r){return this.recording?(r&&r===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>x1.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=r!=null?r:"",!0):!1}};Jf.maximumDepth=1e3;var W1=Jf;function gf(e,r,n){if(e.at(r).mode!=="text")return r;const a=n==="backward"?-1:1;let c;if(wt.test(e.at(r).value)){let p=r,g;do g=e.at(p).mode==="text"&&wt.test(e.at(p).value),p+=a;while(e.at(p)&&g);c=e.at(p)?p-2*a:p-a}else if(/\s/.test(e.at(r).value)){let p=r;for(;e.at(p)&&e.at(p).mode==="text"&&/\s/.test(e.at(p).value);)p+=a;if(!e.at(p))c=p-a;else{let g=!0;do g=e.at(p).mode==="text"&&!/\s/.test(e.at(p).value),p+=a;while(e.at(p)&&g);c=e.at(p)?p-2*a:p-a}}else{let p=r;for(;e.at(p)&&e.at(p).mode==="text"&&!/\s/.test(e.at(p).value);)p+=a;c=e.at(p)?p:p-a;let g=!0;for(;e.at(p)&&g;)g=e.at(p).mode==="text"&&/\s/.test(e.at(p).value),g&&(c=p),p+=a;c=e.at(p)?p-2*a:p-a}return c-(a>0?0:1)}function nc(e,r,n){var a,c,p,g,A,T,I;const K=e.position;(a=n==null?void 0:n.extend)!=null&&a||e.collapseSelection(r);let re=e.at(e.position);if(r==="forward"&&(re.type==="subsup"?(re=re.rightSibling,re||(re=e.at(e.position+1))):re=e.at(e.position+1)),!re)return e.announce("plonk"),!1;let ve=e.offsetOf(re);if(re instanceof Hu)ve=gf(e,ve,r);else if(re instanceof Rs)if(re.isSuggestion)for(console.assert(r==="forward");re&&re instanceof Rs;)re.isSuggestion=!1,ve=e.offsetOf(re),re=re.rightSibling;else if(r==="forward"){if(re=re.rightSibling,!re||!(re instanceof Rs))return e.announce("plonk"),!1;for(;re&&re instanceof Rs&&/[a-zA-Z\*]/.test(re.value);)ve=e.offsetOf(re),re=re.rightSibling}else{if(re=re.leftSibling,!re||!(re instanceof Rs))return e.announce("plonk"),!1;for(;re&&re instanceof Rs&&/[a-zA-Z\*]/.test(re.value);)ve=e.offsetOf(re),re=re.leftSibling}else if(r==="forward"&&re.type==="mopen"){let Oe=0;do re.type==="mopen"?Oe+=1:re.type==="mclose"&&(Oe-=1),re=re.rightSibling;while(!re.isLastSibling&&Oe!==0);ve=e.offsetOf(re.leftSibling)}else if(r==="backward"&&re.type==="mclose"){let Oe=0;do re.type==="mopen"?Oe+=1:re.type==="mclose"&&(Oe-=1),re=re.leftSibling;while(!re.isFirstSibling&&Oe!==0);ve=e.offsetOf(re)}else if(r==="backward")if(re.type==="first")for(;ve>0&&re.type==="first";)ve-=1,re=e.at(ve);else{const Oe=re.type;re.type==="subsup"&&(ve=e.offsetOf(e.at(ve).leftSibling)),ve-=1;let Ke=(c=e.at(ve))==null?void 0:c.type;for(;ve>=0&&Ke===Oe;)((p=e.at(ve))==null?void 0:p.type)==="subsup"?ve=e.offsetOf(e.at(ve).leftSibling):ve-=1,Ke=e.at(ve).type}else{const{type:Oe}=re;let Ke=(g=e.at(ve))==null?void 0:g.type;const{lastOffset:vt}=e;for(;ve<=vt&&(Ke===Oe||Ke==="subsup");){for(;((A=e.at(ve).rightSibling)==null?void 0:A.type)==="subsup";)ve=e.offsetOf(e.at(ve).rightSibling);ve+=1,Ke=(T=e.at(ve))==null?void 0:T.type}ve-=1}if((I=n==null?void 0:n.extend)!=null&&I){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",K),e.mathfield.stopCoalescingUndo(),!0}function Xo(e,r,n){var a,c;if(n=n!=null?n:{extend:!1},e.mathfield.adoptStyle=r==="backward"?"right":"left",r!=="forward"){const[A,T]=te(e);A!==void 0&&T!==void 0&&e.deleteAtoms([A,T])}if(r==="upward")return q1(e,n);if(r==="downward")return Z1(e,n);if(n.extend){let A=td(e,e.position,r);A<0&&(A=0),A>e.lastOffset&&(A=e.lastOffset);const T=e.setSelection(e.anchor,A);return e.mathfield.stopCoalescingUndo(),T}if(e.selectionIsPlaceholder){e.collapseSelection(r);const A=Xo(e,r);return e.mathfield.stopCoalescingUndo(),A}let p=e.position;const g=p;if(e.collapseSelection(r)?(p=e.position,Qf(e,p)||(p=td(e,p,r))):p=td(e,p,r),p<0||p>e.lastOffset){let A=!0;return e.silenceNotifications||(A=(c=(a=e.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("move-out",{detail:{direction:r},cancelable:!0,bubbles:!0,composed:!0})))!=null?c:!0),A&&e.announce("plonk"),A}return e.setPositionHandlingPlaceholder(p),e.mathfield.stopCoalescingUndo(),e.announce("move",g),!0}function td(e,r,n){return r=r+(n==="forward"?1:-1),r<0||r>e.lastOffset||Qf(e,r)?r:td(e,r,n)}function Qf(e,r){var n;const a=e.at(r);let c=a.parent;for(;c&&!c.inCaptureSelection;)c=c.parent;return!(c!=null&&c.inCaptureSelection||(n=a.parent)!=null&&n.skipBoundary&&(!a.isFirstSibling&&a.isLastSibling||a.type==="first")||e.mathfield.hasEditablePrompts&&!a.parentPrompt)}function j1(e,r,n){let a=1/0,c=0;for(;c<r.length;c++){const p=vh(e.getHTMLElement(r[c])).right,g=Math.abs(n-p);if(g<=a)a=g;else break}return r[c-1]}function rd(e,r,n,a,c){const p=e.mathfield.hasEditablePrompts,g=p?n.filter(I=>I.type==="prompt"&&!I.captureSelection):n,A=vh(e.mathfield.getHTMLElement(r)).right,T=e.offsetOf(j1(e.mathfield,g,A))-(p?1:0);if(a){const[I,K]=e.selection.ranges[0];let re;T<(c==="up"?I:K)?re={ranges:[[T,K]],direction:"backward"}:re={ranges:[[I,T]],direction:"forward"},e.setSelection(re)}else e.setPositionHandlingPlaceholder(T);e.announce(`move ${c}`)}function q1(e,r){var n,a;const c=(n=r==null?void 0:r.extend)!=null?n:!1;c||e.collapseSelection("backward");const p=()=>{var T,I;let K=!0;return e.silenceNotifications||(K=(I=(T=e.mathfield.host)==null?void 0:T.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?I:!0),e.announce(K?"plonk":"line"),K},g=e.at(e.position);let A=g;for(;A&&A.parentBranch!=="below"&&!(Array.isArray(A.parentBranch)&&A.parent instanceof gn);)A=A.parent;if(Array.isArray(A==null?void 0:A.parentBranch)&&A.parent instanceof gn){const T=A.parent;if(A.parentBranch[0]<1)return p();const I=A.parentBranch[0]-1,K=T.array[I][A.parentBranch[1]];if(!K.some(ve=>ve.type==="prompt"&&!ve.captureSelection)&&e.mathfield.hasEditablePrompts)return p();rd(e,g,K,c,"up")}else if(A){const T=(a=A.parent.branch("above"))!=null?a:A.parent.createBranch("above");if(!T.some(K=>K.type==="prompt"&&K.placeholderId)&&e.mathfield.hasEditablePrompts)return p();rd(e,g,T,c,"up")}else return p();return e.mathfield.stopCoalescingUndo(),!0}function Z1(e,r){var n,a;const c=(n=r==null?void 0:r.extend)!=null?n:!1;c||e.collapseSelection("forward");const p=()=>{var T,I;let K=!0;return e.silenceNotifications||(K=(I=(T=e.mathfield.host)==null?void 0:T.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?I:!0),e.announce(K?"plonk":"line"),K},g=e.at(e.position);let A=g;for(;A&&A.parentBranch!=="above"&&!(Array.isArray(A.parentBranch)&&A.parent instanceof gn);)A=A.parent;if(Array.isArray(A==null?void 0:A.parentBranch)&&A.parent instanceof gn){const T=A.parent;if(A.parentBranch[0]+1>T.array.length-1)return p();const I=A.parentBranch[0]+1,K=T.array[I][A.parentBranch[1]];if(!K.some(ve=>ve.type==="prompt"&&!ve.captureSelection)&&e.mathfield.hasEditablePrompts)return p();rd(e,g,K,c,"down")}else if(A){const T=(a=A.parent.branch("below"))!=null?a:A.parent.createBranch("below");if(!T.some(K=>K.type==="prompt")&&e.mathfield.hasEditablePrompts)return p();rd(e,g,T,c,"down")}else return p();return!0}function ep(e){const r=e.position,n=e.at(r).parent;return n!=null&&n.parent?(e.position=e.offsetOf(n),e.mathfield.stopCoalescingUndo(),e.announce("move",r),!0):(e.announce("plonk"),!1)}function Y1(e){let r=0,n=e.at(e.position),a=!1;for(;n;)(!n.hasEmptyBranch("superscript")||!n.hasEmptyBranch("subscript"))&&(r+=1),n.hasEmptyBranch("superscript")?n.hasEmptyBranch("subscript")||(a=!1):a=!0,n=n.parent;return a?r:0}function X1(e){let r=0,n=e.at(e.position),a=!1;for(;n;)(!n.hasEmptyBranch("superscript")||!n.hasEmptyBranch("subscript"))&&(r+=1),n.hasEmptyBranch("superscript")?n.hasEmptyBranch("subscript")||(a=!0):a=!1,n=n.parent;return a?r:0}function tp(e){var r;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&&(((r=n.rightSibling)==null?void 0:r.type)!=="subsup"&&n.parent.addChildAfter(new Ml({style:n.computedStyle}),n),n=n.rightSibling),n.createBranch("superscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(n.superscript[0]))),!0}function rp(e){var r;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&&(((r=e.at(e.position+1))==null?void 0:r.type)!=="subsup"&&n.parent.addChildAfter(new Ml({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 I=[],K=[];return[...T.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(r).forEach((ve,Oe)=>{const Ke=a(ve);Ke===0?I.push(ve):K.push({documentOrder:Oe,tabIndex:Ke,node:ve})}),K.sort((ve,Oe)=>ve.tabIndex===Oe.tabIndex?ve.documentOrder-Oe.documentOrder:ve.tabIndex-Oe.tabIndex).map(ve=>ve.node).concat(I)}function r(T){return!(!n(T)||c(T)||a(T)<0)}function n(T){return!(T.disabled||T.type==="hidden"&&T.tagName.toUpperCase()==="INPUT"||A(T))}function a(T){var I;const K=Number.parseInt((I=T.getAttribute("tabindex"))!=null?I:"NaN",10);return Number.isNaN(K)?T.contentEditable==="true"||(T.nodeName==="AUDIO"||T.nodeName==="VIDEO")&&T.getAttribute("tabindex")===null?0:T.tabIndex:K}function c(T){return T.tagName.toUpperCase()==="INPUT"&&T.type==="radio"&&!g(T)}function p(T,I){for(const K of T)if(K.checked&&K.form===I)return K;return null}function g(T){var I;if(!T.name)return!0;const re=((I=T.form)!=null?I:T.ownerDocument).querySelectorAll('input[type="radio"][name="'+T.name+'"]'),ve=p(re,T.form);return!ve||ve===T}function A(T){if(!O()||T===document.activeElement||T.contains(document.activeElement))return!1;if(getComputedStyle(T).visibility==="hidden")return!0;const I=T.getBoundingClientRect();if(I.width===0||I.height===0)return!0;for(;T;){if(getComputedStyle(T).display==="none")return!0;T=T.parentElement}return!1}return O()?e(document.body):[]}function _a(e,r,n="forward"){const a=e.position;if(Array.isArray(r)){const c=e.offsetOf(r[0]),p=e.offsetOf(r[r.length-1]);return n==="forward"?e.setSelection(c,p):e.setSelection(p,c),e.announce("move",a),e.mathfield.stopCoalescingUndo(),!0}return n==="forward"?_a(e,[r.leftSibling,r]):_a(e,[r,r.leftSibling])}function Do(e,r){const n=e.position;if(typeof r=="number"&&(r=e.at(r)),r.type==="prompt")e.setSelection(e.offsetOf(r.firstChild),e.offsetOf(r.lastChild));else{const a=e.offsetOf(r);r.type==="placeholder"?e.setSelection(a-1,a):e.position=a}return e.announce("move",n),e.mathfield.stopCoalescingUndo(),!0}function id(e,r,n=!0){var a,c;const p=r==="forward"?1:-1;e.at(e.anchor).type==="placeholder"&&Xo(e,r);let g;const A=e.at(e.anchor).parentPrompt;A?r==="forward"?g=e.offsetOf(A)+1:g=e.offsetOf(A.leftSibling):g=Math.max(e.position+p,0);const T=vf(e,g,r);if(!T||r==="forward"&&e.offsetOf(T)<g||r==="backward"&&e.offsetOf(T)>g){if(!n||!((c=(a=e.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("move-out",{detail:{direction:r},cancelable:!0,bubbles:!0,composed:!0})))==null||c))return e.announce("plonk"),!1;const K=J1();if(!document.activeElement||K.length<=1)return e.announce("plonk"),!1;let re=K.indexOf(document.activeElement)+p;return re<0&&(re=K.length-1),re>=K.length&&(re=0),K[re].focus(),e.mathfield.stopCoalescingUndo(),!0}return Do(e,T),!0}function vf(e,r=0,n="forward"){return e.findAtom(a=>a.type==="placeholder"||a.type==="prompt"||!e.mathfield.readOnly&&a.treeDepth>2&&a.isFirstSibling&&a.isLastSibling,r,n)}ta({moveToOpposite:e=>{const r={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},n=e.at(e.position),{parent:a}=n;if(!a)return e.announce("plonk"),!1;const c=n.parentBranch;let p;if(typeof c=="string"&&(p=r[c]),!p){const A=n.subsupPlacement?rp(e):tp(e);return e.mathfield.stopCoalescingUndo(),A}a.branch(p)||a.createBranch(p);const g=e.setSelection(e.getBranchRange(e.offsetOf(a),p));return e.mathfield.stopCoalescingUndo(),g},moveBeforeParent:e=>{const{parent:r}=e.at(e.position);return r?(e.position=e.offsetOf(r),e.mathfield.stopCoalescingUndo(),!0):(e.announce("plonk"),!1)},moveAfterParent:e=>ep(e),moveToNextChar:e=>Xo(e,"forward"),moveToPreviousChar:e=>Xo(e,"backward"),moveUp:e=>Xo(e,"upward"),moveDown:e=>Xo(e,"downward"),moveToNextWord:e=>nc(e,"forward"),moveToPreviousWord:e=>nc(e,"backward"),moveToGroupStart:e=>{const r=e.offsetOf(e.at(e.position).firstSibling);return r===e.position?(e.announce("plonk"),!1):(e.position=r,e.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:e=>{const r=e.offsetOf(e.at(e.position).lastSibling);return r===e.position?(e.announce("plonk"),!1):(e.position=r,e.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:e=>{var r,n,a,c;if(e.position===e.lastOffset&&e.anchor===e.lastOffset)return id(e,"forward");const p=e.at(e.position);if(p.mode==="text"){if(e.selectionIsCollapsed){let ve=p;for(;ve&&ve.mode==="text";)ve=ve.leftSibling;let Oe=p;for(;((r=Oe.rightSibling)==null?void 0:r.mode)==="text";)Oe=Oe.rightSibling;if(ve&&Oe)return _a(e,[ve,Oe])}if(p.rightSibling.mode==="text"){let ve=p;for(;ve&&ve.mode==="text";)ve=ve.rightSibling;return ve?(Do(e,(n=ve.leftSibling)!=null?n:ve),e.mathfield.switchMode("math"),!0):Do(e,e.lastOffset)}}const A=e.at(e.anchor).parentPrompt,T=A?e.offsetOf(A)+1:Math.max(e.position+1,0),I=vf(e,T,"forward");if(I)return Do(e,I);const K=ip(e,p,ve=>ve.type==="leftright"||ve.type==="text","forward");if(K){if(K.mode==="text"){let ve=K;for(;ve&&ve.mode==="text";)ve=ve.rightSibling;return _a(e,[(a=K.leftSibling)!=null?a:K,(c=ve.leftSibling)!=null?c:ve])}return _a(e,K)}const re=p.parent;if(re){if(re.type==="leftright"||re.type==="surd")return _a(e,re);if(p.parentBranch==="superscript"&&re.subscript)return _a(e,re.subscript);if(p.parentBranch==="above"&&re.below)return _a(e,re.below);if(p.parentBranch==="superscript"||p.parentBranch==="subscript")return Do(e,re);if(p.parentBranch==="above"||p.parentBranch==="below")return _a(e,re)}return Do(e,e.lastOffset)},moveToPreviousGroup:e=>{var r;if(e.position===0&&e.anchor===0)return id(e,"backward");let n=e.at(e.position);const a=n.mode;if(a==="text"){if(e.selectionIsCollapsed){let A=n;for(;A&&A.mode==="text";)A=A.leftSibling;let T=n;for(;((r=T.rightSibling)==null?void 0:r.mode)==="text";)T=T.rightSibling;if(A&&T)return _a(e,[A,T])}for(;n&&n.mode==="text";)n=n.leftSibling;return n?Do(e,n):Do(e,0)}const c=e.at(e.anchor).parentPrompt,p=c?e.offsetOf(c.leftSibling):Math.max(e.position-1,0),g=vf(e,p,"backward");if(g)return Do(e,g);if(a==="math"){const A=ip(e,n,I=>I.type==="leftright"||I.type==="text","backward");if(A){if(A.mode==="text"){let I=A;for(;I&&I.mode==="text";)I=I.leftSibling;return _a(e,[A,I])}return _a(e,A)}const T=n.parent;if(T){if(T.type==="leftright"||T.type==="surd")return _a(e,T);if(n.parentBranch==="subscript"&&T.superscript)return _a(e,T.superscript);if(n.parentBranch==="below"&&T.above)return _a(e,T.above);if(n.parentBranch==="superscript"||n.parentBranch==="subscript")return Do(e,T);if(n.parentBranch==="above"||n.parentBranch==="below")return _a(e,T)}return Do(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:tp,moveToSubscript:rp},{target:"model",changeSelection:!0}),ta({moveToNextPlaceholder:e=>id(e,"forward"),moveToPreviousPlaceholder:e=>id(e,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function ip(e,r,n,a){if(a==="forward"){let p=r.rightSibling;for(;p&&!n(p);)p=p.rightSibling;return p}let c=r.leftSibling;for(;c&&!n(c);)c=c.leftSibling;return c}function nd(e,r,n){typeof r=="function"&&(n=r,r=1/0),r===void 0&&(r=1/0);let a=e.position,c=!1,p="";for(;!c;){const g=e.at(a);c=r===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),c||(g.mode="text",g.command=g.value,g.verbatimLatex=void 0,p+=g.value),a-=1,r-=1}e.contentDidChange({data:p,inputType:"insertText"})}function p0(e,r,n){typeof r=="function"&&(n=r,r=1/0),r===void 0&&(r=1/0);let a=e.position,c=!1;const p=[];for(;!c;){const g=e.at(a);c=r===0||!g||g.type==="first"||g.isFirstSibling||g.mode!=="text"||g.value===" "||typeof n=="function"&&!n(g),c||(p.push(Mt.serialize([g],{defaultMode:"math"})),g.mode="math"),a-=1,r-=1}yf(e),e.contentDidChange({data:Yi(p),inputType:"insertText"})}function yf(e){var r;let n=e.position-1;for(;n>=0&&((r=e.at(n))==null?void 0:r.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 r="",n=e.position,a=!1;for(;!a;){const c=e.at(n);a=!(c&&(c.mode==="text"||c.mode==="math"&&c.type&&/mord|mpunct/.test(c.type))),a||(r=c.value+r),n-=1}return r}function em(e,r,n){const{model:a}=e;if(a.mode==="latex"||!a.at(a.position).isLastSibling||!n||!h(n))return!1;const c=o(n);if(!a.selectionIsCollapsed)return!!(e.model.mode==="text"&&/[/_^]/.test(c));const p=Q1(a)+c;if(e.model.mode==="text"){if(r==="Esc"||/[/\\]/.test(c))return!0;if(/[\^_]/.test(c))return/(^|\s)[a-zA-Z][^_]$/.test(p)&&p0(a,1),!0;const g={")":"(","}":"{","]":"["}[c],{parent:A}=a.at(a.position);if(g&&A instanceof Qn&&A.leftDelim===g)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(p))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(c))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(p))return p0(a,1),!1;if(/\D\.[^\d\s]$/.test(p)){p0(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(p)||/\.\d$/.test(p)||/\([\d+\-.]$/.test(p))return p0(a,1),!0;if(/\([a-z][,;]$/.test(p))return p0(a,2),!0;if(/[\d+\-=><*|]$/.test(c))return yf(a),!0}else{if(r==="[Space]")return nd(a,void 0,g=>/[a-z][:,;.]$/.test(g.value)),!0;if(/[a-zA-Z]{3,}$/.test(p)&&!/(dxd|abc|xyz|uvw)$/.test(p))return nd(a,void 0,g=>/[a-zA-Z]/.test(g.value)),!0;if(/(^|\W)(if)$/i.test(p))return nd(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(p)&&!/(αβγ)$/.test(p))return nd(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(c==="?"||c==="."&&!/[\d-+]\.$/.test(p))return!0}return!1}function tm(e,r){if(!e.isSelectionEditable||!e.keystrokeCaptionVisible)return;const n=np(),a=e.element.getBoundingClientRect();n.style.left=`${a.left}px`,n.style.top=`${a.top-64}px`,n.innerHTML=window.MathfieldElement.createHTML("<span>"+(n0(r)||r)+"</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 r=np();r.innerHTML=""}else{const r=rt("mathlive-keystroke-caption-panel");r.style.visibility="hidden"}return!1}function np(){const e=document.getElementById("mathlive-keystroke-caption-panel");return e||(va("keystroke-caption"),va("core"),rt("mathlive-keystroke-caption-panel"))}function im(){document.getElementById("mathlive-keystroke-caption-panel")&&(Lt("mathlive-keystroke-caption-panel"),no("core"),no("keystroke-caption"))}function sp(e,r){var n,a,c;const{model:p}=e,g=l(r);if(r.isTrusted){lf(r);const Oe=i0();e.keyboardLayout!==Oe.id&&(e.keyboardLayout=Oe.id,e._keybindings=void 0)}if(clearTimeout(e.inlineShortcutBufferFlushTimer),e.inlineShortcutBufferFlushTimer=0,tm(e,g),r.isTrusted&&r.defaultPrevented)return e.flushInlineShortcutBuffer(),!1;let A,T="",I;const K=e.inlineShortcutBuffer;if(e.isSelectionEditable){if(p.mode==="math")if(g==="[Backspace]")K.pop();else if(!h(r))e.flushInlineShortcutBuffer();else{const Oe=o(r),Ke=[...(a=(n=K[K.length-1])==null?void 0:n.keystrokes)!=null?a:[],Oe];K.push({state:p.getState(),keystrokes:Ke,leftSiblings:nm(e)});let vt=0,ur="";for(;!A&&vt<Ke.length;)I=K.length-(Ke.length-vt),ur=Ke.slice(vt).join(""),A=su(K[I].leftSiblings,ur,e.options.inlineShortcuts),!A&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(ur)&&(A=e.options.onInlineShortcut(e,ur)),vt+=1;e.flushInlineShortcutBuffer({defer:!0})}e.options.smartMode&&(A?e.switchMode("math"):em(e,g,r)&&(e.switchMode({math:"text",text:"math"}[p.mode]),T=""))}if(!A){if(T||(T=f(e.keybindings,p.mode,r)),!T&&(g==="[Enter]"||g==="[Return]")){let Oe=!1;return p.contentWillChange({inputType:"insertLineBreak"})&&(e.host&&(Oe=!e.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),Oe||r.preventDefault&&(r.preventDefault(),r.stopPropagation()),p.contentDidChange({inputType:"insertLineBreak"})),Oe}if((!T||g==="[Space]")&&p.mode==="math"){if(g==="[Space]"){if(e.adoptStyle="none",e.flushInlineShortcutBuffer(),e.options.mathModeSpace)return Un.insert(p,e.options.mathModeSpace,{format:"latex",mode:"math"}),e.snapshot("insert-space"),T="",e.dirty=!0,e.scrollIntoView(),r.preventDefault&&(r.preventDefault(),r.stopPropagation()),!1;const Oe=p.at(p.position+1),Ke=p.at(p.position-1);if((Oe==null?void 0:Oe.mode)==="text"||(Ke==null?void 0:Ke.mode)==="text")return Un.insert(p," ",{mode:"text"}),e.snapshot("insert-space"),e.dirty=!0,e.scrollIntoView(),!1}(c=p.at(p.position))!=null&&c.isDigit()&&window.MathfieldElement.decimalSeparator===","&&o(r)===","&&(T="insertDecimalSeparator")}}if(!A&&!T){if(p.mathfield.smartFence){if(_f(p,o(r),e.effectiveStyle))return e.dirty=!0,e.scrollIntoView(),r.preventDefault&&r.preventDefault(),!1}else{const{parent:Oe}=p.at(p.position);if(Oe instanceof Qn&&Oe.rightDelim==="?"&&p.at(p.position).isLastSibling&&/^[)}\]|]$/.test(g))return e.snapshot(),Oe.isDirty=!0,Oe.rightDelim=g,p.position+=1,p.selectionDidChange(),p.contentDidChange({data:o(r),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),r.preventDefault&&r.preventDefault(),!1;if(!p.selectionIsCollapsed){const Ke=o(r);if(Ke==="("||Ke==="{"||Ke==="["){const vt={"(":"(","{":"\\lbrace","[":"\\lbrack"}[Ke],ur={"(":")","{":"\\rbrace","[":"\\rbrack"}[Ke],[mt,zt]=Ws(p.selection);return e.snapshot(),p.position=zt,Un.insert(p,ur,{format:"latex"}),p.position=mt,Un.insert(p,vt,{format:"latex"}),p.setSelection(mt+1,zt+1),p.contentDidChange({data:Ke,inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),r.preventDefault&&r.preventDefault(),!1}}}return!0}const re=p.at(Math.max(p.position,p.anchor)),{parent:ve}=re;if(T==="moveAfterParent"&&(ve==null?void 0:ve.type)==="leftright"&&re.isLastSibling&&e.options.smartFence&&_f(p,".",e.defaultStyle)&&(T="",ui(e)),e.keyboardDelegate.cancelComposition(),T)e.executeCommand(T);else if(A){const Oe=e.effectiveStyle;p.setState(K[I].state);const Ke=K[K.length-1].keystrokes;for(const vt of Ke)Un.insert(p,vt,{silenceNotifications:!0,style:Oe});e.snapshot("insert-shortcut"),p.setState(K[I].state),p.deferNotifications({content:!0,selection:!0,data:A,type:"insertText"},()=>(Un.insert(p,A,{format:"latex",style:Oe}),yf(e.model),A.endsWith(" ")&&(e.switchMode("text"),Un.insert(p," ",{style:Oe,mode:"text"})),e.snapshot(),p.selectionIsCollapsed||e.flushInlineShortcutBuffer(),!0)),e.dirty=!0,p.announce("replacement")}return e.scrollIntoView(),r.preventDefault&&r.preventDefault(),!1}function bf(e,r,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 c=T0(r);const p=window.mathVirtualKeyboard;if(p!=null&&p.isShifted&&(c=typeof c=="string"?c.toUpperCase():c.map(T=>T.toUpperCase())),n.simulateKeystroke){let T=!0;for(const I of c)sp(e,new KeyboardEvent("keypress",{key:I}))&&(T=!1);if(T)return}const g=a.at(a.position),A=z(z({},g.computedStyle),e.defaultStyle);if(a.selectionIsCollapsed||(a.deleteAtoms(Ws(a.selection)),e.snapshot("delete")),a.mode==="latex")a.deferNotifications({content:!0,selection:!0,data:r,type:"insertText"},()=>{xe(e);for(const T of c)Un.insert(a,T);e.snapshot("insert-latex"),ke(e)});else if(a.mode==="text"){for(const T of c)Un.insert(a,T,{style:A});e.snapshot("insert-text")}else if(a.mode==="math")for(const T of c)sm(e,T,A,g);e.dirty=!0,e.scrollIntoView()}function nm(e){const r=e.model,n=[];let a=r.at(Math.min(r.position,r.anchor));for(;a.type!=="first";)n.push(a),a=a.leftSibling;return n}function sm(e,r,n,a){const c=e.model;let p={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[r];if(r===" "&&e.options.mathModeSpace&&(p=["insert",e.options.mathModeSpace]),p){e.executeCommand(p);return}if(/\d/.test(r)&&e.options.smartSuperscript&&a.parentBranch==="superscript"&&a.parent.type!=="mop"&&a.parent.type!=="operator"&&a.parent.type!=="extensible-symbol"&&a.hasNoSiblings){am(c),Un.insert(c,r,{style:n}),e.snapshot(),ep(c),e.snapshot();return}if(/[a-zA-Z0-9]/.test(r)&&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=z({},n),g.style.variant&&(n.variant=g.style.variant),g.style.variantStyle&&(n.variantStyle=g.style.variantStyle))}Un.insert(c,r,{style:n}),e.snapshot(`insert-${c.at(c.position).type}`)}function am(e){e.selectionIsCollapsed||(e.deleteAtoms(Ws(e.selection)),e.mathfield.snapshot("delete"))}function _f(e,r,n){if(!r||e.mode!=="math")return!1;const a=e.at(e.position),{parent:c}=a,p={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[r];if(!p)return!1;const g=Tl[p],A=U0[p];if(!e.selectionIsCollapsed){e.mathfield.snapshot();const[T,I]=Ws(e.selection),K=e.extractAtoms([T,I]),re=c.addChildrenAfter([new Qn("left...right",K,{leftDelim:p,rightDelim:A})],e.at(T));return e.setSelection(e.offsetOf(re.firstChild),e.offsetOf(re.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:p,inputType:"insertText"}),!0}if(p==="|"){const T=c instanceof Qn?c.leftDelim+c.rightDelim:"";if(T==="\\lbrace\\rbrace"||T==="\\{\\}"||T==="\\lbrace?")return e.mathfield.snapshot(),Un.insert(e,"\\,\\middle\\vert\\,",{format:"latex",style:n}),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:p,inputType:"insertText"}),!0}if(A){if(c instanceof Qn&&c.firstChild===a&&(c.leftDelim==="?"||c.leftDelim==="."))return c.leftDelim=p,c.isDirty=!0,e.mathfield.snapshot(),e.contentDidChange({data:p,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(!(c instanceof Qn)){let re=a;for(;re&&!(re.type==="mclose"&&re.value===A);)re=re.rightSibling;if(re){e.mathfield.snapshot();const ve=e.extractAtoms([e.offsetOf(a),e.offsetOf(re)]);return ve.pop(),c.addChildrenAfter([new Qn("left...right",ve,{leftDelim:p,rightDelim:A})],a),e.position=e.offsetOf(c.firstChild)+1,e.contentDidChange({data:p,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}}const T=e.offsetOf(a.lastSibling);let I;for(I=e.position;I<=T;I++){const re=e.at(I);if(re instanceof Qn&&(re.leftDelim==="?"||re.leftDelim===".")&&ap(p,re.rightDelim))break}const K=e.at(I);if(I<=T&&K instanceof Qn){K.leftDelim=p,e.mathfield.snapshot();let re=e.extractAtoms([e.position,I-1]);return re=re.filter(ve=>ve.type!=="first"),K.addChildren(re,K.parentBranch),e.position+=1,e.contentDidChange({data:p,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(c instanceof Qn&&(c.leftDelim==="?"||c.leftDelim===".")&&ap(p,c.rightDelim)){c.isDirty=!0,c.leftDelim=p,e.mathfield.snapshot();const re=e.extractAtoms([e.offsetOf(a.firstSibling),e.position]);for(const ve of re)c.parent.addChildBefore(ve,c);return e.contentDidChange({data:p,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(c instanceof Qn&&c.leftDelim==="|")){if(e.mathfield.snapshot(),Un.insert(e,`\\left${p}\\right?`,{format:"latex",style:n}),a.lastSibling.type!=="first"){const re=e.offsetOf(a.lastSibling),ve=e.extractAtoms([e.position,re]);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 Oe=T.leftSibling,Ke=e.extractAtoms([e.offsetOf(T.leftSibling),e.offsetOf(a)]);Ke.shift();const vt=new Qn("left...right",Ke,{leftDelim:g,rightDelim:p});return c.addChildrenAfter([vt],Oe),e.position=e.offsetOf(vt),e.contentDidChange({data:p,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}T=T.leftSibling}if(c instanceof Qn&&a.isLastSibling&&xf(c.leftDelim,p))return e.mathfield.snapshot(),c.isDirty=!0,c.rightDelim=p,e.position+=1,e.contentDidChange({data:p,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const I=e.offsetOf(a.firstSibling);let K;for(K=e.position;K>=I;K--){const Oe=e.at(K);if(Oe instanceof Qn&&(Oe.rightDelim==="?"||Oe.rightDelim===".")&&xf(Oe.leftDelim,p))break}const re=e.at(K);if(K>=I&&re instanceof Qn)return e.mathfield.snapshot(),re.rightDelim=p,re.addChildren(e.extractAtoms([K,e.position]),re.parentBranch),e.contentDidChange({data:p,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(c instanceof Qn&&(c.rightDelim==="?"||c.rightDelim===".")&&xf(c.leftDelim,p))return e.mathfield.snapshot(),c.isDirty=!0,c.rightDelim=p,c.parent.addChildren(e.extractAtoms([e.position,e.offsetOf(a.lastSibling)]),c.parentBranch),e.position=e.offsetOf(c),e.contentDidChange({data:p,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const ve=c.parent;return ve instanceof Qn&&(ve.rightDelim==="?"||ve.rightDelim===".")&&e.at(e.position).isLastSibling?(e.position=e.offsetOf(ve),_f(e,p,n)):!1}return!1}function xf(e,r){return e?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(r):U0[e]===r:!0}function ap(e,r){return r?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(r)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):Tl[r]===e:!0}ta({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 r=e.field.getBoundingClientRect();return e.field.scroll(r.left-window.scrollX,0),!0},toggleKeystrokeCaption:rm,toggleContextMenu:e=>{const r=e.toggleContextMenu();return r||e.model.announce("plonk"),r},plonk:e=>(e.model.announce("plonk"),!0),switchMode:(e,r,n,a)=>(e.switchMode(r,n,a),!0),insert:(e,r,n)=>e.insert(r,n),typedText:(e,r,n)=>(bf(e,r,n),!0),insertDecimalSeparator:e=>{const r=e.model;return r.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&r.at(Math.max(r.position,r.anchor)).isDigit()?(e.insert("{,}",{format:"latex"}),e.snapshot("insert-mord"),!0):(e.insert("."),!0)},commit:e=>{var r;return e.model.contentWillChange({inputType:"insertLineBreak"})&&((r=e.host)==null||r.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(e,r,n)=>{const a=e.getPrompts();let c="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),p=0;for(;a.includes(c)&&p<100;){if(p===99)return console.error("could not find a unique ID after 100 tries"),!1;c="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),p++}return e.insert(`\\placeholder[${r!=null?r:c}]{}`,n),!0}}),ta({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"}),ta({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(r=>{r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),e.insert(r,{mode:e.model.mode})&&(ke(e),e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),ui(e))):e.model.announce("plonk"),e.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function om(e,r){e.flushInlineShortcutBuffer(),e.stopCoalescingUndo();const n=wf(e,r),{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=z(z({},e.defaultStyle),n)):e.model.deferNotifications({content:!0,type:"insertText"},()=>{a.selection.ranges.forEach(c=>pf(a,c,n,{operation:"toggle"})),e.snapshot("style-change")}),!0}ta({applyStyle:om},{target:"mathfield",canUndo:!0,changeContent:!0});function wf(e,r){var n,a,c,p,g,A,T,I,K,re;const ve={};if(typeof r.color=="string"){const Ke=(a=e.colorMap((n=r.color)!=null?n:r.verbatimColor))!=null?a:"none";Ke!==r.color&&(ve.verbatimColor=(c=r.verbatimColor)!=null?c:r.color),ve.color=Ke}if(typeof r.backgroundColor=="string"){const Ke=(g=e.backgroundColorMap((p=r.backgroundColor)!=null?p:r.verbatimBackgroundColor))!=null?g:"none";Ke!==r.backgroundColor&&(ve.verbatimBackgroundColor=(A=r.verbatimBackgroundColor)!=null?A:r.backgroundColor),ve.backgroundColor=Ke}typeof r.fontFamily=="string"&&(ve.fontFamily=r.fontFamily),typeof r.series=="string"&&(ve.fontSeries=r.series),typeof r.fontSeries=="string"&&(ve.fontSeries=r.fontSeries.toLowerCase()),ve.fontSeries&&(ve.fontSeries=(T={bold:"b",medium:"m",normal:"m"}[ve.fontSeries])!=null?T:ve.fontSeries),typeof r.shape=="string"&&(ve.fontShape=r.shape),typeof r.fontShape=="string"&&(ve.fontShape=r.fontShape.toLowerCase()),ve.fontShape&&(ve.fontShape=(I={italic:"it",up:"n",upright:"n",normal:"n"}[ve.fontShape])!=null?I:ve.fontShape),r.variant&&(ve.variant=r.variant.toLowerCase()),r.variantStyle&&(ve.variantStyle=r.variantStyle.toLowerCase());const Oe=(K=r.size)!=null?K:r.fontSize;return typeof Oe=="number"?ve.fontSize=Math.max(1,Math.min(10,Oe)):typeof Oe=="string"&&(ve.fontSize=(re={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[Oe.toLowerCase()])!=null?re:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[Oe]),ve}function Sf(e){let[r,n]=Ws(e.selection);if(r=op(e,r,"backward"),n=op(e,n,"forward"),r===n){const a=e.at(r);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(r-1,e.offsetOf(a.parent.lastChild)+1);e.setSelection(r-1,n)}else e.setSelection(r,n);return!0}function op(e,r,n){var a,c,p;let g=e.at(r);if(!g)return r;const A=n==="forward"?1:-1;if(g.mode==="text"){for(;g&&!(g.mode!=="text"||!wt.test(g.value));)r+=A,g=e.at(r);return n==="backward"?r-1:r}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);)r+=A,g=e.at(r);else for(;g&&g.mode==="latex"&&/[a-zA-Z\*]/.test(g.value);)r+=A,g=e.at(r);else if(g.value==="{"){if(n==="forward"){for(;g&&g.mode==="latex"&&g.value!=="}";)r+=A,g=e.at(r);return r}return r-1}else if(g.value==="}"){if(n==="backward"){for(;g&&g.mode==="latex"&&g.value!=="{";)r+=A,g=e.at(r);return r-1}return r}return r-1}if(g.mode==="math"){if(g.isDigit()){for(;(a=e.at(r+A))!=null&&a.isDigit();)r+=A;return n==="backward"?r-1:r}if(g.style.variant||g.style.variantStyle){let T=(c=e.at(r))==null?void 0:c.style;for(;T&&T.variant===g.style.variant&&T.variantStyle===g.style.variantStyle;)T=(p=e.at(r+A))==null?void 0:p.style,r+=A;return n==="backward"?r-1:r}return r}return r}ta({selectGroup:e=>{const r=Sf(e);return r||e.announce("plonk"),r},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>Xo(e,"forward",{extend:!0}),extendSelectionBackward:e=>Xo(e,"backward",{extend:!0}),extendToNextWord:e=>nc(e,"forward",{extend:!0}),extendToPreviousWord:e=>nc(e,"backward",{extend:!0}),extendSelectionUpward:e=>Xo(e,"upward",{extend:!0}),extendSelectionDownward:e=>Xo(e,"downward",{extend:!0}),extendToNextBoundary:e=>nc(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>nc(e,"backward",{extend:!0}),extendToGroupStart:e=>{const r=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).firstSibling));return r||e.announce("plonk"),r},extendToGroupEnd:e=>{const r=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).lastSibling));return r||e.announce("plonk"),r},extendToMathFieldStart:e=>{const r=e.setSelection(e.anchor,0);return r||e.announce("plonk"),r},extendToMathFieldEnd:e=>{const r=e.setSelection(e.anchor,e.lastOffset);return r||e.announce("plonk"),r}},{target:"model",changeSelection:!0});var m0=null,jc=0,sd=class co{static start(r,n,a,c){var p;co.element=r,(p=co.controller)==null||p.abort(),co.controller=new AbortController;const g={signal:co.controller.signal};"PointerEvent"in window?(r.addEventListener("pointermove",a,g),r.addEventListener("pointerup",c,g),r.addEventListener("pointercancel",c,g),Ef(n)&&(co.pointerId=n.pointerId,r.setPointerCapture(n.pointerId))):(window.addEventListener("mousemove",a,g),window.addEventListener("blur",c,g),window.addEventListener("mouseup",c,g))}static stop(){var r;(r=co.controller)==null||r.abort(),co.controller=void 0,typeof co.pointerId=="number"&&(co.element.releasePointerCapture(co.pointerId),co.pointerId=void 0)}};function Ef(e){return e!==null&&globalThis.PointerEvent!==void 0&&e instanceof PointerEvent}function lp(e,r){var n;if(r.buttons>1)return;e.atomBoundsCache=new Map;const a=e;let c,p=!1,g=!1,A="none",T=!1,I=!1;const K=r.clientX,re=r.clientY,ve=Date.now(),Oe=a.field,Ke=setInterval(()=>{T?Oe.scroll({top:0,left:Oe.scrollLeft-16}):I&&Oe.scroll({top:0,left:Oe.scrollLeft+16})},32);function vt(){sd.stop(),p=!1,clearInterval(Ke),e.element.classList.remove("tracking"),r&&r.preventDefault()}function ur(zt){if(!a.hasFocus()){vt();return}const pr=zt.clientX,Zt=zt.clientY,Hr=Ef(zt)&&zt.pointerType==="touch"?20:5;if(Date.now()<ve+500&&Math.abs(K-pr)<Hr&&Math.abs(re-Zt)<Hr){zt.preventDefault(),zt.stopPropagation();return}const ni=Oe.getBoundingClientRect();I=pr>ni.right,T=pr<ni.left;let Yr=c;Ef(zt)&&(zt.isPrimary||(Yr=qc(a,zt.clientX,zt.clientY,{bias:0})));const Xi=qc(a,pr,Zt,{bias:pr<=K?pr===K?0:-1:1});Yr>=0&&Xi>=0&&(a.model.extendSelectionTo(Yr,Xi),ui(e)),g&&Sf(a.model)}m0&&Math.abs(m0.x-K)<5&&Math.abs(m0.y-re)<5&&Date.now()<m0.time+500?(jc+=1,m0.time=ve):(m0={x:K,y:re,time:ve},jc=1);const mt=Oe.getBoundingClientRect();if(K>=mt.left&&K<=mt.right&&re>=mt.top&&re<=mt.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",c=qc(e,K,re,{bias:0}),c>=0){if(e.element.classList.add("tracking"),r.shiftKey){const zt=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,c),Le(e.model)||zt?A="all":A="selection"}else e.model.at(c).type==="placeholder"?(e.model.setSelection(c-1,c),A="selection"):((n=e.model.at(c).rightSibling)==null?void 0:n.type)==="placeholder"?(e.model.setSelection(c,c+1),A="selection"):(e.model.position=c,Le(e.model)?A="all":A="selection");e.defaultStyle={},r.detail===3||jc>2?(vt(),(r.detail===3||jc===3)&&(e.model.selection={ranges:[[0,e.model.lastOffset]]},A="all")):p||(p=!0,sd.start(Oe,r,ur,vt),(r.detail===2||jc===2)&&(g=!0,Sf(e.model),A="all"))}e.hasFocus()||(A="none",e.focus({preventScroll:!0}))}else m0=null;e.stopCoalescingUndo(),A!=="none"&&(e.model.selectionIsCollapsed&&(A="all"),ui(e)),r.preventDefault()}function lm(e,r,n){if(e>=n.left&&e<=n.right&&r>=n.top&&r<=n.bottom)return 0;const a=e-(n.left+n.right)/2,c=r-(n.top+n.bottom)/2;return a*a+c*c}function up(e,r,n,a,c){if(!n.id)return[1/0,null];if(r.has(n.id))return r.get(n.id);const p=Wu(e,n);if(!p)return[1/0,null];let g=[1/0,null];if(n.hasChildren&&!n.captureSelection&&a>=p.left&&a<=p.right)for(const A of n.children){const T=up(e,r,A,a,c);T[0]<=g[0]&&(g=T)}return g[1]||(g=[lm(a,c,p),n]),r.set(n.id,g),g}function um(e,r,n){const[,a]=up(e,new Map,e.model.root,r,n);return a}function qc(e,r,n,a){var c;const p=e.field.querySelector(".ML__latex").getBoundingClientRect();if(!p)return 0;if(r>p.right||n>p.bottom+8)return e.model.lastOffset;if(r<p.left||n<p.top-8)return 0;a=a!=null?a:{},a.bias=(c=a.bias)!=null?c:0;let g=um(e,r,n);const A=[];let T=g;for(;T;)A.unshift(T),T=T.parent;for(const K of A)if(K.captureSelection){g=K;break}let I=e.model.offsetOf(g);if(I<0)return-1;if(g.leftSibling)if(a.bias===0&&g.type!=="placeholder"){const K=Wu(e,g);K&&r<(K.left+K.right)/2&&(I=e.model.offsetOf(g.leftSibling))}else a.bias<0&&(I=e.model.offsetOf(g.leftSibling));return I}var cm=class extends Un{constructor(){super("math")}onPaste(e,r){if(!r||!e.model.contentWillChange({data:typeof r=="string"?r:null,dataTransfer:typeof r=="string"?null:r,inputType:"insertFromPaste"}))return!1;let n="",a="auto",c=typeof r!="string"?r.getData("application/json+mathlive"):"";if(c)try{const p=JSON.parse(c);if(p&&Array.isArray(p)){e.snapshot();const g=ko(p),{model:A}=e;A.selectionIsCollapsed||A.deleteAtoms(Ws(A.selection));const T=A.at(A.position);if(T.parent instanceof gn){console.assert(T.parentBranch!==void 0);const I=[];let K=[];g[0].type==="first"&&g.shift(),g[g.length-1].type==="first"&&g.pop();for(const Ke of g)Ke.type==="first"&&K.length>0?(I.push(K),K=[Ke]):K.push(Ke);K.length>0&&I.push(K);let re=Number(T.parentBranch[0]),ve=Number(T.parentBranch[1]);const Oe=T.parent.maxColumns;for(;T.parent.colCount-ve<I.length&&T.parent.colCount<Oe;)T.parent.addColumn();T.parent.addChildrenAfter(I[0],T);for(let Ke=1;Ke<I.length;Ke++)ve++,ve>=Oe&&(ve=0,T.parent.addRowAfter(re),re++),T.parent.setCell(re,ve,I[Ke])}else T.parent.addChildrenAfter(g.filter(I=>I.type!=="first"),T);return A.position=A.offsetOf(g[g.length-1]),A.contentDidChange({inputType:"insertFromPaste"}),ui(e),!0}}catch(p){}if(c=typeof r!="string"?r.getData("application/json"):"",c&&window.MathfieldElement.computeEngine)try{const p=JSON.parse(c);if(typeof p=="object"&&"latex"in p&&p.latex&&(n=p.latex),!n){const g=window.MathfieldElement.computeEngine.box(p);g&&!g.has("Error")&&(n=g.latex)}n||(a="latex")}catch(p){}if(!n&&typeof r!="string"&&(n=r.getData("application/x-latex"),n&&(a="latex")),n||(n=typeof r=="string"?r:r.getData("text/plain")),n){let p;return[p,n]=kc(n),a==="auto"&&p&&(a="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n,{format:a})&&(e.startRecording(),e.snapshot("paste"),ui(e)),e.startRecording(),!0}return!1}insert(e,r,n){var a,c;const p=typeof r=="string"?r:(c=(a=window.MathfieldElement.computeEngine)==null?void 0:a.box(r).latex)!=null?c:"";if(!n.silenceNotifications&&!e.contentWillChange({data:p,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 A=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(Ws(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 I=-1;T[0]?T["@"]=T[0]:typeof r=="string"&&/(^|[^\\])#@/.test(r)&&(I=dm(e),I>=0&&(T["@"]=e.getValue(I,e.position,"latex"))),T[0]||(T[0]=T["?"]);let K=!1;const re=pr=>(K=!0,T[pr]);let[ve,Oe]=cp(e,r,re,n);if(!Oe)return!1;const Ke=Oe.length===1&&Oe[0].type==="genfrac";Ke&&I>=0&&typeof e.mathfield.options.isImplicitFunction=="function"&&e.mathfield.options.isImplicitFunction(e.at(e.position).command)?(T["@"]=T["?"],K=!1,[ve,Oe]=cp(e,r,re,n)):I>=0&&e.deleteAtoms([I,e.position]);const{parent:vt}=e.at(e.position),ur=vt.hasEmptyBranch("body");if(Ke&&ve!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&vt instanceof Qn&&vt.leftDelim==="("&&ur){const pr=vt.parent,Zt=vt.parentBranch;pr.removeChild(vt),pr.setChildren(Oe,Zt)}const mt=e.at(e.position);mt.parent.addChildrenAfter(Oe,mt),ve==="latex"&&typeof r=="string"&&(vt==null?void 0:vt.type)==="root"&&ur&&!K&&(vt.verbatimLatex=r),e.silenceNotifications=A;const zt=Oe[Oe.length-1];if(n.selectionMode==="placeholder"){const pr=Oe.flatMap(Zt=>[Zt,...Zt.children]).find(Zt=>Zt.type==="placeholder");if(pr){const Zt=e.offsetOf(pr);e.setSelection(Zt-1,Zt),e.announce("move")}else zt&&(e.position=e.offsetOf(zt))}else n.selectionMode==="before"||(n.selectionMode==="after"?zt&&(e.position=e.offsetOf(zt)):n.selectionMode==="item"&&e.setSelection(e.anchor,e.offsetOf(zt)));return e.contentDidChange({data:p,inputType:"insertText"}),e.silenceNotifications=g,!0}};function cp(e,r,n,a){var c;let p,g=[];if(typeof r!="string"||a.format==="math-json"){const A=window.MathfieldElement.computeEngine;if(!A)return["math-json",[]];[p,r]=["latex",A.box(r).latex],g=zs(r,{context:e.mathfield.context})}else typeof r=="string"&&a.format==="ascii-math"?([p,r]=F0(r,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),g=zs(r,{context:e.mathfield.context}),p!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&ad(g)):(a.format==="auto"||(c=a.format)!=null&&c.startsWith("latex"))&&(a.format==="auto"&&([p,r]=F0(r,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),a.format==="latex"&&([,r]=kc(r)),g=zs(r,{context:e.mathfield.context,args:n}),a.format!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&ad(g));return gu(g,a.style),[p!=null?p:"latex",g]}function hm(e){if(!e||(console.assert(e[0].type==="first"),e.length>1))return null;const r=e[0];return r instanceof Qn&&r.leftDelim==="("&&r.rightDelim===")"?r.removeBranch("body"):null}function ad(e){if(e){for(let r=0;e[r];r++){const n=e[r];if(n instanceof Qn&&n.leftDelim==="("){let a=0,c=0,p=0;for(let g=0;n.body[g];g++)n.body[g].type==="genfrac"&&(a++,c=g),p++;p===0&&a===1&&(e[r]=n.body[c])}}for(const r of e){for(const n of r.branches)if(!r.hasEmptyBranch(n)){ad(r.branch(n));const a=hm(r.branch(n));a&&r.setChildren(a,n)}if(r instanceof gn)for(const n of r.cells)ad(n)}}}function dm(e){let r=e.at(e.position);if(r.mode==="text"){for(;!r.isFirstSibling&&r.mode==="text";)r=r.leftSibling;return e.offsetOf(r)}const n=r;let a=!1;if(r.type==="mclose"){const c=Tl[r.value];for(;!r.isFirstSibling&&!(r.type==="mopen"&&r.value===c);)r=r.leftSibling;r.isFirstSibling||(r=r.leftSibling),a=!0}else r.type==="leftright"&&(r=r.leftSibling,a=!0);if(a)for(;!r.isFirstSibling&&(r.isFunction||hp(r));)r=r.leftSibling;else{const c=[];for(;!r.isFirstSibling&&(hp(r)||c.length>0);)r.type==="mclose"&&c.unshift(r.value),r.type==="mopen"&&c.length>0&&r.value===Tl[c[0]]&&c.shift(),r=r.leftSibling}return n===r?-1:e.offsetOf(r)}function hp(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 Un{constructor(){super("text")}onPaste(e,r){if(!r)return!1;const n=typeof r=="string"?r:r.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"),ui(e)),e.startRecording(),!0):!1}insert(e,r,n={}){if(!e.contentWillChange({data:r,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 c=e.silenceNotifications;e.silenceNotifications=!0,n.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ws(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 p=pm(r,e.mathfield.context);if(gu(p,n.style),!p)return!1;const g=e.at(e.position),A=g.parent.addChildrenAfter(p,g);return e.silenceNotifications=c,n.selectionMode==="before"||(n.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(A)):A&&(e.position=e.offsetOf(A))),e.contentDidChange({data:r,inputType:"insertText"}),e.silenceNotifications=a,!0}};function pm(e,r){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 "),zs(e,{context:r,parseMode:"text"})}new fm;function Jo(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}var Vn=4,Ta=20,ks=2*(Ta+Vn),od=(e,r)=>`
<line x1="${e+Ta}" y1="${r+Ta}"
x2="${e>r?e+Ta:7*Ta+10*Vn}"
y2="${e<r?r+Ta:7*Ta+10*Vn}"/>
<svg id="plus" viewBox="0 0 40 40" x="${e}" y="${r}" 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>`,dp=(e,r)=>`
<line x1="${e+Ta}" y1="${r+Ta}"
x2="${e>r?e+Ta:7*Ta+10*Vn}"
y2="${e<r?r+Ta:7*Ta+10*Vn}"/>
<svg id="minus" viewBox="0 0 40 40" x="${e}" y="${r}" 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>`,ld=(e,r,n)=>`
<svg id="arrow" viewBox="0 0 40 40" x="${e}" y="${r}" 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*Ta+10*Vn+5} ${8*Ta+10*Vn+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${ks+Vn}"
height="${3*ks}"
width="${ks}"
rx="${ks/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${ks+Vn}"
y="0"
height="${ks}"
width="${3*ks}"
rx="${ks/2}"/>
<g data-command='"moveDown"'>
${ld(2*(Vn+ks),2*Vn+3*ks,0)}
</g>
<g data-command='"moveUp"'>
${ld(2*(Vn+ks),2*Vn+ks,180)}
</g>
<g data-command='"moveToNextWord"'>
${ld(2*Vn+3*ks,2*(Vn+ks),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${ld(2*Vn+ks,2*(Vn+ks),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${od(2*Vn+ks,Vn)}
</g>
<g data-command='"removeColumn"'>
${dp(2*Vn+2*ks,Vn)}
</g>
<g data-command='"addColumnAfter"'>
${od(2*Vn+3*ks,Vn)}
</g>
<g data-command='"addRowBefore"'>
${od(Vn,2*Vn+ks)}
</g>
<g data-command='"removeRow"'>
${dp(Vn,2*Vn+2*ks)}
</g>
<g data-command='"addRowAfter"'>
${od(Vn,2*Vn+3*ks)}
</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>`,fp=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>`,Af={matrix:gm,pmatrix:vm,bmatrix:ym,Bmatrix:fp,vmatrix:bm,Vmatrix:_m},kf={cases:xm,rcases:wm,Bmatrix:fp};function Sm(e){var r,n;const a=(r=e.model.parentEnvironment)==null?void 0:r.array;if(!a)return;let c=0;a.forEach(Ke=>{(!c||Ke.length>c)&&(c=Ke.length)});let p=document.getElementById("mathlive-environment-popover");p||(p=rt("mathlive-environment-popover"),va("environment-popover"),va("core"),p.setAttribute("aria-hidden","true"));let g;const A=p.querySelector(".MLEP__environment-controls");A?g=A:(g=document.createElement("div"),p.innerHTML="",p.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=[],I="";const K=e.model.parentEnvironment.environmentName;if(Eh(K)){const Ke=Am(K);I=Af[Ke]("active");const vt=Af,{[Ke]:ur}=vt,mt=q(vt,[ne(Ke)]);T=Object.values(mt).map(zt=>zt("inactive"))}else if(Ah(K)){const Ke=km(K);I=kf[Ke]("active");const vt=kf,{[Ke]:ur}=vt,mt=q(vt,[ne(Ke)]);T=Object.values(mt).map(zt=>zt("inactive"))}else Ga(K)&&(I=Af.matrix("active"),T=Object.values(kf).map(Ke=>Ke("inactive")));const re=document.createElement("div");re.className="MLEP__environment-delimiter-controls",re.style.display="flex",re.style.flexDirection="column",re.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${I}
${T.join("")}
</div>`,I&&g.appendChild(re),g.querySelectorAll("[data-command]").forEach(Ke=>{const vt=Ke.dataset.command;let ur=vt;try{ur=JSON.parse(vt)}catch(mt){}Ke.addEventListener("mousedown",mt=>mt.preventDefault()),ur&&Ke.addEventListener("click",()=>e.executeCommand(ur))});const Oe=(n=e.field)==null?void 0:n.getBoundingClientRect();Oe&&(p.style.top=`${window.scrollY+(Oe.top-p.clientHeight-15)}px`,p.style.left=`${Oe.left+20}px`,p.classList.add("is-visible"))}function Tf(){const e=document.getElementById("mathlive-environment-popover");e==null||e.classList.remove("is-visible")}function Em(){document.getElementById("mathlive-environment-popover")&&(Lt("mathlive-environment-popover"),no("environment-popover"),no("core"))}function ud(e){if(!e.hasFocus())return;let r=!1;if(e.model.mode==="math"){const n=e.model.parentEnvironment;if(n!=null&&n.array&&zd(n.environmentName)){const a=e.options.environmentPopoverPolicy;r=a==="auto"||a==="on"}}r?Sm(e):Tf()}function Am(e){return e.replace("*","")}function km(e){return e==="dcases"?"cases":e}function pp(e){const r=getComputedStyle(e).direction;return r==="ltr"||r==="rtl"?r:"ltr"}function mp(e,r,n){return r==="left"||r==="leading"&&n==="ltr"||r==="trailing"&&n==="rtl"?e.left:e.right}function Cf(e,r,n,a){return n==="middle"?e-r/2:n==="start"&&a==="rtl"||n==="end"&&a==="ltr"||n==="top"||n==="right"?Math.max(0,e-r):e}function Tm(e,r,n,a){return n==="middle"?e-r/2:n==="start"&&a==="ltr"||n==="end"&&a==="rtl"||n==="top"||n==="right"?e:e-r}function Cm(e,r){var n,a,c;const p=(n=pp(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(),A=Number.isFinite(r.maxHeight)?Math.min(r.maxHeight,window.innerHeight):window.innerHeight;let T=Math.min(A,(a=r.height)!=null?a:g.height),I=Cf(r.location.y,T,r.verticalPos,p);I+T>window.innerHeight-8&&(r.alternateLocation?(I=Cf(r.alternateLocation.y,T,r.verticalPos,p),I+T>window.innerHeight-8&&(I=void 0)):I=void 0),Number.isFinite(I)||(I=Math.max(8,window.innerHeight-8-T),8+T>window.innerHeight-8&&(e.style.bottom="8px")),T=Math.min(I+T,window.innerHeight-8)-I;const K=Number.isFinite(r.maxWidth)?Math.min(r.maxWidth,window.innerWidth):window.innerWidth;let re=Math.min(K,(c=r.width)!=null?c:g.width),ve=Cf(r.location.x,re,r.horizontalPos,p);ve+re>window.innerWidth-8&&(r.alternateLocation?(ve=Tm(r.alternateLocation.x,re,r.verticalPos,p),ve+re>window.innerWidth-8&&(ve=void 0)):ve=void 0),Number.isFinite(ve)||(ve=Math.max(8,window.innerWidth-8-re),8+re>window.innerWidth-8&&(e.style.right="8px")),re=Math.min(ve+re,window.innerWidth-8)-ve,p==="rtl"?e.style.right=`${Math.ceil(window.innerWidth-ve-re).toString()}px`:e.style.left=`${Math.ceil(ve).toString()}px`,e.style.top=`${Math.ceil(I).toString()}px`,T!==g.height&&(e.style.height=`${Math.ceil(T).toString()}px`),re!==g.width&&(e.style.width=`${Math.ceil(re).toString()}px`)}function Dm(e,r){return Math.hypot(r.x-e.x,r.y-e.y)}function sc(e){return"submenu"in e}function Qo(e){return"type"in e&&e.type==="command"||"onMenuSelect"in e||"id"in e}function Df(e){return"type"in e&&e.type==="divider"}function Mf(e){return"type"in e&&e.type==="heading"}var gp={};function Lf(e){let r=gp[e];if(!r){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,gp[e]=a,r=a}}if(r){if("content"in r)return r.content.cloneNode(!0);const n=document.createElement("svg");return n.innerHTML=r.innerHTML,n}}var vp=80,yp=class{constructor(e,r){this._element=null;var n;this.parentMenu=r,this._declaration=e,sc(e)?(this.type="submenu",this.submenu=new bp(e.submenu,{parentMenu:r,submenuClass:e.submenuClass,columnCount:e.columnCount})):this.type=(n=e.type)!=null?n:"command",this.hasCheck=Qo(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,r;(e=this._abortController)==null||e.abort(),this._abortController=void 0,(r=this._element)==null||r.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,r;return(r=(e=this.element)==null?void 0:e.classList.contains("active"))!=null?r:!1}set active(e){this.element&&this.element.classList.toggle("active",e)}updateState(e){var r,n,a;const c=this._declaration;if(Df(c)){this.enabled=!1,this.checked=!1;return}Mf(c)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Qo(c)&&(this.checked=Qo(c)&&((r=ac(c.checked,e))!=null?r:!1)),(Qo(c)||sc(c))&&(this.enabled=(n=ac(c.enabled,e))!=null?n:!0,this.visible=(a=ac(c.visible,e))!=null?a:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(Qo(c)||Mf(c)||sc(c))&&(this.label=ac(c.label,e),this.tooltip=ac(c.tooltip,e),this.ariaLabel=ac(c.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(Lf("checkmark"))):this.checked==="mixed"?(e.setAttribute("aria-checked","mixed"),e.append(Lf("mixedmark"))):e.removeAttribute("aria-checked"),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel);const r=document.createElement("span");if(r.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&r.classList.add("heading"),r.innerHTML=this.label,e.append(r),this._tooltip&&e.setAttribute("data-tooltip",this._tooltip),Qo(this._declaration)&&this._declaration.keyboardShortcut){const n=document.createElement("kbd");n.innerHTML=n0(this._declaration.keyboardShortcut),e.append(n)}this.type==="submenu"&&e.append(Lf("trailing-chevron"))}get element(){if(this._element)return this._element;if(Df(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,(Qo(this._declaration)||Mf(this._declaration)||sc(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 r=this.abortController.signal;return e.addEventListener("pointerenter",this,{signal:r}),e.addEventListener("pointerleave",this,{signal:r}),e.addEventListener("pointerup",this,{signal:r}),e.addEventListener("click",this,{signal:r}),this._element}dispatchSelect(){if(!Qo(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 r;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&&((r=this.parentMenu.activeMenuItem)!=null&&r.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()},vp)},vp)}openSubmenu(e){var r;if(this.type!=="submenu"||!this.element)return;if((r=e==null?void 0:e.withDelay)!=null&&r){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const n=this.element.getBoundingClientRect(),a=pp(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:mp(n,"trailing",a),y:n.top-4},alternateLocation:{x:mp(n,"leading",a),y:n.top-4}})}movingTowardSubmenu(e){if(!this.element||this.type!=="submenu")return!1;const r=this.rootMenu.lastMoveEvent;if(!r)return!1;const n=e.timeStamp-r.timeStamp;if(n>500)return!1;const a=e.clientX-r.clientX;if(Mm(a,r.clientY-e.clientY,n)<=.2)return!1;let p="right";if(this.submenu.element){const g=this.submenu.element.getBoundingClientRect(),A=this.element.getBoundingClientRect();g.left<A.left+A.width/2&&(p="left")}return p==="right"?a>0:a<0}};function Mm(e,r,n){return Math.hypot(e,r)/n}function ac(e,r){return e===void 0||typeof e!="function"?e:(r!=null||(r={alt:!1,control:!1,shift:!1,meta:!1}),e(r))}var bp=class pc{constructor(r,n){this._element=null,this._activeMenuItem=null,this._dirty=!0;var a,c;this.parentMenu=(a=n==null?void 0:n.parentMenu)!=null?a:null,this._submenuClass=n==null?void 0:n.submenuClass,this.columnCount=(c=n==null?void 0:n.columnCount)!=null?c:1,this.isSubmenuOpen=!1,this.menuItems=r}get children(){return this._menuItems}set menuItems(r){const n=this.parentMenu;this.dispose(),this.parentMenu=n,r=[...r],this._menuItems=r.map(a=>a.onCreate?a.onCreate(a,this):new yp(a,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var r;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(r=this._menuItems)==null||r.forEach(n=>n.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(r){if(r.type==="wheel"&&this._element){const n=r;this._element.scrollBy(0,n.deltaY),r.stopPropagation()}}dispatchEvent(r){return this.rootMenu.dispatchEvent(r)}get rootMenu(){return this.parentMenu.rootMenu}updateState(r){var n,a,c;this._menuItems.forEach(I=>I.updateState(r));const p=this.hasCheck;this.hasCheck=this._menuItems.some(I=>I.visible&&I.hasCheck),this.hasCheck!==p&&this._menuItems.forEach(I=>I.updateState(r));let g,A=0;for(const I of this._menuItems)I.type==="heading"?(g&&A===0&&(g.visible=!1),g=I,A=0):I.type==="divider"&&g?(g.visible=A>0,g=void 0,A=0):g&&I.visible&&(A+=1);g&&(g.visible=A>0);let T=!0;for(const I of this._menuItems)I.type==="divider"?(I.visible=!T,T=!0):I.visible&&(T=!1);(n=this.activeMenuItem)!=null&&n.visible||(this.activeMenuItem=null),!((a=this.activeMenuItem)!=null&&a.enabled)&&((c=this.activeMenuItem)==null?void 0:c.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(r=>r.type!=="divider"&&r.visible&&r.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(r=>r.type!=="divider"&&r.visible)}set dirty(r){console.assert(r===!0),this._dirty!==r&&r&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var r;if(this._element){this._element.textContent="";for(const{element:n,visible:a}of this._menuItems)n&&a&&this._element.append(n);(r=this._element.querySelector("li:first-of-type"))==null||r.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const r=document.createElement("menu");r.setAttribute("role","menu"),r.setAttribute("tabindex","-1"),r.setAttribute("aria-orientation","vertical"),r.setAttribute("part","ui-menu-container"),this._submenuClass&&r.classList.add(this._submenuClass),r.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const n=this._abortController.signal;return r.addEventListener("focus",this,{signal:n}),r.addEventListener("wheel",this,{passive:!0,signal:n}),this._element=r,this.updateElement(),r}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(r){var n,a,c,p;if(this.rootMenu.cancelDelayedOperation(),r!==this._activeMenuItem){if(this.activeMenuItem){const g=this.activeMenuItem;g.active=!1,(n=g.submenu)==null||n.hide()}if(!((a=r==null?void 0:r.visible)==null||a)){this._activeMenuItem=null;return}this._activeMenuItem=r,r&&(r.active=!0)}r?(c=r.element)==null||c.focus({preventScroll:!0}):(p=this._element)==null||p.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let r=0,n=!1;const a=this._menuItems;for(;!n&&r<=a.length-1;){const c=a[r];n=c.type!=="divider"&&c.visible&&c.enabled,r+=1}return n?a[r-1]:null}get lastMenuItem(){this.updateIfDirty();const r=this._menuItems;let n=r.length-1,a=!1;for(;!a&&n>=0;){const c=r[n];a=c.type!=="divider"&&c.visible&&c.enabled,n-=1}return a?r[n+1]:null}nextMenuItem(r){if(r===0)return this._activeMenuItem;if(!this._activeMenuItem)return r>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 c=this._menuItems.indexOf(this._activeMenuItem),p=1;for(;c>=n&&c<=a;){c+=r>0?1:-1;const g=this._menuItems[c];if(!g)break;if(g.visible&&g.enabled){if(p===Math.abs(r))return this._menuItems[c];p+=1}}return r>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(r){this.updateIfDirty();const a=this._menuItems.filter(c=>c.visible&&c.enabled).indexOf(r);return a<0?-1:a%this.columnCount}static get collator(){return pc._collator||(pc._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),pc._collator}findMenuItem(r){var n;this.updateIfDirty();const a=this._menuItems.filter(A=>A.type!=="divider"&&A.visible&&A.enabled);if(a.length===0)return null;const c=Math.max(...a.map(A=>A.label.length))-r.length;if(c<0)return null;let p=null,g=0;for(;g<c&&!p;)p=(n=a.find(A=>pc.collator.compare(r,A.label.substring(g,r.length))===0))!=null?n:null,g++;return p}show(r){return!this.visible||!r.container?!1:(this.updateElement(),r.container.appendChild(this.element),B()&&(this.element.popover="manual",this.element.showPopover()),r.location&&Cm(this.element,{location:r.location,alternateLocation:r.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var r,n,a,c,p;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),B()&&((r=this._element)!=null&&r.popover)&&this.element.hidePopover(),(a=(n=this.parentMenu)==null?void 0:n.element)==null||a.focus(),(p=(c=this._element)==null?void 0:c.parentNode)==null||p.removeChild(this._element)}set openSubmenu(r){var n,a,c,p;const g=r!==null;((n=this.activeMenuItem)==null?void 0:n.type)==="submenu"&&((a=this.activeMenuItem.element)==null||a.setAttribute("aria-expanded",g.toString())),(p=(c=this.activeMenuItem)==null?void 0:c.element)==null||p.classList.toggle("is-submenu-open",g),this.isSubmenuOpen=g}},_p=class w1 extends bp{constructor(r,n){var a;super(r),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=r.some(xp),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(r){hf(this._modifiers,r)||(this._modifiers=r,this.dirty=!0)}get activeSubmenu(){let r=this;for(;r.isSubmenuOpen;)r=r.activeMenuItem.submenu;return r}set dirty(r){this._updating||(console.assert(r===!0),this._dirty!==r&&(this._dirty=!0,r&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(r){this._updating=!0,this.modifiers=r!=null?r:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(r){this.isDynamic&&(this.modifiers=Co(r)),r.stopImmediatePropagation()}handleKeydownEvent(r){var n,a,c;if(r.key==="Tab"||r.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=Co(r));let p=!0;const g=this.activeSubmenu,A=g.activeMenuItem;switch(r.key){case" ":case"Space":case"Return":case"Enter":A==null||A.select(Co(r));break;case"ArrowRight":if((A==null?void 0:A.type)==="submenu")A.select(Co(r)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!A)g.activeMenuItem=g.firstMenuItem;else{const T=(n=g.getMenuItemColumn(A))!=null?n:-1;if(T>=0&&T<((a=g.columnCount)!=null?a:1)-1){const I=g.nextMenuItem(1);I&&(g.activeMenuItem=I)}}break;case"ArrowLeft":if(g===this.rootMenu)A||(g.activeMenuItem=g.firstMenuItem);else if((A&&(c=g.getMenuItemColumn(A))!=null?c:-1)<=0||!A){g.hide();const I=g.parentMenu.activeMenuItem;if(I){const{element:K}=I;K==null||K.focus(),K==null||K.classList.remove("is-submenu-open")}}else{const I=g.nextMenuItem(-1);I&&(g.activeMenuItem=I)}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(h(r)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=r.key;const T=g.findMenuItem(this.typingBuffer);T&&(g.activeMenuItem=T),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else p=!1}p&&(r.preventDefault(),r.stopPropagation())}handleEvent(r){if(r.type==="keydown")this.handleKeydownEvent(r);else if(r.type==="keyup")this.handleKeyupEvent(r);else if(r.type==="pointermove")this.lastMoveEvent=r;else if(r.type==="pointerup"&&r.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(r.type==="contextmenu"){r.preventDefault(),r.stopPropagation();return}super.handleEvent(r)}dispatchEvent(r){return this._host?this._host.dispatchEvent(r):!0}get scrim(){return i.element}connectScrim(r){const n=this.scrim;n.addEventListener("pointerup",this),n.addEventListener("contextmenu",this),n.addEventListener("keydown",this),n.addEventListener("keyup",this),n.addEventListener("pointermove",this),i.open({root:r,onDismiss:()=>this.hide()})}disconnectScrim(){const r=this.scrim;r.removeEventListener("pointerup",this),r.removeEventListener("contextmenu",this),r.removeEventListener("keydown",this),r.removeEventListener("keyup",this),r.removeEventListener("pointermove",this),i.state==="open"&&i.scrim.close()}get rootMenu(){return this}show(r){return this._onDismiss=r==null?void 0:r.onDismiss,r!=null&&r.modifiers&&(this.modifiers=r.modifiers),this.updateState(),this.connectScrim(r==null?void 0:r.target),super.show(d(z({},r),{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,i.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(r){this.cancelDelayedOperation();const n=w1.SUBMENU_DELAY;if(n<=0){r();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,r()},n)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};_p.SUBMENU_DELAY=120;var Lm=_p;function xp(e){return Df(e)?!1:typeof e.label=="function"||typeof e.ariaLabel=="function"||typeof e.tooltip=="function"||(Qo(e)||sc(e))&&(typeof e.enabled=="function"||typeof e.visible=="function")||Qo(e)&&typeof e.checked=="function"?!0:sc(e)?e.submenu.some(xp):!1}var cd=class{};cd.DELAY=300,cd.MAX_DISTANCE=10;function Im(e){return new Promise((r,n)=>{const a=s0(e);a||r(!1);let c=a;const p=setTimeout(()=>{g.abort(),r(Dm(c,a)<cd.MAX_DISTANCE)},cd.DELAY),g=new AbortController,A=g.signal;for(const T of["pointermove","pointerup","pointercancel"])window.addEventListener(T,I=>{if(I.type==="pointerup"||I.type==="pointercancel")clearTimeout(p),g.abort(),r(!1);else if(I.type==="pointermove"){const K=s0(I);K&&(c=K)}},{passive:!0,signal:A})})}function wp(e,r,n){return bu(this,null,function*(){if(e.type==="contextmenu"){const a=e;if(n.show({target:r,location:s0(a),modifiers:Co(a)}))return e.preventDefault(),e.stopPropagation(),!0}if(e.type==="keydown"){const a=e;if(a.code==="ContextMenu"||a.code==="F10"&&a.shiftKey){const c=r==null?void 0:r.getBoundingClientRect();if(c&&n.show({target:r,location:{x:Math.ceil(c.left+c.width/2),y:Math.ceil(c.top+c.height/2)},modifiers:Co(a)}))return e.preventDefault(),e.stopPropagation(),!0}}if(e.type==="pointerdown"&&e.pointerType!=="mouse"&&e.button===0){let a=e.target;for(;a&&r!==a;)a=a.parentNode;if(!a||!n.visible)return!1;const c=s0(e);if(yield Im(e))return n.state!=="closed"?!1:(n.show({target:r,location:c}),!0)}return!1})}var Sp={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};Ve(Object.keys(Sp),"{body:auto}",{createAtom:e=>new K0(d(z({},e),{body:He(e.args[0]),accentChar:Sp[e.command.slice(1)]}))}),Ve(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{const r=Ft(He(e.args[0]));return new K0(d(z({},e),{body:He(e.args[0]),svgAccent:e.command.slice(1)+(r.length>5?"4":["1","1","2","2","3","3"][r.length])}))}}),Ve(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:e=>new K0(d(z({},e),{body:He(e.args[0]),svgAccent:"overarc"}))}),Ve(["underarc","underparen"],"{body:auto}",{createAtom:e=>new Ba(d(z({},e),{body:He(e.args[0]),svgBelow:"underarc"}))}),Ve("utilde","{body:auto}",{createAtom:e=>{const r=He(e.args[0]),n=Ft(r),a="widetilde"+(n.length>5?"4":["1","1","2","2","3","3"][n.length]);return new Ba(d(z({},e),{body:r,svgBelow:a,boxType:$s(r)}))}}),Ve("^","{:string}",{createAtom:e=>{var r;return new Mt(d(z({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[e.args[0]])!=null?r:"^"}))}}),Ve("`","{:string}",{createAtom:e=>{var r;return new Mt(d(z({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[e.args[0]])!=null?r:"`"}))}}),Ve("'","{:string}",{createAtom:e=>{var r;return new Mt(d(z({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[e.args[0]])!=null?r:"'"}))}}),Ve('"',"{:string}",{createAtom:e=>{var r,n;return new Mt(d(z({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(r=e.args)!=null&&r[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]:'"'}))}}),Ve(".","{:string}",{createAtom:e=>{var r,n;return new Mt(d(z({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(r=e.args)!=null&&r[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]:"."}))}}),Ve("=","{:string}",{createAtom:e=>{var r,n;return new Mt(d(z({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(r=e.args)!=null&&r[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]:"="}))}}),Ve("~","{:string}",{createAtom:e=>{var r;return new Mt(d(z({type:"mord"},e),{isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[e.args[0]])!=null?r:"\xB4"}))}}),Ve("c","{:string}",{createAtom:e=>{var r;return new Mt(d(z({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={c:"\xE7",C:"\xC7"}[e.args[0]])!=null?r:""}))}}),Ve("enclose","{notation:string}[style:string]{body:auto}",{createAtom:e=>{var r,n;const a=e.args,c={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(r=e.style)!=null?r:{}};if(a[1]){const g=a[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const A of g){const T=A.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(T)c.strokeWidth=T[1],c.strokeStyle=T[2],c.strokeColor=T[3];else{const I=A.match(/\s*([a-z]*)\s*=\s*"(.*)"/);I&&(I[1]==="mathbackground"?c.backgroundcolor=I[2]:I[1]==="mathcolor"?c.strokeColor=I[2]:I[1]==="padding"?c.padding=I[2]:I[1]==="shadow"&&(c.shadow=I[2]))}}c.strokeStyle==="dashed"?c.svgStrokeStyle="5,5":c.strokeStyle==="dotted"&&(c.svgStrokeStyle="1,5")}c.borderStyle=`${c.strokeWidth} ${c.strokeStyle} ${c.strokeColor}`;const p={};return((n=a[0])!=null?n:"").split(/[, ]/).filter(g=>g.length>0).forEach(g=>{p[g.toLowerCase()]=!0}),new Zu(e.command,He(a[2]),p,c)}}),Ve("cancel","{body:auto}",{createAtom:e=>{var r;return new Zu(e.command,He(e.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(r=e.style)!=null?r:{}})}}),Ve("bcancel","{body:auto}",{createAtom:e=>{var r;return new Zu(e.command,He(e.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(r=e.style)!=null?r:{}})}}),Ve("xcancel","{body:auto}",{createAtom:e=>{var r;return new Zu(e.command,He(e.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(r=e.style)!=null?r:{}})}}),Ve(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:e=>{var r;return new Ba(d(z({},e),{body:He((r=e.args)==null?void 0:r[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:e.command.slice(1)}))}}),Ve("overbrace","{:auto}",{createAtom:e=>new Ba(d(z({},e),{body:He(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:e.command.slice(1)}))}),Ve(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:e=>new Ba(d(z({},e),{body:He(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:e.command.slice(1)}))}),Ve(["underbrace"],"{:auto}",{createAtom:e=>new Ba(d(z({},e),{body:He(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:e.command.slice(1)}))}),Ve(["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 r,n,a,c,p;return new Ba(d(z({},e),{svgBody:e.command.slice(1),above:((n=He((r=e.args)==null?void 0:r[1]))==null?void 0:n.length)===0?void 0:He((a=e.args)==null?void 0:a[1]),below:(p=He((c=e.args)==null?void 0:c[0]))!=null?p:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(e,r)=>e.command+(e.hasEmptyBranch("below")?"":`[${e.belowToLatex(r)}]`)+`{${e.aboveToLatex(r)}}${e.supsubToLatex(r)}`}),Ve(["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 Rl(e.command.slice(1),d(z({},e),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),Ve(["liminf","limsup"],"",{ifMode:"math",createAtom:e=>new Rl({"\\liminf":"lim inf","\\limsup":"lim sup"}[e.command],d(z({},e),{limits:"over-under",variant:"main"}))}),Ve(["lim","mod"],"",{ifMode:"math",createAtom:e=>new Rl(e.command.slice(1),d(z({},e),{limits:"over-under",variant:"main"}))}),Ve(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new Rl(e.command.slice(1),d(z({},e),{limits:"over-under",isFunction:!0,variant:"main"}))}),Ve(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new Mt(d(z({},e),{body:He(e.args[0])})),serialize:(e,r)=>`\\ang{${e.bodyToLatex(r)}}`,render:(e,r)=>{const n=e.createBox(r),a=n.caret;n.caret=void 0;const c=new fr("\xB0",{style:d(z({},e.style),{variant:"normal",variantStyle:"up"})});return new fr([n,c],{type:"inner",isSelected:e.isSelected,caret:a})}}),Ve("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new Nc(d(z({},e),{body:He(e.args[1]),index:e.args[0]?He(e.args[0]):void 0}))}),Ve(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:e=>{const r=z({},e),n=e.command,a=e.args;switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":r.hasBarLine=!0;break;case"\\atopfrac":r.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":r.hasBarLine=!1,r.leftDelim="(",r.rightDelim=")";break;case"\\cfrac":r.hasBarLine=!0,r.continuousFraction=!0;break;default:}switch(n){case"\\dfrac":case"\\dbinom":r.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":r.mathstyleName="textstyle";break;default:}return new cu(a[0]?He(a[0]):[new so],a[1]?He(a[1]):[new so],r)},serialize:(e,r)=>{const n=e.aboveToLatex(r),a=e.belowToLatex(r);return/^[0-9]$/.test(n)&&/^[0-9]$/.test(a)?`${e.command}${n}${a}`:Gn(e.command,n,a)}}),Ve(["brace","brack"],"",{infix:!0,createAtom:e=>new cu(He(e.args[0]),He(e.args[1]),d(z({},e),{hasBarLine:!1,leftDelim:e.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:e.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(e,r)=>Yi([e.aboveToLatex(r),e.command,e.belowToLatex(r)])}),Ve(["over","atop","choose"],"",{infix:!0,createAtom:e=>{let r,n;const a=e.args;return e.command==="\\choose"&&(r="(",n=")"),new cu(He(a[0]),He(a[1]),d(z({},e),{hasBarLine:e.command==="\\over",leftDelim:r,rightDelim:n}))},serialize:(e,r)=>Yi([e.aboveToLatex(r),e.command,e.belowToLatex(r)])}),Ve(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:e=>{var r,n;const a=e.args;return new cu(He(a[0]),He(a[1]),d(z({},e),{leftDelim:(r=a[2])!=null?r:".",rightDelim:(n=a[3])!=null?n:".",hasBarLine:!1}))},serialize:(e,r)=>`${e.aboveToLatex(r)} ${e.command}${e.leftDelim}${e.rightDelim}${e.belowToLatex(r)}`}),Ve("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:e=>new cu(He(e.args[0]),He(e.args[1]),d(z({},e),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),Ve(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:e=>new Y0({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)],d(z({},e),{limits:"auto",variant:"main"}))}),Ve("smallint","",{ifMode:"math",createAtom:e=>new Rl("\u222B",d(z({},e),{limits:"adjacent",variant:"main"}))});var Ep={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"};Ve(Object.keys(Ep),"",{ifMode:"math",createAtom:e=>{const r=e.command,n=Ep[r.slice(1)];return new Y0(n,d(z({},e),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[n]}))}}),Ve(["Re","Im"],"",{ifMode:"math",createAtom:e=>new Rl({"\\Re":"\u211C","\\Im":"\u2111"}[e.command],d(z({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Ve("middle","{:delim}",{ifMode:"math",createAtom:e=>{var r;return new Ih(d(z({},e),{delim:(r=e.args[0])!=null?r:"|",size:1}))}}),Ve("the","{:value}",{createAtom:e=>new Mt(d(z({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,r)=>{var n;const a=new ji({parent:r},e.style);let c="";e.isSelected&&(c+=" ML__selected");const p=a.evaluate(e.args[0]);return new fr(((n=Is(p))!=null?n:"").split("").map(g=>new fr(g,{type:"ord",classes:c,mode:e.mode,isSelected:e.isSelected,style:z({variant:"main"},e.style)})),{type:"lift",style:e.style,caret:e.caret,isSelected:e.isSelected,classes:c}).wrap(a)},serialize:e=>{var r;return`\\the${(r=Is(e.args[0]))!=null?r:"\\relax"}`}}),Ve("mathtip","{:auto}{:math}",{createAtom:e=>new hu(d(z({},e),{body:He(e.args[0]),tooltip:He(e.args[1]),content:"math"})),serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`\\texttip{${e.bodyToLatex(r)}}{${Mt.serialize([e.tooltip],d(z({},r),{defaultMode:"math"}))}}`}),Ve("texttip","{:auto}{:text}",{createAtom:e=>new hu(d(z({},e),{body:He(e.args[0]),tooltip:He(e.args[1]),content:"text"})),serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`\\texttip{${e.bodyToLatex(r)}}{${Mt.serialize([e.tooltip],d(z({},r),{defaultMode:"text"}))}}`}),Ve("error","{:math}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[0])})),serialize:(e,r)=>`\\error{${e.bodyToLatex(r)}}`,render:(e,r)=>e.createBox(r,{classes:"ML__error"})}),Ve("ensuremath","{:math}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[0])})),serialize:(e,r)=>`${e.command}{${e.bodyToLatex(d(z({},r),{defaultMode:"math"}))}}`}),Ve("color","{:value}",{applyStyle:(e,r,n)=>{var a,c;return{verbatimColor:(a=Is(r[0]))!=null?a:void 0,color:n.toColor((c=r[0])!=null?c:{string:"red"})}}}),Ve("textcolor","{:value}{content:auto*}",{applyStyle:(e,r,n)=>{var a,c;return{verbatimColor:(a=Is(r[0]))!=null?a:void 0,color:n.toColor((c=r[0])!=null?c:{string:"red"})}}}),Ve("boxed","{content:math}",{createAtom:e=>new Wo(d(z({},e),{body:He(e.args[0]),framecolor:{string:"black"}}))}),Ve("colorbox","{:value}{:text*}",{applyStyle:(e,r,n)=>{var a,c;return{verbatimBackgroundColor:(a=Is(r[0]))!=null?a:void 0,backgroundColor:n.toBackgroundColor((c=r[0])!=null?c:{string:"yellow"})}}}),Ve("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:e=>{var r,n;return new Wo(d(z({},e),{body:He(e.args[2]),framecolor:(r=e.args[0])!=null?r:{string:"blue"},backgroundcolor:(n=e.args[1])!=null?n:{string:"yellow"}}))},serialize:(e,r)=>{var n,a;return r.skipStyles?e.bodyToLatex(d(z({},r),{defaultMode:"text"})):Gn(e.command,(n=Is(e.framecolor))!=null?n:"",(a=Is(e.backgroundcolor))!=null?a:"",e.bodyToLatex(d(z({},r),{defaultMode:"text"})))}}),Ve("bbox","[:bbox]{body:auto}",{createAtom:e=>{var r;const n=e.args[0],a=He(e.args[1]);return n?new Wo(d(z({},e),{body:a,padding:n.padding,border:n.border,backgroundcolor:(r=n.backgroundcolor)!=null?r:void 0})):new Wo(d(z({},e),{body:a}))},serialize:(e,r)=>{var n,a;if(r.skipStyles)return e.bodyToLatex(r);let c=e.command;if(Number.isFinite(e.padding)||e.border!==void 0||e.backgroundcolor!==void 0){const p=[];e.padding&&p.push((n=Is(e.padding))!=null?n:""),e.border&&p.push(`border: ${e.border}`),e.backgroundcolor&&p.push((a=Is(e.backgroundcolor))!=null?a:""),c+=`[${p.join(",")}]`}return Gn(c,e.bodyToLatex(r))}}),Ve(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[0])})),render:(e,r)=>{const n=new ji({parent:r,mathstyle:e.command.slice(1)},e.style),a=Mt.createBox(n,e.body,{type:"lift"});return e.caret&&(a.caret=e.caret),e.bind(r,a)},serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`{${Yi([e.command,e.bodyToLatex(r)])}}`}),Ve(["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]})}),Ve("fontseries","{:string}",{ifMode:"text",applyStyle:(e,r)=>{var n;return{fontSeries:(n=r[0])!=null?n:"auto"}}}),Ve("fontshape","{:string}",{ifMode:"text",applyStyle:(e,r)=>{var n;return{fontShape:(n=r[0])!=null?n:"auto"}}}),Ve("fontfamily","{:string}",{ifMode:"text",applyStyle:(e,r)=>{var n;return{fontFamily:(n=r[0])!=null?n:"roman"}}}),Ve("selectfont","",{ifMode:"text",applyStyle:()=>({})}),Ve("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),Ve(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:e=>new Mt(d(z({},e),{body:He(e.args[0])})),serialize:(e,r)=>`${e.command}{${e.bodyToLatex(r)}}`,render:(e,r)=>e.createBox(r,{classes:"ML__boldsymbol"})}),Ve("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),Ve("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Ve("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Ve("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Ve("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Ve("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Ve("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Ve("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Ve("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Ve("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),Ve("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Ve("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),Ve("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Ve("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),Ve("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),Ve("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),Ve("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),Ve("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),Ve("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),Ve("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),Ve("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),Ve("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),Ve("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),Ve("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),Ve("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),Ve("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),Ve("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),Ve(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),Ve(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),Ve("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),Ve("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),Ve("mbox","{:text}",{ifMode:"math",createAtom:e=>new Mt(d(z({},e),{type:"mord",body:He(e.args[0]),mode:"math"})),serialize:(e,r)=>Gn("\\mbox",e.bodyToLatex(d(z({},r),{defaultMode:"text"})))}),Ve("text","{:text}",{ifMode:"math",applyMode:"text"}),Ve(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[1])})),serialize:(e,r)=>!e.args[0]||r.skipStyles?e.bodyToLatex(r):`${e.command}{${e.args[0]}}{${e.bodyToLatex(r)}}`,render:(e,r)=>{var n;return e.createBox(r,{classes:(n=e.args[0])!=null?n:""})}}),Ve(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[1])})),serialize:(e,r)=>{var n;return!((n=e.args)!=null&&n[0])||r.skipStyles?e.bodyToLatex(r):`${e.command}{${e.args[0]}}{${e.bodyToLatex(r)}}`},render:(e,r)=>{var n;const a=e.createBox(r);return a.cssId=(n=e.args[0])!=null?n:"",a}}),Ve("htmlData","{data:string}{content:auto}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[1])})),serialize:(e,r)=>{var n;return!((n=e.args)!=null&&n[0])||r.skipStyles?e.bodyToLatex(r):`\\htmlData{${e.args[0]}}{${e.bodyToLatex(r)}}`},render:(e,r)=>{var n;const a=e.createBox(r);return a.htmlData=(n=e.args[0])!=null?n:"",a}}),Ve(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[1])})),serialize:(e,r)=>{var n;return!((n=e.args)!=null&&n[0])||r.skipStyles?e.bodyToLatex(r):`${e.command}{${e.args[0]}}{${e.bodyToLatex(r)}}`},render:(e,r)=>{var n;const a=e.createBox(r);return a.htmlStyle=(n=e.args[0])!=null?n:"",a}}),Ve("em","{:rest}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[0])})),serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`{\\em ${e.bodyToLatex(r)}}`,render:(e,r)=>e.createBox(r,{classes:"ML__emph",boxType:"lift"})}),Ve("emph","{:auto}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[1])})),serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`\\emph{${e.bodyToLatex(r)}}`,render:(e,r)=>e.createBox(r,{classes:"ML__emph",boxType:"lift"})});var Ap={"\\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}};Ve(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:e=>{var r;return new Bc(d(z({},e),{delim:(r=e.args[0])!=null?r:".",size:Ap[e.command].size,delimType:Ap[e.command].mclass}))}}),Ve(["hspace","hspace*"],"{width:value}",{createAtom:e=>{var r;return new Il(d(z({},e),{width:(r=e.args[0])!=null?r:{dimension:0}}))}}),Ve(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var r;return new Il(d(z({},e),{width:(r=e.args[0])!=null?r:{dimension:0}}))}}),Ve("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:e=>new Mt(e),render:(e,r)=>{let n=0;const a=r.mathstyle.id;(a===R0||a===_l)&&(n=1),(a===iu||a===ga)&&(n=2),(a===xl||a===Vs)&&(n=3);const c=He(e.args[n]);return Mt.createBox(r,c)},serialize:(e,r)=>`\\mathchoice{${Mt.serialize(e.args[0],r)}}{${Mt.serialize(e.args[1],r)}}{${Mt.serialize(e.args[2],r)}}{${Mt.serialize(e.args[3],r)}}`}),Ve("mathop","{:auto}",{createAtom:e=>new Mt(d(z({},e),{type:"mop",body:He(e.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(e,r)=>{var n;let a=Mt.createBox(r,e.body);if(e.superscript||e.subscript){const c=(n=e.subsupPlacement)!=null?n:"auto";a=c==="over-under"||c==="auto"&&r.isDisplayStyle?e.attachLimits(r,{base:a}):e.attachSupsub(r,{base:a})}return new fr(e.bind(r,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,r)=>{const n=[Gn(e.command,e.bodyToLatex(r))];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(r)),Yi(n)}}),Ve(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new Mt(d(z({},e),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e.command],body:He(e.args[0])}))}),Ve(["operatorname","operatorname*"],"{operator:math}",{createAtom:e=>{const r=He(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 Mt(d(z({},e),{type:"mop",body:r,isFunction:!0,limits:e.command==="\\operatorname"?"adjacent":"over-under"}))},render:(e,r)=>{var n;let a=Mt.createBox(r,e.body);if(e.superscript||e.subscript){const c=(n=e.subsupPlacement)!=null?n:"auto";a=c==="over-under"||c==="auto"&&r.isDisplayStyle?e.attachLimits(r,{base:a}):e.attachSupsub(r,{base:a})}return e.caret&&(a.caret=e.caret),new fr(e.bind(r,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,r)=>{const n=[Gn(e.command,e.bodyToLatex(r))];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(r)),Yi(n)}}),Ve(["char","unicode"],"{charcode:value}",{createAtom:e=>new Mt(d(z({},e),{type:e.mode==="text"?"text":"mord"})),serialize:e=>{var r;return`${e.command}${Is((r=e.args[0])!=null?r:{number:10067,base:"hexadecimal"})}`},render:(e,r)=>{let n=r.evaluate(e.args[0]);return(!n||!("number"in n))&&(n={number:10067,base:"hexadecimal"}),e.value=String.fromCodePoint(n.number),e.createBox(r)}}),Ve("rule","[raise:value]{width:value}{thickness:value}",{createAtom:e=>new Mt(e),render:(e,r)=>{var n,a,c;const p=new ji({parent:r,mathstyle:"textstyle"},e.style),g=p.toEm((n=e.args[0])!=null?n:{dimension:0}),A=p.toEm((a=e.args[1])!=null?a:{dimension:10}),T=p.toEm((c=e.args[2])!=null?c:{dimension:10}),I=new fr(null,{classes:"rule",type:"ord"});return I.width=A,I.height=T+g,I.depth=-g,I.setStyle("border-right-width",A,"em"),I.setStyle("border-top-width",T,"em"),I.setStyle("border-color",e.style.color),I.setStyle("vertical-align",g,"em"),e.isSelected&&I.setStyle("opacity","50%"),e.bind(p,I),e.caret&&(I.caret=e.caret),I.wrap(r)},serialize:e=>`\\rule${e.args[0]?`[${Is(e.args[0])}]`:""}{${Is(e.args[1])}}{${Is(e.args[2])}}`}),Ve(["overline","underline"],"{:auto}",{createAtom:e=>new Mt(d(z({},e),{body:He(e.args[0])})),render:(e,r)=>{const n=e.command.substring(1),a=new ji({parent:r,mathstyle:"cramp"},e.style),c=Mt.createBox(a,e.body);if(!c)return null;const p=a.metrics.defaultRuleThickness/a.scalingFactor,g=new fr(null,{classes:n+"-line"});g.height=p,g.maxFontSize=p*1.125*a.scalingFactor;let A;return n==="overline"?A=new ws({shift:0,children:[{box:c},3*p,{box:g},p]}):A=new ws({top:c.height,children:[p,{box:g},3*p,{box:c}]}),e.caret&&(A.caret=e.caret),new fr(A,{classes:n,type:"ignore"})}}),Ve("overset","{:auto}{base:auto}",{createAtom:e=>{const r=He(e.args[1]);return new Ba(d(z({},e),{above:He(e.args[0]),body:r,skipBoundary:!1,boxType:$s(r)}))},serialize:(e,r)=>Gn(e.command,e.aboveToLatex(r),e.bodyToLatex(r))}),Ve("underset","{:auto}{base:auto}",{createAtom:e=>{const r=He(e.args[1]);return new Ba(d(z({},e),{below:He(e.args[0]),body:r,skipBoundary:!1,boxType:$s(r)}))},serialize:(e,r)=>Gn(e.command,e.belowToLatex(r),e.bodyToLatex(r))}),Ve("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:e=>{const r=He(e.args[2]);return new Ba(d(z({},e),{above:He(e.args[0]),below:He(e.args[1]),body:r,skipBoundary:!1,boxType:$s(r)}))},serialize:(e,r)=>Gn(e.command,e.belowToLatex(r),e.bodyToLatex(r))}),Ve(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new Ba(d(z({},e),{body:He(e.args[2]),above:He(e.args[1]),below:He(e.args[0]),skipBoundary:!1,boxType:e.command==="\\stackrel"?"rel":"bin"})),serialize:(e,r)=>Gn(e.command,e.aboveToLatex(r),e.bodyToLatex(r))}),Ve("smash","[:string]{:auto}",{createAtom:e=>{var r,n,a,c;return new Yu(d(z({},e),{body:He(e.args[1]),smashHeight:(n=(r=e.args[0])==null?void 0:r.includes("t"))!=null?n:!0,smashDepth:(c=(a=e.args[0])==null?void 0:a.includes("b"))!=null?c:!0}))}}),Ve(["vphantom"],"{:auto}",{createAtom:e=>new Yu(d(z({},e),{body:He(e.args[0]),isInvisible:!0,smashWidth:!0}))}),Ve(["hphantom"],"{:auto}",{createAtom:e=>new Yu(d(z({},e),{body:He(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Ve(["phantom"],"{:auto}",{createAtom:e=>new Yu(d(z({},e),{body:He(e.args[0]),isInvisible:!0}))}),Ve("not","{:math}",{createAtom:e=>{const r=He(e.args[0]);return r.length===0?new Mt(d(z({},e),{type:"mrel",value:"\uE020"})):new Mt(d(z({},e),{body:[new jo(d(z({},e),{body:"\uE020",align:"right"})),...r],captureSelection:!0}))},serialize:(e,r)=>{const n=e.args[0],a=n&&typeof n=="object"&&"group"in n;return e.value!=="\uE020"?a?`\\not{${Mt.serialize(n.group,r)}}`:`\\not${Mt.serialize(n,r)}`:a?"\\not{}":"\\not"},render:(e,r)=>{if(e.value)return e.createBox(r);const a=e.args[0]&&typeof e.args[0]=="object"&&"group"in e.args[0]?"ord":$s(He(e.args[0])),c=Mt.createBox(r,e.body,{type:a});return e.caret&&(c.caret=e.caret),e.bind(r,c)}}),Ve(["ne","neq"],"",{createAtom:e=>new Mt(d(z({},e),{type:"mrel",body:[new jo(d(z({},e),{body:"\uE020",align:"right",boxType:"rel"})),new Mt(d(z({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command}),Ve("rlap","{:auto}",{createAtom:e=>new jo(d(z({},e),{body:He(e.args[0]),align:"right"}))}),Ve("llap","{:auto}",{createAtom:e=>new jo(d(z({},e),{body:He(e.args[0]),align:"left"}))}),Ve("mathrlap","{:math}",{createAtom:e=>new jo(d(z({},e),{body:He(e.args[0]),align:"left"}))}),Ve("mathllap","{:math}",{createAtom:e=>new jo(d(z({},e),{body:He(e.args[0]),align:"left"}))}),Ve("raisebox","{:value}{:text}",{createAtom:e=>{var r;return new Wo(d(z({},e),{body:He(e.args[1]),padding:{dimension:0},offset:(r=e.args[0])!=null?r:{dimension:0}}))},serialize:(e,r)=>{var n;return Gn("\\raisebox",(n=Is(e.offset))!=null?n:"0pt",e.bodyToLatex(r))}}),Ve("raise","{:value}{:auto}",{createAtom:e=>{var r;return new Wo(d(z({},e),{body:He(e.args[1]),padding:{dimension:0},offset:(r=e.args[0])!=null?r:{dimension:0}}))},serialize:(e,r)=>{var n;return Gn("\\raise",(n=Is(e.offset))!=null?n:"0pt",e.bodyToLatex(r))}}),Ve("lower","{:value}{:auto}",{createAtom:e=>{var r;return new Wo(d(z({},e),{body:He(e.args[1]),padding:{dimension:0},offset:(r=Oa(e.args[0],-1))!=null?r:{dimension:0}}))},serialize:(e,r)=>{var n,a;return Gn("\\lower",(a=Is(Oa((n=e.offset)!=null?n:{dimension:0},-1)))!=null?a:"0pt",e.bodyToLatex(r))}}),Dt("0123456789/@.?!"),fe(65,90),fe(97,122),Dt([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Dt([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Dt([["\\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]]),Dt([["\\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"),Dt([["\\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"]]),Dt([["\\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"]]),Dt([["\\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"),Dt([["+",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"),Dt([["\\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"),Dt([["\\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]]),Dt([["=",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"),Dt([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Dt([["\\wp",8472],["\\aleph",8501]]),Dt([["\\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"),Dt([["\\ ",160],["~",160]],"space"),Ve(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:e=>new Il(e)}),Ve("space","",{createAtom:e=>new Il(e)}),Dt([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Dt([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Dt([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var kp="<mo>&#x2061;</mo>",hd="<mo>&#8290;</mo>";function dd(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Nn(e,r){return!e||!r.generateID?"":` extid="${e}"`}function Rm(e,r,n){var a,c,p,g,A,T,I,K,re,ve,Oe;let Ke=!1;r=r!=null?r:e.atoms.length;let vt="",ur="",mt=e.atoms[e.index];const zt=(c=(a=mt.style)==null?void 0:a.variant)!=null?c:"",pr=(g=(p=mt.style)==null?void 0:p.variantStyle)!=null?g:"";let Zt="";if(zt||pr){const ni=at(mt.value,(A=mt.style)==null?void 0:A.variant,(T=mt.style)==null?void 0:T.variantStyle);if(ni!==mt.value)return e.index+=1,vt=`<mi${Nn(mt.id,n)}>${ni}</mi>`,Fl(vt,e,n)||(e.mathML+=vt,e.lastType="mi"),!0;Zt=(I={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"}[pr+zt])!=null?I:"",Zt=` mathvariant="${Zt}"`}const Hr={"\\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(mt.command==="!")return e.index+=1,vt="<mo>!</mo>",Fl(vt,e,n)||(e.mathML+=vt,e.lastType="mo"),!0;if(Hr[mt.command]){e.index+=1;let ni=`<mi${Nn(mt.id,n)}${Zt}>${Hr[mt.command]}</mi>`;return(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mtext"||e.lastType==="fence")&&(ni=hd+ni),Fl(ni,e,n)||(e.mathML+=ni,e.lastType="mi"),!0}if(mt.command==="\\operatorname")ur=oc(mt.body),e.index+=1;else if(zt||pr)for(;e.index<r&&(mt.type==="mord"||mt.type==="macro")&&!mt.isDigit()&&zt===((re=(K=mt.style)==null?void 0:K.variant)!=null?re:"")&&pr===((Oe=(ve=mt.style)==null?void 0:ve.variantStyle)!=null?Oe:"");)ur+=oc([mt]),e.index+=1,mt=e.atoms[e.index];else(mt.type==="mord"||mt.type==="macro")&&!mt.isDigit()&&(ur+=oc([mt]),e.index+=1);if(ur.length>0){Ke=!0,vt=`<mi${Zt}>${ur}</mi>`;const ni=e.lastType;vt.endsWith(">f</mi>")||vt.endsWith(">g</mi>")?(vt+=kp,e.lastType="applyfunction"):e.lastType=/^<mo>(.*)<\/mo>$/.test(vt)?"mo":"mi",Fl(vt,e,n)||((ni==="mi"||ni==="mn"||ni==="mtext"||ni==="fence")&&(vt=hd+vt),e.mathML+=vt)}return Ke}function Pm(e){return e.index<e.atoms.length&&e.atoms[e.index].superscript&&e.atoms[e.index].type==="subsup"}function Om(e){let r=-1,n=e.index,a=!1,c=!1;for(;n<e.atoms.length&&!a&&!c;){const p=e.atoms[n];a=!p.isDigit(),c=!a&&p.superscript!==void 0,n++}return c&&(r=n-1),r}function Fl(e,r,n){var a;let c=r.atoms[r.index-1];if(!c)return!1;if(!c.superscript&&!c.subscript)if(((a=r.atoms[r.index])==null?void 0:a.type)==="subsup")c=r.atoms[r.index],r.index+=1;else return!1;const p=r.lastType;r.lastType="";const g=on(c.superscript,n);r.lastType="";const A=on(c.subscript,n);if(r.lastType=p,!g&&!A)return!1;let T="";return g&&A?T=`<msubsup>${e}${A}${g}</msubsup>`:g?T=`<msup>${e}${g}</msup>`:A&&(T=`<msub>${e}${A}</msub>`),r.mathML+=T,r.lastType="",!0}function Bm(e,r,n){r=r!=null?r:e.atoms.length;const a=e.index;let c="";for(;e.index<r&&e.atoms[e.index].mode==="text";)c+=e.atoms[e.index].value?e.atoms[e.index].value:" ",e.index+=1;return c.length>0?(e.mathML+=`<mtext ${Nn(e.atoms[a].id,n)}>${c}</mtext>`,e.lastType="mtext",!0):!1}function Fm(e,r,n){r=r!=null?r:e.atoms.length;const a=e.index;let c="",p=Om(e);for(p>=0&&p<r&&(r=p);e.index<r&&e.atoms[e.index].isDigit();)c+=e.atoms[e.index].asDigit(),e.index+=1;return c.length<=0?!1:(c="<mn"+Nn(e.atoms[a].id,n)+">"+c+"</mn>",p<0&&Pm(e)&&(p=e.index,e.index+=1),Fl(c,e,n)||(e.mathML+=c,e.lastType="mn"),!0)}function Nm(e,r,n){let a=!1;r=r!=null?r:e.atoms.length;let c="",p="";if(e.index<r&&e.atoms[e.index].type==="mopen"){let g=!1,A=0;const T=e.index;let I=-1,K=T+1;for(;K<r&&!g;)e.atoms[K].type==="mopen"?A+=1:e.atoms[K].type==="mclose"&&(A-=1),A===-1&&(g=!0,I=K),K+=1;g&&(c="<mrow>",c+=g0(e.atoms[T],n),c+=on(e.atoms,n,T+1,I),c+=g0(e.atoms[I],n),c+="</mrow>",e.index=I+1,(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mfrac"||e.lastType==="fence")&&(e.mathML+=hd),Fl(c,e,n)&&(a=!0,e.lastType="",c=""),p="fence")}return c.length>0&&(a=!0,e.mathML+=c,e.lastType=p),a}function $m(e,r,n){let a=!1;r=r!=null?r:e.atoms.length;let c="",p="";const g=e.atoms[e.index];if(!g)return!1;const A={"\\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(A[g.command]){e.index+=1;const T=`<mo${Nn(g.id,n)}>${A[g.command]}</mo>`;return Fl(T,e,n)||(e.mathML+=T,e.lastType="mo"),!0}if(e.index<r&&(g.type==="mbin"||g.type==="mrel"))c+=If(e.atoms[e.index],n),e.index+=1,p="mo";else if(e.index<r&&(g.type==="mop"||g.type==="operator"||g.type==="extensible-symbol")){if(g.subsupPlacement==="over-under"&&(g.superscript||g.subscript)){const T=g0(g,n);return g.superscript&&g.subscript?(c+="<munderover>"+T,c+=on(g.subscript,n),c+=on(g.superscript,n),c+="</munderover>"):g.superscript?(c+="<mover>"+T,c+=on(g.superscript,n),c+="</mover>"):g.subscript&&(c+="<munder>"+T,c+=on(g.subscript,n),c+="</munder>"),e.mathML+=c,e.lastType="mo",e.index+=1,!0}{const T=e.atoms[e.index],I=T.value==="\\operatorname",K=I?'<mi class="MathML-Unit"'+Nn(T.id,n)+">"+oc(T.value)+"</mi>":g0(T,n);c+=K,!I&&!/^<mo>(.*)<\/mo>$/.test(K)?(c+=kp,p="applyfunction"):p=I?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(c)&&(c=hd+c),e.index+=1}return c.length>0&&(a=!0,Fl(c,e,n)||(e.mathML+=c,e.lastType=p)),a}function on(e,r,n,a){r!=null||(r={});const c={atoms:[],index:n!=null?n:0,mathML:"",lastType:""};if(typeof e=="number"||typeof e=="boolean")c.mathML=e.toString();else if(typeof e=="string")c.mathML=e;else if(e instanceof Mt)c.mathML=If(e,r);else if(Array.isArray(e)){c.atoms=e;let p=0;for(a=a||(e?e.length:0);c.index<a;)if(Bm(c,a,r)||Fm(c,a,r)||Rm(c,a,r)||$m(c,a,r)||Nm(c,a,r))p+=1;else if(c.index<a){let g=If(c.atoms[c.index],r);c.lastType==="mn"&&g.length>0&&c.atoms[c.index].type==="genfrac"&&(g="<mo>&#x2064;</mo>"+g),c.atoms[c.index].type==="genfrac"?c.lastType="mfrac":c.lastType="",c.index+=1,Fl(g,c,r)?p+=1:g.length>0&&(c.mathML+=g,p+=1)}p>1&&(c.mathML="<mrow>"+c.mathML+"</mrow>")}return c.mathML}function g0(e,r){let n="";const a=oc(e.value);return a&&(n="<mo"+Nn(e.id,r)+">"+a+"</mo>"),n}function oc(e){if(!e)return"";if(typeof e=="string")return dd(e);if(!Array.isArray(e)&&typeof e.body=="string")return dd(e.body);let r="";for(const n of e)typeof n.value=="string"&&(r+=n.value);return dd(r)}function If(e,r){var n,a,c,p,g,A,T,I,K,re,ve,Oe,Ke,vt,ur,mt,zt,pr,Zt,Hr,ni,Yr;if(e.mode==="text")return`<mi${Nn(e.id,r)}>${e.value}</mi>`;const Xi={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"},Pn={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let yr="",Va="",tl,uo,Us,Wa,Ca,$n;const{command:ys}=e;if(e.command==="\\error")return`<merror${Nn(e.id,r)}>${on(e.body,r)}</merror>`;const Hs={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},rl={"\\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":yr=on(e.body,r);break;case"array":if((e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(yr+="<mrow>",e.leftDelim&&e.leftDelim!=="."&&(yr+="<mo>"+(Hs[e.leftDelim]||e.leftDelim)+"</mo>")),yr+="<mtable",e.colFormat){for(yr+=' columnalign="',Us=0;Us<e.colFormat.length;Us++)e.colFormat[Us].align&&(yr+={l:"left",c:"center",r:"right"}[e.colFormat[Us].align]+" ");yr+='"'}for(yr+=">",uo=0;uo<e.array.length;uo++){for(yr+="<mtr>",tl=0;tl<e.array[uo].length;tl++)yr+="<mtd>"+on(e.array[uo][tl],r)+"</mtd>";yr+="</mtr>"}yr+="</mtable>",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(yr+="<mo>"+(Hs[e.leftDelim]||e.rightDelim)+"</mo>"),yr+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(yr+="<mrow>"),e.leftDelim&&e.leftDelim!=="."&&(yr+="<mo"+Nn(e.id,r)+">"+(Hs[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(yr+="<mfrac>",yr+=on(e.above,r)||"<mi>&nbsp;</mi>",yr+=on(e.below,r)||"<mi>&nbsp;</mi>",yr+="</mfrac>"):(yr+="<mtable"+Nn(e.id,r)+">",yr+="<mtr>"+on(e.above,r)+"</mtr>",yr+="<mtr>"+on(e.below,r)+"</mtr>",yr+="</mtable>"),e.rightDelim&&e.rightDelim!=="."&&(yr+="<mo"+Nn(e.id,r)+">"+(Hs[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(yr+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(yr+="<msqrt"+Nn(e.id,r)+">",yr+=on(e.body,r),yr+="</msqrt>"):(yr+="<mroot"+Nn(e.id,r)+">",yr+=on(e.body,r),yr+=on(e.above,r),yr+="</mroot>");break;case"leftright":const il=e,nl=il.leftDelim;yr="<mrow>",nl&&nl!=="."&&(yr+=`<mo${Nn(e.id,r)}>${(n=Hs[nl])!=null?n:nl}</mo>`),e.body&&(yr+=on(e.body,r));const sl=il.matchingRightDelim();sl&&sl!=="."&&(yr+=`<mo${Nn(e.id,r)}>${(a=Hs[sl])!=null?a:sl}</mo>`),yr+="</mrow>";break;case"sizeddelim":case"delim":yr+=`<mo${Nn(e.id,r)}>${Hs[e.value]||e.value}</mo>`;break;case"accent":yr+='<mover accent="true"'+Nn(e.id,r)+">",yr+=on(e.body,r),yr+="<mo>"+(rl[ys]||e.accent)+"</mo>",yr+="</mover>";break;case"line":case"overlap":break;case"overunder":Ca=e.above,Wa=e.below,(e.svgAbove||Ca)&&(e.svgBelow||Wa)?$n=e.body:Ca&&Ca.length>0?($n=e.body,(p=(c=e.body)==null?void 0:c[0])!=null&&p.below?(Wa=e.body[0].below,$n=e.body[0].body):((A=(g=e.body)==null?void 0:g[0])==null?void 0:A.type)==="first"&&((I=(T=e.body)==null?void 0:T[1])!=null&&I.below)&&(Wa=e.body[1].below,$n=e.body[1].body)):Wa&&Wa.length>0&&($n=e.body,(re=(K=e.body)==null?void 0:K[0])!=null&&re.above?(Ca=e.body[0].above,$n=e.body[0].body):((Oe=(ve=e.body)==null?void 0:ve[0])==null?void 0:Oe.type)==="first"&&((vt=(Ke=e.body)==null?void 0:Ke[1])!=null&&vt.above)&&(Ca=e.body[1].overscript,$n=e.body[1].body)),(e.svgAbove||Ca)&&(e.svgBelow||Wa)?(yr+=`<munderover ${Nn(e.id,r)}>`,yr+=(ur=Xi[e.svgBody])!=null?ur:on($n,r),yr+=(mt=Xi[e.svgBelow])!=null?mt:on(Wa,r),yr+=(zt=Xi[e.svgAbove])!=null?zt:on(Ca,r),yr+="</munderover>"):e.svgAbove||Ca?(yr+=`<mover ${Nn(e.id,r)}>`+((pr=Xi[e.svgBody])!=null?pr:on($n,r)),yr+=(Zt=Xi[e.svgAbove])!=null?Zt:on(Ca,r),yr+="</mover>"):(e.svgBelow||Wa)&&(yr+=`<munder ${Nn(e.id,r)}>`+((Hr=Xi[e.svgBody])!=null?Hr:on($n,r)),yr+=(ni=Xi[e.svgBelow])!=null?ni:on(Wa,r),yr+="</munder>");break;case"placeholder":yr+="?";break;case"mord":{yr=typeof e.value=="string"?e.value:ys,ys==="\\char"?yr="&#x"+("000000"+e.args[0].number.toString(16)).slice(-4)+";":yr.length>0&&yr.startsWith("\\")&&(typeof e.value=="string"&&e.value.charCodeAt(0)>255?yr="&#x"+("000000"+e.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof e.value=="string"?yr=e.value.charAt(0):(console.error("Did not expect this"),yr=""));const Mo=/\d/.test(yr)?"mn":"mi";yr=`<${Mo}${Nn(e.id,r)}>${dd(yr)}</${Mo}>`;break}case"mbin":case"mrel":case"minner":yr=g0(e,r);break;case"mpunct":yr='<mo separator="true"'+Nn(e.id,r)+">"+ys+"</mo>";break;case"mop":case"operator":case"extensible-symbol":e.body!=="\u200B"&&(yr="<mo"+Nn(e.id,r)+">",yr+=ys==="\\operatorname"?e.body:ys||e.body,yr+="</mo>");break;case"box":yr='<menclose notation="box"',e.backgroundcolor&&(yr+=' mathbackground="'+e.backgroundcolor+'"'),yr+=Nn(e.id,r)+">"+on(e.body,r)+"</menclose>";break;case"spacing":yr+='<mspace width="'+((Yr=Pn[ys])!=null?Yr:0)+'em"/>';break;case"enclose":yr='<menclose notation="';for(const Mo in e.notation)Object.prototype.hasOwnProperty.call(e.notation,Mo)&&e.notation[Mo]&&(yr+=Va+Mo,Va=" ");yr+=Nn(e.id,r)+'">'+on(e.body,r)+"</menclose>";break;case"prompt":yr='<menclose notation="roundexbox""">'+on(e.body,r)+"</menclose>";break;case"space":yr+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":yr+=g0(e,r);break;case"mclose":yr+=g0(e,r);break;case"macro":{const Mo=e.command+oc(e.macroArgs);Mo&&(yr+=`<mo ${Nn(e.id,r)}>${Mo}</mo>`)}break;case"latexgroup":yr+=on(e.body,r);break;case"latex":yr+="<mtext"+Nn(e.id,r)+">"+e.value+"</mtext>";break;case"tooltip":yr+=on(e.body,r);break;case"text":yr+=`<mtext ${Nn(e.id,r)}x>${e.value}</mtext>`;break;default:if(e.command==="\\displaystyle")return`<mrow ${Nn(e.id,r)} displaystyle="true">${on(e.body,r)}</mrow>`;if(e.command==="\\textstyle")return`<mrow ${Nn(e.id,r)} displaystyle="false">${on(e.body,r)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return yr}var lc={"\\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"},Rf={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 r="";return e.startsWith("\\")&&(r=" "+e.replace("\\","")+" "),r}function Zc(e){let r=0;if(M(e))for(const n of e)n.type!=="first"&&(r+=1);return r===1}function Km(e){if(M(e)){for(const r of e)if(r.type!=="first"&&r.id)return r.id.toString()}return""}function Tp(e){let r="";if(M(e))for(const n of e)n.type!=="first"&&typeof n.value=="string"&&(r+=n.value);return r}function Um(e){return e?e.map(r=>r.value).join(""):""}function Wi(e,r){var n,a,c,p,g;function A(K){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(K)?` <say-as interpret-as="character">${K}</say-as>`:/[A-Z]/.test(K)?`capital <say-as interpret-as="character">${K.toLowerCase()}</say-as>`:K:/[a-z]/.test(K)?" '"+K.toUpperCase()+"'":/[A-Z]/.test(K)?" 'capital "+K.toUpperCase()+"'":K}function T(K){return"<emphasis>"+K+"</emphasis>"}if(!r)return"";let I="";if(M(r)){let K=!1,re=!1;for(let ve=0;ve<r.length;ve++)r[ve].type!=="first"&&(r[ve].mode!=="text"&&(re=!1),ve<r.length-2&&r[ve].type==="mopen"&&r[ve+2].type==="mclose"&&r[ve+1].type==="mord"?(I+=" of ",I+=T(Wi(e,r[ve+1])),ve+=2):r[ve].mode==="text"?re?I+=(n=r[ve].value)!=null?n:" ":(re=!0,I+=Wi("text",r[ve])):r[ve].isDigit()?K?I+=r[ve].asDigit():(K=!0,I+=Wi(e,r[ve])):(K=!1,I+=Wi(e,r[ve])))}else if(r.mode==="text")r.id&&e==="math"&&(I+='<mark name="'+r.id.toString()+'"/>'),I+=r.value;else{r.id&&e==="math"&&(I+='<mark name="'+r.id.toString()+'"/>');let K="",re="",ve="",Oe=!1;const{command:Ke}=r;switch(Ke){case"\\vec":return"vector "+Wi(e,r.body);case"\\acute":return Wi(e,r.body)+" acute";case"\\grave":return Wi(e,r.body)+" grave";case"\\dot":return"dot over"+Wi(e,r.body);case"\\ddot":return"double dot over"+Wi(e,r.body);case"\\mathring":return"ring over"+Wi(e,r.body);case"\\tilde":case"\\widetilde":return"tilde over"+Wi(e,r.body);case"\\bar":return Wi(e,r.body)+" bar";case"\\breve":return Wi(e,r.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Wi(e,r.body);case"\\hat":case"\\widehat":return"hat over"+Wi(e,r.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Wi(e,r.body);case"\\underarc":case"\\underparen":return"arc under "+Wi(e,r.body)}switch(r.type){case"prompt":const vt=r.body.length>1?'start input . <break time="500ms"/> '+Wi(e,r.body)+'. <break time="500ms"/> end input':"blank";I+=' <break time="300ms"/> '+vt+'. <break time="700ms"/>'+((a=r.correctness)!=null?a:"")+' . <break time="700ms"/> ';break;case"array":const ur=r.array,mt=r.environmentName;if(Object.keys(Rf).includes(mt)){I+=` begin ${Rf[mt]} `;for(let Zt=0;Zt<ur.length;Zt++){Zt>0&&(I+=","),I+=` row ${Zt+1} `;for(let Hr=0;Hr<ur[Zt].length;Hr++)Hr>0&&(I+=","),I+=` column ${Hr+1}: `,I+=Wi("math",ur[Zt][Hr])}I+=` end ${Rf[mt]} `}break;case"group":Ke==="\\ne"?I+=" not equal ":(Ke==="\\not"&&(I+=" not "),I+=Wi("math",r.body));break;case"root":I+=Wi("math",r.body);break;case"genfrac":if(K=Wi("math",r.above),re=Wi("math",r.below),Zc(r.above)&&Zc(r.below)){const Hr={"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 "}[Tp(r.above)+"/"+Tp(r.below)];Hr?I=Hr:I+=K+" over "+re}else I+=' the fraction <break time="150ms"/>'+K+' over <break time="150ms"/>'+re+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(ve=Wi("math",r.body),r.hasEmptyBranch("above"))I+=Zc(r.body)?" the square root of "+ve+" , ":' the square root of <break time="200ms"/>'+ve+'. <break time="200ms"/> End square root';else{let Zt=Wi("math",r.above);Zt=Zt.trim();const Hr=Zt.replace(/<mark([^/]*)\/>/g,"");Hr==="3"?I+=' the cube root of <break time="200ms"/>'+ve+'. <break time="200ms"/> End cube root':Hr==="n"?I+=' the nth root of <break time="200ms"/>'+ve+'. <break time="200ms"/> End root':I+=' the root with index: <break time="200ms"/>'+Zt+', of <break time="200ms"/>'+ve+'. <break time="200ms"/> End root'}break;case"leftright":{const Zt=r;I+=(c=Zt.leftDelim?lc[Zt.leftDelim]:void 0)!=null?c:Zt.leftDelim,I+=Wi("math",r.body),I+=(p=Zt.rightDelim?lc[Zt.rightDelim]:void 0)!=null?p:Zt.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const zt=Ke.replace(/^\\/g,""),pr=gr()[zt];pr&&(pr!=null&&pr.expand?I+=Wi("math",r.body):I+=`${zt} `);break;case"placeholder":I+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(Ke==="\\mathbin"||Ke==="\\mathrel"||Ke==="\\mathopen"||Ke==="\\mathclose"||Ke==="\\mathpunct"||Ke==="\\mathord"||Ke==="\\mathinner"){I=Wi(e,r.body);break}let Zt=r.isDigit()?r.asDigit():r.value,Hr=r.command;if((r.type==="delim"||r.type==="sizeddelim")&&(Hr=r.value,Zt=Hr),e==="text")I+=Zt;else{if(r.type==="mbin"&&(I+='<break time="150ms"/>'),Zt){const ni=lc[Zt]||(Hr?lc[Hr.trim()]:"");if(ni)I+=" "+ni;else{const Yr=Hr?zm(Hr.trim()):"";I+=Yr||A(Zt)}}else I+=Wi("math",r.body);r.type==="mbin"&&(I+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(r.value!=="\u200B"){const Zt=r.command;if(Zt==="\\sum")if(!r.hasEmptyBranch("superscript")&&!r.hasEmptyBranch("subscript")){let Hr=Wi("math",r.superscript);Hr=Hr.trim();let ni=Wi("math",r.subscript);ni=ni.trim(),I+=' the summation from <break time="200ms"/>'+ni+'<break time="200ms"/> to <break time="200ms"/>'+Hr+'<break time="200ms"/> of <break time="150ms"/>',Oe=!0}else if(r.hasEmptyBranch("subscript"))I+=" the summation of";else{let Hr=Wi("math",r.subscript);Hr=Hr.trim(),I+=' the summation from <break time="200ms"/>'+Hr+'<break time="200ms"/> of <break time="150ms"/>',Oe=!0}else if(Zt==="\\prod")if(!r.hasEmptyBranch("superscript")&&!r.hasEmptyBranch("subscript")){let Hr=Wi("math",r.superscript);Hr=Hr.trim();let ni=Wi("math",r.subscript);ni=ni.trim(),I+=' the product from <break time="200ms"/>'+ni+'<break time="200ms"/> to <break time="200ms"/>'+Hr+'<break time="200ms"/> of <break time="150ms"/>',Oe=!0}else if(r.hasEmptyBranch("subscript"))I+=" the product of ";else{let Hr=Wi("math",r.subscript);Hr=Hr.trim(),I+=' the product from <break time="200ms"/>'+Hr+'<break time="200ms"/> of <break time="150ms"/>',Oe=!0}else if(Zt==="\\int")if(!r.hasEmptyBranch("superscript")&&!r.hasEmptyBranch("subscript")){let Hr=Wi("math",r.superscript);Hr=Hr.trim();let ni=Wi("math",r.subscript);ni=ni.trim(),I+=' the integral from <break time="200ms"/>'+T(ni)+'<break time="200ms"/> to <break time="200ms"/>'+T(Hr)+' <break time="200ms"/> of ',Oe=!0}else I+=' the integral of <break time="200ms"/> ';else if(typeof r.value=="string"){const Hr=(g=lc[r.value])!=null?g:r.command?lc[r.command]:void 0;I+=Hr||" "+r.value}else r.command&&(r.command==="\\mathop"?I+=Wi("math",r.body):r.command==="\\operatorname"?I+=Um(r.body):I+=r.command.startsWith("\\")?" "+r.command.slice(1):" "+r.command)}break;case"enclose":ve=Wi("math",r.body),I+=" crossed out "+ve+". End crossed out.";break;case"space":case"spacing":break}if(!Oe&&!r.hasEmptyBranch("superscript")){let vt=Wi(e,r.superscript);vt=vt.trim();const ur=vt.replace(/<[^>]*>/g,"");if(Zc(r.superscript)){if(e==="math"){const mt=Km(r.superscript);mt&&(I+='<mark name="'+mt+'"/>')}ur==="\u2032"?I+=" prime ":ur==="2"?I+=" squared ":ur==="3"?I+=" cubed ":Number.isNaN(Number.parseInt(ur))?I+=" to the "+vt+"; ":I+=' to the <say-as interpret-as="ordinal">'+ur+"</say-as> power; "}else Number.isNaN(Number.parseInt(ur))?I+=" raised to the "+vt+"; ":I+=' raised to the <say-as interpret-as="ordinal">'+ur+"</say-as> power; "}if(!Oe&&!r.hasEmptyBranch("subscript")){let vt=Wi("math",r.subscript);vt=vt.trim(),I+=Zc(r.subscript)?" sub "+vt:" subscript "+vt+". End subscript. "}}return I}function uc(e){var r,n;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const c=on(e);if(c){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(r=window.MathfieldElement.textToSpeechRulesOptions)!=null?r:{},window.MathfieldElement.textToSpeechRulesOptions=d(z({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=d(z({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=d(z({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const p=(n=window.SRE)!=null?n:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&p.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let g="";try{g=p.toSpeech(c)}catch(A){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",A)}return g}return""}let a=Wi("math",e);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let c="";window.MathfieldElement.speechEngineRate&&(c='<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>'+c+"<p><s>"+a+"</s></p>"+(c?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&le()==="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 Yc={"\\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"},Xc={"\\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 r="";for(const n of e){const a=r[r.length-1];a!==void 0&&/\d/.test(a)&&/^\d/.test(n)&&(r+=" "),r+=n}return r}function vs(e){var r,n,a,c,p,g,A,T,I,K,re,ve,Oe;if(!e)return"";if(M(e)){if(e.length===0)return"";if(e[0].mode==="latex")return e.map(vs).join("");if(e[0].mode==="text"){let pr=0,Zt="";for(;((r=e[pr])==null?void 0:r.mode)==="text";)Zt+=e[pr].body?vs(e[pr].body):e[pr].value,pr++;return`"${Zt}" ${vs(e.slice(pr))}`}let mt=0;const zt=[];for(;e[mt]&&e[mt].mode==="math";){let pr="";for(;e[mt]&&e[mt].type==="mord"&&/\d/.test(e[mt].value);)pr+=e[mt++].value;pr?zt.push(pr):zt.push(vs(e[mt++]))}return zt.push(vs(e.slice(mt))),Hm(zt)}if(e.mode==="text")return`"${e.value}"`;let Ke="";const{command:vt}=e;let ur;if(vt==="\\placeholder")return`(${vs(e.body)})`;switch(e.type){case"accent":const mt={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[vt];Ke=`${mt!=null?mt:""} ${vs(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map(Yr=>Yr.value).join("");case"group":case"root":Ke=(n=Yc[vt])!=null?n:vs(e.body);break;case"genfrac":{const Yr=e;(Yr.leftDelim||Yr.rightDelim)&&(Ke=Yr.leftDelim==="."||!Yr.leftDelim?"{:":Yr.leftDelim),Yr.hasBarLine?(Ke+="(",Ke+=vs(Yr.above),Ke+=")/(",Ke+=vs(Yr.below),Ke+=")"):(Ke+="("+vs(Yr.above)+"),",Ke+="("+vs(Yr.below)+")"),(Yr.leftDelim||Yr.rightDelim)&&(Ke+=Yr.rightDelim==="."||!Yr.rightDelim?"{:":Yr.rightDelim)}break;case"surd":Ke+=e.hasEmptyBranch("above")?"sqrt("+vs(e.body)+")":"root("+vs(e.above)+")("+vs(e.body)+")";break;case"latex":Ke=e.value;break;case"leftright":{const Yr=e,Xi=Yr.leftDelim;Ke+=Xi==="."||!Xi?"{:":Xi,Ke+=vs(Yr.body);const Pn=Yr.matchingRightDelim();Ke+=Pn==="."||!Pn?":}":Pn}break;case"sizeddelim":case"delim":Ke=e.value;break;case"overlap":break;case"overunder":break;case"mord":Ke=(c=(a=Yc[vt])!=null?a:vt)!=null?c:typeof e.value=="string"?e.value:"",Ke.startsWith("\\")&&(Ke+=" "),ur=vt?vt.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,ur?Ke=String.fromCodePoint(Number.parseInt("0x"+ur[1])):Ke.length>0&&Ke.startsWith("\\")&&(Ke=typeof e.value=="string"?e.value.charAt(0):e.command),Ke=Gm(Ke,e.style);break;case"mbin":case"mrel":case"minner":Ke=(g=(p=Yc[vt])!=null?p:Xc[vt])!=null?g:e.value;break;case"mopen":case"mclose":Ke=e.value;break;case"mpunct":Ke=(A=Xc[vt])!=null?A:vt;break;case"mop":case"operator":case"extensible-symbol":e.value!=="\u200B"&&(Xc[vt]?Ke=Xc[vt]:Ke=vt==="\\operatorname"?vs(e.body):(T=e.value)!=null?T:vt,Ke+=" ");break;case"array":const zt=e.array,pr=e.environmentName,Zt=(I={bmatrix:["[","]"],"bmatrix*":["[","]"]}[pr])!=null?I:["(",")"],Hr=[];for(const Yr of zt){const Xi=[];for(const Pn of Yr)Xi.push(Zt[0]+vs(Pn)+Zt[1]);Hr.push(Xi.join(","))}const ni=(K={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[pr])!=null?K:["(",")"];Ke=ni[0]+Hr.join(",")+ni[1];break;case"box":break;case"spacing":Ke=(re=Yc[vt])!=null?re:" ";break;case"enclose":Ke="("+vs(e.body)+")";break;case"space":Ke=" ";break;case"subsup":Ke="";break;case"macro":Ke=(Oe=(ve=Yc[vt])!=null?ve:Xc[vt])!=null?Oe:vs(e.body);break}if(!e.hasEmptyBranch("subscript")){Ke+="_";const mt=vs(e.subscript);Ke+=mt.length!==1?`(${mt})`:mt}if(!e.hasEmptyBranch("superscript")){Ke+="^";const mt=vs(e.superscript);Ke+=mt.length!==1?`(${mt})`:mt}return Ke}function Gm(e,r){if(!r)return e;let n=e;return r.variant==="double-struck"&&(n=`bbb "${n}"`),r.variant==="script"&&(n=`cc "${n}"`),r.variant==="fraktur"&&(n=`fr "${n}"`),r.variant==="sans-serif"&&(n=`sf "${n}"`),r.variant==="monospace"&&(n=`tt "${n}"`),r.variantStyle==="bold"&&(n=`bb "${n}"`),r.color?`color({${r.color}})(${n})`:n}function Ks(e,r){var n,a;r!=null||(r={}),r.mathstyle=(n=r.mathstyle)!=null?n:"displaystyle";const c=new ji({from:d(z({},Ku()),{renderPlaceholder:()=>new fr(160,{maxFontSize:1}),letterShapeStyle:(a=r==null?void 0:r.letterShapeStyle)!=null?a:"tex"}),mathstyle:r.mathstyle}),g=new Mt({mode:"math",type:"root",body:zs(e,{context:c,parseMode:"math",mathstyle:r.mathstyle})}).render(c);return g?(D0(Xu(g,c)),M0(g,{classes:"ML__latex"}).toMarkup()):""}function Pg(e){return Mh(e,{context:Ku()})}function Vm(e,r={}){return on(zs(e,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),r)}function Wm(e){const r=zs(e,{parseMode:"math",mathstyle:"displaystyle"});return uc(r)}var fd;function jm(e){var r,n;if(!fd){const a=(r=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:r.ComputeEngine;a?fd=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=fd==null?void 0:fd.box(e).latex)!=null?n:""}function Og(e,r="math"){return vs(new Mt({type:"root",body:zs(e,{parseMode:r})}))}function Bg(e){return F0(e,{format:"ascii-math"})[1]}function Pf(e){if(typeof e=="string"){const r=qm(e);if(!r)throw new Error(`Invalid color: ${e}`);return r}return"C"in e?Ym(e):"a"in e?Cp(e):e}function cc(e){return e<0?0:e>255?255:Math.round(e)}function qm(e){if(!e||e[0]!=="#")return;e=e.slice(1);let r;return e.length<=4?(r={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(r.a=parseInt(e[3]+e[3],16)/255)):(r={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(r.a=parseInt(e[6]+e[7],16)/255)),r&&typeof r.a=="undefined"&&(r.a=1),r}function Of(e){const[r,n,a]=[e.L,e.C,e.H],c=a*Math.PI/180,p={L:r,a:n*Math.cos(c),b:n*Math.sin(c)};return e.alpha!==void 0&&(p.alpha=e.alpha),p}function Zm(e){const[r,n,a]=[e.L,e.a,e.b],c=Math.sqrt(n*n+a*a),g=Math.atan2(a,n)*180/Math.PI,A={L:r,C:c,H:g};return e.alpha!==void 0&&(A.alpha=e.alpha),A}function Bf(e){const[r,n,a]=[e.L,e.a,e.b],c=Math.pow(.9999999984505198*r+.39633779217376786*n+.2158037580607588*a,3),p=Math.pow(1.00000000888176*r-.10556134232365635*n-.0638541747717059*a,3),g=Math.pow(r*1.000000054672411-.0894841820949657*n-1.2914855378640917*a,3),A=4.076741661347994*c-3.307711590408193*p+.230969928729428*g,T=-1.2684380040921763*c+2.6097574006633715*p-.3413193963102197*g,I=-.004196086541837188*c-.7034186144594493*p+1.7076147009309444*g,K=re=>{const ve=Math.abs(re);return ve<=.0031308?re*12.92:(Math.sign(re)||1)*(1.055*Math.pow(ve,1/2.4)-.055)};return[K(A),K(T),K(I)]}function Ff(e){const[r,n,a]=e;return r>=0&&r<=1&&n>=0&&n<=1&&a>=0&&a<=1}function Nf(e,r){let[n,a,c]=e;return n=cc(n*255),a=cc(a*255),c=cc(c*255),r!==void 0?{r:n,g:a,b:c,alpha:r}:{r:n,g:a,b:c}}function Cp(e){let[r,n,a]=Bf(e);if(Ff([r,n,a]))return Nf([r,n,a],e.alpha);const c=Zm(e);if(c.C=0,[r,n,a]=Bf(Of(c)),!Ff([r,n,a]))return Nf([r,n,a],e.alpha);let p=0,g=e.L,A=(p+g)/2;c.C=A;const T=.36/Math.pow(2,12);for(;g-p>T;)A=(p+g)/2,c.C=A,[r,n,a]=Bf(Of(c)),Ff([r,n,a])?p=A:g=A;return Nf([r,n,a],e.alpha)}function Ym(e){return Cp(Of(e))}function Dp(e,r){const n=Pf(e),a=Pf(r),c=.56,p=.57,g=.62,A=.65,T=.022,I=1.414,K=.1,re=5e-4,ve=1.14,Oe=.027,Ke=1.14,vt=.027;function ur(Yr){return Yr>=T?Yr:Yr+Lo(T-Yr,I)}function mt(Yr){return(Yr<0?-1:1)*Math.pow(Math.abs(Yr),2.4)}const zt=ur(mt(a.r/255)*.2126729+mt(a.g/255)*.7151522+mt(a.b/255)*.072175),pr=ur(mt(n.r/255)*.2126729+mt(n.g/255)*.7151522+mt(n.b/255)*.072175);let Zt,Hr,ni;return Math.abs(pr-zt)<re?Hr=0:pr>zt?(Zt=Lo(pr,c)-Lo(zt,p),Hr=Zt*ve):(Zt=Lo(pr,A)-Lo(zt,g),Hr=Zt*Ke),Math.abs(Hr)<K?ni=0:Hr>0?ni=Hr-vt:ni=Hr+Oe,ni*100}function Mp(e,r,n){n!=null||(n="#fff"),r!=null||(r="#000");const a=Dp(e,n),c=Dp(e,r);return Math.abs(a)>Math.abs(c)?n:r}function Xm(e){const r=Pf(e);let n=((1<<24)+(cc(r.r)<<16)+(cc(r.g)<<8)+cc(r.b)).toString(16).slice(1);return r.alpha!==void 0&&r.alpha<1&&(n+=("00"+Math.round(r.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]+(r.alpha!==void 0&&r.alpha<1?n[6]:"")),"#"+n}function qn(e){const r=Lp(e);let n="";for(const a of r){if(typeof a.value!="string")return"";n+=a.value}return n}function Lp(e){const n=e.model.selection.ranges;return n.length!==1?[]:e.model.getAtoms(n[0])}function Jm(e,r){const n=Lp(e);if(n.length!==1)return!1;const a=J0[r];return a?!!a.test(n[0].value):!1}function Qm(e,r){return qn(e).length>0}function eg(e){return[$f(e,"double-struck","mathbb","tooltip.blackboard"),$f(e,"fraktur","mathfrak","tooltip.fraktur"),$f(e,"calligraphic","mathcal","tooltip.caligraphic"),zf(e,"up","mathrm","tooltip.roman-upright"),zf(e,"bold","mathbf","tooltip.bold"),zf(e,"italic","mathit","tooltip.italic")]}function tg(e){return[{label:()=>Ks(`\\vec{${qn(e)}}`),visible:()=>qn(e).length===1,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\overrightarrow{${qn(e)}}`),visible:()=>qn(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\overleftarrow{${qn(e)}}`),visible:()=>qn(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\dot{${qn(e)}}`),visible:()=>qn(e).length===1,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\ddot{${qn(e)}}`),visible:()=>qn(e).length===1,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\bar{${qn(e)}}`),visible:()=>qn(e).length===1,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\overline{${qn(e)}}`),visible:()=>qn(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\overgroup{${qn(e)}}`),visible:()=>qn(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\overbrace{${qn(e)}}`),visible:()=>qn(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\underline{${qn(e)}}`),visible:()=>qn(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\undergroup{${qn(e)}}`),visible:()=>qn(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\underbrace{${qn(e)}}`),visible:()=>qn(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function rg(e){return[{label:()=>Ks(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Ks(`\\bbox[5px, border: 2px dashed black]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function ig(e){const r=[];for(const n of Object.keys($e))r.push({class:(Xm(Mp($e[n]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${$e[n]} "></span>`,ariaLabel:()=>{var a;return(a=H(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 r}function ng(e){const r=[];for(const n of Object.keys(Se))r.push({class:(Mp(Se[n])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Se[n]} "></span>`,ariaLabel:()=>{var a;return(a=H(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 r}var sg=class extends yp{constructor(e,r,n,a){super(e,r),this.row=n,this.col=a}set active(e){const r=this.parentMenu.children;if(e)for(const n of r)n.element.classList.toggle("active",n.row<=this.row&&n.col<=this.col);else for(const n of r)n.element.classList.remove("active")}};function ag(e){const r=[];for(let n=1;n<=5;n++)for(let a=1;a<=5;a++)r.push({onCreate:(c,p)=>new sg(c,p,n,a),label:"\u2610",tooltip:()=>H("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 r}function og(e){return[{label:()=>H("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>e.executeCommand("addRowBefore"),visible:()=>v0(e)},{label:()=>H("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>v0(e)},{label:()=>H("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>v0(e),enabled:()=>{const r=e.model.parentEnvironment;if(!r)return!1;const[n,a]=ug(e);return n<r.maxColumns}},{label:()=>H("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>e.executeCommand("addColumnAfter"),visible:()=>v0(e)},{type:"divider"},{label:()=>H("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>v0(e)},{label:()=>H("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>v0(e)},{type:"divider"},{label:()=>H("menu.borders"),visible:()=>(lg(e)||v0(e))&&e.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Jc(e,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Jc(e,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Jc(e,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Jc(e,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Jc(e,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>H("menu.insert matrix"),id:"insert-matrix",visible:()=>e.isSelectionEditable,submenu:ag(e),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>H("menu.mode"),id:"mode",visible:()=>e.isSelectionEditable&&e.model.selectionIsCollapsed,submenu:[{label:()=>H("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{Ze(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>e.model.mode==="math"},{label:()=>H("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{Ze(e,"accept-all"),e.executeCommand(["switchMode","text"])},checked:()=>e.model.mode==="text"},{label:()=>H("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>e.executeCommand(["switchMode","latex"]),checked:()=>e.model.mode==="latex"}]},{type:"divider"},{label:()=>H("menu.font-style"),id:"variant",visible:()=>e.isSelectionEditable,submenu:eg(e),submenuClass:"variant-submenu"},{label:()=>H("menu.color"),id:"color",visible:()=>e.isSelectionEditable,submenu:ng(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>H("menu.background-color"),id:"background-color",visible:()=>e.isSelectionEditable,submenu:ig(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>H("menu.accent"),id:"accent",visible:()=>e.isSelectionEditable,submenu:tg(e),submenuClass:"variant-submenu"},{label:()=>H("menu.decoration"),id:"decoration",visible:()=>e.isSelectionEditable&&qn(e).length>0,submenu:rg(e),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>H("menu.evaluate"),id:"ce-evaluate",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const r=cg(e);if(!r){e.model.announce("plonk");return}e.model.selectionIsCollapsed?(e.model.position=e.model.lastOffset,e.insert(`=${r}`,{insertionMode:"insertAfter",selectionMode:"item"})):e.insert(r,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>H("menu.simplify"),id:"ce-simplify",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var r,n;if(e.model.selectionIsCollapsed){const a=(r=e.expression)==null?void 0:r.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 r;if(window.MathfieldElement.computeEngine===null)return"";const n=(r=e.expression)==null?void 0:r.unknowns[0];return n?H("menu.solve-for",Ks(n)):H("menu.solve")},id:"ce-solve",visible:()=>{var r;return e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((r=e.expression)==null?void 0:r.unknowns.length)===1&&e.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var r;const n=e.expression,a=n==null?void 0:n.unknowns[0],c=(r=n.solve(a))==null?void 0:r.map(p=>{var g;return(g=p.simplify().latex)!=null?g:""});if(!c){e.model.announce("plonk");return}e.insert(`${a}=${c.length===1?c[0]:"\\left\\lbrace"+(c==null?void 0:c.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>H("menu.cut"),onMenuSelect:()=>e.executeCommand("cutToClipboard"),visible:()=>!e.options.readOnly&&e.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>H("menu.copy"),id:"copy",submenu:[{label:()=>H("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>Un.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>H("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>Un.copyToClipboard(e,"ascii-math")},{label:()=>H("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>Un.copyToClipboard(e,"math-ml")}]},{label:()=>H("menu.paste"),id:"paste",onMenuSelect:()=>e.executeCommand("pasteFromClipboard"),visible:()=>e.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>H("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>e.executeCommand("selectAll")}]}function v0(e){var r;return!!((r=e.model.parentEnvironment)!=null&&r.array)}function lg(e){return e.model.at(e.model.position).type==="array"}function ug(e){var r;const n=(r=e.model.parentEnvironment)==null?void 0:r.array;return n?[n.length,n.reduce((a,c)=>Math.max(a,c.length),0)]:[0,0]}function Jc(e,r){xe(e),e.flushInlineShortcutBuffer(),Yf(e.model,r),ui(e)}function cg(e){var r,n;let a;if(e.model.selectionIsCollapsed?a=(r=window.MathfieldElement.computeEngine)==null?void 0:r.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 c=a.evaluate();return c.isSame(a)&&(c=a.N()),c.latex}function $f(e,r,n,a){return{label:()=>Ks(`\\${n}{${qn(e)}}`),tooltip:()=>{var c;return(c=H(a))!=null?c:a},visible:()=>Jm(e,r),checked:()=>{var c;return{some:"mixed",all:!0}[(c=e.queryStyle({variant:r}))!=null?c:!1]},onMenuSelect:()=>{e.applyStyle({variant:r},{operation:"toggle"}),e.adoptStyle="none"}}}function zf(e,r,n,a){return{label:()=>Ks(`\\${n}{${qn(e)}}`),tooltip:()=>{var c;return(c=H(a))!=null?c:a},visible:()=>Qm(e,r),checked:()=>{var c;return{some:"mixed",all:!0}[(c=e.queryStyle({variantStyle:r}))!=null?c:!1]},onMenuSelect:()=>{e.applyStyle({variantStyle:r},{operation:"toggle"}),e.adoptStyle="none"}}}function hc(e,r){return e+uc(r)}ta({speak:(e,r,n)=>hg(e,r,n)},{target:"mathfield"});function hg(e,r,n){var a,c;n=n!=null?n:{withHighlighting:!1};const{model:p}=e;function g(K){let re=null;switch(K){case"all":re=p.root;break;case"selection":re=p.getAtoms(p.selection);break;case"left":{re=p.getAtoms(p.offsetOf(p.at(p.position).leftSibling),p.position);break}case"right":{re=p.getAtoms(p.position,p.offsetOf(p.at(p.position).rightSibling));break}case"group":re=p.getAtoms(p.getSiblingsRange(p.position));break;case"parent":{const{parent:ve}=p.at(p.position);ve!=null&&ve.parent?re=ve:re=p.root;break}default:re=p.root}return re}function A(K){let re="";switch(K){case"all":console.log("Internal failure: speak all failed");break;case"selection":re="no selection";break;case"left":re="at start";break;case"right":re="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":re="no parent";break;default:console.log('unknown speak_ param value: "'+K+'"');break}return re}const T=g(r);if(T===null)return(c=(a=window.MathfieldElement).speakHook)==null||c.call(a,A(r)),!1;(n.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const I=uc(T);return O()&&n.withHighlighting?(yu().readAloudMathfield=e,hs(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,I)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(I),!1}function dg(e){var r,n;if(!O()){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"}),c={OutputFormat:"mp3",VoiceId:(r=window.MathfieldElement.speechEngineVoice)!=null?r:"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(c,(p,g)=>{if(p)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${p}`);else if(g!=null&&g.AudioStream){const A=new Uint8Array(g.AudioStream),T=new Blob([A.buffer],{type:"audio/mpeg"}),I=URL.createObjectURL(T);new Audio(I).play().catch(re=>console.log(re))}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 Ip(e){var r;let n;if(e.parent.type==="prompt")e.parentBranch==="body"&&(n="prompt");else if(e.parentBranch==="body")n=e.type&&(r={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[e.type])!=null?r:"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,r,n,a){let c="";if(r==="plonk")window.MathfieldElement.playSound("plonk"),e.flushInlineShortcutBuffer();else if(r==="delete")c=hc("deleted: ",a);else if(r==="focus"||r.includes("move"))c=pg(e.model,n)+(e.model.selectionIsCollapsed?"":"selected: ")+mg(e.model);else if(r==="replacement")c=hc("",e.model.at(e.model.position));else if(r==="line"){const p=hc("",e.model.root);e.keyboardDelegate.setAriaLabel(p)}else c=a?hc(r+" ",a):r;if(c){const p=e.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";e.ariaLiveText.textContent=c+p}}function pg(e,r){if(Number.isNaN(r))return"";const n=e.at(r);if(!n||n.treeDepth<=e.at(e.position).treeDepth)return"";let a="",c=n.parent;const p=e.at(e.position).parent;for(;c!==e.root&&c!==p;)a+=`out of ${Ip(c)};`,c=c.parent;return a}function mg(e){if(!e.selectionIsCollapsed)return hc("",e.getAtoms(e.selection));let r="";const n=e.at(e.position),a=Ip(n);return n.isFirstSibling&&(r=(a?"start of "+a:"unknown")+": "),n.isLastSibling?n.isFirstSibling||(r+=a?"end of "+a:"unknown"):r+=hc("",n),r}var gg=class{constructor(e,r,n){this.mathfield=e,this.mode=r,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,r){var n;const a=this.silenceNotifications;this.silenceNotifications=(n=r==null?void 0:r.silenceNotifications)!=null?n:!0;let c={};if((r==null?void 0:r.type)==="undo"&&(c={inputType:"historyUndo"}),(r==null?void 0:r.type)==="redo"&&(c={inputType:"historyRedo"}),this.contentWillChange(c)){const p=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=ko(e.content),this.selection=e.selection,this.silenceNotifications=p,this.contentDidChange(c)}this.silenceNotifications=a}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,r){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var n,a,c;const p=this.normalizeSelection(e,r);if(p===void 0)throw new TypeError("Invalid selection");if(p.ranges.length===1&&p.ranges[0][0]===p.ranges[0][1]){const K=p.ranges[0][0];if(!this.mathfield.dirty&&!((n=this.at(K))!=null&&n.parentPrompt)&&this.mathfield.hasEditablePrompts){if((a=this.at(K-1))!=null&&a.parentPrompt){this._anchor=this.normalizeOffset(K-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((c=this.at(K+1))!=null&&c.parentPrompt){this._anchor=this.normalizeOffset(K+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=K,this._position=K,this._selection=p;return}const g=Ws(p);p.direction==="backward"?[this._position,this._anchor]=g:[this._anchor,this._position]=g;const A=this.at(g[0]+1),T=this.at(g[1]),I=Mt.commonAncestor(A,T);(I==null?void 0:I.type)==="array"&&A.parent===I&&T.parent===I?this._selection={ranges:[g],direction:p.direction}:this._selection={ranges:[g],direction:p.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(e){var r;const n=this.at(e);(n==null?void 0:n.type)==="placeholder"?this.setSelection(e-1,e):((r=n==null?void 0:n.rightSibling)==null?void 0:r.type)==="placeholder"?this.setSelection(e,e+1):this.position=e,n instanceof Rs&&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 r=this.at(e),{parent:n}=r;if(!n)return[0,this.lastOffset];const a=r.parent.branch(r.parentBranch);return[this.offsetOf(a[0]),this.offsetOf(a[a.length-1])]}getBranchRange(e,r){const n=this.at(e).branch(r);return[this.offsetOf(n[0]),this.offsetOf(n[n.length-1])]}getAtoms(e,r,n){let a=n!=null?n:{};if(O0(e)){if(a=r!=null?r:{},e.ranges.length>1)return e.ranges.reduce((I,K)=>[...I,...this.getAtoms(K,a)],[]);e=e.ranges[0]}let c,p;if(Go(e)){if(c=e,!Go(r))return[];p=r}else[c,p]=e,a=r!=null?r:{};if(!Number.isFinite(c))return[];a.includeChildren===void 0&&(a.includeChildren=!1),c<0&&(c=this.lastOffset-c+1),p<0&&(p=this.lastOffset-p+1);const g=Math.min(c,p)+1,A=Math.max(c,p);if(!a.includeChildren&&g===1&&A===this.lastOffset)return[this.root];let T=[];for(let I=g;I<=A;I++){const K=this.atoms[I];Rp(this,K,g,A)&&T.push(K)}return a.includeChildren||(T=T.filter(I=>{let K=!1,{parent:re}=I;for(;re&&!K;)K=Rp(this,re,g,A),re=re.parent;return!K})),T}getAllAtoms(e=0){const r=[],n=this.lastOffset;for(let a=e;a<=n;a++)r.push(this.atoms[a]);for(let a=0;a<e;a++)r.push(this.atoms[a]);return r}findAtom(e,r=0,n="forward"){let a;const c=this.lastOffset;if(n==="forward"){for(let p=r;p<=c;p++)if(a=this.atoms[p],e(a))return a;for(let p=0;p<r;p++)if(a=this.atoms[p],e(a))return a;return}for(let p=r;p>=0;p--)if(a=this.atoms[p],e(a))return a;for(let p=c;p>r;p--)if(a=this.atoms[p],e(a))return a}extractAtoms(e){let r=this.getAtoms(e);if(r.length===1&&!r[0].parent)if(r[0].type==="root")r=[...r[0].body],r.shift();else return r=this.root.cells.flat(),this.root=new Mt({type:"root",body:[]}),r;for(const n of r)n.parent.removeChild(n);return r}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,r){const n=r!=null?r:"latex";if(n.startsWith("latex"))return Mt.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 on(e);if(n==="spoken")return uc(e);if(n==="spoken-text"){const a=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const c=uc(e);return window.MathfieldElement.textToSpeechMarkup=a,c}if(n==="spoken-ssml"||n==="spoken-ssml-with-highlighting"){const a=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const c=uc(e);return window.MathfieldElement.textToSpeechMarkup=a,c}return n==="ascii-math"?vs(e):(console.error(`MathLive 0.98.5: Unexpected format "${n}`),"")}getValue(e,r,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,c;if(Go(e)&&Go(r)?(a=[this.normalizeRange([e,r])],c=n):Gu(e)?(a=[this.normalizeRange(e)],c=r):O0(e)?(a=e.ranges,c=r):(a=[this.normalizeRange([0,-1])],c=e),c!=null||(c="latex"),c==="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 p=this.getValue({ranges:a},"latex-unstyled");try{const g=window.MathfieldElement.computeEngine.parse(p);return JSON.stringify(g.json)}catch(g){return JSON.stringify(["Error",`'${g.toString()}'`])}}if(c.startsWith("latex")){const p={expandMacro:c==="latex-expanded",skipStyles:c==="latex-unstyled",skipPlaceholders:c==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return Yi(a.map(g=>Mt.serialize(this.getAtoms(g),p)))}return a.map(p=>this.getAtoms(p).map(g=>this.atomToString(g,c)).join("")).join("")}extendSelectionTo(e,r){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const n=this.normalizeRange([e,r]);let[a,c]=n,{parent:p}=this.at(c);if(p&&(p.type==="genfrac"||p.type==="subsup"))for(;p!==this.root&&Kf(this,p,[a,c]);)c=this.offsetOf(p),p=p.parent;for(p=this.at(a).parent;p!==this.root&&Kf(this,p,[a,c]);)a=this.offsetOf(p.leftSibling),p=p.parent;if(p=this.at(c).parent,(p==null?void 0:p.type)==="genfrac")for(;p!==this.root&&Kf(this,p,[a,c]);)c=this.offsetOf(p),console.assert(c>=0),p=p.parent;this._position=this.normalizeOffset(r),this._selection={ranges:[[a,c]],direction:"none"}})}announce(e,r,n=[]){var a,c;((c=(a=this.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:r,atoms:n},cancelable:!0,bubbles:!0,composed:!0})))!=null?c:!0)&&fg(this.mathfield,e,r,n)}deferNotifications(e,r){const n=this._selection,a=this._anchor,c=this._position,p=this.silenceNotifications;this.silenceNotifications=!0;const g=this.root.changeCounter;r();const A=this.root.changeCounter!==g,T=a!==this._anchor||c!==this._position||Sd(this._selection,n)==="different";return this.silenceNotifications=p,e.content&&A&&this.contentDidChange({inputType:e.type}),e.selection&&T&&this.selectionDidChange(),A||T}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[r,n]=e;return r=this.normalizeOffset(r),n=this.normalizeOffset(n),r<n?[r,n]:[n,r]}normalizeSelection(e,r){var n;let a;if(Go(e)){const c=this.normalizeOffset(e);if(Go(r)){const p=this.normalizeOffset(r);a=c<=p?{ranges:[[c,p]],direction:"none"}:{ranges:[[p,c]],direction:"backward"}}else a={ranges:[[c,c]],direction:"none"}}else if(Gu(e)){const c=this.normalizeOffset(e[0]),p=this.normalizeOffset(e[1]);a=c<=p?{ranges:[[c,p]],direction:"none"}:{ranges:[[p,c]],direction:"backward"}}else O0(e)&&(a={ranges:e.ranges.map(c=>this.normalizeRange(c)),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 r=this.at(this.position);if(r){for(;r&&((e=r.parent)==null?void 0:e.type)!=="array";)r=r.parent;if(!(!(r!=null&&r.parent)||r.parent.type!=="array"))return r.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;const r=this.silenceNotifications;this.silenceNotifications=!0;const n=this.mathfield.onContentWillChange(e);return this.silenceNotifications=r,n}contentDidChange(e){var r;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Jo(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const n=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",d(z({},e),{data:e.data?e.data:(r=e.inputType)!=null?r:"",bubbles:!0,composed:!0}))),this.silenceNotifications=n}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Jo(this.mathfield)),this.silenceNotifications))return;const e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}};function Rp(e,r,n,a){const c=e.offsetOf(r);if(c<n||c>a)return!1;if(!r.hasChildren)return!0;const p=e.offsetOf(r.firstChild);if(p>=n&&p<=a){const g=e.offsetOf(r.lastChild);if(g>=n&&g<=a)return!0}return!1}function Kf(e,r,n){if(!(r!=null&&r.hasChildren))return!1;const[a,c]=n,p=e.offsetOf(r.firstChild),g=e.offsetOf(r.lastChild);return p>=a&&p<=c&&g>=p&&g<=c}function Qc(e,r,n,a){var c,p,g,A,T,I;const K=n.parent;if(K&&n instanceof Qn){const re=!a&&r==="forward"||a==="body"&&r==="backward";let ve=re?e.offsetOf(n.firstChild):e.offsetOf(n.lastChild);return re?n.rightDelim!=="?"&&n.rightDelim!=="."?(n.leftDelim=".",n.isDirty=!0):(K.addChildrenAfter(n.removeBranch("body"),n),K.removeChild(n),ve--):n.leftDelim!=="?"&&n.leftDelim!=="."?(n.rightDelim=".",n.isDirty=!0):(K.addChildrenAfter(n.removeBranch("body"),n),K.removeChild(n),ve--),e.position=ve,!0}if(K&&n.type==="surd"){if(r==="forward"&&!a||r==="backward"&&a==="body"){const re=n.leftSibling;n.hasChildren&&K.addChildrenAfter(n.removeBranch("body"),n),K.removeChild(n),e.position=e.offsetOf(re)}else r==="forward"&&a==="body"?e.position=e.offsetOf(n):!a&&r==="backward"?n.hasChildren?e.position=e.offsetOf(n.lastChild):(e.position=Math.max(0,e.offsetOf(n)-1),K.removeChild(n)):a==="above"&&(n.hasEmptyBranch("above")&&n.removeBranch("above"),r==="backward"?e.position=e.offsetOf(n.leftSibling):e.position=e.offsetOf(n.body[0]));return!0}if(K&&(n.type==="box"||n.type==="enclose")){const re=a&&r==="backward"||!a&&r==="forward"?n.leftSibling:n.lastChild;return K.addChildrenAfter(n.removeBranch("body"),n),K.removeChild(n),e.position=e.offsetOf(re),!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(r==="forward"?n.firstChild:n.lastChild),!0);const re=eh.fractionNavigationOrder==="numerator-denominator"?"above":"below",ve=re==="above"?"below":"above";if(K&&(r==="forward"&&a===re||r==="backward"&&a===ve)){const Oe=n.removeBranch(re),Ke=n.removeBranch(ve);return K.addChildrenAfter([...Oe,...Ke],n),K.removeChild(n),e.position=e.offsetOf(Oe.length>0?Oe[Oe.length-1]:Ke[0]),!0}return r==="backward"?e.position=e.offsetOf(n.leftSibling):e.position=e.offsetOf(n),!0}if(n.isExtensibleSymbol||n.type==="subsup"){if(!a&&r==="forward")return!1;if(!a){if(n.subscript||n.superscript){const re=r==="forward"?(g=(c=n.superscript)==null?void 0:c[0])!=null?g:(p=n.subscript)==null?void 0:p[0]:(I=(A=n.subscript)==null?void 0:A[0].lastSibling)!=null?I:(T=n.superscript)==null?void 0:T[0].lastSibling;return re&&(e.position=e.offsetOf(re)),!0}return!1}if(!n.hasChildren&&n.type==="subsup"){const re=r==="forward"?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);return n.parent.removeChild(n),e.position=re,!0}if(a==="superscript")if(r==="backward"){const re=e.offsetOf(n.firstChild)-1;console.assert(re>=0),e.position=re}else n.subscript?e.position=e.offsetOf(n.subscript[0]):e.position=e.offsetOf(n);else a==="subscript"&&(r==="backward"&&n.superscript?e.position=e.offsetOf(n.superscript[0].lastSibling):r==="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 re=r==="forward"?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);n.parent.removeChild(n),e.position=re}return!0}if((K==null?void 0:K.type)==="genfrac"&&!a&&n.type!=="first"){let re=e.offsetOf(n.leftSibling);return K.removeChild(n),K.hasEmptyBranch("above")&&K.hasEmptyBranch("below")?(re=e.offsetOf(K.leftSibling),K.parent.removeChild(K),e.announce("delete",void 0,[K]),e.position=re,!0):(e.announce("delete",void 0,[n]),e.position=re,!0)}if(r==="backward"&&((K==null?void 0:K.command)==="\\ln"||(K==null?void 0:K.command)==="\\log")&&n.parentBranch!=="body"){const re=e.offsetOf(K.leftSibling);return K.parent.removeChild(K),e.announce("delete",void 0,[K]),e.position=re,!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 r=e.at(e.position);if(!(r&&Qc(e,"backward",r))){if(r!=null&&r.isFirstSibling){if(Qc(e,"backward",r.parent,r.parentBranch))return;r=null}if(!r){e.announce("plonk");return}e.position=e.offsetOf(r.leftSibling),r.parent.removeChild(r),e.announce("delete",void 0,[r])}}):el(e,Ws(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 r,n;let a=e.at(e.position).rightSibling;if(a&&Qc(e,"forward",a))return;if(a){if(e.at(e.position).isLastSibling&&Qc(e,"forward",a.parent,a.parentBranch))return}else{if(a=e.at(e.position),a.isLastSibling&&Qc(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 c=(r=e.at(e.position))==null?void 0:r.rightSibling;for(;(c==null?void 0:c.type)==="subsup";)c.parent.removeChild(c),c=(n=e.at(e.position))==null?void 0:n.rightSibling;e.announce("delete",void 0,[a])}):el(e,Ws(e.selection),"deleteContentForward")}function el(e,r,n){const a=e.getAtoms(r);if(a.length>0&&a[0].parent){let c=a[0].parent.firstChild;c.type==="first"&&(c=c.rightSibling);const p=a[a.length-1].parent.lastChild;let g=a[0];g.type==="first"&&(g=g.rightSibling);const A=a[a.length-1];if(g===c&&A===p){const T=a[0].parent;T.parent&&T.type!=="prompt"&&(r=[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,I=a[0].parentBranch==="below"?"above":"below",K=e.offsetOf(T.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:n},()=>{var re,ve;const Oe=T.removeBranch(I);if(Oe.length===1&&Oe[0].type==="placeholder")(ve=T.parent)==null||ve.removeChild(T),e.position=Math.max(0,K);else{const Ke=T.parent.addChildrenAfter(Oe,T);(re=T.parent)==null||re.removeChild(T),e.position=e.offsetOf(Ke)}})}}return e.deferNotifications({content:!0,selection:!0,type:n},()=>e.deleteAtoms(r))}ta({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&el(e,[0,-1],"deleteContent"),deleteForward:e=>yg(e),deleteBackward:e=>vg(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&el(e,[e.anchor,gf(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&el(e,[e.anchor,gf(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&el(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&el(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&el(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&el(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="${H("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="${H("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,r){this.focusBlurInProgress=!1;var n,a,c;this.options=z(d(z({},Xh()),{macros:gr(),registers:P0()}),Yh(r)),this.eventController=new AbortController;const p=this.eventController.signal;r.eventSink&&(this.host=r.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=r.value)!=null?n:this.element.textContent)!=null?a:"";g=g.trim();const A=jf(this.options),T=new Mt({type:"root",mode:A,body:zs(g,{context:this.context})});this.model=new gg(this,A,T),this.undoManager=new W1(this.model);const I=[];if(I.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>"),I.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),I.push("<span part=content class=ML__content>"),I.push(js(this)),I.push("</span>"),window.mathVirtualKeyboard&&(I.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">`),I.push(bg),I.push("</div>")),I.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),I.push(_g),I.push("</div>"),I.push("</span>"),I.push("<span class=ML__sr-only>"),I.push("<span role=status aria-live=assertive aria-atomic=true></span>"),I.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(I.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=V.subscribe(()=>V.update(this.element)),V.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",re=>re.stopImmediatePropagation(),{capture:!1,signal:p}),this.field.addEventListener("wheel",this,{passive:!1,signal:p}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:p}):this.field.addEventListener("mousedown",this,{signal:p}),(c=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||c.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(Jo(this)))},{signal:p}),this._menu=new Lm(og(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:p});const K=this.element.querySelector("[part=menu-toggle]");K==null||K.addEventListener("pointerdown",re=>{if(re.currentTarget!==K||this._menu.state!=="closed")return;this.element.classList.add("tracking");const ve=K.getBoundingClientRect();this._menu.modifiers=Co(re),this._menu.show({target:K,location:{x:ve.left,y:ve.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),re.preventDefault(),re.stopPropagation()},{signal:p}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(K.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=s(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:p}),document.addEventListener("scroll",this,{signal:p}),this.resizeObserver=new ResizeObserver(()=>ui(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:p}),r0&&!V.locale.startsWith(r0.locale)&&uf(V.locale),_r!=="ready"&&document.fonts.ready.then(()=>ua(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),r=this.adoptStyle==="right"?e.rightSibling:e;if(!r)return this.defaultStyle;if(r.type==="group"){const n=r.branch("body");return!n||n.length<2?{}:this.adoptStyle==="right"?n[1].computedStyle:n[n.length-1].computedStyle}return r.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Jo(this)),ud(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Tf())}showMenu(e){var r,n;const a=(n=(r=e==null?void 0:e.location)!=null?r:Vu(this.field))!=null?n:void 0,c=e==null?void 0:e.modifiers,p=this.element.querySelector("[part=container]");return this._menu.show({target:p,location:a,modifiers:c})}get colorMap(){return e=>{var r,n,a;return(a=(n=(r=this.options).colorMap)==null?void 0:n.call(r,e))!=null?a:Xe(e)}}get backgroundColorMap(){return e=>{var r,n,a,c,p,g;return(g=(p=(n=(r=this.options).backgroundColorMap)==null?void 0:n.call(r,e))!=null?p:(c=(a=this.options).colorMap)==null?void 0:c.call(a,e))!=null?g:$t(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,r;return(r=(e=this.host)==null?void 0:e.disabled)!=null?r:!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),r=this.model.at(this.model.position),n=Mt.commonAncestor(e,r);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 r=z({},e[0].style);for(const n of e)for(const[a,c]of Object.entries(n.style))r[a]!==c&&delete r[a];return r}queryStyle(e){const r=wf(this,e);"verbatimColor"in r&&delete r.verbatimColor,"verbatimBackgroundColor"in r&&delete r.verbatimBackgroundColor;const n=Object.keys(r).length;if(n===0)return"all";if(n>1){for(const T of Object.keys(r)){const I=this.queryStyle({[T]:r[T]});if(I==="none")return"none";if(I==="some")return"some"}return"all"}const a=Object.keys(r)[0],c=r[a];if(this.model.selectionIsCollapsed)return this.effectiveStyle[a]===c?"all":"none";const p=this.model.getAtoms(this.model.selection,{includeChildren:!0});let g=p.length;if(g===0)return"none";let A=0;for(const T of p){if(T.type==="first"){g-=1;continue}T.style[a]===c&&(A+=1)}return A===0?"none":A===g?"all":"some"}get keybindings(){var e,r;if(this._keybindings)return this._keybindings;const[n,a]=k(this.options.keybindings,(e=i0())!=null?e:cf());return((r=i0())==null?void 0:r.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 r;this.options=z(z({},this.options),Yh(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"),((r=this.model.root.firstChild)==null?void 0:r.mode)!==n&&(this.model.root.firstChild.mode=n),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const a=Mt.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==a)&&Un.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)&&ui(this)}getOptions(e){return c0(this.options,e)}getOption(e){return c0(this.options,e)}handleEvent(e){return bu(this,null,function*(){var r;if(El(this)){if(Yo(e)){if(!Cc(e.origin,(r=this.options.originValidator)!=null?r:"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(o0(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"&&lp(this,e);break;case"pointerdown":this.userSelect!=="none"&&(lp(this,e),e.shiftKey===!1&&(yield wp(e,this.element.querySelector("[part=container]"),this._menu))&&sd.stop());break;case"contextmenu":this.userSelect!=="none"&&e.shiftKey===!1&&(yield wp(e,this.element.querySelector("[part=container]"),this._menu))&&sd.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&ud(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>El(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>El(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}})}dispose(){if(!El(this))return;V.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,im(),ei(),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 o0(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Jo(this))),!1):_n(this,e)}get errors(){return Mh(this.model.getValue(),{context:this.context})}getValue(e,r,n){return this.model.getValue(e,r,n)}setValue(e,r){var n;r=r!=null?r:{mode:"math"},r.insertionMode===void 0&&(r.insertionMode="replaceAll"),(r.format===void 0||r.format==="auto")&&(r.format="latex"),(r.mode===void 0||r.mode==="auto")&&(r.mode=(n=B0(this.model,this.model.position))!=null?n:"math");const a=this.undoManager.canUndo();Un.insert(this.model,e,r)&&(ui(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,c=this.host.getBoundingClientRect();c.bottom>a.top&&((e=window.document.scrollingElement)==null||e.scrollBy(0,c.bottom-a.top+8))}}this.dirty&&hs(this,{interactive:!0});const r=this.field.getBoundingClientRect();let n=null;if(this.model.selectionIsCollapsed)n=Vu(this.field);else{const a=Tc(this);if(a.length>0){let c=-1/0,p=-1/0;for(const g of a)g.right>c&&(c=g.right),g.top<p&&(p=g.top);n={x:c+r.left-this.field.scrollLeft,y:p+r.top-this.field.scrollTop,height:0}}}if(this.host&&n){const a=this.host.getBoundingClientRect(),c=n.y;let p=this.host.scrollTop;c<a.top?p=c-a.top+this.host.scrollTop:c>a.bottom&&(p=c-a.bottom+this.host.scrollTop+n.height),this.host.scroll({top:p,left:0})}if(n){const a=n.x-window.scrollX;let c=this.field.scrollLeft;a<r.left?c=a-r.left+this.field.scrollLeft-20:a>r.right&&(c=a-r.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:c})}}insert(e,r){return typeof e!="string"||e.length===0&&((r==null?void 0:r.insertionMode)==="insertBefore"||(r==null?void 0:r.insertionMode)==="insertAfter")||e.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),r=r!=null?r:{mode:"math"},r.focus&&this.focus(),r.feedback&&(window.MathfieldElement.keypressVibration&&he()&&navigator.vibrate(Zo),window.MathfieldElement.playSound("keypress")),e==="\\\\"?qf(this.model):e==="&"?Zf(this.model):this.model.selectionIsCollapsed?Un.insert(this.model,e,z({style:this.model.at(this.model.position).computedStyle},r)):Un.insert(this.model,e,r),this.snapshot(`insert-${this.model.at(this.model.position).type}`),ui(this),r.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(e,r="",n=""){var a;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const c=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=c;return}const p=this.model.mode,{model:g}=this;g.deferNotifications({content:!!n||!!r,selection:!0,type:"insertText"},()=>{let A=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),r&&e!=="latex"){const T=zs(r,{context:this.context,parseMode:e});g.collapseSelection("forward");const I=g.at(g.position);g.position=g.offsetOf(I.parent.addChildrenAfter(T,I)),A=!0}if(this.model.mode=e,e==="latex"){let T=g.selectionIsCollapsed;Ze(this,"accept");let I,K=g.at(g.position);if(T)I="\\";else{const ve=Ws(g.selection);I=this.model.getValue(ve,"latex");const Oe=this.model.extractAtoms(ve);Oe.length===1&&Oe[0].type==="placeholder"&&(I=r,T=!0),K=g.at(ve[0])}const re=new Ll(I);K.parent.addChildAfter(re,K),T?g.position=g.offsetOf(re.lastChild):g.setSelection(g.offsetOf(re.firstChild),g.offsetOf(re.lastChild))}else Q(g).forEach(T=>{T.isError=!1});if(n){const T=zs(n,{context:this.context,parseMode:p});g.collapseSelection("forward");const I=g.at(g.position);g.position=g.offsetOf(I.parent.addChildrenAfter(T,I)),A=!0}return ui(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),A}),this.model.mode=e,window.mathVirtualKeyboard.update(Jo(this))}hasFocus(){return!this.blurred}focus(e){var r;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(r=e==null?void 0:e.preventScroll)!=null&&r||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(e,r={}){var n,a;const c={operation:"set",silenceNotifications:!1};Gu(r)?c.range=r:(r.operation==="toggle"&&(c.operation="toggle"),c.range=r.range,c.silenceNotifications=(n=r.silenceNotifications)!=null?n:!1);const p=wf(this,e),g=(a=c.operation)!=null?a:"set";if(c.range===void 0&&this.model.selectionIsCollapsed){if(g==="set"){this.defaultStyle=z(z({},this.defaultStyle),p);return}const A=z({},this.defaultStyle);for(const T of Object.keys(p))A[T]===p[T]?(T==="color"&&delete A.verbatimColor,T==="backgroundColor"&&delete A.verbatimBackgroundColor,delete A[T]):A[T]=p[T];this.defaultStyle=A;return}this.model.deferNotifications({content:!c.silenceNotifications,type:"insertText"},()=>{if(c.range===void 0)for(const A of this.model.selection.ranges)pf(this.model,A,p,{operation:g});else pf(this.model,c.range,p,{operation:g})}),ui(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 r;return(r=this.element)==null?void 0:r.focus()}}),!0):!1}getCaretPoint(){const e=Vu(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,r){const n=qc(this,e,r,{bias:0});if(n<0)return!1;const a=this.model.position;return this.model.position=n,this.model.announce("move",a),ui(this),!0}getPrompt(e){const r=this.model.findAtom(n=>n.type==="prompt"&&n.placeholderId===e);return console.assert(r!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),r}getPromptValue(e,r){const n=this.getPrompt(e);if(!n)return"";const a=this.model.offsetOf(n.firstChild),c=this.model.offsetOf(n.lastChild);return this.model.getValue(a,c,r)}getPrompts(e){return this.model.getAllAtoms().filter(r=>r.type!=="prompt"?!1:e?!(e.id&&r.placeholderId!==e.id||e.locked&&r.locked!==e.locked||e.correctness==="undefined"&&r.correctness||e.correctness&&r.correctness!==e.correctness):!0).map(r=>r.placeholderId)}setPromptValue(e,r,n){if(r!==void 0){const a=this.getPrompt(e);if(!a){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}const c=this.model.getBranchRange(this.model.offsetOf(a),"body");this.model.setSelection(c),this.insert(r,d(z({},n),{insertionMode:"replaceSelection"}))}n!=null&&n.silenceNotifications&&(this.valueOnFocus=this.getValue()),ui(this)}setPromptState(e,r,n){const a=this.getPrompt(e);if(!a){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}r==="undefined"?a.correctness=void 0:typeof r=="string"&&(a.correctness=r),typeof n=="boolean"&&(a.locked=n,a.captureSelection=n),ui(this)}getPromptState(e){const r=this.getPrompt(e);return r?[r.correctness,r.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[void 0,!0])}getPromptRange(e){const r=this.getPrompt(e);return r?this.model.getBranchRange(this.model.offsetOf(r),"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 r;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Jo(this)),(r=this.host)==null||r.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(Jo(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(Jo(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,r;const n=this.model;this.keyboardDelegate.setValue(n.getValue(this.model.selection,"latex-expanded"));{const a=n.at(n.position),c=(e=a.mode)!=null?e:jf(this.options);this.model.mode!==c&&(this.model.mode==="latex"?(Ze(this,"accept",{mode:c}),n.position=n.offsetOf(a)):this.switchMode(c))}(r=this.host)==null||r.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Jo(this)),ud(this)}onContentWillChange(e){var r,n,a;return(a=(n=this.host)==null?void 0:n.dispatchEvent(new InputEvent("beforeinput",d(z({},e),{data:e.data?e.data:(r=e.inputType)!=null?r:"",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(),hs(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,r,n;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",jt(this),this.model.getValue()!==this.valueOnFocus&&((e=this.host)==null||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(r=this.host)==null||r.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(n=this.host)==null||n.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),ui(this),this.focusBlurInProgress=!1,Tf();const a=new AbortController,c=a.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{El(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:c})},{once:!0,signal:c}),setTimeout(()=>a.abort(),100)}onInput(e){bf(this,e)}onKeystroke(e){return sp(this,e)}onCompositionStart(e){this.model.deleteAtoms(Ws(this.model.selection));const r=Vu(this.field);r&&requestAnimationFrame(()=>{hs(this),this.keyboardDelegate.moveTo(r.x,r.y-r.height)})}onCompositionUpdate(e){F1(this.model,e),ui(this)}onCompositionEnd(e){N1(this.model),bf(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),Un.onCopy(this,e),el(this.model,Ws(this.model.selection),"deleteByCut"),this.snapshot("cut"),ui(this))}onCopy(e){Un.onCopy(this,e)}onPaste(e){let r=this.isSelectionEditable;return r&&(r=Un.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),r||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),r}onGeometryChange(){this._menu.hide(),ht(this),ud(this)}onWheel(e){const r=5*e.deltaX;if(!Number.isFinite(r)||r===0)return;const n=this.field;r<0&&n.scrollLeft===0||r>0&&n.offsetWidth+n.scrollLeft>=n.scrollWidth||(n.scrollBy({top:0,left:r}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let r=e;for(;!r.id&&r.hasChildren;)r=e.children[0];return this.field.querySelector(`[data-atom-id="${r.id}"]`)}get context(){var e,r;return{registers:(e=this.options.registers)!=null?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(r=this.options.placeholderSymbol)!=null?r:"\u25A2",colorMap:n=>this.colorMap(n),backgroundColorMap:n=>this.backgroundColorMap(n),getMacro:n=>Lr(n,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function Pp(e){if(e&&(e.classList.remove("ML__highlight"),e.children))for(const r of e.children)Pp(r)}function Uf(e,r){var n;e&&(!r||((n=e.dataset)==null?void 0:n.atomId)===r?(e.classList.add("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(a=>{a instanceof HTMLElement&&Uf(a)})):(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(a=>{a instanceof HTMLElement&&Uf(a,r)})))}function wg(e,r){var n;if(!O())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(r);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"}),c={OutputFormat:"json",VoiceId:(n=window.MathfieldElement.speechEngineVoice)!=null?n:"Joanna",Engine:"standard",Text:r,TextType:"ssml",SpeechMarkTypes:["ssml"]};yu().readAloudElement=e,a.synthesizeSpeech(c,(p,g)=>{if(p){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${p}`);return}if(!(g!=null&&g.AudioStream)){console.log("polly.synthesizeSpeech():",g);return}const A=new TextDecoder("utf-8").decode(new Uint8Array(g.AudioStream));yu().readAloudMarks=A.split(`
`).map(T=>T?JSON.parse(T):{}),yu().readAloudTokens=[];for(const T of yu().readAloudMarks)T.value&&yu().readAloudTokens.push(T.value);yu().readAloudCurrentMark="",c.OutputFormat="mp3",c.SpeechMarkTypes=[],a.synthesizeSpeech(c,(T,I)=>{if(T){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${r}") error:${T}`);return}if(!(I!=null&&I.AudioStream))return;const K=new Uint8Array(I.AudioStream),re=new Blob([K.buffer],{type:"audio/mpeg"}),ve=URL.createObjectURL(re),Oe=yu();Oe.readAloudAudio?Oe.readAloudAudio.pause():(Oe.readAloudAudio=new Audio,Oe.readAloudAudio.addEventListener("ended",()=>{const Ke=Oe.readAloudMathfield;Oe.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),Ke?(hs(Ke),Oe.readAloudElement=null,Oe.readAloudMathfield=null,Oe.readAloudTokens=[],Oe.readAloudMarks=[],Oe.readAloudCurrentMark=""):Pp(Oe.readAloudElement)}),Oe.readAloudAudio.addEventListener("timeupdate",()=>{let Ke="";const vt=Oe.readAloudAudio.currentTime*1e3+100;for(const ur of Oe.readAloudMarks)ur.time<vt&&(Ke=ur.value);Oe.readAloudCurrentMark!==Ke&&(Oe.readAloudCurrentToken=Ke,Ke&&Ke===Oe.readAloudFinalToken?Oe.readAloudAudio.pause():(Oe.readAloudCurrentMark=Ke,Uf(Oe.readAloudElement,Oe.readAloudCurrentMark)))})),Oe.readAloudAudio.src=ve,Oe.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),Oe.readAloudAudio.play()})})}O()||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 nn=new WeakMap,Sg=.5,vu={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 = ..."},qs=class y0 extends HTMLElement{static get formAssociated(){return dc()}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(r){r!==this._fontsDirectory&&(this._fontsDirectory=r,Pr())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(r){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(r){this._soundsDirectory=r,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(r){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(r){var n,a,c;this.audioBuffers={},r===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof r=="string"?this._keypressSound={spacebar:r,return:r,delete:r,default:r}:typeof r=="object"&&"default"in r&&(this._keypressSound={spacebar:(n=r.spacebar)!=null?n:r.default,return:(a=r.return)!=null?a:r.default,delete:(c=r.delete)!=null?c:r.default,default:r.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(r){this.audioBuffers={},this._plonkSound=r}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(r){this._speechEngine=r}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(r){this._speechEngineRate=r}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(r){this._speechEngineVoice=r}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(r){this._textToSpeechMarkup=r}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(r){this._textToSpeechRules=r}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(r){this._textToSpeechRulesOptions=r}static get locale(){return V.locale}static set locale(r){r==="auto"&&(r=navigator.language.slice(0,5)),V.locale=r}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(r){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return V.strings}static set strings(r){V.merge(r)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(r){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(r){this._decimalSeparator=r,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(r){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var r,n;if(this._computeEngine===void 0){const a=(r=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:r.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(r){this._computeEngine=r}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(r){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(r){this._isFunction=r}static loadSound(r){return bu(this,null,function*(){delete this.audioBuffers[r];let n="";switch(r){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 p=yield(yield fetch(yield li(`${a}/${n}`))).arrayBuffer(),g=yield this.audioContext.decodeAudioData(p);this.audioBuffers[r]=g}catch(c){}})}static playSound(r){return bu(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[r]||(yield this.loadSound(r)),!this.audioBuffers[r])return;const n=this.audioContext.createBufferSource();n.buffer=this.audioBuffers[r];const a=this.audioContext.createGain();a.gain.value=Sg,n.connect(a).connect(this.audioContext.destination),n.start()})}constructor(r){if(super(),r){const n=[];for(const a of Object.keys(r))if(vu[a])if(vu[a].startsWith("mf."))if(vu[a].startsWith(`mf.${a}`))n.push(`Option \`${a}\` cannot be used as a constructor option. Use ${vu[a]}`);else{const c=vu[a].match(/([a-zA-Z]+) =/);n.push(`Option \`${a}\` has been renamed \`${c[1]}\``)}else n.push(`Option \`${a}\` cannot be used as a constructor option. Use ${vu[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(dc()&&(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=[kl("core"),kl("mathfield"),kl("mathfield-element"),kl("ui"),kl("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>"+Al("core")+Al("mathfield")+Al("mathfield-element")+Al("ui")+Al("menu")+'</style><span></span><slot style="display:none"></slot>';r&&this._setOptions(r),this.shadowRoot.addEventListener("slotchange",()=>{var n;const a=this.shadowRoot.querySelector("slot:not([name])");this.value=(n=a==null?void 0:a.assignedNodes().map(c=>c.nodeType===3?c.textContent:"").join("").trim())!=null?n:""})}showMenu(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.showMenu(r))!=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",r=>{var n;r.target===this&&!((n=this._mathfield)!=null&&n.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:r.altKey,button:r.button,buttons:r.buttons,clientX:r.clientX,clientY:r.clientY,ctrlKey:r.ctrlKey,metaKey:r.metaKey,movementX:r.movementX,movementY:r.movementY,relatedTarget:r.relatedTarget,screenX:r.screenX,screenY:r.screenY,shiftKey:r.shiftKey}))},{once:!0})}getPromptValue(r,n){var a,c;return(c=(a=this._mathfield)==null?void 0:a.getPromptValue(r,n))!=null?c:""}setPromptValue(r,n,a){var c;(c=this._mathfield)==null||c.setPromptValue(r,n,a)}getPromptRange(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPromptRange(r))!=null?a:null}getPrompts(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPrompts(r))!=null?a:[]}get form(){var r;return(r=this._internals)==null?void 0:r.form}get name(){var r;return(r=this.getAttribute("name"))!=null?r:""}get type(){return this.localName}get mode(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.model.mode)!=null?n:this.defaultMode==="text"?"text":"math"}set mode(r){var n;(n=this._mathfield)==null||n.switchMode(r)}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(r){var n,a;if(!this._mathfield)return;const c=(a=(n=y0.computeEngine)==null?void 0:n.box(r).latex)!=null?a:null;c!==null&&this._mathfield.setValue(c),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 r,n;return(n=(r=this._mathfield)==null?void 0:r.errors)!=null?n:[]}_getOptions(r){return this._mathfield?c0(this._mathfield.options,r):nn.has(this)?z({},c0(z(z({},Xh()),Yh(nn.get(this).options)),r)):null}getOptions(r){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?c0(this._mathfield.options,r):nn.has(this)?c0(z(z({},Xh()),Yh(nn.get(this).options)),r):null}reflectAttributes(){const r=Xh(),n=this._getOptions();Object.keys(y0.optionsAttributes).forEach(a=>{const c=Nl(a);y0.optionsAttributes[a]==="on/off"?r[c]!==n[c]?this.setAttribute(a,n[c]?"on":"off"):this.removeAttribute(a):r[c]!==n[c]&&(y0.optionsAttributes[a]==="boolean"?n[c]?this.setAttribute(a,""):this.removeAttribute(a):(typeof n[c]=="string"||typeof n[c]=="number")&&this.setAttribute(a,n[c].toString()))})}getOption(r){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([r])[r]}_getOption(r){return this._getOptions([r])[r]}_setOptions(r){if(this._mathfield)this._mathfield.setOptions(r);else if(nn.has(this)){const n=z(z({},nn.get(this).options),r);nn.set(this,d(z({},nn.get(this)),{selection:{ranges:n.readOnly?[[0,0]]:[[0,-1]]},options:n}))}else nn.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:r,menuItems:void 0});this.reflectAttributes()}setOptions(r){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(r))vu[n]&&console.warn(`\`mf.setOptions({${n}:...})\` -> ${vu[n]}`);console.groupEnd(),this._setOptions(r)}executeCommand(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.executeCommand(r))!=null?a:!1}getValue(r,n,a){var c,p;if(this._mathfield)return this._mathfield.model.getValue(r,n,a);if(nn.has(this)){let g,A,T;if(O0(r)?([g,A]=r.ranges[0],T=n):Gu(r)?([g,A]=r,T=n):Go(r)&&Go(n)?(g=r,A=n,T=a):(g=0,A=-1,T=r),(T===void 0||T==="latex")&&g===0&&A===-1)return(p=(c=nn.get(this).value)!=null?c:this.textContent)!=null?p:""}return""}setValue(r,n){if(this._mathfield&&r!==void 0){n!=null||(n={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(r,n);return}if(nn.has(this)){const c=nn.get(this).options;nn.set(this,{value:r,selection:{ranges:[[-1,-1]],direction:"forward"},options:c,menuItems:void 0});return}const a=th(this);nn.set(this,{value:r,selection:{ranges:[[-1,-1]],direction:"forward"},options:a,menuItems:void 0})}hasFocus(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.hasFocus())!=null?n:!1}focus(){var r;(r=this._mathfield)==null||r.focus()}blur(){var r;(r=this._mathfield)==null||r.blur()}select(){var r;(r=this._mathfield)==null||r.select()}insert(r,n){var a,c;return(c=(a=this._mathfield)==null?void 0:a.insert(r,n))!=null?c:!1}applyStyle(r,n){var a;return(a=this._mathfield)==null?void 0:a.applyStyle(r,n)}queryStyle(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.queryStyle(r))!=null?a:"none"}get caretPoint(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.getCaretPoint())!=null?n:null}set caretPoint(r){var n;r&&((n=this._mathfield)==null||n.setCaretPoint(r.x,r.y))}setCaretPoint(r,n){var a,c;return(c=(a=this._mathfield)==null?void 0:a.setCaretPoint(r,n))!=null?c:!1}offsetFromPoint(r,n,a){return this._mathfield?qc(this._mathfield,r,n,a):-1}hitboxFromOffset(r){if(!this._mathfield)return null;const n=this._mathfield.model.at(r);if(!n)return null;const a=Wu(this._mathfield,n);return a?new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top):null}resetUndo(){var r;(r=this._mathfield)==null||r.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(r){var n,a,c,p;i.state==="closed"&&((a=(n=this._mathfield)==null?void 0:n.menu)==null?void 0:a.state)==="closed"&&(r.type==="pointerdown"&&this.onPointerDown(),r.type==="focus"&&((c=this._mathfield)==null||c.focus()),r.type==="blur"&&((p=this._mathfield)==null||p.blur()))}connectedCallback(){var r,n,a,c;const p=window.getComputedStyle(this),g=this.shadowRoot,A=p.userSelect!=="none";if(A)g.host.addEventListener("pointerdown",this,!0);else{const K=g.querySelector("span");K.style.pointerEvents="none"}g.host.addEventListener("focus",this,!0),g.host.addEventListener("blur",this,!0),dc()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),A&&!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(K=>K.tagName.toLowerCase()==="style").map(K=>K.textContent).join("")}catch(K){console.error(K)}if(this._style){const K=document.createElement("style");K.textContent=this._style,g.appendChild(K)}let I="";if(this.hasAttribute("value")?I=this.getAttribute("value"):I=(r=T==null?void 0:T.assignedNodes().map(K=>K.nodeType===3?K.textContent:"").join("").trim())!=null?r:"",this._mathfield=new xg(g.querySelector(":host > span"),d(z({},(a=(n=nn.get(this))==null?void 0:n.options)!=null?a:th(this)),{eventSink:this,value:I})),!nn.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const K of Object.keys(y0.optionsAttributes))this.upgradeProperty(Nl(K))}if(!((c=this._mathfield)!=null&&c.model)){this._mathfield=null;return}if(nn.has(this)){const K=this._mathfield,re=nn.get(this),ve=re.menuItems;K.model.deferNotifications({content:!1,selection:!1},()=>{const Oe=re.value;Oe!==void 0&&K.setValue(Oe),K.model.selection=re.selection,nn.delete(this)}),ve&&(this.menuItems=ve)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Ui()}disconnectedCallback(){var r,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=c0(this._mathfield.options,Object.keys(y0.optionsAttributes).map(c=>Nl(c)));nn.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(n=(r=this._mathfield.menu)==null?void 0:r.menuItems)!=null?n:void 0,options:a}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(r){if(this.hasOwnProperty(r)){const n=this[r];delete this[r],(r==="readonly"||r==="read-only")&&(r="readOnly"),this[r]=n}}attributeChangedCallback(r,n,a){if(n===a)return;const c=a!==null;switch(r){case"contenteditable":ui(this._mathfield);break;case"disabled":this.disabled=c;break;case"read-only":case"readonly":this.readOnly=c;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(r){const n=!!r;n?(this.setAttribute("readonly",""),dc()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(dc()?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(r){var n;const a=!!r;a?this.setAttribute("disabled",""):this.removeAttribute("disabled"),dc()?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(r){this.setValue(r)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(r){this._setOptions({defaultMode:r})}get macros(){return this._getOption("macros")}set macros(r){this._setOptions({macros:r})}get registers(){const r=this;return new Proxy({},{get:(n,a)=>{if(typeof a=="string")return r._getOption("registers")[a]},set(n,a,c){return typeof a!="string"?!1:(r._setOptions({registers:d(z({},r._getOption("registers")),{[a]:c})}),!0)}})}set registers(r){this._setOptions({registers:r})}get colorMap(){return this._getOption("colorMap")}set colorMap(r){this._setOptions({colorMap:r})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(r){this._setOptions({backgroundColorMap:r})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(r){this._setOptions({letterShapeStyle:r})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(r){this._setOptions({minFontScale:r})}get smartMode(){return this._getOption("smartMode")}set smartMode(r){this._setOptions({smartMode:r})}get smartFence(){return this._getOption("smartFence")}set smartFence(r){this._setOptions({smartFence:r})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(r){this._setOptions({smartSuperscript:r})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(r){this._setOptions({scriptDepth:r})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(r){this._setOptions({removeExtraneousParentheses:r})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(r){this._setOptions({mathModeSpace:r})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(r){this._setOptions({placeholderSymbol:r})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(r){this._setOptions({popoverPolicy:r})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(r){this._setOptions({environmentPopoverPolicy:r})}get menuItems(){var r,n,a;return this._mathfield?(r=this._mathfield.menu._menuItems.map(c=>c.menuItem))!=null?r:[]:(a=(n=nn.get(this))==null?void 0:n.menuItems)!=null?a:[]}set menuItems(r){var n;if(this._mathfield){const a=(n=this._mathfield.element)==null?void 0:n.querySelector("[part=menu-toggle]");a&&(a.style.display=r.length===0?"none":""),this._mathfield.menu.menuItems=r}nn.has(this)?nn.set(this,d(z({},nn.get(this)),{menuItems:r})):nn.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:th(this),menuItems:r})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(r){this._setOptions({mathVirtualKeyboardPolicy:r})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(r){this._setOptions({inlineShortcuts:r})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(r){this._setOptions({inlineShortcutTimeout:r})}get keybindings(){return this._getOption("keybindings")}set keybindings(r){this._setOptions({keybindings:r})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(r){this._setOptions({onInlineShortcut:r})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(r){this._setOptions({onScrollIntoView:r})}get onExport(){return this._getOption("onExport")}set onExport(r){this._setOptions({onExport:r})}get readOnly(){return this._getOption("readOnly")}set readOnly(r){this._setOptions({readOnly:r})}get isSelectionEditable(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.isSelectionEditable)!=null?n:!1}setPromptState(r,n,a){var c;(c=this._mathfield)==null||c.setPromptState(r,n,a)}getPromptState(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPromptState(r))!=null?a:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(r){this._setOptions({virtualKeyboardTargetOrigin:r})}get selection(){return this._mathfield?this._mathfield.model.selection:nn.has(this)?nn.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(r){if(typeof r=="number"&&(r={ranges:[[r,r]]}),this._mathfield){this._mathfield.model.selection=r,ui(this._mathfield);return}if(nn.has(this)){nn.set(this,d(z({},nn.get(this)),{selection:r}));return}nn.set(this,{value:void 0,selection:r,options:th(this),menuItems:void 0})}get selectionIsCollapsed(){const r=this.selection;return r.ranges.length===1&&r.ranges[0][0]===r.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:nn.has(this)?nn.get(this).selection.ranges[0][0]:0}set position(r){if(this._mathfield&&(this._mathfield.model.position=r,ui(this._mathfield)),nn.has(this)){nn.set(this,d(z({},nn.get(this)),{selection:{ranges:[[r,r]]}}));return}nn.set(this,{value:void 0,selection:{ranges:[[r,r]]},options:th(this),menuItems:void 0})}getOffsetDepth(r){var n,a;return this._mathfield?((a=(n=this._mathfield.model.at(r))==null?void 0:n.treeDepth)!=null?a:2)-2:0}get lastOffset(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.model.lastOffset)!=null?n:-1}};qs.version="0.98.5",qs._fontsDirectory="./fonts",qs._soundsDirectory="./sounds",qs.keypressVibration=!0,qs._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},qs._plonkSound="plonk.wav",qs.audioBuffers={},qs.createHTML=e=>e,qs._speechEngineRate="100%",qs._speechEngineVoice="Joanna",qs._textToSpeechMarkup="",qs._textToSpeechRules="mathlive",qs._textToSpeechRulesOptions={},qs.speakHook=dg,qs.readAloudHook=wg,qs._decimalSeparator=".",qs.fractionNavigationOrder="numerator-denominator",qs._isFunction=e=>{var r,n;const a=window.MathfieldElement.computeEngine;return(n=(r=a==null?void 0:a.parse(e).domain)==null?void 0:r.isFunction)!=null?n:!1};var eh=qs;function Nl(e){return e.replace(/[^a-zA-Z\d]+(.)/g,(r,n)=>n.toUpperCase())}function th(e){const r={readOnly:!1},n=eh.optionsAttributes;return Object.keys(n).forEach(a=>{if(e.hasAttribute(a)){const c=e.getAttribute(a);a==="placeholder"?r.contentPlaceholder=c!=null?c:"":n[a]==="boolean"?r[Nl(a)]=!0:n[a]==="on/off"?c==="on"?r[Nl(a)]=!0:c==="off"?r[Nl(a)]=!1:r[Nl(a)]=void 0:n[a]==="number"?r[Nl(a)]=Number.parseFloat(c!=null?c:"0"):r[Nl(a)]=c}}),r}function dc(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var Op=eh,Bp,Fp,Np,$p;if(O()&&!((Bp=window.customElements)!=null&&Bp.get("math-field"))){(Np=window[Fp=Symbol.for("io.cortexjs.mathlive")])!=null||(window[Fp]={});const e=window[Symbol.for("io.cortexjs.mathlive")];e.version="0.98.5",window.MathfieldElement=eh,($p=window.customElements)==null||$p.define("math-field",eh)}function Eg(e,r,n){let a=n,c=0;const p=e.length;for(;a<r.length;){const g=r[a];if(c<=0&&r.slice(a,a+p)===e)return a;g==="\\"?a++:g==="{"?c++:g==="}"&&c--,a++}return-1}function pd(e,r,n,a,c="latex"){const p=[];for(const g of e)if(g.type==="text"){const A=g.data;let T=!0,I=0,K;K=A.indexOf(r),K!==-1&&(I=K,I>0&&p.push({type:"text",data:A.slice(0,I)}),T=!1);let re=!1;for(;!re;){if(T){if(K=A.indexOf(r,I),K===-1){re=!0;break}I!==K&&p.push({type:"text",data:A.slice(I,K)}),I=K}else{if(K=Eg(n,A,I+r.length),K===-1){re=!0;break}let ve=A.slice(I+r.length,K);c==="ascii-math"&&([,ve]=F0(ve,{format:"ascii-math"})),p.push({type:"math",data:ve,rawData:A.slice(I,K+n.length),mathstyle:a}),I=K+n.length}T=!T}I<A.length&&p.push({type:"text",data:A.slice(I)})}else p.push(g);return p}function zp(e,r,n){let a=[{type:"text",data:e}];return r!=null&&r.inline&&r.inline.forEach(([c,p])=>{a=pd(a,c,p,"textstyle")}),r!=null&&r.display&&r.display.forEach(([c,p])=>{a=pd(a,c,p,"displaystyle")}),n!=null&&n.inline&&n.inline.forEach(([c,p])=>{a=pd(a,c,p,"textstyle","ascii-math")}),n!=null&&n.display&&n.display.forEach(([c,p])=>{a=pd(a,c,p,"displaystyle","ascii-math")}),a}function Ag(e,r){const n=document.createElement("span");n.setAttribute("translate","no");try{const a="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+r.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 kg(e,r,n,a){try{const c=r.renderToMarkup(e,{mathstyle:n,format:"html"}),p=document.createElement("span");return p.dataset.latex=e,p.style.display=n==="displaystyle"?"flex":"inline-flex",p.setAttribute("aria-hidden","true"),p.setAttribute("translate","no"),p.innerHTML=window.MathfieldElement.createHTML(c),p}catch(c){if(console.error("Could not parse'"+e+"' with ",c),a)return document.createTextNode(e)}return null}function fc(e,r,n,a){var c;const p=kg(e,n,r||"textstyle",a),g=(c=n.renderAccessibleContent)!=null?c:"";if(p&&/\b(mathml|speakable-text)\b/i.test(g)){const A=document.createElement("span");if(/\bmathml\b/i.test(g)&&n.renderToMathML&&A.append(Ag(e,n)),/\bspeakable-text\b/i.test(g)&&n.renderToSpeakableText){const T=document.createElement("span");T.setAttribute("translate","no");const I=n.renderToSpeakableText(e);T.innerHTML=window.MathfieldElement.createHTML(I),T.className="ML__sr-only",A.append(T)}return A.append(p),A}return p}function Tg(e,r){var n,a,c;let p=null;if((n=r.TeX)!=null&&n.processEnvironments&&/^\s*\\begin/.test(e)){p=document.createDocumentFragment();const g=fc(e,"",r,!0);g&&p.appendChild(g)}else{if(!e.trim())return null;const g=zp(e,(a=r.TeX)==null?void 0:a.delimiters,(c=r.asciiMath)==null?void 0:c.delimiters);if(g.length===1&&g[0].type==="text")return null;p=document.createDocumentFragment();for(const A of g)if(A.type==="text")p.appendChild(document.createTextNode(A.data));else{const T=fc(A.data,A.mathstyle==="textstyle"?"textstyle":"displaystyle",r,!0);T&&p.appendChild(T)}}return p}function Kp(e,r){var n,a,c,p,g,A,T,I,K,re,ve,Oe,Ke,vt,ur,mt;if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const zt=(n=e.childNodes[0].textContent)!=null?n:"";if((a=r.TeX)!=null&&a.processEnvironments&&/^\s*\\begin/.test(zt)){e.textContent="";const Zt=fc(zt,"",r,!0);Zt&&e.append(Zt);return}const pr=zp(zt,(c=r.TeX)==null?void 0:c.delimiters,(p=r.asciiMath)==null?void 0:p.delimiters);if(pr.length===1&&pr[0].type==="math"){e.textContent="";const Zt=fc(pr[0].data,pr[0].mathstyle==="textstyle"?"textstyle":"displaystyle",r,!0);Zt&&e.append(Zt);return}if(pr.length===1&&pr[0].type==="text")return}for(let zt=e.childNodes.length-1;zt>=0;zt--){const pr=e.childNodes[zt];if(pr.nodeType===3){const Zt=Tg((g=pr.textContent)!=null?g:"",r);Zt&&(zt+=Zt.childNodes.length-1,pr.replaceWith(Zt))}else if(pr.nodeType===1){const Zt=pr,Hr=pr.nodeName.toLowerCase();if(Hr==="script"){const ni=pr;let Yr;if((A=r.processScriptTypePattern)!=null&&A.test(ni.type))Yr=(T=ni.textContent)!=null?T:"";else if((I=r.processMathJSONScriptTypePattern)!=null&&I.test(ni.type))try{Yr=(re=r.serializeToLatex)==null?void 0:re.call(r,JSON.parse((K=ni.textContent)!=null?K:""))}catch(Xi){console.error(Xi)}if(Yr){let Xi="textstyle";for(const yr of ni.type.split(";")){const[Va,tl]=yr.toLowerCase().split("=");Va.trim()==="mode"&&(Xi=tl.trim()==="display"?"displaystyle":"textstyle")}const Pn=fc(Yr,Xi,r,!0);Pn&&ni.parentNode.replaceChild(Pn,ni)}}else if(((Oe=(ve=r.processClassPattern)==null?void 0:ve.test(Zt.className))!=null?Oe:!1)||!((vt=(Ke=r.skipTags)==null?void 0:Ke.includes(Hr))!=null&&vt||(mt=(ur=r.ignoreClassPattern)==null?void 0:ur.test(Zt.className))!=null&&mt))if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const Yr=e.textContent;e.textContent="";const Xi=fc(Yr!=null?Yr:"","displaystyle",r,!0);Xi&&e.append(Xi)}else Kp(Zt,r)}}}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,r){var n,a,c,p;try{const g=z(z({},Cg),r);g.ignoreClassPattern=new RegExp((n=g.ignoreClass)!=null?n:""),g.processClassPattern=new RegExp((a=g.processClass)!=null?a:""),g.processScriptTypePattern=new RegExp((c=g.processScriptType)!=null?c:""),g.processMathJSONScriptTypePattern=new RegExp((p=g.processMathJSONScriptType)!=null?p:""),Ui(),va("core"),Kp(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,r){const n=mu.singleton;return n?(n.show(),pu(),n.currentLayer=r,n.render(),n.focus(),!0):!1}function Lg(){const e=window.mathVirtualKeyboard;return e.visible?e.hide({animate:!0}):e.show({animate:!0}),!1}ta({switchKeyboardLayer:Mg,toggleVirtualKeyboard:Lg,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function yu(){var e,r;return(r=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){Rg(document.body,e)}function Ig(e){if(typeof e=="string"){const r=document.getElementById(e);if(r===null)throw new Error(`The element with ID "${e}" could not be found.`);return r}return typeof e=="string"?null:e}function Rg(e,r){var n,a,c,p;const g=Ig(e);if(!g)return;const A=r!=null?r:{};(n=A.renderToMarkup)!=null||(A.renderToMarkup=Ks),(a=A.renderToMathML)!=null||(A.renderToMathML=Vm),(c=A.renderToSpeakableText)!=null||(A.renderToSpeakableText=Wm),(p=A.serializeToLatex)!=null||(A.serializeToLatex=jm),Dg(g,A)}var $g={mathlive:"0.98.5"}}}]);
}());