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/p__MoopCases__InfoPanel__in...

1252 lines
1.2 MiB

!(function(){var bu=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[1855],{70557:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return pe}});var F=X(60499),Te=X(59301),Be={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"},ye=Be,te=X(7657),_=function(Q,B){return Te.createElement(te.Z,(0,F.Z)({},Q,{ref:B,icon:ye}))},De=Te.forwardRef(_),pe=De},68196:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return Nt}});var F=X(85899),Te=X(72190),Be=X(42244),ye=X(43403),te=X(92310),_=X.n(te),De=X(29301),pe=X(76846),u=X(96452),Q=X(6089),B=X(80402),b=X(34280),k=X(49658),S=X(59301),C=X(60499),H=X(77900),V=X(8654);function M(Pe){var $e=Pe.prefixCls,Ee=Pe.align,Ve=Pe.arrow,Je=Pe.arrowPos,lt=Ve||{},re=lt.className,Se=lt.content,je=Je.x,Ge=je===void 0?0:je,Ze=Je.y,mt=Ze===void 0?0:Ze,Pt=S.useRef();if(!Ee||!Ee.points)return null;var yt={position:"absolute"};if(Ee.autoArrow!==!1){var _t=Ee.points[0],vt=Ee.points[1],$t=_t[0],Ct=_t[1],wt=vt[0],He=vt[1];$t===wt||!["t","b"].includes($t)?yt.top=mt:$t==="t"?yt.top=0:yt.bottom=0,Ct===He||!["l","r"].includes(Ct)?yt.left=Ge:Ct==="l"?yt.left=0:yt.right=0}return S.createElement("div",{ref:Pt,className:_()("".concat($e,"-arrow"),re),style:yt},Se)}function I(Pe){var $e=Pe.prefixCls,Ee=Pe.open,Ve=Pe.zIndex,Je=Pe.mask,lt=Pe.motion;return Je?S.createElement(H.default,(0,C.Z)({},lt,{motionAppear:!0,visible:Ee,removeOnLeave:!0}),function(re){var Se=re.className;return S.createElement("div",{style:{zIndex:Ve},className:_()("".concat($e,"-mask"),Se)})}):null}var z=S.memo(function(Pe){var $e=Pe.children;return $e},function(Pe,$e){return $e.cache}),ae=z,ee=S.forwardRef(function(Pe,$e){var Ee=Pe.popup,Ve=Pe.className,Je=Pe.prefixCls,lt=Pe.style,re=Pe.target,Se=Pe.onVisibleChanged,je=Pe.open,Ge=Pe.keepDom,Ze=Pe.fresh,mt=Pe.onClick,Pt=Pe.mask,yt=Pe.arrow,_t=Pe.arrowPos,vt=Pe.align,$t=Pe.motion,Ct=Pe.maskMotion,wt=Pe.forceRender,He=Pe.getPopupContainer,Tt=Pe.autoDestroy,gt=Pe.portal,st=Pe.zIndex,Rt=Pe.onMouseEnter,y=Pe.onMouseLeave,D=Pe.onPointerEnter,Oe=Pe.onPointerDownCapture,N=Pe.ready,oe=Pe.offsetX,rr=Pe.offsetY,xe=Pe.offsetR,ke=Pe.offsetB,Re=Pe.onAlign,G=Pe.onPrepare,q=Pe.stretch,me=Pe.targetWidth,we=Pe.targetHeight,O=typeof Ee=="function"?Ee():Ee,ht=je||Ge,he=(He==null?void 0:He.length)>0,It=S.useState(!He||!he),Ot=(0,Te.Z)(It,2),er=Ot[0],Dr=Ot[1];if((0,b.Z)(function(){!er&&he&&re&&Dr(!0)},[er,he,re]),!er)return null;var lr="auto",Wt={left:"-1000vw",top:"-1000vh",right:lr,bottom:lr};if(N||!je){var Mr,Xr=vt.points,Er=vt.dynamicInset||((Mr=vt._experimental)===null||Mr===void 0?void 0:Mr.dynamicInset),_r=Er&&Xr[0][1]==="r",At=Er&&Xr[0][0]==="b";_r?(Wt.right=xe,Wt.left=lr):(Wt.left=oe,Wt.right=lr),At?(Wt.bottom=ke,Wt.top=lr):(Wt.top=rr,Wt.bottom=lr)}var pt={};return q&&(q.includes("height")&&we?pt.height=we:q.includes("minHeight")&&we&&(pt.minHeight=we),q.includes("width")&&me?pt.width=me:q.includes("minWidth")&&me&&(pt.minWidth=me)),je||(pt.pointerEvents="none"),S.createElement(gt,{open:wt||ht,getContainer:He&&function(){return He(re)},autoDestroy:Tt},S.createElement(I,{prefixCls:Je,open:je,zIndex:st,mask:Pt,motion:Ct}),S.createElement(De.Z,{onResize:Re,disabled:!je},function(xt){return S.createElement(H.default,(0,C.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:wt,leavedClassName:"".concat(Je,"-hidden")},$t,{onAppearPrepare:G,onEnterPrepare:G,visible:je,onVisibleChanged:function(pr){var wr;$t==null||(wr=$t.onVisibleChanged)===null||wr===void 0||wr.call($t,pr),Se(pr)}}),function(tr,pr){var wr=tr.className,Yr=tr.style,qr=_()(Je,wr,Ve);return S.createElement("div",{ref:(0,V.sQ)(xt,$e,pr),className:qr,style:(0,F.Z)((0,F.Z)((0,F.Z)((0,F.Z)({"--arrow-x":"".concat(_t.x||0,"px"),"--arrow-y":"".concat(_t.y||0,"px")},Wt),pt),Yr),{},{boxSizing:"border-box",zIndex:st},lt),onMouseEnter:Rt,onMouseLeave:y,onPointerEnter:D,onClick:mt,onPointerDownCapture:Oe},yt&&S.createElement(M,{prefixCls:Je,arrow:yt,arrowPos:_t,align:vt}),S.createElement(ae,{cache:!je&&!Ze},O))})}))}),_e=ee,be=S.forwardRef(function(Pe,$e){var Ee=Pe.children,Ve=Pe.getTriggerDOMNode,Je=(0,V.Yr)(Ee),lt=S.useCallback(function(Se){(0,V.mH)($e,Ve?Ve(Se):Se)},[Ve]),re=(0,V.x1)(lt,(0,V.C4)(Ee));return Je?S.cloneElement(Ee,{ref:re}):Ee}),ce=be,ve=S.createContext(null),Ie=ve;function Ae(Pe){return Pe?Array.isArray(Pe)?Pe:[Pe]:[]}function We(Pe,$e,Ee,Ve){return S.useMemo(function(){var Je=Ae(Ee!=null?Ee:$e),lt=Ae(Ve!=null?Ve:$e),re=new Set(Je),Se=new Set(lt);return Pe&&(re.has("hover")&&(re.delete("hover"),re.add("click")),Se.has("hover")&&(Se.delete("hover"),Se.add("click"))),[re,Se]},[Pe,$e,Ee,Ve])}var Y=X(29194);function P(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ee=arguments.length>2?arguments[2]:void 0;return Ee?Pe[0]===$e[0]:Pe[0]===$e[0]&&Pe[1]===$e[1]}function j(Pe,$e,Ee,Ve){for(var Je=Ee.points,lt=Object.keys(Pe),re=0;re<lt.length;re+=1){var Se,je=lt[re];if(P((Se=Pe[je])===null||Se===void 0?void 0:Se.points,Je,Ve))return"".concat($e,"-placement-").concat(je)}return""}function J(Pe,$e,Ee,Ve){return $e||(Ee?{motionName:"".concat(Pe,"-").concat(Ee)}:Ve?{motionName:Ve}:null)}function se(Pe){return Pe.ownerDocument.defaultView}function Z(Pe){for(var $e=[],Ee=Pe==null?void 0:Pe.parentElement,Ve=["hidden","scroll","clip","auto"];Ee;){var Je=se(Ee).getComputedStyle(Ee),lt=Je.overflowX,re=Je.overflowY,Se=Je.overflow;[lt,re,Se].some(function(je){return Ve.includes(je)})&&$e.push(Ee),Ee=Ee.parentElement}return $e}function w(Pe){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Pe)?$e:Pe}function E(Pe){return w(parseFloat(Pe),0)}function K(Pe,$e){var Ee=(0,F.Z)({},Pe);return($e||[]).forEach(function(Ve){if(!(Ve instanceof HTMLBodyElement||Ve instanceof HTMLHtmlElement)){var Je=se(Ve).getComputedStyle(Ve),lt=Je.overflow,re=Je.overflowClipMargin,Se=Je.borderTopWidth,je=Je.borderBottomWidth,Ge=Je.borderLeftWidth,Ze=Je.borderRightWidth,mt=Ve.getBoundingClientRect(),Pt=Ve.offsetHeight,yt=Ve.clientHeight,_t=Ve.offsetWidth,vt=Ve.clientWidth,$t=E(Se),Ct=E(je),wt=E(Ge),He=E(Ze),Tt=w(Math.round(mt.width/_t*1e3)/1e3),gt=w(Math.round(mt.height/Pt*1e3)/1e3),st=(_t-vt-wt-He)*Tt,Rt=(Pt-yt-$t-Ct)*gt,y=$t*gt,D=Ct*gt,Oe=wt*Tt,N=He*Tt,oe=0,rr=0;if(lt==="clip"){var xe=E(re);oe=xe*Tt,rr=xe*gt}var ke=mt.x+Oe-oe,Re=mt.y+y-rr,G=ke+mt.width+2*oe-Oe-N-st,q=Re+mt.height+2*rr-y-D-Rt;Ee.left=Math.max(Ee.left,ke),Ee.top=Math.max(Ee.top,Re),Ee.right=Math.min(Ee.right,G),Ee.bottom=Math.min(Ee.bottom,q)}}),Ee}function de(Pe){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ee="".concat($e),Ve=Ee.match(/^(.*)\%$/);return Ve?Pe*(parseFloat(Ve[1])/100):parseFloat(Ee)}function Ue(Pe,$e){var Ee=$e||[],Ve=(0,Te.Z)(Ee,2),Je=Ve[0],lt=Ve[1];return[de(Pe.width,Je),de(Pe.height,lt)]}function Ye(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Pe[0],Pe[1]]}function ct(Pe,$e){var Ee=$e[0],Ve=$e[1],Je,lt;return Ee==="t"?lt=Pe.y:Ee==="b"?lt=Pe.y+Pe.height:lt=Pe.y+Pe.height/2,Ve==="l"?Je=Pe.x:Ve==="r"?Je=Pe.x+Pe.width:Je=Pe.x+Pe.width/2,{x:Je,y:lt}}function at(Pe,$e){var Ee={t:"b",b:"t",l:"r",r:"l"};return Pe.map(function(Ve,Je){return Je===$e?Ee[Ve]||"c":Ve}).join("")}function Dt(Pe,$e,Ee,Ve,Je,lt,re){var Se=S.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Je[Ve]||{}}),je=(0,Te.Z)(Se,2),Ge=je[0],Ze=je[1],mt=S.useRef(0),Pt=S.useMemo(function(){return $e?Z($e):[]},[$e]),yt=S.useRef({}),_t=function(){yt.current={}};Pe||_t();var vt=(0,Q.Z)(function(){if($e&&Ee&&Pe){let _n=function(is,Rn){var qn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cn,Kn=ht.x+is,Fi=ht.y+Rn,Wi=Kn+At,Yi=Fi+_r,Nn=Math.max(Kn,qn.left),Gt=Math.max(Fi,qn.top),sr=Math.min(Wi,qn.right),Or=Math.min(Yi,qn.bottom);return Math.max(0,(sr-Nn)*(Or-Gt))},Mi=function(){Vn=ht.y+jr,wn=Vn+_r,ur=ht.x+Ir,Pr=ur+At};var wt,He,Tt,gt,st=$e,Rt=st.ownerDocument,y=se(st),D=y.getComputedStyle(st),Oe=D.position,N=st.style.left,oe=st.style.top,rr=st.style.right,xe=st.style.bottom,ke=st.style.overflow,Re=(0,F.Z)((0,F.Z)({},Je[Ve]),lt),G=Rt.createElement("div");(wt=st.parentElement)===null||wt===void 0||wt.appendChild(G),G.style.left="".concat(st.offsetLeft,"px"),G.style.top="".concat(st.offsetTop,"px"),G.style.position=Oe,G.style.height="".concat(st.offsetHeight,"px"),G.style.width="".concat(st.offsetWidth,"px"),st.style.left="0",st.style.top="0",st.style.right="auto",st.style.bottom="auto",st.style.overflow="hidden";var q;if(Array.isArray(Ee))q={x:Ee[0],y:Ee[1],width:0,height:0};else{var me,we,O=Ee.getBoundingClientRect();O.x=(me=O.x)!==null&&me!==void 0?me:O.left,O.y=(we=O.y)!==null&&we!==void 0?we:O.top,q={x:O.x,y:O.y,width:O.width,height:O.height}}var ht=st.getBoundingClientRect(),he=y.getComputedStyle(st),It=he.height,Ot=he.width;ht.x=(He=ht.x)!==null&&He!==void 0?He:ht.left,ht.y=(Tt=ht.y)!==null&&Tt!==void 0?Tt:ht.top;var er=Rt.documentElement,Dr=er.clientWidth,lr=er.clientHeight,Wt=er.scrollWidth,Mr=er.scrollHeight,Xr=er.scrollTop,Er=er.scrollLeft,_r=ht.height,At=ht.width,pt=q.height,xt=q.width,tr={left:0,top:0,right:Dr,bottom:lr},pr={left:-Er,top:-Xr,right:Wt-Er,bottom:Mr-Xr},wr=Re.htmlRegion,Yr="visible",qr="visibleFirst";wr!=="scroll"&&wr!==qr&&(wr=Yr);var sn=wr===qr,Jr=K(pr,Pt),mr=K(tr,Pt),cn=wr===Yr?mr:Jr,kr=sn?mr:cn;st.style.left="auto",st.style.top="auto",st.style.right="0",st.style.bottom="0";var En=st.getBoundingClientRect();st.style.left=N,st.style.top=oe,st.style.right=rr,st.style.bottom=xe,st.style.overflow=ke,(gt=st.parentElement)===null||gt===void 0||gt.removeChild(G);var dn=w(Math.round(At/parseFloat(Ot)*1e3)/1e3),yr=w(Math.round(_r/parseFloat(It)*1e3)/1e3);if(dn===0||yr===0||(0,pe.Sh)(Ee)&&!(0,Y.Z)(Ee))return;var Tr=Re.offset,Cr=Re.targetOffset,Nr=Ue(ht,Tr),br=(0,Te.Z)(Nr,2),nr=br[0],pn=br[1],Ur=Ue(q,Cr),mn=(0,Te.Z)(Ur,2),ei=mn[0],es=mn[1];q.x-=ei,q.y-=es;var An=Re.points||[],zn=(0,Te.Z)(An,2),ms=zn[0],ts=zn[1],an=Ye(ts),Rr=Ye(ms),tn=ct(q,an),mi=ct(ht,Rr),Dn=(0,F.Z)({},Re),Ir=tn.x-mi.x+nr,jr=tn.y-mi.y+pn,on=_n(Ir,jr),gi=_n(Ir,jr,mr),xn=ct(q,["t","l"]),_i=ct(ht,["t","l"]),vi=ct(q,["b","r"]),On=ct(ht,["b","r"]),ti=Re.overflow||{},Qe=ti.adjustX,cr=ti.adjustY,Vr=ti.shiftX,yi=ti.shiftY,bi=function(Rn){return typeof Rn=="boolean"?Rn:Rn>=0},Vn,wn,ur,Pr;Mi();var kn=bi(cr),en=Rr[0]===an[0];if(kn&&Rr[0]==="t"&&(wn>kr.bottom||yt.current.bt)){var $r=jr;en?$r-=_r-pt:$r=xn.y-On.y-pn;var ji=_n(Ir,$r),Wn=_n(Ir,$r,mr);ji>on||ji===on&&(!sn||Wn>=gi)?(yt.current.bt=!0,jr=$r,pn=-pn,Dn.points=[at(Rr,0),at(an,0)]):yt.current.bt=!1}if(kn&&Rr[0]==="b"&&(Vn<kr.top||yt.current.tb)){var fn=jr;en?fn+=_r-pt:fn=vi.y-_i.y-pn;var Ht=_n(Ir,fn),ln=_n(Ir,fn,mr);Ht>on||Ht===on&&(!sn||ln>=gi)?(yt.current.tb=!0,jr=fn,pn=-pn,Dn.points=[at(Rr,0),at(an,0)]):yt.current.tb=!1}var Qr=bi(Qe),Mn=Rr[1]===an[1];if(Qr&&Rr[1]==="l"&&(Pr>kr.right||yt.current.rl)){var Ei=Ir;Mn?Ei-=At-xt:Ei=xn.x-On.x-nr;var xi=_n(Ei,jr),Vi=_n(Ei,jr,mr);xi>on||xi===on&&(!sn||Vi>=gi)?(yt.current.rl=!0,Ir=Ei,nr=-nr,Dn.points=[at(Rr,1),at(an,1)]):yt.current.rl=!1}if(Qr&&Rr[1]==="r"&&(ur<kr.left||yt.current.lr)){var wi=Ir;Mn?wi+=At-xt:wi=vi.x-_i.x-nr;var Zr=_n(wi,jr),ri=_n(wi,jr,mr);Zr>on||Zr===on&&(!sn||ri>=gi)?(yt.current.lr=!0,Ir=wi,nr=-nr,Dn.points=[at(Rr,1),at(an,1)]):yt.current.lr=!1}Mi();var Cn=Vr===!0?0:Vr;typeof Cn=="number"&&(ur<mr.left&&(Ir-=ur-mr.left-nr,q.x+xt<mr.left+Cn&&(Ir+=q.x-mr.left+xt-Cn)),Pr>mr.right&&(Ir-=Pr-mr.right-nr,q.x>mr.right-Cn&&(Ir+=q.x-mr.right+Cn)));var Yn=yi===!0?0:yi;typeof Yn=="number"&&(Vn<mr.top&&(jr-=Vn-mr.top-pn,q.y+pt<mr.top+Yn&&(jr+=q.y-mr.top+pt-Yn)),wn>mr.bottom&&(jr-=wn-mr.bottom-pn,q.y>mr.bottom-Yn&&(jr+=q.y-mr.bottom+Yn)));var Fn=ht.x+Ir,Ln=Fn+At,dr=ht.y+jr,Si=dr+_r,ni=q.x,ii=ni+xt,un=q.y,ir=un+pt,rs=Math.max(Fn,ni),St=Math.min(Ln,ii),hn=(rs+St)/2,Ii=hn-Fn,Pi=Math.max(dr,un),gn=Math.min(Si,ir),Gn=(Pi+gn)/2,ar=Gn-dr;re==null||re($e,Dn);var Bn=En.right-ht.x-(Ir+ht.width),Oi=En.bottom-ht.y-(jr+ht.height);dn===1&&(Ir=Math.floor(Ir),Bn=Math.floor(Bn)),yr===1&&(jr=Math.floor(jr),Oi=Math.floor(Oi));var ns={ready:!0,offsetX:Ir/dn,offsetY:jr/yr,offsetR:Bn/dn,offsetB:Oi/yr,arrowX:Ii/dn,arrowY:ar/yr,scaleX:dn,scaleY:yr,align:Dn};Ze(ns)}}),$t=function(){mt.current+=1;var He=mt.current;Promise.resolve().then(function(){mt.current===He&&vt()})},Ct=function(){Ze(function(He){return(0,F.Z)((0,F.Z)({},He),{},{ready:!1})})};return(0,b.Z)(Ct,[Ve]),(0,b.Z)(function(){Pe||Ct()},[Pe]),[Ge.ready,Ge.offsetX,Ge.offsetY,Ge.offsetR,Ge.offsetB,Ge.arrowX,Ge.arrowY,Ge.scaleX,Ge.scaleY,Ge.align,$t]}var bt=X(77654);function ot(Pe,$e,Ee,Ve,Je){(0,b.Z)(function(){if(Pe&&$e&&Ee){let mt=function(){Ve(),Je()};var lt=$e,re=Ee,Se=Z(lt),je=Z(re),Ge=se(re),Ze=new Set([Ge].concat((0,bt.Z)(Se),(0,bt.Z)(je)));return Ze.forEach(function(Pt){Pt.addEventListener("scroll",mt,{passive:!0})}),Ge.addEventListener("resize",mt,{passive:!0}),Ve(),function(){Ze.forEach(function(Pt){Pt.removeEventListener("scroll",mt),Ge.removeEventListener("resize",mt)})}}},[Pe,$e,Ee])}var Qt=X(48736);function nt(Pe,$e,Ee,Ve,Je,lt,re,Se){var je=S.useRef(Pe);je.current=Pe;var Ge=S.useRef(!1);S.useEffect(function(){if($e&&Ve&&(!Je||lt)){var mt=function(){Ge.current=!1},Pt=function(Tt){var gt;je.current&&!re(((gt=Tt.composedPath)===null||gt===void 0||(gt=gt.call(Tt))===null||gt===void 0?void 0:gt[0])||Tt.target)&&!Ge.current&&Se(!1)},yt=se(Ve);yt.addEventListener("pointerdown",mt,!0),yt.addEventListener("mousedown",Pt,!0),yt.addEventListener("contextmenu",Pt,!0);var _t=(0,u.A)(Ee);if(_t&&(_t.addEventListener("mousedown",Pt,!0),_t.addEventListener("contextmenu",Pt,!0)),0)var vt,$t,Ct,wt;return function(){yt.removeEventListener("pointerdown",mt,!0),yt.removeEventListener("mousedown",Pt,!0),yt.removeEventListener("contextmenu",Pt,!0),_t&&(_t.removeEventListener("mousedown",Pt,!0),_t.removeEventListener("contextmenu",Pt,!0))}}},[$e,Ee,Ve,Je,lt]);function Ze(){Ge.current=!0}return Ze}var kt=["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 et(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ye.Z,$e=S.forwardRef(function(Ee,Ve){var Je=Ee.prefixCls,lt=Je===void 0?"rc-trigger-popup":Je,re=Ee.children,Se=Ee.action,je=Se===void 0?"hover":Se,Ge=Ee.showAction,Ze=Ee.hideAction,mt=Ee.popupVisible,Pt=Ee.defaultPopupVisible,yt=Ee.onPopupVisibleChange,_t=Ee.afterPopupVisibleChange,vt=Ee.mouseEnterDelay,$t=Ee.mouseLeaveDelay,Ct=$t===void 0?.1:$t,wt=Ee.focusDelay,He=Ee.blurDelay,Tt=Ee.mask,gt=Ee.maskClosable,st=gt===void 0?!0:gt,Rt=Ee.getPopupContainer,y=Ee.forceRender,D=Ee.autoDestroy,Oe=Ee.destroyPopupOnHide,N=Ee.popup,oe=Ee.popupClassName,rr=Ee.popupStyle,xe=Ee.popupPlacement,ke=Ee.builtinPlacements,Re=ke===void 0?{}:ke,G=Ee.popupAlign,q=Ee.zIndex,me=Ee.stretch,we=Ee.getPopupClassNameFromAlign,O=Ee.fresh,ht=Ee.alignPoint,he=Ee.onPopupClick,It=Ee.onPopupAlign,Ot=Ee.arrow,er=Ee.popupMotion,Dr=Ee.maskMotion,lr=Ee.popupTransitionName,Wt=Ee.popupAnimation,Mr=Ee.maskTransitionName,Xr=Ee.maskAnimation,Er=Ee.className,_r=Ee.getTriggerDOMNode,At=(0,Be.Z)(Ee,kt),pt=D||Oe||!1,xt=S.useState(!1),tr=(0,Te.Z)(xt,2),pr=tr[0],wr=tr[1];(0,b.Z)(function(){wr((0,k.Z)())},[]);var Yr=S.useRef({}),qr=S.useContext(Ie),sn=S.useMemo(function(){return{registerSubPopup:function(sr,Or){Yr.current[sr]=Or,qr==null||qr.registerSubPopup(sr,Or)}}},[qr]),Jr=(0,B.Z)(),mr=S.useState(null),cn=(0,Te.Z)(mr,2),kr=cn[0],En=cn[1],dn=S.useRef(null),yr=(0,Q.Z)(function(Gt){dn.current=Gt,(0,pe.Sh)(Gt)&&kr!==Gt&&En(Gt),qr==null||qr.registerSubPopup(Jr,Gt)}),Tr=S.useState(null),Cr=(0,Te.Z)(Tr,2),Nr=Cr[0],br=Cr[1],nr=S.useRef(null),pn=(0,Q.Z)(function(Gt){(0,pe.Sh)(Gt)&&Nr!==Gt&&(br(Gt),nr.current=Gt)}),Ur=S.Children.only(re),mn=(Ur==null?void 0:Ur.props)||{},ei={},es=(0,Q.Z)(function(Gt){var sr,Or,fr=Nr;return(fr==null?void 0:fr.contains(Gt))||((sr=(0,u.A)(fr))===null||sr===void 0?void 0:sr.host)===Gt||Gt===fr||(kr==null?void 0:kr.contains(Gt))||((Or=(0,u.A)(kr))===null||Or===void 0?void 0:Or.host)===Gt||Gt===kr||Object.values(Yr.current).some(function(vr){return(vr==null?void 0:vr.contains(Gt))||Gt===vr})}),An=J(lt,er,Wt,lr),zn=J(lt,Dr,Xr,Mr),ms=S.useState(Pt||!1),ts=(0,Te.Z)(ms,2),an=ts[0],Rr=ts[1],tn=mt!=null?mt:an,mi=(0,Q.Z)(function(Gt){mt===void 0&&Rr(Gt)});(0,b.Z)(function(){Rr(mt||!1)},[mt]);var Dn=S.useRef(tn);Dn.current=tn;var Ir=S.useRef([]);Ir.current=[];var jr=(0,Q.Z)(function(Gt){var sr;mi(Gt),((sr=Ir.current[Ir.current.length-1])!==null&&sr!==void 0?sr:tn)!==Gt&&(Ir.current.push(Gt),yt==null||yt(Gt))}),on=S.useRef(),gi=function(){clearTimeout(on.current)},xn=function(sr){var Or=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;gi(),Or===0?jr(sr):on.current=setTimeout(function(){jr(sr)},Or*1e3)};S.useEffect(function(){return gi},[]);var _i=S.useState(!1),vi=(0,Te.Z)(_i,2),On=vi[0],ti=vi[1];(0,b.Z)(function(Gt){(!Gt||tn)&&ti(!0)},[tn]);var Qe=S.useState(null),cr=(0,Te.Z)(Qe,2),Vr=cr[0],yi=cr[1],bi=S.useState(null),Vn=(0,Te.Z)(bi,2),wn=Vn[0],ur=Vn[1],Pr=function(sr){ur([sr.clientX,sr.clientY])},kn=Dt(tn,kr,ht&&wn!==null?wn:Nr,xe,Re,G,It),en=(0,Te.Z)(kn,11),$r=en[0],ji=en[1],Wn=en[2],fn=en[3],Ht=en[4],ln=en[5],Qr=en[6],Mn=en[7],Ei=en[8],xi=en[9],Vi=en[10],wi=We(pr,je,Ge,Ze),Zr=(0,Te.Z)(wi,2),ri=Zr[0],Cn=Zr[1],Yn=ri.has("click"),Fn=Cn.has("click")||Cn.has("contextMenu"),Ln=(0,Q.Z)(function(){On||Vi()}),dr=function(){Dn.current&&ht&&Fn&&xn(!1)};ot(tn,Nr,kr,Ln,dr),(0,b.Z)(function(){Ln()},[wn,xe]),(0,b.Z)(function(){tn&&!(Re!=null&&Re[xe])&&Ln()},[JSON.stringify(G)]);var Si=S.useMemo(function(){var Gt=j(Re,lt,xi,ht);return _()(Gt,we==null?void 0:we(xi))},[xi,we,Re,lt,ht]);S.useImperativeHandle(Ve,function(){return{nativeElement:nr.current,popupElement:dn.current,forceAlign:Ln}});var ni=S.useState(0),ii=(0,Te.Z)(ni,2),un=ii[0],ir=ii[1],rs=S.useState(0),St=(0,Te.Z)(rs,2),hn=St[0],Ii=St[1],Pi=function(){if(me&&Nr){var sr=Nr.getBoundingClientRect();ir(sr.width),Ii(sr.height)}},gn=function(){Pi(),Ln()},Gn=function(sr){ti(!1),Vi(),_t==null||_t(sr)},ar=function(){return new Promise(function(sr){Pi(),yi(function(){return sr})})};(0,b.Z)(function(){Vr&&(Vi(),Vr(),yi(null))},[Vr]);function Bn(Gt,sr,Or,fr){ei[Gt]=function(vr){var si;fr==null||fr(vr),xn(sr,Or);for(var Zn=arguments.length,ai=new Array(Zn>1?Zn-1:0),Bi=1;Bi<Zn;Bi++)ai[Bi-1]=arguments[Bi];(si=mn[Gt])===null||si===void 0||si.call.apply(si,[mn,vr].concat(ai))}}(Yn||Fn)&&(ei.onClick=function(Gt){var sr;Dn.current&&Fn?xn(!1):!Dn.current&&Yn&&(Pr(Gt),xn(!0));for(var Or=arguments.length,fr=new Array(Or>1?Or-1:0),vr=1;vr<Or;vr++)fr[vr-1]=arguments[vr];(sr=mn.onClick)===null||sr===void 0||sr.call.apply(sr,[mn,Gt].concat(fr))});var Oi=nt(tn,Fn,Nr,kr,Tt,st,es,xn),ns=ri.has("hover"),_n=Cn.has("hover"),Mi,is;ns&&(Bn("onMouseEnter",!0,vt,function(Gt){Pr(Gt)}),Bn("onPointerEnter",!0,vt,function(Gt){Pr(Gt)}),Mi=function(sr){(tn||On)&&kr!==null&&kr!==void 0&&kr.contains(sr.target)&&xn(!0,vt)},ht&&(ei.onMouseMove=function(Gt){var sr;(sr=mn.onMouseMove)===null||sr===void 0||sr.call(mn,Gt)})),_n&&(Bn("onMouseLeave",!1,Ct),Bn("onPointerLeave",!1,Ct),is=function(){xn(!1,Ct)}),ri.has("focus")&&Bn("onFocus",!0,wt),Cn.has("focus")&&Bn("onBlur",!1,He),ri.has("contextMenu")&&(ei.onContextMenu=function(Gt){var sr;Dn.current&&Cn.has("contextMenu")?xn(!1):(Pr(Gt),xn(!0)),Gt.preventDefault();for(var Or=arguments.length,fr=new Array(Or>1?Or-1:0),vr=1;vr<Or;vr++)fr[vr-1]=arguments[vr];(sr=mn.onContextMenu)===null||sr===void 0||sr.call.apply(sr,[mn,Gt].concat(fr))}),Er&&(ei.className=_()(mn.className,Er));var Rn=S.useRef(!1);Rn.current||(Rn.current=y||tn||On);var qn=(0,F.Z)((0,F.Z)({},mn),ei),Kn={},Fi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Fi.forEach(function(Gt){At[Gt]&&(Kn[Gt]=function(){for(var sr,Or=arguments.length,fr=new Array(Or),vr=0;vr<Or;vr++)fr[vr]=arguments[vr];(sr=qn[Gt])===null||sr===void 0||sr.call.apply(sr,[qn].concat(fr)),At[Gt].apply(At,fr)})});var Wi=S.cloneElement(Ur,(0,F.Z)((0,F.Z)({},qn),Kn)),Yi={x:ln,y:Qr},Nn=Ot?(0,F.Z)({},Ot!==!0?Ot:{}):null;return S.createElement(S.Fragment,null,S.createElement(De.Z,{disabled:!tn,ref:pn,onResize:gn},S.createElement(ce,{getTriggerDOMNode:_r},Wi)),Rn.current&&S.createElement(Ie.Provider,{value:sn},S.createElement(_e,{portal:Pe,ref:yr,prefixCls:lt,popup:N,className:_()(oe,Si),style:rr,target:Nr,onMouseEnter:Mi,onMouseLeave:is,onPointerEnter:Mi,zIndex:q,open:tn,keepDom:On,fresh:O,onClick:he,onPointerDownCapture:Oi,mask:Tt,motion:An,maskMotion:zn,onVisibleChanged:Gn,onPrepare:ar,forceRender:y,autoDestroy:pt,getPopupContainer:Rt,align:xi,arrow:Nn,arrowPos:Yi,ready:$r,offsetX:ji,offsetY:Wn,offsetR:fn,offsetB:Ht,onAlign:Ln,stretch:me,targetWidth:un/Mn,targetHeight:hn/Ei})))});return $e}var Nt=et(ye.Z)},46214:function(){"use strict"},72082:function(){"use strict"},13225:function(){"use strict"},90736:function(Kt,it,X){"use strict";var F=X(59301),Te=X(4977),Be=X(7939),ye=Object.defineProperty,te=Object.defineProperties,_=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,Q=(S,C,H)=>C in S?ye(S,C,{enumerable:!0,configurable:!0,writable:!0,value:H}):S[C]=H,B=(S,C)=>{for(var H in C||(C={}))pe.call(C,H)&&Q(S,H,C[H]);if(De)for(var H of De(C))u.call(C,H)&&Q(S,H,C[H]);return S},b=(S,C)=>te(S,_(C));const k=({img:S,buttonProps:C={},styles:H={},customText:V,ButtonText:M,ButtonClick:I,Buttonclass:z,ButtonTwo:ae,imgStyles:ee,loading:_e=!1,className:be=""})=>F.createElement("section",{className:`tc animated fadeIn ${be}`,style:B({color:"#999",margin:"100px auto",visibility:_e?"hidden":"visible"},H)},F.createElement("img",{src:S||Te,style:b(B({},ee),{pointerEvents:"none",userSelect:"none"})}),F.createElement("p",{className:"mt20 font14"},V||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),M&&F.createElement(Be.ZP,B({className:z,onClick:I},C),M),ae&&ae);it.Z=k},86974:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return z}});var F=X(59301),Te={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",showClose:"showClose___edZQA",embed:"embed___hvpEJ"},Be=X(7939),ye=X(70557),te=X(34728),_=X(25399),De=X(76406),pe=X(84849),u=X(90736),Q=X(14185),B=X(52078),b=X(59301),k=Object.defineProperty,S=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,V=(ae,ee,_e)=>ee in ae?k(ae,ee,{enumerable:!0,configurable:!0,writable:!0,value:_e}):ae[ee]=_e,M=(ae,ee)=>{for(var _e in ee||(ee={}))C.call(ee,_e)&&V(ae,_e,ee[_e]);if(S)for(var _e of S(ee))H.call(ee,_e)&&V(ae,_e,ee[_e]);return ae},I=(ae,ee,_e)=>new Promise((be,ce)=>{var ve=We=>{try{Ae(_e.next(We))}catch(Y){ce(Y)}},Ie=We=>{try{Ae(_e.throw(We))}catch(Y){ce(Y)}},Ae=We=>We.done?be(We.value):Promise.resolve(We.value).then(ve,Ie);Ae((_e=_e.apply(ae,ee)).next())}),z=({editOffice:ae="view",data:ee,issaver:_e,onSaver:be,theme:ce,type:ve,filename:Ie,monacoEditor:Ae,className:We,style:Y,close:P,onClose:j,hasMask:J,disabledDownload:se,onImgDimensions:Z,showNodata:w,recordInfo:E})=>{const[K,de]=(0,F.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Ue,Ye]=(0,F.useState)(""),[ct,at]=(0,F.useState)(),Dt=window.ENV==="build"?"/react/build":"",bt=location.host.startsWith("localhost")?Q.Z.PROXY_SERVER:Q.Z.API_SERVER,Qt=10*(1024*1024),nt=(0,F.useRef)();ee!=null&&ee.startsWith("/api")&&ve!=="txt"&&(ee=Q.Z.API_SERVER+ee);const kt=Ve=>Ve.substring(Ve.lastIndexOf("/")+1).split(".").pop();Ie&&Ae&&(Ae.filename=Ie),(0,F.useEffect)(()=>{var Ve,Je;const lt=(Je=(Ve=document.cookie)==null?void 0:Ve.replace(/\s/g,""))==null?void 0:Je.split(";");lt==null||lt.map(re=>{let Se=re.split("=");Se[0]==="_educoder_session"&&Ye(Se[1])})},[]),(0,F.useEffect)(()=>{ve==="office"&&(ee.indexOf("bigfilescdn.")>-1||ee.indexOf("bigfiles1")>-1?at({url:ee,fileType:kt(ee),model:ee.indexOf("model=edit")?"edit":"view"}):ee.indexOf("coze")>-1?at({url:ee,fileType:"doc",model:"view"}):Nt())},[ve,ee]);function et(Ve){return I(this,null,function*(){Ve.data.type==="pdfdata"&&(be(Ve.data.data),window.removeEventListener("message",et,!1)),console.log("mess---:",Ve.data)})}const Nt=()=>I(void 0,null,function*(){console.log("data:",ee);let Ve=ee;ee.startsWith("http")||(Ve=location.origin+Ve);let Je=new URL(Ve).pathname.split("/").pop();const lt=yield(0,pe.gJ)({attachment_id:Je});lt.url=bt+lt.url,at(lt)}),Pe=()=>{if(ee.startsWith("http")||ee.startsWith("blob:")){$e();return}(0,De.Sv)(Ie||"educoder",ee,Ie)},$e=()=>{E&&(0,B.fc)({id:E==null?void 0:E.id,watch_type:1,course_id:E==null?void 0:E.course_id}),(0,De.Nd)(Ie||"educoder",decodeURIComponent(ee))};(0,F.useEffect)(()=>(window.addEventListener("message",Ee),()=>{window.removeEventListener("message",Ee)}),[]);const Ee=Ve=>{var Je;((Je=Ve==null?void 0:Ve.data)==null?void 0:Je.type)==="closePop"&&j()};return b.createElement("div",{style:M({},Y||{}),className:`${J&&Te.bgBlack} ${ve?Te.wrp:"hide"}`},!!ve&&P&&b.createElement("div",{id:"closePop",className:Te.close,ref:nt},!!Z&&b.createElement(_.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>nt.current},b.createElement("span",{onClick:()=>{j(),Z()}},b.createElement("i",{className:"icon-yulanpizhu"}))),!se&&window.parent===window&&b.createElement(_.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>nt.current},b.createElement("span",{onClick:$e},b.createElement("i",{className:"icon-quxiaozhiding"}))),_e&&b.createElement(_.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>nt.current},b.createElement("span",{className:"",onClick:()=>{const Ve=document.getElementById("pdfiframe");window.addEventListener("message",et,!1),setTimeout(()=>{Ve.contentWindow.postMessage("getData","*")},300)}},b.createElement("i",{className:"icon-baocun"}))),b.createElement(_.Z,{title:"\u5173\u95ED",getPopupContainer:()=>nt.current},b.createElement("span",{className:"",onClick:()=>{j()}},b.createElement("i",{className:"icon-guanbi1"})))),b.createElement("div",{className:`${Te[We]} ${We} ${Te.monaco} ${ve==="txt"?"show":"hide"}`},ve==="txt"&&b.createElement(b.Fragment,null,b.createElement(te.ZP,M({},Ae)))),ve==="audio"&&b.createElement("audio",{controls:!0,src:`${(ee==null?void 0:ee.indexOf("http://"))>-1||(ee==null?void 0:ee.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${ee}`,autoPlay:!0}),ve==="video"&&b.createElement(b.Fragment,null,(ee==null?void 0:ee.indexOf("http"))>-1?b.createElement("video",{controls:!0,src:`${ee}`,autoPlay:!0}):b.createElement("video",{controls:!0,src:`data:video/mp4;base64,${ee}`,autoPlay:!0})),ve==="office"&&ct&&b.createElement("iframe",{src:`${Dt}/office.html?key=${ct.key}&url=${btoa(ct.url)}&callbackUrl=${bt+(ct.callbackUrl||"")}&fileType=${ct.fileType}&title=${ct.title||""}&model=${ae}&officeServer=${Q.Z.ONLYOFFICE}&disabledDownload=${!!se}`}),ve==="html"&&b.createElement("iframe",{src:ee+"&disposition=inline"}),ve==="pdf"&&b.createElement("iframe",{id:"pdfiframe",src:`${Dt}/js/pdf/index.html?filename=${Ie||"educoder.pdf"}&url=${encodeURIComponent(ee)}&disabledDownload=${!!se}&model=${ae}`}),ve==="image"&&b.createElement("img",{src:`${(ee==null?void 0:ee.indexOf("http://"))>-1||(ee==null?void 0:ee.indexOf("https://"))>-1?"":"data:image/png;base64,"}${ee}`}),(ve==="other"||ve==="download")&&b.createElement(b.Fragment,null,w?b.createElement(u.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:b.createElement(Be.ZP,{icon:b.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Pe,disabled:se},"\u4E0B\u8F7D")}):b.createElement(Be.ZP,{type:"primary",size:"middle",onClick:Pe,disabled:se},b.createElement(ye.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")),ve==="flowChart"&&b.createElement("div",{className:"embed"},b.createElement("iframe",{src:`/drawio/src/main/webapp/viewer.html?id=${ee||""}&gapi=0&od=0&db=0&gh=0&gl=0`,width:"100%",height:"100%",frameBorder:"0"})))}},35883:function(Kt,it,X){"use strict";X.d(it,{z:function(){return Ae},Z:function(){return We}});var F=X(59301),Te=X(46214),Be=X(20047),ye=X(64018),te=X(16471),_=X(14185),De=X(76406),pe=X(15342),u=X(44104),Q=X(7939),B=X(1012),b=X(86974),k=X(59301),C=({html:Y})=>{const P=(0,F.useRef)(null),j=(0,F.useRef)(null),J=`.markdown-body p {
margin: 0 0 16px 0 !important;
line-height: 28px;
white-space: pre-wrap;
}
ol,
ul,
li {
list-style-type: none
}
ol,
ul,
dl {
margin-bottom: 0px;
}
.markdown-body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
color: #333;
overflow: hidden;
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
word-break: break-word;
font-size: 16px;
line-height: 1.6;
white-space: normal;
word-wrap: break-word;
position: relative;
}
.markdown-body ul>li {
list-style-type: disc;
}
.markdown-body ol>li {
list-style-type: decimal;
}
.markdown-body a {
background: transparent;
}
.markdown-body a:active,
.markdown-body a:hover {
outline: 0;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border: 0;
}
.markdown-body hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.markdown-body pre {
overflow: auto;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
font-size: 1em;
}
.markdown-body input {
color: inherit;
font: inherit;
margin: 0;
}
.markdown-body html input[disabled] {
cursor: default;
}
.markdown-body input {
line-height: normal;
}
.markdown-body input[type="checkbox"] {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body * {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body input {
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}
.markdown-body a {
color: #4183c4;
text-decoration: none;
}
.markdown-body a:hover,
.markdown-body a:active {
text-decoration: underline;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
.markdown-body hr:before {
display: table;
content: "";
}
.markdown-body hr:after {
display: table;
clear: both;
content: "";
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
.markdown-body h1 {
font-size: 30px;
}
.markdown-body h2 {
font-size: 21px;
}
.markdown-body h3 {
font-size: 16px;
}
.markdown-body h4 {
font-size: 14px;
}
.markdown-body h5 {
font-size: 12px;
}
.markdown-body h6 {
font-size: 11px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
ul.linenums,
ol.linenums {
padding: 16px 0 0 56px !important;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .octicon {
font: normal normal 16px octicons-anchor;
line-height: 1;
display: inline-block;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.markdown-body .octicon-link:before {
content: '\f05c';
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body .anchor {
position: absolute;
top: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
padding-left: 8px;
margin-left: -30px;
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h1 .anchor {
line-height: 1;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h2 .anchor {
line-height: 1;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h3 .anchor {
line-height: 1.2;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h4 .anchor {
line-height: 1.2;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h5 .anchor {
line-height: 1.1;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body h6 .anchor {
line-height: 1.1;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote> :first-child {
margin-top: 0;
}
.markdown-body blockquote> :last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
text-align: revert;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0, 0, 0, 0.04);
border-radius: 3px;
}
.markdown-body code:has(.katex) {
background-color: transparent;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\\00a0";
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .pl-c {
color: #969896;
}
.markdown-body .pl-c1,
.markdown-body .pl-mdh,
.markdown-body .pl-mm,
.markdown-body .pl-mp,
.markdown-body .pl-mr,
.markdown-body .pl-s1 .pl-v,
.markdown-body .pl-s3,
.markdown-body .pl-sc,
.markdown-body .pl-sv {
color: #0086b3;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #795da3;
}
.markdown-body .pl-s1 .pl-s2,
.markdown-body .pl-smi,
.markdown-body .pl-smp,
.markdown-body .pl-stj,
.markdown-body .pl-vo,
.markdown-body .pl-vpf {
color: #333;
}
.markdown-body .pl-ent {
color: #63a35c;
}
.markdown-body .pl-k,
.markdown-body .pl-s,
.markdown-body .pl-st {
color: #a71d5d;
}
.markdown-body .pl-pds,
.markdown-body .pl-s1,
.markdown-body .pl-s1 .pl-pse .pl-s2,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre,
.markdown-body .pl-src {
color: #df5000;
}
.markdown-body .pl-mo,
.markdown-body .pl-v {
color: #1d3e81;
}
.markdown-body .pl-id {
color: #b52a1d;
}
.markdown-body .pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.markdown-body .pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.markdown-body .pl-ml {
color: #693a17;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
color: #1d3e81;
font-weight: bold;
}
.markdown-body .pl-mq {
color: #008080;
}
.markdown-body .pl-mi {
color: #333;
font-style: italic;
}
.markdown-body .pl-mb {
color: #333;
font-weight: bold;
}
.markdown-body .pl-md,
.markdown-body .pl-mdhf {
background-color: #ffecec;
color: #bd2c00;
}
.markdown-body .pl-mdht,
.markdown-body .pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.markdown-body .pl-mdr {
color: #795da3;
font-weight: bold;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
float: left;
margin: 0.3em 0 0.25em -1.6em;
vertical-align: middle;
}
.markdown-body :checked+.radio-label {
z-index: 1;
position: relative;
border-color: #4183c4;
}
/*! Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
.pln {
color: #000
}
/* plain text */
@media screen {
.str {
color: #080
}
/* string content */
.kwd {
color: #008
}
/* a keyword */
.com {
color: #800
}
/* a comment */
.typ {
color: #606
}
/* a type name */
.lit {
color: #066
}
/* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun,
.opn,
.clo {
color: #660
}
.tag {
color: #008
}
/* a markup tag name */
.atn {
color: #606
}
/* a markup attribute name */
.atv {
color: #080
}
/* a markup attribute value */
.dec,
.var {
color: #606
}
/* a declaration; a variable name */
.fun {
color: red
}
/* a function name */
}
/* Use higher contrast and text-weight for printable form. */
@media print,
projection {
.str {
color: #060
}
.kwd {
color: #006;
font-weight: bold
}
.com {
color: #600;
font-style: italic
}
.typ {
color: #404;
font-weight: bold
}
.lit {
color: #044
}
.pun,
.opn,
.clo {
color: #440
}
.tag {
color: #006;
font-weight: bold
}
.atn {
color: #404
}
.atv {
color: #060
}
}
/* Put a border around prettyprinted code snippets. */
pre.prettyprint {
padding: 2px;
/* border: 1px solid #888 */
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0
}
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 {
list-style-type: none
}
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
background: #eee
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}`;return(0,F.useEffect)(()=>{const se=P.current.attachShadow({mode:"open"});j.current=document.createElement("div"),j.current.className="markdown-body",j.current.innerHTML=Y,se.appendChild(j.current);const Z=document.createElement("style");return Z.textContent=J,se.appendChild(Z),()=>{se.innerHTML=""}},[]),(0,F.useEffect)(()=>{j.current&&(j.current.innerHTML=Y)},[Y]),k.createElement("div",{ref:P})};function H(Y){const P=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],j=new RegExp(`\\b(${P.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi"),J=/<meta\s+http-equiv\s*=\s*["']?refresh["']?[^>]*>/gi;return Y.replace(j,"").replace(J,"").trim()}var V={mdBody:"mdBody___raKXb",button:"button___Ch5Pc",previewFlowChart:"previewFlowChart___vY1dq"},M=Object.defineProperty,I=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable,ee=(Y,P,j)=>P in Y?M(Y,P,{enumerable:!0,configurable:!0,writable:!0,value:j}):Y[P]=j,_e=(Y,P)=>{for(var j in P||(P={}))z.call(P,j)&&ee(Y,j,P[j]);if(I)for(var j of I(P))ae.call(P,j)&&ee(Y,j,P[j]);return Y};const be="@\u2581\u2581@",ce="@\u2581@",ve=/<pre[^>]*>/g;function Ie(Y){let P=document.createElement("div");return P.innerHTML=Y,P.childNodes.length===0?"":P.childNodes[0].nodeValue}const Ae=(Y,P)=>{Y=Y||"";const j=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,J=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,se=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Z=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return P?Y.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(j,(w,E,K,de,Ue,Ye,ct)=>{const at=E||de||Ye,Dt=K||Ue||ct||"?";return _.Z.API_SERVER+"/api/attachments/"+at+Dt+"&t="+(0,De.Jn)(at,Date.now())+(w.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Y=Y.replace(Z,(w,E,K,de,Ue,Ye,ct)=>{const at=E||de||Ye,Dt=K||Ue||ct||"?";return _.Z.API_SERVER+"/attachments/download/"+at+Dt+"&t="+(0,De.Jn)(at,Date.now())+(w.indexOf(")")>-1?")":"&")}).replace(j,(w,E,K,de,Ue,Ye,ct)=>{const at=E||de||Ye,Dt=K||Ue||ct||"?";return _.Z.API_SERVER+"/api/attachments/"+at+Dt+"&t="+(0,De.Jn)(at,Date.now())+(w.indexOf(")")>-1?")":"&")}).replace(J,(w,E,K,de,Ue)=>{const Ye=E||de,ct=K||Ue||"";return'"'+_.Z.API_SERVER+"/api/attachments/"+Ye+ct+Ye+ct+"&t="+(0,De.Jn)(Ye,Date.now())}).replace(se,(w,E,K,de,Ue)=>{const Ye=E||de,ct=K||Ue||"";return"("+_.Z.API_SERVER+"/files/uploads/"+Ye+ct+Ye+ct+"&t="+(0,De.Jn)(Ye,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Y)};var We=({value:Y="",edit:P=!1,className:j,showTextOnly:J,showLines:se,style:Z={},stylesPrev:w={},highlightKeywords:E,showProgramFill:K,isProgramFill:de,disabledFill:Ue=!1,programFillValue:Ye,openEditor:ct=()=>{},onFillChange:at=ot=>{},onFillBlur:Dt=()=>{},onFillFocus:bt=()=>{}})=>{let ot=H(String(Y||""));const Qt=(0,F.useRef)(),nt=(0,F.useRef)(),[kt,et]=(0,F.useState)(""),[Nt,Pe]=(0,F.useState)("office"),[$e,Ee]=(0,F.useState)([]),Ve=(0,F.useRef)("a"+(0,B.Z)()),Je={},lt=He=>/<style[\s\S]*?>/i.test(He||""),re=(He,Tt,gt)=>{const st=document.createElement(He===ce?"input":"textarea");st.style.width="100%",st.style.height=He===ce?"40px":"151px",st.rows=5,st.spellcheck=!1,st.name="edu-program-fill",st.placeholder="\u8BF7\u8F93\u5165",st.dataset.id=Tt;const Rt=Object.keys(Je).length;return Je[Rt]=st,`<span class="edu-program-fill-wrap ${He===ce?"":"show"}" style="width:${He===ce?"600px":"100%"}" title=${gt||""}><span>${st.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Se(He){return He=He.replace(/!\[.*?\]\(.*?\)/g,""),He=He.replace(/\[.*?\]\(.*?\)/g,""),He=He.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),He=He.replace(/<embed.*?>/g,""),He=He.replace(/<img.*?>/g,""),He=He.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),He=He.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),He=He.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),He=He.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),He}const je=He=>!J&&lt(ot)?He:He.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Tt,gt){let st=gt.replace(/(\n|\r)/g,"").split("}"),Rt=[];return st.map(y=>{y!=""&&Rt.push(`.${Ve.current} ${y}`)}),`<style>${Rt.join("}")}</style>`}),Ge=(0,F.useMemo)(()=>{(0,Be.Iy)();try{const st=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Rt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,y=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,D=/\(\/attachments\/download\//g;ot=ot.replace(D,"("+_.Z.API_SERVER+"/attachments/download/").replace(st,"("+_.Z.API_SERVER+"/api/attachments/").replace(Rt,'"'+_.Z.API_SERVER+"/api/attachments/").replace(y,'"'+_.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Qt.current.style.display="none"}catch(st){}if(K){let st=-1;return ot=ot.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(Rt,y,D){var Oe;return++st,re(Rt,st,(Oe=Ye==null?void 0:Ye[st])==null?void 0:Oe.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${je(ot||"")}</pre>`}let He=je(ot);He=(0,Be.ZP)(He);const Tt=(0,Be.ez)();ot.match(/\[TOC\]/)&&(He=He.replace("<p>[TOC]</p>",(0,Be.Qv)()),(0,Be.Iy)()),He=He.replace(/(__special_katext_id_\d+__)/g,(st,Rt)=>{const{type:y,expression:D}=Tt[Rt];return(0,pe.renderToString)(Ie(D)||"",{displayMode:y==="block",throwOnError:!1,output:"html"})}),He=He.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,Be.AL)();const gt=document.createElement("div");if(gt.innerHTML=He,J)return gt.innerText;if(E){const st=E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return yt(gt,st),gt.innerHTML}return setTimeout(()=>$t(),500),gt.innerHTML},[ot,E]);(0,F.useEffect)(()=>{_t.current&&_t.current.querySelectorAll(["input","textarea"]).forEach(Tt=>{Tt.oninput=Ze,Tt.onblur=mt,Tt.onfocus=Pt})},[$e]),(0,F.useEffect)(()=>{var He,Tt,gt,st,Rt;if(Ye!=null&&Ye.length)try{const y=_t.current.querySelectorAll(".edu-program-fill-score"),D=_t.current.querySelectorAll('[name="edu-program-fill"]');for(const[Oe,N]of D.entries())N.value=((He=Ye==null?void 0:Ye[Oe])==null?void 0:He.value)||"",((Tt=Ye==null?void 0:Ye[Oe])==null?void 0:Tt.type)==="warning"?N.className="program-fill-warning":((gt=Ye==null?void 0:Ye[Oe])==null?void 0:gt.type)==="success"?N.className="program-fill-success":N.className="";for(const[Oe,N]of y.entries())N.innerHTML=(st=Ye==null?void 0:Ye[Oe])!=null&&st.score?`${(Rt=Ye==null?void 0:Ye[Oe])==null?void 0:Rt.score}\u5206`:"";Ee(Ye)}catch(y){console.log(y,"error")}},[Ye]);const Ze=He=>{$e[He.target.dataset.id]=$e[He.target.dataset.id]||{},$e[He.target.dataset.id].value=He.target.value,Ee([...$e]),at($e,He.target.dataset.id)},mt=He=>{$e[He.target.dataset.id]=$e[He.target.dataset.id]||{},$e[He.target.dataset.id].value=He.target.value,Ee([...$e]),Dt($e,He.target.dataset.id)},Pt=He=>{$e[He.target.dataset.id]=$e[He.target.dataset.id]||{},$e[He.target.dataset.id].value=He.target.value,Ee([...$e]),bt($e,He.target.dataset.id)};function yt(He,Tt){return He.childNodes.forEach(gt=>{var st;if(gt.childNodes.length>0)yt(gt,Tt);else if(gt.nodeName!=="IMG")if(gt.innerHTML)gt.innerHTML=(st=gt.innerHTML)==null?void 0:st.replace(new RegExp(Tt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Rt=document.createElement("span");Rt.innerHTML=gt.textContent.replace(new RegExp(Tt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),gt.replaceWith(Rt)}})}const _t=(0,F.useRef)();Be.jb.WebkitLineClamp=se,se&&(Z=_e(_e({},Z),Be.jb));function vt(He){let Tt=He.target;if(Tt.tagName.toUpperCase()==="A"){let gt=Tt.getAttribute("href");if(gt.indexOf("office")>-1)He.preventDefault(),et(gt),Pe("office");else if(gt.indexOf("application/pdf")>-1)He.preventDefault(),et(gt),Pe("pdf");else if(gt.indexOf("text/html")>-1)He.preventDefault(),et(gt),Pe("html");else if(gt.startsWith("#")){He.preventDefault();let st=document.getElementById(gt.replace("#",""));st&&st.scrollIntoView(!0)}}}const $t=()=>{var He;const Tt=(He=_t.current)==null?void 0:He.querySelectorAll("video");Tt==null||Tt.forEach(gt=>{if(gt.oncontextmenu=()=>!1,gt.src.indexOf(".m3u8")>-1&&!gt.canPlayType("application/vnd.apple.mpegurl")){if(te.ZP.isSupported()){var st=new te.ZP;st.loadSource(gt.src),st.attachMedia(gt)}}})};(0,F.useEffect)(()=>{if(_t.current&&Ge&&Ge.match(ve)&&window.PR.prettyPrint(),_t.current)return _t.current.addEventListener("click",vt),()=>{var He;(He=_t.current)==null||He.removeEventListener("click",vt),(0,Be.AL)(),(0,Be.Iy)()}},[Ge,_t.current,vt]);const Ct=He=>{He.target.nodeName==="IMG"&&He.target.className.indexOf("draw-flowchart")>-1?(Qt.current.style.zIndex=1,Qt.current.style.display="flex",Qt.current.style.width=He.target.clientWidth+"px",Qt.current.style.height=He.target.clientHeight+"px",Qt.current.style.top=He.target.offsetTop+"px",Qt.current.style.left=He.target.offsetLeft+"px",He.target.id&&(nt.current=He.target.id)):Qt.current.style.display="none"},wt=()=>{Qt.current.style.display="none"};return(0,F.useEffect)(()=>{var He;const Tt=gt=>{gt.preventDefault(),gt.clipboardData.setData("text",window.getSelection().toString())};return(He=_t.current)==null||He.addEventListener("copy",Tt),()=>{var gt;(gt=_t.current)==null||gt.removeEventListener("copy",Tt)}},[_t.current]),F.createElement("div",{style:{position:"relative"},onMouseLeave:wt},J&&F.createElement("div",{ref:_t,className:`${V.mdBody} `},Ge),!J&&!lt(Ge)&&F.createElement("div",{ref:_t,style:_e({},Z),onMouseOver:Ct,className:`${j||""} ${Ue?"disabled-fill":""} markdown-body ${V.mdBody} ${Ve.current}`,dangerouslySetInnerHTML:{__html:Ge}}),!J&&lt(Ge)&&F.createElement(C,{html:Ge}),F.createElement("div",{ref:Qt,className:`${V.button} ${P?"":V.previewFlowChart}`},F.createElement(u.Z,null,F.createElement(Q.ZP,{onClick:()=>{P?ct(nt.current):(et(nt.current),Pe("flowChart"))}},P?"\u7F16\u8F91":"\u9884\u89C8"))),F.createElement(b.Z,{close:!0,data:kt,type:kt!=null&&kt.length?Nt:"",style:_e({},w),onClose:()=>et("")}))}},34728:function(Kt,it,X){"use strict";X.d(it,{SV:function(){return Qt},ZP:function(){return ot}});var F=X(59301),Te=X(76374);const Be={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},ye={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},te={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std",content:["using namespace std"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},_={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},De={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
`)}]};var pe=X(53184),u=X.n(pe),Q=(nt,kt,et)=>new Promise((Nt,Pe)=>{var $e=Je=>{try{Ve(et.next(Je))}catch(lt){Pe(lt)}},Ee=Je=>{try{Ve(et.throw(Je))}catch(lt){Pe(lt)}},Ve=Je=>Je.done?Nt(Je.value):Promise.resolve(Je.value).then($e,Ee);Ve((et=et.apply(nt,kt)).next())});const B={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},b=(nt,kt,et,Nt)=>{const Pe=kt.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:et.lineNumber,endColumn:et.column});return Array.from(new Set(Pe.match(/\b\w{2,}\b/g)||[])).map(Ee=>({label:Ee,kind:nt.languages.CompletionItemKind.Text,insertText:Ee,range:Nt}))},k=(nt,kt,et,Nt)=>{nt.languages.registerCompletionItemProvider(kt,{provideCompletionItems(Pe,$e){const Ee=Pe.getWordUntilPosition($e),Ve={startLineNumber:$e.lineNumber,endLineNumber:$e.lineNumber,startColumn:Ee.startColumn,endColumn:Ee.endColumn},Je=Pe.getLineContent($e.lineNumber).substring(Ee.startColumn-2,Ee.endColumn);return{suggestions:[...b(nt,Pe,$e,Ve),...et.map(re=>({label:re,kind:nt.languages.CompletionItemKind.Keyword,documentation:re,insertText:re,insertTextRules:nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ve})),...Nt.map(re=>({label:re.label,kind:nt.languages.CompletionItemKind.Snippet,documentation:re.content,insertText:Je.startsWith("#")?re.content.replace(/#/,""):re.content,insertTextRules:nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ve}))]}}})};var S=nt=>{B.languages.forEach(kt=>{nt.languages.registerDocumentFormattingEditProvider(kt,{provideDocumentFormattingEdits(et){return Q(this,null,function*(){const Nt=u()(et.getValue(),{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:0,indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:et.getFullModelRange(),text:Nt}]})}})}),k(nt,"java",ye.keywords,ye.quickKey),k(nt,"cpp",te.keywords,te.quickKey),k(nt,"c",Be.keywords,[]),k(nt,"python",_.keywords,_.quickKey),k(nt,"scala",De.keywords,De.quickKey)};const C="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var H=Object.defineProperty,V=(nt,kt,et)=>kt in nt?H(nt,kt,{enumerable:!0,configurable:!0,writable:!0,value:et}):nt[kt]=et,M=(nt,kt,et)=>V(nt,typeof kt!="symbol"?kt+"":kt,et);const I=class Eu{constructor(kt,et,Nt){this.placeholder=kt,this.editor=et,this.monaco=Nt,et.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Eu.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};M(I,"ID","editor.widget.placeholderHint");var ae=I,ee=X(96236),_e=X(6767),be=X(25399),ce=X(78267),ve=X(33156),Ie=X(56102),Ae=Object.defineProperty,We=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,se=(nt,kt,et)=>kt in nt?Ae(nt,kt,{enumerable:!0,configurable:!0,writable:!0,value:et}):nt[kt]=et,Z=(nt,kt)=>{for(var et in kt||(kt={}))j.call(kt,et)&&se(nt,et,kt[et]);if(P)for(var et of P(kt))J.call(kt,et)&&se(nt,et,kt[et]);return nt},w=(nt,kt)=>We(nt,Y(kt)),E=(nt,kt)=>{var et={};for(var Nt in nt)j.call(nt,Nt)&&kt.indexOf(Nt)<0&&(et[Nt]=nt[Nt]);if(nt!=null&&P)for(var Nt of P(nt))kt.indexOf(Nt)<0&&J.call(nt,Nt)&&(et[Nt]=nt[Nt]);return et},K=(nt,kt,et)=>new Promise((Nt,Pe)=>{var $e=Je=>{try{Ve(et.next(Je))}catch(lt){Pe(lt)}},Ee=Je=>{try{Ve(et.throw(Je))}catch(lt){Pe(lt)}},Ve=Je=>Je.done?Nt(Je.value):Promise.resolve(Je.value).then($e,Ee);Ve((et=et.apply(nt,kt)).next())});function de(nt){return/^\d+$/.test(nt)?`${nt}px`:nt}function Ue(){}let Ye=!1;const ct={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function at(nt=[]){let kt=nt;if(Array.isArray(nt)){for(let et=0;et<nt.length;et++){let Nt=ct[nt[et]];if(Nt)return Nt}return kt[0]}return ct[kt]||kt}let Dt=null;const bt=()=>K(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(nt){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",nt)}});var ot=nt=>{var kt=nt,{width:et="100%",height:Nt="100%",value:Pe,language:$e="javascript",style:Ee={},options:Ve={},overrideServices:Je={},theme:lt="vs-dark",onEditBlur:re,isCopy:Se=!1,onSave:je,autoHeight:Ge=!1,forbidCopy:Ze=!1,forbidCopyTips:mt,onChange:Pt=Ue,editorDidMount:yt=Ue,onFocus:_t=Ue,onBreakPoint:vt=Ue,breakPointValue:$t=[],filename:Ct="educoder.txt",errorLine:wt,errorContent:He="",highlightLine:Tt,openBreakPoint:gt=!1,placeholder:st="",showMiniMap:Rt=!0}=kt,y=E(kt,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","forbidCopyTips","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const D=(0,F.useRef)(),Oe=(0,F.useRef)({}),N=(0,F.useRef)(),oe=(0,F.useRef)(),rr=(0,F.useRef)([]),xe=(0,F.useRef)(!1),ke=(0,F.useRef)(),Re=(0,F.useRef)(),G=(0,F.useRef)(!1),[q,me]=(0,F.useState)(!1);function we(){let pt;return D.current&&(pt=new Te.Z(xt=>{for(let tr of xt)(tr.target.offsetHeight>0||tr.target.offsetWidth>0)&&Oe.current.instance.layout()}),pt.observe(D.current)),pt}function O(){_e.ZP.warning({content:decodeURIComponent(mt||C),key:"monaco-editor-tip"})}const ht=()=>{let pt=Oe.current.instance;if(Pe!=null&&pt&&q){const xt=pt.getModel();xt&&Pe!==xt.getValue()&&(Ye=!0,xt.setValue(Pe),pt.layout(),Ye=!1)}};(0,F.useEffect)(()=>{const pt=ve.Z.subscribe("formatDocument",xt=>{var tr;let pr=Oe.current.instance;(tr=pr==null?void 0:pr.getAction)==null||tr.call(pr,"editor.action.formatDocument").run()});return window.updateMonacoValue=xt=>{Pt(xt)},pt},[]),(0,F.useEffect)(()=>{var pt;let xt=Oe.current.instance;oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>{ht()},500),Pe&&(Pe!=null&&Pe.length)&&((pt=xt==null?void 0:xt.updateOptions)==null||pt.call(xt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Pe.split(/\r\n|\r|\n/g).length))+3,5)}))},[Pe,q,Oe.current]),(0,F.useEffect)(()=>{if(wt&&Oe.current&&Oe.current.instance){let xt=Oe.current.instance;xt.changeViewZones(function(tr){var pr=document.createElement("div");pr.style.padding="10px 20px",pr.style.width="calc(100% - 20px)",pr.className="my-error-line-wrp",pr.innerHTML=He,tr.addZone({afterLineNumber:wt||11,heightInLines:3,domNode:pr})});var pt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};xt.addOverlayWidget(pt),xt.revealPositionInCenter({lineNumber:20,column:1})}},[wt,Oe.current,q]);const he=(pt="",xt)=>{if(!pt||pt.trim()==="")return!0;const pr=Oe.current.instance.getModel().getLineTokens(xt);let wr=!1;for(let Yr=0;Yr<2;Yr++)pr.getStandardTokenType(Yr)===1&&(wr=!0);return wr};(0,F.useEffect)(()=>{var pt;const xt=(pt=Oe.current)==null?void 0:pt.instance;if(xt&&q&&Ze){const tr=xt.onDidBlurEditorWidget(()=>{G.current=!1}),pr=xt.onDidFocusEditorText(()=>{G.current=!0});return()=>{tr.dispose(),pr.dispose()}}},[Oe.current,q,Ze]),(0,F.useEffect)(()=>{var pt;if((pt=Oe.current)!=null&&pt.instance&&q&&gt){let xt=Oe.current.instance,tr=xt.getModel();if(!tr)return;(()=>{var yr;let Tr=[],Cr=[];const Nr=tr.getAllDecorations();for(let nr of Nr)nr.options.className==="highlighted-line"&&(Tr.push((yr=nr==null?void 0:nr.range)==null?void 0:yr.startLineNumber),Cr.push(nr==null?void 0:nr.id));if(Tt===Tr[0])return;tr.deltaDecorations(Cr,[]);const br=tr.getLineCount();Tt&&Tt<=br&&(xt.deltaDecorations([],[{range:new Dt.Range(Tt,1,Tt,tr.getLineMaxColumn(Tt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),xt.revealLineInCenter(Tt))})();const wr=(yr=!1)=>{var Tr;let Cr=[],Nr=[];const br=tr.getAllDecorations();for(let nr of br)nr.options.linesDecorationsClassName==="breakpoints-select"&&(Cr.push((Tr=nr==null?void 0:nr.range)==null?void 0:Tr.startLineNumber),Nr.push(nr==null?void 0:nr.id));if(yr)return{lines:Cr,ids:Nr};vt(Cr)},Yr=yr=>K(void 0,null,function*(){let Tr={range:new Dt.Range(yr,1,yr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield tr.deltaDecorations([],[Tr]),wr()}),qr=yr=>K(void 0,null,function*(){let Tr=[];const Cr=xt.getLineDecorations(yr);for(let Nr of Cr)Nr.options.linesDecorationsClassName==="breakpoints-select"&&Tr.push(Nr.id);yield tr.deltaDecorations(Tr,[]),wr()}),sn=yr=>{let Tr=xt.getLineDecorations(yr);for(let Cr of Tr)if(Cr.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,ce.isEqual)($t,wr(!0).lines)){tr.deltaDecorations(wr(!0).ids,[]);const yr=$t.map(Tr=>({range:new Dt.Range(Tr,1,Tr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));tr.deltaDecorations([],yr)}const Jr=xt.onDidChangeModelContent(yr=>{let Tr=xt.getPosition();if(Tr){let Cr=Tr.lineNumber;clearTimeout(Re.current),Re.current=setTimeout(()=>{he(tr.getLineContent(Cr),Cr)?qr(Cr):sn(Cr)?(qr(Cr),Yr(Cr)):wr()},100)}}),mr=xt.onMouseDown(yr=>{var Tr,Cr,Nr;if(yr.target.detail&&((Nr=(Cr=(Tr=yr.target)==null?void 0:Tr.element)==null?void 0:Cr.className)!=null&&Nr.includes("line-numbers"))){let br=yr.target.position.lineNumber;if(he(tr.getLineContent(br),br))return;sn(br)?qr(br):Yr(br)}}),cn=yr=>{let Tr={range:new Dt.Range(yr,1,yr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};rr.current=xt.deltaDecorations(rr.current,[Tr])},kr=()=>{rr.current=xt.deltaDecorations(rr.current,[])},En=xt.onMouseMove(yr=>{var Tr,Cr,Nr;if(kr(),yr.target.detail&&((Nr=(Cr=(Tr=yr.target)==null?void 0:Tr.element)==null?void 0:Cr.className)!=null&&Nr.includes("line-numbers"))){let br=yr.target.position.lineNumber;if(he(tr.getLineContent(br),br))return;cn(br)}}),dn=xt.onMouseLeave(()=>{kr()});return()=>{Jr.dispose(),mr.dispose(),En.dispose(),dn.dispose()}}},[Oe.current,q,$t,Tt,gt,$e]),(0,F.useEffect)(()=>{var pt;(pt=Oe.current)!=null&&pt.instance&&gt&&Oe.current.instance.setPosition({lineNumber:0,column:0})},[Tt]);function It(){let pt=Oe.current.instance;if(pt){const xt=pt.getSelection(),tr=Oe.current.pastePos||{},pr=new Dt.Range(tr.startLineNumber||xt.endLineNumber,tr.startColumn||xt.endColumn,tr.endLineNumber||xt.endLineNumber,tr.endColumn||xt.endColumn);setTimeout(()=>{pt.executeEdits("",[{range:pr,text:""}])},300)}}function Ot(pt){(window.navigator.platform.match("Mac")?pt.metaKey:pt.ctrlKey)&&pt.keyCode==83&&(pt.preventDefault(),je())}const er=()=>{if(Ge&&Oe.current.instance){const pt=Oe.current.instance.getContentHeight();_r(pt<Nt?Nt:pt)}else _r(Nt)};function Dr(pt){var xt=document.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),pt.dispatchEvent(xt)}const lr=pt=>{if(!G.current)return;const{keyCode:xt,ctrlKey:tr,metaKey:pr,target:wr,type:Yr}=pt;return(Yr==="paste"||(xt===67||xt===86)&&(pr||tr))&&wr.nodeName==="TEXTAREA"&&(O(),pt.preventDefault()),!1};function Wt(pt,xt){var tr=window.URL||window.webkitURL||window,pr=new Blob([xt]),wr=document.createElementNS("http://www.w3.org/1999/xhtml","a");wr.href=tr.createObjectURL(pr),wr.download=pt,Dr(wr)}(0,F.useEffect)(()=>{er()},[er]),(0,F.useEffect)(()=>{D.current&&!q&&Promise.all([X.e(8909),X.e(5977)]).then(X.bind(X,71448)).then(pt=>{try{Dt=pt,Oe.current.instance=Dt.editor.create(D.current,{value:Pe,language:at($e),theme:lt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Rt||!1}},Je);const xt=Oe.current.instance;let wr=[...ee.BH._menuItems].find(Jr=>Jr[0]._debugName=="EditorContext")[1],Yr=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],qr=(Jr,mr)=>{var cn,kr;let En=Jr._first;do mr.includes((kr=(cn=En.element)==null?void 0:cn.command)==null?void 0:kr.id)&&Jr._remove(En);while(En=En.next)};if(yt(xt,Dt),setTimeout(()=>{er(),Oe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Wt(Ct||"educoder.txt",xt.getValue())}})},500),Oe.current.subscription=xt.onDidChangeModelContent(Jr=>{xe.current?clearTimeout(ke.current):(er(),Pt(xt.getValue(),Jr)),ke.current=setTimeout(()=>{xe.current=!1},500)}),window.Monaco||S(Dt,at($e)),Ze&&(qr(wr,Yr),D.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",lr),window.removeEventListener("paste",lr),window.addEventListener("keydown",lr),window.addEventListener("paste",lr)),window.Monaco=Dt,re&&xt.onDidBlurEditorWidget(()=>{re(xt.getValue())}),_t&&xt.onDidFocusEditorText(()=>{Ze&&bt(),_t(xt.getValue())}),Ze){bt();try{xt.onDidPaste(Jr=>{const mr=xt.getSelection(),cn=Oe.current.pastePos||{},kr=new Dt.Range(cn.startLineNumber||mr.endLineNumber,cn.startColumn||mr.endColumn,cn.endLineNumber||mr.endLineNumber,cn.endColumn||mr.endColumn);xt.executeEdits("",[{range:Jr.range,text:""}])})}catch(Jr){}}let sn=we();return st&&typeof st=="string"&&new ae(st,xt,Dt),me(!0),()=>{const Jr=Oe.current.instance;Jr.dispose();const mr=Jr.getModel();mr&&mr.dispose(),Oe.current.subscription&&Oe.current.subscription.dispose(),sn.unobserve(D.current)}}catch(xt){}})},[]),(0,F.useEffect)(()=>{if(Oe.current.instance&&q)return document.addEventListener("keydown",Ot,!1),()=>{document.removeEventListener("keydown",Ot)}},[je,q]),(0,F.useEffect)(()=>{let pt=Oe.current.instance;if(pt&&q){let xt=at($e);Dt.editor.setModelLanguage(pt.getModel(),xt)}},[$e,q]),(0,F.useEffect)(()=>{Oe.current.instance&&q&&Dt.editor.setTheme(lt)},[lt,q]),(0,F.useEffect)(()=>{let pt=Oe.current.instance;N.current=Ve,pt&&q&&(pt.updateOptions(Z({},Ve)),setTimeout(()=>{pt.getModel().updateOptions(Z({},Ve))},200))},[JSON.stringify(Ve),q]),(0,F.useEffect)(()=>{let pt=Oe.current.instance;pt&&q&&pt.layout()},[et,Nt,q]);const[Mr,Xr]=(0,F.useState)(de(et)),[Er,_r]=(0,F.useState)(de(Nt)),At=w(Z({},Ee),{width:Mr,height:Er,position:"relative"});return F.createElement("div",{className:"my-monaco-editor",ref:D,style:At,onFocus:()=>{Ze&&bt()}},Se&&F.createElement(Ie.CopyToClipboard,{text:Pe,onCopy:()=>_e.ZP.success("\u590D\u5236\u6210\u529F")},F.createElement(be.Z,{title:"\u590D\u5236\u4EE3\u7801"},F.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},F.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Qt({width:nt="100%",height:kt="100%",original:et,modified:Nt,language:Pe,options:$e={}}){const Ee=(0,F.useRef)(),[Ve,Je]=(0,F.useState)(null);function lt(Ge){let Ze;return Ee.current&&(Ze=new Te.Z(mt=>{for(let Pt of mt)(Pt.target.offsetHeight>0||Pt.target.offsetWidth>0)&&Ge.layout()}),Ze.observe(Ee.current)),Ze}(0,F.useEffect)(()=>(Ee.current&&Promise.all([X.e(8909),X.e(9404)]).then(X.bind(X,2550)).then(Ge=>{Dt=Ge;const Ze=Dt.editor.createDiffEditor(Ee.current,w(Z({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},$e),{wordWrap:!0}));Je(Ze);let mt=lt(Ze);return()=>{Ze.dispose();const Pt=Ze.getModel();Pt&&Pt.dispose(),mt.unobserve(Ee.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,F.useEffect)(()=>{Ve&&Ve.setModel({original:Dt.editor.createModel(et,Pe),modified:Dt.editor.createModel(Nt,Pe)})},[et,Nt,Pe,Ve]);const re=de(nt),Se=de(kt),je={width:re,height:Se};return F.createElement("div",{className:"my-diff-editor",ref:Ee,style:je})}},60810:function(Kt,it,X){"use strict";X.r(it),X.d(it,{Types:function(){return ee}});var F=X(59301),Te=X(29787),Be=X(7939),ye=X(93725),te=X(44283),_=X(49317),De=X(14185),pe=X(35883),u=X(13225),Q=X(72082),B=Object.defineProperty,b=Object.defineProperties,k=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,V=(be,ce,ve)=>ce in be?B(be,ce,{enumerable:!0,configurable:!0,writable:!0,value:ve}):be[ce]=ve,M=(be,ce)=>{for(var ve in ce||(ce={}))C.call(ce,ve)&&V(be,ve,ce[ve]);if(S)for(var ve of S(ce))H.call(ce,ve)&&V(be,ve,ce[ve]);return be},I=(be,ce)=>b(be,k(ce)),z=(be,ce,ve)=>new Promise((Ie,Ae)=>{var We=j=>{try{P(ve.next(j))}catch(J){Ae(J)}},Y=j=>{try{P(ve.throw(j))}catch(J){Ae(J)}},P=j=>j.done?Ie(j.value):Promise.resolve(j.value).then(We,Y);P((ve=ve.apply(be,ce)).next())});const ae={data:void 0};var ee=(be=>(be.GET_DATA="get-data",be.PRAISE="on-praise",be))(ee||{});function _e(be,ce){switch(ce.type){case"get-data":return I(M({},be),{data:ce.payload});case"on-praise":return I(M({},be),{data:ce.payload});default:throw new Error}}it.default=()=>{var be,ce,ve,Ie,Ae,We,Y,P,j;const[J,se]=(0,F.useReducer)(_e,ae),{data:Z}=J,{caseId:w}=(0,te.useParams)();(0,F.useEffect)(()=>{let de=!1;function Ue(){return z(this,null,function*(){const Ye=yield(0,_.U2)(`libraries/${w}.json`);de||(Ye.status===404?te.history.push("/moop_cases"):se({type:"get-data",payload:Ye}))})}return de||Ue(),()=>{de=!0}},[w]);function E(){return z(this,null,function*(){yield(0,_.v_)("praise_tread/like.json",{object_id:w,object_type:"library"});let de=M({},Z);de.operation.user_praised=!0,de.praise_count+=1,se({type:"on-praise",payload:de})})}function K(){return z(this,null,function*(){yield(0,_.IV)(`/libraries/${w}.json`),te.history.push("/moop_cases")})}return F.createElement(Te.Z,{spinning:!Z,delay:500},Z?F.createElement("section",{className:"moop-info"},F.createElement("div",{className:"crumb"},F.createElement(te.Link,{to:"/moop_cases"},"\u6559\u5B66\u6848\u4F8B > "),F.createElement("span",null,Z.title)),F.createElement("div",{className:"title"},F.createElement("h2",null,Z.title,(be=Z.tags)==null?void 0:be.map((de,Ue)=>F.createElement("span",{className:"label-"+Ue,key:de.id},de.name))),F.createElement(te.Link,{to:"/moop_cases"},"\u8FD4\u56DE")),F.createElement("div",{className:"moop-info-body"},F.createElement("div",{className:"moop-sub-title"},F.createElement("img",{src:`${De.Z.IMG_SERVER}/images/${(ce=Z.creator)==null?void 0:ce.image_url}`,alt:"cover",width:50}),F.createElement("div",{className:"desc"},F.createElement("div",{className:"flex-container"},F.createElement("span",null,(ve=Z.creator)==null?void 0:ve.name),(Ie=Z.operation)!=null&&Ie.can_editable?F.createElement(te.Link,{to:`/moop_cases/${Z.id}/edit`,style:{marginRight:10}},F.createElement(Be.ZP,{type:"ghost"},"\u7F16\u8F91")):null,(Ae=Z.operation)!=null&&Ae.can_deletable?F.createElement(ye.Z,{placement:"bottomRight",title:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onConfirm:K},F.createElement(Be.ZP,{type:"dashed"},"\u5220\u9664")):null),F.createElement("div",{className:"sum"},F.createElement("span",null,(We=Z.creator)==null?void 0:We.school_name),F.createElement("span",null,"\u7F16\u7801\uFF1A",Z.uuid),F.createElement("span",null,"\u53D1\u5E03\u65F6\u95F4\uFF1A",Z.published_at)))),F.createElement("p",null,"\u4F5C\u8005\uFF1A",`${Z.author_name} / ${Z.author_school_name}`),F.createElement(pe.Z,{value:Z.content}),F.createElement("ul",{className:"attachment"},(Y=Z.attachments)==null?void 0:Y.map(de=>F.createElement("li",{key:de.id},F.createElement("a",{href:de.url},F.createElement("i",{className:"iconfont icon-fujian"}),F.createElement("span",null,de.title),F.createElement("span",null,de.filesize))))),F.createElement("button",{className:"praise",disabled:(P=Z.operation)==null?void 0:P.user_praised,onClick:E},(j=Z.operation)!=null&&j.user_praised?F.createElement("span",null,"\u5DF2\u8D5E"):F.createElement("span",null,F.createElement("i",{className:"iconfont icon-dianzan"})),F.createElement("span",null,Z.praise_count)))):null)}},20047:function(Kt,it,X){"use strict";X.d(it,{AL:function(){return ae},Iy:function(){return B},Qv:function(){return S},ez:function(){return z},jb:function(){return b}});var F=X(32834),Te=X.n(F),Be=X(11690),ye=X.n(Be);let te=1;function _(ve,Ie){const Ae=ve.match(/^(\s+)(?:```)/);if(Ae===null)return Ie;const We=Ae[1];return Ie.split(`
`).map(Y=>{const P=Y.match(/^\s+/);if(P===null)return Y;const[j]=P;return j.length>=We.length?Y.slice(We.length):Y}).join(`
`)}let De=[],pe=["<ul>"];const u=new(Te()).Renderer,Q=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function B(){De.length=0,pe=["<ul>"]}const b={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function k(ve,Ie,Ae,We){if(Ie>=ve.length||ve[Ie].level<=Ae)return Ie;var Y=ve[Ie];We.push("<li><a href='#"+te+Y.anchor+"'>"+Y.text+"</a>"),Ie++;var P=[];return Ie=k(ve,Ie,Y.level,P),P.length>0&&(We.push("<ul>"),P.forEach(function(j){We.push(j)}),We.push("</ul>")),We.push("</li>"),Ie=k(ve,Ie,Ae,We),Ie}function S(){return k(De,0,0,pe),pe.push("</ul>"),pe.join("")}const C={heading(ve){const Ie=Q.exec(ve);if(te+=1,Ie)return{type:"heading",raw:Ie[0],depth:Ie[1].length,text:Ie[2]}},fences(ve){const Ie=this.rules.block.fences.exec(ve);if(Ie){const Ae=Ie[0];let We=_(Ae,Ie[3]||"");const Y=Ie[2]?Ie[2].trim():Ie[2];if(["latex","katex","math"].indexOf(Y)>=0){const P=M(),j=We;We=P,I[P]={type:"block",expression:j}}return{type:"code",raw:Ae,lang:Y,text:We}}}},H=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let V=0;const M=()=>`__special_katext_id_${V++}__`;let I={};function z(){return I}function ae(){V=0,I={}}function ee(ve){return ve=ve.replace(H,(Ie,Ae)=>{const We=M();return I[We]={type:"inline",expression:Ae},We}),ve}const _e=u.listitem;u.listitem=function(ve){return _e(ee(ve))};const be=u.paragraph;u.paragraph=function(ve){return be(ee(ve))};const ce=u.tablecell;u.tablecell=function(ve,Ie){return ce(ee(ve),Ie)},u.code=function(ve,Ie,Ae){const We=(Ie||"").match(/\S*/)[0];return We?["latex","katex","math"].indexOf(We)>=0?`<p class='editormd-tex'>${ve}</p>`:`<pre class="prettyprint linenums"><code class="language-${Ie}">${Ae?ve:(0,Be.escape)(ve,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(Ae?ve:(0,Be.escape)(ve,!0))+"</code></pre>"},u.heading=function(ve,Ie,Ae){let We=this.options.headerPrefix+Ae.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return De.push({anchor:We,level:Ie,text:ve}),"<h"+Ie+' id="'+te+We+'">'+ve+"</h"+Ie+">"},Te().setOptions({silent:!0,gfm:!0,pedantic:!1}),Te().use({tokenizer:C,renderer:u}),it.ZP=Te()},29509:function(Kt,it,X){"use strict";X.d(it,{o2:function(){return te},yT:function(){return _}});var F=X(77654),Te=X(34998);const Be=Te.i.map(De=>`${De}-inverse`),ye=["success","processing","error","default","warning"];function te(De){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,F.Z)(Be),(0,F.Z)(Te.i)).includes(De):Te.i.includes(De)}function _(De){return ye.includes(De)}},99402:function(Kt,it,X){"use strict";X.d(it,{T:function(){return Te},n:function(){return F}});function F(Be){return["small","middle","large"].includes(Be)}function Te(Be){return Be?typeof Be=="number"&&!Number.isNaN(Be):!1}},54500:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return F}});const F=Te=>Te?typeof Te=="function"?Te():Te:null},52838:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return _}});var F=X(37645);function Te(De,pe,u,Q){if(Q===!1)return{adjustX:!1,adjustY:!1};const B=Q&&typeof Q=="object"?Q:{},b={};switch(De){case"top":case"bottom":b.shiftX=pe.arrowOffsetHorizontal*2+u,b.shiftY=!0,b.adjustY=!0;break;case"left":case"right":b.shiftY=pe.arrowOffsetVertical*2+u,b.shiftX=!0,b.adjustX=!0;break}const k=Object.assign(Object.assign({},b),B);return k.shiftX||(k.adjustX=!0),k.shiftY||(k.adjustY=!0),k}const Be={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"]}},ye={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"]}},te=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function _(De){const{arrowWidth:pe,autoAdjustOverflow:u,arrowPointAtCenter:Q,offset:B,borderRadius:b,visibleFirst:k}=De,S=pe/2,C={};return Object.keys(Be).forEach(H=>{const V=Q&&ye[H]||Be[H],M=Object.assign(Object.assign({},V),{offset:[0,0],dynamicInset:!0});switch(C[H]=M,te.has(H)&&(M.autoArrow=!1),H){case"top":case"topLeft":case"topRight":M.offset[1]=-S-B;break;case"bottom":case"bottomLeft":case"bottomRight":M.offset[1]=S+B;break;case"left":case"leftTop":case"leftBottom":M.offset[0]=-S-B;break;case"right":case"rightTop":case"rightBottom":M.offset[0]=S+B;break}const I=(0,F.wZ)({contentRadius:b,limitVerticalRadius:!0});if(Q)switch(H){case"topLeft":case"bottomLeft":M.offset[0]=-I.arrowOffsetHorizontal-S;break;case"topRight":case"bottomRight":M.offset[0]=I.arrowOffsetHorizontal+S;break;case"leftTop":case"rightTop":M.offset[1]=-I.arrowOffsetHorizontal*2+S;break;case"leftBottom":case"rightBottom":M.offset[1]=I.arrowOffsetHorizontal*2-S;break}M.overflow=Te(H,I,pe,u),k&&(M.htmlRegion="visibleFirst")}),C}},93725:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return Ie}});var F=X(59301),Te=X(96512),Be=X(92310),ye=X.n(Be),te=X(18929),_=X(2738),De=X(48755),pe=X(37639),u=X(15565),Q=X(54500),B=X(7939),b=X(61670),k=X(9017),S=X(85981),C=X(69106),H=X(16931);const V=Ae=>{const{componentCls:We,iconCls:Y,antCls:P,zIndexPopup:j,colorText:J,colorWarning:se,marginXXS:Z,marginXS:w,fontSize:E,fontWeightStrong:K,colorTextHeading:de}=Ae;return{[We]:{zIndex:j,[`&${P}-popover`]:{fontSize:E},[`${We}-message`]:{marginBottom:w,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${We}-message-icon ${Y}`]:{color:se,fontSize:E,lineHeight:1,marginInlineEnd:w},[`${We}-title`]:{fontWeight:K,color:de,"&:only-child":{fontWeight:"normal"}},[`${We}-description`]:{marginTop:Z,color:J}},[`${We}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:w}}}}},M=Ae=>{const{zIndexPopupBase:We}=Ae;return{zIndexPopup:We+60}};var I=(0,H.I$)("Popconfirm",Ae=>V(Ae),M,{resetStyle:!1}),z=function(Ae,We){var Y={};for(var P in Ae)Object.prototype.hasOwnProperty.call(Ae,P)&&We.indexOf(P)<0&&(Y[P]=Ae[P]);if(Ae!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,P=Object.getOwnPropertySymbols(Ae);j<P.length;j++)We.indexOf(P[j])<0&&Object.prototype.propertyIsEnumerable.call(Ae,P[j])&&(Y[P[j]]=Ae[P[j]]);return Y};const ae=Ae=>{const{prefixCls:We,okButtonProps:Y,cancelButtonProps:P,title:j,description:J,cancelText:se,okText:Z,okType:w="primary",icon:E=F.createElement(Te.Z,null),showCancel:K=!0,close:de,onConfirm:Ue,onCancel:Ye,onPopupClick:ct}=Ae,{getPrefixCls:at}=F.useContext(De.E_),[Dt]=(0,k.Z)("Popconfirm",S.Z.Popconfirm),bt=(0,Q.Z)(j),ot=(0,Q.Z)(J);return F.createElement("div",{className:`${We}-inner-content`,onClick:ct},F.createElement("div",{className:`${We}-message`},E&&F.createElement("span",{className:`${We}-message-icon`},E),F.createElement("div",{className:`${We}-message-text`},bt&&F.createElement("div",{className:`${We}-title`},bt),ot&&F.createElement("div",{className:`${We}-description`},ot))),F.createElement("div",{className:`${We}-buttons`},K&&F.createElement(B.ZP,Object.assign({onClick:Ye,size:"small"},P),se||(Dt==null?void 0:Dt.cancelText)),F.createElement(u.Z,{buttonProps:Object.assign(Object.assign({size:"small"},(0,b.nx)(w)),Y),actionFn:Ue,close:de,prefixCls:at("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},Z||(Dt==null?void 0:Dt.okText))))};var _e=Ae=>{const{prefixCls:We,placement:Y,className:P,style:j}=Ae,J=z(Ae,["prefixCls","placement","className","style"]),{getPrefixCls:se}=F.useContext(De.E_),Z=se("popconfirm",We),[w]=I(Z);return w(F.createElement(C.ZP,{placement:Y,className:ye()(Z,P),style:j,content:F.createElement(ae,Object.assign({prefixCls:Z},J))}))},be=function(Ae,We){var Y={};for(var P in Ae)Object.prototype.hasOwnProperty.call(Ae,P)&&We.indexOf(P)<0&&(Y[P]=Ae[P]);if(Ae!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,P=Object.getOwnPropertySymbols(Ae);j<P.length;j++)We.indexOf(P[j])<0&&Object.prototype.propertyIsEnumerable.call(Ae,P[j])&&(Y[P[j]]=Ae[P[j]]);return Y};const ve=F.forwardRef((Ae,We)=>{var Y,P;const{prefixCls:j,placement:J="top",trigger:se="click",okType:Z="primary",icon:w=F.createElement(Te.Z,null),children:E,overlayClassName:K,onOpenChange:de,onVisibleChange:Ue,overlayStyle:Ye,styles:ct,classNames:at}=Ae,Dt=be(Ae,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:bt,className:ot,style:Qt,classNames:nt,styles:kt}=(0,De.dj)("popconfirm"),[et,Nt]=(0,te.Z)(!1,{value:(Y=Ae.open)!==null&&Y!==void 0?Y:Ae.visible,defaultValue:(P=Ae.defaultOpen)!==null&&P!==void 0?P:Ae.defaultVisible}),Pe=(Ge,Ze)=>{Nt(Ge,!0),Ue==null||Ue(Ge),de==null||de(Ge,Ze)},$e=Ge=>{Pe(!1,Ge)},Ee=Ge=>{var Ze;return(Ze=Ae.onConfirm)===null||Ze===void 0?void 0:Ze.call(void 0,Ge)},Ve=Ge=>{var Ze;Pe(!1,Ge),(Ze=Ae.onCancel)===null||Ze===void 0||Ze.call(void 0,Ge)},Je=(Ge,Ze)=>{const{disabled:mt=!1}=Ae;mt||Pe(Ge,Ze)},lt=bt("popconfirm",j),re=ye()(lt,ot,K,nt.root,at==null?void 0:at.root),Se=ye()(nt.body,at==null?void 0:at.body),[je]=I(lt);return je(F.createElement(pe.Z,Object.assign({},(0,_.Z)(Dt,["title"]),{trigger:se,placement:J,onOpenChange:Je,open:et,ref:We,classNames:{root:re,body:Se},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},kt.root),Qt),Ye),ct==null?void 0:ct.root),body:Object.assign(Object.assign({},kt.body),ct==null?void 0:ct.body)},content:F.createElement(ae,Object.assign({okType:Z,icon:w},Ae,{prefixCls:lt,close:$e,onConfirm:Ee,onCancel:Ve})),"data-popover-inject":!0}),E))});ve._InternalPanelDoNotUseOrYouWillBeFired=_e;var Ie=ve},69106:function(Kt,it,X){"use strict";X.d(it,{aV:function(){return u},t5:function(){return Q}});var F=X(59301),Te=X(92310),Be=X.n(Te),ye=X(29125),te=X(54500),_=X(48755),De=X(85074),pe=function(b,k){var S={};for(var C in b)Object.prototype.hasOwnProperty.call(b,C)&&k.indexOf(C)<0&&(S[C]=b[C]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var H=0,C=Object.getOwnPropertySymbols(b);H<C.length;H++)k.indexOf(C[H])<0&&Object.prototype.propertyIsEnumerable.call(b,C[H])&&(S[C[H]]=b[C[H]]);return S};const u=b=>{let{title:k,content:S,prefixCls:C}=b;return!k&&!S?null:F.createElement(F.Fragment,null,k&&F.createElement("div",{className:`${C}-title`},k),S&&F.createElement("div",{className:`${C}-inner-content`},S))},Q=b=>{const{hashId:k,prefixCls:S,className:C,style:H,placement:V="top",title:M,content:I,children:z}=b,ae=(0,te.Z)(M),ee=(0,te.Z)(I),_e=Be()(k,S,`${S}-pure`,`${S}-placement-${V}`,C);return F.createElement("div",{className:_e,style:H},F.createElement("div",{className:`${S}-arrow`}),F.createElement(ye.G,Object.assign({},b,{className:k,prefixCls:S}),z||F.createElement(u,{prefixCls:S,title:ae,content:ee})))},B=b=>{const{prefixCls:k,className:S}=b,C=pe(b,["prefixCls","className"]),{getPrefixCls:H}=F.useContext(_.E_),V=H("popover",k),[M,I,z]=(0,De.Z)(V);return M(F.createElement(Q,Object.assign({},C,{prefixCls:V,hashId:I,className:Be()(S,z)})))};it.ZP=B},37639:function(Kt,it,X){"use strict";var F=X(59301),Te=X(92310),Be=X.n(Te),ye=X(18929),te=X(10228),_=X(54500),De=X(86641),pe=X(22703),u=X(25399),Q=X(69106),B=X(48755),b=X(85074),k=function(H,V){var M={};for(var I in H)Object.prototype.hasOwnProperty.call(H,I)&&V.indexOf(I)<0&&(M[I]=H[I]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function")for(var z=0,I=Object.getOwnPropertySymbols(H);z<I.length;z++)V.indexOf(I[z])<0&&Object.prototype.propertyIsEnumerable.call(H,I[z])&&(M[I[z]]=H[I[z]]);return M};const C=F.forwardRef((H,V)=>{var M,I;const{prefixCls:z,title:ae,content:ee,overlayClassName:_e,placement:be="top",trigger:ce="hover",children:ve,mouseEnterDelay:Ie=.1,mouseLeaveDelay:Ae=.1,onOpenChange:We,overlayStyle:Y={},styles:P,classNames:j}=H,J=k(H,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:se,className:Z,style:w,classNames:E,styles:K}=(0,B.dj)("popover"),de=se("popover",z),[Ue,Ye,ct]=(0,b.Z)(de),at=se(),Dt=Be()(_e,Ye,ct,Z,E.root,j==null?void 0:j.root),bt=Be()(E.body,j==null?void 0:j.body),[ot,Qt]=(0,ye.Z)(!1,{value:(M=H.open)!==null&&M!==void 0?M:H.visible,defaultValue:(I=H.defaultOpen)!==null&&I!==void 0?I:H.defaultVisible}),nt=($e,Ee)=>{Qt($e,!0),We==null||We($e,Ee)},kt=$e=>{$e.keyCode===te.Z.ESC&&nt(!1,$e)},et=$e=>{nt($e)},Nt=(0,_.Z)(ae),Pe=(0,_.Z)(ee);return Ue(F.createElement(u.Z,Object.assign({placement:be,trigger:ce,mouseEnterDelay:Ie,mouseLeaveDelay:Ae},J,{prefixCls:de,classNames:{root:Dt,body:bt},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},K.root),w),Y),P==null?void 0:P.root),body:Object.assign(Object.assign({},K.body),P==null?void 0:P.body)},ref:V,open:ot,onOpenChange:et,overlay:Nt||Pe?F.createElement(Q.aV,{prefixCls:de,title:Nt,content:Pe}):null,transitionName:(0,De.m)(at,"zoom-big",J.transitionName),"data-popover-inject":!0}),(0,pe.Tm)(ve,{onKeyDown:$e=>{var Ee,Ve;F.isValidElement(ve)&&((Ve=ve==null?void 0:(Ee=ve.props).onKeyDown)===null||Ve===void 0||Ve.call(Ee,$e)),kt($e)}})))});C._InternalPanelDoNotUseOrYouWillBeFired=Q.ZP,it.Z=C},85074:function(Kt,it,X){"use strict";var F=X(63356),Te=X(34925),Be=X(37645),ye=X(36305),te=X(34998),_=X(16931),De=X(51636);const pe=B=>{const{componentCls:b,popoverColor:k,titleMinWidth:S,fontWeightStrong:C,innerPadding:H,boxShadowSecondary:V,colorTextHeading:M,borderRadiusLG:I,zIndexPopup:z,titleMarginBottom:ae,colorBgElevated:ee,popoverBg:_e,titleBorderBottom:be,innerContentPadding:ce,titlePadding:ve}=B;return[{[b]:Object.assign(Object.assign({},(0,F.Wf)(B)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:z,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"--antd-arrow-background-color":ee,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${b}-content`]:{position:"relative"},[`${b}-inner`]:{backgroundColor:_e,backgroundClip:"padding-box",borderRadius:I,boxShadow:V,padding:H},[`${b}-title`]:{minWidth:S,marginBottom:ae,color:M,fontWeight:C,borderBottom:be,padding:ve},[`${b}-inner-content`]:{color:k,padding:ce}})},(0,Be.ZP)(B,"var(--antd-arrow-background-color)"),{[`${b}-pure`]:{position:"relative",maxWidth:"none",margin:B.sizePopupArrow,display:"inline-block",[`${b}-content`]:{display:"inline-block"}}}]},u=B=>{const{componentCls:b}=B;return{[b]:te.i.map(k=>{const S=B[`${k}6`];return{[`&${b}-${k}`]:{"--antd-arrow-background-color":S,[`${b}-inner`]:{backgroundColor:S},[`${b}-arrow`]:{background:"transparent"}}}})}},Q=B=>{const{lineWidth:b,controlHeight:k,fontHeight:S,padding:C,wireframe:H,zIndexPopupBase:V,borderRadiusLG:M,marginXS:I,lineType:z,colorSplit:ae,paddingSM:ee}=B,_e=k-S,be=_e/2,ce=_e/2-b,ve=C;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:V+30},(0,ye.w)(B)),(0,Be.wZ)({contentRadius:M,limitVerticalRadius:!0})),{innerPadding:H?0:12,titleMarginBottom:H?0:I,titlePadding:H?`${be}px ${ve}px ${ce}px`:0,titleBorderBottom:H?`${b}px ${z} ${ae}`:"none",innerContentPadding:H?`${ee}px ${ve}px`:0})};it.Z=(0,_.I$)("Popover",B=>{const{colorBgElevated:b,colorText:k}=B,S=(0,De.mergeToken)(B,{popoverBg:b,popoverColor:k});return[pe(S),u(S),(0,Te._y)(S,"zoom-big")]},Q,{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]})},44104:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return H}});var F=X(59301),Te=X(92310),Be=X.n(Te),ye=X(11592),te=X(99402),_=X(48755),De=X(70045);const pe=F.createContext({latestIndex:0}),u=pe.Provider;var B=V=>{let{className:M,index:I,children:z,split:ae,style:ee}=V;const{latestIndex:_e}=F.useContext(pe);return z==null?null:F.createElement(F.Fragment,null,F.createElement("div",{className:M,style:ee},z),I<_e&&ae&&F.createElement("span",{className:`${M}-split`},ae))},b=X(31547),k=function(V,M){var I={};for(var z in V)Object.prototype.hasOwnProperty.call(V,z)&&M.indexOf(z)<0&&(I[z]=V[z]);if(V!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ae=0,z=Object.getOwnPropertySymbols(V);ae<z.length;ae++)M.indexOf(z[ae])<0&&Object.prototype.propertyIsEnumerable.call(V,z[ae])&&(I[z[ae]]=V[z[ae]]);return I};const C=F.forwardRef((V,M)=>{var I;const{getPrefixCls:z,direction:ae,size:ee,className:_e,style:be,classNames:ce,styles:ve}=(0,_.dj)("space"),{size:Ie=ee!=null?ee:"small",align:Ae,className:We,rootClassName:Y,children:P,direction:j="horizontal",prefixCls:J,split:se,style:Z,wrap:w=!1,classNames:E,styles:K}=V,de=k(V,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[Ue,Ye]=Array.isArray(Ie)?Ie:[Ie,Ie],ct=(0,te.n)(Ye),at=(0,te.n)(Ue),Dt=(0,te.T)(Ye),bt=(0,te.T)(Ue),ot=(0,ye.Z)(P,{keepEmpty:!0}),Qt=Ae===void 0&&j==="horizontal"?"center":Ae,nt=z("space",J),[kt,et,Nt]=(0,b.Z)(nt),Pe=Be()(nt,_e,et,`${nt}-${j}`,{[`${nt}-rtl`]:ae==="rtl",[`${nt}-align-${Qt}`]:Qt,[`${nt}-gap-row-${Ye}`]:ct,[`${nt}-gap-col-${Ue}`]:at},We,Y,Nt),$e=Be()(`${nt}-item`,(I=E==null?void 0:E.item)!==null&&I!==void 0?I:ce.item);let Ee=0;const Ve=ot.map((re,Se)=>{var je;re!=null&&(Ee=Se);const Ge=(re==null?void 0:re.key)||`${$e}-${Se}`;return F.createElement(B,{className:$e,key:Ge,index:Se,split:se,style:(je=K==null?void 0:K.item)!==null&&je!==void 0?je:ve.item},re)}),Je=F.useMemo(()=>({latestIndex:Ee}),[Ee]);if(ot.length===0)return null;const lt={};return w&&(lt.flexWrap="wrap"),!at&&bt&&(lt.columnGap=Ue),!ct&&Dt&&(lt.rowGap=Ye),kt(F.createElement("div",Object.assign({ref:M,className:Pe,style:Object.assign(Object.assign(Object.assign({},lt),be),Z)},de),F.createElement(u,{value:Je},Ve)))});C.Compact=De.ZP;var H=C},37645:function(Kt,it,X){"use strict";X.d(it,{ZP:function(){return _},qN:function(){return Be},wZ:function(){return ye}});var F=X(36237),Te=X(36305);const Be=8;function ye(De){const{contentRadius:pe,limitVerticalRadius:u}=De,Q=pe>12?pe+2:12;return{arrowOffsetHorizontal:Q,arrowOffsetVertical:u?Be:Q}}function te(De,pe){return De?pe:{}}function _(De,pe,u){const{componentCls:Q,boxShadowPopoverArrow:B,arrowOffsetVertical:b,arrowOffsetHorizontal:k}=De,{arrowDistance:S=0,arrowPlacement:C={left:!0,right:!0,top:!0,bottom:!0}}=u||{};return{[Q]:Object.assign(Object.assign(Object.assign(Object.assign({[`${Q}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,Te.W)(De,pe,B)),{"&:before":{background:pe}})]},te(!!C.top,{[[`&-placement-top > ${Q}-arrow`,`&-placement-topLeft > ${Q}-arrow`,`&-placement-topRight > ${Q}-arrow`].join(",")]:{bottom:S,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${Q}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":k,[`> ${Q}-arrow`]:{left:{_skip_check_:!0,value:k}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,F.unit)(k)})`,[`> ${Q}-arrow`]:{right:{_skip_check_:!0,value:k}}}})),te(!!C.bottom,{[[`&-placement-bottom > ${Q}-arrow`,`&-placement-bottomLeft > ${Q}-arrow`,`&-placement-bottomRight > ${Q}-arrow`].join(",")]:{top:S,transform:"translateY(-100%)"},[`&-placement-bottom > ${Q}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":k,[`> ${Q}-arrow`]:{left:{_skip_check_:!0,value:k}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,F.unit)(k)})`,[`> ${Q}-arrow`]:{right:{_skip_check_:!0,value:k}}}})),te(!!C.left,{[[`&-placement-left > ${Q}-arrow`,`&-placement-leftTop > ${Q}-arrow`,`&-placement-leftBottom > ${Q}-arrow`].join(",")]:{right:{_skip_check_:!0,value:S},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${Q}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${Q}-arrow`]:{top:b},[`&-placement-leftBottom > ${Q}-arrow`]:{bottom:b}})),te(!!C.right,{[[`&-placement-right > ${Q}-arrow`,`&-placement-rightTop > ${Q}-arrow`,`&-placement-rightBottom > ${Q}-arrow`].join(",")]:{left:{_skip_check_:!0,value:S},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${Q}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${Q}-arrow`]:{top:b},[`&-placement-rightBottom > ${Q}-arrow`]:{bottom:b}}))}}},36305:function(Kt,it,X){"use strict";X.d(it,{W:function(){return Be},w:function(){return Te}});var F=X(36237);function Te(ye){const{sizePopupArrow:te,borderRadiusXS:_,borderRadiusOuter:De}=ye,pe=te/2,u=0,Q=pe,B=De*1/Math.sqrt(2),b=pe-De*(1-1/Math.sqrt(2)),k=pe-_*(1/Math.sqrt(2)),S=De*(Math.sqrt(2)-1)+_*(1/Math.sqrt(2)),C=2*pe-k,H=S,V=2*pe-B,M=b,I=2*pe-u,z=Q,ae=pe*Math.sqrt(2)+De*(Math.sqrt(2)-2),ee=De*(Math.sqrt(2)-1),_e=`polygon(${ee}px 100%, 50% ${ee}px, ${2*pe-ee}px 100%, ${ee}px 100%)`,be=`path('M ${u} ${Q} A ${De} ${De} 0 0 0 ${B} ${b} L ${k} ${S} A ${_} ${_} 0 0 1 ${C} ${H} L ${V} ${M} A ${De} ${De} 0 0 0 ${I} ${z} Z')`;return{arrowShadowWidth:ae,arrowPath:be,arrowPolygon:_e}}const Be=(ye,te,_)=>{const{sizePopupArrow:De,arrowPolygon:pe,arrowPath:u,arrowShadowWidth:Q,borderRadiusXS:B,calc:b}=ye;return{pointerEvents:"none",width:De,height:De,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:De,height:b(De).div(2).equal(),background:te,clipPath:{_multi_value_:!0,value:[pe,u]},content:'""'},"&::after":{content:'""',position:"absolute",width:Q,height:Q,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${(0,F.unit)(B)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:_,zIndex:0,background:"transparent"}}}},93427:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return Te}});var F=X(34998);function Te(Be,ye){return F.i.reduce((te,_)=>{const De=Be[`${_}1`],pe=Be[`${_}3`],u=Be[`${_}6`],Q=Be[`${_}7`];return Object.assign(Object.assign({},te),ye(_,{lightColor:De,lightBorderColor:pe,darkColor:u,textColor:Q}))},{})}},25399:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return J}});var F=X(59301),Te=X(92310),Be=X.n(Te),ye=X(29125),te=X(18929),_=X(62487),De=X(75030),pe=X(86641),u=X(52838),Q=X(22703),B=X(32383),b=X(55743),k=X(57700),S=X(48755),C=X(36237),H=X(63356),V=X(34925),M=X(37645),I=X(36305),z=X(93427),ae=X(51636),ee=X(16931);const _e=se=>{const{calc:Z,componentCls:w,tooltipMaxWidth:E,tooltipColor:K,tooltipBg:de,tooltipBorderRadius:Ue,zIndexPopup:Ye,controlHeight:ct,boxShadowSecondary:at,paddingSM:Dt,paddingXS:bt,arrowOffsetHorizontal:ot,sizePopupArrow:Qt}=se,nt=Z(Ue).add(Qt).add(ot).equal(),kt=Z(Ue).mul(2).add(Qt).equal();return[{[w]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,H.Wf)(se)),{position:"absolute",zIndex:Ye,display:"block",width:"max-content",maxWidth:E,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":de,[`${w}-inner`]:{minWidth:kt,minHeight:ct,padding:`${(0,C.unit)(se.calc(Dt).div(2).equal())} ${(0,C.unit)(bt)}`,color:K,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:de,borderRadius:Ue,boxShadow:at,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:nt},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${w}-inner`]:{borderRadius:se.min(Ue,M.qN)}},[`${w}-content`]:{position:"relative"}}),(0,z.Z)(se,(et,Nt)=>{let{darkColor:Pe}=Nt;return{[`&${w}-${et}`]:{[`${w}-inner`]:{backgroundColor:Pe},[`${w}-arrow`]:{"--antd-arrow-background-color":Pe}}}})),{"&-rtl":{direction:"rtl"}})},(0,M.ZP)(se,"var(--antd-arrow-background-color)"),{[`${w}-pure`]:{position:"relative",maxWidth:"none",margin:se.sizePopupArrow}}]},be=se=>Object.assign(Object.assign({zIndexPopup:se.zIndexPopupBase+70},(0,M.wZ)({contentRadius:se.borderRadius,limitVerticalRadius:!0})),(0,I.w)((0,ae.mergeToken)(se,{borderRadiusOuter:Math.min(se.borderRadiusOuter,4)})));var ce=function(se){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return(0,ee.I$)("Tooltip",E=>{const{borderRadius:K,colorTextLightSolid:de,colorBgSpotlight:Ue}=E,Ye=(0,ae.mergeToken)(E,{tooltipMaxWidth:250,tooltipColor:de,tooltipBorderRadius:K,tooltipBg:Ue});return[_e(Ye),(0,V._y)(E,"zoom-big-fast")]},be,{resetStyle:!1,injectStyle:Z})(se)},ve=X(29509);function Ie(se,Z){const w=(0,ve.o2)(Z),E=Be()({[`${se}-${Z}`]:Z&&w}),K={},de={};return Z&&!w&&(K.background=Z,de["--antd-arrow-background-color"]=Z),{className:E,overlayStyle:K,arrowStyle:de}}var We=se=>{const{prefixCls:Z,className:w,placement:E="top",title:K,color:de,overlayInnerStyle:Ue}=se,{getPrefixCls:Ye}=F.useContext(S.E_),ct=Ye("tooltip",Z),[at,Dt,bt]=ce(ct),ot=Ie(ct,de),Qt=ot.arrowStyle,nt=Object.assign(Object.assign({},Ue),ot.overlayStyle),kt=Be()(Dt,bt,ct,`${ct}-pure`,`${ct}-placement-${E}`,w,ot.className);return at(F.createElement("div",{className:kt,style:Qt},F.createElement("div",{className:`${ct}-arrow`}),F.createElement(ye.G,Object.assign({},se,{className:Dt,prefixCls:ct,overlayInnerStyle:nt}),K)))},Y=function(se,Z){var w={};for(var E in se)Object.prototype.hasOwnProperty.call(se,E)&&Z.indexOf(E)<0&&(w[E]=se[E]);if(se!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,E=Object.getOwnPropertySymbols(se);K<E.length;K++)Z.indexOf(E[K])<0&&Object.prototype.propertyIsEnumerable.call(se,E[K])&&(w[E[K]]=se[E[K]]);return w};const j=F.forwardRef((se,Z)=>{var w,E;const{prefixCls:K,openClassName:de,getTooltipContainer:Ue,color:Ye,overlayInnerStyle:ct,children:at,afterOpenChange:Dt,afterVisibleChange:bt,destroyTooltipOnHide:ot,arrow:Qt=!0,title:nt,overlay:kt,builtinPlacements:et,arrowPointAtCenter:Nt=!1,autoAdjustOverflow:Pe=!0,motion:$e,getPopupContainer:Ee,placement:Ve="top",mouseEnterDelay:Je=.1,mouseLeaveDelay:lt=.1,overlayStyle:re,rootClassName:Se,overlayClassName:je,styles:Ge,classNames:Ze}=se,mt=Y(se,["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"]),Pt=!!Qt,[,yt]=(0,k.ZP)(),{getPopupContainer:_t,getPrefixCls:vt,direction:$t,className:Ct,style:wt,classNames:He,styles:Tt}=(0,S.dj)("tooltip"),gt=(0,B.ln)("Tooltip"),st=F.useRef(null),Rt=()=>{var Er;(Er=st.current)===null||Er===void 0||Er.forceAlign()};F.useImperativeHandle(Z,()=>{var Er,_r;return{forceAlign:Rt,forcePopupAlign:()=>{gt.deprecated(!1,"forcePopupAlign","forceAlign"),Rt()},nativeElement:(Er=st.current)===null||Er===void 0?void 0:Er.nativeElement,popupElement:(_r=st.current)===null||_r===void 0?void 0:_r.popupElement}});const[y,D]=(0,te.Z)(!1,{value:(w=se.open)!==null&&w!==void 0?w:se.visible,defaultValue:(E=se.defaultOpen)!==null&&E!==void 0?E:se.defaultVisible}),Oe=!nt&&!kt&&nt!==0,N=Er=>{var _r,At;D(Oe?!1:Er),Oe||((_r=se.onOpenChange)===null||_r===void 0||_r.call(se,Er),(At=se.onVisibleChange)===null||At===void 0||At.call(se,Er))},oe=F.useMemo(()=>{var Er,_r;let At=Nt;return typeof Qt=="object"&&(At=(_r=(Er=Qt.pointAtCenter)!==null&&Er!==void 0?Er:Qt.arrowPointAtCenter)!==null&&_r!==void 0?_r:Nt),et||(0,u.Z)({arrowPointAtCenter:At,autoAdjustOverflow:Pe,arrowWidth:Pt?yt.sizePopupArrow:0,borderRadius:yt.borderRadius,offset:yt.marginXXS,visibleFirst:!0})},[Nt,Qt,et,yt]),rr=F.useMemo(()=>nt===0?nt:kt||nt||"",[kt,nt]),xe=F.createElement(_.Z,{space:!0},typeof rr=="function"?rr():rr),ke=vt("tooltip",K),Re=vt(),G=se["data-popover-inject"];let q=y;!("open"in se)&&!("visible"in se)&&Oe&&(q=!1);const me=F.isValidElement(at)&&!(0,Q.M2)(at)?at:F.createElement("span",null,at),we=me.props,O=!we.className||typeof we.className=="string"?Be()(we.className,de||`${ke}-open`):we.className,[ht,he,It]=ce(ke,!G),Ot=Ie(ke,Ye),er=Ot.arrowStyle,Dr=Be()(je,{[`${ke}-rtl`]:$t==="rtl"},Ot.className,Se,he,It,Ct,He.root,Ze==null?void 0:Ze.root),lr=Be()(He.body,Ze==null?void 0:Ze.body),[Wt,Mr]=(0,De.Cn)("Tooltip",mt.zIndex),Xr=F.createElement(ye.Z,Object.assign({},mt,{zIndex:Wt,showArrow:Pt,placement:Ve,mouseEnterDelay:Je,mouseLeaveDelay:lt,prefixCls:ke,classNames:{root:Dr,body:lr},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},er),Tt.root),wt),re),Ge==null?void 0:Ge.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},Tt.body),ct),Ge==null?void 0:Ge.body),Ot.overlayStyle)},getTooltipContainer:Ee||Ue||_t,ref:st,builtinPlacements:oe,overlay:xe,visible:q,onVisibleChange:N,afterVisibleChange:Dt!=null?Dt:bt,arrowContent:F.createElement("span",{className:`${ke}-arrow-content`}),motion:{motionName:(0,pe.m)(Re,"zoom-big-fast",se.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!ot}),q?(0,Q.Tm)(me,{className:O}):me);return ht(F.createElement(b.Z.Provider,{value:Mr},Xr))});j._InternalPanelDoNotUseOrYouWillBeFired=We;var J=j},64018:function(){var Kt,it,X,F=!1,Te,Be;window.PR_SHOULD_USE_CONTINUATION=!0;var ye,te;(function(){var _=window,De=["break,continue,do,else,for,if,return,while"],pe=[De,"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"],u=[pe,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],Q=[u,"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"],B=[u,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],b=[u,"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"],k="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",S=[u,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],C="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",H=[De,"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"],V=[De,"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"],M=[De,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],I=[Q,b,B,S,C,H,V,M],z=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ae="str",ee="kwd",_e="com",be="typ",ce="lit",ve="pun",Ie="pln",Ae="tag",We="dec",Y="src",P="atn",j="atv",J="nocode",se="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function Z($e){for(var Ee=0,Ve=!1,Je=!1,lt=0,re=$e.length;lt<re;++lt){var Se=$e[lt];if(Se.ignoreCase)Je=!0;else if(/[a-z]/i.test(Se.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ve=!0,Je=!1;break}}var je={b:8,t:9,n:10,v:11,f:12,r:13};function Ge(_t){var vt=_t.charCodeAt(0);if(vt!==92)return vt;var $t=_t.charAt(1);return vt=je[$t],vt||("0"<=$t&&$t<="7"?parseInt(_t.substring(1),8):$t==="u"||$t==="x"?parseInt(_t.substring(2),16):_t.charCodeAt(1))}function Ze(_t){if(_t<32)return(_t<16?"\\x0":"\\x")+_t.toString(16);var vt=String.fromCharCode(_t);return vt==="\\"||vt==="-"||vt==="]"||vt==="^"?"\\"+vt:vt}function mt(_t){var vt=_t.substring(1,_t.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")),$t=[],Ct=vt[0]==="^",wt=["["];Ct&&wt.push("^");for(var He=Ct?1:0,Tt=vt.length;He<Tt;++He){var gt=vt[He];if(/\\[bdsw]/i.test(gt))wt.push(gt);else{var st=Ge(gt),Rt;He+2<Tt&&vt[He+1]==="-"?(Rt=Ge(vt[He+2]),He+=2):Rt=st,$t.push([st,Rt]),Rt<65||st>122||(Rt<65||st>90||$t.push([Math.max(65,st)|32,Math.min(Rt,90)|32]),Rt<97||st>122||$t.push([Math.max(97,st)&-33,Math.min(Rt,122)&-33]))}}$t.sort(function(N,oe){return N[0]-oe[0]||oe[1]-N[1]});for(var y=[],D=[],He=0;He<$t.length;++He){var Oe=$t[He];Oe[0]<=D[1]+1?D[1]=Math.max(D[1],Oe[1]):y.push(D=Oe)}for(var He=0;He<y.length;++He){var Oe=y[He];wt.push(Ze(Oe[0])),Oe[1]>Oe[0]&&(Oe[1]+1>Oe[0]&&wt.push("-"),wt.push(Ze(Oe[1])))}return wt.push("]"),wt.join("")}function Pt(_t){for(var vt=_t.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")),$t=vt.length,Ct=[],wt=0,He=0;wt<$t;++wt){var Tt=vt[wt];if(Tt==="(")++He;else if(Tt.charAt(0)==="\\"){var gt=+Tt.substring(1);gt&&(gt<=He?Ct[gt]=-1:vt[wt]=Ze(gt))}}for(var wt=1;wt<Ct.length;++wt)Ct[wt]===-1&&(Ct[wt]=++Ee);for(var wt=0,He=0;wt<$t;++wt){var Tt=vt[wt];if(Tt==="(")++He,Ct[He]||(vt[wt]="(?:");else if(Tt.charAt(0)==="\\"){var gt=+Tt.substring(1);gt&&gt<=He&&(vt[wt]="\\"+Ct[gt])}}for(var wt=0;wt<$t;++wt)vt[wt]==="^"&&vt[wt+1]!=="^"&&(vt[wt]="");if(_t.ignoreCase&&Ve)for(var wt=0;wt<$t;++wt){var Tt=vt[wt],st=Tt.charAt(0);Tt.length>=2&&st==="["?vt[wt]=mt(Tt):st!=="\\"&&(vt[wt]=Tt.replace(/[a-zA-Z]/g,function(D){var Oe=D.charCodeAt(0);return"["+String.fromCharCode(Oe&-33,Oe|32)+"]"}))}return vt.join("")}for(var yt=[],lt=0,re=$e.length;lt<re;++lt){var Se=$e[lt];if(Se.global||Se.multiline)throw new Error(""+Se);yt.push("(?:"+Pt(Se)+")")}return new RegExp(yt.join("|"),Je?"gi":"g")}function w($e,Ee){var Ve=/(?:^|\s)nocode(?:\s|$)/,Je=[],lt=0,re=[],Se=0;function je(Ge){var Ze=Ge.nodeType;if(Ze==1){if(Ve.test(Ge.className))return;for(var mt=Ge.firstChild;mt;mt=mt.nextSibling)je(mt);var Pt=Ge.nodeName.toLowerCase();(Pt==="br"||Pt==="li")&&(Je[Se]=`
`,re[Se<<1]=lt++,re[Se++<<1|1]=Ge)}else if(Ze==3||Ze==4){var yt=Ge.nodeValue;yt.length&&(Ee?yt=yt.replace(/\r\n?/g,`
`):yt=yt.replace(/[ \t\r\n]+/g," "),Je[Se]=yt,re[Se<<1]=lt,lt+=yt.length,re[Se++<<1|1]=Ge)}}return je($e),{sourceCode:Je.join("").replace(/\n$/,""),spans:re}}function E($e,Ee,Ve,Je,lt){if(Ve){var re={sourceNode:$e,pre:1,langExtension:null,numberLines:null,sourceCode:Ve,spans:null,basePos:Ee,decorations:null};Je(re),lt.push.apply(lt,re.decorations)}}var K=/\S/;function de($e){for(var Ee=void 0,Ve=$e.firstChild;Ve;Ve=Ve.nextSibling){var Je=Ve.nodeType;Ee=Je===1?Ee?$e:Ve:Je===3&&K.test(Ve.nodeValue)?$e:Ee}return Ee===$e?void 0:Ee}function Ue($e,Ee){var Ve={},Je;(function(){for(var Se=$e.concat(Ee),je=[],Ge={},Ze=0,mt=Se.length;Ze<mt;++Ze){var Pt=Se[Ze],yt=Pt[3];if(yt)for(var _t=yt.length;--_t>=0;)Ve[yt.charAt(_t)]=Pt;var vt=Pt[1],$t=""+vt;Ge.hasOwnProperty($t)||(je.push(vt),Ge[$t]=null)}je.push(/[\0-\uffff]/),Je=Z(je)})();var lt=Ee.length,re=function(Se){for(var je=Se.sourceCode,Ge=Se.basePos,Ze=Se.sourceNode,mt=[Ge,Ie],Pt=0,yt=je.match(Je)||[],_t={},vt=0,$t=yt.length;vt<$t;++vt){var Ct=yt[vt],wt=_t[Ct],He=void 0,Tt;if(typeof wt=="string")Tt=!1;else{var gt=Ve[Ct.charAt(0)];if(gt)He=Ct.match(gt[1]),wt=gt[0];else{for(var st=0;st<lt;++st)if(gt=Ee[st],He=Ct.match(gt[1]),He){wt=gt[0];break}He||(wt=Ie)}Tt=wt.length>=5&&wt.substring(0,5)==="lang-",Tt&&!(He&&typeof He[1]=="string")&&(Tt=!1,wt=Y),Tt||(_t[Ct]=wt)}var Rt=Pt;if(Pt+=Ct.length,!Tt)mt.push(Ge+Rt,wt);else{var y=He[1],D=Ct.indexOf(y),Oe=D+y.length;He[2]&&(Oe=Ct.length-He[2].length,D=Oe-y.length);var N=wt.substring(5);E(Ze,Ge+Rt,Ct.substring(0,D),re,mt),E(Ze,Ge+Rt+D,y,Qt(N,y),mt),E(Ze,Ge+Rt+Oe,Ct.substring(Oe),re,mt)}}Se.decorations=mt};return re}function Ye($e){var Ee=[],Ve=[];$e.tripleQuotedStrings?Ee.push([ae,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):$e.multiLineStrings?Ee.push([ae,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ee.push([ae,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),$e.verbatimStrings&&Ve.push([ae,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Je=$e.hashComments;Je&&($e.cStyleComments?(Je>1?Ee.push([_e,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ee.push([_e,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ve.push([ae,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ee.push([_e,/^#[^\r\n]*/,null,"#"])),$e.cStyleComments&&(Ve.push([_e,/^\/\/[^\r\n]*/,null]),Ve.push([_e,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var lt=$e.regexLiterals;if(lt){var re=lt>1?"":`
\r`,Se=re?".":"[\\S\\s]",je="/(?=[^/*"+re+"])(?:[^/\\x5B\\x5C"+re+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+re+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";Ve.push(["lang-regex",RegExp("^"+se+"("+je+")")])}var Ge=$e.types;Ge&&Ve.push([be,Ge]);var Ze=(""+$e.keywords).replace(/^ | $/g,"");Ze.length&&Ve.push([ee,new RegExp("^(?:"+Ze.replace(/[\s,]+/g,"|")+")\\b"),null]),Ee.push([Ie,/^\s+/,null,` \r
\xA0`]);var mt="^.[^\\s\\w.$@'\"`/\\\\]*";return $e.regexLiterals&&(mt+="(?!s*/)"),Ve.push([ce,/^@[a-z_$][a-z_$@0-9]*/i,null],[be,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[Ie,/^[a-z_$][a-z_$@0-9]*/i,null],[ce,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[Ie,/^\\[\s\S]?/,null],[ve,new RegExp(mt),null]),Ue(Ee,Ve)}var ct=Ye({keywords:I,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function at($e,Ee,Ve){for(var Je=/(?:^|\s)nocode(?:\s|$)/,lt=/\r\n?|\n/,re=$e.ownerDocument,Se=re.createElement("li");$e.firstChild;)Se.appendChild($e.firstChild);var je=[Se];function Ge(vt){var $t=vt.nodeType;if($t==1&&!Je.test(vt.className))if(vt.nodeName==="br")Ze(vt),vt.parentNode&&vt.parentNode.removeChild(vt);else for(var Ct=vt.firstChild;Ct;Ct=Ct.nextSibling)Ge(Ct);else if(($t==3||$t==4)&&Ve){var wt=vt.nodeValue,He=wt.match(lt);if(He){var Tt=wt.substring(0,He.index);vt.nodeValue=Tt;var gt=wt.substring(He.index+He[0].length);if(gt){var st=vt.parentNode;st.insertBefore(re.createTextNode(gt),vt.nextSibling)}Ze(vt),Tt||vt.parentNode.removeChild(vt)}}}function Ze(vt){for(;!vt.nextSibling;)if(vt=vt.parentNode,!vt)return;function $t(He,Tt){var gt=Tt?He.cloneNode(!1):He,st=He.parentNode;if(st){var Rt=$t(st,1),y=He.nextSibling;Rt.appendChild(gt);for(var D=y;D;D=y)y=D.nextSibling,Rt.appendChild(D)}return gt}for(var Ct=$t(vt.nextSibling,0),wt;(wt=Ct.parentNode)&&wt.nodeType===1;)Ct=wt;je.push(Ct)}for(var mt=0;mt<je.length;++mt)Ge(je[mt]);Ee===(Ee|0)&&je[0].setAttribute("value",Ee);var Pt=re.createElement("ol");Pt.className="linenums";for(var yt=Math.max(0,Ee-1|0)||0,mt=0,_t=je.length;mt<_t;++mt)Se=je[mt],Se.className="L"+(mt+yt)%10,Se.firstChild||Se.appendChild(re.createTextNode("\xA0")),Pt.appendChild(Se);$e.appendChild(Pt)}function Dt($e){var Ee=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ee=Ee&&+Ee[1]<=8;var Ve=/\n/g,Je=$e.sourceCode,lt=Je.length,re=0,Se=$e.spans,je=Se.length,Ge=0,Ze=$e.decorations,mt=Ze.length,Pt=0;Ze[mt]=lt;var yt,_t;for(_t=yt=0;_t<mt;)Ze[_t]!==Ze[_t+2]?(Ze[yt++]=Ze[_t++],Ze[yt++]=Ze[_t++]):_t+=2;for(mt=yt,_t=yt=0;_t<mt;){for(var vt=Ze[_t],$t=Ze[_t+1],Ct=_t+2;Ct+2<=mt&&Ze[Ct+1]===$t;)Ct+=2;Ze[yt++]=vt,Ze[yt++]=$t,_t=Ct}mt=Ze.length=yt;var wt=$e.sourceNode,He="";wt&&(He=wt.style.display,wt.style.display="none");try{for(var Tt=null;Ge<je;){var gt=Se[Ge],st=Se[Ge+2]||lt,Rt=Ze[Pt+2]||lt,Ct=Math.min(st,Rt),y=Se[Ge+1],D;if(y.nodeType!==1&&(D=Je.substring(re,Ct))){Ee&&(D=D.replace(Ve,"\r")),y.nodeValue=D;var Oe=y.ownerDocument,N=Oe.createElement("span");N.className=Ze[Pt+1];var oe=y.parentNode;oe.replaceChild(N,y),N.appendChild(y),re<st&&(Se[Ge+1]=y=Oe.createTextNode(Je.substring(Ct,st)),oe.insertBefore(y,N.nextSibling))}re=Ct,re>=st&&(Ge+=2),re>=Rt&&(Pt+=2)}}finally{wt&&(wt.style.display=He)}}var bt={};function ot($e,Ee){for(var Ve=Ee.length;--Ve>=0;){var Je=Ee[Ve];bt.hasOwnProperty(Je)?_.console&&console.warn("cannot override language handler %s",Je):bt[Je]=$e}}function Qt($e,Ee){return $e&&bt.hasOwnProperty($e)||($e=/^\s*</.test(Ee)?"default-markup":"default-code"),bt[$e]}ot(ct,["default-code"]),ot(Ue([],[[Ie,/^[^<?]+/],[We,/^<!\w[^>]*(?:>|$)/],[_e,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ve,/^(?:<[%?]|[%?]>)/],["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"]),ot(Ue([[Ie,/^[\s]+/,null,` \r
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Ae,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ve,/^[=<>\/]+/],["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"]),ot(Ue([],[[j,/^[\s\S]+/]]),["uq.val"]),ot(Ye({keywords:Q,hashComments:!0,cStyleComments:!0,types:z}),["c","cc","cpp","cxx","cyc","m"]),ot(Ye({keywords:"null,true,false"}),["json"]),ot(Ye({keywords:b,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:z}),["cs"]),ot(Ye({keywords:B,cStyleComments:!0}),["java"]),ot(Ye({keywords:M,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ot(Ye({keywords:H,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ot(Ye({keywords:C,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ot(Ye({keywords:V,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ot(Ye({keywords:S,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ot(Ye({keywords:k,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ot(Ue([],[[ae,/^[\s\S]+/]]),["regex"]);function nt($e){var Ee=$e.langExtension;try{var Ve=w($e.sourceNode,$e.pre),Je=Ve.sourceCode;$e.sourceCode=Je,$e.spans=Ve.spans,$e.basePos=0,Qt(Ee,Je)($e),Dt($e)}catch(lt){_.console&&console.log(lt&&lt.stack||lt)}}function kt($e,Ee,Ve){var Je=Ve||!1,lt=Ee||null,re=document.createElement("div");re.innerHTML="<pre>"+$e+"</pre>",re=re.firstChild,Je&&at(re,Je,!0);var Se={langExtension:lt,numberLines:Je,sourceNode:re,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return nt(Se),re.innerHTML}function et($e,Ee){var Ve=Ee||document.body,Je=Ve.ownerDocument||document;function lt(gt){return Ve.getElementsByTagName(gt)}for(var re=[lt("pre"),lt("code"),lt("xmp")],Se=[],je=0;je<re.length;++je)for(var Ge=0,Ze=re[je].length;Ge<Ze;++Ge)Se.push(re[je][Ge]);re=null;var mt=Date;mt.now||(mt={now:function(){return+new Date}});var Pt=0,yt=/\blang(?:uage)?-([\w.]+)(?!\S)/,_t=/\bprettyprint\b/,vt=/\bprettyprinted\b/,$t=/pre|xmp/i,Ct=/^code$/i,wt=/^(?:pre|code|xmp)$/i,He={};function Tt(){for(var gt=_.PR_SHOULD_USE_CONTINUATION?mt.now()+250:1/0;Pt<Se.length&&mt.now()<gt;Pt++){for(var st=Se[Pt],Rt=He,y=st;y=y.previousSibling;){var D=y.nodeType,Oe=(D===7||D===8)&&y.nodeValue;if(Oe?!/^\??prettify\b/.test(Oe):D!==3||/\S/.test(y.nodeValue))break;if(Oe){Rt={},Oe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(he,It,Ot){Rt[It]=Ot});break}}var N=st.className;if((Rt!==He||_t.test(N))&&!vt.test(N)){for(var oe=!1,rr=st.parentNode;rr;rr=rr.parentNode){var xe=rr.tagName;if(wt.test(xe)&&rr.className&&_t.test(rr.className)){oe=!0;break}}if(!oe){st.className+=" prettyprinted";var ke=Rt.lang;if(!ke){ke=N.match(yt);var Re;!ke&&(Re=de(st))&&Ct.test(Re.tagName)&&(ke=Re.className.match(yt)),ke&&(ke=ke[1])}var G;if($t.test(st.tagName))G=1;else{var q=st.currentStyle,me=Je.defaultView,we=q?q.whiteSpace:me&&me.getComputedStyle?me.getComputedStyle(st,null).getPropertyValue("white-space"):0;G=we&&we.substring(0,3)==="pre"}var O=Rt.linenums;(O=O==="true"||+O)||(O=N.match(/\blinenums\b(?::(\d+))?/),O=O?O[1]&&O[1].length?+O[1]:!0:!1),O&&at(st,O,G);var ht={langExtension:ke,sourceNode:st,numberLines:O,pre:G,sourceCode:null,basePos:null,spans:null,decorations:null};nt(ht)}}}Pt<Se.length?_.setTimeout(Tt,250):typeof $e=="function"&&$e()}Tt()}var Nt=_.PR={createSimpleLexer:Ue,registerLangHandler:ot,sourceDecorator:Ye,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:j,PR_COMMENT:_e,PR_DECLARATION:We,PR_KEYWORD:ee,PR_LITERAL:ce,PR_NOCODE:J,PR_PLAIN:Ie,PR_PUNCTUATION:ve,PR_SOURCE:Y,PR_STRING:ae,PR_TAG:Ae,PR_TYPE:be,prettyPrintOne:F?_.prettyPrintOne=kt:ye=kt,prettyPrint:te=F?_.prettyPrint=et:te=et},Pe=_.define;typeof Pe=="function"&&Pe.amd&&Pe("google-code-prettify",[],function(){return Nt})})()},25769:function(Kt,it,X){"use strict";var F=X(98040),Te={"text/plain":"Text","text/html":"Url",default:"Text"},Be="Copy to clipboard: #{key}, Enter";function ye(_){var De=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return _.replace(/#{\s*key\s*}/g,De)}function te(_,De){var pe,u,Q,B,b,k,S=!1;De||(De={}),pe=De.debug||!1;try{Q=F(),B=document.createRange(),b=document.getSelection(),k=document.createElement("span"),k.textContent=_,k.ariaHidden="true",k.style.all="unset",k.style.position="fixed",k.style.top=0,k.style.clip="rect(0, 0, 0, 0)",k.style.whiteSpace="pre",k.style.webkitUserSelect="text",k.style.MozUserSelect="text",k.style.msUserSelect="text",k.style.userSelect="text",k.addEventListener("copy",function(H){if(H.stopPropagation(),De.format)if(H.preventDefault(),typeof H.clipboardData=="undefined"){pe&&console.warn("unable to use e.clipboardData"),pe&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var V=Te[De.format]||Te.default;window.clipboardData.setData(V,_)}else H.clipboardData.clearData(),H.clipboardData.setData(De.format,_);De.onCopy&&(H.preventDefault(),De.onCopy(H.clipboardData))}),document.body.appendChild(k),B.selectNodeContents(k),b.addRange(B);var C=document.execCommand("copy");if(!C)throw new Error("copy command was unsuccessful");S=!0}catch(H){pe&&console.error("unable to copy using execCommand: ",H),pe&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(De.format||"text",_),De.onCopy&&De.onCopy(window.clipboardData),S=!0}catch(V){pe&&console.error("unable to copy using clipboardData: ",V),pe&&console.error("falling back to prompt"),u=ye("message"in De?De.message:Be),window.prompt(u,_)}}finally{b&&(typeof b.removeRange=="function"?b.removeRange(B):b.removeAllRanges()),k&&document.body.removeChild(k),Q()}return S}Kt.exports=te},53184:function(Kt,it,X){"use strict";var F,Te;function Be(ye,te,_){var De=function(pe,u){return ye.js_beautify(pe,u)};return De.js=ye.js_beautify,De.css=te.css_beautify,De.html=_.html_beautify,De.js_beautify=ye.js_beautify,De.css_beautify=te.css_beautify,De.html_beautify=_.html_beautify,De}F=[X(58553),X(87804),X(40998)],Te=function(ye,te,_){return Be(ye,te,_)}.apply(it,F),Te!==void 0&&(Kt.exports=Te)},87804:function(Kt,it){var X,F;(function(){var Te;(function(){"use strict";var ye=[,,function(pe){function u(b){this.__parent=b,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=[]}u.prototype.clone_empty=function(){var b=new u(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},u.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},u.prototype.has_match=function(b){for(var k=this.__items.length-1;k>=0;k--)if(this.__items[k].match(b))return!0;return!1},u.prototype.set_indent=function(b,k){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=k||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.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)},u.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},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(b){this.__items.push(b);var k=b.lastIndexOf(`
`);k!==-1?this.__character_count=b.length-k:this.__character_count+=b.length},u.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function Q(b,k){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),k=k||"",b.indent_level>0&&(k=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=k,this.__base_string_length=k.length}Q.prototype.get_indent_size=function(b,k){var S=this.__base_string_length;return k=k||0,b<0&&(S=0),S+=b*this.__indent_size,S+=k,S},Q.prototype.get_indent_string=function(b,k){var S=this.__base_string;return k=k||0,b<0&&(b=0,S=""),k+=b*this.__indent_size,this.__ensure_cache(k),S+=this.__cache[k],S},Q.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},Q.prototype.__add_column=function(){var b=this.__cache.length,k=0,S="";this.__indent_size&&b>=this.__indent_size&&(k=Math.floor(b/this.__indent_size),b-=k*this.__indent_size,S=new Array(k+1).join(this.__indent_string)),b&&(S+=new Array(b+1).join(" ")),this.__cache.push(S)};function B(b,k){this.__indent_cache=new Q(b,k),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}B.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},B.prototype.get_line_number=function(){return this.__lines.length},B.prototype.get_indent_string=function(b,k){return this.__indent_cache.get_indent_string(b,k)},B.prototype.get_indent_size=function(b,k){return this.__indent_cache.get_indent_size(b,k)},B.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},B.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},B.prototype.get_code=function(b){this.trim(!0);var k=this.current_line.pop();k&&(k[k.length-1]===`
`&&(k=k.replace(/\n+$/g,"")),this.current_line.push(k)),this._end_with_newline&&this.__add_outputline();var S=this.__lines.join(`
`);return b!==`
`&&(S=S.replace(/[\n]/g,b)),S},B.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},B.prototype.set_indent=function(b,k){return b=b||0,k=k||0,this.next_line.set_indent(b,k),this.__lines.length>1?(this.current_line.set_indent(b,k),!0):(this.current_line.set_indent(),!1)},B.prototype.add_raw_token=function(b){for(var k=0;k<b.newlines;k++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},B.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},B.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(" "))},B.prototype.remove_indent=function(b){for(var k=this.__lines.length;b<k;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},B.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&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},B.prototype.just_added_newline=function(){return this.current_line.is_empty()},B.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},B.prototype.ensure_empty_line_above=function(b,k){for(var S=this.__lines.length-2;S>=0;){var C=this.__lines[S];if(C.is_empty())break;if(C.item(0).indexOf(b)!==0&&C.item(-1)!==k){this.__lines.splice(S+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}S--}},pe.exports.Output=B},,,,function(pe){function u(b,k){this.raw_options=Q(b,k),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"])}u.prototype._get_array=function(b,k){var S=this.raw_options[b],C=k||[];return typeof S=="object"?S!==null&&typeof S.concat=="function"&&(C=S.concat()):typeof S=="string"&&(C=S.split(/[^a-zA-Z0-9_\/\-]+/)),C},u.prototype._get_boolean=function(b,k){var S=this.raw_options[b],C=S===void 0?!!k:!!S;return C},u.prototype._get_characters=function(b,k){var S=this.raw_options[b],C=k||"";return typeof S=="string"&&(C=S.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),C},u.prototype._get_number=function(b,k){var S=this.raw_options[b];k=parseInt(k,10),isNaN(k)&&(k=0);var C=parseInt(S,10);return isNaN(C)&&(C=k),C},u.prototype._get_selection=function(b,k,S){var C=this._get_selection_list(b,k,S);if(C.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
`+k+`
You passed in: '`+this.raw_options[b]+"'");return C[0]},u.prototype._get_selection_list=function(b,k,S){if(!k||k.length===0)throw new Error("Selection list cannot be empty.");if(S=S||[k[0]],!this._is_valid_selection(S,k))throw new Error("Invalid Default Value!");var C=this._get_array(b,S);if(!this._is_valid_selection(C,k))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
`+k+`
You passed in: '`+this.raw_options[b]+"'");return C},u.prototype._is_valid_selection=function(b,k){return b.length&&k.length&&!b.some(function(S){return k.indexOf(S)===-1})};function Q(b,k){var S={};b=B(b);var C;for(C in b)C!==k&&(S[C]=b[C]);if(k&&b[k])for(C in b[k])S[C]=b[k][C];return S}function B(b){var k={},S;for(S in b){var C=S.replace(/-/g,"_");k[C]=b[S]}return k}pe.exports.Options=u,pe.exports.normalizeOpts=B,pe.exports.mergeOpts=Q},,function(pe){var u=RegExp.prototype.hasOwnProperty("sticky");function Q(B){this.__input=B||"",this.__input_length=this.__input.length,this.__position=0}Q.prototype.restart=function(){this.__position=0},Q.prototype.back=function(){this.__position>0&&(this.__position-=1)},Q.prototype.hasNext=function(){return this.__position<this.__input_length},Q.prototype.next=function(){var B=null;return this.hasNext()&&(B=this.__input.charAt(this.__position),this.__position+=1),B},Q.prototype.peek=function(B){var b=null;return B=B||0,B+=this.__position,B>=0&&B<this.__input_length&&(b=this.__input.charAt(B)),b},Q.prototype.__match=function(B,b){B.lastIndex=b;var k=B.exec(this.__input);return k&&!(u&&B.sticky)&&k.index!==b&&(k=null),k},Q.prototype.test=function(B,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match(B,b):!1},Q.prototype.testChar=function(B,b){var k=this.peek(b);return B.lastIndex=0,k!==null&&B.test(k)},Q.prototype.match=function(B){var b=this.__match(B,this.__position);return b?this.__position+=b[0].length:b=null,b},Q.prototype.read=function(B,b,k){var S="",C;return B&&(C=this.match(B),C&&(S+=C[0])),b&&(C||!B)&&(S+=this.readUntil(b,k)),S},Q.prototype.readUntil=function(B,b){var k="",S=this.__position;B.lastIndex=this.__position;var C=B.exec(this.__input);return C?(S=C.index,b&&(S+=C[0].length)):S=this.__input_length,k=this.__input.substring(this.__position,S),this.__position=S,k},Q.prototype.readUntilAfter=function(B){return this.readUntil(B,!0)},Q.prototype.get_regexp=function(B,b){var k=null,S="g";return b&&u&&(S="y"),typeof B=="string"&&B!==""?k=new RegExp(B,S):B&&(k=new RegExp(B.source,S)),k},Q.prototype.get_literal_regexp=function(B){return RegExp(B.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},Q.prototype.peekUntilAfter=function(B){var b=this.__position,k=this.readUntilAfter(B);return this.__position=b,k},Q.prototype.lookBack=function(B){var b=this.__position-1;return b>=B.length&&this.__input.substring(b-B.length,b).toLowerCase()===B},pe.exports.InputScanner=Q},,,,,function(pe){function u(Q,B){Q=typeof Q=="string"?Q:Q.source,B=typeof B=="string"?B:B.source,this.__directives_block_pattern=new RegExp(Q+/ beautify( \w+[:]\w+)+ /.source+B,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(Q+/\sbeautify\signore:end\s/.source+B,"g")}u.prototype.get_directives=function(Q){if(!Q.match(this.__directives_block_pattern))return null;var B={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(Q);b;)B[b[1]]=b[2],b=this.__directive_pattern.exec(Q);return B},u.prototype.readIgnored=function(Q){return Q.readUntilAfter(this.__directives_end_ignore_pattern)},pe.exports.Directives=u},,function(pe,u,Q){var B=Q(16).Beautifier,b=Q(17).Options;function k(S,C){var H=new B(S,C);return H.beautify()}pe.exports=k,pe.exports.defaultOptions=function(){return new b}},function(pe,u,Q){var B=Q(17).Options,b=Q(2).Output,k=Q(8).InputScanner,S=Q(13).Directives,C=new S(/\/\*/,/\*\//),H=/\r\n|[\r\n]/,V=/\r\n|[\r\n]/g,M=/\s/,I=/(?:\s|\n)+/g,z=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,ae=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function ee(_e,be){this._source_text=_e||"",this._options=new B(be),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"]}ee.prototype.eatString=function(_e){var be="";for(this._ch=this._input.next();this._ch;){if(be+=this._ch,this._ch==="\\")be+=this._input.next();else if(_e.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return be},ee.prototype.eatWhitespace=function(_e){for(var be=M.test(this._input.peek()),ce=0;M.test(this._input.peek());)this._ch=this._input.next(),_e&&this._ch===`
`&&(ce===0||ce<this._options.max_preserve_newlines)&&(ce++,this._output.add_new_line(!0));return be},ee.prototype.foundNestedPseudoClass=function(){for(var _e=0,be=1,ce=this._input.peek(be);ce;){if(ce==="{")return!0;if(ce==="(")_e+=1;else if(ce===")"){if(_e===0)return!1;_e-=1}else if(ce===";"||ce==="}")return!1;be++,ce=this._input.peek(be)}return!1},ee.prototype.print_string=function(_e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(_e)},ee.prototype.preserveSingleSpace=function(_e){_e&&(this._output.space_before_token=!0)},ee.prototype.indent=function(){this._indentLevel++},ee.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},ee.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _e=this._source_text,be=this._options.eol;be==="auto"&&(be=`
`,_e&&H.test(_e||"")&&(be=_e.match(H)[0])),_e=_e.replace(V,`
`);var ce=_e.match(/^[\t ]*/)[0];this._output=new b(this._options,ce),this._input=new k(_e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var ve=0,Ie=!1,Ae=!1,We=!1,Y=!1,P=!1,j=this._ch,J=!1,se,Z,w;se=this._input.read(I),Z=se!=="",w=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var E=this._input.read(z),K=C.get_directives(E);K&&K.ignore==="start"&&(E+=C.readIgnored(this._input)),this.print_string(E),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(ae)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(Z),this.print_string(this._ch);var de=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);de.match(/[ :]$/)&&(de=this.eatString(": ").replace(/\s+$/,""),this.print_string(de),this._output.space_before_token=!0),ve===0&&de.indexOf(":")!==-1&&(Ae=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(Z),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Ue=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Ue.match(/[ :]$/)&&(Ue=this.eatString(": ").replace(/\s+$/,""),this.print_string(Ue),this._output.space_before_token=!0),ve===0&&Ue.indexOf(":")!==-1?(Ae=!0,this.indent()):Ue in this.NESTED_AT_RULE?(this._nestedLevel+=1,Ue in this.CONDITIONAL_GROUP_RULE&&(We=!0)):ve===0&&!Ae&&(Y=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(Z),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")Ae&&(Ae=!1,this.outdent()),Y=!1,We?(We=!1,Ie=this._indentLevel>=this._nestedLevel):Ie=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&Ie&&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)):(w==="("?this._output.space_before_token=!1:w!==","&&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(),w==="{"&&this._output.trim(!0),Ae&&(this.outdent(),Ae=!1),this.print_string(this._ch),Ie=!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 Ye=0;Ye<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Ye++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Ye])){J=!0;break}(Ie||We)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!Y&&ve===0?(this.print_string(":"),Ae||(Ae=!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 ct=w==='"'||w==="'";this.preserveSingleSpace(ct||Z),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")J=!1,ve===0?(Ae&&(this.outdent(),Ae=!1),Y=!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(),ve++,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(")")),ve&&(ve--,this.outdent()));else{var at=!1;this._input.lookBack("with")&&(at=!0),this.preserveSingleSpace(Z||at),this.print_string(this._ch),Ae&&w==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),P=!0):(this.eatWhitespace(),ve++,this.indent())}else if(this._ch===")")ve&&(ve--,this.outdent()),P&&this._input.peek()===";"&&this._options.selector_separator_newline&&(P=!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&&(!Ae||P)&&ve===0&&!Y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!Ae&&ve===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&&M.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(Z),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),M.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 Dt=w==='"'||w==="'";this.preserveSingleSpace(Dt||Z),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&J&&this._output.add_new_line()}var bt=this._output.get_code(be);return bt},pe.exports.Beautifier=ee},function(pe,u,Q){var B=Q(6).Options;function b(k){B.call(this,k,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var S=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||S;var C=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var H=0;H<C.length;H++)C[H]!=="expand"?this.brace_style="collapse":this.brace_style=C[H]}b.prototype=new B,pe.exports.Options=b}],te={};function _(pe){var u=te[pe];if(u!==void 0)return u.exports;var Q=te[pe]={exports:{}};return ye[pe](Q,Q.exports,_),Q.exports}var De=_(15);Te=De})();var Be=Te;X=[],F=function(){return{css_beautify:Be}}.apply(it,X),F!==void 0&&(Kt.exports=F)})()},40998:function(Kt,it,X){var F,Te;(function(){var Be;(function(){"use strict";var De=[,,function(B){function b(C){this.__parent=C,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=[]}b.prototype.clone_empty=function(){var C=new b(this.__parent);return C.set_indent(this.__indent_count,this.__alignment_count),C},b.prototype.item=function(C){return C<0?this.__items[this.__items.length+C]:this.__items[C]},b.prototype.has_match=function(C){for(var H=this.__items.length-1;H>=0;H--)if(this.__items[H].match(C))return!0;return!1},b.prototype.set_indent=function(C,H){this.is_empty()&&(this.__indent_count=C||0,this.__alignment_count=H||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},b.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)},b.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},b.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var C=this.__parent.current_line;return C.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),C.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),C.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,C.__items[0]===" "&&(C.__items.splice(0,1),C.__character_count-=1),!0}return!1},b.prototype.is_empty=function(){return this.__items.length===0},b.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},b.prototype.push=function(C){this.__items.push(C);var H=C.lastIndexOf(`
`);H!==-1?this.__character_count=C.length-H:this.__character_count+=C.length},b.prototype.pop=function(){var C=null;return this.is_empty()||(C=this.__items.pop(),this.__character_count-=C.length),C},b.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},b.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},b.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},b.prototype.toString=function(){var C="";return this.is_empty()?this.__parent.indent_empty_lines&&(C=this.__parent.get_indent_string(this.__indent_count)):(C=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),C+=this.__items.join("")),C};function k(C,H){this.__cache=[""],this.__indent_size=C.indent_size,this.__indent_string=C.indent_char,C.indent_with_tabs||(this.__indent_string=new Array(C.indent_size+1).join(C.indent_char)),H=H||"",C.indent_level>0&&(H=new Array(C.indent_level+1).join(this.__indent_string)),this.__base_string=H,this.__base_string_length=H.length}k.prototype.get_indent_size=function(C,H){var V=this.__base_string_length;return H=H||0,C<0&&(V=0),V+=C*this.__indent_size,V+=H,V},k.prototype.get_indent_string=function(C,H){var V=this.__base_string;return H=H||0,C<0&&(C=0,V=""),H+=C*this.__indent_size,this.__ensure_cache(H),V+=this.__cache[H],V},k.prototype.__ensure_cache=function(C){for(;C>=this.__cache.length;)this.__add_column()},k.prototype.__add_column=function(){var C=this.__cache.length,H=0,V="";this.__indent_size&&C>=this.__indent_size&&(H=Math.floor(C/this.__indent_size),C-=H*this.__indent_size,V=new Array(H+1).join(this.__indent_string)),C&&(V+=new Array(C+1).join(" ")),this.__cache.push(V)};function S(C,H){this.__indent_cache=new k(C,H),this.raw=!1,this._end_with_newline=C.end_with_newline,this.indent_size=C.indent_size,this.wrap_line_length=C.wrap_line_length,this.indent_empty_lines=C.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new b(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}S.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},S.prototype.get_line_number=function(){return this.__lines.length},S.prototype.get_indent_string=function(C,H){return this.__indent_cache.get_indent_string(C,H)},S.prototype.get_indent_size=function(C,H){return this.__indent_cache.get_indent_size(C,H)},S.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},S.prototype.add_new_line=function(C){return this.is_empty()||!C&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},S.prototype.get_code=function(C){this.trim(!0);var H=this.current_line.pop();H&&(H[H.length-1]===`
`&&(H=H.replace(/\n+$/g,"")),this.current_line.push(H)),this._end_with_newline&&this.__add_outputline();var V=this.__lines.join(`
`);return C!==`
`&&(V=V.replace(/[\n]/g,C)),V},S.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},S.prototype.set_indent=function(C,H){return C=C||0,H=H||0,this.next_line.set_indent(C,H),this.__lines.length>1?(this.current_line.set_indent(C,H),!0):(this.current_line.set_indent(),!1)},S.prototype.add_raw_token=function(C){for(var H=0;H<C.newlines;H++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(C.whitespace_before),this.current_line.push(C.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},S.prototype.add_token=function(C){this.__add_space_before_token(),this.current_line.push(C),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},S.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(" "))},S.prototype.remove_indent=function(C){for(var H=this.__lines.length;C<H;)this.__lines[C]._remove_indent(),C++;this.current_line._remove_wrap_indent()},S.prototype.trim=function(C){for(C=C===void 0?!1:C,this.current_line.trim();C&&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},S.prototype.just_added_newline=function(){return this.current_line.is_empty()},S.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},S.prototype.ensure_empty_line_above=function(C,H){for(var V=this.__lines.length-2;V>=0;){var M=this.__lines[V];if(M.is_empty())break;if(M.item(0).indexOf(C)!==0&&M.item(-1)!==H){this.__lines.splice(V+1,0,new b(this)),this.previous_line=this.__lines[this.__lines.length-2];break}V--}},B.exports.Output=S},function(B){function b(k,S,C,H){this.type=k,this.text=S,this.comments_before=null,this.newlines=C||0,this.whitespace_before=H||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}B.exports.Token=b},,,function(B){function b(C,H){this.raw_options=k(C,H),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"])}b.prototype._get_array=function(C,H){var V=this.raw_options[C],M=H||[];return typeof V=="object"?V!==null&&typeof V.concat=="function"&&(M=V.concat()):typeof V=="string"&&(M=V.split(/[^a-zA-Z0-9_\/\-]+/)),M},b.prototype._get_boolean=function(C,H){var V=this.raw_options[C],M=V===void 0?!!H:!!V;return M},b.prototype._get_characters=function(C,H){var V=this.raw_options[C],M=H||"";return typeof V=="string"&&(M=V.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),M},b.prototype._get_number=function(C,H){var V=this.raw_options[C];H=parseInt(H,10),isNaN(H)&&(H=0);var M=parseInt(V,10);return isNaN(M)&&(M=H),M},b.prototype._get_selection=function(C,H,V){var M=this._get_selection_list(C,H,V);if(M.length!==1)throw new Error("Invalid Option Value: The option '"+C+`' can only be one of the following values:
`+H+`
You passed in: '`+this.raw_options[C]+"'");return M[0]},b.prototype._get_selection_list=function(C,H,V){if(!H||H.length===0)throw new Error("Selection list cannot be empty.");if(V=V||[H[0]],!this._is_valid_selection(V,H))throw new Error("Invalid Default Value!");var M=this._get_array(C,V);if(!this._is_valid_selection(M,H))throw new Error("Invalid Option Value: The option '"+C+`' can contain only the following values:
`+H+`
You passed in: '`+this.raw_options[C]+"'");return M},b.prototype._is_valid_selection=function(C,H){return C.length&&H.length&&!C.some(function(V){return H.indexOf(V)===-1})};function k(C,H){var V={};C=S(C);var M;for(M in C)M!==H&&(V[M]=C[M]);if(H&&C[H])for(M in C[H])V[M]=C[H][M];return V}function S(C){var H={},V;for(V in C){var M=V.replace(/-/g,"_");H[M]=C[V]}return H}B.exports.Options=b,B.exports.normalizeOpts=S,B.exports.mergeOpts=k},,function(B){var b=RegExp.prototype.hasOwnProperty("sticky");function k(S){this.__input=S||"",this.__input_length=this.__input.length,this.__position=0}k.prototype.restart=function(){this.__position=0},k.prototype.back=function(){this.__position>0&&(this.__position-=1)},k.prototype.hasNext=function(){return this.__position<this.__input_length},k.prototype.next=function(){var S=null;return this.hasNext()&&(S=this.__input.charAt(this.__position),this.__position+=1),S},k.prototype.peek=function(S){var C=null;return S=S||0,S+=this.__position,S>=0&&S<this.__input_length&&(C=this.__input.charAt(S)),C},k.prototype.__match=function(S,C){S.lastIndex=C;var H=S.exec(this.__input);return H&&!(b&&S.sticky)&&H.index!==C&&(H=null),H},k.prototype.test=function(S,C){return C=C||0,C+=this.__position,C>=0&&C<this.__input_length?!!this.__match(S,C):!1},k.prototype.testChar=function(S,C){var H=this.peek(C);return S.lastIndex=0,H!==null&&S.test(H)},k.prototype.match=function(S){var C=this.__match(S,this.__position);return C?this.__position+=C[0].length:C=null,C},k.prototype.read=function(S,C,H){var V="",M;return S&&(M=this.match(S),M&&(V+=M[0])),C&&(M||!S)&&(V+=this.readUntil(C,H)),V},k.prototype.readUntil=function(S,C){var H="",V=this.__position;S.lastIndex=this.__position;var M=S.exec(this.__input);return M?(V=M.index,C&&(V+=M[0].length)):V=this.__input_length,H=this.__input.substring(this.__position,V),this.__position=V,H},k.prototype.readUntilAfter=function(S){return this.readUntil(S,!0)},k.prototype.get_regexp=function(S,C){var H=null,V="g";return C&&b&&(V="y"),typeof S=="string"&&S!==""?H=new RegExp(S,V):S&&(H=new RegExp(S.source,V)),H},k.prototype.get_literal_regexp=function(S){return RegExp(S.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},k.prototype.peekUntilAfter=function(S){var C=this.__position,H=this.readUntilAfter(S);return this.__position=C,H},k.prototype.lookBack=function(S){var C=this.__position-1;return C>=S.length&&this.__input.substring(C-S.length,C).toLowerCase()===S},B.exports.InputScanner=k},function(B,b,k){var S=k(8).InputScanner,C=k(3).Token,H=k(10).TokenStream,V=k(11).WhitespacePattern,M={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},I=function(z,ae){this._input=new S(z),this._options=ae||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new V(this._input)};I.prototype.tokenize=function(){this._input.restart(),this.__tokens=new H,this._reset();for(var z,ae=new C(M.START,""),ee=null,_e=[],be=new H;ae.type!==M.EOF;){for(z=this._get_next_token(ae,ee);this._is_comment(z);)be.add(z),z=this._get_next_token(ae,ee);be.isEmpty()||(z.comments_before=be,be=new H),z.parent=ee,this._is_opening(z)?(_e.push(ee),ee=z):ee&&this._is_closing(z,ee)&&(z.opened=ee,ee.closed=z,ee=_e.pop(),z.parent=ee),z.previous=ae,ae.next=z,this.__tokens.add(z),ae=z}return this.__tokens},I.prototype._is_first_token=function(){return this.__tokens.isEmpty()},I.prototype._reset=function(){},I.prototype._get_next_token=function(z,ae){this._readWhitespace();var ee=this._input.read(/.+/g);return ee?this._create_token(M.RAW,ee):this._create_token(M.EOF,"")},I.prototype._is_comment=function(z){return!1},I.prototype._is_opening=function(z){return!1},I.prototype._is_closing=function(z,ae){return!1},I.prototype._create_token=function(z,ae){var ee=new C(z,ae,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return ee},I.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},B.exports.Tokenizer=I,B.exports.TOKEN=M},function(B){function b(k){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=k}b.prototype.restart=function(){this.__position=0},b.prototype.isEmpty=function(){return this.__tokens_length===0},b.prototype.hasNext=function(){return this.__position<this.__tokens_length},b.prototype.next=function(){var k=null;return this.hasNext()&&(k=this.__tokens[this.__position],this.__position+=1),k},b.prototype.peek=function(k){var S=null;return k=k||0,k+=this.__position,k>=0&&k<this.__tokens_length&&(S=this.__tokens[k]),S},b.prototype.add=function(k){this.__parent_token&&(k.parent=this.__parent_token),this.__tokens.push(k),this.__tokens_length+=1},B.exports.TokenStream=b},function(B,b,k){var S=k(12).Pattern;function C(H,V){S.call(this,H,V),V?this._line_regexp=this._input.get_regexp(V._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}C.prototype=new S,C.prototype.__set_whitespace_patterns=function(H,V){H+="\\t ",V+="\\n\\r",this._match_pattern=this._input.get_regexp("["+H+V+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+V+"]")},C.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var H=this._input.read(this._match_pattern);if(H===" ")this.whitespace_before_token=" ";else if(H){var V=this.__split(this._newline_regexp,H);this.newline_count=V.length-1,this.whitespace_before_token=V[this.newline_count]}return H},C.prototype.matching=function(H,V){var M=this._create();return M.__set_whitespace_patterns(H,V),M._update(),M},C.prototype._create=function(){return new C(this._input,this)},C.prototype.__split=function(H,V){H.lastIndex=0;for(var M=0,I=[],z=H.exec(V);z;)I.push(V.substring(M,z.index)),M=z.index+z[0].length,z=H.exec(V);return M<V.length?I.push(V.substring(M,V.length)):I.push(""),I},B.exports.WhitespacePattern=C},function(B){function b(k,S){this._input=k,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,S&&(this._starting_pattern=this._input.get_regexp(S._starting_pattern,!0),this._match_pattern=this._input.get_regexp(S._match_pattern,!0),this._until_pattern=this._input.get_regexp(S._until_pattern),this._until_after=S._until_after)}b.prototype.read=function(){var k=this._input.read(this._starting_pattern);return(!this._starting_pattern||k)&&(k+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),k},b.prototype.read_match=function(){return this._input.match(this._match_pattern)},b.prototype.until_after=function(k){var S=this._create();return S._until_after=!0,S._until_pattern=this._input.get_regexp(k),S._update(),S},b.prototype.until=function(k){var S=this._create();return S._until_after=!1,S._until_pattern=this._input.get_regexp(k),S._update(),S},b.prototype.starting_with=function(k){var S=this._create();return S._starting_pattern=this._input.get_regexp(k,!0),S._update(),S},b.prototype.matching=function(k){var S=this._create();return S._match_pattern=this._input.get_regexp(k,!0),S._update(),S},b.prototype._create=function(){return new b(this._input,this)},b.prototype._update=function(){},B.exports.Pattern=b},function(B){function b(k,S){k=typeof k=="string"?k:k.source,S=typeof S=="string"?S:S.source,this.__directives_block_pattern=new RegExp(k+/ beautify( \w+[:]\w+)+ /.source+S,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(k+/\sbeautify\signore:end\s/.source+S,"g")}b.prototype.get_directives=function(k){if(!k.match(this.__directives_block_pattern))return null;var S={};this.__directive_pattern.lastIndex=0;for(var C=this.__directive_pattern.exec(k);C;)S[C[1]]=C[2],C=this.__directive_pattern.exec(k);return S},b.prototype.readIgnored=function(k){return k.readUntilAfter(this.__directives_end_ignore_pattern)},B.exports.Directives=b},function(B,b,k){var S=k(12).Pattern,C={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function H(V,M){S.call(this,V,M),this.__template_pattern=null,this._disabled=Object.assign({},C),this._excluded=Object.assign({},C),M&&(this.__template_pattern=this._input.get_regexp(M.__template_pattern),this._excluded=Object.assign(this._excluded,M._excluded),this._disabled=Object.assign(this._disabled,M._disabled));var I=new S(V);this.__patterns={handlebars_comment:I.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:I.starting_with(/{{{/).until_after(/}}}/),handlebars:I.starting_with(/{{/).until_after(/}}/),php:I.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:I.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:I.starting_with(/{%/).until_after(/%}/),django_value:I.starting_with(/{{/).until_after(/}}/),django_comment:I.starting_with(/{#/).until_after(/#}/),smarty:I.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:I.starting_with(/{\*/).until_after(/\*}/),smarty_literal:I.starting_with(/{literal}/).until_after(/{\/literal}/)}}H.prototype=new S,H.prototype._create=function(){return new H(this._input,this)},H.prototype._update=function(){this.__set_templated_pattern()},H.prototype.disable=function(V){var M=this._create();return M._disabled[V]=!0,M._update(),M},H.prototype.read_options=function(V){var M=this._create();for(var I in C)M._disabled[I]=V.templating.indexOf(I)===-1;return M._update(),M},H.prototype.exclude=function(V){var M=this._create();return M._excluded[V]=!0,M._update(),M},H.prototype.read=function(){var V="";this._match_pattern?V=this._input.read(this._starting_pattern):V=this._input.read(this._starting_pattern,this.__template_pattern);for(var M=this._read_template();M;)this._match_pattern?M+=this._input.read(this._match_pattern):M+=this._input.readUntil(this.__template_pattern),V+=M,M=this._read_template();return this._until_after&&(V+=this._input.readUntilAfter(this._until_pattern)),V},H.prototype.__set_templated_pattern=function(){var V=[];this._disabled.php||V.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||V.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||V.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||V.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(V.push(this.__patterns.django._starting_pattern.source),V.push(this.__patterns.django_value._starting_pattern.source),V.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||V.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&V.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+V.join("|")+")")},H.prototype._read_template=function(){var V="",M=this._input.peek();if(M==="<"){var I=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&I==="?"&&(V=V||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&I==="%"&&(V=V||this.__patterns.erb.read())}else M==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(V=V||this.__patterns.handlebars_comment.read(),V=V||this.__patterns.handlebars_unescaped.read(),V=V||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(V=V||this.__patterns.django_value.read()),this._excluded.django||(V=V||this.__patterns.django_comment.read(),V=V||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(V=V||this.__patterns.smarty_comment.read(),V=V||this.__patterns.smarty_literal.read(),V=V||this.__patterns.smarty.read()));return V},B.exports.TemplatablePattern=H},,,,function(B,b,k){var S=k(19).Beautifier,C=k(20).Options;function H(V,M,I,z){var ae=new S(V,M,I,z);return ae.beautify()}B.exports=H,B.exports.defaultOptions=function(){return new C}},function(B,b,k){var S=k(20).Options,C=k(2).Output,H=k(21).Tokenizer,V=k(21).TOKEN,M=/\r\n|[\r\n]/,I=/\r\n|[\r\n]/g,z=function(Y,P){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=Y.max_preserve_newlines,this.preserve_newlines=Y.preserve_newlines,this._output=new C(Y,P)};z.prototype.current_line_has_match=function(Y){return this._output.current_line.has_match(Y)},z.prototype.set_space_before_token=function(Y,P){this._output.space_before_token=Y,this._output.non_breaking_space=P},z.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},z.prototype.add_raw_token=function(Y){this._output.add_raw_token(Y)},z.prototype.print_preserved_newlines=function(Y){var P=0;Y.type!==V.TEXT&&Y.previous.type!==V.TEXT&&(P=Y.newlines?1:0),this.preserve_newlines&&(P=Y.newlines<this.max_preserve_newlines+1?Y.newlines:this.max_preserve_newlines+1);for(var j=0;j<P;j++)this.print_newline(j>0);return P!==0},z.prototype.traverse_whitespace=function(Y){return Y.whitespace_before||Y.newlines?(this.print_preserved_newlines(Y)||(this._output.space_before_token=!0),!0):!1},z.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},z.prototype.print_newline=function(Y){this._output.add_new_line(Y)},z.prototype.print_token=function(Y){Y.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(Y.text))},z.prototype.indent=function(){this.indent_level++},z.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},z.prototype.get_full_indent=function(Y){return Y=this.indent_level+(Y||0),Y<1?"":this._output.get_indent_string(Y)};var ae=function(Y){for(var P=null,j=Y.next;j.type!==V.EOF&&Y.closed!==j;){if(j.type===V.ATTRIBUTE&&j.text==="type"){j.next&&j.next.type===V.EQUALS&&j.next.next&&j.next.next.type===V.VALUE&&(P=j.next.next.text);break}j=j.next}return P},ee=function(Y,P){var j=null,J=null;return P.closed?(Y==="script"?j="text/javascript":Y==="style"&&(j="text/css"),j=ae(P)||j,j.search("text/css")>-1?J="css":j.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?J="javascript":j.search(/(text|application|dojo)\/(x-)?(html)/)>-1?J="html":j.search(/test\/null/)>-1&&(J="null"),J):null};function _e(Y,P){return P.indexOf(Y)!==-1}function be(Y,P,j){this.parent=Y||null,this.tag=P?P.tag_name:"",this.indent_level=j||0,this.parser_token=P||null}function ce(Y){this._printer=Y,this._current_frame=null}ce.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},ce.prototype.record_tag=function(Y){var P=new be(this._current_frame,Y,this._printer.indent_level);this._current_frame=P},ce.prototype._try_pop_frame=function(Y){var P=null;return Y&&(P=Y.parser_token,this._printer.indent_level=Y.indent_level,this._current_frame=Y.parent),P},ce.prototype._get_frame=function(Y,P){for(var j=this._current_frame;j&&Y.indexOf(j.tag)===-1;){if(P&&P.indexOf(j.tag)!==-1){j=null;break}j=j.parent}return j},ce.prototype.try_pop=function(Y,P){var j=this._get_frame([Y],P);return this._try_pop_frame(j)},ce.prototype.indent_to_tag=function(Y){var P=this._get_frame(Y);P&&(this._printer.indent_level=P.indent_level)};function ve(Y,P,j,J){this._source_text=Y||"",P=P||{},this._js_beautify=j,this._css_beautify=J,this._tag_stack=null;var se=new S(P,"html");this._options=se,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"}ve.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Y=this._source_text,P=this._options.eol;this._options.eol==="auto"&&(P=`
`,Y&&M.test(Y)&&(P=Y.match(M)[0])),Y=Y.replace(I,`
`);var j=Y.match(/^[\t ]*/)[0],J={text:"",type:""},se=new Ie(this._options),Z=new z(this._options,j),w=new H(Y,this._options).tokenize();this._tag_stack=new ce(Z);for(var E=null,K=w.next();K.type!==V.EOF;)K.type===V.TAG_OPEN||K.type===V.COMMENT?(E=this._handle_tag_open(Z,K,se,J,w),se=E):K.type===V.ATTRIBUTE||K.type===V.EQUALS||K.type===V.VALUE||K.type===V.TEXT&&!se.tag_complete?E=this._handle_inside_tag(Z,K,se,J):K.type===V.TAG_CLOSE?E=this._handle_tag_close(Z,K,se):K.type===V.TEXT?E=this._handle_text(Z,K,se):K.type===V.CONTROL_FLOW_OPEN?E=this._handle_control_flow_open(Z,K):K.type===V.CONTROL_FLOW_CLOSE?E=this._handle_control_flow_close(Z,K):Z.add_raw_token(K),J=E,K=w.next();var de=Z._output.get_code(P);return de},ve.prototype._handle_control_flow_open=function(Y,P){var j={text:P.text,type:P.type};return Y.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),P.newlines?Y.print_preserved_newlines(P):Y.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),Y.print_token(P),Y.indent(),j},ve.prototype._handle_control_flow_close=function(Y,P){var j={text:P.text,type:P.type};return Y.deindent(),P.newlines?Y.print_preserved_newlines(P):Y.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),Y.print_token(P),j},ve.prototype._handle_tag_close=function(Y,P,j){var J={text:P.text,type:P.type};return Y.alignment_size=0,j.tag_complete=!0,Y.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),j.is_unformatted?Y.add_raw_token(P):(j.tag_start_char==="<"&&(Y.set_space_before_token(P.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&j.has_wrapped_attrs&&Y.print_newline(!1)),Y.print_token(P)),j.indent_content&&!(j.is_unformatted||j.is_content_unformatted)&&(Y.indent(),j.indent_content=!1),!j.is_inline_element&&!(j.is_unformatted||j.is_content_unformatted)&&Y.set_wrap_point(),J},ve.prototype._handle_inside_tag=function(Y,P,j,J){var se=j.has_wrapped_attrs,Z={text:P.text,type:P.type};return Y.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),j.is_unformatted?Y.add_raw_token(P):j.tag_start_char==="{"&&P.type===V.TEXT?Y.print_preserved_newlines(P)?(P.newlines=0,Y.add_raw_token(P)):Y.print_token(P):(P.type===V.ATTRIBUTE?Y.set_space_before_token(!0):(P.type===V.EQUALS||P.type===V.VALUE&&P.previous.type===V.EQUALS)&&Y.set_space_before_token(!1),P.type===V.ATTRIBUTE&&j.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(Y.traverse_whitespace(P),se=se||P.newlines!==0),this._is_wrap_attributes_force&&j.attr_count>=this._options.wrap_attributes_min_attrs&&(J.type!==V.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(Y.print_newline(!1),se=!0)),Y.print_token(P),se=se||Y.previous_token_wrapped(),j.has_wrapped_attrs=se),Z},ve.prototype._handle_text=function(Y,P,j){var J={text:P.text,type:"TK_CONTENT"};return j.custom_beautifier_name?this._print_custom_beatifier_text(Y,P,j):j.is_unformatted||j.is_content_unformatted?Y.add_raw_token(P):(Y.traverse_whitespace(P),Y.print_token(P)),J},ve.prototype._print_custom_beatifier_text=function(Y,P,j){var J=this;if(P.text!==""){var se=P.text,Z,w=1,E="",K="";j.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?Z=this._js_beautify:j.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?Z=this._css_beautify:j.custom_beautifier_name==="html"&&(Z=function(Dt,bt){var ot=new ve(Dt,bt,J._js_beautify,J._css_beautify);return ot.beautify()}),this._options.indent_scripts==="keep"?w=0:this._options.indent_scripts==="separate"&&(w=-Y.indent_level);var de=Y.get_full_indent(w);if(se=se.replace(/\n[ \t]*$/,""),j.custom_beautifier_name!=="html"&&se[0]==="<"&&se.match(/^(<!--|<!\[CDATA\[)/)){var Ue=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(se);if(!Ue){Y.add_raw_token(P);return}E=de+Ue[1]+`
`,se=Ue[4],Ue[5]&&(K=de+Ue[5]),se=se.replace(/\n[ \t]*$/,""),(Ue[2]||Ue[3].indexOf(`
`)!==-1)&&(Ue=Ue[3].match(/[ \t]+$/),Ue&&(P.whitespace_before=Ue[0]))}if(se)if(Z){var Ye=function(){this.eol=`
`};Ye.prototype=this._options.raw_options;var ct=new Ye;se=Z(de+se,ct)}else{var at=P.whitespace_before;at&&(se=se.replace(new RegExp(`
(`+at+")?","g"),`
`)),se=de+se.replace(/\n/g,`
`+de)}E&&(se?se=E+se+`
`+K:se=E+K),Y.print_newline(!1),se&&(P.text=se,P.whitespace_before="",P.newlines=0,Y.add_raw_token(P),Y.print_newline(!0))}},ve.prototype._handle_tag_open=function(Y,P,j,J,se){var Z=this._get_tag_open_token(P);if((j.is_unformatted||j.is_content_unformatted)&&!j.is_empty_element&&P.type===V.TAG_OPEN&&!Z.is_start_tag?(Y.add_raw_token(P),Z.start_tag_token=this._tag_stack.try_pop(Z.tag_name)):(Y.traverse_whitespace(P),this._set_tag_position(Y,P,Z,j,J),Z.is_inline_element||Y.set_wrap_point(),Y.print_token(P)),Z.is_start_tag&&this._is_wrap_attributes_force){var w=0,E;do E=se.peek(w),E.type===V.ATTRIBUTE&&(Z.attr_count+=1),w+=1;while(E.type!==V.EOF&&E.type!==V.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(Z.alignment_size=P.text.length+1),!Z.tag_complete&&!Z.is_unformatted&&(Y.alignment_size=Z.alignment_size),Z};var Ie=function(Y,P,j){if(this.parent=P||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="",!j)this.tag_complete=!0;else{var J;this.tag_start_char=j.text[0],this.text=j.text,this.tag_start_char==="<"?(J=j.text.match(/^<([^\s>]*)/),this.tag_check=J?J[1]:""):(J=j.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=J?J[1]:"",(j.text.startsWith("{{#>")||j.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&j.next!==null?this.tag_check=j.next.text.split(" ")[0]:this.tag_check=j.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),j.type===V.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||j.closed&&j.closed.text==="/>";var se=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(se=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!Y.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(se)))}};ve.prototype._get_tag_open_token=function(Y){var P=new Ie(this._options,this._tag_stack.get_parser_token(),Y);return P.alignment_size=this._options.wrap_attributes_indent_size,P.is_end_tag=P.is_end_tag||_e(P.tag_check,this._options.void_elements),P.is_empty_element=P.tag_complete||P.is_start_tag&&P.is_end_tag,P.is_unformatted=!P.tag_complete&&_e(P.tag_check,this._options.unformatted),P.is_content_unformatted=!P.is_empty_element&&_e(P.tag_check,this._options.content_unformatted),P.is_inline_element=_e(P.tag_name,this._options.inline)||this._options.inline_custom_elements&&P.tag_name.includes("-")||P.tag_start_char==="{",P},ve.prototype._set_tag_position=function(Y,P,j,J,se){if(j.is_empty_element||(j.is_end_tag?j.start_tag_token=this._tag_stack.try_pop(j.tag_name):(this._do_optional_end_element(j)&&(j.is_inline_element||Y.print_newline(!1)),this._tag_stack.record_tag(j),(j.tag_name==="script"||j.tag_name==="style")&&!(j.is_unformatted||j.is_content_unformatted)&&(j.custom_beautifier_name=ee(j.tag_check,P)))),_e(j.tag_check,this._options.extra_liners)&&(Y.print_newline(!1),Y._output.just_added_blankline()||Y.print_newline(!0)),j.is_empty_element){if(j.tag_start_char==="{"&&j.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),j.indent_content=!0;var Z=Y.current_line_has_match(/{{#if/);Z||Y.print_newline(!1)}j.tag_name==="!--"&&se.type===V.TAG_CLOSE&&J.is_end_tag&&j.text.indexOf(`
`)===-1||(j.is_inline_element||j.is_unformatted||Y.print_newline(!1),this._calcluate_parent_multiline(Y,j))}else if(j.is_end_tag){var w=!1;w=j.start_tag_token&&j.start_tag_token.multiline_content,w=w||!j.is_inline_element&&!(J.is_inline_element||J.is_unformatted)&&!(se.type===V.TAG_CLOSE&&j.start_tag_token===J)&&se.type!=="TK_CONTENT",(j.is_content_unformatted||j.is_unformatted)&&(w=!1),w&&Y.print_newline(!1)}else j.indent_content=!j.custom_beautifier_name,j.tag_start_char==="<"&&(j.tag_name==="html"?j.indent_content=this._options.indent_inner_html:j.tag_name==="head"?j.indent_content=this._options.indent_head_inner_html:j.tag_name==="body"&&(j.indent_content=this._options.indent_body_inner_html)),!(j.is_inline_element||j.is_unformatted)&&(se.type!=="TK_CONTENT"||j.is_content_unformatted)&&Y.print_newline(!1),this._calcluate_parent_multiline(Y,j)},ve.prototype._calcluate_parent_multiline=function(Y,P){P.parent&&Y._output.just_added_newline()&&!((P.is_inline_element||P.is_unformatted)&&P.parent.is_inline_element)&&(P.parent.multiline_content=!0)};var Ae=["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"],We=["a","audio","del","ins","map","noscript","video"];ve.prototype._do_optional_end_element=function(Y){var P=null;if(!(Y.is_empty_element||!Y.is_start_tag||!Y.parent)){if(Y.tag_name==="body")P=P||this._tag_stack.try_pop("head");else if(Y.tag_name==="li")P=P||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(Y.tag_name==="dd"||Y.tag_name==="dt")P=P||this._tag_stack.try_pop("dt",["dl"]),P=P||this._tag_stack.try_pop("dd",["dl"]);else if(Y.parent.tag_name==="p"&&Ae.indexOf(Y.tag_name)!==-1){var j=Y.parent.parent;(!j||We.indexOf(j.tag_name)===-1)&&(P=P||this._tag_stack.try_pop("p"))}else Y.tag_name==="rp"||Y.tag_name==="rt"?(P=P||this._tag_stack.try_pop("rt",["ruby","rtc"]),P=P||this._tag_stack.try_pop("rp",["ruby","rtc"])):Y.tag_name==="optgroup"?P=P||this._tag_stack.try_pop("optgroup",["select"]):Y.tag_name==="option"?P=P||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):Y.tag_name==="colgroup"?P=P||this._tag_stack.try_pop("caption",["table"]):Y.tag_name==="thead"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"])):Y.tag_name==="tbody"||Y.tag_name==="tfoot"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("thead",["table"]),P=P||this._tag_stack.try_pop("tbody",["table"])):Y.tag_name==="tr"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(Y.tag_name==="th"||Y.tag_name==="td")&&(P=P||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),P=P||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return Y.parent=this._tag_stack.get_parser_token(),P}},B.exports.Beautifier=ve},function(B,b,k){var S=k(6).Options;function C(H){S.call(this,H,"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"])}C.prototype=new S,B.exports.Options=C},function(B,b,k){var S=k(9).Tokenizer,C=k(9).TOKEN,H=k(13).Directives,V=k(14).TemplatablePattern,M=k(12).Pattern,I={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:C.START,RAW:C.RAW,EOF:C.EOF},z=new H(/<\!--/,/-->/),ae=function(ee,_e){S.call(this,ee,_e),this._current_tag_name="";var be=new V(this._input).read_options(this._options),ce=new M(this._input);if(this.__patterns={word:be.until(/[\n\r\t <]/),word_control_flow_close_excluded:be.until(/[\n\r\t <}]/),single_quote:be.until_after(/'/),double_quote:be.until_after(/"/),attribute:be.until(/[\n\r\t =>]|\/>/),element_name:be.until(/[\n\r\t >\/]/),angular_control_flow_start:ce.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:ce.starting_with(/{{!--/).until_after(/--}}/),handlebars:ce.starting_with(/{{/).until_after(/}}/),handlebars_open:ce.until(/[\n\r\t }]/),handlebars_raw_close:ce.until(/}}/),comment:ce.starting_with(/<!--/).until_after(/-->/),cdata:ce.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:ce.starting_with(/<!\[/).until_after(/]>/),processing:ce.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 ve=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ce.matching(ve).until_after(ve)}};ae.prototype=new S,ae.prototype._is_comment=function(ee){return!1},ae.prototype._is_opening=function(ee){return ee.type===I.TAG_OPEN||ee.type===I.CONTROL_FLOW_OPEN},ae.prototype._is_closing=function(ee,_e){return ee.type===I.TAG_CLOSE&&_e&&((ee.text===">"||ee.text==="/>")&&_e.text[0]==="<"||ee.text==="}}"&&_e.text[0]==="{"&&_e.text[1]==="{")||ee.type===I.CONTROL_FLOW_CLOSE&&ee.text==="}"&&_e.text.endsWith("{")},ae.prototype._reset=function(){this._current_tag_name=""},ae.prototype._get_next_token=function(ee,_e){var be=null;this._readWhitespace();var ce=this._input.peek();return ce===null?this._create_token(I.EOF,""):(be=be||this._read_open_handlebars(ce,_e),be=be||this._read_attribute(ce,ee,_e),be=be||this._read_close(ce,_e),be=be||this._read_script_and_style(ce,ee),be=be||this._read_control_flows(ce,_e),be=be||this._read_raw_content(ce,ee,_e),be=be||this._read_content_word(ce,_e),be=be||this._read_comment_or_cdata(ce),be=be||this._read_processing(ce),be=be||this._read_open(ce,_e),be=be||this._create_token(I.UNKNOWN,this._input.next()),be)},ae.prototype._read_comment_or_cdata=function(ee){var _e=null,be=null,ce=null;if(ee==="<"){var ve=this._input.peek(1);ve==="!"&&(be=this.__patterns.comment.read(),be?(ce=z.get_directives(be),ce&&ce.ignore==="start"&&(be+=z.readIgnored(this._input))):be=this.__patterns.cdata.read()),be&&(_e=this._create_token(I.COMMENT,be),_e.directives=ce)}return _e},ae.prototype._read_processing=function(ee){var _e=null,be=null,ce=null;if(ee==="<"){var ve=this._input.peek(1);(ve==="!"||ve==="?")&&(be=this.__patterns.conditional_comment.read(),be=be||this.__patterns.processing.read()),be&&(_e=this._create_token(I.COMMENT,be),_e.directives=ce)}return _e},ae.prototype._read_open=function(ee,_e){var be=null,ce=null;return(!_e||_e.type===I.CONTROL_FLOW_OPEN)&&ee==="<"&&(be=this._input.next(),this._input.peek()==="/"&&(be+=this._input.next()),be+=this.__patterns.element_name.read(),ce=this._create_token(I.TAG_OPEN,be)),ce},ae.prototype._read_open_handlebars=function(ee,_e){var be=null,ce=null;return(!_e||_e.type===I.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&ee==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(be=this.__patterns.handlebars_comment.read(),be=be||this.__patterns.handlebars.read(),ce=this._create_token(I.COMMENT,be)):(be=this.__patterns.handlebars_open.read(),ce=this._create_token(I.TAG_OPEN,be))),ce},ae.prototype._read_control_flows=function(ee,_e){var be="",ce=null;if(!this._options.templating.includes("angular"))return ce;if(ee==="@"){if(be=this.__patterns.angular_control_flow_start.read(),be==="")return ce;for(var ve=be.endsWith("(")?1:0,Ie=0;!(be.endsWith("{")&&ve===Ie);){var Ae=this._input.next();if(Ae===null)break;Ae==="("?ve++:Ae===")"&&Ie++,be+=Ae}ce=this._create_token(I.CONTROL_FLOW_OPEN,be)}else ee==="}"&&_e&&_e.type===I.CONTROL_FLOW_OPEN&&(be=this._input.next(),ce=this._create_token(I.CONTROL_FLOW_CLOSE,be));return ce},ae.prototype._read_close=function(ee,_e){var be=null,ce=null;return _e&&_e.type===I.TAG_OPEN&&(_e.text[0]==="<"&&(ee===">"||ee==="/"&&this._input.peek(1)===">")?(be=this._input.next(),ee==="/"&&(be+=this._input.next()),ce=this._create_token(I.TAG_CLOSE,be)):_e.text[0]==="{"&&ee==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ce=this._create_token(I.TAG_CLOSE,"}}"))),ce},ae.prototype._read_attribute=function(ee,_e,be){var ce=null,ve="";if(be&&be.text[0]==="<")if(ee==="=")ce=this._create_token(I.EQUALS,this._input.next());else if(ee==='"'||ee==="'"){var Ie=this._input.next();ee==='"'?Ie+=this.__patterns.double_quote.read():Ie+=this.__patterns.single_quote.read(),ce=this._create_token(I.VALUE,Ie)}else ve=this.__patterns.attribute.read(),ve&&(_e.type===I.EQUALS?ce=this._create_token(I.VALUE,ve):ce=this._create_token(I.ATTRIBUTE,ve));return ce},ae.prototype._is_content_unformatted=function(ee){return this._options.void_elements.indexOf(ee)===-1&&(this._options.content_unformatted.indexOf(ee)!==-1||this._options.unformatted.indexOf(ee)!==-1)},ae.prototype._read_raw_content=function(ee,_e,be){var ce="";if(be&&be.text[0]==="{")ce=this.__patterns.handlebars_raw_close.read();else if(_e.type===I.TAG_CLOSE&&_e.opened.text[0]==="<"&&_e.text[0]!=="/"){var ve=_e.opened.text.substr(1).toLowerCase();this._is_content_unformatted(ve)&&(ce=this._input.readUntil(new RegExp("</"+ve+"[\\n\\r\\t ]*?>","ig")))}return ce?this._create_token(I.TEXT,ce):null},ae.prototype._read_script_and_style=function(ee,_e){if(_e.type===I.TAG_CLOSE&&_e.opened.text[0]==="<"&&_e.text[0]!=="/"){var be=_e.opened.text.substr(1).toLowerCase();if(be==="script"||be==="style"){var ce=this._read_comment_or_cdata(ee);if(ce)return ce.type=I.TEXT,ce;var ve=this._input.readUntil(new RegExp("</"+be+"[\\n\\r\\t ]*?>","ig"));if(ve)return this._create_token(I.TEXT,ve)}}return null},ae.prototype._read_content_word=function(ee,_e){var be="";return this._options.unformatted_content_delimiter&&ee===this._options.unformatted_content_delimiter[0]&&(be=this.__patterns.unformatted_content_delimiter.read()),be||(be=_e&&_e.type===I.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),be?this._create_token(I.TEXT,be):null},B.exports.Tokenizer=ae,B.exports.TOKEN=I}],pe={};function u(B){var b=pe[B];if(b!==void 0)return b.exports;var k=pe[B]={exports:{}};return De[B](k,k.exports,u),k.exports}var Q=u(18);Be=Q})();var ye=Be;if(1)F=[X,X(58553),X(87804)],Te=function(De){var pe=X(58553),u=X(87804);return{html_beautify:function(Q,B){return ye(Q,B,pe.js_beautify,u.css_beautify)}}}.apply(it,F),Te!==void 0&&(Kt.exports=Te);else var te,_})()},58553:function(Kt,it){var X,F;(function(){var Te;(function(){"use strict";var ye=[function(pe,u,Q){var B=Q(1).Beautifier,b=Q(5).Options;function k(S,C){var H=new B(S,C);return H.beautify()}pe.exports=k,pe.exports.defaultOptions=function(){return new b}},function(pe,u,Q){var B=Q(2).Output,b=Q(3).Token,k=Q(4),S=Q(5).Options,C=Q(7).Tokenizer,H=Q(7).line_starters,V=Q(7).positionable_operators,M=Q(7).TOKEN;function I(E,K){return K.indexOf(E)!==-1}function z(E){return E.replace(/^\s+/g,"")}function ae(E){for(var K={},de=0;de<E.length;de++)K[E[de].replace(/-/g,"_")]=E[de];return K}function ee(E,K){return E&&E.type===M.RESERVED&&E.text===K}function _e(E,K){return E&&E.type===M.RESERVED&&I(E.text,K)}var be=["case","return","do","if","throw","else","await","break","continue","async"],ce=["before-newline","after-newline","preserve-newline"],ve=ae(ce),Ie=[ve.before_newline,ve.preserve_newline],Ae={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function We(E,K){K.multiline_frame||K.mode===Ae.ForInitializer||K.mode===Ae.Conditional||E.remove_indent(K.start_line_index)}function Y(E){E=E.replace(k.allLineBreaks,`
`);for(var K=[],de=E.indexOf(`
`);de!==-1;)K.push(E.substring(0,de)),E=E.substring(de+1),de=E.indexOf(`
`);return E.length&&K.push(E),K}function P(E){return E===Ae.ArrayLiteral}function j(E){return I(E,[Ae.Expression,Ae.ForInitializer,Ae.Conditional])}function J(E,K){for(var de=0;de<E.length;de++){var Ue=E[de].trim();if(Ue.charAt(0)!==K)return!1}return!0}function se(E,K){for(var de=0,Ue=E.length,Ye;de<Ue;de++)if(Ye=E[de],Ye&&Ye.indexOf(K)!==0)return!1;return!0}function Z(E,K){K=K||{},this._source_text=E||"",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 S(K)}Z.prototype.create_flags=function(E,K){var de=0;E&&(de=E.indentation_level,!this._output.just_added_newline()&&E.line_indent_level>de&&(de=E.line_indent_level));var Ue={mode:K,parent:E,last_token:E?E.last_token:new b(M.START_BLOCK,""),last_word:E?E.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:de,alignment:0,line_indent_level:E?E.line_indent_level:de,start_line_index:this._output.get_line_number(),ternary_depth:0};return Ue},Z.prototype._reset=function(E){var K=E.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new B(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Ae.BlockStatement);var de=new C(E,this._options);return this._tokens=de.tokenize(),E},Z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E,K=this._reset(this._source_text),de=this._options.eol;this._options.eol==="auto"&&(de=`
`,K&&k.lineBreak.test(K||"")&&(de=K.match(k.lineBreak)[0]));for(var Ue=this._tokens.next();Ue;)this.handle_token(Ue),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Ue,Ue=this._tokens.next();return E=this._output.get_code(de),E},Z.prototype.handle_token=function(E,K){E.type===M.START_EXPR?this.handle_start_expr(E):E.type===M.END_EXPR?this.handle_end_expr(E):E.type===M.START_BLOCK?this.handle_start_block(E):E.type===M.END_BLOCK?this.handle_end_block(E):E.type===M.WORD?this.handle_word(E):E.type===M.RESERVED?this.handle_word(E):E.type===M.SEMICOLON?this.handle_semicolon(E):E.type===M.STRING?this.handle_string(E):E.type===M.EQUALS?this.handle_equals(E):E.type===M.OPERATOR?this.handle_operator(E):E.type===M.COMMA?this.handle_comma(E):E.type===M.BLOCK_COMMENT?this.handle_block_comment(E,K):E.type===M.COMMENT?this.handle_comment(E,K):E.type===M.DOT?this.handle_dot(E):E.type===M.EOF?this.handle_eof(E):E.type===M.UNKNOWN?this.handle_unknown(E,K):this.handle_unknown(E,K)},Z.prototype.handle_whitespace_and_comments=function(E,K){var de=E.newlines,Ue=this._options.keep_array_indentation&&P(this._flags.mode);if(E.comments_before)for(var Ye=E.comments_before.next();Ye;)this.handle_whitespace_and_comments(Ye,K),this.handle_token(Ye,K),Ye=E.comments_before.next();if(Ue)for(var ct=0;ct<de;ct+=1)this.print_newline(ct>0,K);else if(this._options.max_preserve_newlines&&de>this._options.max_preserve_newlines&&(de=this._options.max_preserve_newlines),this._options.preserve_newlines&&de>1){this.print_newline(!1,K);for(var at=1;at<de;at+=1)this.print_newline(!0,K)}};var w=["async","break","continue","return","throw","yield"];Z.prototype.allow_wrap_or_preserved_newline=function(E,K){if(K=K===void 0?!1:K,!this._output.just_added_newline()){var de=this._options.preserve_newlines&&E.newlines||K,Ue=I(this._flags.last_token.text,V)||I(E.text,V);if(Ue){var Ye=I(this._flags.last_token.text,V)&&I(this._options.operator_position,Ie)||I(E.text,V);de=de&&Ye}if(de)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(_e(this._flags.last_token,w))return;this._output.set_wrap_point()}}},Z.prototype.print_newline=function(E,K){if(!K&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==M.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var de=this._tokens.peek();this._flags.mode===Ae.Statement&&!(this._flags.if_block&&ee(de,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(E)&&(this._flags.multiline_frame=!0)},Z.prototype.print_token_line_indentation=function(E){this._output.just_added_newline()&&(this._options.keep_array_indentation&&E.newlines&&(E.text==="["||P(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(E.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))},Z.prototype.print_token=function(E){if(this._output.raw){this._output.add_raw_token(E);return}if(this._options.comma_first&&E.previous&&E.previous.type===M.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var K=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(K),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(E),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(E),this._output.non_breaking_space=!0,this._output.add_token(E.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Z.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Z.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))},Z.prototype.set_mode=function(E){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,E),this._flags=this.create_flags(this._previous_flags,E),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Z.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Ae.Statement&&We(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Z.prototype.start_of_object_property=function(){return this._flags.parent.mode===Ae.ObjectLiteral&&this._flags.mode===Ae.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||_e(this._flags.last_token,["get","set"]))},Z.prototype.start_of_statement=function(E){var K=!1;return K=K||_e(this._flags.last_token,["var","let","const"])&&E.type===M.WORD,K=K||ee(this._flags.last_token,"do"),K=K||!(this._flags.parent.mode===Ae.ObjectLiteral&&this._flags.mode===Ae.Statement)&&_e(this._flags.last_token,w)&&!E.newlines,K=K||ee(this._flags.last_token,"else")&&!(ee(E,"if")&&!E.comments_before),K=K||this._flags.last_token.type===M.END_EXPR&&(this._previous_flags.mode===Ae.ForInitializer||this._previous_flags.mode===Ae.Conditional),K=K||this._flags.last_token.type===M.WORD&&this._flags.mode===Ae.BlockStatement&&!this._flags.in_case&&!(E.text==="--"||E.text==="++")&&this._last_last_text!=="function"&&E.type!==M.WORD&&E.type!==M.RESERVED,K=K||this._flags.mode===Ae.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||_e(this._flags.last_token,["get","set"])),K?(this.set_mode(Ae.Statement),this.indent(),this.handle_whitespace_and_comments(E,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E,_e(E,["do","for","if","while"])),!0):!1},Z.prototype.handle_start_expr=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E);var K=Ae.Expression;if(E.text==="["){if(this._flags.last_token.type===M.WORD||this._flags.last_token.text===")"){_e(this._flags.last_token,H)&&(this._output.space_before_token=!0),this.print_token(E),this.set_mode(K),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}K=Ae.ArrayLiteral,P(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()),I(this._flags.last_token.type,[M.START_EXPR,M.END_EXPR,M.WORD,M.OPERATOR,M.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===M.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,K=Ae.ForInitializer):I(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=Ae.Conditional):I(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&E.whitespace_before===""?this._output.space_before_token=!1:(I(this._flags.last_token.text,H)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===M.EQUALS||this._flags.last_token.type===M.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E);else if(this._flags.last_token.type===M.WORD){this._output.space_before_token=!1;var de=this._tokens.peek(-3);if(this._options.space_after_named_function&&de){var Ue=this._tokens.peek(-4);_e(de,["async","function"])||de.text==="*"&&_e(Ue,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Ae.ObjectLiteral?(de.text==="{"||de.text===","||de.text==="*"&&(Ue.text==="{"||Ue.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(E);(this._flags.last_token.type===M.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(I(this._last_last_text,["function","yield"])||this._flags.mode===Ae.ObjectLiteral&&I(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===M.START_BLOCK?this.print_newline():(this._flags.last_token.type===M.END_EXPR||this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===M.COMMA)&&this.allow_wrap_or_preserved_newline(E,E.newlines),this.print_token(E),this.set_mode(K),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Z.prototype.handle_end_expr=function(E){for(;this._flags.mode===Ae.Statement;)this.restore_mode();this.handle_whitespace_and_comments(E),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(E,E.text==="]"&&P(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===M.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(E),this.restore_mode(),We(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Ae.Conditional&&(this._previous_flags.mode=Ae.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Z.prototype.handle_start_block=function(E){this.handle_whitespace_and_comments(E);var K=this._tokens.peek(),de=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===M.END_EXPR?(this.set_mode(Ae.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Ae.BlockStatement):de&&(I(de.text,[":",","])&&I(K.type,[M.STRING,M.WORD,M.RESERVED])||I(K.text,["get","set","..."])&&I(de.type,[M.WORD,M.RESERVED]))?I(this._last_last_text,["class","interface"])&&!I(de.text,[":",","])?this.set_mode(Ae.BlockStatement):this.set_mode(Ae.ObjectLiteral):this._flags.last_token.type===M.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Ae.BlockStatement):I(this._flags.last_token.type,[M.EQUALS,M.START_EXPR,M.COMMA,M.OPERATOR])||_e(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Ae.ObjectLiteral):this.set_mode(Ae.BlockStatement),this._flags.last_token&&_e(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var Ue=!K.comments_before&&K.text==="}",Ye=Ue&&this._flags.last_word==="function"&&this._flags.last_token.type===M.END_EXPR;if(this._options.brace_preserve_inline){var ct=0,at=null;this._flags.inline_frame=!0;do if(ct+=1,at=this._tokens.peek(ct-1),at.newlines){this._flags.inline_frame=!1;break}while(at.type!==M.EOF&&!(at.type===M.END_BLOCK&&at.opened===E))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&E.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==M.OPERATOR&&(Ye||this._flags.last_token.type===M.EQUALS||_e(this._flags.last_token,be)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(P(this._previous_flags.mode)&&(this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.COMMA)&&((this._flags.last_token.type===M.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(E),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==M.OPERATOR&&this._flags.last_token.type!==M.START_EXPR&&(I(this._flags.last_token.type,[M.START_BLOCK,M.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(E),this.indent(),!Ue&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Z.prototype.handle_end_block=function(E){for(this.handle_whitespace_and_comments(E);this._flags.mode===Ae.Statement;)this.restore_mode();var K=this._flags.last_token.type===M.START_BLOCK;this._flags.inline_frame&&!K?this._output.space_before_token=!0:this._options.brace_style==="expand"?K||this.print_newline():K||(P(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(E)},Z.prototype.handle_word=function(E){if(E.type===M.RESERVED){if(I(E.text,["set","get"])&&this._flags.mode!==Ae.ObjectLiteral)E.type=M.WORD;else if(E.text==="import"&&I(this._tokens.peek().text,["(","."]))E.type=M.WORD;else if(I(E.text,["as","from"])&&!this._flags.import_block)E.type=M.WORD;else if(this._flags.mode===Ae.ObjectLiteral){var K=this._tokens.peek();K.text===":"&&(E.type=M.WORD)}}if(this.start_of_statement(E)?_e(this._flags.last_token,["var","let","const"])&&E.type===M.WORD&&(this._flags.declaration_statement=!0):E.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==M.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==M.EQUALS&&(this._options.preserve_newlines||!_e(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(E),this.print_newline()):this.handle_whitespace_and_comments(E),this._flags.do_block&&!this._flags.do_while)if(ee(E,"while")){this._output.space_before_token=!0,this.print_token(E),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&&ee(E,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Ae.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&_e(E,["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(E),this._flags.in_case=!0;return}if((this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.EQUALS||this._flags.last_token.type===M.OPERATOR)&&!this.start_of_object_property()&&!(I(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===Ae.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(E),ee(E,"function")){(I(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(I(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===M.OPERATOR))&&!this._output.just_added_blankline()&&!E.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===M.RESERVED||this._flags.last_token.type===M.WORD?_e(this._flags.last_token,["get","set","new","export"])||_e(this._flags.last_token,w)?this._output.space_before_token=!0:ee(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===M.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||P(this._flags.mode))||this.print_newline(),this.print_token(E),this._flags.last_word=E.text;return}var de="NONE";if(this._flags.last_token.type===M.END_BLOCK?this._previous_flags.inline_frame?de="SPACE":_e(E,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&E.newlines?de="NEWLINE":(de="SPACE",this._output.space_before_token=!0):de="NEWLINE":this._flags.last_token.type===M.SEMICOLON&&this._flags.mode===Ae.BlockStatement?de="NEWLINE":this._flags.last_token.type===M.SEMICOLON&&j(this._flags.mode)?de="SPACE":this._flags.last_token.type===M.STRING?de="NEWLINE":this._flags.last_token.type===M.RESERVED||this._flags.last_token.type===M.WORD||this._flags.last_token.text==="*"&&(I(this._last_last_text,["function","yield"])||this._flags.mode===Ae.ObjectLiteral&&I(this._last_last_text,["{",","]))?de="SPACE":this._flags.last_token.type===M.START_BLOCK?this._flags.inline_frame?de="SPACE":de="NEWLINE":this._flags.last_token.type===M.END_EXPR&&(this._output.space_before_token=!0,de="NEWLINE"),_e(E,H)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?de="SPACE":de="NEWLINE"),_e(E,["else","catch","finally"]))if((!(this._flags.last_token.type===M.END_BLOCK&&this._previous_flags.mode===Ae.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&E.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Ue=this._output.current_line;Ue.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else de==="NEWLINE"?_e(this._flags.last_token,be)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&_e(E,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==M.END_EXPR?(this._flags.last_token.type!==M.START_EXPR||!_e(E,["var","let","const"]))&&this._flags.last_token.text!==":"&&(ee(E,"if")&&ee(E.previous,"else")?this._output.space_before_token=!0:this.print_newline()):_e(E,H)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&P(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():de==="SPACE"&&(this._output.space_before_token=!0);E.previous&&(E.previous.type===M.WORD||E.previous.type===M.RESERVED)&&(this._output.space_before_token=!0),this.print_token(E),this._flags.last_word=E.text,E.type===M.RESERVED&&(E.text==="do"?this._flags.do_block=!0:E.text==="if"?this._flags.if_block=!0:E.text==="import"?this._flags.import_block=!0:this._flags.import_block&&ee(E,"from")&&(this._flags.import_block=!1))},Z.prototype.handle_semicolon=function(E){this.start_of_statement(E)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(E);for(var K=this._tokens.peek();this._flags.mode===Ae.Statement&&!(this._flags.if_block&&ee(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(E)},Z.prototype.handle_string=function(E){E.text.startsWith("`")&&E.newlines===0&&E.whitespace_before===""&&(E.previous.text===")"||this._flags.last_token.type===M.WORD)||(this.start_of_statement(E)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(E),this._flags.last_token.type===M.RESERVED||this._flags.last_token.type===M.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.EQUALS||this._flags.last_token.type===M.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E):E.text.startsWith("`")&&this._flags.last_token.type===M.END_EXPR&&(E.previous.text==="]"||E.previous.text===")")&&E.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(E)},Z.prototype.handle_equals=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(E),this._output.space_before_token=!0},Z.prototype.handle_comma=function(E){this.handle_whitespace_and_comments(E,!0),this.print_token(E),this._output.space_before_token=!0,this._flags.declaration_statement?(j(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(E)):this._flags.mode===Ae.ObjectLiteral||this._flags.mode===Ae.Statement&&this._flags.parent.mode===Ae.ObjectLiteral?(this._flags.mode===Ae.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(E)},Z.prototype.handle_operator=function(E){var K=E.text==="*"&&(_e(this._flags.last_token,["function","yield"])||I(this._flags.last_token.type,[M.START_BLOCK,M.COMMA,M.END_BLOCK,M.SEMICOLON])),de=I(E.text,["-","+"])&&(I(this._flags.last_token.type,[M.START_BLOCK,M.START_EXPR,M.EQUALS,M.OPERATOR])||I(this._flags.last_token.text,H)||this._flags.last_token.text===",");if(!this.start_of_statement(E)){var Ue=!K;this.handle_whitespace_and_comments(E,Ue)}if(E.text==="*"&&this._flags.last_token.type===M.DOT){this.print_token(E);return}if(E.text==="::"){this.print_token(E);return}if(I(E.text,["-","+"])&&this.start_of_object_property()){this.print_token(E);return}if(this._flags.last_token.type===M.OPERATOR&&I(this._options.operator_position,Ie)&&this.allow_wrap_or_preserved_newline(E),E.text===":"&&this._flags.in_case){this.print_token(E),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==M.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 Ye=!0,ct=!0,at=!1;if(E.text===":"?this._flags.ternary_depth===0?Ye=!1:(this._flags.ternary_depth-=1,at=!0):E.text==="?"&&(this._flags.ternary_depth+=1),!de&&!K&&this._options.preserve_newlines&&I(E.text,V)){var Dt=E.text===":",bt=Dt&&at,ot=Dt&&!at;switch(this._options.operator_position){case ve.before_newline:this._output.space_before_token=!ot,this.print_token(E),(!Dt||bt)&&this.allow_wrap_or_preserved_newline(E),this._output.space_before_token=!0;return;case ve.after_newline:this._output.space_before_token=!0,!Dt||bt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(E):this._output.space_before_token=!1,this.print_token(E),this._output.space_before_token=!0;return;case ve.preserve_newline:ot||this.allow_wrap_or_preserved_newline(E),Ye=!(this._output.just_added_newline()||ot),this._output.space_before_token=Ye,this.print_token(E),this._output.space_before_token=!0;return}}if(K){this.allow_wrap_or_preserved_newline(E),Ye=!1;var Qt=this._tokens.peek();ct=Qt&&I(Qt.type,[M.WORD,M.RESERVED])}else if(E.text==="...")this.allow_wrap_or_preserved_newline(E),Ye=this._flags.last_token.type===M.START_BLOCK,ct=!1;else if(I(E.text,["--","++","!","~"])||de){if((this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR)&&this.allow_wrap_or_preserved_newline(E),Ye=!1,ct=!1,E.newlines&&(E.text==="--"||E.text==="++"||E.text==="~")){var nt=_e(this._flags.last_token,be)&&E.newlines;nt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(nt,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(Ye=!0),this._flags.last_token.type===M.RESERVED?Ye=!0:this._flags.last_token.type===M.END_EXPR?Ye=!(this._flags.last_token.text==="]"&&(E.text==="--"||E.text==="++")):this._flags.last_token.type===M.OPERATOR&&(Ye=I(E.text,["--","-","++","+"])&&I(this._flags.last_token.text,["--","-","++","+"]),I(E.text,["+","-"])&&I(this._flags.last_token.text,["--","++"])&&(ct=!0)),(this._flags.mode===Ae.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Ae.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Ye,this.print_token(E),this._output.space_before_token=ct},Z.prototype.handle_block_comment=function(E,K){if(this._output.raw){this._output.add_raw_token(E),E.directives&&E.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(E.directives){this.print_newline(!1,K),this.print_token(E),E.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!k.newline.test(E.text)&&!E.newlines){this._output.space_before_token=!0,this.print_token(E),this._output.space_before_token=!0;return}else this.print_block_commment(E,K)},Z.prototype.print_block_commment=function(E,K){var de=Y(E.text),Ue,Ye=!1,ct=!1,at=E.whitespace_before,Dt=at.length;if(this.print_newline(!1,K),this.print_token_line_indentation(E),this._output.add_token(de[0]),this.print_newline(!1,K),de.length>1){for(de=de.slice(1),Ye=J(de,"*"),ct=se(de,at),Ye&&(this._flags.alignment=1),Ue=0;Ue<de.length;Ue++)Ye?(this.print_token_line_indentation(E),this._output.add_token(z(de[Ue]))):ct&&de[Ue]?(this.print_token_line_indentation(E),this._output.add_token(de[Ue].substring(Dt))):(this._output.current_line.set_indent(-1),this._output.add_token(de[Ue])),this.print_newline(!1,K);this._flags.alignment=0}},Z.prototype.handle_comment=function(E,K){E.newlines?this.print_newline(!1,K):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(E),this.print_newline(!1,K)},Z.prototype.handle_dot=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),_e(this._flags.last_token,be)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(E,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(E)},Z.prototype.handle_unknown=function(E,K){this.print_token(E),E.text[E.text.length-1]===`
`&&this.print_newline(!1,K)},Z.prototype.handle_eof=function(E){for(;this._flags.mode===Ae.Statement;)this.restore_mode();this.handle_whitespace_and_comments(E)},pe.exports.Beautifier=Z},function(pe){function u(b){this.__parent=b,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=[]}u.prototype.clone_empty=function(){var b=new u(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},u.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},u.prototype.has_match=function(b){for(var k=this.__items.length-1;k>=0;k--)if(this.__items[k].match(b))return!0;return!1},u.prototype.set_indent=function(b,k){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=k||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.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)},u.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},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(b){this.__items.push(b);var k=b.lastIndexOf(`
`);k!==-1?this.__character_count=b.length-k:this.__character_count+=b.length},u.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function Q(b,k){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),k=k||"",b.indent_level>0&&(k=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=k,this.__base_string_length=k.length}Q.prototype.get_indent_size=function(b,k){var S=this.__base_string_length;return k=k||0,b<0&&(S=0),S+=b*this.__indent_size,S+=k,S},Q.prototype.get_indent_string=function(b,k){var S=this.__base_string;return k=k||0,b<0&&(b=0,S=""),k+=b*this.__indent_size,this.__ensure_cache(k),S+=this.__cache[k],S},Q.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},Q.prototype.__add_column=function(){var b=this.__cache.length,k=0,S="";this.__indent_size&&b>=this.__indent_size&&(k=Math.floor(b/this.__indent_size),b-=k*this.__indent_size,S=new Array(k+1).join(this.__indent_string)),b&&(S+=new Array(b+1).join(" ")),this.__cache.push(S)};function B(b,k){this.__indent_cache=new Q(b,k),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}B.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},B.prototype.get_line_number=function(){return this.__lines.length},B.prototype.get_indent_string=function(b,k){return this.__indent_cache.get_indent_string(b,k)},B.prototype.get_indent_size=function(b,k){return this.__indent_cache.get_indent_size(b,k)},B.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},B.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},B.prototype.get_code=function(b){this.trim(!0);var k=this.current_line.pop();k&&(k[k.length-1]===`
`&&(k=k.replace(/\n+$/g,"")),this.current_line.push(k)),this._end_with_newline&&this.__add_outputline();var S=this.__lines.join(`
`);return b!==`
`&&(S=S.replace(/[\n]/g,b)),S},B.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},B.prototype.set_indent=function(b,k){return b=b||0,k=k||0,this.next_line.set_indent(b,k),this.__lines.length>1?(this.current_line.set_indent(b,k),!0):(this.current_line.set_indent(),!1)},B.prototype.add_raw_token=function(b){for(var k=0;k<b.newlines;k++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},B.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},B.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(" "))},B.prototype.remove_indent=function(b){for(var k=this.__lines.length;b<k;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},B.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&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},B.prototype.just_added_newline=function(){return this.current_line.is_empty()},B.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},B.prototype.ensure_empty_line_above=function(b,k){for(var S=this.__lines.length-2;S>=0;){var C=this.__lines[S];if(C.is_empty())break;if(C.item(0).indexOf(b)!==0&&C.item(-1)!==k){this.__lines.splice(S+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}S--}},pe.exports.Output=B},function(pe){function u(Q,B,b,k){this.type=Q,this.text=B,this.comments_before=null,this.newlines=b||0,this.whitespace_before=k||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}pe.exports.Token=u},function(pe,u){var Q="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",B="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",b="\\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",k="\\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",S="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",C="(?:"+S+"|["+Q+b+"])",H="(?:"+S+"|["+B+b+k+"])*";u.identifier=new RegExp(C+H,"g"),u.identifierStart=new RegExp(C),u.identifierMatch=new RegExp("(?:"+S+"|["+B+b+k+"])+");var V=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;u.newline=/[\n\r\u2028\u2029]/,u.lineBreak=new RegExp(`\r
|`+u.newline.source),u.allLineBreaks=new RegExp(u.lineBreak.source,"g")},function(pe,u,Q){var B=Q(6).Options,b=["before-newline","after-newline","preserve-newline"];function k(S){B.call(this,S,"js");var C=this.raw_options.brace_style||null;C==="expand-strict"?this.raw_options.brace_style="expand":C==="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 H=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var V=0;V<H.length;V++)H[V]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=H[V];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",b),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}k.prototype=new B,pe.exports.Options=k},function(pe){function u(b,k){this.raw_options=Q(b,k),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"])}u.prototype._get_array=function(b,k){var S=this.raw_options[b],C=k||[];return typeof S=="object"?S!==null&&typeof S.concat=="function"&&(C=S.concat()):typeof S=="string"&&(C=S.split(/[^a-zA-Z0-9_\/\-]+/)),C},u.prototype._get_boolean=function(b,k){var S=this.raw_options[b],C=S===void 0?!!k:!!S;return C},u.prototype._get_characters=function(b,k){var S=this.raw_options[b],C=k||"";return typeof S=="string"&&(C=S.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),C},u.prototype._get_number=function(b,k){var S=this.raw_options[b];k=parseInt(k,10),isNaN(k)&&(k=0);var C=parseInt(S,10);return isNaN(C)&&(C=k),C},u.prototype._get_selection=function(b,k,S){var C=this._get_selection_list(b,k,S);if(C.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
`+k+`
You passed in: '`+this.raw_options[b]+"'");return C[0]},u.prototype._get_selection_list=function(b,k,S){if(!k||k.length===0)throw new Error("Selection list cannot be empty.");if(S=S||[k[0]],!this._is_valid_selection(S,k))throw new Error("Invalid Default Value!");var C=this._get_array(b,S);if(!this._is_valid_selection(C,k))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
`+k+`
You passed in: '`+this.raw_options[b]+"'");return C},u.prototype._is_valid_selection=function(b,k){return b.length&&k.length&&!b.some(function(S){return k.indexOf(S)===-1})};function Q(b,k){var S={};b=B(b);var C;for(C in b)C!==k&&(S[C]=b[C]);if(k&&b[k])for(C in b[k])S[C]=b[k][C];return S}function B(b){var k={},S;for(S in b){var C=S.replace(/-/g,"_");k[C]=b[S]}return k}pe.exports.Options=u,pe.exports.normalizeOpts=B,pe.exports.mergeOpts=Q},function(pe,u,Q){var B=Q(8).InputScanner,b=Q(9).Tokenizer,k=Q(9).TOKEN,S=Q(13).Directives,C=Q(4),H=Q(12).Pattern,V=Q(14).TemplatablePattern;function M(J,se){return se.indexOf(J)!==-1}var I={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:k.START,RAW:k.RAW,EOF:k.EOF},z=new S(/\/\*/,/\*\//),ae=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,ee=/[0-9]/,_e=/[^\d\.]/,be=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ce=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ce=ce.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ce="\\?\\.(?!\\d) "+ce,ce=ce.replace(/ /g,"|");var ve=new RegExp(ce),Ie="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),Ae=Ie.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),We=new RegExp("^(?:"+Ae.join("|")+")$"),Y,P=function(J,se){b.call(this,J,se),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Z=new H(this._input),w=new V(this._input).read_options(this._options);this.__patterns={template:w,identifier:w.starting_with(C.identifier).matching(C.identifierMatch),number:Z.matching(ae),punct:Z.matching(ve),comment:Z.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Z.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Z.matching(/<!--/),html_comment_end:Z.matching(/-->/),include:Z.starting_with(/#include/).until_after(C.lineBreak),shebang:Z.starting_with(/#!/).until_after(C.lineBreak),xml:Z.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:w.until(/['\\\n\r\u2028\u2029]/),double_quote:w.until(/["\\\n\r\u2028\u2029]/),template_text:w.until(/[`\\$]/),template_expression:w.until(/[`}\\]/)}};P.prototype=new b,P.prototype._is_comment=function(J){return J.type===I.COMMENT||J.type===I.BLOCK_COMMENT||J.type===I.UNKNOWN},P.prototype._is_opening=function(J){return J.type===I.START_BLOCK||J.type===I.START_EXPR},P.prototype._is_closing=function(J,se){return(J.type===I.END_BLOCK||J.type===I.END_EXPR)&&se&&(J.text==="]"&&se.text==="["||J.text===")"&&se.text==="("||J.text==="}"&&se.text==="{")},P.prototype._reset=function(){Y=!1},P.prototype._get_next_token=function(J,se){var Z=null;this._readWhitespace();var w=this._input.peek();return w===null?this._create_token(I.EOF,""):(Z=Z||this._read_non_javascript(w),Z=Z||this._read_string(w),Z=Z||this._read_pair(w,this._input.peek(1)),Z=Z||this._read_word(J),Z=Z||this._read_singles(w),Z=Z||this._read_comment(w),Z=Z||this._read_regexp(w,J),Z=Z||this._read_xml(w,J),Z=Z||this._read_punctuation(),Z=Z||this._create_token(I.UNKNOWN,this._input.next()),Z)},P.prototype._read_word=function(J){var se;if(se=this.__patterns.identifier.read(),se!=="")return se=se.replace(C.allLineBreaks,`
`),!(J.type===I.DOT||J.type===I.RESERVED&&(J.text==="set"||J.text==="get"))&&We.test(se)?(se==="in"||se==="of")&&(J.type===I.WORD||J.type===I.STRING)?this._create_token(I.OPERATOR,se):this._create_token(I.RESERVED,se):this._create_token(I.WORD,se);if(se=this.__patterns.number.read(),se!=="")return this._create_token(I.WORD,se)},P.prototype._read_singles=function(J){var se=null;return J==="("||J==="["?se=this._create_token(I.START_EXPR,J):J===")"||J==="]"?se=this._create_token(I.END_EXPR,J):J==="{"?se=this._create_token(I.START_BLOCK,J):J==="}"?se=this._create_token(I.END_BLOCK,J):J===";"?se=this._create_token(I.SEMICOLON,J):J==="."&&_e.test(this._input.peek(1))?se=this._create_token(I.DOT,J):J===","&&(se=this._create_token(I.COMMA,J)),se&&this._input.next(),se},P.prototype._read_pair=function(J,se){var Z=null;return J==="#"&&se==="{"&&(Z=this._create_token(I.START_BLOCK,J+se)),Z&&(this._input.next(),this._input.next()),Z},P.prototype._read_punctuation=function(){var J=this.__patterns.punct.read();if(J!=="")return J==="="?this._create_token(I.EQUALS,J):J==="?."?this._create_token(I.DOT,J):this._create_token(I.OPERATOR,J)},P.prototype._read_non_javascript=function(J){var se="";if(J==="#"){if(this._is_first_token()&&(se=this.__patterns.shebang.read(),se))return this._create_token(I.UNKNOWN,se.trim()+`
`);if(se=this.__patterns.include.read(),se)return this._create_token(I.UNKNOWN,se.trim()+`
`);J=this._input.next();var Z="#";if(this._input.hasNext()&&this._input.testChar(ee)){do J=this._input.next(),Z+=J;while(this._input.hasNext()&&J!=="#"&&J!=="=");return J==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Z+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Z+="{}",this._input.next(),this._input.next())),this._create_token(I.WORD,Z)}this._input.back()}else if(J==="<"&&this._is_first_token()){if(se=this.__patterns.html_comment_start.read(),se){for(;this._input.hasNext()&&!this._input.testChar(C.newline);)se+=this._input.next();return Y=!0,this._create_token(I.COMMENT,se)}}else if(Y&&J==="-"&&(se=this.__patterns.html_comment_end.read(),se))return Y=!1,this._create_token(I.COMMENT,se);return null},P.prototype._read_comment=function(J){var se=null;if(J==="/"){var Z="";if(this._input.peek(1)==="*"){Z=this.__patterns.block_comment.read();var w=z.get_directives(Z);w&&w.ignore==="start"&&(Z+=z.readIgnored(this._input)),Z=Z.replace(C.allLineBreaks,`
`),se=this._create_token(I.BLOCK_COMMENT,Z),se.directives=w}else this._input.peek(1)==="/"&&(Z=this.__patterns.comment.read(),se=this._create_token(I.COMMENT,Z))}return se},P.prototype._read_string=function(J){if(J==="`"||J==="'"||J==='"'){var se=this._input.next();return this.has_char_escapes=!1,J==="`"?se+=this._read_string_recursive("`",!0,"${"):se+=this._read_string_recursive(J),this.has_char_escapes&&this._options.unescape_strings&&(se=j(se)),this._input.peek()===J&&(se+=this._input.next()),se=se.replace(C.allLineBreaks,`
`),this._create_token(I.STRING,se)}return null},P.prototype._allow_regexp_or_xml=function(J){return J.type===I.RESERVED&&M(J.text,["return","case","throw","else","do","typeof","yield"])||J.type===I.END_EXPR&&J.text===")"&&J.opened.previous.type===I.RESERVED&&M(J.opened.previous.text,["if","while","for"])||M(J.type,[I.COMMENT,I.START_EXPR,I.START_BLOCK,I.START,I.END_BLOCK,I.OPERATOR,I.EQUALS,I.EOF,I.SEMICOLON,I.COMMA])},P.prototype._read_regexp=function(J,se){if(J==="/"&&this._allow_regexp_or_xml(se)){for(var Z=this._input.next(),w=!1,E=!1;this._input.hasNext()&&(w||E||this._input.peek()!==J)&&!this._input.testChar(C.newline);)Z+=this._input.peek(),w?w=!1:(w=this._input.peek()==="\\",this._input.peek()==="["?E=!0:this._input.peek()==="]"&&(E=!1)),this._input.next();return this._input.peek()===J&&(Z+=this._input.next(),Z+=this._input.read(C.identifier)),this._create_token(I.STRING,Z)}return null},P.prototype._read_xml=function(J,se){if(this._options.e4x&&J==="<"&&this._allow_regexp_or_xml(se)){var Z="",w=this.__patterns.xml.read_match();if(w){for(var E=w[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),K=E.indexOf("{")===0,de=0;w;){var Ue=!!w[1],Ye=w[2],ct=!!w[w.length-1]||Ye.slice(0,8)==="![CDATA[";if(!ct&&(Ye===E||K&&Ye.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Ue?--de:++de),Z+=w[0],de<=0)break;w=this.__patterns.xml.read_match()}return w||(Z+=this._input.match(/[\s\S]*/g)[0]),Z=Z.replace(C.allLineBreaks,`
`),this._create_token(I.STRING,Z)}}return null};function j(J){for(var se="",Z=0,w=new B(J),E=null;w.hasNext();)if(E=w.match(/([\s]|[^\\]|\\\\)+/g),E&&(se+=E[0]),w.peek()==="\\"){if(w.next(),w.peek()==="x")E=w.match(/x([0-9A-Fa-f]{2})/g);else if(w.peek()==="u")E=w.match(/u([0-9A-Fa-f]{4})/g),E||(E=w.match(/u\{([0-9A-Fa-f]+)\}/g));else{se+="\\",w.hasNext()&&(se+=w.next());continue}if(!E||(Z=parseInt(E[1],16),Z>126&&Z<=255&&E[0].indexOf("x")===0))return J;Z>=0&&Z<32||Z>1114111?se+="\\"+E[0]:Z===34||Z===39||Z===92?se+="\\"+String.fromCharCode(Z):se+=String.fromCharCode(Z)}return se}P.prototype._read_string_recursive=function(J,se,Z){var w,E;J==="'"?E=this.__patterns.single_quote:J==='"'?E=this.__patterns.double_quote:J==="`"?E=this.__patterns.template_text:J==="}"&&(E=this.__patterns.template_expression);for(var K=E.read(),de="";this._input.hasNext();){if(de=this._input.next(),de===J||!se&&C.newline.test(de)){this._input.back();break}else de==="\\"&&this._input.hasNext()?(w=this._input.peek(),w==="x"||w==="u"?this.has_char_escapes=!0:w==="\r"&&this._input.peek(1)===`
`&&this._input.next(),de+=this._input.next()):Z&&(Z==="${"&&de==="$"&&this._input.peek()==="{"&&(de+=this._input.next()),Z===de&&(J==="`"?de+=this._read_string_recursive("}",se,"`"):de+=this._read_string_recursive("`",se,"${"),this._input.hasNext()&&(de+=this._input.next())));de+=E.read(),K+=de}return K},pe.exports.Tokenizer=P,pe.exports.TOKEN=I,pe.exports.positionable_operators=be.slice(),pe.exports.line_starters=Ie.slice()},function(pe){var u=RegExp.prototype.hasOwnProperty("sticky");function Q(B){this.__input=B||"",this.__input_length=this.__input.length,this.__position=0}Q.prototype.restart=function(){this.__position=0},Q.prototype.back=function(){this.__position>0&&(this.__position-=1)},Q.prototype.hasNext=function(){return this.__position<this.__input_length},Q.prototype.next=function(){var B=null;return this.hasNext()&&(B=this.__input.charAt(this.__position),this.__position+=1),B},Q.prototype.peek=function(B){var b=null;return B=B||0,B+=this.__position,B>=0&&B<this.__input_length&&(b=this.__input.charAt(B)),b},Q.prototype.__match=function(B,b){B.lastIndex=b;var k=B.exec(this.__input);return k&&!(u&&B.sticky)&&k.index!==b&&(k=null),k},Q.prototype.test=function(B,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match(B,b):!1},Q.prototype.testChar=function(B,b){var k=this.peek(b);return B.lastIndex=0,k!==null&&B.test(k)},Q.prototype.match=function(B){var b=this.__match(B,this.__position);return b?this.__position+=b[0].length:b=null,b},Q.prototype.read=function(B,b,k){var S="",C;return B&&(C=this.match(B),C&&(S+=C[0])),b&&(C||!B)&&(S+=this.readUntil(b,k)),S},Q.prototype.readUntil=function(B,b){var k="",S=this.__position;B.lastIndex=this.__position;var C=B.exec(this.__input);return C?(S=C.index,b&&(S+=C[0].length)):S=this.__input_length,k=this.__input.substring(this.__position,S),this.__position=S,k},Q.prototype.readUntilAfter=function(B){return this.readUntil(B,!0)},Q.prototype.get_regexp=function(B,b){var k=null,S="g";return b&&u&&(S="y"),typeof B=="string"&&B!==""?k=new RegExp(B,S):B&&(k=new RegExp(B.source,S)),k},Q.prototype.get_literal_regexp=function(B){return RegExp(B.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},Q.prototype.peekUntilAfter=function(B){var b=this.__position,k=this.readUntilAfter(B);return this.__position=b,k},Q.prototype.lookBack=function(B){var b=this.__position-1;return b>=B.length&&this.__input.substring(b-B.length,b).toLowerCase()===B},pe.exports.InputScanner=Q},function(pe,u,Q){var B=Q(8).InputScanner,b=Q(3).Token,k=Q(10).TokenStream,S=Q(11).WhitespacePattern,C={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},H=function(V,M){this._input=new B(V),this._options=M||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new S(this._input)};H.prototype.tokenize=function(){this._input.restart(),this.__tokens=new k,this._reset();for(var V,M=new b(C.START,""),I=null,z=[],ae=new k;M.type!==C.EOF;){for(V=this._get_next_token(M,I);this._is_comment(V);)ae.add(V),V=this._get_next_token(M,I);ae.isEmpty()||(V.comments_before=ae,ae=new k),V.parent=I,this._is_opening(V)?(z.push(I),I=V):I&&this._is_closing(V,I)&&(V.opened=I,I.closed=V,I=z.pop(),V.parent=I),V.previous=M,M.next=V,this.__tokens.add(V),M=V}return this.__tokens},H.prototype._is_first_token=function(){return this.__tokens.isEmpty()},H.prototype._reset=function(){},H.prototype._get_next_token=function(V,M){this._readWhitespace();var I=this._input.read(/.+/g);return I?this._create_token(C.RAW,I):this._create_token(C.EOF,"")},H.prototype._is_comment=function(V){return!1},H.prototype._is_opening=function(V){return!1},H.prototype._is_closing=function(V,M){return!1},H.prototype._create_token=function(V,M){var I=new b(V,M,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return I},H.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},pe.exports.Tokenizer=H,pe.exports.TOKEN=C},function(pe){function u(Q){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=Q}u.prototype.restart=function(){this.__position=0},u.prototype.isEmpty=function(){return this.__tokens_length===0},u.prototype.hasNext=function(){return this.__position<this.__tokens_length},u.prototype.next=function(){var Q=null;return this.hasNext()&&(Q=this.__tokens[this.__position],this.__position+=1),Q},u.prototype.peek=function(Q){var B=null;return Q=Q||0,Q+=this.__position,Q>=0&&Q<this.__tokens_length&&(B=this.__tokens[Q]),B},u.prototype.add=function(Q){this.__parent_token&&(Q.parent=this.__parent_token),this.__tokens.push(Q),this.__tokens_length+=1},pe.exports.TokenStream=u},function(pe,u,Q){var B=Q(12).Pattern;function b(k,S){B.call(this,k,S),S?this._line_regexp=this._input.get_regexp(S._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}b.prototype=new B,b.prototype.__set_whitespace_patterns=function(k,S){k+="\\t ",S+="\\n\\r",this._match_pattern=this._input.get_regexp("["+k+S+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+S+"]")},b.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var k=this._input.read(this._match_pattern);if(k===" ")this.whitespace_before_token=" ";else if(k){var S=this.__split(this._newline_regexp,k);this.newline_count=S.length-1,this.whitespace_before_token=S[this.newline_count]}return k},b.prototype.matching=function(k,S){var C=this._create();return C.__set_whitespace_patterns(k,S),C._update(),C},b.prototype._create=function(){return new b(this._input,this)},b.prototype.__split=function(k,S){k.lastIndex=0;for(var C=0,H=[],V=k.exec(S);V;)H.push(S.substring(C,V.index)),C=V.index+V[0].length,V=k.exec(S);return C<S.length?H.push(S.substring(C,S.length)):H.push(""),H},pe.exports.WhitespacePattern=b},function(pe){function u(Q,B){this._input=Q,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,B&&(this._starting_pattern=this._input.get_regexp(B._starting_pattern,!0),this._match_pattern=this._input.get_regexp(B._match_pattern,!0),this._until_pattern=this._input.get_regexp(B._until_pattern),this._until_after=B._until_after)}u.prototype.read=function(){var Q=this._input.read(this._starting_pattern);return(!this._starting_pattern||Q)&&(Q+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),Q},u.prototype.read_match=function(){return this._input.match(this._match_pattern)},u.prototype.until_after=function(Q){var B=this._create();return B._until_after=!0,B._until_pattern=this._input.get_regexp(Q),B._update(),B},u.prototype.until=function(Q){var B=this._create();return B._until_after=!1,B._until_pattern=this._input.get_regexp(Q),B._update(),B},u.prototype.starting_with=function(Q){var B=this._create();return B._starting_pattern=this._input.get_regexp(Q,!0),B._update(),B},u.prototype.matching=function(Q){var B=this._create();return B._match_pattern=this._input.get_regexp(Q,!0),B._update(),B},u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){},pe.exports.Pattern=u},function(pe){function u(Q,B){Q=typeof Q=="string"?Q:Q.source,B=typeof B=="string"?B:B.source,this.__directives_block_pattern=new RegExp(Q+/ beautify( \w+[:]\w+)+ /.source+B,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(Q+/\sbeautify\signore:end\s/.source+B,"g")}u.prototype.get_directives=function(Q){if(!Q.match(this.__directives_block_pattern))return null;var B={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(Q);b;)B[b[1]]=b[2],b=this.__directive_pattern.exec(Q);return B},u.prototype.readIgnored=function(Q){return Q.readUntilAfter(this.__directives_end_ignore_pattern)},pe.exports.Directives=u},function(pe,u,Q){var B=Q(12).Pattern,b={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function k(S,C){B.call(this,S,C),this.__template_pattern=null,this._disabled=Object.assign({},b),this._excluded=Object.assign({},b),C&&(this.__template_pattern=this._input.get_regexp(C.__template_pattern),this._excluded=Object.assign(this._excluded,C._excluded),this._disabled=Object.assign(this._disabled,C._disabled));var H=new B(S);this.__patterns={handlebars_comment:H.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:H.starting_with(/{{{/).until_after(/}}}/),handlebars:H.starting_with(/{{/).until_after(/}}/),php:H.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:H.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:H.starting_with(/{%/).until_after(/%}/),django_value:H.starting_with(/{{/).until_after(/}}/),django_comment:H.starting_with(/{#/).until_after(/#}/),smarty:H.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:H.starting_with(/{\*/).until_after(/\*}/),smarty_literal:H.starting_with(/{literal}/).until_after(/{\/literal}/)}}k.prototype=new B,k.prototype._create=function(){return new k(this._input,this)},k.prototype._update=function(){this.__set_templated_pattern()},k.prototype.disable=function(S){var C=this._create();return C._disabled[S]=!0,C._update(),C},k.prototype.read_options=function(S){var C=this._create();for(var H in b)C._disabled[H]=S.templating.indexOf(H)===-1;return C._update(),C},k.prototype.exclude=function(S){var C=this._create();return C._excluded[S]=!0,C._update(),C},k.prototype.read=function(){var S="";this._match_pattern?S=this._input.read(this._starting_pattern):S=this._input.read(this._starting_pattern,this.__template_pattern);for(var C=this._read_template();C;)this._match_pattern?C+=this._input.read(this._match_pattern):C+=this._input.readUntil(this.__template_pattern),S+=C,C=this._read_template();return this._until_after&&(S+=this._input.readUntilAfter(this._until_pattern)),S},k.prototype.__set_templated_pattern=function(){var S=[];this._disabled.php||S.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||S.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||S.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||S.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(S.push(this.__patterns.django._starting_pattern.source),S.push(this.__patterns.django_value._starting_pattern.source),S.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||S.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&S.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+S.join("|")+")")},k.prototype._read_template=function(){var S="",C=this._input.peek();if(C==="<"){var H=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&H==="?"&&(S=S||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&H==="%"&&(S=S||this.__patterns.erb.read())}else C==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(S=S||this.__patterns.handlebars_comment.read(),S=S||this.__patterns.handlebars_unescaped.read(),S=S||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(S=S||this.__patterns.django_value.read()),this._excluded.django||(S=S||this.__patterns.django_comment.read(),S=S||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(S=S||this.__patterns.smarty_comment.read(),S=S||this.__patterns.smarty_literal.read(),S=S||this.__patterns.smarty.read()));return S},pe.exports.TemplatablePattern=k}],te={};function _(pe){var u=te[pe];if(u!==void 0)return u.exports;var Q=te[pe]={exports:{}};return ye[pe](Q,Q.exports,_),Q.exports}var De=_(0);Te=De})();var Be=Te;X=[],F=function(){return{js_beautify:Be}}.apply(it,X),F!==void 0&&(Kt.exports=F)})()},15342:function(Kt){(function(X,F){Kt.exports=F()})(typeof self!="undefined"?self:this,function(){return function(it){var X={};function F(Te){if(X[Te])return X[Te].exports;var Be=X[Te]={i:Te,l:!1,exports:{}};return it[Te].call(Be.exports,Be,Be.exports,F),Be.l=!0,Be.exports}return F.m=it,F.c=X,F.d=function(Te,Be,ye){F.o(Te,Be)||Object.defineProperty(Te,Be,{enumerable:!0,get:ye})},F.r=function(Te){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Te,"__esModule",{value:!0})},F.t=function(Te,Be){if(Be&1&&(Te=F(Te)),Be&8||Be&4&&typeof Te=="object"&&Te&&Te.__esModule)return Te;var ye=Object.create(null);if(F.r(ye),Object.defineProperty(ye,"default",{enumerable:!0,value:Te}),Be&2&&typeof Te!="string")for(var te in Te)F.d(ye,te,function(_){return Te[_]}.bind(null,te));return ye},F.n=function(Te){var Be=Te&&Te.__esModule?function(){return Te.default}:function(){return Te};return F.d(Be,"a",Be),Be},F.o=function(Te,Be){return Object.prototype.hasOwnProperty.call(Te,Be)},F.p="",F(F.s=1)}([function(it,X,F){},function(it,X,F){"use strict";F.r(X);var Te=F(0),Be=function(){function R(l,f,d){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=l,this.start=f,this.end=d}return R.range=function(f,d){return d?!f||!f.loc||!d.loc||f.loc.lexer!==d.loc.lexer?null:new R(f.loc.lexer,f.loc.start,d.loc.end):f&&f.loc},R}(),ye=function(){function R(f,d){this.text=void 0,this.loc=void 0,this.text=f,this.loc=d}var l=R.prototype;return l.range=function(d,g){return new R(g,Be.range(this,d))},R}(),te=function R(l,f){this.position=void 0;var d="KaTeX parse error: "+l,g,x=f&&f.loc;if(x&&x.start<=x.end){var L=x.lexer.input;g=x.start;var W=x.end;g===L.length?d+=" at end of input: ":d+=" at position "+(g+1)+": ";var ne=L.slice(g,W).replace(/[^]/g,"$&\u0332"),ge;g>15?ge="\u2026"+L.slice(g-15,g):ge=L.slice(0,g);var Le;W+15<L.length?Le=L.slice(W,W+15)+"\u2026":Le=L.slice(W),d+=ge+ne+Le}var Ke=new Error(d);return Ke.name="ParseError",Ke.__proto__=R.prototype,Ke.position=g,Ke};te.prototype.__proto__=Error.prototype;var _=te,De=function(l,f){return l.indexOf(f)!==-1},pe=function(l,f){return l===void 0?f:l},u=/([A-Z])/g,Q=function(l){return l.replace(u,"-$1").toLowerCase()},B={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},b=/[&><"']/g;function k(R){return String(R).replace(b,function(l){return B[l]})}var S=function R(l){return l.type==="ordgroup"||l.type==="color"?l.body.length===1?R(l.body[0]):l:l.type==="font"?R(l.body):l},C=function(l){var f=S(l);return f.type==="mathord"||f.type==="textord"||f.type==="atom"},H=function(l){if(!l)throw new Error("Expected non-null, but got "+String(l));return l},V=function(l){var f=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(l);return f!=null?f[1]:"_relative"},M={contains:De,deflt:pe,escape:k,hyphenate:Q,getBaseElem:S,isCharacterBox:C,protocolFromUrl:V},I=function(){function R(f){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,f=f||{},this.displayMode=M.deflt(f.displayMode,!1),this.output=M.deflt(f.output,"htmlAndMathml"),this.leqno=M.deflt(f.leqno,!1),this.fleqn=M.deflt(f.fleqn,!1),this.throwOnError=M.deflt(f.throwOnError,!0),this.errorColor=M.deflt(f.errorColor,"#cc0000"),this.macros=f.macros||{},this.minRuleThickness=Math.max(0,M.deflt(f.minRuleThickness,0)),this.colorIsTextColor=M.deflt(f.colorIsTextColor,!1),this.strict=M.deflt(f.strict,"warn"),this.trust=M.deflt(f.trust,!1),this.maxSize=Math.max(0,M.deflt(f.maxSize,1/0)),this.maxExpand=Math.max(0,M.deflt(f.maxExpand,1e3))}var l=R.prototype;return l.reportNonstrict=function(d,g,x){var L=this.strict;if(typeof L=="function"&&(L=L(d,g,x)),!(!L||L==="ignore")){if(L===!0||L==="error")throw new _("LaTeX-incompatible input and strict mode is set to 'error': "+(g+" ["+d+"]"),x);L==="warn"?typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(g+" ["+d+"]")):typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+L+"': "+g+" ["+d+"]"))}},l.useStrictBehavior=function(d,g,x){var L=this.strict;if(typeof L=="function")try{L=L(d,g,x)}catch(W){L="error"}return!L||L==="ignore"?!1:L===!0||L==="error"?!0:L==="warn"?(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(g+" ["+d+"]")),!1):(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+L+"': "+g+" ["+d+"]")),!1)},l.isTrusted=function(d){d.url&&!d.protocol&&(d.protocol=M.protocolFromUrl(d.url));var g=typeof this.trust=="function"?this.trust(d):this.trust;return!!g},R}(),z=function(){function R(f,d,g){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=f,this.size=d,this.cramped=g}var l=R.prototype;return l.sup=function(){return We[Y[this.id]]},l.sub=function(){return We[P[this.id]]},l.fracNum=function(){return We[j[this.id]]},l.fracDen=function(){return We[J[this.id]]},l.cramp=function(){return We[se[this.id]]},l.text=function(){return We[Z[this.id]]},l.isTight=function(){return this.size>=2},R}(),ae=0,ee=1,_e=2,be=3,ce=4,ve=5,Ie=6,Ae=7,We=[new z(ae,0,!1),new z(ee,0,!0),new z(_e,1,!1),new z(be,1,!0),new z(ce,2,!1),new z(ve,2,!0),new z(Ie,3,!1),new z(Ae,3,!0)],Y=[ce,ve,ce,ve,Ie,Ae,Ie,Ae],P=[ve,ve,ve,ve,Ae,Ae,Ae,Ae],j=[_e,be,ce,ve,Ie,Ae,Ie,Ae],J=[be,be,ve,ve,Ae,Ae,Ae,Ae],se=[ee,ee,be,be,ve,ve,Ae,Ae],Z=[ae,ee,_e,be,_e,be,_e,be],w={DISPLAY:We[ae],TEXT:We[_e],SCRIPT:We[ce],SCRIPTSCRIPT:We[Ie]},E=[{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 K(R){for(var l=0;l<E.length;l++)for(var f=E[l],d=0;d<f.blocks.length;d++){var g=f.blocks[d];if(R>=g[0]&&R<=g[1])return f.name}return null}var de=[];E.forEach(function(R){return R.blocks.forEach(function(l){return de.push.apply(de,l)})});function Ue(R){for(var l=0;l<de.length;l+=2)if(R>=de[l]&&R<=de[l+1])return!0;return!1}var Ye=80,ct=function(l,f){return"M95,"+(622+l+f)+`
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`+l/2.075+" -"+l+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+l)+`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+l)+" "+f+"h400000v"+(40+l)+"h-400000z"},at=function(l,f){return"M263,"+(601+l+f)+`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`+l/2.084+" -"+l+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+l)+`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+l)+" "+f+"h400000v"+(40+l)+"h-400000z"},Dt=function(l,f){return"M983 "+(10+l+f)+`
l`+l/3.13+" -"+l+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+l)+`
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+l)+" "+f+"h400000v"+(40+l)+"h-400000z"},bt=function(l,f){return"M424,"+(2398+l+f)+`
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`+l/4.223+" -"+l+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+l)+`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+l)+" "+f+`
h400000v`+(40+l)+"h-400000z"},ot=function(l,f){return"M473,"+(2713+l+f)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+l/5.298+" -"+l+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+l)+`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+l)+" "+f+"h400000v"+(40+l)+"H1017.7z"},Qt=function(l,f,d){var g=d-54-f-l;return"M702 "+(l+f)+"H400000"+(40+l)+`
H742v`+g+`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 `+f+"H400000v"+(40+l)+"H742z"},nt=function(l,f,d){f=1e3*f;var g="";switch(l){case"sqrtMain":g=ct(f,Ye);break;case"sqrtSize1":g=at(f,Ye);break;case"sqrtSize2":g=Dt(f,Ye);break;case"sqrtSize3":g=bt(f,Ye);break;case"sqrtSize4":g=ot(f,Ye);break;case"sqrtTall":g=Qt(f,Ye,d)}return g},kt={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`},et=function(){function R(f){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=f,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var l=R.prototype;return l.hasClass=function(d){return M.contains(this.classes,d)},l.toNode=function(){for(var d=document.createDocumentFragment(),g=0;g<this.children.length;g++)d.appendChild(this.children[g].toNode());return d},l.toMarkup=function(){for(var d="",g=0;g<this.children.length;g++)d+=this.children[g].toMarkup();return d},l.toText=function(){var d=function(x){return x.toText()};return this.children.map(d).join("")},R}(),Nt=function(l){return l.filter(function(f){return f}).join(" ")},Pe=function(l,f,d){if(this.classes=l||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=d||{},f){f.style.isTight()&&this.classes.push("mtight");var g=f.getColor();g&&(this.style.color=g)}},$e=function(l){var f=document.createElement(l);f.className=Nt(this.classes);for(var d in this.style)this.style.hasOwnProperty(d)&&(f.style[d]=this.style[d]);for(var g in this.attributes)this.attributes.hasOwnProperty(g)&&f.setAttribute(g,this.attributes[g]);for(var x=0;x<this.children.length;x++)f.appendChild(this.children[x].toNode());return f},Ee=function(l){var f="<"+l;this.classes.length&&(f+=' class="'+M.escape(Nt(this.classes))+'"');var d="";for(var g in this.style)this.style.hasOwnProperty(g)&&(d+=M.hyphenate(g)+":"+this.style[g]+";");d&&(f+=' style="'+M.escape(d)+'"');for(var x in this.attributes)this.attributes.hasOwnProperty(x)&&(f+=" "+x+'="'+M.escape(this.attributes[x])+'"');f+=">";for(var L=0;L<this.children.length;L++)f+=this.children[L].toMarkup();return f+="</"+l+">",f},Ve=function(){function R(f,d,g,x){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,Pe.call(this,f,g,x),this.children=d||[]}var l=R.prototype;return l.setAttribute=function(d,g){this.attributes[d]=g},l.hasClass=function(d){return M.contains(this.classes,d)},l.toNode=function(){return $e.call(this,"span")},l.toMarkup=function(){return Ee.call(this,"span")},R}(),Je=function(){function R(f,d,g,x){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,Pe.call(this,d,x),this.children=g||[],this.setAttribute("href",f)}var l=R.prototype;return l.setAttribute=function(d,g){this.attributes[d]=g},l.hasClass=function(d){return M.contains(this.classes,d)},l.toNode=function(){return $e.call(this,"a")},l.toMarkup=function(){return Ee.call(this,"a")},R}(),lt=function(){function R(f,d,g){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=d,this.src=f,this.classes=["mord"],this.style=g}var l=R.prototype;return l.hasClass=function(d){return M.contains(this.classes,d)},l.toNode=function(){var d=document.createElement("img");d.src=this.src,d.alt=this.alt,d.className="mord";for(var g in this.style)this.style.hasOwnProperty(g)&&(d.style[g]=this.style[g]);return d},l.toMarkup=function(){var d="<img src='"+this.src+" 'alt='"+this.alt+"' ",g="";for(var x in this.style)this.style.hasOwnProperty(x)&&(g+=M.hyphenate(x)+":"+this.style[x]+";");return g&&(d+=' style="'+M.escape(g)+'"'),d+="'/>",d},R}(),re={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},Se=function(){function R(f,d,g,x,L,W,ne,ge){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=f,this.height=d||0,this.depth=g||0,this.italic=x||0,this.skew=L||0,this.width=W||0,this.classes=ne||[],this.style=ge||{},this.maxFontSize=0;var Le=K(this.text.charCodeAt(0));Le&&this.classes.push(Le+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=re[this.text])}var l=R.prototype;return l.hasClass=function(d){return M.contains(this.classes,d)},l.toNode=function(){var d=document.createTextNode(this.text),g=null;this.italic>0&&(g=document.createElement("span"),g.style.marginRight=this.italic+"em"),this.classes.length>0&&(g=g||document.createElement("span"),g.className=Nt(this.classes));for(var x in this.style)this.style.hasOwnProperty(x)&&(g=g||document.createElement("span"),g.style[x]=this.style[x]);return g?(g.appendChild(d),g):d},l.toMarkup=function(){var d=!1,g="<span";this.classes.length&&(d=!0,g+=' class="',g+=M.escape(Nt(this.classes)),g+='"');var x="";this.italic>0&&(x+="margin-right:"+this.italic+"em;");for(var L in this.style)this.style.hasOwnProperty(L)&&(x+=M.hyphenate(L)+":"+this.style[L]+";");x&&(d=!0,g+=' style="'+M.escape(x)+'"');var W=M.escape(this.text);return d?(g+=">",g+=W,g+="</span>",g):W},R}(),je=function(){function R(f,d){this.children=void 0,this.attributes=void 0,this.children=f||[],this.attributes=d||{}}var l=R.prototype;return l.toNode=function(){var d="http://www.w3.org/2000/svg",g=document.createElementNS(d,"svg");for(var x in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,x)&&g.setAttribute(x,this.attributes[x]);for(var L=0;L<this.children.length;L++)g.appendChild(this.children[L].toNode());return g},l.toMarkup=function(){var d="<svg";for(var g in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,g)&&(d+=" "+g+"='"+this.attributes[g]+"'");d+=">";for(var x=0;x<this.children.length;x++)d+=this.children[x].toMarkup();return d+="</svg>",d},R}(),Ge=function(){function R(f,d){this.pathName=void 0,this.alternate=void 0,this.pathName=f,this.alternate=d}var l=R.prototype;return l.toNode=function(){var d="http://www.w3.org/2000/svg",g=document.createElementNS(d,"path");return this.alternate?g.setAttribute("d",this.alternate):g.setAttribute("d",kt[this.pathName]),g},l.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+kt[this.pathName]+"'/>"},R}(),Ze=function(){function R(f){this.attributes=void 0,this.attributes=f||{}}var l=R.prototype;return l.toNode=function(){var d="http://www.w3.org/2000/svg",g=document.createElementNS(d,"line");for(var x in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,x)&&g.setAttribute(x,this.attributes[x]);return g},l.toMarkup=function(){var d="<line";for(var g in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,g)&&(d+=" "+g+"='"+this.attributes[g]+"'");return d+="/>",d},R}();function mt(R){if(R instanceof Se)return R;throw new Error("Expected symbolNode but got "+String(R)+".")}function Pt(R){if(R instanceof Ve)return R;throw new Error("Expected span<HtmlDomNode> but got "+String(R)+".")}var yt={"AMS-Regular":{65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473]},"Fraktur-Regular":{33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],163:[0,.69444,0,0,.86853],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],163:[0,.69444,0,0,.76909],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],305:[0,.43056,0,.02778,.32246],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],567:[.19444,.43056,0,.08334,.38403],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,1],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.67,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.744,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.744,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333]},"Math-Italic":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"Math-Regular":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"SansSerif-Bold":{33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212]},"Size1-Regular":{40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},_t={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]},vt={\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 $t(R,l){yt[R]=l}function Ct(R,l,f){if(!yt[l])throw new Error("Font metrics not found for font: "+l+".");var d=R.charCodeAt(0),g=yt[l][d];if(!g&&R[0]in vt&&(d=vt[R[0]].charCodeAt(0),g=yt[l][d]),!g&&f==="text"&&Ue(d)&&(g=yt[l][77]),g)return{depth:g[0],height:g[1],italic:g[2],skew:g[3],width:g[4]}}var wt={};function He(R){var l;if(R>=5?l=0:R>=3?l=1:l=2,!wt[l]){var f=wt[l]={cssEmPerMu:_t.quad[l]/18};for(var d in _t)_t.hasOwnProperty(d)&&(f[d]=_t[d][l])}return wt[l]}var Tt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},gt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},st={math:{},text:{}},Rt=st;function y(R,l,f,d,g,x){st[R][g]={font:l,group:f,replace:d},x&&d&&(st[R][d]=st[R][g])}var D="math",Oe="text",N="main",oe="ams",rr="accent-token",xe="bin",ke="close",Re="inner",G="mathord",q="op-token",me="open",we="punct",O="rel",ht="spacing",he="textord";y(D,N,O,"\u2261","\\equiv",!0),y(D,N,O,"\u227A","\\prec",!0),y(D,N,O,"\u227B","\\succ",!0),y(D,N,O,"\u223C","\\sim",!0),y(D,N,O,"\u22A5","\\perp"),y(D,N,O,"\u2AAF","\\preceq",!0),y(D,N,O,"\u2AB0","\\succeq",!0),y(D,N,O,"\u2243","\\simeq",!0),y(D,N,O,"\u2223","\\mid",!0),y(D,N,O,"\u226A","\\ll",!0),y(D,N,O,"\u226B","\\gg",!0),y(D,N,O,"\u224D","\\asymp",!0),y(D,N,O,"\u2225","\\parallel"),y(D,N,O,"\u22C8","\\bowtie",!0),y(D,N,O,"\u2323","\\smile",!0),y(D,N,O,"\u2291","\\sqsubseteq",!0),y(D,N,O,"\u2292","\\sqsupseteq",!0),y(D,N,O,"\u2250","\\doteq",!0),y(D,N,O,"\u2322","\\frown",!0),y(D,N,O,"\u220B","\\ni",!0),y(D,N,O,"\u221D","\\propto",!0),y(D,N,O,"\u22A2","\\vdash",!0),y(D,N,O,"\u22A3","\\dashv",!0),y(D,N,O,"\u220B","\\owns"),y(D,N,we,".","\\ldotp"),y(D,N,we,"\u22C5","\\cdotp"),y(D,N,he,"#","\\#"),y(Oe,N,he,"#","\\#"),y(D,N,he,"&","\\&"),y(Oe,N,he,"&","\\&"),y(D,N,he,"\u2135","\\aleph",!0),y(D,N,he,"\u2200","\\forall",!0),y(D,N,he,"\u210F","\\hbar",!0),y(D,N,he,"\u2203","\\exists",!0),y(D,N,he,"\u2207","\\nabla",!0),y(D,N,he,"\u266D","\\flat",!0),y(D,N,he,"\u2113","\\ell",!0),y(D,N,he,"\u266E","\\natural",!0),y(D,N,he,"\u2663","\\clubsuit",!0),y(D,N,he,"\u2118","\\wp",!0),y(D,N,he,"\u266F","\\sharp",!0),y(D,N,he,"\u2662","\\diamondsuit",!0),y(D,N,he,"\u211C","\\Re",!0),y(D,N,he,"\u2661","\\heartsuit",!0),y(D,N,he,"\u2111","\\Im",!0),y(D,N,he,"\u2660","\\spadesuit",!0),y(Oe,N,he,"\xA7","\\S",!0),y(Oe,N,he,"\xB6","\\P",!0),y(D,N,he,"\u2020","\\dag"),y(Oe,N,he,"\u2020","\\dag"),y(Oe,N,he,"\u2020","\\textdagger"),y(D,N,he,"\u2021","\\ddag"),y(Oe,N,he,"\u2021","\\ddag"),y(Oe,N,he,"\u2021","\\textdaggerdbl"),y(D,N,ke,"\u23B1","\\rmoustache",!0),y(D,N,me,"\u23B0","\\lmoustache",!0),y(D,N,ke,"\u27EF","\\rgroup",!0),y(D,N,me,"\u27EE","\\lgroup",!0),y(D,N,xe,"\u2213","\\mp",!0),y(D,N,xe,"\u2296","\\ominus",!0),y(D,N,xe,"\u228E","\\uplus",!0),y(D,N,xe,"\u2293","\\sqcap",!0),y(D,N,xe,"\u2217","\\ast"),y(D,N,xe,"\u2294","\\sqcup",!0),y(D,N,xe,"\u25EF","\\bigcirc"),y(D,N,xe,"\u2219","\\bullet"),y(D,N,xe,"\u2021","\\ddagger"),y(D,N,xe,"\u2240","\\wr",!0),y(D,N,xe,"\u2A3F","\\amalg"),y(D,N,xe,"&","\\And"),y(D,N,O,"\u27F5","\\longleftarrow",!0),y(D,N,O,"\u21D0","\\Leftarrow",!0),y(D,N,O,"\u27F8","\\Longleftarrow",!0),y(D,N,O,"\u27F6","\\longrightarrow",!0),y(D,N,O,"\u21D2","\\Rightarrow",!0),y(D,N,O,"\u27F9","\\Longrightarrow",!0),y(D,N,O,"\u2194","\\leftrightarrow",!0),y(D,N,O,"\u27F7","\\longleftrightarrow",!0),y(D,N,O,"\u21D4","\\Leftrightarrow",!0),y(D,N,O,"\u27FA","\\Longleftrightarrow",!0),y(D,N,O,"\u21A6","\\mapsto",!0),y(D,N,O,"\u27FC","\\longmapsto",!0),y(D,N,O,"\u2197","\\nearrow",!0),y(D,N,O,"\u21A9","\\hookleftarrow",!0),y(D,N,O,"\u21AA","\\hookrightarrow",!0),y(D,N,O,"\u2198","\\searrow",!0),y(D,N,O,"\u21BC","\\leftharpoonup",!0),y(D,N,O,"\u21C0","\\rightharpoonup",!0),y(D,N,O,"\u2199","\\swarrow",!0),y(D,N,O,"\u21BD","\\leftharpoondown",!0),y(D,N,O,"\u21C1","\\rightharpoondown",!0),y(D,N,O,"\u2196","\\nwarrow",!0),y(D,N,O,"\u21CC","\\rightleftharpoons",!0),y(D,oe,O,"\u226E","\\nless",!0),y(D,oe,O,"\uE010","\\@nleqslant"),y(D,oe,O,"\uE011","\\@nleqq"),y(D,oe,O,"\u2A87","\\lneq",!0),y(D,oe,O,"\u2268","\\lneqq",!0),y(D,oe,O,"\uE00C","\\@lvertneqq"),y(D,oe,O,"\u22E6","\\lnsim",!0),y(D,oe,O,"\u2A89","\\lnapprox",!0),y(D,oe,O,"\u2280","\\nprec",!0),y(D,oe,O,"\u22E0","\\npreceq",!0),y(D,oe,O,"\u22E8","\\precnsim",!0),y(D,oe,O,"\u2AB9","\\precnapprox",!0),y(D,oe,O,"\u2241","\\nsim",!0),y(D,oe,O,"\uE006","\\@nshortmid"),y(D,oe,O,"\u2224","\\nmid",!0),y(D,oe,O,"\u22AC","\\nvdash",!0),y(D,oe,O,"\u22AD","\\nvDash",!0),y(D,oe,O,"\u22EA","\\ntriangleleft"),y(D,oe,O,"\u22EC","\\ntrianglelefteq",!0),y(D,oe,O,"\u228A","\\subsetneq",!0),y(D,oe,O,"\uE01A","\\@varsubsetneq"),y(D,oe,O,"\u2ACB","\\subsetneqq",!0),y(D,oe,O,"\uE017","\\@varsubsetneqq"),y(D,oe,O,"\u226F","\\ngtr",!0),y(D,oe,O,"\uE00F","\\@ngeqslant"),y(D,oe,O,"\uE00E","\\@ngeqq"),y(D,oe,O,"\u2A88","\\gneq",!0),y(D,oe,O,"\u2269","\\gneqq",!0),y(D,oe,O,"\uE00D","\\@gvertneqq"),y(D,oe,O,"\u22E7","\\gnsim",!0),y(D,oe,O,"\u2A8A","\\gnapprox",!0),y(D,oe,O,"\u2281","\\nsucc",!0),y(D,oe,O,"\u22E1","\\nsucceq",!0),y(D,oe,O,"\u22E9","\\succnsim",!0),y(D,oe,O,"\u2ABA","\\succnapprox",!0),y(D,oe,O,"\u2246","\\ncong",!0),y(D,oe,O,"\uE007","\\@nshortparallel"),y(D,oe,O,"\u2226","\\nparallel",!0),y(D,oe,O,"\u22AF","\\nVDash",!0),y(D,oe,O,"\u22EB","\\ntriangleright"),y(D,oe,O,"\u22ED","\\ntrianglerighteq",!0),y(D,oe,O,"\uE018","\\@nsupseteqq"),y(D,oe,O,"\u228B","\\supsetneq",!0),y(D,oe,O,"\uE01B","\\@varsupsetneq"),y(D,oe,O,"\u2ACC","\\supsetneqq",!0),y(D,oe,O,"\uE019","\\@varsupsetneqq"),y(D,oe,O,"\u22AE","\\nVdash",!0),y(D,oe,O,"\u2AB5","\\precneqq",!0),y(D,oe,O,"\u2AB6","\\succneqq",!0),y(D,oe,O,"\uE016","\\@nsubseteqq"),y(D,oe,xe,"\u22B4","\\unlhd"),y(D,oe,xe,"\u22B5","\\unrhd"),y(D,oe,O,"\u219A","\\nleftarrow",!0),y(D,oe,O,"\u219B","\\nrightarrow",!0),y(D,oe,O,"\u21CD","\\nLeftarrow",!0),y(D,oe,O,"\u21CF","\\nRightarrow",!0),y(D,oe,O,"\u21AE","\\nleftrightarrow",!0),y(D,oe,O,"\u21CE","\\nLeftrightarrow",!0),y(D,oe,O,"\u25B3","\\vartriangle"),y(D,oe,he,"\u210F","\\hslash"),y(D,oe,he,"\u25BD","\\triangledown"),y(D,oe,he,"\u25CA","\\lozenge"),y(D,oe,he,"\u24C8","\\circledS"),y(D,oe,he,"\xAE","\\circledR"),y(Oe,oe,he,"\xAE","\\circledR"),y(D,oe,he,"\u2221","\\measuredangle",!0),y(D,oe,he,"\u2204","\\nexists"),y(D,oe,he,"\u2127","\\mho"),y(D,oe,he,"\u2132","\\Finv",!0),y(D,oe,he,"\u2141","\\Game",!0),y(D,oe,he,"\u2035","\\backprime"),y(D,oe,he,"\u25B2","\\blacktriangle"),y(D,oe,he,"\u25BC","\\blacktriangledown"),y(D,oe,he,"\u25A0","\\blacksquare"),y(D,oe,he,"\u29EB","\\blacklozenge"),y(D,oe,he,"\u2605","\\bigstar"),y(D,oe,he,"\u2222","\\sphericalangle",!0),y(D,oe,he,"\u2201","\\complement",!0),y(D,oe,he,"\xF0","\\eth",!0),y(D,oe,he,"\u2571","\\diagup"),y(D,oe,he,"\u2572","\\diagdown"),y(D,oe,he,"\u25A1","\\square"),y(D,oe,he,"\u25A1","\\Box"),y(D,oe,he,"\u25CA","\\Diamond"),y(D,oe,he,"\xA5","\\yen",!0),y(Oe,oe,he,"\xA5","\\yen",!0),y(D,oe,he,"\u2713","\\checkmark",!0),y(Oe,oe,he,"\u2713","\\checkmark"),y(D,oe,he,"\u2136","\\beth",!0),y(D,oe,he,"\u2138","\\daleth",!0),y(D,oe,he,"\u2137","\\gimel",!0),y(D,oe,he,"\u03DD","\\digamma",!0),y(D,oe,he,"\u03F0","\\varkappa"),y(D,oe,me,"\u250C","\\ulcorner",!0),y(D,oe,ke,"\u2510","\\urcorner",!0),y(D,oe,me,"\u2514","\\llcorner",!0),y(D,oe,ke,"\u2518","\\lrcorner",!0),y(D,oe,O,"\u2266","\\leqq",!0),y(D,oe,O,"\u2A7D","\\leqslant",!0),y(D,oe,O,"\u2A95","\\eqslantless",!0),y(D,oe,O,"\u2272","\\lesssim",!0),y(D,oe,O,"\u2A85","\\lessapprox",!0),y(D,oe,O,"\u224A","\\approxeq",!0),y(D,oe,xe,"\u22D6","\\lessdot"),y(D,oe,O,"\u22D8","\\lll",!0),y(D,oe,O,"\u2276","\\lessgtr",!0),y(D,oe,O,"\u22DA","\\lesseqgtr",!0),y(D,oe,O,"\u2A8B","\\lesseqqgtr",!0),y(D,oe,O,"\u2251","\\doteqdot"),y(D,oe,O,"\u2253","\\risingdotseq",!0),y(D,oe,O,"\u2252","\\fallingdotseq",!0),y(D,oe,O,"\u223D","\\backsim",!0),y(D,oe,O,"\u22CD","\\backsimeq",!0),y(D,oe,O,"\u2AC5","\\subseteqq",!0),y(D,oe,O,"\u22D0","\\Subset",!0),y(D,oe,O,"\u228F","\\sqsubset",!0),y(D,oe,O,"\u227C","\\preccurlyeq",!0),y(D,oe,O,"\u22DE","\\curlyeqprec",!0),y(D,oe,O,"\u227E","\\precsim",!0),y(D,oe,O,"\u2AB7","\\precapprox",!0),y(D,oe,O,"\u22B2","\\vartriangleleft"),y(D,oe,O,"\u22B4","\\trianglelefteq"),y(D,oe,O,"\u22A8","\\vDash",!0),y(D,oe,O,"\u22AA","\\Vvdash",!0),y(D,oe,O,"\u2323","\\smallsmile"),y(D,oe,O,"\u2322","\\smallfrown"),y(D,oe,O,"\u224F","\\bumpeq",!0),y(D,oe,O,"\u224E","\\Bumpeq",!0),y(D,oe,O,"\u2267","\\geqq",!0),y(D,oe,O,"\u2A7E","\\geqslant",!0),y(D,oe,O,"\u2A96","\\eqslantgtr",!0),y(D,oe,O,"\u2273","\\gtrsim",!0),y(D,oe,O,"\u2A86","\\gtrapprox",!0),y(D,oe,xe,"\u22D7","\\gtrdot"),y(D,oe,O,"\u22D9","\\ggg",!0),y(D,oe,O,"\u2277","\\gtrless",!0),y(D,oe,O,"\u22DB","\\gtreqless",!0),y(D,oe,O,"\u2A8C","\\gtreqqless",!0),y(D,oe,O,"\u2256","\\eqcirc",!0),y(D,oe,O,"\u2257","\\circeq",!0),y(D,oe,O,"\u225C","\\triangleq",!0),y(D,oe,O,"\u223C","\\thicksim"),y(D,oe,O,"\u2248","\\thickapprox"),y(D,oe,O,"\u2AC6","\\supseteqq",!0),y(D,oe,O,"\u22D1","\\Supset",!0),y(D,oe,O,"\u2290","\\sqsupset",!0),y(D,oe,O,"\u227D","\\succcurlyeq",!0),y(D,oe,O,"\u22DF","\\curlyeqsucc",!0),y(D,oe,O,"\u227F","\\succsim",!0),y(D,oe,O,"\u2AB8","\\succapprox",!0),y(D,oe,O,"\u22B3","\\vartriangleright"),y(D,oe,O,"\u22B5","\\trianglerighteq"),y(D,oe,O,"\u22A9","\\Vdash",!0),y(D,oe,O,"\u2223","\\shortmid"),y(D,oe,O,"\u2225","\\shortparallel"),y(D,oe,O,"\u226C","\\between",!0),y(D,oe,O,"\u22D4","\\pitchfork",!0),y(D,oe,O,"\u221D","\\varpropto"),y(D,oe,O,"\u25C0","\\blacktriangleleft"),y(D,oe,O,"\u2234","\\therefore",!0),y(D,oe,O,"\u220D","\\backepsilon"),y(D,oe,O,"\u25B6","\\blacktriangleright"),y(D,oe,O,"\u2235","\\because",!0),y(D,oe,O,"\u22D8","\\llless"),y(D,oe,O,"\u22D9","\\gggtr"),y(D,oe,xe,"\u22B2","\\lhd"),y(D,oe,xe,"\u22B3","\\rhd"),y(D,oe,O,"\u2242","\\eqsim",!0),y(D,N,O,"\u22C8","\\Join"),y(D,oe,O,"\u2251","\\Doteq",!0),y(D,oe,xe,"\u2214","\\dotplus",!0),y(D,oe,xe,"\u2216","\\smallsetminus"),y(D,oe,xe,"\u22D2","\\Cap",!0),y(D,oe,xe,"\u22D3","\\Cup",!0),y(D,oe,xe,"\u2A5E","\\doublebarwedge",!0),y(D,oe,xe,"\u229F","\\boxminus",!0),y(D,oe,xe,"\u229E","\\boxplus",!0),y(D,oe,xe,"\u22C7","\\divideontimes",!0),y(D,oe,xe,"\u22C9","\\ltimes",!0),y(D,oe,xe,"\u22CA","\\rtimes",!0),y(D,oe,xe,"\u22CB","\\leftthreetimes",!0),y(D,oe,xe,"\u22CC","\\rightthreetimes",!0),y(D,oe,xe,"\u22CF","\\curlywedge",!0),y(D,oe,xe,"\u22CE","\\curlyvee",!0),y(D,oe,xe,"\u229D","\\circleddash",!0),y(D,oe,xe,"\u229B","\\circledast",!0),y(D,oe,xe,"\u22C5","\\centerdot"),y(D,oe,xe,"\u22BA","\\intercal",!0),y(D,oe,xe,"\u22D2","\\doublecap"),y(D,oe,xe,"\u22D3","\\doublecup"),y(D,oe,xe,"\u22A0","\\boxtimes",!0),y(D,oe,O,"\u21E2","\\dashrightarrow",!0),y(D,oe,O,"\u21E0","\\dashleftarrow",!0),y(D,oe,O,"\u21C7","\\leftleftarrows",!0),y(D,oe,O,"\u21C6","\\leftrightarrows",!0),y(D,oe,O,"\u21DA","\\Lleftarrow",!0),y(D,oe,O,"\u219E","\\twoheadleftarrow",!0),y(D,oe,O,"\u21A2","\\leftarrowtail",!0),y(D,oe,O,"\u21AB","\\looparrowleft",!0),y(D,oe,O,"\u21CB","\\leftrightharpoons",!0),y(D,oe,O,"\u21B6","\\curvearrowleft",!0),y(D,oe,O,"\u21BA","\\circlearrowleft",!0),y(D,oe,O,"\u21B0","\\Lsh",!0),y(D,oe,O,"\u21C8","\\upuparrows",!0),y(D,oe,O,"\u21BF","\\upharpoonleft",!0),y(D,oe,O,"\u21C3","\\downharpoonleft",!0),y(D,oe,O,"\u22B8","\\multimap",!0),y(D,oe,O,"\u21AD","\\leftrightsquigarrow",!0),y(D,oe,O,"\u21C9","\\rightrightarrows",!0),y(D,oe,O,"\u21C4","\\rightleftarrows",!0),y(D,oe,O,"\u21A0","\\twoheadrightarrow",!0),y(D,oe,O,"\u21A3","\\rightarrowtail",!0),y(D,oe,O,"\u21AC","\\looparrowright",!0),y(D,oe,O,"\u21B7","\\curvearrowright",!0),y(D,oe,O,"\u21BB","\\circlearrowright",!0),y(D,oe,O,"\u21B1","\\Rsh",!0),y(D,oe,O,"\u21CA","\\downdownarrows",!0),y(D,oe,O,"\u21BE","\\upharpoonright",!0),y(D,oe,O,"\u21C2","\\downharpoonright",!0),y(D,oe,O,"\u21DD","\\rightsquigarrow",!0),y(D,oe,O,"\u21DD","\\leadsto"),y(D,oe,O,"\u21DB","\\Rrightarrow",!0),y(D,oe,O,"\u21BE","\\restriction"),y(D,N,he,"\u2018","`"),y(D,N,he,"$","\\$"),y(Oe,N,he,"$","\\$"),y(Oe,N,he,"$","\\textdollar"),y(D,N,he,"%","\\%"),y(Oe,N,he,"%","\\%"),y(D,N,he,"_","\\_"),y(Oe,N,he,"_","\\_"),y(Oe,N,he,"_","\\textunderscore"),y(D,N,he,"\u2220","\\angle",!0),y(D,N,he,"\u221E","\\infty",!0),y(D,N,he,"\u2032","\\prime"),y(D,N,he,"\u25B3","\\triangle"),y(D,N,he,"\u0393","\\Gamma",!0),y(D,N,he,"\u0394","\\Delta",!0),y(D,N,he,"\u0398","\\Theta",!0),y(D,N,he,"\u039B","\\Lambda",!0),y(D,N,he,"\u039E","\\Xi",!0),y(D,N,he,"\u03A0","\\Pi",!0),y(D,N,he,"\u03A3","\\Sigma",!0),y(D,N,he,"\u03A5","\\Upsilon",!0),y(D,N,he,"\u03A6","\\Phi",!0),y(D,N,he,"\u03A8","\\Psi",!0),y(D,N,he,"\u03A9","\\Omega",!0),y(D,N,he,"A","\u0391"),y(D,N,he,"B","\u0392"),y(D,N,he,"E","\u0395"),y(D,N,he,"Z","\u0396"),y(D,N,he,"H","\u0397"),y(D,N,he,"I","\u0399"),y(D,N,he,"K","\u039A"),y(D,N,he,"M","\u039C"),y(D,N,he,"N","\u039D"),y(D,N,he,"O","\u039F"),y(D,N,he,"P","\u03A1"),y(D,N,he,"T","\u03A4"),y(D,N,he,"X","\u03A7"),y(D,N,he,"\xAC","\\neg",!0),y(D,N,he,"\xAC","\\lnot"),y(D,N,he,"\u22A4","\\top"),y(D,N,he,"\u22A5","\\bot"),y(D,N,he,"\u2205","\\emptyset"),y(D,oe,he,"\u2205","\\varnothing"),y(D,N,G,"\u03B1","\\alpha",!0),y(D,N,G,"\u03B2","\\beta",!0),y(D,N,G,"\u03B3","\\gamma",!0),y(D,N,G,"\u03B4","\\delta",!0),y(D,N,G,"\u03F5","\\epsilon",!0),y(D,N,G,"\u03B6","\\zeta",!0),y(D,N,G,"\u03B7","\\eta",!0),y(D,N,G,"\u03B8","\\theta",!0),y(D,N,G,"\u03B9","\\iota",!0),y(D,N,G,"\u03BA","\\kappa",!0),y(D,N,G,"\u03BB","\\lambda",!0),y(D,N,G,"\u03BC","\\mu",!0),y(D,N,G,"\u03BD","\\nu",!0),y(D,N,G,"\u03BE","\\xi",!0),y(D,N,G,"\u03BF","\\omicron",!0),y(D,N,G,"\u03C0","\\pi",!0),y(D,N,G,"\u03C1","\\rho",!0),y(D,N,G,"\u03C3","\\sigma",!0),y(D,N,G,"\u03C4","\\tau",!0),y(D,N,G,"\u03C5","\\upsilon",!0),y(D,N,G,"\u03D5","\\phi",!0),y(D,N,G,"\u03C7","\\chi",!0),y(D,N,G,"\u03C8","\\psi",!0),y(D,N,G,"\u03C9","\\omega",!0),y(D,N,G,"\u03B5","\\varepsilon",!0),y(D,N,G,"\u03D1","\\vartheta",!0),y(D,N,G,"\u03D6","\\varpi",!0),y(D,N,G,"\u03F1","\\varrho",!0),y(D,N,G,"\u03C2","\\varsigma",!0),y(D,N,G,"\u03C6","\\varphi",!0),y(D,N,xe,"\u2217","*"),y(D,N,xe,"+","+"),y(D,N,xe,"\u2212","-"),y(D,N,xe,"\u22C5","\\cdot",!0),y(D,N,xe,"\u2218","\\circ"),y(D,N,xe,"\xF7","\\div",!0),y(D,N,xe,"\xB1","\\pm",!0),y(D,N,xe,"\xD7","\\times",!0),y(D,N,xe,"\u2229","\\cap",!0),y(D,N,xe,"\u222A","\\cup",!0),y(D,N,xe,"\u2216","\\setminus"),y(D,N,xe,"\u2227","\\land"),y(D,N,xe,"\u2228","\\lor"),y(D,N,xe,"\u2227","\\wedge",!0),y(D,N,xe,"\u2228","\\vee",!0),y(D,N,he,"\u221A","\\surd"),y(D,N,me,"(","("),y(D,N,me,"[","["),y(D,N,me,"\u27E8","\\langle",!0),y(D,N,me,"\u2223","\\lvert"),y(D,N,me,"\u2225","\\lVert"),y(D,N,ke,")",")"),y(D,N,ke,"]","]"),y(D,N,ke,"?","?"),y(D,N,ke,"!","!"),y(D,N,ke,"\u27E9","\\rangle",!0),y(D,N,ke,"\u2223","\\rvert"),y(D,N,ke,"\u2225","\\rVert"),y(D,N,O,"=","="),y(D,N,O,"<","<"),y(D,N,O,">",">"),y(D,N,O,":",":"),y(D,N,O,"\u2248","\\approx",!0),y(D,N,O,"\u2245","\\cong",!0),y(D,N,O,"\u2265","\\ge"),y(D,N,O,"\u2265","\\geq",!0),y(D,N,O,"\u2190","\\gets"),y(D,N,O,">","\\gt"),y(D,N,O,"\u2208","\\in",!0),y(D,N,O,"\uE020","\\@not"),y(D,N,O,"\u2282","\\subset",!0),y(D,N,O,"\u2283","\\supset",!0),y(D,N,O,"\u2286","\\subseteq",!0),y(D,N,O,"\u2287","\\supseteq",!0),y(D,oe,O,"\u2288","\\nsubseteq",!0),y(D,oe,O,"\u2289","\\nsupseteq",!0),y(D,N,O,"\u22A8","\\models"),y(D,N,O,"\u2190","\\leftarrow",!0),y(D,N,O,"\u2264","\\le"),y(D,N,O,"\u2264","\\leq",!0),y(D,N,O,"<","\\lt"),y(D,N,O,"\u2192","\\rightarrow",!0),y(D,N,O,"\u2192","\\to"),y(D,oe,O,"\u2271","\\ngeq",!0),y(D,oe,O,"\u2270","\\nleq",!0),y(D,N,ht,"\xA0","\\ "),y(D,N,ht,"\xA0","~"),y(D,N,ht,"\xA0","\\space"),y(D,N,ht,"\xA0","\\nobreakspace"),y(Oe,N,ht,"\xA0","\\ "),y(Oe,N,ht,"\xA0","~"),y(Oe,N,ht,"\xA0","\\space"),y(Oe,N,ht,"\xA0","\\nobreakspace"),y(D,N,ht,null,"\\nobreak"),y(D,N,ht,null,"\\allowbreak"),y(D,N,we,",",","),y(D,N,we,";",";"),y(D,oe,xe,"\u22BC","\\barwedge",!0),y(D,oe,xe,"\u22BB","\\veebar",!0),y(D,N,xe,"\u2299","\\odot",!0),y(D,N,xe,"\u2295","\\oplus",!0),y(D,N,xe,"\u2297","\\otimes",!0),y(D,N,he,"\u2202","\\partial",!0),y(D,N,xe,"\u2298","\\oslash",!0),y(D,oe,xe,"\u229A","\\circledcirc",!0),y(D,oe,xe,"\u22A1","\\boxdot",!0),y(D,N,xe,"\u25B3","\\bigtriangleup"),y(D,N,xe,"\u25BD","\\bigtriangledown"),y(D,N,xe,"\u2020","\\dagger"),y(D,N,xe,"\u22C4","\\diamond"),y(D,N,xe,"\u22C6","\\star"),y(D,N,xe,"\u25C3","\\triangleleft"),y(D,N,xe,"\u25B9","\\triangleright"),y(D,N,me,"{","\\{"),y(Oe,N,he,"{","\\{"),y(Oe,N,he,"{","\\textbraceleft"),y(D,N,ke,"}","\\}"),y(Oe,N,he,"}","\\}"),y(Oe,N,he,"}","\\textbraceright"),y(D,N,me,"{","\\lbrace"),y(D,N,ke,"}","\\rbrace"),y(D,N,me,"[","\\lbrack"),y(Oe,N,he,"[","\\lbrack"),y(D,N,ke,"]","\\rbrack"),y(Oe,N,he,"]","\\rbrack"),y(D,N,me,"(","\\lparen"),y(D,N,ke,")","\\rparen"),y(Oe,N,he,"<","\\textless"),y(Oe,N,he,">","\\textgreater"),y(D,N,me,"\u230A","\\lfloor",!0),y(D,N,ke,"\u230B","\\rfloor",!0),y(D,N,me,"\u2308","\\lceil",!0),y(D,N,ke,"\u2309","\\rceil",!0),y(D,N,he,"\\","\\backslash"),y(D,N,he,"\u2223","|"),y(D,N,he,"\u2223","\\vert"),y(Oe,N,he,"|","\\textbar"),y(D,N,he,"\u2225","\\|"),y(D,N,he,"\u2225","\\Vert"),y(Oe,N,he,"\u2225","\\textbardbl"),y(Oe,N,he,"~","\\textasciitilde"),y(Oe,N,he,"\\","\\textbackslash"),y(Oe,N,he,"^","\\textasciicircum"),y(D,N,O,"\u2191","\\uparrow",!0),y(D,N,O,"\u21D1","\\Uparrow",!0),y(D,N,O,"\u2193","\\downarrow",!0),y(D,N,O,"\u21D3","\\Downarrow",!0),y(D,N,O,"\u2195","\\updownarrow",!0),y(D,N,O,"\u21D5","\\Updownarrow",!0),y(D,N,q,"\u2210","\\coprod"),y(D,N,q,"\u22C1","\\bigvee"),y(D,N,q,"\u22C0","\\bigwedge"),y(D,N,q,"\u2A04","\\biguplus"),y(D,N,q,"\u22C2","\\bigcap"),y(D,N,q,"\u22C3","\\bigcup"),y(D,N,q,"\u222B","\\int"),y(D,N,q,"\u222B","\\intop"),y(D,N,q,"\u222C","\\iint"),y(D,N,q,"\u222D","\\iiint"),y(D,N,q,"\u220F","\\prod"),y(D,N,q,"\u2211","\\sum"),y(D,N,q,"\u2A02","\\bigotimes"),y(D,N,q,"\u2A01","\\bigoplus"),y(D,N,q,"\u2A00","\\bigodot"),y(D,N,q,"\u222E","\\oint"),y(D,N,q,"\u222F","\\oiint"),y(D,N,q,"\u2230","\\oiiint"),y(D,N,q,"\u2A06","\\bigsqcup"),y(D,N,q,"\u222B","\\smallint"),y(Oe,N,Re,"\u2026","\\textellipsis"),y(D,N,Re,"\u2026","\\mathellipsis"),y(Oe,N,Re,"\u2026","\\ldots",!0),y(D,N,Re,"\u2026","\\ldots",!0),y(D,N,Re,"\u22EF","\\@cdots",!0),y(D,N,Re,"\u22F1","\\ddots",!0),y(D,N,he,"\u22EE","\\varvdots"),y(D,N,rr,"\u02CA","\\acute"),y(D,N,rr,"\u02CB","\\grave"),y(D,N,rr,"\xA8","\\ddot"),y(D,N,rr,"~","\\tilde"),y(D,N,rr,"\u02C9","\\bar"),y(D,N,rr,"\u02D8","\\breve"),y(D,N,rr,"\u02C7","\\check"),y(D,N,rr,"^","\\hat"),y(D,N,rr,"\u20D7","\\vec"),y(D,N,rr,"\u02D9","\\dot"),y(D,N,rr,"\u02DA","\\mathring"),y(D,N,G,"\u0131","\\imath",!0),y(D,N,G,"\u0237","\\jmath",!0),y(Oe,N,he,"\u0131","\\i",!0),y(Oe,N,he,"\u0237","\\j",!0),y(Oe,N,he,"\xDF","\\ss",!0),y(Oe,N,he,"\xE6","\\ae",!0),y(Oe,N,he,"\xE6","\\ae",!0),y(Oe,N,he,"\u0153","\\oe",!0),y(Oe,N,he,"\xF8","\\o",!0),y(Oe,N,he,"\xC6","\\AE",!0),y(Oe,N,he,"\u0152","\\OE",!0),y(Oe,N,he,"\xD8","\\O",!0),y(Oe,N,rr,"\u02CA","\\'"),y(Oe,N,rr,"\u02CB","\\`"),y(Oe,N,rr,"\u02C6","\\^"),y(Oe,N,rr,"\u02DC","\\~"),y(Oe,N,rr,"\u02C9","\\="),y(Oe,N,rr,"\u02D8","\\u"),y(Oe,N,rr,"\u02D9","\\."),y(Oe,N,rr,"\u02DA","\\r"),y(Oe,N,rr,"\u02C7","\\v"),y(Oe,N,rr,"\xA8",'\\"'),y(Oe,N,rr,"\u02DD","\\H"),y(Oe,N,rr,"\u25EF","\\textcircled");var It={"--":!0,"---":!0,"``":!0,"''":!0};y(Oe,N,he,"\u2013","--"),y(Oe,N,he,"\u2013","\\textendash"),y(Oe,N,he,"\u2014","---"),y(Oe,N,he,"\u2014","\\textemdash"),y(Oe,N,he,"\u2018","`"),y(Oe,N,he,"\u2018","\\textquoteleft"),y(Oe,N,he,"\u2019","'"),y(Oe,N,he,"\u2019","\\textquoteright"),y(Oe,N,he,"\u201C","``"),y(Oe,N,he,"\u201C","\\textquotedblleft"),y(Oe,N,he,"\u201D","''"),y(Oe,N,he,"\u201D","\\textquotedblright"),y(D,N,he,"\xB0","\\degree",!0),y(Oe,N,he,"\xB0","\\degree"),y(Oe,N,he,"\xB0","\\textdegree",!0),y(D,N,G,"\xA3","\\pounds"),y(D,N,G,"\xA3","\\mathsterling",!0),y(Oe,N,G,"\xA3","\\pounds"),y(Oe,N,G,"\xA3","\\textsterling",!0),y(D,oe,he,"\u2720","\\maltese"),y(Oe,oe,he,"\u2720","\\maltese"),y(Oe,N,ht,"\xA0","\\ "),y(Oe,N,ht,"\xA0"," "),y(Oe,N,ht,"\xA0","~");for(var Ot='0123456789/@."',er=0;er<Ot.length;er++){var Dr=Ot.charAt(er);y(D,N,he,Dr,Dr)}for(var lr='0123456789!@*()-=+[]<>|";:?/.,',Wt=0;Wt<lr.length;Wt++){var Mr=lr.charAt(Wt);y(Oe,N,he,Mr,Mr)}for(var Xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Er=0;Er<Xr.length;Er++){var _r=Xr.charAt(Er);y(D,N,G,_r,_r),y(Oe,N,he,_r,_r)}y(D,oe,he,"C","\u2102"),y(Oe,oe,he,"C","\u2102"),y(D,oe,he,"H","\u210D"),y(Oe,oe,he,"H","\u210D"),y(D,oe,he,"N","\u2115"),y(Oe,oe,he,"N","\u2115"),y(D,oe,he,"P","\u2119"),y(Oe,oe,he,"P","\u2119"),y(D,oe,he,"Q","\u211A"),y(Oe,oe,he,"Q","\u211A"),y(D,oe,he,"R","\u211D"),y(Oe,oe,he,"R","\u211D"),y(D,oe,he,"Z","\u2124"),y(Oe,oe,he,"Z","\u2124"),y(D,N,G,"h","\u210E"),y(Oe,N,G,"h","\u210E");for(var At="",pt=0;pt<Xr.length;pt++){var xt=Xr.charAt(pt);At=String.fromCharCode(55349,56320+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At),At=String.fromCharCode(55349,56372+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At),At=String.fromCharCode(55349,56424+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At),At=String.fromCharCode(55349,56580+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At),At=String.fromCharCode(55349,56736+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At),At=String.fromCharCode(55349,56788+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At),At=String.fromCharCode(55349,56840+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At),At=String.fromCharCode(55349,56944+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At),pt<26&&(At=String.fromCharCode(55349,56632+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At),At=String.fromCharCode(55349,56476+pt),y(D,N,G,xt,At),y(Oe,N,he,xt,At))}At="\u{1D55C}",y(D,N,G,"k",At),y(Oe,N,he,"k",At);for(var tr=0;tr<10;tr++){var pr=tr.toString();At=String.fromCharCode(55349,57294+tr),y(D,N,G,pr,At),y(Oe,N,he,pr,At),At=String.fromCharCode(55349,57314+tr),y(D,N,G,pr,At),y(Oe,N,he,pr,At),At=String.fromCharCode(55349,57324+tr),y(D,N,G,pr,At),y(Oe,N,he,pr,At),At=String.fromCharCode(55349,57334+tr),y(D,N,G,pr,At),y(Oe,N,he,pr,At)}for(var wr="\xC7\xD0\xDE\xE7\xFE",Yr=0;Yr<wr.length;Yr++){var qr=wr.charAt(Yr);y(D,N,G,qr,qr),y(Oe,N,he,qr,qr)}y(Oe,N,he,"\xF0","\xF0"),y(Oe,N,he,"\u2013","\u2013"),y(Oe,N,he,"\u2014","\u2014"),y(Oe,N,he,"\u2018","\u2018"),y(Oe,N,he,"\u2019","\u2019"),y(Oe,N,he,"\u201C","\u201C"),y(Oe,N,he,"\u201D","\u201D");var sn=[["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"]],Jr=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],mr=function(l,f){var d=l.charCodeAt(0),g=l.charCodeAt(1),x=(d-55296)*1024+(g-56320)+65536,L=f==="math"?0:1;if(119808<=x&&x<120484){var W=Math.floor((x-119808)/26);return[sn[W][2],sn[W][L]]}else if(120782<=x&&x<=120831){var ne=Math.floor((x-120782)/10);return[Jr[ne][2],Jr[ne][L]]}else{if(x===120485||x===120486)return[sn[0][2],sn[0][L]];if(120486<x&&x<120782)return["",""];throw new _("Unsupported character: "+l)}},cn=[[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]],kr=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],En=function(l,f){return f.size<2?l:cn[l-1][f.size-1]},dn=function(){function R(f){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=f.style,this.color=f.color,this.size=f.size||R.BASESIZE,this.textSize=f.textSize||this.size,this.phantom=!!f.phantom,this.font=f.font||"",this.fontFamily=f.fontFamily||"",this.fontWeight=f.fontWeight||"",this.fontShape=f.fontShape||"",this.sizeMultiplier=kr[this.size-1],this.maxSize=f.maxSize,this.minRuleThickness=f.minRuleThickness,this._fontMetrics=void 0}var l=R.prototype;return l.extend=function(d){var g={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 x in d)d.hasOwnProperty(x)&&(g[x]=d[x]);return new R(g)},l.havingStyle=function(d){return this.style===d?this:this.extend({style:d,size:En(this.textSize,d)})},l.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},l.havingSize=function(d){return this.size===d&&this.textSize===d?this:this.extend({style:this.style.text(),size:d,textSize:d,sizeMultiplier:kr[d-1]})},l.havingBaseStyle=function(d){d=d||this.style.text();var g=En(R.BASESIZE,d);return this.size===g&&this.textSize===R.BASESIZE&&this.style===d?this:this.extend({style:d,size:g})},l.havingBaseSizing=function(){var d;switch(this.style.id){case 4:case 5:d=3;break;case 6:case 7:d=1;break;default:d=6}return this.extend({style:this.style.text(),size:d})},l.withColor=function(d){return this.extend({color:d})},l.withPhantom=function(){return this.extend({phantom:!0})},l.withFont=function(d){return this.extend({font:d})},l.withTextFontFamily=function(d){return this.extend({fontFamily:d,font:""})},l.withTextFontWeight=function(d){return this.extend({fontWeight:d,font:""})},l.withTextFontShape=function(d){return this.extend({fontShape:d,font:""})},l.sizingClasses=function(d){return d.size!==this.size?["sizing","reset-size"+d.size,"size"+this.size]:[]},l.baseSizingClasses=function(){return this.size!==R.BASESIZE?["sizing","reset-size"+this.size,"size"+R.BASESIZE]:[]},l.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=He(this.size)),this._fontMetrics},l.getColor=function(){return this.phantom?"transparent":this.color},R}();dn.BASESIZE=6;var yr=dn,Tr={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},Cr={ex:!0,em:!0,mu:!0},Nr=function(l){return typeof l!="string"&&(l=l.unit),l in Tr||l in Cr||l==="ex"},br=function(l,f){var d;if(l.unit in Tr)d=Tr[l.unit]/f.fontMetrics().ptPerEm/f.sizeMultiplier;else if(l.unit==="mu")d=f.fontMetrics().cssEmPerMu;else{var g;if(f.style.isTight()?g=f.havingStyle(f.style.text()):g=f,l.unit==="ex")d=g.fontMetrics().xHeight;else if(l.unit==="em")d=g.fontMetrics().quad;else throw new _("Invalid unit: '"+l.unit+"'");g!==f&&(d*=g.sizeMultiplier/f.sizeMultiplier)}return Math.min(l.number*d,f.maxSize)},nr=["\\imath","\u0131","\\jmath","\u0237","\\pounds","\\mathsterling","\\textsterling","\xA3"],pn=function(l,f,d){return Rt[d][l]&&Rt[d][l].replace&&(l=Rt[d][l].replace),{value:l,metrics:Ct(l,f,d)}},Ur=function(l,f,d,g,x){var L=pn(l,f,d),W=L.metrics;l=L.value;var ne;if(W){var ge=W.italic;(d==="text"||g&&g.font==="mathit")&&(ge=0),ne=new Se(l,W.height,W.depth,ge,W.skew,W.width,x)}else typeof console!="undefined"&&console.warn("No character metrics "+("for '"+l+"' in style '"+f+"' and mode '"+d+"'")),ne=new Se(l,0,0,0,0,0,x);if(g){ne.maxFontSize=g.sizeMultiplier,g.style.isTight()&&ne.classes.push("mtight");var Le=g.getColor();Le&&(ne.style.color=Le)}return ne},mn=function(l,f,d,g){return g===void 0&&(g=[]),d.font==="boldsymbol"&&pn(l,"Main-Bold",f).metrics?Ur(l,"Main-Bold",f,d,g.concat(["mathbf"])):l==="\\"||Rt[f][l].font==="main"?Ur(l,"Main-Regular",f,d,g):Ur(l,"AMS-Regular",f,d,g.concat(["amsrm"]))},ei=function(l,f,d,g){return/[0-9]/.test(l.charAt(0))||M.contains(nr,l)?{fontName:"Main-Italic",fontClass:"mathit"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},es=function(l,f,d,g){return M.contains(nr,l)?{fontName:"Main-Italic",fontClass:"mathit"}:/[0-9]/.test(l.charAt(0))?{fontName:"Caligraphic-Regular",fontClass:"mathcal"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},An=function(l,f,d,g){return pn(l,"Math-BoldItalic",f).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},zn=function(l,f,d){var g=l.mode,x=l.text,L=["mord"],W=g==="math"||g==="text"&&f.font,ne=W?f.font:f.fontFamily;if(x.charCodeAt(0)===55349){var ge=mr(x,g),Le=ge[0],Ke=ge[1];return Ur(x,Le,g,f,L.concat(Ke))}else if(ne){var rt,dt;if(ne==="boldsymbol"||ne==="mathnormal"){var Et=ne==="boldsymbol"?An(x,g,f,L):es(x,g,f,L);rt=Et.fontName,dt=[Et.fontClass]}else M.contains(nr,x)?(rt="Main-Italic",dt=["mathit"]):W?(rt=vi[ne].fontName,dt=[ne]):(rt=_i(ne,f.fontWeight,f.fontShape),dt=[ne,f.fontWeight,f.fontShape]);if(pn(x,rt,g).metrics)return Ur(x,rt,g,f,L.concat(dt));if(It.hasOwnProperty(x)&&rt.substr(0,10)==="Typewriter"){for(var Mt=[],Yt=0;Yt<x.length;Yt++)Mt.push(Ur(x[Yt],rt,g,f,L.concat(dt)));return Ir(Mt)}}if(d==="mathord"){var Zt=ei(x,g,f,L);return Ur(x,Zt.fontName,g,f,L.concat([Zt.fontClass]))}else if(d==="textord"){var or=Rt[g][x]&&Rt[g][x].font;if(or==="ams"){var gr=_i("amsrm",f.fontWeight,f.fontShape);return Ur(x,gr,g,f,L.concat("amsrm",f.fontWeight,f.fontShape))}else if(or==="main"||!or){var Gr=_i("textrm",f.fontWeight,f.fontShape);return Ur(x,Gr,g,f,L.concat(f.fontWeight,f.fontShape))}else{var Fr=_i(or,f.fontWeight,f.fontShape);return Ur(x,Fr,g,f,L.concat(Fr,f.fontWeight,f.fontShape))}}else throw new Error("unexpected type: "+d+" in makeOrd")},ms=function(l,f){if(Nt(l.classes)!==Nt(f.classes)||l.skew!==f.skew||l.maxFontSize!==f.maxFontSize)return!1;for(var d in l.style)if(l.style.hasOwnProperty(d)&&l.style[d]!==f.style[d])return!1;for(var g in f.style)if(f.style.hasOwnProperty(g)&&l.style[g]!==f.style[g])return!1;return!0},ts=function(l){for(var f=0;f<l.length-1;f++){var d=l[f],g=l[f+1];d instanceof Se&&g instanceof Se&&ms(d,g)&&(d.text+=g.text,d.height=Math.max(d.height,g.height),d.depth=Math.max(d.depth,g.depth),d.italic=g.italic,l.splice(f+1,1),f--)}return l},an=function(l){for(var f=0,d=0,g=0,x=0;x<l.children.length;x++){var L=l.children[x];L.height>f&&(f=L.height),L.depth>d&&(d=L.depth),L.maxFontSize>g&&(g=L.maxFontSize)}l.height=f,l.depth=d,l.maxFontSize=g},Rr=function(l,f,d,g){var x=new Ve(l,f,d,g);return an(x),x},tn=function(l,f,d,g){return new Ve(l,f,d,g)},mi=function(l,f,d){var g=Rr([l],[],f);return g.height=Math.max(d||f.fontMetrics().defaultRuleThickness,f.minRuleThickness),g.style.borderBottomWidth=g.height+"em",g.maxFontSize=1,g},Dn=function(l,f,d,g){var x=new Je(l,f,d,g);return an(x),x},Ir=function(l){var f=new et(l);return an(f),f},jr=function(l,f){return l instanceof et?Rr([],[l],f):l},on=function(l){if(l.positionType==="individualShift"){for(var f=l.children,d=[f[0]],g=-f[0].shift-f[0].elem.depth,x=g,L=1;L<f.length;L++){var W=-f[L].shift-x-f[L].elem.depth,ne=W-(f[L-1].elem.height+f[L-1].elem.depth);x=x+W,d.push({type:"kern",size:ne}),d.push(f[L])}return{children:d,depth:g}}var ge;if(l.positionType==="top"){for(var Le=l.positionData,Ke=0;Ke<l.children.length;Ke++){var rt=l.children[Ke];Le-=rt.type==="kern"?rt.size:rt.elem.height+rt.elem.depth}ge=Le}else if(l.positionType==="bottom")ge=-l.positionData;else{var dt=l.children[0];if(dt.type!=="elem")throw new Error('First child must have type "elem".');if(l.positionType==="shift")ge=-dt.elem.depth-l.positionData;else if(l.positionType==="firstBaseline")ge=-dt.elem.depth;else throw new Error("Invalid positionType "+l.positionType+".")}return{children:l.children,depth:ge}},gi=function(l,f){for(var d=on(l),g=d.children,x=d.depth,L=0,W=0;W<g.length;W++){var ne=g[W];if(ne.type==="elem"){var ge=ne.elem;L=Math.max(L,ge.maxFontSize,ge.height)}}L+=2;var Le=Rr(["pstrut"],[]);Le.style.height=L+"em";for(var Ke=[],rt=x,dt=x,Et=x,Mt=0;Mt<g.length;Mt++){var Yt=g[Mt];if(Yt.type==="kern")Et+=Yt.size;else{var Zt=Yt.elem,or=Yt.wrapperClasses||[],gr=Yt.wrapperStyle||{},Gr=Rr(or,[Le,Zt],void 0,gr);Gr.style.top=-L-Et-Zt.depth+"em",Yt.marginLeft&&(Gr.style.marginLeft=Yt.marginLeft),Yt.marginRight&&(Gr.style.marginRight=Yt.marginRight),Ke.push(Gr),Et+=Zt.height+Zt.depth}rt=Math.min(rt,Et),dt=Math.max(dt,Et)}var Fr=Rr(["vlist"],Ke);Fr.style.height=dt+"em";var Kr;if(rt<0){var Hr=Rr([],[]),zr=Rr(["vlist"],[Hr]);zr.style.height=-rt+"em";var bn=Rr(["vlist-s"],[new Se("\u200B")]);Kr=[Rr(["vlist-r"],[Fr,bn]),Rr(["vlist-r"],[zr])]}else Kr=[Rr(["vlist-r"],[Fr])];var Wr=Rr(["vlist-t"],Kr);return Kr.length===2&&Wr.classes.push("vlist-t2"),Wr.height=dt,Wr.depth=-rt,Wr},xn=function(l,f){var d=Rr(["mspace"],[],f),g=br(l,f);return d.style.marginRight=g+"em",d},_i=function(l,f,d){var g="";switch(l){case"amsrm":g="AMS";break;case"textrm":g="Main";break;case"textsf":g="SansSerif";break;case"texttt":g="Typewriter";break;default:g=l}var x;return f==="textbf"&&d==="textit"?x="BoldItalic":f==="textbf"?x="Bold":f==="textit"?x="Italic":x="Regular",g+"-"+x},vi={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"}},On={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},ti=function(l,f){var d=On[l],g=d[0],x=d[1],L=d[2],W=new Ge(g),ne=new je([W],{width:x+"em",height:L+"em",style:"width:"+x+"em",viewBox:"0 0 "+1e3*x+" "+1e3*L,preserveAspectRatio:"xMinYMin"}),ge=tn(["overlay"],[ne],f);return ge.height=L,ge.style.height=L+"em",ge.style.width=x+"em",ge},Qe={fontMap:vi,makeSymbol:Ur,mathsym:mn,makeSpan:Rr,makeSvgSpan:tn,makeLineSpan:mi,makeAnchor:Dn,makeFragment:Ir,wrapFragment:jr,makeVList:gi,makeOrd:zn,makeGlue:xn,staticSvg:ti,svgData:On,tryCombineChars:ts};function cr(R,l){var f=Vr(R,l);if(!f)throw new Error("Expected node of type "+l+", but got "+(R?"node of type "+R.type:String(R)));return f}function Vr(R,l){return R&&R.type===l?R:null}function yi(R,l){var f=bi(R,l);if(!f)throw new Error('Expected node of type "atom" and family "'+l+'", but got '+(R?R.type==="atom"?"atom of family "+R.family:"node of type "+R.type:String(R)));return f}function bi(R,l){return R&&R.type==="atom"&&R.family===l?R:null}function Vn(R){var l=wn(R);if(!l)throw new Error("Expected node of symbol group type, but got "+(R?"node of type "+R.type:String(R)));return l}function wn(R){return R&&(R.type==="atom"||gt.hasOwnProperty(R.type))?R:null}var ur={number:3,unit:"mu"},Pr={number:4,unit:"mu"},kn={number:5,unit:"mu"},en={mord:{mop:ur,mbin:Pr,mrel:kn,minner:ur},mop:{mord:ur,mop:ur,mrel:kn,minner:ur},mbin:{mord:Pr,mop:Pr,mopen:Pr,minner:Pr},mrel:{mord:kn,mop:kn,mopen:kn,minner:kn},mopen:{},mclose:{mop:ur,mbin:Pr,mrel:kn,minner:ur},mpunct:{mord:ur,mop:ur,mrel:kn,mopen:ur,mclose:ur,mpunct:ur,minner:ur},minner:{mord:ur,mop:ur,mbin:Pr,mrel:kn,mopen:ur,mpunct:ur,minner:ur}},$r={mord:{mop:ur},mop:{mord:ur,mop:ur},mbin:{},mrel:{},mopen:{},mclose:{mop:ur},mpunct:{},minner:{mop:ur}},ji={},Wn={},fn={};function Ht(R){for(var l=R.type,f=R.names,d=R.props,g=R.handler,x=R.htmlBuilder,L=R.mathmlBuilder,W={type:l,numArgs:d.numArgs,argTypes:d.argTypes,greediness:d.greediness===void 0?1:d.greediness,allowedInText:!!d.allowedInText,allowedInMath:d.allowedInMath===void 0?!0:d.allowedInMath,numOptionalArgs:d.numOptionalArgs||0,infix:!!d.infix,handler:g},ne=0;ne<f.length;++ne)ji[f[ne]]=W;l&&(x&&(Wn[l]=x),L&&(fn[l]=L))}function ln(R){var l=R.type,f=R.htmlBuilder,d=R.mathmlBuilder;Ht({type:l,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:f,mathmlBuilder:d})}var Qr=function(l){var f=Vr(l,"ordgroup");return f?f.body:[l]},Mn=Qe.makeSpan,Ei=["leftmost","mbin","mopen","mrel","mop","mpunct"],xi=["rightmost","mrel","mclose","mpunct"],Vi={display:w.DISPLAY,text:w.TEXT,script:w.SCRIPT,scriptscript:w.SCRIPTSCRIPT},wi={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Zr=function(l,f,d,g){g===void 0&&(g=[null,null]);for(var x=[],L=0;L<l.length;L++){var W=dr(l[L],f);if(W instanceof et){var ne=W.children;x.push.apply(x,ne)}else x.push(W)}if(!d)return x;var ge=f;if(l.length===1){var Le=Vr(l[0],"sizing")||Vr(l[0],"styling");Le&&(Le.type==="sizing"?ge=f.havingSize(Le.size):Le.type==="styling"&&(ge=f.havingStyle(Vi[Le.style])))}var Ke=Mn([g[0]||"leftmost"],[],f),rt=Mn([g[1]||"rightmost"],[],f);return ri(x,function(dt,Et){var Mt=Et.classes[0],Yt=dt.classes[0];Mt==="mbin"&&M.contains(xi,Yt)?Et.classes[0]="mord":Yt==="mbin"&&M.contains(Ei,Mt)&&(dt.classes[0]="mord")},{node:Ke},rt),ri(x,function(dt,Et){var Mt=Fn(Et),Yt=Fn(dt),Zt=Mt&&Yt?dt.hasClass("mtight")?$r[Mt][Yt]:en[Mt][Yt]:null;if(Zt)return Qe.makeGlue(Zt,ge)},{node:Ke},rt),x},ri=function R(l,f,d,g){g&&l.push(g);for(var x=0;x<l.length;x++){var L=l[x],W=Cn(L);if(W){R(W.children,f,d);continue}if(L.classes[0]!=="mspace"){var ne=f(L,d.node);ne&&(d.insertAfter?d.insertAfter(ne):(l.unshift(ne),x++)),d.node=L,d.insertAfter=function(ge){return function(Le){l.splice(ge+1,0,Le),x++}}(x)}}g&&l.pop()},Cn=function(l){return l instanceof et||l instanceof Je?l:null},Yn=function R(l,f){var d=Cn(l);if(d){var g=d.children;if(g.length){if(f==="right")return R(g[g.length-1],"right");if(f==="left")return R(g[0],"left")}}return l},Fn=function(l,f){return l?(f&&(l=Yn(l,f)),wi[l.classes[0]]||null):null},Ln=function(l,f){var d=["nulldelimiter"].concat(l.baseSizingClasses());return Mn(f.concat(d))},dr=function(l,f,d){if(!l)return Mn();if(Wn[l.type]){var g=Wn[l.type](l,f);if(d&&f.size!==d.size){g=Mn(f.sizingClasses(d),[g],f);var x=f.sizeMultiplier/d.sizeMultiplier;g.height*=x,g.depth*=x}return g}else throw new _("Got group of unknown type: '"+l.type+"'")};function Si(R,l){var f=Mn(["base"],R,l),d=Mn(["strut"]);return d.style.height=f.height+f.depth+"em",d.style.verticalAlign=-f.depth+"em",f.children.unshift(d),f}function ni(R,l){var f=null;R.length===1&&R[0].type==="tag"&&(f=R[0].tag,R=R[0].body);for(var d=Zr(R,l,!0),g=[],x=[],L=0;L<d.length;L++)if(x.push(d[L]),d[L].hasClass("mbin")||d[L].hasClass("mrel")||d[L].hasClass("allowbreak")){for(var W=!1;L<d.length-1&&d[L+1].hasClass("mspace")&&!d[L+1].hasClass("newline");)L++,x.push(d[L]),d[L].hasClass("nobreak")&&(W=!0);W||(g.push(Si(x,l)),x=[])}else d[L].hasClass("newline")&&(x.pop(),x.length>0&&(g.push(Si(x,l)),x=[]),g.push(d[L]));x.length>0&&g.push(Si(x,l));var ne;f&&(ne=Si(Zr(f,l,!0)),ne.classes=["tag"],g.push(ne));var ge=Mn(["katex-html"],g);if(ge.setAttribute("aria-hidden","true"),ne){var Le=ne.children[0];Le.style.height=ge.height+ge.depth+"em",Le.style.verticalAlign=-ge.depth+"em"}return ge}function ii(R){return new et(R)}var un=function(){function R(f,d){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=f,this.attributes={},this.children=d||[]}var l=R.prototype;return l.setAttribute=function(d,g){this.attributes[d]=g},l.getAttribute=function(d){return this.attributes[d]},l.toNode=function(){var d=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var g in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,g)&&d.setAttribute(g,this.attributes[g]);for(var x=0;x<this.children.length;x++)d.appendChild(this.children[x].toNode());return d},l.toMarkup=function(){var d="<"+this.type;for(var g in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,g)&&(d+=" "+g+'="',d+=M.escape(this.attributes[g]),d+='"');d+=">";for(var x=0;x<this.children.length;x++)d+=this.children[x].toMarkup();return d+="</"+this.type+">",d},l.toText=function(){return this.children.map(function(d){return d.toText()}).join("")},R}(),ir=function(){function R(f){this.text=void 0,this.text=f}var l=R.prototype;return l.toNode=function(){return document.createTextNode(this.text)},l.toMarkup=function(){return M.escape(this.toText())},l.toText=function(){return this.text},R}(),rs=function(){function R(f){this.width=void 0,this.character=void 0,this.width=f,f>=.05555&&f<=.05556?this.character="\u200A":f>=.1666&&f<=.1667?this.character="\u2009":f>=.2222&&f<=.2223?this.character="\u2005":f>=.2777&&f<=.2778?this.character="\u2005\u200A":f>=-.05556&&f<=-.05555?this.character="\u200A\u2063":f>=-.1667&&f<=-.1666?this.character="\u2009\u2063":f>=-.2223&&f<=-.2222?this.character="\u205F\u2063":f>=-.2778&&f<=-.2777?this.character="\u2005\u2063":this.character=null}var l=R.prototype;return l.toNode=function(){if(this.character)return document.createTextNode(this.character);var d=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return d.setAttribute("width",this.width+"em"),d},l.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+this.width+'em"/>'},l.toText=function(){return this.character?this.character:" "},R}(),St={MathNode:un,TextNode:ir,SpaceNode:rs,newDocumentFragment:ii},hn=function(l,f,d){return Rt[f][l]&&Rt[f][l].replace&&l.charCodeAt(0)!==55349&&!(It.hasOwnProperty(l)&&d&&(d.fontFamily&&d.fontFamily.substr(4,2)==="tt"||d.font&&d.font.substr(4,2)==="tt"))&&(l=Rt[f][l].replace),new St.TextNode(l)},Ii=function(l){return l.length===1?l[0]:new St.MathNode("mrow",l)},Pi=function(l,f){if(f.fontFamily==="texttt")return"monospace";if(f.fontFamily==="textsf")return f.fontShape==="textit"&&f.fontWeight==="textbf"?"sans-serif-bold-italic":f.fontShape==="textit"?"sans-serif-italic":f.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(f.fontShape==="textit"&&f.fontWeight==="textbf")return"bold-italic";if(f.fontShape==="textit")return"italic";if(f.fontWeight==="textbf")return"bold";var d=f.font;if(!d||d==="mathnormal")return null;var g=l.mode;if(d==="mathit")return"italic";if(d==="boldsymbol")return"bold-italic";if(d==="mathbf")return"bold";if(d==="mathbb")return"double-struck";if(d==="mathfrak")return"fraktur";if(d==="mathscr"||d==="mathcal")return"script";if(d==="mathsf")return"sans-serif";if(d==="mathtt")return"monospace";var x=l.text;if(M.contains(["\\imath","\\jmath"],x))return null;Rt[g][x]&&Rt[g][x].replace&&(x=Rt[g][x].replace);var L=Qe.fontMap[d].fontName;return Ct(x,L,g)?Qe.fontMap[d].variant:null},gn=function(l,f,d){if(l.length===1){var g=ar(l[0],f);return d&&g instanceof un&&g.type==="mo"&&(g.setAttribute("lspace","0em"),g.setAttribute("rspace","0em")),[g]}for(var x=[],L,W=0;W<l.length;W++){var ne=ar(l[W],f);if(ne instanceof un&&L instanceof un){if(ne.type==="mtext"&&L.type==="mtext"&&ne.getAttribute("mathvariant")===L.getAttribute("mathvariant")){var ge;(ge=L.children).push.apply(ge,ne.children);continue}else if(ne.type==="mn"&&L.type==="mn"){var Le;(Le=L.children).push.apply(Le,ne.children);continue}else if(ne.type==="mi"&&ne.children.length===1&&L.type==="mn"){var Ke=ne.children[0];if(Ke instanceof ir&&Ke.text==="."){var rt;(rt=L.children).push.apply(rt,ne.children);continue}}else if(L.type==="mi"&&L.children.length===1){var dt=L.children[0];if(dt instanceof ir&&dt.text==="\u0338"&&(ne.type==="mo"||ne.type==="mi"||ne.type==="mn")){var Et=ne.children[0];Et instanceof ir&&Et.text.length>0&&(Et.text=Et.text.slice(0,1)+"\u0338"+Et.text.slice(1),x.pop())}}}x.push(ne),L=ne}return x},Gn=function(l,f,d){return Ii(gn(l,f,d))},ar=function(l,f){if(!l)return new St.MathNode("mrow");if(fn[l.type]){var d=fn[l.type](l,f);return d}else throw new _("Got group of unknown type: '"+l.type+"'")};function Bn(R,l,f,d){var g=gn(R,f),x;g.length===1&&g[0]instanceof un&&M.contains(["mrow","mtable"],g[0].type)?x=g[0]:x=new St.MathNode("mrow",g);var L=new St.MathNode("annotation",[new St.TextNode(l)]);L.setAttribute("encoding","application/x-tex");var W=new St.MathNode("semantics",[x,L]),ne=new St.MathNode("math",[W]);ne.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var ge=d?"katex":"katex-mathml";return Qe.makeSpan([ge],[ne])}var Oi=function(l){return new yr({style:l.displayMode?w.DISPLAY:w.TEXT,maxSize:l.maxSize,minRuleThickness:l.minRuleThickness})},ns=function(l,f){if(f.displayMode){var d=["katex-display"];f.leqno&&d.push("leqno"),f.fleqn&&d.push("fleqn"),l=Qe.makeSpan(d,[l])}return l},_n=function(l,f,d){var g=Oi(d),x;if(d.output==="mathml")return Bn(l,f,g,!0);if(d.output==="html"){var L=ni(l,g);x=Qe.makeSpan(["katex"],[L])}else{var W=Bn(l,f,g,!1),ne=ni(l,g);x=Qe.makeSpan(["katex"],[W,ne])}return ns(x,d)},Mi=function(l,f,d){var g=Oi(d),x=ni(l,g),L=Qe.makeSpan(["katex"],[x]);return ns(L,d)},is=_n,Rn={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"},qn=function(l){var f=new St.MathNode("mo",[new St.TextNode(Rn[l.substr(1)])]);return f.setAttribute("stretchy","true"),f},Kn={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]},Fi=function(l){return l.type==="ordgroup"?l.body.length:1},Wi=function(l,f){function d(){var ne=4e5,ge=l.label.substr(1);if(M.contains(["widehat","widecheck","widetilde","utilde"],ge)){var Le=l,Ke=Fi(Le.base),rt,dt,Et;if(Ke>5)ge==="widehat"||ge==="widecheck"?(rt=420,ne=2364,Et=.42,dt=ge+"4"):(rt=312,ne=2340,Et=.34,dt="tilde4");else{var Mt=[1,1,2,2,3,3][Ke];ge==="widehat"||ge==="widecheck"?(ne=[0,1062,2364,2364,2364][Mt],rt=[0,239,300,360,420][Mt],Et=[0,.24,.3,.3,.36,.42][Mt],dt=ge+Mt):(ne=[0,600,1033,2339,2340][Mt],rt=[0,260,286,306,312][Mt],Et=[0,.26,.286,.3,.306,.34][Mt],dt="tilde"+Mt)}var Yt=new Ge(dt),Zt=new je([Yt],{width:"100%",height:Et+"em",viewBox:"0 0 "+ne+" "+rt,preserveAspectRatio:"none"});return{span:Qe.makeSvgSpan([],[Zt],f),minWidth:0,height:Et}}else{var or=[],gr=Kn[ge],Gr=gr[0],Fr=gr[1],Kr=gr[2],Hr=Kr/1e3,zr=Gr.length,bn,Wr;if(zr===1){var Me=gr[3];bn=["hide-tail"],Wr=[Me]}else if(zr===2)bn=["halfarrow-left","halfarrow-right"],Wr=["xMinYMin","xMaxYMin"];else if(zr===3)bn=["brace-left","brace-center","brace-right"],Wr=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+zr+" children.");for(var Un=0;Un<zr;Un++){var ci=new Ge(Gr[Un]),Xn=new je([ci],{width:"400em",height:Hr+"em",viewBox:"0 0 "+ne+" "+Kr,preserveAspectRatio:Wr[Un]+" slice"}),rn=Qe.makeSvgSpan([bn[Un]],[Xn],f);if(zr===1)return{span:rn,minWidth:Fr,height:Hr};rn.style.height=Hr+"em",or.push(rn)}return{span:Qe.makeSpan(["stretchy"],or,f),minWidth:Fr,height:Hr}}}var g=d(),x=g.span,L=g.minWidth,W=g.height;return x.height=W,x.style.height=W+"em",L>0&&(x.style.minWidth=L+"em"),x},Yi=function(l,f,d,g){var x,L=l.height+l.depth+2*d;if(/fbox|color/.test(f)){if(x=Qe.makeSpan(["stretchy",f],[],g),f==="fbox"){var W=g.color&&g.getColor();W&&(x.style.borderColor=W)}}else{var ne=[];/^[bx]cancel$/.test(f)&&ne.push(new Ze({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(f)&&ne.push(new Ze({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var ge=new je(ne,{width:"100%",height:L+"em"});x=Qe.makeSvgSpan([],[ge],g)}return x.height=L,x.style.height=L+"em",x},Nn={encloseSpan:Yi,mathMLnode:qn,svgSpan:Wi},Gt=function(l,f){var d,g,x=Vr(l,"supsub"),L;x?(g=cr(x.base,"accent"),d=g.base,x.base=d,L=Pt(dr(x,f)),x.base=g):(g=cr(l,"accent"),d=g.base);var W=dr(d,f.havingCrampedStyle()),ne=g.isShifty&&M.isCharacterBox(d),ge=0;if(ne){var Le=M.getBaseElem(d),Ke=dr(Le,f.havingCrampedStyle());ge=mt(Ke).skew}var rt=Math.min(W.height,f.fontMetrics().xHeight),dt;if(g.isStretchy)dt=Nn.svgSpan(g,f),dt=Qe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:W},{type:"elem",elem:dt,wrapperClasses:["svg-align"],wrapperStyle:ge>0?{width:"calc(100% - "+2*ge+"em)",marginLeft:2*ge+"em"}:void 0}]},f);else{var Et,Mt;g.label==="\\vec"?(Et=Qe.staticSvg("vec",f),Mt=Qe.svgData.vec[1]):(Et=Qe.makeOrd({mode:g.mode,text:g.label},f,"textord"),Et=mt(Et),Et.italic=0,Mt=Et.width),dt=Qe.makeSpan(["accent-body"],[Et]);var Yt=g.label==="\\textcircled";Yt&&(dt.classes.push("accent-full"),rt=W.height);var Zt=ge;Yt||(Zt-=Mt/2),dt.style.left=Zt+"em",g.label==="\\textcircled"&&(dt.style.top=".2em"),dt=Qe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:W},{type:"kern",size:-rt},{type:"elem",elem:dt}]},f)}var or=Qe.makeSpan(["mord","accent"],[dt],f);return L?(L.children[0]=or,L.height=Math.max(or.height,L.height),L.classes[0]="mord",L):or},sr=function(l,f){var d=l.isStretchy?Nn.mathMLnode(l.label):new St.MathNode("mo",[hn(l.label,l.mode)]),g=new St.MathNode("mover",[ar(l.base,f),d]);return g.setAttribute("accent","true"),g},Or=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(R){return"\\"+R}).join("|"));Ht({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(l,f){var d=f[0],g=!Or.test(l.funcName),x=!g||l.funcName==="\\widehat"||l.funcName==="\\widetilde"||l.funcName==="\\widecheck";return{type:"accent",mode:l.parser.mode,label:l.funcName,isStretchy:g,isShifty:x,base:d}},htmlBuilder:Gt,mathmlBuilder:sr}),Ht({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!1},handler:function(l,f){var d=f[0];return{type:"accent",mode:l.parser.mode,label:l.funcName,isStretchy:!1,isShifty:!0,base:d}},htmlBuilder:Gt,mathmlBuilder:sr}),Ht({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"accentUnder",mode:d.mode,label:g,base:x}},htmlBuilder:function(l,f){var d=dr(l.base,f),g=Nn.svgSpan(l,f),x=l.label==="\\utilde"?.12:0,L=Qe.makeVList({positionType:"bottom",positionData:g.height+x,children:[{type:"elem",elem:g,wrapperClasses:["svg-align"]},{type:"kern",size:x},{type:"elem",elem:d}]},f);return Qe.makeSpan(["mord","accentunder"],[L],f)},mathmlBuilder:function(l,f){var d=Nn.mathMLnode(l.label),g=new St.MathNode("munder",[ar(l.base,f),d]);return g.setAttribute("accentunder","true"),g}});var fr=function(l){var f=new St.MathNode("mpadded",l?[l]:[]);return f.setAttribute("width","+0.6em"),f.setAttribute("lspace","0.3em"),f};Ht({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(l,f,d){var g=l.parser,x=l.funcName;return{type:"xArrow",mode:g.mode,label:x,body:f[0],below:d[0]}},htmlBuilder:function(l,f){var d=f.style,g=f.havingStyle(d.sup()),x=Qe.wrapFragment(dr(l.body,g,f),f);x.classes.push("x-arrow-pad");var L;l.below&&(g=f.havingStyle(d.sub()),L=Qe.wrapFragment(dr(l.below,g,f),f),L.classes.push("x-arrow-pad"));var W=Nn.svgSpan(l,f),ne=-f.fontMetrics().axisHeight+.5*W.height,ge=-f.fontMetrics().axisHeight-.5*W.height-.111;(x.depth>.25||l.label==="\\xleftequilibrium")&&(ge-=x.depth);var Le;if(L){var Ke=-f.fontMetrics().axisHeight+L.height+.5*W.height+.111;Le=Qe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:ge},{type:"elem",elem:W,shift:ne},{type:"elem",elem:L,shift:Ke}]},f)}else Le=Qe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:ge},{type:"elem",elem:W,shift:ne}]},f);return Le.children[0].children[0].children[1].classes.push("svg-align"),Qe.makeSpan(["mrel","x-arrow"],[Le],f)},mathmlBuilder:function(l,f){var d=Nn.mathMLnode(l.label),g;if(l.body){var x=fr(ar(l.body,f));if(l.below){var L=fr(ar(l.below,f));g=new St.MathNode("munderover",[d,L,x])}else g=new St.MathNode("mover",[d,x])}else if(l.below){var W=fr(ar(l.below,f));g=new St.MathNode("munder",[d,W])}else g=fr(),g=new St.MathNode("mover",[d,g]);return g}}),Ht({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){for(var d=l.parser,g=cr(f[0],"ordgroup"),x=g.body,L="",W=0;W<x.length;W++){var ne=cr(x[W],"textord");L+=ne.text}var ge=parseInt(L);if(isNaN(ge))throw new _("\\@char has non-numeric argument "+L);return{type:"textord",mode:d.mode,text:String.fromCharCode(ge)}}});var vr=function(l,f){var d=Zr(l.body,f.withColor(l.color),!1);return Qe.makeFragment(d)},si=function(l,f){var d=gn(l.body,f.withColor(l.color)),g=new St.MathNode("mstyle",d);return g.setAttribute("mathcolor",l.color),g};Ht({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(l,f){var d=l.parser,g=cr(f[0],"color-token").color,x=f[1];return{type:"color",mode:d.mode,color:g,body:Qr(x)}},htmlBuilder:vr,mathmlBuilder:si}),Ht({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(l,f){var d=l.parser,g=l.breakOnTokenText,x=cr(f[0],"color-token").color;d.gullet.macros.set("\\current@color",x);var L=d.parseExpression(!0,g);return{type:"color",mode:d.mode,color:x,body:L}},htmlBuilder:vr,mathmlBuilder:si}),Ht({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(l,f,d){var g=l.parser,x=l.funcName,L=d[0],W=x==="\\cr",ne=!1;return W||(g.settings.displayMode&&g.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")?ne=!1:ne=!0),{type:"cr",mode:g.mode,newLine:ne,newRow:W,size:L&&cr(L,"size").value}},htmlBuilder:function(l,f){if(l.newRow)throw new _("\\cr valid only within a tabular/array environment");var d=Qe.makeSpan(["mspace"],[],f);return l.newLine&&(d.classes.push("newline"),l.size&&(d.style.marginTop=br(l.size,f)+"em")),d},mathmlBuilder:function(l,f){var d=new St.MathNode("mspace");return l.newLine&&(d.setAttribute("linebreak","newline"),l.size&&d.setAttribute("height",br(l.size,f)+"em")),d}});var Zn=function(l,f,d){var g=Rt.math[l]&&Rt.math[l].replace,x=Ct(g||l,f,d);if(!x)throw new Error("Unsupported symbol "+l+" and font size "+f+".");return x},ai=function(l,f,d,g){var x=d.havingBaseStyle(f),L=Qe.makeSpan(g.concat(x.sizingClasses(d)),[l],d),W=x.sizeMultiplier/d.sizeMultiplier;return L.height*=W,L.depth*=W,L.maxFontSize=x.sizeMultiplier,L},Bi=function(l,f,d){var g=f.havingBaseStyle(d),x=(1-f.sizeMultiplier/g.sizeMultiplier)*f.fontMetrics().axisHeight;l.classes.push("delimcenter"),l.style.top=x+"em",l.height-=x,l.depth+=x},Eo=function(l,f,d,g,x,L){var W=Qe.makeSymbol(l,"Main-Regular",x,g),ne=ai(W,f,g,L);return d&&Bi(ne,g,f),ne},xo=function(l,f,d,g){return Qe.makeSymbol(l,"Size"+f+"-Regular",d,g)},Aa=function(l,f,d,g,x,L){var W=xo(l,f,x,g),ne=ai(Qe.makeSpan(["delimsizing","size"+f],[W],g),w.TEXT,g,L);return d&&Bi(ne,g,w.TEXT),ne},Ti=function(l,f,d){var g;f==="Size1-Regular"?g="delim-size1":g="delim-size4";var x=Qe.makeSpan(["delimsizinginner",g],[Qe.makeSpan([],[Qe.makeSymbol(l,f,d)])]);return{type:"elem",elem:x}},oi={type:"kern",size:-.005},Ai=function(l,f,d,g,x,L){var W,ne,ge,Le;W=ge=Le=l,ne=null;var Ke="Size1-Regular";l==="\\uparrow"?ge=Le="\u23D0":l==="\\Uparrow"?ge=Le="\u2016":l==="\\downarrow"?W=ge="\u23D0":l==="\\Downarrow"?W=ge="\u2016":l==="\\updownarrow"?(W="\\uparrow",ge="\u23D0",Le="\\downarrow"):l==="\\Updownarrow"?(W="\\Uparrow",ge="\u2016",Le="\\Downarrow"):l==="["||l==="\\lbrack"?(W="\u23A1",ge="\u23A2",Le="\u23A3",Ke="Size4-Regular"):l==="]"||l==="\\rbrack"?(W="\u23A4",ge="\u23A5",Le="\u23A6",Ke="Size4-Regular"):l==="\\lfloor"||l==="\u230A"?(ge=W="\u23A2",Le="\u23A3",Ke="Size4-Regular"):l==="\\lceil"||l==="\u2308"?(W="\u23A1",ge=Le="\u23A2",Ke="Size4-Regular"):l==="\\rfloor"||l==="\u230B"?(ge=W="\u23A5",Le="\u23A6",Ke="Size4-Regular"):l==="\\rceil"||l==="\u2309"?(W="\u23A4",ge=Le="\u23A5",Ke="Size4-Regular"):l==="("||l==="\\lparen"?(W="\u239B",ge="\u239C",Le="\u239D",Ke="Size4-Regular"):l===")"||l==="\\rparen"?(W="\u239E",ge="\u239F",Le="\u23A0",Ke="Size4-Regular"):l==="\\{"||l==="\\lbrace"?(W="\u23A7",ne="\u23A8",Le="\u23A9",ge="\u23AA",Ke="Size4-Regular"):l==="\\}"||l==="\\rbrace"?(W="\u23AB",ne="\u23AC",Le="\u23AD",ge="\u23AA",Ke="Size4-Regular"):l==="\\lgroup"||l==="\u27EE"?(W="\u23A7",Le="\u23A9",ge="\u23AA",Ke="Size4-Regular"):l==="\\rgroup"||l==="\u27EF"?(W="\u23AB",Le="\u23AD",ge="\u23AA",Ke="Size4-Regular"):l==="\\lmoustache"||l==="\u23B0"?(W="\u23A7",Le="\u23AD",ge="\u23AA",Ke="Size4-Regular"):(l==="\\rmoustache"||l==="\u23B1")&&(W="\u23AB",Le="\u23A9",ge="\u23AA",Ke="Size4-Regular");var rt=Zn(W,Ke,x),dt=rt.height+rt.depth,Et=Zn(ge,Ke,x),Mt=Et.height+Et.depth,Yt=Zn(Le,Ke,x),Zt=Yt.height+Yt.depth,or=0,gr=1;if(ne!==null){var Gr=Zn(ne,Ke,x);or=Gr.height+Gr.depth,gr=2}var Fr=dt+Zt+or,Kr=Math.max(0,Math.ceil((f-Fr)/(gr*Mt))),Hr=Fr+Kr*gr*Mt,zr=g.fontMetrics().axisHeight;d&&(zr*=g.sizeMultiplier);var bn=Hr/2-zr,Wr=(Kr+1)*.005-Mt,Me=[];if(Me.push(Ti(Le,Ke,x)),ne===null)for(var Un=0;Un<Kr;Un++)Me.push(oi),Me.push(Ti(ge,Ke,x));else{for(var ci=0;ci<Kr;ci++)Me.push(oi),Me.push(Ti(ge,Ke,x));Me.push({type:"kern",size:Wr}),Me.push(Ti(ge,Ke,x)),Me.push(oi),Me.push(Ti(ne,Ke,x));for(var Xn=0;Xn<Kr;Xn++)Me.push(oi),Me.push(Ti(ge,Ke,x))}Me.push({type:"kern",size:Wr}),Me.push(Ti(ge,Ke,x)),Me.push(oi),Me.push(Ti(W,Ke,x));var rn=g.havingBaseStyle(w.TEXT),$i=Qe.makeVList({positionType:"bottom",positionData:bn,children:Me},rn);return ai(Qe.makeSpan(["delimsizing","mult"],[$i],rn),w.TEXT,g,L)},Ys=80,Cs=.08,qs=function(l,f,d,g,x){var L=nt(l,g,d),W=new Ge(l,L),ne=new je([W],{width:"400em",height:f+"em",viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});return Qe.makeSvgSpan(["hide-tail"],[ne],x)},Da=function(l,f){var d=f.havingBaseSizing(),g=Qs("\\surd",l*d.sizeMultiplier,Xs,d),x=d.sizeMultiplier,L=Math.max(0,f.minRuleThickness-f.fontMetrics().sqrtRuleThickness),W,ne=0,ge=0,Le=0,Ke;return g.type==="small"?(Le=1e3+1e3*L+Ys,l<1?x=1:l<1.4&&(x=.7),ne=(1+L+Cs)/x,ge=(1+L)/x,W=qs("sqrtMain",ne,Le,L,f),W.style.minWidth="0.853em",Ke=.833/x):g.type==="large"?(Le=(1e3+Ys)*Rs[g.size],ge=(Rs[g.size]+L)/x,ne=(Rs[g.size]+L+Cs)/x,W=qs("sqrtSize"+g.size,ne,Le,L,f),W.style.minWidth="1.02em",Ke=1/x):(ne=l+L+Cs,ge=l+L,Le=Math.floor(1e3*l+L)+Ys,W=qs("sqrtTall",ne,Le,L,f),W.style.minWidth="0.742em",Ke=1.056),W.height=ge,W.style.height=ne+"em",{span:W,advanceWidth:Ke,ruleWidth:(f.fontMetrics().sqrtRuleThickness+L)*x}},Zs=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],wo=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],Ls=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Rs=[0,1.2,1.8,2.4,3],li=function(l,f,d,g,x){if(l==="<"||l==="\\lt"||l==="\u27E8"?l="\\langle":(l===">"||l==="\\gt"||l==="\u27E9")&&(l="\\rangle"),M.contains(Zs,l)||M.contains(Ls,l))return Aa(l,f,!1,d,g,x);if(M.contains(wo,l))return Ai(l,Rs[f],!1,d,g,x);throw new _("Illegal delimiter: '"+l+"'")},ka=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],So=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"stack"}],Xs=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Ca=function(l){if(l.type==="small")return"Main-Regular";if(l.type==="large")return"Size"+l.size+"-Regular";if(l.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+l.type+"' here.")},Qs=function(l,f,d,g){for(var x=Math.min(2,3-g.style.size),L=x;L<d.length&&d[L].type!=="stack";L++){var W=Zn(l,Ca(d[L]),"math"),ne=W.height+W.depth;if(d[L].type==="small"){var ge=g.havingBaseStyle(d[L].style);ne*=ge.sizeMultiplier}if(ne>f)return d[L]}return d[d.length-1]},Js=function(l,f,d,g,x,L){l==="<"||l==="\\lt"||l==="\u27E8"?l="\\langle":(l===">"||l==="\\gt"||l==="\u27E9")&&(l="\\rangle");var W;M.contains(Ls,l)?W=ka:M.contains(Zs,l)?W=Xs:W=So;var ne=Qs(l,f,W,g);return ne.type==="small"?Eo(l,ne.style,d,g,x,L):ne.type==="large"?Aa(l,ne.size,d,g,x,L):Ai(l,f,d,g,x,L)},To=function(l,f,d,g,x,L){var W=g.fontMetrics().axisHeight*g.sizeMultiplier,ne=901,ge=5/g.fontMetrics().ptPerEm,Le=Math.max(f-W,d+W),Ke=Math.max(Le/500*ne,2*Le-ge);return Js(l,Ke,!0,g,x,L)},ui={sqrtImage:Da,sizedDelim:li,customSizedDelim:Js,leftRightDelim:To},ea={"\\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}},La=["(","\\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 Hn(R,l){var f=wn(R);if(f&&M.contains(La,f.text))return f;throw new _("Invalid delimiter: '"+(f?f.text:JSON.stringify(R))+"' after '"+l.funcName+"'",R)}Ht({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1},handler:function(l,f){var d=Hn(f[0],l);return{type:"delimsizing",mode:l.parser.mode,size:ea[l.funcName].size,mclass:ea[l.funcName].mclass,delim:d.text}},htmlBuilder:function(l,f){return l.delim==="."?Qe.makeSpan([l.mclass]):ui.sizedDelim(l.delim,l.size,f,l.mode,[l.mclass])},mathmlBuilder:function(l){var f=[];l.delim!=="."&&f.push(hn(l.delim,l.mode));var d=new St.MathNode("mo",f);return l.mclass==="mopen"||l.mclass==="mclose"?d.setAttribute("fence","true"):d.setAttribute("fence","false"),d}});function ta(R){if(!R.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ht({type:"leftright-right",names:["\\right"],props:{numArgs:1},handler:function(l,f){var d=l.parser.gullet.macros.get("\\current@color");if(d&&typeof d!="string")throw new _("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:l.parser.mode,delim:Hn(f[0],l).text,color:d}}}),Ht({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(l,f){var d=Hn(f[0],l),g=l.parser;++g.leftrightDepth;var x=g.parseExpression(!1);--g.leftrightDepth,g.expect("\\right",!1);var L=cr(g.parseFunction(),"leftright-right");return{type:"leftright",mode:g.mode,body:x,left:d.text,right:L.delim,rightColor:L.color}},htmlBuilder:function(l,f){ta(l);for(var d=Zr(l.body,f,!0,["mopen","mclose"]),g=0,x=0,L=!1,W=0;W<d.length;W++)d[W].isMiddle?L=!0:(g=Math.max(d[W].height,g),x=Math.max(d[W].depth,x));g*=f.sizeMultiplier,x*=f.sizeMultiplier;var ne;if(l.left==="."?ne=Ln(f,["mopen"]):ne=ui.leftRightDelim(l.left,g,x,f,l.mode,["mopen"]),d.unshift(ne),L)for(var ge=1;ge<d.length;ge++){var Le=d[ge],Ke=Le.isMiddle;Ke&&(d[ge]=ui.leftRightDelim(Ke.delim,g,x,Ke.options,l.mode,[]))}var rt;if(l.right===".")rt=Ln(f,["mclose"]);else{var dt=l.rightColor?f.withColor(l.rightColor):f;rt=ui.leftRightDelim(l.right,g,x,dt,l.mode,["mclose"])}return d.push(rt),Qe.makeSpan(["minner"],d,f)},mathmlBuilder:function(l,f){ta(l);var d=gn(l.body,f);if(l.left!=="."){var g=new St.MathNode("mo",[hn(l.left,l.mode)]);g.setAttribute("fence","true"),d.unshift(g)}if(l.right!=="."){var x=new St.MathNode("mo",[hn(l.right,l.mode)]);x.setAttribute("fence","true"),l.rightColor&&x.setAttribute("mathcolor",l.rightColor),d.push(x)}return Ii(d)}}),Ht({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(l,f){var d=Hn(f[0],l);if(!l.parser.leftrightDepth)throw new _("\\middle without preceding \\left",d);return{type:"middle",mode:l.parser.mode,delim:d.text}},htmlBuilder:function(l,f){var d;if(l.delim===".")d=Ln(f,[]);else{d=ui.sizedDelim(l.delim,1,f,l.mode,[]);var g={delim:l.delim,options:f};d.isMiddle=g}return d},mathmlBuilder:function(l,f){var d=l.delim==="\\vert"||l.delim==="|"?hn("|","text"):hn(l.delim,l.mode),g=new St.MathNode("mo",[d]);return g.setAttribute("fence","true"),g.setAttribute("lspace","0.05em"),g.setAttribute("rspace","0.05em"),g}});var gs=function(l,f){var d=Qe.wrapFragment(dr(l.body,f),f),g=l.label.substr(1),x=f.sizeMultiplier,L,W=0,ne=M.isCharacterBox(l.body);if(g==="sout")L=Qe.makeSpan(["stretchy","sout"]),L.height=f.fontMetrics().defaultRuleThickness/x,W=-.5*f.fontMetrics().xHeight;else{/cancel/.test(g)?ne||d.classes.push("cancel-pad"):d.classes.push("boxpad");var ge=0,Le=0;/box/.test(g)?(Le=Math.max(f.fontMetrics().fboxrule,f.minRuleThickness),ge=f.fontMetrics().fboxsep+(g==="colorbox"?0:Le)):ge=ne?.2:0,L=Nn.encloseSpan(d,g,ge,f),/fbox|boxed|fcolorbox/.test(g)&&(L.style.borderStyle="solid",L.style.borderWidth=Le+"em"),W=d.depth+ge,l.backgroundColor&&(L.style.backgroundColor=l.backgroundColor,l.borderColor&&(L.style.borderColor=l.borderColor))}var Ke;return l.backgroundColor?Ke=Qe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:L,shift:W},{type:"elem",elem:d,shift:0}]},f):Ke=Qe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:0},{type:"elem",elem:L,shift:W,wrapperClasses:/cancel/.test(g)?["svg-align"]:[]}]},f),/cancel/.test(g)&&(Ke.height=d.height,Ke.depth=d.depth),/cancel/.test(g)&&!ne?Qe.makeSpan(["mord","cancel-lap"],[Ke],f):Qe.makeSpan(["mord"],[Ke],f)},Is=function(l,f){var d=0,g=new St.MathNode(l.label.indexOf("colorbox")>-1?"mpadded":"menclose",[ar(l.body,f)]);switch(l.label){case"\\cancel":g.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":g.setAttribute("notation","downdiagonalstrike");break;case"\\sout":g.setAttribute("notation","horizontalstrike");break;case"\\fbox":g.setAttribute("notation","box");break;case"\\fcolorbox":case"\\colorbox":if(d=f.fontMetrics().fboxsep*f.fontMetrics().ptPerEm,g.setAttribute("width","+"+2*d+"pt"),g.setAttribute("height","+"+2*d+"pt"),g.setAttribute("lspace",d+"pt"),g.setAttribute("voffset",d+"pt"),l.label==="\\fcolorbox"){var x=Math.max(f.fontMetrics().fboxrule,f.minRuleThickness);g.setAttribute("style","border: "+x+"em solid "+String(l.borderColor))}break;case"\\xcancel":g.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return l.backgroundColor&&g.setAttribute("mathbackground",l.backgroundColor),g};Ht({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(l,f,d){var g=l.parser,x=l.funcName,L=cr(f[0],"color-token").color,W=f[1];return{type:"enclose",mode:g.mode,label:x,backgroundColor:L,body:W}},htmlBuilder:gs,mathmlBuilder:Is}),Ht({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(l,f,d){var g=l.parser,x=l.funcName,L=cr(f[0],"color-token").color,W=cr(f[1],"color-token").color,ne=f[2];return{type:"enclose",mode:g.mode,label:x,backgroundColor:W,borderColor:L,body:ne}},htmlBuilder:gs,mathmlBuilder:Is}),Ht({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(l,f){var d=l.parser;return{type:"enclose",mode:d.mode,label:"\\fbox",body:f[0]}}}),Ht({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(l,f,d){var g=l.parser,x=l.funcName,L=f[0];return{type:"enclose",mode:g.mode,label:x,body:L}},htmlBuilder:gs,mathmlBuilder:Is});var Ra={};function Ni(R){for(var l=R.type,f=R.names,d=R.props,g=R.handler,x=R.htmlBuilder,L=R.mathmlBuilder,W={type:l,numArgs:d.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:g},ne=0;ne<f.length;++ne)Ra[f[ne]]=W;x&&(Wn[l]=x),L&&(fn[l]=L)}function Ia(R){var l=[];R.consumeSpaces();for(var f=R.fetch().text;f==="\\hline"||f==="\\hdashline";)R.consume(),l.push(f==="\\hdashline"),R.consumeSpaces(),f=R.fetch().text;return l}function qi(R,l,f){var d=l.hskipBeforeAndAfter,g=l.addJot,x=l.cols,L=l.arraystretch,W=l.colSeparationType;if(R.gullet.beginGroup(),R.gullet.macros.set("\\\\","\\cr"),!L){var ne=R.gullet.expandMacroAsText("\\arraystretch");if(ne==null)L=1;else if(L=parseFloat(ne),!L||L<0)throw new _("Invalid \\arraystretch: "+ne)}R.gullet.beginGroup();var ge=[],Le=[ge],Ke=[],rt=[];for(rt.push(Ia(R));;){var dt=R.parseExpression(!1,"\\cr");R.gullet.endGroup(),R.gullet.beginGroup(),dt={type:"ordgroup",mode:R.mode,body:dt},f&&(dt={type:"styling",mode:R.mode,style:f,body:[dt]}),ge.push(dt);var Et=R.fetch().text;if(Et==="&")R.consume();else if(Et==="\\end"){ge.length===1&&dt.type==="styling"&&dt.body[0].body.length===0&&Le.pop(),rt.length<Le.length+1&&rt.push([]);break}else if(Et==="\\cr"){var Mt=cr(R.parseFunction(),"cr");Ke.push(Mt.size),rt.push(Ia(R)),ge=[],Le.push(ge)}else throw new _("Expected & or \\\\ or \\cr or \\end",R.nextToken)}return R.gullet.endGroup(),R.gullet.endGroup(),{type:"array",mode:R.mode,addJot:g,arraystretch:L,body:Le,cols:x,rowGaps:Ke,hskipBeforeAndAfter:d,hLinesBeforeRow:rt,colSeparationType:W}}function Ps(R){return R.substr(0,1)==="d"?"display":"text"}var Di=function(l,f){var d,g,x=l.body.length,L=l.hLinesBeforeRow,W=0,ne=new Array(x),ge=[],Le=Math.max(f.fontMetrics().arrayRuleWidth,f.minRuleThickness),Ke=1/f.fontMetrics().ptPerEm,rt=5*Ke;if(l.colSeparationType&&l.colSeparationType==="small"){var dt=f.havingStyle(w.SCRIPT).sizeMultiplier;rt=.2778*(dt/f.sizeMultiplier)}var Et=12*Ke,Mt=3*Ke,Yt=l.arraystretch*Et,Zt=.7*Yt,or=.3*Yt,gr=0;function Gr(ws){for(var Gs=0;Gs<ws.length;++Gs)Gs>0&&(gr+=.25),ge.push({pos:gr,isDashed:ws[Gs]})}for(Gr(L[0]),d=0;d<l.body.length;++d){var Fr=l.body[d],Kr=Zt,Hr=or;W<Fr.length&&(W=Fr.length);var zr=new Array(Fr.length);for(g=0;g<Fr.length;++g){var bn=dr(Fr[g],f);Hr<bn.depth&&(Hr=bn.depth),Kr<bn.height&&(Kr=bn.height),zr[g]=bn}var Wr=l.rowGaps[d],Me=0;Wr&&(Me=br(Wr,f),Me>0&&(Me+=or,Hr<Me&&(Hr=Me),Me=0)),l.addJot&&(Hr+=Mt),zr.height=Kr,zr.depth=Hr,gr+=Kr,zr.pos=gr,gr+=Hr+Me,ne[d]=zr,Gr(L[d+1])}var Un=gr/2+f.fontMetrics().axisHeight,ci=l.cols||[],Xn=[],rn,$i;for(g=0,$i=0;g<W||$i<ci.length;++g,++$i){for(var fi=ci[$i]||{},no=!0;fi.type==="separator";){if(no||(rn=Qe.makeSpan(["arraycolsep"],[]),rn.style.width=f.fontMetrics().doubleRuleSep+"em",Xn.push(rn)),fi.separator==="|"||fi.separator===":"){var Bo=fi.separator==="|"?"solid":"dashed",hs=Qe.makeSpan(["vertical-separator"],[],f);hs.style.height=gr+"em",hs.style.borderRightWidth=Le+"em",hs.style.borderRightStyle=Bo,hs.style.margin="0 -"+Le/2+"em",hs.style.verticalAlign=-(gr-Un)+"em",Xn.push(hs)}else throw new _("Invalid separator type: "+fi.separator);$i++,fi=ci[$i]||{},no=!1}if(!(g>=W)){var cs=void 0;(g>0||l.hskipBeforeAndAfter)&&(cs=M.deflt(fi.pregap,rt),cs!==0&&(rn=Qe.makeSpan(["arraycolsep"],[]),rn.style.width=cs+"em",Xn.push(rn)));var Qn=[];for(d=0;d<x;++d){var fs=ne[d],xs=fs[g];if(xs){var $s=fs.pos-Un;xs.depth=fs.depth,xs.height=fs.height,Qn.push({type:"elem",elem:xs,shift:$s})}}Qn=Qe.makeVList({positionType:"individualShift",children:Qn},f),Qn=Qe.makeSpan(["col-align-"+(fi.align||"c")],[Qn]),Xn.push(Qn),(g<W-1||l.hskipBeforeAndAfter)&&(cs=M.deflt(fi.postgap,rt),cs!==0&&(rn=Qe.makeSpan(["arraycolsep"],[]),rn.style.width=cs+"em",Xn.push(rn)))}}if(ne=Qe.makeSpan(["mtable"],Xn),ge.length>0){for(var $n=Qe.makeLineSpan("hline",f,Le),No=Qe.makeLineSpan("hdashline",f,Le),zs=[{type:"elem",elem:ne,shift:0}];ge.length>0;){var ba=ge.pop(),io=ba.pos-Un;ba.isDashed?zs.push({type:"elem",elem:No,shift:io}):zs.push({type:"elem",elem:$n,shift:io})}ne=Qe.makeVList({positionType:"individualShift",children:zs},f)}return Qe.makeSpan(["mord"],[ne],f)},ra={c:"center ",l:"left ",r:"right "},ki=function(l,f){var d=new St.MathNode("mtable",l.body.map(function(gr){return new St.MathNode("mtr",gr.map(function(Gr){return new St.MathNode("mtd",[ar(Gr,f)])}))})),g=l.arraystretch===.5?.1:.16+l.arraystretch-1+(l.addJot?.09:0);d.setAttribute("rowspacing",g+"em");var x="",L="";if(l.cols){var W=l.cols,ne="",ge=!1,Le=0,Ke=W.length;W[0].type==="separator"&&(x+="top ",Le=1),W[W.length-1].type==="separator"&&(x+="bottom ",Ke-=1);for(var rt=Le;rt<Ke;rt++)W[rt].type==="align"?(L+=ra[W[rt].align],ge&&(ne+="none "),ge=!0):W[rt].type==="separator"&&ge&&(ne+=W[rt].separator==="|"?"solid ":"dashed ",ge=!1);d.setAttribute("columnalign",L.trim()),/[sd]/.test(ne)&&d.setAttribute("columnlines",ne.trim())}if(l.colSeparationType==="align"){for(var dt=l.cols||[],Et="",Mt=1;Mt<dt.length;Mt++)Et+=Mt%2?"0em ":"1em ";d.setAttribute("columnspacing",Et.trim())}else l.colSeparationType==="alignat"?d.setAttribute("columnspacing","0em"):l.colSeparationType==="small"?d.setAttribute("columnspacing","0.2778em"):d.setAttribute("columnspacing","1em");var Yt="",Zt=l.hLinesBeforeRow;x+=Zt[0].length>0?"left ":"",x+=Zt[Zt.length-1].length>0?"right ":"";for(var or=1;or<Zt.length-1;or++)Yt+=Zt[or].length===0?"none ":Zt[or][0]?"dashed ":"solid ";return/[sd]/.test(Yt)&&d.setAttribute("rowlines",Yt.trim()),x!==""&&(d=new St.MathNode("menclose",[d]),d.setAttribute("notation",x.trim())),l.arraystretch&&l.arraystretch<1&&(d=new St.MathNode("mstyle",[d]),d.setAttribute("scriptlevel","1")),d},na=function(l,f){var d=[],g=qi(l.parser,{cols:d,addJot:!0},"display"),x,L=0,W={type:"ordgroup",mode:l.mode,body:[]},ne=Vr(f[0],"ordgroup");if(ne){for(var ge="",Le=0;Le<ne.body.length;Le++){var Ke=cr(ne.body[Le],"textord");ge+=Ke.text}x=Number(ge),L=x*2}var rt=!L;g.body.forEach(function(Yt){for(var Zt=1;Zt<Yt.length;Zt+=2){var or=cr(Yt[Zt],"styling"),gr=cr(or.body[0],"ordgroup");gr.body.unshift(W)}if(rt)L<Yt.length&&(L=Yt.length);else{var Gr=Yt.length/2;if(x<Gr)throw new _("Too many math in a row: "+("expected "+x+", but got "+Gr),Yt[0])}});for(var dt=0;dt<L;++dt){var Et="r",Mt=0;dt%2===1?Et="l":dt>0&&rt&&(Mt=1),d[dt]={type:"align",align:Et,pregap:Mt,postgap:0}}return g.colSeparationType=rt?"align":"alignat",g};Ni({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(l,f){var d=wn(f[0]),g=d?[f[0]]:cr(f[0],"ordgroup").body,x=g.map(function(W){var ne=Vn(W),ge=ne.text;if("lcr".indexOf(ge)!==-1)return{type:"align",align:ge};if(ge==="|")return{type:"separator",separator:"|"};if(ge===":")return{type:"separator",separator:":"};throw new _("Unknown column alignment: "+ge,W)}),L={cols:x,hskipBeforeAndAfter:!0};return qi(l.parser,L,Ps(l.envName))},htmlBuilder:Di,mathmlBuilder:ki}),Ni({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"],props:{numArgs:0},handler:function(l){var f={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[l.envName],d={hskipBeforeAndAfter:!1},g=qi(l.parser,d,Ps(l.envName));return f?{type:"leftright",mode:l.mode,body:[g],left:f[0],right:f[1],rightColor:void 0}:g},htmlBuilder:Di,mathmlBuilder:ki}),Ni({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(l){var f={arraystretch:.5},d=qi(l.parser,f,"script");return d.colSeparationType="small",d},htmlBuilder:Di,mathmlBuilder:ki}),Ni({type:"array",names:["subarray"],props:{numArgs:1},handler:function(l,f){var d=wn(f[0]),g=d?[f[0]]:cr(f[0],"ordgroup").body,x=g.map(function(W){var ne=Vn(W),ge=ne.text;if("lc".indexOf(ge)!==-1)return{type:"align",align:ge};throw new _("Unknown column alignment: "+ge,W)});if(x.length>1)throw new _("{subarray} can contain only one column");var L={cols:x,hskipBeforeAndAfter:!1,arraystretch:.5};if(L=qi(l.parser,L,"script"),L.body[0].length>1)throw new _("{subarray} can contain only one column");return L},htmlBuilder:Di,mathmlBuilder:ki}),Ni({type:"array",names:["cases","dcases"],props:{numArgs:0},handler:function(l){var f={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},d=qi(l.parser,f,Ps(l.envName));return{type:"leftright",mode:l.mode,body:[d],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:Di,mathmlBuilder:ki}),Ni({type:"array",names:["aligned"],props:{numArgs:0},handler:na,htmlBuilder:Di,mathmlBuilder:ki}),Ni({type:"array",names:["gathered"],props:{numArgs:0},handler:function(l){var f={cols:[{type:"align",align:"c"}],addJot:!0};return qi(l.parser,f,"display")},htmlBuilder:Di,mathmlBuilder:ki}),Ni({type:"array",names:["alignedat"],props:{numArgs:1},handler:na,htmlBuilder:Di,mathmlBuilder:ki}),Ht({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(l,f){throw new _(l.funcName+" valid only within array environment")}});var Pa=Ra,ia=Pa;Ht({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];if(x.type!=="ordgroup")throw new _("Invalid environment name",x);for(var L="",W=0;W<x.body.length;++W)L+=cr(x.body[W],"textord").text;if(g==="\\begin"){if(!ia.hasOwnProperty(L))throw new _("No such environment: "+L,x);var ne=ia[L],ge=d.parseArguments("\\begin{"+L+"}",ne),Le=ge.args,Ke=ge.optArgs,rt={mode:d.mode,envName:L,parser:d},dt=ne.handler(rt,Le,Ke);d.expect("\\end",!1);var Et=d.nextToken,Mt=cr(d.parseFunction(),"environment");if(Mt.name!==L)throw new _("Mismatch: \\begin{"+L+"} matched by \\end{"+Mt.name+"}",Et);return dt}return{type:"environment",mode:d.mode,name:L,nameGroup:x}}});var Oa=Qe.makeSpan;function Ma(R,l){var f=Zr(R.body,l,!0);return Oa([R.mclass],f,l)}function sa(R,l){var f,d=gn(R.body,l);return R.mclass==="minner"?St.newDocumentFragment(d):(R.mclass==="mord"?R.isCharacterBox?(f=d[0],f.type="mi"):f=new St.MathNode("mi",d):(R.isCharacterBox?(f=d[0],f.type="mo"):f=new St.MathNode("mo",d),R.mclass==="mbin"?(f.attributes.lspace="0.22em",f.attributes.rspace="0.22em"):R.mclass==="mpunct"?(f.attributes.lspace="0em",f.attributes.rspace="0.17em"):(R.mclass==="mopen"||R.mclass==="mclose")&&(f.attributes.lspace="0em",f.attributes.rspace="0em")),f)}Ht({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"mclass",mode:d.mode,mclass:"m"+g.substr(5),body:Qr(x),isCharacterBox:M.isCharacterBox(x)}},htmlBuilder:Ma,mathmlBuilder:sa});var Zi=function(l){var f=l.type==="ordgroup"&&l.body.length?l.body[0]:l;return f.type==="atom"&&(f.family==="bin"||f.family==="rel")?"m"+f.family:"mord"};Ht({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(l,f){var d=l.parser;return{type:"mclass",mode:d.mode,mclass:Zi(f[0]),body:[f[1]],isCharacterBox:M.isCharacterBox(f[1])}}}),Ht({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[1],L=f[0],W;g!=="\\stackrel"?W=Zi(x):W="mrel";var ne={type:"op",mode:x.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:g!=="\\stackrel",body:Qr(x)},ge={type:"supsub",mode:L.mode,base:ne,sup:g==="\\underset"?null:L,sub:g==="\\underset"?L:null};return{type:"mclass",mode:d.mode,mclass:W,body:[ge],isCharacterBox:M.isCharacterBox(ge)}},htmlBuilder:Ma,mathmlBuilder:sa});var Fa=function(l,f){var d=l.font,g=f.withFont(d);return dr(l.body,g)},aa=function(l,f){var d=l.font,g=f.withFont(d);return ar(l.body,g)},oa={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Ht({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,greediness:2},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0],L=g;return L in oa&&(L=oa[L]),{type:"font",mode:d.mode,font:L.slice(1),body:x}},htmlBuilder:Fa,mathmlBuilder:aa}),Ht({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(l,f){var d=l.parser,g=f[0],x=M.isCharacterBox(g);return{type:"mclass",mode:d.mode,mclass:Zi(g),body:[{type:"font",mode:d.mode,font:"boldsymbol",body:g}],isCharacterBox:x}}}),Ht({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=l.breakOnTokenText,L=d.mode,W=d.parseExpression(!0,x),ne="math"+g.slice(1);return{type:"font",mode:L,font:ne,body:{type:"ordgroup",mode:d.mode,body:W}}},htmlBuilder:Fa,mathmlBuilder:aa});var Ba=function(l,f){var d=f;return l==="display"?d=d.id>=w.SCRIPT.id?d.text():w.DISPLAY:l==="text"&&d.size===w.DISPLAY.size?d=w.TEXT:l==="script"?d=w.SCRIPT:l==="scriptscript"&&(d=w.SCRIPTSCRIPT),d},Os=function(l,f){var d=Ba(l.size,f.style),g=d.fracNum(),x=d.fracDen(),L;L=f.havingStyle(g);var W=dr(l.numer,L,f);if(l.continued){var ne=8.5/f.fontMetrics().ptPerEm,ge=3.5/f.fontMetrics().ptPerEm;W.height=W.height<ne?ne:W.height,W.depth=W.depth<ge?ge:W.depth}L=f.havingStyle(x);var Le=dr(l.denom,L,f),Ke,rt,dt;l.hasBarLine?(l.barSize?(rt=br(l.barSize,f),Ke=Qe.makeLineSpan("frac-line",f,rt)):Ke=Qe.makeLineSpan("frac-line",f),rt=Ke.height,dt=Ke.height):(Ke=null,rt=0,dt=f.fontMetrics().defaultRuleThickness);var Et,Mt,Yt;d.size===w.DISPLAY.size||l.size==="display"?(Et=f.fontMetrics().num1,rt>0?Mt=3*dt:Mt=7*dt,Yt=f.fontMetrics().denom1):(rt>0?(Et=f.fontMetrics().num2,Mt=dt):(Et=f.fontMetrics().num3,Mt=3*dt),Yt=f.fontMetrics().denom2);var Zt;if(Ke){var gr=f.fontMetrics().axisHeight;Et-W.depth-(gr+.5*rt)<Mt&&(Et+=Mt-(Et-W.depth-(gr+.5*rt))),gr-.5*rt-(Le.height-Yt)<Mt&&(Yt+=Mt-(gr-.5*rt-(Le.height-Yt)));var Gr=-(gr-.5*rt);Zt=Qe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Le,shift:Yt},{type:"elem",elem:Ke,shift:Gr},{type:"elem",elem:W,shift:-Et}]},f)}else{var or=Et-W.depth-(Le.height-Yt);or<Mt&&(Et+=.5*(Mt-or),Yt+=.5*(Mt-or)),Zt=Qe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Le,shift:Yt},{type:"elem",elem:W,shift:-Et}]},f)}L=f.havingStyle(d),Zt.height*=L.sizeMultiplier/f.sizeMultiplier,Zt.depth*=L.sizeMultiplier/f.sizeMultiplier;var Fr;d.size===w.DISPLAY.size?Fr=f.fontMetrics().delim1:Fr=f.fontMetrics().delim2;var Kr,Hr;return l.leftDelim==null?Kr=Ln(f,["mopen"]):Kr=ui.customSizedDelim(l.leftDelim,Fr,!0,f.havingStyle(d),l.mode,["mopen"]),l.continued?Hr=Qe.makeSpan([]):l.rightDelim==null?Hr=Ln(f,["mclose"]):Hr=ui.customSizedDelim(l.rightDelim,Fr,!0,f.havingStyle(d),l.mode,["mclose"]),Qe.makeSpan(["mord"].concat(L.sizingClasses(f)),[Kr,Qe.makeSpan(["mfrac"],[Zt]),Hr],f)},ss=function(l,f){var d=new St.MathNode("mfrac",[ar(l.numer,f),ar(l.denom,f)]);if(!l.hasBarLine)d.setAttribute("linethickness","0px");else if(l.barSize){var g=br(l.barSize,f);d.setAttribute("linethickness",g+"em")}var x=Ba(l.size,f.style);if(x.size!==f.style.size){d=new St.MathNode("mstyle",[d]);var L=x.size===w.DISPLAY.size?"true":"false";d.setAttribute("displaystyle",L),d.setAttribute("scriptlevel","0")}if(l.leftDelim!=null||l.rightDelim!=null){var W=[];if(l.leftDelim!=null){var ne=new St.MathNode("mo",[new St.TextNode(l.leftDelim.replace("\\",""))]);ne.setAttribute("fence","true"),W.push(ne)}if(W.push(d),l.rightDelim!=null){var ge=new St.MathNode("mo",[new St.TextNode(l.rightDelim.replace("\\",""))]);ge.setAttribute("fence","true"),W.push(ge)}return Ii(W)}return d};Ht({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,greediness:2},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0],L=f[1],W,ne=null,ge=null,Le="auto";switch(g){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":W=!0;break;case"\\\\atopfrac":W=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":W=!1,ne="(",ge=")";break;case"\\\\bracefrac":W=!1,ne="\\{",ge="\\}";break;case"\\\\brackfrac":W=!1,ne="[",ge="]";break;default:throw new Error("Unrecognized genfrac command")}switch(g){case"\\cfrac":case"\\dfrac":case"\\dbinom":Le="display";break;case"\\tfrac":case"\\tbinom":Le="text";break}return{type:"genfrac",mode:d.mode,continued:g==="\\cfrac",numer:x,denom:L,hasBarLine:W,leftDelim:ne,rightDelim:ge,size:Le,barSize:null}},htmlBuilder:Os,mathmlBuilder:ss}),Ht({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(l){var f=l.parser,d=l.funcName,g=l.token,x;switch(d){case"\\over":x="\\frac";break;case"\\choose":x="\\binom";break;case"\\atop":x="\\\\atopfrac";break;case"\\brace":x="\\\\bracefrac";break;case"\\brack":x="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:f.mode,replaceWith:x,token:g}}});var vn=["display","text","script","scriptscript"],Sn=function(l){var f=null;return l.length>0&&(f=l,f=f==="."?null:f),f};Ht({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(l,f){var d=l.parser,g=f[4],x=f[5],L=Vr(f[0],"atom");L&&(L=yi(f[0],"open"));var W=L?Sn(L.text):null,ne=Vr(f[1],"atom");ne&&(ne=yi(f[1],"close"));var ge=ne?Sn(ne.text):null,Le=cr(f[2],"size"),Ke,rt=null;Le.isBlank?Ke=!0:(rt=Le.value,Ke=rt.number>0);var dt="auto",Et=Vr(f[3],"ordgroup");if(Et){if(Et.body.length>0){var Mt=cr(Et.body[0],"textord");dt=vn[Number(Mt.text)]}}else Et=cr(f[3],"textord"),dt=vn[Number(Et.text)];return{type:"genfrac",mode:d.mode,numer:g,denom:x,continued:!1,hasBarLine:Ke,barSize:rt,leftDelim:W,rightDelim:ge,size:dt}},htmlBuilder:Os,mathmlBuilder:ss}),Ht({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=l.token;return{type:"infix",mode:d.mode,replaceWith:"\\\\abovefrac",size:cr(f[0],"size").value,token:x}}}),Ht({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0],L=H(cr(f[1],"infix").size),W=f[2],ne=L.number>0;return{type:"genfrac",mode:d.mode,numer:x,denom:W,continued:!1,hasBarLine:ne,barSize:L,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Os,mathmlBuilder:ss});var Na=function(l,f){var d=f.style,g,x,L=Vr(l,"supsub");L?(g=L.sup?dr(L.sup,f.havingStyle(d.sup()),f):dr(L.sub,f.havingStyle(d.sub()),f),x=cr(L.base,"horizBrace")):x=cr(l,"horizBrace");var W=dr(x.base,f.havingBaseStyle(w.DISPLAY)),ne=Nn.svgSpan(x,f),ge;if(x.isOver?(ge=Qe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:W},{type:"kern",size:.1},{type:"elem",elem:ne}]},f),ge.children[0].children[0].children[1].classes.push("svg-align")):(ge=Qe.makeVList({positionType:"bottom",positionData:W.depth+.1+ne.height,children:[{type:"elem",elem:ne},{type:"kern",size:.1},{type:"elem",elem:W}]},f),ge.children[0].children[0].children[0].classes.push("svg-align")),g){var Le=Qe.makeSpan(["mord",x.isOver?"mover":"munder"],[ge],f);x.isOver?ge=Qe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:Le},{type:"kern",size:.2},{type:"elem",elem:g}]},f):ge=Qe.makeVList({positionType:"bottom",positionData:Le.depth+.2+g.height+g.depth,children:[{type:"elem",elem:g},{type:"kern",size:.2},{type:"elem",elem:Le}]},f)}return Qe.makeSpan(["mord",x.isOver?"mover":"munder"],[ge],f)},ut=function(l,f){var d=Nn.mathMLnode(l.label);return new St.MathNode(l.isOver?"mover":"munder",[ar(l.base,f),d])};Ht({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=l.funcName;return{type:"horizBrace",mode:d.mode,label:g,isOver:/^\\over/.test(g),base:f[0]}},htmlBuilder:Na,mathmlBuilder:ut}),Ht({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(l,f){var d=l.parser,g=f[1],x=cr(f[0],"url").url;return d.settings.isTrusted({command:"\\href",url:x})?{type:"href",mode:d.mode,href:x,body:Qr(g)}:d.formatUnsupportedCmd("\\href")},htmlBuilder:function(l,f){var d=Zr(l.body,f,!1);return Qe.makeAnchor(l.href,[],d,f)},mathmlBuilder:function(l,f){var d=Gn(l.body,f);return d instanceof un||(d=new un("mrow",[d])),d.setAttribute("href",l.href),d}}),Ht({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(l,f){var d=l.parser,g=cr(f[0],"url").url;if(!d.settings.isTrusted({command:"\\url",url:g}))return d.formatUnsupportedCmd("\\url");for(var x=[],L=0;L<g.length;L++){var W=g[L];W==="~"&&(W="\\textasciitilde"),x.push({type:"textord",mode:"text",text:W})}var ne={type:"text",mode:d.mode,font:"\\texttt",body:x};return{type:"href",mode:d.mode,href:g,body:Qr(ne)}}}),Ht({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(l,f){var d=l.parser;return{type:"htmlmathml",mode:d.mode,html:Qr(f[0]),mathml:Qr(f[1])}},htmlBuilder:function(l,f){var d=Zr(l.html,f,!1);return Qe.makeFragment(d)},mathmlBuilder:function(l,f){return Gn(l.mathml,f)}});var _s=function(l){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(l))return{number:+l,unit:"bp"};var f=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(l);if(!f)throw new _("Invalid size: '"+l+"' in \\includegraphics");var d={number:+(f[1]+f[2]),unit:f[3]};if(!Nr(d))throw new _("Invalid unit: '"+d.unit+"' in \\includegraphics.");return d};Ht({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(l,f,d){var g=l.parser,x={number:0,unit:"em"},L={number:.9,unit:"em"},W={number:0,unit:"em"},ne="";if(d[0])for(var ge=cr(d[0],"raw").string,Le=ge.split(","),Ke=0;Ke<Le.length;Ke++){var rt=Le[Ke].split("=");if(rt.length===2){var dt=rt[1].trim();switch(rt[0].trim()){case"alt":ne=dt;break;case"width":x=_s(dt);break;case"height":L=_s(dt);break;case"totalheight":W=_s(dt);break;default:throw new _("Invalid key: '"+rt[0]+"' in \\includegraphics.")}}}var Et=cr(f[0],"url").url;return ne===""&&(ne=Et,ne=ne.replace(/^.*[\\/]/,""),ne=ne.substring(0,ne.lastIndexOf("."))),g.settings.isTrusted({command:"\\includegraphics",url:Et})?{type:"includegraphics",mode:g.mode,alt:ne,width:x,height:L,totalheight:W,src:Et}:g.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(l,f){var d=br(l.height,f),g=0;l.totalheight.number>0&&(g=br(l.totalheight,f)-d,g=Number(g.toFixed(2)));var x=0;l.width.number>0&&(x=br(l.width,f));var L={height:d+g+"em"};x>0&&(L.width=x+"em"),g>0&&(L.verticalAlign=-g+"em");var W=new lt(l.src,l.alt,L);return W.height=d,W.depth=g,W},mathmlBuilder:function(l,f){var d=new St.MathNode("mglyph",[]);d.setAttribute("alt",l.alt);var g=br(l.height,f),x=0;if(l.totalheight.number>0&&(x=br(l.totalheight,f)-g,x=x.toFixed(2),d.setAttribute("valign","-"+x+"em")),d.setAttribute("height",g+x+"em"),l.width.number>0){var L=br(l.width,f);d.setAttribute("width",L+"em")}return d.setAttribute("src",l.src),d}}),Ht({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=cr(f[0],"size");if(d.settings.strict){var L=g[1]==="m",W=x.value.unit==="mu";L?(W||d.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+g+" supports only mu units, "+("not "+x.value.unit+" units")),d.mode!=="math"&&d.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+g+" works only in math mode")):W&&d.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+g+" doesn't support mu units")}return{type:"kern",mode:d.mode,dimension:x.value}},htmlBuilder:function(l,f){return Qe.makeGlue(l.dimension,f)},mathmlBuilder:function(l,f){var d=br(l.dimension,f);return new St.SpaceNode(d)}}),Ht({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"lap",mode:d.mode,alignment:g.slice(5),body:x}},htmlBuilder:function(l,f){var d;l.alignment==="clap"?(d=Qe.makeSpan([],[dr(l.body,f)]),d=Qe.makeSpan(["inner"],[d],f)):d=Qe.makeSpan(["inner"],[dr(l.body,f)]);var g=Qe.makeSpan(["fix"],[]),x=Qe.makeSpan([l.alignment],[d,g],f),L=Qe.makeSpan(["strut"]);return L.style.height=x.height+x.depth+"em",L.style.verticalAlign=-x.depth+"em",x.children.unshift(L),x=Qe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:x}]},f),Qe.makeSpan(["mord"],[x],f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mpadded",[ar(l.body,f)]);if(l.alignment!=="rlap"){var g=l.alignment==="llap"?"-1":"-0.5";d.setAttribute("lspace",g+"width")}return d.setAttribute("width","0px"),d}}),Ht({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(l,f){var d=l.funcName,g=l.parser,x=g.mode;g.switchMode("math");var L=d==="\\("?"\\)":"$",W=g.parseExpression(!1,L);return g.expect(L),g.switchMode(x),{type:"styling",mode:g.mode,style:"text",body:W}}}),Ht({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(l,f){throw new _("Mismatched "+l.funcName)}});var la=function(l,f){switch(f.style.size){case w.DISPLAY.size:return l.display;case w.TEXT.size:return l.text;case w.SCRIPT.size:return l.script;case w.SCRIPTSCRIPT.size:return l.scriptscript;default:return l.text}};Ht({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(l,f){var d=l.parser;return{type:"mathchoice",mode:d.mode,display:Qr(f[0]),text:Qr(f[1]),script:Qr(f[2]),scriptscript:Qr(f[3])}},htmlBuilder:function(l,f){var d=la(l,f),g=Zr(d,f,!1);return Qe.makeFragment(g)},mathmlBuilder:function(l,f){var d=la(l,f);return Gn(d,f)}});var ua=function(l,f,d,g,x,L,W){l=Qe.makeSpan([],[l]);var ne,ge;if(f){var Le=dr(f,g.havingStyle(x.sup()),g);ge={elem:Le,kern:Math.max(g.fontMetrics().bigOpSpacing1,g.fontMetrics().bigOpSpacing3-Le.depth)}}if(d){var Ke=dr(d,g.havingStyle(x.sub()),g);ne={elem:Ke,kern:Math.max(g.fontMetrics().bigOpSpacing2,g.fontMetrics().bigOpSpacing4-Ke.height)}}var rt;if(ge&&ne){var dt=g.fontMetrics().bigOpSpacing5+ne.elem.height+ne.elem.depth+ne.kern+l.depth+W;rt=Qe.makeVList({positionType:"bottom",positionData:dt,children:[{type:"kern",size:g.fontMetrics().bigOpSpacing5},{type:"elem",elem:ne.elem,marginLeft:-L+"em"},{type:"kern",size:ne.kern},{type:"elem",elem:l},{type:"kern",size:ge.kern},{type:"elem",elem:ge.elem,marginLeft:L+"em"},{type:"kern",size:g.fontMetrics().bigOpSpacing5}]},g)}else if(ne){var Et=l.height-W;rt=Qe.makeVList({positionType:"top",positionData:Et,children:[{type:"kern",size:g.fontMetrics().bigOpSpacing5},{type:"elem",elem:ne.elem,marginLeft:-L+"em"},{type:"kern",size:ne.kern},{type:"elem",elem:l}]},g)}else if(ge){var Mt=l.depth+W;rt=Qe.makeVList({positionType:"bottom",positionData:Mt,children:[{type:"elem",elem:l},{type:"kern",size:ge.kern},{type:"elem",elem:ge.elem,marginLeft:L+"em"},{type:"kern",size:g.fontMetrics().bigOpSpacing5}]},g)}else return l;return Qe.makeSpan(["mop","op-limits"],[rt],g)},Ua=["\\smallint"],Ui=function(l,f){var d,g,x=!1,L,W=Vr(l,"supsub");W?(d=W.sup,g=W.sub,L=cr(W.base,"op"),x=!0):L=cr(l,"op");var ne=f.style,ge=!1;ne.size===w.DISPLAY.size&&L.symbol&&!M.contains(Ua,L.name)&&(ge=!0);var Le;if(L.symbol){var Ke=ge?"Size2-Regular":"Size1-Regular",rt="";if((L.name==="\\oiint"||L.name==="\\oiiint")&&(rt=L.name.substr(1),L.name=rt==="oiint"?"\\iint":"\\iiint"),Le=Qe.makeSymbol(L.name,Ke,"math",f,["mop","op-symbol",ge?"large-op":"small-op"]),rt.length>0){var dt=Le.italic,Et=Qe.staticSvg(rt+"Size"+(ge?"2":"1"),f);Le=Qe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Le,shift:0},{type:"elem",elem:Et,shift:ge?.08:0}]},f),L.name="\\"+rt,Le.classes.unshift("mop"),Le.italic=dt}}else if(L.body){var Mt=Zr(L.body,f,!0);Mt.length===1&&Mt[0]instanceof Se?(Le=Mt[0],Le.classes[0]="mop"):Le=Qe.makeSpan(["mop"],Qe.tryCombineChars(Mt),f)}else{for(var Yt=[],Zt=1;Zt<L.name.length;Zt++)Yt.push(Qe.mathsym(L.name[Zt],L.mode,f));Le=Qe.makeSpan(["mop"],Yt,f)}var or=0,gr=0;return(Le instanceof Se||L.name==="\\oiint"||L.name==="\\oiiint")&&!L.suppressBaseShift&&(or=(Le.height-Le.depth)/2-f.fontMetrics().axisHeight,gr=Le.italic),x?ua(Le,d,g,f,ne,gr,or):(or&&(Le.style.position="relative",Le.style.top=or+"em"),Le)},as=function(l,f){var d;if(l.symbol)d=new un("mo",[hn(l.name,l.mode)]),M.contains(Ua,l.name)&&d.setAttribute("largeop","false");else if(l.body)d=new un("mo",gn(l.body,f));else{d=new un("mi",[new ir(l.name.slice(1))]);var g=new un("mo",[hn("\u2061","text")]);l.parentIsSupSub?d=new un("mo",[d,g]):d=ii([d,g])}return d},Ao={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Ht({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(l,f){var d=l.parser,g=l.funcName,x=g;return x.length===1&&(x=Ao[x]),{type:"op",mode:d.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:x}},htmlBuilder:Ui,mathmlBuilder:as}),Ht({type:"op",names:["\\mathop"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=f[0];return{type:"op",mode:d.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Qr(g)}},htmlBuilder:Ui,mathmlBuilder:as});var Do={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Ht({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(l){var f=l.parser,d=l.funcName;return{type:"op",mode:f.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:d}},htmlBuilder:Ui,mathmlBuilder:as}),Ht({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(l){var f=l.parser,d=l.funcName;return{type:"op",mode:f.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:d}},htmlBuilder:Ui,mathmlBuilder:as}),Ht({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler:function(l){var f=l.parser,d=l.funcName,g=d;return g.length===1&&(g=Do[g]),{type:"op",mode:f.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:g}},htmlBuilder:Ui,mathmlBuilder:as});var Ms=function(l,f){var d,g,x=!1,L,W=Vr(l,"supsub");W?(d=W.sup,g=W.sub,L=cr(W.base,"operatorname"),x=!0):L=cr(l,"operatorname");var ne;if(L.body.length>0){for(var ge=L.body.map(function(dt){var Et=dt.text;return typeof Et=="string"?{type:"textord",mode:dt.mode,text:Et}:dt}),Le=Zr(ge,f.withFont("mathrm"),!0),Ke=0;Ke<Le.length;Ke++){var rt=Le[Ke];rt instanceof Se&&(rt.text=rt.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}ne=Qe.makeSpan(["mop"],Le,f)}else ne=Qe.makeSpan(["mop"],[],f);return x?ua(ne,d,g,f,f.style,0,0):ne},vs=function(l,f){for(var d=gn(l.body,f.withFont("mathrm")),g=!0,x=0;x<d.length;x++){var L=d[x];if(!(L instanceof St.SpaceNode))if(L instanceof St.MathNode)switch(L.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var W=L.children[0];L.children.length===1&&W instanceof St.TextNode?W.text=W.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):g=!1;break}default:g=!1}else g=!1}if(g){var ne=d.map(function(Ke){return Ke.toText()}).join("");d=[new St.TextNode(ne)]}var ge=new St.MathNode("mi",d);ge.setAttribute("mathvariant","normal");var Le=new St.MathNode("mo",[hn("\u2061","text")]);return l.parentIsSupSub?new St.MathNode("mo",[ge,Le]):St.newDocumentFragment([ge,Le])};Ht({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"operatorname",mode:d.mode,body:Qr(x),alwaysHandleSupSub:g==="\\operatorname*",limits:!1,parentIsSupSub:!1}},htmlBuilder:Ms,mathmlBuilder:vs}),ln({type:"ordgroup",htmlBuilder:function(l,f){return l.semisimple?Qe.makeFragment(Zr(l.body,f,!1)):Qe.makeSpan(["mord"],Zr(l.body,f,!0),f)},mathmlBuilder:function(l,f){return Gn(l.body,f,!0)}}),Ht({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=f[0];return{type:"overline",mode:d.mode,body:g}},htmlBuilder:function(l,f){var d=dr(l.body,f.havingCrampedStyle()),g=Qe.makeLineSpan("overline-line",f),x=f.fontMetrics().defaultRuleThickness,L=Qe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d},{type:"kern",size:3*x},{type:"elem",elem:g},{type:"kern",size:x}]},f);return Qe.makeSpan(["mord","overline"],[L],f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mo",[new St.TextNode("\u203E")]);d.setAttribute("stretchy","true");var g=new St.MathNode("mover",[ar(l.body,f),d]);return g.setAttribute("accent","true"),g}}),Ht({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,g=f[0];return{type:"phantom",mode:d.mode,body:Qr(g)}},htmlBuilder:function(l,f){var d=Zr(l.body,f.withPhantom(),!1);return Qe.makeFragment(d)},mathmlBuilder:function(l,f){var d=gn(l.body,f);return new St.MathNode("mphantom",d)}}),Ht({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,g=f[0];return{type:"hphantom",mode:d.mode,body:g}},htmlBuilder:function(l,f){var d=Qe.makeSpan([],[dr(l.body,f.withPhantom())]);if(d.height=0,d.depth=0,d.children)for(var g=0;g<d.children.length;g++)d.children[g].height=0,d.children[g].depth=0;return d=Qe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d}]},f),Qe.makeSpan(["mord"],[d],f)},mathmlBuilder:function(l,f){var d=gn(Qr(l.body),f),g=new St.MathNode("mphantom",d),x=new St.MathNode("mpadded",[g]);return x.setAttribute("height","0px"),x.setAttribute("depth","0px"),x}}),Ht({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,g=f[0];return{type:"vphantom",mode:d.mode,body:g}},htmlBuilder:function(l,f){var d=Qe.makeSpan(["inner"],[dr(l.body,f.withPhantom())]),g=Qe.makeSpan(["fix"],[]);return Qe.makeSpan(["mord","rlap"],[d,g],f)},mathmlBuilder:function(l,f){var d=gn(Qr(l.body),f),g=new St.MathNode("mphantom",d),x=new St.MathNode("mpadded",[g]);return x.setAttribute("width","0px"),x}}),Ht({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(l,f){var d=l.parser,g=cr(f[0],"size").value,x=f[1];return{type:"raisebox",mode:d.mode,dy:g,body:x}},htmlBuilder:function(l,f){var d=dr(l.body,f),g=br(l.dy,f);return Qe.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:d}]},f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mpadded",[ar(l.body,f)]),g=l.dy.number+l.dy.unit;return d.setAttribute("voffset",g),d}}),Ht({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(l,f,d){var g=l.parser,x=d[0],L=cr(f[0],"size"),W=cr(f[1],"size");return{type:"rule",mode:g.mode,shift:x&&cr(x,"size").value,width:L.value,height:W.value}},htmlBuilder:function(l,f){var d=Qe.makeSpan(["mord","rule"],[],f),g=br(l.width,f),x=br(l.height,f),L=l.shift?br(l.shift,f):0;return d.style.borderRightWidth=g+"em",d.style.borderTopWidth=x+"em",d.style.bottom=L+"em",d.width=g,d.height=x+L,d.depth=-L,d.maxFontSize=x*1.125*f.sizeMultiplier,d},mathmlBuilder:function(l,f){var d=br(l.width,f),g=br(l.height,f),x=l.shift?br(l.shift,f):0,L=f.color&&f.getColor()||"black",W=new St.MathNode("mspace");W.setAttribute("mathbackground",L),W.setAttribute("width",d+"em"),W.setAttribute("height",g+"em");var ne=new St.MathNode("mpadded",[W]);return x>=0?ne.setAttribute("height","+"+x+"em"):(ne.setAttribute("height",x+"em"),ne.setAttribute("depth","+"+-x+"em")),ne.setAttribute("voffset",x+"em"),ne}});function Xi(R,l,f){for(var d=Zr(R,l,!1),g=l.sizeMultiplier/f.sizeMultiplier,x=0;x<d.length;x++){var L=d[x].classes.indexOf("sizing");L<0?Array.prototype.push.apply(d[x].classes,l.sizingClasses(f)):d[x].classes[L+1]==="reset-size"+l.size&&(d[x].classes[L+1]="reset-size"+f.size),d[x].height*=g,d[x].depth*=g}return Qe.makeFragment(d)}var $a=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],ko=function(l,f){var d=f.havingSize(l.size);return Xi(l.body,d,f)};Ht({type:"sizing",names:$a,props:{numArgs:0,allowedInText:!0},handler:function(l,f){var d=l.breakOnTokenText,g=l.funcName,x=l.parser,L=x.parseExpression(!1,d);return{type:"sizing",mode:x.mode,size:$a.indexOf(g)+1,body:L}},htmlBuilder:ko,mathmlBuilder:function(l,f){var d=f.havingSize(l.size),g=gn(l.body,d),x=new St.MathNode("mstyle",g);return x.setAttribute("mathsize",d.sizeMultiplier+"em"),x}}),Ht({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(l,f,d){var g=l.parser,x=!1,L=!1,W=d[0]&&cr(d[0],"ordgroup");if(W)for(var ne="",ge=0;ge<W.body.length;++ge){var Le=W.body[ge];if(ne=Le.text,ne==="t")x=!0;else if(ne==="b")L=!0;else{x=!1,L=!1;break}}else x=!0,L=!0;var Ke=f[0];return{type:"smash",mode:g.mode,body:Ke,smashHeight:x,smashDepth:L}},htmlBuilder:function(l,f){var d=Qe.makeSpan([],[dr(l.body,f)]);if(!l.smashHeight&&!l.smashDepth)return d;if(l.smashHeight&&(d.height=0,d.children))for(var g=0;g<d.children.length;g++)d.children[g].height=0;if(l.smashDepth&&(d.depth=0,d.children))for(var x=0;x<d.children.length;x++)d.children[x].depth=0;var L=Qe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d}]},f);return Qe.makeSpan(["mord"],[L],f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mpadded",[ar(l.body,f)]);return l.smashHeight&&d.setAttribute("height","0px"),l.smashDepth&&d.setAttribute("depth","0px"),d}}),Ht({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(l,f,d){var g=l.parser,x=d[0],L=f[0];return{type:"sqrt",mode:g.mode,body:L,index:x}},htmlBuilder:function(l,f){var d=dr(l.body,f.havingCrampedStyle());d.height===0&&(d.height=f.fontMetrics().xHeight),d=Qe.wrapFragment(d,f);var g=f.fontMetrics(),x=g.defaultRuleThickness,L=x;f.style.id<w.TEXT.id&&(L=f.fontMetrics().xHeight);var W=x+L/4,ne=d.height+d.depth+W+x,ge=ui.sqrtImage(ne,f),Le=ge.span,Ke=ge.ruleWidth,rt=ge.advanceWidth,dt=Le.height-Ke;dt>d.height+d.depth+W&&(W=(W+dt-d.height-d.depth)/2);var Et=Le.height-d.height-W-Ke;d.style.paddingLeft=rt+"em";var Mt=Qe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d,wrapperClasses:["svg-align"]},{type:"kern",size:-(d.height+Et)},{type:"elem",elem:Le},{type:"kern",size:Ke}]},f);if(l.index){var Yt=f.havingStyle(w.SCRIPTSCRIPT),Zt=dr(l.index,Yt,f),or=.6*(Mt.height-Mt.depth),gr=Qe.makeVList({positionType:"shift",positionData:-or,children:[{type:"elem",elem:Zt}]},f),Gr=Qe.makeSpan(["root"],[gr]);return Qe.makeSpan(["mord","sqrt"],[Gr,Mt],f)}else return Qe.makeSpan(["mord","sqrt"],[Mt],f)},mathmlBuilder:function(l,f){var d=l.body,g=l.index;return g?new St.MathNode("mroot",[ar(d,f),ar(g,f)]):new St.MathNode("msqrt",[ar(d,f)])}});var za={display:w.DISPLAY,text:w.TEXT,script:w.SCRIPT,scriptscript:w.SCRIPTSCRIPT};Ht({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(l,f){var d=l.breakOnTokenText,g=l.funcName,x=l.parser,L=x.parseExpression(!0,d),W=g.slice(1,g.length-5);return{type:"styling",mode:x.mode,style:W,body:L}},htmlBuilder:function(l,f){var d=za[l.style],g=f.havingStyle(d).withFont("");return Xi(l.body,g,f)},mathmlBuilder:function(l,f){var d=za[l.style],g=f.havingStyle(d),x=gn(l.body,g),L=new St.MathNode("mstyle",x),W={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},ne=W[l.style];return L.setAttribute("scriptlevel",ne[0]),L.setAttribute("displaystyle",ne[1]),L}});var Co=function(l,f){var d=l.base;if(d)if(d.type==="op"){var g=d.limits&&(f.style.size===w.DISPLAY.size||d.alwaysHandleSupSub);return g?Ui:null}else if(d.type==="operatorname"){var x=d.alwaysHandleSupSub&&(f.style.size===w.DISPLAY.size||d.limits);return x?Ms:null}else{if(d.type==="accent")return M.isCharacterBox(d.base)?Gt:null;if(d.type==="horizBrace"){var L=!l.sub;return L===d.isOver?Na:null}else return null}else return null};ln({type:"supsub",htmlBuilder:function(l,f){var d=Co(l,f);if(d)return d(l,f);var g=l.base,x=l.sup,L=l.sub,W=dr(g,f),ne,ge,Le=f.fontMetrics(),Ke=0,rt=0,dt=g&&M.isCharacterBox(g);if(x){var Et=f.havingStyle(f.style.sup());ne=dr(x,Et,f),dt||(Ke=W.height-Et.fontMetrics().supDrop*Et.sizeMultiplier/f.sizeMultiplier)}if(L){var Mt=f.havingStyle(f.style.sub());ge=dr(L,Mt,f),dt||(rt=W.depth+Mt.fontMetrics().subDrop*Mt.sizeMultiplier/f.sizeMultiplier)}var Yt;f.style===w.DISPLAY?Yt=Le.sup1:f.style.cramped?Yt=Le.sup3:Yt=Le.sup2;var Zt=f.sizeMultiplier,or=.5/Le.ptPerEm/Zt+"em",gr=null;if(ge){var Gr=l.base&&l.base.type==="op"&&l.base.name&&(l.base.name==="\\oiint"||l.base.name==="\\oiiint");(W instanceof Se||Gr)&&(gr=-W.italic+"em")}var Fr;if(ne&&ge){Ke=Math.max(Ke,Yt,ne.depth+.25*Le.xHeight),rt=Math.max(rt,Le.sub2);var Kr=Le.defaultRuleThickness,Hr=4*Kr;if(Ke-ne.depth-(ge.height-rt)<Hr){rt=Hr-(Ke-ne.depth)+ge.height;var zr=.8*Le.xHeight-(Ke-ne.depth);zr>0&&(Ke+=zr,rt-=zr)}var bn=[{type:"elem",elem:ge,shift:rt,marginRight:or,marginLeft:gr},{type:"elem",elem:ne,shift:-Ke,marginRight:or}];Fr=Qe.makeVList({positionType:"individualShift",children:bn},f)}else if(ge){rt=Math.max(rt,Le.sub1,ge.height-.8*Le.xHeight);var Wr=[{type:"elem",elem:ge,marginLeft:gr,marginRight:or}];Fr=Qe.makeVList({positionType:"shift",positionData:rt,children:Wr},f)}else if(ne)Ke=Math.max(Ke,Yt,ne.depth+.25*Le.xHeight),Fr=Qe.makeVList({positionType:"shift",positionData:-Ke,children:[{type:"elem",elem:ne,marginRight:or}]},f);else throw new Error("supsub must have either sup or sub.");var Me=Fn(W,"right")||"mord";return Qe.makeSpan([Me],[W,Qe.makeSpan(["msupsub"],[Fr])],f)},mathmlBuilder:function(l,f){var d=!1,g,x,L=Vr(l.base,"horizBrace");L&&(x=!!l.sup,x===L.isOver&&(d=!0,g=L.isOver)),l.base&&(l.base.type==="op"||l.base.type==="operatorname")&&(l.base.parentIsSupSub=!0);var W=[ar(l.base,f)];l.sub&&W.push(ar(l.sub,f)),l.sup&&W.push(ar(l.sup,f));var ne;if(d)ne=g?"mover":"munder";else if(l.sub)if(l.sup){var Ke=l.base;Ke&&Ke.type==="op"&&Ke.limits&&f.style===w.DISPLAY||Ke&&Ke.type==="operatorname"&&Ke.alwaysHandleSupSub&&(f.style===w.DISPLAY||Ke.limits)?ne="munderover":ne="msubsup"}else{var Le=l.base;Le&&Le.type==="op"&&Le.limits&&(f.style===w.DISPLAY||Le.alwaysHandleSupSub)||Le&&Le.type==="operatorname"&&Le.alwaysHandleSupSub&&(Le.limits||f.style===w.DISPLAY)?ne="munder":ne="msub"}else{var ge=l.base;ge&&ge.type==="op"&&ge.limits&&(f.style===w.DISPLAY||ge.alwaysHandleSupSub)||ge&&ge.type==="operatorname"&&ge.alwaysHandleSupSub&&(ge.limits||f.style===w.DISPLAY)?ne="mover":ne="msup"}var rt=new St.MathNode(ne,W);return rt}}),ln({type:"atom",htmlBuilder:function(l,f){return Qe.mathsym(l.text,l.mode,f,["m"+l.family])},mathmlBuilder:function(l,f){var d=new St.MathNode("mo",[hn(l.text,l.mode)]);if(l.family==="bin"){var g=Pi(l,f);g==="bold-italic"&&d.setAttribute("mathvariant",g)}else l.family==="punct"?d.setAttribute("separator","true"):(l.family==="open"||l.family==="close")&&d.setAttribute("stretchy","false");return d}});var ha={mi:"italic",mn:"normal",mtext:"normal"};ln({type:"mathord",htmlBuilder:function(l,f){return Qe.makeOrd(l,f,"mathord")},mathmlBuilder:function(l,f){var d=new St.MathNode("mi",[hn(l.text,l.mode,f)]),g=Pi(l,f)||"italic";return g!==ha[d.type]&&d.setAttribute("mathvariant",g),d}}),ln({type:"textord",htmlBuilder:function(l,f){return Qe.makeOrd(l,f,"textord")},mathmlBuilder:function(l,f){var d=hn(l.text,l.mode,f),g=Pi(l,f)||"normal",x;return l.mode==="text"?x=new St.MathNode("mtext",[d]):/[0-9]/.test(l.text)?x=new St.MathNode("mn",[d]):l.text==="\\prime"?x=new St.MathNode("mo",[d]):x=new St.MathNode("mi",[d]),g!==ha[x.type]&&x.setAttribute("mathvariant",g),x}});var ys={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},os={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ln({type:"spacing",htmlBuilder:function(l,f){if(os.hasOwnProperty(l.text)){var d=os[l.text].className||"";if(l.mode==="text"){var g=Qe.makeOrd(l,f,"textord");return g.classes.push(d),g}else return Qe.makeSpan(["mspace",d],[Qe.mathsym(l.text,l.mode,f)],f)}else{if(ys.hasOwnProperty(l.text))return Qe.makeSpan(["mspace",ys[l.text]],[],f);throw new _('Unknown type of space "'+l.text+'"')}},mathmlBuilder:function(l,f){var d;if(os.hasOwnProperty(l.text))d=new St.MathNode("mtext",[new St.TextNode("\xA0")]);else{if(ys.hasOwnProperty(l.text))return new St.MathNode("mspace");throw new _('Unknown type of space "'+l.text+'"')}return d}});var ls=function(){var l=new St.MathNode("mtd",[]);return l.setAttribute("width","50%"),l};ln({type:"tag",mathmlBuilder:function(l,f){var d=new St.MathNode("mtable",[new St.MathNode("mtr",[ls(),new St.MathNode("mtd",[Gn(l.body,f)]),ls(),new St.MathNode("mtd",[Gn(l.tag,f)])])]);return d.setAttribute("width","100%"),d}});var Ga={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},ca={"\\textbf":"textbf","\\textmd":"textmd"},Ka={"\\textit":"textit","\\textup":"textup"},Fs=function(l,f){var d=l.font;return d?Ga[d]?f.withTextFontFamily(Ga[d]):ca[d]?f.withTextFontWeight(ca[d]):f.withTextFontShape(Ka[d]):f};Ht({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],greediness:2,allowedInText:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"text",mode:d.mode,body:Qr(x),font:g}},htmlBuilder:function(l,f){var d=Fs(l,f),g=Zr(l.body,d,!0);return Qe.makeSpan(["mord","text"],Qe.tryCombineChars(g),d)},mathmlBuilder:function(l,f){var d=Fs(l,f);return Gn(l.body,d)}}),Ht({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser;return{type:"underline",mode:d.mode,body:f[0]}},htmlBuilder:function(l,f){var d=dr(l.body,f),g=Qe.makeLineSpan("underline-line",f),x=f.fontMetrics().defaultRuleThickness,L=Qe.makeVList({positionType:"top",positionData:d.height,children:[{type:"kern",size:x},{type:"elem",elem:g},{type:"kern",size:3*x},{type:"elem",elem:d}]},f);return Qe.makeSpan(["mord","underline"],[L],f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mo",[new St.TextNode("\u203E")]);d.setAttribute("stretchy","true");var g=new St.MathNode("munder",[ar(l.body,f),d]);return g.setAttribute("accentunder","true"),g}}),Ht({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(l,f,d){throw new _("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(l,f){for(var d=Ha(l),g=[],x=f.havingStyle(f.style.text()),L=0;L<d.length;L++){var W=d[L];W==="~"&&(W="\\textasciitilde"),g.push(Qe.makeSymbol(W,"Typewriter-Regular",l.mode,x,["mord","texttt"]))}return Qe.makeSpan(["mord","text"].concat(x.sizingClasses(f)),Qe.tryCombineChars(g),x)},mathmlBuilder:function(l,f){var d=new St.TextNode(Ha(l)),g=new St.MathNode("mtext",[d]);return g.setAttribute("mathvariant","monospace"),g}});var Ha=function(l){return l.body.replace(/ /g,l.star?"\u2423":"\xA0")},Bs=ji,bs=Bs,fa=`[ \r
]`,da="\\\\[a-zA-Z@]+",ja="\\\\[^\uD800-\uDFFF]",Lo=""+da+fa+"*",Va=new RegExp("^("+da+")"+fa+"*$"),pa="[\u0300-\u036F]",Ro=new RegExp(pa+"+$"),ma="("+fa+"+)|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(pa+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(pa+"*")+"|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*"+("|"+Lo)+("|"+ja+")"),Wa=function(){function R(f,d){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=f,this.settings=d,this.tokenRegex=new RegExp(ma,"g"),this.catcodes={"%":14}}var l=R.prototype;return l.setCatcode=function(d,g){this.catcodes[d]=g},l.lex=function(){var d=this.input,g=this.tokenRegex.lastIndex;if(g===d.length)return new ye("EOF",new Be(this,g,g));var x=this.tokenRegex.exec(d);if(x===null||x.index!==g)throw new _("Unexpected character: '"+d[g]+"'",new ye(d[g],new Be(this,g,g+1)));var L=x[2]||" ";if(this.catcodes[L]===14){var W=d.indexOf(`
`,this.tokenRegex.lastIndex);return W===-1?(this.tokenRegex.lastIndex=d.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=W+1,this.lex()}var ne=L.match(Va);return ne&&(L=ne[1]),new ye(L,new Be(this,g,this.tokenRegex.lastIndex))},R}(),Io=function(){function R(f,d){f===void 0&&(f={}),d===void 0&&(d={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=d,this.builtins=f,this.undefStack=[]}var l=R.prototype;return l.beginGroup=function(){this.undefStack.push({})},l.endGroup=function(){if(this.undefStack.length===0)throw new _("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var d=this.undefStack.pop();for(var g in d)d.hasOwnProperty(g)&&(d[g]===void 0?delete this.current[g]:this.current[g]=d[g])},l.has=function(d){return this.current.hasOwnProperty(d)||this.builtins.hasOwnProperty(d)},l.get=function(d){return this.current.hasOwnProperty(d)?this.current[d]:this.builtins[d]},l.set=function(d,g,x){if(x===void 0&&(x=!1),x){for(var L=0;L<this.undefStack.length;L++)delete this.undefStack[L][d];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][d]=g)}else{var W=this.undefStack[this.undefStack.length-1];W&&!W.hasOwnProperty(d)&&(W[d]=this.current[d])}this.current[d]=g},R}(),Ya={},Po=Ya;function ue(R,l){Ya[R]=l}ue("\\@firstoftwo",function(R){var l=R.consumeArgs(2);return{tokens:l[0],numArgs:0}}),ue("\\@secondoftwo",function(R){var l=R.consumeArgs(2);return{tokens:l[1],numArgs:0}}),ue("\\@ifnextchar",function(R){var l=R.consumeArgs(3),f=R.future();return l[0].length===1&&l[0][0].text===f.text?{tokens:l[1],numArgs:0}:{tokens:l[2],numArgs:0}}),ue("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ue("\\TextOrMath",function(R){var l=R.consumeArgs(2);return R.mode==="text"?{tokens:l[0],numArgs:0}:{tokens:l[1],numArgs:0}});var qa={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};ue("\\char",function(R){var l=R.popToken(),f,d="";if(l.text==="'")f=8,l=R.popToken();else if(l.text==='"')f=16,l=R.popToken();else if(l.text==="`")if(l=R.popToken(),l.text[0]==="\\")d=l.text.charCodeAt(1);else{if(l.text==="EOF")throw new _("\\char` missing argument");d=l.text.charCodeAt(0)}else f=10;if(f){if(d=qa[l.text],d==null||d>=f)throw new _("Invalid base-"+f+" digit "+l.text);for(var g;(g=qa[R.future().text])!=null&&g<f;)d*=f,d+=g,R.popToken()}return"\\@char{"+d+"}"});var ga=function(l,f){var d=l.consumeArgs(1)[0];if(d.length!==1)throw new _("\\gdef's first argument must be a macro name");var g=d[0].text,x=0;for(d=l.consumeArgs(1)[0];d.length===1&&d[0].text==="#";){if(d=l.consumeArgs(1)[0],d.length!==1)throw new _('Invalid argument number length "'+d.length+'"');if(!/^[1-9]$/.test(d[0].text))throw new _('Invalid argument number "'+d[0].text+'"');if(x++,parseInt(d[0].text)!==x)throw new _('Argument number "'+d[0].text+'" out of order');d=l.consumeArgs(1)[0]}return l.macros.set(g,{tokens:d,numArgs:x},f),""};ue("\\gdef",function(R){return ga(R,!0)}),ue("\\def",function(R){return ga(R,!1)}),ue("\\global",function(R){var l=R.consumeArgs(1)[0];if(l.length!==1)throw new _("Invalid command after \\global");var f=l[0].text;if(f==="\\def")return ga(R,!0);throw new _("Invalid command '"+f+"' after \\global")});var _a=function(l,f,d){var g=l.consumeArgs(1)[0];if(g.length!==1)throw new _("\\newcommand's first argument must be a macro name");var x=g[0].text,L=l.isDefined(x);if(L&&!f)throw new _("\\newcommand{"+x+"} attempting to redefine "+(x+"; use \\renewcommand"));if(!L&&!d)throw new _("\\renewcommand{"+x+"} when command "+x+" does not yet exist; use \\newcommand");var W=0;if(g=l.consumeArgs(1)[0],g.length===1&&g[0].text==="["){for(var ne="",ge=l.expandNextToken();ge.text!=="]"&&ge.text!=="EOF";)ne+=ge.text,ge=l.expandNextToken();if(!ne.match(/^\s*[0-9]+\s*$/))throw new _("Invalid number of arguments: "+ne);W=parseInt(ne),g=l.consumeArgs(1)[0]}return l.macros.set(x,{tokens:g,numArgs:W}),""};ue("\\newcommand",function(R){return _a(R,!1,!0)}),ue("\\renewcommand",function(R){return _a(R,!0,!1)}),ue("\\providecommand",function(R){return _a(R,!0,!0)}),ue("\\bgroup","{"),ue("\\egroup","}"),ue("\\lq","`"),ue("\\rq","'"),ue("\\aa","\\r a"),ue("\\AA","\\r A"),ue("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),ue("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ue("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),ue("\u212C","\\mathscr{B}"),ue("\u2130","\\mathscr{E}"),ue("\u2131","\\mathscr{F}"),ue("\u210B","\\mathscr{H}"),ue("\u2110","\\mathscr{I}"),ue("\u2112","\\mathscr{L}"),ue("\u2133","\\mathscr{M}"),ue("\u211B","\\mathscr{R}"),ue("\u212D","\\mathfrak{C}"),ue("\u210C","\\mathfrak{H}"),ue("\u2128","\\mathfrak{Z}"),ue("\\Bbbk","\\Bbb{k}"),ue("\xB7","\\cdotp"),ue("\\llap","\\mathllap{\\textrm{#1}}"),ue("\\rlap","\\mathrlap{\\textrm{#1}}"),ue("\\clap","\\mathclap{\\textrm{#1}}"),ue("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),ue("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),ue("\\ne","\\neq"),ue("\u2260","\\neq"),ue("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),ue("\u2209","\\notin"),ue("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),ue("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),ue("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),ue("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),ue("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),ue("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),ue("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),ue("\u27C2","\\perp"),ue("\u203C","\\mathclose{!\\mkern-0.8mu!}"),ue("\u220C","\\notni"),ue("\u231C","\\ulcorner"),ue("\u231D","\\urcorner"),ue("\u231E","\\llcorner"),ue("\u231F","\\lrcorner"),ue("\xA9","\\copyright"),ue("\xAE","\\textregistered"),ue("\uFE0F","\\textregistered"),ue("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),ue("\u22EE","\\vdots"),ue("\\varGamma","\\mathit{\\Gamma}"),ue("\\varDelta","\\mathit{\\Delta}"),ue("\\varTheta","\\mathit{\\Theta}"),ue("\\varLambda","\\mathit{\\Lambda}"),ue("\\varXi","\\mathit{\\Xi}"),ue("\\varPi","\\mathit{\\Pi}"),ue("\\varSigma","\\mathit{\\Sigma}"),ue("\\varUpsilon","\\mathit{\\Upsilon}"),ue("\\varPhi","\\mathit{\\Phi}"),ue("\\varPsi","\\mathit{\\Psi}"),ue("\\varOmega","\\mathit{\\Omega}"),ue("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ue("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),ue("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ue("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ue("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ue("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Za={",":"\\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"};ue("\\dots",function(R){var l="\\dotso",f=R.expandAfterFuture().text;return f in Za?l=Za[f]:(f.substr(0,4)==="\\not"||f in Rt.math&&M.contains(["bin","rel"],Rt.math[f].group))&&(l="\\dotsb"),l});var us={")":!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};ue("\\dotso",function(R){var l=R.future().text;return l in us?"\\ldots\\,":"\\ldots"}),ue("\\dotsc",function(R){var l=R.future().text;return l in us&&l!==","?"\\ldots\\,":"\\ldots"}),ue("\\cdots",function(R){var l=R.future().text;return l in us?"\\@cdots\\,":"\\@cdots"}),ue("\\dotsb","\\cdots"),ue("\\dotsm","\\cdots"),ue("\\dotsi","\\!\\cdots"),ue("\\dotsx","\\ldots\\,"),ue("\\DOTSI","\\relax"),ue("\\DOTSB","\\relax"),ue("\\DOTSX","\\relax"),ue("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ue("\\,","\\tmspace+{3mu}{.1667em}"),ue("\\thinspace","\\,"),ue("\\>","\\mskip{4mu}"),ue("\\:","\\tmspace+{4mu}{.2222em}"),ue("\\medspace","\\:"),ue("\\;","\\tmspace+{5mu}{.2777em}"),ue("\\thickspace","\\;"),ue("\\!","\\tmspace-{3mu}{.1667em}"),ue("\\negthinspace","\\!"),ue("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ue("\\negthickspace","\\tmspace-{5mu}{.277em}"),ue("\\enspace","\\kern.5em "),ue("\\enskip","\\hskip.5em\\relax"),ue("\\quad","\\hskip1em\\relax"),ue("\\qquad","\\hskip2em\\relax"),ue("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ue("\\tag@paren","\\tag@literal{({#1})}"),ue("\\tag@literal",function(R){if(R.macros.get("\\df@tag"))throw new _("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ue("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ue("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ue("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ue("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ue("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),ue("\\\\","\\newline"),ue("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Xa=yt["Main-Regular"][84][1]-.7*yt["Main-Regular"][65][1]+"em";ue("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Xa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ue("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Xa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ue("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ue("\\@hspace","\\hskip #1\\relax"),ue("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ue("\\ordinarycolon",":"),ue("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ue("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ue("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ue("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ue("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ue("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ue("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ue("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ue("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ue("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ue("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ue("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ue("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ue("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ue("\u2237","\\dblcolon"),ue("\u2239","\\eqcolon"),ue("\u2254","\\coloneqq"),ue("\u2255","\\eqqcolon"),ue("\u2A74","\\Coloneqq"),ue("\\ratio","\\vcentcolon"),ue("\\coloncolon","\\dblcolon"),ue("\\colonequals","\\coloneqq"),ue("\\coloncolonequals","\\Coloneqq"),ue("\\equalscolon","\\eqqcolon"),ue("\\equalscoloncolon","\\Eqqcolon"),ue("\\colonminus","\\coloneq"),ue("\\coloncolonminus","\\Coloneq"),ue("\\minuscolon","\\eqcolon"),ue("\\minuscoloncolon","\\Eqcolon"),ue("\\coloncolonapprox","\\Colonapprox"),ue("\\coloncolonsim","\\Colonsim"),ue("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ue("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ue("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ue("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ue("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),ue("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ue("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ue("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),ue("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),ue("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),ue("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),ue("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),ue("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),ue("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),ue("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),ue("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),ue("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),ue("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),ue("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),ue("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),ue("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),ue("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),ue("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),ue("\u27E6","\\llbracket"),ue("\u27E7","\\rrbracket"),ue("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),ue("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),ue("\u2983","\\lBrace"),ue("\u2984","\\rBrace"),ue("\\darr","\\downarrow"),ue("\\dArr","\\Downarrow"),ue("\\Darr","\\Downarrow"),ue("\\lang","\\langle"),ue("\\rang","\\rangle"),ue("\\uarr","\\uparrow"),ue("\\uArr","\\Uparrow"),ue("\\Uarr","\\Uparrow"),ue("\\N","\\mathbb{N}"),ue("\\R","\\mathbb{R}"),ue("\\Z","\\mathbb{Z}"),ue("\\alef","\\aleph"),ue("\\alefsym","\\aleph"),ue("\\Alpha","\\mathrm{A}"),ue("\\Beta","\\mathrm{B}"),ue("\\bull","\\bullet"),ue("\\Chi","\\mathrm{X}"),ue("\\clubs","\\clubsuit"),ue("\\cnums","\\mathbb{C}"),ue("\\Complex","\\mathbb{C}"),ue("\\Dagger","\\ddagger"),ue("\\diamonds","\\diamondsuit"),ue("\\empty","\\emptyset"),ue("\\Epsilon","\\mathrm{E}"),ue("\\Eta","\\mathrm{H}"),ue("\\exist","\\exists"),ue("\\harr","\\leftrightarrow"),ue("\\hArr","\\Leftrightarrow"),ue("\\Harr","\\Leftrightarrow"),ue("\\hearts","\\heartsuit"),ue("\\image","\\Im"),ue("\\infin","\\infty"),ue("\\Iota","\\mathrm{I}"),ue("\\isin","\\in"),ue("\\Kappa","\\mathrm{K}"),ue("\\larr","\\leftarrow"),ue("\\lArr","\\Leftarrow"),ue("\\Larr","\\Leftarrow"),ue("\\lrarr","\\leftrightarrow"),ue("\\lrArr","\\Leftrightarrow"),ue("\\Lrarr","\\Leftrightarrow"),ue("\\Mu","\\mathrm{M}"),ue("\\natnums","\\mathbb{N}"),ue("\\Nu","\\mathrm{N}"),ue("\\Omicron","\\mathrm{O}"),ue("\\plusmn","\\pm"),ue("\\rarr","\\rightarrow"),ue("\\rArr","\\Rightarrow"),ue("\\Rarr","\\Rightarrow"),ue("\\real","\\Re"),ue("\\reals","\\mathbb{R}"),ue("\\Reals","\\mathbb{R}"),ue("\\Rho","\\mathrm{P}"),ue("\\sdot","\\cdot"),ue("\\sect","\\S"),ue("\\spades","\\spadesuit"),ue("\\sub","\\subset"),ue("\\sube","\\subseteq"),ue("\\supe","\\supseteq"),ue("\\Tau","\\mathrm{T}"),ue("\\thetasym","\\vartheta"),ue("\\weierp","\\wp"),ue("\\Zeta","\\mathrm{Z}"),ue("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ue("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ue("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ue("\\blue","\\textcolor{##6495ed}{#1}"),ue("\\orange","\\textcolor{##ffa500}{#1}"),ue("\\pink","\\textcolor{##ff00af}{#1}"),ue("\\red","\\textcolor{##df0030}{#1}"),ue("\\green","\\textcolor{##28ae7b}{#1}"),ue("\\gray","\\textcolor{gray}{#1}"),ue("\\purple","\\textcolor{##9d38bd}{#1}"),ue("\\blueA","\\textcolor{##ccfaff}{#1}"),ue("\\blueB","\\textcolor{##80f6ff}{#1}"),ue("\\blueC","\\textcolor{##63d9ea}{#1}"),ue("\\blueD","\\textcolor{##11accd}{#1}"),ue("\\blueE","\\textcolor{##0c7f99}{#1}"),ue("\\tealA","\\textcolor{##94fff5}{#1}"),ue("\\tealB","\\textcolor{##26edd5}{#1}"),ue("\\tealC","\\textcolor{##01d1c1}{#1}"),ue("\\tealD","\\textcolor{##01a995}{#1}"),ue("\\tealE","\\textcolor{##208170}{#1}"),ue("\\greenA","\\textcolor{##b6ffb0}{#1}"),ue("\\greenB","\\textcolor{##8af281}{#1}"),ue("\\greenC","\\textcolor{##74cf70}{#1}"),ue("\\greenD","\\textcolor{##1fab54}{#1}"),ue("\\greenE","\\textcolor{##0d923f}{#1}"),ue("\\goldA","\\textcolor{##ffd0a9}{#1}"),ue("\\goldB","\\textcolor{##ffbb71}{#1}"),ue("\\goldC","\\textcolor{##ff9c39}{#1}"),ue("\\goldD","\\textcolor{##e07d10}{#1}"),ue("\\goldE","\\textcolor{##a75a05}{#1}"),ue("\\redA","\\textcolor{##fca9a9}{#1}"),ue("\\redB","\\textcolor{##ff8482}{#1}"),ue("\\redC","\\textcolor{##f9685d}{#1}"),ue("\\redD","\\textcolor{##e84d39}{#1}"),ue("\\redE","\\textcolor{##bc2612}{#1}"),ue("\\maroonA","\\textcolor{##ffbde0}{#1}"),ue("\\maroonB","\\textcolor{##ff92c6}{#1}"),ue("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ue("\\maroonD","\\textcolor{##ca337c}{#1}"),ue("\\maroonE","\\textcolor{##9e034e}{#1}"),ue("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ue("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ue("\\purpleC","\\textcolor{##aa87ff}{#1}"),ue("\\purpleD","\\textcolor{##7854ab}{#1}"),ue("\\purpleE","\\textcolor{##543b78}{#1}"),ue("\\mintA","\\textcolor{##f5f9e8}{#1}"),ue("\\mintB","\\textcolor{##edf2df}{#1}"),ue("\\mintC","\\textcolor{##e0e5cc}{#1}"),ue("\\grayA","\\textcolor{##f6f7f7}{#1}"),ue("\\grayB","\\textcolor{##f0f1f2}{#1}"),ue("\\grayC","\\textcolor{##e3e5e6}{#1}"),ue("\\grayD","\\textcolor{##d6d8da}{#1}"),ue("\\grayE","\\textcolor{##babec2}{#1}"),ue("\\grayF","\\textcolor{##888d93}{#1}"),ue("\\grayG","\\textcolor{##626569}{#1}"),ue("\\grayH","\\textcolor{##3b3e40}{#1}"),ue("\\grayI","\\textcolor{##21242c}{#1}"),ue("\\kaBlue","\\textcolor{##314453}{#1}"),ue("\\kaGreen","\\textcolor{##71B307}{#1}");var va={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Qa=function(){function R(f,d,g){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=d,this.expansionCount=0,this.feed(f),this.macros=new Io(Po,d.macros),this.mode=g,this.stack=[]}var l=R.prototype;return l.feed=function(d){this.lexer=new Wa(d,this.settings)},l.switchMode=function(d){this.mode=d},l.beginGroup=function(){this.macros.beginGroup()},l.endGroup=function(){this.macros.endGroup()},l.future=function(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},l.popToken=function(){return this.future(),this.stack.pop()},l.pushToken=function(d){this.stack.push(d)},l.pushTokens=function(d){var g;(g=this.stack).push.apply(g,d)},l.consumeSpaces=function(){for(;;){var d=this.future();if(d.text===" ")this.stack.pop();else break}},l.consumeArgs=function(d){for(var g=[],x=0;x<d;++x){this.consumeSpaces();var L=this.popToken();if(L.text==="{"){for(var W=[],ne=1;ne!==0;){var ge=this.popToken();if(W.push(ge),ge.text==="{")++ne;else if(ge.text==="}")--ne;else if(ge.text==="EOF")throw new _("End of input in macro argument",L)}W.pop(),W.reverse(),g[x]=W}else{if(L.text==="EOF")throw new _("End of input expecting macro argument");g[x]=[L]}}return g},l.expandOnce=function(){var d=this.popToken(),g=d.text,x=this._getExpansion(g);if(x==null)return this.pushToken(d),d;if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new _("Too many expansions: infinite loop or need to increase maxExpand setting");var L=x.tokens;if(x.numArgs){var W=this.consumeArgs(x.numArgs);L=L.slice();for(var ne=L.length-1;ne>=0;--ne){var ge=L[ne];if(ge.text==="#"){if(ne===0)throw new _("Incomplete placeholder at end of macro body",ge);if(ge=L[--ne],ge.text==="#")L.splice(ne+1,1);else if(/^[1-9]$/.test(ge.text)){var Le;(Le=L).splice.apply(Le,[ne,2].concat(W[+ge.text-1]))}else throw new _("Not a valid argument number",ge)}}}return this.pushTokens(L),L},l.expandAfterFuture=function(){return this.expandOnce(),this.future()},l.expandNextToken=function(){for(;;){var d=this.expandOnce();if(d instanceof ye)if(d.text==="\\relax")this.stack.pop();else return this.stack.pop()}throw new Error},l.expandMacro=function(d){if(this.macros.get(d)){var g=[],x=this.stack.length;for(this.pushToken(new ye(d));this.stack.length>x;){var L=this.expandOnce();L instanceof ye&&g.push(this.stack.pop())}return g}},l.expandMacroAsText=function(d){var g=this.expandMacro(d);return g&&g.map(function(x){return x.text}).join("")},l._getExpansion=function(d){var g=this.macros.get(d);if(g==null)return g;var x=typeof g=="function"?g(this):g;if(typeof x=="string"){var L=0;if(x.indexOf("#")!==-1)for(var W=x.replace(/##/g,"");W.indexOf("#"+(L+1))!==-1;)++L;for(var ne=new Wa(x,this.settings),ge=[],Le=ne.lex();Le.text!=="EOF";)ge.push(Le),Le=ne.lex();ge.reverse();var Ke={tokens:ge,numArgs:L};return Ke}return x},l.isDefined=function(d){return this.macros.has(d)||bs.hasOwnProperty(d)||Rt.math.hasOwnProperty(d)||Rt.text.hasOwnProperty(d)||va.hasOwnProperty(d)},R}(),Ja={"\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"}},Ns={\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"},yn=function(){function R(f,d){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 Qa(f,d,this.mode),this.settings=d,this.leftrightDepth=0}var l=R.prototype;return l.expect=function(d,g){if(g===void 0&&(g=!0),this.fetch().text!==d)throw new _("Expected '"+d+"', got '"+this.fetch().text+"'",this.fetch());g&&this.consume()},l.consume=function(){this.nextToken=null},l.fetch=function(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},l.switchMode=function(d){this.mode=d,this.gullet.switchMode(d)},l.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var d=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),d},l.parseExpression=function(d,g){for(var x=[];;){this.mode==="math"&&this.consumeSpaces();var L=this.fetch();if(R.endOfExpression.indexOf(L.text)!==-1||g&&L.text===g||d&&bs[L.text]&&bs[L.text].infix)break;var W=this.parseAtom(g);if(!W)break;x.push(W)}return this.mode==="text"&&this.formLigatures(x),this.handleInfixNodes(x)},l.handleInfixNodes=function(d){for(var g=-1,x,L=0;L<d.length;L++){var W=Vr(d[L],"infix");if(W){if(g!==-1)throw new _("only one infix operator per group",W.token);g=L,x=W.replaceWith}}if(g!==-1&&x){var ne,ge,Le=d.slice(0,g),Ke=d.slice(g+1);Le.length===1&&Le[0].type==="ordgroup"?ne=Le[0]:ne={type:"ordgroup",mode:this.mode,body:Le},Ke.length===1&&Ke[0].type==="ordgroup"?ge=Ke[0]:ge={type:"ordgroup",mode:this.mode,body:Ke};var rt;return x==="\\\\abovefrac"?rt=this.callFunction(x,[ne,d[g],ge],[]):rt=this.callFunction(x,[ne,ge],[]),[rt]}else return d},l.handleSupSubscript=function(d){var g=this.fetch(),x=g.text;this.consume();var L=this.parseGroup(d,!1,R.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!L)throw new _("Expected group after '"+x+"'",g);return L},l.formatUnsupportedCmd=function(d){for(var g=[],x=0;x<d.length;x++)g.push({type:"textord",mode:"text",text:d[x]});var L={type:"text",mode:this.mode,body:g},W={type:"color",mode:this.mode,color:this.settings.errorColor,body:[L]};return W},l.parseAtom=function(d){var g=this.parseGroup("atom",!1,null,d);if(this.mode==="text")return g;for(var x,L;;){this.consumeSpaces();var W=this.fetch();if(W.text==="\\limits"||W.text==="\\nolimits"){var ne=Vr(g,"op");if(ne){var ge=W.text==="\\limits";ne.limits=ge,ne.alwaysHandleSupSub=!0}else if(ne=Vr(g,"operatorname"),ne&&ne.alwaysHandleSupSub){var Le=W.text==="\\limits";ne.limits=Le}else throw new _("Limit controls must follow a math operator",W);this.consume()}else if(W.text==="^"){if(x)throw new _("Double superscript",W);x=this.handleSupSubscript("superscript")}else if(W.text==="_"){if(L)throw new _("Double subscript",W);L=this.handleSupSubscript("subscript")}else if(W.text==="'"){if(x)throw new _("Double superscript",W);var Ke={type:"textord",mode:this.mode,text:"\\prime"},rt=[Ke];for(this.consume();this.fetch().text==="'";)rt.push(Ke),this.consume();this.fetch().text==="^"&&rt.push(this.handleSupSubscript("superscript")),x={type:"ordgroup",mode:this.mode,body:rt}}else break}return x||L?{type:"supsub",mode:this.mode,base:g,sup:x,sub:L}:g},l.parseFunction=function(d,g,x){var L=this.fetch(),W=L.text,ne=bs[W];if(!ne)return null;if(this.consume(),x!=null&&ne.greediness<=x)throw new _("Got function '"+W+"' with no arguments"+(g?" as "+g:""),L);if(this.mode==="text"&&!ne.allowedInText)throw new _("Can't use function '"+W+"' in text mode",L);if(this.mode==="math"&&ne.allowedInMath===!1)throw new _("Can't use function '"+W+"' in math mode",L);var ge=this.parseArguments(W,ne),Le=ge.args,Ke=ge.optArgs;return this.callFunction(W,Le,Ke,L,d)},l.callFunction=function(d,g,x,L,W){var ne={funcName:d,parser:this,token:L,breakOnTokenText:W},ge=bs[d];if(ge&&ge.handler)return ge.handler(ne,g,x);throw new _("No function handler for "+d)},l.parseArguments=function(d,g){var x=g.numArgs+g.numOptionalArgs;if(x===0)return{args:[],optArgs:[]};for(var L=g.greediness,W=[],ne=[],ge=0;ge<x;ge++){var Le=g.argTypes&&g.argTypes[ge],Ke=ge<g.numOptionalArgs,rt=ge>0&&!Ke||ge===0&&!Ke&&this.mode==="math",dt=this.parseGroupOfType("argument to '"+d+"'",Le,Ke,L,rt);if(!dt){if(Ke){ne.push(null);continue}throw new _("Expected group after '"+d+"'",this.fetch())}(Ke?ne:W).push(dt)}return{args:W,optArgs:ne}},l.parseGroupOfType=function(d,g,x,L,W){switch(g){case"color":return W&&this.consumeSpaces(),this.parseColorGroup(x);case"size":return W&&this.consumeSpaces(),this.parseSizeGroup(x);case"url":return this.parseUrlGroup(x,W);case"math":case"text":return this.parseGroup(d,x,L,void 0,g,W);case"hbox":{var ne=this.parseGroup(d,x,L,void 0,"text",W);if(!ne)return ne;var ge={type:"styling",mode:ne.mode,body:[ne],style:"text"};return ge}case"raw":{if(W&&this.consumeSpaces(),x&&this.fetch().text==="{")return null;var Le=this.parseStringGroup("raw",x,!0);if(Le)return{type:"raw",mode:"text",string:Le.text};throw new _("Expected raw group",this.fetch())}case"original":case null:case void 0:return this.parseGroup(d,x,L,void 0,void 0,W);default:throw new _("Unknown group type as "+d,this.fetch())}},l.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},l.parseStringGroup=function(d,g,x){var L=g?"[":"{",W=g?"]":"}",ne=this.fetch();if(ne.text!==L){if(g)return null;if(x&&ne.text!=="EOF"&&/[^{}[\]]/.test(ne.text))return this.consume(),ne}var ge=this.mode;this.mode="text",this.expect(L);for(var Le="",Ke=this.fetch(),rt=0,dt=Ke,Et;(Et=this.fetch()).text!==W||x&&rt>0;){switch(Et.text){case"EOF":throw new _("Unexpected end of input in "+d,Ke.range(dt,Le));case L:rt++;break;case W:rt--;break}dt=Et,Le+=dt.text,this.consume()}return this.expect(W),this.mode=ge,Ke.range(dt,Le)},l.parseRegexGroup=function(d,g){var x=this.mode;this.mode="text";for(var L=this.fetch(),W=L,ne="",ge;(ge=this.fetch()).text!=="EOF"&&d.test(ne+ge.text);)W=ge,ne+=W.text,this.consume();if(ne==="")throw new _("Invalid "+g+": '"+L.text+"'",L);return this.mode=x,L.range(W,ne)},l.parseColorGroup=function(d){var g=this.parseStringGroup("color",d);if(!g)return null;var x=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(g.text);if(!x)throw new _("Invalid color: '"+g.text+"'",g);var L=x[0];return/^[0-9a-f]{6}$/i.test(L)&&(L="#"+L),{type:"color-token",mode:this.mode,color:L}},l.parseSizeGroup=function(d){var g,x=!1;if(!d&&this.fetch().text!=="{"?g=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):g=this.parseStringGroup("size",d),!g)return null;!d&&g.text.length===0&&(g.text="0pt",x=!0);var L=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(g.text);if(!L)throw new _("Invalid size: '"+g.text+"'",g);var W={number:+(L[1]+L[2]),unit:L[3]};if(!Nr(W))throw new _("Invalid unit: '"+W.unit+"'",g);return{type:"size",mode:this.mode,value:W,isBlank:x}},l.parseUrlGroup=function(d,g){this.gullet.lexer.setCatcode("%",13);var x=this.parseStringGroup("url",d,!0);if(this.gullet.lexer.setCatcode("%",14),!x)return null;var L=x.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:L}},l.parseGroup=function(d,g,x,L,W,ne){var ge=this.mode;W&&this.switchMode(W),ne&&this.consumeSpaces();var Le=this.fetch(),Ke=Le.text,rt;if(g?Ke==="[":Ke==="{"||Ke==="\\begingroup"){this.consume();var dt=R.endOfGroup[Ke];this.gullet.beginGroup();var Et=this.parseExpression(!1,dt),Mt=this.fetch();this.expect(dt),this.gullet.endGroup(),rt={type:"ordgroup",mode:this.mode,loc:Be.range(Le,Mt),body:Et,semisimple:Ke==="\\begingroup"||void 0}}else if(g)rt=null;else if(rt=this.parseFunction(L,d,x)||this.parseSymbol(),rt==null&&Ke[0]==="\\"&&!va.hasOwnProperty(Ke)){if(this.settings.throwOnError)throw new _("Undefined control sequence: "+Ke,Le);rt=this.formatUnsupportedCmd(Ke),this.consume()}return W&&this.switchMode(ge),rt},l.formLigatures=function(d){for(var g=d.length-1,x=0;x<g;++x){var L=d[x],W=L.text;W==="-"&&d[x+1].text==="-"&&(x+1<g&&d[x+2].text==="-"?(d.splice(x,3,{type:"textord",mode:"text",loc:Be.range(L,d[x+2]),text:"---"}),g-=2):(d.splice(x,2,{type:"textord",mode:"text",loc:Be.range(L,d[x+1]),text:"--"}),g-=1)),(W==="'"||W==="`")&&d[x+1].text===W&&(d.splice(x,2,{type:"textord",mode:"text",loc:Be.range(L,d[x+1]),text:W+W}),g-=1)}},l.parseSymbol=function(){var d=this.fetch(),g=d.text;if(/^\\verb[^a-zA-Z]/.test(g)){this.consume();var x=g.slice(5),L=x.charAt(0)==="*";if(L&&(x=x.slice(1)),x.length<2||x.charAt(0)!==x.slice(-1))throw new _(`\\verb assertion failed --
please report what input caused this bug`);return x=x.slice(1,-1),{type:"verb",mode:"text",body:x,star:L}}Ns.hasOwnProperty(g[0])&&!Rt[this.mode][g[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+g[0]+'" used in math mode',d),g=Ns[g[0]]+g.substr(1));var W=Ro.exec(g);W&&(g=g.substring(0,W.index),g==="i"?g="\u0131":g==="j"&&(g="\u0237"));var ne;if(Rt[this.mode][g]){this.settings.strict&&this.mode==="math"&&wr.indexOf(g)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+g[0]+'" used in math mode',d);var ge=Rt[this.mode][g].group,Le=Be.range(d),Ke;if(Tt.hasOwnProperty(ge)){var rt=ge;Ke={type:"atom",mode:this.mode,family:rt,loc:Le,text:g}}else Ke={type:ge,mode:this.mode,loc:Le,text:g};ne=Ke}else if(g.charCodeAt(0)>=128)this.settings.strict&&(Ue(g.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+g[0]+'" used in math mode',d):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+g[0]+'"'+(" ("+g.charCodeAt(0)+")"),d)),ne={type:"textord",mode:"text",loc:Be.range(d),text:g};else return null;if(this.consume(),W)for(var dt=0;dt<W[0].length;dt++){var Et=W[0][dt];if(!Ja[Et])throw new _("Unknown accent ' "+Et+"'",d);var Mt=Ja[Et][this.mode];if(!Mt)throw new _("Accent "+Et+" unsupported in "+this.mode+" mode",d);ne={type:"accent",mode:this.mode,loc:Be.range(d),label:Mt,isStretchy:!1,isShifty:!0,base:ne}}return ne},R}();yn.endOfExpression=["}","\\endgroup","\\end","\\right","&"],yn.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},yn.SUPSUB_GREEDINESS=1;var hi=function(l,f){if(!(typeof l=="string"||l instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var d=new yn(l,f);delete d.gullet.macros.current["\\df@tag"];var g=d.parse();if(d.gullet.macros.get("\\df@tag")){if(!f.displayMode)throw new _("\\tag works only in display equations");d.gullet.feed("\\df@tag"),g=[{type:"tag",mode:"text",body:g,tag:d.parse()}]}return g},Es=hi,eo=function(l,f,d){f.textContent="";var g=ya(l,d).toNode();f.appendChild(g)};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."),eo=function(){throw new _("KaTeX doesn't work in quirks mode.")});var Us=function(l,f){var d=ya(l,f).toMarkup();return d},Oo=function(l,f){var d=new I(f);return Es(l,d)},to=function(l,f,d){if(d.throwOnError||!(l instanceof _))throw l;var g=Qe.makeSpan(["katex-error"],[new Se(f)]);return g.setAttribute("title",l.toString()),g.setAttribute("style","color:"+d.errorColor),g},ya=function(l,f){var d=new I(f);try{var g=Es(l,d);return _n(g,l,d)}catch(x){return to(x,l,d)}},Mo=function(l,f){var d=new I(f);try{var g=Es(l,d);return Mi(g,l,d)}catch(x){return to(x,l,d)}},ro={version:"0.11.1",render:eo,renderToString:Us,ParseError:_,__parse:Oo,__renderToDomTree:ya,__renderToHTMLTree:Mo,__setFontMetrics:$t,__defineSymbol:y,__defineMacro:ue,__domTree:{Span:Ve,Anchor:Je,SymbolNode:Se,SvgNode:je,PathNode:Ge,LineNode:Ze}},Fo=X.default=ro}]).default})},32834:function(Kt){(function(it,X){Kt.exports=X()})(this,function(){"use strict";function it(xe,ke){for(var Re=0;Re<ke.length;Re++){var G=ke[Re];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(xe,G.key,G)}}function X(xe,ke,Re){return ke&&it(xe.prototype,ke),Re&&it(xe,Re),xe}function F(xe,ke){if(xe){if(typeof xe=="string")return Te(xe,ke);var Re=Object.prototype.toString.call(xe).slice(8,-1);if(Re==="Object"&&xe.constructor&&(Re=xe.constructor.name),Re==="Map"||Re==="Set")return Array.from(xe);if(Re==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Re))return Te(xe,ke)}}function Te(xe,ke){(ke==null||ke>xe.length)&&(ke=xe.length);for(var Re=0,G=new Array(ke);Re<ke;Re++)G[Re]=xe[Re];return G}function Be(xe,ke){var Re=typeof Symbol!="undefined"&&xe[Symbol.iterator]||xe["@@iterator"];if(Re)return(Re=Re.call(xe)).next.bind(Re);if(Array.isArray(xe)||(Re=F(xe))||ke&&xe&&typeof xe.length=="number"){Re&&(xe=Re);var G=0;return function(){return G>=xe.length?{done:!0}:{done:!1,value:xe[G++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ye={exports:{}};function te(){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 _(xe){ye.exports.defaults=xe}ye.exports={defaults:te(),getDefaults:te,changeDefaults:_};var De=/[&<>"']/,pe=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,Q=/[<>"']|&(?!#?\w+;)/g,B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},b=function(ke){return B[ke]};function k(xe,ke){if(ke){if(De.test(xe))return xe.replace(pe,b)}else if(u.test(xe))return xe.replace(Q,b);return xe}var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function C(xe){return xe.replace(S,function(ke,Re){return Re=Re.toLowerCase(),Re==="colon"?":":Re.charAt(0)==="#"?Re.charAt(1)==="x"?String.fromCharCode(parseInt(Re.substring(2),16)):String.fromCharCode(+Re.substring(1)):""})}var H=/(^|[^\[])\^/g;function V(xe,ke){xe=xe.source||xe,ke=ke||"";var Re={replace:function(q,me){return me=me.source||me,me=me.replace(H,"$1"),xe=xe.replace(q,me),Re},getRegex:function(){return new RegExp(xe,ke)}};return Re}var M=/[^\w:]/g,I=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function z(xe,ke,Re){if(xe){var G;try{G=decodeURIComponent(C(Re)).replace(M,"").toLowerCase()}catch(q){return null}if(G.indexOf("javascript:")===0||G.indexOf("vbscript:")===0||G.indexOf("data:")===0)return null}ke&&!I.test(Re)&&(Re=ce(ke,Re));try{Re=encodeURI(Re).replace(/%25/g,"%")}catch(q){return null}return Re}var ae={},ee=/^[^:]+:\/*[^/]*$/,_e=/^([^:]+:)[\s\S]*$/,be=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ce(xe,ke){ae[" "+xe]||(ee.test(xe)?ae[" "+xe]=xe+"/":ae[" "+xe]=We(xe,"/",!0)),xe=ae[" "+xe];var Re=xe.indexOf(":")===-1;return ke.substring(0,2)==="//"?Re?ke:xe.replace(_e,"$1")+ke:ke.charAt(0)==="/"?Re?ke:xe.replace(be,"$1")+ke:xe+ke}var ve={exec:function(){}};function Ie(xe){for(var ke=1,Re,G;ke<arguments.length;ke++){Re=arguments[ke];for(G in Re)Object.prototype.hasOwnProperty.call(Re,G)&&(xe[G]=Re[G])}return xe}function Ae(xe,ke){var Re=xe.replace(/\|/g,function(me,we,O){for(var ht=!1,he=we;--he>=0&&O[he]==="\\";)ht=!ht;return ht?"|":" |"}),G=Re.split(/ \|/),q=0;if(G.length>ke)G.splice(ke);else for(;G.length<ke;)G.push("");for(;q<G.length;q++)G[q]=G[q].trim().replace(/\\\|/g,"|");return G}function We(xe,ke,Re){var G=xe.length;if(G===0)return"";for(var q=0;q<G;){var me=xe.charAt(G-q-1);if(me===ke&&!Re)q++;else if(me!==ke&&Re)q++;else break}return xe.substr(0,G-q)}function Y(xe,ke){if(xe.indexOf(ke[1])===-1)return-1;for(var Re=xe.length,G=0,q=0;q<Re;q++)if(xe[q]==="\\")q++;else if(xe[q]===ke[0])G++;else if(xe[q]===ke[1]&&(G--,G<0))return q;return-1}function P(xe){xe&&xe.sanitize&&!xe.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 j(xe,ke){if(ke<1)return"";for(var Re="";ke>1;)ke&1&&(Re+=xe),ke>>=1,xe+=xe;return Re+xe}var J={escape:k,unescape:C,edit:V,cleanUrl:z,resolveUrl:ce,noopTest:ve,merge:Ie,splitCells:Ae,rtrim:We,findClosingBracket:Y,checkSanitizeDeprecation:P,repeatString:j},se=ye.exports.defaults,Z=J.rtrim,w=J.splitCells,E=J.escape,K=J.findClosingBracket;function de(xe,ke,Re){var G=ke.href,q=ke.title?E(ke.title):null,me=xe[1].replace(/\\([\[\]])/g,"$1");return xe[0].charAt(0)!=="!"?{type:"link",raw:Re,href:G,title:q,text:me}:{type:"image",raw:Re,href:G,title:q,text:E(me)}}function Ue(xe,ke){var Re=xe.match(/^(\s+)(?:```)/);if(Re===null)return ke;var G=Re[1];return ke.split(`
`).map(function(q){var me=q.match(/^\s+/);if(me===null)return q;var we=me[0];return we.length>=G.length?q.slice(G.length):q}).join(`
`)}var Ye=function(){function xe(Re){this.options=Re||se}var ke=xe.prototype;return ke.space=function(G){var q=this.rules.block.newline.exec(G);if(q)return q[0].length>1?{type:"space",raw:q[0]}:{raw:`
`}},ke.code=function(G){var q=this.rules.block.code.exec(G);if(q){var me=q[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?me:Z(me,`
`)}}},ke.fences=function(G){var q=this.rules.block.fences.exec(G);if(q){var me=q[0],we=Ue(me,q[3]||"");return{type:"code",raw:me,lang:q[2]?q[2].trim():q[2],text:we}}},ke.heading=function(G){var q=this.rules.block.heading.exec(G);if(q){var me=q[2].trim();if(/#$/.test(me)){var we=Z(me,"#");(this.options.pedantic||!we||/ $/.test(we))&&(me=we.trim())}return{type:"heading",raw:q[0],depth:q[1].length,text:me}}},ke.nptable=function(G){var q=this.rules.block.nptable.exec(G);if(q){var me={type:"table",header:w(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
`):[],raw:q[0]};if(me.header.length===me.align.length){var we=me.align.length,O;for(O=0;O<we;O++)/^ *-+: *$/.test(me.align[O])?me.align[O]="right":/^ *:-+: *$/.test(me.align[O])?me.align[O]="center":/^ *:-+ *$/.test(me.align[O])?me.align[O]="left":me.align[O]=null;for(we=me.cells.length,O=0;O<we;O++)me.cells[O]=w(me.cells[O],me.header.length);return me}}},ke.hr=function(G){var q=this.rules.block.hr.exec(G);if(q)return{type:"hr",raw:q[0]}},ke.blockquote=function(G){var q=this.rules.block.blockquote.exec(G);if(q){var me=q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:q[0],text:me}}},ke.list=function(G){var q=this.rules.block.list.exec(G);if(q){var me=q[0],we=q[2],O=we.length>1,ht={type:"list",raw:me,ordered:O,start:O?+we.slice(0,-1):"",loose:!1,items:[]},he=q[0].match(this.rules.block.item),It=!1,Ot,er,Dr,lr,Wt,Mr,Xr,Er,_r,At=he.length;Dr=this.rules.block.listItemStart.exec(he[0]);for(var pt=0;pt<At;pt++){if(Ot=he[pt],me=Ot,this.options.pedantic||(_r=Ot.match(new RegExp("\\n\\s*\\n {0,"+(Dr[0].length-1)+"}\\S")),_r&&(Wt=Ot.length-_r.index+he.slice(pt+1).join(`
`).length,ht.raw=ht.raw.substring(0,ht.raw.length-Wt),Ot=Ot.substring(0,_r.index),me=Ot,At=pt+1)),pt!==At-1){if(lr=this.rules.block.listItemStart.exec(he[pt+1]),this.options.pedantic?lr[1].length>Dr[1].length:lr[1].length>=Dr[0].length||lr[1].length>3){he.splice(pt,2,he[pt]+(!this.options.pedantic&&lr[1].length<Dr[0].length&&!he[pt].match(/\n$/)?"":`
`)+he[pt+1]),pt--,At--;continue}else(!this.options.pedantic||this.options.smartLists?lr[2][lr[2].length-1]!==we[we.length-1]:O===(lr[2].length===1))&&(Wt=he.slice(pt+1).join(`
`).length,ht.raw=ht.raw.substring(0,ht.raw.length-Wt),pt=At-1);Dr=lr}er=Ot.length,Ot=Ot.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Ot.indexOf(`
`)&&(er-=Ot.length,Ot=this.options.pedantic?Ot.replace(/^ {1,4}/gm,""):Ot.replace(new RegExp("^ {1,"+er+"}","gm"),"")),Ot=Z(Ot,`
`),pt!==At-1&&(me=me+`
`),Mr=It||/\n\n(?!\s*$)/.test(me),pt!==At-1&&(It=me.slice(-2)===`
`,Mr||(Mr=It)),Mr&&(ht.loose=!0),this.options.gfm&&(Xr=/^\[[ xX]\] /.test(Ot),Er=void 0,Xr&&(Er=Ot[1]!==" ",Ot=Ot.replace(/^\[[ xX]\] +/,""))),ht.items.push({type:"list_item",raw:me,task:Xr,checked:Er,loose:Mr,text:Ot})}return ht}},ke.html=function(G){var q=this.rules.block.html.exec(G);if(q)return{type:this.options.sanitize?"paragraph":"html",raw:q[0],pre:!this.options.sanitizer&&(q[1]==="pre"||q[1]==="script"||q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):E(q[0]):q[0]}},ke.def=function(G){var q=this.rules.block.def.exec(G);if(q){q[3]&&(q[3]=q[3].substring(1,q[3].length-1));var me=q[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:me,raw:q[0],href:q[2],title:q[3]}}},ke.table=function(G){var q=this.rules.block.table.exec(G);if(q){var me={type:"table",header:w(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
`):[]};if(me.header.length===me.align.length){me.raw=q[0];var we=me.align.length,O;for(O=0;O<we;O++)/^ *-+: *$/.test(me.align[O])?me.align[O]="right":/^ *:-+: *$/.test(me.align[O])?me.align[O]="center":/^ *:-+ *$/.test(me.align[O])?me.align[O]="left":me.align[O]=null;for(we=me.cells.length,O=0;O<we;O++)me.cells[O]=w(me.cells[O].replace(/^ *\| *| *\| *$/g,""),me.header.length);return me}}},ke.lheading=function(G){var q=this.rules.block.lheading.exec(G);if(q)return{type:"heading",raw:q[0],depth:q[2].charAt(0)==="="?1:2,text:q[1]}},ke.paragraph=function(G){var q=this.rules.block.paragraph.exec(G);if(q)return{type:"paragraph",raw:q[0],text:q[1].charAt(q[1].length-1)===`
`?q[1].slice(0,-1):q[1]}},ke.text=function(G){var q=this.rules.block.text.exec(G);if(q)return{type:"text",raw:q[0],text:q[0]}},ke.escape=function(G){var q=this.rules.inline.escape.exec(G);if(q)return{type:"escape",raw:q[0],text:E(q[1])}},ke.tag=function(G,q,me){var we=this.rules.inline.tag.exec(G);if(we)return!q&&/^<a /i.test(we[0])?q=!0:q&&/^<\/a>/i.test(we[0])&&(q=!1),!me&&/^<(pre|code|kbd|script)(\s|>)/i.test(we[0])?me=!0:me&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(we[0])&&(me=!1),{type:this.options.sanitize?"text":"html",raw:we[0],inLink:q,inRawBlock:me,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(we[0]):E(we[0]):we[0]}},ke.link=function(G){var q=this.rules.inline.link.exec(G);if(q){var me=q[2].trim();if(!this.options.pedantic&&/^</.test(me)){if(!/>$/.test(me))return;var we=Z(me.slice(0,-1),"\\");if((me.length-we.length)%2===0)return}else{var O=K(q[2],"()");if(O>-1){var ht=q[0].indexOf("!")===0?5:4,he=ht+q[1].length+O;q[2]=q[2].substring(0,O),q[0]=q[0].substring(0,he).trim(),q[3]=""}}var It=q[2],Ot="";if(this.options.pedantic){var er=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(It);er&&(It=er[1],Ot=er[3])}else Ot=q[3]?q[3].slice(1,-1):"";return It=It.trim(),/^</.test(It)&&(this.options.pedantic&&!/>$/.test(me)?It=It.slice(1):It=It.slice(1,-1)),de(q,{href:It&&It.replace(this.rules.inline._escapes,"$1"),title:Ot&&Ot.replace(this.rules.inline._escapes,"$1")},q[0])}},ke.reflink=function(G,q){var me;if((me=this.rules.inline.reflink.exec(G))||(me=this.rules.inline.nolink.exec(G))){var we=(me[2]||me[1]).replace(/\s+/g," ");if(we=q[we.toLowerCase()],!we||!we.href){var O=me[0].charAt(0);return{type:"text",raw:O,text:O}}return de(me,we,me[0])}},ke.emStrong=function(G,q,me){me===void 0&&(me="");var we=this.rules.inline.emStrong.lDelim.exec(G);if(we&&!(we[3]&&me.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 O=we[1]||we[2]||"";if(!O||O&&(me===""||this.rules.inline.punctuation.exec(me))){var ht=we[0].length-1,he,It,Ot=ht,er=0,Dr=we[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Dr.lastIndex=0,q=q.slice(-1*G.length+ht);(we=Dr.exec(q))!=null;)if(he=we[1]||we[2]||we[3]||we[4]||we[5]||we[6],!!he){if(It=he.length,we[3]||we[4]){Ot+=It;continue}else if((we[5]||we[6])&&ht%3&&!((ht+It)%3)){er+=It;continue}if(Ot-=It,!(Ot>0))return It=Math.min(It,It+Ot+er),Math.min(ht,It)%2?{type:"em",raw:G.slice(0,ht+we.index+It+1),text:G.slice(1,ht+we.index+It)}:{type:"strong",raw:G.slice(0,ht+we.index+It+1),text:G.slice(2,ht+we.index+It-1)}}}}},ke.codespan=function(G){var q=this.rules.inline.code.exec(G);if(q){var me=q[2].replace(/\n/g," "),we=/[^ ]/.test(me),O=/^ /.test(me)&&/ $/.test(me);return we&&O&&(me=me.substring(1,me.length-1)),me=E(me,!0),{type:"codespan",raw:q[0],text:me}}},ke.br=function(G){var q=this.rules.inline.br.exec(G);if(q)return{type:"br",raw:q[0]}},ke.del=function(G){var q=this.rules.inline.del.exec(G);if(q)return{type:"del",raw:q[0],text:q[2]}},ke.autolink=function(G,q){var me=this.rules.inline.autolink.exec(G);if(me){var we,O;return me[2]==="@"?(we=E(this.options.mangle?q(me[1]):me[1]),O="mailto:"+we):(we=E(me[1]),O=we),{type:"link",raw:me[0],text:we,href:O,tokens:[{type:"text",raw:we,text:we}]}}},ke.url=function(G,q){var me;if(me=this.rules.inline.url.exec(G)){var we,O;if(me[2]==="@")we=E(this.options.mangle?q(me[0]):me[0]),O="mailto:"+we;else{var ht;do ht=me[0],me[0]=this.rules.inline._backpedal.exec(me[0])[0];while(ht!==me[0]);we=E(me[0]),me[1]==="www."?O="http://"+we:O=we}return{type:"link",raw:me[0],text:we,href:O,tokens:[{type:"text",raw:we,text:we}]}}},ke.inlineText=function(G,q,me){var we=this.rules.inline.text.exec(G);if(we){var O;return q?O=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(we[0]):E(we[0]):we[0]:O=E(this.options.smartypants?me(we[0]):we[0]),{type:"text",raw:we[0],text:O}}},xe}(),ct=J.noopTest,at=J.edit,Dt=J.merge,bt={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:ct,table:ct,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};bt._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,bt._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,bt.def=at(bt.def).replace("label",bt._label).replace("title",bt._title).getRegex(),bt.bullet=/(?:[*+-]|\d{1,9}[.)])/,bt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,bt.item=at(bt.item,"gm").replace(/bull/g,bt.bullet).getRegex(),bt.listItemStart=at(/^( *)(bull) */).replace("bull",bt.bullet).getRegex(),bt.list=at(bt.list).replace(/bull/g,bt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+bt.def.source+")").getRegex(),bt._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",bt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,bt.html=at(bt.html,"i").replace("comment",bt._comment).replace("tag",bt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bt.paragraph=at(bt._paragraph).replace("hr",bt.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",bt._tag).getRegex(),bt.blockquote=at(bt.blockquote).replace("paragraph",bt.paragraph).getRegex(),bt.normal=Dt({},bt),bt.gfm=Dt({},bt.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*|$)"}),bt.gfm.nptable=at(bt.gfm.nptable).replace("hr",bt.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",bt._tag).getRegex(),bt.gfm.table=at(bt.gfm.table).replace("hr",bt.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",bt._tag).getRegex(),bt.pedantic=Dt({},bt.normal,{html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bt._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:ct,paragraph:at(bt.normal._paragraph).replace("hr",bt.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",bt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ot={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ct,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:ct,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};ot._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ot.punctuation=at(ot.punctuation).replace(/punctuation/g,ot._punctuation).getRegex(),ot.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ot.escapedEmSt=/\\\*|\\_/g,ot._comment=at(bt._comment).replace("(?:-->|$)","-->").getRegex(),ot.emStrong.lDelim=at(ot.emStrong.lDelim).replace(/punct/g,ot._punctuation).getRegex(),ot.emStrong.rDelimAst=at(ot.emStrong.rDelimAst,"g").replace(/punct/g,ot._punctuation).getRegex(),ot.emStrong.rDelimUnd=at(ot.emStrong.rDelimUnd,"g").replace(/punct/g,ot._punctuation).getRegex(),ot._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ot._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ot._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])?)+(?![-_])/,ot.autolink=at(ot.autolink).replace("scheme",ot._scheme).replace("email",ot._email).getRegex(),ot._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ot.tag=at(ot.tag).replace("comment",ot._comment).replace("attribute",ot._attribute).getRegex(),ot._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ot._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ot._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ot.link=at(ot.link).replace("label",ot._label).replace("href",ot._href).replace("title",ot._title).getRegex(),ot.reflink=at(ot.reflink).replace("label",ot._label).getRegex(),ot.reflinkSearch=at(ot.reflinkSearch,"g").replace("reflink",ot.reflink).replace("nolink",ot.nolink).getRegex(),ot.normal=Dt({},ot),ot.pedantic=Dt({},ot.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:at(/^!?\[(label)\]\((.*?)\)/).replace("label",ot._label).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ot._label).getRegex()}),ot.gfm=Dt({},ot.normal,{escape:at(ot.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),ot.gfm.url=at(ot.gfm.url,"i").replace("email",ot.gfm._extended_email).getRegex(),ot.breaks=Dt({},ot.gfm,{br:at(ot.br).replace("{2,}","*").getRegex(),text:at(ot.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Qt={block:bt,inline:ot},nt=Ye,kt=ye.exports.defaults,et=Qt.block,Nt=Qt.inline,Pe=J.repeatString;function $e(xe){return xe.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 Ee(xe){var ke="",Re,G,q=xe.length;for(Re=0;Re<q;Re++)G=xe.charCodeAt(Re),Math.random()>.5&&(G="x"+G.toString(16)),ke+="&#"+G+";";return ke}var Ve=function(){function xe(Re){this.tokens=[],this.tokens.links=Object.create(null),this.options=Re||kt,this.options.tokenizer=this.options.tokenizer||new nt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var G={block:et.normal,inline:Nt.normal};this.options.pedantic?(G.block=et.pedantic,G.inline=Nt.pedantic):this.options.gfm&&(G.block=et.gfm,this.options.breaks?G.inline=Nt.breaks:G.inline=Nt.gfm),this.tokenizer.rules=G}xe.lex=function(G,q){var me=new xe(q);return me.lex(G)},xe.lexInline=function(G,q){var me=new xe(q);return me.inlineTokens(G)};var ke=xe.prototype;return ke.lex=function(G){return G=G.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(G,this.tokens,!0),this.inline(this.tokens),this.tokens},ke.blockTokens=function(G,q,me){q===void 0&&(q=[]),me===void 0&&(me=!0),this.options.pedantic&&(G=G.replace(/^ +$/gm,""));for(var we,O,ht,he;G;){if(we=this.tokenizer.space(G)){G=G.substring(we.raw.length),we.type&&q.push(we);continue}if(we=this.tokenizer.code(G)){G=G.substring(we.raw.length),he=q[q.length-1],he&&he.type==="paragraph"?(he.raw+=`
`+we.raw,he.text+=`
`+we.text):q.push(we);continue}if(we=this.tokenizer.fences(G)){G=G.substring(we.raw.length),q.push(we);continue}if(we=this.tokenizer.heading(G)){G=G.substring(we.raw.length),q.push(we);continue}if(we=this.tokenizer.nptable(G)){G=G.substring(we.raw.length),q.push(we);continue}if(we=this.tokenizer.hr(G)){G=G.substring(we.raw.length),q.push(we);continue}if(we=this.tokenizer.blockquote(G)){G=G.substring(we.raw.length),we.tokens=this.blockTokens(we.text,[],me),q.push(we);continue}if(we=this.tokenizer.list(G)){for(G=G.substring(we.raw.length),ht=we.items.length,O=0;O<ht;O++)we.items[O].tokens=this.blockTokens(we.items[O].text,[],!1);q.push(we);continue}if(we=this.tokenizer.html(G)){G=G.substring(we.raw.length),q.push(we);continue}if(me&&(we=this.tokenizer.def(G))){G=G.substring(we.raw.length),this.tokens.links[we.tag]||(this.tokens.links[we.tag]={href:we.href,title:we.title});continue}if(we=this.tokenizer.table(G)){G=G.substring(we.raw.length),q.push(we);continue}if(we=this.tokenizer.lheading(G)){G=G.substring(we.raw.length),q.push(we);continue}if(me&&(we=this.tokenizer.paragraph(G))){G=G.substring(we.raw.length),q.push(we);continue}if(we=this.tokenizer.text(G)){G=G.substring(we.raw.length),he=q[q.length-1],he&&he.type==="text"?(he.raw+=`
`+we.raw,he.text+=`
`+we.text):q.push(we);continue}if(G){var It="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(It);break}else throw new Error(It)}}return q},ke.inline=function(G){var q,me,we,O,ht,he,It=G.length;for(q=0;q<It;q++)switch(he=G[q],he.type){case"paragraph":case"text":case"heading":{he.tokens=[],this.inlineTokens(he.text,he.tokens);break}case"table":{for(he.tokens={header:[],cells:[]},O=he.header.length,me=0;me<O;me++)he.tokens.header[me]=[],this.inlineTokens(he.header[me],he.tokens.header[me]);for(O=he.cells.length,me=0;me<O;me++)for(ht=he.cells[me],he.tokens.cells[me]=[],we=0;we<ht.length;we++)he.tokens.cells[me][we]=[],this.inlineTokens(ht[we],he.tokens.cells[me][we]);break}case"blockquote":{this.inline(he.tokens);break}case"list":{for(O=he.items.length,me=0;me<O;me++)this.inline(he.items[me].tokens);break}}return G},ke.inlineTokens=function(G,q,me,we){q===void 0&&(q=[]),me===void 0&&(me=!1),we===void 0&&(we=!1);var O,ht,he=G,It,Ot,er;if(this.tokens.links){var Dr=Object.keys(this.tokens.links);if(Dr.length>0)for(;(It=this.tokenizer.rules.inline.reflinkSearch.exec(he))!=null;)Dr.includes(It[0].slice(It[0].lastIndexOf("[")+1,-1))&&(he=he.slice(0,It.index)+"["+Pe("a",It[0].length-2)+"]"+he.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(It=this.tokenizer.rules.inline.blockSkip.exec(he))!=null;)he=he.slice(0,It.index)+"["+Pe("a",It[0].length-2)+"]"+he.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(It=this.tokenizer.rules.inline.escapedEmSt.exec(he))!=null;)he=he.slice(0,It.index)+"++"+he.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;G;){if(Ot||(er=""),Ot=!1,O=this.tokenizer.escape(G)){G=G.substring(O.raw.length),q.push(O);continue}if(O=this.tokenizer.tag(G,me,we)){G=G.substring(O.raw.length),me=O.inLink,we=O.inRawBlock;var lr=q[q.length-1];lr&&O.type==="text"&&lr.type==="text"?(lr.raw+=O.raw,lr.text+=O.text):q.push(O);continue}if(O=this.tokenizer.link(G)){G=G.substring(O.raw.length),O.type==="link"&&(O.tokens=this.inlineTokens(O.text,[],!0,we)),q.push(O);continue}if(O=this.tokenizer.reflink(G,this.tokens.links)){G=G.substring(O.raw.length);var Wt=q[q.length-1];O.type==="link"?(O.tokens=this.inlineTokens(O.text,[],!0,we),q.push(O)):Wt&&O.type==="text"&&Wt.type==="text"?(Wt.raw+=O.raw,Wt.text+=O.text):q.push(O);continue}if(O=this.tokenizer.emStrong(G,he,er)){G=G.substring(O.raw.length),O.tokens=this.inlineTokens(O.text,[],me,we),q.push(O);continue}if(O=this.tokenizer.codespan(G)){G=G.substring(O.raw.length),q.push(O);continue}if(O=this.tokenizer.br(G)){G=G.substring(O.raw.length),q.push(O);continue}if(O=this.tokenizer.del(G)){G=G.substring(O.raw.length),O.tokens=this.inlineTokens(O.text,[],me,we),q.push(O);continue}if(O=this.tokenizer.autolink(G,Ee)){G=G.substring(O.raw.length),q.push(O);continue}if(!me&&(O=this.tokenizer.url(G,Ee))){G=G.substring(O.raw.length),q.push(O);continue}if(O=this.tokenizer.inlineText(G,we,$e)){G=G.substring(O.raw.length),O.raw.slice(-1)!=="_"&&(er=O.raw.slice(-1)),Ot=!0,ht=q[q.length-1],ht&&ht.type==="text"?(ht.raw+=O.raw,ht.text+=O.text):q.push(O);continue}if(G){var Mr="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(Mr);break}else throw new Error(Mr)}}return q},X(xe,null,[{key:"rules",get:function(){return{block:et,inline:Nt}}}]),xe}(),Je=ye.exports.defaults,lt=J.cleanUrl,re=J.escape,Se=function(){function xe(Re){this.options=Re||Je}var ke=xe.prototype;return ke.code=function(G,q,me){var we=(q||"").match(/\S*/)[0];if(this.options.highlight){var O=this.options.highlight(G,we);O!=null&&O!==G&&(me=!0,G=O)}return G=G.replace(/\n$/,"")+`
`,we?'<pre><code class="'+this.options.langPrefix+re(we,!0)+'">'+(me?G:re(G,!0))+`</code></pre>
`:"<pre><code>"+(me?G:re(G,!0))+`</code></pre>
`},ke.blockquote=function(G){return`<blockquote>
`+G+`</blockquote>
`},ke.html=function(G){return G},ke.heading=function(G,q,me,we){return this.options.headerIds?"<h"+q+' id="'+this.options.headerPrefix+we.slug(me)+'">'+G+"</h"+q+`>
`:"<h"+q+">"+G+"</h"+q+`>
`},ke.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ke.list=function(G,q,me){var we=q?"ol":"ul",O=q&&me!==1?' start="'+me+'"':"";return"<"+we+O+`>
`+G+"</"+we+`>
`},ke.listitem=function(G){return"<li>"+G+`</li>
`},ke.checkbox=function(G){return"<input "+(G?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ke.paragraph=function(G){return"<p>"+G+`</p>
`},ke.table=function(G,q){return q&&(q="<tbody>"+q+"</tbody>"),`<table>
<thead>
`+G+`</thead>
`+q+`</table>
`},ke.tablerow=function(G){return`<tr>
`+G+`</tr>
`},ke.tablecell=function(G,q){var me=q.header?"th":"td",we=q.align?"<"+me+' align="'+q.align+'">':"<"+me+">";return we+G+"</"+me+`>
`},ke.strong=function(G){return"<strong>"+G+"</strong>"},ke.em=function(G){return"<em>"+G+"</em>"},ke.codespan=function(G){return"<code>"+G+"</code>"},ke.br=function(){return this.options.xhtml?"<br/>":"<br>"},ke.del=function(G){return"<del>"+G+"</del>"},ke.link=function(G,q,me){if(G=lt(this.options.sanitize,this.options.baseUrl,G),G===null)return me;var we='<a href="'+re(G)+'"';return q&&(we+=' title="'+q+'"'),we+=">"+me+"</a>",we},ke.image=function(G,q,me){if(G=lt(this.options.sanitize,this.options.baseUrl,G),G===null)return me;var we='<img src="'+G+'" alt="'+me+'"';return q&&(we+=' title="'+q+'"'),we+=this.options.xhtml?"/>":">",we},ke.text=function(G){return G},xe}(),je=function(){function xe(){}var ke=xe.prototype;return ke.strong=function(G){return G},ke.em=function(G){return G},ke.codespan=function(G){return G},ke.del=function(G){return G},ke.html=function(G){return G},ke.text=function(G){return G},ke.link=function(G,q,me){return""+me},ke.image=function(G,q,me){return""+me},ke.br=function(){return""},xe}(),Ge=function(){function xe(){this.seen={}}var ke=xe.prototype;return ke.serialize=function(G){return G.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ke.getNextSafeSlug=function(G,q){var me=G,we=0;if(this.seen.hasOwnProperty(me)){we=this.seen[G];do we++,me=G+"-"+we;while(this.seen.hasOwnProperty(me))}return q||(this.seen[G]=we,this.seen[me]=0),me},ke.slug=function(G,q){q===void 0&&(q={});var me=this.serialize(G);return this.getNextSafeSlug(me,q.dryrun)},xe}(),Ze=Se,mt=je,Pt=Ge,yt=ye.exports.defaults,_t=J.unescape,vt=function(){function xe(Re){this.options=Re||yt,this.options.renderer=this.options.renderer||new Ze,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new mt,this.slugger=new Pt}xe.parse=function(G,q){var me=new xe(q);return me.parse(G)},xe.parseInline=function(G,q){var me=new xe(q);return me.parseInline(G)};var ke=xe.prototype;return ke.parse=function(G,q){q===void 0&&(q=!0);var me="",we,O,ht,he,It,Ot,er,Dr,lr,Wt,Mr,Xr,Er,_r,At,pt,xt,tr,pr=G.length;for(we=0;we<pr;we++)switch(Wt=G[we],Wt.type){case"space":continue;case"hr":{me+=this.renderer.hr();continue}case"heading":{me+=this.renderer.heading(this.parseInline(Wt.tokens),Wt.depth,_t(this.parseInline(Wt.tokens,this.textRenderer)),this.slugger);continue}case"code":{me+=this.renderer.code(Wt.text,Wt.lang,Wt.escaped);continue}case"table":{for(Dr="",er="",he=Wt.header.length,O=0;O<he;O++)er+=this.renderer.tablecell(this.parseInline(Wt.tokens.header[O]),{header:!0,align:Wt.align[O]});for(Dr+=this.renderer.tablerow(er),lr="",he=Wt.cells.length,O=0;O<he;O++){for(Ot=Wt.tokens.cells[O],er="",It=Ot.length,ht=0;ht<It;ht++)er+=this.renderer.tablecell(this.parseInline(Ot[ht]),{header:!1,align:Wt.align[ht]});lr+=this.renderer.tablerow(er)}me+=this.renderer.table(Dr,lr);continue}case"blockquote":{lr=this.parse(Wt.tokens),me+=this.renderer.blockquote(lr);continue}case"list":{for(Mr=Wt.ordered,Xr=Wt.start,Er=Wt.loose,he=Wt.items.length,lr="",O=0;O<he;O++)At=Wt.items[O],pt=At.checked,xt=At.task,_r="",At.task&&(tr=this.renderer.checkbox(pt),Er?At.tokens.length>0&&At.tokens[0].type==="text"?(At.tokens[0].text=tr+" "+At.tokens[0].text,At.tokens[0].tokens&&At.tokens[0].tokens.length>0&&At.tokens[0].tokens[0].type==="text"&&(At.tokens[0].tokens[0].text=tr+" "+At.tokens[0].tokens[0].text)):At.tokens.unshift({type:"text",text:tr}):_r+=tr),_r+=this.parse(At.tokens,Er),lr+=this.renderer.listitem(_r,xt,pt);me+=this.renderer.list(lr,Mr,Xr);continue}case"html":{me+=this.renderer.html(Wt.text);continue}case"paragraph":{me+=this.renderer.paragraph(this.parseInline(Wt.tokens));continue}case"text":{for(lr=Wt.tokens?this.parseInline(Wt.tokens):Wt.text;we+1<pr&&G[we+1].type==="text";)Wt=G[++we],lr+=`
`+(Wt.tokens?this.parseInline(Wt.tokens):Wt.text);me+=q?this.renderer.paragraph(lr):lr;continue}default:{var wr='Token with "'+Wt.type+'" type was not found.';if(this.options.silent){console.error(wr);return}else throw new Error(wr)}}return me},ke.parseInline=function(G,q){q=q||this.renderer;var me="",we,O,ht=G.length;for(we=0;we<ht;we++)switch(O=G[we],O.type){case"escape":{me+=q.text(O.text);break}case"html":{me+=q.html(O.text);break}case"link":{me+=q.link(O.href,O.title,this.parseInline(O.tokens,q));break}case"image":{me+=q.image(O.href,O.title,O.text);break}case"strong":{me+=q.strong(this.parseInline(O.tokens,q));break}case"em":{me+=q.em(this.parseInline(O.tokens,q));break}case"codespan":{me+=q.codespan(O.text);break}case"br":{me+=q.br();break}case"del":{me+=q.del(this.parseInline(O.tokens,q));break}case"text":{me+=q.text(O.text);break}default:{var he='Token with "'+O.type+'" type was not found.';if(this.options.silent){console.error(he);return}else throw new Error(he)}}return me},xe}(),$t=Ve,Ct=vt,wt=Ye,He=Se,Tt=je,gt=Ge,st=J.merge,Rt=J.checkSanitizeDeprecation,y=J.escape,D=ye.exports.getDefaults,Oe=ye.exports.changeDefaults,N=ye.exports.defaults;function oe(xe,ke,Re){if(typeof xe=="undefined"||xe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof xe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(xe)+", string expected");if(typeof ke=="function"&&(Re=ke,ke=null),ke=st({},oe.defaults,ke||{}),Rt(ke),Re){var G=ke.highlight,q;try{q=$t.lex(xe,ke)}catch(ht){return Re(ht)}var me=function(he){var It;if(!he)try{ke.walkTokens&&oe.walkTokens(q,ke.walkTokens),It=Ct.parse(q,ke)}catch(Ot){he=Ot}return ke.highlight=G,he?Re(he):Re(null,It)};if(!G||G.length<3||(delete ke.highlight,!q.length))return me();var we=0;oe.walkTokens(q,function(ht){ht.type==="code"&&(we++,setTimeout(function(){G(ht.text,ht.lang,function(he,It){if(he)return me(he);It!=null&&It!==ht.text&&(ht.text=It,ht.escaped=!0),we--,we===0&&me()})},0))}),we===0&&me();return}try{var O=$t.lex(xe,ke);return ke.walkTokens&&oe.walkTokens(O,ke.walkTokens),Ct.parse(O,ke)}catch(ht){if(ht.message+=`
Please report this to https://github.com/markedjs/marked.`,ke.silent)return"<p>An error occurred:</p><pre>"+y(ht.message+"",!0)+"</pre>";throw ht}}oe.options=oe.setOptions=function(xe){return st(oe.defaults,xe),Oe(oe.defaults),oe},oe.getDefaults=D,oe.defaults=N,oe.use=function(xe){var ke=st({},xe);if(xe.renderer&&function(){var G=oe.defaults.renderer||new He,q=function(O){var ht=G[O];G[O]=function(){for(var he=arguments.length,It=new Array(he),Ot=0;Ot<he;Ot++)It[Ot]=arguments[Ot];var er=xe.renderer[O].apply(G,It);return er===!1&&(er=ht.apply(G,It)),er}};for(var me in xe.renderer)q(me);ke.renderer=G}(),xe.tokenizer&&function(){var G=oe.defaults.tokenizer||new wt,q=function(O){var ht=G[O];G[O]=function(){for(var he=arguments.length,It=new Array(he),Ot=0;Ot<he;Ot++)It[Ot]=arguments[Ot];var er=xe.tokenizer[O].apply(G,It);return er===!1&&(er=ht.apply(G,It)),er}};for(var me in xe.tokenizer)q(me);ke.tokenizer=G}(),xe.walkTokens){var Re=oe.defaults.walkTokens;ke.walkTokens=function(G){xe.walkTokens(G),Re&&Re(G)}}oe.setOptions(ke)},oe.walkTokens=function(xe,ke){for(var Re=Be(xe),G;!(G=Re()).done;){var q=G.value;switch(ke(q),q.type){case"table":{for(var me=Be(q.tokens.header),we;!(we=me()).done;){var O=we.value;oe.walkTokens(O,ke)}for(var ht=Be(q.tokens.cells),he;!(he=ht()).done;)for(var It=he.value,Ot=Be(It),er;!(er=Ot()).done;){var Dr=er.value;oe.walkTokens(Dr,ke)}break}case"list":{oe.walkTokens(q.items,ke);break}default:q.tokens&&oe.walkTokens(q.tokens,ke)}}},oe.parseInline=function(xe,ke){if(typeof xe=="undefined"||xe===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof xe!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(xe)+", string expected");ke=st({},oe.defaults,ke||{}),Rt(ke);try{var Re=$t.lexInline(xe,ke);return ke.walkTokens&&oe.walkTokens(Re,ke.walkTokens),Ct.parseInline(Re,ke)}catch(G){if(G.message+=`
Please report this to https://github.com/markedjs/marked.`,ke.silent)return"<p>An error occurred:</p><pre>"+y(G.message+"",!0)+"</pre>";throw G}},oe.Parser=Ct,oe.parser=Ct.parse,oe.Renderer=He,oe.TextRenderer=Tt,oe.Lexer=$t,oe.lexer=$t.lex,oe.Tokenizer=wt,oe.Slugger=gt,oe.parse=oe;var rr=oe;return rr})},11690:function(Kt){const it=/[&<>"']/,X=/[&<>"']/g,F=/[<>"']|&(?!#?\w+;)/,Te=/[<>"']|&(?!#?\w+;)/g,Be={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ye=ce=>Be[ce];function te(ce,ve){if(ve){if(it.test(ce))return ce.replace(X,ye)}else if(F.test(ce))return ce.replace(Te,ye);return ce}const _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function De(ce){return ce.replace(_,(ve,Ie)=>(Ie=Ie.toLowerCase(),Ie==="colon"?":":Ie.charAt(0)==="#"?Ie.charAt(1)==="x"?String.fromCharCode(parseInt(Ie.substring(2),16)):String.fromCharCode(+Ie.substring(1)):""))}const pe=/(^|[^\[])\^/g;function u(ce,ve){ce=ce.source||ce,ve=ve||"";const Ie={replace:(Ae,We)=>(We=We.source||We,We=We.replace(pe,"$1"),ce=ce.replace(Ae,We),Ie),getRegex:()=>new RegExp(ce,ve)};return Ie}const Q=/[^\w:]/g,B=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(ce,ve,Ie){if(ce){let Ae;try{Ae=decodeURIComponent(De(Ie)).replace(Q,"").toLowerCase()}catch(We){return null}if(Ae.indexOf("javascript:")===0||Ae.indexOf("vbscript:")===0||Ae.indexOf("data:")===0)return null}ve&&!B.test(Ie)&&(Ie=V(ve,Ie));try{Ie=encodeURI(Ie).replace(/%25/g,"%")}catch(Ae){return null}return Ie}const k={},S=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,H=/^([^:]+:\/*[^/]*)[\s\S]*$/;function V(ce,ve){k[" "+ce]||(S.test(ce)?k[" "+ce]=ce+"/":k[" "+ce]=ae(ce,"/",!0)),ce=k[" "+ce];const Ie=ce.indexOf(":")===-1;return ve.substring(0,2)==="//"?Ie?ve:ce.replace(C,"$1")+ve:ve.charAt(0)==="/"?Ie?ve:ce.replace(H,"$1")+ve:ce+ve}const M={exec:function(){}};function I(ce){let ve=1,Ie,Ae;for(;ve<arguments.length;ve++){Ie=arguments[ve];for(Ae in Ie)Object.prototype.hasOwnProperty.call(Ie,Ae)&&(ce[Ae]=Ie[Ae])}return ce}function z(ce,ve){const Ie=ce.replace(/\|/g,(Y,P,j)=>{let J=!1,se=P;for(;--se>=0&&j[se]==="\\";)J=!J;return J?"|":" |"}),Ae=Ie.split(/ \|/);let We=0;if(Ae.length>ve)Ae.splice(ve);else for(;Ae.length<ve;)Ae.push("");for(;We<Ae.length;We++)Ae[We]=Ae[We].trim().replace(/\\\|/g,"|");return Ae}function ae(ce,ve,Ie){const Ae=ce.length;if(Ae===0)return"";let We=0;for(;We<Ae;){const Y=ce.charAt(Ae-We-1);if(Y===ve&&!Ie)We++;else if(Y!==ve&&Ie)We++;else break}return ce.substr(0,Ae-We)}function ee(ce,ve){if(ce.indexOf(ve[1])===-1)return-1;const Ie=ce.length;let Ae=0,We=0;for(;We<Ie;We++)if(ce[We]==="\\")We++;else if(ce[We]===ve[0])Ae++;else if(ce[We]===ve[1]&&(Ae--,Ae<0))return We;return-1}function _e(ce){ce&&ce.sanitize&&!ce.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 be(ce,ve){if(ve<1)return"";let Ie="";for(;ve>1;)ve&1&&(Ie+=ce),ve>>=1,ce+=ce;return Ie+ce}Kt.exports={escape:te,unescape:De,edit:u,cleanUrl:b,resolveUrl:V,noopTest:M,merge:I,splitCells:z,rtrim:ae,findClosingBracket:ee,checkSanitizeDeprecation:_e,repeatString:be}},75918:function(Kt,it,X){"use strict";X.d(it,{Wi:function(){return _},Z0:function(){return De},aU:function(){return te},eZ:function(){return u},wY:function(){return pe}});var F=X(4348),Te=X(69323),Be=X(13268),ye=function(Q,B,b,k){function S(C){return C instanceof b?C:new b(function(H){H(C)})}return new(b||(b=Promise))(function(C,H){function V(z){try{I(k.next(z))}catch(ae){H(ae)}}function M(z){try{I(k.throw(z))}catch(ae){H(ae)}}function I(z){z.done?C(z.value):S(z.value).then(V,M)}I((k=k.apply(Q,B||[])).next())})};class te extends Te.JT{constructor(B,b="",k="",S=!0,C){super(),this._onDidChange=this._register(new F.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=B,this._label=b,this._cssClass=k,this._enabled=S,this._actionCallback=C}get id(){return this._id}get label(){return this._label}set label(B){this._setLabel(B)}_setLabel(B){this._label!==B&&(this._label=B,this._onDidChange.fire({label:B}))}get tooltip(){return this._tooltip||""}set tooltip(B){this._setTooltip(B)}_setTooltip(B){this._tooltip!==B&&(this._tooltip=B,this._onDidChange.fire({tooltip:B}))}get class(){return this._cssClass}set class(B){this._setClass(B)}_setClass(B){this._cssClass!==B&&(this._cssClass=B,this._onDidChange.fire({class:B}))}get enabled(){return this._enabled}set enabled(B){this._setEnabled(B)}_setEnabled(B){this._enabled!==B&&(this._enabled=B,this._onDidChange.fire({enabled:B}))}get checked(){return this._checked}set checked(B){this._setChecked(B)}_setChecked(B){this._checked!==B&&(this._checked=B,this._onDidChange.fire({checked:B}))}run(B,b){return ye(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(B))})}}class _ extends Te.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new F.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new F.Q5),this.onDidRun=this._onDidRun.event}run(B,b){return ye(this,void 0,void 0,function*(){if(!B.enabled)return;this._onBeforeRun.fire({action:B});let k;try{yield this.runAction(B,b)}catch(S){k=S}this._onDidRun.fire({action:B,error:k})})}runAction(B,b){return ye(this,void 0,void 0,function*(){yield B.run(b)})}}class De extends te{constructor(B){super(De.ID,B,B?"separator text":"separator"),this.checked=!1,this.enabled=!1}}De.ID="vs.actions.separator";class pe{constructor(B,b,k,S){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=B,this.label=b,this.class=S,this._actions=k}get actions(){return this._actions}dispose(){}run(){return ye(this,void 0,void 0,function*(){})}}class u extends te{constructor(){super(u.ID,Be.N("submenu.empty","(empty)"),void 0,!1)}}u.ID="vs.actions.empty"},76068:function(Kt,it,X){"use strict";X.d(it,{ok:function(){return F}});function F(Te,Be){if(!Te)throw new Error(Be?`Assertion failed (${Be})`:"Assertion Failed")}},52615:function(Kt,it,X){"use strict";X.d(it,{CM:function(){return te},JL:function(){return _},dT:function(){return pe},fK:function(){return ye},lA:function(){return De}});var F=X(4348);class Te{constructor(){this._icons=new Map,this._onDidRegister=new F.Q5}add(Q){const B=this._icons.get(Q.id);B?Q.description?B.description=Q.description:console.error(`Duplicate registration of codicon ${Q.id}`):(this._icons.set(Q.id,Q),this._onDidRegister.fire(Q))}get(Q){return this._icons.get(Q)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const Be=new Te,ye=Be;function te(u,Q){return new De(u,Q)}function _(u){return u?u.replace(/\$\((.*?)\)/g,(Q,B)=>` ${B} `).trim():""}class De{constructor(Q,B,b){this.id=Q,this.definition=B,this.description=b,Be.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var pe;(function(u){u.iconNameSegment="[A-Za-z0-9]+",u.iconNameExpression="[A-Za-z0-9\\-]+",u.iconModifierExpression="~[A-Za-z]+";const Q=new RegExp(`^(${u.iconNameExpression})(${u.iconModifierExpression})?$`);function B(S){if(S instanceof De)return["codicon","codicon-"+S.id];const C=Q.exec(S.id);if(!C)return B(De.error);let[,H,V]=C;const M=["codicon","codicon-"+H];return V&&M.push("codicon-modifier-"+V.substr(1)),M}u.asClassNameArray=B;function b(S){return B(S).join(" ")}u.asClassName=b;function k(S){return"."+B(S).join(".")}u.asCSSSelector=k})(pe||(pe={})),function(u){u.add=new u("add",{fontCharacter:"\\ea60"}),u.plus=new u("plus",u.add.definition),u.gistNew=new u("gist-new",u.add.definition),u.repoCreate=new u("repo-create",u.add.definition),u.lightbulb=new u("lightbulb",{fontCharacter:"\\ea61"}),u.lightBulb=new u("light-bulb",{fontCharacter:"\\ea61"}),u.repo=new u("repo",{fontCharacter:"\\ea62"}),u.repoDelete=new u("repo-delete",{fontCharacter:"\\ea62"}),u.gistFork=new u("gist-fork",{fontCharacter:"\\ea63"}),u.repoForked=new u("repo-forked",{fontCharacter:"\\ea63"}),u.gitPullRequest=new u("git-pull-request",{fontCharacter:"\\ea64"}),u.gitPullRequestAbandoned=new u("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),u.recordKeys=new u("record-keys",{fontCharacter:"\\ea65"}),u.keyboard=new u("keyboard",{fontCharacter:"\\ea65"}),u.tag=new u("tag",{fontCharacter:"\\ea66"}),u.tagAdd=new u("tag-add",{fontCharacter:"\\ea66"}),u.tagRemove=new u("tag-remove",{fontCharacter:"\\ea66"}),u.person=new u("person",{fontCharacter:"\\ea67"}),u.personFollow=new u("person-follow",{fontCharacter:"\\ea67"}),u.personOutline=new u("person-outline",{fontCharacter:"\\ea67"}),u.personFilled=new u("person-filled",{fontCharacter:"\\ea67"}),u.gitBranch=new u("git-branch",{fontCharacter:"\\ea68"}),u.gitBranchCreate=new u("git-branch-create",{fontCharacter:"\\ea68"}),u.gitBranchDelete=new u("git-branch-delete",{fontCharacter:"\\ea68"}),u.sourceControl=new u("source-control",{fontCharacter:"\\ea68"}),u.mirror=new u("mirror",{fontCharacter:"\\ea69"}),u.mirrorPublic=new u("mirror-public",{fontCharacter:"\\ea69"}),u.star=new u("star",{fontCharacter:"\\ea6a"}),u.starAdd=new u("star-add",{fontCharacter:"\\ea6a"}),u.starDelete=new u("star-delete",{fontCharacter:"\\ea6a"}),u.starEmpty=new u("star-empty",{fontCharacter:"\\ea6a"}),u.comment=new u("comment",{fontCharacter:"\\ea6b"}),u.commentAdd=new u("comment-add",{fontCharacter:"\\ea6b"}),u.alert=new u("alert",{fontCharacter:"\\ea6c"}),u.warning=new u("warning",{fontCharacter:"\\ea6c"}),u.search=new u("search",{fontCharacter:"\\ea6d"}),u.searchSave=new u("search-save",{fontCharacter:"\\ea6d"}),u.logOut=new u("log-out",{fontCharacter:"\\ea6e"}),u.signOut=new u("sign-out",{fontCharacter:"\\ea6e"}),u.logIn=new u("log-in",{fontCharacter:"\\ea6f"}),u.signIn=new u("sign-in",{fontCharacter:"\\ea6f"}),u.eye=new u("eye",{fontCharacter:"\\ea70"}),u.eyeUnwatch=new u("eye-unwatch",{fontCharacter:"\\ea70"}),u.eyeWatch=new u("eye-watch",{fontCharacter:"\\ea70"}),u.circleFilled=new u("circle-filled",{fontCharacter:"\\ea71"}),u.primitiveDot=new u("primitive-dot",{fontCharacter:"\\ea71"}),u.closeDirty=new u("close-dirty",{fontCharacter:"\\ea71"}),u.debugBreakpoint=new u("debug-breakpoint",{fontCharacter:"\\ea71"}),u.debugBreakpointDisabled=new u("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),u.debugHint=new u("debug-hint",{fontCharacter:"\\ea71"}),u.primitiveSquare=new u("primitive-square",{fontCharacter:"\\ea72"}),u.edit=new u("edit",{fontCharacter:"\\ea73"}),u.pencil=new u("pencil",{fontCharacter:"\\ea73"}),u.info=new u("info",{fontCharacter:"\\ea74"}),u.issueOpened=new u("issue-opened",{fontCharacter:"\\ea74"}),u.gistPrivate=new u("gist-private",{fontCharacter:"\\ea75"}),u.gitForkPrivate=new u("git-fork-private",{fontCharacter:"\\ea75"}),u.lock=new u("lock",{fontCharacter:"\\ea75"}),u.mirrorPrivate=new u("mirror-private",{fontCharacter:"\\ea75"}),u.close=new u("close",{fontCharacter:"\\ea76"}),u.removeClose=new u("remove-close",{fontCharacter:"\\ea76"}),u.x=new u("x",{fontCharacter:"\\ea76"}),u.repoSync=new u("repo-sync",{fontCharacter:"\\ea77"}),u.sync=new u("sync",{fontCharacter:"\\ea77"}),u.clone=new u("clone",{fontCharacter:"\\ea78"}),u.desktopDownload=new u("desktop-download",{fontCharacter:"\\ea78"}),u.beaker=new u("beaker",{fontCharacter:"\\ea79"}),u.microscope=new u("microscope",{fontCharacter:"\\ea79"}),u.vm=new u("vm",{fontCharacter:"\\ea7a"}),u.deviceDesktop=new u("device-desktop",{fontCharacter:"\\ea7a"}),u.file=new u("file",{fontCharacter:"\\ea7b"}),u.fileText=new u("file-text",{fontCharacter:"\\ea7b"}),u.more=new u("more",{fontCharacter:"\\ea7c"}),u.ellipsis=new u("ellipsis",{fontCharacter:"\\ea7c"}),u.kebabHorizontal=new u("kebab-horizontal",{fontCharacter:"\\ea7c"}),u.mailReply=new u("mail-reply",{fontCharacter:"\\ea7d"}),u.reply=new u("reply",{fontCharacter:"\\ea7d"}),u.organization=new u("organization",{fontCharacter:"\\ea7e"}),u.organizationFilled=new u("organization-filled",{fontCharacter:"\\ea7e"}),u.organizationOutline=new u("organization-outline",{fontCharacter:"\\ea7e"}),u.newFile=new u("new-file",{fontCharacter:"\\ea7f"}),u.fileAdd=new u("file-add",{fontCharacter:"\\ea7f"}),u.newFolder=new u("new-folder",{fontCharacter:"\\ea80"}),u.fileDirectoryCreate=new u("file-directory-create",{fontCharacter:"\\ea80"}),u.trash=new u("trash",{fontCharacter:"\\ea81"}),u.trashcan=new u("trashcan",{fontCharacter:"\\ea81"}),u.history=new u("history",{fontCharacter:"\\ea82"}),u.clock=new u("clock",{fontCharacter:"\\ea82"}),u.folder=new u("folder",{fontCharacter:"\\ea83"}),u.fileDirectory=new u("file-directory",{fontCharacter:"\\ea83"}),u.symbolFolder=new u("symbol-folder",{fontCharacter:"\\ea83"}),u.logoGithub=new u("logo-github",{fontCharacter:"\\ea84"}),u.markGithub=new u("mark-github",{fontCharacter:"\\ea84"}),u.github=new u("github",{fontCharacter:"\\ea84"}),u.terminal=new u("terminal",{fontCharacter:"\\ea85"}),u.console=new u("console",{fontCharacter:"\\ea85"}),u.repl=new u("repl",{fontCharacter:"\\ea85"}),u.zap=new u("zap",{fontCharacter:"\\ea86"}),u.symbolEvent=new u("symbol-event",{fontCharacter:"\\ea86"}),u.error=new u("error",{fontCharacter:"\\ea87"}),u.stop=new u("stop",{fontCharacter:"\\ea87"}),u.variable=new u("variable",{fontCharacter:"\\ea88"}),u.symbolVariable=new u("symbol-variable",{fontCharacter:"\\ea88"}),u.array=new u("array",{fontCharacter:"\\ea8a"}),u.symbolArray=new u("symbol-array",{fontCharacter:"\\ea8a"}),u.symbolModule=new u("symbol-module",{fontCharacter:"\\ea8b"}),u.symbolPackage=new u("symbol-package",{fontCharacter:"\\ea8b"}),u.symbolNamespace=new u("symbol-namespace",{fontCharacter:"\\ea8b"}),u.symbolObject=new u("symbol-object",{fontCharacter:"\\ea8b"}),u.symbolMethod=new u("symbol-method",{fontCharacter:"\\ea8c"}),u.symbolFunction=new u("symbol-function",{fontCharacter:"\\ea8c"}),u.symbolConstructor=new u("symbol-constructor",{fontCharacter:"\\ea8c"}),u.symbolBoolean=new u("symbol-boolean",{fontCharacter:"\\ea8f"}),u.symbolNull=new u("symbol-null",{fontCharacter:"\\ea8f"}),u.symbolNumeric=new u("symbol-numeric",{fontCharacter:"\\ea90"}),u.symbolNumber=new u("symbol-number",{fontCharacter:"\\ea90"}),u.symbolStructure=new u("symbol-structure",{fontCharacter:"\\ea91"}),u.symbolStruct=new u("symbol-struct",{fontCharacter:"\\ea91"}),u.symbolParameter=new u("symbol-parameter",{fontCharacter:"\\ea92"}),u.symbolTypeParameter=new u("symbol-type-parameter",{fontCharacter:"\\ea92"}),u.symbolKey=new u("symbol-key",{fontCharacter:"\\ea93"}),u.symbolText=new u("symbol-text",{fontCharacter:"\\ea93"}),u.symbolReference=new u("symbol-reference",{fontCharacter:"\\ea94"}),u.goToFile=new u("go-to-file",{fontCharacter:"\\ea94"}),u.symbolEnum=new u("symbol-enum",{fontCharacter:"\\ea95"}),u.symbolValue=new u("symbol-value",{fontCharacter:"\\ea95"}),u.symbolRuler=new u("symbol-ruler",{fontCharacter:"\\ea96"}),u.symbolUnit=new u("symbol-unit",{fontCharacter:"\\ea96"}),u.activateBreakpoints=new u("activate-breakpoints",{fontCharacter:"\\ea97"}),u.archive=new u("archive",{fontCharacter:"\\ea98"}),u.arrowBoth=new u("arrow-both",{fontCharacter:"\\ea99"}),u.arrowDown=new u("arrow-down",{fontCharacter:"\\ea9a"}),u.arrowLeft=new u("arrow-left",{fontCharacter:"\\ea9b"}),u.arrowRight=new u("arrow-right",{fontCharacter:"\\ea9c"}),u.arrowSmallDown=new u("arrow-small-down",{fontCharacter:"\\ea9d"}),u.arrowSmallLeft=new u("arrow-small-left",{fontCharacter:"\\ea9e"}),u.arrowSmallRight=new u("arrow-small-right",{fontCharacter:"\\ea9f"}),u.arrowSmallUp=new u("arrow-small-up",{fontCharacter:"\\eaa0"}),u.arrowUp=new u("arrow-up",{fontCharacter:"\\eaa1"}),u.bell=new u("bell",{fontCharacter:"\\eaa2"}),u.bold=new u("bold",{fontCharacter:"\\eaa3"}),u.book=new u("book",{fontCharacter:"\\eaa4"}),u.bookmark=new u("bookmark",{fontCharacter:"\\eaa5"}),u.debugBreakpointConditionalUnverified=new u("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),u.debugBreakpointConditional=new u("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),u.debugBreakpointConditionalDisabled=new u("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),u.debugBreakpointDataUnverified=new u("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),u.debugBreakpointData=new u("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),u.debugBreakpointDataDisabled=new u("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),u.debugBreakpointLogUnverified=new u("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),u.debugBreakpointLog=new u("debug-breakpoint-log",{fontCharacter:"\\eaab"}),u.debugBreakpointLogDisabled=new u("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),u.briefcase=new u("briefcase",{fontCharacter:"\\eaac"}),u.broadcast=new u("broadcast",{fontCharacter:"\\eaad"}),u.browser=new u("browser",{fontCharacter:"\\eaae"}),u.bug=new u("bug",{fontCharacter:"\\eaaf"}),u.calendar=new u("calendar",{fontCharacter:"\\eab0"}),u.caseSensitive=new u("case-sensitive",{fontCharacter:"\\eab1"}),u.check=new u("check",{fontCharacter:"\\eab2"}),u.checklist=new u("checklist",{fontCharacter:"\\eab3"}),u.chevronDown=new u("chevron-down",{fontCharacter:"\\eab4"}),u.dropDownButton=new u("drop-down-button",u.chevronDown.definition),u.chevronLeft=new u("chevron-left",{fontCharacter:"\\eab5"}),u.chevronRight=new u("chevron-right",{fontCharacter:"\\eab6"}),u.chevronUp=new u("chevron-up",{fontCharacter:"\\eab7"}),u.chromeClose=new u("chrome-close",{fontCharacter:"\\eab8"}),u.chromeMaximize=new u("chrome-maximize",{fontCharacter:"\\eab9"}),u.chromeMinimize=new u("chrome-minimize",{fontCharacter:"\\eaba"}),u.chromeRestore=new u("chrome-restore",{fontCharacter:"\\eabb"}),u.circleOutline=new u("circle-outline",{fontCharacter:"\\eabc"}),u.debugBreakpointUnverified=new u("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),u.circleSlash=new u("circle-slash",{fontCharacter:"\\eabd"}),u.circuitBoard=new u("circuit-board",{fontCharacter:"\\eabe"}),u.clearAll=new u("clear-all",{fontCharacter:"\\eabf"}),u.clippy=new u("clippy",{fontCharacter:"\\eac0"}),u.closeAll=new u("close-all",{fontCharacter:"\\eac1"}),u.cloudDownload=new u("cloud-download",{fontCharacter:"\\eac2"}),u.cloudUpload=new u("cloud-upload",{fontCharacter:"\\eac3"}),u.code=new u("code",{fontCharacter:"\\eac4"}),u.collapseAll=new u("collapse-all",{fontCharacter:"\\eac5"}),u.colorMode=new u("color-mode",{fontCharacter:"\\eac6"}),u.commentDiscussion=new u("comment-discussion",{fontCharacter:"\\eac7"}),u.compareChanges=new u("compare-changes",{fontCharacter:"\\eafd"}),u.creditCard=new u("credit-card",{fontCharacter:"\\eac9"}),u.dash=new u("dash",{fontCharacter:"\\eacc"}),u.dashboard=new u("dashboard",{fontCharacter:"\\eacd"}),u.database=new u("database",{fontCharacter:"\\eace"}),u.debugContinue=new u("debug-continue",{fontCharacter:"\\eacf"}),u.debugDisconnect=new u("debug-disconnect",{fontCharacter:"\\ead0"}),u.debugPause=new u("debug-pause",{fontCharacter:"\\ead1"}),u.debugRestart=new u("debug-restart",{fontCharacter:"\\ead2"}),u.debugStart=new u("debug-start",{fontCharacter:"\\ead3"}),u.debugStepInto=new u("debug-step-into",{fontCharacter:"\\ead4"}),u.debugStepOut=new u("debug-step-out",{fontCharacter:"\\ead5"}),u.debugStepOver=new u("debug-step-over",{fontCharacter:"\\ead6"}),u.debugStop=new u("debug-stop",{fontCharacter:"\\ead7"}),u.debug=new u("debug",{fontCharacter:"\\ead8"}),u.deviceCameraVideo=new u("device-camera-video",{fontCharacter:"\\ead9"}),u.deviceCamera=new u("device-camera",{fontCharacter:"\\eada"}),u.deviceMobile=new u("device-mobile",{fontCharacter:"\\eadb"}),u.diffAdded=new u("diff-added",{fontCharacter:"\\eadc"}),u.diffIgnored=new u("diff-ignored",{fontCharacter:"\\eadd"}),u.diffModified=new u("diff-modified",{fontCharacter:"\\eade"}),u.diffRemoved=new u("diff-removed",{fontCharacter:"\\eadf"}),u.diffRenamed=new u("diff-renamed",{fontCharacter:"\\eae0"}),u.diff=new u("diff",{fontCharacter:"\\eae1"}),u.discard=new u("discard",{fontCharacter:"\\eae2"}),u.editorLayout=new u("editor-layout",{fontCharacter:"\\eae3"}),u.emptyWindow=new u("empty-window",{fontCharacter:"\\eae4"}),u.exclude=new u("exclude",{fontCharacter:"\\eae5"}),u.extensions=new u("extensions",{fontCharacter:"\\eae6"}),u.eyeClosed=new u("eye-closed",{fontCharacter:"\\eae7"}),u.fileBinary=new u("file-binary",{fontCharacter:"\\eae8"}),u.fileCode=new u("file-code",{fontCharacter:"\\eae9"}),u.fileMedia=new u("file-media",{fontCharacter:"\\eaea"}),u.filePdf=new u("file-pdf",{fontCharacter:"\\eaeb"}),u.fileSubmodule=new u("file-submodule",{fontCharacter:"\\eaec"}),u.fileSymlinkDirectory=new u("file-symlink-directory",{fontCharacter:"\\eaed"}),u.fileSymlinkFile=new u("file-symlink-file",{fontCharacter:"\\eaee"}),u.fileZip=new u("file-zip",{fontCharacter:"\\eaef"}),u.files=new u("files",{fontCharacter:"\\eaf0"}),u.filter=new u("filter",{fontCharacter:"\\eaf1"}),u.flame=new u("flame",{fontCharacter:"\\eaf2"}),u.foldDown=new u("fold-down",{fontCharacter:"\\eaf3"}),u.foldUp=new u("fold-up",{fontCharacter:"\\eaf4"}),u.fold=new u("fold",{fontCharacter:"\\eaf5"}),u.folderActive=new u("folder-active",{fontCharacter:"\\eaf6"}),u.folderOpened=new u("folder-opened",{fontCharacter:"\\eaf7"}),u.gear=new u("gear",{fontCharacter:"\\eaf8"}),u.gift=new u("gift",{fontCharacter:"\\eaf9"}),u.gistSecret=new u("gist-secret",{fontCharacter:"\\eafa"}),u.gist=new u("gist",{fontCharacter:"\\eafb"}),u.gitCommit=new u("git-commit",{fontCharacter:"\\eafc"}),u.gitCompare=new u("git-compare",{fontCharacter:"\\eafd"}),u.gitMerge=new u("git-merge",{fontCharacter:"\\eafe"}),u.githubAction=new u("github-action",{fontCharacter:"\\eaff"}),u.githubAlt=new u("github-alt",{fontCharacter:"\\eb00"}),u.globe=new u("globe",{fontCharacter:"\\eb01"}),u.grabber=new u("grabber",{fontCharacter:"\\eb02"}),u.graph=new u("graph",{fontCharacter:"\\eb03"}),u.gripper=new u("gripper",{fontCharacter:"\\eb04"}),u.heart=new u("heart",{fontCharacter:"\\eb05"}),u.home=new u("home",{fontCharacter:"\\eb06"}),u.horizontalRule=new u("horizontal-rule",{fontCharacter:"\\eb07"}),u.hubot=new u("hubot",{fontCharacter:"\\eb08"}),u.inbox=new u("inbox",{fontCharacter:"\\eb09"}),u.issueClosed=new u("issue-closed",{fontCharacter:"\\eba4"}),u.issueReopened=new u("issue-reopened",{fontCharacter:"\\eb0b"}),u.issues=new u("issues",{fontCharacter:"\\eb0c"}),u.italic=new u("italic",{fontCharacter:"\\eb0d"}),u.jersey=new u("jersey",{fontCharacter:"\\eb0e"}),u.json=new u("json",{fontCharacter:"\\eb0f"}),u.kebabVertical=new u("kebab-vertical",{fontCharacter:"\\eb10"}),u.key=new u("key",{fontCharacter:"\\eb11"}),u.law=new u("law",{fontCharacter:"\\eb12"}),u.lightbulbAutofix=new u("lightbulb-autofix",{fontCharacter:"\\eb13"}),u.linkExternal=new u("link-external",{fontCharacter:"\\eb14"}),u.link=new u("link",{fontCharacter:"\\eb15"}),u.listOrdered=new u("list-ordered",{fontCharacter:"\\eb16"}),u.listUnordered=new u("list-unordered",{fontCharacter:"\\eb17"}),u.liveShare=new u("live-share",{fontCharacter:"\\eb18"}),u.loading=new u("loading",{fontCharacter:"\\eb19"}),u.location=new u("location",{fontCharacter:"\\eb1a"}),u.mailRead=new u("mail-read",{fontCharacter:"\\eb1b"}),u.mail=new u("mail",{fontCharacter:"\\eb1c"}),u.markdown=new u("markdown",{fontCharacter:"\\eb1d"}),u.megaphone=new u("megaphone",{fontCharacter:"\\eb1e"}),u.mention=new u("mention",{fontCharacter:"\\eb1f"}),u.milestone=new u("milestone",{fontCharacter:"\\eb20"}),u.mortarBoard=new u("mortar-board",{fontCharacter:"\\eb21"}),u.move=new u("move",{fontCharacter:"\\eb22"}),u.multipleWindows=new u("multiple-windows",{fontCharacter:"\\eb23"}),u.mute=new u("mute",{fontCharacter:"\\eb24"}),u.noNewline=new u("no-newline",{fontCharacter:"\\eb25"}),u.note=new u("note",{fontCharacter:"\\eb26"}),u.octoface=new u("octoface",{fontCharacter:"\\eb27"}),u.openPreview=new u("open-preview",{fontCharacter:"\\eb28"}),u.package_=new u("package",{fontCharacter:"\\eb29"}),u.paintcan=new u("paintcan",{fontCharacter:"\\eb2a"}),u.pin=new u("pin",{fontCharacter:"\\eb2b"}),u.play=new u("play",{fontCharacter:"\\eb2c"}),u.run=new u("run",{fontCharacter:"\\eb2c"}),u.plug=new u("plug",{fontCharacter:"\\eb2d"}),u.preserveCase=new u("preserve-case",{fontCharacter:"\\eb2e"}),u.preview=new u("preview",{fontCharacter:"\\eb2f"}),u.project=new u("project",{fontCharacter:"\\eb30"}),u.pulse=new u("pulse",{fontCharacter:"\\eb31"}),u.question=new u("question",{fontCharacter:"\\eb32"}),u.quote=new u("quote",{fontCharacter:"\\eb33"}),u.radioTower=new u("radio-tower",{fontCharacter:"\\eb34"}),u.reactions=new u("reactions",{fontCharacter:"\\eb35"}),u.references=new u("references",{fontCharacter:"\\eb36"}),u.refresh=new u("refresh",{fontCharacter:"\\eb37"}),u.regex=new u("regex",{fontCharacter:"\\eb38"}),u.remoteExplorer=new u("remote-explorer",{fontCharacter:"\\eb39"}),u.remote=new u("remote",{fontCharacter:"\\eb3a"}),u.remove=new u("remove",{fontCharacter:"\\eb3b"}),u.replaceAll=new u("replace-all",{fontCharacter:"\\eb3c"}),u.replace=new u("replace",{fontCharacter:"\\eb3d"}),u.repoClone=new u("repo-clone",{fontCharacter:"\\eb3e"}),u.repoForcePush=new u("repo-force-push",{fontCharacter:"\\eb3f"}),u.repoPull=new u("repo-pull",{fontCharacter:"\\eb40"}),u.repoPush=new u("repo-push",{fontCharacter:"\\eb41"}),u.report=new u("report",{fontCharacter:"\\eb42"}),u.requestChanges=new u("request-changes",{fontCharacter:"\\eb43"}),u.rocket=new u("rocket",{fontCharacter:"\\eb44"}),u.rootFolderOpened=new u("root-folder-opened",{fontCharacter:"\\eb45"}),u.rootFolder=new u("root-folder",{fontCharacter:"\\eb46"}),u.rss=new u("rss",{fontCharacter:"\\eb47"}),u.ruby=new u("ruby",{fontCharacter:"\\eb48"}),u.saveAll=new u("save-all",{fontCharacter:"\\eb49"}),u.saveAs=new u("save-as",{fontCharacter:"\\eb4a"}),u.save=new u("save",{fontCharacter:"\\eb4b"}),u.screenFull=new u("screen-full",{fontCharacter:"\\eb4c"}),u.screenNormal=new u("screen-normal",{fontCharacter:"\\eb4d"}),u.searchStop=new u("search-stop",{fontCharacter:"\\eb4e"}),u.server=new u("server",{fontCharacter:"\\eb50"}),u.settingsGear=new u("settings-gear",{fontCharacter:"\\eb51"}),u.settings=new u("settings",{fontCharacter:"\\eb52"}),u.shield=new u("shield",{fontCharacter:"\\eb53"}),u.smiley=new u("smiley",{fontCharacter:"\\eb54"}),u.sortPrecedence=new u("sort-precedence",{fontCharacter:"\\eb55"}),u.splitHorizontal=new u("split-horizontal",{fontCharacter:"\\eb56"}),u.splitVertical=new u("split-vertical",{fontCharacter:"\\eb57"}),u.squirrel=new u("squirrel",{fontCharacter:"\\eb58"}),u.starFull=new u("star-full",{fontCharacter:"\\eb59"}),u.starHalf=new u("star-half",{fontCharacter:"\\eb5a"}),u.symbolClass=new u("symbol-class",{fontCharacter:"\\eb5b"}),u.symbolColor=new u("symbol-color",{fontCharacter:"\\eb5c"}),u.symbolConstant=new u("symbol-constant",{fontCharacter:"\\eb5d"}),u.symbolEnumMember=new u("symbol-enum-member",{fontCharacter:"\\eb5e"}),u.symbolField=new u("symbol-field",{fontCharacter:"\\eb5f"}),u.symbolFile=new u("symbol-file",{fontCharacter:"\\eb60"}),u.symbolInterface=new u("symbol-interface",{fontCharacter:"\\eb61"}),u.symbolKeyword=new u("symbol-keyword",{fontCharacter:"\\eb62"}),u.symbolMisc=new u("symbol-misc",{fontCharacter:"\\eb63"}),u.symbolOperator=new u("symbol-operator",{fontCharacter:"\\eb64"}),u.symbolProperty=new u("symbol-property",{fontCharacter:"\\eb65"}),u.wrench=new u("wrench",{fontCharacter:"\\eb65"}),u.wrenchSubaction=new u("wrench-subaction",{fontCharacter:"\\eb65"}),u.symbolSnippet=new u("symbol-snippet",{fontCharacter:"\\eb66"}),u.tasklist=new u("tasklist",{fontCharacter:"\\eb67"}),u.telescope=new u("telescope",{fontCharacter:"\\eb68"}),u.textSize=new u("text-size",{fontCharacter:"\\eb69"}),u.threeBars=new u("three-bars",{fontCharacter:"\\eb6a"}),u.thumbsdown=new u("thumbsdown",{fontCharacter:"\\eb6b"}),u.thumbsup=new u("thumbsup",{fontCharacter:"\\eb6c"}),u.tools=new u("tools",{fontCharacter:"\\eb6d"}),u.triangleDown=new u("triangle-down",{fontCharacter:"\\eb6e"}),u.triangleLeft=new u("triangle-left",{fontCharacter:"\\eb6f"}),u.triangleRight=new u("triangle-right",{fontCharacter:"\\eb70"}),u.triangleUp=new u("triangle-up",{fontCharacter:"\\eb71"}),u.twitter=new u("twitter",{fontCharacter:"\\eb72"}),u.unfold=new u("unfold",{fontCharacter:"\\eb73"}),u.unlock=new u("unlock",{fontCharacter:"\\eb74"}),u.unmute=new u("unmute",{fontCharacter:"\\eb75"}),u.unverified=new u("unverified",{fontCharacter:"\\eb76"}),u.verified=new u("verified",{fontCharacter:"\\eb77"}),u.versions=new u("versions",{fontCharacter:"\\eb78"}),u.vmActive=new u("vm-active",{fontCharacter:"\\eb79"}),u.vmOutline=new u("vm-outline",{fontCharacter:"\\eb7a"}),u.vmRunning=new u("vm-running",{fontCharacter:"\\eb7b"}),u.watch=new u("watch",{fontCharacter:"\\eb7c"}),u.whitespace=new u("whitespace",{fontCharacter:"\\eb7d"}),u.wholeWord=new u("whole-word",{fontCharacter:"\\eb7e"}),u.window=new u("window",{fontCharacter:"\\eb7f"}),u.wordWrap=new u("word-wrap",{fontCharacter:"\\eb80"}),u.zoomIn=new u("zoom-in",{fontCharacter:"\\eb81"}),u.zoomOut=new u("zoom-out",{fontCharacter:"\\eb82"}),u.listFilter=new u("list-filter",{fontCharacter:"\\eb83"}),u.listFlat=new u("list-flat",{fontCharacter:"\\eb84"}),u.listSelection=new u("list-selection",{fontCharacter:"\\eb85"}),u.selection=new u("selection",{fontCharacter:"\\eb85"}),u.listTree=new u("list-tree",{fontCharacter:"\\eb86"}),u.debugBreakpointFunctionUnverified=new u("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),u.debugBreakpointFunction=new u("debug-breakpoint-function",{fontCharacter:"\\eb88"}),u.debugBreakpointFunctionDisabled=new u("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),u.debugStackframeActive=new u("debug-stackframe-active",{fontCharacter:"\\eb89"}),u.debugStackframeDot=new u("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),u.debugStackframe=new u("debug-stackframe",{fontCharacter:"\\eb8b"}),u.debugStackframeFocused=new u("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),u.debugBreakpointUnsupported=new u("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),u.symbolString=new u("symbol-string",{fontCharacter:"\\eb8d"}),u.debugReverseContinue=new u("debug-reverse-continue",{fontCharacter:"\\eb8e"}),u.debugStepBack=new u("debug-step-back",{fontCharacter:"\\eb8f"}),u.debugRestartFrame=new u("debug-restart-frame",{fontCharacter:"\\eb90"}),u.callIncoming=new u("call-incoming",{fontCharacter:"\\eb92"}),u.callOutgoing=new u("call-outgoing",{fontCharacter:"\\eb93"}),u.menu=new u("menu",{fontCharacter:"\\eb94"}),u.expandAll=new u("expand-all",{fontCharacter:"\\eb95"}),u.feedback=new u("feedback",{fontCharacter:"\\eb96"}),u.groupByRefType=new u("group-by-ref-type",{fontCharacter:"\\eb97"}),u.ungroupByRefType=new u("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),u.account=new u("account",{fontCharacter:"\\eb99"}),u.bellDot=new u("bell-dot",{fontCharacter:"\\eb9a"}),u.debugConsole=new u("debug-console",{fontCharacter:"\\eb9b"}),u.library=new u("library",{fontCharacter:"\\eb9c"}),u.output=new u("output",{fontCharacter:"\\eb9d"}),u.runAll=new u("run-all",{fontCharacter:"\\eb9e"}),u.syncIgnored=new u("sync-ignored",{fontCharacter:"\\eb9f"}),u.pinned=new u("pinned",{fontCharacter:"\\eba0"}),u.githubInverted=new u("github-inverted",{fontCharacter:"\\eba1"}),u.debugAlt=new u("debug-alt",{fontCharacter:"\\eb91"}),u.serverProcess=new u("server-process",{fontCharacter:"\\eba2"}),u.serverEnvironment=new u("server-environment",{fontCharacter:"\\eba3"}),u.pass=new u("pass",{fontCharacter:"\\eba4"}),u.stopCircle=new u("stop-circle",{fontCharacter:"\\eba5"}),u.playCircle=new u("play-circle",{fontCharacter:"\\eba6"}),u.record=new u("record",{fontCharacter:"\\eba7"}),u.debugAltSmall=new u("debug-alt-small",{fontCharacter:"\\eba8"}),u.vmConnect=new u("vm-connect",{fontCharacter:"\\eba9"}),u.cloud=new u("cloud",{fontCharacter:"\\ebaa"}),u.merge=new u("merge",{fontCharacter:"\\ebab"}),u.exportIcon=new u("export",{fontCharacter:"\\ebac"}),u.graphLeft=new u("graph-left",{fontCharacter:"\\ebad"}),u.magnet=new u("magnet",{fontCharacter:"\\ebae"}),u.notebook=new u("notebook",{fontCharacter:"\\ebaf"}),u.redo=new u("redo",{fontCharacter:"\\ebb0"}),u.checkAll=new u("check-all",{fontCharacter:"\\ebb1"}),u.pinnedDirty=new u("pinned-dirty",{fontCharacter:"\\ebb2"}),u.passFilled=new u("pass-filled",{fontCharacter:"\\ebb3"}),u.circleLargeFilled=new u("circle-large-filled",{fontCharacter:"\\ebb4"}),u.circleLargeOutline=new u("circle-large-outline",{fontCharacter:"\\ebb5"}),u.combine=new u("combine",{fontCharacter:"\\ebb6"}),u.gather=new u("gather",{fontCharacter:"\\ebb6"}),u.table=new u("table",{fontCharacter:"\\ebb7"}),u.variableGroup=new u("variable-group",{fontCharacter:"\\ebb8"}),u.typeHierarchy=new u("type-hierarchy",{fontCharacter:"\\ebb9"}),u.typeHierarchySub=new u("type-hierarchy-sub",{fontCharacter:"\\ebba"}),u.typeHierarchySuper=new u("type-hierarchy-super",{fontCharacter:"\\ebbb"}),u.gitPullRequestCreate=new u("git-pull-request-create",{fontCharacter:"\\ebbc"}),u.runAbove=new u("run-above",{fontCharacter:"\\ebbd"}),u.runBelow=new u("run-below",{fontCharacter:"\\ebbe"}),u.notebookTemplate=new u("notebook-template",{fontCharacter:"\\ebbf"}),u.debugRerun=new u("debug-rerun",{fontCharacter:"\\ebc0"}),u.workspaceTrusted=new u("workspace-trusted",{fontCharacter:"\\ebc1"}),u.workspaceUntrusted=new u("workspace-untrusted",{fontCharacter:"\\ebc2"}),u.workspaceUnspecified=new u("workspace-unspecified",{fontCharacter:"\\ebc3"}),u.terminalCmd=new u("terminal-cmd",{fontCharacter:"\\ebc4"}),u.terminalDebian=new u("terminal-debian",{fontCharacter:"\\ebc5"}),u.terminalLinux=new u("terminal-linux",{fontCharacter:"\\ebc6"}),u.terminalPowershell=new u("terminal-powershell",{fontCharacter:"\\ebc7"}),u.terminalTmux=new u("terminal-tmux",{fontCharacter:"\\ebc8"}),u.terminalUbuntu=new u("terminal-ubuntu",{fontCharacter:"\\ebc9"}),u.terminalBash=new u("terminal-bash",{fontCharacter:"\\ebca"}),u.arrowSwap=new u("arrow-swap",{fontCharacter:"\\ebcb"}),u.copy=new u("copy",{fontCharacter:"\\ebcc"}),u.personAdd=new u("person-add",{fontCharacter:"\\ebcd"}),u.filterFilled=new u("filter-filled",{fontCharacter:"\\ebce"}),u.wand=new u("wand",{fontCharacter:"\\ebcf"}),u.debugLineByLine=new u("debug-line-by-line",{fontCharacter:"\\ebd0"}),u.inspect=new u("inspect",{fontCharacter:"\\ebd1"}),u.layers=new u("layers",{fontCharacter:"\\ebd2"}),u.layersDot=new u("layers-dot",{fontCharacter:"\\ebd3"}),u.layersActive=new u("layers-active",{fontCharacter:"\\ebd4"}),u.compass=new u("compass",{fontCharacter:"\\ebd5"}),u.compassDot=new u("compass-dot",{fontCharacter:"\\ebd6"}),u.compassActive=new u("compass-active",{fontCharacter:"\\ebd7"}),u.azure=new u("azure",{fontCharacter:"\\ebd8"}),u.issueDraft=new u("issue-draft",{fontCharacter:"\\ebd9"}),u.gitPullRequestClosed=new u("git-pull-request-closed",{fontCharacter:"\\ebda"}),u.gitPullRequestDraft=new u("git-pull-request-draft",{fontCharacter:"\\ebdb"}),u.debugAll=new u("debug-all",{fontCharacter:"\\ebdc"}),u.debugCoverage=new u("debug-coverage",{fontCharacter:"\\ebdd"}),u.runErrors=new u("run-errors",{fontCharacter:"\\ebde"}),u.folderLibrary=new u("folder-library",{fontCharacter:"\\ebdf"}),u.debugContinueSmall=new u("debug-continue-small",{fontCharacter:"\\ebe0"}),u.beakerStop=new u("beaker-stop",{fontCharacter:"\\ebe1"}),u.graphLine=new u("graph-line",{fontCharacter:"\\ebe2"}),u.graphScatter=new u("graph-scatter",{fontCharacter:"\\ebe3"}),u.pieChart=new u("pie-chart",{fontCharacter:"\\ebe4"}),u.bracket=new u("bracket",u.json.definition),u.bracketDot=new u("bracket-dot",{fontCharacter:"\\ebe5"}),u.bracketError=new u("bracket-error",{fontCharacter:"\\ebe6"}),u.lockSmall=new u("lock-small",{fontCharacter:"\\ebe7"}),u.azureDevops=new u("azure-devops",{fontCharacter:"\\ebe8"}),u.verifiedFilled=new u("verified-filled",{fontCharacter:"\\ebe9"})}(De||(De={}))},79881:function(Kt,it,X){"use strict";X.d(it,{B8:function(){return B},Cp:function(){return ye},F0:function(){return pe},L6:function(){return Q},VV:function(){return De},b1:function(){return u},dL:function(){return Be},ri:function(){return te}});class F{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(k){setTimeout(()=>{throw k.stack?new Error(k.message+`
`+k.stack):k},0)}}emit(k){this.listeners.forEach(S=>{S(k)})}onUnexpectedError(k){this.unexpectedErrorHandler(k),this.emit(k)}onUnexpectedExternalError(k){this.unexpectedErrorHandler(k)}}const Te=new F;function Be(b){De(b)||Te.onUnexpectedError(b)}function ye(b){De(b)||Te.onUnexpectedExternalError(b)}function te(b){if(b instanceof Error){let{name:k,message:S}=b;const C=b.stacktrace||b.stack;return{$isError:!0,name:k,message:S,stack:C}}return b}const _="Canceled";function De(b){return b instanceof Error&&b.name===_&&b.message===_}function pe(){const b=new Error(_);return b.name=b.message,b}function u(b){return b?new Error(`Illegal argument: ${b}`):new Error("Illegal argument")}function Q(b){return b?new Error(`Illegal state: ${b}`):new Error("Illegal state")}class B extends Error{constructor(k){super("NotSupported"),k&&(this.message=k)}}},4348:function(Kt,it,X){"use strict";X.d(it,{D0:function(){return B},E7:function(){return b},K3:function(){return Q},Q5:function(){return u},ZD:function(){return k},ju:function(){return te}});var F=X(79881),Te=X(69323),Be=X(34502),ye=X(95830),te;(function(S){S.None=()=>Te.JT.None;function C(j){return(J,se=null,Z)=>{let w=!1,E;return E=j(K=>{if(!w)return E?E.dispose():w=!0,J.call(se,K)},null,Z),w&&E.dispose(),E}}S.once=C;function H(j,J){return ee((se,Z=null,w)=>j(E=>se.call(Z,J(E)),null,w))}S.map=H;function V(j,J){return ee((se,Z=null,w)=>j(E=>{J(E),se.call(Z,E)},null,w))}S.forEach=V;function M(j,J){return ee((se,Z=null,w)=>j(E=>J(E)&&se.call(Z,E),null,w))}S.filter=M;function I(j){return j}S.signal=I;function z(...j){return(J,se=null,Z)=>(0,Te.F8)(...j.map(w=>w(E=>J.call(se,E),null,Z)))}S.any=z;function ae(j,J,se){let Z=se;return H(j,w=>(Z=J(Z,w),Z))}S.reduce=ae;function ee(j){let J;const se=new u({onFirstListenerAdd(){J=j(se.fire,se)},onLastListenerRemove(){J.dispose()}});return se.event}function _e(j,J,se=100,Z=!1,w){let E,K,de,Ue=0;const Ye=new u({leakWarningThreshold:w,onFirstListenerAdd(){E=j(ct=>{Ue++,K=J(K,ct),Z&&!de&&(Ye.fire(K),K=void 0),clearTimeout(de),de=setTimeout(()=>{const at=K;K=void 0,de=void 0,(!Z||Ue>1)&&Ye.fire(at),Ue=0},se)})},onLastListenerRemove(){E.dispose()}});return Ye.event}S.debounce=_e;function be(j,J=(se,Z)=>se===Z){let se=!0,Z;return M(j,w=>{const E=se||!J(w,Z);return se=!1,Z=w,E})}S.latch=be;function ce(j,J){return[S.filter(j,J),S.filter(j,se=>!J(se))]}S.split=ce;function ve(j,J=!1,se=[]){let Z=se.slice(),w=j(de=>{Z?Z.push(de):K.fire(de)});const E=()=>{Z&&Z.forEach(de=>K.fire(de)),Z=null},K=new u({onFirstListenerAdd(){w||(w=j(de=>K.fire(de)))},onFirstListenerDidAdd(){Z&&(J?setTimeout(E):E())},onLastListenerRemove(){w&&w.dispose(),w=null}});return K.event}S.buffer=ve;class Ie{constructor(J){this.event=J}map(J){return new Ie(H(this.event,J))}forEach(J){return new Ie(V(this.event,J))}filter(J){return new Ie(M(this.event,J))}reduce(J,se){return new Ie(ae(this.event,J,se))}latch(){return new Ie(be(this.event))}debounce(J,se=100,Z=!1,w){return new Ie(_e(this.event,J,se,Z,w))}on(J,se,Z){return this.event(J,se,Z)}once(J,se,Z){return C(this.event)(J,se,Z)}}function Ae(j){return new Ie(j)}S.chain=Ae;function We(j,J,se=Z=>Z){const Z=(...de)=>K.fire(se(...de)),w=()=>j.on(J,Z),E=()=>j.removeListener(J,Z),K=new u({onFirstListenerAdd:w,onLastListenerRemove:E});return K.event}S.fromNodeEventEmitter=We;function Y(j,J,se=Z=>Z){const Z=(...de)=>K.fire(se(...de)),w=()=>j.addEventListener(J,Z),E=()=>j.removeEventListener(J,Z),K=new u({onFirstListenerAdd:w,onLastListenerRemove:E});return K.event}S.fromDOMEventEmitter=Y;function P(j){return new Promise(J=>C(j)(J))}S.toPromise=P})(te||(te={}));class _{constructor(C){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${C}_${_._idPool++}`}start(C){this._stopWatch=new ye.G(!0),this._listenerCount=C}stop(){if(this._stopWatch){const C=this._stopWatch.elapsed();this._elapsedOverall+=C,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${C.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}_._idPool=0;let De=-1;class pe{constructor(C,H=Math.random().toString(18).slice(2,5)){this.customThreshold=C,this.name=H,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(C){let H=De;if(typeof this.customThreshold=="number"&&(H=this.customThreshold),H<=0||C<H)return;this._stacks||(this._stacks=new Map);const V=new Error().stack.split(`
`).slice(3).join(`
`),M=this._stacks.get(V)||0;if(this._stacks.set(V,M+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=H*.5;let I,z=0;for(const[ae,ee]of this._stacks)(!I||z<ee)&&(I=ae,z=ee);console.warn(`[${this.name}] potential listener LEAK detected, having ${C} listeners already. MOST frequent listener (${z}):`),console.warn(I)}return()=>{const I=this._stacks.get(V)||0;this._stacks.set(V,I-1)}}}class u{constructor(C){var H;this._disposed=!1,this._options=C,this._leakageMon=De>0?new pe(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((H=this._options)===null||H===void 0)&&H._profName?new _(this._options._profName):void 0}get event(){return this._event||(this._event=(C,H,V)=>{var M;this._listeners||(this._listeners=new Be.S);const I=this._listeners.isEmpty();I&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const z=this._listeners.push(H?[C,H]:C);I&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,C,H);const ae=(M=this._leakageMon)===null||M===void 0?void 0:M.check(this._listeners.size),ee=(0,Te.OF)(()=>{ae&&ae(),this._disposed||(z(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return V instanceof Te.SL?V.add(ee):Array.isArray(V)&&V.push(ee),ee}),this._event}fire(C){var H,V;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Be.S);for(let M of this._listeners)this._deliveryQueue.push([M,C]);for((H=this._perfMon)===null||H===void 0||H.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[M,I]=this._deliveryQueue.shift();try{typeof M=="function"?M.call(void 0,I):M[0].call(M[1],I)}catch(z){(0,F.dL)(z)}}(V=this._perfMon)===null||V===void 0||V.stop()}}dispose(){var C,H,V,M,I;this._disposed||(this._disposed=!0,(C=this._listeners)===null||C===void 0||C.clear(),(H=this._deliveryQueue)===null||H===void 0||H.clear(),(M=(V=this._options)===null||V===void 0?void 0:V.onLastListenerRemove)===null||M===void 0||M.call(V),(I=this._leakageMon)===null||I===void 0||I.dispose())}}class Q extends u{constructor(C){super(C),this._isPaused=0,this._eventQueue=new Be.S,this._mergeFn=C==null?void 0:C.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const C=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(C))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(C){this._listeners&&(this._isPaused!==0?this._eventQueue.push(C):super.fire(C))}}class B extends Q{constructor(C){var H;super(C),this._delay=(H=C.delay)!==null&&H!==void 0?H:100}fire(C){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(C)}}class b{constructor(){this.buffers=[]}wrapEvent(C){return(H,V,M)=>C(I=>{const z=this.buffers[this.buffers.length-1];z?z.push(()=>H.call(V,I)):H.call(V,I)},void 0,M)}bufferEvents(C){const H=[];this.buffers.push(H);const V=C();return this.buffers.pop(),H.forEach(M=>M()),V}}class k{constructor(){this.listening=!1,this.inputEvent=te.None,this.inputEventListener=Te.JT.None,this.emitter=new u({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(C){this.inputEvent=C,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=C(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(Kt,it,X){"use strict";X.d(it,{I:function(){return F}});function F(Te){const Be=this;let ye=!1,te;return function(){return ye||(ye=!0,te=Te.apply(Be,arguments)),te}}},88226:function(Kt,it,X){"use strict";X.d(it,{$:function(){return F}});var F;(function(Te){function Be(z){return z&&typeof z=="object"&&typeof z[Symbol.iterator]=="function"}Te.is=Be;const ye=Object.freeze([]);function te(){return ye}Te.empty=te;function*_(z){yield z}Te.single=_;function De(z){return z||ye}Te.from=De;function pe(z){return!z||z[Symbol.iterator]().next().done===!0}Te.isEmpty=pe;function u(z){return z[Symbol.iterator]().next().value}Te.first=u;function Q(z,ae){for(const ee of z)if(ae(ee))return!0;return!1}Te.some=Q;function B(z,ae){for(const ee of z)if(ae(ee))return ee}Te.find=B;function*b(z,ae){for(const ee of z)ae(ee)&&(yield ee)}Te.filter=b;function*k(z,ae){let ee=0;for(const _e of z)yield ae(_e,ee++)}Te.map=k;function*S(...z){for(const ae of z)for(const ee of ae)yield ee}Te.concat=S;function*C(z){for(const ae of z)for(const ee of ae)yield ee}Te.concatNested=C;function H(z,ae,ee){let _e=ee;for(const be of z)_e=ae(_e,be);return _e}Te.reduce=H;function*V(z,ae,ee=z.length){for(ae<0&&(ae+=z.length),ee<0?ee+=z.length:ee>z.length&&(ee=z.length);ae<ee;ae++)yield z[ae]}Te.slice=V;function M(z,ae=Number.POSITIVE_INFINITY){const ee=[];if(ae===0)return[ee,z];const _e=z[Symbol.iterator]();for(let be=0;be<ae;be++){const ce=_e.next();if(ce.done)return[ee,Te.empty()];ee.push(ce.value)}return[ee,{[Symbol.iterator](){return _e}}]}Te.consume=M;function I(z,ae,ee=(_e,be)=>_e===be){const _e=z[Symbol.iterator](),be=ae[Symbol.iterator]();for(;;){const ce=_e.next(),ve=be.next();if(ce.done!==ve.done)return!1;if(ce.done)return!0;if(!ee(ce.value,ve.value))return!1}}Te.equals=I})(F||(F={}))},69323:function(Kt,it,X){"use strict";X.d(it,{B9:function(){return k},F8:function(){return S},JT:function(){return V},Jz:function(){return I},OF:function(){return C},SL:function(){return H},Wf:function(){return b},XK:function(){return M},dk:function(){return Q}});var F=X(17845),Te=X(88226);const Be=!1;let ye=null;function te(z){ye=z}if(Be){const z="__is_disposable_tracked__";te(new class{trackDisposable(ae){const ee=new Error("Potentially leaked disposable").stack;setTimeout(()=>{ae[z]||console.log(ee)},3e3)}setParent(ae,ee){if(ae&&ae!==V.None)try{ae[z]=!0}catch(_e){}}markAsDisposed(ae){if(ae&&ae!==V.None)try{ae[z]=!0}catch(ee){}}markAsSingleton(ae){}})}function _(z){return ye==null||ye.trackDisposable(z),z}function De(z){ye==null||ye.markAsDisposed(z)}function pe(z,ae){ye==null||ye.setParent(z,ae)}function u(z,ae){if(ye)for(const ee of z)ye.setParent(ee,ae)}function Q(z){return ye==null||ye.markAsSingleton(z),z}class B extends Error{constructor(ae){super(`Encountered errors while disposing of store. Errors: [${ae.join(", ")}]`),this.errors=ae}}function b(z){return typeof z.dispose=="function"&&z.dispose.length===0}function k(z){if(Te.$.is(z)){let ae=[];for(const ee of z)if(ee)try{ee.dispose()}catch(_e){ae.push(_e)}if(ae.length===1)throw ae[0];if(ae.length>1)throw new B(ae);return Array.isArray(z)?[]:z}else if(z)return z.dispose(),z}function S(...z){const ae=C(()=>k(z));return u(z,ae),ae}function C(z){const ae=_({dispose:(0,F.I)(()=>{De(ae),z()})});return ae}class H{constructor(){this._toDispose=new Set,this._isDisposed=!1,_(this)}dispose(){this._isDisposed||(De(this),this._isDisposed=!0,this.clear())}clear(){try{k(this._toDispose.values())}finally{this._toDispose.clear()}}add(ae){if(!ae)return ae;if(ae===this)throw new Error("Cannot register a disposable on itself!");return pe(ae,this),this._isDisposed?H.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(ae),ae}}H.DISABLE_DISPOSED_WARNING=!1;class V{constructor(){this._store=new H,_(this),pe(this._store,this)}dispose(){De(this),this._store.dispose()}_register(ae){if(ae===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(ae)}}V.None=Object.freeze({dispose(){}});class M{constructor(){this._isDisposed=!1,_(this)}get value(){return this._isDisposed?void 0:this._value}set value(ae){var ee;this._isDisposed||ae===this._value||((ee=this._value)===null||ee===void 0||ee.dispose(),ae&&pe(ae,this),this._value=ae)}clear(){this.value=void 0}dispose(){var ae;this._isDisposed=!0,De(this),(ae=this._value)===null||ae===void 0||ae.dispose(),this._value=void 0}clearAndLeak(){const ae=this._value;return this._value=void 0,ae&&pe(ae,null),ae}}class I{constructor(ae){this.object=ae}dispose(){}}},34502:function(Kt,it,X){"use strict";X.d(it,{S:function(){return Te}});class F{constructor(ye){this.element=ye,this.next=F.Undefined,this.prev=F.Undefined}}F.Undefined=new F(void 0);class Te{constructor(){this._first=F.Undefined,this._last=F.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===F.Undefined}clear(){let ye=this._first;for(;ye!==F.Undefined;){const te=ye.next;ye.prev=F.Undefined,ye.next=F.Undefined,ye=te}this._first=F.Undefined,this._last=F.Undefined,this._size=0}unshift(ye){return this._insert(ye,!1)}push(ye){return this._insert(ye,!0)}_insert(ye,te){const _=new F(ye);if(this._first===F.Undefined)this._first=_,this._last=_;else if(te){const pe=this._last;this._last=_,_.prev=pe,pe.next=_}else{const pe=this._first;this._first=_,_.next=pe,pe.prev=_}this._size+=1;let De=!1;return()=>{De||(De=!0,this._remove(_))}}shift(){if(this._first!==F.Undefined){const ye=this._first.element;return this._remove(this._first),ye}}pop(){if(this._last!==F.Undefined){const ye=this._last.element;return this._remove(this._last),ye}}_remove(ye){if(ye.prev!==F.Undefined&&ye.next!==F.Undefined){const te=ye.prev;te.next=ye.next,ye.next.prev=te}else ye.prev===F.Undefined&&ye.next===F.Undefined?(this._first=F.Undefined,this._last=F.Undefined):ye.next===F.Undefined?(this._last=this._last.prev,this._last.next=F.Undefined):ye.prev===F.Undefined&&(this._first=this._first.next,this._first.prev=F.Undefined);this._size-=1}*[Symbol.iterator](){let ye=this._first;for(;ye!==F.Undefined;)yield ye.element,ye=ye.next}}},23345:function(Kt,it,X){"use strict";X.d(it,{$L:function(){return _e},ED:function(){return I},IJ:function(){return ae},OS:function(){return Ie},WE:function(){return ce},dz:function(){return z},gn:function(){return be},li:function(){return C},r:function(){return Y},tY:function(){return ee},xS:function(){return ve}});var F=X(97671),Te;const Be="en";let ye=!1,te=!1,_=!1,De=!1,pe=!1,u=!1,Q=!1,B,b=null,k=null,S;const C=typeof self=="object"?self:typeof X.g=="object"?X.g:{};let H;typeof C.vscode!="undefined"&&typeof C.vscode.process!="undefined"?H=C.vscode.process:typeof F!="undefined"&&(H=F);const V=typeof((Te=H==null?void 0:H.versions)===null||Te===void 0?void 0:Te.electron)=="string"&&H.type==="renderer";if(typeof navigator=="object"&&!V)S=navigator.userAgent,ye=S.indexOf("Windows")>=0,te=S.indexOf("Macintosh")>=0,Q=(S.indexOf("Macintosh")>=0||S.indexOf("iPad")>=0||S.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_=S.indexOf("Linux")>=0,u=!0,B=navigator.language,b=B;else if(typeof H=="object"){ye=H.platform==="win32",te=H.platform==="darwin",_=H.platform==="linux",De=_&&!!H.env.SNAP&&!!H.env.SNAP_REVISION,B=Be,b=Be;const P=H.env.VSCODE_NLS_CONFIG;if(P)try{const j=JSON.parse(P),J=j.availableLanguages["*"];B=j.locale,b=J||Be,k=j._translationsConfigFile}catch(j){}pe=!0}else console.error("Unable to resolve platform.");let M=0;te?M=1:ye?M=3:_&&(M=2);const I=ye,z=te,ae=_,ee=pe,_e=u,be=Q,ce=S,ve=function(){if(C.setImmediate)return C.setImmediate.bind(C);if(typeof C.postMessage=="function"&&!C.importScripts){let J=[];C.addEventListener("message",Z=>{if(Z.data&&Z.data.vscodeSetImmediateId)for(let w=0,E=J.length;w<E;w++){const K=J[w];if(K.id===Z.data.vscodeSetImmediateId){J.splice(w,1),K.callback();return}}});let se=0;return Z=>{const w=++se;J.push({id:w,callback:Z}),C.postMessage({vscodeSetImmediateId:w},"*")}}if(typeof(H==null?void 0:H.nextTick)=="function")return H.nextTick.bind(H);const j=Promise.resolve();return J=>j.then(J)}(),Ie=te||Q?2:ye?1:3;let Ae=!0,We=!1;function Y(){if(!We){We=!0;const P=new Uint8Array(2);P[0]=1,P[1]=2,Ae=new Uint16Array(P.buffer)[0]===513}return Ae}},95830:function(Kt,it,X){"use strict";X.d(it,{G:function(){return Be}});var F=X(23345);const Te=F.li.performance&&typeof F.li.performance.now=="function";class Be{constructor(te){this._highResolution=Te&&te,this._startTime=this._now(),this._stopTime=-1}static create(te=!0){return new Be(te)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?F.li.performance.now():Date.now()}}},82983:function(Kt,it,X){"use strict";X.d(it,{$i:function(){return Ue},C8:function(){return bt},GF:function(){return B},HO:function(){return se},IO:function(){return b},K7:function(){return Dt},Kw:function(){return nt},LC:function(){return C},Mh:function(){return ve},P1:function(){return Ie},PJ:function(){return kt},Qe:function(){return Ye},R1:function(){return Q},RP:function(){return K},S6:function(){return et},TT:function(){return I},Ut:function(){return w},V8:function(){return H},WU:function(){return Be},YK:function(){return We},YU:function(){return ye},ZG:function(){return Ae},ZH:function(){return P},ab:function(){return ct},c1:function(){return ot},df:function(){return _e},ec:function(){return te},fi:function(){return Nt},fy:function(){return _},j3:function(){return De},j_:function(){return ae},m5:function(){return F},mK:function(){return ee},mr:function(){return k},oH:function(){return Ee},oL:function(){return pe},ok:function(){return ce},ow:function(){return V},qq:function(){return be},qu:function(){return M},rL:function(){return Y},uS:function(){return Qt},un:function(){return u},uq:function(){return S},vH:function(){return J},xe:function(){return at},zY:function(){return z}});function F(re){return!re||typeof re!="string"?!0:re.trim().length===0}const Te=/{(\d+)}/g;function Be(re,...Se){return Se.length===0?re:re.replace(Te,function(je,Ge){const Ze=parseInt(Ge,10);return isNaN(Ze)||Ze<0||Ze>=Se.length?je:Se[Ze]})}function ye(re){return re.replace(/[<>&]/g,function(Se){switch(Se){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Se}})}function te(re){return re.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function _(re,Se=" "){const je=De(re,Se);return pe(je,Se)}function De(re,Se){if(!re||!Se)return re;const je=Se.length;if(je===0||re.length===0)return re;let Ge=0;for(;re.indexOf(Se,Ge)===Ge;)Ge=Ge+je;return re.substring(Ge)}function pe(re,Se){if(!re||!Se)return re;const je=Se.length,Ge=re.length;if(je===0||Ge===0)return re;let Ze=Ge,mt=-1;for(;mt=re.lastIndexOf(Se,Ze-1),!(mt===-1||mt+je!==Ze);){if(mt===0)return"";Ze=mt}return re.substring(0,Ze)}function u(re){return re.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function Q(re){return re.replace(/\*/g,"")}function B(re,Se,je={}){if(!re)throw new Error("Cannot create regex from empty string");Se||(re=te(re)),je.wholeWord&&(/\B/.test(re.charAt(0))||(re="\\b"+re),/\B/.test(re.charAt(re.length-1))||(re=re+"\\b"));let Ge="";return je.global&&(Ge+="g"),je.matchCase||(Ge+="i"),je.multiline&&(Ge+="m"),je.unicode&&(Ge+="u"),new RegExp(re,Ge)}function b(re){return re.source==="^"||re.source==="^$"||re.source==="$"||re.source==="^\\s*$"?!1:!!(re.exec("")&&re.lastIndex===0)}function k(re){return(re.global?"g":"")+(re.ignoreCase?"i":"")+(re.multiline?"m":"")+(re.unicode?"u":"")}function S(re){return re.split(/\r\n|\r|\n/)}function C(re){for(let Se=0,je=re.length;Se<je;Se++){const Ge=re.charCodeAt(Se);if(Ge!==32&&Ge!==9)return Se}return-1}function H(re,Se=0,je=re.length){for(let Ge=Se;Ge<je;Ge++){const Ze=re.charCodeAt(Ge);if(Ze!==32&&Ze!==9)return re.substring(Se,Ge)}return re.substring(Se,je)}function V(re,Se=re.length-1){for(let je=Se;je>=0;je--){const Ge=re.charCodeAt(je);if(Ge!==32&&Ge!==9)return je}return-1}function M(re,Se){return re<Se?-1:re>Se?1:0}function I(re,Se,je=0,Ge=re.length,Ze=0,mt=Se.length){for(;je<Ge&&Ze<mt;je++,Ze++){let _t=re.charCodeAt(je),vt=Se.charCodeAt(Ze);if(_t<vt)return-1;if(_t>vt)return 1}const Pt=Ge-je,yt=mt-Ze;return Pt<yt?-1:Pt>yt?1:0}function z(re,Se){return ae(re,Se,0,re.length,0,Se.length)}function ae(re,Se,je=0,Ge=re.length,Ze=0,mt=Se.length){for(;je<Ge&&Ze<mt;je++,Ze++){let _t=re.charCodeAt(je),vt=Se.charCodeAt(Ze);if(_t===vt)continue;if(_t>=128||vt>=128)return I(re.toLowerCase(),Se.toLowerCase(),je,Ge,Ze,mt);ee(_t)&&(_t-=32),ee(vt)&&(vt-=32);const $t=_t-vt;if($t!==0)return $t}const Pt=Ge-je,yt=mt-Ze;return Pt<yt?-1:Pt>yt?1:0}function ee(re){return re>=97&&re<=122}function _e(re){return re>=65&&re<=90}function be(re,Se){return re.length===Se.length&&ae(re,Se)===0}function ce(re,Se){const je=Se.length;return Se.length>re.length?!1:ae(re,Se,0,je)===0}function ve(re,Se){let je,Ge=Math.min(re.length,Se.length);for(je=0;je<Ge;je++)if(re.charCodeAt(je)!==Se.charCodeAt(je))return je;return Ge}function Ie(re,Se){let je,Ge=Math.min(re.length,Se.length);const Ze=re.length-1,mt=Se.length-1;for(je=0;je<Ge;je++)if(re.charCodeAt(Ze-je)!==Se.charCodeAt(mt-je))return je;return Ge}function Ae(re){return 55296<=re&&re<=56319}function We(re){return 56320<=re&&re<=57343}function Y(re,Se){return(re-55296<<10)+(Se-56320)+65536}function P(re,Se,je){const Ge=re.charCodeAt(je);if(Ae(Ge)&&je+1<Se){const Ze=re.charCodeAt(je+1);if(We(Ze))return Y(Ge,Ze)}return Ge}function j(re,Se){const je=re.charCodeAt(Se-1);if(We(je)&&Se>1){const Ge=re.charCodeAt(Se-2);if(Ae(Ge))return Y(Ge,je)}return je}function J(re,Se){const je=Pe.getInstance(),Ge=Se,Ze=re.length,mt=P(re,Ze,Se);Se+=mt>=65536?2:1;let Pt=je.getGraphemeBreakType(mt);for(;Se<Ze;){const yt=P(re,Ze,Se),_t=je.getGraphemeBreakType(yt);if(Nt(Pt,_t))break;Se+=yt>=65536?2:1,Pt=_t}return Se-Ge}function se(re,Se){const je=Pe.getInstance(),Ge=Se,Ze=j(re,Se);Se-=Ze>=65536?2:1;let mt=je.getGraphemeBreakType(Ze);for(;Se>0;){const Pt=j(re,Se),yt=je.getGraphemeBreakType(Pt);if(Nt(yt,mt))break;Se-=Pt>=65536?2:1,mt=yt}return Ge-Se}const Z=/(?:[\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 w(re){return Z.test(re)}const E=/(?:[\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 K(re){return E.test(re)}const de=/^[\t\n\r\x20-\x7E]*$/;function Ue(re){return de.test(re)}const Ye=/[\u2028\u2029]/;function ct(re){return Ye.test(re)}function at(re){for(let Se=0,je=re.length;Se<je;Se++)if(Dt(re.charCodeAt(Se)))return!0;return!1}function Dt(re){return re=+re,re>=11904&&re<=55215||re>=63744&&re<=64255||re>=65281&&re<=65374}function bt(re){return re>=127462&&re<=127487||re===8986||re===8987||re===9200||re===9203||re>=9728&&re<=10175||re===11088||re===11093||re>=127744&&re<=128591||re>=128640&&re<=128764||re>=128992&&re<=129003||re>=129280&&re<=129535||re>=129648&&re<=129750}const ot="\uFEFF";function Qt(re){return!!(re&&re.length>0&&re.charCodeAt(0)===65279)}function nt(re,Se=!1){return re?(Se&&(re=re.replace(/\\./g,"")),re.toLowerCase()!==re):!1}function kt(re){return re=re%(2*26),re<26?String.fromCharCode(97+re):String.fromCharCode(65+re-26)}function et(re){return Pe.getInstance().getGraphemeBreakType(re)}function Nt(re,Se){return re===0?Se!==5&&Se!==7:re===2&&Se===3?!1:re===4||re===2||re===3||Se===4||Se===2||Se===3?!0:!(re===8&&(Se===8||Se===9||Se===11||Se===12)||(re===11||re===9)&&(Se===9||Se===10)||(re===12||re===10)&&Se===10||Se===5||Se===13||Se===7||re===1||re===13&&Se===14||re===6&&Se===6)}class Pe{constructor(){this._data=$e()}static getInstance(){return Pe._INSTANCE||(Pe._INSTANCE=new Pe),Pe._INSTANCE}getGraphemeBreakType(Se){if(Se<32)return Se===10?3:Se===13?2:4;if(Se<127)return 0;const je=this._data,Ge=je.length/3;let Ze=1;for(;Ze<=Ge;)if(Se<je[3*Ze])Ze=2*Ze;else if(Se>je[3*Ze+1])Ze=2*Ze+1;else return je[3*Ze+2];return 0}}Pe._INSTANCE=null;function $e(){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 Ee(re,Se){if(re===0)return 0;const je=Ve(re,Se);if(je!==void 0)return je;const Ge=j(Se,re);return re-=Je(Ge),re}function Ve(re,Se){let je=j(Se,re);for(re-=Je(je);lt(je)||je===65039||je===8419;){if(re===0)return;je=j(Se,re),re-=Je(je)}if(bt(je)){if(re>=0){const Ge=j(Se,re);Ge===8205&&(re-=Je(Ge))}return re}}function Je(re){return re>=65536?2:1}function lt(re){return 127995<=re&&re<=127999}},72999:function(Kt,it,X){"use strict";X.d(it,{$E:function(){return C},$K:function(){return De},D8:function(){return b},HD:function(){return Te},IU:function(){return H},Jp:function(){return pe},Kn:function(){return Be},cW:function(){return Q},f6:function(){return V},hj:function(){return ye},jn:function(){return te},kJ:function(){return F},mf:function(){return B},o8:function(){return _},p_:function(){return u},vE:function(){return M}});function F(I){return Array.isArray(I)}function Te(I){return typeof I=="string"}function Be(I){return typeof I=="object"&&I!==null&&!Array.isArray(I)&&!(I instanceof RegExp)&&!(I instanceof Date)}function ye(I){return typeof I=="number"&&!isNaN(I)}function te(I){return I===!0||I===!1}function _(I){return typeof I=="undefined"}function De(I){return!pe(I)}function pe(I){return _(I)||I===null}function u(I,z){if(!I)throw new Error(z?`Unexpected type, expected '${z}'`:"Unexpected type")}function Q(I){if(pe(I))throw new Error("Assertion Failed: argument is undefined or null");return I}function B(I){return typeof I=="function"}function b(I,z){const ae=Math.min(I.length,z.length);for(let ee=0;ee<ae;ee++)k(I[ee],z[ee])}function k(I,z){if(Te(z)){if(typeof I!==z)throw new Error(`argument does not match constraint: typeof ${z}`)}else if(B(z)){try{if(I instanceof z)return}catch(ae){}if(!pe(I)&&I.constructor===z||z.length===1&&z.call(void 0,I)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function S(I){let z=[],ae=Object.getPrototypeOf(I);for(;Object.prototype!==ae;)z=z.concat(Object.getOwnPropertyNames(ae)),ae=Object.getPrototypeOf(ae);return z}function C(I){const z=[];for(const ae of S(I))typeof I[ae]=="function"&&z.push(ae);return z}function H(I,z){const ae=_e=>function(){const be=Array.prototype.slice.call(arguments,0);return z(_e,be)};let ee={};for(const _e of I)ee[_e]=ae(_e);return ee}function V(I){return I===null?void 0:I}function M(I,z="Unreachable"){throw new Error(z)}},13268:function(Kt,it,X){"use strict";X.d(it,{N:function(){return Te}});function F(Be,ye){let te;return ye.length===0?te=Be:te=Be.replace(/\{(\d+)\}/g,function(_,De){const pe=De[0];return typeof ye[pe]!="undefined"?ye[pe]:_}),te}function Te(Be,ye,...te){return F(ye,te)}},96236:function(Kt,it,X){"use strict";X.d(it,{BH:function(){return H},NZ:function(){return V},U8:function(){return M},co:function(){return C},eH:function(){return S},vr:function(){return k}});var F=X(75918),Te=X(52615),Be=X(4348),ye=X(88226),te=X(69323),_=X(34502),De=X(35884),pe=X(90689),u=X(16925),Q=X(49055),B=function(I,z,ae,ee){var _e=arguments.length,be=_e<3?z:ee===null?ee=Object.getOwnPropertyDescriptor(z,ae):ee,ce;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")be=Reflect.decorate(I,z,ae,ee);else for(var ve=I.length-1;ve>=0;ve--)(ce=I[ve])&&(be=(_e<3?ce(be):_e>3?ce(z,ae,be):ce(z,ae))||be);return _e>3&&be&&Object.defineProperty(z,ae,be),be},b=function(I,z){return function(ae,ee){z(ae,ee,I)}};function k(I){return I.command!==void 0}class S{constructor(z){this.id=S._idPool++,this._debugName=z}}S._idPool=0,S.CommandPalette=new S("CommandPalette"),S.EditorContext=new S("EditorContext"),S.SimpleEditorContext=new S("SimpleEditorContext"),S.EditorContextCopy=new S("EditorContextCopy"),S.EditorContextPeek=new S("EditorContextPeek"),S.MenubarEditMenu=new S("MenubarEditMenu"),S.MenubarCopy=new S("MenubarCopy"),S.MenubarGoMenu=new S("MenubarGoMenu"),S.MenubarSelectionMenu=new S("MenubarSelectionMenu"),S.InlineCompletionsActions=new S("InlineCompletionsActions");const C=(0,u.yh)("menuService"),H=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Be.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:I=>I===S.CommandPalette}}addCommand(I){return this.addCommands(ye.$.single(I))}addCommands(I){for(const z of I)this._commands.set(z.id,z);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,te.OF)(()=>{let z=!1;for(const ae of I)z=this._commands.delete(ae.id)||z;z&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(I){return this._commands.get(I)}getCommands(){const I=new Map;return this._commands.forEach((z,ae)=>I.set(ae,z)),I}appendMenuItem(I,z){return this.appendMenuItems(ye.$.single({id:I,item:z}))}appendMenuItems(I){const z=new Set,ae=new _.S;for(const{id:ee,item:_e}of I){let be=this._menuItems.get(ee);be||(be=new _.S,this._menuItems.set(ee,be)),ae.push(be.push(_e)),z.add(ee)}return this._onDidChangeMenu.fire(z),(0,te.OF)(()=>{if(ae.size>0){for(let ee of ae)ee();this._onDidChangeMenu.fire(z),ae.clear()}})}getMenuItems(I){let z;return this._menuItems.has(I)?z=[...this._menuItems.get(I)]:z=[],I===S.CommandPalette&&this._appendImplicitItems(z),z}_appendImplicitItems(I){const z=new Set;for(const ae of I)k(ae)&&(z.add(ae.command.id),ae.alt&&z.add(ae.alt.id));this._commands.forEach((ae,ee)=>{z.has(ee)||I.push({command:ae})})}};class V extends F.wY{constructor(z,ae,ee,_e){super(`submenuitem.${z.submenu.id}`,typeof z.title=="string"?z.title:z.title.value,[],"submenu"),this.item=z,this._menuService=ae,this._contextKeyService=ee,this._options=_e}get actions(){const z=[],ae=this._menuService.createMenu(this.item.submenu,this._contextKeyService),ee=ae.getActions(this._options);ae.dispose();for(const[,_e]of ee)_e.length>0&&(z.push(..._e),z.push(new F.Z0));return z.length&&z.pop(),z}}let M=class xu{constructor(z,ae,ee,_e,be){var ce,ve;if(this._commandService=be,this.id=z.id,this.label=ee!=null&&ee.renderShortTitle&&z.shortTitle?typeof z.shortTitle=="string"?z.shortTitle:z.shortTitle.value:typeof z.title=="string"?z.title:z.title.value,this.tooltip=(ve=typeof z.tooltip=="string"?z.tooltip:(ce=z.tooltip)===null||ce===void 0?void 0:ce.value)!==null&&ve!==void 0?ve:"",this.enabled=!z.precondition||_e.contextMatchesRules(z.precondition),this.checked=void 0,z.toggled){const Ie=z.toggled.condition?z.toggled:{condition:z.toggled};this.checked=_e.contextMatchesRules(Ie.condition),this.checked&&Ie.tooltip&&(this.tooltip=typeof Ie.tooltip=="string"?Ie.tooltip:Ie.tooltip.value),Ie.title&&(this.label=typeof Ie.title=="string"?Ie.title:Ie.title.value)}this.item=z,this.alt=ae?new xu(ae,void 0,ee,_e,be):void 0,this._options=ee,Q.kS.isThemeIcon(z.icon)&&(this.class=Te.dT.asClassName(z.icon))}dispose(){}run(...z){var ae,ee;let _e=[];return!((ae=this._options)===null||ae===void 0)&&ae.arg&&(_e=[..._e,this._options.arg]),!((ee=this._options)===null||ee===void 0)&&ee.shouldForwardArgs&&(_e=[..._e,...z]),this._commandService.executeCommand(this.id,..._e)}};M=B([b(3,pe.i6),b(4,De.H)],M)},35884:function(Kt,it,X){"use strict";X.d(it,{H:function(){return De},P:function(){return pe}});var F=X(4348),Te=X(88226),Be=X(69323),ye=X(34502),te=X(72999),_=X(16925);const De=(0,_.yh)("commandService"),pe=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new F.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(u,Q){if(!u)throw new Error("invalid command");if(typeof u=="string"){if(!Q)throw new Error("invalid command");return this.registerCommand({id:u,handler:Q})}if(u.description){const C=[];for(let V of u.description.args)C.push(V.constraint);const H=u.handler;u.handler=function(V,...M){return(0,te.D8)(M,C),H(V,...M)}}const{id:B}=u;let b=this._commands.get(B);b||(b=new ye.S,this._commands.set(B,b));let k=b.unshift(u),S=(0,Be.OF)(()=>{k();const C=this._commands.get(B);C!=null&&C.isEmpty()&&this._commands.delete(B)});return this._onDidRegisterCommand.fire(B),S}registerCommandAlias(u,Q){return pe.registerCommand(u,(B,...b)=>B.get(De).executeCommand(Q,...b))}getCommand(u){const Q=this._commands.get(u);if(!(!Q||Q.isEmpty()))return Te.$.first(Q)}getCommands(){const u=new Map;for(const Q of this._commands.keys()){const B=this.getCommand(Q);B&&u.set(Q,B)}return u}};pe.registerCommand("noop",()=>{})},90689:function(Kt,it,X){"use strict";X.d(it,{Ao:function(){return De},Eq:function(){return Y},Fb:function(){return pe},K8:function(){return J},i6:function(){return We},uy:function(){return Ae}});var F=X(23345),Te=X(82983),Be=X(16925);let ye=F.WE||"";const te=new Map;te.set("false",!1),te.set("true",!0),te.set("isMac",F.dz),te.set("isLinux",F.IJ),te.set("isWindows",F.ED),te.set("isWeb",F.$L),te.set("isMacNative",F.dz&&!F.$L),te.set("isEdge",ye.indexOf("Edg/")>=0),te.set("isFirefox",ye.indexOf("Firefox")>=0),te.set("isChrome",ye.indexOf("Chrome")>=0),te.set("isSafari",ye.indexOf("Safari")>=0);const _=Object.prototype.hasOwnProperty;class De{static has(w){return b.create(w)}static equals(w,E){return k.create(w,E)}static regex(w,E){return _e.create(w,E)}static not(w){return V.create(w)}static and(...w){return ve.create(w,null)}static or(...w){return Ie.create(w,null,!0)}static deserialize(w,E=!1){if(w)return this._deserializeOrExpression(w,E)}static _deserializeOrExpression(w,E){let K=w.split("||");return Ie.create(K.map(de=>this._deserializeAndExpression(de,E)),null,!0)}static _deserializeAndExpression(w,E){let K=w.split("&&");return ve.create(K.map(de=>this._deserializeOne(de,E)),null)}static _deserializeOne(w,E){if(w=w.trim(),w.indexOf("!=")>=0){let K=w.split("!=");return H.create(K[0].trim(),this._deserializeValue(K[1],E))}if(w.indexOf("==")>=0){let K=w.split("==");return k.create(K[0].trim(),this._deserializeValue(K[1],E))}if(w.indexOf("=~")>=0){let K=w.split("=~");return _e.create(K[0].trim(),this._deserializeRegexValue(K[1],E))}if(w.indexOf(" in ")>=0){let K=w.split(" in ");return S.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(w)){const K=w.split(">=");return z.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(w)){const K=w.split(">");return I.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(w)){const K=w.split("<=");return ee.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(w)){const K=w.split("<");return ae.create(K[0].trim(),K[1].trim())}return/^\!\s*/.test(w)?V.create(w.substr(1).trim()):b.create(w)}static _deserializeValue(w,E){if(w=w.trim(),w==="true")return!0;if(w==="false")return!1;let K=/^'([^']*)'$/.exec(w);return K?K[1].trim():w}static _deserializeRegexValue(w,E){if((0,Te.m5)(w)){if(E)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let K=w.indexOf("/"),de=w.lastIndexOf("/");if(K===de||K<0){if(E)throw new Error(`bad regexp-value '${w}', missing /-enclosure`);return console.warn(`bad regexp-value '${w}', missing /-enclosure`),null}let Ue=w.slice(K+1,de),Ye=w[de+1]==="i"?"i":"";try{return new RegExp(Ue,Ye)}catch(ct){if(E)throw new Error(`bad regexp-value '${w}', parse error: ${ct}`);return console.warn(`bad regexp-value '${w}', parse error: ${ct}`),null}}}function pe(Z,w){const E=Z?Z.substituteConstants():void 0,K=w?w.substituteConstants():void 0;return!E&&!K?!0:!E||!K?!1:E.equals(K)}function u(Z,w){return Z.cmp(w)}class Q{constructor(){this.type=0}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!1}serialize(){return"false"}keys(){return[]}negate(){return B.INSTANCE}}Q.INSTANCE=new Q;class B{constructor(){this.type=1}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!0}serialize(){return"true"}keys(){return[]}negate(){return Q.INSTANCE}}B.INSTANCE=new B;class b{constructor(w,E){this.key=w,this.negated=E,this.type=2}static create(w,E=null){const K=te.get(w);return typeof K=="boolean"?K?B.INSTANCE:Q.INSTANCE:new b(w,E)}cmp(w){return w.type!==this.type?this.type-w.type:P(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=te.get(this.key);return typeof w=="boolean"?w?B.INSTANCE:Q.INSTANCE:this}evaluate(w){return!!w.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=V.create(this.key,this)),this.negated}}class k{constructor(w,E,K){this.key=w,this.value=E,this.negated=K,this.type=4}static create(w,E,K=null){if(typeof E=="boolean")return E?b.create(w,K):V.create(w,K);const de=te.get(w);return typeof de=="boolean"?E===(de?"true":"false")?B.INSTANCE:Q.INSTANCE:new k(w,E,K)}cmp(w){return w.type!==this.type?this.type-w.type:j(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=te.get(this.key);if(typeof w=="boolean"){const E=w?"true":"false";return this.value===E?B.INSTANCE:Q.INSTANCE}return this}evaluate(w){return w.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 S{constructor(w,E){this.key=w,this.valueKey=E,this.type=10,this.negated=null}static create(w,E){return new S(w,E)}cmp(w){return w.type!==this.type?this.type-w.type:j(this.key,this.valueKey,w.key,w.valueKey)}equals(w){return w.type===this.type?this.key===w.key&&this.valueKey===w.valueKey:!1}substituteConstants(){return this}evaluate(w){const E=w.getValue(this.valueKey),K=w.getValue(this.key);return Array.isArray(E)?E.indexOf(K)>=0:typeof K=="string"&&typeof E=="object"&&E!==null?_.call(E,K):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=C.create(this)),this.negated}}class C{constructor(w){this._actual=w,this.type=11}static create(w){return new C(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class H{constructor(w,E,K){this.key=w,this.value=E,this.negated=K,this.type=5}static create(w,E,K=null){if(typeof E=="boolean")return E?V.create(w,K):b.create(w,K);const de=te.get(w);return typeof de=="boolean"?E===(de?"true":"false")?Q.INSTANCE:B.INSTANCE:new H(w,E,K)}cmp(w){return w.type!==this.type?this.type-w.type:j(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=te.get(this.key);if(typeof w=="boolean"){const E=w?"true":"false";return this.value===E?Q.INSTANCE:B.INSTANCE}return this}evaluate(w){return w.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this.key,this.value,this)),this.negated}}class V{constructor(w,E){this.key=w,this.negated=E,this.type=3}static create(w,E=null){const K=te.get(w);return typeof K=="boolean"?K?Q.INSTANCE:B.INSTANCE:new V(w,E)}cmp(w){return w.type!==this.type?this.type-w.type:P(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=te.get(this.key);return typeof w=="boolean"?w?Q.INSTANCE:B.INSTANCE:this}evaluate(w){return!w.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this)),this.negated}}function M(Z,w){if(typeof Z=="string"){const E=parseFloat(Z);isNaN(E)||(Z=E)}return typeof Z=="string"||typeof Z=="number"?w(Z):Q.INSTANCE}class I{constructor(w,E,K){this.key=w,this.value=E,this.negated=K,this.type=12}static create(w,E,K=null){return M(E,de=>new I(w,de,K))}cmp(w){return w.type!==this.type?this.type-w.type:j(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ee.create(this.key,this.value,this)),this.negated}}class z{constructor(w,E,K){this.key=w,this.value=E,this.negated=K,this.type=13}static create(w,E,K=null){return M(E,de=>new z(w,de,K))}cmp(w){return w.type!==this.type?this.type-w.type:j(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ae.create(this.key,this.value,this)),this.negated}}class ae{constructor(w,E,K){this.key=w,this.value=E,this.negated=K,this.type=14}static create(w,E,K=null){return M(E,de=>new ae(w,de,K))}cmp(w){return w.type!==this.type?this.type-w.type:j(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=z.create(this.key,this.value,this)),this.negated}}class ee{constructor(w,E,K){this.key=w,this.value=E,this.negated=K,this.type=15}static create(w,E,K=null){return M(E,de=>new ee(w,de,K))}cmp(w){return w.type!==this.type?this.type-w.type:j(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=I.create(this.key,this.value,this)),this.negated}}class _e{constructor(w,E){this.key=w,this.regexp=E,this.type=7,this.negated=null}static create(w,E){return new _e(w,E)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.key<w.key)return-1;if(this.key>w.key)return 1;const E=this.regexp?this.regexp.source:"",K=w.regexp?w.regexp.source:"";return E<K?-1:E>K?1:0}equals(w){if(w.type===this.type){const E=this.regexp?this.regexp.source:"",K=w.regexp?w.regexp.source:"";return this.key===w.key&&E===K}return!1}substituteConstants(){return this}evaluate(w){let E=w.getValue(this.key);return this.regexp?this.regexp.test(E):!1}serialize(){const w=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${w}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=be.create(this)),this.negated}}class be{constructor(w){this._actual=w,this.type=8}static create(w){return new be(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ce(Z){let w=null;for(let E=0,K=Z.length;E<K;E++){const de=Z[E].substituteConstants();if(Z[E]!==de&&w===null){w=[];for(let Ue=0;Ue<E;Ue++)w[Ue]=Z[Ue]}w!==null&&(w[E]=de)}return w===null?Z:w}class ve{constructor(w,E){this.expr=w,this.negated=E,this.type=6}static create(w,E){return ve._normalizeArr(w,E)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let E=0,K=this.expr.length;E<K;E++){const de=u(this.expr[E],w.expr[E]);if(de!==0)return de}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let E=0,K=this.expr.length;E<K;E++)if(!this.expr[E].equals(w.expr[E]))return!1;return!0}return!1}substituteConstants(){const w=ce(this.expr);return w===this.expr?this:ve.create(w,this.negated)}evaluate(w){for(let E=0,K=this.expr.length;E<K;E++)if(!this.expr[E].evaluate(w))return!1;return!0}static _normalizeArr(w,E){const K=[];let de=!1;for(const Ue of w)if(Ue){if(Ue.type===1){de=!0;continue}if(Ue.type===0)return Q.INSTANCE;if(Ue.type===6){K.push(...Ue.expr);continue}K.push(Ue)}if(K.length===0&&de)return B.INSTANCE;if(K.length!==0){if(K.length===1)return K[0];K.sort(u);for(let Ue=1;Ue<K.length;Ue++)K[Ue-1].equals(K[Ue])&&(K.splice(Ue,1),Ue--);if(K.length===1)return K[0];for(;K.length>1;){const Ue=K[K.length-1];if(Ue.type!==9)break;K.pop();const Ye=K.pop(),ct=K.length===0,at=Ie.create(Ue.expr.map(Dt=>ve.create([Dt,Ye],null)),null,ct);at&&(K.push(at),K.sort(u))}return K.length===1?K[0]:new ve(K,E)}}serialize(){return this.expr.map(w=>w.serialize()).join(" && ")}keys(){const w=[];for(let E of this.expr)w.push(...E.keys());return w}negate(){if(!this.negated){const w=[];for(let E of this.expr)w.push(E.negate());this.negated=Ie.create(w,this,!0)}return this.negated}}class Ie{constructor(w,E){this.expr=w,this.negated=E,this.type=9}static create(w,E,K){return Ie._normalizeArr(w,E,K)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let E=0,K=this.expr.length;E<K;E++){const de=u(this.expr[E],w.expr[E]);if(de!==0)return de}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let E=0,K=this.expr.length;E<K;E++)if(!this.expr[E].equals(w.expr[E]))return!1;return!0}return!1}substituteConstants(){const w=ce(this.expr);return w===this.expr?this:Ie.create(w,this.negated,!1)}evaluate(w){for(let E=0,K=this.expr.length;E<K;E++)if(this.expr[E].evaluate(w))return!0;return!1}static _normalizeArr(w,E,K){let de=[],Ue=!1;if(w){for(let Ye=0,ct=w.length;Ye<ct;Ye++){const at=w[Ye];if(at){if(at.type===0){Ue=!0;continue}if(at.type===1)return B.INSTANCE;if(at.type===9){de=de.concat(at.expr);continue}de.push(at)}}if(de.length===0&&Ue)return Q.INSTANCE;de.sort(u)}if(de.length!==0){if(de.length===1)return de[0];for(let Ye=1;Ye<de.length;Ye++)de[Ye-1].equals(de[Ye])&&(de.splice(Ye,1),Ye--);if(de.length===1)return de[0];if(K){for(let Ye=0;Ye<de.length;Ye++)for(let ct=Ye+1;ct<de.length;ct++)J(de[Ye],de[ct])&&(de.splice(ct,1),ct--);if(de.length===1)return de[0]}return new Ie(de,E)}}serialize(){return this.expr.map(w=>w.serialize()).join(" || ")}keys(){const w=[];for(let E of this.expr)w.push(...E.keys());return w}negate(){if(!this.negated){let w=[];for(let E of this.expr)w.push(E.negate());for(;w.length>1;){const E=w.shift(),K=w.shift(),de=[];for(const Ye of se(E))for(const ct of se(K))de.push(ve.create([Ye,ct],null));const Ue=w.length===0;w.unshift(Ie.create(de,null,Ue))}this.negated=w[0]}return this.negated}}class Ae extends b{constructor(w,E,K){super(w,null),this._defaultValue=E,typeof K=="object"?Ae._info.push(Object.assign(Object.assign({},K),{key:w})):K!==!0&&Ae._info.push({key:w,description:K,type:E!=null?typeof E:void 0})}static all(){return Ae._info.values()}bindTo(w){return w.createKey(this.key,this._defaultValue)}getValue(w){return w.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(w){return k.create(this.key,w)}}Ae._info=[];const We=(0,Be.yh)("contextKeyService"),Y="setContext";function P(Z,w){return Z<w?-1:Z>w?1:0}function j(Z,w,E,K){return Z<E?-1:Z>E?1:w<K?-1:w>K?1:0}function J(Z,w){if(w.type===6&&Z.type!==9&&Z.type!==6){for(const de of w.expr)if(Z.equals(de))return!0}const E=Z.negate(),K=se(E).concat(se(w));K.sort(u);for(let de=0;de<K.length;de++){const Ye=K[de].negate();for(let ct=de+1;ct<K.length;ct++){const at=K[ct];if(Ye.equals(at))return!0}}return!1}function se(Z){return Z.type===9?Z.expr:[Z]}},16925:function(Kt,it,X){"use strict";X.d(it,{I8:function(){return F},TG:function(){return Te},jt:function(){return te},yh:function(){return ye}});var F;(function(_){_.serviceIds=new Map,_.DI_TARGET="$di$target",_.DI_DEPENDENCIES="$di$dependencies";function De(pe){return pe[_.DI_DEPENDENCIES]||[]}_.getServiceDependencies=De})(F||(F={}));const Te=ye("instantiationService");function Be(_,De,pe,u){De[F.DI_TARGET]===De?De[F.DI_DEPENDENCIES].push({id:_,index:pe,optional:u}):(De[F.DI_DEPENDENCIES]=[{id:_,index:pe,optional:u}],De[F.DI_TARGET]=De)}function ye(_){if(F.serviceIds.has(_))return F.serviceIds.get(_);const De=function(pe,u,Q){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Be(De,pe,Q,!1)};return De.toString=()=>_,F.serviceIds.set(_,De),De}function te(_){return function(De,pe,u){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Be(_,De,u,!0)}}},44650:function(Kt,it,X){"use strict";X.d(it,{B:function(){return ye}});var F=X(76068),Te=X(72999);class Be{constructor(){this.data=new Map}add(_,De){F.ok(Te.HD(_)),F.ok(Te.Kn(De)),F.ok(!this.data.has(_),"There is already an extension with this id"),this.data.set(_,De)}as(_){return this.data.get(_)||null}}const ye=new Be},66213:function(Kt,it,X){"use strict";X.d(it,{e:function(){return F}});var F;(function(Te){Te.DARK="dark",Te.LIGHT="light",Te.HIGH_CONTRAST="hc"})(F||(F={}))},49055:function(Kt,it,X){"use strict";X.d(it,{EN:function(){return u},IP:function(){return b},Ic:function(){return C},XE:function(){return De},bB:function(){return H},kS:function(){return Q},m6:function(){return B}});var F=X(52615),Te=X(4348),Be=X(69323),ye=X(16925),te=X(44650),_=X(66213);const De=(0,ye.yh)("themeService");var pe;(function(V){function M(I){return I&&typeof I=="object"&&typeof I.id=="string"}V.isThemeColor=M})(pe||(pe={}));function u(V){return{id:V}}var Q;(function(V){function M(be){return be&&typeof be=="object"&&typeof be.id=="string"&&(typeof be.color=="undefined"||pe.isThemeColor(be.color))}V.isThemeIcon=M;const I=new RegExp(`^\\$\\((${F.dT.iconNameExpression}(?:${F.dT.iconModifierExpression})?)\\)$`);function z(be){const ce=I.exec(be);if(!ce)return;let[,ve]=ce;return{id:ve}}V.fromString=z;function ae(be,ce){let ve=be.id;const Ie=ve.lastIndexOf("~");return Ie!==-1&&(ve=ve.substring(0,Ie)),ce&&(ve=`${ve}~${ce}`),{id:ve}}V.modify=ae;function ee(be,ce){var ve,Ie;return be.id===ce.id&&((ve=be.color)===null||ve===void 0?void 0:ve.id)===((Ie=ce.color)===null||Ie===void 0?void 0:Ie.id)}V.isEqual=ee;function _e(be,ce){return{id:be.id,color:ce?u(ce):void 0}}V.asThemeIcon=_e,V.asClassNameArray=F.dT.asClassNameArray,V.asClassName=F.dT.asClassName,V.asCSSSelector=F.dT.asCSSSelector})(Q||(Q={}));function B(V){switch(V){case _.e.DARK:return"vs-dark";case _.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const b={ThemingContribution:"base.contributions.theming"};class k{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Te.Q5}onColorThemeChange(M){return this.themingParticipants.push(M),this.onThemingParticipantAddedEmitter.fire(M),(0,Be.OF)(()=>{const I=this.themingParticipants.indexOf(M);this.themingParticipants.splice(I,1)})}getThemingParticipants(){return this.themingParticipants}}let S=new k;te.B.add(b.ThemingContribution,S);function C(V){return S.onColorThemeChange(V)}class H extends Be.JT{constructor(M){super(),this.themeService=M,this.theme=M.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(I=>this.onThemeChange(I)))}onThemeChange(M){this.theme=M,this.updateStyles()}updateStyles(){}}},29301:function(Kt,it,X){"use strict";X.d(it,{Z:function(){return Y}});var F=X(60499),Te=X(59301),Be=X(11592),ye=X(48736),te=X(85899),_=X(43749),De=X(76846),pe=X(8654),u=Te.createContext(null);function Q(P){var j=P.children,J=P.onBatchResize,se=Te.useRef(0),Z=Te.useRef([]),w=Te.useContext(u),E=Te.useCallback(function(K,de,Ue){se.current+=1;var Ye=se.current;Z.current.push({size:K,element:de,data:Ue}),Promise.resolve().then(function(){Ye===se.current&&(J==null||J(Z.current),Z.current=[])}),w==null||w(K,de,Ue)},[J,w]);return Te.createElement(u.Provider,{value:E},j)}var B=X(76374),b=new Map;function k(P){P.forEach(function(j){var J,se=j.target;(J=b.get(se))===null||J===void 0||J.forEach(function(Z){return Z(se)})})}var S=new B.Z(k),C=null,H=null;function V(P,j){b.has(P)||(b.set(P,new Set),S.observe(P)),b.get(P).add(j)}function M(P,j){b.has(P)&&(b.get(P).delete(j),b.get(P).size||(S.unobserve(P),b.delete(P)))}var I=X(38705),z=X(17212),ae=X(39153),ee=X(55401),_e=function(P){(0,ae.Z)(J,P);var j=(0,ee.Z)(J);function J(){return(0,I.Z)(this,J),j.apply(this,arguments)}return(0,z.Z)(J,[{key:"render",value:function(){return this.props.children}}]),J}(Te.Component);function be(P,j){var J=P.children,se=P.disabled,Z=Te.useRef(null),w=Te.useRef(null),E=Te.useContext(u),K=typeof J=="function",de=K?J(Z):J,Ue=Te.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ye=!K&&Te.isValidElement(de)&&(0,pe.Yr)(de),ct=Ye?(0,pe.C4)(de):null,at=(0,pe.x1)(ct,Z),Dt=function(){var nt;return(0,De.ZP)(Z.current)||(Z.current&&(0,_.Z)(Z.current)==="object"?(0,De.ZP)((nt=Z.current)===null||nt===void 0?void 0:nt.nativeElement):null)||(0,De.ZP)(w.current)};Te.useImperativeHandle(j,function(){return Dt()});var bt=Te.useRef(P);bt.current=P;var ot=Te.useCallback(function(Qt){var nt=bt.current,kt=nt.onResize,et=nt.data,Nt=Qt.getBoundingClientRect(),Pe=Nt.width,$e=Nt.height,Ee=Qt.offsetWidth,Ve=Qt.offsetHeight,Je=Math.floor(Pe),lt=Math.floor($e);if(Ue.current.width!==Je||Ue.current.height!==lt||Ue.current.offsetWidth!==Ee||Ue.current.offsetHeight!==Ve){var re={width:Je,height:lt,offsetWidth:Ee,offsetHeight:Ve};Ue.current=re;var Se=Ee===Math.round(Pe)?Pe:Ee,je=Ve===Math.round($e)?$e:Ve,Ge=(0,te.Z)((0,te.Z)({},re),{},{offsetWidth:Se,offsetHeight:je});E==null||E(Ge,Qt,et),kt&&Promise.resolve().then(function(){kt(Ge,Qt)})}},[]);return Te.useEffect(function(){var Qt=Dt();return Qt&&!se&&V(Qt,ot),function(){return M(Qt,ot)}},[Z.current,se]),Te.createElement(_e,{ref:w},Ye?Te.cloneElement(de,{ref:at}):de)}var ce=Te.forwardRef(be),ve=ce,Ie="rc-observer-key";function Ae(P,j){var J=P.children,se=typeof J=="function"?[J]:(0,Be.Z)(J);return se.map(function(Z,w){var E=(Z==null?void 0:Z.key)||"".concat(Ie,"-").concat(w);return Te.createElement(ve,(0,F.Z)({},P,{key:E,ref:w===0?j:void 0}),Z)})}var We=Te.forwardRef(Ae);We.Collection=Q;var Y=We},29125:function(Kt,it,X){"use strict";X.d(it,{G:function(){return ye},Z:function(){return M}});var F=X(92310),Te=X.n(F),Be=X(59301);function ye(I){var z=I.children,ae=I.prefixCls,ee=I.id,_e=I.overlayInnerStyle,be=I.bodyClassName,ce=I.className,ve=I.style;return Be.createElement("div",{className:Te()("".concat(ae,"-content"),ce),style:ve},Be.createElement("div",{className:Te()("".concat(ae,"-inner"),be),id:ee,role:"tooltip",style:_e},typeof z=="function"?z():z))}var te=X(60499),_=X(85899),De=X(42244),pe=X(68196),u={shiftX:64,adjustY:1},Q={adjustX:1,shiftY:!0},B=[0,0],b={left:{points:["cr","cl"],overflow:Q,offset:[-4,0],targetOffset:B},right:{points:["cl","cr"],overflow:Q,offset:[4,0],targetOffset:B},top:{points:["bc","tc"],overflow:u,offset:[0,-4],targetOffset:B},bottom:{points:["tc","bc"],overflow:u,offset:[0,4],targetOffset:B},topLeft:{points:["bl","tl"],overflow:u,offset:[0,-4],targetOffset:B},leftTop:{points:["tr","tl"],overflow:Q,offset:[-4,0],targetOffset:B},topRight:{points:["br","tr"],overflow:u,offset:[0,-4],targetOffset:B},rightTop:{points:["tl","tr"],overflow:Q,offset:[4,0],targetOffset:B},bottomRight:{points:["tr","br"],overflow:u,offset:[0,4],targetOffset:B},rightBottom:{points:["bl","br"],overflow:Q,offset:[4,0],targetOffset:B},bottomLeft:{points:["tl","bl"],overflow:u,offset:[0,4],targetOffset:B},leftBottom:{points:["br","bl"],overflow:Q,offset:[-4,0],targetOffset:B}},k=null,S=X(80402),C=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],H=function(z,ae){var ee=z.overlayClassName,_e=z.trigger,be=_e===void 0?["hover"]:_e,ce=z.mouseEnterDelay,ve=ce===void 0?0:ce,Ie=z.mouseLeaveDelay,Ae=Ie===void 0?.1:Ie,We=z.overlayStyle,Y=z.prefixCls,P=Y===void 0?"rc-tooltip":Y,j=z.children,J=z.onVisibleChange,se=z.afterVisibleChange,Z=z.transitionName,w=z.animation,E=z.motion,K=z.placement,de=K===void 0?"right":K,Ue=z.align,Ye=Ue===void 0?{}:Ue,ct=z.destroyTooltipOnHide,at=ct===void 0?!1:ct,Dt=z.defaultVisible,bt=z.getTooltipContainer,ot=z.overlayInnerStyle,Qt=z.arrowContent,nt=z.overlay,kt=z.id,et=z.showArrow,Nt=et===void 0?!0:et,Pe=z.classNames,$e=z.styles,Ee=(0,De.Z)(z,C),Ve=(0,S.Z)(kt),Je=(0,Be.useRef)(null);(0,Be.useImperativeHandle)(ae,function(){return Je.current});var lt=(0,_.Z)({},Ee);"visible"in z&&(lt.popupVisible=z.visible);var re=function(){return Be.createElement(ye,{key:"content",prefixCls:P,id:Ve,bodyClassName:Pe==null?void 0:Pe.body,overlayInnerStyle:(0,_.Z)((0,_.Z)({},ot),$e==null?void 0:$e.body)},nt)},Se=function(){var Ge=Be.Children.only(j),Ze=(Ge==null?void 0:Ge.props)||{},mt=(0,_.Z)((0,_.Z)({},Ze),{},{"aria-describedby":nt?Ve:null});return Be.cloneElement(j,mt)};return Be.createElement(pe.Z,(0,te.Z)({popupClassName:Te()(ee,Pe==null?void 0:Pe.root),prefixCls:P,popup:re,action:be,builtinPlacements:b,popupPlacement:de,ref:Je,popupAlign:Ye,getPopupContainer:bt,onPopupVisibleChange:J,afterPopupVisibleChange:se,popupTransitionName:Z,popupAnimation:w,popupMotion:E,defaultPopupVisible:Dt,autoDestroy:at,mouseLeaveDelay:Ae,popupStyle:(0,_.Z)((0,_.Z)({},We),$e==null?void 0:$e.root),mouseEnterDelay:ve,arrow:Nt},lt),Se())},V=(0,Be.forwardRef)(H),M=V},49658:function(Kt,it){"use strict";it.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var X=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(X)||/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(X==null?void 0:X.substr(0,4))}},83145:function(Kt,it,X){"use strict";Object.defineProperty(it,"__esModule",{value:!0}),it.CopyToClipboard=void 0;var F=Be(X(59301)),Te=Be(X(25769));function Be(I){return I&&I.__esModule?I:{default:I}}function ye(I){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ye=function(ae){return typeof ae}:ye=function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},ye(I)}function te(I,z){var ae=Object.keys(I);if(Object.getOwnPropertySymbols){var ee=Object.getOwnPropertySymbols(I);z&&(ee=ee.filter(function(_e){return Object.getOwnPropertyDescriptor(I,_e).enumerable})),ae.push.apply(ae,ee)}return ae}function _(I){for(var z=1;z<arguments.length;z++){var ae=arguments[z]!=null?arguments[z]:{};z%2?te(ae,!0).forEach(function(ee){V(I,ee,ae[ee])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(ae)):te(ae).forEach(function(ee){Object.defineProperty(I,ee,Object.getOwnPropertyDescriptor(ae,ee))})}return I}function De(I,z){if(I==null)return{};var ae=pe(I,z),ee,_e;if(Object.getOwnPropertySymbols){var be=Object.getOwnPropertySymbols(I);for(_e=0;_e<be.length;_e++)ee=be[_e],!(z.indexOf(ee)>=0)&&Object.prototype.propertyIsEnumerable.call(I,ee)&&(ae[ee]=I[ee])}return ae}function pe(I,z){if(I==null)return{};var ae={},ee=Object.keys(I),_e,be;for(be=0;be<ee.length;be++)_e=ee[be],!(z.indexOf(_e)>=0)&&(ae[_e]=I[_e]);return ae}function u(I,z){if(!(I instanceof z))throw new TypeError("Cannot call a class as a function")}function Q(I,z){for(var ae=0;ae<z.length;ae++){var ee=z[ae];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(I,ee.key,ee)}}function B(I,z,ae){return z&&Q(I.prototype,z),ae&&Q(I,ae),I}function b(I,z){return z&&(ye(z)==="object"||typeof z=="function")?z:S(I)}function k(I){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(ae){return ae.__proto__||Object.getPrototypeOf(ae)},k(I)}function S(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function C(I,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(z&&z.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),z&&H(I,z)}function H(I,z){return H=Object.setPrototypeOf||function(ee,_e){return ee.__proto__=_e,ee},H(I,z)}function V(I,z,ae){return z in I?Object.defineProperty(I,z,{value:ae,enumerable:!0,configurable:!0,writable:!0}):I[z]=ae,I}var M=function(I){C(z,I);function z(){var ae,ee;u(this,z);for(var _e=arguments.length,be=new Array(_e),ce=0;ce<_e;ce++)be[ce]=arguments[ce];return ee=b(this,(ae=k(z)).call.apply(ae,[this].concat(be))),V(S(ee),"onClick",function(ve){var Ie=ee.props,Ae=Ie.text,We=Ie.onCopy,Y=Ie.children,P=Ie.options,j=F.default.Children.only(Y),J=(0,Te.default)(Ae,P);We&&We(Ae,J),j&&j.props&&typeof j.props.onClick=="function"&&j.props.onClick(ve)}),ee}return B(z,[{key:"render",value:function(){var ee=this.props,_e=ee.text,be=ee.onCopy,ce=ee.options,ve=ee.children,Ie=De(ee,["text","onCopy","options","children"]),Ae=F.default.Children.only(ve);return F.default.cloneElement(Ae,_({},Ie,{onClick:this.onClick}))}}]),z}(F.default.PureComponent);it.CopyToClipboard=M,V(M,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Kt,it,X){"use strict";var F=X(83145),Te=F.CopyToClipboard;Te.CopyToClipboard=Te,Kt.exports=Te},76374:function(Kt,it,X){"use strict";var F=function(){if(typeof Map!="undefined")return Map;function Y(P,j){var J=-1;return P.some(function(se,Z){return se[0]===j?(J=Z,!0):!1}),J}return function(){function P(){this.__entries__=[]}return Object.defineProperty(P.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),P.prototype.get=function(j){var J=Y(this.__entries__,j),se=this.__entries__[J];return se&&se[1]},P.prototype.set=function(j,J){var se=Y(this.__entries__,j);~se?this.__entries__[se][1]=J:this.__entries__.push([j,J])},P.prototype.delete=function(j){var J=this.__entries__,se=Y(J,j);~se&&J.splice(se,1)},P.prototype.has=function(j){return!!~Y(this.__entries__,j)},P.prototype.clear=function(){this.__entries__.splice(0)},P.prototype.forEach=function(j,J){J===void 0&&(J=null);for(var se=0,Z=this.__entries__;se<Z.length;se++){var w=Z[se];j.call(J,w[1],w[0])}},P}()}(),Te=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Be=function(){return typeof X.g!="undefined"&&X.g.Math===Math?X.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ye=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Be):function(Y){return setTimeout(function(){return Y(Date.now())},1e3/60)}}(),te=2;function _(Y,P){var j=!1,J=!1,se=0;function Z(){j&&(j=!1,Y()),J&&E()}function w(){ye(Z)}function E(){var K=Date.now();if(j){if(K-se<te)return;J=!0}else j=!0,J=!1,setTimeout(w,P);se=K}return E}var De=20,pe=["top","right","bottom","left","width","height","size","weight"],u=typeof MutationObserver!="undefined",Q=function(){function Y(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=_(this.refresh.bind(this),De)}return Y.prototype.addObserver=function(P){~this.observers_.indexOf(P)||this.observers_.push(P),this.connected_||this.connect_()},Y.prototype.removeObserver=function(P){var j=this.observers_,J=j.indexOf(P);~J&&j.splice(J,1),!j.length&&this.connected_&&this.disconnect_()},Y.prototype.refresh=function(){var P=this.updateObservers_();P&&this.refresh()},Y.prototype.updateObservers_=function(){var P=this.observers_.filter(function(j){return j.gatherActive(),j.hasActive()});return P.forEach(function(j){return j.broadcastActive()}),P.length>0},Y.prototype.connect_=function(){!Te||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(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)},Y.prototype.disconnect_=function(){!Te||!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)},Y.prototype.onTransitionEnd_=function(P){var j=P.propertyName,J=j===void 0?"":j,se=pe.some(function(Z){return!!~J.indexOf(Z)});se&&this.refresh()},Y.getInstance=function(){return this.instance_||(this.instance_=new Y),this.instance_},Y.instance_=null,Y}(),B=function(Y,P){for(var j=0,J=Object.keys(P);j<J.length;j++){var se=J[j];Object.defineProperty(Y,se,{value:P[se],enumerable:!1,writable:!1,configurable:!0})}return Y},b=function(Y){var P=Y&&Y.ownerDocument&&Y.ownerDocument.defaultView;return P||Be},k=_e(0,0,0,0);function S(Y){return parseFloat(Y)||0}function C(Y){for(var P=[],j=1;j<arguments.length;j++)P[j-1]=arguments[j];return P.reduce(function(J,se){var Z=Y["border-"+se+"-width"];return J+S(Z)},0)}function H(Y){for(var P=["top","right","bottom","left"],j={},J=0,se=P;J<se.length;J++){var Z=se[J],w=Y["padding-"+Z];j[Z]=S(w)}return j}function V(Y){var P=Y.getBBox();return _e(0,0,P.width,P.height)}function M(Y){var P=Y.clientWidth,j=Y.clientHeight;if(!P&&!j)return k;var J=b(Y).getComputedStyle(Y),se=H(J),Z=se.left+se.right,w=se.top+se.bottom,E=S(J.width),K=S(J.height);if(J.boxSizing==="border-box"&&(Math.round(E+Z)!==P&&(E-=C(J,"left","right")+Z),Math.round(K+w)!==j&&(K-=C(J,"top","bottom")+w)),!z(Y)){var de=Math.round(E+Z)-P,Ue=Math.round(K+w)-j;Math.abs(de)!==1&&(E-=de),Math.abs(Ue)!==1&&(K-=Ue)}return _e(se.left,se.top,E,K)}var I=function(){return typeof SVGGraphicsElement!="undefined"?function(Y){return Y instanceof b(Y).SVGGraphicsElement}:function(Y){return Y instanceof b(Y).SVGElement&&typeof Y.getBBox=="function"}}();function z(Y){return Y===b(Y).document.documentElement}function ae(Y){return Te?I(Y)?V(Y):M(Y):k}function ee(Y){var P=Y.x,j=Y.y,J=Y.width,se=Y.height,Z=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,w=Object.create(Z.prototype);return B(w,{x:P,y:j,width:J,height:se,top:j,right:P+J,bottom:se+j,left:P}),w}function _e(Y,P,j,J){return{x:Y,y:P,width:j,height:J}}var be=function(){function Y(P){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_e(0,0,0,0),this.target=P}return Y.prototype.isActive=function(){var P=ae(this.target);return this.contentRect_=P,P.width!==this.broadcastWidth||P.height!==this.broadcastHeight},Y.prototype.broadcastRect=function(){var P=this.contentRect_;return this.broadcastWidth=P.width,this.broadcastHeight=P.height,P},Y}(),ce=function(){function Y(P,j){var J=ee(j);B(this,{target:P,contentRect:J})}return Y}(),ve=function(){function Y(P,j,J){if(this.activeObservations_=[],this.observations_=new F,typeof P!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=P,this.controller_=j,this.callbackCtx_=J}return Y.prototype.observe=function(P){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(P instanceof b(P).Element))throw new TypeError('parameter 1 is not of type "Element".');var j=this.observations_;j.has(P)||(j.set(P,new be(P)),this.controller_.addObserver(this),this.controller_.refresh())}},Y.prototype.unobserve=function(P){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(P instanceof b(P).Element))throw new TypeError('parameter 1 is not of type "Element".');var j=this.observations_;j.has(P)&&(j.delete(P),j.size||this.controller_.removeObserver(this))}},Y.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Y.prototype.gatherActive=function(){var P=this;this.clearActive(),this.observations_.forEach(function(j){j.isActive()&&P.activeObservations_.push(j)})},Y.prototype.broadcastActive=function(){if(this.hasActive()){var P=this.callbackCtx_,j=this.activeObservations_.map(function(J){return new ce(J.target,J.broadcastRect())});this.callback_.call(P,j,P),this.clearActive()}},Y.prototype.clearActive=function(){this.activeObservations_.splice(0)},Y.prototype.hasActive=function(){return this.activeObservations_.length>0},Y}(),Ie=typeof WeakMap!="undefined"?new WeakMap:new F,Ae=function(){function Y(P){if(!(this instanceof Y))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var j=Q.getInstance(),J=new ve(P,j,this);Ie.set(this,J)}return Y}();["observe","unobserve","disconnect"].forEach(function(Y){Ae.prototype[Y]=function(){var P;return(P=Ie.get(this))[Y].apply(P,arguments)}});var We=function(){return typeof Be.ResizeObserver!="undefined"?Be.ResizeObserver:Ae}();it.Z=We},98040:function(Kt){Kt.exports=function(){var it=document.getSelection();if(!it.rangeCount)return function(){};for(var X=document.activeElement,F=[],Te=0;Te<it.rangeCount;Te++)F.push(it.getRangeAt(Te));switch(X.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":X.blur();break;default:X=null;break}return it.removeAllRanges(),function(){it.type==="Caret"&&it.removeAllRanges(),it.rangeCount||F.forEach(function(Be){it.addRange(Be)}),X&&X.focus()}}},4977:function(Kt){"use strict";Kt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},16471:function(Kt,it,X){"use strict";X.d(it,{ZP:function(){return ps}});const F=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Te=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=Be},Be=Number.MAX_SAFE_INTEGER||9007199254740991;let ye=function(a){return a.NETWORK_ERROR="networkError",a.MEDIA_ERROR="mediaError",a.KEY_SYSTEM_ERROR="keySystemError",a.MUX_ERROR="muxError",a.OTHER_ERROR="otherError",a}({}),te=function(a){return a.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",a.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",a.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_PARSING_ERROR="levelParsingError",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.FRAG_GAP="fragGap",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.ASSET_LIST_LOAD_ERROR="assetListLoadError",a.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",a.ASSET_LIST_PARSING_ERROR="assetListParsingError",a.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.ATTACH_MEDIA_ERROR="attachMediaError",a.UNKNOWN="unknown",a}({}),_=function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.MEDIA_ENDED="hlsMediaEnded",a.STALL_RESOLVED="hlsStallResolved",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFERED_TO_END="hlsBufferedToEnd",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",a.ASSET_LIST_LOADING="hlsAssetListLoading",a.ASSET_LIST_LOADED="hlsAssetListLoaded",a.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",a.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",a.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",a.INTERSTITIAL_STARTED="hlsInterstitialStarted",a.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",a.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",a.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",a.INTERSTITIAL_ENDED="hlsInterstitialEnded",a.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",a.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",a.EVENT_CUE_ENTER="hlsEventCueEnter",a}({});var De={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},pe={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class u{constructor(e,t=0,r=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class Q{constructor(e,t,r,n=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_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new u(e),this.fast_=new u(t),this.defaultTTFB_=n,this.ttfb_=new u(e)}update(e,t){const{slow_:r,fast_:n,ttfb_:i}=this;r.halfLife!==e&&(this.slow_=new u(e,r.getEstimate(),r.getTotalWeight())),n.halfLife!==t&&(this.fast_=new u(t,n.getEstimate(),n.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new u(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,n=e/1e3,i=r/n;this.fast_.sample(n,i),this.slow_.sample(n,i)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,Math.max(e,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 B(a,e,t){return(e=H(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function b(){return b=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},b.apply(null,arguments)}function k(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(a,n).enumerable})),t.push.apply(t,r)}return t}function S(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?k(Object(t),!0).forEach(function(r){B(a,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach(function(r){Object.defineProperty(a,r,Object.getOwnPropertyDescriptor(t,r))})}return a}function C(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var r=t.call(a,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function H(a){var e=C(a,"string");return typeof e=="symbol"?e:e+""}class V{constructor(e,t){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 r=`[${e}]:`;this.trace=M,this.debug=t.debug.bind(null,r),this.log=t.log.bind(null,r),this.warn=t.warn.bind(null,r),this.info=t.info.bind(null,r),this.error=t.error.bind(null,r)}}const M=function(){},I={trace:M,debug:M,log:M,warn:M,info:M,error:M};function z(){return b({},I)}function ae(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):M}function ee(a,e,t){return e[a]?e[a].bind(e):ae(a,t)}const _e=z();function be(a,e,t){const r=z();if(typeof console=="object"&&a===!0||typeof a=="object"){const n=["debug","log","info","warn","error"];n.forEach(i=>{r[i]=ee(i,a,t)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch(i){return z()}n.forEach(i=>{_e[i]=ee(i,a)})}else b(_e,r);return r}const ce=_e;function ve(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Ie(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function Ae(a,e){const t=Object.keys(a),r=Object.keys(e),n=t.length,i=r.length;return!n||!i||n===i&&!t.some(s=>r.indexOf(s)===-1)}function We(a,e=!1){if(typeof TextDecoder!="undefined"){const h=new TextDecoder("utf-8").decode(a);if(e){const p=h.indexOf("\0");return p!==-1?h.substring(0,p):h}return h.replace(/\0/g,"")}const t=a.length;let r,n,i,s="",o=0;for(;o<t;){if(r=a[o++],r===0&&e)return s;if(r===0||r===3)continue;switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(r);break;case 12:case 13:n=a[o++],s+=String.fromCharCode((r&31)<<6|n&63);break;case 14:n=a[o++],i=a[o++],s+=String.fromCharCode((r&15)<<12|(n&63)<<6|(i&63)<<0);break}}return s}function Y(a){let e="";for(let t=0;t<a.length;t++){let r=a[t].toString(16);r.length<2&&(r="0"+r),e+=r}return e}function P(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function j(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var J={exports:{}},se;function Z(){return se||(se=1,function(a,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(c,h,p){if(p=p||{},c=c.trim(),h=h.trim(),!h){if(!p.alwaysNormalize)return c;var m=o.parseURL(c);if(!m)throw new Error("Error trying to parse base URL.");return m.path=o.normalizePath(m.path),o.buildURLFromParts(m)}var v=o.parseURL(h);if(!v)throw new Error("Error trying to parse relative URL.");if(v.scheme)return p.alwaysNormalize?(v.path=o.normalizePath(v.path),o.buildURLFromParts(v)):h;var T=o.parseURL(c);if(!T)throw new Error("Error trying to parse base URL.");if(!T.netLoc&&T.path&&T.path[0]!=="/"){var A=n.exec(T.path);T.netLoc=A[1],T.path=A[2]}T.netLoc&&!T.path&&(T.path="/");var $={scheme:T.scheme,netLoc:v.netLoc,path:null,params:v.params,query:v.query,fragment:v.fragment};if(!v.netLoc&&($.netLoc=T.netLoc,v.path[0]!=="/"))if(!v.path)$.path=T.path,v.params||($.params=T.params,v.query||($.query=T.query));else{var U=T.path,ie=U.substring(0,U.lastIndexOf("/")+1)+v.path;$.path=o.normalizePath(ie)}return $.path===null&&($.path=p.alwaysNormalize?o.normalizePath(v.path):v.path),o.buildURLFromParts($)},parseURL:function(c){var h=r.exec(c);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(i,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};a.exports=o})()}(J)),J.exports}var w=Z();class E{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 K={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class de{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,Dt(this,"stats")}setByteRange(e,t){const r=e.split("@",2);let n;r.length===1?n=(t==null?void 0:t.byteRangeEndOffset)||0:n=parseInt(r[1]),this._byteRange=[n,parseInt(r[0])+n]}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={[K.AUDIO]:null,[K.VIDEO]:null,[K.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new E),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=w.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[K.AUDIO]=null,e[K.VIDEO]=null,e[K.AUDIOVIDEO]=null}}function Ue(a){return a.sn!=="initSegment"}class Ye extends de{constructor(e,t){super(t),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=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(F(e)&&F(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;const{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(!((e=this._decryptdata)!=null&&e.keyId)){const r=Object.keys(t);if(r.length===1){const n=this._decryptdata=t[r[0]]||null;n&&(this._decryptdata=n.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=F(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;const r=Object.keys(this.levelkeys),n=r.length;if(n>1||n===1&&(t=this.levelkeys[r[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!F(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return Ue(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const t=this.levelkeys;if(t){var r;const n=t[e];n&&!((r=this._decryptdata)!=null&&r.keyId)&&(this._decryptdata=n.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,r,n,i,s=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:r,startDTS:n,endDTS:i,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,r),c.startDTS=Math.min(c.startDTS,n),c.endDTS=Math.max(c.endDTS,i)}}class ct extends de{constructor(e,t,r,n,i){super(r),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=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=n;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function at(a,e){const t=Object.getPrototypeOf(a);if(t){const r=Object.getOwnPropertyDescriptor(t,e);return r||at(t,e)}}function Dt(a,e){const t=at(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const bt=Math.pow(2,32)-1,ot=[].push,Qt={video:1,audio:2,id3:3,text:4};function nt(a){return String.fromCharCode.apply(null,a)}function kt(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function et(a,e){const t=Pe(a,e);return t<0?4294967296+t:t}function Nt(a,e){let t=et(a,e);return t*=Math.pow(2,32),t+=et(a,e+4),t}function Pe(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function $e(a){const e=a.byteLength;for(let t=0;t<e;){const r=et(a,t);if(r>8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=r>1?t+r:e}return!1}function Ee(a,e){const t=[];if(!e.length)return t;const r=a.byteLength;for(let n=0;n<r;){const i=et(a,n),s=nt(a.subarray(n+4,n+8)),o=i>1?n+i:r;if(s===e[0])if(e.length===1)t.push(a.subarray(n+8,o));else{const c=Ee(a.subarray(n+8,o),e.slice(1));c.length&&ot.apply(t,c)}n=o}return t}function Ve(a){const e=[],t=a[0];let r=8;const n=et(a,r);r+=4;let i=0,s=0;t===0?(i=et(a,r),s=et(a,r+4),r+=8):(i=Nt(a,r),s=Nt(a,r+8),r+=16),r+=2;let o=a.length+s;const c=kt(a,r);r+=2;for(let h=0;h<c;h++){let p=r;const m=et(a,p);p+=4;const v=m&2147483647;if((m&2147483648)>>>31===1)return ce.warn("SIDX has hierarchical references (not supported)"),null;const A=et(a,p);p+=4,e.push({referenceSize:v,subsegmentDuration:A,info:{duration:A/n,start:o,end:o+v-1}}),o+=v,p+=4,r=p}return{earliestPresentationTime:i,timescale:n,version:t,referencesCount:c,references:e}}function Je(a){const e=[],t=Ee(a,["moov","trak"]);for(let n=0;n<t.length;n++){const i=t[n],s=Ee(i,["tkhd"])[0];if(s){let o=s[0];const c=et(s,o===0?12:20),h=Ee(i,["mdia","mdhd"])[0];if(h){o=h[0];const p=et(h,o===0?12:20),m=Ee(i,["mdia","hdlr"])[0];if(m){const v=nt(m.subarray(8,12)),T={soun:K.AUDIO,vide:K.VIDEO}[v],A=Ee(i,["mdia","minf","stbl","stsd"])[0],$=lt(A);T?(e[c]={timescale:p,type:T,stsd:$},e[T]=S({timescale:p,id:c},$)):e[c]={timescale:p,type:v,stsd:$}}}}}return Ee(a,["moov","mvex","trex"]).forEach(n=>{const i=et(n,4),s=e[i];s&&(s.default={duration:et(n,12),flags:et(n,20)})}),e}function lt(a){const e=a.subarray(8),t=e.subarray(86),r=nt(e.subarray(4,8));let n=r,i;const s=r==="enca"||r==="encv";if(s){const h=Ee(e,[r])[0].subarray(r==="enca"?28:78);Ee(h,["sinf"]).forEach(m=>{const v=Ee(m,["schm"])[0];if(v){const T=nt(v.subarray(4,8));if(T==="cbcs"||T==="cenc"){const A=Ee(m,["frma"])[0];A&&(n=nt(A))}}})}const o=n;switch(n){case"avc1":case"avc2":case"avc3":case"avc4":{const c=Ee(t,["avcC"])[0];c&&c.length>3&&(n+="."+Ge(c[1])+Ge(c[2])+Ge(c[3]),i=re(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=Ee(e,[r])[0],h=Ee(c.subarray(28),["esds"])[0];if(h&&h.length>7){let p=4;if(h[p++]!==3)break;p=je(h,p),p+=2;const m=h[p++];if(m&128&&(p+=2),m&64&&(p+=h[p++]),h[p++]!==4)break;p=je(h,p);const v=h[p++];if(v===64)n+="."+Ge(v);else break;if(p+=12,h[p++]!==5)break;p=je(h,p);const T=h[p++];let A=(T&248)>>3;A===31&&(A+=1+((T&7)<<3)+((h[p]&224)>>5)),n+="."+A}break}case"hvc1":case"hev1":{const c=Ee(t,["hvcC"])[0];if(c&&c.length>12){const h=c[1],p=["","A","B","C"][h>>6],m=h&31,v=et(c,2),T=(h&32)>>5?"H":"L",A=c[12],$=c.subarray(6,12);n+="."+p+m,n+="."+Se(v).toString(16).toUpperCase(),n+="."+T+A;let U="";for(let ie=$.length;ie--;){const le=$[ie];(le||U)&&(U="."+le.toString(16).toUpperCase()+U)}n+=U}i=re(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{n=re(n,t)||n;break}case"vp09":{const c=Ee(t,["vpcC"])[0];if(c&&c.length>6){const h=c[4],p=c[5],m=c[6]>>4&15;n+="."+Ze(h)+"."+Ze(p)+"."+Ze(m)}break}case"av01":{const c=Ee(t,["av1C"])[0];if(c&&c.length>2){const h=c[1]>>>5,p=c[1]&31,m=c[2]>>>7?"H":"M",v=(c[2]&64)>>6,T=(c[2]&32)>>5,A=h===2&&v?T?12:10:v?10:8,$=(c[2]&16)>>4,U=(c[2]&8)>>3,ie=(c[2]&4)>>2,le=c[2]&3;n+="."+h+"."+Ze(p)+m+"."+Ze(A)+"."+$+"."+U+ie+le+"."+Ze(1)+"."+Ze(1)+"."+Ze(1)+"."+0,i=re("dav1",t)}break}}return{codec:n,encrypted:s,supplemental:i}}function re(a,e){const t=Ee(e,["dvvC"]),r=t.length?t[0]:Ee(e,["dvcC"])[0];if(r){const n=r[2]>>1&127,i=r[2]<<5&32|r[3]>>3&31;return a+"."+Ze(n)+"."+Ze(i)}}function Se(a){let e=0;for(let t=0;t<32;t++)e|=(a>>t&1)<<31-t;return e>>>0}function je(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function Ge(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function Ze(a){return(a<10?"0":"")+a}function mt(a,e){if(!a||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&yt(a,(r,n)=>{const i=r.subarray(8,24);i.some(s=>s!==0)||(ce.log(`[eme] Patching keyId in 'enc${n?"a":"v"}>sinf>>tenc' box: ${Y(i)} -> ${Y(t)}`),r.set(t,8))})}function Pt(a){const e=[];return yt(a,t=>e.push(t.subarray(8,24))),e}function yt(a,e){Ee(a,["moov","trak"]).forEach(r=>{const n=Ee(r,["mdia","minf","stbl","stsd"])[0];if(!n)return;const i=n.subarray(8);let s=Ee(i,["enca"]);const o=s.length>0;o||(s=Ee(i,["encv"])),s.forEach(c=>{const h=o?c.subarray(28):c.subarray(78);Ee(h,["sinf"]).forEach(m=>{const v=_t(m);v&&e(v,o)})})})}function _t(a){const e=Ee(a,["schm"])[0];if(e){const t=nt(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const r=Ee(a,["schi","tenc"])[0];if(r)return r}}}function vt(a,e,t){const r={},n=Ee(a,["moof","traf"]);for(let i=0;i<n.length;i++){const s=n[i],o=Ee(s,["tfhd"])[0],c=et(o,4),h=e[c];if(!h)continue;r[c]||(r[c]={start:NaN,duration:0,sampleCount:0,timescale:h.timescale,type:h.type});const p=r[c],m=Ee(s,["tfdt"])[0];if(m){const fe=m[0];let Ce=et(m,4);fe===1&&(Ce===bt?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(Ce*=bt+1,Ce+=et(m,8))),F(Ce)&&(!F(p.start)||Ce<p.start)&&(p.start=Ce)}const v=h.default,T=et(o,0)|(v==null?void 0:v.flags);let A=(v==null?void 0:v.duration)||0;T&8&&(T&2?A=et(o,12):A=et(o,8));const $=Ee(s,["trun"]);let U=p.start||0,ie=0,le=A;for(let fe=0;fe<$.length;fe++){const Ce=$[fe],Fe=et(Ce,4),tt=p.sampleCount;p.sampleCount+=Fe;const Ne=Ce[3]&1,Xe=Ce[3]&4,qe=Ce[2]&1,ze=Ce[2]&2,ft=Ce[2]&4,Ut=Ce[2]&8;let jt=8,Jt=Fe;for(Ne&&(jt+=4),Xe&&Fe&&(!(Ce[jt+1]&1)&&p.keyFrameIndex===void 0&&(p.keyFrameIndex=tt),jt+=4,qe?(le=et(Ce,jt),jt+=4):le=A,ze&&(jt+=4),Ut&&(jt+=4),U+=le,ie+=le,Jt--);Jt--;)qe?(le=et(Ce,jt),jt+=4):le=A,ze&&(jt+=4),ft&&(Ce[jt+1]&1||p.keyFrameIndex===void 0&&(p.keyFrameIndex=p.sampleCount-(Jt+1),p.keyFrameStart=U),jt+=4),Ut&&(jt+=4),U+=le,ie+=le;!ie&&A&&(ie+=A*Fe)}p.duration+=ie}if(!Object.keys(r).some(i=>r[i].duration)){let i=1/0,s=0;const o=Ee(a,["sidx"]);for(let c=0;c<o.length;c++){const h=Ve(o[c]);if(h!=null&&h.references){i=Math.min(i,h.earliestPresentationTime/h.timescale);const p=h.references.reduce((m,v)=>m+v.info.duration||0,0);s=Math.max(s,p+h.earliestPresentationTime/h.timescale)}}s&&F(s)&&Object.keys(r).forEach(c=>{r[c].duration||(r[c].duration=s*r[c].timescale-r[c].start)})}return r}function $t(a){const e={valid:null,remainder:null},t=Ee(a,["moof"]);if(t.length<2)return e.remainder=a,e;const r=t[t.length-1];return e.valid=a.slice(0,r.byteOffset-8),e.remainder=a.slice(r.byteOffset-8),e}function Ct(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function wt(a,e){const t=[],r=e.samples,n=e.timescale,i=e.id;let s=!1;return Ee(r,["moof"]).map(c=>{const h=c.byteOffset-8;Ee(c,["traf"]).map(m=>{const v=Ee(m,["tfdt"]).map(T=>{const A=T[0];let $=et(T,4);return A===1&&($*=Math.pow(2,32),$+=et(T,8)),$/n})[0];return v!==void 0&&(a=v),Ee(m,["tfhd"]).map(T=>{const A=et(T,4),$=et(T,0)&16777215,U=($&1)!==0,ie=($&2)!==0,le=($&8)!==0;let fe=0;const Ce=($&16)!==0;let Fe=0;const tt=($&32)!==0;let Ne=8;A===i&&(U&&(Ne+=8),ie&&(Ne+=4),le&&(fe=et(T,Ne),Ne+=4),Ce&&(Fe=et(T,Ne),Ne+=4),tt&&(Ne+=4),e.type==="video"&&(s=He(e.codec)),Ee(m,["trun"]).map(Xe=>{const qe=Xe[0],ze=et(Xe,0)&16777215,ft=(ze&1)!==0;let Ut=0;const jt=(ze&4)!==0,Jt=(ze&256)!==0;let Vt=0;const Lt=(ze&512)!==0;let qt=0;const zt=(ze&1024)!==0,Xt=(ze&2048)!==0;let hr=0;const Ft=et(Xe,4);let Bt=8;ft&&(Ut=et(Xe,Bt),Bt+=4),jt&&(Bt+=4);let xr=Ut+h;for(let Br=0;Br<Ft;Br++){if(Jt?(Vt=et(Xe,Bt),Bt+=4):Vt=fe,Lt?(qt=et(Xe,Bt),Bt+=4):qt=Fe,zt&&(Bt+=4),Xt&&(qe===0?hr=et(Xe,Bt):hr=Pe(Xe,Bt),Bt+=4),e.type===K.VIDEO){let Sr=0;for(;Sr<qt;){const Ar=et(r,xr);if(xr+=4,Tt(s,r[xr])){const In=r.subarray(xr,xr+Ar);gt(In,s?2:1,a+hr/n,t)}xr+=Ar,Sr+=Ar+4}}a+=Vt/n}}))})})}),t}function He(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Tt(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function gt(a,e,t,r){const n=st(a);let i=0;i+=e;let s=0,o=0,c=0;for(;i<n.length;){s=0;do{if(i>=n.length)break;c=n[i++],s+=c}while(c===255);o=0;do{if(i>=n.length)break;c=n[i++],o+=c}while(c===255);const h=n.length-i;let p=i;if(o<h)i+=o;else if(o>h){ce.error(`Malformed SEI payload. ${o} is too small, only ${h} bytes left to parse.`);break}if(s===4){if(n[p++]===181){const v=kt(n,p);if(p+=2,v===49){const T=et(n,p);if(p+=4,T===1195456820){const A=n[p++];if(A===3){const $=n[p++],U=31&$,ie=64&$,le=ie?2+U*3:0,fe=new Uint8Array(le);if(ie){fe[0]=$;for(let Ce=1;Ce<le;Ce++)fe[Ce]=n[p++]}r.push({type:A,payloadType:s,pts:t,bytes:fe})}}}}}else if(s===5&&o>16){const m=[];for(let A=0;A<16;A++){const $=n[p++].toString(16);m.push($.length==1?"0"+$:$),(A===3||A===5||A===7||A===9)&&m.push("-")}const v=o-16,T=new Uint8Array(v);for(let A=0;A<v;A++)T[A]=n[p++];r.push({payloadType:s,pts:t,uuid:m.join(""),userData:We(T),userDataBytes:T})}}}function st(a){const e=a.byteLength,t=[];let r=1;for(;r<e-2;)a[r]===0&&a[r+1]===0&&a[r+2]===3?(t.push(r+2),r+=2):r++;if(t.length===0)return a;const n=e-t.length,i=new Uint8Array(n);let s=0;for(r=0;r<n;s++,r++)s===t[0]&&(s++,t.shift()),i[r]=a[s];return i}function Rt(a){const e=a[0];let t="",r="",n=0,i=0,s=0,o=0,c=0,h=0;if(e===0){for(;nt(a.subarray(h,h+1))!=="\0";)t+=nt(a.subarray(h,h+1)),h+=1;for(t+=nt(a.subarray(h,h+1)),h+=1;nt(a.subarray(h,h+1))!=="\0";)r+=nt(a.subarray(h,h+1)),h+=1;r+=nt(a.subarray(h,h+1)),h+=1,n=et(a,12),i=et(a,16),o=et(a,20),c=et(a,24),h=28}else if(e===1){h+=4,n=et(a,h),h+=4;const m=et(a,h);h+=4;const v=et(a,h);for(h+=4,s=bu(2,32)*m+v,Te(s)||(s=Number.MAX_SAFE_INTEGER,ce.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=et(a,h),h+=4,c=et(a,h),h+=4;nt(a.subarray(h,h+1))!=="\0";)t+=nt(a.subarray(h,h+1)),h+=1;for(t+=nt(a.subarray(h,h+1)),h+=1;nt(a.subarray(h,h+1))!=="\0";)r+=nt(a.subarray(h,h+1)),h+=1;r+=nt(a.subarray(h,h+1)),h+=1}const p=a.subarray(h,a.byteLength);return{schemeIdUri:t,value:r,timeScale:n,presentationTime:s,presentationTimeDelta:i,eventDuration:o,id:c,payload:p}}function y(a,...e){const t=e.length;let r=8,n=t;for(;n--;)r+=e[n].byteLength;const i=new Uint8Array(r);for(i[0]=r>>24&255,i[1]=r>>16&255,i[2]=r>>8&255,i[3]=r&255,i.set(a,4),n=0,r=8;n<t;n++)i.set(e[n],r),r+=e[n].byteLength;return i}function D(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let r,n;r=0,n=new Uint8Array;let i;r>0?(i=new Uint8Array(4),e.length>0&&new DataView(i.buffer).setUint32(0,e.length,!1)):i=new Uint8Array;const s=new Uint8Array(4);return t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),y([112,115,115,104],new Uint8Array([r,0,0,0]),a,i,n,s,t)}function Oe(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let r=0;for(;r+32<t;){const n=new DataView(a,r),i=N(n);e.push(i),r+=i.size}}return e}function N(a){const e=a.getUint32(0),t=a.byteOffset,r=a.byteLength;if(r<e)return{offset:t,size:r};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const i=a.getUint32(8)>>>24;if(i!==0&&i!==1)return{offset:t,size:e};const s=a.buffer,o=Y(new Uint8Array(s,t+12,16));let c=null,h=null,p=0;if(i===0)p=28;else{const v=a.getUint32(28);if(!v||r<32+v*16)return{offset:t,size:e};c=[];for(let T=0;T<v;T++)c.push(new Uint8Array(s,t+32+T*16,16));p=32+v*16}if(!p)return{offset:t,size:e};const m=a.getUint32(p);return e-32<m?{offset:t,size:e}:(h=new Uint8Array(s,t+p+4,m),{version:i,systemId:o,kids:c,data:h,offset:t,size:e})}const oe=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),rr={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 xe(a,e){const t=rr[e];return!!t&&!!t[a.slice(0,4)]}function ke(a,e,t=!0){return!a.split(",").some(r=>!Re(r,e,t))}function Re(a,e,t=!0){var r;const n=ve(t);return(r=n==null?void 0:n.isTypeSupported(G(a,e)))!=null?r:!1}function G(a,e){return`${e}/mp4;codecs=${a}`}function q(a){if(a){const e=a.substring(0,4);return rr.video[e]}return 2}function me(a){const e=oe();return a.split(",").reduce((t,r)=>{const i=e&&He(r)?9:rr.video[r];return i?(i*2+t)/(t?3:2):(rr.audio[r]+t)/(t?2:1)},0)}const we={};function O(a,e=!0){if(we[a])return we[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let n=0;n<t.length;n++){var r;if(Re(t[n],"audio",e))return we[a]=t[n],t[n];if(t[n]==="mp3"&&(r=ve(e))!=null&&r.isTypeSupported("audio/mpeg"))return""}return a}const ht=/flac|opus|mp4a\.40\.34/i;function he(a,e=!0){return a.replace(ht,t=>O(t.toLowerCase(),e))}function It(a,e){const t=[];if(a){const r=a.split(",");for(let n=0;n<r.length;n++)xe(r[n],"video")||t.push(r[n])}return e&&t.push(e),t.join(",")}function Ot(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1)&&(er(a,"audio")||er(a,"video")))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let r=t.length;r--;)if(t[r].substring(0,4)===a.substring(0,4))return t[r]}return t[0]}}return e||a}function er(a,e){return xe(a,e)&&Re(a,e)}function Dr(a){const e=a.split(",");for(let t=0;t<e.length;t++){const r=e[t].split(".");r.length>2&&r[0]==="avc1"&&(e[t]=`avc1.${parseInt(r[1]).toString(16)}${("000"+parseInt(r[2]).toString(16)).slice(-4)}`)}return e.join(",")}function lr(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let r=e.length;r>4&&r<10;r++)e[r]=t[r-4];return e.join(".")}return a}function Wt(a){const e=ve(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Mr(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Xr={supported:!0,powerEfficient:!0,smooth:!0},Er={supported:!1,smooth:!1,powerEfficient:!1},_r={supported:!0,configurations:[],decodingInfoResults:[Xr]};function At(a,e){return{supported:!1,configurations:e,decodingInfoResults:[Er],error:a}}function pt(a,e,t,r,n,i){const s=a.videoCodec,o=a.audioCodec?a.audioGroups:null,c=i==null?void 0:i.audioCodec,h=i==null?void 0:i.channels,p=h?parseInt(h):c?1/0:2;let m=null;if(o!=null&&o.length)try{o.length===1&&o[0]?m=e.groups[o[0]].channels:m=o.reduce((v,T)=>{if(T){const A=e.groups[T];if(!A)throw new Error(`Audio track group ${T} not found`);Object.keys(A.channels).forEach($=>{v[$]=(v[$]||0)+A.channels[$]})}return v},{2:0})}catch(v){return!0}return s!==void 0&&(s.split(",").some(v=>He(v))||a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(r,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(n,8e6))||!!m&&F(p)&&Object.keys(m).some(v=>parseInt(v)>p)}function xt(a,e,t,r={}){const n=a.videoCodec;if(!n&&!a.audioCodec||!t)return Promise.resolve(_r);const i=[],s=tr(a),o=s.length,c=pr(a,e,o>0),h=c.length;for(let p=o||1*h||1;p--;){const m={type:"media-source"};if(o&&(m.video=s[p%o]),h){m.audio=c[p%h];const v=m.audio.bitrate;m.video&&v&&(m.video.bitrate-=v)}i.push(m)}if(n){const p=navigator.userAgent;if(n.split(",").some(m=>He(m))&&oe())return Promise.resolve(At(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${p})`),i))}return Promise.all(i.map(p=>{const m=qr(p);return r[m]||(r[m]=t.decodingInfo(p))})).then(p=>({supported:!p.some(m=>!m.supported),configurations:i,decodingInfoResults:p})).catch(p=>({supported:!1,configurations:i,decodingInfoResults:[],error:p}))}function tr(a){var e;const t=(e=a.videoCodec)==null?void 0:e.split(","),r=Yr(a),n=a.width||640,i=a.height||480,s=a.frameRate||30,o=a.videoRange.toLowerCase();return t?t.map(c=>{const h={contentType:G(lr(c),"video"),width:n,height:i,bitrate:r,framerate:s};return o!=="sdr"&&(h.transferFunction=o),h}):[]}function pr(a,e,t){var r;const n=(r=a.audioCodec)==null?void 0:r.split(","),i=Yr(a);return n&&a.audioGroups?a.audioGroups.reduce((s,o)=>{var c;const h=o?(c=e.groups[o])==null?void 0:c.tracks:null;return h?h.reduce((p,m)=>{if(m.groupId===o){const v=parseFloat(m.channels||"");n.forEach(T=>{const A={contentType:G(T,"audio"),bitrate:t?wr(T,i):i};v&&(A.channels=""+v),p.push(A)})}return p},s):s},[]):[]}function wr(a,e){if(e<=1)return 1;let t=128e3;return a==="ec-3"?t=768e3:a==="ac-3"&&(t=64e4),Math.min(e/2,t)}function Yr(a){return Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)/1e3)*1e3||1}function qr(a){let e="";const{audio:t,video:r}=a;if(r){const n=Mr(r.contentType);e+=`${n}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||"sd"}_${Math.ceil(r.bitrate/1e5)}`}if(t){const n=Mr(t.contentType);e+=`${r?"_":""}${n}_c${t.channels}`}return e}const sn=["NONE","TYPE-0","TYPE-1",null];function Jr(a){return sn.indexOf(a)>-1}const mr=["SDR","PQ","HLG"];function cn(a){return!!a&&mr.indexOf(a)>-1}var kr={No:"",Yes:"YES",v2:"v2"};function En(a){const{canSkipUntil:e,canSkipDateRanges:t,age:r}=a,n=r<e/2;return e&&n?t?kr.v2:kr.Yes:kr.No}class dn{constructor(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class yr{constructor(e){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=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(r=>!!r).map(r=>r.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const r=(t=e.supplemental)==null?void 0:t.videoCodec;r&&r!==e.videoCodec&&(this.codecSet+=`,${r.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.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(e){return Tr(this._audioGroups,e)}hasSubtitleGroup(e){return Tr(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let r=this._audioGroups;r||(r=this._audioGroups=[]),r.indexOf(t)===-1&&r.push(t)}else if(e==="text"){let r=this._subtitleGroups;r||(r=this._subtitleGroups=[]),r.indexOf(t)===-1&&r.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Tr(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function Cr(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function Nr(a,e){let t=!1,r=[];if(a&&(t=a!=="SDR",r=[a]),e){r=e.allowedVideoRanges||mr.slice(0);const n=r.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:n&&Cr(),t||(r=["SDR"])}return{preferHDR:t,allowedVideoRanges:r}}const br=a=>{const e=new WeakSet;return(t,r)=>{if(a&&(r=a(t,r)),typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}},nr=(a,e)=>JSON.stringify(a,br(e));function pn(a,e,t,r,n){const i=Object.keys(a),s=r==null?void 0:r.channels,o=r==null?void 0:r.audioCodec,c=n==null?void 0:n.videoCodec,h=s&&parseInt(s)===2;let p=!1,m=!1,v=1/0,T=1/0,A=1/0,$=1/0,U=0,ie=[];const{preferHDR:le,allowedVideoRanges:fe}=Nr(e,n);for(let Xe=i.length;Xe--;){const qe=a[i[Xe]];p||(p=qe.channels[2]>0),v=Math.min(v,qe.minHeight),T=Math.min(T,qe.minFramerate),A=Math.min(A,qe.minBitrate),fe.filter(ft=>qe.videoRanges[ft]>0).length>0&&(m=!0)}v=F(v)?v:0,T=F(T)?T:0;const Ce=Math.max(1080,v),Fe=Math.max(30,T);A=F(A)?A:t,t=Math.max(A,t),m||(e=void 0);const tt=i.length>1;return{codecSet:i.reduce((Xe,qe)=>{const ze=a[qe];if(qe===Xe)return Xe;if(ie=m?fe.filter(ft=>ze.videoRanges[ft]>0):[],tt){if(ze.minBitrate>t)return Ur(qe,`min bitrate of ${ze.minBitrate} > current estimate of ${t}`),Xe;if(!ze.hasDefaultAudio)return Ur(qe,"no renditions with default or auto-select sound found"),Xe;if(o&&qe.indexOf(o.substring(0,4))%5!==0)return Ur(qe,`audio codec preference "${o}" not found`),Xe;if(s&&!h){if(!ze.channels[s])return Ur(qe,`no renditions with ${s} channel sound found (channels options: ${Object.keys(ze.channels)})`),Xe}else if((!o||h)&&p&&ze.channels[2]===0)return Ur(qe,"no renditions with stereo sound found"),Xe;if(ze.minHeight>Ce)return Ur(qe,`min resolution of ${ze.minHeight} > maximum of ${Ce}`),Xe;if(ze.minFramerate>Fe)return Ur(qe,`min framerate of ${ze.minFramerate} > maximum of ${Fe}`),Xe;if(!ie.some(ft=>ze.videoRanges[ft]>0))return Ur(qe,`no variants with VIDEO-RANGE of ${nr(ie)} found`),Xe;if(c&&qe.indexOf(c.substring(0,4))%5!==0)return Ur(qe,`video codec preference "${c}" not found`),Xe;if(ze.maxScore<U)return Ur(qe,`max score of ${ze.maxScore} < selected max of ${U}`),Xe}return Xe&&(me(qe)>=me(Xe)||ze.fragmentError>a[Xe].fragmentError)?Xe:($=ze.minIndex,U=ze.maxScore,qe)},void 0),videoRanges:ie,preferHDR:le,minFramerate:T,minBitrate:A,minIndex:$}}function Ur(a,e){ce.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function mn(a){return a.reduce((e,t)=>{let r=e.groups[t.groupId];r||(r=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),r.tracks.push(t);const n=t.channels||"2";return r.channels[n]=(r.channels[n]||0)+1,r.hasDefault=r.hasDefault||t.default,r.hasAutoSelect=r.hasAutoSelect||t.autoselect,r.hasDefault&&(e.hasDefaultAudio=!0),r.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function ei(a,e,t,r){return a.slice(t,r+1).reduce((n,i,s)=>{if(!i.codecSet)return n;const o=i.audioGroups;let c=n[i.codecSet];c||(n[i.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,i.bitrate);const h=Math.min(i.height,i.width);return c.minHeight=Math.min(c.minHeight,h),c.minFramerate=Math.min(c.minFramerate,i.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,i.score),c.fragmentError+=i.fragmentError,c.videoRanges[i.videoRange]=(c.videoRanges[i.videoRange]||0)+1,o&&o.forEach(p=>{if(!p)return;const m=e.groups[p];m&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?m.hasDefault:m.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(m.channels).forEach(v=>{c.channels[v]=(c.channels[v]||0)+m.channels[v]}))}),n},{})}function es(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:r,channels:n,audioCodec:i}=a;return{lang:e,assocLang:t,characteristics:r,channels:n,audioCodec:i}}function An(a,e,t){if("attrs"in a){const r=e.indexOf(a);if(r!==-1)return r}for(let r=0;r<e.length;r++){const n=e[r];if(zn(a,n,t))return r}return-1}function zn(a,e,t){const{groupId:r,name:n,lang:i,assocLang:s,default:o}=a,c=a.forced;return(r===void 0||e.groupId===r)&&(n===void 0||e.name===n)&&(i===void 0||ms(i,e.lang))&&(i===void 0||e.assocLang===s)&&(o===void 0||e.default===o)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||ts(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function ms(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function ts(a,e=""){const t=a.split(","),r=e.split(",");return t.length===r.length&&!t.some(n=>r.indexOf(n)===-1)}function an(a,e){const{audioCodec:t,channels:r}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(r===void 0||r===(e.channels||"2"))}function Rr(a,e,t,r,n){const i=e[r],o=e.reduce((v,T,A)=>{const $=T.uri;return(v[$]||(v[$]=[])).push(A),v},{})[i.uri];o.length>1&&(r=Math.max.apply(Math,o));const c=i.videoRange,h=i.frameRate,p=i.codecSet.substring(0,4),m=tn(e,r,v=>{if(v.videoRange!==c||v.frameRate!==h||v.codecSet.substring(0,4)!==p)return!1;const T=v.audioGroups,A=t.filter($=>!T||T.indexOf($.groupId)!==-1);return An(a,A,n)>-1});return m>-1?m:tn(e,r,v=>{const T=v.audioGroups,A=t.filter($=>!T||T.indexOf($.groupId)!==-1);return An(a,A,n)>-1})}function tn(a,e,t){for(let r=e;r>-1;r--)if(t(a[r]))return r;for(let r=e+1;r<a.length;r++)if(t(a[r]))return r;return-1}function mi(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Dn extends V{constructor(e){super("abr",e.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=t=>{var r;const{fragCurrent:n,partCurrent:i,hls:s}=this,{autoLevelEnabled:o,media:c}=s;if(!n||!c)return;const h=performance.now(),p=i?i.stats:n.stats,m=i?i.duration:n.duration,v=h-p.loading.start,T=s.minAutoLevel,A=n.level,$=this._nextAutoLevel;if(p.aborted||p.loaded&&p.loaded===p.total||A<=T){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const U=$>-1&&$!==A,ie=!!t||U;if(!ie&&(c.paused||!c.playbackRate||!c.readyState))return;const le=s.mainForwardBufferInfo;if(!ie&&le===null)return;const fe=this.bwEstimator.getEstimateTTFB(),Ce=Math.abs(c.playbackRate);if(v<=Math.max(fe,1e3*(m/(Ce*2))))return;const Fe=le?le.len/Ce:0,tt=p.loading.first?p.loading.first-p.loading.start:-1,Ne=p.loaded&&tt>-1,Xe=this.getBwEstimate(),qe=s.levels,ze=qe[A],ft=Math.max(p.loaded,Math.round(m*(n.bitrate||ze.averageBitrate)/8));let Ut=Ne?v-tt:v;Ut<1&&Ne&&(Ut=Math.min(v,p.loaded*8/Xe));const jt=Ne?p.loaded*1e3/Ut:0,Jt=fe/1e3,Vt=jt?(ft-p.loaded)/jt:ft*8/Xe+Jt;if(Vt<=Fe)return;const Lt=jt?jt*8:Xe,qt=((r=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:r.live)===!0,zt=this.hls.config.abrBandWidthUpFactor;let Xt=Number.POSITIVE_INFINITY,hr;for(hr=A-1;hr>T;hr--){const Br=qe[hr].maxBitrate,Sr=!qe[hr].details||qt;if(Xt=this.getTimeToLoadFrag(Jt,Lt,m*Br,Sr),Xt<Math.min(Fe,m+Jt))break}if(Xt>=Vt||Xt>m*10)return;Ne?this.bwEstimator.sample(v-Math.min(fe,tt),p.loaded):this.bwEstimator.sampleTTFB(v);const Ft=qe[hr].maxBitrate;this.getBwEstimate()*zt>Ft&&this.resetEstimator(Ft);const Bt=this.findBestLevel(Ft,T,hr,0,Fe,1,1);Bt>-1&&(hr=Bt),this.warn(`Fragment ${n.sn}${i?" part "+i.index:""} of level ${A} is loading too slowly;
Fragment duration: ${n.duration.toFixed(3)}
Time to underbuffer: ${Fe.toFixed(3)} s
Estimated load time for current fragment: ${Vt.toFixed(3)} s
Estimated load time for down switch fragment: ${Xt.toFixed(3)} s
TTFB estimate: ${tt|0} ms
Current BW estimate: ${F(Xe)?Xe|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${hr} @ ${Ft|0} bps`),s.nextLoadLevel=s.nextAutoLevel=hr,this.clearTimer();const xr=()=>{if(this.clearTimer(),this.fragCurrent===n&&this.hls.loadLevel===hr&&hr>0){const Br=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${hr>0?"and switching down":""}
Fragment duration: ${n.duration.toFixed(3)} s
Time to underbuffer: ${Br.toFixed(3)} s`),n.abortRequests(),this.fragCurrent=this.partCurrent=null,hr>T){let Sr=this.findBestLevel(this.hls.levels[T].bitrate,T,hr,0,Br,1,1);Sr===-1&&(Sr=T),this.hls.nextLoadLevel=this.hls.nextAutoLevel=Sr,this.resetEstimator(this.hls.levels[Sr].bitrate)}}};U||Vt>Xt*2?xr():this.timer=self.setInterval(xr,Xt*1e3),s.trigger(_.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:i,stats:p})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new Q(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.FRAG_LOADING,this.onFragLoading,this),e.on(_.FRAG_LOADED,this.onFragLoaded,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.FRAG_LOADING,this.onFragLoading,this),e.off(_.FRAG_LOADED,this.onFragLoaded,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(_.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){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(e,t){const r=t.frag;if(!this.ignoreFragment(r)){if(!r.bitrateTest){var n;this.fragCurrent=r,this.partCurrent=(n=t.part)!=null?n:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case te.BUFFER_ADD_CODEC_ERROR:case te.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case te.FRAG_LOAD_TIMEOUT:{const r=t.frag,{fragCurrent:n,partCurrent:i}=this;if(r&&n&&r.sn===n.sn&&r.level===n.level){const s=performance.now(),o=i?i.stats:r.stats,c=s-o.loading.start,h=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&h>-1){const m=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(m,h),o.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,r,n){const i=e+r/t,s=n?e+this.lastLevelLoadSec:0;return i+s}onLevelLoaded(e,t){const r=this.hls.config,{loading:n}=t.stats,i=n.end-n.first;F(i)&&(this.lastLevelLoadSec=i/1e3),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:r}){const n=r?r.stats:t.stats;if(t.type===pe.MAIN&&this.bwEstimator.sampleTTFB(n.loading.first-n.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const i=r?r.duration:t.duration,s=this.hls.levels[t.level],o=(s.loaded?s.loaded.bytes:0)+n.loaded,c=(s.loaded?s.loaded.duration:0)+i;s.loaded={bytes:o,duration:c},s.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){const i={stats:n,frag:t,part:r,id:t.type};this.onFragBuffered(_.FRAG_BUFFERED,i),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:r,part:n}=t,i=n!=null&&n.stats.loaded?n.stats:r.stats;if(i.aborted||this.ignoreFragment(r))return;const s=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.getBwEstimate(),r.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==pe.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,r=this.getBwEstimate(),n=this.hls.config.maxStarvationDelay,i=this.findBestLevel(r,t,e,0,n,1,1);if(i>-1)return i;const s=this.hls.firstLevel,o=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,r=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(e!==-1&&(!r||!n||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const i=r&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,i)&&s[e].loadError<=s[i].loadError)return e}return this._nextAutoLevel=i,this.nextAutoLevelKey=this.getAutoLevelKey(),i}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:r}=this;if(r.levels.length<=1)return r.loadLevel;const{maxAutoLevel:n,config:i,minAutoLevel:s}=r,o=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),h=this.getStarvationDelay();let p=i.abrBandWidthFactor,m=i.abrBandWidthUpFactor;if(h){const U=this.findBestLevel(c,s,n,h,0,p,m);if(U>=0)return this.rebufferNotice=-1,U}let v=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay;if(!h){const U=this.bitrateTestDelay;U&&(v=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-U,this.info(`bitrate test took ${Math.round(1e3*U)}ms, set first fragment max fetchDuration to ${Math.round(1e3*v)} ms`),p=m=1)}const T=this.findBestLevel(c,s,n,h,v,p,m);if(this.rebufferNotice!==T&&(this.rebufferNotice=T,this.info(`${h?"rebuffering expected":"buffer is empty"}, optimal quality level ${T}`)),T>-1)return T;const A=r.levels[s],$=r.loadLevelObj;return $&&(A==null?void 0:A.bitrate)<$.bitrate?s:r.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const r=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,n=e.mainForwardBufferInfo;return(n?n.len:0)/r}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,r,n,i,s,o){var c;const h=n+i,p=this.lastLoadedFragLevel,m=p===-1?this.hls.firstLevel:p,{fragCurrent:v,partCurrent:T}=this,{levels:A,allAudioTracks:$,loadLevel:U,config:ie}=this.hls;if(A.length===1)return 0;const le=A[m],fe=!!((c=this.hls.latestLevelDetails)!=null&&c.live),Ce=U===-1||p===-1;let Fe,tt="SDR",Ne=(le==null?void 0:le.frameRate)||0;const{audioPreference:Xe,videoPreference:qe}=ie,ze=this.audioTracksByGroup||(this.audioTracksByGroup=mn($));let ft=-1;if(Ce){if(this.firstSelection!==-1)return this.firstSelection;const Lt=this.codecTiers||(this.codecTiers=ei(A,ze,t,r)),qt=pn(Lt,tt,e,Xe,qe),{codecSet:zt,videoRanges:Xt,minFramerate:hr,minBitrate:Ft,minIndex:Bt,preferHDR:xr}=qt;ft=Bt,Fe=zt,tt=xr?Xt[Xt.length-1]:Xt[0],Ne=hr,e=Math.max(e,Ft),this.log(`picked start tier ${nr(qt)}`)}else Fe=le==null?void 0:le.codecSet,tt=le==null?void 0:le.videoRange;const Ut=T?T.duration:v?v.duration:0,jt=this.bwEstimator.getEstimateTTFB()/1e3,Jt=[];for(let Lt=r;Lt>=t;Lt--){var Vt;const qt=A[Lt],zt=Lt>m;if(!qt)continue;if(ie.useMediaCapabilities&&!qt.supportedResult&&!qt.supportedPromise){const Sr=navigator.mediaCapabilities;typeof(Sr==null?void 0:Sr.decodingInfo)=="function"&&pt(qt,ze,tt,Ne,e,Xe)?(qt.supportedPromise=xt(qt,ze,Sr,this.supportedCache),qt.supportedPromise.then(Ar=>{if(!this.hls)return;qt.supportedResult=Ar;const In=this.hls.levels,Tn=In.indexOf(qt);Ar.error?this.warn(`MediaCapabilities decodingInfo error: "${Ar.error}" for level ${Tn} ${nr(Ar)}`):Ar.supported?Ar.decodingInfoResults.some(di=>di.smooth===!1||di.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${Tn} not smooth or powerEfficient: ${nr(Ar)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Tn} ${nr(Ar)}`),Tn>-1&&In.length>1&&(this.log(`Removing unsupported level ${Tn}`),this.hls.removeLevel(Tn),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(Ar=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${Ar}`)})):qt.supportedResult=_r}if((Fe&&qt.codecSet!==Fe||tt&&qt.videoRange!==tt||zt&&Ne>qt.frameRate||!zt&&Ne>0&&Ne<qt.frameRate||(Vt=qt.supportedResult)!=null&&(Vt=Vt.decodingInfoResults)!=null&&Vt.some(Sr=>Sr.smooth===!1))&&(!Ce||Lt!==ft)){Jt.push(Lt);continue}const Xt=qt.details,hr=(T?Xt==null?void 0:Xt.partTarget:Xt==null?void 0:Xt.averagetargetduration)||Ut;let Ft;zt?Ft=o*e:Ft=s*e;const Bt=Ut&&n>=Ut*2&&i===0?qt.averageBitrate:qt.maxBitrate,xr=this.getTimeToLoadFrag(jt,Ft,Bt*hr,Xt===void 0);if(Ft>=Bt&&(Lt===p||qt.loadError===0&&qt.fragmentError===0)&&(xr<=jt||!F(xr)||fe&&!this.bitrateTestDelay||xr<h)){const Sr=this.forcedAutoLevel;return Lt!==U&&(Sr===-1||Sr!==U)&&(Jt.length&&this.trace(`Skipped level(s) ${Jt.join(",")} of ${r} max with CODECS and VIDEO-RANGE:"${A[Jt[0]].codecs}" ${A[Jt[0]].videoRange}; not compatible with "${Fe}" ${tt}`),this.info(`switch candidate:${m}->${Lt} adjustedbw(${Math.round(Ft)})-bitrate=${Math.round(Ft-Bt)} ttfb:${jt.toFixed(1)} avgDuration:${hr.toFixed(1)} maxFetchDuration:${h.toFixed(1)} fetchDuration:${xr.toFixed(1)} firstSelection:${Ce} codecSet:${qt.codecSet} videoRange:${qt.videoRange} hls.loadLevel:${U}`)),Ce&&(this.firstSelection=Lt),Lt}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:r}=this.hls;return Math.min(Math.max(e,r),t)}}const Ir={search:function(a,e){let t=0,r=a.length-1,n=null,i=null;for(;t<=r;){n=(t+r)/2|0,i=a[n];const s=e(i);if(s>0)t=n+1;else if(s<0)r=n-1;else return i}return null}};function jr(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!F(e))return null;const r=a[0].programDateTime;if(e<(r||0))return null;const n=a[a.length-1].endProgramDateTime;if(e>=(n||0))return null;for(let i=0;i<a.length;++i){const s=a[i];if(_i(e,t,s))return s}return null}function on(a,e,t=0,r=0,n=.005){let i=null;if(a){i=e[1+a.sn-e[0].sn]||null;const o=a.endDTS-t;o>0&&o<15e-7&&(t+=15e-7),i&&a.level!==i.level&&i.end<=a.end&&(i=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(i=e[0]);if(i&&((!a||a.level===i.level)&&xn(t,r,i)===0||gi(i,a,Math.min(n,r))))return i;const s=Ir.search(e,xn.bind(null,t,r));return s&&(s!==a||!i)?s:i}function gi(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const r=e.tagList.reduce((n,i)=>(i[0]==="INF"&&(n+=parseFloat(i[1])),n),t);return a.start<=r}return!1}function xn(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-r<=a?1:t.start-r>a&&t.start?-1:0}function _i(a,e,t){const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-r>a}function vi(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){let r=a.fragments;const{fragmentHint:n}=a;n&&(r=r.concat(n));let i;return Ir.search(r,s=>s.cc<e?1:s.cc>e?-1:(i=s,s.end<=t?1:s.start>t?-1:0)),i||null}return null}function On(a){switch(a.details){case te.FRAG_LOAD_TIMEOUT:case te.KEY_LOAD_TIMEOUT:case te.LEVEL_LOAD_TIMEOUT:case te.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function ti(a){return a.details.startsWith("key")}function Qe(a){return ti(a)&&!!a.frag&&!a.frag.decryptdata}function cr(a,e){const t=On(e);return a.default[`${t?"timeout":"error"}Retry`]}function Vr(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function yi(a){return S(S({},a),{errorRetry:null,timeoutRetry:null})}function bi(a,e,t,r){if(!a)return!1;const n=r==null?void 0:r.code,i=e<a.maxNumRetry&&(Vn(n)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,r,i):i}function Vn(a){return wn(a)||!!a&&(a<400||a>499)}function wn(a){return a===0&&navigator.onLine===!1}var ur={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Pr={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4,SwitchToSDR:8};class kn extends V{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(_.ERROR,this.onError,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(_.ERROR,this.onError,this),e.off(_.ERROR,this.onErrorOut,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===pe.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,r=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||r===-1?t.loadLevel:r}variantHasKey(e,t){if(e){var r;if((r=e.details)!=null&&r.hasKey(t))return!0;const n=e.audioGroups;if(n)return this.hls.allAudioTracks.filter(s=>n.indexOf(s.groupId)>=0).some(s=>{var o;return(o=s.details)==null?void 0:o.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var r;if(t.fatal)return;const n=this.hls,i=t.context;switch(t.details){case te.FRAG_LOAD_ERROR:case te.FRAG_LOAD_TIMEOUT:case te.KEY_LOAD_ERROR:case te.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case te.FRAG_PARSING_ERROR:if((r=t.frag)!=null&&r.gap){t.errorAction=en();return}case te.FRAG_GAP:case te.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=ur.SendAlternateToPenaltyBox;return}case te.LEVEL_EMPTY_ERROR:case te.LEVEL_PARSING_ERROR:{var s;const c=t.parent===pe.MAIN?t.level:n.loadLevel;t.details===te.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(s=s.levelDetails)!=null&&s.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case te.LEVEL_LOAD_ERROR:case te.LEVEL_LOAD_TIMEOUT:typeof(i==null?void 0:i.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level));return;case te.AUDIO_TRACK_LOAD_ERROR:case te.AUDIO_TRACK_LOAD_TIMEOUT:case te.SUBTITLE_LOAD_ERROR:case te.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){const c=n.loadLevelObj;if(c&&(i.type===De.AUDIO_TRACK&&c.hasAudioGroup(i.groupId)||i.type===De.SUBTITLE_TRACK&&c.hasSubtitleGroup(i.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=ur.SendAlternateToPenaltyBox,t.errorAction.flags=Pr.MoveAllAlternatesMatchingHost;return}}return;case te.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:ur.SendAlternateToPenaltyBox,flags:Pr.MoveAllAlternatesMatchingHDCP};return;case te.KEY_SYSTEM_SESSION_UPDATE_FAILED:case te.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case te.KEY_SYSTEM_NO_SESSION:t.errorAction={action:ur.SendAlternateToPenaltyBox,flags:Pr.MoveAllAlternatesMatchingKey};return;case te.BUFFER_ADD_CODEC_ERROR:case te.REMUX_ALLOC_ERROR:case te.BUFFER_APPEND_ERROR:if(!t.errorAction){var o;t.errorAction=this.getLevelSwitchAction(t,(o=t.level)!=null?o:n.loadLevel)}return;case te.INTERNAL_EXCEPTION:case te.BUFFER_APPENDING_ERROR:case te.BUFFER_FULL_ERROR:case te.LEVEL_SWITCH_ERROR:case te.BUFFER_STALLED_ERROR:case te.BUFFER_SEEK_OVER_HOLE:case te.BUFFER_NUDGE_ON_STALL:t.errorAction=en();return}t.type===ye.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=en())}getPlaylistRetryOrSwitchAction(e,t){const r=this.hls,n=cr(r.config.playlistLoadPolicy,e),i=this.playlistError++;if(bi(n,i,On(e),e.response))return{action:ur.RetryRequest,flags:Pr.None,retryConfig:n,retryCount:i};const o=this.getLevelSwitchAction(e,t);return n&&(o.retryConfig=n,o.retryCount=i),o}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),n=t.levels[r],{fragLoadPolicy:i,keyLoadPolicy:s}=t.config,o=cr(ti(e)?s:i,e),c=t.levels.reduce((p,m)=>p+m.fragmentError,0);if(n&&(e.details!==te.FRAG_GAP&&n.fragmentError++,!Qe(e)&&bi(o,c,On(e),e.response)))return{action:ur.RetryRequest,flags:Pr.None,retryConfig:o,retryCount:c};const h=this.getLevelSwitchAction(e,r);return o&&(h.retryConfig=o,h.retryCount=c),h}getLevelSwitchAction(e,t){const r=this.hls;t==null&&(t=r.loadLevel);const n=this.hls.levels[t];if(n){var i,s;const h=e.details;n.loadError++,h===te.BUFFER_APPEND_ERROR&&n.fragmentError++;let p=-1;const{levels:m,loadLevel:v,minAutoLevel:T,maxAutoLevel:A}=r;!r.autoLevelEnabled&&!r.config.preserveManualLevelOnError&&(r.loadLevel=-1);const $=(i=e.frag)==null?void 0:i.type,ie=($===pe.AUDIO&&h===te.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(h===te.BUFFER_ADD_CODEC_ERROR||h===te.BUFFER_APPEND_ERROR))&&m.some(({audioCodec:tt})=>n.audioCodec!==tt),fe=e.sourceBufferName==="video"&&(h===te.BUFFER_ADD_CODEC_ERROR||h===te.BUFFER_APPEND_ERROR)&&m.some(({codecSet:tt,audioCodec:Ne})=>n.codecSet!==tt&&n.audioCodec===Ne),{type:Ce,groupId:Fe}=(s=e.context)!=null?s:{};for(let tt=m.length;tt--;){const Ne=(tt+v)%m.length;if(Ne!==v&&Ne>=T&&Ne<=A&&m[Ne].loadError===0){var o,c;const Xe=m[Ne];if(h===te.FRAG_GAP&&$===pe.MAIN&&e.frag){const qe=m[Ne].details;if(qe){const ze=on(e.frag,qe.fragments,e.frag.start);if(ze!=null&&ze.gap)continue}}else{if(Ce===De.AUDIO_TRACK&&Xe.hasAudioGroup(Fe)||Ce===De.SUBTITLE_TRACK&&Xe.hasSubtitleGroup(Fe))continue;if($===pe.AUDIO&&(o=n.audioGroups)!=null&&o.some(qe=>Xe.hasAudioGroup(qe))||$===pe.SUBTITLE&&(c=n.subtitleGroups)!=null&&c.some(qe=>Xe.hasSubtitleGroup(qe))||ie&&n.audioCodec===Xe.audioCodec||fe&&n.codecSet===Xe.codecSet||!ie&&n.codecSet!==Xe.codecSet)continue}p=Ne;break}}if(p>-1&&r.loadLevel!==p)return e.levelRetry=!0,this.playlistError=0,{action:ur.SendAlternateToPenaltyBox,flags:Pr.None,nextAutoLevel:p}}return{action:ur.SendAlternateToPenaltyBox,flags:Pr.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var r;switch((r=t.errorAction)==null?void 0:r.action){case ur.DoNothing:break;case ur.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==te.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case ur.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:n}=r,i=r.nextAutoLevel;switch(n){case Pr.None:this.switchLevel(e,i);break;case Pr.MoveAllAlternatesMatchingHDCP:{const c=this.getVariantLevelIndex(e.frag),h=t.levels[c],p=h==null?void 0:h.attrs["HDCP-LEVEL"];if(r.hdcpLevel=p,p==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(p){t.maxHdcpLevel=sn[sn.indexOf(p)-1],r.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case Pr.MoveAllAlternatesMatchingKey:{const c=e.decryptdata;if(c){const h=this.hls.levels,p=h.length;for(let v=p;v--;)if(this.variantHasKey(h[v],c)){var s,o;this.log(`Banned key found in level ${v} (${h[v].bitrate}bps) or audio group "${(s=h[v].audioGroups)==null?void 0:s.join(",")}" (${(o=e.frag)==null?void 0:o.type} fragment) ${Y(c.keyId||[])}`),h[v].fragmentError++,h[v].loadError++,this.log(`Removing level ${v} with key error (${e.error})`),this.hls.removeLevel(v)}const m=e.frag;if(this.hls.levels.length<p)r.resolved=!0;else if(m&&m.type!==pe.MAIN){const v=m.decryptdata;v&&!c.matches(v)&&(r.resolved=!0)}}break}}r.resolved||this.switchLevel(e,i)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===te.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const r=Mr(e.mimeType),n=this.hls.levels;for(let i=n.length;i--;)n[i][`${e.sourceBufferName}Codec`]===r&&(this.log(`Removing level ${i} for ${e.details} ("${r}" not supported)`),this.hls.removeLevel(i))}}}function en(a){const e={action:ur.DoNothing,flags:Pr.None};return a&&(e.resolved=!0),e}var $r={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class ji{constructor(e){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=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.BUFFER_APPENDED,this.onBufferAppended,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.BUFFER_APPENDED,this.onBufferAppended,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const r=this.activePartLists[t];if(r)for(let n=r.length;n--;){const i=r[n];if(!i)break;if(i.start<=e&&e<=i.end&&i.loaded)return i}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,r){const{fragments:n}=this,i=Object.keys(n);for(let s=i.length;s--;){const o=n[i[s]];if((o==null?void 0:o.body.type)===t&&(!r||o.buffered)){const c=o.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,r,n,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(n==null?void 0:n.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const c=this.fragments[o];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||i)){c.body.type===r&&this.removeFragment(c.body);return}const h=c.range[e];if(h){if(h.time.length===0){this.removeFragment(c.body);return}h.time.some(p=>{const m=!this.isTimeBuffered(p.startPTS,p.endPTS,t);return m&&this.removeFragment(c.body),m})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const r=e.frag,n=fn(r),i=this.fragments[n];if(!i||i.buffered&&r.gap)return;const s=!r.relurl;Object.keys(t).forEach(o=>{const c=r.elementaryStreams[o];if(!c)return;const h=t[o],p=s||c.partial===!0;i.range[o]=this.getBufferedTimes(r,e.part,p,h)}),i.loaded=null,Object.keys(i.range).length?(this.bufferedEnd(i,r),Wn(i)||this.removeParts(r.sn-1,r.type)):this.removeFragment(i.body)}bufferedEnd(e,t){e.buffered=!0,(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=Ht(r,n=>n.fragment.sn>=e))}fragBuffered(e,t){const r=fn(e);let n=this.fragments[r];!n&&t&&(n=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),n&&(n.loaded=null,this.bufferedEnd(n,e))}getBufferedTimes(e,t,r,n){const i={time:[],partial:r},s=e.start,o=e.end,c=e.minEndPTS||o,h=e.maxStartPTS||s;for(let p=0;p<n.length;p++){const m=n.start(p)-this.bufferPadding,v=n.end(p)+this.bufferPadding;if(h>=m&&c<=v){i.time.push({startPTS:Math.max(s,n.start(p)),endPTS:Math.min(o,n.end(p))});break}else if(s<v&&o>m){const T=Math.max(s,n.start(p)),A=Math.min(o,n.end(p));A>T&&(i.partial=!0,i.time.push({startPTS:T,endPTS:A}))}else if(o<=m)break}return i}getPartialFragment(e){let t=null,r,n,i,s=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(h=>{const p=c[h];p&&Wn(p)&&(n=p.body.start-o,i=p.body.end+o,e>=n&&e<=i&&(r=Math.min(e-n,i-e),s<=r&&(t=p.body,s=r)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Wn(t))}getState(e){const t=fn(e),r=this.fragments[t];return r?r.buffered?Wn(r)?$r.PARTIAL:$r.OK:$r.APPENDING:$r.NOT_LOADED}isTimeBuffered(e,t,r){let n,i;for(let s=0;s<r.length;s++){if(n=r.start(s)-this.bufferPadding,i=r.end(s)+this.bufferPadding,e>=n&&t<=i)return!0;if(t<=n)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const r=t.frag,n=t.part?null:t,i=fn(r);this.fragments[i]={body:r,appendedPTS:null,loaded:n,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:n,timeRanges:i,type:s}=t;if(r.sn==="initSegment")return;const o=r.type;if(n){let h=this.activePartLists[o];h||(this.activePartLists[o]=h=[]),h.push(n)}this.timeRanges=i;const c=i[s];this.detectEvictedFragments(s,c,o,n)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=fn(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,r=Object.keys(t);if(!e)return r.length>0;for(let n=r.length;n--;){const i=t[r[n]];if((i==null?void 0:i.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,r,n,i){n&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o)return;const c=o.body;c.type!==r||n&&!c.gap||c.start<t&&c.end>e&&(o.buffered||i)&&this.removeFragment(c)})}removeFragment(e){const t=fn(e);e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const n=e.sn;this.activePartLists[e.type]=Ht(r,i=>i.fragment.sn!==n)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(r=>r.clearElementaryStreamInfo())}}function Wn(a){var e,t,r;return a.buffered&&!!(a.body.gap||(e=a.range.video)!=null&&e.partial||(t=a.range.audio)!=null&&t.partial||(r=a.range.audiovideo)!=null&&r.partial)}function fn(a){return`${a.type}_${a.level}_${a.sn}`}function Ht(a,e){return a.filter(t=>{const r=e(t);return r||t.clearElementaryStreamInfo(),r})}var ln={cbc:0,ctr:1};class Qr{constructor(e,t,r){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=r}decrypt(e,t){switch(this.aesMode){case ln.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case ln.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function Mn(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class Ei{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_(e){const t=new DataView(e),r=new Uint32Array(4);for(let n=0;n<4;n++)r[n]=t.getUint32(n*4);return r}initTable(){const e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],s=r[2],o=r[3],c=this.invSubMix,h=c[0],p=c[1],m=c[2],v=c[3],T=new Uint32Array(256);let A=0,$=0,U=0;for(U=0;U<256;U++)U<128?T[U]=U<<1:T[U]=U<<1^283;for(U=0;U<256;U++){let ie=$^$<<1^$<<2^$<<3^$<<4;ie=ie>>>8^ie&255^99,e[A]=ie,t[ie]=A;const le=T[A],fe=T[le],Ce=T[fe];let Fe=T[ie]*257^ie*16843008;n[A]=Fe<<24|Fe>>>8,i[A]=Fe<<16|Fe>>>16,s[A]=Fe<<8|Fe>>>24,o[A]=Fe,Fe=Ce*16843009^fe*65537^le*257^A*16843008,h[ie]=Fe<<24|Fe>>>8,p[ie]=Fe<<16|Fe>>>16,m[ie]=Fe<<8|Fe>>>24,v[ie]=Fe,A?(A=le^T[T[T[Ce^le]]],$^=T[T[$]]):A=$=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let r=!0,n=0;for(;n<t.length&&r;)r=t[n]===this.key[n],n++;if(r)return;this.key=t;const i=this.keySize=t.length;if(i!==4&&i!==6&&i!==8)throw new Error("Invalid aes key size="+i);const s=this.ksRows=(i+6+1)*4;let o,c;const h=this.keySchedule=new Uint32Array(s),p=this.invKeySchedule=new Uint32Array(s),m=this.sBox,v=this.rcon,T=this.invSubMix,A=T[0],$=T[1],U=T[2],ie=T[3];let le,fe;for(o=0;o<s;o++){if(o<i){le=h[o]=t[o];continue}fe=le,o%i===0?(fe=fe<<8|fe>>>24,fe=m[fe>>>24]<<24|m[fe>>>16&255]<<16|m[fe>>>8&255]<<8|m[fe&255],fe^=v[o/i|0]<<24):i>6&&o%i===4&&(fe=m[fe>>>24]<<24|m[fe>>>16&255]<<16|m[fe>>>8&255]<<8|m[fe&255]),h[o]=le=(h[o-i]^fe)>>>0}for(c=0;c<s;c++)o=s-c,c&3?fe=h[o]:fe=h[o-4],c<4||o<=4?p[c]=fe:p[c]=A[m[fe>>>24]]^$[m[fe>>>16&255]]^U[m[fe>>>8&255]]^ie[m[fe&255]],p[c]=p[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,r){const n=this.keySize+6,i=this.invKeySchedule,s=this.invSBox,o=this.invSubMix,c=o[0],h=o[1],p=o[2],m=o[3],v=this.uint8ArrayToUint32Array_(r);let T=v[0],A=v[1],$=v[2],U=v[3];const ie=new Int32Array(e),le=new Int32Array(ie.length);let fe,Ce,Fe,tt,Ne,Xe,qe,ze,ft,Ut,jt,Jt,Vt,Lt;const qt=this.networkToHostOrderSwap;for(;t<ie.length;){for(ft=qt(ie[t]),Ut=qt(ie[t+1]),jt=qt(ie[t+2]),Jt=qt(ie[t+3]),Ne=ft^i[0],Xe=Jt^i[1],qe=jt^i[2],ze=Ut^i[3],Vt=4,Lt=1;Lt<n;Lt++)fe=c[Ne>>>24]^h[Xe>>16&255]^p[qe>>8&255]^m[ze&255]^i[Vt],Ce=c[Xe>>>24]^h[qe>>16&255]^p[ze>>8&255]^m[Ne&255]^i[Vt+1],Fe=c[qe>>>24]^h[ze>>16&255]^p[Ne>>8&255]^m[Xe&255]^i[Vt+2],tt=c[ze>>>24]^h[Ne>>16&255]^p[Xe>>8&255]^m[qe&255]^i[Vt+3],Ne=fe,Xe=Ce,qe=Fe,ze=tt,Vt=Vt+4;fe=s[Ne>>>24]<<24^s[Xe>>16&255]<<16^s[qe>>8&255]<<8^s[ze&255]^i[Vt],Ce=s[Xe>>>24]<<24^s[qe>>16&255]<<16^s[ze>>8&255]<<8^s[Ne&255]^i[Vt+1],Fe=s[qe>>>24]<<24^s[ze>>16&255]<<16^s[Ne>>8&255]<<8^s[Xe&255]^i[Vt+2],tt=s[ze>>>24]<<24^s[Ne>>16&255]<<16^s[Xe>>8&255]<<8^s[qe&255]^i[Vt+3],le[t]=qt(fe^T),le[t+1]=qt(tt^A),le[t+2]=qt(Fe^$),le[t+3]=qt(Ce^U),T=ft,A=Ut,$=jt,U=Jt,t=t+4}return le.buffer}}class xi{constructor(e,t,r){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=r}expandKey(){const e=Vi(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Vi(a){switch(a){case ln.cbc:return"AES-CBC";case ln.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const wi=16;class Zr{constructor(e,{removePKCS7Padding:t=!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=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const r=self.crypto;r&&(this.subtle=r.subtle||r.webkitSubtle)}catch(r){}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:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const r=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Mn(r):r}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,r,n){return this.useSoftware?new Promise((i,s)=>{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,r,n);const c=this.flush();c?i(c.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,r,n)}softwareDecrypt(e,t,r,n){const{currentIV:i,currentResult:s,remainderData:o}=this;if(n!==ln.cbc||t.byteLength!==16)return ce.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=Ct(o,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;i&&(r=i);let h=this.softwareDecrypter;h||(h=this.softwareDecrypter=new Ei),h.expandKey(t);const p=s;return this.currentResult=h.decrypt(c.buffer,0,r),this.currentIV=c.slice(-16).buffer,p||null}webCryptoDecrypt(e,t,r,n){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,r,n));this.key=t,this.fastAesKey=new xi(this.subtle,t,n)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Qr(this.subtle,new Uint8Array(r),n).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(ce.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,r,n)))}onWebCryptoError(e,t,r,n){const i=this.enableSoftwareAES;if(i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,r,n);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(i?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const r=e.length-e.length%wi;return r!==e.length&&(t=e.slice(0,r),this.remainderData=e.slice(r)),t}logOnce(e){this.logEnabled&&(ce.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const ri=Math.pow(2,17);class Cn{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const r=e.url;if(!r)return Promise.reject(new dr({type:ye.NETWORK_ERROR,details:te.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${r?"part list":"url"}`),networkDetails:null}));this.abort();const n=this.config,i=n.fLoader,s=n.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(A=>A[0]==="GAP")){c(Fn(e));return}else e.gap=!1;const h=this.loader=i?new i(n):new s(n),p=Yn(e);e.loader=h;const m=yi(n.fragLoadPolicy.default),v={loadPolicy:m,timeout:m.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:ri};e.stats=h.stats;const T={onSuccess:(A,$,U,ie)=>{this.resetLoader(e,h);let le=A.data;U.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(le.slice(0,16)),le=le.slice(16)),o({frag:e,part:null,payload:le,networkDetails:ie})},onError:(A,$,U,ie)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:te.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:S({url:r,data:void 0},A),error:new Error(`HTTP Error ${A.code} ${A.text}`),networkDetails:U,stats:ie}))},onAbort:(A,$,U)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:te.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:U,stats:A}))},onTimeout:(A,$,U)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:te.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:U,stats:A}))}};t&&(T.onProgress=(A,$,U,ie)=>t({frag:e,part:null,payload:U,networkDetails:ie})),h.load(p,v,T)})}loadPart(e,t,r){this.abort();const n=this.config,i=n.fLoader,s=n.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(Fn(e,t));return}const h=this.loader=i?new i(n):new s(n),p=Yn(e,t);e.loader=h;const m=yi(n.fragLoadPolicy.default),v={loadPolicy:m,timeout:m.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:ri};t.stats=h.stats,h.load(p,v,{onSuccess:(T,A,$,U)=>{this.resetLoader(e,h),this.updateStatsFromPart(e,t);const ie={frag:e,part:t,payload:T.data,networkDetails:U};r(ie),o(ie)},onError:(T,A,$,U)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:te.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:S({url:p.url,data:void 0},T),error:new Error(`HTTP Error ${T.code} ${T.text}`),networkDetails:$,stats:U}))},onAbort:(T,A,$)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:te.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:$,stats:T}))},onTimeout:(T,A,$)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:te.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:$,stats:T}))}})})}updateStatsFromPart(e,t){const r=e.stats,n=t.stats,i=n.total;if(r.loaded+=n.loaded,i){const c=Math.round(e.duration/t.duration),h=Math.min(Math.round(r.loaded/i),c),m=(c-h)*Math.round(r.loaded/h);r.total=r.loaded+m}else r.total=Math.max(r.loaded,r.total);const s=r.loading,o=n.loading;s.start?s.first+=o.first-o.start:(s.start=o.start,s.first=o.first),s.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Yn(a,e=null){const t=e||a,r={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},n=t.byteRangeStartOffset,i=t.byteRangeEndOffset;if(F(n)&&F(i)){var s;let o=n,c=i;if(a.sn==="initSegment"&&Ln((s=a.decryptdata)==null?void 0:s.method)){const h=i-n;h%16&&(c=i+(16-h%16)),n!==0&&(r.resetIV=!0,o=n-16)}r.rangeStart=o,r.rangeEnd=c}return r}function Fn(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),r={type:ye.MEDIA_ERROR,details:te.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(r.part=e),(e||a).stats.aborted=!0,new dr(r)}function Ln(a){return a==="AES-128"||a==="AES-256"}class dr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Si extends V{constructor(e,t){super(e,t),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(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!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 ni{constructor(e,t,r,n=0,i=-1,s=!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=ii(),this.buffering={audio:ii(),video:ii(),audiovideo:ii()},this.level=e,this.sn=t,this.id=r,this.size=n,this.part=i,this.partial=s}}function ii(){return{start:0,executeStart:0,executeEnd:0,end:0}}const un={length:0,start:()=>0,end:()=>0};class ir{static isBuffered(e,t){if(e){const r=ir.getBuffered(e);for(let n=r.length;n--;)if(t>=r.start(n)&&t<=r.end(n))return!0}return!1}static bufferedRanges(e){if(e){const t=ir.getBuffered(e);return ir.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}static bufferInfo(e,t,r){if(e){const n=ir.bufferedRanges(e);if(n.length)return ir.bufferedInfo(n,t,r)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,r){t=Math.max(0,t),e.length>1&&e.sort((p,m)=>p.start-m.start||m.end-p.end);let n=-1,i=[];if(r)for(let p=0;p<e.length;p++){t>=e[p].start&&t<=e[p].end&&(n=p);const m=i.length;if(m){const v=i[m-1].end;e[p].start-v<r?e[p].end>v&&(i[m-1].end=e[p].end):i.push(e[p])}else i.push(e[p])}else i=e;let s=0,o,c=t,h=t;for(let p=0;p<i.length;p++){const m=i[p].start,v=i[p].end;if(n===-1&&t>=m&&t<=v&&(n=p),t+r>=m&&t<v)c=m,h=v,s=h-t;else if(t+r<m){o=m;break}}return{len:s,start:c||0,end:h||0,nextStart:o,buffered:e,bufferedIndex:n}}static getBuffered(e){try{return e.buffered||un}catch(t){return ce.log("failed to get media.buffered",t),un}}}const rs=/\{\$([a-zA-Z0-9-_]+)\}/g;function St(a){return rs.test(a)}function hn(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(rs,r=>{const n=r.substring(2,r.length-1),i=t==null?void 0:t[n];return i===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${n}"`)),r):i})}return e}function Ii(a,e,t){let r=a.variableList;r||(a.variableList=r={});let n,i;if("QUERYPARAM"in e){n=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(n))i=s.get(n);else throw new Error(`"${n}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else n=e.NAME,i=e.VALUE;n in r?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${n}"`)):r[n]=i||""}function Pi(a,e,t){const r=e.IMPORT;if(t&&r in t){let n=a.variableList;n||(a.variableList=n={}),n[r]=t[r]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}const gn=/^(\d+)x(\d+)$/,Gn=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ar{constructor(e,t){typeof e=="string"&&(e=ar.parseAttrList(e,t)),b(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const r=new Uint8Array(t.length/2);for(let n=0;n<t.length/2;n++)r[n]=parseInt(t.slice(n*2,n*2+2),16);return r}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const r=this[e];return r?parseFloat(r):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const r=this[e];return(r?r.split(/[ ,]+/):[]).reduce((n,i)=>(n[i.toLowerCase()]=!0,n),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=gn.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let r;const n={},i='"';for(Gn.lastIndex=0;(r=Gn.exec(e))!==null;){const s=r[1].trim();let o=r[2];const c=o.indexOf(i)===0&&o.lastIndexOf(i)===o.length-1;let h=!1;if(c)o=o.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":h=!0}if(t&&(c||h))o=hn(t,o);else if(!h&&!c)switch(s){case"CLOSED-CAPTIONS":if(o==="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":ce.warn(`${e}: attribute ${s} is missing quotes`)}n[s]=o}return n}}const Bn="com.apple.hls.interstitial";function Oi(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function ns(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class _n{constructor(e,t,r=0){var n;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=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(n=t==null?void 0:t.tagOrder)!=null?n:r,t){const i=t.attr;for(const s in i)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==i[s]){ce.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=b(new ar({}),i,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const i=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);F(i.getTime())&&(this._endDate=i)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(ce.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(F(e))return e}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===Bn}get isValid(){return!!this.id&&!this._badValueForSameId&&F(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 Mi=10;class is{constructor(e){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=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&r>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(t=>{let r=t.decryptdata;return r||(t.setKeyFormat(e.keyFormat),r=t.decryptdata),!!r&&e.matches(r)})}get hasProgramDateTime(){return this.fragments.length?F(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Mi}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.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 e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let r=e.length;r--;)if(e[r].index>t)return e[r].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Rn(a,e){return a.length===e.length?!a.some((t,r)=>t!==e[r]):!1}function qn(a,e){return!a&&!e?!0:!a||!e?!1:Rn(a,e)}function Kn(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Fi(a){switch(a){case"AES-128":case"AES-256":return ln.cbc;case"AES-256-CTR":return ln.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function Wi(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function Yi(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Nn(a){const e=Yi(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Gt(a){const e=function(r,n,i){const s=r[n];r[n]=r[i],r[i]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function sr(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const r=e[1].split(";"),n=r[r.length-1].split(",");if(n.length===2){const i=n[0]==="base64",s=n[1];i?(r.splice(-1,1),t=Wi(s)):t=Nn(s)}}return t}const Or=typeof self!="undefined"?self:void 0;var fr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},vr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function si(a){switch(a){case vr.FAIRPLAY:return fr.FAIRPLAY;case vr.PLAYREADY:return fr.PLAYREADY;case vr.WIDEVINE:return fr.WIDEVINE;case vr.CLEARKEY:return fr.CLEARKEY}}function Zn(a){switch(a){case fr.FAIRPLAY:return vr.FAIRPLAY;case fr.PLAYREADY:return vr.PLAYREADY;case fr.WIDEVINE:return vr.WIDEVINE;case fr.CLEARKEY:return vr.CLEARKEY}}function ai(a){const{drmSystems:e,widevineLicenseUrl:t}=a,r=e?[fr.FAIRPLAY,fr.WIDEVINE,fr.PLAYREADY,fr.CLEARKEY].filter(n=>!!e[n]):[];return!r[fr.WIDEVINE]&&t&&r.push(fr.WIDEVINE),r}const Bi=function(a){return Or!=null&&(a=Or.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Eo(a,e,t,r){let n;switch(a){case fr.FAIRPLAY:n=["cenc","sinf"];break;case fr.WIDEVINE:case fr.PLAYREADY:n=["cenc"];break;case fr.CLEARKEY:n=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return xo(n,e,t,r)}function xo(a,e,t,r){return[{initDataTypes:a,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:e.map(i=>({contentType:`audio/mp4; codecs=${i}`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null})),videoCapabilities:t.map(i=>({contentType:`video/mp4; codecs=${i}`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null}))}]}function Aa(a){var e;return!!a&&(a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function Ti(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),r=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(s){const o=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(o){const c=Wi(o).subarray(0,16);return Gt(c),c}}return null}let oi={};class Ai{static clearKeyUriToKeyIdMap(){oi={}}static setKeyIdForUri(e,t){oi[e]=t}static addKeyIdForUri(e){const t=Object.keys(oi).length%Number.MAX_SAFE_INTEGER,r=new Uint8Array(16);return new DataView(r.buffer,12,4).setUint32(0,t),oi[e]=r,r}constructor(e,t,r,n=[1],i=null,s){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=e,this.uri=t,this.keyFormat=r,this.keyFormatVersions=n,this.iv=i,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Kn(e),s!=null&&s.startsWith("0x")&&(this.keyId=new Uint8Array(P(s)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&Rn(e.keyFormatVersions,this.keyFormatVersions)&&qn(e.iv,this.iv)&&qn(e.keyId,this.keyId)}isSupported(){if(this.method){if(Kn(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case vr.FAIRPLAY:case vr.WIDEVINE:case vr.PLAYREADY:case vr.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(Kn(this.method)){let i=this.iv;return i||(typeof e!="number"&&(ce.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),i=qs(e)),new Ai(this.method,this.uri,"identity",this.keyFormatVersions,i)}if(this.keyId){const i=oi[this.uri];if(i&&!Rn(this.keyId,i)&&Ai.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const r=sr(this.uri);if(r)switch(this.keyFormat){case vr.WIDEVINE:if(this.pssh=r,!this.keyId){const i=Oe(r.buffer);if(i.length){var n;const s=i[0];this.keyId=(n=s.kids)!=null&&n.length?s.kids[0]:null}}this.keyId||(this.keyId=Cs(t));break;case vr.PLAYREADY:{const i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=D(i,null,r),this.keyId=Ti(r);break}default:{let i=r.subarray(0,16);if(i.length!==16){const s=new Uint8Array(16);s.set(i,16-i.length),i=s}this.keyId=i;break}}if(!this.keyId||this.keyId.byteLength!==16){let i;i=Ys(t),i||(i=Cs(t),i||(i=oi[this.uri])),i&&(this.keyId=i,Ai.setKeyIdForUri(this.uri,i))}return this}}function Ys(a){const e=a==null?void 0:a[vr.WIDEVINE];return e?e.keyId:null}function Cs(a){const e=a==null?void 0:a[vr.PLAYREADY];if(e){const t=sr(e.uri);if(t)return Ti(t)}return null}function qs(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Da=/#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,Zs=/#EXT-X-MEDIA:(.*)/g,wo=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ls=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Rs=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 li{static findGroup(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n.id===t)return n}}static resolve(e,t){return w.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return wo.test(e)}static parseMasterPlaylist(e,t){const r=St(e),n={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:r},i=[];if(Da.lastIndex=0,!e.startsWith("#EXTM3U"))return n.playlistParsingError=new Error("no EXTM3U delimiter"),n;let s;for(;(s=Da.exec(e))!=null;)if(s[1]){var o;const h=new ar(s[1],n),p=hn(n,s[2]),m={attrs:h,bitrate:h.decimalInteger("BANDWIDTH")||h.decimalInteger("AVERAGE-BANDWIDTH"),name:h.NAME,url:li.resolve(p,t)},v=h.decimalResolution("RESOLUTION");v&&(m.width=v.width,m.height=v.height),Qs(h.CODECS,m);const T=h["SUPPLEMENTAL-CODECS"];T&&(m.supplemental={},Qs(T,m.supplemental)),(o=m.unknownCodecs)!=null&&o.length||i.push(m),n.levels.push(m)}else if(s[3]){const h=s[3],p=s[4];switch(h){case"SESSION-DATA":{const m=new ar(p,n),v=m["DATA-ID"];v&&(n.sessionData===null&&(n.sessionData={}),n.sessionData[v]=m);break}case"SESSION-KEY":{const m=Xs(p,t,n);m.encrypted&&m.isSupported()?(n.sessionKeys===null&&(n.sessionKeys=[]),n.sessionKeys.push(m)):ce.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${p}"`);break}case"DEFINE":{{const m=new ar(p,n);Ii(n,m,t)}break}case"CONTENT-STEERING":{const m=new ar(p,n);n.contentSteering={uri:li.resolve(m["SERVER-URI"],t),pathwayId:m["PATHWAY-ID"]||"."};break}case"START":{n.startTimeOffset=Ca(p);break}}}const c=i.length>0&&i.length<n.levels.length;return n.levels=c?i:n.levels,n.levels.length===0&&(n.playlistParsingError=new Error("no levels found in manifest")),n}static parseMasterPlaylistMedia(e,t,r){let n;const i={},s=r.levels,o={AUDIO:s.map(h=>({id:h.attrs.AUDIO,audioCodec:h.audioCodec})),SUBTITLES:s.map(h=>({id:h.attrs.SUBTITLES,textCodec:h.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(Zs.lastIndex=0;(n=Zs.exec(e))!==null;){const h=new ar(n[1],r),p=h.TYPE;if(p){const m=o[p],v=i[p]||[];i[p]=v;const T=h.LANGUAGE,A=h["ASSOC-LANGUAGE"],$=h.CHANNELS,U=h.CHARACTERISTICS,ie=h["INSTREAM-ID"],le={attrs:h,bitrate:0,id:c++,groupId:h["GROUP-ID"]||"",name:h.NAME||T||"",type:p,default:h.bool("DEFAULT"),autoselect:h.bool("AUTOSELECT"),forced:h.bool("FORCED"),lang:T,url:h.URI?li.resolve(h.URI,t):""};if(A&&(le.assocLang=A),$&&(le.channels=$),U&&(le.characteristics=U),ie&&(le.instreamId=ie),m!=null&&m.length){const fe=li.findGroup(m,le.groupId)||m[0];Js(le,fe,"audioCodec"),Js(le,fe,"textCodec")}v.push(le)}}return i}static parseLevelPlaylist(e,t,r,n,i,s){var o;const c={url:t},h=new is(t),p=h.fragments,m=[];let v=null,T=0,A=0,$=0,U=0,ie=0,le=null,fe=new Ye(n,c),Ce,Fe,tt,Ne=-1,Xe=!1,qe=null,ze;if(Ls.lastIndex=0,h.m3u8=e,h.hasVariableRefs=St(e),((o=Ls.exec(e))==null?void 0:o[0])!=="#EXTM3U")return h.playlistParsingError=new Error("Missing format identifier #EXTM3U"),h;for(;(Ce=Ls.exec(e))!==null;){Xe&&(Xe=!1,fe=new Ye(n,c),fe.playlistOffset=$,fe.setStart($),fe.sn=T,fe.cc=U,ie&&(fe.bitrate=ie),fe.level=r,v&&(fe.initSegment=v,v.rawProgramDateTime&&(fe.rawProgramDateTime=v.rawProgramDateTime,v.rawProgramDateTime=null),qe&&(fe.setByteRange(qe),qe=null)));const Jt=Ce[1];if(Jt){fe.duration=parseFloat(Jt);const Vt=(" "+Ce[2]).slice(1);fe.title=Vt||null,fe.tagList.push(Vt?["INF",Jt,Vt]:["INF",Jt])}else if(Ce[3]){if(F(fe.duration)){fe.playlistOffset=$,fe.setStart($),tt&&La(fe,tt,h),fe.sn=T,fe.level=r,fe.cc=U,p.push(fe);const Vt=(" "+Ce[3]).slice(1);fe.relurl=hn(h,Vt),ui(fe,le,m),le=fe,$+=fe.duration,T++,A=0,Xe=!0}}else{if(Ce=Ce[0].match(Rs),!Ce){ce.warn("No matches on slow regex match for level playlist!");continue}for(Fe=1;Fe<Ce.length&&Ce[Fe]===void 0;Fe++);const Vt=(" "+Ce[Fe]).slice(1),Lt=(" "+Ce[Fe+1]).slice(1),qt=Ce[Fe+2]?(" "+Ce[Fe+2]).slice(1):null;switch(Vt){case"BYTERANGE":le?fe.setByteRange(Lt,le):fe.setByteRange(Lt);break;case"PROGRAM-DATE-TIME":fe.rawProgramDateTime=Lt,fe.tagList.push(["PROGRAM-DATE-TIME",Lt]),Ne===-1&&(Ne=p.length);break;case"PLAYLIST-TYPE":h.type&&Hn(h,Vt,Ce),h.type=Lt.toUpperCase();break;case"MEDIA-SEQUENCE":h.startSN!==0?Hn(h,Vt,Ce):p.length>0&&ta(h,Vt,Ce),T=h.startSN=parseInt(Lt);break;case"SKIP":{h.skippedSegments&&Hn(h,Vt,Ce);const zt=new ar(Lt,h),Xt=zt.decimalInteger("SKIPPED-SEGMENTS");if(F(Xt)){h.skippedSegments+=Xt;for(let Ft=Xt;Ft--;)p.push(null);T+=Xt}const hr=zt.enumeratedString("RECENTLY-REMOVED-DATERANGES");hr&&(h.recentlyRemovedDateranges=(h.recentlyRemovedDateranges||[]).concat(hr.split(" ")));break}case"TARGETDURATION":h.targetduration!==0&&Hn(h,Vt,Ce),h.targetduration=Math.max(parseInt(Lt),1);break;case"VERSION":h.version!==null&&Hn(h,Vt,Ce),h.version=parseInt(Lt);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":h.live||Hn(h,Vt,Ce),h.live=!1;break;case"#":(Lt||qt)&&fe.tagList.push(qt?[Lt,qt]:[Lt]);break;case"DISCONTINUITY":U++,fe.tagList.push(["DIS"]);break;case"GAP":fe.gap=!0,fe.tagList.push([Vt]);break;case"BITRATE":fe.tagList.push([Vt,Lt]),ie=parseInt(Lt)*1e3,F(ie)?fe.bitrate=ie:ie=0;break;case"DATERANGE":{const zt=new ar(Lt,h),Xt=new _n(zt,h.dateRanges[zt.ID],h.dateRangeTagCount);h.dateRangeTagCount++,Xt.isValid||h.skippedSegments?h.dateRanges[Xt.id]=Xt:ce.warn(`Ignoring invalid DATERANGE tag: "${Lt}"`),fe.tagList.push(["EXT-X-DATERANGE",Lt]);break}case"DEFINE":{{const zt=new ar(Lt,h);"IMPORT"in zt?Pi(h,zt,s):Ii(h,zt,t)}break}case"DISCONTINUITY-SEQUENCE":h.startCC!==0?Hn(h,Vt,Ce):p.length>0&&ta(h,Vt,Ce),h.startCC=U=parseInt(Lt);break;case"KEY":{const zt=Xs(Lt,t,h);if(zt.isSupported()){if(zt.method==="NONE"){tt=void 0;break}tt||(tt={});const Xt=tt[zt.keyFormat];Xt!=null&&Xt.matches(zt)||(Xt&&(tt=b({},tt)),tt[zt.keyFormat]=zt)}else ce.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${Lt}"`);break}case"START":h.startTimeOffset=Ca(Lt);break;case"MAP":{const zt=new ar(Lt,h);if(fe.duration){const Xt=new Ye(n,c);ea(Xt,zt,r,tt),v=Xt,fe.initSegment=v,v.rawProgramDateTime&&!fe.rawProgramDateTime&&(fe.rawProgramDateTime=v.rawProgramDateTime)}else{const Xt=fe.byteRangeEndOffset;if(Xt){const hr=fe.byteRangeStartOffset;qe=`${Xt-hr}@${hr}`}else qe=null;ea(fe,zt,r,tt),v=fe,Xe=!0}v.cc=U;break}case"SERVER-CONTROL":{ze&&Hn(h,Vt,Ce),ze=new ar(Lt),h.canBlockReload=ze.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=ze.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&ze.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=ze.optionalFloat("PART-HOLD-BACK",0),h.holdBack=ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{h.partTarget&&Hn(h,Vt,Ce);const zt=new ar(Lt);h.partTarget=zt.decimalFloatingPoint("PART-TARGET");break}case"PART":{let zt=h.partList;zt||(zt=h.partList=[]);const Xt=A>0?zt[zt.length-1]:void 0,hr=A++,Ft=new ar(Lt,h),Bt=new ct(Ft,fe,c,hr,Xt);zt.push(Bt),fe.duration+=Bt.duration;break}case"PRELOAD-HINT":{const zt=new ar(Lt,h);h.preloadHint=zt;break}case"RENDITION-REPORT":{const zt=new ar(Lt,h);h.renditionReports=h.renditionReports||[],h.renditionReports.push(zt);break}default:ce.warn(`line parsed but not handled: ${Ce}`);break}}}le&&!le.relurl?(p.pop(),$-=le.duration,h.partList&&(h.fragmentHint=le)):h.partList&&(ui(fe,le,m),fe.cc=U,h.fragmentHint=fe,tt&&La(fe,tt,h)),h.targetduration||(h.playlistParsingError=new Error("Missing Target Duration"));const ft=p.length,Ut=p[0],jt=p[ft-1];if($+=h.skippedSegments*h.targetduration,$>0&&ft&&jt){h.averagetargetduration=$/ft;const Jt=jt.sn;h.endSN=Jt!=="initSegment"?Jt:0,h.live||(jt.endList=!0),Ne>0&&(To(p,Ne),Ut&&m.unshift(Ut))}return h.fragmentHint&&($+=h.fragmentHint.duration),h.totalduration=$,m.length&&h.dateRangeTagCount&&Ut&&ka(m,h),h.endCC=U,h}}function ka(a,e){let t=a.length;if(!t)if(e.hasProgramDateTime){const o=e.fragments[e.fragments.length-1];a.push(o),t++}else return;const r=a[t-1],n=e.live?1/0:e.totalduration,i=Object.keys(e.dateRanges);for(let o=i.length;o--;){const c=e.dateRanges[i[o]],h=c.startDate.getTime();c.tagAnchor=r.ref;for(let p=t;p--;){var s;if(((s=a[p])==null?void 0:s.sn)<e.startSN)break;const m=So(e,h,a,p,n);if(m!==-1){c.tagAnchor=e.fragments[m].ref;break}}}}function So(a,e,t,r,n){const i=t[r];if(i){const o=i.programDateTime;if(e>=o||r===0){var s;const c=(((s=t[r+1])==null?void 0:s.start)||n)-i.start;if(e<=o+c*1e3){const h=t[r].sn-a.startSN;if(h<0)return-1;const p=a.fragments;if(p.length>t.length){const v=(t[r+1]||p[p.length-1]).sn-a.startSN;for(let T=v;T>h;T--){const A=p[T].programDateTime;if(e>=A&&e<A+p[T].duration*1e3)return T}}return h}}}return-1}function Xs(a,e,t){var r,n;const i=new ar(a,t),s=(r=i.METHOD)!=null?r:"",o=i.URI,c=i.hexadecimalInteger("IV"),h=i.KEYFORMATVERSIONS,p=(n=i.KEYFORMAT)!=null?n:"identity";o&&i.IV&&!c&&ce.error(`Invalid IV: ${i.IV}`);const m=o?li.resolve(o,e):"",v=(h||"1").split("/").map(Number).filter(Number.isFinite);return new Ai(s,m,p,v,c,i.KEYID)}function Ca(a){const t=new ar(a).decimalFloatingPoint("TIME-OFFSET");return F(t)?t:null}function Qs(a,e){let t=(a||"").split(/[ ,]+/).filter(r=>r);["video","audio","text"].forEach(r=>{const n=t.filter(i=>xe(i,r));n.length&&(e[`${r}Codec`]=n.map(i=>i.split("/")[0]).join(","),t=t.filter(i=>n.indexOf(i)===-1))}),e.unknownCodecs=t}function Js(a,e,t){const r=e[t];r&&(a[t]=r)}function To(a,e){let t=a[e];for(let r=e;r--;){const n=a[r];if(!n)return;n.programDateTime=t.programDateTime-n.duration*1e3,t=n}}function ui(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function ea(a,e,t,r){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",r&&(a.levelkeys=r),a.initSegment=null}function La(a,e,t){a.levelkeys=e;const{encryptedFragments:r}=t;(!r.length||r[r.length-1].levelkeys!==e)&&Object.keys(e).some(n=>e[n].isCommonEncryption)&&r.push(a)}function Hn(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function ta(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function gs(a,e){const t=e.startPTS;if(F(t)){let r=0,n;e.sn>a.sn?(r=t-a.start,n=a):(r=a.start-t,n=e),n.duration!==r&&n.setDuration(r)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.setStart(a.start+(a.minEndPTS-a.start)):e.setStart(a.start+a.duration):e.setStart(Math.max(a.start-e.duration,0))}function Is(a,e,t,r,n,i,s){r-t<=0&&(s.warn("Fragment should have a positive duration",e),r=t+e.duration,i=n+e.duration);let c=t,h=r;const p=e.startPTS,m=e.endPTS;if(F(p)){const ie=Math.abs(p-t);a&&ie>a.totalduration?s.warn(`media timestamps and playlist times differ by ${ie}s for level ${e.level} ${a.url}`):F(e.deltaPTS)?e.deltaPTS=Math.max(ie,e.deltaPTS):e.deltaPTS=ie,c=Math.max(t,p),t=Math.min(t,p),n=e.startDTS!==void 0?Math.min(n,e.startDTS):n,h=Math.min(r,m),r=Math.max(r,m),i=e.endDTS!==void 0?Math.max(i,e.endDTS):i}const v=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(r-e.start),e.startPTS=t,e.maxStartPTS=c,e.startDTS=n,e.endPTS=r,e.minEndPTS=h,e.endDTS=i;const T=e.sn;if(!a||T<a.startSN||T>a.endSN)return 0;let A;const $=T-a.startSN,U=a.fragments;for(U[$]=e,A=$;A>0;A--)gs(U[A],U[A-1]);for(A=$;A<U.length-1;A++)gs(U[A],U[A+1]);return a.fragmentHint&&gs(U[U.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,v}function Ra(a,e,t){if(a===e)return;let r=null;const n=a.fragments;for(let p=n.length-1;p>=0;p--){const m=n[p].initSegment;if(m){r=m;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i;qi(a,e,(p,m,v,T)=>{if((!e.startCC||e.skippedSegments)&&m.cc!==p.cc){const A=p.cc-m.cc;for(let $=v;$<T.length;$++)T[$].cc+=A;e.endCC=T[T.length-1].cc}F(p.startPTS)&&F(p.endPTS)&&(m.setStart(m.startPTS=p.startPTS),m.startDTS=p.startDTS,m.maxStartPTS=p.maxStartPTS,m.endPTS=p.endPTS,m.endDTS=p.endDTS,m.minEndPTS=p.minEndPTS,m.setDuration(p.endPTS-p.startPTS),m.duration&&(i=m),e.PTSKnown=e.alignedSliding=!0),p.hasStreams&&(m.elementaryStreams=p.elementaryStreams),m.loader=p.loader,p.hasStats&&(m.stats=p.stats),p.initSegment&&(m.initSegment=p.initSegment,r=p.initSegment)});const s=e.fragments,o=e.fragmentHint?s.concat(e.fragmentHint):s;if(r&&o.forEach(p=>{var m;p&&(!p.initSegment||p.initSegment.relurl===((m=r)==null?void 0:m.relurl))&&(p.initSegment=r)}),e.skippedSegments){if(e.deltaUpdateFailed=s.some(p=>!p),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let p=e.skippedSegments;p--;)s.shift();e.startSN=s[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=Ni(a.dateRanges,e,t));const p=a.fragments.filter(m=>m.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let m=1;m<o.length;m++)o[m].programDateTime===null&&ui(o[m],o[m-1],p);ka(p,e)}e.endCC=s[s.length-1].cc}if(!e.startCC){var c;const p=na(a,e.startSN-1);e.startCC=(c=p==null?void 0:p.cc)!=null?c:s[0].cc}Ia(a.partList,e.partList,(p,m)=>{m.elementaryStreams=p.elementaryStreams,m.stats=p.stats}),i?Is(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS,t):Di(a,e),s.length&&(e.totalduration=e.edge-s[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const h=e.advancedDateTime;if(e.advanced&&h){const p=e.edge;e.driftStart||(e.driftStartTime=h,e.driftStart=p),e.driftEndTime=h,e.driftEnd=p}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function Ni(a,e,t){const{dateRanges:r,recentlyRemovedDateranges:n}=e,i=b({},a);n&&n.forEach(c=>{delete i[c]});const o=Object.keys(i).length;return o?(Object.keys(r).forEach(c=>{const h=i[c],p=new _n(r[c].attr,h);p.isValid?(i[c]=p,h||(p.tagOrder+=o)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${nr(r[c].attr)}"`)}),i):r}function Ia(a,e,t){if(a&&e){let r=0;for(let n=0,i=a.length;n<=i;n++){const s=a[n],o=e[n+r];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?t(s,o):r--}}}function qi(a,e,t){const r=e.skippedSegments,n=Math.max(a.startSN,e.startSN)-e.startSN,i=(a.fragmentHint?1:0)+(r?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let h=n;h<=i;h++){const p=c[s+h];let m=o[h];if(r&&!m&&p&&(m=e.fragments[h]=p),p&&m){t(p,m,h,o);const v=p.relurl,T=m.relurl;if(v&&Ma(v,T)){e.playlistParsingError=Ps(`media sequence mismatch ${m.sn}:`,a,e,p,m);return}else if(p.cc!==m.cc){e.playlistParsingError=Ps(`discontinuity sequence mismatch (${p.cc}!=${m.cc})`,a,e,p,m);return}}}}function Ps(a,e,t,r,n){return new Error(`${a} ${n.url}
Playlist starting @${e.startSN}
${e.m3u8}
Playlist starting @${t.startSN}
${t.m3u8}`)}function Di(a,e,t=!0){const r=e.startSN+e.skippedSegments-a.startSN,n=a.fragments,i=r>=0;let s=0;if(i&&r<n.length)s=n[r].start;else if(i&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(i&&t)s=a.fragmentStart+r*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;ra(e,s)}function ra(a,e){if(e){const t=a.fragments;for(let r=a.skippedSegments;r<t.length;r++)t[r].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function ki(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const r=a.fragments;if(r.length&&t*4>e){const i=r[r.length-1].duration*1e3;i<t&&(t=i)}}else t/=2;return Math.round(t)}function na(a,e,t){if(!a)return null;let r=a.fragments[e-a.startSN];return r||(r=a.fragmentHint,r&&r.sn===e)?r:e<a.startSN&&t&&t.sn===e?t:null}function Pa(a,e,t){return a?ia(a.partList,e,t):null}function ia(a,e,t){if(a)for(let r=a.length;r--;){const n=a[r];if(n.index===t&&n.fragment.sn===e)return n}return null}function Oa(a){a.forEach((e,t)=>{var r;(r=e.details)==null||r.fragments.forEach(n=>{n.level=t,n.initSegment&&(n.initSegment.level=t)})})}function Ma(a,e){return a!==e&&e?sa(a)!==sa(e):!1}function sa(a){return a.replace(/\?[^?]*$/,"")}function Zi(a,e){for(let r=0,n=a.length;r<n;r++){var t;if(((t=a[r])==null?void 0:t.cc)===e)return a[r]}return null}function Fa(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function aa(a,e){const t=a.start+e;a.startPTS=t,a.setStart(t),a.endPTS=t+a.duration}function oa(a,e){const t=e.fragments;for(let r=0,n=t.length;r<n;r++)aa(t[r],a);e.fragmentHint&&aa(e.fragmentHint,a),e.alignedSliding=!0}function Ba(a,e){a&&(Os(e,a),e.alignedSliding||ss(e,a),!e.alignedSliding&&!e.skippedSegments&&Di(a,e,!1))}function Os(a,e){if(!Fa(e,a))return;const t=Math.min(e.endCC,a.endCC),r=Zi(e.fragments,t),n=Zi(a.fragments,t);if(!r||!n)return;ce.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const i=r.start-n.start;oa(i,a)}function ss(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,r=e.fragments;if(!t.length||!r.length)return;let n,i;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(n=Zi(r,s),i=Zi(t,s)),(!n||!i)&&(n=r[Math.floor(r.length/2)],i=Zi(t,n.cc)||t[Math.floor(t.length/2)]);const o=n.programDateTime,c=i.programDateTime;if(!o||!c)return;const h=(c-o)/1e3-(i.start-n.start);oa(h,a)}function vn(a,e,t){Sn(a,e,t),a.addEventListener(e,t)}function Sn(a,e,t){a.removeEventListener(e,t)}const Na={toString:function(a){let e="";const t=a.length;for(let r=0;r<t;r++)e+=`[${a.start(r).toFixed(3)}-${a.end(r).toFixed(3)}]`;return e}},ut={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 _s extends Si{constructor(e,t,r,n,i){super(n,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=ut.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:s,fragCurrent:o,media:c,mediaBuffer:h,state:p}=this,m=c?c.currentTime:0,v=ir.bufferInfo(h||c,m,s.maxBufferHole),T=!v.len;if(this.log(`Media seeking to ${F(m)?m.toFixed(3):m}, state: ${p}, ${T?"out of":"in"} buffer`),this.state===ut.ENDED)this.resetLoadingState();else if(o){const A=s.maxFragLookUpTolerance,$=o.start-A,U=o.start+o.duration+A;if(T||U<v.start||$>v.end){const ie=m>U;(m<$||ie)&&(ie&&o.loader&&(this.log(`Cancelling fragment load for seek (sn: ${o.sn})`),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(m,1/0,this.playlistType,!0);const A=this.lastCurrentTime;if(m>A&&(this.lastCurrentTime=m),!this.loadingParts){const $=Math.max(v.end,m),U=this.shouldLoadParts(this.getLevelDetails(),$);U&&(this.log(`LL-Part loading ON after seeking to ${m.toFixed(2)} with buffer @${$.toFixed(2)}`),this.loadingParts=U)}}this.hls.hasEnoughToStart||(this.log(`Setting ${T?"startPosition":"nextLoadPosition"} to ${m} for seek without enough to start`),this.nextLoadPosition=m,T&&(this.startPosition=m)),T&&this.state===ut.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=i,this.hls=e,this.fragmentLoader=new Cn(e.config),this.keyLoader=r,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Zr(e.config)}registerListeners(){const{hls:e}=this;e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===ut.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=ut.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const r=e.end||0,n=this.config.timelineOffset||0;if(r<=n)return!1;const i=e.buffered;this.config.maxBufferHole&&i&&i.length>1&&(e=ir.bufferedInfo(i,e.start,0));const s=e.nextStart;if(s&&s>n&&s<t.edge||this.media.currentTime<e.start)return!1;const c=t.partList;if(c!=null&&c.length){const p=c[c.length-1];return ir.isBuffered(this.media,p.start+p.duration/2)}const h=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(h)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const r=this.media=this.mediaBuffer=t.media;vn(r,"seeking",this.onMediaSeeking),vn(r,"ended",this.onMediaEnded);const n=this.config;this.levels&&n.autoStartLoad&&this.state===ut.STOPPED&&this.startLoad(n.startPosition)}onMediaDetaching(e,t){const r=!!t.transferMedia,n=this.media;if(n!==null){if(n.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),Sn(n,"seeking",this.onMediaSeeking),Sn(n,"ended",this.onMediaEnded),this.keyLoader&&!r&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,r){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(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=ut.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(e,t,r){this.startFragRequested=!0,this._loadFragForPlayback(e,t,r)}_loadFragForPlayback(e,t,r){const n=i=>{const s=i.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${i.part?" part: "+i.part.index:""} of ${this.fragInfo(s,!1,i.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(i)};this._doFragLoad(e,t,r,n).then(i=>{if(!i)return;const s=this.state,o=i.frag;if(this.fragContextChanged(o)){(s===ut.FRAG_LOADING||!this.fragCurrent&&s===ut.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=ut.IDLE);return}"payload"in i&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(_.FRAG_LOADED,i)),this._handleFragmentLoadComplete(i)}).catch(i=>{this.state===ut.STOPPED||this.state===ut.ERROR||(this.warn(`Frag error: ${(i==null?void 0:i.message)||i}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this;if(r.getState(e)===$r.APPENDING){const i=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,i),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&r.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?r.removeAllFragments():r.hasParts(e.type)&&(r.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),r.getState(e)===$r.PARTIAL&&r.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,r=null){if(!(e-t))return;const n={startOffset:e,endOffset:t,type:r};this.hls.trigger(_.BUFFER_FLUSHING,n)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(r=>{const n=r==null?void 0:r.frag;if(!n||this.fragContextChanged(n)||!this.levels)throw new Error("init load aborted");return r}).then(r=>{const{hls:n}=this,{frag:i,payload:s}=r,o=i.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&Kn(o.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,Fi(o.method)).catch(h=>{throw n.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.FRAG_DECRYPT_ERROR,fatal:!1,error:h,reason:h.message,frag:i}),h}).then(h=>{const p=self.performance.now();return n.trigger(_.FRAG_DECRYPTED,{frag:i,payload:h,stats:{tstart:c,tdecrypt:p}}),r.payload=h,this.completeInitSegmentLoad(r)})}return this.completeInitSegmentLoad(r)}).catch(r=>{this.state===ut.STOPPED||this.state===ut.ERROR||(this.warn(r),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const r=e.frag.stats;this.state!==ut.STOPPED&&(this.state=ut.IDLE),e.frag.data=new Uint8Array(e.payload),r.parsing.start=r.buffering.start=self.performance.now(),r.parsing.end=r.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var r,n;const i=e.tracks;if(i&&!t.encrypted&&((r=i.audio)!=null&&r.encrypted||(n=i.video)!=null&&n.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const s=this.media,o=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${s?"attached mediaKeys: "+s.mediaKeys:"detached"})`);return this.warn(o.message),!s||s.mediaKeys?!1:(this.hls.trigger(_.ERROR,{type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_NO_KEYS,fatal:!1,error:o,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const r=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${r?Na.toString(ir.getBuffered(r)):"(detached)"})`),Ue(e)){var n;if(e.type!==pe.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(o=>!!s[o])){this.state=ut.IDLE;return}}const i=(n=this.levels)==null?void 0:n[e.level];i!=null&&i.fragmentError&&(this.log(`Resetting level fragment error count of ${i.fragmentError} on frag buffered`),i.fragmentError=0)}this.state=ut.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:n,partsLoaded:i}=e,s=!i||i.length===0||i.some(c=>!c),o=new ni(r.level,r.sn,r.stats.chunkCount+1,0,n?n.index:-1,!s);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,n){var i;this.fragCurrent=e;const s=t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;if(e.encrypted&&!((i=e.decryptdata)!=null&&i.key)){if(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=ut.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(v=>{if(!this.fragContextChanged(v.frag))return this.hls.trigger(_.KEY_LOADED,v),this.state===ut.KEY_LOADING&&(this.state=ut.IDLE),v}),this.hls.trigger(_.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(o=this.keyLoader.loadClear(e,s.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if(Ue(e)&&(!c||e.sn!==c.sn)){const v=this.shouldLoadParts(t.details,e.end);v!==this.loadingParts&&(this.log(`LL-Part loading ${v?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=v)}if(r=Math.max(e.start,r||0),this.loadingParts&&Ue(e)){const v=s.partList;if(v&&n){r>s.fragmentEnd&&s.fragmentHint&&(e=s.fragmentHint);const T=this.getNextPart(v,e,r);if(T>-1){const A=v[T];e=this.fragCurrent=A.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${A.index} (${T}/${v.length-1}) of ${this.fragInfo(e,!1,A)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=A.start+A.duration,this.state=ut.FRAG_LOADING;let $;return o?$=o.then(U=>!U||this.fragContextChanged(U.frag)?null:this.doFragPartsLoad(e,A,t,n)).catch(U=>this.handleFragLoadError(U)):$=this.doFragPartsLoad(e,A,t,n).catch(U=>this.handleFragLoadError(U)),this.hls.trigger(_.FRAG_LOADING,{frag:e,part:A,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):$}else if(!e.url||this.loadedEndOfParts(v,r))return Promise.resolve(null)}}if(Ue(e)&&this.loadingParts){var h;this.log(`LL-Part loading OFF after next part miss @${r.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(h=s.partList)==null?void 0:h.filter(v=>v.loaded).map(v=>`[${v.start}-${v.end}]`)}`),this.loadingParts=!1}else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+s.startSN+"-"+s.endSN+"]"}, target: ${parseFloat(r.toFixed(3))}`),F(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=ut.FRAG_LOADING;const p=this.config.progressive&&e.type!==pe.SUBTITLE;let m;return p&&o?m=o.then(v=>!v||this.fragContextChanged(v.frag)?null:this.fragmentLoader.load(e,n)).catch(v=>this.handleFragLoadError(v)):m=Promise.all([this.fragmentLoader.load(e,p?n:void 0),o]).then(([v])=>(!p&&n&&n(v),v)).catch(v=>this.handleFragLoadError(v)),this.hls.trigger(_.FRAG_LOADING,{frag:e,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):m}doFragPartsLoad(e,t,r,n){return new Promise((i,s)=>{var o;const c=[],h=(o=r.details)==null?void 0:o.partList,p=m=>{this.fragmentLoader.loadPart(e,m,n).then(v=>{c[m.index]=v;const T=v.part;this.hls.trigger(_.FRAG_LOADED,v);const A=Pa(r.details,e.sn,m.index+1)||ia(h,e.sn,m.index+1);if(A)p(A);else return i({frag:e,part:T,partsLoaded:c})}).catch(s)};p(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===te.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===ye.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(_.ERROR,t)}else this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:te.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==ut.PARSING){!this.fragCurrent&&this.state!==ut.STOPPED&&this.state!==ut.ERROR&&(this.state=ut.IDLE);return}const{frag:r,part:n,level:i}=t,s=self.performance.now();r.stats.parsing.end=s,n&&(n.stats.parsing.end=s);const o=this.getLevelDetails(),h=o&&r.sn>o.endSN||this.shouldLoadParts(o,r.end);h!==this.loadingParts&&(this.log(`LL-Part loading ${h?"ON":"OFF"} after parsing segment ending @${r.end.toFixed(2)}`),this.loadingParts=h),this.updateLevelTiming(r,n,i,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var r;const i=e.partList[0];if(i.fragment.type===pe.SUBTITLE)return!1;const s=i.end+(((r=e.fragmentHint)==null?void 0:r.duration)||0);if(t>=s){var n;if((this.hls.hasEnoughToStart?((n=this.media)==null?void 0:n.currentTime)||this.lastCurrentTime:this.getLoadPosition())>i.start-i.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:n,sn:i,part:s}=e;if(!(t!=null&&t[n]))return this.warn(`Levels object was unset while buffering fragment ${i} of ${this.playlistLabel()} ${n}. The current chunk will not be buffered.`),null;const o=t[n],c=o.details,h=s>-1?Pa(c,i,s):null,p=h?h.fragment:na(c,i,r);return p?(r&&r!==p&&(p.stats=r.stats),{frag:p,part:h,level:o}):null}bufferFragmentData(e,t,r,n,i){if(this.state!==ut.PARSING)return;const{data1:s,data2:o}=e;let c=s;if(o&&(c=Ct(s,o)),!c.length)return;const h=this.initPTS[t.cc],p=h?-h.baseTime/h.timescale:void 0,m={type:e.type,frag:t,part:r,chunkMeta:n,offset:p,parent:t.type,data:c};if(this.hls.trigger(_.BUFFER_APPENDING,m),e.dropped&&e.independent&&!r){if(i)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!ir.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const r=t.currentTime,n=ir.bufferInfo(t,r,0),i=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,i*.25),o=Math.max(Math.min(e.start-s,n.end-s),r+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var r;const n=this.getLoadPosition();if(!F(n))return null;const s=this.lastCurrentTime>n||(r=this.media)!=null&&r.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,n,t,s)}getFwdBufferInfoAtPos(e,t,r,n){const i=ir.bufferInfo(e,t,n);if(i.len===0&&i.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,r);if(s&&(i.nextStart<=s.end||s.gap)){const o=Math.max(Math.min(i.nextStart,s.end)-t,n);return ir.bufferInfo(e,t,o)}}return i}getMaxBufferLength(e){const{config:t}=this;let r;return e?r=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):r=t.maxBufferLength,Math.min(r,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const r=this.config,n=Math.max(Math.min(e-t,r.maxBufferLength),t),i=Math.max(e-t*3,r.maxMaxBufferLength/2,n);return i>=n?(r.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0):!1}getAppendedFrag(e,t=pe.MAIN){const r=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const r=t.fragments,n=r.length;if(!n)return null;const{config:i}=this,s=r[0].start,o=i.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const m=i.initialLiveManifestSize;if(n<m)return this.warn(`Not enough fragments to start playback (have: ${n}, need: ${m})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var h;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t);const v=this.hls.startPosition,T=this.hls.liveSyncPosition,A=c?(v!==-1&&v>=s?v:T)||c.start:e;this.log(`Setting startPosition to ${A} to match start frag at live edge. mainStart: ${v} liveSyncPosition: ${T} frag.start: ${(h=c)==null?void 0:h.start}`),this.startPosition=this.nextLoadPosition=A}}else e<=s&&(c=r[0]);if(!c){const m=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,m,t)}let p=this.filterReplacedPrimary(c,t);if(!p&&c){const m=c.sn-t.startSN;p=this.filterReplacedPrimary(r[m+1]||null,t)}return this.mapToInitFragWhenRequired(p)}isLoopLoading(e,t){const r=this.fragmentTracker.getState(e);return(r===$r.OK||r===$r.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,r,n,i){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&r.nextStart)){const o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,n,0);if(o!==null&&r.len+o.len>=i){const c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${n}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(la(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(la(this.config)&&e.type!==pe.SUBTITLE){const r=this.hls.interstitialsManager,n=r==null?void 0:r.bufferingItem;if(n){const s=n.event;if(s){if(s.appendInPlace||Math.abs(e.start-n.start)>1||n.start===0)return null}else if(e.end<=n.start&&(t==null?void 0:t.live)===!1||e.start>n.end&&n.nextEvent&&(n.nextEvent.appendInPlace||e.start-n.end>1))return null}const i=r==null?void 0:r.playerQueue;if(i)for(let s=i.length;s--;){const o=i[s].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,r){let n=-1,i=!1,s=!0;for(let o=0,c=e.length;o<c;o++){const h=e[o];if(s=s&&!h.independent,n>-1&&r<h.start)break;const p=h.loaded;p?n=-1:(i||(h.independent||s)&&h.fragment===t)&&(h.fragment!==t&&this.warn(`Need buffer at ${r} but next unloaded part starts at ${h.start}`),n=o),i=p}return n}loadedEndOfParts(e,t){let r;for(let n=e.length;n--;){if(r=e[n],!r.loaded)return!1;if(t>r.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,r=this.fragPrevious;let n=null;if(r){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${r.programDateTime}`),n=jr(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!n){const i=r.sn+1;if(i>=e.startSN&&i<=e.endSN){const s=t[i-e.startSN];r.cc===s.cc&&(n=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${n.sn}`))}n||(n=vi(e,r.cc,r.end),n&&this.log(`Live playlist, switching playlist, load frag with same CC: ${n.sn}`))}}else{const i=this.hls.liveSyncPosition;i!==null&&(n=this.getFragmentAtPosition(i,this.bitrateTest?e.fragmentEnd:e.edge,e))}return n}getFragmentAtPosition(e,t,r){const{config:n}=this;let{fragPrevious:i}=this,{fragments:s,endSN:o}=r;const{fragmentHint:c}=r,{maxFragLookUpTolerance:h}=n,p=r.partList,m=!!(this.loadingParts&&p!=null&&p.length&&c);m&&!this.bitrateTest&&p[p.length-1].fragment.sn===c.sn&&(s=s.concat(c),o=c.sn);let v;if(e<t){var T;const $=e<this.lastCurrentTime||e>t-h||(T=this.media)!=null&&T.paused||!this.startFragRequested?0:h;v=on(i,s,e,$)}else v=s[s.length-1];if(v){const A=v.sn-r.startSN,$=this.fragmentTracker.getState(v);if(($===$r.OK||$===$r.PARTIAL&&v.gap)&&(i=v),i&&v.sn===i.sn&&(!m||p[0].fragment.sn>v.sn||!r.live)&&v.level===i.level){const ie=s[A+1];v.sn<o&&this.fragmentTracker.getState(ie)!==$r.OK?v=ie:v=null}}return v}alignPlaylists(e,t,r){const n=e.fragments.length;if(!n)return this.warn("No fragments in live playlist"),0;const i=e.fragmentStart,s=!t,o=e.alignedSliding&&F(i);if(s||!o&&!i){Ba(r,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${n}`),c}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let r=this.startPosition;r<t&&(r=-1);const n=this.timelineOffset;if(r===-1){const i=this.startTimeOffset!==null,s=i?this.startTimeOffset:e.startTimeOffset;s!==null&&F(s)?(r=t+s,s<0&&(r+=e.edge),r=Math.min(Math.max(t,r),t+e.totalduration),this.log(`Setting startPosition to ${r} for start time offset ${s} found in ${i?"multivariant":"media"} playlist`),this.startPosition=r):e.live?(r=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${r}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=r=0),this.lastCurrentTime=r+n}this.nextLoadPosition=r+n}getLoadPosition(){var e;const{media:t}=this;let r=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?r=t.currentTime:this.nextLoadPosition>=0&&(r=this.nextLoadPosition),r}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&Ue(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==ut.FRAG_LOADING_WAITING_RETRY)&&(this.state=ut.IDLE)}onFragmentOrKeyLoadError(e,t){var r;if(t.chunkMeta&&!t.frag){const ie=this.getCurrentContext(t.chunkMeta);ie&&(t.frag=ie.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const s=t.details===te.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(n,!0);const o=t.errorAction;if(!o){this.state=ut.ERROR;return}const{action:c,flags:h,retryCount:p=0,retryConfig:m}=o,v=!!m,T=v&&c===ur.RetryRequest,A=v&&!o.resolved&&h===Pr.MoveAllAlternatesMatchingHost,$=(r=this.hls.latestLevelDetails)==null?void 0:r.live;if(!T&&A&&Ue(n)&&!n.endList&&$&&!Qe(t))this.resetFragmentErrors(e),this.treatAsGap(n),o.resolved=!0;else if((T||A)&&p<m.maxNumRetry){var U;const ie=wn((U=t.response)==null?void 0:U.code),le=Vr(m,p);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+le,this.state=ut.FRAG_LOADING_WAITING_RETRY,o.resolved=!0,ie){this.log("Waiting for connection (offline)"),this.retryDate=1/0,t.reason="offline";return}this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${p+1}/${m.maxNumRetry} in ${le}ms`)}else if(m)if(this.resetFragmentErrors(e),p<m.maxNumRetry)!s&&c!==ur.RemoveAlternatePermanently&&(o.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${p})`);return}else c===ur.SendAlternateToPenaltyBox?this.state=ut.WAITING_LEVEL:this.state=ut.ERROR;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,r=t===1/0;(!t||e>=t||r&&!wn(0))&&(r&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=ut.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===ut.PARSING||this.state===ut.PARSED){const t=e.frag,r=e.parent,n=this.getFwdBufferInfo(this.mediaBuffer,r),i=n&&n.len>.5;i&&this.reduceMaxBufferLength(n.len,(t==null?void 0:t.duration)||10);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${r} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===pe.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==ut.STOPPED&&(this.state=ut.IDLE)}afterBufferFlushed(e,t,r){if(!e)return;const n=ir.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,n,r),this.state===ut.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==ut.STOPPED&&(this.state=ut.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,r,n){const i=r.details;if(!i){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,h)=>{const p=e.elementaryStreams[h];if(p){const m=p.endPTS-p.startPTS;if(m<=0)return this.warn(`Could not parse fragment ${e.sn} ${h} duration reliably (${m})`),c||!1;const v=n?0:Is(i,e,p.startPTS,p.endPTS,p.startDTS,p.endDTS,this);return this.hls.trigger(_.LEVEL_PTS_UPDATED,{details:i,level:r,drift:v,type:h,frag:e,start:p.startPTS,end:p.endPTS}),!0}return c},!1)){var o;const c=((o=this.transmuxer)==null?void 0:o.error)===null;if((r.fragmentError===0||c&&(r.fragmentError<2||e.endList))&&this.treatAsGap(e,r),c){const h=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(h.message),this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,fatal:!1,error:h,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=ut.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(_.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===pe.MAIN?"level":"track"}fragInfo(e,t=!0,r){var n,i;return`${this.playlistLabel()} ${e.level} (${r?"part":"frag"}:[${((n=t&&!r?e.startPTS:(r||e).start)!=null?n:NaN).toFixed(3)}-${((i=t&&!r?e.endPTS:(r||e).end)!=null?i:NaN).toFixed(3)}]${r&&e.type==="main"?"INDEPENDENT="+(r.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function la(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class ua{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let r;if(e.length)e.length===1?r=e[0]:r=Ua(e,t);else return new Uint8Array(0);return this.reset(),r}reset(){this.chunks.length=0,this.dataLength=0}}function Ua(a,e){const t=new Uint8Array(e);let r=0;for(let n=0;n<a.length;n++){const i=a[n];t.set(i,r),r+=i.length}return t}var Ui={exports:{}},as;function Ao(){return as||(as=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function n(c,h,p){this.fn=c,this.context=h,this.once=p||!1}function i(c,h,p,m,v){if(typeof p!="function")throw new TypeError("The listener must be a function");var T=new n(p,m||c,v),A=t?t+h:h;return c._events[A]?c._events[A].fn?c._events[A]=[c._events[A],T]:c._events[A].push(T):(c._events[A]=T,c._eventsCount++),c}function s(c,h){--c._eventsCount===0?c._events=new r:delete c._events[h]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],p,m;if(this._eventsCount===0)return h;for(m in p=this._events)e.call(p,m)&&h.push(t?m.slice(1):m);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},o.prototype.listeners=function(h){var p=t?t+h:h,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var v=0,T=m.length,A=new Array(T);v<T;v++)A[v]=m[v].fn;return A},o.prototype.listenerCount=function(h){var p=t?t+h:h,m=this._events[p];return m?m.fn?1:m.length:0},o.prototype.emit=function(h,p,m,v,T,A){var $=t?t+h:h;if(!this._events[$])return!1;var U=this._events[$],ie=arguments.length,le,fe;if(U.fn){switch(U.once&&this.removeListener(h,U.fn,void 0,!0),ie){case 1:return U.fn.call(U.context),!0;case 2:return U.fn.call(U.context,p),!0;case 3:return U.fn.call(U.context,p,m),!0;case 4:return U.fn.call(U.context,p,m,v),!0;case 5:return U.fn.call(U.context,p,m,v,T),!0;case 6:return U.fn.call(U.context,p,m,v,T,A),!0}for(fe=1,le=new Array(ie-1);fe<ie;fe++)le[fe-1]=arguments[fe];U.fn.apply(U.context,le)}else{var Ce=U.length,Fe;for(fe=0;fe<Ce;fe++)switch(U[fe].once&&this.removeListener(h,U[fe].fn,void 0,!0),ie){case 1:U[fe].fn.call(U[fe].context);break;case 2:U[fe].fn.call(U[fe].context,p);break;case 3:U[fe].fn.call(U[fe].context,p,m);break;case 4:U[fe].fn.call(U[fe].context,p,m,v);break;default:if(!le)for(Fe=1,le=new Array(ie-1);Fe<ie;Fe++)le[Fe-1]=arguments[Fe];U[fe].fn.apply(U[fe].context,le)}}return!0},o.prototype.on=function(h,p,m){return i(this,h,p,m,!1)},o.prototype.once=function(h,p,m){return i(this,h,p,m,!0)},o.prototype.removeListener=function(h,p,m,v){var T=t?t+h:h;if(!this._events[T])return this;if(!p)return s(this,T),this;var A=this._events[T];if(A.fn)A.fn===p&&(!v||A.once)&&(!m||A.context===m)&&s(this,T);else{for(var $=0,U=[],ie=A.length;$<ie;$++)(A[$].fn!==p||v&&!A[$].once||m&&A[$].context!==m)&&U.push(A[$]);U.length?this._events[T]=U.length===1?U[0]:U:s(this,T)}return this},o.prototype.removeAllListeners=function(h){var p;return h?(p=t?t+h:h,this._events[p]&&s(this,p)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,a.exports=o}(Ui)),Ui.exports}var Do=Ao(),Ms=j(Do);const vs="1.6.15",Xi={};function $a(){return typeof __HLS_WORKER_BUNDLE__=="function"}function ko(){const a=Xi[vs];if(a)return a.clientCount++,a;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),n={worker:new self.Worker(t),objectURL:t,clientCount:1};return Xi[vs]=n,n}function za(a){const e=Xi[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,n={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Xi[a]=n,n}function Co(a){const e=Xi[a||vs];if(e&&e.clientCount--===1){const{worker:r,objectURL:n}=e;delete Xi[a||vs],n&&self.URL.revokeObjectURL(n),r.terminate()}}function ha(a,e){return e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function ys(a,e){return e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function os(a,e){let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t}function ls(a,e){const t=e;let r=0;for(;ys(a,e);){r+=10;const n=os(a,e+6);r+=n,ha(a,e+10)&&(r+=10),e+=r}if(r>0)return a.subarray(t,t+r)}function Ga(a,e,t,r){const n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=e[t+2],s=i>>2&15;if(s>12){const T=new Error(`invalid ADTS sampling index:${s}`);a.emit(_.ERROR,_.ERROR,{type:ye.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,fatal:!0,error:T,reason:T.message});return}const o=(i>>6&3)+1,c=e[t+3]>>6&3|(i&1)<<2,h="mp4a.40."+o,p=n[s];let m=s;(o===5||o===29)&&(m-=3);const v=[o<<3|(m&14)>>1,(m&1)<<7|c<<3];return ce.log(`manifest codec:${r}, parsed codec:${h}, channels:${c}, rate:${p} (ADTS object type:${o} sampling index:${s})`),{config:v,samplerate:p,channelCount:c,codec:h,parsedCodec:h,manifestCodec:r}}function ca(a,e){return a[e]===255&&(a[e+1]&246)===240}function Ka(a,e){return a[e+1]&1?7:9}function Fs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function Ha(a,e){return e+5<a.length}function Bs(a,e){return e+1<a.length&&ca(a,e)}function bs(a,e){return Ha(a,e)&&ca(a,e)&&Fs(a,e)<=a.length-e}function fa(a,e){if(Bs(a,e)){const t=Ka(a,e);if(e+t>=a.length)return!1;const r=Fs(a,e);if(r<=t)return!1;const n=e+r;return n===a.length||Bs(a,n)}return!1}function da(a,e,t,r,n){if(!a.samplerate){const i=Ga(e,t,r,n);if(!i)return;b(a,i)}}function ja(a){return 1024*9e4/a}function Lo(a,e){const t=Ka(a,e);if(e+t<=a.length){const r=Fs(a,e)-t;if(r>0)return{headerLength:t,frameLength:r}}}function Va(a,e,t,r,n){const i=ja(a.samplerate),s=r+n*i,o=Lo(e,t);let c;if(o){const{frameLength:m,headerLength:v}=o,T=v+m,A=Math.max(0,t+T-e.length);A?(c=new Uint8Array(T-v),c.set(e.subarray(t+v,e.length),0)):c=e.subarray(t+v,t+T);const $={unit:c,pts:s};return A||a.samples.push($),{sample:$,length:T,missing:A}}const h=e.length-t;return c=new Uint8Array(h),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:h,missing:-1}}function pa(a,e){return ys(a,e)&&os(a,e+6)+10<=a.length-e}function Ro(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function ma(a,e=0,t=1/0){return Wa(a,e,t,Uint8Array)}function Wa(a,e,t,r){const n=Io(a);let i=1;"BYTES_PER_ELEMENT"in r&&(i=r.BYTES_PER_ELEMENT);const s=Ya(a)?a.byteOffset:0,o=(s+a.byteLength)/i,c=(s+e)/i,h=Math.floor(Math.max(0,Math.min(c,o))),p=Math.floor(Math.min(h+Math.max(t,0),o));return new r(n,h,p-h)}function Io(a){return a instanceof ArrayBuffer?a:a.buffer}function Ya(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function Po(a){const e={key:a.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(a.size<2)return;if(a.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const r=a.data.subarray(1).indexOf(0);if(r===-1)return;const n=We(ma(a.data,1,r)),i=a.data[2+r],s=a.data.subarray(3+r).indexOf(0);if(s===-1)return;const o=We(ma(a.data,3+r,s));let c;return n==="-->"?c=We(ma(a.data,4+r+s)):c=Ro(a.data.subarray(4+r+s)),e.mimeType=n,e.pictureType=i,e.description=o,e.data=c,e}function ue(a){if(a.size<2)return;const e=We(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function qa(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const r=We(a.data.subarray(t),!0);t+=r.length+1;const n=We(a.data.subarray(t));return{key:a.type,info:r,data:n}}const e=We(a.data.subarray(1));return{key:a.type,info:"",data:e}}function ga(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const r=We(a.data.subarray(t),!0);t+=r.length+1;const n=We(a.data.subarray(t));return{key:a.type,info:r,data:n}}const e=We(a.data);return{key:a.type,info:"",data:e}}function _a(a){return a.type==="PRIV"?ue(a):a.type[0]==="W"?ga(a):a.type==="APIC"?Po(a):qa(a)}function Za(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=os(a,4),r=10;return{type:e,size:t,data:a.subarray(r,r+t)}}const us=10,Xa=10;function va(a){let e=0;const t=[];for(;ys(a,e);){const r=os(a,e+6);a[e+5]>>6&1&&(e+=us),e+=us;const n=e+r;for(;e+Xa<n;){const i=Za(a.subarray(e)),s=_a(i);s&&t.push(s),e+=i.size+us}ha(a,e)&&(e+=us)}return t}function Qa(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function Ja(a){if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,t&&(r+=4772185884e-2),Math.round(r)}}function Ns(a){const e=va(a);for(let t=0;t<e.length;t++){const r=e[t];if(Qa(r))return Ja(r)}}let yn=function(a){return a.audioId3="org.id3",a.dateRange="com.apple.quicktime.HLS",a.emsg="https://aomedia.org/emsg/ID3",a.misbklv="urn:misb:KLV:bin:1910.1",a}({});function hi(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Es{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(e,t,r,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,r){}demux(e,t){this.cachedData&&(e=Ct(this.cachedData,e),this.cachedData=null);let r=ls(e,0),n=r?r.length:0,i;const s=this._audioTrack,o=this._id3Track,c=r?Ns(r):void 0,h=e.length;for((this.basePTS===null||this.frameIndex===0&&F(c))&&(this.basePTS=eo(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),r&&r.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:yn.audioId3,duration:Number.POSITIVE_INFINITY});n<h;){if(this.canParse(e,n)){const p=this.appendFrame(s,e,n);p?(this.frameIndex++,this.lastPTS=p.sample.pts,n+=p.length,i=n):n=h}else pa(e,n)?(r=ls(e,n),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:yn.audioId3,duration:Number.POSITIVE_INFINITY}),n+=r.length,i=n):n++;if(n===h&&i!==h){const p=e.slice(i);this.cachedData?this.cachedData=Ct(this.cachedData,p):this.cachedData=p}}return{audioTrack:s,videoTrack:hi(),id3Track:o,textTrack:hi()}}demuxSampleAes(e,t,r){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:hi(),id3Track:this._id3Track,textTrack:hi()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const eo=(a,e,t)=>{if(F(a))return a*90;const r=t?t.baseTime*9e4/t.timescale:0;return e*9e4+r};let Us=null;const Oo=[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],to=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],ya=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Mo=[0,1,1,4];function ro(a,e,t,r,n){if(t+24>e.length)return;const i=Fo(e,t);if(i&&t+i.frameLength<=e.length){const s=i.samplesPerFrame*9e4/i.sampleRate,o=r+n*s,c={unit:e.subarray(t,t+i.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=i.channelCount,a.samplerate=i.sampleRate,a.samples.push(c),{sample:c,length:i.frameLength,missing:0}}}function Fo(a,e){const t=a[e+1]>>3&3,r=a[e+1]>>1&3,n=a[e+2]>>4&15,i=a[e+2]>>2&3;if(t!==1&&n!==0&&n!==15&&i!==3){const s=a[e+2]>>1&1,o=a[e+3]>>6,c=t===3?3-r:r===3?3:4,h=Oo[c*14+n-1]*1e3,m=to[(t===3?0:t===2?1:2)*3+i],v=o===3?1:2,T=ya[t][r],A=Mo[r],$=T*8*A,U=Math.floor(T*h/m+s)*A;if(Us===null){const fe=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Us=fe?parseInt(fe[1]):0}return!!Us&&Us<=87&&r===2&&h>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:m,channelCount:v,frameLength:U,samplesPerFrame:$}}}function R(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function l(a,e){return e+1<a.length&&R(a,e)}function f(a,e){return R(a,e)&&4<=a.length-e}function d(a,e){if(e+1<a.length&&R(a,e)){const r=Fo(a,e);let n=4;r!=null&&r.frameLength&&(n=r.frameLength);const i=e+n;return i===a.length||l(a,i)}return!1}class g extends Es{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const r=ls(e,0);let n=(r==null?void 0:r.length)||0;if(d(e,n))return!1;for(let i=e.length;n<i;n++)if(fa(e,n))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return bs(e,t)}appendFrame(e,t,r){da(e,this.observer,t,r,e.manifestCodec);const n=Va(e,t,r,this.basePTS,this.frameIndex);if(n&&n.missing===0)return n}}const x=(a,e)=>{let t=0,r=5;e+=r;const n=new Uint32Array(1),i=new Uint32Array(1),s=new Uint8Array(1);for(;r>0;){s[0]=a[e];const o=Math.min(r,8),c=8-o;i[0]=4278190080>>>24+c<<c,n[0]=(s[0]&i[0])>>c,t=t?t<<o|n[0]:n[0],e+=1,r-=o}return t};class L extends Es{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,r){const n=W(e,t,r,this.basePTS,this.frameIndex);if(n!==-1)return{sample:e.samples[e.samples.length-1],length:n,missing:0}}static probe(e){if(!e)return!1;const t=ls(e,0);if(!t)return!1;const r=t.length;return e[r]===11&&e[r+1]===119&&Ns(t)!==void 0&&x(e,r)<16}}function W(a,e,t,r,n){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const i=e[t+4]>>6;if(i>=3)return-1;const o=[48e3,44100,32e3][i],c=e[t+4]&63,p=[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][c*3+i]*2;if(t+p>e.length)return-1;const m=e[t+6]>>5;let v=0;m===2?v+=2:(m&1&&m!==1&&(v+=2),m&4&&(v+=2));const T=(e[t+6]<<8|e[t+7])>>12-v&1,$=[2,1,2,3,3,4,4,5][m]+T,U=e[t+5]>>3,ie=e[t+5]&7,le=new Uint8Array([i<<6|U<<1|ie>>2,(ie&3)<<6|m<<3|T<<2|c>>4,c<<4&224]),fe=1536/o*9e4,Ce=r+n*fe,Fe=e.subarray(t,t+p);return a.config=le,a.channelCount=$,a.samplerate=o,a.samples.push({unit:Fe,pts:Ce}),p}class ne extends Es{resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=ls(e,0);let r=(t==null?void 0:t.length)||0;if(t&&e[r]===11&&e[r+1]===119&&Ns(t)!==void 0&&x(e,r)<=16)return!1;for(let n=e.length;r<n;r++)if(d(e,r))return ce.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return f(e,t)}appendFrame(e,t,r){if(this.basePTS!==null)return ro(e,t,r,this.basePTS,this.frameIndex)}}const ge=/\/emsg[-/]ID3/i;class Le{constructor(e,t){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=t}resetTimeStamp(){}resetInitSegment(e,t,r,n){const i=this.videoTrack=hi("video",1),s=this.audioTrack=hi("audio",1),o=this.txtTrack=hi("text",1);if(this.id3Track=hi("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=Je(e);if(c.video){const{id:h,timescale:p,codec:m,supplemental:v}=c.video;i.id=h,i.timescale=o.timescale=p,i.codec=m,i.supplemental=v}if(c.audio){const{id:h,timescale:p,codec:m}=c.audio;s.id=h,s.timescale=p,s.codec=m}o.id=Qt.text,i.sampleDuration=0,i.duration=s.duration=n}resetContiguity(){this.remainderData=null}static probe(e){return $e(e)}demux(e,t){this.timeOffset=t;let r=e;const n=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Ct(this.remainderData,e));const o=$t(r);this.remainderData=o.remainder,n.samples=o.valid||new Uint8Array}else n.samples=r;const s=this.extractID3Track(n,t);return i.samples=wt(t,n),{videoTrack:n,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const n=this.extractID3Track(t,this.timeOffset);return r.samples=wt(e,t),{videoTrack:t,audioTrack:hi(),id3Track:n,textTrack:hi()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const n=Ee(e.samples,["emsg"]);n&&n.forEach(i=>{const s=Rt(i);if(ge.test(s.schemeIdUri)){const o=Ke(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const h=s.payload;r.samples.push({data:h,len:h.byteLength,dts:o,pts:o,type:yn.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=Ke(s,t);r.samples.push({data:s.payload,len:s.payload.byteLength,dts:o,pts:o,type:yn.misbklv,duration:Number.POSITIVE_INFINITY})}})}return r}demuxSampleAes(e,t,r){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 Ke(a,e){return F(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class rt{constructor(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new Zr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,ln.cbc)}decryptAacSample(e,t,r){const n=e[t].unit;if(n.length<=16)return;const i=n.subarray(16,n.length-n.length%16),s=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(s).then(o=>{const c=new Uint8Array(o);n.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)}).catch(r)}decryptAacSamples(e,t,r){for(;;t++){if(t>=e.length){r();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,r),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,r=new Int8Array(t);let n=0;for(let i=32;i<e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r}getAvcDecryptedUnit(e,t){const r=new Uint8Array(t);let n=0;for(let i=32;i<e.length-16;i+=160,n+=16)e.set(r.subarray(n,n+16),i);return e}decryptAvcSample(e,t,r,n,i){const s=st(i.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then(c=>{i.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,n)}).catch(n)}decryptAvcSamples(e,t,r,n){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length){n();return}const i=e[t].units;for(;!(r>=i.length);r++){const s=i[r];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,r,n,s),!this.decrypter.isSync()))return}}}}class dt{constructor(){this.VideoSample=null}createVideoSample(e,t,r){return{key:e,frame:!1,pts:t,dts:r,units:[],length:0}}getLastNalUnit(e){var t;let r=this.VideoSample,n;if((!r||r.units.length===0)&&(r=e[e.length-1]),(t=r)!=null&&t.units){const i=r.units;n=i[i.length-1]}return n}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const r=t.samples,n=r.length;if(n){const i=r[n-1];e.pts=i.pts,e.dts=i.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,r){const n=t.byteLength;let i=e.naluState||0;const s=i,o=[];let c=0,h,p,m,v=-1,T=0;for(i===-1&&(v=0,T=this.getNALuType(t,0),i=0,c=1);c<n;){if(h=t[c++],!i){i=h?0:1;continue}if(i===1){i=h?0:2;continue}if(!h)i=3;else if(h===1){if(p=c-i-1,v>=0){const A={data:t.subarray(v,p),type:T};o.push(A)}else{const A=this.getLastNalUnit(e.samples);A&&(s&&c<=4-s&&A.state&&(A.data=A.data.subarray(0,A.data.byteLength-s)),p>0&&(A.data=Ct(A.data,t.subarray(0,p)),A.state=0))}c<n?(m=this.getNALuType(t,c),v=c,T=m,i=0):i=-1}else i=0}if(v>=0&&i>=0){const A={data:t.subarray(v,n),type:T,state:i};o.push(A)}if(o.length===0){const A=this.getLastNalUnit(e.samples);A&&(A.data=Ct(A.data,t))}return e.naluState=i,o}}class Et{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,r=e.byteLength-t,n=new Uint8Array(4),i=Math.min(4,t);if(i===0)throw new Error("no bytes available");n.set(e.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=i*8,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const r=this.word>>>32-t;if(e>32&&ce.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?r<<t|this.readBits(t):r}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Mt extends dt{parsePES(e,t,r,n){const i=this.parseNALu(e,r.data,n);let s=this.VideoSample,o,c=!1;r.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),i.forEach(h=>{var p,m;switch(h.type){case 1:{let $=!1;o=!0;const U=h.data;if(c&&U.length>4){const ie=this.readSliceType(U);(ie===2||ie===4||ie===7||ie===9)&&($=!0)}if($){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.frame=!0,s.key=$;break}case 5:o=!0,(p=s)!=null&&p.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0,s.frame=!0;break;case 6:{o=!0,gt(h.data,1,r.pts,t.samples);break}case 7:{var T,A;o=!0,c=!0;const $=h.data,U=this.readSPS($);if(!e.sps||e.width!==U.width||e.height!==U.height||((T=e.pixelRatio)==null?void 0:T[0])!==U.pixelRatio[0]||((A=e.pixelRatio)==null?void 0:A[1])!==U.pixelRatio[1]){e.width=U.width,e.height=U.height,e.pixelRatio=U.pixelRatio,e.sps=[$];const ie=$.subarray(1,4);let le="avc1.";for(let fe=0;fe<3;fe++){let Ce=ie[fe].toString(16);Ce.length<2&&(Ce="0"+Ce),le+=Ce}e.codec=le}break}case 8:o=!0,e.pps=[h.data];break;case 9:o=!0,e.audFound=!0,(m=s)!=null&&m.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;case 12:o=!0;break;default:o=!1;break}s&&o&&s.units.push(h)}),n&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new Et(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let r=8,n=8,i;for(let s=0;s<e;s++)n!==0&&(i=t.readEG(),n=(r+i+256)%256),r=n===0?r:n}readSPS(e){const t=new Et(e);let r=0,n=0,i=0,s=0,o,c,h;const p=t.readUByte.bind(t),m=t.readBits.bind(t),v=t.readUEG.bind(t),T=t.readBoolean.bind(t),A=t.skipBits.bind(t),$=t.skipEG.bind(t),U=t.skipUEG.bind(t),ie=this.skipScalingList.bind(this);p();const le=p();if(m(5),A(3),p(),U(),le===100||le===110||le===122||le===244||le===44||le===83||le===86||le===118||le===128){const Xe=v();if(Xe===3&&A(1),U(),U(),A(1),T())for(c=Xe!==3?8:12,h=0;h<c;h++)T()&&(h<6?ie(16,t):ie(64,t))}U();const fe=v();if(fe===0)v();else if(fe===1)for(A(1),$(),$(),o=v(),h=0;h<o;h++)$();U(),A(1);const Ce=v(),Fe=v(),tt=m(1);tt===0&&A(1),A(1),T()&&(r=v(),n=v(),i=v(),s=v());let Ne=[1,1];if(T()&&T())switch(p()){case 1:Ne=[1,1];break;case 2:Ne=[12,11];break;case 3:Ne=[10,11];break;case 4:Ne=[16,11];break;case 5:Ne=[40,33];break;case 6:Ne=[24,11];break;case 7:Ne=[20,11];break;case 8:Ne=[32,11];break;case 9:Ne=[80,33];break;case 10:Ne=[18,11];break;case 11:Ne=[15,11];break;case 12:Ne=[64,33];break;case 13:Ne=[160,99];break;case 14:Ne=[4,3];break;case 15:Ne=[3,2];break;case 16:Ne=[2,1];break;case 255:{Ne=[p()<<8|p(),p()<<8|p()];break}}return{width:Math.ceil((Ce+1)*16-r*2-n*2),height:(2-tt)*(Fe+1)*16-(tt?2:4)*(i+s),pixelRatio:Ne}}}class Yt extends dt{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,r,n){const i=this.parseNALu(e,r.data,n);let s=this.VideoSample,o,c=!1;r.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),i.forEach(h=>{var p,m;switch(h.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),s.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,c){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:o=!0,(p=s)!=null&&p.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0,s.frame=!0;break;case 39:o=!0,gt(h.data,2,r.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=b(e.params,this.readVPS(h.data)),this.initVPS=h.data),e.vps=[h.data];break;case 33:if(o=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],h.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const T=this.readSPS(h.data);e.width=T.width,e.height=T.height,e.pixelRatio=T.pixelRatio,e.codec=T.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const A in T.params)e.params[A]=T.params[A]}this.pushParameterSet(e.sps,h.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const T=this.readPPS(h.data);for(const A in T)e.params[A]=T[A]}this.pushParameterSet(e.pps,h.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(m=s)!=null&&m.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;default:o=!1;break}s&&o&&s.units.push(h)}),n&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,r){(r&&r[0]===this.initVPS||!r&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let r=0;for(let n=0;n<e.byteLength;n++)n>=2&&e[n]===3&&e[n-1]===0&&e[n-2]===0||(t[r]=e[n],r++);return new Uint8Array(t.buffer,0,r)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Et(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const r=t.readBits(3),n=t.readBoolean();return{numTemporalLayers:r+1,temporalIdNested:n}}readSPS(e){const t=new Et(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const r=t.readBits(3);t.readBoolean();const n=t.readBits(2),i=t.readBoolean(),s=t.readBits(5),o=t.readUByte(),c=t.readUByte(),h=t.readUByte(),p=t.readUByte(),m=t.readUByte(),v=t.readUByte(),T=t.readUByte(),A=t.readUByte(),$=t.readUByte(),U=t.readUByte(),ie=t.readUByte(),le=[],fe=[];for(let Lr=0;Lr<r;Lr++)le.push(t.readBoolean()),fe.push(t.readBoolean());if(r>0)for(let Lr=r;Lr<8;Lr++)t.readBits(2);for(let Lr=0;Lr<r;Lr++)le[Lr]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),fe[Lr]&&t.readUByte();t.readUEG();const Ce=t.readUEG();Ce==3&&t.skipBits(1);const Fe=t.readUEG(),tt=t.readUEG(),Ne=t.readBoolean();let Xe=0,qe=0,ze=0,ft=0;Ne&&(Xe+=t.readUEG(),qe+=t.readUEG(),ze+=t.readUEG(),ft+=t.readUEG());const Ut=t.readUEG(),jt=t.readUEG(),Jt=t.readUEG(),Vt=t.readBoolean();for(let Lr=Vt?0:r;Lr<=r;Lr++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let Pn=0;Pn<4;Pn++)for(let pi=0;pi<(Pn===3?2:6);pi++)if(!t.readBoolean())t.readUEG();else{const Ri=Math.min(64,1<<4+(Pn<<1));Pn>1&&t.readEG();for(let Ws=0;Ws<Ri;Ws++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const zt=t.readUEG();let Xt=0;for(let Lr=0;Lr<zt;Lr++){let Pn=!1;if(Lr!==0&&(Pn=t.readBoolean()),Pn){Lr===zt&&t.readUEG(),t.readBoolean(),t.readUEG();let pi=0;for(let Ds=0;Ds<=Xt;Ds++){const Ri=t.readBoolean();let Ws=!1;Ri||(Ws=t.readBoolean()),(Ri||Ws)&&pi++}Xt=pi}else{const pi=t.readUEG(),Ds=t.readUEG();Xt=pi+Ds;for(let Ri=0;Ri<pi;Ri++)t.readUEG(),t.readBoolean();for(let Ri=0;Ri<Ds;Ri++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const Lr=t.readUEG();for(let Pn=0;Pn<Lr;Pn++){for(let pi=0;pi<Jt+4;pi++)t.readBits(1);t.readBits(1)}}let Ft=0,Bt=1,xr=1,Br=!0,Sr=1,Ar=0;t.readBoolean(),t.readBoolean();let In=!1;if(t.readBoolean()){if(t.readBoolean()){const ks=t.readUByte(),mu=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],bo=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];ks>0&&ks<16?(Bt=mu[ks-1],xr=bo[ks-1]):ks===255&&(Bt=t.readBits(16),xr=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),In=t.readBoolean(),In&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(Sr=t.readBits(32),Ar=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const bo=t.readBoolean(),gu=t.readBoolean();let Sa=!1;(bo||gu)&&(Sa=t.readBoolean(),Sa&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Sa&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let _u=0;_u<=r;_u++){Br=t.readBoolean();const Hh=Br||t.readBoolean();let vu=!1;Hh?t.readEG():vu=t.readBoolean();const yu=vu?1:t.readUEG()+1;if(bo)for(let Ta=0;Ta<yu;Ta++)t.readUEG(),t.readUEG(),Sa&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(gu)for(let Ta=0;Ta<yu;Ta++)t.readUEG(),t.readUEG(),Sa&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),Ft=t.readUEG())}let di=Fe,Hi=tt;if(Ne){let Lr=1,Pn=1;Ce===1?Lr=Pn=2:Ce==2&&(Lr=2),di=Fe-Lr*qe-Lr*Xe,Hi=tt-Pn*ft-Pn*ze}const As=n?["A","B","C"][n]:"",Kh=o<<24|c<<16|h<<8|p;let fl=0;for(let Lr=0;Lr<32;Lr++)fl=(fl|(Kh>>Lr&1)<<31-Lr)>>>0;let dl=fl.toString(16);return s===1&&dl==="2"&&(dl="6"),{codecString:`hvc1.${As}${s}.${dl}.${i?"H":"L"}${ie}.B0`,params:{general_tier_flag:i,general_profile_idc:s,general_profile_space:n,general_profile_compatibility_flags:[o,c,h,p],general_constraint_indicator_flags:[m,v,T,A,$,U],general_level_idc:ie,bit_depth:Ut+8,bit_depth_luma_minus8:Ut,bit_depth_chroma_minus8:jt,min_spatial_segmentation_idc:Ft,chroma_format_idc:Ce,frame_rate:{fixed:Br,fps:Ar/Sr}},width:di,height:Hi,pixelRatio:[Bt,xr]}}readPPS(e){const t=new Et(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const n=t.readBoolean(),i=t.readBoolean();let s=1;return i&&n?s=0:i?s=3:n&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Zt=188;class or{constructor(e,t,r,n){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=e,this.config=t,this.typeSupported=r,this.logger=n,this.videoParser=null}static probe(e,t){const r=or.syncOffset(e);return r>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${r}`),r!==-1}static syncOffset(e){const t=e.length;let r=Math.min(Zt*5,t-Zt)+1,n=0;for(;n<r;){let i=!1,s=-1,o=0;for(let c=n;c<t;c+=Zt)if(e[c]===71&&(t-c===Zt||e[c+Zt]===71)){if(o++,s===-1&&(s=c,s!==0&&(r=Math.min(s+Zt*99,e.length-Zt)+1)),i||(i=gr(e,c)===0),i&&o>1&&(s===0&&o>2||c+Zt>r))return s}else{if(o)return-1;break}n++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Qt[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,r,n){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=or.createTrack("video"),this._videoTrack.duration=n,this._audioTrack=or.createTrack("audio",n),this._id3Track=or.createTrack("id3"),this._txtTrack=or.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:r}=this;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,r=!1,n=!1){r||(this.sampleAes=null);let i;const s=this._videoTrack,o=this._audioTrack,c=this._id3Track,h=this._txtTrack;let p=s.pid,m=s.pesData,v=o.pid,T=c.pid,A=o.pesData,$=c.pesData,U=null,ie=this.pmtParsed,le=this._pmtId,fe=e.length;if(this.remainderData&&(e=Ct(this.remainderData,e),fe=e.length,this.remainderData=null),fe<Zt&&!n)return this.remainderData=e,{audioTrack:o,videoTrack:s,id3Track:c,textTrack:h};const Ce=Math.max(0,or.syncOffset(e));fe-=(fe-Ce)%Zt,fe<e.byteLength&&!n&&(this.remainderData=new Uint8Array(e.buffer,fe,e.buffer.byteLength-fe));let Fe=0;for(let Ne=Ce;Ne<fe;Ne+=Zt)if(e[Ne]===71){const Xe=!!(e[Ne+1]&64),qe=gr(e,Ne),ze=(e[Ne+3]&48)>>4;let ft;if(ze>1){if(ft=Ne+5+e[Ne+4],ft===Ne+Zt)continue}else ft=Ne+4;switch(qe){case p:Xe&&(m&&(i=zr(m,this.logger))&&(this.readyVideoParser(s.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(s,h,i,!1)),m={data:[],size:0}),m&&(m.data.push(e.subarray(ft,Ne+Zt)),m.size+=Ne+Zt-ft);break;case v:if(Xe){if(A&&(i=zr(A,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,i);break;case"mp3":this.parseMPEGPES(o,i);break;case"ac3":this.parseAC3PES(o,i);break}A={data:[],size:0}}A&&(A.data.push(e.subarray(ft,Ne+Zt)),A.size+=Ne+Zt-ft);break;case T:Xe&&($&&(i=zr($,this.logger))&&this.parseID3PES(c,i),$={data:[],size:0}),$&&($.data.push(e.subarray(ft,Ne+Zt)),$.size+=Ne+Zt-ft);break;case 0:Xe&&(ft+=e[ft]+1),le=this._pmtId=Gr(e,ft);break;case le:{Xe&&(ft+=e[ft]+1);const Ut=Fr(e,ft,this.typeSupported,r,this.observer,this.logger);p=Ut.videoPid,p>0&&(s.pid=p,s.segmentCodec=Ut.segmentVideoCodec),v=Ut.audioPid,v>0&&(o.pid=v,o.segmentCodec=Ut.segmentAudioCodec),T=Ut.id3Pid,T>0&&(c.pid=T),U!==null&&!ie&&(this.logger.warn(`MPEG-TS PMT found at ${Ne} after unknown PID '${U}'. Backtracking to sync byte @${Ce} to parse all TS packets.`),U=null,Ne=Ce-188),ie=this.pmtParsed=!0;break}case 17:case 8191:break;default:U=qe;break}}else Fe++;Fe>0&&Kr(this.observer,new Error(`Found ${Fe} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=m,o.pesData=A,c.pesData=$;const tt={audioTrack:o,videoTrack:s,id3Track:c,textTrack:h};return n&&this.extractRemainingSamples(tt),tt}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:r,id3Track:n,textTrack:i}=e,s=r.pesData,o=t.pesData,c=n.pesData;let h;if(s&&(h=zr(s,this.logger))?(this.readyVideoParser(r.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(r,i,h,!0),r.pesData=null)):r.pesData=s,o&&(h=zr(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,h);break;case"mp3":this.parseMPEGPES(t,h);break;case"ac3":this.parseAC3PES(t,h);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;c&&(h=zr(c,this.logger))?(this.parseID3PES(n,h),n.pesData=null):n.pesData=c}demuxSampleAes(e,t,r){const n=this.demux(e,r,!0,!this.config.progressive),i=this.sampleAes=new rt(this.observer,this.config,t);return this.decrypt(n,i)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new Mt:e==="hevc"&&(this.videoParser=new Yt))}decrypt(e,t){return new Promise(r=>{const{audioTrack:n,videoTrack:i}=e;n.samples&&n.segmentCodec==="aac"?t.decryptAacSamples(n.samples,0,()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,()=>{r(e)}):r(e)}):i.samples&&t.decryptAvcSamples(i.samples,0,0,()=>{r(e)})})}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(e,t){let r=0;const n=this.aacOverFlow;let i=t.data;if(n){this.aacOverFlow=null;const m=n.missing,v=n.sample.unit.byteLength;if(m===-1)i=Ct(n.sample.unit,i);else{const T=v-m;n.sample.unit.set(i.subarray(0,m),T),e.samples.push(n.sample),r=n.missing}}let s,o;for(s=r,o=i.length;s<o-1&&!Bs(i,s);s++);if(s!==r){let m;const v=s<o-1;if(v?m=`AAC PES did not start with ADTS header,offset:${s}`:m="No ADTS header found in AAC PES",Kr(this.observer,new Error(m),v,this.logger),!v)return}da(e,this.observer,i,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(n){const m=ja(e.samplerate);c=n.sample.pts+m}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let h=0,p;for(;s<o;)if(p=Va(e,i,s,c,h),s+=p.length,p.missing){this.aacOverFlow=p;break}else for(h++;s<o-1&&!Bs(i,s);s++);}parseMPEGPES(e,t){const r=t.data,n=r.length;let i=0,s=0;const o=t.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<n;)if(l(r,s)){const c=ro(e,r,s,o,i);if(c)s+=c.length,i++;else break}else s++}parseAC3PES(e,t){{const r=t.data,n=t.pts;if(n===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const i=r.length;let s=0,o=0,c;for(;o<i&&(c=W(e,r,o,n,s++))>0;)o+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const r=b({},t,{type:this._videoTrack?yn.emsg:yn.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(r)}}function gr(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Gr(a,e){return(a[e+10]&31)<<8|a[e+11]}function Fr(a,e,t,r,n,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(a[e+1]&15)<<8|a[e+2],c=e+3+o-4,h=(a[e+10]&15)<<8|a[e+11];for(e+=12+h;e<c;){const p=gr(a,e),m=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!r){Hr("ADTS AAC",i);break}case 15:s.audioPid===-1&&(s.audioPid=p);break;case 21:s.id3Pid===-1&&(s.id3Pid=p);break;case 219:if(!r){Hr("H.264",i);break}case 27:s.videoPid===-1&&(s.videoPid=p);break;case 3:case 4:!t.mpeg&&!t.mp3?i.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=p,s.segmentAudioCodec="mp3");break;case 193:if(!r){Hr("AC-3",i);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=p,s.segmentAudioCodec="ac3"):i.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&m>0){let v=e+5,T=m;for(;T>2;){switch(a[v]){case 106:t.ac3!==!0?i.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=p,s.segmentAudioCodec="ac3");break}const $=a[v+1]+2;v+=$,T-=$}}break;case 194:case 135:return Kr(n,new Error("Unsupported EC-3 in M2TS found"),void 0,i),s;case 36:s.videoPid===-1&&(s.videoPid=p,s.segmentVideoCodec="hevc",i.log("HEVC in M2TS found"));break}e+=m+5}return s}function Kr(a,e,t,r){r.warn(`parsing error: ${e.message}`),a.emit(_.ERROR,_.ERROR,{type:ye.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Hr(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function zr(a,e){let t=0,r,n,i,s,o;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Ct(c[0],c[1]),c.splice(1,1);if(r=c[0],(r[0]<<16)+(r[1]<<8)+r[2]===1){if(n=(r[4]<<8)+r[5],n&&n>a.size-6)return null;const p=r[7];p&192&&(s=(r[9]&14)*536870912+(r[10]&255)*4194304+(r[11]&254)*16384+(r[12]&255)*128+(r[13]&254)/2,p&64?(o=(r[14]&14)*536870912+(r[15]&255)*4194304+(r[16]&254)*16384+(r[17]&255)*128+(r[18]&254)/2,s-o>60*9e4&&(e.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),i=r[8];let m=i+9;if(a.size<=m)return null;a.size-=m;const v=new Uint8Array(a.size);for(let T=0,A=c.length;T<A;T++){r=c[T];let $=r.byteLength;if(m)if(m>$){m-=$;continue}else r=r.subarray(m),$-=m,m=0;v.set(r,t),t+=$}return n&&(n-=i+3),{data:v,pts:s,dts:o,len:n}}return null}class bn{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===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(t===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(t===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(t===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(t===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 Wr=Math.pow(2,32)-1;class Me{static init(){Me.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 e;for(e in Me.types)Me.types.hasOwnProperty(e)&&(Me.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=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]),r=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]);Me.HDLR_TYPES={video:t,audio:r};const n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);Me.STTS=Me.STSC=Me.STCO=i,Me.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Me.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Me.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Me.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);Me.FTYP=Me.box(Me.types.ftyp,s,c,s,o),Me.DINF=Me.box(Me.types.dinf,Me.box(Me.types.dref,n))}static box(e,...t){let r=8,n=t.length;const i=n;for(;n--;)r+=t[n].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=r&255,s.set(e,4),n=0,r=8;n<i;n++)s.set(t[n],r),r+=t[n].byteLength;return s}static hdlr(e){return Me.box(Me.types.hdlr,Me.HDLR_TYPES[e])}static mdat(e){return Me.box(Me.types.mdat,e)}static mdhd(e,t){t*=e;const r=Math.floor(t/(Wr+1)),n=Math.floor(t%(Wr+1));return Me.box(Me.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&255,85,196,0,0]))}static mdia(e){return Me.box(Me.types.mdia,Me.mdhd(e.timescale||0,e.duration||0),Me.hdlr(e.type),Me.minf(e))}static mfhd(e){return Me.box(Me.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?Me.box(Me.types.minf,Me.box(Me.types.smhd,Me.SMHD),Me.DINF,Me.stbl(e)):Me.box(Me.types.minf,Me.box(Me.types.vmhd,Me.VMHD),Me.DINF,Me.stbl(e))}static moof(e,t,r){return Me.box(Me.types.moof,Me.mfhd(e),Me.traf(r,t))}static moov(e){let t=e.length;const r=[];for(;t--;)r[t]=Me.trak(e[t]);return Me.box.apply(null,[Me.types.moov,Me.mvhd(e[0].timescale||0,e[0].duration||0)].concat(r).concat(Me.mvex(e)))}static mvex(e){let t=e.length;const r=[];for(;t--;)r[t]=Me.trex(e[t]);return Me.box.apply(null,[Me.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(Wr+1)),n=Math.floor(t%(Wr+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&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 Me.box(Me.types.mvhd,i)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let n,i;for(n=0;n<t.length;n++)i=t[n].flags,r[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return Me.box(Me.types.sdtp,r)}static stbl(e){return Me.box(Me.types.stbl,Me.stsd(e),Me.box(Me.types.stts,Me.STTS),Me.box(Me.types.stsc,Me.STSC),Me.box(Me.types.stsz,Me.STSZ),Me.box(Me.types.stco,Me.STCO))}static avc1(e){let t=[],r=[],n,i,s;for(n=0;n<e.sps.length;n++)i=e.sps[n],s=i.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(i));for(n=0;n<e.pps.length;n++)i=e.pps[n],s=i.byteLength,r.push(s>>>8&255),r.push(s&255),r=r.concat(Array.prototype.slice.call(i));const o=Me.box(Me.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(r))),c=e.width,h=e.height,p=e.pixelRatio[0],m=e.pixelRatio[1];return Me.box(Me.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,c>>8&255,c&255,h>>8&255,h&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]),o,Me.box(Me.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Me.box(Me.types.pasp,new Uint8Array([p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&255])))}static esds(e){const t=e.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,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return Me.box(Me.types.mp4a,Me.audioStsd(e),Me.box(Me.types.esds,Me.esds(e)))}static mp3(e){return Me.box(Me.types[".mp3"],Me.audioStsd(e))}static ac3(e){return Me.box(Me.types["ac-3"],Me.audioStsd(e),Me.box(Me.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return Me.box(Me.types.stsd,Me.STSD,Me.mp4a(e));if(t==="ac3"&&e.config)return Me.box(Me.types.stsd,Me.STSD,Me.ac3(e));if(t==="mp3"&&e.codec==="mp3")return Me.box(Me.types.stsd,Me.STSD,Me.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return Me.box(Me.types.stsd,Me.STSD,Me.avc1(e));if(t==="hevc"&&e.vps)return Me.box(Me.types.stsd,Me.STSD,Me.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,r=(e.duration||0)*(e.timescale||0),n=e.width||0,i=e.height||0,s=Math.floor(r/(Wr+1)),o=Math.floor(r%(Wr+1));return Me.box(Me.types.tkhd,new Uint8Array([1,0,0,7,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,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&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,n>>8&255,n&255,0,0,i>>8&255,i&255,0,0]))}static traf(e,t){const r=Me.sdtp(e),n=e.id,i=Math.floor(t/(Wr+1)),s=Math.floor(t%(Wr+1));return Me.box(Me.types.traf,Me.box(Me.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255])),Me.box(Me.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,s>>24,s>>16&255,s>>8&255,s&255])),Me.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,Me.box(Me.types.trak,Me.tkhd(e),Me.mdia(e))}static trex(e){const t=e.id;return Me.box(Me.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const r=e.samples||[],n=r.length,i=12+16*n,s=new Uint8Array(i);let o,c,h,p,m,v;for(t+=8+i,s.set([e.type==="video"?1:0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,n&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o<n;o++)c=r[o],h=c.duration,p=c.size,m=c.flags,v=c.cts,s.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,p>>>24&255,p>>>16&255,p>>>8&255,p&255,m.isLeading<<2|m.dependsOn,m.isDependedOn<<6|m.hasRedundancy<<4|m.paddingValue<<1|m.isNonSync,m.degradPrio&61440,m.degradPrio&15,v>>>24&255,v>>>16&255,v>>>8&255,v&255],12+16*o);return Me.box(Me.types.trun,s)}static initSegment(e){Me.types||Me.init();const t=Me.moov(e);return Ct(Me.FTYP,t)}static hvc1(e){const t=e.params,r=[e.vps,e.sps,e.pps],n=4,i=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),n-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),r.length]);let s=i.length;for(let A=0;A<r.length;A+=1){s+=3;for(let $=0;$<r[A].length;$+=1)s+=2+r[A][$].length}const o=new Uint8Array(s);o.set(i,0),s=i.length;const c=r.length-1;for(let A=0;A<r.length;A+=1){o.set(new Uint8Array([32+A|(A===c?128:0),0,r[A].length]),s),s+=3;for(let $=0;$<r[A].length;$+=1)o.set(new Uint8Array([r[A][$].length>>8,r[A][$].length&255]),s),s+=2,o.set(r[A][$],s),s+=r[A][$].length}const h=Me.box(Me.types.hvcC,o),p=e.width,m=e.height,v=e.pixelRatio[0],T=e.pixelRatio[1];return Me.box(Me.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,p>>8&255,p&255,m>>8&255,m&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]),h,Me.box(Me.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Me.box(Me.types.pasp,new Uint8Array([v>>24,v>>16&255,v>>8&255,v&255,T>>24,T>>16&255,T>>8&255,T&255])))}}Me.types=void 0,Me.HDLR_TYPES=void 0,Me.STTS=void 0,Me.STSC=void 0,Me.STCO=void 0,Me.STSZ=void 0,Me.VMHD=void 0,Me.SMHD=void 0,Me.STSD=void 0,Me.FTYP=void 0,Me.DINF=void 0;const Un=9e4;function ci(a,e,t=1,r=!1){const n=a*e*t;return r?Math.round(n):n}function Xn(a,e,t=1,r=!1){return ci(a,e,1/t,r)}function rn(a,e=!1){return ci(a,1e3,1/Un,e)}function $i(a,e=1){return ci(a,Un,1/e)}function fi(a){const{baseTime:e,timescale:t,trackId:r}=a;return`${e/t} (${e}/${t}) trackId: ${r}`}const no=10*1e3,Bo=1024,hs=1152,cs=1536;let Qn=null,fs=null;function xs(a,e,t,r){return{duration:e,size:t,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class $s extends V{constructor(e,t,r,n){if(super("mp4-remuxer",n),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=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,Qn===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Qn=s?parseInt(s[1]):0}if(fs===null){const i=navigator.userAgent.match(/Safari\/(\d+)/i);fs=i?parseInt(i[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const t=this._initPTS;(!t||!e||e.trackId!==t.trackId||e.baseTime!==t.baseTime||e.timescale!==t.timescale)&&this.log(`Reset initPTS: ${t&&fi(t)} > ${e&&fi(e)}`),this._initPTS=this._initDTS=e}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(e){let t=!1;const r=e[0].pts,n=e.reduce((i,s)=>{let o=s.pts,c=o-i;return c<-4294967296&&(t=!0,o=$n(o,r),c=o-i),c>0?i:o},r);return t&&this.debug("PTS rollover detected"),n}remux(e,t,r,n,i,s,o,c){let h,p,m,v,T,A,$=i,U=i;const ie=e.pid>-1,le=t.pid>-1,fe=t.samples.length,Ce=e.samples.length>0,Fe=o&&fe>0||fe>1;if((!ie||Ce)&&(!le||Fe)||this.ISGenerated||o){if(this.ISGenerated){var Ne,Xe,qe,ze;const Jt=this.videoTrackConfig;(Jt&&(t.width!==Jt.width||t.height!==Jt.height||((Ne=t.pixelRatio)==null?void 0:Ne[0])!==((Xe=Jt.pixelRatio)==null?void 0:Xe[0])||((qe=t.pixelRatio)==null?void 0:qe[1])!==((ze=Jt.pixelRatio)==null?void 0:ze[1]))||!Jt&&Fe||this.nextAudioTs===null&&Ce)&&this.resetInitSegment()}this.ISGenerated||(m=this.generateIS(e,t,i,s));const ft=this.isVideoContiguous;let Ut=-1,jt;if(Fe&&(Ut=No(t.samples),!ft&&this.config.forceKeyFrameOnDiscontinuity))if(A=!0,Ut>0){this.warn(`Dropped ${Ut} out of ${fe} video samples due to a missing keyframe`);const Jt=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Ut),t.dropped+=Ut,U+=(t.samples[0].pts-Jt)/t.inputTimeScale,jt=U}else Ut===-1&&(this.warn(`No keyframe found out of ${fe} video samples`),A=!1);if(this.ISGenerated){if(Ce&&Fe){const Jt=this.getVideoStartPts(t.samples),Lt=($n(e.samples[0].pts,Jt)-Jt)/t.inputTimeScale;$+=Math.max(0,Lt),U+=Math.max(0,-Lt)}if(Ce){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),m=this.generateIS(e,t,i,s)),p=this.remuxAudio(e,$,this.isAudioContiguous,s,le||Fe||c===pe.AUDIO?U:void 0),Fe){const Jt=p?p.endPTS-p.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),m=this.generateIS(e,t,i,s)),h=this.remuxVideo(t,U,ft,Jt)}}else Fe&&(h=this.remuxVideo(t,U,ft,0));h&&(h.firstKeyFrame=Ut,h.independent=Ut!==-1,h.firstKeyFramePTS=jt)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(T=zs(r,i,this._initPTS,this._initDTS)),n.samples.length&&(v=ba(n,i,this._initPTS))),{audio:p,video:h,initSegment:m,independent:A,text:v,id3:T}}computeInitPts(e,t,r,n){const i=Math.round(r*t);let s=$n(e,i);if(s<i+t)for(this.log(`Adjusting PTS for rollover in timeline near ${(i-s)/t} ${n}`);s<i+t;)s+=8589934592;return s-i}generateIS(e,t,r,n){const i=e.samples,s=t.samples,o=this.typeSupported,c={},h=this._initPTS;let p=!h||n,m="audio/mp4",v,T,A,$=-1;if(p&&(v=T=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(m="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:m,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):Me.initSegment([e]),metadata:{channelCount:e.channelCount}},p&&($=e.id,A=e.inputTimeScale,!h||A!==h.timescale?v=T=this.computeInitPts(i[0].pts,A,r,"audio"):p=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Me.initSegment([t]),metadata:{width:t.width,height:t.height}},p)if($=t.id,A=t.inputTimeScale,!h||A!==h.timescale){const U=this.getVideoStartPts(s),ie=$n(s[0].dts,U),le=this.computeInitPts(ie,A,r,"video"),fe=this.computeInitPts(U,A,r,"video");T=Math.min(T,le),v=Math.min(v,fe)}else p=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,p?(h&&this.warn(`Timestamps at playlist time: ${n?"":"~"}${r} ${v/A} != initPTS: ${h.baseTime/h.timescale} (${h.baseTime}/${h.timescale}) trackId: ${h.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${v/A} (${v}/${A}) trackId: ${$}`),this._initPTS={baseTime:v,timescale:A,trackId:$},this._initDTS={baseTime:T,timescale:A,trackId:$}):v=A=void 0,{tracks:c,initPTS:v,timescale:A,trackId:$}}remuxVideo(e,t,r,n){const i=e.inputTimeScale,s=e.samples,o=[],c=s.length,h=this._initPTS,p=h.baseTime*i/h.timescale;let m=this.nextVideoTs,v=8,T=this.videoSampleDuration,A,$,U=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,le=!1;if(!r||m===null){const Ft=p+t*i,Bt=s[0].pts-$n(s[0].dts,s[0].pts);Qn&&m!==null&&Math.abs(Ft-Bt-(m+p))<15e3?r=!0:m=Ft-Bt-p}const fe=m+p;for(let Ft=0;Ft<c;Ft++){const Bt=s[Ft];Bt.pts=$n(Bt.pts,fe),Bt.dts=$n(Bt.dts,fe),Bt.dts<s[Ft>0?Ft-1:Ft].dts&&(le=!0)}le&&s.sort(function(Ft,Bt){const xr=Ft.dts-Bt.dts,Br=Ft.pts-Bt.pts;return xr||Br}),A=s[0].dts,$=s[s.length-1].dts;const Ce=$-A,Fe=Ce?Math.round(Ce/(c-1)):T||e.inputTimeScale/30;if(r){const Ft=A-fe,Bt=Ft>Fe,xr=Ft<-1;if((Bt||xr)&&(Bt?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${rn(Ft,!0)} ms (${Ft}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${rn(-Ft,!0)} ms (${Ft}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!xr||fe>=s[0].pts||Qn)){A=fe;const Br=s[0].pts-Ft;if(Bt)s[0].dts=A,s[0].pts=Br;else{let Sr=!0;for(let Ar=0;Ar<s.length&&!(s[Ar].dts>Br&&Sr);Ar++){const In=s[Ar].pts;if(s[Ar].dts-=Ft,s[Ar].pts-=Ft,Ar<s.length-1){const Tn=s[Ar+1].pts,di=s[Ar].pts,Hi=Tn<=di,As=Tn<=In;Sr=Hi==As}}}this.log(`Video: Initial PTS/DTS adjusted: ${rn(Br,!0)}/${rn(A,!0)}, delta: ${rn(Ft,!0)} ms`)}}A=Math.max(0,A);let tt=0,Ne=0,Xe=A;for(let Ft=0;Ft<c;Ft++){const Bt=s[Ft],xr=Bt.units,Br=xr.length;let Sr=0;for(let Ar=0;Ar<Br;Ar++)Sr+=xr[Ar].data.length;Ne+=Sr,tt+=Br,Bt.length=Sr,Bt.dts<Xe?(Bt.dts=Xe,Xe+=Fe/4|0||1):Xe=Bt.dts,U=Math.min(Bt.pts,U),ie=Math.max(Bt.pts,ie)}$=s[c-1].dts;const qe=Ne+4*tt+8;let ze;try{ze=new Uint8Array(qe)}catch(Ft){this.observer.emit(_.ERROR,_.ERROR,{type:ye.MUX_ERROR,details:te.REMUX_ALLOC_ERROR,fatal:!1,error:Ft,bytes:qe,reason:`fail allocating video mdat ${qe}`});return}const ft=new DataView(ze.buffer);ft.setUint32(0,qe),ze.set(Me.types.mdat,4);let Ut=!1,jt=Number.POSITIVE_INFINITY,Jt=Number.POSITIVE_INFINITY,Vt=Number.NEGATIVE_INFINITY,Lt=Number.NEGATIVE_INFINITY;for(let Ft=0;Ft<c;Ft++){const Bt=s[Ft],xr=Bt.units;let Br=0;for(let In=0,Tn=xr.length;In<Tn;In++){const di=xr[In],Hi=di.data,As=di.data.byteLength;ft.setUint32(v,As),v+=4,ze.set(Hi,v),v+=As,Br+=4+As}let Sr;if(Ft<c-1)T=s[Ft+1].dts-Bt.dts,Sr=s[Ft+1].pts-Bt.pts;else{const In=this.config,Tn=Ft>0?Bt.dts-s[Ft-1].dts:Fe;if(Sr=Ft>0?Bt.pts-s[Ft-1].pts:Fe,In.stretchShortVideoTrack&&this.nextAudioTs!==null){const di=Math.floor(In.maxBufferHole*i),Hi=(n?U+n*i:this.nextAudioTs+p)-Bt.pts;Hi>di?(T=Hi-Tn,T<0?T=Tn:Ut=!0,this.log(`It is approximately ${Hi/90} ms to the next segment; using duration ${T/90} ms for the last video frame.`)):T=Tn}else T=Tn}const Ar=Math.round(Bt.pts-Bt.dts);jt=Math.min(jt,T),Vt=Math.max(Vt,T),Jt=Math.min(Jt,Sr),Lt=Math.max(Lt,Sr),o.push(xs(Bt.key,T,Br,Ar))}if(o.length){if(Qn){if(Qn<70){const Ft=o[0].flags;Ft.dependsOn=2,Ft.isNonSync=0}}else if(fs&&Lt-Jt<Vt-jt&&Fe/Vt<.025&&o[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Ft=A;for(let Bt=0,xr=o.length;Bt<xr;Bt++){const Br=Ft+o[Bt].duration,Sr=Ft+o[Bt].cts;if(Bt<xr-1){const Ar=Br+o[Bt+1].cts;o[Bt].duration=Ar-Sr}else o[Bt].duration=Bt?o[Bt-1].duration:Fe;o[Bt].cts=0,Ft=Br}}}T=Ut||!T?Fe:T;const qt=$+T;this.nextVideoTs=m=qt-p,this.videoSampleDuration=T,this.isVideoContiguous=!0;const hr={data1:Me.moof(e.sequenceNumber++,A,b(e,{samples:o})),data2:ze,startPTS:(U-p)/i,endPTS:(ie+T-p)/i,startDTS:(A-p)/i,endDTS:m/i,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,hr}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return hs;case"ac3":return cs;default:return Bo}}remuxAudio(e,t,r,n,i){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,c=s/o,h=this.getSamplesPerFrame(e),p=h*c,m=this._initPTS,v=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,T=[],A=i!==void 0;let $=e.samples,U=v?0:8,ie=this.nextAudioTs||-1;const le=m.baseTime*s/m.timescale,fe=le+t*s;if(this.isAudioContiguous=r=r||$.length&&ie>0&&(n&&Math.abs(fe-(ie+le))<9e3||Math.abs($n($[0].pts,fe)-(ie+le))<20*p),$.forEach(function(Lt){Lt.pts=$n(Lt.pts,fe)}),!r||ie<0){const Lt=$.length;if($=$.filter(qt=>qt.pts>=0),Lt!==$.length&&this.warn(`Removed ${$.length-Lt} of ${Lt} samples (initPTS ${le} / ${s})`),!$.length)return;i===0?ie=0:n&&!A?ie=Math.max(0,fe-le):ie=$[0].pts-le}if(e.segmentCodec==="aac"){const Lt=this.config.maxAudioFramesDrift;for(let qt=0,zt=ie+le;qt<$.length;qt++){const Xt=$[qt],hr=Xt.pts,Ft=hr-zt,Bt=Math.abs(1e3*Ft/s);if(Ft<=-Lt*p&&A)qt===0&&(this.warn(`Audio frame @ ${(hr/s).toFixed(3)}s overlaps marker by ${Math.round(1e3*Ft/s)} ms.`),this.nextAudioTs=ie=hr-le,zt=hr);else if(Ft>=Lt*p&&Bt<no&&A){let xr=Math.round(Ft/p);for(zt=hr-xr*p;zt<0&&xr&&p;)xr--,zt+=p;qt===0&&(this.nextAudioTs=ie=zt-le),this.warn(`Injecting ${xr} audio frames @ ${((zt-le)/s).toFixed(3)}s due to ${Math.round(1e3*Ft/s)} ms gap.`);for(let Br=0;Br<xr;Br++){let Sr=bn.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Sr||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),Sr=Xt.unit.subarray()),$.splice(qt,0,{unit:Sr,pts:zt}),zt+=p,qt++}}Xt.pts=zt,zt+=p}}let Ce=null,Fe=null,tt,Ne=0,Xe=$.length;for(;Xe--;)Ne+=$[Xe].unit.byteLength;for(let Lt=0,qt=$.length;Lt<qt;Lt++){const zt=$[Lt],Xt=zt.unit;let hr=zt.pts;if(Fe!==null){const Bt=T[Lt-1];Bt.duration=Math.round((hr-Fe)/c)}else if(r&&e.segmentCodec==="aac"&&(hr=ie+le),Ce=hr,Ne>0){Ne+=U;try{tt=new Uint8Array(Ne)}catch(Bt){this.observer.emit(_.ERROR,_.ERROR,{type:ye.MUX_ERROR,details:te.REMUX_ALLOC_ERROR,fatal:!1,error:Bt,bytes:Ne,reason:`fail allocating audio mdat ${Ne}`});return}v||(new DataView(tt.buffer).setUint32(0,Ne),tt.set(Me.types.mdat,4))}else return;tt.set(Xt,U);const Ft=Xt.byteLength;U+=Ft,T.push(xs(!0,h,Ft,0)),Fe=hr}const qe=T.length;if(!qe)return;const ze=T[T.length-1];ie=Fe-le,this.nextAudioTs=ie+c*ze.duration;const ft=v?new Uint8Array(0):Me.moof(e.sequenceNumber++,Ce/c,b({},e,{samples:T}));e.samples=[];const Ut=(Ce-le)/s,jt=this.nextAudioTs/s,Vt={data1:ft,data2:tt,startPTS:Ut,endPTS:jt,startDTS:Ut,endDTS:jt,type:"audio",hasAudio:!0,hasVideo:!1,nb:qe};return this.isAudioContiguous=!0,Vt}}function $n(a,e){let t;if(e===null)return a;for(e<a?t=-8589934592:t=8589934592;Math.abs(a-e)>4294967296;)a+=t;return a}function No(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function zs(a,e,t,r){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let o=0;o<n;o++){const c=a.samples[o];c.pts=$n(c.pts-t.baseTime*i/t.timescale,e*i)/i,c.dts=$n(c.dts-r.baseTime*i/r.timescale,e*i)/i}const s=a.samples;return a.samples=[],{samples:s}}function ba(a,e,t){const r=a.samples.length;if(!r)return;const n=a.inputTimeScale;for(let s=0;s<r;s++){const o=a.samples[s];o.pts=$n(o.pts-t.baseTime*n/t.timescale,e*n)/n}a.samples.sort((s,o)=>s.pts-o.pts);const i=a.samples;return a.samples=[],{samples:i}}class io extends V{constructor(e,t,r,n){super("passthrough-remuxer",n),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(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,r,n){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(e,n),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:r,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:i,video:s}=this.initData=Je(e);if(t)mt(e,t);else{const c=i||s;c!=null&&c.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${c.codec}")!`)}i&&(r=pl(i,K.AUDIO,this)),s&&(n=pl(s,K.VIDEO,this));const o={};i&&s?o.audiovideo={container:"video/mp4",codec:r+","+n,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:i?o.audio={container:"audio/mp4",codec:r,encrypted:i.encrypted,initSegment:e,id:"audio"}:s?o.video={container:"video/mp4",codec:n,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=o}remux(e,t,r,n,i,s){var o,c;let{initPTS:h,lastEndTime:p}=this;const m={audio:void 0,video:void 0,text:n,id3:r,initSegment:void 0};F(p)||(p=this.lastEndTime=i||0);const v=t.samples;if(!v.length)return m;const T={initPTS:void 0,timescale:void 0,trackId:void 0};let A=this.initData;if((o=A)!=null&&o.length||(this.generateInitSegment(v),A=this.initData),!((c=A)!=null&&c.length))return this.warn("Failed to generate initSegment."),m;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1);const $=vt(v,A,this),U=A.audio?$[A.audio.id]:null,ie=A.video?$[A.video.id]:null,le=ws(ie,1/0),fe=ws(U,1/0),Ce=ws(ie,0,!0),Fe=ws(U,0,!0);let tt=i,Ne=0;const Xe=U&&(!ie||!h&&fe<le||h&&h.trackId===A.audio.id),qe=Xe?U:ie;if(qe){const zt=qe.timescale,Xt=qe.start-i*zt,hr=Xe?A.audio.id:A.video.id;tt=qe.start/zt,Ne=Xe?Fe-fe:Ce-le,(s||!h)&&(Gs(h,tt,i,Ne)||zt!==h.timescale)&&(h&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${i} ${Xt/zt} != initPTS: ${h.baseTime/h.timescale} (${h.baseTime}/${h.timescale}) trackId: ${h.trackId}`),this.log(`Found initPTS at playlist time: ${i} offset: ${tt-i} (${Xt}/${zt}) trackId: ${hr}`),h=null,T.initPTS=Xt,T.timescale=zt,T.trackId=hr)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${i}`);h?(T.initPTS=h.baseTime,T.timescale=h.timescale,T.trackId=h.trackId):((!T.timescale||T.trackId===void 0||T.initPTS===void 0)&&(this.warn("Could not set initPTS"),T.initPTS=tt,T.timescale=1,T.trackId=-1),this.initPTS=h={baseTime:T.initPTS,timescale:T.timescale,trackId:T.trackId});const ze=tt-h.baseTime/h.timescale,ft=ze+Ne;Ne>0?this.lastEndTime=ft:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Ut=!!A.audio,jt=!!A.video;let Jt="";Ut&&(Jt+="audio"),jt&&(Jt+="video");const Vt=(A.audio?A.audio.encrypted:!1)||(A.video?A.video.encrypted:!1),Lt={data1:v,startPTS:ze,startDTS:ze,endPTS:ft,endDTS:ft,type:Jt,hasAudio:Ut,hasVideo:jt,nb:1,dropped:0,encrypted:Vt};m.audio=Ut&&!jt?Lt:void 0,m.video=jt?Lt:void 0;const qt=ie==null?void 0:ie.sampleCount;if(qt){const zt=ie.keyFrameIndex,Xt=zt!==-1;Lt.nb=qt,Lt.dropped=zt===0||this.isVideoContiguous?0:Xt?zt:qt,Lt.independent=Xt,Lt.firstKeyFrame=zt,Xt&&ie.keyFrameStart&&(Lt.firstKeyFramePTS=(ie.keyFrameStart-h.baseTime)/h.timescale),this.isVideoContiguous||(m.independent=Xt),this.isVideoContiguous||(this.isVideoContiguous=Xt),Lt.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${zt}/${qt} dropped: ${Lt.dropped} start: ${Lt.firstKeyFramePTS||"NA"}`)}return m.initSegment=T,m.id3=zs(r,i,h,h),n.samples.length&&(m.text=ba(n,i,h)),m}}function ws(a,e,t=!1){return(a==null?void 0:a.start)!==void 0?(a.start+(t?a.duration:0))/a.timescale:e}function Gs(a,e,t,r){if(a===null)return!0;const n=Math.max(r,1),i=e-a.baseTime/a.timescale;return Math.abs(i-t)>n}function pl(a,e,t){const r=a.codec;return r&&r.length>4?r:e===K.AUDIO?r==="ec-3"||r==="ac-3"||r==="alac"?r:r==="fLaC"||r==="Opus"?he(r,!1):(t.warn(`Unhandled audio codec "${r}" in mp4 MAP`),r||"mp4a"):(t.warn(`Unhandled video codec "${r}" in mp4 MAP`),r||"avc1")}let Qi;try{Qi=self.performance.now.bind(self.performance)}catch(a){Qi=Date.now}const so=[{demux:Le,remux:io},{demux:or,remux:$s},{demux:g,remux:$s},{demux:ne,remux:$s}];so.splice(2,0,{demux:L,remux:$s});class ml{constructor(e,t,r,n,i,s){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=e,this.typeSupported=t,this.config=r,this.id=i,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,n){const i=r.transmuxing;i.executeStart=Qi();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:c}=this;n&&(this.currentTransmuxState=n);const{contiguous:h,discontinuity:p,trackSwitch:m,accurateTimeOffset:v,timeOffset:T,initSegmentChange:A}=n||o,{audioCodec:$,videoCodec:U,defaultInitPts:ie,duration:le,initSegmentData:fe}=c,Ce=wu(s,t);if(Ce&&Kn(Ce.method)){const Xe=this.getDecrypter(),qe=Fi(Ce.method);if(Xe.isSync()){let ze=Xe.softwareDecrypt(s,Ce.key.buffer,Ce.iv.buffer,qe);if(r.part>-1){const Ut=Xe.flush();ze=Ut&&Ut.buffer}if(!ze)return i.executeEnd=Qi(),Uo(r);s=new Uint8Array(ze)}else return this.asyncResult=!0,this.decryptionPromise=Xe.webCryptoDecrypt(s,Ce.key.buffer,Ce.iv.buffer,qe).then(ze=>{const ft=this.push(ze,null,r);return this.decryptionPromise=null,ft}),this.decryptionPromise}const Fe=this.needsProbing(p,m);if(Fe){const Xe=this.configureTransmuxer(s);if(Xe)return this.logger.warn(`[transmuxer] ${Xe.message}`),this.observer.emit(_.ERROR,_.ERROR,{type:ye.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,fatal:!1,error:Xe,reason:Xe.message}),i.executeEnd=Qi(),Uo(r)}(p||m||A||Fe)&&this.resetInitSegment(fe,$,U,le,t),(p||A||Fe)&&this.resetInitialTimestamp(ie),h||this.resetContiguity();const tt=this.transmux(s,Ce,T,v,r);this.asyncResult=Ea(tt);const Ne=this.currentTransmuxState;return Ne.contiguous=!0,Ne.discontinuity=!1,Ne.trackSwitch=!1,i.executeEnd=Qi(),tt}flush(e){const t=e.transmuxing;t.executeStart=Qi();const{decrypter:r,currentTransmuxState:n,decryptionPromise:i}=this;if(i)return this.asyncResult=!0,i.then(()=>this.flush(e));const s=[],{timeOffset:o}=n;if(r){const m=r.flush();m&&s.push(this.push(m.buffer,null,e))}const{demuxer:c,remuxer:h}=this;if(!c||!h){t.executeEnd=Qi();const m=[Uo(e)];return this.asyncResult?Promise.resolve(m):m}const p=c.flush(o);return Ea(p)?(this.asyncResult=!0,p.then(m=>(this.flushRemux(s,m,e),s))):(this.flushRemux(s,p,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,r){const{audioTrack:n,videoTrack:i,id3Track:s,textTrack:o}=t,{accurateTimeOffset:c,timeOffset:h}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${r.sn}${r.part>-1?" part: "+r.part:""} of ${this.id===pe.MAIN?"level":"track"} ${r.level}`);const p=this.remuxer.remux(n,i,s,o,h,c,!0,this.id);e.push({remuxResult:p,chunkMeta:r}),r.transmuxing.executeEnd=Qi()}resetInitialTimestamp(e){const{demuxer:t,remuxer:r}=this;!t||!r||(t.resetTimeStamp(e),r.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,r,n,i){const{demuxer:s,remuxer:o}=this;!s||!o||(s.resetInitSegment(e,t,r,n),o.resetInitSegment(e,t,r,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,n,i){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,r,n,i):s=this.transmuxUnencrypted(e,r,n,i),s}transmuxUnencrypted(e,t,r,n){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,o,c,t,r,!1,this.id),chunkMeta:n}}transmuxSampleAes(e,t,r,n,i){return this.demuxer.demuxSampleAes(e,t,r).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,r,n,!1,this.id),chunkMeta:i}))}configureTransmuxer(e){const{config:t,observer:r,typeSupported:n}=this;let i;for(let m=0,v=so.length;m<v;m++){var s;if((s=so[m].demux)!=null&&s.probe(e,this.logger)){i=so[m];break}}if(!i)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,c=this.remuxer,h=i.remux,p=i.demux;(!c||!(c instanceof h))&&(this.remuxer=new h(r,t,n,this.logger)),(!o||!(o instanceof p))&&(this.demuxer=new p(r,t,n,this.logger),this.probe=p.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Zr(this.config)),e}}function wu(a,e){let t=null;return a.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Uo=a=>({remuxResult:{},chunkMeta:a});function Ea(a){return"then"in a&&a.then instanceof Function}class Su{constructor(e,t,r,n,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=r,this.duration=n,this.defaultInitPts=i||null}}class Tu{constructor(e,t,r,n,i,s){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=e,this.contiguous=t,this.accurateTimeOffset=r,this.trackSwitch=n,this.timeOffset=i,this.initSegmentChange=s}}let gl=0;class _l{constructor(e,t,r,n){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=gl++,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=c=>{const h=c.data,p=this.hls;if(!(!p||!(h!=null&&h.event)||h.instanceNo!==this.instanceNo))switch(h.event){case"init":{var m;const v=(m=this.workerContext)==null?void 0:m.objectURL;v&&self.URL.revokeObjectURL(v);break}case"transmuxComplete":{this.handleTransmuxComplete(h.data);break}case"flush":{this.onFlush(h.data);break}case"workerLog":{p.logger[h.data.logType]&&p.logger[h.data.logType](h.data.message);break}default:{h.data=h.data||{},h.data.frag=this.frag,h.data.part=this.part,h.data.id=this.id,p.trigger(h.event,h.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const h=new Error(`${c.message} (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:te.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:h})};const i=e.config;this.hls=e,this.id=t,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=r,this.onFlush=n;const s=(c,h)=>{h=h||{},h.frag=this.frag||void 0,c===_.ERROR&&(h=h,h.parent=this.id,h.part=this.part,this.error=h.error),this.hls.trigger(c,h)};this.observer=new Ms,this.observer.on(_.FRAG_DECRYPTED,s),this.observer.on(_.ERROR,s);const o=Wt(i.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(i.workerPath||$a()){try{i.workerPath?(c.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=za(i.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=ko());const{worker:p}=this.workerContext;p.addEventListener("message",this.onWorkerMessage),p.addEventListener("error",this.onWorkerError),p.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:nr(i)})}catch(p){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,p),this.terminateWorker(),this.error=null,this.transmuxer=new ml(this.observer,o,i,"",t,e.logger)}return}}this.transmuxer=new ml(this.observer,o,i,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=gl++;const t=this.hls.config,r=Wt(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:r,id:this.id,config:nr(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),Co(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,r,n,i,s,o,c,h,p){var m,v;h.transmuxing.start=self.performance.now();const{instanceNo:T,transmuxer:A}=this,$=s?s.start:i.start,U=i.decryptdata,ie=this.frag,le=!(ie&&i.cc===ie.cc),fe=!(ie&&h.level===ie.level),Ce=ie?h.sn-ie.sn:-1,Fe=this.part?h.part-this.part.index:-1,tt=Ce===0&&h.id>1&&h.id===(ie==null?void 0:ie.stats.chunkCount),Ne=!fe&&(Ce===1||Ce===0&&(Fe===1||tt&&Fe<=0)),Xe=self.performance.now();(fe||Ce||i.stats.parsing.start===0)&&(i.stats.parsing.start=Xe),s&&(Fe||!Ne)&&(s.stats.parsing.start=Xe);const qe=!(ie&&((m=i.initSegment)==null?void 0:m.url)===((v=ie.initSegment)==null?void 0:v.url)),ze=new Tu(le,Ne,c,fe,$,qe);if(!Ne||le||qe){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${i.type} sn: ${h.sn}${h.part>-1?" part: "+h.part:""} ${this.id===pe.MAIN?"level":"track"}: ${h.level} id: ${h.id}
discontinuity: ${le}
trackSwitch: ${fe}
contiguous: ${Ne}
accurateTimeOffset: ${c}
timeOffset: ${$}
initSegmentChange: ${qe}`);const ft=new Su(r,n,t,o,p);this.configureTransmuxer(ft)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:T,cmd:"demux",data:e,decryptdata:U,chunkMeta:h,state:ze},e instanceof ArrayBuffer?[e]:[]);else if(A){const ft=A.push(e,U,h,ze);Ea(ft)?ft.then(Ut=>{this.handleTransmuxComplete(Ut)}).catch(Ut=>{this.transmuxerError(Ut,h,"transmuxer-interface push error")}):this.handleTransmuxComplete(ft)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:r}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(r){const n=r.flush(e);Ea(n)?n.then(i=>{this.handleFlushResult(i,e)}).catch(i=>{this.transmuxerError(i,e,"transmuxer-interface flush error")}):this.handleFlushResult(n,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:r}))}handleFlushResult(e,t){e.forEach(r=>{this.handleTransmuxComplete(r)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:r}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):r&&r.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const vl=100;class Au extends _s{constructor(e,t,r){super(e,t,r,"audio-stream-controller",pe.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:e}=this;e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(_.BUFFER_RESET,this.onBufferReset,this),e.on(_.BUFFER_CREATED,this.onBufferCreated,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(_.FRAG_LOADING,this.onFragLoading,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(_.BUFFER_RESET,this.onBufferReset,this),e.off(_.BUFFER_CREATED,this.onBufferCreated,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(_.FRAG_LOADING,this.onFragLoading,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:r,initPTS:n,timescale:i,trackId:s}){if(r===pe.MAIN){const o=t.cc,c=this.fragCurrent;if(this.initPTS[o]={baseTime:n,timescale:i,trackId:s},this.log(`InitPTS for cc: ${o} found from main: ${n/i} (${n}/${i}) trackId: ${s}`),this.mainAnchor=t,this.state===ut.WAITING_INIT_PTS){const h=this.waitingData;(!h&&!this.loadingParts||h&&h.frag.cc!==o)&&this.syncWithAnchor(t,h==null?void 0:h.frag)}else!this.hls.hasEnoughToStart&&c&&c.cc!==o?(c.abortRequests(),this.syncWithAnchor(t,c)):this.state===ut.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var r;const n=((r=this.mainFragLoading)==null?void 0:r.frag)||null;if(t&&(n==null?void 0:n.cc)===t.cc)return;const i=(n||e).cc,s=this.getLevelDetails(),o=this.getLoadPosition(),c=vi(s,i,o);c&&(this.log(`Syncing with main frag at ${c.start} cc ${c.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===ut.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=ut.STOPPED;return}const r=this.lastCurrentTime;this.stopLoad(),this.setInterval(vl),r>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r,this.state=ut.IDLE):this.state=ut.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case ut.IDLE:this.doTickIdle();break;case ut.WAITING_TRACK:{const{levels:e,trackId:t}=this,r=e==null?void 0:e[t],n=r==null?void 0:r.details;if(n&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(n))break;this.state=ut.WAITING_INIT_PTS}break}case ut.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case ut.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:r,cache:n,complete:i}=e,s=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=ut.FRAG_LOADING;const o=n.flush().buffer,c={frag:t,part:r,payload:o,networkDetails:null};this._handleFragmentLoadProgress(c),i&&super._handleFragmentLoadComplete(c)}else s&&s.cc!==e.frag.cc&&this.syncWithAnchor(s,e.frag)}else this.state=ut.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:r,media:n,trackId:i}=this,s=t.config;if(!this.buffering||!n&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(r!=null&&r[i]))return;const o=r[i],c=o.details;if(!c||this.waitForLive(o)||this.waitForCdnTuneIn(c)){this.state=ut.WAITING_TRACK,this.startFragRequested=!1;return}const h=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&h&&(this.bufferFlushed=!1,this.afterBufferFlushed(h,K.AUDIO,pe.AUDIO));const p=this.getFwdBufferInfo(h,pe.AUDIO);if(p===null)return;if(!this.switchingTrack&&this._streamEnded(p,c)){t.trigger(_.BUFFER_EOS,{type:"audio"}),this.state=ut.ENDED;return}const m=p.len,v=t.maxBufferLength,T=c.fragments,A=T[0].start,$=this.getLoadPosition(),U=this.flushing?$:p.end;if(this.switchingTrack&&n){const fe=$;c.PTSKnown&&fe<A&&(p.end>A||p.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=A+.05)}if(m>=v&&!this.switchingTrack&&U<T[T.length-1].start)return;let ie=this.getNextFragment(U,c);if(ie&&this.isLoopLoading(ie,U)&&(ie=this.getNextFragmentLoopLoading(ie,c,p,pe.MAIN,v)),!ie){this.bufferFlushed=!0;return}let le=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&le&&Ue(ie)&&!ie.endList&&(!c.live||!this.loadingParts&&U<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(le)===$r.OK&&(this.mainFragLoading=le=null),le&&Ue(le))){if(ie.start>le.end){const Ce=this.fragmentTracker.getFragAtPos(U,pe.MAIN);Ce&&Ce.end>le.end&&(le=Ce,this.mainFragLoading={frag:Ce,targetBufferTime:null})}if(ie.start>le.end)return}this.loadFragment(ie,o,U)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(r=>new yr(r))}onAudioTrackSwitching(e,t){const r=!!t.url;this.trackId=t.id;const{fragCurrent:n}=this;n&&(n.abortRequests(),this.removeUnbufferedFrags(n.start)),this.resetLoadingState(),r?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==ut.STOPPED&&(this.setInterval(vl),this.state=ut.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const r=this.cachedTrackLoadedData;r&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(_.AUDIO_TRACK_LOADED,r))}onAudioTrackLoaded(e,t){var r;const{levels:n}=this,{details:i,id:s,groupId:o,track:c}=t;if(!n){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${o}"`);return}const h=this.mainDetails;if(!h||i.endCC>h.endCC||h.expired){this.cachedTrackLoadedData=t,this.state!==ut.STOPPED&&(this.state=ut.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${o}" loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const p=n[s];let m=0;if(i.live||(r=p.details)!=null&&r.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;if(p.details){var v;m=this.alignPlaylists(i,p.details,(v=this.levelLastLoaded)==null?void 0:v.details)}i.alignedSliding||(Os(i,h),i.alignedSliding||ss(i,h),m=i.fragmentStart)}p.details=i,this.levelLastLoaded=p,this.startFragRequested||this.setStartPosition(h,m),this.hls.trigger(_.AUDIO_TRACK_UPDATED,{details:i,id:s,groupId:t.groupId}),this.state===ut.WAITING_TRACK&&!this.waitForCdnTuneIn(i)&&(this.state=ut.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:n,payload:i}=e,{config:s,trackId:o,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const h=c[o];if(!h){this.warn("Audio track is undefined on fragment load progress");return}const p=h.details;if(!p){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(r.start);return}const m=s.defaultAudioCodec||h.audioCodec||"mp4a.40.2";let v=this.transmuxer;v||(v=this.transmuxer=new _l(this.hls,pe.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const T=this.initPTS[r.cc],A=(t=r.initSegment)==null?void 0:t.data;if(T!==void 0){const U=n?n.index:-1,ie=U!==-1,le=new ni(r.level,r.sn,r.stats.chunkCount,i.byteLength,U,ie);v.push(i,A,m,"",r,n,p.totalduration,!1,le,T)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${p.startSN} ,${p.endSN}],track ${o}`);const{cache:$}=this.waitingData=this.waitingData||{frag:r,part:n,cache:new ua,complete:!1};$.push(new Uint8Array(i)),this.state!==ut.STOPPED&&(this.state=ut.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===pe.MAIN&&Ue(t.frag)&&(this.mainFragLoading=t,this.state===ut.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:r,part:n}=t;if(r.type!==pe.AUDIO){!this.audioOnly&&r.type===pe.MAIN&&!r.elementaryStreams.video&&!r.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${n?" p: "+n.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(Ue(r)){this.fragPrevious=r;const i=this.switchingTrack;i&&(this.bufferedTrack=i,this.switchingTrack=null,this.hls.trigger(_.AUDIO_TRACK_SWITCHED,S({},i)))}this.fragBufferedComplete(r,n),this.media&&this.tick()}onError(e,t){var r;if(t.fatal){this.state=ut.ERROR;return}switch(t.details){case te.FRAG_GAP:case te.FRAG_PARSING_ERROR:case te.FRAG_DECRYPT_ERROR:case te.FRAG_LOAD_ERROR:case te.FRAG_LOAD_TIMEOUT:case te.KEY_LOAD_ERROR:case te.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(pe.AUDIO,t);break;case te.AUDIO_TRACK_LOAD_ERROR:case te.AUDIO_TRACK_LOAD_TIMEOUT:case te.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ut.WAITING_TRACK&&((r=t.context)==null?void 0:r.type)===De.AUDIO_TRACK&&(this.state=ut.IDLE);break;case te.BUFFER_ADD_CODEC_ERROR:case te.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case te.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case te.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==K.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==K.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===ut.ENDED&&(this.state=ut.IDLE);const r=this.mediaBuffer||this.media;r&&(this.afterBufferFlushed(r,t,pe.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const r="audio",{hls:n}=this,{remuxResult:i,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:h,level:p}=o,{details:m}=p,{audio:v,text:T,id3:A,initSegment:$}=i;if(this.fragContextChanged(c)||!m){this.fragmentTracker.removeFragment(c);return}if(this.state=ut.PARSING,this.switchingTrack&&v&&this.completeAudioSwitch(this.switchingTrack),$!=null&&$.tracks){const U=c.initSegment||c;if(this.unhandledEncryptionError($,c))return;this._bufferInitSegment(p,$.tracks,U,s),n.trigger(_.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:r,tracks:$.tracks})}if(v){const{startPTS:U,endPTS:ie,startDTS:le,endDTS:fe}=v;h&&(h.elementaryStreams[K.AUDIO]={startPTS:U,endPTS:ie,startDTS:le,endDTS:fe}),c.setElementaryStreamInfo(K.AUDIO,U,ie,le,fe),this.bufferFragmentData(v,c,h,s)}if(A!=null&&(t=A.samples)!=null&&t.length){const U=b({id:r,frag:c,details:m},A);n.trigger(_.FRAG_PARSING_METADATA,U)}if(T){const U=b({id:r,frag:c,details:m},T);n.trigger(_.FRAG_PARSING_USERDATA,U)}}_bufferInitSegment(e,t,r,n){if(this.state!==ut.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const i=t.audio;i.id=pe.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${s}/${i.codec}]`),s&&s.split(",").length===1&&(i.levelCodec=s),this.hls.trigger(_.BUFFER_CODECS,t);const o=i.initSegment;if(o!=null&&o.byteLength){const c={type:"audio",frag:r,part:null,chunkMeta:n,parent:r.type,data:o};this.hls.trigger(_.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);if(this.switchingTrack||n===$r.NOT_LOADED||n===$r.PARTIAL){var i;if(!Ue(e))this._loadInitSegment(e,t);else if((i=t.details)!=null&&i.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=ut.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&ss(t.details,s)}else super.loadFragment(e,t,r)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:r,assocLang:n,characteristics:i,audioCodec:s,channels:o}=this.bufferedTrack;zn({name:t,lang:r,assocLang:n,characteristics:i,audioCodec:s,channels:o},e,an)||(mi(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(_.AUDIO_TRACK_SWITCHED,S({},e))}}class $o extends V{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}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(e,t,r){const n=t==null?void 0:t.renditionReports;if(n){let i=-1;for(let s=0;s<n.length;s++){const o=n[s];let c;try{c=new self.URL(o.URI,t.url).href}catch(h){this.warn(`Could not construct new URL for Rendition Report: ${h}`),c=o.URI||""}if(c===e){i=s;break}else c===e.substring(0,c.length)&&(i=s)}if(i!==-1){const s=n[i],o=parseInt(s["LAST-MSN"])||t.lastPartSn;let c=parseInt(s["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const p=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&p>t.partTarget&&(c+=1)}const h=r&&En(r);return new dn(o,c>=0?c:void 0,h)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}return e}playlistLoaded(e,t,r){const{details:n,stats:i}=t,s=self.performance.now(),o=i.loading.first?Math.max(0,s-i.loading.first):0;n.advancedDateTime=Date.now()-o;const c=this.hls.config.timelineOffset;if(c!==n.appliedTimelineOffset){const p=Math.max(c||0,0);n.appliedTimelineOffset=p,n.fragments.forEach(m=>{m.setStart(m.playlistOffset+p)})}if(n.live||r!=null&&r.live){const p="levelInfo"in t?t.levelInfo:t.track;if(n.reloaded(r),r&&n.fragments.length>0){Ra(r,n,this);const le=n.playlistParsingError;if(le){this.warn(le);const fe=this.hls;if(!fe.config.ignorePlaylistParsingErrors){var h;const{networkDetails:Ce}=t;fe.trigger(_.ERROR,{type:ye.NETWORK_ERROR,details:te.LEVEL_PARSING_ERROR,fatal:!1,url:n.url,error:le,reason:le.message,level:t.level||void 0,parent:(h=n.fragments[0])==null?void 0:h.type,networkDetails:Ce,stats:i});return}n.playlistParsingError=null}}n.requestScheduled===-1&&(n.requestScheduled=i.loading.start);const m=this.hls.mainForwardBufferInfo,v=m?m.end-m.len:0,T=(n.edge-v)*1e3,A=ki(n,T);if(n.requestScheduled+A<s?n.requestScheduled=s:n.requestScheduled+=A,this.log(`live playlist ${e} ${n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:n.updated?"UPDATED":"MISSED"}`),!this.canLoad||!n.live)return;let $,U,ie;if(n.canBlockReload&&n.endSN&&n.advanced){const le=this.hls.config.lowLatencyMode,fe=n.lastPartSn,Ce=n.endSN,Fe=n.lastPartIndex,tt=Fe!==-1,Ne=fe===Ce;tt?Ne?(U=Ce+1,ie=le?0:Fe):(U=fe,ie=le?Fe+1:n.maxPartIndex):U=Ce+1;const Xe=n.age,qe=Xe+n.ageHeader;let ze=Math.min(qe-n.partTarget,n.targetduration*1.5);if(ze>0){if(qe>n.targetduration*3)this.log(`Playlist last advanced ${Xe.toFixed(2)}s ago. Omitting segment and part directives.`),U=void 0,ie=void 0;else if(r!=null&&r.tuneInGoal&&qe-n.partTarget>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${ze} with playlist age: ${n.age}`),ze=0;else{const ft=Math.floor(ze/n.targetduration);if(U+=ft,ie!==void 0){const Ut=Math.round(ze%n.targetduration/n.partTarget);ie+=Ut}this.log(`CDN Tune-in age: ${n.ageHeader}s last advanced ${Xe.toFixed(2)}s goal: ${ze} skip sn ${ft} to part ${ie}`)}n.tuneInGoal=ze}if($=this.getDeliveryDirectives(n,t.deliveryDirectives,U,ie),le||!Ne){n.requestScheduled=s,this.loadingPlaylist(p,$);return}}else(n.canBlockReload||n.canSkipUntil)&&($=this.getDeliveryDirectives(n,t.deliveryDirectives,U,ie));$&&U!==void 0&&n.canBlockReload&&(n.requestScheduled=i.loading.first+Math.max(A-o*2,A/2)),this.scheduleLoading(p,$,n)}else this.clearTimer()}scheduleLoading(e,t,r){const n=r||e.details;if(!n){this.loadingPlaylist(e,t);return}const i=self.performance.now(),s=n.requestScheduled;if(i>=s){this.loadingPlaylist(e,t);return}const o=s-i;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(o)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),o)}getDeliveryDirectives(e,t,r,n){let i=En(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,n=t.part,i=kr.No),new dn(r,n,i)}checkRetry(e){const t=e.details,r=On(e),n=e.errorAction,{action:i,retryCount:s=0,retryConfig:o}=n||{},c=!!n&&!!o&&(i===ur.RetryRequest||!n.resolved&&i===ur.SendAlternateToPenaltyBox);if(c){var h;if(s>=o.maxNumRetry)return!1;if(r&&(h=e.context)!=null&&h.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const p=Vr(o,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),p),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${p}ms`)}e.levelRetry=!0,n.resolved=!0}return c}}function yl(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!xa(a[t].attrs,e[t].attrs))return!1;return!0}function xa(a,e,t){const r=a["STABLE-RENDITION-ID"];return r&&!t?r===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(n=>a[n]!==e[n])}function zo(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Du extends $o{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(_.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(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:r,groupId:n,details:i}=t,s=this.tracksInGroup[r];if(!s||s.groupId!==n){this.warn(`Audio track with id:${r} and group:${n} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Audio track ${r} "${s.name}" lang:${s.lang} group:${n} loaded [${i.startSN}-${i.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const r=t.audioGroups||null,n=this.groupIds;let i=this.currentTrack;if(!r||(n==null?void 0:n.length)!==(r==null?void 0:r.length)||r!=null&&r.some(o=>(n==null?void 0:n.indexOf(o))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(v=>!r||r.indexOf(v.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(v=>v.default)&&(this.selectDefaultTrack=!1),o.forEach((v,T)=>{v.id=T});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const c=this.hls.config.audioPreference;if(!i&&c){const v=An(c,o,an);if(v>-1)i=o[v];else{const T=An(c,this.tracks);i=this.tracks[T]}}let h=this.findTrackId(i);h===-1&&i&&(h=this.findTrackId(null));const p={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${r==null?void 0:r.join(",")}`),this.hls.trigger(_.AUDIO_TRACKS_UPDATED,p);const m=this.trackId;if(h!==-1&&m===-1)this.setAudioTrack(h);else if(o.length&&m===-1){var s;const v=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${o.length}`);this.warn(v.message),this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:v})}}}onError(e,t){t.fatal||!t.context||t.context.type===De.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const r=this.allAudioTracks;if(this.selectDefaultTrack=!1,r.length){const n=this.currentTrack;if(n&&zn(e,n,an))return n;const i=An(e,this.tracksInGroup,an);if(i>-1){const s=this.tracksInGroup[i];return this.setAudioTrack(i),s}else if(n){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const o=Rr(e,t.levels,r,s,an);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=An(e,r);if(s>-1)return r[s]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const r=this.currentTrack,n=t[e],i=n.details&&!n.details.live;if(e===this.trackId&&n===r&&i||(this.log(`Switching to audio-track ${e} "${n.name}" lang:${n.lang} group:${n.groupId} channels:${n.channels}`),this.trackId=e,this.currentTrack=n,this.hls.trigger(_.AUDIO_TRACK_SWITCHING,S({},n)),i))return;const s=this.switchParams(n.url,r==null?void 0:r.details,n.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const n=t[r];if(!(this.selectDefaultTrack&&!n.default)&&(!e||zn(e,n,an)))return r}if(e){const{name:r,lang:n,assocLang:i,characteristics:s,audioCodec:o,channels:c}=e;for(let h=0;h<t.length;h++){const p=t[h];if(zn({name:r,lang:n,assocLang:i,characteristics:s,audioCodec:o,channels:c},p,an))return h}for(let h=0;h<t.length;h++){const p=t[h];if(xa(e.attrs,p.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return h}for(let h=0;h<t.length;h++){const p=t[h];if(xa(e.attrs,p.attrs,["LANGUAGE"]))return h}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&mi(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,n=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading audio-track ${r} "${e.name}" lang:${e.lang} group:${n}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(_.AUDIO_TRACK_LOADING,{url:i,id:r,groupId:n,deliveryDirectives:t||null,track:e})}}class ku{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,r){if(this.queues===null||this.tracks===null)return;const n=this.queues[t];n.push(e),n.length===1&&!r&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const r={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(r,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const r={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(r)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const r=(t=e[0])==null?void 0:t.label;(r==="async-blocker"||r==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const n=t[0];try{n.execute()}catch(i){var r;if(n.onError(i),this.queues===null||this.tracks===null)return;const s=(r=this.tracks[e])==null?void 0:r.buffer;s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
${this.list("video")}
${this.list("audio")}
${this.list("audiovideo")}}`}list(e){var t,r;return(t=this.queues)!=null&&t[e]||(r=this.tracks)!=null&&r[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const r=(t=this.tracks)==null?void 0:t[e],n=r==null?void 0:r.buffer;return n?`SourceBuffer${n.updating?" updating":""}${r.ended?" ended":""}${r.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(r=>r.label).join(", "))||""}}const bl=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,El="HlsJsTrackRemovedError";class Cu extends Error{constructor(e){super(e),this.name=El}}class Lu extends V{constructor(e,t){super("buffer-controller",e.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=r=>{var n;this.hls&&((n=this.mediaSource)==null?void 0:n.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=r=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=r=>{const{media:n,mediaSource:i}=this;r&&this.log("Media source opened"),!(!n||!i)&&(i.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(_.MEDIA_ATTACHED,{media:n,mediaSource:i}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:r,_objectUrl:n}=this;r!==n&&this.error(`Media element src was set while attaching MediaSource (${n} > ${r})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=Ie(ve(e.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:e}=this;e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.BUFFER_RESET,this.onBufferReset,this),e.on(_.BUFFER_APPENDING,this.onBufferAppending,this),e.on(_.BUFFER_CODECS,this.onBufferCodecs,this),e.on(_.BUFFER_EOS,this.onBufferEos,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.FRAG_PARSED,this.onFragParsed,this),e.on(_.FRAG_CHANGED,this.onFragChanged,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.BUFFER_RESET,this.onBufferReset,this),e.off(_.BUFFER_APPENDING,this.onBufferAppending,this),e.off(_.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_.BUFFER_EOS,this.onBufferEos,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.FRAG_PARSED,this.onFragParsed,this),e.off(_.FRAG_CHANGED,this.onFragChanged,this),e.off(_.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const r={};if(this.operationQueue){const i=this.isUpdating();i||this.operationQueue.removeBlockers();const s=this.isQueued();(i||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${i?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const n=this.transferData;return!this.sourceBufferCount&&n&&n.mediaSource===t?b(r,n.tracks):this.sourceBuffers.forEach(i=>{const[s]=i;s&&(r[s]=b({},this.tracks[s]),this.removeBuffer(s)),i[0]=i[1]=null}),{media:e,mediaSource:t,tracks:r}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var r;let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsTotal=n,this.log(`${n} bufferCodec event(s) expected.`),(r=this.transferData)!=null&&r.mediaSource&&this.sourceBufferCount&&n&&this.bufferCreated()}onMediaAttaching(e,t){const r=this.media=t.media;this.transferData=this.overrides=void 0;const n=ve(this.appendSource);if(n){const i=!!t.mediaSource;(i||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new n;if(this.assignMediaSource(s),i)this._objectUrl=r.src,this.attachTransferred();else{const o=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{r.removeAttribute("src");const c=self.ManagedMediaSource;r.disableRemotePlayback=r.disableRemotePlayback||c&&s instanceof c,xl(r),Ru(r,o),r.load()}catch(c){r.src=o}else r.src=o}r.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,r;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(r=e.constructor)==null?void 0:r.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const r=this.tracks,n=t.tracks,i=n?Object.keys(n):null,s=i?i.length:0,o=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(n&&i&&s){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: ${nr(r,(c,h)=>c==="initSegment"?void 0:h)};
transfer tracks: ${nr(n,(c,h)=>c==="initSegment"?void 0:h)}}`),!Ae(n,r)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,h=this.details,p=Math.max(c,(h==null?void 0:h.fragments[0].start)||0);if(p-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${p}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(n)}"->"${Object.keys(r)}") start time: ${p} currentTime: ${c}`),this.onMediaDetaching(_.MEDIA_DETACHING,{}),this.onMediaAttaching(_.MEDIA_ATTACHING,t),e.currentTime=p;return}this.transferData=void 0,i.forEach(c=>{const h=c,p=n[h];if(p){const m=p.buffer;if(m){const v=this.fragmentTracker,T=p.id;if(v.hasFragments(T)||v.hasParts(T)){const U=ir.getBuffered(m);v.detectEvictedFragments(h,U,T,null,!0)}const A=Go(h),$=[h,m];this.sourceBuffers[A]=$,m.updating&&this.operationQueue&&this.operationQueue.prependBlocker(h),this.trackSourceBuffer(h,p)}}}),o(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),o()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const r=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:n,mediaSource:i,_objectUrl:s}=this;if(i){if(this.log(`media source ${r?"transferring":"detaching"}`),r)this.sourceBuffers.forEach(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=i.readyState==="open";try{const c=i.sourceBuffers;for(let h=c.length;h--;)o&&c[h].abort(),i.removeSourceBuffer(c[h]);o&&i.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(i.removeEventListener("startstreaming",this._onStartStreaming),i.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}n&&(n.removeEventListener("emptied",this._onMediaEmptied),r||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(n.removeAttribute("src"),this.appendSource&&xl(n),n.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(_.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const r=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),r)try{var n;(n=this.mediaSource)!=null&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(r)}catch(i){this.warn(`onBufferReset ${e}`,i)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[Go(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new ku(this.tracks)}onBufferCodecs(e,t){var r;const n=this.tracks,i=Object.keys(t);this.log(`BUFFER_CODECS: "${i}" (current SB count ${this.sourceBufferCount})`);const s="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),o=!s&&this.sourceBufferCount&&this.media&&i.some(c=>!n[c]);if(s||o){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${i}" SourceBuffers`);return}i.forEach(c=>{var h,p;const m=t[c],{id:v,codec:T,levelCodec:A,container:$,metadata:U,supplemental:ie}=m;let le=n[c];const fe=(h=this.transferData)==null||(h=h.tracks)==null?void 0:h[c],Ce=fe!=null&&fe.buffer?fe:le,Fe=(Ce==null?void 0:Ce.pendingCodec)||(Ce==null?void 0:Ce.codec),tt=Ce==null?void 0:Ce.levelCodec;le||(le=n[c]={buffer:void 0,listeners:[],codec:T,supplemental:ie,container:$,levelCodec:A,metadata:U,id:v});const Ne=Ot(Fe,tt),Xe=Ne==null?void 0:Ne.replace(bl,"$1");let qe=Ot(T,A);const ze=(p=qe)==null?void 0:p.replace(bl,"$1");qe&&Ne&&Xe!==ze&&(c.slice(0,5)==="audio"&&(qe=he(qe,this.appendSource)),this.log(`switching codec ${Fe} to ${qe}`),qe!==(le.pendingCodec||le.codec)&&(le.pendingCodec=qe),le.container=$,this.appendChangeType(c,$,qe))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&((r=t.audio)==null?void 0:r.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const r=this.tracks[t];return e[t]={id:r.id,container:r.container,codec:r.codec,levelCodec:r.levelCodec},e},{})}appendChangeType(e,t,r){const n=`${t};codecs=${r}`,i={label:`change-type=${n}`,execute:()=>{const s=this.tracks[e];if(s){const o=s.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${n}`),o.changeType(n),s.codec=r,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(i,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const r=e.start,n=r+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(r,pe.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var o;const c=this.tracks.video;(this.lastVideoAppendEnd>n||c!=null&&c.buffer&&ir.isBuffered(c.buffer,n)||((o=this.fragmentTracker.getAppendedFrag(n,pe.MAIN))==null?void 0:o.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn("Error executing block-audio operation",o)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:r}=this,{data:n,type:i,parent:s,frag:o,part:c,chunkMeta:h,offset:p}=t,m=h.buffering[i],{sn:v,cc:T}=o,A=self.performance.now();m.start=A;const $=o.stats.buffering,U=c?c.stats.buffering:null;$.start===0&&($.start=A),U&&U.start===0&&(U.start=A);const ie=r.audio;let le=!1;i==="audio"&&(ie==null?void 0:ie.container)==="audio/mpeg"&&(le=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const fe=r.video,Ce=fe==null?void 0:fe.buffer;if(Ce&&v!=="initSegment"){const Ne=c||o,Xe=this.blockedAudioAppend;if(i==="audio"&&s!=="main"&&!this.blockedAudioAppend&&!(fe.ending||fe.ended)){const ze=Ne.start+Ne.duration*.05,ft=Ce.buffered,Ut=this.currentOp("video");!ft.length&&!Ut?this.blockAudio(Ne):!Ut&&!ir.isBuffered(Ce,ze)&&this.lastVideoAppendEnd<ze&&this.blockAudio(Ne)}else if(i==="video"){const qe=Ne.end;if(Xe){const ze=Xe.frag.start;(qe>ze||qe<this.lastVideoAppendEnd||ir.isBuffered(Ce,ze))&&this.unblockAudio()}this.lastVideoAppendEnd=qe}}const Fe=(c||o).start,tt={label:`append-${i}`,execute:()=>{var Ne;m.executeStart=self.performance.now();const Xe=(Ne=this.tracks[i])==null?void 0:Ne.buffer;Xe&&(le?this.updateTimestampOffset(Xe,Fe,.1,i,v,T):p!==void 0&&F(p)&&this.updateTimestampOffset(Xe,p,1e-6,i,v,T)),this.appendExecutor(n,i)},onStart:()=>{},onComplete:()=>{const Ne=self.performance.now();m.executeEnd=m.end=Ne,$.first===0&&($.first=Ne),U&&U.first===0&&(U.first=Ne);const Xe={};this.sourceBuffers.forEach(([qe,ze])=>{qe&&(Xe[qe]=ir.getBuffered(ze))}),this.appendErrors[i]=0,i==="audio"||i==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(_.BUFFER_APPENDED,{type:i,frag:o,part:c,chunkMeta:h,parent:o.type,timeRanges:Xe})},onError:Ne=>{var Xe;const qe={type:ye.MEDIA_ERROR,parent:o.type,details:te.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:o,part:c,chunkMeta:h,error:Ne,err:Ne,fatal:!1},ze=(Xe=this.media)==null?void 0:Xe.error;if(Ne.code===DOMException.QUOTA_EXCEEDED_ERR||Ne.name=="QuotaExceededError"||"quota"in Ne)qe.details=te.BUFFER_FULL_ERROR;else if(Ne.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!ze)qe.errorAction=en(!0);else if(Ne.name===El&&this.sourceBufferCount===0)qe.errorAction=en(!0);else{const ft=++this.appendErrors[i];this.warn(`Failed ${ft}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${i}" sourceBuffer (${ze||"no media error"})`),(ft>=this.hls.config.appendErrorMaxRetry||ze)&&(qe.fatal=!0)}this.hls.trigger(_.ERROR,qe)}};this.log(`queuing "${i}" append sn: ${v}${c?" p: "+c.index:""} of ${o.type===pe.MAIN?"level":"track"} ${o.level} cc: ${T}`),this.append(tt,i,this.isPending(this.tracks[i]))}getFlushOp(e,t,r){return this.log(`queuing "${e}" remove ${t}-${r}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,r)},onStart:()=>{},onComplete:()=>{this.hls.trigger(_.BUFFER_FLUSHED,{type:e})},onError:n=>{this.warn(`Failed to remove ${t}-${r} from "${e}" SourceBuffer`,n)}}}onBufferFlushing(e,t){const{type:r,startOffset:n,endOffset:i}=t;r?this.append(this.getFlushOp(r,n,i),r):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,n,i),s)})}onFragParsed(e,t){const{frag:r,part:n}=t,i=[],s=n?n.elementaryStreams:r.elementaryStreams;s[K.AUDIOVIDEO]?i.push("audiovideo"):(s[K.AUDIO]&&i.push("audio"),s[K.VIDEO]&&i.push("video"));const o=()=>{const c=self.performance.now();r.stats.buffering.end=c,n&&(n.stats.buffering.end=c);const h=n?n.stats:r.stats;this.hls.trigger(_.FRAG_BUFFERED,{frag:r,part:n,stats:h,id:r.type})};i.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers(o,i).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var r;this.sourceBuffers.forEach(([s])=>{if(s){const o=this.tracks[s];(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} buffer reached EOS`)))}});const n=((r=this.overrides)==null?void 0:r.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var o;return s&&!((o=this.tracks[s])!=null&&o.ended)})?n?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:s}=this;if(!s||s.readyState!=="open"){s&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${s.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),s.endOfStream(),this.hls.trigger(_.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(_.BUFFERED_TO_END,void 0)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===te.BUFFER_APPEND_ERROR&&t.frag){var r;const n=(r=t.errorAction)==null?void 0:r.nextAutoLevel;F(n)&&n!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:r}=this;if(!r||t===null||!this.sourceBufferCount)return;const n=e.config,i=r.currentTime,s=t.levelTargetDuration,o=t.live&&n.liveBackBufferLength!==null?n.liveBackBufferLength:n.backBufferLength;if(F(o)&&o>=0){const h=Math.max(o,s),p=Math.floor(i/s)*s-h;this.flushBackBuffer(i,s,p)}const c=n.frontBufferFlushThreshold;if(F(c)&&c>0){const h=Math.max(n.maxBufferLength,c),p=Math.max(h,s),m=Math.floor(i/s)*s+p;this.flushFrontBuffer(i,s,m)}}flushBackBuffer(e,t,r){this.sourceBuffers.forEach(([n,i])=>{if(i){const o=ir.getBuffered(i);if(o.length>0&&r>o.start(0)){var s;this.hls.trigger(_.BACK_BUFFER_REACHED,{bufferEnd:r});const c=this.tracks[n];if((s=this.details)!=null&&s.live)this.hls.trigger(_.LIVE_BACK_BUFFER_REACHED,{bufferEnd:r});else if(c!=null&&c.ended){this.log(`Cannot flush ${n} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(_.BUFFER_FLUSHING,{startOffset:0,endOffset:r,type:n})}}})}flushFrontBuffer(e,t,r){this.sourceBuffers.forEach(([n,i])=>{if(i){const s=ir.getBuffered(i),o=s.length;if(o<2)return;const c=s.start(o-1),h=s.end(o-1);if(r>c||e>=c&&e<=h)return;this.hls.trigger(_.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:n})}})}getDurationAndRange(){var e;const{details:t,mediaSource:r}=this;if(!t||!this.media||(r==null?void 0:r.readyState)!=="open")return null;const n=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&r.setLiveSeekableRange){const h=Math.max(0,t.fragmentStart),p=Math.max(h,n);return{duration:1/0,start:h,end:p}}return{duration:1/0}}const i=(e=this.overrides)==null?void 0:e.duration;if(i)return F(i)?{duration:i}:null;const s=this.media.duration,o=F(r.duration)?r.duration:0;return n>o&&n>s||!F(s)?{duration:n}:null}updateMediaSource({duration:e,start:t,end:r}){const n=this.mediaSource;!this.media||!n||n.readyState!=="open"||(n.duration!==e&&(F(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),n.duration=e),t!==void 0&&r!==void 0&&(this.log(`MediaSource duration is set to ${n.duration}. Setting seekable range to ${t}-${r}.`),n.setLiveSeekableRange(t,r)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:r}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${nr(r)}`),this.tracksReady){var n;const i=(n=this.transferData)==null?void 0:n.tracks;i&&Object.keys(i).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,r])=>{if(t){const n=this.tracks[t];e[t]={buffer:r,container:n.container,codec:n.codec,supplemental:n.supplemental,levelCodec:n.levelCodec,id:n.id,metadata:n.metadata}}}),this.hls.trigger(_.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:r}=this;if(!r)throw new Error("createSourceBuffers called when mediaSource was null");for(const i in e){const s=i,o=e[s];if(this.isPending(o)){const c=this.getTrackCodec(o,s),h=`${o.container};codecs=${c}`;o.codec=c,this.log(`creating sourceBuffer(${h})${this.currentOp(s)?" Queued":""} ${nr(o)}`);try{const p=r.addSourceBuffer(h),m=Go(s),v=[s,p];t[m]=v,o.buffer=p}catch(p){var n;this.error(`error while trying to add sourceBuffer: ${p.message}`),this.shiftAndExecuteNext(s),(n=this.operationQueue)==null||n.removeBlockers(),delete this.tracks[s],this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:p,sourceBufferName:s,mimeType:h,parent:o.id});return}this.trackSourceBuffer(s,o)}}this.bufferCreated()}getTrackCodec(e,t){const r=e.supplemental;let n=e.codec;r&&(t==="video"||t==="audiovideo")&&ke(r,"video")&&(n=It(n,r));const i=Ot(n,e.levelCodec);return i?t.slice(0,5)==="audio"?he(i,this.appendSource):i:""}trackSourceBuffer(e,t){const r=t.buffer;if(!r)return;const n=this.getTrackCodec(t,e);this.tracks[e]={buffer:r,codec:n,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(i,s)=>{const o=s.removedRanges;o!=null&&o.length&&this.hls.trigger(_.BUFFER_FLUSHED,{type:i})})}get mediaSrc(){var e,t;const r=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return r==null?void 0:r.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const r=this.currentOp(e);r&&(r.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var r;const n=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(r=this.mediaSource)==null?void 0:r.readyState}`);this.error(`${n}`,t),this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:n,fatal:!1});const i=this.currentOp(e);i&&i.onError(n)}updateTimestampOffset(e,t,r,n,i,s){const o=t-e.timestampOffset;Math.abs(o)>=r&&(this.log(`Updating ${n} SourceBuffer timestampOffset to ${t} (sn: ${i} cc: ${s})`),e.timestampOffset=t)}removeExecutor(e,t,r){const{media:n,mediaSource:i}=this,s=this.tracks[e],o=s==null?void 0:s.buffer;if(!n||!i||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=F(n.duration)?n.duration:1/0,h=F(i.duration)?i.duration:1/0,p=Math.max(0,t),m=Math.min(r,c,h);m>p&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${p},${m}] from the ${e} SourceBuffer`),o.remove(p,m)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const r=this.tracks[t],n=r==null?void 0:r.buffer;if(!n)throw new Cu(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);r.ending=!1,r.ended=!1,n.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:r}=this,n=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(n).then(s=>{r===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var r;const n=(r=this.tracks[t])==null?void 0:r.buffer;!n||n.updating||this.shiftAndExecuteNext(t)})}append(e,t,r){this.operationQueue&&this.operationQueue.append(e,t,r)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,r){const n=this.tracks[e];if(!n)return;const i=n.buffer;if(!i)return;const s=r.bind(this,e);n.listeners.push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const r=t.buffer;r&&(t.listeners.forEach(n=>{r.removeEventListener(n.event,n.listener)}),t.listeners.length=0)}}function xl(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Ru(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function Go(a){return a==="audio"?1:0}class Ko{constructor(e){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=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(_.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.BUFFER_CODECS,this.onBufferCodecs,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(_.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const r=this.hls.levels[t.droppedLevel];this.isLevelAllowed(r)&&this.restrictedLevels.push({bitrate:r.bitrate,height:r.height,width:r.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const r=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,r.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&F(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.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 e=this.hls.levels;if(e.length){const t=this.hls,r=this.getMaxLevel(e.length-1);r!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${r}: ${e[r].height}p@${e[r].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=r,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const r=t.filter((n,i)=>this.isLevelAllowed(n)&&i<=e);return this.clientRect=null,Ko.getMaxLevelByMediaSize(r,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 e=this.media,t={width:0,height:0};if(e){const r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,!t.width&&!t.height&&(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(r=>e.bitrate===r.bitrate&&e.width===r.width&&e.height===r.height)}static getMaxLevelByMediaSize(e,t,r){if(!(e!=null&&e.length))return-1;const n=(o,c)=>c?o.width!==c.width||o.height!==c.height:!0;let i=e.length-1;const s=Math.max(t,r);for(let o=0;o<e.length;o+=1){const c=e[o];if((c.width>=s||c.height>=s)&&n(c,e[o+1])){i=o;break}}return i}}const jn={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Iu={HLS:"h"};class zi{constructor(e,t){Array.isArray(e)&&(e=e.map(r=>r instanceof zi?r:new zi(r))),this.value=e,this.params=t}}const Pu="Dict";function Ou(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function Mu(a,e,t,r){return new Error(`failed to ${a} "${Ou(e)}" as ${t}`,{cause:r})}function Gi(a,e,t){return Mu("serialize",a,e,t)}class wl{constructor(e){this.description=e}}const Sl="Bare Item",Fu="Boolean";function Bu(a){if(typeof a!="boolean")throw Gi(a,Fu);return a?"?1":"?0"}function Nu(a){return btoa(String.fromCharCode(...a))}const Uu="Byte Sequence";function $u(a){if(ArrayBuffer.isView(a)===!1)throw Gi(a,Uu);return`:${Nu(a)}:`}const zu="Integer";function Gu(a){return a<-999999999999999||999999999999999<a}function Tl(a){if(Gu(a))throw Gi(a,zu);return a.toString()}function Ku(a){return`@${Tl(a.getTime()/1e3)}`}function Al(a,e){if(a<0)return-Al(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const n=Math.floor(a*t);return(n%2===0?n:n+1)/t}else return Math.round(a*t)/t}const Hu="Decimal";function ju(a){const e=Al(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Gi(a,Hu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Vu="String",Wu=/[\x00-\x1f\x7f]+/;function Yu(a){if(Wu.test(a))throw Gi(a,Vu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function qu(a){return a.description||a.toString().slice(7,-1)}const Zu="Token";function Dl(a){const e=qu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Gi(e,Zu);return e}function Ho(a){switch(typeof a){case"number":if(!F(a))throw Gi(a,Sl);return Number.isInteger(a)?Tl(a):ju(a);case"string":return Yu(a);case"symbol":return Dl(a);case"boolean":return Bu(a);case"object":if(a instanceof Date)return Ku(a);if(a instanceof Uint8Array)return $u(a);if(a instanceof wl)return Dl(a);default:throw Gi(a,Sl)}}const Xu="Key";function jo(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Gi(a,Xu);return a}function Vo(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${jo(e)}`:`;${jo(e)}=${Ho(t)}`).join("")}function kl(a){return a instanceof zi?`${Ho(a.value)}${Vo(a.params)}`:Ho(a)}function Qu(a){return`(${a.value.map(kl).join(" ")})${Vo(a.params)}`}function Ju(a,e={whitespace:!0}){if(typeof a!="object"||a==null)throw Gi(a,Pu);const t=a instanceof Map?a.entries():Object.entries(a),r=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([n,i])=>{i instanceof zi||(i=new zi(i));let s=jo(n);return i.value===!0?s+=Vo(i.params):(s+="=",Array.isArray(i.value)?s+=Qu(i):s+=kl(i)),s}).join(`,${r}`)}function Cl(a,e){return Ju(a,e)}const Ki="CMCD-Object",nn="CMCD-Request",Ss="CMCD-Session",ds="CMCD-Status",e0={br:Ki,ab:Ki,d:Ki,ot:Ki,tb:Ki,tpb:Ki,lb:Ki,tab:Ki,lab:Ki,url:Ki,pb:nn,bl:nn,tbl:nn,dl:nn,ltc:nn,mtp:nn,nor:nn,nrr:nn,rc:nn,sn:nn,sta:nn,su:nn,ttfb:nn,ttfbb:nn,ttlb:nn,cmsdd:nn,cmsds:nn,smrt:nn,df:nn,cs:nn,ts:nn,cid:Ss,pr:Ss,sf:Ss,sid:Ss,st:Ss,v:Ss,msd:Ss,bs:ds,bsd:ds,cdn:ds,rtp:ds,bg:ds,pt:ds,ec:ds,e:ds},t0={REQUEST:nn};function r0(a){return Object.keys(a).reduce((e,t)=>{var r;return(r=a[t])===null||r===void 0||r.forEach(n=>e[n]=t),e},{})}function n0(a,e){const t={};if(!a)return t;const r=Object.keys(a),n=e?r0(e):{};return r.reduce((i,s)=>{var o;const c=e0[s]||n[s]||t0.REQUEST,h=(o=i[c])!==null&&o!==void 0?o:i[c]={};return h[s]=a[s],i},t)}function i0(a){return["ot","sf","st","e","sta"].includes(a)}function s0(a){return typeof a=="number"?F(a):a!=null&&a!==""&&a!==!1}const Ll="event";function a0(a,e){const t=new URL(a),r=new URL(e);if(t.origin!==r.origin)return a;const n=t.pathname.split("/").slice(1),i=r.pathname.split("/").slice(1,-1);for(;n[0]===i[0];)n.shift(),i.shift();for(;i.length;)i.shift(),n.unshift("..");return n.join("/")+t.search+t.hash}const ao=a=>Math.round(a),Wo=(a,e)=>Array.isArray(a)?a.map(t=>Wo(t,e)):a instanceof zi&&typeof a.value=="string"?new zi(Wo(a.value,e),a.params):(e.baseUrl&&(a=a0(a,e.baseUrl)),e.version===1?encodeURIComponent(a):a),oo=a=>ao(a/100)*100,o0={br:ao,d:ao,bl:oo,dl:oo,mtp:oo,nor:(a,e)=>{let t=a;return e.version>=2&&(a instanceof zi&&typeof a.value=="string"?t=new zi([a]):typeof a=="string"&&(t=[a])),Wo(t,e)},rtp:oo,tb:ao},Rl="request",Il="response",Yo=["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"],l0=["e"],u0=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function lo(a){return u0.test(a)}function h0(a){return Yo.includes(a)||l0.includes(a)||lo(a)}const Pl=["d","dl","nor","ot","rtp","su"];function c0(a){return Yo.includes(a)||Pl.includes(a)||lo(a)}const f0=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function d0(a){return Yo.includes(a)||Pl.includes(a)||f0.includes(a)||lo(a)}const p0=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function m0(a){return p0.includes(a)||lo(a)}const g0={[Il]:d0,[Ll]:h0,[Rl]:c0};function Ol(a,e={}){const t={};if(a==null||typeof a!="object")return t;const r=e.version||a.v||1,n=e.reportingMode||Rl,i=r===1?m0:g0[n];let s=Object.keys(a).filter(i);const o=e.filter;typeof o=="function"&&(s=s.filter(o));const c=n===Il||n===Ll;c&&!s.includes("ts")&&s.push("ts"),r>1&&!s.includes("v")&&s.push("v");const h=b({},o0,e.formatters),p={version:r,reportingMode:n,baseUrl:e.baseUrl};return s.sort().forEach(m=>{let v=a[m];const T=h[m];if(typeof T=="function"&&(v=T(v,p)),m==="v"){if(r===1)return;v=r}m=="pr"&&v===1||(c&&m==="ts"&&!F(v)&&(v=Date.now()),s0(v)&&(i0(m)&&typeof v=="string"&&(v=new wl(v)),t[m]=v))}),t}function _0(a,e={}){const t={};if(!a)return t;const r=Ol(a,e),n=n0(r,e==null?void 0:e.customHeaderMap);return Object.entries(n).reduce((i,[s,o])=>{const c=Cl(o,{whitespace:!1});return c&&(i[s]=c),i},t)}function v0(a,e,t){return b(a,_0(e,t))}const y0="CMCD";function b0(a,e={}){return a?Cl(Ol(a,e),{whitespace:!1}):""}function E0(a,e={}){if(!a)return"";const t=b0(a,e);return encodeURIComponent(t)}function x0(a,e={}){if(!a)return"";const t=E0(a,e);return`${y0}=${t}`}const Ml=/CMCD=[^&#]+/;function w0(a,e,t){const r=x0(e,t);if(!r)return a;if(Ml.test(a))return a.replace(Ml,r);const n=a.includes("?")?"&":"?";return`${a}${n}${r}`}class S0{constructor(e){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=n=>{try{this.apply(n,{ot:jn.MANIFEST,su:!this.initialized})}catch(i){this.hls.logger.warn("Could not generate manifest CMCD data.",i)}},this.applyFragmentData=n=>{try{const{frag:i,part:s}=n,o=this.hls.levels[i.level],c=this.getObjectType(i),h={d:(s||i).duration*1e3,ot:c};(c===jn.VIDEO||c===jn.AUDIO||c==jn.MUXED)&&(h.br=o.bitrate/1e3,h.tb=this.getTopBandwidth(c)/1e3,h.bl=this.getBufferLength(c));const p=s?this.getNextPart(s):this.getNextFrag(i);p!=null&&p.url&&p.url!==i.url&&(h.nor=p.url),this.apply(n,h)}catch(i){this.hls.logger.warn("Could not generate segment CMCD data.",i)}},this.hls=e;const t=this.config=e.config,{cmcd:r}=t;r!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||e.sessionId,this.cid=r.contentId,this.useHeaders=r.useHeaders===!0,this.includeKeys=r.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHED,this.onMediaDetached,this),e.on(_.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHED,this.onMediaDetached,this),e.off(_.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(e,t){this.media=t.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(e,t){var r,n;this.audioBuffer=(r=t.tracks.audio)==null?void 0:r.buffer,this.videoBuffer=(n=t.tracks.video)==null?void 0:n.buffer}createData(){var e;return{v:1,sf:Iu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){b(t,this.createData());const r=t.ot===jn.INIT||t.ot===jn.VIDEO||t.ot===jn.MUXED;this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:n}=this;n&&(t=Object.keys(t).reduce((s,o)=>(n.includes(o)&&(s[o]=t[o]),s),{}));const i={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),v0(e.headers,t,i)):e.url=w0(e.url,t,i)}getNextFrag(e){var t;const r=(t=this.hls.levels[e.level])==null?void 0:t.details;if(r){const n=e.sn-r.startSN;return r.fragments[n+1]}}getNextPart(e){var t;const{index:r,fragment:n}=e,i=(t=this.hls.levels[n.level])==null||(t=t.details)==null?void 0:t.partList;if(i){const{sn:s}=n;for(let o=i.length-1;o>=0;o--){const c=i[o];if(c.index===r&&c.fragment.sn===s)return i[o+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return jn.TIMED_TEXT;if(e.sn==="initSegment")return jn.INIT;if(t==="audio")return jn.AUDIO;if(t==="main")return this.hls.audioTracks.length?jn.VIDEO:jn.MUXED}getTopBandwidth(e){let t=0,r;const n=this.hls;if(e===jn.AUDIO)r=n.audioTracks;else{const i=n.maxAutoLevel,s=i>-1?i+1:n.levels.length;r=n.levels.slice(0,s)}return r.forEach(i=>{i.bitrate>t&&(t=i.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,r=e===jn.AUDIO?this.audioBuffer:this.videoBuffer;return!r||!t?NaN:ir.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,r=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new r(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,o){t(i),this.loader.load(i,s,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,r=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new r(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,o){t(i),this.loader.load(i,s,o)}}}}const T0=3e5;class A0 extends V{constructor(e){super("content-steering",e.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=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);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(e){const t=this.levels;t&&(this.levels=t.filter(r=>r!==e))}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(e,t){const{contentSteering:r}=t;r!==null&&(this.pathwayId=r.pathwayId,this.uri=r.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:r}=t;if((r==null?void 0:r.action)===ur.SendAlternateToPenaltyBox&&r.flags===Pr.MoveAllAlternatesMatchingHost){const n=this.levels;let i=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:c,type:h}=t.context;o&&n?s=this.getPathwayForGroupId(o,h,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!i&&n&&(i=this.pathways()),i&&i.length>1&&(this.updatePathwayPriority(i),r.resolved=this.pathwayId!==s),t.details===te.BUFFER_APPEND_ERROR&&!t.fatal?r.resolved=!0:r.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${n&&n.length} priorities: ${nr(i)} penalized: ${nr(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const r=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${r}"`),t=this.getLevelsForPathway(r),this.pathwayId=r}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const r=this.penalizedPathways,n=performance.now();Object.keys(r).forEach(i=>{n-r[i]>T0&&delete r[i]});for(let i=0;i<e.length;i++){const s=e[i];if(s in r)continue;if(s===this.pathwayId)return;const o=this.hls.nextLoadLevel,c=this.hls.levels[o];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,Oa(t),this.hls.trigger(_.LEVELS_UPDATED,{levels:t});const h=this.hls.levels[o];c&&h&&this.levels&&(h.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&h.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${h.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,r){const n=this.getLevelsForPathway(r).concat(this.levels||[]);for(let i=0;i<n.length;i++)if(t===De.AUDIO_TRACK&&n[i].hasAudioGroup(e)||t===De.SUBTITLE_TRACK&&n[i].hasSubtitleGroup(e))return n[i].pathwayId;return r}clonePathways(e){const t=this.levels;if(!t)return;const r={},n={};e.forEach(i=>{const{ID:s,"BASE-ID":o,"URI-REPLACEMENT":c}=i;if(t.some(p=>p.pathwayId===s))return;const h=this.getLevelsForPathway(o).map(p=>{const m=new ar(p.attrs);m["PATHWAY-ID"]=s;const v=m.AUDIO&&`${m.AUDIO}_clone_${s}`,T=m.SUBTITLES&&`${m.SUBTITLES}_clone_${s}`;v&&(r[m.AUDIO]=v,m.AUDIO=v),T&&(n[m.SUBTITLES]=T,m.SUBTITLES=T);const A=Bl(p.uri,m["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),$=new yr({attrs:m,audioCodec:p.audioCodec,bitrate:p.bitrate,height:p.height,name:p.name,url:A,videoCodec:p.videoCodec,width:p.width});if(p.audioGroups)for(let U=1;U<p.audioGroups.length;U++)$.addGroupId("audio",`${p.audioGroups[U]}_clone_${s}`);if(p.subtitleGroups)for(let U=1;U<p.subtitleGroups.length;U++)$.addGroupId("text",`${p.subtitleGroups[U]}_clone_${s}`);return $});t.push(...h),Fl(this.audioTracks,r,c,s),Fl(this.subtitleTracks,n,c,s)})}loadSteeringManifest(e){const t=this.hls.config,r=t.loader;this.loader&&this.loader.destroy(),this.loader=new r(t);let n;try{n=new self.URL(e)}catch(p){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(n.protocol!=="data:"){const p=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;n.searchParams.set("_HLS_pathway",this.pathwayId),n.searchParams.set("_HLS_throughput",""+p)}const i={responseType:"json",url:n.href},s=t.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},h={onSuccess:(p,m,v,T)=>{this.log(`Loaded steering manifest: "${n}"`);const A=p.data;if((A==null?void 0:A.VERSION)!==1){this.log(`Steering VERSION ${A.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=A.TTL;const{"RELOAD-URI":$,"PATHWAY-CLONES":U,"PATHWAY-PRIORITY":ie}=A;if($)try{this.uri=new self.URL($,n).href}catch(fe){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${$}`);return}this.scheduleRefresh(this.uri||v.url),U&&this.clonePathways(U);const le={steeringManifest:A,url:n.toString()};this.hls.trigger(_.STEERING_MANIFEST_LOADED,le),ie&&this.updatePathwayPriority(ie)},onError:(p,m,v,T)=>{if(this.log(`Error loading steering manifest: ${p.code} ${p.text} (${m.url})`),this.stopLoad(),p.code===410){this.enabled=!1,this.log(`Steering manifest ${m.url} no longer available`);return}let A=this.timeToLoad*1e3;if(p.code===429){const $=this.loader;if(typeof($==null?void 0:$.getResponseHeader)=="function"){const U=$.getResponseHeader("Retry-After");U&&(A=parseFloat(U)*1e3)}this.log(`Steering manifest ${m.url} rate limited`);return}this.scheduleRefresh(this.uri||m.url,A)},onTimeout:(p,m,v)=>{this.log(`Timeout loading steering manifest (${m.url})`),this.scheduleRefresh(this.uri||m.url)}};this.log(`Requesting steering manifest: ${n}`),this.loader.load(i,c,h)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var r;const n=(r=this.hls)==null?void 0:r.media;if(n&&!n.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function Fl(a,e,t,r){a&&Object.keys(e).forEach(n=>{const i=a.filter(s=>s.groupId===n).map(s=>{const o=b({},s);return o.details=void 0,o.attrs=new ar(o.attrs),o.url=o.attrs.URI=Bl(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[n],o.attrs["PATHWAY-ID"]=r,o});a.push(...i)})}function Bl(a,e,t,r){const{HOST:n,PARAMS:i,[t]:s}=r;let o;e&&(o=s==null?void 0:s[e],o&&(a=o));const c=new self.URL(a);return n&&!o&&(c.host=n),i&&Object.keys(i).sort().forEach(h=>{h&&c.searchParams.set(h,i[h])}),c.href}class Ks extends V{constructor(e){super("eme",e.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=Ks.CDMCleanupPromise?[Ks.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:r,initData:n}=t,i=`"${t.type}" event: init data type: "${r}"`;if(this.debug(i),n!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=ai(this.config));const o=s.map(Zn).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(s=>{const o=si(s);if(r!=="sinf"||o!==fr.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${r}" for selected key-system ${o}`);return}let c;try{const T=nt(new Uint8Array(n)),A=Wi(JSON.parse(T).sinf),$=_t(A);if(!$)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array($.subarray(8,24))}catch(T){this.warn(`${i} Failed to parse sinf: ${T}`);return}const h=Y(c),{keyIdToKeySessionPromise:p,mediaKeySessions:m}=this;let v=p[h];for(let T=0;T<m.length;T++){const A=m[T],$=A.decryptdata;if(!$.keyId)continue;const U=Y($.keyId);if(Rn(c,$.keyId)||$.uri.replace(/-/g,"").indexOf(h)!==-1){if(v=p[U],!v)continue;if($.pssh)break;delete p[U],$.pssh=new Uint8Array(n),$.keyId=c,v=p[h]=v.then(()=>this.generateRequestWithPreferredKeySession(A,r,n,"encrypted-event-key-match")),v.catch(ie=>this.handleError(ie));break}}v||this.handleError(new Error(`Key ID ${h} not encountered in playlist. Key-system sessions ${m.length}.`))}).catch(s=>this.handleError(s))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(_.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(_.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(_.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(_.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(_.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(_.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,n=t==null?void 0:t[e];if(n)return n.licenseUrl;if(e===fr.WIDEVINE&&r)return r}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,r=t==null?void 0:t[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(s,o,c)=>!!s&&c.indexOf(s)===o,n=t.map(s=>s.audioCodec).filter(r),i=t.map(s=>s.videoCodec).filter(r);return n.length+i.length===0&&i.push("avc1.42e01e"),new Promise((s,o)=>{const c=h=>{const p=h.shift();this.getMediaKeysPromise(p,n,i).then(m=>s({keySystem:p,mediaKeys:m})).catch(m=>{h.length?c(h):m instanceof Jn?o(m):o(new Jn({type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_NO_ACCESS,error:m,fatal:!0},m.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if(typeof r!="function"){let n=`Configured requestMediaKeySystemAccess is not a function ${r}`;return Bi===null&&self.location.protocol==="http:"&&(n=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(n))}return r(e,t)}getMediaKeysPromise(e,t,r){var n;const i=Eo(e,t,r,this.config.drmSystemOptions||{});let s=this.keySystemAccessPromises[e],o=(n=s)==null?void 0:n.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${nr(i)}`),o=this.requestMediaKeySystemAccess(e,i);const c=s=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(h=>{this.log(`Failed to obtain access to key-system "${e}": ${h}`)}),o.then(h=>{this.log(`Access for key-system "${h.keySystem}" obtained`);const p=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const m=c.mediaKeys=h.createMediaKeys().then(v=>(this.log(`Media-keys created for "${e}"`),c.hasMediaKeys=!0,p.then(T=>T?this.setMediaKeysServerCertificate(v,e,T):v)));return m.catch(v=>{this.error(`Failed to create media-keys for "${e}"}: ${v}`)}),m})}return o.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${Y(e.keyId||[])} keyUri: ${e.uri}`);const n=r.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:n,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),n=uo(t),i="cenc";this.keyIdToKeySessionPromise[n]=this.generateRequestWithPreferredKeySession(r,i,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyId ${Y(e.decryptdata.keyId||[])}
} (data length: ${t.byteLength})`),r.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>Zn(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:r})=>this.attemptSetMediaKeys(t,r))}selectKeySystem(e){return new Promise((t,r)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:n})=>{const i=Zn(n);i?t(i):r(new Error(`Unable to find format for key-system "${n}"`))}).catch(r)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=ai(this.config),r=e.map(si).filter(n=>!!n&&t.indexOf(n)!==-1);return this.selectKeySystem(r)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let r=0;r<t.length;r++){const n=D0(e,t[r]);if(n)return n}}loadKey(e){const t=e.keyInfo.decryptdata,r=uo(t),n=this.bannedKeyIds[r];if(n||this.getKeyStatus(t)==="internal-error"){const o=Nl(n||"internal-error",t);return this.handleError(o,e.frag),Promise.reject(o)}const i=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);const s=this.keyIdToKeySessionPromise[r];if(!s){const o=this.getKeySystemForKeyPromise(t).then(({keySystem:c,mediaKeys:h})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(c,h).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:c,mediaKeys:h,decryptdata:t}))))).then(c=>{const h="cenc",p=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(c,h,p,"playlist-key")});return o.catch(c=>this.handleError(c,e.frag)),this.keyIdToKeySessionPromise[r]=o,o}return s.catch(o=>{if(o instanceof Jn){const c=S({},o.data);this.getKeyStatus(t)==="internal-error"&&(c.decryptdata=t);const h=new Jn(c,o.message);this.handleError(h,e.frag)}}),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof Jn){t&&(e.data.frag=t);const r=e.data.decryptdata;this.error(`${e.message}${r?` (${Y(r.keyId||[])})`:""}`),this.hls.trigger(_.ERROR,e.data)}else this.error(e.message),this.hls.trigger(_.ERROR,{type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){const t=uo(e),r=this.keyIdToKeySessionPromise[t];if(!r){const n=si(e.keyFormat),i=n?[n]:ai(this.config);return this.attemptKeySystemAccess(i)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=ai(this.config)),e.length===0)throw new Jn({type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${nr({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const n=Promise.all(r).then(()=>this.media?this.media.setMediaKeys(t):new Promise((i,s)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return s(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=t,this.media.setMediaKeys(t).then(i).catch(s)}}));return this.mediaKeys=t,this.setMediaKeysQueue.push(n),n.then(()=>{this.log(`Media-keys set for "${e}"`),r.push(n),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(i=>r.indexOf(i)===-1)})}generateRequestWithPreferredKeySession(e,t,r,n){var i;const s=(i=this.config.drmSystems)==null||(i=i[e.keySystem])==null?void 0:i.generateRequest;if(s)try{const A=s.call(this.hls,t,r,e);if(!A)throw new Error("Invalid response from configured generateRequest filter");t=A.initDataType,r=A.initData?A.initData:null,e.decryptdata.pssh=r?new Uint8Array(r):null}catch(A){if(this.warn(A.message),this.hls&&this.hls.config.debug)throw A}if(r===null)return this.log(`Skipping key-session request for "${n}" (no initData)`),Promise.resolve(e);const o=uo(e.decryptdata),c=e.decryptdata.uri;this.log(`Generating key-session request for "${n}" keyId: ${o} URI: ${c} (init data type: ${t} length: ${r.byteLength})`);const h=new Ms,p=e._onmessage=A=>{const $=e.mediaKeysSession;if(!$){h.emit("error",new Error("invalid state"));return}const{messageType:U,message:ie}=A;this.log(`"${U}" message event for session "${$.sessionId}" message size: ${ie.byteLength}`),U==="license-request"||U==="license-renewal"?this.renewLicense(e,ie).catch(le=>{h.eventNames().length?h.emit("error",le):this.handleError(le)}):U==="license-release"?e.keySystem===fr.FAIRPLAY&&this.updateKeySession(e,Yi("acknowledged")).then(()=>this.removeSession(e)).catch(le=>this.handleError(le)):this.warn(`unhandled media key message type "${U}"`)},m=(A,$)=>{$.keyStatus=A;let U;A.startsWith("usable")?h.emit("resolved"):A==="internal-error"||A==="output-restricted"||A==="output-downscaled"?U=Nl(A,$.decryptdata):A==="expired"?U=new Error(`key expired (keyId: ${o})`):A==="released"?U=new Error("key released"):A==="status-pending"||this.warn(`unhandled key status change "${A}" (keyId: ${o})`),U&&(h.eventNames().length?h.emit("error",U):this.handleError(U))},v=e._onkeystatuseschange=A=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}const U=this.getKeyStatuses(e);if(!Object.keys(U).some(Ce=>U[Ce]!=="status-pending"))return;if(U[o]==="expired"){this.log(`Expired key ${nr(U)} in key-session "${e.mediaKeysSession.sessionId}"`),this.renewKeySession(e);return}let le=U[o];if(le)m(le,e);else{var fe;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(fe=e.keyStatusTimeouts)[o]||(fe[o]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const Fe=this.getKeyStatus(e.decryptdata);if(Fe&&Fe!=="status-pending")return this.log(`No status for keyId ${o} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${Fe} from other session.`),m(Fe,e);this.log(`key status for ${o} in key-session "${e.mediaKeysSession.sessionId}" timed out after 1000ms`),le="internal-error",m(le,e)},1e3)),this.log(`No status for keyId ${o} (${nr(U)}).`)}};vn(e.mediaKeysSession,"message",p),vn(e.mediaKeysSession,"keystatuseschange",v);const T=new Promise((A,$)=>{h.on("error",$),h.on("resolved",A)});return e.mediaKeysSession.generateRequest(t,r).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${o} URI: ${c}`)}).catch(A=>{throw new Jn({type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_NO_SESSION,error:A,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${A}`)}).then(()=>T).catch(A=>(h.removeAllListeners(),this.removeSession(e).then(()=>{throw A}))).then(()=>(h.removeAllListeners(),e))}getKeyStatuses(e){const t={};return e.mediaKeysSession.keyStatuses.forEach((r,n)=>{if(typeof n=="string"&&typeof r=="object"){const o=n;n=r,r=o}const i="buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n);if(e.keySystem===fr.PLAYREADY&&i.length===16){const o=Y(i);t[o]=r,Gt(i)}const s=Y(i);r==="internal-error"&&(this.bannedKeyIds[s]=r),this.log(`key status change "${r}" for keyStatuses keyId: ${s} key-session "${e.mediaKeysSession.sessionId}"`),t[s]=r}),t}fetchServerCertificate(e){const t=this.config,r=t.loader,n=new r(t),i=this.getServerCertificateUrl(e);return i?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,o)=>{const c={responseType:"arraybuffer",url:i},h=t.certLoadPolicy.default,p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(v,T,A,$)=>{s(v.data)},onError:(v,T,A,$)=>{o(new Jn({type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:A,response:S({url:c.url,data:void 0},v)},`"${e}" certificate request failed (${i}). Status: ${v.code} (${v.text})`))},onTimeout:(v,T,A)=>{o(new Jn({type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:A,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(v,T,A)=>{o(new Error("aborted"))}};n.load(c,p,m)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise((n,i)=>{e.setServerCertificate(r).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${r.byteLength}) on "${t}"`),n(e)}).catch(s=>{i(new Jn({type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(r=>this.updateKeySession(e,new Uint8Array(r)).catch(n=>{throw new Jn({type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:n,fatal:!1},n.message)}))}unpackPlayReadyKeyMessage(e,t){const r=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!r.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const n=new DOMParser().parseFromString(r,"application/xml"),i=n.querySelectorAll("HttpHeader");if(i.length>0){let p;for(let m=0,v=i.length;m<v;m++){var s,o;p=i[m];const T=(s=p.querySelector("name"))==null?void 0:s.textContent,A=(o=p.querySelector("value"))==null?void 0:o.textContent;T&&A&&e.setRequestHeader(T,A)}}const c=n.querySelector("Challenge"),h=c==null?void 0:c.textContent;if(!h)throw new Error("Cannot find <Challenge> in key message");return Yi(atob(h))}setupLicenseXHR(e,t,r,n){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then(()=>{if(!r.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,r,n)}).catch(s=>{if(!r.decryptdata)throw s;return e.open("POST",t,!0),i.call(this.hls,e,t,r,n)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||n})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:n}))}requestLicense(e,t){const r=this.config.keyLoadPolicy.default;return new Promise((n,i)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let c=o.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const h=this.config.licenseResponseCallback;if(h)try{c=h.call(this.hls,o,s,e)}catch(p){this.error(p)}n(c)}else{const c=r.errorRetry,h=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>h||o.status>=400&&o.status<500)i(new Jn({type:ye.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const p=h-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${p} attempts left`),this.requestLicense(e,t).then(n,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,t).then(({xhr:c,licenseChallenge:h})=>{e.keySystem==fr.PLAYREADY&&(h=this.unpackPlayReadyKeyMessage(c,h)),c.send(h)}).catch(i)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,vn(r,"encrypted",this.onMediaEncrypted),vn(r,"waitingforkey",this.onWaitingForKey);const n=this.mediaResolved;n?n():this.mediaKeys=r.mediaKeys}onMediaDetached(){const e=this.media;e&&(Sn(e,"encrypted",this.onMediaEncrypted),Sn(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const t=this.mediaResolved;if(t&&t(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const r=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Ai.clearKeyUriToKeyIdMap();const i=n.length;Ks.CDMCleanupPromise=Promise.all(n.map(s=>this.removeSession(s)).concat((r==null||(e=r.setMediaKeys(null))==null?void 0:e.catch(s=>{this.log(`Could not clear media keys: ${s}`),this.hls&&this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:te.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${s}`)})}))||Promise.resolve())).catch(s=>{this.log(`Could not close sessions and clear media keys: ${s}`),this.hls&&this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:te.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${s}`)})}).then(()=>{i&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const r=t.reduce((n,i)=>(n.indexOf(i.keyFormat)===-1&&n.push(i.keyFormat),n),[]);this.log(`Selecting key-system from session-keys ${r.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(r)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r,decryptdata:n}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${Y((n==null?void 0:n.keyId)||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);i>-1&&this.mediaKeySessions.splice(i,1);const{keyStatusTimeouts:s}=e;s&&Object.keys(s).forEach(h=>self.clearTimeout(s[h]));const{drmSystemOptions:o}=this.config;return(Aa(o)?new Promise((h,p)=>{self.setTimeout(()=>p(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(h).catch(p)}):Promise.resolve()).catch(h=>{this.log(`Could not remove session: ${h}`),this.hls&&this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:te.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${h}`)})}).then(()=>t.close()).catch(h=>{this.log(`Could not close session: ${h}`),this.hls&&this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:te.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${h}`)})})}return Promise.resolve()}}Ks.CDMCleanupPromise=void 0;function uo(a){if(!a)throw new Error("Could not read keyId of undefined decryptdata");if(a.keyId===null)throw new Error("keyId is null");return Y(a.keyId)}function D0(a,e){if(a.keyId&&e.mediaKeysSession.keyStatuses.has(a.keyId))return e.mediaKeysSession.keyStatuses.get(a.keyId);if(a.matches(e.decryptdata))return e.keyStatus}class Jn extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function Nl(a,e){const t=a==="output-restricted",r=t?te.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:te.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Jn({type:ye.KEY_SYSTEM_ERROR,details:r,fatal:!1,decryptdata:e},t?"HDCP level output restricted":`key status changed to "${a}"`)}class k0{constructor(e){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=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(_.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(_.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const r=this.hls.config;if(r.capLevelOnFPSDrop){const n=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=n,n&&typeof n.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,r){const n=performance.now();if(t){if(this.lastTime){const i=n-this.lastTime,s=r-this.lastDroppedFrames,o=t-this.lastDecodedFrames,c=1e3*s/i,h=this.hls;if(h.trigger(_.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:r}),c>0&&s>h.config.fpsDroppedMonitoringThreshold*o){let p=h.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+p),p>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=p)&&(p=p-1,h.trigger(_.FPS_DROP_LEVEL_CAPPING,{level:p,droppedLevel:h.currentLevel}),h.autoLevelCapping=p,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function Ul(a,e){let t;try{t=new Event("addtrack")}catch(r){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function $l(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(r){ce.debug(`[texttrack-utils]: ${r}`);try{const n=new self.TextTrackCue(e.startTime,e.endTime,e.text);n.id=e.id,a.addCue(n)}catch(n){ce.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${n}`)}}t==="disabled"&&(a.mode=t)}function Hs(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let r=a.cues.length;r--;)e&&a.cues[r].removeEventListener("enter",e),a.removeCue(a.cues[r]);t==="disabled"&&(a.mode=t)}function qo(a,e,t,r){const n=a.mode;if(n==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const i=L0(a.cues,e,t);for(let s=0;s<i.length;s++)(!r||r(i[s]))&&a.removeCue(i[s])}n==="disabled"&&(a.mode=n)}function C0(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let r=0,n=t,i;for(;r<=n;)if(i=Math.floor((n+r)/2),e<a[i].startTime)n=i-1;else if(e>a[i].startTime&&r<t)r=i+1;else return i;return a[r].startTime-e<e-a[n].startTime?r:n}function L0(a,e,t){const r=[],n=C0(a,e);if(n>-1)for(let i=n,s=a.length;i<s;i++){const o=a[i];if(o.startTime>=e&&o.endTime<=t)r.push(o);else if(o.startTime>t)return r}return r}function ho(a){const e=[];for(let t=0;t<a.length;t++){const r=a[t];(r.kind==="subtitles"||r.kind==="captions")&&r.label&&e.push(a[t])}return e}class R0 extends $o{constructor(e){super(e,"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 t=null;const r=ho(this.media.textTracks);for(let i=0;i<r.length;i++)if(r[i].mode==="hidden")t=r[i];else if(r[i].mode==="showing"){t=r[i];break}const n=this.findTrackForTextTrack(t);this.subtitleTrack!==n&&this.setSubtitleTrack(n)},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(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(_.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.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(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const r=this.media;if(!r)return;const n=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||r.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,n)return;ho(r.textTracks).forEach(s=>{Hs(s)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:r,groupId:n,details:i}=t,s=this.tracksInGroup[r];if(!s||s.groupId!==n){this.warn(`Subtitle track with id:${r} and group:${n} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Subtitle track ${r} "${s.name}" lang:${s.lang} group:${n} loaded [${i.startSN}-${i.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const r=t.subtitleGroups||null,n=this.groupIds;let i=this.currentTrack;if(!r||(n==null?void 0:n.length)!==(r==null?void 0:r.length)||r!=null&&r.some(s=>(n==null?void 0:n.indexOf(s))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(p=>!r||r.indexOf(p.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(p=>p.default)&&(this.selectDefaultTrack=!1),s.forEach((p,m)=>{p.id=m});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!i&&o){this.selectDefaultTrack=!1;const p=An(o,s);if(p>-1)i=s[p];else{const m=An(o,this.tracks);i=this.tracks[m]}}let c=this.findTrackId(i);c===-1&&i&&(c=this.findTrackId(null));const h={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${r==null?void 0:r.join(",")}" group-id`),this.hls.trigger(_.SUBTITLE_TRACKS_UPDATED,h),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,r=this.selectDefaultTrack;for(let n=0;n<t.length;n++){const i=t[n];if(!(r&&!i.default||!r&&!e)&&(!e||zn(i,e)))return n}if(e){for(let n=0;n<t.length;n++){const i=t[n];if(xa(e.attrs,i.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<t.length;n++){const i=t[n];if(xa(e.attrs,i.attrs,["LANGUAGE"]))return n}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const n=t[r];if(zo(n,e))return r}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===De.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const r=this.currentTrack;if(r&&zn(e,r))return r;const n=An(e,this.tracksInGroup);if(n>-1){const i=this.tracksInGroup[n];return this.setSubtitleTrack(n),i}else{if(r)return null;{const i=An(e,t);if(i>-1)return t[i]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,n=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading subtitle ${r} "${e.name}" lang:${e.lang} group:${n}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(_.SUBTITLE_TRACK_LOADING,{url:i,id:r,groupId:n,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=ho(e.textTracks),r=this.currentTrack;let n;if(r&&(n=t.filter(i=>zo(r,i))[0],n||this.warn(`Unable to find subtitle TextTrack with name "${r.name}" and language "${r.lang}"`)),[].slice.call(t).forEach(i=>{i.mode!=="disabled"&&i!==n&&(i.mode="disabled")}),n){const i=this.subtitleDisplay?"showing":"hidden";n.mode!==i&&(n.mode=i)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!F(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const r=this.currentTrack,n=t[e]||null;if(this.trackId=e,this.currentTrack=n,this.toggleTrackModes(),!n){this.hls.trigger(_.SUBTITLE_TRACK_SWITCH,{id:e});return}const i=!!n.details&&!n.details.live;if(e===this.trackId&&n===r&&i)return;this.log(`Switching to subtitle-track ${e}`+(n?` "${n.name}" lang:${n.lang} group:${n.groupId}`:""));const{id:s,groupId:o="",name:c,type:h,url:p}=n;this.hls.trigger(_.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:c,type:h,url:p});const m=this.switchParams(n.url,r==null?void 0:r.details,n.details);this.loadPlaylist(m)}}function I0(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const i=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(n=="x"?i:i&3|8).toString(16)})}}}function wa(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const js=.025;let co=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function P0(a,e,t){return`${a.identifier}-${t+1}-${wa(e)}`}class O0{constructor(e,t){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=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const r=this.playoutLimit;return e<=0||isNaN(r)?!1:r===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>r}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return Zo(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,r=Zo(t,e);return t-r<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=F(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return Zo(e,t)}return e}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)<js))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?co.Range:co.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 M0(this)}}function Zo(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<js)?e.start:e.start+e.duration}function zl(a,e,t){const r=new self.URL(a,t);return r.protocol!=="data:"&&r.searchParams.set("_HLS_primary_id",e),r}function Xo(a,e){for(;(t=a.assetList[++e])!=null&&t.error;)var t;return e}function M0(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function Vs(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class F0{constructor(e,t,r,n){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(_.PLAYOUT_LIMIT_REACHED,{})};const i=this.hls=new e(t);this.interstitial=r,this.assetItem=n;const s=()=>{this.hasDetails=!0};i.once(_.LEVEL_LOADED,s),i.once(_.AUDIO_TRACK_LOADED,s),i.once(_.SUBTITLE_TRACK_LOADED,s),i.on(_.MEDIA_ATTACHING,(o,{media:c})=>{this.removeMediaListeners(),this.mediaAttached=c,this.interstitial.playoutLimit&&(c.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&i.on(_.BUFFER_APPENDED,()=>{const p=this.bufferedEnd;this.reachedPlayout(p)&&(this._bufferedEosTime=p,i.trigger(_.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=zl(t,e.config.primarySessionId||"").href}catch(r){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const r=Math.min(this._bufferedEosTime||1/0,this.duration),n=this.timelineOffset,i=ir.bufferInfo(e,n,0);return this.getAssetTime(i.end)>=r-.02}reachedPlayout(e){const r=this.interstitial.playoutLimit;return this.startOffset+e>=r}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=ir.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const r=t-this.startOffset;if(r>0&&r<e)return r}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const r=e-t;if(Math.abs(r)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,r=this.duration;return Math.min(Math.max(0,e-t),r)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=r=>delete r.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,r){var n;(n=this.hls)==null||n.on(e,t)}once(e,t,r){var n;(n=this.hls)==null||n.once(e,t)}off(e,t,r){var n;(n=this.hls)==null||n.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${Vs(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const Gl=.033;class B0 extends V{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((r,n)=>e<=n.startOffset&&t>n.startOffset?(delete n.error,r+1):r,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let r=-1;e.nextEvent?r=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(r=this.findEventIndex(e.previousEvent.identifier)+1);const n=this.items;if(n)for(n[r]||(t===void 0&&(t=e.start),r=this.findItemIndexAtTime(t));r>=0&&(i=n[r])!=null&&i.event;){var i;r--}return r}findItemIndexAtTime(e,t){const r=this.items;if(r)for(let n=0;n<r.length;n++){let i=r[n];if(t&&t!=="primary"&&(i=i[t]),e===i.start||e>i.start&&e<i.end)return n}return-1}findJumpRestrictedIndex(e,t){const r=this.items;if(r)for(let n=e;n<=t&&r[n];n++){const i=r[n].event;if(i!=null&&i.restrictions.jump&&!i.appendInPlace)return n}return-1}findEventIndex(e){const t=this.items;if(t)for(let n=t.length;n--;){var r;if(((r=t[n].event)==null?void 0:r.identifier)===e)return n}return-1}findAssetIndex(e,t){const r=e.assetList,n=r.length;if(n>1)for(let i=0;i<n;i++){const s=r[i];if(!s.error){const o=s.timelineStart;if(t===o||t>o&&(t<o+(s.duration||0)||i===n-1))return i}}return 0}get assetIdAtEnd(){var e;const t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){const r=t.assetList,n=r[r.length-1];if(n)return n.identifier}return null}parseInterstitialDateRanges(e,t){const r=e.main.details,{dateRanges:n}=r,i=this.events,s=this.parseDateRanges(n,{url:r.url},t),o=Object.keys(n),c=i?i.filter(h=>!o.includes(h.identifier)):[];s.length&&s.sort((h,p)=>{const m=h.cue.pre,v=h.cue.post,T=p.cue.pre,A=p.cue.post;if(m&&!T)return-1;if(T&&!m||v&&!A)return 1;if(A&&!v)return-1;if(!m&&!T&&!v&&!A){const $=h.startTime,U=p.startTime;if($!==U)return $-U}return h.dateRange.tagOrder-p.dateRange.tagOrder}),this.events=s,c.forEach(h=>{this.removeEvent(h)}),this.updateSchedule(e,c)}updateSchedule(e,t=[],r=!1){const n=this.events||[];if(n.length||t.length||this.length<2){const i=this.items,s=this.parseSchedule(n,e);(r||t.length||(i==null?void 0:i.length)!==s.length||s.some((c,h)=>Math.abs(c.playout.start-i[h].playout.start)>.005||Math.abs(c.playout.end-i[h].playout.end)>.005))&&(this.items=s,this.onScheduleUpdate(t,i))}}parseDateRanges(e,t,r){const n=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const o=i[s],c=e[o];if(c.isInterstitial){let h=this.eventMap[o];h?h.setDateRange(c):(h=new O0(c,t),this.eventMap[o]=h,r===!1&&(h.appendInPlace=r)),n.push(h)}}return n}parseSchedule(e,t){const r=[],n=t.main.details,i=n.live?1/0:n.edge;let s=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,h=0;if(e.forEach((p,m)=>{const v=p.cue.pre,T=p.cue.post,A=e[m-1]||null,$=p.appendInPlace,U=T?i:p.startOffset,ie=p.duration,le=p.timelineOccupancy===co.Range?ie:0,fe=p.resumptionOffset,Ce=(A==null?void 0:A.startTime)===U,Fe=U+p.cumulativeDuration;let tt=$?Fe+ie:U+fe;if(v||!T&&U<=0){const Xe=h;h+=le,p.timelineStart=Fe;const qe=s;s+=ie,r.push({event:p,start:Fe,end:tt,playout:{start:qe,end:s},integrated:{start:Xe,end:h}})}else if(U<=i){if(!Ce){const ze=U-c;if(ze>Gl){const ft=c,Ut=h;h+=ze;const jt=s;s+=ze;const Jt={previousEvent:e[m-1]||null,nextEvent:p,start:ft,end:ft+ze,playout:{start:jt,end:s},integrated:{start:Ut,end:h}};r.push(Jt)}else ze>0&&A&&(A.cumulativeDuration+=ze,r[r.length-1].end=U)}T&&(tt=Fe),p.timelineStart=Fe;const Xe=h;h+=le;const qe=s;s+=ie,r.push({event:p,start:Fe,end:tt,playout:{start:qe,end:s},integrated:{start:Xe,end:h}})}else return;const Ne=p.resumeTime;T||Ne>i?c=i:c=Ne}),c<i){var o;const p=c,m=h,v=i-c;h+=v;const T=s;s+=v,r.push({previousEvent:((o=r[r.length-1])==null?void 0:o.event)||null,nextEvent:null,start:c,end:p+v,playout:{start:T,end:s},integrated:{start:m,end:h}})}this.setDurations(i,s,h)}else r.push({previousEvent:null,nextEvent:null,start:0,end:i,playout:{start:0,end:i},integrated:{start:0,end:i}}),this.setDurations(i,i,i);return r}setDurations(e,t,r){this.durations={primary:e,playout:t,integrated:r}}resolveOffsets(e,t){const r=t.main.details,n=r.live?1/0:r.edge;let i=0,s=-1;e.forEach((o,c)=>{const h=o.cue.pre,p=o.cue.post,m=h?0:p?n:o.startTime;this.updateAssetDurations(o),s===m?o.cumulativeDuration=i:(i=0,s=m),!p&&o.snapOptions.in&&(o.resumeAnchor=on(null,r.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<Gl&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const T=F(o.resumeOffset)?o.resumeOffset:o.duration;i+=T})}primaryCanResumeInPlaceAt(e,t){const r=e.resumeTime,n=e.startTime+e.resumptionOffset;return Math.abs(r-n)>js?(this.log(`"${e.identifier}" resumption ${r} not aligned with estimated timeline end ${n}`),!1):!Object.keys(t).some(s=>{const o=t[s].details,c=o.edge;if(r>=c)return this.log(`"${e.identifier}" resumption ${r} past ${s} playlist end ${c}`),!1;const h=on(null,o.fragments,r);if(!h)return this.log(`"${e.identifier}" resumption ${r} does not align with any fragments in ${s} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const p=s==="audio"?.175:0;return Math.abs(h.start-r)<js+p||Math.abs(h.end-r)<js+p?!1:(this.log(`"${e.identifier}" resumption ${r} not aligned with ${s} fragment bounds (${h.start}-${h.end} sn: ${h.sn} cc: ${h.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let r=0,n=!1,i=!1;for(let s=0;s<e.assetList.length;s++){const o=e.assetList[s],c=t+r;o.startOffset=r,o.timelineStart=c,n||(n=o.duration===null),i||(i=!!o.error);const h=o.error?0:o.duration||0;r+=h}n&&!i?e.duration=Math.max(r,e.duration):e.duration=r}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Ci(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class N0{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const r=e.assetListUrl;let n;try{n=zl(r,this.hls.sessionId,e.baseUrl)}catch(v){const T=this.assignAssetListError(e,te.ASSET_LIST_LOAD_ERROR,v,r);this.hls.trigger(_.ERROR,T);return}t&&n.protocol!=="data:"&&n.searchParams.set("_HLS_start_offset",""+t);const i=this.hls.config,s=i.loader,o=new s(i),c={responseType:"json",url:n.href},h=i.interstitialAssetListLoadPolicy.default,p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(v,T,A,$)=>{const U=v.data,ie=U==null?void 0:U.ASSETS;if(!Array.isArray(ie)){const le=this.assignAssetListError(e,te.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),A.url,T,$);this.hls.trigger(_.ERROR,le);return}e.assetListResponse=U,this.hls.trigger(_.ASSET_LIST_LOADED,{event:e,assetListResponse:U,networkDetails:$})},onError:(v,T,A,$)=>{const U=this.assignAssetListError(e,te.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${v.code} ${v.text} (${T.url})`),T.url,$,A);this.hls.trigger(_.ERROR,U)},onTimeout:(v,T,A)=>{const $=this.assignAssetListError(e,te.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${T.url})`),T.url,v,A);this.hls.trigger(_.ERROR,$)}};return o.load(c,p,m),this.hls.trigger(_.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,r,n,i,s){return e.error=r,{type:ye.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:n,error:r,networkDetails:s,stats:i}}}function Kl(a){var e;a==null||(e=a.play())==null||e.catch(()=>{})}function fo(a,e){return`[${a}] Advancing timeline position to ${e}`}class U0 extends V{constructor(e,t){super("interstitials",e.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 r=this.currentTime;if(r===void 0||this.playbackDisabled||!this.schedule)return;const n=r-this.timelinePos;if(Math.abs(n)<1/7056e5)return;const s=n<=-.01;this.timelinePos=r,this.bufferedPos=r;const o=this.playingItem;if(!o){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(r,r-n)&&this.updateSchedule(!0),this.checkBuffer(),s&&r<o.start||r>=o.end){var c;const T=this.findItemIndex(o);let A=this.schedule.findItemIndexAtTime(r);if(A===-1&&(A=T+(s?-1:1),this.log(`seeked ${s?"back ":""}to position not covered by schedule ${r} (resolving from ${T} to ${A})`)),!this.isInterstitial(o)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s&&A>T){const $=this.schedule.findJumpRestrictedIndex(T+1,A);if($>T){this.setSchedulePosition($);return}}this.setSchedulePosition(A);return}const h=this.playingAsset;if(!h){if(this.playingLastItem&&this.isInterstitial(o)){const T=o.event.assetList[0];T&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(r,T))}return}const p=h.timelineStart,m=h.duration||0;if(s&&r<p||r>=p+m){var v;(v=o.event)!=null&&v.appendInPlace&&(this.clearAssetPlayers(o.event,o),this.flushFrontBuffer(r)),this.setScheduleToAssetAtTime(r,h)}},this.onTimeupdate=()=>{const r=this.currentTime;if(r===void 0||this.playbackDisabled)return;if(r>this.timelinePos)this.timelinePos=r,r>this.bufferedPos&&this.checkBuffer();else return;const n=this.playingItem;if(!n||this.playingLastItem)return;if(r>=n.end){this.timelinePos=n.end;const o=this.findItemIndex(n);this.setSchedulePosition(o+1)}const i=this.playingAsset;if(!i)return;const s=i.timelineStart+(i.duration||0);r>=s&&this.setScheduleToAssetAtTime(r,i)},this.onScheduleUpdate=(r,n)=>{const i=this.schedule;if(!i)return;const s=this.playingItem,o=i.events||[],c=i.items||[],h=i.durations,p=r.map($=>$.identifier),m=!!(o.length||p.length);(m||n)&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
Schedule: ${c.map($=>Ci($))} pos: ${this.timelinePos}`),p.length&&this.log(`Removed events ${p}`);let v=null,T=null;s&&(v=this.updateItem(s,this.timelinePos),this.itemsMatch(s,v)?this.playingItem=v:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const A=this.bufferingItem;if(A&&(T=this.updateItem(A,this.bufferedPos),this.itemsMatch(A,T)?this.bufferingItem=T:A.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(A.event,null))),r.forEach($=>{$.assetList.forEach(U=>{this.clearAssetPlayer(U.identifier,null)})}),this.playerQueue.forEach($=>{if($.interstitial.appendInPlace){const U=$.assetItem.timelineStart,ie=$.timelineOffset-U;if(ie)try{$.timelineOffset=U}catch(le){Math.abs(ie)>js&&this.warn(`${le} ("${$.assetId}" ${$.timelineOffset}->${U})`)}}}),m||n){if(this.hls.trigger(_.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:c.slice(0),durations:h,removedIds:p}),this.isInterstitial(s)&&p.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}s&&this.trimInPlace(v,s),A&&T!==v&&this.trimInPlace(T,A),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new N0(e),this.schedule=new B0(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(_.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(_.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(_.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(_.BUFFER_APPENDED,this.onBufferAppended,this),e.on(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(_.MEDIA_ENDED,this.onMediaEnded,this),e.on(_.ERROR,this.onError,this),e.on(_.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(_.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(_.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(_.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(_.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_.BUFFER_APPENDED,this.onBufferAppended,this),e.off(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(_.MEDIA_ENDED,this.onMediaEnded,this),e.off(_.ERROR,this.onError,this),e.off(_.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.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 e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){Sn(e,"play",this.onPlay),Sn(e,"pause",this.onPause),Sn(e,"seeking",this.onSeeking),Sn(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const r=this.media=t.media;vn(r,"seeking",this.onSeeking),vn(r,"timeupdate",this.onTimeupdate),vn(r,"play",this.onPlay),vn(r,"pause",this.onPause)}onMediaAttached(e,t){const r=this.effectivePlayingItem,n=this.detachedData;if(this.detachedData=null,r===null)this.checkStart();else if(!n){this.clearScheduleState();const i=this.findItemIndex(r);this.setSchedulePosition(i)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const r=!!t.transferMedia,n=this.media;if(this.media=null,!r&&(n&&this.removeMediaListeners(n),this.detachedData)){const i=this.getBufferingPlayer();i&&(this.log(`Removing schedule state for detachedData and ${i}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,i.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,r=m=>m&&e.getAssetPlayer(m.identifier),n=(m,v,T,A,$)=>{if(m){let U=m[v].start;const ie=m.event;if(ie){if(v==="playout"||ie.timelineOccupancy!==co.Point){const le=r(T);(le==null?void 0:le.interstitial)===ie&&(U+=le.assetItem.startOffset+le[$])}}else{const le=A==="bufferedPos"?s():e[A];U+=le-m.start}return U}return 0},i=(m,v)=>{var T;if(m!==0&&v!=="primary"&&(T=e.schedule)!=null&&T.length){var A;const $=e.schedule.findItemIndexAtTime(m),U=(A=e.schedule.items)==null?void 0:A[$];if(U){const ie=U[v].start-U.start;return m+ie}}return m},s=()=>{const m=e.bufferedPos;return m===Number.MAX_VALUE?o("primary"):Math.max(m,0)},o=m=>{var v,T;return(v=e.primaryDetails)!=null&&v.live?e.primaryDetails.edge:((T=e.schedule)==null?void 0:T.durations[m])||0},c=(m,v)=>{var T,A;const $=e.effectivePlayingItem;if($!=null&&(T=$.event)!=null&&T.restrictions.skip||!e.schedule)return;e.log(`seek to ${m} "${v}"`);const U=e.effectivePlayingItem,ie=e.schedule.findItemIndexAtTime(m,v),le=(A=e.schedule.items)==null?void 0:A[ie],fe=e.getBufferingPlayer(),Ce=fe==null?void 0:fe.interstitial,Fe=Ce==null?void 0:Ce.appendInPlace,tt=U&&e.itemsMatch(U,le);if(U&&(Fe||tt)){const Ne=r(e.playingAsset),Xe=(Ne==null?void 0:Ne.media)||e.primaryMedia;if(Xe){const qe=v==="primary"?Xe.currentTime:n(U,v,e.playingAsset,"timelinePos","currentTime"),ze=m-qe,ft=(Fe?qe:Xe.currentTime)+ze;if(ft>=0&&(!Ne||Fe||ft<=Ne.duration)){Xe.currentTime=ft;return}}}if(le){let Ne=m;if(v!=="primary"){const qe=le[v].start,ze=m-qe;Ne=le.start+ze}const Xe=!e.isInterstitial(le);if((!e.isInterstitial(U)||U.event.appendInPlace)&&(Xe||le.event.appendInPlace)){const qe=e.media||(Fe?fe==null?void 0:fe.media:null);qe&&(qe.currentTime=Ne)}else if(U){const qe=e.findItemIndex(U);if(ie>qe){const ft=e.schedule.findJumpRestrictedIndex(qe+1,ie);if(ft>qe){e.setSchedulePosition(ft);return}}let ze=0;if(Xe)e.timelinePos=Ne,e.checkBuffer();else{const ft=le.event.assetList,Ut=m-(le[v]||le).start;for(let jt=ft.length;jt--;){const Jt=ft[jt];if(Jt.duration&&Ut>=Jt.startOffset&&Ut<Jt.startOffset+Jt.duration){ze=jt;break}}}e.setSchedulePosition(ie,ze)}}},h=()=>{const m=e.effectivePlayingItem;if(e.isInterstitial(m))return m;const v=t();return e.isInterstitial(v)?v:null},p={get bufferedEnd(){const m=t(),v=e.bufferingItem;if(v&&v===m){var T;return n(v,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-v.playout.start||((T=e.bufferingAsset)==null?void 0:T.startOffset)||0}return 0},get currentTime(){const m=h(),v=e.effectivePlayingItem;return v&&v===m?n(v,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-v.playout.start:0},set currentTime(m){const v=h(),T=e.effectivePlayingItem;T&&T===v&&c(m+T.playout.start,"playout")},get duration(){const m=h();return m?m.playout.end-m.playout.start:0},get assetPlayers(){var m;const v=(m=h())==null?void 0:m.event.assetList;return v?v.map(T=>e.getAssetPlayer(T.identifier)):[]},get playingIndex(){var m;const v=(m=h())==null?void 0:m.event;return v&&e.effectivePlayingAsset?v.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return h()}};return this.manager={get events(){var m;return((m=e.schedule)==null||(m=m.events)==null?void 0:m.slice(0))||[]},get schedule(){var m;return((m=e.schedule)==null||(m=m.items)==null?void 0:m.slice(0))||[]},get interstitialPlayer(){return h()?p:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const m=t();return e.findItemIndex(m)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const m=e.effectivePlayingItem;return e.findItemIndex(m)},primary:{get bufferedEnd(){return s()},get currentTime(){const m=e.timelinePos;return m>0?m:0},set currentTime(m){c(m,"primary")},get duration(){return o("primary")},get seekableStart(){var m;return((m=e.primaryDetails)==null?void 0:m.fragmentStart)||0}},integrated:{get bufferedEnd(){return n(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return n(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(m){c(m,"integrated")},get duration(){return o("integrated")},get seekableStart(){var m;return i(((m=e.primaryDetails)==null?void 0:m.fragmentStart)||0,"integrated")}},skip:()=>{const m=e.effectivePlayingItem,v=m==null?void 0:m.event;if(v&&!v.restrictions.skip){const T=e.findItemIndex(m);if(v.appendInPlace){const A=m.playout.start+m.event.duration;c(A+.001,"playout")}else e.advanceAfterAssetEnded(v,T,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,r=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!r?!1:this.findItemIndex(t)===r.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t;if(this.mediaSelection===null)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let n=this.media;!n&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(n=this.primaryMedia);const i=(t=n)==null?void 0:t.currentTime;if(!(i===void 0||!F(i)))return i}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const r=this.getAssetPlayer(e);r&&this.transferMediaFromPlayer(r,t)}transferMediaFromPlayer(e,t){const r=e.interstitial.appendInPlace,n=e.media;if(r&&n===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&n){this.detachedData={media:n};return}const i=e.transferMedia();this.log(`transfer MediaSource from ${e} ${nr(i)}`),this.detachedData=i}else t&&n&&(this.shouldPlay||(this.shouldPlay=!n.paused))}transferMediaTo(e,t){var r,n;if(e.media===t)return;let i=null;const s=this.hls,o=e!==s,c=o&&e.interstitial.appendInPlace,h=(r=this.detachedData)==null?void 0:r.mediaSource;let p;if(s.media)c&&(i=s.transferMedia(),this.detachedData=i),p="Primary";else if(h){const A=this.getBufferingPlayer();A?(i=A.transferMedia(),p=`${A}`):p="detached MediaSource"}else p="detached media";if(!i){if(h)i=this.detachedData,this.log(`using detachedData: MediaSource ${nr(i)}`);else if(!this.detachedData||s.media===t){const A=this.playerQueue;A.length>1&&A.forEach($=>{if(o&&$.interstitial.appendInPlace!==c){const U=$.interstitial;this.clearInterstitial($.interstitial,null),U.appendInPlace=!1,U.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${U}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const m=i&&"mediaSource"in i&&((n=i.mediaSource)==null?void 0:n.readyState)!=="closed",v=m&&i?i:t;this.log(`${m?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${p} (media.currentTime: ${t.currentTime})`);const T=this.schedule;if(v===i&&T){const A=o&&e.assetId===T.assetIdAtEnd;v.overrides={duration:T.duration,endOfStream:!o||A,cueRemoval:!o}}e.attachMedia(v)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e==null?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const r=this.timelinePos,n=this.effectivePlayingItem;if(r===-1){const i=this.hls.startPosition;if(this.log(fo("checkStart",i)),this.timelinePos=i,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(i>=0||!this.primaryLive){const s=this.timelinePos=i>0?i:0,o=e.findItemIndexAtTime(s);this.setSchedulePosition(o)}}else if(n&&!this.playingItem){const i=e.findItemIndex(n);this.setSchedulePosition(i)}}advanceAssetBuffering(e,t){const r=e.event,n=r.findAssetIndex(t),i=Xo(r,n);if(!r.isAssetPastPlayoutLimit(i))this.bufferedToEvent(e,i);else if(this.schedule){var s;const o=(s=this.schedule.items)==null?void 0:s[this.findItemIndex(e)+1];o&&this.bufferedToItem(o)}}advanceAfterAssetEnded(e,t,r){const n=Xo(e,r);if(e.isAssetPastPlayoutLimit(n)){if(this.schedule){const i=this.schedule.items;if(i){const s=t+1,o=i.length;if(s>=o){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.log(fo("advanceAfterAssetEnded",c)),this.timelinePos=c,e.appendInPlace&&this.advanceInPlace(c),this.checkBuffer(this.bufferedPos<c)),this.setSchedulePosition(s)}}}else{if(e.appendInPlace){const i=e.assetList[n];i&&this.advanceInPlace(i.timelineStart)}this.setSchedulePosition(t,n)}}setScheduleToAssetAtTime(e,t){const r=this.schedule;if(!r)return;const n=t.parentIdentifier,i=r.getEvent(n);if(i){const s=r.findEventIndex(n),o=r.findAssetIndex(i,e);this.advanceAfterAssetEnded(i,s,o-1)}}setSchedulePosition(e,t){var r;const n=(r=this.schedule)==null?void 0:r.items;if(!n||this.playbackDisabled)return;const i=e>=0?n[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${i&&Ci(i)}) pos: ${this.timelinePos}`);const s=this.waitingItem||this.playingItem,o=this.playingLastItem;if(this.isInterstitial(s)){const p=s.event,m=this.playingAsset,v=m==null?void 0:m.identifier,T=v?this.getAssetPlayer(v):null;if(T&&v&&(!this.eventItemsMatch(s,i)||t!==void 0&&v!==p.assetList[t].identifier)){var c;const A=p.findAssetIndex(m);if(this.log(`INTERSTITIAL_ASSET_ENDED ${A+1}/${p.assetList.length} ${Vs(m)}`),this.endedAsset=m,this.playingAsset=null,this.hls.trigger(_.INTERSTITIAL_ASSET_ENDED,{asset:m,assetListIndex:A,event:p,schedule:n.slice(0),scheduleIndex:e,player:T}),s!==this.playingItem){this.itemsMatch(s,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(p,this.findItemIndex(this.playingItem),A);return}this.retreiveMediaSource(v,i),T.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&T.detachMedia()}if(!this.eventItemsMatch(s,i)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${p} ${Ci(s)}`),p.hasPlayed=!0,this.hls.trigger(_.INTERSTITIAL_ENDED,{event:p,schedule:n.slice(0),scheduleIndex:e}),p.cue.once)){var h;this.updateSchedule();const A=(h=this.schedule)==null?void 0:h.items;if(i&&A){const $=this.findItemIndex(i);this.advanceSchedule($,A,t,s,o)}return}}this.advanceSchedule(e,n,t,s,o)}advanceSchedule(e,t,r,n,i){const s=this.schedule;if(!s)return;const o=t[e]||null,c=this.primaryMedia,h=this.playerQueue;if(h.length&&h.forEach(p=>{const m=p.interstitial,v=s.findEventIndex(m.identifier);(v<e||v>e+1)&&this.clearInterstitial(m,o)}),this.isInterstitial(o)){this.timelinePos=Math.min(Math.max(this.timelinePos,o.start),o.end);const p=o.event;if(r===void 0){r=s.findAssetIndex(p,this.timelinePos);const A=Xo(p,r-1);if(p.isAssetPastPlayoutLimit(A)||p.appendInPlace&&this.timelinePos===o.end){this.advanceAfterAssetEnded(p,e,r);return}r=A}const m=this.waitingItem;this.assetsBuffered(o,c)||this.setBufferingItem(o);let v=this.preloadAssets(p,r);if(this.eventItemsMatch(o,m||n)||(this.waitingItem=o,this.log(`INTERSTITIAL_STARTED ${Ci(o)} ${p.appendInPlace?"append in place":""}`),this.hls.trigger(_.INTERSTITIAL_STARTED,{event:p,schedule:t.slice(0),scheduleIndex:e})),!p.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${p}`);return}if(p.assetListLoader&&(p.assetListLoader.destroy(),p.assetListLoader=void 0),!c){this.log(`Waiting for attachMedia to start Interstitial ${p}`);return}this.waitingItem=this.endedItem=null,this.playingItem=o;const T=p.assetList[r];if(!T){this.advanceAfterAssetEnded(p,e,r||0);return}if(v||(v=this.getAssetPlayer(T.identifier)),v===null||v.destroyed){const A=p.assetList.length;this.warn(`asset ${r+1}/${A} player destroyed ${p}`),v=this.createAssetPlayer(p,T,r),v.loadSource()}if(!this.eventItemsMatch(o,this.bufferingItem)&&p.appendInPlace&&this.isAssetBuffered(T))return;this.startAssetPlayer(v,r,t,e,c),this.shouldPlay&&Kl(v.media)}else o?(this.resumePrimary(o,e,n),this.shouldPlay&&Kl(this.hls.media)):i&&this.isInterstitial(n)&&(this.endedItem=null,this.playingItem=n,n.event.appendInPlace||this.attachPrimary(s.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,r){var n,i;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Ci(e)}`),!((n=this.detachedData)!=null&&n.mediaSource)){let o=this.timelinePos;(o<e.start||o>=e.end)&&(o=this.getPrimaryResumption(e,t),this.log(fo("resumePrimary",o)),this.timelinePos=o),this.attachPrimary(o,e)}if(!r)return;const s=(i=this.schedule)==null?void 0:i.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Ci(e)}`),this.hls.trigger(_.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const r=e.start;if(this.primaryLive){const n=this.primaryDetails;if(t===0)return this.hls.startPosition;if(n&&(r<n.fragmentStart||r>n.edge))return this.hls.liveSyncPosition||-1}return r}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:ir.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,r){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const n=this.primaryMedia;if(!n)return;const i=this.hls;i.media?this.checkBuffer():(this.transferMediaTo(i,n),r&&this.startLoadingPrimaryAt(e,r)),r||(this.log(fo("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,r))}startLoadingPrimaryAt(e,t){var r;const n=this.hls;!n.loadingEnabled||!n.media||Math.abs((((r=n.mainForwardBufferInfo)==null?void 0:r.start)||n.media.currentTime)-e)>.5?n.startLoad(e,t):n.bufferingEnabled||n.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),(e=this.schedule)==null||e.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(_.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(_.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;const r=this.hls.levels[t.level];if(!r.details)return;const n=S(S({},this.mediaSelection||this.altSelection),{},{main:r});this.mediaSelection=n,this.schedule.parseInterstitialDateRanges(n,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const r=this.hls.audioTracks[t.id],n=this.mediaSelection;if(!n){this.altSelection=S(S({},this.altSelection),{},{audio:r});return}const i=S(S({},n),{},{audio:r});this.mediaSelection=i}onSubtitleTrackUpdated(e,t){const r=this.hls.subtitleTracks[t.id],n=this.mediaSelection;if(!n){this.altSelection=S(S({},this.altSelection),{},{subtitles:r});return}const i=S(S({},n),{},{subtitles:r});this.mediaSelection=i}onAudioTrackSwitching(e,t){const r=es(t);this.playerQueue.forEach(({hls:n})=>n&&(n.setAudioOption(t)||n.setAudioOption(r)))}onSubtitleTrackSwitch(e,t){const r=es(t);this.playerQueue.forEach(({hls:n})=>n&&(n.setSubtitleOption(t)||t.id!==-1&&n.setSubtitleOption(r)))}onBufferCodecs(e,t){const r=t.tracks;r&&(this.requiredTracks=r)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const r=this.playingItem;if(r&&!this.itemsMatch(r,this.bufferingItem)&&!this.isInterstitial(r)){const n=this.timelinePos;this.bufferedPos=n,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let n=0;n<t.length;n++){const i=t[n];if(i.cue.post){var r;const s=this.schedule.findEventIndex(i.identifier),o=(r=this.schedule.items)==null?void 0:r[s];this.isInterstitial(o)&&this.eventItemsMatch(o,this.bufferingItem)&&this.bufferedToItem(o,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const r=this.findItemIndex(t);this.setSchedulePosition(r+1)}else this.shouldPlay=!1}updateItem(e,t){var r;const n=(r=this.schedule)==null?void 0:r.items;if(e&&n){const i=this.findItemIndex(e,t);return n[i]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((i,s)=>{e.event.isAssetPastPlayoutLimit(s)&&this.clearAssetPlayer(i.identifier,null)});const r=e.end+.25,n=ir.bufferInfo(this.primaryMedia,r,0);(n.end>r||(n.nextStart||0)>r)&&(this.log(`trim buffered interstitial ${Ci(e)} (was ${Ci(t)})`),this.attachPrimary(r,null,!0),this.flushFrontBuffer(r))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var r;return!!t&&(e===t||e.event.identifier===((r=t.event)==null?void 0:r.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const r=this.mediaSelection;r&&((t=this.schedule)==null||t.updateSchedule(r,[],e))}checkBuffer(e){var t;const r=(t=this.schedule)==null?void 0:t.items;if(!r)return;const n=ir.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,r,e)}updateBufferedPos(e,t,r){const n=this.schedule,i=this.bufferingItem;if(this.bufferedPos>e||!n)return;if(t.length===1&&this.itemsMatch(t[0],i)){this.bufferedPos=e;return}const s=this.playingItem,o=this.findItemIndex(s);let c=n.findItemIndexAtTime(e);if(this.bufferedPos<e){var h;const p=this.findItemIndex(i),m=Math.min(p+1,t.length-1),v=t[m];if((c===-1&&i&&e>=i.end||(h=v.event)!=null&&h.appendInPlace&&e+.01>=v.start)&&(c=m),this.isInterstitial(i)){const T=i.event;if(m-o>1&&T.appendInPlace===!1||T.assetList.length===0&&T.assetListLoader)return}if(this.bufferedPos=e,c>p&&c>o)this.bufferedToItem(v);else{const T=this.primaryDetails;this.primaryLive&&T&&e>T.edge-T.targetduration&&v.start<T.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(v)&&this.preloadAssets(v.event,0)}}else r&&s&&!this.itemsMatch(s,i)&&(c===o?this.bufferedToItem(s):c===o+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(n=>{const i=this.getAssetPlayer(n.identifier);return!(i!=null&&i.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,r=this.schedule;if(!this.itemsMatch(e,t)&&r){const{items:n,events:i}=r;if(!n||!i)return t;const s=this.isInterstitial(e),o=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=o?o.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Ci(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(s){const h=r.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((p,m)=>{const v=this.getAssetPlayer(p.identifier);v&&(m===h&&v.loadSource(),v.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(h=>h.pauseBuffering());this.hls.trigger(_.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:i.slice(0),schedule:n.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const r=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(r!==null){this.bufferingAsset=null;const n=this.detachedData;n?n.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),r=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(r)}bufferedToEvent(e,t){const r=e.event,n=r.assetList.length===0&&!r.assetListLoader,i=r.cue.once;if(n||!i){const s=this.preloadAssets(r,t);if(s!=null&&s.interstitial.appendInPlace){const o=this.primaryMedia;o&&this.bufferAssetPlayer(s,o)}}}preloadAssets(e,t){const r=e.assetUrl,n=e.assetList.length,i=n===0&&!e.assetListLoader,s=e.cue.once;if(i){const c=e.timelineStart;if(e.appendInPlace){var o;const v=this.playingItem;!this.isInterstitial(v)&&(v==null||(o=v.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let h,p=0;if(!this.playingItem&&this.primaryLive&&(p=this.hls.startPosition,p===-1&&(p=this.hls.liveSyncPosition||0)),p&&!(e.cue.pre||e.cue.post)){const v=p-c;v>0&&(h=Math.round(v*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${r?1:n} ${e}${h?` live-start: ${p} start-offset: ${h}`:""}`),r)return this.createAsset(e,0,0,c,e.duration,r);const m=this.assetListLoader.loadAssetList(e,h);m&&(e.assetListLoader=m)}else if(!s&&n){for(let h=t;h<n;h++){const p=e.assetList[h],m=this.getAssetPlayerQueueIndex(p.identifier);(m===-1||this.playerQueue[m].destroyed)&&!p.error&&this.createAssetPlayer(e,p,h)}const c=e.assetList[t];if(c){const h=this.getAssetPlayer(c.identifier);return h&&h.loadSource(),h}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(n=>{this.hls.trigger(_.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:n})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let r=0;r<t.length;r++)if(e===t[r].assetId)return r;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let r=0;r<e.length;r++)if(e[r].media===t)return e[r]}return null}createAsset(e,t,r,n,i,s){const o={parentIdentifier:e.identifier,identifier:P0(e,s,t),duration:i,startOffset:r,timelineStart:n,uri:s};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,r){const n=this.hls,i=n.userConfig;let s=i.videoPreference;const o=n.loadLevelObj||n.levels[n.currentLevel];(s||o)&&(s=b({},s),o.videoCodec&&(s.videoCodec=o.videoCodec),o.videoRange&&(s.allowedVideoRanges=[o.videoRange]));const c=n.audioTracks[n.audioTrack],h=n.subtitleTracks[n.subtitleTrack];let p=0;if(this.primaryLive||e.appendInPlace){const Ce=this.timelinePos-t.timelineStart;if(Ce>1){const Fe=t.duration;Fe&&Ce<Fe&&(p=Ce)}}const m=t.identifier,v=S(S({},i),{},{maxMaxBufferLength:Math.min(180,n.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:n.sessionId,assetPlayerId:m,abrEwmaDefaultEstimate:n.bandwidthEstimate,interstitialsController:void 0,startPosition:p,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||i.audioPreference,subtitlePreference:h||i.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(v.timelineOffset=t.timelineStart));const T=v.cmcd;T!=null&&T.sessionId&&T.contentId&&(v.cmcd=b({},T,{contentId:wa(t.uri)})),this.getAssetPlayer(m)&&this.warn(`Duplicate date range identifier ${e} and asset ${m}`);const A=new F0(this.HlsPlayerClass,v,e,t);this.playerQueue.push(A),e.assetList[r]=t;let $=!0;const U=Ce=>{if(Ce.live){var Fe;const Xe=new Error(`Interstitials MUST be VOD assets ${e}`),qe={fatal:!0,type:ye.OTHER_ERROR,details:te.INTERSTITIAL_ASSET_ITEM_ERROR,error:Xe},ze=((Fe=this.schedule)==null?void 0:Fe.findEventIndex(e.identifier))||-1;this.handleAssetItemError(qe,e,ze,r,Xe.message);return}const tt=Ce.edge-Ce.fragmentStart,Ne=t.duration;($||Ne===null||tt>Ne)&&($=!1,this.log(`Interstitial asset "${m}" duration change ${Ne} > ${tt}`),t.duration=tt,this.updateSchedule())};A.on(_.LEVEL_UPDATED,(Ce,{details:Fe})=>U(Fe)),A.on(_.LEVEL_PTS_UPDATED,(Ce,{details:Fe})=>U(Fe)),A.on(_.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const ie=(Ce,Fe)=>{const tt=this.getAssetPlayer(m);if(tt&&Fe.tracks){tt.off(_.BUFFER_CODECS,ie),tt.tracks=Fe.tracks;const Ne=this.primaryMedia;this.bufferingAsset===tt.assetItem&&Ne&&!tt.media&&this.bufferAssetPlayer(tt,Ne)}};A.on(_.BUFFER_CODECS,ie);const le=()=>{var Ce;const Fe=this.getAssetPlayer(m);if(this.log(`buffered to end of asset ${Fe}`),!Fe||!this.schedule)return;const tt=this.schedule.findEventIndex(e.identifier),Ne=(Ce=this.schedule.items)==null?void 0:Ce[tt];this.isInterstitial(Ne)&&this.advanceAssetBuffering(Ne,t)};A.on(_.BUFFERED_TO_END,le);const fe=Ce=>()=>{if(!this.getAssetPlayer(m)||!this.schedule)return;this.shouldPlay=!0;const tt=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,tt,Ce)};return A.once(_.MEDIA_ENDED,fe(r)),A.once(_.PLAYOUT_LIMIT_REACHED,fe(1/0)),A.on(_.ERROR,(Ce,Fe)=>{if(!this.schedule)return;const tt=this.getAssetPlayer(m);if(Fe.details===te.BUFFER_STALLED_ERROR){if(tt!=null&&tt.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(Fe,e,this.schedule.findEventIndex(e.identifier),r,`Asset player error ${Fe.error} ${e}`)}),A.on(_.DESTROYING,()=>{if(!this.getAssetPlayer(m)||!this.schedule)return;const Fe=new Error(`Asset player destroyed unexpectedly ${m}`),tt={fatal:!0,type:ye.OTHER_ERROR,details:te.INTERSTITIAL_ASSET_ITEM_ERROR,error:Fe};this.handleAssetItemError(tt,e,this.schedule.findEventIndex(e.identifier),r,Fe.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${Vs(t)}`),this.hls.trigger(_.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:r,event:e,player:A}),A}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach(r=>{this.clearAssetPlayer(r.identifier,t)})}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const r=this.playerQueue[t];this.transferMediaFromPlayer(r,null),r.resetDetails()}}clearAssetPlayer(e,t){const r=this.getAssetPlayerQueueIndex(e);if(r!==-1){const n=this.playerQueue[r];this.log(`clear ${n} toSegment: ${t&&Ci(t)}`),this.transferMediaFromPlayer(n,t),this.playerQueue.splice(r,1),n.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,r,n,i){const{interstitial:s,assetItem:o,assetId:c}=e,h=s.assetList.length,p=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!p||p.identifier!==c)&&(p&&(this.clearAssetPlayer(p.identifier,r[n]),delete p.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${h} ${Vs(o)}`),this.hls.trigger(_.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:s,schedule:r.slice(0),scheduleIndex:n,player:e})),this.bufferAssetPlayer(e,i)}bufferAssetPlayer(e,t){var r,n;if(!this.schedule)return;const{interstitial:i,assetItem:s}=e,o=this.schedule.findEventIndex(i.identifier),c=(r=this.schedule.items)==null?void 0:r[o];if(!c)return;e.loadSource(),this.setBufferingItem(c),this.bufferingAsset=s;const h=this.getBufferingPlayer();if(h===e)return;const p=i.appendInPlace;if(p&&(h==null?void 0:h.interstitial.appendInPlace)===!1)return;const m=(h==null?void 0:h.tracks)||((n=this.detachedData)==null?void 0:n.tracks)||this.requiredTracks;if(p&&s!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(m&&!Ae(m,e.tracks)){const v=new Error(`Asset ${Vs(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(m)}')`),T={fatal:!0,type:ye.OTHER_ERROR,details:te.INTERSTITIAL_ASSET_ITEM_ERROR,error:v},A=i.findAssetIndex(s);this.handleAssetItemError(T,i,o,A,v.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,r=this.primaryMedia;if(!t||!r)return;const n=r.currentTime,i=t.findAssetIndex(e,n),s=e.assetList[i];if(s){const o=this.getAssetPlayer(s.identifier);if(o){const c=o.currentTime||n-s.timelineStart,h=o.duration-c;if(this.warn(`Stalled at ${c} of ${c+h} in ${o} ${e} (media.currentTime: ${n})`),c&&(h/r.playbackRate<.5||o.bufferedInPlaceToEnd(r))&&o.hls){const p=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,p,i)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,r,n,i){if(e.details===te.BUFFER_STALLED_ERROR)return;const s=t.assetList[n]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${s&&Vs(s)} ${e.error}`),!this.schedule)return;const o=(s==null?void 0:s.identifier)||"",c=this.getAssetPlayerQueueIndex(o),h=this.playerQueue[c]||null,p=this.schedule.items,m=b({},e,{fatal:!1,errorAction:en(!0),asset:s,assetListIndex:n,event:t,schedule:p,scheduleIndex:r,player:h});if(this.hls.trigger(_.INTERSTITIAL_ASSET_ERROR,m),!e.fatal)return;const v=this.playingAsset,T=this.bufferingAsset,A=new Error(i);if(s&&(this.clearAssetPlayer(o,null),s.error=A),!t.assetList.some($=>!$.error))t.error=A;else for(let $=n;$<t.assetList.length;$++)this.resetAssetPlayer(t.assetList[$].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):v&&v.identifier===o?this.advanceAfterAssetEnded(t,r,n):T&&T.identifier===o&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,T)}primaryFallback(e){const t=e.timelineStart,r=this.effectivePlayingItem;let n=this.timelinePos;if(r){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${n} playing: ${Ci(r)} error: ${e.error}`),n===-1&&(n=this.hls.startPosition);const s=this.updateItem(r,n);this.itemsMatch(r,s)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(n===-1){this.checkStart();return}if(!this.schedule)return;const i=this.schedule.findItemIndexAtTime(n);this.setSchedulePosition(i)}onAssetListLoaded(e,t){var r,n;const i=t.event,s=i.identifier,o=t.assetListResponse.ASSETS;if(!((r=this.schedule)!=null&&r.hasEvent(s)))return;const c=i.timelineStart,h=i.duration;let p=0;o.forEach(($,U)=>{const ie=parseFloat($.DURATION);this.createAsset(i,U,p,c+p,ie,$.URI),p+=ie}),i.duration=p,this.log(`Loaded asset-list with duration: ${p} (was: ${h}) ${i}`);const m=this.waitingItem,v=(m==null?void 0:m.event.identifier)===s;this.updateSchedule();const T=(n=this.bufferingItem)==null?void 0:n.event;if(v){var A;const $=this.schedule.findEventIndex(s),U=(A=this.schedule.items)==null?void 0:A[$];if(U){if(!this.playingItem&&this.timelinePos>U.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==$){i.error=new Error(`Interstitial ${o.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${i}`),this.log(i.error.message),this.updateSchedule(!0),this.primaryFallback(i);return}this.setBufferingItem(U)}this.setSchedulePosition($)}else if((T==null?void 0:T.identifier)===s){const $=i.assetList[0];if($){const U=this.getAssetPlayer($.identifier);if(T.appendInPlace){const ie=this.primaryMedia;U&&ie&&this.bufferAssetPlayer(U,ie)}else U&&U.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case te.ASSET_LIST_PARSING_ERROR:case te.ASSET_LIST_LOAD_ERROR:case te.ASSET_LIST_LOAD_TIMEOUT:{const r=t.interstitial;r&&(this.updateSchedule(!0),this.primaryFallback(r));break}case te.BUFFER_STALLED_ERROR:{const r=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&r.event.appendInPlace){this.handleInPlaceStall(r.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const Hl=500;class $0 extends _s{constructor(e,t,r){super(e,t,r,"subtitle-stream-controller",pe.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(_.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(_.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=ut.IDLE,this.setInterval(Hl),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:r,success:n}=t;if(this.fragContextChanged(r)||(Ue(r)&&(this.fragPrevious=r),this.state=ut.IDLE),!n)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let s;const o=r.start;for(let h=0;h<i.length;h++)if(o>=i[h].start&&o<=i[h].end){s=i[h];break}const c=r.start+r.duration;s?s.end=c:(s={start:o,end:c},i.push(s)),this.fragmentTracker.fragBuffered(r),this.fragBufferedComplete(r,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:r,endOffset:n}=t;if(r===0&&n!==Number.POSITIVE_INFINITY){const i=n-1;if(i<=0)return;t.endOffsetSubtitles=Math.max(0,i),this.tracksBuffered.forEach(s=>{for(let o=0;o<s.length;){if(s[o].end<=i){s.shift();continue}else if(s[o].start<i)s[o].start=i;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(r,i,pe.SUBTITLE)}}onError(e,t){const r=t.frag;(r==null?void 0:r.type)===pe.SUBTITLE&&(t.details===te.FRAG_GAP&&this.fragmentTracker.fragBuffered(r,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==ut.STOPPED&&(this.state=ut.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&yl(this.levels,t)){this.levels=t.map(r=>new yr(r));return}this.tracksBuffered=[],this.levels=t.map(r=>{const n=new yr(r);return this.tracksBuffered[n.id]=[],n}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,pe.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var r;if(this.currentTrackId=t.id,!((r=this.levels)!=null&&r.length)||this.currentTrackId===-1){this.clearInterval();return}const n=this.levels[this.currentTrackId];n!=null&&n.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,n&&this.state!==ut.STOPPED&&this.setInterval(Hl)}onSubtitleTrackLoaded(e,t){var r;const{currentTrackId:n,levels:i}=this,{details:s,id:o}=t;if(!i){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const c=i[o];if(o>=i.length||!c)return;this.log(`Subtitle track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let h=0;if(s.live||(r=c.details)!=null&&r.live){if(s.deltaUpdateFailed)return;const m=this.mainDetails;if(!m){this.startFragRequested=!1;return}const v=m.fragments[0];if(!c.details)s.hasProgramDateTime&&m.hasProgramDateTime?(ss(s,m),h=s.fragmentStart):v&&(h=v.start,ra(s,h));else{var p;h=this.alignPlaylists(s,c.details,(p=this.levelLastLoaded)==null?void 0:p.details),h===0&&v&&(h=v.start,ra(s,h))}m&&!this.startFragRequested&&this.setStartPosition(m,h)}c.details=s,this.levelLastLoaded=c,o===n&&(this.hls.trigger(_.SUBTITLE_TRACK_UPDATED,{details:s,id:o,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===ut.IDLE&&(on(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:r}=e,n=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&n!=null&&n.key&&n.iv&&Kn(n.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer,Fi(n.method)).catch(o=>{throw i.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const c=performance.now();i.trigger(_.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:c}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=ut.IDLE})}}doTick(){if(!this.media){this.state=ut.IDLE;return}if(this.state===ut.IDLE){const{currentTrackId:e,levels:t}=this,r=t==null?void 0:t[e];if(!r||!t.length||!r.details||this.waitForLive(r))return;const{config:n}=this,i=this.getLoadPosition(),s=ir.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,n.maxBufferHole),{end:o,len:c}=s,h=r.details,p=this.hls.maxBufferLength+h.levelTargetDuration;if(c>p)return;const m=h.fragments,v=m.length,T=h.edge;let A=null;const $=this.fragPrevious;if(o<T){const le=n.maxFragLookUpTolerance,fe=o>T-le?0:le;A=on($,m,Math.max(m[0].start,o),fe),!A&&$&&$.start<m[0].start&&(A=m[0])}else A=m[v-1];if(A=this.filterReplacedPrimary(A,r.details),!A)return;const U=A.sn-h.startSN,ie=m[U-1];if(ie&&ie.cc===A.cc&&this.fragmentTracker.getState(ie)===$r.NOT_LOADED&&(A=ie),this.fragmentTracker.getState(A)===$r.NOT_LOADED){const le=this.mapToInitFragWhenRequired(A);le&&this.loadFragment(le,r,o)}}}loadFragment(e,t,r){Ue(e)?super.loadFragment(e,t,r):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new z0(this.tracksBuffered[this.currentTrackId]||[])}}class z0{constructor(e){this.buffered=void 0;const t=(r,n,i)=>{if(n=n>>>0,n>i-1)throw new DOMException(`Failed to execute '${r}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${i})`);return e[n][r]};this.buffered={get length(){return e.length},end(r){return t("end",r,e.length)},start(r){return t("start",r,e.length)}}}}const G0={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},jl=a=>String.fromCharCode(G0[a]||a),Li=15,Ji=100,K0={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},H0={17:2,18:4,21:6,22:8,23:10,19:13,20:15},j0={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},V0={25:2,26:4,29:6,30:8,31:10,27:13,28:15},W0=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Y0{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r=typeof t=="function"?t():t;ce.log(`${this.time} [${e}] ${r}`)}}}const Ts=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].toString(16));return t};class Vl{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(e){const t=["foreground","underline","italics","background","flash"];for(let r=0;r<t.length;r++){const n=t[r];e.hasOwnProperty(n)&&(this[n]=e[n])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class q0{constructor(){this.uchar=" ",this.penState=new Vl}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class Z0{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Vl,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Ji;t++)this.chars.push(new q0);this.logger=e}equals(e){for(let t=0;t<Ji;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Ji;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Ji;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Ji&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Ji)}moveCursor(e){const t=this.pos+e;if(e>1)for(let r=this.pos+1;r<t+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=jl(e);if(this.pos>=Ji){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<Ji;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let r=0;r<Ji;r++){const n=this.chars[r].uchar;n!==" "&&(t=!1),e.push(n)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Qo{constructor(e){this.rows=[],this.currRow=Li-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Li;t++)this.rows.push(new Z0(e));this.logger=e}reset(){for(let e=0;e<Li;e++)this.rows[e].clear();this.currRow=Li-1}equals(e){let t=!0;for(let r=0;r<Li;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}copy(e){for(let t=0;t<Li;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Li;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+nr(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let o=0;o<Li;o++)this.rows[o].clear();const i=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const o=s.rows[i].cueStartTime,c=this.logger.time;if(o!==null&&c!==null&&o<c)for(let h=0;h<this.nrRollUpRows;h++)this.rows[t-this.nrRollUpRows+h+1].copy(s.rows[i+h])}}this.currRow=t;const r=this.rows[this.currRow];if(e.indent!==null){const i=e.indent,s=Math.max(i-1,0);r.setCursor(e.indent),e.color=r.chars[s].penState.foreground}const n={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(n)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+nr(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let r="",n=-1;for(let i=0;i<Li;i++){const s=this.rows[i].getTextString();s&&(n=i+1,e?t.push("Row "+n+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?r="["+t.join(" | ")+"]":r=t.join(`
`)),r}getTextAndFormat(){return this.rows}}class Wl{constructor(e,t,r){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=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Qo(r),this.nonDisplayedMemory=new Qo(r),this.lastOutputScreen=new Qo(r),this.currRollUpRow=this.displayedMemory.rows[Li-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Li-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),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=e)}insertChars(e){for(let r=0;r<e.length;r++)this.writeScreen.insertChar(e[r]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+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(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}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 e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const r=Math.floor(e/2)-16,n=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=n[r]}this.logger.log(2,"MIDROW: "+nr(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Yl{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Q0(),this.logger=void 0;const n=this.logger=new Y0;this.channels=[null,new Wl(e,t,n),new Wl(e+1,r,n)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let r=0;r<t.length;r+=2){const n=t[r]&127,i=t[r+1]&127;let s=!1,o=null;if(n===0&&i===0)continue;this.logger.log(3,()=>"["+Ts([t[r],t[r+1]])+"] -> ("+Ts([n,i])+")");const c=this.cmdHistory;if(n>=16&&n<=31){if(X0(n,i,c)){po(null,null,c),this.logger.log(3,()=>"Repeated command ("+Ts([n,i])+") is dropped");continue}po(n,i,this.cmdHistory),s=this.parseCmd(n,i),s||(s=this.parseMidrow(n,i)),s||(s=this.parsePAC(n,i)),s||(s=this.parseBackgroundAttributes(n,i))}else po(null,null,c);if(!s&&(o=this.parseChars(n,i),o)){const p=this.currentChannel;p&&p>0?this.channels[p].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Ts([n,i])+" orig: "+Ts([t[r],t[r+1]]))}}parseCmd(e,t){const r=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,n=(e===23||e===31)&&t>=33&&t<=35;if(!(r||n))return!1;const i=e===20||e===21||e===23?1:2,s=this.channels[i];return e===20||e===21||e===28||e===29?t===32?s.ccRCL():t===33?s.ccBS():t===34?s.ccAOF():t===35?s.ccAON():t===36?s.ccDER():t===37?s.ccRU(2):t===38?s.ccRU(3):t===39?s.ccRU(4):t===40?s.ccFON():t===41?s.ccRDC():t===42?s.ccTR():t===43?s.ccRTD():t===44?s.ccEDM():t===45?s.ccCR():t===46?s.ccENM():t===47&&s.ccEOC():s.ccTO(t-32),this.currentChannel=i,!0}parseMidrow(e,t){let r=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?r=1:r=2,r!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const n=this.channels[r];return n?(n.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Ts([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let r;const n=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,i=(e===16||e===24)&&t>=64&&t<=95;if(!(n||i))return!1;const s=e<=23?1:2;t>=64&&t<=95?r=s===1?K0[e]:j0[e]:r=s===1?H0[e]:V0[e];const o=this.channels[s];return o?(o.setPAC(this.interpretPAC(r,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let r;const n={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?r=t-96:r=t-64,n.underline=(r&1)===1,r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=Math.floor((r-16)/2)*4,n}parseChars(e,t){let r,n=null,i=null;if(e>=25?(r=2,i=e-8):(r=1,i=e),i>=17&&i<=19){let s;i===17?s=t+80:i===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+jl(s)+"' in channel "+r),n=[s]}else e>=32&&e<=127&&(n=t===0?[e]:[e,t]);return n&&this.logger.log(3,()=>"Char codes = "+Ts(n).join(",")),n}parseBackgroundAttributes(e,t){const r=(e===16||e===24)&&t>=32&&t<=47,n=(e===23||e===31)&&t>=45&&t<=47;if(!(r||n))return!1;let i;const s={};e===16||e===24?(i=Math.floor((t-32)/2),s.background=W0[i],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}po(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const r=this.channels[t];r&&r.cueSplitAtTime(e)}}}function po(a,e,t){t.a=a,t.b=e}function X0(a,e,t){return t.a===a&&t.b===e}function Q0(){return{a:null,b:null}}var Jo=function(){if(Or!=null&&Or.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,c){if(typeof c!="string"||!Array.isArray(o))return!1;const h=c.toLowerCase();return~o.indexOf(h)?h:!1}function r(o){return t(a,o)}function n(o){return t(e,o)}function i(o,...c){let h=1;for(;h<arguments.length;h++){const p=arguments[h];for(const m in p)o[m]=p[m]}return o}function s(o,c,h){const p=this,m={enumerable:!0};p.hasBeenReset=!1;let v="",T=!1,A=o,$=c,U=h,ie=null,le="",fe=!0,Ce="auto",Fe="start",tt=50,Ne="middle",Xe=50,qe="middle";Object.defineProperty(p,"id",i({},m,{get:function(){return v},set:function(ze){v=""+ze}})),Object.defineProperty(p,"pauseOnExit",i({},m,{get:function(){return T},set:function(ze){T=!!ze}})),Object.defineProperty(p,"startTime",i({},m,{get:function(){return A},set:function(ze){if(typeof ze!="number")throw new TypeError("Start time must be set to a number.");A=ze,this.hasBeenReset=!0}})),Object.defineProperty(p,"endTime",i({},m,{get:function(){return $},set:function(ze){if(typeof ze!="number")throw new TypeError("End time must be set to a number.");$=ze,this.hasBeenReset=!0}})),Object.defineProperty(p,"text",i({},m,{get:function(){return U},set:function(ze){U=""+ze,this.hasBeenReset=!0}})),Object.defineProperty(p,"region",i({},m,{get:function(){return ie},set:function(ze){ie=ze,this.hasBeenReset=!0}})),Object.defineProperty(p,"vertical",i({},m,{get:function(){return le},set:function(ze){const ft=r(ze);if(ft===!1)throw new SyntaxError("An invalid or illegal string was specified.");le=ft,this.hasBeenReset=!0}})),Object.defineProperty(p,"snapToLines",i({},m,{get:function(){return fe},set:function(ze){fe=!!ze,this.hasBeenReset=!0}})),Object.defineProperty(p,"line",i({},m,{get:function(){return Ce},set:function(ze){if(typeof ze!="number"&&ze!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Ce=ze,this.hasBeenReset=!0}})),Object.defineProperty(p,"lineAlign",i({},m,{get:function(){return Fe},set:function(ze){const ft=n(ze);if(!ft)throw new SyntaxError("An invalid or illegal string was specified.");Fe=ft,this.hasBeenReset=!0}})),Object.defineProperty(p,"position",i({},m,{get:function(){return tt},set:function(ze){if(ze<0||ze>100)throw new Error("Position must be between 0 and 100.");tt=ze,this.hasBeenReset=!0}})),Object.defineProperty(p,"positionAlign",i({},m,{get:function(){return Ne},set:function(ze){const ft=n(ze);if(!ft)throw new SyntaxError("An invalid or illegal string was specified.");Ne=ft,this.hasBeenReset=!0}})),Object.defineProperty(p,"size",i({},m,{get:function(){return Xe},set:function(ze){if(ze<0||ze>100)throw new Error("Size must be between 0 and 100.");Xe=ze,this.hasBeenReset=!0}})),Object.defineProperty(p,"align",i({},m,{get:function(){return qe},set:function(ze){const ft=n(ze);if(!ft)throw new SyntaxError("An invalid or illegal string was specified.");qe=ft,this.hasBeenReset=!0}})),p.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class J0{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function ql(a){function e(r,n,i,s){return(r|0)*3600+(n|0)*60+(i|0)+parseFloat(s||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class eh{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,r){for(let n=0;n<r.length;++n)if(t===r[n]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const r=parseFloat(t);if(r>=0&&r<=100)return this.set(e,r),!0}return!1}}function Zl(a,e,t,r){const n=r?a.split(r):[a];for(const i in n){if(typeof n[i]!="string")continue;const s=n[i].split(t);if(s.length!==2)continue;const o=s[0],c=s[1];e(o,c)}}const el=new Jo(0,0,""),mo=el.align==="middle"?"middle":"center";function th(a,e,t){const r=a;function n(){const o=ql(a);if(o===null)throw new Error("Malformed timestamp: "+r);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function i(o,c){const h=new eh;Zl(o,function(v,T){let A;switch(v){case"region":for(let $=t.length-1;$>=0;$--)if(t[$].id===T){h.set(v,t[$].region);break}break;case"vertical":h.alt(v,T,["rl","lr"]);break;case"line":A=T.split(","),h.integer(v,A[0]),h.percent(v,A[0])&&h.set("snapToLines",!1),h.alt(v,A[0],["auto"]),A.length===2&&h.alt("lineAlign",A[1],["start",mo,"end"]);break;case"position":A=T.split(","),h.percent(v,A[0]),A.length===2&&h.alt("positionAlign",A[1],["start",mo,"end","line-left","line-right","auto"]);break;case"size":h.percent(v,T);break;case"align":h.alt(v,T,["start",mo,"end","left","right"]);break}},/:/,/\s/),c.region=h.get("region",null),c.vertical=h.get("vertical","");let p=h.get("line","auto");p==="auto"&&el.line===-1&&(p=-1),c.line=p,c.lineAlign=h.get("lineAlign","start"),c.snapToLines=h.get("snapToLines",!0),c.size=h.get("size",100),c.align=h.get("align",mo);let m=h.get("position","auto");m==="auto"&&el.position===50&&(m=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=m}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=n(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);a=a.slice(3),s(),e.endTime=n(),s(),i(a,e)}function Xl(a){return a.replace(/<br(?: \/)?>/gi,`
`)}class rh{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new J0,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function r(){let i=t.buffer,s=0;for(i=Xl(i);s<i.length&&i[s]!=="\r"&&i[s]!==`
`;)++s;const o=i.slice(0,s);return i[s]==="\r"&&++s,i[s]===`
`&&++s,t.buffer=i.slice(s),o}function n(i){Zl(i,function(s,o){},/:/)}try{let i="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;i=r();const o=i.match(/^()?WEBVTT([ \t].*)?$/);if(!(o!=null&&o[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:i=r(),t.state){case"HEADER":/:/.test(i)?n(i):i||(t.state="ID");continue;case"NOTE":i||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){t.state="NOTE";break}if(!i)continue;if(t.cue=new Jo(0,0,""),t.state="CUE",i.indexOf("-->")===-1){t.cue.id=i;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{th(i,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=i.indexOf("-->")!==-1;if(!i||o&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
`),t.cue.text+=i}continue;case"BADCUE":i||(t.state="ID")}}}catch(i){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const nh=/\r\n|\n\r|\n|\r/g,tl=function(e,t,r=0){return e.slice(r,r+t.length)===t},ih=function(e){let t=parseInt(e.slice(-3));const r=parseInt(e.slice(-6,-4)),n=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!F(t)||!F(r)||!F(n)||!F(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*r,t+=60*1e3*n,t+=60*60*1e3*i,t};function rl(a,e,t){return wa(a.toString())+wa(e.toString())+wa(t)}const sh=function(e,t,r){let n=e[t],i=e[n.prevCC];if(!i||!i.new&&n.new){e.ccOffset=e.presentationOffset=n.start,n.new=!1;return}for(;(s=i)!=null&&s.new;){var s;e.ccOffset+=n.start-i.start,n.new=!1,n=i,i=e[n.prevCC]}e.presentationOffset=r};function ah(a,e,t,r,n,i,s){const o=new rh,c=We(new Uint8Array(a)).trim().replace(nh,`
`).split(`
`),h=[],p=e?$i(e.baseTime,e.timescale):0;let m="00:00.000",v=0,T=0,A,$=!0;o.oncue=function(U){const ie=t[r];let le=t.ccOffset;const fe=(v-p)/9e4;if(ie!=null&&ie.new&&(T!==void 0?le=t.ccOffset=ie.start:sh(t,r,fe)),fe){if(!e){A=new Error("Missing initPTS for VTT MPEGTS");return}le=fe-t.presentationOffset}const Ce=U.endTime-U.startTime,Fe=$n((U.startTime+le-T)*9e4,n*9e4)/9e4;U.startTime=Math.max(Fe,0),U.endTime=Math.max(Fe+Ce,0);const tt=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(tt)),U.id||(U.id=rl(U.startTime,U.endTime,tt)),U.endTime>0&&h.push(U)},o.onparsingerror=function(U){A=U},o.onflush=function(){if(A){s(A);return}i(h)},c.forEach(U=>{if($)if(tl(U,"X-TIMESTAMP-MAP=")){$=!1,U.slice(16).split(",").forEach(ie=>{tl(ie,"LOCAL:")?m=ie.slice(6):tl(ie,"MPEGTS:")&&(v=parseInt(ie.slice(7)))});try{T=ih(m)/1e3}catch(ie){A=ie}return}else U===""&&($=!1);o.parse(U+`
`)}),o.flush()}const nl="stpp.ttml.im1t",Ql=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Jl=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,oh={left:"start",center:"center",right:"end",start:"start",end:"end"};function eu(a,e,t,r){const n=Ee(new Uint8Array(a),["mdat"]);if(n.length===0){r(new Error("Could not parse IMSC1 mdat"));return}const i=n.map(o=>We(o)),s=Xn(e.baseTime,1,e.timescale);try{i.forEach(o=>t(lh(o,s)))}catch(o){r(o)}}function lh(a,e){const n=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!n)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(i).reduce((m,v)=>(m[v]=n.getAttribute(`ttp:${v}`)||i[v],m),{}),o=n.getAttribute("xml:space")!=="preserve",c=tu(il(n,"styling","style")),h=tu(il(n,"layout","region")),p=il(n,"body","[begin]");return[].map.call(p,m=>{const v=ru(m,o);if(!v||!m.hasAttribute("begin"))return null;const T=al(m.getAttribute("begin"),s),A=al(m.getAttribute("dur"),s);let $=al(m.getAttribute("end"),s);if(T===null)throw nu(m);if($===null){if(A===null)throw nu(m);$=T+A}const U=new Jo(T-e,$-e,v);U.id=rl(U.startTime,U.endTime,U.text);const ie=h[m.getAttribute("region")],le=c[m.getAttribute("style")],fe=uh(ie,le,c),{textAlign:Ce}=fe;if(Ce){const Fe=oh[Ce];Fe&&(U.lineAlign=Fe),U.align=Ce}return b(U,fe),U}).filter(m=>m!==null)}function il(a,e,t){const r=a.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(t)):[]}function tu(a){return a.reduce((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function ru(a,e){return[].slice.call(a.childNodes).reduce((t,r,n)=>{var i;return r.nodeName==="br"&&n?t+`
`:(i=r.childNodes)!=null&&i.length?ru(r,e):e?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent},"")}function uh(a,e,t){const r="http://www.w3.org/ns/ttml#styling";let n=null;const i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(n=t[s]),i.reduce((o,c)=>{const h=sl(e,r,c)||sl(a,r,c)||sl(n,r,c);return h&&(o[c]=h),o},{})}function sl(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function nu(a){return new Error(`Could not parse ttml timestamp ${a}`)}function al(a,e){if(!a)return null;let t=ql(a);return t===null&&(Ql.test(a)?t=hh(a,e):Jl.test(a)&&(t=ch(a,e))),t}function hh(a,e){const t=Ql.exec(a),r=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+r/e.frameRate}function ch(a,e){const t=Jl.exec(a),r=Number(t[1]);switch(t[2]){case"h":return r*3600;case"m":return r*60;case"ms":return r*1e3;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}class go{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,r){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class fh{constructor(e){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=au(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.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}},e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(_.FRAG_LOADING,this.onFragLoading,this),e.on(_.FRAG_LOADED,this.onFragLoaded,this),e.on(_.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(_.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(_.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(_.FRAG_LOADING,this.onFragLoading,this),e.off(_.FRAG_LOADED,this.onFragLoaded,this),e.off(_.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(_.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(_.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new go(this,"textTrack1"),t=new go(this,"textTrack2"),r=new go(this,"textTrack3"),n=new go(this,"textTrack4");this.cea608Parser1=new Yl(1,e,t),this.cea608Parser2=new Yl(3,r,n)}addCues(e,t,r,n,i){let s=!1;for(let o=i.length;o--;){const c=i[o],h=dh(c[0],c[1],t,r);if(h>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],r),s=!0,h/(r-t)>.5))return}if(s||i.push([t,r]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,r,n)}else{const o=this.Cues.newCue(null,t,r,n);this.hls.trigger(_.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:n,timescale:i,trackId:s}){const{unparsedVttFrags:o}=this;r===pe.MAIN&&(this.initPTS[t.cc]={baseTime:n,timescale:i,trackId:s}),o.length&&(this.unparsedVttFrags=[],o.forEach(c=>{this.initPTS[c.frag.cc]?this.onFragLoaded(_.FRAG_LOADED,c):this.hls.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:r}=this;if(r)for(let n=0;n<r.textTracks.length;n++){const i=r.textTracks[n];if(su(i,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return i}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:r,media:n}=this,{label:i,languageCode:s}=t[e],o=this.getExistingTrack(i,s);if(o)r[e]=o,Hs(r[e]),Ul(r[e],n);else{const c=this.createTextTrack("captions",i,s);c&&(c[e]=!0,r[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const r=t.label,n={_id:e,label:r,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=n,this.hls.trigger(_.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}createTextTrack(e,t,r){const n=this.media;if(n)return n.addTextTrack(e,t,r)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const r=!!t.transferMedia;if(this.media=null,r)return;const{captionsTracks:n}=this;Object.keys(n).forEach(i=>{Hs(n[i]),delete n[i]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=au(),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:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let r=0;r<t.length;r++)Hs(t[r])}onSubtitleTracksUpdated(e,t){const r=t.subtitleTracks||[],n=r.some(i=>i.textCodec===nl);if(this.config.enableWebVTT||n&&this.config.enableIMSC1){if(yl(this.tracks,r)){this.tracks=r;return}if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const s=this.media,o=s?ho(s.textTracks):null;if(this.tracks.forEach((c,h)=>{let p;if(o){let m=null;for(let v=0;v<o.length;v++)if(o[v]&&su(o[v],c)){m=o[v],o[v]=null;break}m&&(p=m)}if(p)Hs(p);else{const m=iu(c);p=this.createTextTrack(m,c.name,c.lang),p&&(p.mode="disabled")}p&&this.textTracks.push(p)}),o!=null&&o.length){const c=o.filter(h=>h!==null).map(h=>h.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(_.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(r=>{const n=/(?:CC|SERVICE)([1-4])/.exec(r.instreamId);if(!n)return;const i=`textTrack${n[1]}`,s=this.captionsProperties[i];s&&(s.label=r.name,r.lang&&(s.languageCode=r.lang),s.media=r)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===pe.MAIN){var r,n;const{cea608Parser1:i,cea608Parser2:s,lastSn:o}=this,{cc:c,sn:h}=t.frag,p=(r=(n=t.part)==null?void 0:n.index)!=null?r:-1;i&&s&&(h!==o+1||h===o&&p!==this.lastPartIndex+1||c!==this.lastCc)&&(i.reset(),s.reset()),this.lastCc=c,this.lastSn=h,this.lastPartIndex=p}}onFragLoaded(e,t){const{frag:r,payload:n}=t;if(r.type===pe.SUBTITLE)if(n.byteLength){const i=r.decryptdata,s="stats"in t;if(i==null||!i.encrypted||s){const o=this.tracks[r.level],c=this.vttCCs;c[r.cc]||(c[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),o&&o.textCodec===nl?this._parseIMSC1(r,n):this._parseVTTs(t)}}else this.hls.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const r=this.hls;eu(t,this.initPTS[e.cc],n=>{this._appendCues(n,e.level),r.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},n=>{r.logger.log(`Failed to parse IMSC1: ${n}`),r.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:n})})}_parseVTTs(e){var t;const{frag:r,payload:n}=e,{initPTS:i,unparsedVttFrags:s}=this,o=i.length-1;if(!i[r.cc]&&o===-1){s.push(e);return}const c=this.hls,h=(t=r.initSegment)!=null&&t.data?Ct(r.initSegment.data,new Uint8Array(n)).buffer:n;ah(h,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,p=>{this._appendCues(p,r.level),c.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},p=>{const m=p.message==="Missing initPTS for VTT MPEGTS";m?s.push(e):this._fallbackToIMSC1(r,n),c.logger.log(`Failed to parse VTT cue: ${p}`),!(m&&o>r.cc)&&c.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:p})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||eu(t,this.initPTS[e.cc],()=>{r.textCodec=nl,this._parseIMSC1(e,t)},()=>{r.textCodec="wvtt"})}_appendCues(e,t){const r=this.hls;if(this.config.renderTextTracksNatively){const n=this.textTracks[t];if(!n||n.mode==="disabled")return;e.forEach(i=>$l(n,i))}else{const n=this.tracks[t];if(!n)return;const i=n.default?"default":"subtitles"+t;r.trigger(_.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===pe.SUBTITLE&&this.onFragLoaded(_.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:r,samples:n}=t;if(!(r.type===pe.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let i=0;i<n.length;i++){const s=n[i].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(s);this.cea608Parser1.addData(n[i].pts,o[0]),this.cea608Parser2.addData(n[i].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:r,endOffsetSubtitles:n,type:i}){const{media:s}=this;if(!(!s||s.currentTime<r)){if(!i||i==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(c=>qo(o[c],t,r))}if(this.config.renderTextTracksNatively&&t===0&&n!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>qo(o[c],t,n))}}}extractCea608Data(e){const t=[[],[]],r=e[0]&31;let n=2;for(let i=0;i<r;i++){const s=e[n++],o=127&e[n++],c=127&e[n++];if(o===0&&c===0)continue;if((4&s)!==0){const p=3&s;(p===0||p===1)&&(t[p].push(o),t[p].push(c))}}return t}}function iu(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function su(a,e){return!!a&&a.kind===iu(e)&&zo(e,a)}function dh(a,e,t,r){return Math.min(e,r)-Math.max(a,t)}function au(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const ph=/\s/,mh={newCue(a,e,t,r){const n=[];let i,s,o,c,h;const p=self.VTTCue||self.TextTrackCue;for(let v=0;v<r.rows.length;v++)if(i=r.rows[v],o=!0,c=0,h="",!i.isEmpty()){var m;for(let $=0;$<i.chars.length;$++)ph.test(i.chars[$].uchar)&&o?c++:(h+=i.chars[$].uchar,o=!1);i.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const T=Xl(h.trim()),A=rl(e,t,T);a!=null&&(m=a.cues)!=null&&m.getCueById(A)||(s=new p(e,t,T),s.id=A,s.line=v+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),n.push(s))}return a&&n.length&&(n.sort((v,T)=>v.line==="auto"||T.line==="auto"?0:v.line>8&&T.line>8?T.line-v.line:v.line-T.line),n.forEach(v=>$l(a,v))),n}};function gh(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const _h=/(\d+)-(\d+)\/(\d+)/;class ou{constructor(e){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=e.fetchSetup||Eh,this.controller=new self.AbortController,this.stats=new E}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 e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,r){const n=this.stats;if(n.loading.start)throw new Error("Loader can only be used once.");n.loading.start=self.performance.now();const i=vh(e,this.controller.signal),s=e.responseType==="arraybuffer",o=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=c&&F(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(n,e,this.response))},t.timeout),(Ea(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(m=>{var v;this.response=this.loader=m;const T=Math.max(self.performance.now(),n.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(n,e,this.response))},h-(T-n.loading.start)),!m.ok){const{status:$,statusText:U}=m;throw new xh(U||"fetch, bad network response",$,m)}n.loading.first=T,n.total=bh(m.headers)||n.total;const A=(v=this.callbacks)==null?void 0:v.onProgress;return A&&F(t.highWaterMark)?this.loadProgressively(m,n,e,t.highWaterMark,A):s?m.arrayBuffer():e.responseType==="json"?m.json():m.text()}).then(m=>{var v,T;const A=this.response;if(!A)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),n.loading.end=Math.max(self.performance.now(),n.loading.first);const $=m[o];$&&(n.loaded=n.total=$);const U={url:A.url,data:m,code:A.status},ie=(v=this.callbacks)==null?void 0:v.onProgress;ie&&!F(t.highWaterMark)&&ie(n,e,m,A),(T=this.callbacks)==null||T.onSuccess(U,n,e,A)}).catch(m=>{var v;if(self.clearTimeout(this.requestTimeout),n.aborted)return;const T=m&&m.code||0,A=m?m.message:null;(v=this.callbacks)==null||v.onError({code:T,text:A},e,m?m.details:null,n)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,r,n=0,i){const s=new ua,o=e.body.getReader(),c=()=>o.read().then(h=>{if(h.done)return s.dataLength&&i(t,r,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const p=h.value,m=p.length;return t.loaded+=m,m<n||s.dataLength?(s.push(p),s.dataLength>=n&&i(t,r,s.flush().buffer,e)):i(t,r,p.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function vh(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(b({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function yh(a){const e=_h.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function bh(a){const e=a.get("Content-Range");if(e){const r=yh(e);if(F(r))return r}const t=a.get("Content-Length");if(t)return parseInt(t)}function Eh(a,e){return new self.Request(a.url,e)}class xh extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const wh=/^age:\s*[\d.]+\s*$/im;class lu{constructor(e){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=e&&e.xhrSetup||null,this.stats=new E,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=r,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const r=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0,n.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then(()=>{if(!(this.loader!==r||this.stats.aborted))return i(r,t.url)}).catch(s=>{if(!(this.loader!==r||this.stats.aborted))return r.open("GET",t.url,!0),i(r,t.url)}).then(()=>{this.loader!==r||this.stats.aborted||this.openAndSendXhr(r,t,e)}).catch(s=>{var o;(o=this.callbacks)==null||o.onError({code:r.status,text:s.message},t,r,n)}):this.openAndSendXhr(r,t,e)}openAndSendXhr(e,t,r){e.readyState||e.open("GET",t.url,!0);const n=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:s}=r.loadPolicy;if(n)for(const o in n)e.setRequestHeader(o,n[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),r.timeout=i&&F(i)?i:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:r}=this;if(!e||!t)return;const n=t.readyState,i=this.config;if(!r.aborted&&n>=2&&(r.loading.first===0&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),n===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const h=t.status,p=t.responseType==="text"?t.responseText:null;if(h>=200&&h<300){const A=p!=null?p:t.response;if(A!=null){var s,o;r.loading.end=Math.max(self.performance.now(),r.loading.first);const $=t.responseType==="arraybuffer"?A.byteLength:A.length;r.loaded=r.total=$,r.bwEstimate=r.total*8e3/(r.loading.end-r.loading.first);const U=(s=this.callbacks)==null?void 0:s.onProgress;U&&U(r,e,A,t);const ie={url:t.responseURL,data:A,code:h};(o=this.callbacks)==null||o.onSuccess(ie,r,e,t);return}}const m=i.loadPolicy.errorRetry,v=r.retry,T={url:e.url,data:void 0,code:h};if(bi(m,v,!1,T))this.retry(m);else{var c;ce.error(`${h} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:h,text:t.statusText},e,t,r)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(bi(e,t,!0))this.retry(e);else{var r;ce.warn(`timeout while loading ${(r=this.context)==null?void 0:r.url}`);const n=this.callbacks;n&&(this.abortInternal(),n.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:r}=this;this.retryDelay=Vr(e,r.retry),r.retry++,ce.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${r.retry}/${e.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(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&wh.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const Sh={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Th=S(S({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:lu,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Dn,bufferController:Lu,capLevelController:Ko,errorController:kn,fpsController:k0,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:Bi,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:Sh},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},Ah()),{},{subtitleStreamController:$0,subtitleTrackController:R0,timelineController:fh,audioStreamController:Au,audioTrackController:Du,emeController:Ks,cmcdController:S0,contentSteeringController:A0,interstitialsController:U0});function Ah(){return{cueHandler:mh,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 Dh(a,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const r=ol(a),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,c=e[o]===void 0,h=[];i.forEach(p=>{const m=`${s}Loading${p}`,v=e[m];if(v!==void 0&&c){h.push(m);const T=r[o].default;switch(e[o]={default:T},p){case"TimeOut":T.maxLoadTimeMs=v,T.maxTimeToFirstByteMs=v;break;case"MaxRetry":T.errorRetry.maxNumRetry=v,T.timeoutRetry.maxNumRetry=v;break;case"RetryDelay":T.errorRetry.retryDelayMs=v,T.timeoutRetry.retryDelayMs=v;break;case"MaxRetryTimeout":T.errorRetry.maxRetryDelayMs=v,T.timeoutRetry.maxRetryDelayMs=v;break}}}),h.length&&t.warn(`hls.js config: "${h.join('", "')}" setting(s) are deprecated, use "${o}": ${nr(e[o])}`)}),S(S({},r),e)}function ol(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(ol):Object.keys(a).reduce((e,t)=>(e[t]=ol(a[t]),e),{}):a}function kh(a,e){const t=a.loader;t!==ou&&t!==lu?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):gh()&&(a.loader=ou,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const _o=2,Ch=.1,Lh=.05,Rh=100;class Ih extends Si{constructor(e,t){super("gap-controller",e.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 r;(r=this.media)!=null&&r.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var r;this.ended=((r=this.media)==null?void 0:r.currentTime)||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(Rh),this.mediaSource=t.mediaSource;const r=this.media=t.media;vn(r,"playing",this.onMediaPlaying),vn(r,"waiting",this.onMediaWaiting),vn(r,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:r}=this;r&&(Sn(r,"playing",this.onMediaPlaying),Sn(r,"waiting",this.onMediaWaiting),Sn(r,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var r,n;const i=(r=this.hls)==null?void 0:r.config;if(!i)return;const s=this.media;if(!s)return;const{seeking:o}=s,c=this.seeking&&!o,h=!this.seeking&&o,p=s.paused&&!o||s.ended||s.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,i.nudgeOnVideoHole&&!p&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(h||c){c&&this.stallResolved(e);return}if(p){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!1}));return}if(!ir.getBuffered(s).length){this.nudgeRetry=0;return}const m=ir.bufferInfo(s,e,0),v=m.nextStart||0,T=this.fragmentTracker;if(o&&T&&this.hls){const tt=uu(this.hls.inFlightFragments,e),Ne=m.len>_o,Xe=!v||tt||v-e>_o&&!T.getPartialFragment(e);if(Ne||Xe)return;this.moved=!1}const A=(n=this.hls)==null?void 0:n.latestLevelDetails;if(!this.moved&&this.stalled!==null&&T){if(!(m.len>0)&&!v)return;const Ne=Math.max(v,m.start||0)-e,qe=!!(A!=null&&A.live)?A.targetduration*2:_o,ze=vo(e,T);if(Ne>0&&(Ne<=qe||ze)){s.paused||this._trySkipBufferHole(ze);return}}const $=i.detectStallWithCurrentTimeMs,U=self.performance.now(),ie=this.waiting;let le=this.stalled;if(le===null)if(ie>0&&U-ie<$)le=this.stalled=ie;else{this.stalled=U;return}const fe=U-le;if(!o&&(fe>=$||ie)&&this.hls){var Ce;if(((Ce=this.mediaSource)==null?void 0:Ce.readyState)==="ended"&&!(A!=null&&A.live)&&Math.abs(e-((A==null?void 0:A.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(m),!this.media||!this.hls)return}const Fe=ir.bufferInfo(s,e,i.maxBufferHole);this._tryFixBufferStall(Fe,fe,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const r=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(r)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(_.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var r;const n=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(r=this.buffered.audio)!=null&&r.length&&n&&n.length>1&&e>n.end(0)){const i=ir.bufferedInfo(ir.timeRangesToArray(this.buffered.audio),e,0);if(i.len>1&&t>=i.start){const s=ir.timeRangesToArray(n),o=ir.bufferedInfo(s,t,0).bufferedIndex;if(o>-1&&o<s.length-1){const c=ir.bufferedInfo(s,e,0).bufferedIndex,h=s[o].end,p=s[o+1].start;if((c===-1||c>o)&&p-h<1&&e-h<2){const m=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${h} -> ${p} buffered index: ${c}`);this.warn(m.message),this.media.currentTime+=1e-6;let v=vo(e,this.fragmentTracker);v&&"fragment"in v?v=v.fragment:v||(v=void 0);const T=ir.bufferInfo(this.media,e,0);this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:m,reason:m.message,frag:v,buffer:T.len,bufferInfo:T})}}}}}_tryFixBufferStall(e,t,r){var n,i;const{fragmentTracker:s,media:o}=this,c=(n=this.hls)==null?void 0:n.config;if(!o||!s||!c)return;const h=(i=this.hls)==null?void 0:i.latestLevelDetails,p=vo(r,s);if((p||h!=null&&h.live&&r<h.fragmentStart)&&(this._trySkipBufferHole(p)||!this.media))return;const m=e.buffered,v=this.adjacentTraversal(e,r);(m&&m.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-r<c.maxBufferHole||v))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const r=this.fragmentTracker,n=e.nextStart;if(r&&n){const i=r.getFragAtPos(t,pe.MAIN),s=r.getFragAtPos(n,pe.MAIN);if(i&&s)return s.sn-i.sn<2}return!1}_reportStall(e){const{hls:t,media:r,stallReported:n,stalled:i}=this;if(!n&&i!==null&&r&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${nr(e)})`);this.warn(s.message),t.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:i}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:r,media:n}=this,i=(t=this.hls)==null?void 0:t.config;if(!n||!r||!i)return 0;const s=n.currentTime,o=ir.bufferInfo(n,s,0),c=s<o.start?o.start:o.nextStart;if(c&&this.hls){const p=o.len<=i.maxBufferHole,m=o.len>0&&o.len<1&&n.readyState<3,v=c-s;if(v>0&&(p||m)){if(v>i.maxBufferHole){let A=!1;if(s===0){const $=r.getAppendedFrag(0,pe.MAIN);$&&c<$.end&&(A=!0)}if(!A&&e){var h;if(!((h=this.hls.loadLevelObj)!=null&&h.details)||uu(this.hls.inFlightFragments,c))return 0;let U=!1,ie=e.end;for(;ie<c;){const le=vo(ie,r);if(le)ie+=le.duration;else{U=!0;break}}if(U)return 0}}const T=Math.max(c+Lh,s+Ch);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${T}`),this.moved=!0,n.currentTime=T,!(e!=null&&e.gap)){const A=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${T}`),$={type:ye.MEDIA_ERROR,details:te.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:A,reason:A.message,buffer:o.len,bufferInfo:o};e&&("fragment"in e?$.part=e:$.frag=e),this.hls.trigger(_.ERROR,$)}return T}}return 0}_tryNudgeBuffer(e){const{hls:t,media:r,nudgeRetry:n}=this,i=t==null?void 0:t.config;if(!r||!i)return 0;const s=r.currentTime;if(this.nudgeRetry++,n<i.nudgeMaxRetry){const o=s+(n+1)*i.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${o}`);this.warn(c.message),r.currentTime=o,t.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${i.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function uu(a,e){const t=hu(a.main);if(t&&t.start<=e)return t;const r=hu(a.audio);return r&&r.start<=e?r:null}function hu(a){if(!a)return null;switch(a.state){case ut.IDLE:case ut.STOPPED:case ut.ENDED:case ut.ERROR:return null}return a.frag}function vo(a,e){return e.getAppendedFrag(a,pe.MAIN)||e.getPartialFragment(a)}const Ph=.25;function ll(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function ul(a,e,t,r,n){let i=new a(e,t,"");try{i.value=r,n&&(i.type=n)}catch(s){i=new a(e,t,nr(n?S({type:n},r):r))}return i}const yo=(()=>{const a=ll();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class Oh{constructor(e){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(_.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var r;this.media=t.media,((r=t.overrides)==null?void 0:r.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&Hs(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const r=e[t];if(r.kind==="metadata"&&r.label==="id3")return Ul(r,this.media),r}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:r,enableID3MetadataCues:n}=this.hls.config;if(!r&&!n)return;const{samples:i}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=ll();if(s)for(let o=0;o<i.length;o++){const c=i[o].type;if(c===yn.emsg&&!r||!n)continue;const h=va(i[o].data),p=i[o].pts;let m=p+i[o].duration;m>yo&&(m=yo),m-p<=0&&(m=p+Ph);for(let T=0;T<h.length;T++){const A=h[T];if(!Qa(A)){this.updateId3CueEnds(p,c);const $=ul(s,p,m,A,c);$&&this.id3Track.addCue($)}}}}updateId3CueEnds(e,t){var r;const n=(r=this.id3Track)==null?void 0:r.cues;if(n)for(let i=n.length;i--;){const s=n[i];s.type===t&&s.startTime<e&&s.endTime===yo&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:r,type:n}){const{id3Track:i,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:c}}=s;if(i&&(o||c)){let h;n==="audio"?h=p=>p.type===yn.audioId3&&c:n==="video"?h=p=>p.type===yn.emsg&&o:h=p=>p.type===yn.audioId3&&c||p.type===yn.emsg&&o,qo(i,t,r,h)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:r,timelineOffset:n,enableDateRangeMetadataCues:i,interstitialsController:s}=this.hls.config;if(!i)return;const o=ll();if(r&&n&&!s){const{fragmentStart:$,fragmentEnd:U}=e;let ie=this.assetCue;ie?(ie.startTime=$,ie.endTime=U):o&&(ie=this.assetCue=ul(o,$,U,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),ie&&(ie.id=r,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(ie),ie.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:c}=this,{dateRanges:h}=e,p=Object.keys(h);let m=this.dateRangeCuesAppended;if(c&&t){var v;if((v=c.cues)!=null&&v.length){const $=Object.keys(m).filter(U=>!p.includes(U));for(let U=$.length;U--;){var T;const ie=$[U],le=(T=m[ie])==null?void 0:T.cues;delete m[ie],le&&Object.keys(le).forEach(fe=>{const Ce=le[fe];if(Ce){Ce.removeEventListener("enter",this.onEventCueEnter);try{c.removeCue(Ce)}catch(Fe){}}})}}else m=this.dateRangeCuesAppended={}}const A=e.fragments[e.fragments.length-1];if(!(p.length===0||!F(A==null?void 0:A.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let $=0;$<p.length;$++){const U=p[$],ie=h[U],le=ie.startTime,fe=m[U],Ce=(fe==null?void 0:fe.cues)||{};let Fe=(fe==null?void 0:fe.durationKnown)||!1,tt=yo;const{duration:Ne,endDate:Xe}=ie;if(Xe&&Ne!==null)tt=le+Ne,Fe=!0;else if(ie.endOnNext&&!Fe){const ze=p.reduce((ft,Ut)=>{if(Ut!==ie.id){const jt=h[Ut];if(jt.class===ie.class&&jt.startDate>ie.startDate&&(!ft||ie.startDate<ft.startDate))return jt}return ft},null);ze&&(tt=ze.startTime,Fe=!0)}const qe=Object.keys(ie.attr);for(let ze=0;ze<qe.length;ze++){const ft=qe[ze];if(!Oi(ft))continue;const Ut=Ce[ft];if(Ut)Fe&&!(fe!=null&&fe.durationKnown)?Ut.endTime=tt:Math.abs(Ut.startTime-le)>.01&&(Ut.startTime=le,Ut.endTime=tt);else if(o){let jt=ie.attr[ft];ns(ft)&&(jt=P(jt));const Vt=ul(o,le,tt,{key:ft,data:jt},yn.dateRange);Vt&&(Vt.id=U,this.id3Track.addCue(Vt),Ce[ft]=Vt,s&&(ft==="X-ASSET-LIST"||ft==="X-ASSET-URL")&&Vt.addEventListener("enter",this.onEventCueEnter))}}m[U]={cues:Ce,dateRange:ie,durationKnown:Fe}}}}}class Mh{constructor(e){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:t}=this,r=this.levelDetails;if(!t||!r)return;this.currentTime=t.currentTime;const n=this.computeLatency();if(n===null)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||s===1||!r.live)return;const o=this.targetLatency;if(o===null)return;const c=n-o,h=Math.min(this.maxLatency,o+r.targetduration);if(c<h&&c>.05&&this.forwardBufferLength>1){const m=Math.min(2,Math.max(1,s)),v=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,T=Math.min(m,Math.max(1,v));this.changeMediaPlaybackRate(t,T)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:r,targetduration:n}=e,{liveSyncDuration:i,liveSyncDurationCount:s,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let h=o&&r||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||h===0)&&(h=i!==void 0?i:s*n);const p=n;return h+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,p)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const r=this.levelDetails;if(r===null)return null;const n=r.edge,i=e-t-this.edgeStalled,s=n-r.totalduration,o=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(s,i),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.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(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var r;t.details===te.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(r=this.levelDetails)!=null&&r.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var r,n;e.playbackRate!==t&&((r=this.hls)==null||r.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(n=this.targetLatency)==null?void 0:n.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Fh extends $o{constructor(e,t){super(e,"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=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const r=this.hls.config.preferManagedMediaSource,n=[],i={},s={};let o=!1,c=!1,h=!1;t.levels.forEach(p=>{const m=p.attrs;let{audioCodec:v,videoCodec:T}=p;v&&(p.audioCodec=v=he(v,r)||void 0),T&&(T=p.videoCodec=Dr(T));const{width:A,height:$,unknownCodecs:U}=p,ie=(U==null?void 0:U.length)||0;if(o||(o=!!(A&&$)),c||(c=!!T),h||(h=!!v),ie||v&&!this.isAudioSupported(v)||T&&!this.isVideoSupported(T)){this.log(`Some or all CODECS not supported "${m.CODECS}"`);return}const{CODECS:le,"FRAME-RATE":fe,"HDCP-LEVEL":Ce,"PATHWAY-ID":Fe,RESOLUTION:tt,"VIDEO-RANGE":Ne}=m,qe=`${`${Fe||"."}-`}${p.bitrate}-${tt}-${fe}-${le}-${Ne}-${Ce}`;if(i[qe])if(i[qe].uri!==p.url&&!p.attrs["PATHWAY-ID"]){const ze=s[qe]+=1;p.attrs["PATHWAY-ID"]=new Array(ze+1).join(".");const ft=this.createLevel(p);i[qe]=ft,n.push(ft)}else i[qe].addGroupId("audio",m.AUDIO),i[qe].addGroupId("text",m.SUBTITLES);else{const ze=this.createLevel(p);i[qe]=ze,s[qe]=1,n.push(ze)}}),this.filterAndSortMediaOptions(n,t,o,c,h)}createLevel(e){const t=new yr(e),r=e.supplemental;if(r!=null&&r.videoCodec&&!this.isVideoSupported(r.videoCodec)){const n=new Error(`SUPPLEMENTAL-CODECS not supported "${r.videoCodec}"`);this.log(n.message),t.supportedResult=At(n,[])}return t}isAudioSupported(e){return ke(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return ke(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,r,n,i){var s;let o=[],c=[],h=e;const p=((s=t.stats)==null?void 0:s.parsing)||{};if((r||n)&&i&&(h=h.filter(({videoCodec:le,videoRange:fe,width:Ce,height:Fe})=>(!!le||!!(Ce&&Fe))&&cn(fe))),h.length===0){Promise.resolve().then(()=>{if(this.hls){let le="no level with compatible codecs found in manifest",fe=le;t.levels.length&&(fe=`one or more CODECS in variant not supported: ${nr(t.levels.map(Fe=>Fe.attrs.CODECS).filter((Fe,tt,Ne)=>Ne.indexOf(Fe)===tt))}`,this.warn(fe),le+=` (${fe})`);const Ce=new Error(le);this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:te.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:Ce,reason:fe})}}),p.end=performance.now();return}t.audioTracks&&(o=t.audioTracks.filter(le=>!le.audioCodec||this.isAudioSupported(le.audioCodec)),cu(o)),t.subtitles&&(c=t.subtitles,cu(c));const m=h.slice(0);h.sort((le,fe)=>{if(le.attrs["HDCP-LEVEL"]!==fe.attrs["HDCP-LEVEL"])return(le.attrs["HDCP-LEVEL"]||"")>(fe.attrs["HDCP-LEVEL"]||"")?1:-1;if(r&&le.height!==fe.height)return le.height-fe.height;if(le.frameRate!==fe.frameRate)return le.frameRate-fe.frameRate;if(le.videoRange!==fe.videoRange)return mr.indexOf(le.videoRange)-mr.indexOf(fe.videoRange);if(le.videoCodec!==fe.videoCodec){const Ce=q(le.videoCodec),Fe=q(fe.videoCodec);if(Ce!==Fe)return Fe-Ce}if(le.uri===fe.uri&&le.codecSet!==fe.codecSet){const Ce=me(le.codecSet),Fe=me(fe.codecSet);if(Ce!==Fe)return Fe-Ce}return le.averageBitrate!==fe.averageBitrate?le.averageBitrate-fe.averageBitrate:0});let v=m[0];if(this.steering&&(h=this.steering.filterParsedLevels(h),h.length!==m.length)){for(let le=0;le<m.length;le++)if(m[le].pathwayId===h[0].pathwayId){v=m[le];break}}this._levels=h;for(let le=0;le<h.length;le++)if(h[le]===v){var T;this._firstLevel=le;const fe=v.bitrate,Ce=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${h.length} level(s) found, first bitrate: ${fe}`),((T=this.hls.userConfig)==null?void 0:T.abrEwmaDefaultEstimate)===void 0){const Fe=Math.min(fe,this.hls.config.abrEwmaDefaultEstimateMax);Fe>Ce&&Ce===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Fe)}break}const A=i&&!n,$=this.hls.config,U=!!($.audioStreamController&&$.audioTrackController),ie={levels:h,audioTracks:o,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:n,altAudio:U&&!A&&o.some(le=>!!le.url)};p.end=performance.now(),this.hls.trigger(_.MANIFEST_PARSED,ie)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const p=new Error("invalid level idx"),m=e<0;if(this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:te.LEVEL_SWITCH_ERROR,level:e,fatal:m,error:p,reason:p.message}),m)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,n=this.currentLevel,i=n?n.attrs["PATHWAY-ID"]:void 0,s=t[e],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,r===e&&n&&i===o)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${o?" with Pathway "+o:""} from level ${r}${i?" with Pathway "+i:""}`);const c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(_.LEVEL_SWITCHING,c);const h=s.details;if(!h||h.live){const p=this.switchParams(s.uri,n==null?void 0:n.details,h);this.loadPlaylist(p)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),r=e.filter(n=>t.indexOf(n)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=r}}onError(e,t){t.fatal||!t.context||t.context.type===De.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===pe.MAIN){const r=t.elementaryStreams;if(!Object.keys(r).some(i=>!!r[i]))return;const n=this._levels[t.level];n!=null&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var r;const{level:n,details:i}=t,s=t.levelInfo;if(!s){var o;this.warn(`Invalid level index ${n}`),(o=t.deliveryDirectives)!=null&&o.skip&&(i.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let c=s.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(n,t,c)}else(r=t.deliveryDirectives)!=null&&r.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=this.getUrlWithDirectives(e.uri,t),n=this.currentLevelIndex,i=e.attrs["PATHWAY-ID"],s=e.details,o=s==null?void 0:s.age;this.log(`Loading level index ${n}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${i?" Pathway "+i:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(_.LEVEL_LOADING,{url:r,level:n,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const r=this._levels.filter((i,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(o=>o.level=-1)),!1));Oa(r),this._levels=r,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const n=r.length-1;this._firstLevel=Math.min(this._firstLevel,n),this._startLevel&&(this._startLevel=Math.min(this._startLevel,n)),this.hls.trigger(_.LEVELS_UPDATED,{levels:r})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:r}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(_.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:r}))}}function cu(a){const e={};a.forEach(t=>{const r=t.groupId||"";t.id=e[r]=e[r]||0,e[r]++})}function fu(){return self.SourceBuffer||self.WebKitSourceBuffer}function du(){if(!ve())return!1;const e=fu();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Bh(){if(!du())return!1;const a=ve();return typeof(a==null?void 0:a.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(G(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(G(e,"audio"))))}function Nh(){var a;const e=fu();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Uh=100;class $h extends _s{constructor(e,t,r){super(e,t,r,"stream-controller",pe.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 n=this.media,i=n?n.currentTime:null;if(i===null||!F(i)||(this.log(`Media seeked to ${i.toFixed(3)}`),!this.getBufferedFrag(i)))return;const s=this.getFwdBufferInfoAtPos(n,i,pe.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${i} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(_.BUFFER_CREATED,this.onBufferCreated,this),e.on(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(_.BUFFER_CREATED,this.onBufferCreated,this),e.off(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:r,hls:n}=this;if(this.stopLoad(),this.setInterval(Uh),this.level=-1,!this.startFragRequested){let i=n.startLevel;i===-1&&(n.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=n.firstAutoLevel),n.nextLoadLevel=i,this.level=n.loadLevel,this._hasEnoughToStart=!!t}r>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r),this.state=ut.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=ut.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case ut.WAITING_LEVEL:{const{levels:e,level:t}=this,r=e==null?void 0:e[t],n=r==null?void 0:r.details;if(n&&(!n.live||this.levelLastLoaded===r&&!this.waitForLive(r))){if(this.waitForCdnTuneIn(n))break;this.state=ut.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=ut.IDLE;break}break}case ut.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===ut.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:r,media:n}=this;if(t===null||!n&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const i=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(r!=null&&r[i]))return;const s=r[i],o=this.getMainFwdBufferInfo();if(o===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const $={};this.altAudio===2&&($.type="video"),this.hls.trigger(_.BUFFER_EOS,$),this.state=ut.ENDED;return}if(!this.buffering)return;e.loadLevel!==i&&e.manualLevel===-1&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;const h=s.details;if(!h||this.state===ut.WAITING_LEVEL||this.waitForLive(s)){this.level=i,this.state=ut.WAITING_LEVEL,this.startFragRequested=!1;return}const p=o.len,m=this.getMaxBufferLength(s.maxBitrate);if(p>=m)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const v=this.backtrackFragment?this.backtrackFragment.start:o.end;let T=this.getNextFragment(v,h);if(this.couldBacktrack&&!this.fragPrevious&&T&&Ue(T)&&this.fragmentTracker.getState(T)!==$r.OK){var A;const U=((A=this.backtrackFragment)!=null?A:T).sn-h.startSN,ie=h.fragments[U-1];ie&&T.cc===ie.cc&&(T=ie,this.fragmentTracker.removeFragment(ie))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(T&&this.isLoopLoading(T,v)){if(!T.gap){const U=this.audioOnly&&!this.altAudio?K.AUDIO:K.VIDEO,ie=(U===K.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;ie&&this.afterBufferFlushed(ie,U,pe.MAIN)}T=this.getNextFragmentLoopLoading(T,h,o,pe.MAIN,m)}T&&(T.initSegment&&!T.initSegment.data&&!this.bitrateTest&&(T=T.initSegment),this.loadFragment(T,s,v))}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);n===$r.NOT_LOADED||n===$r.PARTIAL?Ue(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,r):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,pe.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let r;const n=this.getAppendedFrag(t.currentTime);n&&n.start>1&&this.flushMainBuffer(0,n.start-1);const i=this.getLevelDetails();if(i!=null&&i.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<i.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,c=e[o],h=this.fragLastKbps;h&&this.fragCurrent?r=this.fragCurrent.duration*c.maxBitrate/(1e3*h)+1:r=0}else r=0;const s=this.getBufferedFrag(t.currentTime+r);if(s){const o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();const c=o.maxStartPTS?o.maxStartPTS:o.start,h=o.duration,p=Math.max(s.end,c+Math.min(Math.max(h-this.config.maxFragLookUpTolerance,h*(this.couldBacktrack?.5:.125)),h*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(p,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case ut.KEY_LOADING:case ut.FRAG_LOADING:case ut.FRAG_LOADING_WAITING_RETRY:case ut.PARSING:case ut.PARSED:this.state=ut.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const r=t.media;vn(r,"playing",this.onMediaPlaying),vn(r,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:r}=this;r&&(Sn(r,"playing",this.onMediaPlaying),Sn(r,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(_.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let r=!1,n=!1;for(let i=0;i<t.levels.length;i++){const s=t.levels[i].audioCodec;s&&(r=r||s.indexOf("mp4a.40.2")!==-1,n=n||s.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=r&&n&&!Nh(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:r}=this;if(!r||this.state!==ut.IDLE)return;const n=t.levelInfo;(!n.details||n.details.live&&(this.levelLastLoaded!==n||n.details.expired)||this.waitForCdnTuneIn(n.details))&&(this.state=ut.WAITING_LEVEL)}onLevelLoaded(e,t){var r;const{levels:n,startFragRequested:i}=this,s=t.level,o=t.details,c=o.totalduration;if(!n){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${c}`);const h=t.levelInfo,p=this.fragCurrent;p&&(this.state===ut.FRAG_LOADING||this.state===ut.FRAG_LOADING_WAITING_RETRY)&&p.level!==t.level&&p.loader&&this.abortCurrentFrag();let m=0;if(o.live||(r=h.details)!=null&&r.live){var v;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;m=this.alignPlaylists(o,h.details,(v=this.levelLastLoaded)==null?void 0:v.details)}if(h.details=o,this.levelLastLoaded=h,i||this.setStartPosition(o,m),this.hls.trigger(_.LEVEL_UPDATED,{details:o,level:s}),this.state===ut.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=ut.IDLE}i&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:r}=this;if(!r)return;const n=this.hls.liveSyncPosition,i=this.getLoadPosition(),s=e.fragmentStart,o=e.edge,c=i>=s-t.maxFragLookUpTolerance&&i<=o;if(n!==null&&r.duration>n&&(i<n||!c)){const p=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&r.readyState<4||i<o-p)&&(this._hasEnoughToStart||(this.nextLoadPosition=n),r.readyState))if(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${n.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var h;const m=ir.bufferInfo(r,n,0);if(!((h=m.buffered)!=null&&h.length)){r.currentTime=n;return}if(m.start<=i){r.currentTime=n;return}const{nextStart:T}=ir.bufferedInfo(m.buffered,i,0);T&&(r.currentTime=T)}else r.currentTime=n}}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:n,payload:i}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const o=s[r.level];if(!o){this.warn(`Level ${r.level} not found on progress`);return}const c=o.details;if(!c){this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),this.fragmentTracker.removeFragment(r);return}const h=o.videoCodec,p=c.PTSKnown||!c.live,m=(t=r.initSegment)==null?void 0:t.data,v=this._getAudioCodec(o),T=this.transmuxer=this.transmuxer||new _l(this.hls,pe.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),A=n?n.index:-1,$=A!==-1,U=new ni(r.level,r.sn,r.stats.chunkCount,i.byteLength,A,$),ie=this.initPTS[r.cc];T.push(i,m,v,h,r,n,c.totalduration,p,U,ie)}onAudioTrackSwitching(e,t){const r=this.hls,n=this.altAudio!==0;if(mi(t.url,r))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 s=this.fragCurrent;s&&(this.log("Switching to main audio track, cancel main fragment load"),s.abortRequests(),this.fragmentTracker.removeFragment(s)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(n){this.altAudio=0,this.fragmentTracker.removeAllFragments(),r.once(_.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(_.AUDIO_TRACK_SWITCHED,t)}),r.trigger(_.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}r.trigger(_.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const r=mi(t.url,this.hls);if(r){const n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r?2:0,this.tick()}onBufferCreated(e,t){const r=t.tracks;let n,i,s=!1;for(const o in r){const c=r[o];if(c.id==="main"){if(i=o,n=c,o==="video"){const h=r[o];h&&(this.videoBuffer=h.buffer)}}else s=!0}s&&n?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:n}=t,i=r.type===pe.MAIN;if(i){if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${n?" p: "+n.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}`),this.state===ut.PARSED&&(this.state=ut.IDLE);return}const o=n?n.stats:r.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),Ue(r)&&(this.fragPrevious=r),this.fragBufferedComplete(r,n)}const s=this.media;s&&(!this._hasEnoughToStart&&ir.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var r;if(t.fatal){this.state=ut.ERROR;return}switch(t.details){case te.FRAG_GAP:case te.FRAG_PARSING_ERROR:case te.FRAG_DECRYPT_ERROR:case te.FRAG_LOAD_ERROR:case te.FRAG_LOAD_TIMEOUT:case te.KEY_LOAD_ERROR:case te.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(pe.MAIN,t);break;case te.LEVEL_LOAD_ERROR:case te.LEVEL_LOAD_TIMEOUT:case te.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ut.WAITING_LEVEL&&((r=t.context)==null?void 0:r.type)===De.LEVEL&&(this.state=ut.IDLE);break;case te.BUFFER_ADD_CODEC_ERROR:case te.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case te.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case te.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=ut.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==K.AUDIO||!this.altAudio){const r=(t===K.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;r&&(this.afterBufferFlushed(r,t,pe.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let r=this.startPosition;if(r>=0&&t<r){if(e.seeking){this.log(`could not seek to ${r}, already seeking at ${t}`);return}const n=this.timelineOffset;n&&r&&(r+=n);const i=this.getLevelDetails(),s=ir.getBuffered(e),o=s.length?s.start(0):0,c=o-r,h=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<h||this.loadingParts&&c<2*((i==null?void 0:i.partTarget)||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),r+=c,this.startPosition=r),t<r&&(this.log(`seek to target start position ${r} from current time ${t} buffer start ${o}`),e.currentTime=r)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(r=>{const{hls:n}=this,i=r==null?void 0:r.frag;if(!i||this.fragContextChanged(i))return;t.fragmentError=0,this.state=ut.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=i.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),n.trigger(_.FRAG_LOADED,r),i.bitrateTest=!1}).catch(r=>{this.state===ut.STOPPED||this.state===ut.ERROR||(this.warn(r),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:r}=this,{remuxResult:n,chunkMeta:i}=e,s=this.getCurrentContext(i);if(!s){this.resetWhenMissingContext(i);return}const{frag:o,part:c,level:h}=s,{video:p,text:m,id3:v,initSegment:T}=n,{details:A}=h,$=this.altAudio?void 0:n.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=ut.PARSING,T){const U=T.tracks;if(U){const Ce=o.initSegment||o;if(this.unhandledEncryptionError(T,o))return;this._bufferInitSegment(h,U,Ce,i),r.trigger(_.FRAG_PARSING_INIT_SEGMENT,{frag:Ce,id:t,tracks:U})}const ie=T.initPTS,le=T.timescale,fe=this.initPTS[o.cc];if(F(ie)&&(!fe||fe.baseTime!==ie||fe.timescale!==le)){const Ce=T.trackId;this.initPTS[o.cc]={baseTime:ie,timescale:le,trackId:Ce},r.trigger(_.INIT_PTS_FOUND,{frag:o,id:t,initPTS:ie,timescale:le,trackId:Ce})}}if(p&&A){$&&p.type==="audiovideo"&&this.logMuxedErr(o);const U=A.fragments[o.sn-1-A.startSN],ie=o.sn===A.startSN,le=!U||o.cc>U.cc;if(n.independent!==!1){const{startPTS:fe,endPTS:Ce,startDTS:Fe,endDTS:tt}=p;if(c)c.elementaryStreams[p.type]={startPTS:fe,endPTS:Ce,startDTS:Fe,endDTS:tt};else if(p.firstKeyFrame&&p.independent&&i.id===1&&!le&&(this.couldBacktrack=!0),p.dropped&&p.independent){const Ne=this.getMainFwdBufferInfo(),Xe=(Ne?Ne.end:this.getLoadPosition())+this.config.maxBufferHole,qe=p.firstKeyFramePTS?p.firstKeyFramePTS:fe;if(!ie&&Xe<qe-this.config.maxBufferHole&&!le){this.backtrack(o);return}else le&&(o.gap=!0);o.setElementaryStreamInfo(p.type,o.start,Ce,o.start,tt,!0)}else ie&&fe-(A.appliedTimelineOffset||0)>_o&&(o.gap=!0);o.setElementaryStreamInfo(p.type,fe,Ce,Fe,tt),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(p,o,c,i,ie||le)}else if(ie||le)o.gap=!0;else{this.backtrack(o);return}}if($){const{startPTS:U,endPTS:ie,startDTS:le,endDTS:fe}=$;c&&(c.elementaryStreams[K.AUDIO]={startPTS:U,endPTS:ie,startDTS:le,endDTS:fe}),o.setElementaryStreamInfo(K.AUDIO,U,ie,le,fe),this.bufferFragmentData($,o,c,i)}if(A&&v!=null&&v.samples.length){const U={id:t,frag:o,details:A,samples:v.samples};r.trigger(_.FRAG_PARSING_METADATA,U)}if(A&&m){const U={id:t,frag:o,details:A,samples:m.samples};r.trigger(_.FRAG_PARSING_USERDATA,U)}}logMuxedErr(e){this.warn(`${Ue(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,r,n){if(this.state!==ut.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(r));const{audio:i,video:s,audiovideo:o}=t;if(i){const h=e.audioCodec;let p=Ot(i.codec,h);p==="mp4a"&&(p="mp4a.40.5");const m=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){p&&(p.indexOf("mp4a.40.5")!==-1?p="mp4a.40.2":p="mp4a.40.5");const v=i.metadata;v&&"channelCount"in v&&(v.channelCount||1)!==1&&m.indexOf("firefox")===-1&&(p="mp4a.40.5")}p&&p.indexOf("mp4a.40.5")!==-1&&m.indexOf("android")!==-1&&i.container!=="audio/mpeg"&&(p="mp4a.40.2",this.log(`Android: force audio codec to ${p}`)),h&&h!==p&&this.log(`Swapping manifest audio codec "${h}" for "${p}"`),i.levelCodec=p,i.id=pe.MAIN,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${p||""}/${h||""}/${i.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=pe.MAIN;const h=s.codec;if((h==null?void 0:h.length)===4)switch(h){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${h}]${s.codec!==h?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(_.BUFFER_CODECS,t),!this.hls)return;c.forEach(h=>{const m=t[h].initSegment;m!=null&&m.byteLength&&this.hls.trigger(_.BUFFER_APPENDING,{type:h,data:m,frag:r,part:null,chunkMeta:n,parent:r.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,pe.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,r=e==null?void 0:e[t];return r?this.getMaxBufferLength(r.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=ut.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const r=e.currentTime;if(ir.isBuffered(e,r)?t=this.getAppendedFrag(r):ir.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const n=this.fragPlaying,i=t.level;(!n||t.sn!==n.sn||n.level!==i)&&(this.fragPlaying=t,this.hls.trigger(_.FRAG_CHANGED,{frag:t}),(!n||n.level!==i)&&this.hls.trigger(_.LEVEL_SWITCHED,{level:i}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return F(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(F(t)){const r=this.getLevelDetails(),n=this.currentFrag||(r?on(null,r.fragments,t):null);if(n){const i=n.programDateTime;if(i!==null){const s=i+(t-n.start)*1e3;return new Date(s)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class zh extends V{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const r in this.keyIdToKeyInfo){const n=this.keyIdToKeyInfo[r].loader;if(n){var t;if(e&&e!==((t=n.context)==null?void 0:t.frag.type))return;n.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=te.KEY_LOAD_ERROR,r,n,i){return new dr({type:ye.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:r,networkDetails:n})}loadClear(e,t,r){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let n=0,i=t.length;n<i;n++){const s=t[n];if(e.cc<=s.cc&&(!Ue(e)||!Ue(s)||e.sn<s.sn)||!r&&n==i-1)return this.emeController.selectKeySystemFormat(s).then(o=>{if(!this.emeController)return;s.setKeyFormat(o);const c=si(o);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const n=ai(this.config);if(n.length)return this.emeController.getKeySystemAccess(n)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var r,n;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const h=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,te.KEY_LOAD_ERROR,h))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,te.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));const o=hl(i);let c=this.keyIdToKeyInfo[o];if((r=c)!=null&&r.decryptdata.key)return i.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if(this.emeController&&(n=c)!=null&&n.keyLoadPromise)switch(this.emeController.getKeyStatus(c.decryptdata)){case"usable":case"usable-in-future":return c.keyLoadPromise.then(p=>{const{keyInfo:m}=p;return i.key=m.decryptdata.key,{frag:e,keyInfo:m}})}switch(this.log(`${this.keyIdToKeyInfo[o]?"Rel":"L"}oading${i.keyId?" keyId: "+Y(i.keyId):""} URI: ${i.uri} from ${e.type} ${e.level}`),c=this.keyIdToKeyInfo[o]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return i.keyFormat==="identity"?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,te.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var n;if(!e.decryptdata.keyId&&(n=t.initSegment)!=null&&n.data){const s=Pt(t.initSegment.data);if(s.length){let o=s[0];o.some(c=>c!==0)?(this.log(`Using keyId found in init segment ${Y(o)}`),Ai.setKeyIdForUri(e.decryptdata.uri,o)):(o=Ai.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${Y(o)}`)),e.decryptdata.keyId=o}}if(!e.decryptdata.keyId&&!Ue(t))return Promise.resolve(r);const i=this.emeController.loadKey(r);return(e.keyLoadPromise=i.then(s=>(e.mediaKeySessionContext=s,r))).catch(s=>{throw e.keyLoadPromise=null,"data"in s&&(s.data.frag=t),s})}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,n=r.loader,i=new n(r);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise((s,o)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},h=r.keyLoadPolicy.default,p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(v,T,A,$)=>{const{frag:U,keyInfo:ie}=A,le=hl(ie.decryptdata);if(!U.decryptdata||ie!==this.keyIdToKeyInfo[le])return o(this.createKeyLoadError(U,te.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),$));ie.decryptdata.key=U.decryptdata.key=new Uint8Array(v.data),U.keyLoader=null,ie.loader=null,s({frag:U,keyInfo:ie})},onError:(v,T,A,$)=>{this.resetLoader(T),o(this.createKeyLoadError(t,te.KEY_LOAD_ERROR,new Error(`HTTP Error ${v.code} loading key ${v.text}`),A,S({url:c.url,data:void 0},v)))},onTimeout:(v,T,A)=>{this.resetLoader(T),o(this.createKeyLoadError(t,te.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),A))},onAbort:(v,T,A)=>{this.resetLoader(T),o(this.createKeyLoadError(t,te.INTERNAL_ABORTED,new Error("key loading aborted"),A))}};i.load(c,p,m)})}resetLoader(e){const{frag:t,keyInfo:r,url:n}=e,i=r.loader;t.keyLoader===i&&(t.keyLoader=null,r.loader=null);const s=hl(r.decryptdata)||n;delete this.keyIdToKeyInfo[s],i&&i.destroy()}}function hl(a){if(a.keyFormat!==vr.FAIRPLAY){const e=a.keyId;if(e)return Y(e)}return a.uri}function pu(a){const{type:e}=a;switch(e){case De.AUDIO_TRACK:return pe.AUDIO;case De.SUBTITLE_TRACK:return pe.SUBTITLE;default:return pe.MAIN}}function cl(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Gh{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(_.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(_.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,r=t.pLoader,n=t.loader,i=r||n,s=new i(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:r}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:De.MANIFEST,url:r,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:r,level:n,pathwayId:i,url:s,deliveryDirectives:o,levelInfo:c}=t;this.load({id:r,level:n,pathwayId:i,responseType:"text",type:De.LEVEL,url:s,deliveryDirectives:o,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s,track:o}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:De.AUDIO_TRACK,url:i,deliveryDirectives:s,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s,track:o}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:De.SUBTITLE_TRACK,url:i,deliveryDirectives:s,levelOrTrack:o})}onLevelsUpdated(e,t){const r=this.loaders[De.LEVEL];if(r){const n=r.context;n&&!t.levels.some(i=>i===n.levelOrTrack)&&(r.abort(),delete this.loaders[De.LEVEL])}}load(e){var t;const r=this.hls.config;let n=this.getInternalLoader(e);if(n){const h=this.hls.logger,p=n.context;if(p&&p.levelOrTrack===e.levelOrTrack&&(p.url===e.url||p.deliveryDirectives&&!e.deliveryDirectives)){p.url===e.url?h.log(`[playlist-loader]: ignore ${e.url} ongoing request`):h.log(`[playlist-loader]: ignore ${e.url} in favor of ${p.url}`);return}h.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),n.abort()}let i;if(e.type===De.MANIFEST?i=r.manifestLoadPolicy.default:i=b({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),n=this.createInternalLoader(e),F((t=e.deliveryDirectives)==null?void 0:t.part)){let h;if(e.type===De.LEVEL&&e.level!==null?h=this.hls.levels[e.level].details:e.type===De.AUDIO_TRACK&&e.id!==null?h=this.hls.audioTracks[e.id].details:e.type===De.SUBTITLE_TRACK&&e.id!==null&&(h=this.hls.subtitleTracks[e.id].details),h){const p=h.partTarget,m=h.targetduration;if(p&&m){const v=Math.max(p*3,m*.8)*1e3;i=b({},i,{maxTimeToFirstByteMs:Math.min(v,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(v,i.maxTimeToFirstByteMs)})}}}const s=i.errorRetry||i.timeoutRetry||{},o={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(h,p,m,v)=>{const T=this.getInternalLoader(m);this.resetInternalLoader(m.type);const A=h.data;p.parsing.start=performance.now(),li.isMediaPlaylist(A)||m.type!==De.MANIFEST?this.handleTrackOrLevelPlaylist(h,p,m,v||null,T):this.handleMasterPlaylist(h,p,m,v)},onError:(h,p,m,v)=>{this.handleNetworkError(p,m,!1,h,v)},onTimeout:(h,p,m)=>{this.handleNetworkError(p,m,!0,void 0,h)}};n.load(e,o,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:r}=this.hls;(e||r)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,r,n){const i=this.hls,s=e.data,o=cl(e,r),c=li.parseMasterPlaylist(s,o);if(c.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,r,c.playlistParsingError,n,t);return}const{contentSteering:h,levels:p,sessionData:m,sessionKeys:v,startTimeOffset:T,variableList:A}=c;this.variableList=A,p.forEach(le=>{const{unknownCodecs:fe}=le;if(fe){const{preferManagedMediaSource:Ce}=this.hls.config;let{audioCodec:Fe,videoCodec:tt}=le;for(let Ne=fe.length;Ne--;){const Xe=fe[Ne];ke(Xe,"audio",Ce)?(le.audioCodec=Fe=Fe?`${Fe},${Xe}`:Xe,rr.audio[Fe.substring(0,4)]=2,fe.splice(Ne,1)):ke(Xe,"video",Ce)&&(le.videoCodec=tt=tt?`${tt},${Xe}`:Xe,rr.video[tt.substring(0,4)]=2,fe.splice(Ne,1))}}});const{AUDIO:$=[],SUBTITLES:U,"CLOSED-CAPTIONS":ie}=li.parseMasterPlaylistMedia(s,o,c);$.length&&!$.some(fe=>!fe.url)&&p[0].audioCodec&&!p[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),$.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ar({}),bitrate:0,url:""})),i.trigger(_.MANIFEST_LOADED,{levels:p,audioTracks:$,subtitles:U,captions:ie,contentSteering:h,url:o,stats:t,networkDetails:n,sessionData:m,sessionKeys:v,startTimeOffset:T,variableList:A})}handleTrackOrLevelPlaylist(e,t,r,n,i){const s=this.hls,{id:o,level:c,type:h}=r,p=cl(e,r),m=F(c)?c:F(o)?o:0,v=pu(r),T=li.parseLevelPlaylist(e.data,p,m,v,0,this.variableList);if(h===De.MANIFEST){const A={attrs:new ar({}),bitrate:0,details:T,name:"",url:p};T.requestScheduled=t.loading.start+ki(T,0),s.trigger(_.MANIFEST_LOADED,{levels:[A],audioTracks:[],url:p,stats:t,networkDetails:n,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=T,this.handlePlaylistLoaded(T,e,t,r,n,i)}handleManifestParsingError(e,t,r,n,i){this.hls.trigger(_.ERROR,{type:ye.NETWORK_ERROR,details:te.MANIFEST_PARSING_ERROR,fatal:t.type===De.MANIFEST,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:n,stats:i})}handleNetworkError(e,t,r=!1,n,i){let s=`A network ${r?"timeout":"error"+(n?" (status "+n.code+")":"")} occurred while loading ${e.type}`;e.type===De.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===De.AUDIO_TRACK||e.type===De.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=te.UNKNOWN,h=!1;const p=this.getInternalLoader(e);switch(e.type){case De.MANIFEST:c=r?te.MANIFEST_LOAD_TIMEOUT:te.MANIFEST_LOAD_ERROR,h=!0;break;case De.LEVEL:c=r?te.LEVEL_LOAD_TIMEOUT:te.LEVEL_LOAD_ERROR,h=!1;break;case De.AUDIO_TRACK:c=r?te.AUDIO_TRACK_LOAD_TIMEOUT:te.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case De.SUBTITLE_TRACK:c=r?te.SUBTITLE_TRACK_LOAD_TIMEOUT:te.SUBTITLE_LOAD_ERROR,h=!1;break}p&&this.resetInternalLoader(e.type);const m={type:ye.NETWORK_ERROR,details:c,fatal:h,url:e.url,loader:p,context:e,error:o,networkDetails:t,stats:i};if(n){const v=(t==null?void 0:t.url)||e.url;m.response=S({url:v,data:void 0},n)}this.hls.trigger(_.ERROR,m)}handlePlaylistLoaded(e,t,r,n,i,s){const o=this.hls,{type:c,level:h,levelOrTrack:p,id:m,groupId:v,deliveryDirectives:T}=n,A=cl(t,n),$=pu(n);let U=typeof n.level=="number"&&$===pe.MAIN?h:void 0;const ie=e.playlistParsingError;if(ie){if(this.hls.logger.warn(`${ie} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(_.ERROR,{type:ye.NETWORK_ERROR,details:te.LEVEL_PARSING_ERROR,fatal:!1,url:A,error:ie,reason:ie.message,response:t,context:n,level:U,parent:$,networkDetails:i,stats:r});return}e.playlistParsingError=null}if(!e.fragments.length){const le=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(_.ERROR,{type:ye.NETWORK_ERROR,details:te.LEVEL_EMPTY_ERROR,fatal:!1,url:A,error:le,reason:le.message,response:t,context:n,level:U,parent:$,networkDetails:i,stats:r});return}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case De.MANIFEST:case De.LEVEL:if(U){if(!p)U=0;else if(p!==o.levels[U]){const le=o.levels.indexOf(p);le>-1&&(U=le)}}o.trigger(_.LEVEL_LOADED,{details:e,levelInfo:p||o.levels[0],level:U||0,id:m||0,stats:r,networkDetails:i,deliveryDirectives:T,withoutMultiVariant:c===De.MANIFEST});break;case De.AUDIO_TRACK:o.trigger(_.AUDIO_TRACK_LOADED,{details:e,track:p,id:m||0,groupId:v||"",stats:r,networkDetails:i,deliveryDirectives:T});break;case De.SUBTITLE_TRACK:o.trigger(_.SUBTITLE_TRACK_LOADED,{details:e,track:p,id:m||0,groupId:v||"",stats:r,networkDetails:i,deliveryDirectives:T});break}}}class ps{static get version(){return vs}static isMSESupported(){return du()}static isSupported(){return Bh()}static getMediaSource(){return ve()}static get Events(){return _}static get MetadataSchema(){return yn}static get ErrorTypes(){return ye}static get ErrorDetails(){return te}static get DefaultConfig(){return ps.defaultConfig?ps.defaultConfig:Th}static set DefaultConfig(e){ps.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Ms,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 t=this.logger=be(e.debug||!1,"Hls instance",e.assetPlayerId),r=this.config=Dh(ps.DefaultConfig,e,t);this.userConfig=e,r.progressive&&kh(r,t);const{abrController:n,bufferController:i,capLevelController:s,errorController:o,fpsController:c}=r,h=new o(this),p=this.abrController=new n(this),m=new ji(this),v=r.interstitialsController,T=v?this.interstitialsController=new v(this,ps):null,A=this.bufferController=new i(this,m),$=this.capLevelController=new s(this),U=new c(this),ie=new Gh(this),le=r.contentSteeringController,fe=le?new le(this):null,Ce=this.levelController=new Fh(this,fe),Fe=new Oh(this),tt=new zh(this.config,this.logger),Ne=this.streamController=new $h(this,m,tt),Xe=this.gapController=new Ih(this,m);$.setStreamController(Ne),U.setStreamController(Ne);const qe=[ie,Ce,Ne];T&&qe.splice(1,0,T),fe&&qe.splice(1,0,fe),this.networkControllers=qe;const ze=[p,A,Xe,$,U,Fe,m];this.audioTrackController=this.createController(r.audioTrackController,qe);const ft=r.audioStreamController;ft&&qe.push(this.audioStreamController=new ft(this,m,tt)),this.subtitleTrackController=this.createController(r.subtitleTrackController,qe);const Ut=r.subtitleStreamController;Ut&&qe.push(this.subtititleStreamController=new Ut(this,m,tt)),this.createController(r.timelineController,ze),tt.emeController=this.emeController=this.createController(r.emeController,ze),this.cmcdController=this.createController(r.cmcdController,ze),this.latencyController=this.createController(Mh,ze),this.coreComponents=ze,qe.push(h);const jt=h.onErrorOut;typeof jt=="function"&&this.on(_.ERROR,jt,h),this.on(_.MANIFEST_LOADED,ie.onManifestLoaded,ie)}createController(e,t){if(e){const r=new e(this);return t&&t.push(r),r}return null}on(e,t,r=this){this._emitter.on(e,t,r)}once(e,t,r=this){this._emitter.once(e,t,r)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,r=this,n){this._emitter.off(e,t,r,n)}listeners(e){return this._emitter.listeners(e)}emit(e,t,r){return this._emitter.emit(e,t,r)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(r){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),!this.triggeringException){this.triggeringException=!0;const n=e===_.ERROR;this.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:te.INTERNAL_EXCEPTION,fatal:n,event:e,error:r}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(_.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const i=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:te.ATTACH_MEDIA_ERROR,fatal:!0,error:i});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,r=t?e.media:e,n=t?e:{media:r};this._media=r,this.trigger(_.MEDIA_ATTACHING,n)}detachMedia(){this.logger.log("detachMedia"),this.trigger(_.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(_.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,r=this._url,n=this._url=w.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${n}`),t&&r&&(r!==n||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(_.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let r=0;r<this.networkControllers.length&&(this.networkControllers[r].startLoad(e,t),!(!this.started||!this.networkControllers));r++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[pe.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[pe.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[pe.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=I0()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Jr(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const r=e.length;for(let n=0;n<r;n++)if(e[n].maxBitrate>=t)return n;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:r}=this;let n;if(t===-1&&e!=null&&e.length?n=e.length-1:n=t,r)for(let i=n;i--;){const s=e[i].attrs["HDCP-LEVEL"];if(s&&s<=r)return i}return n}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}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(e){this.latencyController.targetLatency=e}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(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const r=mn(t);return xt(e,r,navigator.mediaCapabilities)}}ps.defaultConfig=void 0}}]);
}());