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__Classrooms__Lists__Commo...

162 lines
1.2 MiB

!(function(){var Ec=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[2303],{95869:function(Sr,St,Z){"use strict";Z.d(St,{Z:function(){return H}});var z=Z(67711),we=Z(59301),Ue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 264c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48zm-8 136H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM480 544H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-48 308H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm356.8-74.4c29-26.3 47.2-64.3 47.2-106.6 0-79.5-64.5-144-144-144s-144 64.5-144 144c0 42.3 18.2 80.3 47.2 106.6-57 32.5-96.2 92.7-99.2 162.1-.2 4.5 3.5 8.3 8 8.3h48.1c4.2 0 7.7-3.3 8-7.6C564 871.2 621.7 816 692 816s128 55.2 131.9 124.4c.2 4.2 3.7 7.6 8 7.6H880c4.6 0 8.2-3.8 8-8.3-2.9-69.5-42.2-129.6-99.2-162.1zM692 591c44.2 0 80 35.8 80 80s-35.8 80-80 80-80-35.8-80-80 35.8-80 80-80z"}}]},name:"solution",theme:"outlined"},ve=Ue,Y=Z(7657),_=function(ne,U){return we.createElement(Y.Z,(0,z.Z)({},ne,{ref:U,icon:ve}))},ye=we.forwardRef(_),H=ye},65030:function(Sr,St,Z){"use strict";Z.d(St,{Z:function(){return Ht}});var z=Z(98506),we=Z(16886),Ue=Z(33346),ve=Z(43403),Y=Z(92310),_=Z.n(Y),ye=Z(29301),H=Z(76846),o=Z(96452),ne=Z(6089),U=Z(80402),B=Z(34280),y=Z(49658),C=Z(59301),T=Z(67711),ee=Z(77900),G=Z(8654);function W(Fe){var R=Fe.prefixCls,m=Fe.align,F=Fe.arrow,V=Fe.arrowPos,D=F||{},N=D.className,Ae=D.content,Le=V.x,Me=Le===void 0?0:Le,Xe=V.y,qe=Xe===void 0?0:Xe,Pt=C.useRef();if(!m||!m.points)return null;var ot={position:"absolute"};if(m.autoArrow!==!1){var Bt=m.points[0],ut=m.points[1],gt=Bt[0],Ye=Bt[1],rt=ut[0],yt=ut[1];gt===rt||!["t","b"].includes(gt)?ot.top=qe:gt==="t"?ot.top=0:ot.bottom=0,Ye===yt||!["l","r"].includes(Ye)?ot.left=Me:Ye==="l"?ot.left=0:ot.right=0}return C.createElement("div",{ref:Pt,className:_()("".concat(R,"-arrow"),N),style:ot},Ae)}function k(Fe){var R=Fe.prefixCls,m=Fe.open,F=Fe.zIndex,V=Fe.mask,D=Fe.motion;return V?C.createElement(ee.default,(0,T.Z)({},D,{motionAppear:!0,visible:m,removeOnLeave:!0}),function(N){var Ae=N.className;return C.createElement("div",{style:{zIndex:F},className:_()("".concat(R,"-mask"),Ae)})}):null}var K=C.memo(function(Fe){var R=Fe.children;return R},function(Fe,R){return R.cache}),re=K,me=C.forwardRef(function(Fe,R){var m=Fe.popup,F=Fe.className,V=Fe.prefixCls,D=Fe.style,N=Fe.target,Ae=Fe.onVisibleChanged,Le=Fe.open,Me=Fe.keepDom,Xe=Fe.fresh,qe=Fe.onClick,Pt=Fe.mask,ot=Fe.arrow,Bt=Fe.arrowPos,ut=Fe.align,gt=Fe.motion,Ye=Fe.maskMotion,rt=Fe.forceRender,yt=Fe.getPopupContainer,It=Fe.autoDestroy,zt=Fe.portal,kt=Fe.zIndex,tr=Fe.onMouseEnter,Wt=Fe.onMouseLeave,ir=Fe.onPointerEnter,Er=Fe.onPointerDownCapture,zr=Fe.ready,Nt=Fe.offsetX,ur=Fe.offsetY,ke=Fe.offsetR,De=Fe.offsetB,Se=Fe.onAlign,te=Fe.onPrepare,se=Fe.stretch,ce=Fe.targetWidth,Ee=Fe.targetHeight,Te=typeof m=="function"?m():m,Et=Le||Me,Ut=(yt==null?void 0:yt.length)>0,Ft=C.useState(!yt||!Ut),rr=(0,we.Z)(Ft,2),Ir=rr[0],qr=rr[1];if((0,B.Z)(function(){!Ir&&Ut&&N&&qr(!0)},[Ir,Ut,N]),!Ir)return null;var jt="auto",Yt={left:"-1000vw",top:"-1000vh",right:jt,bottom:jt};if(zr||!Le){var $r,fn=ut.points,Oe=ut.dynamicInset||(($r=ut._experimental)===null||$r===void 0?void 0:$r.dynamicInset),Wr=Oe&&fn[0][1]==="r",Pr=Oe&&fn[0][0]==="b";Wr?(Yt.right=ke,Yt.left=jt):(Yt.left=Nt,Yt.right=jt),Pr?(Yt.bottom=De,Yt.top=jt):(Yt.top=ur,Yt.bottom=jt)}var Mr={};return se&&(se.includes("height")&&Ee?Mr.height=Ee:se.includes("minHeight")&&Ee&&(Mr.minHeight=Ee),se.includes("width")&&ce?Mr.width=ce:se.includes("minWidth")&&ce&&(Mr.minWidth=ce)),Le||(Mr.pointerEvents="none"),C.createElement(zt,{open:rt||Et,getContainer:yt&&function(){return yt(N)},autoDestroy:It},C.createElement(k,{prefixCls:V,open:Le,zIndex:kt,mask:Pt,motion:Ye}),C.createElement(ye.Z,{onResize:Se,disabled:!Le},function(In){return C.createElement(ee.default,(0,T.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:rt,leavedClassName:"".concat(V,"-hidden")},gt,{onAppearPrepare:te,onEnterPrepare:te,visible:Le,onVisibleChanged:function(Fn){var mn;gt==null||(mn=gt.onVisibleChanged)===null||mn===void 0||mn.call(gt,Fn),Ae(Fn)}}),function(en,Fn){var mn=en.className,Nn=en.style,Rn=_()(V,mn,F);return C.createElement("div",{ref:(0,G.sQ)(In,R,Fn),className:Rn,style:(0,z.Z)((0,z.Z)((0,z.Z)((0,z.Z)({"--arrow-x":"".concat(Bt.x||0,"px"),"--arrow-y":"".concat(Bt.y||0,"px")},Yt),Mr),Nn),{},{boxSizing:"border-box",zIndex:kt},D),onMouseEnter:tr,onMouseLeave:Wt,onPointerEnter:ir,onClick:qe,onPointerDownCapture:Er},ot&&C.createElement(W,{prefixCls:V,arrow:ot,arrowPos:Bt,align:ut}),C.createElement(re,{cache:!Le&&!Xe},Te))})}))}),Ce=me,Ie=C.forwardRef(function(Fe,R){var m=Fe.children,F=Fe.getTriggerDOMNode,V=(0,G.Yr)(m),D=C.useCallback(function(Ae){(0,G.mH)(R,F?F(Ae):Ae)},[F]),N=(0,G.x1)(D,(0,G.C4)(m));return V?C.cloneElement(m,{ref:N}):m}),le=Ie,xe=C.createContext(null),Ke=xe;function ge(Fe){return Fe?Array.isArray(Fe)?Fe:[Fe]:[]}function Ze(Fe,R,m,F){return C.useMemo(function(){var V=ge(m!=null?m:R),D=ge(F!=null?F:R),N=new Set(V),Ae=new Set(D);return Fe&&(N.has("hover")&&(N.delete("hover"),N.add("click")),Ae.has("hover")&&(Ae.delete("hover"),Ae.add("click"))),[N,Ae]},[Fe,R,m,F])}var q=Z(29194);function L(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=arguments.length>2?arguments[2]:void 0;return m?Fe[0]===R[0]:Fe[0]===R[0]&&Fe[1]===R[1]}function j(Fe,R,m,F){for(var V=m.points,D=Object.keys(Fe),N=0;N<D.length;N+=1){var Ae,Le=D[N];if(L((Ae=Fe[Le])===null||Ae===void 0?void 0:Ae.points,V,F))return"".concat(R,"-placement-").concat(Le)}return""}function X(Fe,R,m,F){return R||(m?{motionName:"".concat(Fe,"-").concat(m)}:F?{motionName:F}:null)}function ue(Fe){return Fe.ownerDocument.defaultView}function ae(Fe){for(var R=[],m=Fe==null?void 0:Fe.parentElement,F=["hidden","scroll","clip","auto"];m;){var V=ue(m).getComputedStyle(m),D=V.overflowX,N=V.overflowY,Ae=V.overflow;[D,N,Ae].some(function(Le){return F.includes(Le)})&&R.push(m),m=m.parentElement}return R}function w(Fe){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Fe)?R:Fe}function b(Fe){return w(parseFloat(Fe),0)}function $(Fe,R){var m=(0,z.Z)({},Fe);return(R||[]).forEach(function(F){if(!(F instanceof HTMLBodyElement||F instanceof HTMLHtmlElement)){var V=ue(F).getComputedStyle(F),D=V.overflow,N=V.overflowClipMargin,Ae=V.borderTopWidth,Le=V.borderBottomWidth,Me=V.borderLeftWidth,Xe=V.borderRightWidth,qe=F.getBoundingClientRect(),Pt=F.offsetHeight,ot=F.clientHeight,Bt=F.offsetWidth,ut=F.clientWidth,gt=b(Ae),Ye=b(Le),rt=b(Me),yt=b(Xe),It=w(Math.round(qe.width/Bt*1e3)/1e3),zt=w(Math.round(qe.height/Pt*1e3)/1e3),kt=(Bt-ut-rt-yt)*It,tr=(Pt-ot-gt-Ye)*zt,Wt=gt*zt,ir=Ye*zt,Er=rt*It,zr=yt*It,Nt=0,ur=0;if(D==="clip"){var ke=b(N);Nt=ke*It,ur=ke*zt}var De=qe.x+Er-Nt,Se=qe.y+Wt-ur,te=De+qe.width+2*Nt-Er-zr-kt,se=Se+qe.height+2*ur-Wt-ir-tr;m.left=Math.max(m.left,De),m.top=Math.max(m.top,Se),m.right=Math.min(m.right,te),m.bottom=Math.min(m.bottom,se)}}),m}function fe(Fe){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,m="".concat(R),F=m.match(/^(.*)\%$/);return F?Fe*(parseFloat(F[1])/100):parseFloat(m)}function $e(Fe,R){var m=R||[],F=(0,we.Z)(m,2),V=F[0],D=F[1];return[fe(Fe.width,V),fe(Fe.height,D)]}function lt(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Fe[0],Fe[1]]}function Rt(Fe,R){var m=R[0],F=R[1],V,D;return m==="t"?D=Fe.y:m==="b"?D=Fe.y+Fe.height:D=Fe.y+Fe.height/2,F==="l"?V=Fe.x:F==="r"?V=Fe.x+Fe.width:V=Fe.x+Fe.width/2,{x:V,y:D}}function Ct(Fe,R){var m={t:"b",b:"t",l:"r",r:"l"};return Fe.map(function(F,V){return V===R?m[F]||"c":F}).join("")}function Vt(Fe,R,m,F,V,D,N){var Ae=C.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:V[F]||{}}),Le=(0,we.Z)(Ae,2),Me=Le[0],Xe=Le[1],qe=C.useRef(0),Pt=C.useMemo(function(){return R?ae(R):[]},[R]),ot=C.useRef({}),Bt=function(){ot.current={}};Fe||Bt();var ut=(0,ne.Z)(function(){if(R&&m&&Fe){let Xn=function(An,kn){var ci=arguments.length>2&&arguments[2]!==void 0?arguments[2]:an,Ii=Et.x+An,Di=Et.y+kn,Oi=Ii+Pr,wi=Di+Wr,Bn=Math.max(Ii,ci.left),pr=Math.max(Di,ci.top),Nr=Math.min(Oi,ci.right),En=Math.min(wi,ci.bottom);return Math.max(0,(Nr-Bn)*(En-pr))},Qn=function(){nr=Et.y+Re,xr=nr+Wr,or=Et.x+pe,er=or+Pr};var rt,yt,It,zt,kt=R,tr=kt.ownerDocument,Wt=ue(kt),ir=Wt.getComputedStyle(kt),Er=ir.position,zr=kt.style.left,Nt=kt.style.top,ur=kt.style.right,ke=kt.style.bottom,De=kt.style.overflow,Se=(0,z.Z)((0,z.Z)({},V[F]),D),te=tr.createElement("div");(rt=kt.parentElement)===null||rt===void 0||rt.appendChild(te),te.style.left="".concat(kt.offsetLeft,"px"),te.style.top="".concat(kt.offsetTop,"px"),te.style.position=Er,te.style.height="".concat(kt.offsetHeight,"px"),te.style.width="".concat(kt.offsetWidth,"px"),kt.style.left="0",kt.style.top="0",kt.style.right="auto",kt.style.bottom="auto",kt.style.overflow="hidden";var se;if(Array.isArray(m))se={x:m[0],y:m[1],width:0,height:0};else{var ce,Ee,Te=m.getBoundingClientRect();Te.x=(ce=Te.x)!==null&&ce!==void 0?ce:Te.left,Te.y=(Ee=Te.y)!==null&&Ee!==void 0?Ee:Te.top,se={x:Te.x,y:Te.y,width:Te.width,height:Te.height}}var Et=kt.getBoundingClientRect(),Ut=Wt.getComputedStyle(kt),Ft=Ut.height,rr=Ut.width;Et.x=(yt=Et.x)!==null&&yt!==void 0?yt:Et.left,Et.y=(It=Et.y)!==null&&It!==void 0?It:Et.top;var Ir=tr.documentElement,qr=Ir.clientWidth,jt=Ir.clientHeight,Yt=Ir.scrollWidth,$r=Ir.scrollHeight,fn=Ir.scrollTop,Oe=Ir.scrollLeft,Wr=Et.height,Pr=Et.width,Mr=se.height,In=se.width,en={left:0,top:0,right:qr,bottom:jt},Fn={left:-Oe,top:-fn,right:Yt-Oe,bottom:$r-fn},mn=Se.htmlRegion,Nn="visible",Rn="visibleFirst";mn!=="scroll"&&mn!==Rn&&(mn=Nn);var Hn=mn===Rn,ei=$(Fn,Pt),tn=$(en,Pt),an=mn===Nn?tn:ei,gn=Hn?tn:an;kt.style.left="auto",kt.style.top="auto",kt.style.right="0",kt.style.bottom="0";var ii=kt.getBoundingClientRect();kt.style.left=zr,kt.style.top=Nt,kt.style.right=ur,kt.style.bottom=ke,kt.style.overflow=De,(zt=kt.parentElement)===null||zt===void 0||zt.removeChild(te);var Hr=w(Math.round(Pr/parseFloat(rr)*1e3)/1e3),ti=w(Math.round(Wr/parseFloat(Ft)*1e3)/1e3);if(Hr===0||ti===0||(0,H.Sh)(m)&&!(0,q.Z)(m))return;var Cn=Se.offset,wr=Se.targetOffset,kr=$e(Et,Cn),Ne=(0,we.Z)(kr,2),tt=Ne[0],wt=Ne[1],mt=$e(se,wr),Mt=(0,we.Z)(mt,2),ht=Mt[0],vt=Mt[1];se.x-=ht,se.y-=vt;var Gt=Se.points||[],qt=(0,we.Z)(Gt,2),yr=qt[0],Zr=qt[1],Rr=lt(Zr),Dr=lt(yr),Q=Rt(se,Rr),P=Rt(Et,Dr),oe=(0,z.Z)({},Se),pe=Q.x-P.x+tt,Re=Q.y-P.y+wt,je=Xn(pe,Re),ct=Xn(pe,Re,tn),dt=Rt(se,["t","l"]),Ot=Rt(Et,["t","l"]),Dt=Rt(se,["b","r"]),be=Rt(Et,["b","r"]),st=Se.overflow||{},Tt=st.adjustX,Jt=st.adjustY,Kt=st.shiftX,$t=st.shiftY,Zt=function(kn){return typeof kn=="boolean"?kn:kn>=0},nr,xr,or,er;Qn();var Ur=Zt(Jt),Lr=Dr[0]===Rr[0];if(Ur&&Dr[0]==="t"&&(xr>gn.bottom||ot.current.bt)){var Gr=Re;Lr?Gr-=Wr-Mr:Gr=dt.y-be.y-wt;var Tr=Xn(pe,Gr),Br=Xn(pe,Gr,tn);Tr>je||Tr===je&&(!Hn||Br>=ct)?(ot.current.bt=!0,Re=Gr,wt=-wt,oe.points=[Ct(Dr,0),Ct(Rr,0)]):ot.current.bt=!1}if(Ur&&Dr[0]==="b"&&(nr<gn.top||ot.current.tb)){var Yr=Re;Lr?Yr+=Wr-Mr:Yr=Dt.y-Ot.y-wt;var Qr=Xn(pe,Yr),Xr=Xn(pe,Yr,tn);Qr>je||Qr===je&&(!Hn||Xr>=ct)?(ot.current.tb=!0,Re=Yr,wt=-wt,oe.points=[Ct(Dr,0),Ct(Rr,0)]):ot.current.tb=!1}var ln=Zt(Tt),_n=Dr[1]===Rr[1];if(ln&&Dr[1]==="l"&&(er>gn.right||ot.current.rl)){var un=pe;_n?un-=Pr-In:un=dt.x-be.x-tt;var jr=Xn(un,Re),Vr=Xn(un,Re,tn);jr>je||jr===je&&(!Hn||Vr>=ct)?(ot.current.rl=!0,pe=un,tt=-tt,oe.points=[Ct(Dr,1),Ct(Rr,1)]):ot.current.rl=!1}if(ln&&Dr[1]==="r"&&(or<gn.left||ot.current.lr)){var sn=pe;_n?sn+=Pr-In:sn=Dt.x-Ot.x-tt;var rn=Xn(sn,Re),Vn=Xn(sn,Re,tn);rn>je||rn===je&&(!Hn||Vn>=ct)?(ot.current.lr=!0,pe=sn,tt=-tt,oe.points=[Ct(Dr,1),Ct(Rr,1)]):ot.current.lr=!1}Qn();var sr=Kt===!0?0:Kt;typeof sr=="number"&&(or<tn.left&&(pe-=or-tn.left-tt,se.x+In<tn.left+sr&&(pe+=se.x-tn.left+In-sr)),er>tn.right&&(pe-=er-tn.right-tt,se.x>tn.right-sr&&(pe+=se.x-tn.right+sr)));var pn=$t===!0?0:$t;typeof pn=="number"&&(nr<tn.top&&(Re-=nr-tn.top-wt,se.y+Mr<tn.top+pn&&(Re+=se.y-tn.top+Mr-pn)),xr>tn.bottom&&(Re-=xr-tn.bottom-wt,se.y>tn.bottom-pn&&(Re+=se.y-tn.bottom+pn)));var bn=Et.x+pe,Sn=bn+Pr,vn=Et.y+Re,Wn=vn+Wr,si=se.x,ri=si+In,hn=se.y,Bi=hn+Mr,li=Math.max(bn,si),Zn=Math.min(Sn,ri),ui=(li+Zn)/2,Ti=ui-bn,Hi=Math.max(vn,hn),gi=Math.min(Wn,Bi),hi=(Hi+gi)/2,Ei=hi-vn;N==null||N(R,oe);var zn=ii.right-Et.x-(pe+Et.width),pi=ii.bottom-Et.y-(Re+Et.height);Hr===1&&(pe=Math.round(pe),zn=Math.round(zn)),ti===1&&(Re=Math.round(Re),pi=Math.round(pi));var Ki={ready:!0,offsetX:pe/Hr,offsetY:Re/ti,offsetR:zn/Hr,offsetB:pi/ti,arrowX:Ti/Hr,arrowY:Ei/ti,scaleX:Hr,scaleY:ti,align:oe};Xe(Ki)}}),gt=function(){qe.current+=1;var yt=qe.current;Promise.resolve().then(function(){qe.current===yt&&ut()})},Ye=function(){Xe(function(yt){return(0,z.Z)((0,z.Z)({},yt),{},{ready:!1})})};return(0,B.Z)(Ye,[F]),(0,B.Z)(function(){Fe||Ye()},[Fe]),[Me.ready,Me.offsetX,Me.offsetY,Me.offsetR,Me.offsetB,Me.arrowX,Me.arrowY,Me.scaleX,Me.scaleY,Me.align,gt]}var Qt=Z(15142);function bt(Fe,R,m,F,V){(0,B.Z)(function(){if(Fe&&R&&m){let qe=function(){F(),V()};var D=R,N=m,Ae=ae(D),Le=ae(N),Me=ue(N),Xe=new Set([Me].concat((0,Qt.Z)(Ae),(0,Qt.Z)(Le)));return Xe.forEach(function(Pt){Pt.addEventListener("scroll",qe,{passive:!0})}),Me.addEventListener("resize",qe,{passive:!0}),F(),function(){Xe.forEach(function(Pt){Pt.removeEventListener("scroll",qe),Me.removeEventListener("resize",qe)})}}},[Fe,R,m])}var He=Z(48736);function nt(Fe,R,m,F,V,D,N,Ae){var Le=C.useRef(Fe);Le.current=Fe;var Me=C.useRef(!1);C.useEffect(function(){if(R&&F&&(!V||D)){var qe=function(){Me.current=!1},Pt=function(It){var zt;Le.current&&!N(((zt=It.composedPath)===null||zt===void 0||(zt=zt.call(It))===null||zt===void 0?void 0:zt[0])||It.target)&&!Me.current&&Ae(!1)},ot=ue(F);ot.addEventListener("pointerdown",qe,!0),ot.addEventListener("mousedown",Pt,!0),ot.addEventListener("contextmenu",Pt,!0);var Bt=(0,o.A)(m);if(Bt&&(Bt.addEventListener("mousedown",Pt,!0),Bt.addEventListener("contextmenu",Pt,!0)),0)var ut,gt,Ye,rt;return function(){ot.removeEventListener("pointerdown",qe,!0),ot.removeEventListener("mousedown",Pt,!0),ot.removeEventListener("contextmenu",Pt,!0),Bt&&(Bt.removeEventListener("mousedown",Pt,!0),Bt.removeEventListener("contextmenu",Pt,!0))}}},[R,m,F,V,D]);function Xe(){Me.current=!0}return Xe}var it=["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 At(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ve.Z,R=C.forwardRef(function(m,F){var V=m.prefixCls,D=V===void 0?"rc-trigger-popup":V,N=m.children,Ae=m.action,Le=Ae===void 0?"hover":Ae,Me=m.showAction,Xe=m.hideAction,qe=m.popupVisible,Pt=m.defaultPopupVisible,ot=m.onPopupVisibleChange,Bt=m.afterPopupVisibleChange,ut=m.mouseEnterDelay,gt=m.mouseLeaveDelay,Ye=gt===void 0?.1:gt,rt=m.focusDelay,yt=m.blurDelay,It=m.mask,zt=m.maskClosable,kt=zt===void 0?!0:zt,tr=m.getPopupContainer,Wt=m.forceRender,ir=m.autoDestroy,Er=m.destroyPopupOnHide,zr=m.popup,Nt=m.popupClassName,ur=m.popupStyle,ke=m.popupPlacement,De=m.builtinPlacements,Se=De===void 0?{}:De,te=m.popupAlign,se=m.zIndex,ce=m.stretch,Ee=m.getPopupClassNameFromAlign,Te=m.fresh,Et=m.alignPoint,Ut=m.onPopupClick,Ft=m.onPopupAlign,rr=m.arrow,Ir=m.popupMotion,qr=m.maskMotion,jt=m.popupTransitionName,Yt=m.popupAnimation,$r=m.maskTransitionName,fn=m.maskAnimation,Oe=m.className,Wr=m.getTriggerDOMNode,Pr=(0,Ue.Z)(m,it),Mr=ir||Er||!1,In=C.useState(!1),en=(0,we.Z)(In,2),Fn=en[0],mn=en[1];(0,B.Z)(function(){mn((0,y.Z)())},[]);var Nn=C.useRef({}),Rn=C.useContext(Ke),Hn=C.useMemo(function(){return{registerSubPopup:function(Nr,En){Nn.current[Nr]=En,Rn==null||Rn.registerSubPopup(Nr,En)}}},[Rn]),ei=(0,U.Z)(),tn=C.useState(null),an=(0,we.Z)(tn,2),gn=an[0],ii=an[1],Hr=C.useRef(null),ti=(0,ne.Z)(function(pr){Hr.current=pr,(0,H.Sh)(pr)&&gn!==pr&&ii(pr),Rn==null||Rn.registerSubPopup(ei,pr)}),Cn=C.useState(null),wr=(0,we.Z)(Cn,2),kr=wr[0],Ne=wr[1],tt=C.useRef(null),wt=(0,ne.Z)(function(pr){(0,H.Sh)(pr)&&kr!==pr&&(Ne(pr),tt.current=pr)}),mt=C.Children.only(N),Mt=(mt==null?void 0:mt.props)||{},ht={},vt=(0,ne.Z)(function(pr){var Nr,En,xn=kr;return(xn==null?void 0:xn.contains(pr))||((Nr=(0,o.A)(xn))===null||Nr===void 0?void 0:Nr.host)===pr||pr===xn||(gn==null?void 0:gn.contains(pr))||((En=(0,o.A)(gn))===null||En===void 0?void 0:En.host)===pr||pr===gn||Object.values(Nn.current).some(function(yn){return(yn==null?void 0:yn.contains(pr))||pr===yn})}),Gt=X(D,Ir,Yt,jt),qt=X(D,qr,fn,$r),yr=C.useState(Pt||!1),Zr=(0,we.Z)(yr,2),Rr=Zr[0],Dr=Zr[1],Q=qe!=null?qe:Rr,P=(0,ne.Z)(function(pr){qe===void 0&&Dr(pr)});(0,B.Z)(function(){Dr(qe||!1)},[qe]);var oe=C.useRef(Q);oe.current=Q;var pe=C.useRef([]);pe.current=[];var Re=(0,ne.Z)(function(pr){var Nr;P(pr),((Nr=pe.current[pe.current.length-1])!==null&&Nr!==void 0?Nr:Q)!==pr&&(pe.current.push(pr),ot==null||ot(pr))}),je=C.useRef(),ct=function(){clearTimeout(je.current)},dt=function(Nr){var En=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ct(),En===0?Re(Nr):je.current=setTimeout(function(){Re(Nr)},En*1e3)};C.useEffect(function(){return ct},[]);var Ot=C.useState(!1),Dt=(0,we.Z)(Ot,2),be=Dt[0],st=Dt[1];(0,B.Z)(function(pr){(!pr||Q)&&st(!0)},[Q]);var Tt=C.useState(null),Jt=(0,we.Z)(Tt,2),Kt=Jt[0],$t=Jt[1],Zt=C.useState(null),nr=(0,we.Z)(Zt,2),xr=nr[0],or=nr[1],er=function(Nr){or([Nr.clientX,Nr.clientY])},Ur=Vt(Q,gn,Et&&xr!==null?xr:kr,ke,Se,te,Ft),Lr=(0,we.Z)(Ur,11),Gr=Lr[0],Tr=Lr[1],Br=Lr[2],Yr=Lr[3],Qr=Lr[4],Xr=Lr[5],ln=Lr[6],_n=Lr[7],un=Lr[8],jr=Lr[9],Vr=Lr[10],sn=Ze(Fn,Le,Me,Xe),rn=(0,we.Z)(sn,2),Vn=rn[0],sr=rn[1],pn=Vn.has("click"),bn=sr.has("click")||sr.has("contextMenu"),Sn=(0,ne.Z)(function(){be||Vr()}),vn=function(){oe.current&&Et&&bn&&dt(!1)};bt(Q,kr,gn,Sn,vn),(0,B.Z)(function(){Sn()},[xr,ke]),(0,B.Z)(function(){Q&&!(Se!=null&&Se[ke])&&Sn()},[JSON.stringify(te)]);var Wn=C.useMemo(function(){var pr=j(Se,D,jr,Et);return _()(pr,Ee==null?void 0:Ee(jr))},[jr,Ee,Se,D,Et]);C.useImperativeHandle(F,function(){return{nativeElement:tt.current,popupElement:Hr.current,forceAlign:Sn}});var si=C.useState(0),ri=(0,we.Z)(si,2),hn=ri[0],Bi=ri[1],li=C.useState(0),Zn=(0,we.Z)(li,2),ui=Zn[0],Ti=Zn[1],Hi=function(){if(ce&&kr){var Nr=kr.getBoundingClientRect();Bi(Nr.width),Ti(Nr.height)}},gi=function(){Hi(),Sn()},hi=function(Nr){st(!1),Vr(),Bt==null||Bt(Nr)},Ei=function(){return new Promise(function(Nr){Hi(),$t(function(){return Nr})})};(0,B.Z)(function(){Kt&&(Vr(),Kt(),$t(null))},[Kt]);function zn(pr,Nr,En,xn){ht[pr]=function(yn){var ji;xn==null||xn(yn),dt(Nr,En);for(var jn=arguments.length,Kn=new Array(jn>1?jn-1:0),$i=1;$i<jn;$i++)Kn[$i-1]=arguments[$i];(ji=Mt[pr])===null||ji===void 0||ji.call.apply(ji,[Mt,yn].concat(Kn))}}(pn||bn)&&(ht.onClick=function(pr){var Nr;oe.current&&bn?dt(!1):!oe.current&&pn&&(er(pr),dt(!0));for(var En=arguments.length,xn=new Array(En>1?En-1:0),yn=1;yn<En;yn++)xn[yn-1]=arguments[yn];(Nr=Mt.onClick)===null||Nr===void 0||Nr.call.apply(Nr,[Mt,pr].concat(xn))});var pi=nt(Q,bn,kr,gn,It,kt,vt,dt),Ki=Vn.has("hover"),Xn=sr.has("hover"),Qn,An;Ki&&(zn("onMouseEnter",!0,ut,function(pr){er(pr)}),zn("onPointerEnter",!0,ut,function(pr){er(pr)}),Qn=function(Nr){(Q||be)&&gn!==null&&gn!==void 0&&gn.contains(Nr.target)&&dt(!0,ut)},Et&&(ht.onMouseMove=function(pr){var Nr;(Nr=Mt.onMouseMove)===null||Nr===void 0||Nr.call(Mt,pr)})),Xn&&(zn("onMouseLeave",!1,Ye),zn("onPointerLeave",!1,Ye),An=function(){dt(!1,Ye)}),Vn.has("focus")&&zn("onFocus",!0,rt),sr.has("focus")&&zn("onBlur",!1,yt),Vn.has("contextMenu")&&(ht.onContextMenu=function(pr){var Nr;oe.current&&sr.has("contextMenu")?dt(!1):(er(pr),dt(!0)),pr.preventDefault();for(var En=arguments.length,xn=new Array(En>1?En-1:0),yn=1;yn<En;yn++)xn[yn-1]=arguments[yn];(Nr=Mt.onContextMenu)===null||Nr===void 0||Nr.call.apply(Nr,[Mt,pr].concat(xn))}),Oe&&(ht.className=_()(Mt.className,Oe));var kn=C.useRef(!1);kn.current||(kn.current=Wt||Q||be);var ci=(0,z.Z)((0,z.Z)({},Mt),ht),Ii={},Di=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Di.forEach(function(pr){Pr[pr]&&(Ii[pr]=function(){for(var Nr,En=arguments.length,xn=new Array(En),yn=0;yn<En;yn++)xn[yn]=arguments[yn];(Nr=ci[pr])===null||Nr===void 0||Nr.call.apply(Nr,[ci].concat(xn)),Pr[pr].apply(Pr,xn)})});var Oi=C.cloneElement(mt,(0,z.Z)((0,z.Z)({},ci),Ii)),wi={x:Xr,y:ln},Bn=rr?(0,z.Z)({},rr!==!0?rr:{}):null;return C.createElement(C.Fragment,null,C.createElement(ye.Z,{disabled:!Q,ref:wt,onResize:gi},C.createElement(le,{getTriggerDOMNode:Wr},Oi)),kn.current&&C.createElement(Ke.Provider,{value:Hn},C.createElement(Ce,{portal:Fe,ref:ti,prefixCls:D,popup:zr,className:_()(Nt,Wn),style:ur,target:kr,onMouseEnter:Qn,onMouseLeave:An,onPointerEnter:Qn,zIndex:se,open:Q,keepDom:be,fresh:Te,onClick:Ut,onPointerDownCapture:pi,mask:It,motion:Gt,maskMotion:qt,onVisibleChanged:hi,onPrepare:Ei,forceRender:Wt,autoDestroy:Mr,getPopupContainer:tr,align:jr,arrow:Bn,arrowPos:wi,ready:Gr,offsetX:Tr,offsetY:Br,offsetR:Yr,offsetB:Qr,onAlign:Sn,stretch:ce,targetWidth:hn/_n,targetHeight:ui/un})))});return R}var Ht=At(ve.Z)},53281:function(Sr,St,Z){"use strict";Z.r(St),Z.d(St,{default:function(){return ut}});var z=Z(59301),we=Z(61186),Ue=Z.n(we),ve=Z(86129),Y=Z.n(ve),_=Z(82093),ye=Z(76560),H=Z(62957),o=Z(6767),ne=Z(77019),U=Z(5269),B=Z(99571),y=Z(458),C=Z(91882),T=Z(37285),ee=Z(54172),G=Z(71114),W=Z(82326),k=Z(29787),K=Z(27812),re=Z(95869),me=Z(87169),Ce=Z(26227),Ie=Z(90524),le=Z(34055),xe=Z(49661),Ke=Z(28284),ge=Z(71051),Ze=Z(37568),q=({defaultValue:gt,onBlur:Ye,max:rt,className:yt="game-score"})=>{const[It,zt]=(0,z.useState)(gt);(0,z.useEffect)(()=>{zt(gt)},[gt]);function kt(Wt){zt(Wt)}function tr(){It&&(Ye(It>rt?rt:It),zt(null))}return z.createElement(ge.Z,{max:rt,min:0,className:yt,value:It,onChange:kt,onBlur:tr})},L={greyText:"greyText___lvEE6",info:"info___El01Z",label:"label___GmvST",blackContent:"blackContent___FYo0Z",orangeContent:"orangeContent____uYQ3",inputLabel:"inputLabel___ruiZm",tableTitle:"tableTitle___ir3x7",scoreTable:"scoreTable___b9Z37"},j=Z(46383),X=Z(3493),ue=Z(59301),ae=Object.defineProperty,w=Object.defineProperties,b=Object.getOwnPropertyDescriptors,$=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,lt=(gt,Ye,rt)=>Ye in gt?ae(gt,Ye,{enumerable:!0,configurable:!0,writable:!0,value:rt}):gt[Ye]=rt,Rt=(gt,Ye)=>{for(var rt in Ye||(Ye={}))fe.call(Ye,rt)&&lt(gt,rt,Ye[rt]);if($)for(var rt of $(Ye))$e.call(Ye,rt)&&lt(gt,rt,Ye[rt]);return gt},Ct=(gt,Ye)=>w(gt,b(Ye)),Vt=(gt,Ye,rt)=>new Promise((yt,It)=>{var zt=Wt=>{try{tr(rt.next(Wt))}catch(ir){It(ir)}},kt=Wt=>{try{tr(rt.throw(Wt))}catch(ir){It(ir)}},tr=Wt=>Wt.done?yt(Wt.value):Promise.resolve(Wt.value).then(zt,kt);tr((rt=rt.apply(gt,Ye)).next())});const Qt=({shixunHomeworks:gt,dispatch:Ye,classroomList:rt,gethomeworkreport:yt,homeWorkReport:It})=>{var zt,kt;const{shixunWorkReport:tr}=gt,Wt=(0,ye.useParams)(),[ir,Er]=(0,z.useState)(!1),[zr,Nt]=(0,z.useState)(!1),[ur,ke]=(0,z.useState)(""),[De]=Ke.default.useForm(),Se=Ke.default.useWatch("comment",De),te=Ke.default.useWatch("hidden_comment",De),[se,ce]=(0,z.useState)(!1),Ee=(0,z.useRef)({}),[Te,Et]=H.default.useModal(),Ut=()=>Vt(void 0,null,function*(){Nt(!0);const jt=De.getFieldsValue();(yield(0,_.ZP)(`/api/student_works/${Wt.homeworkId}/shixun_work_comment.json`,{method:"post",body:{hidden_comment:jt.hidden_comment,comment:jt.comment}})).status===0&&(o.ZP.success("\u70B9\u8BC4\u6210\u529F"),De.resetFields(),Ye({type:"classroomList/setActionTabs",payload:{}}),yt()),Nt(!1)}),Ft=()=>Vt(void 0,null,function*(){if(!ur){o.ZP.warning("\u8BF7\u586B\u5199\u5206\u6570");return}Nt(!0);const jt=De.getFieldsValue();(yield(0,_.ZP)(`/api/student_works/${Wt.homeworkId}/add_score.json`,{method:"post",body:{comment:jt.comment,score:ur}})).status===0&&(o.ZP.success("\u70B9\u8BC4\u6210\u529F"),Ye({type:"classroomList/setActionTabs",payload:{}}),yt()),Nt(!1)}),rr=jt=>Vt(void 0,null,function*(){const{mes:Yt,setChatData:$r,setTyping:fn}=jt,Oe=yield(0,_.ZP)("/api/intelligent_reviews/large_model_intelligent_qa.json",{method:"post",body:Rt({query:Yt,student_work_id:Wt.homeworkId},Ee.current)});Oe.answer=(Oe==null?void 0:Oe.status)==-3?Oe.message:Oe==null?void 0:Oe.answer,Oe!=null&&Oe.answer&&$r(Wr=>[...Wr].map((Pr,Mr)=>Mr===Wr.length-1?Ct(Rt({},Pr),{text:Oe==null?void 0:Oe.answer,loading:!1,response:Oe}):Pr))}),Ir=({chatData:jt,setChatData:Yt,setLoading:$r,getData:fn,renderChatItems:Oe})=>{Ye({type:"shixunHomeworks/setActionTabs",payload:{key:"\u667A\u80FD\u8BC4\u9605\u914D\u7F6E",onOk:Wr=>{Ee.current=Wr,ce(!0),$r(!0);const Pr=Oe();Pr[0].show=!1,Yt(Pr),fn()}}})},qr=[{title:"\u4EFB\u52A1\u540D\u79F0",dataIndex:"shixun_name",ellipsis:!0},{title:"\u5F00\u542F\u65F6\u95F4",dataIndex:"open_time",width:160,render:jt=>jt||"--"},{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"evaluate_count",width:110},{title:"\u5B8C\u6210\u65F6\u95F4",dataIndex:"finished_time",width:160},{title:"\u5B9E\u8BAD\u8017\u65F6",dataIndex:"cost_time",width:160},{title:"\u7F3A\u8BC4\u6263\u5206",dataIndex:"absence_penalty",width:90,render:jt=>jt||"--"},{title:"\u5F97\u5206",dataIndex:"score",width:90,render:(jt,Yt)=>ue.createElement("div",null,ue.createElement("span",{style:{color:parseFloat(Yt.score_full)!==parseFloat(jt)?"#E30000":"#53C41B"}},jt),"/",Yt.score_full)},{title:"\u8C03\u5206",width:100,dataIndex:"action",render:(jt,Yt)=>(0,le.GJ)()?ue.createElement(q,{max:Yt.score_full,onBlur:$r=>Vt(void 0,null,function*(){var fn;if((0,le.Rm)()&&!((fn=rt.AssistantObject.practice)!=null&&fn.can_appraise)){o.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}const Oe=yield(0,_.ZP)(`/api/student_works/${Wt.homeworkId}/adjust_score.json`,{method:"post",body:{score:$r}});yt(),Oe.status===0&&o.ZP.success("\u8C03\u5206\u6210\u529F")})}):It!=null&&It.is_anonymous?ue.createElement(ge.Z,{min:0,value:ur,onChange:$r=>ke($r),max:Yt.score_full}):jt}].filter(jt=>It!=null&&It.is_anonymous?!["late_penalty","score","absence_penalty"].includes(jt.dataIndex):!0);return ue.createElement(ue.Fragment,null,ue.createElement(H.default,{centered:!0,width:1080,title:"\u70B9\u8BC4\u4F5C\u4E1A",afterClose:()=>{De.resetFields(),ke("")},confirmLoading:zr,open:rt.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:()=>Vt(void 0,null,function*(){var jt;if((0,le.Rm)()&&!((jt=rt.AssistantObject.practice)!=null&&jt.can_appraise)){o.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}if(It!=null&&It.is_anonymous){Ft();return}const Yt=De.getFieldsValue();JSON.stringify(Yt)==="{}"||Yt.hidden_comment===""&&Yt.comment===""?Er(!0):Ut()}),onCancel:()=>{Ye({type:"classroomList/setActionTabs",payload:{}})}},ue.createElement(ne.Z,{className:L.info},ue.createElement(U.Z,null,ue.createElement("span",{className:`${L.label} ${L.greyText}`},"\u59D3\u540D"),ue.createElement("span",{className:L.blackContent},It==null?void 0:It.username)),ue.createElement(U.Z,null,ue.createElement("span",{className:`${L.label} ${L.greyText}`},"\u5B66\u53F7"),ue.createElement("span",{className:L.blackContent},(It==null?void 0:It.student_id)||"--")),!(It!=null&&It.is_anonymous)&&ue.createElement(ue.Fragment,null,ue.createElement(U.Z,null,ue.createElement("span",{className:`${L.label} ${L.greyText}`},"\u73ED\u7EA7"),ue.createElement("span",{className:L.blackContent},(It==null?void 0:It.group_name)||"--")),ue.createElement(U.Z,null,ue.createElement("span",{className:`${L.label} ${L.greyText}`},"\u8865\u4EA4\u6263\u5206"),ue.createElement("span",{className:L.orangeContent},((zt=It==null?void 0:It.stage_list[0])==null?void 0:zt.late_penalty)||"--")),ue.createElement(U.Z,null,ue.createElement("span",{className:`${L.label} ${L.greyText}`},"\u7F3A\u8BC4\u6263\u5206"),ue.createElement("span",{className:L.orangeContent},((kt=It==null?void 0:It.stage_list[0])==null?void 0:kt.absence_penalty)||"--")),ue.createElement(U.Z,null,ue.createElement("span",{className:`${L.label} ${L.greyText}`},"\u603B\u6210\u7EE9"),ue.createElement("span",{className:L.orangeContent},(It==null?void 0:It.stage_list[0].score)||"--")))),ue.createElement(Ke.default,{form:De,onChange:()=>{ir&&Er(!1)}},ue.createElement("div",{className:"w-full flex justify-between item-center"},ue.createElement("div",{className:`${L.inputLabel} ${L.greyText}`,style:{marginBottom:0}},It!=null&&It.is_anonymous?"\u8BC4\u8BED":"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),ue.createElement("div",{className:"mb10"},ue.createElement(j.Z,{title:"\u667A\u80FD\u8BC4\u9605",visible:se,onOpen:Ir,onClose:()=>{ce(!1)},loadingOption:{text:"AI\u8BC4\u9605\u4E2D..."},hideUpload:!0,showDefaultTips:!1,hideInputBox:!0,customRequest:rr,extraAnswerAction:jt=>{var Yt;return!jt.loading&&![-1,-3].includes((Yt=jt==null?void 0:jt.response)==null?void 0:Yt.status)&&ue.createElement("div",{className:L.apply,onClick:()=>{const $r=()=>{var fn,Oe,Wr;De.setFieldsValue({comment:(fn=jt==null?void 0:jt.response)==null?void 0:fn.remarks,hidden_comment:(Oe=jt==null?void 0:jt.response)==null?void 0:Oe.remarks}),ke((Wr=jt==null?void 0:jt.response)==null?void 0:Wr.score),ce(!1)};if(ur||Se||te){Te.confirm({icon:null,title:"\u63D0\u793A",centered:!0,content:"\u7CFB\u7EDF\u68C0\u6D4B\u5230\u8BC4\u5206\u6216\u8BC4\u8BED\u8F93\u5165\u6846\u4E2D\u5DF2\u6709\u5185\u5BB9\uFF0C\u4E00\u952E\u5E94\u7528\u5C06\u4F1A\u8986\u76D6\u539F\u6709\u5185\u5BB9\u3002\u662F\u5426\u5E94\u7528\uFF1F",okText:"\u5E94\u7528",onOk:$r});return}$r()}},ue.createElement("i",{style:{color:"#3061D0"},className:"iconfont icon-yijianyingyong1 font12 mr5"}),"\u4E00\u952E\u5E94\u7528")}},ue.createElement(B.ZP,{icon:ue.createElement("img",{src:Z(11689)}),type:"link"},"\u667A\u80FD\u8BC4\u9605")))),ue.createElement(Ke.default.Item,{name:"comment"},ue.createElement(Ze.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:3})),!(It!=null&&It.is_anonymous)&&ue.createElement(ue.Fragment,null,ue.createElement("div",{className:`${L.inputLabel} ${L.greyText}`},"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),ue.createElement(Ke.default.Item,{name:"hidden_comment"},ue.createElement(Ze.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:3}))," ")),ir&&ue.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A"),ue.createElement("div",{className:L.tableTitle},"\u5173\u5361\u6210\u7EE9"),ue.createElement(ee.default,{className:L.scoreTable,dataSource:It==null?void 0:It.stage_list,rowKey:"challenge_id",pagination:!1,columns:qr})),ue.createElement(X.Z,null))};var bt=(0,ye.connect)(({shixunHomeworks:gt,classroomList:Ye})=>({shixunHomeworks:gt,classroomList:Ye}))(Qt),He={},nt=(gt,Ye,rt)=>new Promise((yt,It)=>{var zt=Wt=>{try{tr(rt.next(Wt))}catch(ir){It(ir)}},kt=Wt=>{try{tr(rt.throw(Wt))}catch(ir){It(ir)}},tr=Wt=>Wt.done?yt(Wt.value):Promise.resolve(Wt.value).then(zt,kt);tr((rt=rt.apply(gt,Ye)).next())});const it=({shixunHomeworks:gt,dispatch:Ye,gethomeworkreport:rt,homeWorkReport:yt})=>{var It,zt;const{shixunWorkReport:kt}=gt;console.log(yt,"homeWorkReport");const tr=(0,ye.useParams)(),[Wt,ir]=(0,z.useState)(!1),[Er]=Ke.default.useForm(),{user_name:zr,score:Nt,comment_time:ur,content:ke,score_id:De,user_id:Se}=((zt=(It=gt==null?void 0:gt.actionTabs)==null?void 0:It.selectArrs)==null?void 0:zt.data)||{},te=()=>nt(void 0,null,function*(){yield Er.validateFields(),ir(!0);const se=Er.getFieldsValue();(yield(0,_.ZP)(`/api/student_works/${tr.homeworkId}/appeal_anonymous_score.json`,{method:"post",body:{comment:se.comment,score_id:De,userId:Se}})).status===0&&(o.ZP.success("\u64CD\u4F5C\u6210\u529F"),Ye({type:"shixunHomeworks/setActionTabs",payload:{}}),rt()),ir(!1)});return z.createElement(H.default,{centered:!0,width:600,title:"\u533F\u8BC4\u7533\u8BC9",afterClose:()=>{Er.resetFields()},confirmLoading:Wt,open:gt.actionTabs.key==="\u533F\u8BC4\u7533\u8BC9",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:te,onCancel:()=>{Ye({type:"shixunHomeworks/setActionTabs",payload:{}})}},z.createElement("div",{className:"p20",style:{background:"#F7F8F9",padding:15,marginBottom:20}},z.createElement(ne.Z,{justify:"space-between",className:He.info},z.createElement("span",null,z.createElement("span",{className:"c-grey-666"},zr),z.createElement("span",{className:"c-grey-333 ml5"},"\u8C03\u5206\u4E3A"),z.createElement("span",{className:"c-orange ml5"},Nt,"\u5206")),z.createElement("span",{className:"c-grey-333"},ur)),z.createElement("div",{className:"c-grey-333 mt5"},ke)),z.createElement(Ke.default,{form:Er,className:"mt15",layout:"vertical"},z.createElement(Ke.default.Item,{name:"comment",label:"\u7533\u8BC9",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7533\u8BC9\u539F\u56E0"}]},z.createElement(Ze.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u7533\u8BC9\u539F\u56E0",rows:3}))))};var At=(0,ye.connect)(({shixunHomeworks:gt})=>({shixunHomeworks:gt}))(it),Ht=Z(82572),Fe={flex_box_center:"flex_box_center___uz0LL",flex_space_between:"flex_space_between___kuKI5",flex_box_vertical_center:"flex_box_vertical_center___VzPH1",flex_box_center_end:"flex_box_center_end___Tyr1U",flex_box_column:"flex_box_column___qsgVa",title:"title___SFyGM",export:"export___ezPhH",title1_right:"title1_right___tMOJn",userPic:"userPic___mW4Rr",userInfo:"userInfo___vYvSZ",listItem:"listItem___gJf4Z",rightInfo:"rightInfo___PRYRt",shixunTitle:"shixunTitle___STlvE",shixunWrp:"shixunWrp___knhTt",footerBar:"footerBar___R5IlQ",footerBarStatic:"footerBarStatic___M4EQj",exitComment:"exitComment___NoCI4",nextComment:"nextComment___sFj7z",modal:"modal___TwQdH",tag:"tag___RErUu"},R=Z(3713),m=Z(45278),F=Z(44164),V=Z.n(F),D=Z(59301),N=Object.defineProperty,Ae=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,Xe=(gt,Ye,rt)=>Ye in gt?N(gt,Ye,{enumerable:!0,configurable:!0,writable:!0,value:rt}):gt[Ye]=rt,qe=(gt,Ye)=>{for(var rt in Ye||(Ye={}))Le.call(Ye,rt)&&Xe(gt,rt,Ye[rt]);if(Ae)for(var rt of Ae(Ye))Me.call(Ye,rt)&&Xe(gt,rt,Ye[rt]);return gt},Pt=(gt,Ye)=>{var rt={};for(var yt in gt)Le.call(gt,yt)&&Ye.indexOf(yt)<0&&(rt[yt]=gt[yt]);if(gt!=null&&Ae)for(var yt of Ae(gt))Ye.indexOf(yt)<0&&Me.call(gt,yt)&&(rt[yt]=gt[yt]);return rt},ot=(gt,Ye,rt)=>new Promise((yt,It)=>{var zt=Wt=>{try{tr(rt.next(Wt))}catch(ir){It(ir)}},kt=Wt=>{try{tr(rt.throw(Wt))}catch(ir){It(ir)}},tr=Wt=>Wt.done?yt(Wt.value):Promise.resolve(Wt.value).then(zt,kt);tr((rt=rt.apply(gt,Ye)).next())});const Bt=gt=>{var Ye=gt,{shixunHomeworks:rt,classroomList:yt,globalSetting:It,loading:zt,user:kt,dispatch:tr}=Ye,Wt=Pt(Ye,["shixunHomeworks","classroomList","globalSetting","loading","user","dispatch"]),ir,Er,zr,Nt,ur,ke,De;const[Se,te]=(0,z.useState)(qe({},(0,ye.useParams)())),se=(0,ye.useParams)(),ce=(0,ye.useLocation)(),[]=(0,z.useState)([]),[Ee,Te]=(0,z.useState)({last:!1}),[Et,Ut]=(0,z.useState)({last:!1}),Ft=(0,z.useRef)(),rr=(0,z.useRef)(),[Ir,qr]=(0,z.useState)(!1),[jt,Yt]=(0,z.useState)(!1),[$r,fn]=(0,z.useState)(!1),[Oe,Wr]=(0,z.useState)(),[Pr,Mr]=(0,z.useState)(),[In,en]=(0,z.useState)(!0),[Fn,mn]=(0,z.useState)(),Nn=(0,le.GJ)(),[Rn,Hn]=(0,z.useState)(new(Y())),[ei,tn]=(0,z.useState)(0),[an,gn]=(0,z.useState)([]),[ii,Hr]=(0,z.useState)(!1),[ti,Cn]=(0,z.useState)(!1),[wr,kr]=(0,z.useState)(""),[Ne,tt]=(0,z.useState)(!1),[wt,mt]=(0,z.useState)(!0),[Mt,ht]=(0,z.useState)(0),[vt]=(0,ye.useSearchParams)(),Gt=()=>ot(void 0,null,function*(){(kt.userInfo.is_teacher||kt.userInfo.admin)&&(tt(!0),mt(!1))});(0,z.useEffect)(()=>{Gt(),console.log("\u6253\u5370\u7684------",Oe),console.log(rt),kr(Oe==null?void 0:Oe.repeat_minus_score)},[Oe,kt]),(0,z.useEffect)(()=>{console.log("\u89E6\u53D1\u8FD9",Oe==null?void 0:Oe.work_score),ht(Oe==null?void 0:Oe.work_score)},[Oe==null?void 0:Oe.work_score,wr]),(0,z.useEffect)(()=>(tr({type:"globalSetting/footerToggle",payload:!1}),()=>{tr({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,z.useEffect)(()=>{var be;if(Oe){let st=[];(be=Oe==null?void 0:Oe.target_test_sets)==null||be.map((Tt,Jt)=>{var Kt;(Kt=Tt==null?void 0:Tt.targets)==null||Kt.map(($t,Zt)=>{var nr;$t.name=Tt==null?void 0:Tt.name,$t.total_target_score=Tt==null?void 0:Tt.total_target_score,$t.actual_target_score=Tt==null?void 0:Tt.actual_target_score,$t.rowSpan=Zt===0?(nr=Tt==null?void 0:Tt.targets)==null?void 0:nr.length:0,$t.order=Jt+1,st.push($t)})}),mn(st),tr({type:"classroomList/getAssistantPermissions",payload:{course_id:Se.coursesId}})}},[Oe]),(0,z.useEffect)(()=>{rt.actionTabs.key==="\u5BFC\u51FA\u5B9E\u8BAD\u62A5\u544A"&&an.length>0&&Oe!=null&&Oe.course_name&&Rr("all")},[Oe==null?void 0:Oe.course_name]),(0,z.useEffect)(()=>{console.log(se),te(qe({},se))},[ce.pathname]);const qt=()=>{document.body.scrollIntoView()};function yr(){return ot(this,null,function*(){var be,st,Tt,Jt;const Kt=JSON.parse(localStorage.all_student_works_param||"{}"),$t=yield tr({type:"shixunHomeworks/getAllStudentWorks",payload:qe(qe({},Se),Kt)});gn($t.all_student_works);const Zt=(be=$t.all_student_works)==null?void 0:be.map(nr=>String(nr.student_work_id)).indexOf(Se.homeworkId);Zt===((st=$t.all_student_works)==null?void 0:st.length)-1?Te({last:!0}):Te((Tt=$t.all_student_works)==null?void 0:Tt[Zt+1]),Ut(Zt===0?{last:!0}:(Jt=$t.all_student_works)==null?void 0:Jt[Zt-1])})}const Zr=()=>{document.querySelectorAll("canvas").forEach(be=>{(!be.clientWidth||!be.clientHeight)&&be.remove()})},Rr=be=>ot(void 0,null,function*(){let st=0,Tt;Tt=H.default.info({width:460,title:D.createElement("div",null,"\u6B63\u5728\u5BFC\u51FA\u5B9E\u8BAD\u62A5\u544A,",D.createElement("span",{className:"c-red"},"\u8BF7\u52FF\u5173\u95ED\u6216\u64CD\u4F5C\u5F53\u524D\u6D4F\u89C8\u5668\u7A97\u53E3")),content:D.createElement("div",null,"\u5F53\u524D\u8FDB\u5EA6: ",D.createElement("span",{className:"c-blue"},st+1),"/",be!=="all"?1:an==null?void 0:an.length,D.createElement("br",null),"\u8BF7\u52FF\u5173\u95ED\u6D4F\u89C8\u5668\u7A97\u53E3"),maskClosable:!1,className:Fe.modal,onOk:()=>{}});const Jt={margin:[0,0],filename:`${Oe==null?void 0:Oe.username}.pdf`,html2canvas:{useCORS:!0,letterRendering:!0},jsPDF:{unit:"mm",format:"a4",orientation:"landscape"}};function Kt(){return ot(this,null,function*(){qt(),st++,setTimeout(()=>ot(this,null,function*(){var Zt;Zr();const nr=Rn.folder(`${(Zt=Oe==null?void 0:Oe.stage_list[0])==null?void 0:Zt.shixun_name}`),xr=document.querySelector("#export-all").children;let or=V()();for(let er=0;er<xr.length;er++)yield or.set(Jt).from(xr[er]).toContainer().toCanvas().toPdf().get("pdf").then(Ur=>ot(this,null,function*(){er<xr.length-1&&(yield Ur.addPage())}));nr.file(`${an[st-1].student_work_user_name}.pdf`,or.output("blob")),Tt.update({content:D.createElement("div",null,"\u5F53\u524D\u8FDB\u5EA6: ",D.createElement("span",{className:"c-blue"},st),"/",an==null?void 0:an.length,D.createElement("br",null),"\u8BF7\u52FF\u5173\u95ED\u6D4F\u89C8\u5668\u7A97\u53E3")}),st==(an==null?void 0:an.length)?(Tt.destroy(),Dr()):$t()}),2200)})}function $t(){return ot(this,null,function*(){var Zt,nr,xr,or,er;const Ur=yield(0,_.ZP)(`/api/student_works/${an[st].student_work_id}/jupyter_work_report.json`,{method:"get"});if((Ur==null?void 0:Ur.status)===0)if(Wr(Ur.data),(nr=(Zt=Ur==null?void 0:Ur.data)==null?void 0:Zt.shixun_detail[0])!=null&&nr.myshixun_identifier){en(!0);const Lr=yield(0,_.ZP)("/api/jupyters/preview_tpi.json",{method:"get",params:{identifier:(or=(xr=Ur==null?void 0:Ur.data)==null?void 0:xr.shixun_detail[0])==null?void 0:or.myshixun_identifier,student_work_id:(er=Ur==null?void 0:Ur.data)==null?void 0:er.work_id}});Lr.status===0&&(Mr(Lr.html_content),en(!1),pe(),Kt())}else Kt()})}if(be!=="all"||(an==null?void 0:an.length)<2){Zr(),qt();const Zt=rr.current.children;let nr=V()();const xr=Rn.folder(`${Oe==null?void 0:Oe.username}`);for(let or=0;or<Zt.length;or++)yield nr.set(Jt).from(Zt[or]).toContainer().toCanvas().toPdf().get("pdf").then(er=>ot(void 0,null,function*(){or<Zt.length-1&&(yield er.addPage())}));qr(!1),xr.file(`${Oe==null?void 0:Oe.username}.pdf`,nr.output("blob"),{base64:!1}),Tt.destroy(),Dr();return}else $t()}),Dr=()=>{Rn.generateAsync({type:"blob"}).then(function(be){const st=document.createElement("a");st.href=window.URL.createObjectURL(be),st.download=(Oe==null?void 0:Oe.course_name)+".zip",document.body.appendChild(st);const Tt=document.createEvent("MouseEvents");Tt.initEvent("click",!1,!1),st.dispatchEvent(Tt),document.body.removeChild(st),Hn(new(Y()))}),fn(!1)};(0,z.useEffect)(()=>{Re()},[Se.homeworkId]),(0,z.useEffect)(()=>{Oe!=null&&Oe.work_id&&((0,le.GJ)()||Oe!=null&&Oe.is_anonymous)&&yr()},[Oe==null?void 0:Oe.work_id]),(0,z.useEffect)(()=>{console.log(Oe)},[Oe]);const Q=()=>ot(void 0,null,function*(){const be=yield(0,_.ZP)(`/api/student_works/${Se.homeworkId}/jupyter_work_report.json`,{method:"get"});(be==null?void 0:be.status)===0&&Wr(be.data)}),P=()=>ot(void 0,null,function*(){var be,st,Tt,Jt,Kt;const $t=yield(0,_.ZP)(`/api/student_works/${Se.homeworkId}/jupyter_work_report.json`,{method:"get"});if(($t==null?void 0:$t.status)===0&&(Wr($t.data),(st=(be=$t==null?void 0:$t.data)==null?void 0:be.shixun_detail[0])!=null&&st.myshixun_identifier)){en(!0);const Zt=yield(0,_.ZP)("/api/jupyters/preview_tpi.json",{method:"get",params:{identifier:(Jt=(Tt=$t==null?void 0:$t.data)==null?void 0:Tt.shixun_detail[0])==null?void 0:Jt.myshixun_identifier,student_work_id:(Kt=$t==null?void 0:$t.data)==null?void 0:Kt.work_id}});if(Zt.status===0){Mr(Zt.html_content),en(!1),oe(Zt.html_content);return}}}),oe=be=>{var st,Tt;(Tt=(st=be==null?void 0:be.match)==null?void 0:st.call(be,/<script [^>]*src=['"]([^'"]+)[^>]*>/gi))==null||Tt.map(Jt=>{const Kt=document.createElement("script");Kt.src=/<script [^>]*src=['"]([^'"]+)[^>]*>/gi.exec(Jt)[1],document.body.appendChild(Kt)}),pe()},pe=()=>{try{window.MathJax&&(MathJax.Hub.Config({TeX:{equationNumbers:{autoNumber:"AMS",useLabelIds:!0}},tex2jax:{inlineMath:[["$","$"],["\\\\(","\\\\)"]],displayMath:[["$$","$$"],["\\\\[","\\\\]"]],processEscapes:!0,processEnvironments:!0},displayAlign:"center",CommonHTML:{linebreaks:{automatic:!0}},"HTML-CSS":{linebreaks:{automatic:!0}}}),MathJax.Hub.Queue(["Typeset",MathJax.Hub]))}catch(be){}},Re=()=>ot(void 0,null,function*(){Yt(!0),P(),Yt(!1)}),je=[{title:"\u4EFB\u52A1\u540D\u79F0",dataIndex:"shixun_name",ellipsis:!0,render:(be,st,Tt)=>be},{title:"\u5F00\u542F\u65F6\u95F4",dataIndex:"open_time",width:Oe!=null&&Oe.is_anonymous?220:170,render:be=>be||"--"},{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"evaluate_count",width:Oe!=null&&Oe.is_anonymous?140:90},{title:"\u5B8C\u6210\u65F6\u95F4",dataIndex:"finished_time",width:Oe!=null&&Oe.is_anonymous?220:170},{title:"\u5B9E\u8BAD\u8017\u65F6",dataIndex:"cost_time",width:130},{title:"\u8865\u4EA4\u6263\u5206",dataIndex:"late_penalty",width:90,render:be=>be||"--"},{title:"\u7F3A\u8BC4\u6263\u5206",dataIndex:"absence_penalty",width:90,render:be=>be||"--"},{title:"\u5F97\u5206",dataIndex:"score",width:100,render:(be,st)=>D.createElement("div",null,D.createElement("span",{style:{color:parseFloat(st.score_full)!==parseFloat(be)?"red":"green"}},be||0),"/",st.score_full)},{title:"\u8C03\u5206",dataIndex:"action",width:110,render:(be,st)=>Nn?D.createElement(q,{max:st.score_full,onBlur:Tt=>ot(void 0,null,function*(){var Jt;if((0,le.Rm)()&&!((Jt=yt.AssistantObject.practice)!=null&&Jt.can_appraise)){o.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}const Kt=yield(0,_.ZP)(`/api/student_works/${Se.homeworkId}/adjust_score.json`,{method:"post",body:{score:Tt}});Q(),Kt.status===0&&o.ZP.success("\u64CD\u4F5C\u6210\u529F")})}):be}].filter(be=>Oe!=null&&Oe.is_anonymous?!["late_penalty","absence_penalty","score","action"].includes(be.dataIndex):!0),ct=Oe==null?void 0:Oe.comment_scores.map(be=>{var st,Tt,Jt;return{children:D.createElement(ne.Z,null,D.createElement(U.Z,{span:24},D.createElement(ne.Z,null,D.createElement(U.Z,{flex:1},D.createElement("span",{className:"c-light-black mr10"},be.user_name),D.createElement("span",null,"\u8C03\u5206\u4E3A"),D.createElement("span",{className:"ml10 c-orange"},be.score?be.score:0,"\u5206")),D.createElement(U.Z,null,D.createElement("span",{className:"c-light-black ml10"},be.comment_time)))),D.createElement(U.Z,{span:24,className:"mt8"},D.createElement(ne.Z,{className:"mt8"},D.createElement(U.Z,{span:22},be.content?D.createElement(R.Z,{value:be.content,style:{fontSize:14}}):D.createElement("span",{className:"c-light-black"},"\u6682\u672A\u5199\u8BC4\u8BED")),D.createElement(U.Z,{className:"tr",span:2},(be==null?void 0:be.can_appeal)&&!(be!=null&&be.is_invalid)&&D.createElement(B.ZP,{size:"small",type:"primary",onClick:()=>{tr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u533F\u8BC4\u7533\u8BC9",selectArrs:{data:qe({},be)}}})}},"\u7533\u8BC9")))),!!(be!=null&&be.appeal_info)&&D.createElement(U.Z,{span:24,className:"mt8"},D.createElement("div",{className:"p20",style:{background:"#F7F8F9",padding:15}},D.createElement(ne.Z,{justify:"space-between"},D.createElement("span",null,D.createElement("span",{className:"c-grey-333"},(st=be==null?void 0:be.appeal_info)==null?void 0:st.user_name),D.createElement("span",null,(be==null?void 0:be.appeal_status)===1&&D.createElement("span",{className:`tag-style bg-orange ml10 ${Fe.tag}`},"\u7533\u8BC9\u4E2D"),(be==null?void 0:be.appeal_status)===2&&D.createElement("span",{className:`tag-style bg-grey-ede c-light-black ml10 ${Fe.tag}`},"\u7533\u8BC9\u5DF2\u64A4\u9500"),(be==null?void 0:be.appeal_status)===3&&D.createElement("span",{className:`tag-style ml10 ${Fe.tag}`,style:{background:"#57BE40"}},"\u7533\u8BC9\u6210\u529F"),(be==null?void 0:be.appeal_status)===4&&D.createElement("span",{className:`tag-style bg-grey-ede c-light-black ml10 ${Fe.tag}`},"\u7533\u8BC9\u88AB\u62D2\u7EDD"),(be==null?void 0:be.appeal_status)===5&&D.createElement("span",{className:`tag-style c-light-black ml10 ${Fe.tag}`,style:{background:"#E9EAED"}},"\u7533\u8BC9\u5931\u8D25"))),D.createElement("span",{className:"c-light-black"}," ",Ue()((Tt=be==null?void 0:be.appeal_info)==null?void 0:Tt.time).format("YYYY-MM-DD HH:mm:ss"))),D.createElement(ne.Z,{justify:"space-between",className:"mt10"},D.createElement(U.Z,{flex:1},(Jt=be.appeal_info)==null?void 0:Jt.content),D.createElement(U.Z,{style:{flexShrink:0,marginLeft:"auto"}},(be==null?void 0:be.appeal_status)===1&&(0,le.GJ)()&&D.createElement("span",{onClick:()=>{H.default.confirm({title:"\u63A5\u53D7\u7533\u8BC9",icon:null,content:"\u6B64\u533F\u8BC4\u8BB0\u5F55\u5C06\u4F5C\u5E9F\uFF0C\u533F\u8BC4\u5B66\u751F\u7684\u4F5C\u54C1\u5C06\u88AB\u6263\u51CF\u8FDD\u89C4\u533F\u8BC4\u5206 \u662F\u5426\u786E\u8BA4\u63A5\u53D7\u7533\u8BC9\uFF1F",onOk:()=>ot(void 0,null,function*(){const Kt=yield(0,_.ZP)(`/api/student_works/${Se.homeworkId}/deal_appeal_score.json`,{method:"post",body:{score_id:be.score_id,status:3}});(Kt==null?void 0:Kt.status)===0&&Q()})})},className:"c-red current"},"\u63A5\u53D7\u7533\u8BC9"),(be==null?void 0:be.appeal_status)===1&&(0,le.GJ)()&&D.createElement("span",{onClick:()=>{H.default.confirm({icon:null,title:"\u63A5\u53D7\u7533\u8BC9",content:"\u6B64\u533F\u8BC4\u8BB0\u5F55\u88AB\u8BA4\u4E3A\u5408\u7406\uFF0C\u662F\u5426\u786E\u8BA4\u62D2\u7EDD\u7533\u8BC9\uFF1F",onOk:()=>ot(void 0,null,function*(){const Kt=yield(0,_.ZP)(`/api/student_works/${Se.homeworkId}/deal_appeal_score.json`,{method:"post",body:{score_id:be.score_id,status:4}});(Kt==null?void 0:Kt.status)===0&&Q()})})},className:"c-light-black current ml10"},"\u62D2\u7EDD\u7533\u8BC9"))))))}}),dt=be=>{Mr(null),tr({type:"shixunHomeworks/setActionTabs",payload:{key:"",type:2}}),setTimeout(()=>{be==="next"?ye.history.push(`/classrooms/${Se.coursesId}/common_homework/${Se.categoryId}/${Ee==null?void 0:Ee.student_work_id}/comment?page=${vt.get("page")}`):ye.history.push(`/classrooms/${Se.coursesId}/common_homework/${Se.categoryId}/${Et==null?void 0:Et.student_work_id}/comment?page=${vt.get("page")}`)},200)},Ot=be=>{kr(""),be.target.value&&(console.log("\u8FDB\u6765",Oe),be.target.value=be.target.value>(Oe==null?void 0:Oe.repeat_setting_score)?Oe==null?void 0:Oe.repeat_setting_score:be.target.value,kr(be.target.value))},Dt=()=>ot(void 0,null,function*(){const be=yield(0,_.ZP)(`/api/student_works/${Oe==null?void 0:Oe.work_id}/update_repeat_score`,{method:"put",body:{score:wr}});yield tr({type:"shixunHomeworks/gethomeWorkReport",payload:qe({},Se)}),be.status===0&&o.ZP.info("\u64CD\u4F5C\u6210\u529F")});return console.log(!!(Oe!=null&&Oe.category),Oe==null?void 0:Oe.course_id,"homeWorkReport"),D.createElement("section",{className:"bg-fafafa",style:{position:"sticky",top:0}},D.createElement("div",{className:"edu-container mt10",style:{paddingBottom:100}},D.createElement(y.Z,{loading:jt,active:!0,avatar:{size:40},paragraph:{rows:5}},D.createElement("div",{className:"edu-container"},(Oe==null?void 0:Oe.course_id)&&D.createElement("section",{className:"animated fadeIn"},D.createElement("aside",{className:""},(Oe==null?void 0:Oe.category)&&D.createElement(C.Z,{separator:">"},D.createElement(C.Z.Item,null,D.createElement(ye.Link,{to:`/classrooms/${Oe==null?void 0:Oe.course_id}/common_homework`},Oe==null?void 0:Oe.course_name)),D.createElement(C.Z.Item,null,D.createElement(ye.Link,{to:`/classrooms/${Oe==null?void 0:Oe.course_id}/common_homework/${Oe!=null&&Oe.category.main?"":Oe==null?void 0:Oe.category.category_id}`},Oe==null?void 0:Oe.category.category_name)),D.createElement(C.Z.Item,null,D.createElement(ye.Link,{to:`/classrooms/${Oe==null?void 0:Oe.course_id}/common_homework/${Oe==null?void 0:Oe.homework_common_id}/detail`},"\u4F5C\u4E1A\u8BE6\u60C5")),D.createElement(C.Z.Item,null,Oe==null?void 0:Oe.username))),D.createElement("aside",{className:[Fe.title1,"mt20"].join(" ")},D.createElement(ne.Z,{align:"middle"},D.createElement(U.Z,{flex:1},D.createElement(ye.Link,{to:`/classrooms/${Oe==null?void 0:Oe.course_id}/common_homework/${Oe==null?void 0:Oe.homework_common_id}/detail?page=${vt.get("page")}`},D.createElement(K.Z,{className:"font16 c-black"})),D.createElement("strong",{style:{fontWeight:700},className:"font20 ml5"},Oe==null?void 0:Oe.shixun_name),D.createElement(xe.VV,{status:Oe==null?void 0:Oe.homework_status})),D.createElement(U.Z,{className:Fe.title1_right},!(Oe!=null&&Oe.is_anonymous)&&!!(Oe!=null&&Oe.work_status)&&D.createElement(B.ZP,null,D.createElement("span",{className:"iconfont icon-yijiandianping mr5"}),D.createElement(ye.Link,{className:"c-black",target:"_blank",to:`/tasks/${(Er=(ir=Oe==null?void 0:Oe.shixun_detail)==null?void 0:ir[0])==null?void 0:Er.myshixun_identifier}/jupyter${(0,le.GJ)()?"":`?homework_common_id=${se.categoryId}`}`},(0,le.GJ)()?"\u67E5\u770B\u5B66\u5458\u5B9E\u8BAD":"\u67E5\u770B\u5B9E\u8BAD")),(0,le.GJ)()&&!((zr=Oe==null?void 0:Oe.homework_status)!=null&&zr.includes("\u5DF2\u622A\u6B62"))&&D.createElement(B.ZP,{className:"ml10",onClick:()=>ot(void 0,null,function*(){yield tr({type:"shixunHomeworks/setActionTabs",payload:{key:"redoShixunModal",homework_common_id:se.categoryId,student_work_id:se.homeworkId}})})},D.createElement("span",{className:"iconfont icon-dahuizhongzuo3x mr5"}),"\u6253\u56DE\u91CD\u505A"),!(Oe!=null&&Oe.is_anonymous)&&D.createElement(B.ZP,{className:"ml10",onClick:()=>{var be;if((0,le.Rm)()&&!((be=yt.AssistantObject.normal)!=null&&be.can_download)){o.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}Rr("")},loading:Ir},D.createElement("span",{className:"iconfont icon-daochu mr5"}),"\u5BFC\u51FA\u5B9E\u8BAD\u62A5\u544A"),(0,le.GJ)()&&(an==null?void 0:an.length)>1&&D.createElement(B.ZP,{className:"ml10",onClick:()=>{var be;if((0,le.Rm)()&&!((be=yt.AssistantObject.normal)!=null&&be.can_download)){o.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}Rr("all")}},D.createElement("span",{className:"iconfont icon-daochu mr5"}),"\u5BFC\u51FA\u5168\u90E8\u5B66\u751F\u5B9E\u8BAD\u62A5\u544A"))))),D.createElement("aside",{className:"mt30 relative"})),D.createElement("aside",{className:"edu-container bg-white",ref:Ft},D.createElement("div",{id:"export-all",ref:rr},D.createElement("div",{id:"export-all-1"},D.createElement("div",{className:Fe.title},D.createElement("h1",null,"\u603B\u4F53\u8BC4\u4EF7"),D.createElement("div",null,!((Nt=Oe==null?void 0:Oe.homework_status)!=null&&Nt.includes("\u5DF2\u622A\u6B62")&&(0,le.dE)())&&((0,le.GJ)()||(Oe==null?void 0:Oe.is_anonymous))&&D.createElement(B.ZP,{className:"mr20",type:"primary",onClick:()=>{tr({type:"classroomList/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:Oe==null?void 0:Oe.user_id,data:qe({},Oe)}}})}},D.createElement(re.Z,null),Oe!=null&&Oe.has_shixun_work_comment?"\u66F4\u6539\u70B9\u8BC4":"\u70B9\u8BC4\u4F5C\u4E1A"))),D.createElement(T.Z,{style:{marginTop:0}}),D.createElement(ne.Z,{className:"pl30 pr30"},D.createElement(U.Z,null,D.createElement("img",{className:Fe.userPic,src:`${Ie.Z.IMG_SERVER}/images/${Oe==null?void 0:Oe.image_url}`,alt:Oe==null?void 0:Oe.username})),D.createElement(U.Z,{className:"pt20"},D.createElement("span",{className:"font16 ml40"},Oe==null?void 0:Oe.username),D.createElement(xe.Y,{status:Oe==null?void 0:Oe.work_status}),D.createElement("ul",{className:Fe.userInfo},D.createElement("li",null,"\u5B66\u53F7\uFF1A",(Oe==null?void 0:Oe.student_id)||"--"),((0,le.GJ)()||!(Oe!=null&&Oe.is_anonymous))&&D.createElement("li",null,"\u5206\u73ED\uFF1A",(Oe==null?void 0:Oe.group_name)||"--"),D.createElement("br",null)))),D.createElement("aside",{className:"pl30 pr30 mt30 mb10"},D.createElement(ee.default,{dataSource:Oe==null?void 0:Oe.stage_list,rowKey:be=>be==null?void 0:be.challenge_id,pagination:!1,columns:je})),((Oe==null?void 0:Oe.work_comment_hidden)||(Oe==null?void 0:Oe.work_comment))&&D.createElement("div",null,D.createElement(ne.Z,{align:"middle"},D.createElement(U.Z,{flex:1},D.createElement("h1",{className:Fe.title},"\u70B9\u8BC4\u5185\u5BB9")),D.createElement(U.Z,{className:"pr30"},(0,le.GJ)()&&D.createElement(B.ZP,{onClick:()=>ot(void 0,null,function*(){H.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:D.createElement(me.Z,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk(){return ot(this,null,function*(){(yield(0,m.gZ)({comment_id:Oe==null?void 0:Oe.comment_id,homeworkId:Se.homeworkId})).status===0&&(o.ZP.success("\u5220\u9664\u6210\u529F"),Q())})}})})},D.createElement(Ce.Z,null),"\u5220\u9664"))),(Oe==null?void 0:Oe.work_comment)&&D.createElement("aside",{className:"pl30 pr30",style:{marginTop:"-5px"}},D.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),D.createElement("br",null),D.createElement(R.Z,{value:Oe==null?void 0:Oe.work_comment,className:"font14"})),(Oe==null?void 0:Oe.work_comment_hidden)&&D.createElement("aside",{className:"pl30 pr30 mt15"},D.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),D.createElement("br",null),D.createElement(R.Z,{value:Oe==null?void 0:Oe.work_comment_hidden,className:"font14"}))),(Oe==null?void 0:Oe.comment_scores.length)>0&&D.createElement(D.Fragment,null,D.createElement("h1",{className:Fe.title},"\u8C03\u5206\u539F\u56E0"),D.createElement("aside",{className:"pl30 pr30",style:{marginTop:"4px"}},D.createElement(G.Z,{items:ct}))),((ur=Oe==null?void 0:Oe.shixun_detail[0])==null?void 0:ur.myshixun_identifier)&&D.createElement(D.Fragment,null,D.createElement("h1",{className:Fe.title,style:{marginTop:"-20px"}},"\u5B9E\u8BAD\u8BE6\u60C5"),D.createElement("aside",{className:"pl30 pr30"},D.createElement("div",{className:Fe.shixunWrp},D.createElement("h2",null,D.createElement("span",null,"\u8BC4\u6D4B\u4EE3\u7801",D.createElement("span",{className:"ml5 font12 c-grey-999"},"\u672A\u901A\u8FC7\u672C\u9898\uFF0C\u5C55\u793A\u6700\u540E\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\u8BE6\u60C5")),D.createElement("span",null,D.createElement(W.default,{style:{width:200},value:(ke=Oe==null?void 0:Oe.shixun_detail[0])==null?void 0:ke.path}," ",Oe==null?void 0:Oe.shixun_detail.map(be=>D.createElement(Option,{value:be.path},be.path))," "))),D.createElement(k.Z,{spinning:In},D.createElement("div",{style:{width:"100%",minHeight:"550px",padding:"16px"},dangerouslySetInnerHTML:{__html:Pr}})))))))),((0,le.GJ)()||(Oe==null?void 0:Oe.is_anonymous))&&D.createElement("aside",{className:`${Fe.footerBar} ${Ir?Fe.footerBarStatic:""}`},D.createElement("aside",{className:"edu-container"},D.createElement(ne.Z,{align:"middle"},D.createElement(U.Z,{flex:"1"},D.createElement(ye.Link,{className:Fe.exitComment,to:`/classrooms/${Se.coursesId}/common_homework/${Se.categoryId}/detail?page=${vt.get("page")}`},"\u8FD4\u56DE\u5217\u8868")),D.createElement(U.Z,{flex:"1",className:"tr"},D.createElement(B.ZP,{type:"default",disabled:Et==null?void 0:Et.last,onClick:()=>dt()},"\u4E0A\u4E00\u4E2A"),D.createElement(B.ZP,{type:"default",style:{marginLeft:"20px",marginRight:"20px"},disabled:Ee==null?void 0:Ee.last,onClick:()=>dt("next")},"\u4E0B\u4E00\u4E2A"),!((De=Oe==null?void 0:Oe.homework_status)!=null&&De.includes("\u5DF2\u622A\u6B62")&&(0,le.dE)())&&((0,le.GJ)()||(Oe==null?void 0:Oe.is_anonymous))&&D.createElement(B.ZP,{type:"primary",onClick:()=>ot(void 0,null,function*(){tr({type:"classroomList/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:Oe==null?void 0:Oe.user_id,data:qe({},Oe)}}})})},"\u70B9\u8BC4\u4F5C\u4E1A"))))))),D.createElement(At,{gethomeworkreport:Q,homeWorkReport:Oe}),D.createElement(bt,{gethomeworkreport:Q,homeWorkReport:Oe}),D.createElement(Ht.Z,{getData:Q}),D.createElement(H.default,{open:ii,width:860,centered:!0,onCancel:()=>{Hr(!1)},title:"\u8BA1\u65F6\u89C4\u5219\u8BF4\u660E",footer:null},D.createElement("div",{style:{color:"#333333",fontWeight:400}},D.createElement("span",{style:{fontWeight:500}},"1\u3001\u9875\u9762\u505C\u7559\u65F6\u957F"),D.createElement("br",null),D.createElement("span",null,"\u5B66\u751F\u8FDB\u5165\u5173\u5361\u7684\u7B54\u9898\u9875\u9762\u5F00\u59CB\u8BA1\u65F6\uFF0C\u76F4\u81F3\u5B66\u751F\u5173\u5361\u8BC4\u6D4B\u901A\u8FC7\uFF0C\u5219\u8BA1\u65F6\u7ED3\u675F\uFF1B"),D.createElement("br",null),D.createElement("span",null," \u5B66\u751F\u8FDB\u5165\u5173\u5361\u7684\u7B54\u9898\u9875\u9762\u5F00\u59CB\u8BA1\u65F6\uFF0C\u82E5\u5B66\u751F\u5173\u95ED/\u9000\u51FA\u7B54\u9898\u9875\u9762\uFF0C\u5219\u8BA1\u65F6\u6682\u505C\uFF0C\u518D\u6B21\u8FDB\u5165\u7B54\u9898\u9875\u9762\u65F6\u5F00\u59CB\u7D2F\u8BA1\u8BA1\u65F6\u76F4\u81F3\u8BC4\u6D4B\u901A\u8FC7\uFF0C\u5219\u8BA1\u65F6\u7ED3\u675F\uFF1B"),D.createElement("span",{style:{color:"#FA6400",display:"flex",height:34,alignItems:"center"}}," \u53EF\u80FD\u4F1A\u9020\u6210\u65F6\u957F\u8BC4\u4F30\u4E0E\u5B9E\u9645\u505A\u9898\u80FD\u529B\u4E0D\u7B26\u7684\u60C5\u51B5 "),D.createElement("span",null,"a\u3001\u5B66\u751F\u8FDB\u5165\u5173\u5361\u770B\u5B8C\u9898\u540E\uFF0C\u9000\u51FA\u7B54\u9898\u9875\u9762\u5B8C\u6210\u4EE3\u7801\u8BBE\u8BA1\uFF0C\u518D\u590D\u5236\u8FDB\u5E73\u53F0\u7B54\u9898\u9875\u9762\u8FDB\u884C\u8BC4\u6D4B\uFF0C\u65E0\u6CD5\u8BC4\u4F30\u5B66\u751F\u7684\u5B66\u4E60\u548C\u601D\u8003\u65F6\u95F4\u3002")),D.createElement("div",{style:{color:"#333333",marginTop:20,fontWeight:400}},D.createElement("span",{style:{fontWeight:500}},"2\u3001\u5173\u5361\u603B\u8017\u65F6"),D.createElement("br",null),D.createElement("span",{style:{}},"\u5B66\u751F\u7B2C\u4E00\u6B21\u8FDB\u5165\u5173\u5361\u7B54\u9898\u9875\u9762\u5F00\u59CB\u8BA1\u65F6\uFF0C\u76F4\u81F3\u8BE5\u5173\u5361\u8BC4\u6D4B\u901A\u8FC7\uFF0C\u5219\u8BA1\u65F6\u7ED3\u675F\u3002 "),D.createElement("br",null),D.createElement("span",null," \u53E6\uFF0C\u5373\u4F7F\u5173\u5361\u95EF\u5173\u8FC7\u7A0B\u4E2D\uFF0C\u5B66\u751F\u9000\u51FA/\u5173\u95ED\u7B54\u9898\u9875\u9762\uFF0C\u4E5F\u5C06\u6301\u7EED\u8BA1\u65F6\uFF0C\u76F4\u81F3\u8BE5\u5173\u5361\u901A\u8FC7\u3002"),D.createElement("span",{style:{color:"#FA6400",display:"flex",height:44,paddingTop:10}}," \u53EF\u80FD\u4F1A\u9020\u6210\u65F6\u957F\u8BC4\u4F30\u4E0E\u5B9E\u9645\u505A\u9898\u80FD\u529B\u4E0D\u7B26\u7684\u60C5\u51B5 "),D.createElement("span",null,"a\u3001\u5B66\u751F\u4ECE\u5176\u4ED6\u540C\u5B66\u5904\u770B\u5230\u9898\u76EE\u540E\uFF0C\u5B8C\u6210\u4EE3\u7801\u8BBE\u8BA1\uFF0C\u518D\u8FDB\u5165\u5173\u5361\u7B54\u9898\u9875\u9762\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EE3\u7801\u590D\u5236\u81F3\u5E73\u53F0\u8FDB\u884C\u8BC4\u6D4B\uFF1B"),D.createElement("br",null),D.createElement("span",null,"b\u3001\u5B66\u751F\u7B2C\u4E00\u6B21\u6253\u5F00\u5173\u5361\u540E\uFF0C\u56E0\u4E3A\u67D0\u79CD\u539F\u56E0\u79BB\u5F00\u9875\u9762\uFF0C\u65F6\u9694\u591A\u65E5\u624D\u518D\u6B21\u8FDB\u5165\u5E73\u53F0\u95EF\u5173\uFF0C\u5C31\u4F1A\u5BFC\u81F4\u5B66\u751F\u5173\u5361\u603B\u8017\u65F6\u8FC7\u957F\uFF1B")),D.createElement("div",{style:{color:"#333333",marginTop:20,fontWeight:400}},D.createElement("span",{style:{fontWeight:500}},"3\u3001\u4F5C\u4E1A\u901A\u5173\u65F6\u957F"),D.createElement("br",null),D.createElement("span",{style:{}},"\u4ECE\u8001\u5E08\u53D1\u5E03\u7684\u5B9E\u8BAD\u4F5C\u4E1A\u5F00\u59CB\u65F6\u95F4\uFF0C\u5F00\u59CB\u8BA1\u65F6\uFF0C\u76F4\u81F3\u5B66\u751F\u5B9E\u8BAD\u901A\u5173\uFF08\u5305\u62EC\u8FDF\u4EA4\u901A\u5173\uFF09\uFF0C\u7ED3\u675F\u8BA1\u65F6\u3002\u5982\u679C\u5B66\u751F\u672A\u901A\u5173\uFF0C\u5219\u8BE5\u751F\u7684\u95EF\u5173\u8017\u65F6\u4E3A\u8001\u5E08\u8BBE\u7F6E\u7684\u5B9E\u8BAD\u5F00\u59CB\u65F6\u95F4\u81F3\u5B9E\u8BAD\u622A\u6B62\u65F6\u95F4\uFF0C\u5982\u679C\u8001\u5E08\u5F00\u542F\u4E86\u8865\u4EA4\uFF0C\u5219\u8BE5\u751F\u7684\u95EF\u5173\u8017\u65F6\u4E3A\u5B9E\u8BAD\u5F00\u59CB\u65F6\u95F4\u81F3\u5B9E\u8BAD\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\u3002")),D.createElement("div",{style:{color:"#333333",marginTop:20,fontWeight:400}},D.createElement("span",{style:{fontWeight:500}},"\u89C4\u5219\u76EE\u7684"),D.createElement("br",null),D.createElement("span",{style:{}},"\u9F13\u52B1\u5B66\u751F\u5728\u5B9E\u8BAD\u4F5C\u4E1A\u53D1\u5E03\u7684\u7B2C\u4E00\u65F6\u95F4\uFF0C\u7ACB\u5373\u767B\u5F55\u5E73\u53F0\u5B8C\u6210\u5B9E\u8BAD\u4F5C\u4E1A\u7684\u901A\u5173\u3002"))),D.createElement(H.default,{open:ti,title:"\u5B9E\u8BAD\u603B\u8017\u65F6\u8BF4\u660E",centered:!0,footer:null,onCancel:()=>{Cn(!1)},width:600},D.createElement("div",{style:{fontWeight:400,color:"#333333"}},D.createElement("div",null,"1\u3001\u5F53\u8BA1\u65F6\u89C4\u5219\u4E3A\u201C",D.createElement("span",{style:{color:"#145DFF"}},"\u9875\u9762\u505C\u7559\u65F6\u957F"),"\u201D\u65F6\uFF0C\u5B9E\u8BAD\u603B\u8017\u65F6\u4E3A\u6240\u6709\u5173\u5361\u8017\u65F6\u76F8\u52A0\u4E4B\u548C\uFF1B"),D.createElement("div",{style:{margin:"20px 0px"}},"2\u3001\u5F53\u8BA1\u65F6\u89C4\u5219\u4E3A\u201C",D.createElement("span",{style:{color:"#145DFF"}},"\u5173\u5361\u603B\u8017\u65F6"),"\u201D\u65F6\uFF0C\u5B9E\u8BAD\u603B\u8017\u65F6\u4E3A\u6240\u6709\u5173\u5361\u8017\u65F6\u76F8\u52A0\u4E4B\u548C\uFF1B"),D.createElement("div",null,"3\u3001\u5F53\u8BA1\u65F6\u89C4\u5219\u4E3A\u201C",D.createElement("span",{style:{color:"#145DFF"}},"\u4F5C\u4E1A\u901A\u5173\u65F6\u957F"),"\u201D\u65F6\uFF0C\u5B9E\u8BAD\u603B\u8017\u65F6\u4E3A\u5B9E\u8BAD\u53D1\u5E03\u65F6\u95F4\u81F3\u5B9E\u8BAD\u901A\u5173\u65F6\u95F4\uFF0C\u5F53\u5B66\u751F\u672A\u901A\u5173\u65F6\uFF0C\u5B9E\u8BAD\u603B\u8017\u65F6\u4E3A\u5B9E\u8BAD\u53D1\u5E03\u65F6\u95F4\u81F3\u5B9E\u8BAD\u622A\u6B62\u65F6\u95F4\u3002"))))};var ut=(0,ye.connect)(({shixunHomeworks:gt,classroomList:Ye,loading:rt,globalSetting:yt,user:It})=>({shixunHomeworks:gt,classroomList:Ye,globalSetting:yt,loading:rt.effects,user:It}))(Bt)},82572:function(Sr,St,Z){"use strict";var z=Z(62957),we=Z(6767),Ue=Z(82093),ve=Z(76560),Y=Z(34055),_=Z(59301),ye=(o,ne,U)=>new Promise((B,y)=>{var C=G=>{try{ee(U.next(G))}catch(W){y(W)}},T=G=>{try{ee(U.throw(G))}catch(W){y(W)}},ee=G=>G.done?B(G.value):Promise.resolve(G.value).then(C,T);ee((U=U.apply(o,ne)).next())});const H=({shixunHomeworks:o,dispatch:ne,classroomList:U,getData:B})=>_.createElement(z.default,{centered:!0,title:"\u63D0\u793A",open:o.actionTabs.key==="redoShixunModal",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:()=>ye(void 0,null,function*(){var y;if((0,Y.Rm)()&&!((y=U.AssistantObject.normal)!=null&&y.can_redo)){we.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}(yield(0,Ue.ZP)(`/api/homework_commons/${o.actionTabs.homework_common_id}/batch_redo_modal.json`,{method:"post",body:{student_work_id:o.actionTabs.student_work_id}})).status===0&&(we.ZP.success("\u64CD\u4F5C\u6210\u529F"),ne({type:"shixunHomeworks/setActionTabs",payload:{}}),B())}),onCancel:()=>{ne({type:"shixunHomeworks/setActionTabs",payload:{}})}},_.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C",o.actionTabs.isshixun?"\u5B66\u751F\u5B9E\u8BAD":"\u5B66\u751F\u4F5C\u54C1\u63D0\u4EA4","\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),_.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"));St.Z=(0,ve.connect)(({shixunHomeworks:o,classroomList:ne})=>({shixunHomeworks:o,classroomList:ne}))(H)},71114:function(Sr,St,Z){"use strict";Z.d(St,{Z:function(){return Ke}});var z=Z(59301),we=Z(92310),Ue=Z.n(we),ve=Z(48755),Y=Z(83397),_=Z(36237),ye=Z(63356),H=Z(16931),o=Z(51636);const ne=ge=>{const{componentCls:Ze,calc:q}=ge;return{[Ze]:Object.assign(Object.assign({},(0,ye.Wf)(ge)),{margin:0,padding:0,listStyle:"none",[`${Ze}-item`]:{position:"relative",margin:0,paddingBottom:ge.itemPaddingBottom,fontSize:ge.fontSize,listStyle:"none","&-tail":{position:"absolute",insetBlockStart:ge.itemHeadSize,insetInlineStart:q(q(ge.itemHeadSize).sub(ge.tailWidth)).div(2).equal(),height:`calc(100% - ${(0,_.unit)(ge.itemHeadSize)})`,borderInlineStart:`${(0,_.unit)(ge.tailWidth)} ${ge.lineType} ${ge.tailColor}`},"&-pending":{[`${Ze}-item-head`]:{fontSize:ge.fontSizeSM,backgroundColor:"transparent"},[`${Ze}-item-tail`]:{display:"none"}},"&-head":{position:"absolute",width:ge.itemHeadSize,height:ge.itemHeadSize,backgroundColor:ge.dotBg,border:`${(0,_.unit)(ge.dotBorderWidth)} ${ge.lineType} transparent`,borderRadius:"50%","&-blue":{color:ge.colorPrimary,borderColor:ge.colorPrimary},"&-red":{color:ge.colorError,borderColor:ge.colorError},"&-green":{color:ge.colorSuccess,borderColor:ge.colorSuccess},"&-gray":{color:ge.colorTextDisabled,borderColor:ge.colorTextDisabled}},"&-head-custom":{position:"absolute",insetBlockStart:q(ge.itemHeadSize).div(2).equal(),insetInlineStart:q(ge.itemHeadSize).div(2).equal(),width:"auto",height:"auto",marginBlockStart:0,paddingBlock:ge.customHeadPaddingVertical,lineHeight:1,textAlign:"center",border:0,borderRadius:0,transform:"translate(-50%, -50%)"},"&-content":{position:"relative",insetBlockStart:q(q(ge.fontSize).mul(ge.lineHeight).sub(ge.fontSize)).mul(-1).add(ge.lineWidth).equal(),marginInlineStart:q(ge.margin).add(ge.itemHeadSize).equal(),marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0,wordBreak:"break-word"},"&-last":{[`> ${Ze}-item-tail`]:{display:"none"},[`> ${Ze}-item-content`]:{minHeight:q(ge.controlHeightLG).mul(1.2).equal()}}},[`&${Ze}-alternate,
&${Ze}-right,
&${Ze}-label`]:{[`${Ze}-item`]:{"&-tail, &-head, &-head-custom":{insetInlineStart:"50%"},"&-head":{marginInlineStart:q(ge.marginXXS).mul(-1).equal(),"&-custom":{marginInlineStart:q(ge.tailWidth).div(2).equal()}},"&-left":{[`${Ze}-item-content`]:{insetInlineStart:`calc(50% - ${(0,_.unit)(ge.marginXXS)})`,width:`calc(50% - ${(0,_.unit)(ge.marginSM)})`,textAlign:"start"}},"&-right":{[`${Ze}-item-content`]:{width:`calc(50% - ${(0,_.unit)(ge.marginSM)})`,margin:0,textAlign:"end"}}}},[`&${Ze}-right`]:{[`${Ze}-item-right`]:{[`${Ze}-item-tail,
${Ze}-item-head,
${Ze}-item-head-custom`]:{insetInlineStart:`calc(100% - ${(0,_.unit)(q(q(ge.itemHeadSize).add(ge.tailWidth)).div(2).equal())})`},[`${Ze}-item-content`]:{width:`calc(100% - ${(0,_.unit)(q(ge.itemHeadSize).add(ge.marginXS).equal())})`}}},[`&${Ze}-pending
${Ze}-item-last
${Ze}-item-tail`]:{display:"block",height:`calc(100% - ${(0,_.unit)(ge.margin)})`,borderInlineStart:`${(0,_.unit)(ge.tailWidth)} dotted ${ge.tailColor}`},[`&${Ze}-reverse
${Ze}-item-last
${Ze}-item-tail`]:{display:"none"},[`&${Ze}-reverse ${Ze}-item-pending`]:{[`${Ze}-item-tail`]:{insetBlockStart:ge.margin,display:"block",height:`calc(100% - ${(0,_.unit)(ge.margin)})`,borderInlineStart:`${(0,_.unit)(ge.tailWidth)} dotted ${ge.tailColor}`},[`${Ze}-item-content`]:{minHeight:q(ge.controlHeightLG).mul(1.2).equal()}},[`&${Ze}-label`]:{[`${Ze}-item-label`]:{position:"absolute",insetBlockStart:q(q(ge.fontSize).mul(ge.lineHeight).sub(ge.fontSize)).mul(-1).add(ge.tailWidth).equal(),width:`calc(50% - ${(0,_.unit)(ge.marginSM)})`,textAlign:"end"},[`${Ze}-item-right`]:{[`${Ze}-item-label`]:{insetInlineStart:`calc(50% + ${(0,_.unit)(ge.marginSM)})`,width:`calc(50% - ${(0,_.unit)(ge.marginSM)})`,textAlign:"start"}}},"&-rtl":{direction:"rtl",[`${Ze}-item-head-custom`]:{transform:"translate(50%, -50%)"}}})}},U=ge=>({tailColor:ge.colorSplit,tailWidth:ge.lineWidthBold,dotBorderWidth:ge.wireframe?ge.lineWidthBold:ge.lineWidth*3,dotBg:ge.colorBgContainer,itemPaddingBottom:ge.padding*1.25});var B=(0,H.I$)("Timeline",ge=>{const Ze=(0,o.mergeToken)(ge,{itemHeadSize:10,customHeadPaddingVertical:ge.paddingXXS,paddingInlineEnd:2});return[ne(Ze)]},U),y=function(ge,Ze){var q={};for(var L in ge)Object.prototype.hasOwnProperty.call(ge,L)&&Ze.indexOf(L)<0&&(q[L]=ge[L]);if(ge!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,L=Object.getOwnPropertySymbols(ge);j<L.length;j++)Ze.indexOf(L[j])<0&&Object.prototype.propertyIsEnumerable.call(ge,L[j])&&(q[L[j]]=ge[L[j]]);return q},T=ge=>{var{prefixCls:Ze,className:q,color:L="blue",dot:j,pending:X=!1,position:ue,label:ae,children:w}=ge,b=y(ge,["prefixCls","className","color","dot","pending","position","label","children"]);const{getPrefixCls:$}=z.useContext(ve.E_),fe=$("timeline",Ze),$e=Ue()(`${fe}-item`,{[`${fe}-item-pending`]:X},q),lt=/blue|red|green|gray/.test(L||"")?void 0:L,Rt=Ue()(`${fe}-item-head`,{[`${fe}-item-head-custom`]:!!j,[`${fe}-item-head-${L}`]:!lt});return z.createElement("li",Object.assign({},b,{className:$e}),ae&&z.createElement("div",{className:`${fe}-item-label`},ae),z.createElement("div",{className:`${fe}-item-tail`}),z.createElement("div",{className:Rt,style:{borderColor:lt,color:lt}},j),z.createElement("div",{className:`${fe}-item-content`},w))},ee=Z(15142),G=Z(58617),W=function(ge,Ze){var q={};for(var L in ge)Object.prototype.hasOwnProperty.call(ge,L)&&Ze.indexOf(L)<0&&(q[L]=ge[L]);if(ge!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,L=Object.getOwnPropertySymbols(ge);j<L.length;j++)Ze.indexOf(L[j])<0&&Object.prototype.propertyIsEnumerable.call(ge,L[j])&&(q[L[j]]=ge[L[j]]);return q},K=ge=>{var{prefixCls:Ze,className:q,pending:L=!1,children:j,items:X,rootClassName:ue,reverse:ae=!1,direction:w,hashId:b,pendingDot:$,mode:fe=""}=ge,$e=W(ge,["prefixCls","className","pending","children","items","rootClassName","reverse","direction","hashId","pendingDot","mode"]);const lt=(it,At)=>fe==="alternate"?it==="right"?`${Ze}-item-right`:it==="left"?`${Ze}-item-left`:At%2===0?`${Ze}-item-left`:`${Ze}-item-right`:fe==="left"?`${Ze}-item-left`:fe==="right"?`${Ze}-item-right`:it==="right"?`${Ze}-item-right`:"",Rt=(0,ee.Z)(X||[]),Ct=typeof L=="boolean"?null:L;L&&Rt.push({pending:!!L,dot:$||z.createElement(G.Z,null),children:Ct}),ae&&Rt.reverse();const Vt=Rt.length,Qt=`${Ze}-item-last`,bt=Rt.filter(it=>!!it).map((it,At)=>{var Ht;const Fe=At===Vt-2?Qt:"",R=At===Vt-1?Qt:"",{className:m}=it,F=W(it,["className"]);return z.createElement(T,Object.assign({},F,{className:Ue()([m,!ae&&L?Fe:R,lt((Ht=it==null?void 0:it.position)!==null&&Ht!==void 0?Ht:"",At)]),key:(it==null?void 0:it.key)||At}))}),He=Rt.some(it=>!!(it!=null&&it.label)),nt=Ue()(Ze,{[`${Ze}-pending`]:!!L,[`${Ze}-reverse`]:!!ae,[`${Ze}-${fe}`]:!!fe&&!He,[`${Ze}-label`]:He,[`${Ze}-rtl`]:w==="rtl"},q,ue,b);return z.createElement("ul",Object.assign({},$e,{className:nt}),bt)},re=Z(11592);function me(ge,Ze){return ge&&Array.isArray(ge)?ge:(0,re.Z)(Ze).map(q=>{var L,j;return Object.assign({children:(j=(L=q==null?void 0:q.props)===null||L===void 0?void 0:L.children)!==null&&j!==void 0?j:""},q.props)})}var Ce=me,Ie=function(ge,Ze){var q={};for(var L in ge)Object.prototype.hasOwnProperty.call(ge,L)&&Ze.indexOf(L)<0&&(q[L]=ge[L]);if(ge!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,L=Object.getOwnPropertySymbols(ge);j<L.length;j++)Ze.indexOf(L[j])<0&&Object.prototype.propertyIsEnumerable.call(ge,L[j])&&(q[L[j]]=ge[L[j]]);return q};const le=ge=>{const{getPrefixCls:Ze,direction:q,timeline:L}=z.useContext(ve.E_),{prefixCls:j,children:X,items:ue,className:ae,style:w}=ge,b=Ie(ge,["prefixCls","children","items","className","style"]),$=Ze("timeline",j),fe=(0,Y.Z)($),[$e,lt,Rt]=B($,fe),Ct=Ce(ue,X);return $e(z.createElement(K,Object.assign({},b,{className:Ue()(L==null?void 0:L.className,ae,Rt,fe),style:Object.assign(Object.assign({},L==null?void 0:L.style),w),prefixCls:$,direction:q,items:Ct,hashId:lt})))};le.Item=T;var xe=le,Ke=xe},86251:function(Sr,St){"use strict";St.byteLength=ye,St.toByteArray=o,St.fromByteArray=B;for(var Z=[],z=[],we=typeof Uint8Array!="undefined"?Uint8Array:Array,Ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ve=0,Y=Ue.length;ve<Y;++ve)Z[ve]=Ue[ve],z[Ue.charCodeAt(ve)]=ve;z[45]=62,z[95]=63;function _(y){var C=y.length;if(C%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var T=y.indexOf("=");T===-1&&(T=C);var ee=T===C?0:4-T%4;return[T,ee]}function ye(y){var C=_(y),T=C[0],ee=C[1];return(T+ee)*3/4-ee}function H(y,C,T){return(C+T)*3/4-T}function o(y){var C,T=_(y),ee=T[0],G=T[1],W=new we(H(y,ee,G)),k=0,K=G>0?ee-4:ee,re;for(re=0;re<K;re+=4)C=z[y.charCodeAt(re)]<<18|z[y.charCodeAt(re+1)]<<12|z[y.charCodeAt(re+2)]<<6|z[y.charCodeAt(re+3)],W[k++]=C>>16&255,W[k++]=C>>8&255,W[k++]=C&255;return G===2&&(C=z[y.charCodeAt(re)]<<2|z[y.charCodeAt(re+1)]>>4,W[k++]=C&255),G===1&&(C=z[y.charCodeAt(re)]<<10|z[y.charCodeAt(re+1)]<<4|z[y.charCodeAt(re+2)]>>2,W[k++]=C>>8&255,W[k++]=C&255),W}function ne(y){return Z[y>>18&63]+Z[y>>12&63]+Z[y>>6&63]+Z[y&63]}function U(y,C,T){for(var ee,G=[],W=C;W<T;W+=3)ee=(y[W]<<16&16711680)+(y[W+1]<<8&65280)+(y[W+2]&255),G.push(ne(ee));return G.join("")}function B(y){for(var C,T=y.length,ee=T%3,G=[],W=16383,k=0,K=T-ee;k<K;k+=W)G.push(U(y,k,k+W>K?K:k+W));return ee===1?(C=y[T-1],G.push(Z[C>>2]+Z[C<<4&63]+"==")):ee===2&&(C=(y[T-2]<<8)+y[T-1],G.push(Z[C>>10]+Z[C>>4&63]+Z[C<<2&63]+"=")),G.join("")}},19208:function(Sr,St,Z){"use strict";var z;var we=Z(86251),Ue=Z(67467),ve=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;St.lW=H,z=k,St.h2=50;var Y=2147483647;z=Y,H.TYPED_ARRAY_SUPPORT=_(),!H.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function _(){try{var R=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(R,m),R.foo()===42}catch(F){return!1}}Object.defineProperty(H.prototype,"parent",{enumerable:!0,get:function(){if(H.isBuffer(this))return this.buffer}}),Object.defineProperty(H.prototype,"offset",{enumerable:!0,get:function(){if(H.isBuffer(this))return this.byteOffset}});function ye(R){if(R>Y)throw new RangeError('The value "'+R+'" is invalid for option "size"');var m=new Uint8Array(R);return Object.setPrototypeOf(m,H.prototype),m}function H(R,m,F){if(typeof R=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(R)}return o(R,m,F)}H.poolSize=8192;function o(R,m,F){if(typeof R=="string")return y(R,m);if(ArrayBuffer.isView(R))return T(R);if(R==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R);if(At(R,ArrayBuffer)||R&&At(R.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(At(R,SharedArrayBuffer)||R&&At(R.buffer,SharedArrayBuffer)))return ee(R,m,F);if(typeof R=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var V=R.valueOf&&R.valueOf();if(V!=null&&V!==R)return H.from(V,m,F);var D=G(R);if(D)return D;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof R[Symbol.toPrimitive]=="function")return H.from(R[Symbol.toPrimitive]("string"),m,F);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R)}H.from=function(R,m,F){return o(R,m,F)},Object.setPrototypeOf(H.prototype,Uint8Array.prototype),Object.setPrototypeOf(H,Uint8Array);function ne(R){if(typeof R!="number")throw new TypeError('"size" argument must be of type number');if(R<0)throw new RangeError('The value "'+R+'" is invalid for option "size"')}function U(R,m,F){return ne(R),R<=0?ye(R):m!==void 0?typeof F=="string"?ye(R).fill(m,F):ye(R).fill(m):ye(R)}H.alloc=function(R,m,F){return U(R,m,F)};function B(R){return ne(R),ye(R<0?0:W(R)|0)}H.allocUnsafe=function(R){return B(R)},H.allocUnsafeSlow=function(R){return B(R)};function y(R,m){if((typeof m!="string"||m==="")&&(m="utf8"),!H.isEncoding(m))throw new TypeError("Unknown encoding: "+m);var F=K(R,m)|0,V=ye(F),D=V.write(R,m);return D!==F&&(V=V.slice(0,D)),V}function C(R){for(var m=R.length<0?0:W(R.length)|0,F=ye(m),V=0;V<m;V+=1)F[V]=R[V]&255;return F}function T(R){if(At(R,Uint8Array)){var m=new Uint8Array(R);return ee(m.buffer,m.byteOffset,m.byteLength)}return C(R)}function ee(R,m,F){if(m<0||R.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(R.byteLength<m+(F||0))throw new RangeError('"length" is outside of buffer bounds');var V;return m===void 0&&F===void 0?V=new Uint8Array(R):F===void 0?V=new Uint8Array(R,m):V=new Uint8Array(R,m,F),Object.setPrototypeOf(V,H.prototype),V}function G(R){if(H.isBuffer(R)){var m=W(R.length)|0,F=ye(m);return F.length===0||R.copy(F,0,0,m),F}if(R.length!==void 0)return typeof R.length!="number"||Ht(R.length)?ye(0):C(R);if(R.type==="Buffer"&&Array.isArray(R.data))return C(R.data)}function W(R){if(R>=Y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y.toString(16)+" bytes");return R|0}function k(R){return+R!=R&&(R=0),H.alloc(+R)}H.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==H.prototype},H.compare=function(m,F){if(At(m,Uint8Array)&&(m=H.from(m,m.offset,m.byteLength)),At(F,Uint8Array)&&(F=H.from(F,F.offset,F.byteLength)),!H.isBuffer(m)||!H.isBuffer(F))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===F)return 0;for(var V=m.length,D=F.length,N=0,Ae=Math.min(V,D);N<Ae;++N)if(m[N]!==F[N]){V=m[N],D=F[N];break}return V<D?-1:D<V?1:0},H.isEncoding=function(m){switch(String(m).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},H.concat=function(m,F){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return H.alloc(0);var V;if(F===void 0)for(F=0,V=0;V<m.length;++V)F+=m[V].length;var D=H.allocUnsafe(F),N=0;for(V=0;V<m.length;++V){var Ae=m[V];if(At(Ae,Uint8Array))N+Ae.length>D.length?H.from(Ae).copy(D,N):Uint8Array.prototype.set.call(D,Ae,N);else if(H.isBuffer(Ae))Ae.copy(D,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=Ae.length}return D};function K(R,m){if(H.isBuffer(R))return R.length;if(ArrayBuffer.isView(R)||At(R,ArrayBuffer))return R.byteLength;if(typeof R!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof R);var F=R.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&F===0)return 0;for(var D=!1;;)switch(m){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return Qt(R).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return nt(R).length;default:if(D)return V?-1:Qt(R).length;m=(""+m).toLowerCase(),D=!0}}H.byteLength=K;function re(R,m,F){var V=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0,m>>>=0,F<=m))return"";for(R||(R="utf8");;)switch(R){case"hex":return w(this,m,F);case"utf8":case"utf-8":return L(this,m,F);case"ascii":return ue(this,m,F);case"latin1":case"binary":return ae(this,m,F);case"base64":return q(this,m,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,m,F);default:if(V)throw new TypeError("Unknown encoding: "+R);R=(R+"").toLowerCase(),V=!0}}H.prototype._isBuffer=!0;function me(R,m,F){var V=R[m];R[m]=R[F],R[F]=V}H.prototype.swap16=function(){var m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var F=0;F<m;F+=2)me(this,F,F+1);return this},H.prototype.swap32=function(){var m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var F=0;F<m;F+=4)me(this,F,F+3),me(this,F+1,F+2);return this},H.prototype.swap64=function(){var m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var F=0;F<m;F+=8)me(this,F,F+7),me(this,F+1,F+6),me(this,F+2,F+5),me(this,F+3,F+4);return this},H.prototype.toString=function(){var m=this.length;return m===0?"":arguments.length===0?L(this,0,m):re.apply(this,arguments)},H.prototype.toLocaleString=H.prototype.toString,H.prototype.equals=function(m){if(!H.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:H.compare(this,m)===0},H.prototype.inspect=function(){var m="",F=St.h2;return m=this.toString("hex",0,F).replace(/(.{2})/g,"$1 ").trim(),this.length>F&&(m+=" ... "),"<Buffer "+m+">"},ve&&(H.prototype[ve]=H.prototype.inspect),H.prototype.compare=function(m,F,V,D,N){if(At(m,Uint8Array)&&(m=H.from(m,m.offset,m.byteLength)),!H.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(F===void 0&&(F=0),V===void 0&&(V=m?m.length:0),D===void 0&&(D=0),N===void 0&&(N=this.length),F<0||V>m.length||D<0||N>this.length)throw new RangeError("out of range index");if(D>=N&&F>=V)return 0;if(D>=N)return-1;if(F>=V)return 1;if(F>>>=0,V>>>=0,D>>>=0,N>>>=0,this===m)return 0;for(var Ae=N-D,Le=V-F,Me=Math.min(Ae,Le),Xe=this.slice(D,N),qe=m.slice(F,V),Pt=0;Pt<Me;++Pt)if(Xe[Pt]!==qe[Pt]){Ae=Xe[Pt],Le=qe[Pt];break}return Ae<Le?-1:Le<Ae?1:0};function Ce(R,m,F,V,D){if(R.length===0)return-1;if(typeof F=="string"?(V=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),F=+F,Ht(F)&&(F=D?0:R.length-1),F<0&&(F=R.length+F),F>=R.length){if(D)return-1;F=R.length-1}else if(F<0)if(D)F=0;else return-1;if(typeof m=="string"&&(m=H.from(m,V)),H.isBuffer(m))return m.length===0?-1:Ie(R,m,F,V,D);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?D?Uint8Array.prototype.indexOf.call(R,m,F):Uint8Array.prototype.lastIndexOf.call(R,m,F):Ie(R,[m],F,V,D);throw new TypeError("val must be string, number or Buffer")}function Ie(R,m,F,V,D){var N=1,Ae=R.length,Le=m.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(R.length<2||m.length<2)return-1;N=2,Ae/=2,Le/=2,F/=2}function Me(Bt,ut){return N===1?Bt[ut]:Bt.readUInt16BE(ut*N)}var Xe;if(D){var qe=-1;for(Xe=F;Xe<Ae;Xe++)if(Me(R,Xe)===Me(m,qe===-1?0:Xe-qe)){if(qe===-1&&(qe=Xe),Xe-qe+1===Le)return qe*N}else qe!==-1&&(Xe-=Xe-qe),qe=-1}else for(F+Le>Ae&&(F=Ae-Le),Xe=F;Xe>=0;Xe--){for(var Pt=!0,ot=0;ot<Le;ot++)if(Me(R,Xe+ot)!==Me(m,ot)){Pt=!1;break}if(Pt)return Xe}return-1}H.prototype.includes=function(m,F,V){return this.indexOf(m,F,V)!==-1},H.prototype.indexOf=function(m,F,V){return Ce(this,m,F,V,!0)},H.prototype.lastIndexOf=function(m,F,V){return Ce(this,m,F,V,!1)};function le(R,m,F,V){F=Number(F)||0;var D=R.length-F;V?(V=Number(V),V>D&&(V=D)):V=D;var N=m.length;V>N/2&&(V=N/2);for(var Ae=0;Ae<V;++Ae){var Le=parseInt(m.substr(Ae*2,2),16);if(Ht(Le))return Ae;R[F+Ae]=Le}return Ae}function xe(R,m,F,V){return it(Qt(m,R.length-F),R,F,V)}function Ke(R,m,F,V){return it(bt(m),R,F,V)}function ge(R,m,F,V){return it(nt(m),R,F,V)}function Ze(R,m,F,V){return it(He(m,R.length-F),R,F,V)}H.prototype.write=function(m,F,V,D){if(F===void 0)D="utf8",V=this.length,F=0;else if(V===void 0&&typeof F=="string")D=F,V=this.length,F=0;else if(isFinite(F))F=F>>>0,isFinite(V)?(V=V>>>0,D===void 0&&(D="utf8")):(D=V,V=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var N=this.length-F;if((V===void 0||V>N)&&(V=N),m.length>0&&(V<0||F<0)||F>this.length)throw new RangeError("Attempt to write outside buffer bounds");D||(D="utf8");for(var Ae=!1;;)switch(D){case"hex":return le(this,m,F,V);case"utf8":case"utf-8":return xe(this,m,F,V);case"ascii":case"latin1":case"binary":return Ke(this,m,F,V);case"base64":return ge(this,m,F,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,m,F,V);default:if(Ae)throw new TypeError("Unknown encoding: "+D);D=(""+D).toLowerCase(),Ae=!0}},H.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q(R,m,F){return m===0&&F===R.length?we.fromByteArray(R):we.fromByteArray(R.slice(m,F))}function L(R,m,F){F=Math.min(R.length,F);for(var V=[],D=m;D<F;){var N=R[D],Ae=null,Le=N>239?4:N>223?3:N>191?2:1;if(D+Le<=F){var Me,Xe,qe,Pt;switch(Le){case 1:N<128&&(Ae=N);break;case 2:Me=R[D+1],(Me&192)===128&&(Pt=(N&31)<<6|Me&63,Pt>127&&(Ae=Pt));break;case 3:Me=R[D+1],Xe=R[D+2],(Me&192)===128&&(Xe&192)===128&&(Pt=(N&15)<<12|(Me&63)<<6|Xe&63,Pt>2047&&(Pt<55296||Pt>57343)&&(Ae=Pt));break;case 4:Me=R[D+1],Xe=R[D+2],qe=R[D+3],(Me&192)===128&&(Xe&192)===128&&(qe&192)===128&&(Pt=(N&15)<<18|(Me&63)<<12|(Xe&63)<<6|qe&63,Pt>65535&&Pt<1114112&&(Ae=Pt))}}Ae===null?(Ae=65533,Le=1):Ae>65535&&(Ae-=65536,V.push(Ae>>>10&1023|55296),Ae=56320|Ae&1023),V.push(Ae),D+=Le}return X(V)}var j=4096;function X(R){var m=R.length;if(m<=j)return String.fromCharCode.apply(String,R);for(var F="",V=0;V<m;)F+=String.fromCharCode.apply(String,R.slice(V,V+=j));return F}function ue(R,m,F){var V="";F=Math.min(R.length,F);for(var D=m;D<F;++D)V+=String.fromCharCode(R[D]&127);return V}function ae(R,m,F){var V="";F=Math.min(R.length,F);for(var D=m;D<F;++D)V+=String.fromCharCode(R[D]);return V}function w(R,m,F){var V=R.length;(!m||m<0)&&(m=0),(!F||F<0||F>V)&&(F=V);for(var D="",N=m;N<F;++N)D+=Fe[R[N]];return D}function b(R,m,F){for(var V=R.slice(m,F),D="",N=0;N<V.length-1;N+=2)D+=String.fromCharCode(V[N]+V[N+1]*256);return D}H.prototype.slice=function(m,F){var V=this.length;m=~~m,F=F===void 0?V:~~F,m<0?(m+=V,m<0&&(m=0)):m>V&&(m=V),F<0?(F+=V,F<0&&(F=0)):F>V&&(F=V),F<m&&(F=m);var D=this.subarray(m,F);return Object.setPrototypeOf(D,H.prototype),D};function $(R,m,F){if(R%1!==0||R<0)throw new RangeError("offset is not uint");if(R+m>F)throw new RangeError("Trying to access beyond buffer length")}H.prototype.readUintLE=H.prototype.readUIntLE=function(m,F,V){m=m>>>0,F=F>>>0,V||$(m,F,this.length);for(var D=this[m],N=1,Ae=0;++Ae<F&&(N*=256);)D+=this[m+Ae]*N;return D},H.prototype.readUintBE=H.prototype.readUIntBE=function(m,F,V){m=m>>>0,F=F>>>0,V||$(m,F,this.length);for(var D=this[m+--F],N=1;F>0&&(N*=256);)D+=this[m+--F]*N;return D},H.prototype.readUint8=H.prototype.readUInt8=function(m,F){return m=m>>>0,F||$(m,1,this.length),this[m]},H.prototype.readUint16LE=H.prototype.readUInt16LE=function(m,F){return m=m>>>0,F||$(m,2,this.length),this[m]|this[m+1]<<8},H.prototype.readUint16BE=H.prototype.readUInt16BE=function(m,F){return m=m>>>0,F||$(m,2,this.length),this[m]<<8|this[m+1]},H.prototype.readUint32LE=H.prototype.readUInt32LE=function(m,F){return m=m>>>0,F||$(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},H.prototype.readUint32BE=H.prototype.readUInt32BE=function(m,F){return m=m>>>0,F||$(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},H.prototype.readIntLE=function(m,F,V){m=m>>>0,F=F>>>0,V||$(m,F,this.length);for(var D=this[m],N=1,Ae=0;++Ae<F&&(N*=256);)D+=this[m+Ae]*N;return N*=128,D>=N&&(D-=Math.pow(2,8*F)),D},H.prototype.readIntBE=function(m,F,V){m=m>>>0,F=F>>>0,V||$(m,F,this.length);for(var D=F,N=1,Ae=this[m+--D];D>0&&(N*=256);)Ae+=this[m+--D]*N;return N*=128,Ae>=N&&(Ae-=Math.pow(2,8*F)),Ae},H.prototype.readInt8=function(m,F){return m=m>>>0,F||$(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},H.prototype.readInt16LE=function(m,F){m=m>>>0,F||$(m,2,this.length);var V=this[m]|this[m+1]<<8;return V&32768?V|4294901760:V},H.prototype.readInt16BE=function(m,F){m=m>>>0,F||$(m,2,this.length);var V=this[m+1]|this[m]<<8;return V&32768?V|4294901760:V},H.prototype.readInt32LE=function(m,F){return m=m>>>0,F||$(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},H.prototype.readInt32BE=function(m,F){return m=m>>>0,F||$(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},H.prototype.readFloatLE=function(m,F){return m=m>>>0,F||$(m,4,this.length),Ue.read(this,m,!0,23,4)},H.prototype.readFloatBE=function(m,F){return m=m>>>0,F||$(m,4,this.length),Ue.read(this,m,!1,23,4)},H.prototype.readDoubleLE=function(m,F){return m=m>>>0,F||$(m,8,this.length),Ue.read(this,m,!0,52,8)},H.prototype.readDoubleBE=function(m,F){return m=m>>>0,F||$(m,8,this.length),Ue.read(this,m,!1,52,8)};function fe(R,m,F,V,D,N){if(!H.isBuffer(R))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>D||m<N)throw new RangeError('"value" argument is out of bounds');if(F+V>R.length)throw new RangeError("Index out of range")}H.prototype.writeUintLE=H.prototype.writeUIntLE=function(m,F,V,D){if(m=+m,F=F>>>0,V=V>>>0,!D){var N=Math.pow(2,8*V)-1;fe(this,m,F,V,N,0)}var Ae=1,Le=0;for(this[F]=m&255;++Le<V&&(Ae*=256);)this[F+Le]=m/Ae&255;return F+V},H.prototype.writeUintBE=H.prototype.writeUIntBE=function(m,F,V,D){if(m=+m,F=F>>>0,V=V>>>0,!D){var N=Math.pow(2,8*V)-1;fe(this,m,F,V,N,0)}var Ae=V-1,Le=1;for(this[F+Ae]=m&255;--Ae>=0&&(Le*=256);)this[F+Ae]=m/Le&255;return F+V},H.prototype.writeUint8=H.prototype.writeUInt8=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,1,255,0),this[F]=m&255,F+1},H.prototype.writeUint16LE=H.prototype.writeUInt16LE=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,2,65535,0),this[F]=m&255,this[F+1]=m>>>8,F+2},H.prototype.writeUint16BE=H.prototype.writeUInt16BE=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,2,65535,0),this[F]=m>>>8,this[F+1]=m&255,F+2},H.prototype.writeUint32LE=H.prototype.writeUInt32LE=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,4,4294967295,0),this[F+3]=m>>>24,this[F+2]=m>>>16,this[F+1]=m>>>8,this[F]=m&255,F+4},H.prototype.writeUint32BE=H.prototype.writeUInt32BE=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,4,4294967295,0),this[F]=m>>>24,this[F+1]=m>>>16,this[F+2]=m>>>8,this[F+3]=m&255,F+4},H.prototype.writeIntLE=function(m,F,V,D){if(m=+m,F=F>>>0,!D){var N=Math.pow(2,8*V-1);fe(this,m,F,V,N-1,-N)}var Ae=0,Le=1,Me=0;for(this[F]=m&255;++Ae<V&&(Le*=256);)m<0&&Me===0&&this[F+Ae-1]!==0&&(Me=1),this[F+Ae]=(m/Le>>0)-Me&255;return F+V},H.prototype.writeIntBE=function(m,F,V,D){if(m=+m,F=F>>>0,!D){var N=Math.pow(2,8*V-1);fe(this,m,F,V,N-1,-N)}var Ae=V-1,Le=1,Me=0;for(this[F+Ae]=m&255;--Ae>=0&&(Le*=256);)m<0&&Me===0&&this[F+Ae+1]!==0&&(Me=1),this[F+Ae]=(m/Le>>0)-Me&255;return F+V},H.prototype.writeInt8=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,1,127,-128),m<0&&(m=255+m+1),this[F]=m&255,F+1},H.prototype.writeInt16LE=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,2,32767,-32768),this[F]=m&255,this[F+1]=m>>>8,F+2},H.prototype.writeInt16BE=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,2,32767,-32768),this[F]=m>>>8,this[F+1]=m&255,F+2},H.prototype.writeInt32LE=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,4,2147483647,-2147483648),this[F]=m&255,this[F+1]=m>>>8,this[F+2]=m>>>16,this[F+3]=m>>>24,F+4},H.prototype.writeInt32BE=function(m,F,V){return m=+m,F=F>>>0,V||fe(this,m,F,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[F]=m>>>24,this[F+1]=m>>>16,this[F+2]=m>>>8,this[F+3]=m&255,F+4};function $e(R,m,F,V,D,N){if(F+V>R.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function lt(R,m,F,V,D){return m=+m,F=F>>>0,D||$e(R,m,F,4,34028234663852886e22,-34028234663852886e22),Ue.write(R,m,F,V,23,4),F+4}H.prototype.writeFloatLE=function(m,F,V){return lt(this,m,F,!0,V)},H.prototype.writeFloatBE=function(m,F,V){return lt(this,m,F,!1,V)};function Rt(R,m,F,V,D){return m=+m,F=F>>>0,D||$e(R,m,F,8,17976931348623157e292,-17976931348623157e292),Ue.write(R,m,F,V,52,8),F+8}H.prototype.writeDoubleLE=function(m,F,V){return Rt(this,m,F,!0,V)},H.prototype.writeDoubleBE=function(m,F,V){return Rt(this,m,F,!1,V)},H.prototype.copy=function(m,F,V,D){if(!H.isBuffer(m))throw new TypeError("argument should be a Buffer");if(V||(V=0),!D&&D!==0&&(D=this.length),F>=m.length&&(F=m.length),F||(F=0),D>0&&D<V&&(D=V),D===V||m.length===0||this.length===0)return 0;if(F<0)throw new RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw new RangeError("Index out of range");if(D<0)throw new RangeError("sourceEnd out of bounds");D>this.length&&(D=this.length),m.length-F<D-V&&(D=m.length-F+V);var N=D-V;return this===m&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(F,V,D):Uint8Array.prototype.set.call(m,this.subarray(V,D),F),N},H.prototype.fill=function(m,F,V,D){if(typeof m=="string"){if(typeof F=="string"?(D=F,F=0,V=this.length):typeof V=="string"&&(D=V,V=this.length),D!==void 0&&typeof D!="string")throw new TypeError("encoding must be a string");if(typeof D=="string"&&!H.isEncoding(D))throw new TypeError("Unknown encoding: "+D);if(m.length===1){var N=m.charCodeAt(0);(D==="utf8"&&N<128||D==="latin1")&&(m=N)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(F<0||this.length<F||this.length<V)throw new RangeError("Out of range index");if(V<=F)return this;F=F>>>0,V=V===void 0?this.length:V>>>0,m||(m=0);var Ae;if(typeof m=="number")for(Ae=F;Ae<V;++Ae)this[Ae]=m;else{var Le=H.isBuffer(m)?m:H.from(m,D),Me=Le.length;if(Me===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(Ae=0;Ae<V-F;++Ae)this[Ae+F]=Le[Ae%Me]}return this};var Ct=/[^+/0-9A-Za-z-_]/g;function Vt(R){if(R=R.split("=")[0],R=R.trim().replace(Ct,""),R.length<2)return"";for(;R.length%4!==0;)R=R+"=";return R}function Qt(R,m){m=m||1/0;for(var F,V=R.length,D=null,N=[],Ae=0;Ae<V;++Ae){if(F=R.charCodeAt(Ae),F>55295&&F<57344){if(!D){if(F>56319){(m-=3)>-1&&N.push(239,191,189);continue}else if(Ae+1===V){(m-=3)>-1&&N.push(239,191,189);continue}D=F;continue}if(F<56320){(m-=3)>-1&&N.push(239,191,189),D=F;continue}F=(D-55296<<10|F-56320)+65536}else D&&(m-=3)>-1&&N.push(239,191,189);if(D=null,F<128){if((m-=1)<0)break;N.push(F)}else if(F<2048){if((m-=2)<0)break;N.push(F>>6|192,F&63|128)}else if(F<65536){if((m-=3)<0)break;N.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((m-=4)<0)break;N.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw new Error("Invalid code point")}return N}function bt(R){for(var m=[],F=0;F<R.length;++F)m.push(R.charCodeAt(F)&255);return m}function He(R,m){for(var F,V,D,N=[],Ae=0;Ae<R.length&&!((m-=2)<0);++Ae)F=R.charCodeAt(Ae),V=F>>8,D=F%256,N.push(D),N.push(V);return N}function nt(R){return we.toByteArray(Vt(R))}function it(R,m,F,V){for(var D=0;D<V&&!(D+F>=m.length||D>=R.length);++D)m[D+F]=R[D];return D}function At(R,m){return R instanceof m||R!=null&&R.constructor!=null&&R.constructor.name!=null&&R.constructor.name===m.name}function Ht(R){return R!==R}var Fe=function(){for(var R="0123456789abcdef",m=new Array(256),F=0;F<16;++F)for(var V=F*16,D=0;D<16;++D)m[V+D]=R[F]+R[D];return m}()},64018:function(){var Sr,St,Z,z=!1,we,Ue;window.PR_SHOULD_USE_CONTINUATION=!0;var ve,Y;(function(){var _=window,ye=["break,continue,do,else,for,if,return,while"],H=[ye,"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"],o=[H,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],ne=[o,"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"],U=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],B=[o,"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"],y="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",C=[o,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],T="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",ee=[ye,"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"],G=[ye,"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"],W=[ye,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],k=[ne,B,U,C,T,ee,G,W],K=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,re="str",me="kwd",Ce="com",Ie="typ",le="lit",xe="pun",Ke="pln",ge="tag",Ze="dec",q="src",L="atn",j="atv",X="nocode",ue="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function ae(R){for(var m=0,F=!1,V=!1,D=0,N=R.length;D<N;++D){var Ae=R[D];if(Ae.ignoreCase)V=!0;else if(/[a-z]/i.test(Ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){F=!0,V=!1;break}}var Le={b:8,t:9,n:10,v:11,f:12,r:13};function Me(Bt){var ut=Bt.charCodeAt(0);if(ut!==92)return ut;var gt=Bt.charAt(1);return ut=Le[gt],ut||("0"<=gt&&gt<="7"?parseInt(Bt.substring(1),8):gt==="u"||gt==="x"?parseInt(Bt.substring(2),16):Bt.charCodeAt(1))}function Xe(Bt){if(Bt<32)return(Bt<16?"\\x0":"\\x")+Bt.toString(16);var ut=String.fromCharCode(Bt);return ut==="\\"||ut==="-"||ut==="]"||ut==="^"?"\\"+ut:ut}function qe(Bt){var ut=Bt.substring(1,Bt.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")),gt=[],Ye=ut[0]==="^",rt=["["];Ye&&rt.push("^");for(var yt=Ye?1:0,It=ut.length;yt<It;++yt){var zt=ut[yt];if(/\\[bdsw]/i.test(zt))rt.push(zt);else{var kt=Me(zt),tr;yt+2<It&&ut[yt+1]==="-"?(tr=Me(ut[yt+2]),yt+=2):tr=kt,gt.push([kt,tr]),tr<65||kt>122||(tr<65||kt>90||gt.push([Math.max(65,kt)|32,Math.min(tr,90)|32]),tr<97||kt>122||gt.push([Math.max(97,kt)&-33,Math.min(tr,122)&-33]))}}gt.sort(function(zr,Nt){return zr[0]-Nt[0]||Nt[1]-zr[1]});for(var Wt=[],ir=[],yt=0;yt<gt.length;++yt){var Er=gt[yt];Er[0]<=ir[1]+1?ir[1]=Math.max(ir[1],Er[1]):Wt.push(ir=Er)}for(var yt=0;yt<Wt.length;++yt){var Er=Wt[yt];rt.push(Xe(Er[0])),Er[1]>Er[0]&&(Er[1]+1>Er[0]&&rt.push("-"),rt.push(Xe(Er[1])))}return rt.push("]"),rt.join("")}function Pt(Bt){for(var ut=Bt.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")),gt=ut.length,Ye=[],rt=0,yt=0;rt<gt;++rt){var It=ut[rt];if(It==="(")++yt;else if(It.charAt(0)==="\\"){var zt=+It.substring(1);zt&&(zt<=yt?Ye[zt]=-1:ut[rt]=Xe(zt))}}for(var rt=1;rt<Ye.length;++rt)Ye[rt]===-1&&(Ye[rt]=++m);for(var rt=0,yt=0;rt<gt;++rt){var It=ut[rt];if(It==="(")++yt,Ye[yt]||(ut[rt]="(?:");else if(It.charAt(0)==="\\"){var zt=+It.substring(1);zt&&zt<=yt&&(ut[rt]="\\"+Ye[zt])}}for(var rt=0;rt<gt;++rt)ut[rt]==="^"&&ut[rt+1]!=="^"&&(ut[rt]="");if(Bt.ignoreCase&&F)for(var rt=0;rt<gt;++rt){var It=ut[rt],kt=It.charAt(0);It.length>=2&&kt==="["?ut[rt]=qe(It):kt!=="\\"&&(ut[rt]=It.replace(/[a-zA-Z]/g,function(ir){var Er=ir.charCodeAt(0);return"["+String.fromCharCode(Er&-33,Er|32)+"]"}))}return ut.join("")}for(var ot=[],D=0,N=R.length;D<N;++D){var Ae=R[D];if(Ae.global||Ae.multiline)throw new Error(""+Ae);ot.push("(?:"+Pt(Ae)+")")}return new RegExp(ot.join("|"),V?"gi":"g")}function w(R,m){var F=/(?:^|\s)nocode(?:\s|$)/,V=[],D=0,N=[],Ae=0;function Le(Me){var Xe=Me.nodeType;if(Xe==1){if(F.test(Me.className))return;for(var qe=Me.firstChild;qe;qe=qe.nextSibling)Le(qe);var Pt=Me.nodeName.toLowerCase();(Pt==="br"||Pt==="li")&&(V[Ae]=`
`,N[Ae<<1]=D++,N[Ae++<<1|1]=Me)}else if(Xe==3||Xe==4){var ot=Me.nodeValue;ot.length&&(m?ot=ot.replace(/\r\n?/g,`
`):ot=ot.replace(/[ \t\r\n]+/g," "),V[Ae]=ot,N[Ae<<1]=D,D+=ot.length,N[Ae++<<1|1]=Me)}}return Le(R),{sourceCode:V.join("").replace(/\n$/,""),spans:N}}function b(R,m,F,V,D){if(F){var N={sourceNode:R,pre:1,langExtension:null,numberLines:null,sourceCode:F,spans:null,basePos:m,decorations:null};V(N),D.push.apply(D,N.decorations)}}var $=/\S/;function fe(R){for(var m=void 0,F=R.firstChild;F;F=F.nextSibling){var V=F.nodeType;m=V===1?m?R:F:V===3&&$.test(F.nodeValue)?R:m}return m===R?void 0:m}function $e(R,m){var F={},V;(function(){for(var Ae=R.concat(m),Le=[],Me={},Xe=0,qe=Ae.length;Xe<qe;++Xe){var Pt=Ae[Xe],ot=Pt[3];if(ot)for(var Bt=ot.length;--Bt>=0;)F[ot.charAt(Bt)]=Pt;var ut=Pt[1],gt=""+ut;Me.hasOwnProperty(gt)||(Le.push(ut),Me[gt]=null)}Le.push(/[\0-\uffff]/),V=ae(Le)})();var D=m.length,N=function(Ae){for(var Le=Ae.sourceCode,Me=Ae.basePos,Xe=Ae.sourceNode,qe=[Me,Ke],Pt=0,ot=Le.match(V)||[],Bt={},ut=0,gt=ot.length;ut<gt;++ut){var Ye=ot[ut],rt=Bt[Ye],yt=void 0,It;if(typeof rt=="string")It=!1;else{var zt=F[Ye.charAt(0)];if(zt)yt=Ye.match(zt[1]),rt=zt[0];else{for(var kt=0;kt<D;++kt)if(zt=m[kt],yt=Ye.match(zt[1]),yt){rt=zt[0];break}yt||(rt=Ke)}It=rt.length>=5&&rt.substring(0,5)==="lang-",It&&!(yt&&typeof yt[1]=="string")&&(It=!1,rt=q),It||(Bt[Ye]=rt)}var tr=Pt;if(Pt+=Ye.length,!It)qe.push(Me+tr,rt);else{var Wt=yt[1],ir=Ye.indexOf(Wt),Er=ir+Wt.length;yt[2]&&(Er=Ye.length-yt[2].length,ir=Er-Wt.length);var zr=rt.substring(5);b(Xe,Me+tr,Ye.substring(0,ir),N,qe),b(Xe,Me+tr+ir,Wt,He(zr,Wt),qe),b(Xe,Me+tr+Er,Ye.substring(Er),N,qe)}}Ae.decorations=qe};return N}function lt(R){var m=[],F=[];R.tripleQuotedStrings?m.push([re,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):R.multiLineStrings?m.push([re,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):m.push([re,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),R.verbatimStrings&&F.push([re,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var V=R.hashComments;V&&(R.cStyleComments?(V>1?m.push([Ce,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):m.push([Ce,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),F.push([re,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):m.push([Ce,/^#[^\r\n]*/,null,"#"])),R.cStyleComments&&(F.push([Ce,/^\/\/[^\r\n]*/,null]),F.push([Ce,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var D=R.regexLiterals;if(D){var N=D>1?"":`
\r`,Ae=N?".":"[\\S\\s]",Le="/(?=[^/*"+N+"])(?:[^/\\x5B\\x5C"+N+"]|\\x5C"+Ae+"|\\x5B(?:[^\\x5C\\x5D"+N+"]|\\x5C"+Ae+")*(?:\\x5D|$))+/";F.push(["lang-regex",RegExp("^"+ue+"("+Le+")")])}var Me=R.types;Me&&F.push([Ie,Me]);var Xe=(""+R.keywords).replace(/^ | $/g,"");Xe.length&&F.push([me,new RegExp("^(?:"+Xe.replace(/[\s,]+/g,"|")+")\\b"),null]),m.push([Ke,/^\s+/,null,` \r
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return R.regexLiterals&&(qe+="(?!s*/)"),F.push([le,/^@[a-z_$][a-z_$@0-9]*/i,null],[Ie,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[Ke,/^[a-z_$][a-z_$@0-9]*/i,null],[le,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[Ke,/^\\[\s\S]?/,null],[xe,new RegExp(qe),null]),$e(m,F)}var Rt=lt({keywords:k,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ct(R,m,F){for(var V=/(?:^|\s)nocode(?:\s|$)/,D=/\r\n?|\n/,N=R.ownerDocument,Ae=N.createElement("li");R.firstChild;)Ae.appendChild(R.firstChild);var Le=[Ae];function Me(ut){var gt=ut.nodeType;if(gt==1&&!V.test(ut.className))if(ut.nodeName==="br")Xe(ut),ut.parentNode&&ut.parentNode.removeChild(ut);else for(var Ye=ut.firstChild;Ye;Ye=Ye.nextSibling)Me(Ye);else if((gt==3||gt==4)&&F){var rt=ut.nodeValue,yt=rt.match(D);if(yt){var It=rt.substring(0,yt.index);ut.nodeValue=It;var zt=rt.substring(yt.index+yt[0].length);if(zt){var kt=ut.parentNode;kt.insertBefore(N.createTextNode(zt),ut.nextSibling)}Xe(ut),It||ut.parentNode.removeChild(ut)}}}function Xe(ut){for(;!ut.nextSibling;)if(ut=ut.parentNode,!ut)return;function gt(yt,It){var zt=It?yt.cloneNode(!1):yt,kt=yt.parentNode;if(kt){var tr=gt(kt,1),Wt=yt.nextSibling;tr.appendChild(zt);for(var ir=Wt;ir;ir=Wt)Wt=ir.nextSibling,tr.appendChild(ir)}return zt}for(var Ye=gt(ut.nextSibling,0),rt;(rt=Ye.parentNode)&&rt.nodeType===1;)Ye=rt;Le.push(Ye)}for(var qe=0;qe<Le.length;++qe)Me(Le[qe]);m===(m|0)&&Le[0].setAttribute("value",m);var Pt=N.createElement("ol");Pt.className="linenums";for(var ot=Math.max(0,m-1|0)||0,qe=0,Bt=Le.length;qe<Bt;++qe)Ae=Le[qe],Ae.className="L"+(qe+ot)%10,Ae.firstChild||Ae.appendChild(N.createTextNode("\xA0")),Pt.appendChild(Ae);R.appendChild(Pt)}function Vt(R){var m=/\bMSIE\s(\d+)/.exec(navigator.userAgent);m=m&&+m[1]<=8;var F=/\n/g,V=R.sourceCode,D=V.length,N=0,Ae=R.spans,Le=Ae.length,Me=0,Xe=R.decorations,qe=Xe.length,Pt=0;Xe[qe]=D;var ot,Bt;for(Bt=ot=0;Bt<qe;)Xe[Bt]!==Xe[Bt+2]?(Xe[ot++]=Xe[Bt++],Xe[ot++]=Xe[Bt++]):Bt+=2;for(qe=ot,Bt=ot=0;Bt<qe;){for(var ut=Xe[Bt],gt=Xe[Bt+1],Ye=Bt+2;Ye+2<=qe&&Xe[Ye+1]===gt;)Ye+=2;Xe[ot++]=ut,Xe[ot++]=gt,Bt=Ye}qe=Xe.length=ot;var rt=R.sourceNode,yt="";rt&&(yt=rt.style.display,rt.style.display="none");try{for(var It=null;Me<Le;){var zt=Ae[Me],kt=Ae[Me+2]||D,tr=Xe[Pt+2]||D,Ye=Math.min(kt,tr),Wt=Ae[Me+1],ir;if(Wt.nodeType!==1&&(ir=V.substring(N,Ye))){m&&(ir=ir.replace(F,"\r")),Wt.nodeValue=ir;var Er=Wt.ownerDocument,zr=Er.createElement("span");zr.className=Xe[Pt+1];var Nt=Wt.parentNode;Nt.replaceChild(zr,Wt),zr.appendChild(Wt),N<kt&&(Ae[Me+1]=Wt=Er.createTextNode(V.substring(Ye,kt)),Nt.insertBefore(Wt,zr.nextSibling))}N=Ye,N>=kt&&(Me+=2),N>=tr&&(Pt+=2)}}finally{rt&&(rt.style.display=yt)}}var Qt={};function bt(R,m){for(var F=m.length;--F>=0;){var V=m[F];Qt.hasOwnProperty(V)?_.console&&console.warn("cannot override language handler %s",V):Qt[V]=R}}function He(R,m){return R&&Qt.hasOwnProperty(R)||(R=/^\s*</.test(m)?"default-markup":"default-code"),Qt[R]}bt(Rt,["default-code"]),bt($e([],[[Ke,/^[^<?]+/],[Ze,/^<!\w[^>]*(?:>|$)/],[Ce,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[xe,/^(?:<[%?]|[%?]>)/],["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"]),bt($e([[Ke,/^[\s]+/,null,` \r
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ge,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[L,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[xe,/^[=<>\/]+/],["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"]),bt($e([],[[j,/^[\s\S]+/]]),["uq.val"]),bt(lt({keywords:ne,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]),bt(lt({keywords:"null,true,false"}),["json"]),bt(lt({keywords:B,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]),bt(lt({keywords:U,cStyleComments:!0}),["java"]),bt(lt({keywords:W,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),bt(lt({keywords:ee,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),bt(lt({keywords:T,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),bt(lt({keywords:G,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),bt(lt({keywords:C,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),bt(lt({keywords:y,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),bt($e([],[[re,/^[\s\S]+/]]),["regex"]);function nt(R){var m=R.langExtension;try{var F=w(R.sourceNode,R.pre),V=F.sourceCode;R.sourceCode=V,R.spans=F.spans,R.basePos=0,He(m,V)(R),Vt(R)}catch(D){_.console&&console.log(D&&D.stack||D)}}function it(R,m,F){var V=F||!1,D=m||null,N=document.createElement("div");N.innerHTML="<pre>"+R+"</pre>",N=N.firstChild,V&&Ct(N,V,!0);var Ae={langExtension:D,numberLines:V,sourceNode:N,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return nt(Ae),N.innerHTML}function At(R,m){var F=m||document.body,V=F.ownerDocument||document;function D(zt){return F.getElementsByTagName(zt)}for(var N=[D("pre"),D("code"),D("xmp")],Ae=[],Le=0;Le<N.length;++Le)for(var Me=0,Xe=N[Le].length;Me<Xe;++Me)Ae.push(N[Le][Me]);N=null;var qe=Date;qe.now||(qe={now:function(){return+new Date}});var Pt=0,ot=/\blang(?:uage)?-([\w.]+)(?!\S)/,Bt=/\bprettyprint\b/,ut=/\bprettyprinted\b/,gt=/pre|xmp/i,Ye=/^code$/i,rt=/^(?:pre|code|xmp)$/i,yt={};function It(){for(var zt=_.PR_SHOULD_USE_CONTINUATION?qe.now()+250:1/0;Pt<Ae.length&&qe.now()<zt;Pt++){for(var kt=Ae[Pt],tr=yt,Wt=kt;Wt=Wt.previousSibling;){var ir=Wt.nodeType,Er=(ir===7||ir===8)&&Wt.nodeValue;if(Er?!/^\??prettify\b/.test(Er):ir!==3||/\S/.test(Wt.nodeValue))break;if(Er){tr={},Er.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ut,Ft,rr){tr[Ft]=rr});break}}var zr=kt.className;if((tr!==yt||Bt.test(zr))&&!ut.test(zr)){for(var Nt=!1,ur=kt.parentNode;ur;ur=ur.parentNode){var ke=ur.tagName;if(rt.test(ke)&&ur.className&&Bt.test(ur.className)){Nt=!0;break}}if(!Nt){kt.className+=" prettyprinted";var De=tr.lang;if(!De){De=zr.match(ot);var Se;!De&&(Se=fe(kt))&&Ye.test(Se.tagName)&&(De=Se.className.match(ot)),De&&(De=De[1])}var te;if(gt.test(kt.tagName))te=1;else{var se=kt.currentStyle,ce=V.defaultView,Ee=se?se.whiteSpace:ce&&ce.getComputedStyle?ce.getComputedStyle(kt,null).getPropertyValue("white-space"):0;te=Ee&&Ee.substring(0,3)==="pre"}var Te=tr.linenums;(Te=Te==="true"||+Te)||(Te=zr.match(/\blinenums\b(?::(\d+))?/),Te=Te?Te[1]&&Te[1].length?+Te[1]:!0:!1),Te&&Ct(kt,Te,te);var Et={langExtension:De,sourceNode:kt,numberLines:Te,pre:te,sourceCode:null,basePos:null,spans:null,decorations:null};nt(Et)}}}Pt<Ae.length?_.setTimeout(It,250):typeof R=="function"&&R()}It()}var Ht=_.PR={createSimpleLexer:$e,registerLangHandler:bt,sourceDecorator:lt,PR_ATTRIB_NAME:L,PR_ATTRIB_VALUE:j,PR_COMMENT:Ce,PR_DECLARATION:Ze,PR_KEYWORD:me,PR_LITERAL:le,PR_NOCODE:X,PR_PLAIN:Ke,PR_PUNCTUATION:xe,PR_SOURCE:q,PR_STRING:re,PR_TAG:ge,PR_TYPE:Ie,prettyPrintOne:z?_.prettyPrintOne=it:ve=it,prettyPrint:Y=z?_.prettyPrint=At:Y=At},Fe=_.define;typeof Fe=="function"&&Fe.amd&&Fe("google-code-prettify",[],function(){return Ht})})()},25769:function(Sr,St,Z){"use strict";var z=Z(98040),we={"text/plain":"Text","text/html":"Url",default:"Text"},Ue="Copy to clipboard: #{key}, Enter";function ve(_){var ye=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return _.replace(/#{\s*key\s*}/g,ye)}function Y(_,ye){var H,o,ne,U,B,y,C=!1;ye||(ye={}),H=ye.debug||!1;try{ne=z(),U=document.createRange(),B=document.getSelection(),y=document.createElement("span"),y.textContent=_,y.ariaHidden="true",y.style.all="unset",y.style.position="fixed",y.style.top=0,y.style.clip="rect(0, 0, 0, 0)",y.style.whiteSpace="pre",y.style.webkitUserSelect="text",y.style.MozUserSelect="text",y.style.msUserSelect="text",y.style.userSelect="text",y.addEventListener("copy",function(ee){if(ee.stopPropagation(),ye.format)if(ee.preventDefault(),typeof ee.clipboardData=="undefined"){H&&console.warn("unable to use e.clipboardData"),H&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var G=we[ye.format]||we.default;window.clipboardData.setData(G,_)}else ee.clipboardData.clearData(),ee.clipboardData.setData(ye.format,_);ye.onCopy&&(ee.preventDefault(),ye.onCopy(ee.clipboardData))}),document.body.appendChild(y),U.selectNodeContents(y),B.addRange(U);var T=document.execCommand("copy");if(!T)throw new Error("copy command was unsuccessful");C=!0}catch(ee){H&&console.error("unable to copy using execCommand: ",ee),H&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(ye.format||"text",_),ye.onCopy&&ye.onCopy(window.clipboardData),C=!0}catch(G){H&&console.error("unable to copy using clipboardData: ",G),H&&console.error("falling back to prompt"),o=ve("message"in ye?ye.message:Ue),window.prompt(o,_)}}finally{B&&(typeof B.removeRange=="function"?B.removeRange(U):B.removeAllRanges()),y&&document.body.removeChild(y),ne()}return C}Sr.exports=Y},6330:function(Sr,St,Z){"use strict";Z.d(St,{HT:function(){return Oe},iZ:function(){return jt}});var z={},we=function(Q,P,oe,pe,Re){var je=new Worker(z[P]||(z[P]=URL.createObjectURL(new Blob([Q+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return je.onmessage=function(ct){var dt=ct.data,Ot=dt.$e$;if(Ot){var Dt=new Error(Ot[0]);Dt.code=Ot[1],Dt.stack=Ot[2],Re(Dt,null)}else Re(null,dt)},je.postMessage(oe,pe),je},Ue=Uint8Array,ve=Uint16Array,Y=Int32Array,_=new Ue([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ye=new Ue([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),H=new Ue([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(Q,P){for(var oe=new ve(31),pe=0;pe<31;++pe)oe[pe]=P+=1<<Q[pe-1];for(var Re=new Y(oe[30]),pe=1;pe<30;++pe)for(var je=oe[pe];je<oe[pe+1];++je)Re[je]=je-oe[pe]<<5|pe;return{b:oe,r:Re}},ne=o(_,2),U=ne.b,B=ne.r;U[28]=258,B[258]=28;for(var y=o(ye,0),C=y.b,T=y.r,ee=new ve(32768),G=0;G<32768;++G){var W=(G&43690)>>1|(G&21845)<<1;W=(W&52428)>>2|(W&13107)<<2,W=(W&61680)>>4|(W&3855)<<4,ee[G]=((W&65280)>>8|(W&255)<<8)>>1}for(var k=function(Q,P,oe){for(var pe=Q.length,Re=0,je=new ve(P);Re<pe;++Re)Q[Re]&&++je[Q[Re]-1];var ct=new ve(P);for(Re=1;Re<P;++Re)ct[Re]=ct[Re-1]+je[Re-1]<<1;var dt;if(oe){dt=new ve(1<<P);var Ot=15-P;for(Re=0;Re<pe;++Re)if(Q[Re])for(var Dt=Re<<4|Q[Re],be=P-Q[Re],st=ct[Q[Re]-1]++<<be,Tt=st|(1<<be)-1;st<=Tt;++st)dt[ee[st]>>Ot]=Dt}else for(dt=new ve(pe),Re=0;Re<pe;++Re)Q[Re]&&(dt[Re]=ee[ct[Q[Re]-1]++]>>15-Q[Re]);return dt},K=new Ue(288),G=0;G<144;++G)K[G]=8;for(var G=144;G<256;++G)K[G]=9;for(var G=256;G<280;++G)K[G]=7;for(var G=280;G<288;++G)K[G]=8;for(var re=new Ue(32),G=0;G<32;++G)re[G]=5;var me=k(K,9,0),Ce=k(K,9,1),Ie=k(re,5,0),le=k(re,5,1),xe=function(Q){for(var P=Q[0],oe=1;oe<Q.length;++oe)Q[oe]>P&&(P=Q[oe]);return P},Ke=function(Q,P,oe){var pe=P/8|0;return(Q[pe]|Q[pe+1]<<8)>>(P&7)&oe},ge=function(Q,P){var oe=P/8|0;return(Q[oe]|Q[oe+1]<<8|Q[oe+2]<<16)>>(P&7)},Ze=function(Q){return(Q+7)/8|0},q=function(Q,P,oe){return(P==null||P<0)&&(P=0),(oe==null||oe>Q.length)&&(oe=Q.length),new Ue(Q.subarray(P,oe))},L={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},j=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],X=function(Q,P,oe){var pe=new Error(P||j[Q]);if(pe.code=Q,Error.captureStackTrace&&Error.captureStackTrace(pe,X),!oe)throw pe;return pe},ue=function(Q,P,oe,pe){var Re=Q.length,je=pe?pe.length:0;if(!Re||P.f&&!P.l)return oe||new Ue(0);var ct=!oe,dt=ct||P.i!=2,Ot=P.i;ct&&(oe=new Ue(Re*3));var Dt=function(li){var Zn=oe.length;if(li>Zn){var ui=new Ue(Math.max(Zn*2,li));ui.set(oe),oe=ui}},be=P.f||0,st=P.p||0,Tt=P.b||0,Jt=P.l,Kt=P.d,$t=P.m,Zt=P.n,nr=Re*8;do{if(!Jt){be=Ke(Q,st,1);var xr=Ke(Q,st+1,3);if(st+=3,xr)if(xr==1)Jt=Ce,Kt=le,$t=9,Zt=5;else if(xr==2){var Lr=Ke(Q,st,31)+257,Gr=Ke(Q,st+10,15)+4,Tr=Lr+Ke(Q,st+5,31)+1;st+=14;for(var Br=new Ue(Tr),Yr=new Ue(19),Qr=0;Qr<Gr;++Qr)Yr[H[Qr]]=Ke(Q,st+Qr*3,7);st+=Gr*3;for(var Xr=xe(Yr),ln=(1<<Xr)-1,_n=k(Yr,Xr,1),Qr=0;Qr<Tr;){var un=_n[Ke(Q,st,ln)];st+=un&15;var or=un>>4;if(or<16)Br[Qr++]=or;else{var jr=0,Vr=0;for(or==16?(Vr=3+Ke(Q,st,3),st+=2,jr=Br[Qr-1]):or==17?(Vr=3+Ke(Q,st,7),st+=3):or==18&&(Vr=11+Ke(Q,st,127),st+=7);Vr--;)Br[Qr++]=jr}}var sn=Br.subarray(0,Lr),rn=Br.subarray(Lr);$t=xe(sn),Zt=xe(rn),Jt=k(sn,$t,1),Kt=k(rn,Zt,1)}else X(1);else{var or=Ze(st)+4,er=Q[or-4]|Q[or-3]<<8,Ur=or+er;if(Ur>Re){Ot&&X(0);break}dt&&Dt(Tt+er),oe.set(Q.subarray(or,Ur),Tt),P.b=Tt+=er,P.p=st=Ur*8,P.f=be;continue}if(st>nr){Ot&&X(0);break}}dt&&Dt(Tt+131072);for(var Vn=(1<<$t)-1,sr=(1<<Zt)-1,pn=st;;pn=st){var jr=Jt[ge(Q,st)&Vn],bn=jr>>4;if(st+=jr&15,st>nr){Ot&&X(0);break}if(jr||X(2),bn<256)oe[Tt++]=bn;else if(bn==256){pn=st,Jt=null;break}else{var Sn=bn-254;if(bn>264){var Qr=bn-257,vn=_[Qr];Sn=Ke(Q,st,(1<<vn)-1)+U[Qr],st+=vn}var Wn=Kt[ge(Q,st)&sr],si=Wn>>4;Wn||X(3),st+=Wn&15;var rn=C[si];if(si>3){var vn=ye[si];rn+=ge(Q,st)&(1<<vn)-1,st+=vn}if(st>nr){Ot&&X(0);break}dt&&Dt(Tt+131072);var ri=Tt+Sn;if(Tt<rn){var hn=je-rn,Bi=Math.min(rn,ri);for(hn+Tt<0&&X(3);Tt<Bi;++Tt)oe[Tt]=pe[hn+Tt]}for(;Tt<ri;++Tt)oe[Tt]=oe[Tt-rn]}}P.l=Jt,P.p=pn,P.b=Tt,P.f=be,Jt&&(be=1,P.m=$t,P.d=Kt,P.n=Zt)}while(!be);return Tt!=oe.length&&ct?q(oe,0,Tt):oe.subarray(0,Tt)},ae=function(Q,P,oe){oe<<=P&7;var pe=P/8|0;Q[pe]|=oe,Q[pe+1]|=oe>>8},w=function(Q,P,oe){oe<<=P&7;var pe=P/8|0;Q[pe]|=oe,Q[pe+1]|=oe>>8,Q[pe+2]|=oe>>16},b=function(Q,P){for(var oe=[],pe=0;pe<Q.length;++pe)Q[pe]&&oe.push({s:pe,f:Q[pe]});var Re=oe.length,je=oe.slice();if(!Re)return{t:Vt,l:0};if(Re==1){var ct=new Ue(oe[0].s+1);return ct[oe[0].s]=1,{t:ct,l:1}}oe.sort(function(Ur,Lr){return Ur.f-Lr.f}),oe.push({s:-1,f:25001});var dt=oe[0],Ot=oe[1],Dt=0,be=1,st=2;for(oe[0]={s:-1,f:dt.f+Ot.f,l:dt,r:Ot};be!=Re-1;)dt=oe[oe[Dt].f<oe[st].f?Dt++:st++],Ot=oe[Dt!=be&&oe[Dt].f<oe[st].f?Dt++:st++],oe[be++]={s:-1,f:dt.f+Ot.f,l:dt,r:Ot};for(var Tt=je[0].s,pe=1;pe<Re;++pe)je[pe].s>Tt&&(Tt=je[pe].s);var Jt=new ve(Tt+1),Kt=$(oe[be-1],Jt,0);if(Kt>P){var pe=0,$t=0,Zt=Kt-P,nr=1<<Zt;for(je.sort(function(Lr,Gr){return Jt[Gr.s]-Jt[Lr.s]||Lr.f-Gr.f});pe<Re;++pe){var xr=je[pe].s;if(Jt[xr]>P)$t+=nr-(1<<Kt-Jt[xr]),Jt[xr]=P;else break}for($t>>=Zt;$t>0;){var or=je[pe].s;Jt[or]<P?$t-=1<<P-Jt[or]++-1:++pe}for(;pe>=0&&$t;--pe){var er=je[pe].s;Jt[er]==P&&(--Jt[er],++$t)}Kt=P}return{t:new Ue(Jt),l:Kt}},$=function(Q,P,oe){return Q.s==-1?Math.max($(Q.l,P,oe+1),$(Q.r,P,oe+1)):P[Q.s]=oe},fe=function(Q){for(var P=Q.length;P&&!Q[--P];);for(var oe=new ve(++P),pe=0,Re=Q[0],je=1,ct=function(Ot){oe[pe++]=Ot},dt=1;dt<=P;++dt)if(Q[dt]==Re&&dt!=P)++je;else{if(!Re&&je>2){for(;je>138;je-=138)ct(32754);je>2&&(ct(je>10?je-11<<5|28690:je-3<<5|12305),je=0)}else if(je>3){for(ct(Re),--je;je>6;je-=6)ct(8304);je>2&&(ct(je-3<<5|8208),je=0)}for(;je--;)ct(Re);je=1,Re=Q[dt]}return{c:oe.subarray(0,pe),n:P}},$e=function(Q,P){for(var oe=0,pe=0;pe<P.length;++pe)oe+=Q[pe]*P[pe];return oe},lt=function(Q,P,oe){var pe=oe.length,Re=Ze(P+2);Q[Re]=pe&255,Q[Re+1]=pe>>8,Q[Re+2]=Q[Re]^255,Q[Re+3]=Q[Re+1]^255;for(var je=0;je<pe;++je)Q[Re+je+4]=oe[je];return(Re+4+pe)*8},Rt=function(Q,P,oe,pe,Re,je,ct,dt,Ot,Dt,be){ae(P,be++,oe),++Re[256];for(var st=b(Re,15),Tt=st.t,Jt=st.l,Kt=b(je,15),$t=Kt.t,Zt=Kt.l,nr=fe(Tt),xr=nr.c,or=nr.n,er=fe($t),Ur=er.c,Lr=er.n,Gr=new ve(19),Tr=0;Tr<xr.length;++Tr)++Gr[xr[Tr]&31];for(var Tr=0;Tr<Ur.length;++Tr)++Gr[Ur[Tr]&31];for(var Br=b(Gr,7),Yr=Br.t,Qr=Br.l,Xr=19;Xr>4&&!Yr[H[Xr-1]];--Xr);var ln=Dt+5<<3,_n=$e(Re,K)+$e(je,re)+ct,un=$e(Re,Tt)+$e(je,$t)+ct+14+3*Xr+$e(Gr,Yr)+2*Gr[16]+3*Gr[17]+7*Gr[18];if(Ot>=0&&ln<=_n&&ln<=un)return lt(P,be,Q.subarray(Ot,Ot+Dt));var jr,Vr,sn,rn;if(ae(P,be,1+(un<_n)),be+=2,un<_n){jr=k(Tt,Jt,0),Vr=Tt,sn=k($t,Zt,0),rn=$t;var Vn=k(Yr,Qr,0);ae(P,be,or-257),ae(P,be+5,Lr-1),ae(P,be+10,Xr-4),be+=14;for(var Tr=0;Tr<Xr;++Tr)ae(P,be+3*Tr,Yr[H[Tr]]);be+=3*Xr;for(var sr=[xr,Ur],pn=0;pn<2;++pn)for(var bn=sr[pn],Tr=0;Tr<bn.length;++Tr){var Sn=bn[Tr]&31;ae(P,be,Vn[Sn]),be+=Yr[Sn],Sn>15&&(ae(P,be,bn[Tr]>>5&127),be+=bn[Tr]>>12)}}else jr=me,Vr=K,sn=Ie,rn=re;for(var Tr=0;Tr<dt;++Tr){var vn=pe[Tr];if(vn>255){var Sn=vn>>18&31;w(P,be,jr[Sn+257]),be+=Vr[Sn+257],Sn>7&&(ae(P,be,vn>>23&31),be+=_[Sn]);var Wn=vn&31;w(P,be,sn[Wn]),be+=rn[Wn],Wn>3&&(w(P,be,vn>>5&8191),be+=ye[Wn])}else w(P,be,jr[vn]),be+=Vr[vn]}return w(P,be,jr[256]),be+Vr[256]},Ct=new Y([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Vt=new Ue(0),Qt=function(Q,P,oe,pe,Re,je){var ct=je.z||Q.length,dt=new Ue(pe+ct+5*(1+Math.ceil(ct/7e3))+Re),Ot=dt.subarray(pe,dt.length-Re),Dt=je.l,be=(je.r||0)&7;if(P){be&&(Ot[0]=je.r>>3);for(var st=Ct[P-1],Tt=st>>13,Jt=st&8191,Kt=(1<<oe)-1,$t=je.p||new ve(32768),Zt=je.h||new ve(Kt+1),nr=Math.ceil(oe/3),xr=2*nr,or=function(Ti){return(Q[Ti]^Q[Ti+1]<<nr^Q[Ti+2]<<xr)&Kt},er=new Y(25e3),Ur=new ve(288),Lr=new ve(32),Gr=0,Tr=0,Br=je.i||0,Yr=0,Qr=je.w||0,Xr=0;Br+2<ct;++Br){var ln=or(Br),_n=Br&32767,un=Zt[ln];if($t[_n]=un,Zt[ln]=_n,Qr<=Br){var jr=ct-Br;if((Gr>7e3||Yr>24576)&&(jr>423||!Dt)){be=Rt(Q,Ot,0,er,Ur,Lr,Tr,Yr,Xr,Br-Xr,be),Yr=Gr=Tr=0,Xr=Br;for(var Vr=0;Vr<286;++Vr)Ur[Vr]=0;for(var Vr=0;Vr<30;++Vr)Lr[Vr]=0}var sn=2,rn=0,Vn=Jt,sr=_n-un&32767;if(jr>2&&ln==or(Br-sr))for(var pn=Math.min(Tt,jr)-1,bn=Math.min(32767,Br),Sn=Math.min(258,jr);sr<=bn&&--Vn&&_n!=un;){if(Q[Br+sn]==Q[Br+sn-sr]){for(var vn=0;vn<Sn&&Q[Br+vn]==Q[Br+vn-sr];++vn);if(vn>sn){if(sn=vn,rn=sr,vn>pn)break;for(var Wn=Math.min(sr,vn-2),si=0,Vr=0;Vr<Wn;++Vr){var ri=Br-sr+Vr&32767,hn=$t[ri],Bi=ri-hn&32767;Bi>si&&(si=Bi,un=ri)}}}_n=un,un=$t[_n],sr+=_n-un&32767}if(rn){er[Yr++]=268435456|B[sn]<<18|T[rn];var li=B[sn]&31,Zn=T[rn]&31;Tr+=_[li]+ye[Zn],++Ur[257+li],++Lr[Zn],Qr=Br+sn,++Gr}else er[Yr++]=Q[Br],++Ur[Q[Br]]}}for(Br=Math.max(Br,Qr);Br<ct;++Br)er[Yr++]=Q[Br],++Ur[Q[Br]];be=Rt(Q,Ot,Dt,er,Ur,Lr,Tr,Yr,Xr,Br-Xr,be),Dt||(je.r=be&7|Ot[be/8|0]<<3,be-=7,je.h=Zt,je.p=$t,je.i=Br,je.w=Qr)}else{for(var Br=je.w||0;Br<ct+Dt;Br+=65535){var ui=Br+65535;ui>=ct&&(Ot[be/8|0]=Dt,ui=ct),be=lt(Ot,be+1,Q.subarray(Br,ui))}je.i=ct}return q(dt,0,pe+Ze(be)+Re)},bt=null,He=function(){var Q=-1;return{p:function(P){for(var oe=Q,pe=0;pe<P.length;++pe)oe=bt[oe&255^P[pe]]^oe>>>8;Q=oe},d:function(){return~Q}}},nt=function(){var Q=1,P=0;return{p:function(oe){for(var pe=Q,Re=P,je=oe.length|0,ct=0;ct!=je;){for(var dt=Math.min(ct+2655,je);ct<dt;++ct)Re+=pe+=oe[ct];pe=(pe&65535)+15*(pe>>16),Re=(Re&65535)+15*(Re>>16)}Q=pe,P=Re},d:function(){return Q%=65521,P%=65521,(Q&255)<<24|(Q&65280)<<8|(P&255)<<8|P>>8}}},it=function(Q,P,oe,pe,Re){if(!Re&&(Re={l:1},P.dictionary)){var je=P.dictionary.subarray(-32768),ct=new Ue(je.length+Q.length);ct.set(je),ct.set(Q,je.length),Q=ct,Re.w=je.length}return Qt(Q,P.level==null?6:P.level,P.mem==null?Re.l?Math.ceil(Math.max(8,Math.min(13,Math.log(Q.length)))*1.5):20:12+P.mem,oe,pe,Re)},At=function(Q,P){var oe={};for(var pe in Q)oe[pe]=Q[pe];for(var pe in P)oe[pe]=P[pe];return oe},Ht=function(Q,P,oe){for(var pe=Q(),Re=Q.toString(),je=Re.slice(Re.indexOf("[")+1,Re.lastIndexOf("]")).replace(/\s+/g,"").split(","),ct=0;ct<pe.length;++ct){var dt=pe[ct],Ot=je[ct];if(typeof dt=="function"){P+=";"+Ot+"=";var Dt=dt.toString();if(dt.prototype)if(Dt.indexOf("[native code]")!=-1){var be=Dt.indexOf(" ",8)+1;P+=Dt.slice(be,Dt.indexOf("(",be))}else{P+=Dt;for(var st in dt.prototype)P+=";"+Ot+".prototype."+st+"="+dt.prototype[st].toString()}else P+=Dt}else oe[Ot]=dt}return P},Fe=null,R=function(Q){var P=[];for(var oe in Q)Q[oe].buffer&&P.push((Q[oe]=new Q[oe].constructor(Q[oe])).buffer);return P},m=function(Q,P,oe,pe){if(!Fe[oe]){for(var Re="",je={},ct=Q.length-1,dt=0;dt<ct;++dt)Re=Ht(Q[dt],Re,je);Fe[oe]={c:Ht(Q[ct],Re,je),e:je}}var Ot=At({},Fe[oe].e);return we(Fe[oe].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+P.toString()+"}",oe,Ot,R(Ot),pe)},F=function(){return[Ue,ve,Y,_,ye,H,U,C,Ce,le,ee,j,k,xe,Ke,ge,Ze,q,X,ue,Se,Me,Xe]},V=function(){return[Ue,ve,Y,_,ye,H,B,T,me,K,Ie,re,ee,Ct,Vt,k,ae,w,b,$,fe,$e,lt,Rt,Ze,q,Qt,it,Nt,Me]},D=function(){return[rt,zt,Ye,He,bt]},N=function(){return[yt,It]},Ae=function(){return[kt,Ye,nt]},Le=function(){return[tr]},Me=function(Q){return postMessage(Q,[Q.buffer])},Xe=function(Q){return Q&&{out:Q.size&&new Ue(Q.size),dictionary:Q.dictionary}},qe=function(Q,P,oe,pe,Re,je){var ct=m(oe,pe,Re,function(dt,Ot){ct.terminate(),je(dt,Ot)});return ct.postMessage([Q,P],P.consume?[Q.buffer]:[]),function(){ct.terminate()}},Pt=function(Q){return Q.ondata=function(P,oe){return postMessage([P,oe],[P.buffer])},function(P){P.data.length?(Q.push(P.data[0],P.data[1]),postMessage([P.data[0].length])):Q.flush()}},ot=function(Q,P,oe,pe,Re,je,ct){var dt,Ot=m(Q,pe,Re,function(Dt,be){Dt?(Ot.terminate(),P.ondata.call(P,Dt)):Array.isArray(be)?be.length==1?(P.queuedSize-=be[0],P.ondrain&&P.ondrain(be[0])):(be[1]&&Ot.terminate(),P.ondata.call(P,Dt,be[0],be[1])):ct(be)});Ot.postMessage(oe),P.queuedSize=0,P.push=function(Dt,be){P.ondata||X(5),dt&&P.ondata(X(4,0,1),null,!!be),P.queuedSize+=Dt.length,Ot.postMessage([Dt,dt=be],[Dt.buffer])},P.terminate=function(){Ot.terminate()},je&&(P.flush=function(){Ot.postMessage([])})},Bt=function(Q,P){return Q[P]|Q[P+1]<<8},ut=function(Q,P){return(Q[P]|Q[P+1]<<8|Q[P+2]<<16|Q[P+3]<<24)>>>0},gt=function(Q,P){return ut(Q,P)+ut(Q,P+4)*4294967296},Ye=function(Q,P,oe){for(;oe;++P)Q[P]=oe,oe>>>=8},rt=function(Q,P){var oe=P.filename;if(Q[0]=31,Q[1]=139,Q[2]=8,Q[8]=P.level<2?4:P.level==9?2:0,Q[9]=3,P.mtime!=0&&Ye(Q,4,Math.floor(new Date(P.mtime||Date.now())/1e3)),oe){Q[3]=8;for(var pe=0;pe<=oe.length;++pe)Q[pe+10]=oe.charCodeAt(pe)}},yt=function(Q){(Q[0]!=31||Q[1]!=139||Q[2]!=8)&&X(6,"invalid gzip data");var P=Q[3],oe=10;P&4&&(oe+=(Q[10]|Q[11]<<8)+2);for(var pe=(P>>3&1)+(P>>4&1);pe>0;pe-=!Q[oe++]);return oe+(P&2)},It=function(Q){var P=Q.length;return(Q[P-4]|Q[P-3]<<8|Q[P-2]<<16|Q[P-1]<<24)>>>0},zt=function(Q){return 10+(Q.filename?Q.filename.length+1:0)},kt=function(Q,P){var oe=P.level,pe=oe==0?0:oe<6?1:oe==9?3:2;if(Q[0]=120,Q[1]=pe<<6|(P.dictionary&&32),Q[1]|=31-(Q[0]<<8|Q[1])%31,P.dictionary){var Re=nt();Re.p(P.dictionary),Ye(Q,2,Re.d())}},tr=function(Q,P){return((Q[0]&15)!=8||Q[0]>>4>7||(Q[0]<<8|Q[1])%31)&&X(6,"invalid zlib data"),(Q[1]>>5&1)==+!P&&X(6,"invalid zlib data: "+(Q[1]&32?"need":"unexpected")+" dictionary"),(Q[1]>>3&4)+2};function Wt(Q,P){return typeof Q=="function"&&(P=Q,Q={}),this.ondata=P,Q}var ir=null,Er=null;function zr(Q,P,oe){return oe||(oe=P,P={}),typeof oe!="function"&&X(7),qe(Q,P,[V],function(pe){return Me(Nt(pe.data[0],pe.data[1]))},0,oe)}function Nt(Q,P){return it(Q,P||{},0,0)}var ur=null,ke=null;function De(Q,P,oe){return oe||(oe=P,P={}),typeof oe!="function"&&X(7),qe(Q,P,[F],function(pe){return Me(Se(pe.data[0],Xe(pe.data[1])))},1,oe)}function Se(Q,P){return ue(Q,{i:2},P&&P.out,P&&P.dictionary)}var te=null,se=null;function ce(Q,P,oe){return oe||(oe=P,P={}),typeof oe!="function"&&X(7),qe(Q,P,[V,D,function(){return[Ee]}],function(pe){return Me(Ee(pe.data[0],pe.data[1]))},2,oe)}function Ee(Q,P){P||(P={});var oe=He(),pe=Q.length;oe.p(Q);var Re=it(Q,P,zt(P),8),je=Re.length;return rt(Re,P),Ye(Re,je-8,oe.d()),Ye(Re,je-4,pe),Re}var Te=null,Et=null;function Ut(Q,P,oe){return oe||(oe=P,P={}),typeof oe!="function"&&X(7),qe(Q,P,[F,N,function(){return[Ft]}],function(pe){return Me(Ft(pe.data[0],pe.data[1]))},3,oe)}function Ft(Q,P){var oe=yt(Q);return oe+8>Q.length&&X(6,"invalid gzip data"),ue(Q.subarray(oe,-8),{i:2},P&&P.out||new Ue(It(Q)),P&&P.dictionary)}var rr=null,Ir=null;function qr(Q,P,oe){return oe||(oe=P,P={}),typeof oe!="function"&&X(7),qe(Q,P,[V,Ae,function(){return[jt]}],function(pe){return Me(jt(pe.data[0],pe.data[1]))},4,oe)}function jt(Q,P){P||(P={});var oe=nt();oe.p(Q);var pe=it(Q,P,P.dictionary?6:2,4);return kt(pe,P),Ye(pe,pe.length-4,oe.d()),pe}var Yt=null,$r=null;function fn(Q,P,oe){return oe||(oe=P,P={}),typeof oe!="function"&&X(7),qe(Q,P,[F,Le,function(){return[Oe]}],function(pe){return Me(Oe(pe.data[0],Xe(pe.data[1])))},5,oe)}function Oe(Q,P){return ue(Q.subarray(tr(Q,P&&P.dictionary),-4),{i:2},P&&P.out,P&&P.dictionary)}var Wr=null,Pr=null;function Mr(Q,P,oe){return oe||(oe=P,P={}),typeof oe!="function"&&X(7),Q[0]==31&&Q[1]==139&&Q[2]==8?Ut(Q,P,oe):(Q[0]&15)!=8||Q[0]>>4>7||(Q[0]<<8|Q[1])%31?De(Q,P,oe):fn(Q,P,oe)}function In(Q,P){return Q[0]==31&&Q[1]==139&&Q[2]==8?Ft(Q,P):(Q[0]&15)!=8||Q[0]>>4>7||(Q[0]<<8|Q[1])%31?Se(Q,P):Oe(Q,P)}var en=function(Q,P,oe,pe){for(var Re in Q){var je=Q[Re],ct=P+Re,dt=pe;Array.isArray(je)&&(dt=At(pe,je[1]),je=je[0]),je instanceof Ue?oe[ct]=[je,dt]:(oe[ct+="/"]=[new Ue(0),dt],en(je,ct,oe,pe))}},Fn=typeof TextEncoder!="undefined"&&new TextEncoder,mn=typeof TextDecoder!="undefined"&&new TextDecoder,Nn=0;try{mn.decode(Vt,{stream:!0}),Nn=1}catch(Q){}var Rn=function(Q){for(var P="",oe=0;;){var pe=Q[oe++],Re=(pe>127)+(pe>223)+(pe>239);if(oe+Re>Q.length)return{s:P,r:q(Q,oe-1)};Re?Re==3?(pe=((pe&15)<<18|(Q[oe++]&63)<<12|(Q[oe++]&63)<<6|Q[oe++]&63)-65536,P+=String.fromCharCode(55296|pe>>10,56320|pe&1023)):Re&1?P+=String.fromCharCode((pe&31)<<6|Q[oe++]&63):P+=String.fromCharCode((pe&15)<<12|(Q[oe++]&63)<<6|Q[oe++]&63):P+=String.fromCharCode(pe)}},Hn=null,ei=null;function tn(Q,P){if(P){for(var oe=new Ue(Q.length),pe=0;pe<Q.length;++pe)oe[pe]=Q.charCodeAt(pe);return oe}if(Fn)return Fn.encode(Q);for(var Re=Q.length,je=new Ue(Q.length+(Q.length>>1)),ct=0,dt=function(be){je[ct++]=be},pe=0;pe<Re;++pe){if(ct+5>je.length){var Ot=new Ue(ct+8+(Re-pe<<1));Ot.set(je),je=Ot}var Dt=Q.charCodeAt(pe);Dt<128||P?dt(Dt):Dt<2048?(dt(192|Dt>>6),dt(128|Dt&63)):Dt>55295&&Dt<57344?(Dt=65536+(Dt&1047552)|Q.charCodeAt(++pe)&1023,dt(240|Dt>>18),dt(128|Dt>>12&63),dt(128|Dt>>6&63),dt(128|Dt&63)):(dt(224|Dt>>12),dt(128|Dt>>6&63),dt(128|Dt&63))}return q(je,0,ct)}function an(Q,P){if(P){for(var oe="",pe=0;pe<Q.length;pe+=16384)oe+=String.fromCharCode.apply(null,Q.subarray(pe,pe+16384));return oe}else{if(mn)return mn.decode(Q);var Re=Rn(Q),je=Re.s,oe=Re.r;return oe.length&&X(8),je}}var gn=function(Q){return Q==1?3:Q<6?2:Q==9?1:0},ii=function(Q,P){return P+30+Bt(Q,P+26)+Bt(Q,P+28)},Hr=function(Q,P,oe){var pe=Bt(Q,P+28),Re=an(Q.subarray(P+46,P+46+pe),!(Bt(Q,P+8)&2048)),je=P+46+pe,ct=ut(Q,P+20),dt=oe&&ct==4294967295?ti(Q,je):[ct,ut(Q,P+24),ut(Q,P+42)],Ot=dt[0],Dt=dt[1],be=dt[2];return[Bt(Q,P+10),Ot,Dt,Re,je+Bt(Q,P+30)+Bt(Q,P+32),be]},ti=function(Q,P){for(;Bt(Q,P)!=1;P+=4+Bt(Q,P+2));return[gt(Q,P+12),gt(Q,P+4),gt(Q,P+20)]},Cn=function(Q){var P=0;if(Q)for(var oe in Q){var pe=Q[oe].length;pe>65535&&X(9),P+=pe+4}return P},wr=function(Q,P,oe,pe,Re,je,ct,dt){var Ot=pe.length,Dt=oe.extra,be=dt&&dt.length,st=Cn(Dt);Ye(Q,P,ct!=null?33639248:67324752),P+=4,ct!=null&&(Q[P++]=20,Q[P++]=oe.os),Q[P]=20,P+=2,Q[P++]=oe.flag<<1|(je<0&&8),Q[P++]=Re&&8,Q[P++]=oe.compression&255,Q[P++]=oe.compression>>8;var Tt=new Date(oe.mtime==null?Date.now():oe.mtime),Jt=Tt.getFullYear()-1980;if((Jt<0||Jt>119)&&X(10),Ye(Q,P,Jt<<25|Tt.getMonth()+1<<21|Tt.getDate()<<16|Tt.getHours()<<11|Tt.getMinutes()<<5|Tt.getSeconds()>>1),P+=4,je!=-1&&(Ye(Q,P,oe.crc),Ye(Q,P+4,je<0?-je-2:je),Ye(Q,P+8,oe.size)),Ye(Q,P+12,Ot),Ye(Q,P+14,st),P+=16,ct!=null&&(Ye(Q,P,be),Ye(Q,P+6,oe.attrs),Ye(Q,P+10,ct),P+=14),Q.set(pe,P),P+=Ot,st)for(var Kt in Dt){var $t=Dt[Kt],Zt=$t.length;Ye(Q,P,+Kt),Ye(Q,P+2,Zt),Q.set($t,P+4),P+=4+Zt}return be&&(Q.set(dt,P),P+=be),P},kr=function(Q,P,oe,pe,Re){Ye(Q,P,101010256),Ye(Q,P+8,oe),Ye(Q,P+10,oe),Ye(Q,P+12,pe),Ye(Q,P+16,Re)},Ne=null,tt=null,wt=null,mt=null;function Mt(Q,P,oe){oe||(oe=P,P={}),typeof oe!="function"&&X(7);var pe={};en(Q,"",pe,P);var Re=Object.keys(pe),je=Re.length,ct=0,dt=0,Ot=je,Dt=new Array(je),be=[],st=function(){for(var Zt=0;Zt<be.length;++Zt)be[Zt]()},Tt=function(Zt,nr){Zr(function(){oe(Zt,nr)})};Zr(function(){Tt=oe});var Jt=function(){var Zt=new Ue(dt+22),nr=ct,xr=dt-ct;dt=0;for(var or=0;or<Ot;++or){var er=Dt[or];try{var Ur=er.c.length;wr(Zt,dt,er,er.f,er.u,Ur);var Lr=30+er.f.length+Cn(er.extra),Gr=dt+Lr;Zt.set(er.c,Gr),wr(Zt,ct,er,er.f,er.u,Ur,dt,er.m),ct+=16+Lr+(er.m?er.m.length:0),dt=Gr+Ur}catch(Tr){return Tt(Tr,null)}}kr(Zt,ct,Dt.length,xr,nr),Tt(null,Zt)};je||Jt();for(var Kt=function(Zt){var nr=Re[Zt],xr=pe[nr],or=xr[0],er=xr[1],Ur=He(),Lr=or.length;Ur.p(or);var Gr=tn(nr),Tr=Gr.length,Br=er.comment,Yr=Br&&tn(Br),Qr=Yr&&Yr.length,Xr=Cn(er.extra),ln=er.level==0?0:8,_n=function(un,jr){if(un)st(),Tt(un,null);else{var Vr=jr.length;Dt[Zt]=At(er,{size:Lr,crc:Ur.d(),c:jr,f:Gr,m:Yr,u:Tr!=nr.length||Yr&&Br.length!=Qr,compression:ln}),ct+=30+Tr+Xr+Vr,dt+=76+2*(Tr+Xr)+(Qr||0)+Vr,--je||Jt()}};if(Tr>65535&&_n(X(11,0,1),null),!ln)_n(null,or);else if(Lr<16e4)try{_n(null,Nt(or,er))}catch(un){_n(un,null)}else be.push(zr(or,er,_n))},$t=0;$t<Ot;++$t)Kt($t);return st}function ht(Q,P){P||(P={});var oe={},pe=[];en(Q,"",oe,P);var Re=0,je=0;for(var ct in oe){var dt=oe[ct],Ot=dt[0],Dt=dt[1],be=Dt.level==0?0:8,st=tn(ct),Tt=st.length,Jt=Dt.comment,Kt=Jt&&tn(Jt),$t=Kt&&Kt.length,Zt=Cn(Dt.extra);Tt>65535&&X(11);var nr=be?Nt(Ot,Dt):Ot,xr=nr.length,or=He();or.p(Ot),pe.push(At(Dt,{size:Ot.length,crc:or.d(),c:nr,f:st,m:Kt,u:Tt!=ct.length||Kt&&Jt.length!=$t,o:Re,compression:be})),Re+=30+Tt+Zt+xr,je+=76+2*(Tt+Zt)+($t||0)+xr}for(var er=new Ue(je+22),Ur=Re,Lr=je-Re,Gr=0;Gr<pe.length;++Gr){var st=pe[Gr];wr(er,st.o,st,st.f,st.u,st.c.length);var Tr=30+st.f.length+Cn(st.extra);er.set(st.c,st.o+Tr),wr(er,Re,st,st.f,st.u,st.c.length,st.o,st.m),Re+=16+Tr+(st.m?st.m.length:0)}return kr(er,Re,pe.length,Lr,Ur),er}var vt=null,Gt=null,qt=null,yr=null,Zr=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(Q){Q()};function Rr(Q,P,oe){oe||(oe=P,P={}),typeof oe!="function"&&X(7);var pe=[],Re=function(){for(var Zt=0;Zt<pe.length;++Zt)pe[Zt]()},je={},ct=function(Zt,nr){Zr(function(){oe(Zt,nr)})};Zr(function(){ct=oe});for(var dt=Q.length-22;ut(Q,dt)!=101010256;--dt)if(!dt||Q.length-dt>65558)return ct(X(13,0,1),null),Re;var Ot=Bt(Q,dt+8);if(Ot){var Dt=Ot,be=ut(Q,dt+16),st=be==4294967295||Dt==65535;if(st){var Tt=ut(Q,dt-12);st=ut(Q,Tt)==101075792,st&&(Dt=Ot=ut(Q,Tt+32),be=ut(Q,Tt+48))}for(var Jt=P&&P.filter,Kt=function(Zt){var nr=Hr(Q,be,st),xr=nr[0],or=nr[1],er=nr[2],Ur=nr[3],Lr=nr[4],Gr=nr[5],Tr=ii(Q,Gr);be=Lr;var Br=function(Qr,Xr){Qr?(Re(),ct(Qr,null)):(Xr&&(je[Ur]=Xr),--Ot||ct(null,je))};if(!Jt||Jt({name:Ur,size:or,originalSize:er,compression:xr}))if(!xr)Br(null,q(Q,Tr,Tr+or));else if(xr==8){var Yr=Q.subarray(Tr,Tr+or);if(er<524288||or>.8*er)try{Br(null,Se(Yr,{out:new Ue(er)}))}catch(Qr){Br(Qr,null)}else pe.push(De(Yr,{size:er},Br))}else Br(X(14,"unknown compression type "+xr,1),null);else Br(null,null)},$t=0;$t<Dt;++$t)Kt($t)}else ct(null,{});return Re}function Dr(Q,P){for(var oe={},pe=Q.length-22;ut(Q,pe)!=101010256;--pe)(!pe||Q.length-pe>65558)&&X(13);var Re=Bt(Q,pe+8);if(!Re)return{};var je=ut(Q,pe+16),ct=je==4294967295||Re==65535;if(ct){var dt=ut(Q,pe-12);ct=ut(Q,dt)==101075792,ct&&(Re=ut(Q,dt+32),je=ut(Q,dt+48))}for(var Ot=P&&P.filter,Dt=0;Dt<Re;++Dt){var be=Hr(Q,je,ct),st=be[0],Tt=be[1],Jt=be[2],Kt=be[3],$t=be[4],Zt=be[5],nr=ii(Q,Zt);je=$t,(!Ot||Ot({name:Kt,size:Tt,originalSize:Jt,compression:st}))&&(st?st==8?oe[Kt]=Se(Q.subarray(nr,nr+Tt),{out:new Ue(Jt)}):X(14,"unknown compression type "+st):oe[Kt]=q(Q,nr,nr+Tt))}return oe}},64270:function(Sr){(function(St,Z){Sr.exports=Z()})(this,function(){"use strict";var St=function(f,u){return St=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var E in h)Object.prototype.hasOwnProperty.call(h,E)&&(d[E]=h[E])},St(f,u)};function Z(f,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");St(f,u);function d(){this.constructor=f}f.prototype=u===null?Object.create(u):(d.prototype=u.prototype,new d)}var z=function(){return z=Object.assign||function(u){for(var d,h=1,E=arguments.length;h<E;h++){d=arguments[h];for(var I in d)Object.prototype.hasOwnProperty.call(d,I)&&(u[I]=d[I])}return u},z.apply(this,arguments)};function we(f,u,d,h){function E(I){return I instanceof d?I:new d(function(J){J(I)})}return new(d||(d=Promise))(function(I,J){function de(Ve){try{Pe(h.next(Ve))}catch(et){J(et)}}function he(Ve){try{Pe(h.throw(Ve))}catch(et){J(et)}}function Pe(Ve){Ve.done?I(Ve.value):E(Ve.value).then(de,he)}Pe((h=h.apply(f,u||[])).next())})}function Ue(f,u){var d={label:0,sent:function(){if(I[0]&1)throw I[1];return I[1]},trys:[],ops:[]},h,E,I,J;return J={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function de(Pe){return function(Ve){return he([Pe,Ve])}}function he(Pe){if(h)throw new TypeError("Generator is already executing.");for(;d;)try{if(h=1,E&&(I=Pe[0]&2?E.return:Pe[0]?E.throw||((I=E.return)&&I.call(E),0):E.next)&&!(I=I.call(E,Pe[1])).done)return I;switch(E=0,I&&(Pe=[Pe[0]&2,I.value]),Pe[0]){case 0:case 1:I=Pe;break;case 4:return d.label++,{value:Pe[1],done:!1};case 5:d.label++,E=Pe[1],Pe=[0];continue;case 7:Pe=d.ops.pop(),d.trys.pop();continue;default:if(I=d.trys,!(I=I.length>0&&I[I.length-1])&&(Pe[0]===6||Pe[0]===2)){d=0;continue}if(Pe[0]===3&&(!I||Pe[1]>I[0]&&Pe[1]<I[3])){d.label=Pe[1];break}if(Pe[0]===6&&d.label<I[1]){d.label=I[1],I=Pe;break}if(I&&d.label<I[2]){d.label=I[2],d.ops.push(Pe);break}I[2]&&d.ops.pop(),d.trys.pop();continue}Pe=u.call(f,d)}catch(Ve){Pe=[6,Ve],E=0}finally{h=I=0}if(Pe[0]&5)throw Pe[1];return{value:Pe[0]?Pe[1]:void 0,done:!0}}}function ve(f,u,d){if(d||arguments.length===2)for(var h=0,E=u.length,I;h<E;h++)(I||!(h in u))&&(I||(I=Array.prototype.slice.call(u,0,h)),I[h]=u[h]);return f.concat(I||u)}for(var Y=function(){function f(u,d,h,E){this.left=u,this.top=d,this.width=h,this.height=E}return f.prototype.add=function(u,d,h,E){return new f(this.left+u,this.top+d,this.width+h,this.height+E)},f.fromClientRect=function(u,d){return new f(d.left+u.windowBounds.left,d.top+u.windowBounds.top,d.width,d.height)},f.fromDOMRectList=function(u,d){var h=Array.from(d).find(function(E){return E.width!==0});return h?new f(h.left+u.windowBounds.left,h.top+u.windowBounds.top,h.width,h.height):f.EMPTY},f.EMPTY=new f(0,0,0,0),f}(),_=function(f,u){return Y.fromClientRect(f,u.getBoundingClientRect())},ye=function(f){var u=f.body,d=f.documentElement;if(!u||!d)throw new Error("Unable to get document size");var h=Math.max(Math.max(u.scrollWidth,d.scrollWidth),Math.max(u.offsetWidth,d.offsetWidth),Math.max(u.clientWidth,d.clientWidth)),E=Math.max(Math.max(u.scrollHeight,d.scrollHeight),Math.max(u.offsetHeight,d.offsetHeight),Math.max(u.clientHeight,d.clientHeight));return new Y(0,0,h,E)},H=function(f){for(var u=[],d=0,h=f.length;d<h;){var E=f.charCodeAt(d++);if(E>=55296&&E<=56319&&d<h){var I=f.charCodeAt(d++);(I&64512)===56320?u.push(((E&1023)<<10)+(I&1023)+65536):(u.push(E),d--)}else u.push(E)}return u},o=function(){for(var f=[],u=0;u<arguments.length;u++)f[u]=arguments[u];if(String.fromCodePoint)return String.fromCodePoint.apply(String,f);var d=f.length;if(!d)return"";for(var h=[],E=-1,I="";++E<d;){var J=f[E];J<=65535?h.push(J):(J-=65536,h.push((J>>10)+55296,J%1024+56320)),(E+1===d||h.length>16384)&&(I+=String.fromCharCode.apply(String,h),h.length=0)}return I},ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),B=0;B<ne.length;B++)U[ne.charCodeAt(B)]=B;for(var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),T=0;T<y.length;T++)C[y.charCodeAt(T)]=T;for(var ee=function(f){var u=f.length*.75,d=f.length,h,E=0,I,J,de,he;f[f.length-1]==="="&&(u--,f[f.length-2]==="="&&u--);var Pe=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&typeof Uint8Array.prototype.slice!="undefined"?new ArrayBuffer(u):new Array(u),Ve=Array.isArray(Pe)?Pe:new Uint8Array(Pe);for(h=0;h<d;h+=4)I=C[f.charCodeAt(h)],J=C[f.charCodeAt(h+1)],de=C[f.charCodeAt(h+2)],he=C[f.charCodeAt(h+3)],Ve[E++]=I<<2|J>>4,Ve[E++]=(J&15)<<4|de>>2,Ve[E++]=(de&3)<<6|he&63;return Pe},G=function(f){for(var u=f.length,d=[],h=0;h<u;h+=2)d.push(f[h+1]<<8|f[h]);return d},W=function(f){for(var u=f.length,d=[],h=0;h<u;h+=4)d.push(f[h+3]<<24|f[h+2]<<16|f[h+1]<<8|f[h]);return d},k=5,K=11,re=2,me=K-k,Ce=65536>>k,Ie=1<<k,le=Ie-1,xe=1024>>k,Ke=Ce+xe,ge=Ke,Ze=32,q=ge+Ze,L=65536>>K,j=1<<me,X=j-1,ue=function(f,u,d){return f.slice?f.slice(u,d):new Uint16Array(Array.prototype.slice.call(f,u,d))},ae=function(f,u,d){return f.slice?f.slice(u,d):new Uint32Array(Array.prototype.slice.call(f,u,d))},w=function(f,u){var d=ee(f),h=Array.isArray(d)?W(d):new Uint32Array(d),E=Array.isArray(d)?G(d):new Uint16Array(d),I=24,J=ue(E,I/2,h[4]/2),de=h[5]===2?ue(E,(I+h[4])/2):ae(h,Math.ceil((I+h[4])/4));return new b(h[0],h[1],h[2],h[3],J,de)},b=function(){function f(u,d,h,E,I,J){this.initialValue=u,this.errorValue=d,this.highStart=h,this.highValueIndex=E,this.index=I,this.data=J}return f.prototype.get=function(u){var d;if(u>=0){if(u<55296||u>56319&&u<=65535)return d=this.index[u>>k],d=(d<<re)+(u&le),this.data[d];if(u<=65535)return d=this.index[Ce+(u-55296>>k)],d=(d<<re)+(u&le),this.data[d];if(u<this.highStart)return d=q-L+(u>>K),d=this.index[d],d+=u>>k&X,d=this.index[d],d=(d<<re)+(u&le),this.data[d];if(u<=1114111)return this.data[this.highValueIndex]}return this.errorValue},f}(),$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),$e=0;$e<$.length;$e++)fe[$.charCodeAt($e)]=$e;var lt="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",Rt=50,Ct=1,Vt=2,Qt=3,bt=4,He=5,nt=7,it=8,At=9,Ht=10,Fe=11,R=12,m=13,F=14,V=15,D=16,N=17,Ae=18,Le=19,Me=20,Xe=21,qe=22,Pt=23,ot=24,Bt=25,ut=26,gt=27,Ye=28,rt=29,yt=30,It=31,zt=32,kt=33,tr=34,Wt=35,ir=36,Er=37,zr=38,Nt=39,ur=40,ke=41,De=42,Se=43,te=[9001,65288],se="!",ce="\xD7",Ee="\xF7",Te=w(lt),Et=[yt,ir],Ut=[Ct,Vt,Qt,He],Ft=[Ht,it],rr=[gt,ut],Ir=Ut.concat(Ft),qr=[zr,Nt,ur,tr,Wt],jt=[V,m],Yt=function(f,u){u===void 0&&(u="strict");var d=[],h=[],E=[];return f.forEach(function(I,J){var de=Te.get(I);if(de>Rt?(E.push(!0),de-=Rt):E.push(!1),["normal","auto","loose"].indexOf(u)!==-1&&[8208,8211,12316,12448].indexOf(I)!==-1)return h.push(J),d.push(D);if(de===bt||de===Fe){if(J===0)return h.push(J),d.push(yt);var he=d[J-1];return Ir.indexOf(he)===-1?(h.push(h[J-1]),d.push(he)):(h.push(J),d.push(yt))}if(h.push(J),de===It)return d.push(u==="strict"?Xe:Er);if(de===De||de===rt)return d.push(yt);if(de===Se)return I>=131072&&I<=196605||I>=196608&&I<=262141?d.push(Er):d.push(yt);d.push(de)}),[h,d,E]},$r=function(f,u,d,h){var E=h[d];if(Array.isArray(f)?f.indexOf(E)!==-1:f===E)for(var I=d;I<=h.length;){I++;var J=h[I];if(J===u)return!0;if(J!==Ht)break}if(E===Ht)for(var I=d;I>0;){I--;var de=h[I];if(Array.isArray(f)?f.indexOf(de)!==-1:f===de)for(var he=d;he<=h.length;){he++;var J=h[he];if(J===u)return!0;if(J!==Ht)break}if(de!==Ht)break}return!1},fn=function(f,u){for(var d=f;d>=0;){var h=u[d];if(h===Ht)d--;else return h}return 0},Oe=function(f,u,d,h,E){if(d[h]===0)return ce;var I=h-1;if(Array.isArray(E)&&E[I]===!0)return ce;var J=I-1,de=I+1,he=u[I],Pe=J>=0?u[J]:0,Ve=u[de];if(he===Vt&&Ve===Qt)return ce;if(Ut.indexOf(he)!==-1)return se;if(Ut.indexOf(Ve)!==-1||Ft.indexOf(Ve)!==-1)return ce;if(fn(I,u)===it)return Ee;if(Te.get(f[I])===Fe||(he===zt||he===kt)&&Te.get(f[de])===Fe||he===nt||Ve===nt||he===At||[Ht,m,V].indexOf(he)===-1&&Ve===At||[N,Ae,Le,ot,Ye].indexOf(Ve)!==-1||fn(I,u)===qe||$r(Pt,qe,I,u)||$r([N,Ae],Xe,I,u)||$r(R,R,I,u))return ce;if(he===Ht)return Ee;if(he===Pt||Ve===Pt)return ce;if(Ve===D||he===D)return Ee;if([m,V,Xe].indexOf(Ve)!==-1||he===F||Pe===ir&&jt.indexOf(he)!==-1||he===Ye&&Ve===ir||Ve===Me||Et.indexOf(Ve)!==-1&&he===Bt||Et.indexOf(he)!==-1&&Ve===Bt||he===gt&&[Er,zt,kt].indexOf(Ve)!==-1||[Er,zt,kt].indexOf(he)!==-1&&Ve===ut||Et.indexOf(he)!==-1&&rr.indexOf(Ve)!==-1||rr.indexOf(he)!==-1&&Et.indexOf(Ve)!==-1||[gt,ut].indexOf(he)!==-1&&(Ve===Bt||[qe,V].indexOf(Ve)!==-1&&u[de+1]===Bt)||[qe,V].indexOf(he)!==-1&&Ve===Bt||he===Bt&&[Bt,Ye,ot].indexOf(Ve)!==-1)return ce;if([Bt,Ye,ot,N,Ae].indexOf(Ve)!==-1)for(var et=I;et>=0;){var xt=u[et];if(xt===Bt)return ce;if([Ye,ot].indexOf(xt)!==-1)et--;else break}if([gt,ut].indexOf(Ve)!==-1)for(var et=[N,Ae].indexOf(he)!==-1?J:I;et>=0;){var xt=u[et];if(xt===Bt)return ce;if([Ye,ot].indexOf(xt)!==-1)et--;else break}if(zr===he&&[zr,Nt,tr,Wt].indexOf(Ve)!==-1||[Nt,tr].indexOf(he)!==-1&&[Nt,ur].indexOf(Ve)!==-1||[ur,Wt].indexOf(he)!==-1&&Ve===ur||qr.indexOf(he)!==-1&&[Me,ut].indexOf(Ve)!==-1||qr.indexOf(Ve)!==-1&&he===gt||Et.indexOf(he)!==-1&&Et.indexOf(Ve)!==-1||he===ot&&Et.indexOf(Ve)!==-1||Et.concat(Bt).indexOf(he)!==-1&&Ve===qe&&te.indexOf(f[de])===-1||Et.concat(Bt).indexOf(Ve)!==-1&&he===Ae)return ce;if(he===ke&&Ve===ke){for(var gr=d[I],Xt=1;gr>0&&(gr--,u[gr]===ke);)Xt++;if(Xt%2!==0)return ce}return he===zt&&Ve===kt?ce:Ee},Wr=function(f,u){u||(u={lineBreak:"normal",wordBreak:"normal"});var d=Yt(f,u.lineBreak),h=d[0],E=d[1],I=d[2];(u.wordBreak==="break-all"||u.wordBreak==="break-word")&&(E=E.map(function(de){return[Bt,yt,De].indexOf(de)!==-1?Er:de}));var J=u.wordBreak==="keep-all"?I.map(function(de,he){return de&&f[he]>=19968&&f[he]<=40959}):void 0;return[h,E,J]},Pr=function(){function f(u,d,h,E){this.codePoints=u,this.required=d===se,this.start=h,this.end=E}return f.prototype.slice=function(){return o.apply(void 0,this.codePoints.slice(this.start,this.end))},f}(),Mr=function(f,u){var d=H(f),h=Wr(d,u),E=h[0],I=h[1],J=h[2],de=d.length,he=0,Pe=0;return{next:function(){if(Pe>=de)return{done:!0,value:null};for(var Ve=ce;Pe<de&&(Ve=Oe(d,I,E,++Pe,J))===ce;);if(Ve!==ce||Pe===de){var et=new Pr(d,Ve,he,Pe);return he=Pe,{value:et,done:!1}}return{done:!0,value:null}}}},In=1,en=2,Fn=4,mn=8,Nn=10,Rn=47,Hn=92,ei=9,tn=32,an=34,gn=61,ii=35,Hr=36,ti=37,Cn=39,wr=40,kr=41,Ne=95,tt=45,wt=33,mt=60,Mt=62,ht=64,vt=91,Gt=93,qt=61,yr=123,Zr=63,Rr=125,Dr=124,Q=126,P=128,oe=65533,pe=42,Re=43,je=44,ct=58,dt=59,Ot=46,Dt=0,be=8,st=11,Tt=14,Jt=31,Kt=127,$t=-1,Zt=48,nr=97,xr=101,or=102,er=117,Ur=122,Lr=65,Gr=69,Tr=70,Br=85,Yr=90,Qr=function(f){return f>=Zt&&f<=57},Xr=function(f){return f>=55296&&f<=57343},ln=function(f){return Qr(f)||f>=Lr&&f<=Tr||f>=nr&&f<=or},_n=function(f){return f>=nr&&f<=Ur},un=function(f){return f>=Lr&&f<=Yr},jr=function(f){return _n(f)||un(f)},Vr=function(f){return f>=P},sn=function(f){return f===Nn||f===ei||f===tn},rn=function(f){return jr(f)||Vr(f)||f===Ne},Vn=function(f){return rn(f)||Qr(f)||f===tt},sr=function(f){return f>=Dt&&f<=be||f===st||f>=Tt&&f<=Jt||f===Kt},pn=function(f,u){return f!==Hn?!1:u!==Nn},bn=function(f,u,d){return f===tt?rn(u)||pn(u,d):rn(f)?!0:!!(f===Hn&&pn(f,u))},Sn=function(f,u,d){return f===Re||f===tt?Qr(u)?!0:u===Ot&&Qr(d):Qr(f===Ot?u:f)},vn=function(f){var u=0,d=1;(f[u]===Re||f[u]===tt)&&(f[u]===tt&&(d=-1),u++);for(var h=[];Qr(f[u]);)h.push(f[u++]);var E=h.length?parseInt(o.apply(void 0,h),10):0;f[u]===Ot&&u++;for(var I=[];Qr(f[u]);)I.push(f[u++]);var J=I.length,de=J?parseInt(o.apply(void 0,I),10):0;(f[u]===Gr||f[u]===xr)&&u++;var he=1;(f[u]===Re||f[u]===tt)&&(f[u]===tt&&(he=-1),u++);for(var Pe=[];Qr(f[u]);)Pe.push(f[u++]);var Ve=Pe.length?parseInt(o.apply(void 0,Pe),10):0;return d*(E+de*Math.pow(10,-J))*Math.pow(10,he*Ve)},Wn={type:2},si={type:3},ri={type:4},hn={type:13},Bi={type:8},li={type:21},Zn={type:9},ui={type:10},Ti={type:11},Hi={type:12},gi={type:14},hi={type:23},Ei={type:1},zn={type:25},pi={type:24},Ki={type:26},Xn={type:27},Qn={type:28},An={type:29},kn={type:31},ci={type:32},Ii=function(){function f(){this._value=[]}return f.prototype.write=function(u){this._value=this._value.concat(H(u))},f.prototype.read=function(){for(var u=[],d=this.consumeToken();d!==ci;)u.push(d),d=this.consumeToken();return u},f.prototype.consumeToken=function(){var u=this.consumeCodePoint();switch(u){case an:return this.consumeStringToken(an);case ii:var d=this.peekCodePoint(0),h=this.peekCodePoint(1),E=this.peekCodePoint(2);if(Vn(d)||pn(h,E)){var I=bn(d,h,E)?en:In,J=this.consumeName();return{type:5,value:J,flags:I}}break;case Hr:if(this.peekCodePoint(0)===gn)return this.consumeCodePoint(),hn;break;case Cn:return this.consumeStringToken(Cn);case wr:return Wn;case kr:return si;case pe:if(this.peekCodePoint(0)===gn)return this.consumeCodePoint(),gi;break;case Re:if(Sn(u,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(u),this.consumeNumericToken();break;case je:return ri;case tt:var de=u,he=this.peekCodePoint(0),Pe=this.peekCodePoint(1);if(Sn(de,he,Pe))return this.reconsumeCodePoint(u),this.consumeNumericToken();if(bn(de,he,Pe))return this.reconsumeCodePoint(u),this.consumeIdentLikeToken();if(he===tt&&Pe===Mt)return this.consumeCodePoint(),this.consumeCodePoint(),pi;break;case Ot:if(Sn(u,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(u),this.consumeNumericToken();break;case Rn:if(this.peekCodePoint(0)===pe)for(this.consumeCodePoint();;){var Ve=this.consumeCodePoint();if(Ve===pe&&(Ve=this.consumeCodePoint(),Ve===Rn))return this.consumeToken();if(Ve===$t)return this.consumeToken()}break;case ct:return Ki;case dt:return Xn;case mt:if(this.peekCodePoint(0)===wt&&this.peekCodePoint(1)===tt&&this.peekCodePoint(2)===tt)return this.consumeCodePoint(),this.consumeCodePoint(),zn;break;case ht:var et=this.peekCodePoint(0),xt=this.peekCodePoint(1),gr=this.peekCodePoint(2);if(bn(et,xt,gr)){var J=this.consumeName();return{type:7,value:J}}break;case vt:return Qn;case Hn:if(pn(u,this.peekCodePoint(0)))return this.reconsumeCodePoint(u),this.consumeIdentLikeToken();break;case Gt:return An;case qt:if(this.peekCodePoint(0)===gn)return this.consumeCodePoint(),Bi;break;case yr:return Ti;case Rr:return Hi;case er:case Br:var Xt=this.peekCodePoint(0),cr=this.peekCodePoint(1);return Xt===Re&&(ln(cr)||cr===Zr)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(u),this.consumeIdentLikeToken();case Dr:if(this.peekCodePoint(0)===gn)return this.consumeCodePoint(),Zn;if(this.peekCodePoint(0)===Dr)return this.consumeCodePoint(),li;break;case Q:if(this.peekCodePoint(0)===gn)return this.consumeCodePoint(),ui;break;case $t:return ci}return sn(u)?(this.consumeWhiteSpace(),kn):Qr(u)?(this.reconsumeCodePoint(u),this.consumeNumericToken()):rn(u)?(this.reconsumeCodePoint(u),this.consumeIdentLikeToken()):{type:6,value:o(u)}},f.prototype.consumeCodePoint=function(){var u=this._value.shift();return typeof u=="undefined"?-1:u},f.prototype.reconsumeCodePoint=function(u){this._value.unshift(u)},f.prototype.peekCodePoint=function(u){return u>=this._value.length?-1:this._value[u]},f.prototype.consumeUnicodeRangeToken=function(){for(var u=[],d=this.consumeCodePoint();ln(d)&&u.length<6;)u.push(d),d=this.consumeCodePoint();for(var h=!1;d===Zr&&u.length<6;)u.push(d),d=this.consumeCodePoint(),h=!0;if(h){var E=parseInt(o.apply(void 0,u.map(function(he){return he===Zr?Zt:he})),16),I=parseInt(o.apply(void 0,u.map(function(he){return he===Zr?Tr:he})),16);return{type:30,start:E,end:I}}var J=parseInt(o.apply(void 0,u),16);if(this.peekCodePoint(0)===tt&&ln(this.peekCodePoint(1))){this.consumeCodePoint(),d=this.consumeCodePoint();for(var de=[];ln(d)&&de.length<6;)de.push(d),d=this.consumeCodePoint();var I=parseInt(o.apply(void 0,de),16);return{type:30,start:J,end:I}}else return{type:30,start:J,end:J}},f.prototype.consumeIdentLikeToken=function(){var u=this.consumeName();return u.toLowerCase()==="url"&&this.peekCodePoint(0)===wr?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===wr?(this.consumeCodePoint(),{type:19,value:u}):{type:20,value:u}},f.prototype.consumeUrlToken=function(){var u=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===$t)return{type:22,value:""};var d=this.peekCodePoint(0);if(d===Cn||d===an){var h=this.consumeStringToken(this.consumeCodePoint());return h.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===$t||this.peekCodePoint(0)===kr)?(this.consumeCodePoint(),{type:22,value:h.value}):(this.consumeBadUrlRemnants(),hi)}for(;;){var E=this.consumeCodePoint();if(E===$t||E===kr)return{type:22,value:o.apply(void 0,u)};if(sn(E))return this.consumeWhiteSpace(),this.peekCodePoint(0)===$t||this.peekCodePoint(0)===kr?(this.consumeCodePoint(),{type:22,value:o.apply(void 0,u)}):(this.consumeBadUrlRemnants(),hi);if(E===an||E===Cn||E===wr||sr(E))return this.consumeBadUrlRemnants(),hi;if(E===Hn)if(pn(E,this.peekCodePoint(0)))u.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),hi;else u.push(E)}},f.prototype.consumeWhiteSpace=function(){for(;sn(this.peekCodePoint(0));)this.consumeCodePoint()},f.prototype.consumeBadUrlRemnants=function(){for(;;){var u=this.consumeCodePoint();if(u===kr||u===$t)return;pn(u,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},f.prototype.consumeStringSlice=function(u){for(var d=5e4,h="";u>0;){var E=Math.min(d,u);h+=o.apply(void 0,this._value.splice(0,E)),u-=E}return this._value.shift(),h},f.prototype.consumeStringToken=function(u){var d="",h=0;do{var E=this._value[h];if(E===$t||E===void 0||E===u)return d+=this.consumeStringSlice(h),{type:0,value:d};if(E===Nn)return this._value.splice(0,h),Ei;if(E===Hn){var I=this._value[h+1];I!==$t&&I!==void 0&&(I===Nn?(d+=this.consumeStringSlice(h),h=-1,this._value.shift()):pn(E,I)&&(d+=this.consumeStringSlice(h),d+=o(this.consumeEscapedCodePoint()),h=-1))}h++}while(!0)},f.prototype.consumeNumber=function(){var u=[],d=Fn,h=this.peekCodePoint(0);for((h===Re||h===tt)&&u.push(this.consumeCodePoint());Qr(this.peekCodePoint(0));)u.push(this.consumeCodePoint());h=this.peekCodePoint(0);var E=this.peekCodePoint(1);if(h===Ot&&Qr(E))for(u.push(this.consumeCodePoint(),this.consumeCodePoint()),d=mn;Qr(this.peekCodePoint(0));)u.push(this.consumeCodePoint());h=this.peekCodePoint(0),E=this.peekCodePoint(1);var I=this.peekCodePoint(2);if((h===Gr||h===xr)&&((E===Re||E===tt)&&Qr(I)||Qr(E)))for(u.push(this.consumeCodePoint(),this.consumeCodePoint()),d=mn;Qr(this.peekCodePoint(0));)u.push(this.consumeCodePoint());return[vn(u),d]},f.prototype.consumeNumericToken=function(){var u=this.consumeNumber(),d=u[0],h=u[1],E=this.peekCodePoint(0),I=this.peekCodePoint(1),J=this.peekCodePoint(2);if(bn(E,I,J)){var de=this.consumeName();return{type:15,number:d,flags:h,unit:de}}return E===ti?(this.consumeCodePoint(),{type:16,number:d,flags:h}):{type:17,number:d,flags:h}},f.prototype.consumeEscapedCodePoint=function(){var u=this.consumeCodePoint();if(ln(u)){for(var d=o(u);ln(this.peekCodePoint(0))&&d.length<6;)d+=o(this.consumeCodePoint());sn(this.peekCodePoint(0))&&this.consumeCodePoint();var h=parseInt(d,16);return h===0||Xr(h)||h>1114111?oe:h}return u===$t?oe:u},f.prototype.consumeName=function(){for(var u="";;){var d=this.consumeCodePoint();if(Vn(d))u+=o(d);else if(pn(d,this.peekCodePoint(0)))u+=o(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(d),u}},f}(),Di=function(){function f(u){this._tokens=u}return f.create=function(u){var d=new Ii;return d.write(u),new f(d.read())},f.parseValue=function(u){return f.create(u).parseComponentValue()},f.parseValues=function(u){return f.create(u).parseComponentValues()},f.prototype.parseComponentValue=function(){for(var u=this.consumeToken();u.type===31;)u=this.consumeToken();if(u.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(u);var d=this.consumeComponentValue();do u=this.consumeToken();while(u.type===31);if(u.type===32)return d;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},f.prototype.parseComponentValues=function(){for(var u=[];;){var d=this.consumeComponentValue();if(d.type===32)return u;u.push(d),u.push()}},f.prototype.consumeComponentValue=function(){var u=this.consumeToken();switch(u.type){case 11:case 28:case 2:return this.consumeSimpleBlock(u.type);case 19:return this.consumeFunction(u)}return u},f.prototype.consumeSimpleBlock=function(u){for(var d={type:u,values:[]},h=this.consumeToken();;){if(h.type===32||ji(h,u))return d;this.reconsumeToken(h),d.values.push(this.consumeComponentValue()),h=this.consumeToken()}},f.prototype.consumeFunction=function(u){for(var d={name:u.value,values:[],type:18};;){var h=this.consumeToken();if(h.type===32||h.type===3)return d;this.reconsumeToken(h),d.values.push(this.consumeComponentValue())}},f.prototype.consumeToken=function(){var u=this._tokens.shift();return typeof u=="undefined"?ci:u},f.prototype.reconsumeToken=function(u){this._tokens.unshift(u)},f}(),Oi=function(f){return f.type===15},wi=function(f){return f.type===17},Bn=function(f){return f.type===20},pr=function(f){return f.type===0},Nr=function(f,u){return Bn(f)&&f.value===u},En=function(f){return f.type!==31},xn=function(f){return f.type!==31&&f.type!==4},yn=function(f){var u=[],d=[];return f.forEach(function(h){if(h.type===4){if(d.length===0)throw new Error("Error parsing function args, zero tokens for arg");u.push(d),d=[];return}h.type!==31&&d.push(h)}),d.length&&u.push(d),u},ji=function(f,u){return u===11&&f.type===12||u===28&&f.type===29?!0:u===2&&f.type===3},jn=function(f){return f.type===17||f.type===15},Kn=function(f){return f.type===16||jn(f)},$i=function(f){return f.length>1?[f[0],f[1]]:[f[0]]},ni={type:17,number:0,flags:Fn},Ci={type:16,number:50,flags:Fn},Gi={type:16,number:100,flags:Fn},Ss=function(f,u,d){var h=f[0],E=f[1];return[Dn(h,u),Dn(typeof E!="undefined"?E:h,d)]},Dn=function(f,u){if(f.type===16)return f.number/100*u;if(Oi(f))switch(f.unit){case"rem":case"em":return 16*f.number;case"px":default:return f.number}return f.number},Es="deg",eA="grad",Ts="rad",Yi="turn",As={name:"angle",parse:function(f,u){if(u.type===15)switch(u.unit){case Es:return Math.PI*u.number/180;case eA:return Math.PI/200*u.number;case Ts:return u.number;case Yi:return Math.PI*2*u.number}throw new Error("Unsupported angle type")}},Ms=function(f){return f.type===15&&(f.unit===Es||f.unit===eA||f.unit===Ts||f.unit===Yi)},tA=function(f){var u=f.filter(Bn).map(function(d){return d.value}).join(" ");switch(u){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ni,ni];case"to top":case"bottom":return $n(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ni,Gi];case"to right":case"left":return $n(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Gi,Gi];case"to bottom":case"top":return $n(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Gi,ni];case"to left":case"right":return $n(270)}return 0},$n=function(f){return Math.PI*f/180},Vi={name:"color",parse:function(f,u){if(u.type===18){var d=Hs[u.name];if(typeof d=="undefined")throw new Error('Attempting to parse an unsupported color function "'+u.name+'"');return d(f,u.values)}if(u.type===5){if(u.value.length===3){var h=u.value.substring(0,1),E=u.value.substring(1,2),I=u.value.substring(2,3);return Xi(parseInt(h+h,16),parseInt(E+E,16),parseInt(I+I,16),1)}if(u.value.length===4){var h=u.value.substring(0,1),E=u.value.substring(1,2),I=u.value.substring(2,3),J=u.value.substring(3,4);return Xi(parseInt(h+h,16),parseInt(E+E,16),parseInt(I+I,16),parseInt(J+J,16)/255)}if(u.value.length===6){var h=u.value.substring(0,2),E=u.value.substring(2,4),I=u.value.substring(4,6);return Xi(parseInt(h,16),parseInt(E,16),parseInt(I,16),1)}if(u.value.length===8){var h=u.value.substring(0,2),E=u.value.substring(2,4),I=u.value.substring(4,6),J=u.value.substring(6,8);return Xi(parseInt(h,16),parseInt(E,16),parseInt(I,16),parseInt(J,16)/255)}}if(u.type===20){var de=Pi[u.value.toUpperCase()];if(typeof de!="undefined")return de}return Pi.TRANSPARENT}},Li=function(f){return(255&f)===0},Jn=function(f){var u=255&f,d=255&f>>8,h=255&f>>16,E=255&f>>24;return u<255?"rgba("+E+","+h+","+d+","+u/255+")":"rgb("+E+","+h+","+d+")"},Xi=function(f,u,d,h){return(f<<24|u<<16|d<<8|Math.round(h*255)<<0)>>>0},_A=function(f,u){if(f.type===17)return f.number;if(f.type===16){var d=u===3?1:255;return u===3?f.number/100*d:Math.round(f.number/100*d)}return 0},vA=function(f,u){var d=u.filter(xn);if(d.length===3){var h=d.map(_A),E=h[0],I=h[1],J=h[2];return Xi(E,I,J,1)}if(d.length===4){var de=d.map(_A),E=de[0],I=de[1],J=de[2],he=de[3];return Xi(E,I,J,he)}return 0};function Ns(f,u,d){return d<0&&(d+=1),d>=1&&(d-=1),d<1/6?(u-f)*d*6+f:d<1/2?u:d<2/3?(u-f)*6*(2/3-d)+f:f}var as=function(f,u){var d=u.filter(xn),h=d[0],E=d[1],I=d[2],J=d[3],de=(h.type===17?$n(h.number):As.parse(f,h))/(Math.PI*2),he=Kn(E)?E.number/100:0,Pe=Kn(I)?I.number/100:0,Ve=typeof J!="undefined"&&Kn(J)?Dn(J,1):1;if(he===0)return Xi(Pe*255,Pe*255,Pe*255,1);var et=Pe<=.5?Pe*(he+1):Pe+he-Pe*he,xt=Pe*2-et,gr=Ns(xt,et,de+1/3),Xt=Ns(xt,et,de),cr=Ns(xt,et,de-1/3);return Xi(gr*255,Xt*255,cr*255,Ve)},Hs={hsl:as,hsla:as,rgb:vA,rgba:vA},os=function(f,u){return Vi.parse(f,Di.create(u).parseComponentValue())},Pi={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},yA={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(f,u){return u.map(function(d){if(Bn(d))switch(d.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},rA={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ji=function(f,u){var d=Vi.parse(f,u[0]),h=u[1];return h&&Kn(h)?{color:d,stop:h}:{color:d,stop:null}},nA=function(f,u){var d=f[0],h=f[f.length-1];d.stop===null&&(d.stop=ni),h.stop===null&&(h.stop=Gi);for(var E=[],I=0,J=0;J<f.length;J++){var de=f[J].stop;if(de!==null){var he=Dn(de,u);he>I?E.push(he):E.push(I),I=he}else E.push(null)}for(var Pe=null,J=0;J<E.length;J++){var Ve=E[J];if(Ve===null)Pe===null&&(Pe=J);else if(Pe!==null){for(var et=J-Pe,xt=E[Pe-1],gr=(Ve-xt)/(et+1),Xt=1;Xt<=et;Xt++)E[Pe+Xt-1]=gr*Xt;Pe=null}}return f.map(function(cr,nn){var Fr=cr.color;return{color:Fr,stop:Math.max(Math.min(1,E[nn]/u),0)}})},Is=function(f,u,d){var h=u/2,E=d/2,I=Dn(f[0],u)-h,J=E-Dn(f[1],d);return(Math.atan2(J,I)+Math.PI*2)%(Math.PI*2)},la=function(f,u,d){var h=typeof f=="number"?f:Is(f,u,d),E=Math.abs(u*Math.sin(h))+Math.abs(d*Math.cos(h)),I=u/2,J=d/2,de=E/2,he=Math.sin(h-Math.PI/2)*de,Pe=Math.cos(h-Math.PI/2)*de;return[E,I-Pe,I+Pe,J-he,J+he]},mi=function(f,u){return Math.sqrt(f*f+u*u)},iA=function(f,u,d,h,E){var I=[[0,0],[0,u],[f,0],[f,u]];return I.reduce(function(J,de){var he=de[0],Pe=de[1],Ve=mi(d-he,h-Pe);return(E?Ve<J.optimumDistance:Ve>J.optimumDistance)?{optimumCorner:de,optimumDistance:Ve}:J},{optimumDistance:E?1/0:-1/0,optimumCorner:null}).optimumCorner},ua=function(f,u,d,h,E){var I=0,J=0;switch(f.size){case 0:f.shape===0?I=J=Math.min(Math.abs(u),Math.abs(u-h),Math.abs(d),Math.abs(d-E)):f.shape===1&&(I=Math.min(Math.abs(u),Math.abs(u-h)),J=Math.min(Math.abs(d),Math.abs(d-E)));break;case 2:if(f.shape===0)I=J=Math.min(mi(u,d),mi(u,d-E),mi(u-h,d),mi(u-h,d-E));else if(f.shape===1){var de=Math.min(Math.abs(d),Math.abs(d-E))/Math.min(Math.abs(u),Math.abs(u-h)),he=iA(h,E,u,d,!0),Pe=he[0],Ve=he[1];I=mi(Pe-u,(Ve-d)/de),J=de*I}break;case 1:f.shape===0?I=J=Math.max(Math.abs(u),Math.abs(u-h),Math.abs(d),Math.abs(d-E)):f.shape===1&&(I=Math.max(Math.abs(u),Math.abs(u-h)),J=Math.max(Math.abs(d),Math.abs(d-E)));break;case 3:if(f.shape===0)I=J=Math.max(mi(u,d),mi(u,d-E),mi(u-h,d),mi(u-h,d-E));else if(f.shape===1){var de=Math.max(Math.abs(d),Math.abs(d-E))/Math.max(Math.abs(u),Math.abs(u-h)),et=iA(h,E,u,d,!1),Pe=et[0],Ve=et[1];I=mi(Pe-u,(Ve-d)/de),J=de*I}break}return Array.isArray(f.size)&&(I=Dn(f.size[0],h),J=f.size.length===2?Dn(f.size[1],E):I),[I,J]},BA=function(f,u){var d=$n(180),h=[];return yn(u).forEach(function(E,I){if(I===0){var J=E[0];if(J.type===20&&J.value==="to"){d=tA(E);return}else if(Ms(J)){d=As.parse(f,J);return}}var de=Ji(f,E);h.push(de)}),{angle:d,stops:h,type:1}},ls=function(f,u){var d=$n(180),h=[];return yn(u).forEach(function(E,I){if(I===0){var J=E[0];if(J.type===20&&["top","left","right","bottom"].indexOf(J.value)!==-1){d=tA(E);return}else if(Ms(J)){d=(As.parse(f,J)+$n(270))%$n(360);return}}var de=Ji(f,E);h.push(de)}),{angle:d,stops:h,type:1}},ca=function(f,u){var d=$n(180),h=[],E=1,I=0,J=3,de=[];return yn(u).forEach(function(he,Pe){var Ve=he[0];if(Pe===0){if(Bn(Ve)&&Ve.value==="linear"){E=1;return}else if(Bn(Ve)&&Ve.value==="radial"){E=2;return}}if(Ve.type===18){if(Ve.name==="from"){var et=Vi.parse(f,Ve.values[0]);h.push({stop:ni,color:et})}else if(Ve.name==="to"){var et=Vi.parse(f,Ve.values[0]);h.push({stop:Gi,color:et})}else if(Ve.name==="color-stop"){var xt=Ve.values.filter(xn);if(xt.length===2){var et=Vi.parse(f,xt[1]),gr=xt[0];wi(gr)&&h.push({stop:{type:16,number:gr.number*100,flags:gr.flags},color:et})}}}}),E===1?{angle:(d+$n(180))%$n(360),stops:h,type:E}:{size:J,shape:I,stops:h,position:de,type:E}},pt="closest-side",wn="farthest-side",On="closest-corner",fi="farthest-corner",di="circle",us="ellipse",Ds="cover",EA="contain",wA=function(f,u){var d=0,h=3,E=[],I=[];return yn(u).forEach(function(J,de){var he=!0;if(de===0){var Pe=!1;he=J.reduce(function(et,xt){if(Pe)if(Bn(xt))switch(xt.value){case"center":return I.push(Ci),et;case"top":case"left":return I.push(ni),et;case"right":case"bottom":return I.push(Gi),et}else(Kn(xt)||jn(xt))&&I.push(xt);else if(Bn(xt))switch(xt.value){case di:return d=0,!1;case us:return d=1,!1;case"at":return Pe=!0,!1;case pt:return h=0,!1;case Ds:case wn:return h=1,!1;case EA:case On:return h=2,!1;case fi:return h=3,!1}else if(jn(xt)||Kn(xt))return Array.isArray(h)||(h=[]),h.push(xt),!1;return et},he)}if(he){var Ve=Ji(f,J);E.push(Ve)}}),{size:h,shape:d,stops:E,position:I,type:2}},cs=function(f,u){var d=0,h=3,E=[],I=[];return yn(u).forEach(function(J,de){var he=!0;if(de===0?he=J.reduce(function(Ve,et){if(Bn(et))switch(et.value){case"center":return I.push(Ci),!1;case"top":case"left":return I.push(ni),!1;case"right":case"bottom":return I.push(Gi),!1}else if(Kn(et)||jn(et))return I.push(et),!1;return Ve},he):de===1&&(he=J.reduce(function(Ve,et){if(Bn(et))switch(et.value){case di:return d=0,!1;case us:return d=1,!1;case EA:case pt:return h=0,!1;case wn:return h=1,!1;case On:return h=2,!1;case Ds:case fi:return h=3,!1}else if(jn(et)||Kn(et))return Array.isArray(h)||(h=[]),h.push(et),!1;return Ve},he)),he){var Pe=Ji(f,J);E.push(Pe)}}),{size:h,shape:d,stops:E,position:I,type:2}},Wi=function(f){return f.type===1},qi=function(f){return f.type===2},sA={name:"image",parse:function(f,u){if(u.type===22){var d={url:u.value,type:0};return f.cache.addImage(u.value),d}if(u.type===18){var h=io[u.name];if(typeof h=="undefined")throw new Error('Attempting to parse an unsupported image function "'+u.name+'"');return h(f,u.values)}throw new Error("Unsupported image type "+u.type)}};function Fl(f){return!(f.type===20&&f.value==="none")&&(f.type!==18||!!io[f.name])}var io={"linear-gradient":BA,"-moz-linear-gradient":ls,"-ms-linear-gradient":ls,"-o-linear-gradient":ls,"-webkit-linear-gradient":ls,"radial-gradient":wA,"-moz-radial-gradient":cs,"-ms-radial-gradient":cs,"-o-radial-gradient":cs,"-webkit-radial-gradient":cs,"-webkit-gradient":ca},Sl={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(f,u){if(u.length===0)return[];var d=u[0];return d.type===20&&d.value==="none"?[]:u.filter(function(h){return xn(h)&&Fl(h)}).map(function(h){return sA.parse(f,h)})}},so={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(f,u){return u.map(function(d){if(Bn(d))switch(d.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},fa={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(f,u){return yn(u).map(function(d){return d.filter(Kn)}).map($i)}},CA={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(f,u){return yn(u).map(function(d){return d.filter(Bn).map(function(h){return h.value}).join(" ")}).map(AA)}},AA=function(f){switch(f){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},Ks;(function(f){f.AUTO="auto",f.CONTAIN="contain",f.COVER="cover"})(Ks||(Ks={}));var Ao={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(f,u){return yn(u).map(function(d){return d.filter(ao)})}},ao=function(f){return Bn(f)||Kn(f)},$s=function(f){return{name:"border-"+f+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Tl=$s("top"),bA=$s("right"),Il=$s("bottom"),Dl=$s("left"),aA=function(f){return{name:"border-radius-"+f,initialValue:"0 0",prefix:!1,type:1,parse:function(u,d){return $i(d.filter(Kn))}}},oo=aA("top-left"),Ll=aA("top-right"),lo=aA("bottom-right"),Ul=aA("bottom-left"),xA=function(f){return{name:"border-"+f+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(u,d){switch(d){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},ha=xA("top"),Rl=xA("right"),Ql=xA("bottom"),kl=xA("left"),FA=function(f){return{name:"border-"+f+"-width",initialValue:"0",type:0,prefix:!1,parse:function(u,d){return Oi(d)?d.number:0}}},Ol=FA("top"),Pl=FA("right"),Ml=FA("bottom"),Nl=FA("left"),Hl={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},SA={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(f,u){switch(u){case"rtl":return 1;case"ltr":default:return 0}}},Kl={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(f,u){return u.filter(Bn).reduce(function(d,h){return d|uo(h.value)},0)}},uo=function(f){switch(f){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},co={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(f,u){switch(u){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},$l={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(f,u){return u.type===20&&u.value==="normal"?0:u.type===17||u.type===15?u.number:0}},Gs;(function(f){f.NORMAL="normal",f.STRICT="strict"})(Gs||(Gs={}));var Ui={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(f,u){switch(u){case"strict":return Gs.STRICT;case"normal":default:return Gs.NORMAL}}},es={name:"line-height",initialValue:"normal",prefix:!1,type:4},TA=function(f,u){return Bn(f)&&f.value==="normal"?1.2*u:f.type===17?u*f.number:Kn(f)?Dn(f,u):u},Gl={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(f,u){return u.type===20&&u.value==="none"?null:sA.parse(f,u)}},IA={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(f,u){switch(u){case"inside":return 0;case"outside":default:return 1}}},da={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(f,u){switch(u){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},DA=function(f){return{name:"margin-"+f,initialValue:"0",prefix:!1,type:4}},Vl=DA("top"),Wl=DA("right"),fo=DA("bottom"),ho=DA("left"),ga={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(f,u){return u.filter(Bn).map(function(d){switch(d.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},go={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(f,u){switch(u){case"break-word":return"break-word";case"normal":default:return"normal"}}},LA=function(f){return{name:"padding-"+f,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},po=LA("top"),Zl=LA("right"),mo=LA("bottom"),zl=LA("left"),_o={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(f,u){switch(u){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},jl={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(f,u){switch(u){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Yl={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(f,u){return u.length===1&&Nr(u[0],"none")?[]:yn(u).map(function(d){for(var h={color:Pi.TRANSPARENT,offsetX:ni,offsetY:ni,blur:ni},E=0,I=0;I<d.length;I++){var J=d[I];jn(J)?(E===0?h.offsetX=J:E===1?h.offsetY=J:h.blur=J,E++):h.color=Vi.parse(f,J)}return h})}},Xl={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(f,u){switch(u){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},vo={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(f,u){if(u.type===20&&u.value==="none")return null;if(u.type===18){var d=oA[u.name];if(typeof d=="undefined")throw new Error('Attempting to parse an unsupported transform function "'+u.name+'"');return d(u.values)}return null}},Jl=function(f){var u=f.filter(function(d){return d.type===17}).map(function(d){return d.number});return u.length===6?u:null},yo=function(f){var u=f.filter(function(he){return he.type===17}).map(function(he){return he.number}),d=u[0],h=u[1];u[2],u[3];var E=u[4],I=u[5];u[6],u[7],u[8],u[9],u[10],u[11];var J=u[12],de=u[13];return u[14],u[15],u.length===16?[d,h,E,I,J,de]:null},oA={matrix:Jl,matrix3d:yo},Bo={type:16,number:50,flags:Fn},ql=[Bo,Bo],Ai={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(f,u){var d=u.filter(Kn);return d.length!==2?ql:[d[0],d[1]]}},ws={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(f,u){switch(u){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},Ls;(function(f){f.NORMAL="normal",f.BREAK_ALL="break-all",f.KEEP_ALL="keep-all"})(Ls||(Ls={}));for(var eu={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(f,u){switch(u){case"break-all":return Ls.BREAK_ALL;case"keep-all":return Ls.KEEP_ALL;case"normal":default:return Ls.NORMAL}}},tu={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(f,u){if(u.type===20)return{auto:!0,order:0};if(wi(u))return{auto:!1,order:u.number};throw new Error("Invalid z-index number parsed")}},UA={name:"time",parse:function(f,u){if(u.type===15)switch(u.unit.toLowerCase()){case"s":return 1e3*u.number;case"ms":return u.number}throw new Error("Unsupported time type")}},pa={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(f,u){return wi(u)?u.number:1}},Vs={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ru={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(f,u){return u.filter(Bn).map(function(d){switch(d.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(d){return d!==0})}},Cs={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(f,u){var d=[],h=[];return u.forEach(function(E){switch(E.type){case 20:case 0:d.push(E.value);break;case 17:d.push(E.number.toString());break;case 4:h.push(d.join(" ")),d.length=0;break}}),d.length&&h.push(d.join(" ")),h.map(function(E){return E.indexOf(" ")===-1?E:"'"+E+"'"})}},Je={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},Eo={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(f,u){if(wi(u))return u.number;if(Bn(u))switch(u.value){case"bold":return 700;case"normal":default:return 400}return 400}},ma={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(f,u){return u.filter(Bn).map(function(d){return d.value})}},nu={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(f,u){switch(u){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},Gn=function(f,u){return(f&u)!==0},iu={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(f,u){if(u.length===0)return[];var d=u[0];return d.type===20&&d.value==="none"?[]:u}},su={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(f,u){if(u.length===0)return null;var d=u[0];if(d.type===20&&d.value==="none")return null;for(var h=[],E=u.filter(En),I=0;I<E.length;I++){var J=E[I],de=E[I+1];if(J.type===20){var he=de&&wi(de)?de.number:1;h.push({counter:J.value,increment:he})}}return h}},Au={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(f,u){if(u.length===0)return[];for(var d=[],h=u.filter(En),E=0;E<h.length;E++){var I=h[E],J=h[E+1];if(Bn(I)&&I.value!=="none"){var de=J&&wi(J)?J.number:0;d.push({counter:I.value,reset:de})}}return d}},au={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(f,u){return u.filter(Oi).map(function(d){return UA.parse(f,d)})}},ou={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(f,u){if(u.length===0)return null;var d=u[0];if(d.type===20&&d.value==="none")return null;var h=[],E=u.filter(pr);if(E.length%2!==0)return null;for(var I=0;I<E.length;I+=2){var J=E[I].value,de=E[I+1].value;h.push({open:J,close:de})}return h}},Us=function(f,u,d){if(!f)return"";var h=f[Math.min(u,f.length-1)];return h?d?h.open:h.close:""},_a={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(f,u){return u.length===1&&Nr(u[0],"none")?[]:yn(u).map(function(d){for(var h={color:255,offsetX:ni,offsetY:ni,blur:ni,spread:ni,inset:!1},E=0,I=0;I<d.length;I++){var J=d[I];Nr(J,"inset")?h.inset=!0:jn(J)?(E===0?h.offsetX=J:E===1?h.offsetY=J:E===2?h.blur=J:h.spread=J,E++):h.color=Vi.parse(f,J)}return h})}},wo={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(f,u){var d=[0,1,2],h=[];return u.filter(Bn).forEach(function(E){switch(E.value){case"stroke":h.push(1);break;case"fill":h.push(0);break;case"markers":h.push(2);break}}),d.forEach(function(E){h.indexOf(E)===-1&&h.push(E)}),h}},RA={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Mi={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(f,u){return Oi(u)?u.number:0}},lu=function(){function f(u,d){var h,E;this.animationDuration=mr(u,au,d.animationDuration),this.backgroundClip=mr(u,yA,d.backgroundClip),this.backgroundColor=mr(u,rA,d.backgroundColor),this.backgroundImage=mr(u,Sl,d.backgroundImage),this.backgroundOrigin=mr(u,so,d.backgroundOrigin),this.backgroundPosition=mr(u,fa,d.backgroundPosition),this.backgroundRepeat=mr(u,CA,d.backgroundRepeat),this.backgroundSize=mr(u,Ao,d.backgroundSize),this.borderTopColor=mr(u,Tl,d.borderTopColor),this.borderRightColor=mr(u,bA,d.borderRightColor),this.borderBottomColor=mr(u,Il,d.borderBottomColor),this.borderLeftColor=mr(u,Dl,d.borderLeftColor),this.borderTopLeftRadius=mr(u,oo,d.borderTopLeftRadius),this.borderTopRightRadius=mr(u,Ll,d.borderTopRightRadius),this.borderBottomRightRadius=mr(u,lo,d.borderBottomRightRadius),this.borderBottomLeftRadius=mr(u,Ul,d.borderBottomLeftRadius),this.borderTopStyle=mr(u,ha,d.borderTopStyle),this.borderRightStyle=mr(u,Rl,d.borderRightStyle),this.borderBottomStyle=mr(u,Ql,d.borderBottomStyle),this.borderLeftStyle=mr(u,kl,d.borderLeftStyle),this.borderTopWidth=mr(u,Ol,d.borderTopWidth),this.borderRightWidth=mr(u,Pl,d.borderRightWidth),this.borderBottomWidth=mr(u,Ml,d.borderBottomWidth),this.borderLeftWidth=mr(u,Nl,d.borderLeftWidth),this.boxShadow=mr(u,_a,d.boxShadow),this.color=mr(u,Hl,d.color),this.direction=mr(u,SA,d.direction),this.display=mr(u,Kl,d.display),this.float=mr(u,co,d.cssFloat),this.fontFamily=mr(u,Cs,d.fontFamily),this.fontSize=mr(u,Je,d.fontSize),this.fontStyle=mr(u,nu,d.fontStyle),this.fontVariant=mr(u,ma,d.fontVariant),this.fontWeight=mr(u,Eo,d.fontWeight),this.letterSpacing=mr(u,$l,d.letterSpacing),this.lineBreak=mr(u,Ui,d.lineBreak),this.lineHeight=mr(u,es,d.lineHeight),this.listStyleImage=mr(u,Gl,d.listStyleImage),this.listStylePosition=mr(u,IA,d.listStylePosition),this.listStyleType=mr(u,da,d.listStyleType),this.marginTop=mr(u,Vl,d.marginTop),this.marginRight=mr(u,Wl,d.marginRight),this.marginBottom=mr(u,fo,d.marginBottom),this.marginLeft=mr(u,ho,d.marginLeft),this.opacity=mr(u,pa,d.opacity);var I=mr(u,ga,d.overflow);this.overflowX=I[0],this.overflowY=I[I.length>1?1:0],this.overflowWrap=mr(u,go,d.overflowWrap),this.paddingTop=mr(u,po,d.paddingTop),this.paddingRight=mr(u,Zl,d.paddingRight),this.paddingBottom=mr(u,mo,d.paddingBottom),this.paddingLeft=mr(u,zl,d.paddingLeft),this.paintOrder=mr(u,wo,d.paintOrder),this.position=mr(u,jl,d.position),this.textAlign=mr(u,_o,d.textAlign),this.textDecorationColor=mr(u,Vs,(h=d.textDecorationColor)!==null&&h!==void 0?h:d.color),this.textDecorationLine=mr(u,ru,(E=d.textDecorationLine)!==null&&E!==void 0?E:d.textDecoration),this.textShadow=mr(u,Yl,d.textShadow),this.textTransform=mr(u,Xl,d.textTransform),this.transform=mr(u,vo,d.transform),this.transformOrigin=mr(u,Ai,d.transformOrigin),this.visibility=mr(u,ws,d.visibility),this.webkitTextStrokeColor=mr(u,RA,d.webkitTextStrokeColor),this.webkitTextStrokeWidth=mr(u,Mi,d.webkitTextStrokeWidth),this.wordBreak=mr(u,eu,d.wordBreak),this.zIndex=mr(u,tu,d.zIndex)}return f.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},f.prototype.isTransparent=function(){return Li(this.backgroundColor)},f.prototype.isTransformed=function(){return this.transform!==null},f.prototype.isPositioned=function(){return this.position!==0},f.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},f.prototype.isFloating=function(){return this.float!==0},f.prototype.isInlineLevel=function(){return Gn(this.display,4)||Gn(this.display,33554432)||Gn(this.display,268435456)||Gn(this.display,536870912)||Gn(this.display,67108864)||Gn(this.display,134217728)},f}(),Co=function(){function f(u,d){this.content=mr(u,iu,d.content),this.quotes=mr(u,ou,d.quotes)}return f}(),va=function(){function f(u,d){this.counterIncrement=mr(u,su,d.counterIncrement),this.counterReset=mr(u,Au,d.counterReset)}return f}(),mr=function(f,u,d){var h=new Ii,E=d!==null&&typeof d!="undefined"?d.toString():u.initialValue;h.write(E);var I=new Di(h.read());switch(u.type){case 2:var J=I.parseComponentValue();return u.parse(f,Bn(J)?J.value:u.initialValue);case 0:return u.parse(f,I.parseComponentValue());case 1:return u.parse(f,I.parseComponentValues());case 4:return I.parseComponentValue();case 3:switch(u.format){case"angle":return As.parse(f,I.parseComponentValue());case"color":return Vi.parse(f,I.parseComponentValue());case"image":return sA.parse(f,I.parseComponentValue());case"length":var de=I.parseComponentValue();return jn(de)?de:ni;case"length-percentage":var he=I.parseComponentValue();return Kn(he)?he:ni;case"time":return UA.parse(f,I.parseComponentValue())}break}},QA="data-html2canvas-debug",uu=function(f){var u=f.getAttribute(QA);switch(u){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},kA=function(f,u){var d=uu(f);return d===1||u===d},ai=function(){function f(u,d){if(this.context=u,this.textNodes=[],this.elements=[],this.flags=0,kA(d,3))debugger;this.styles=new lu(u,window.getComputedStyle(d,null)),ZA(d)&&(this.styles.animationDuration.some(function(h){return h>0})&&(d.style.animationDuration="0s"),this.styles.transform!==null&&(d.style.transform="none")),this.bounds=_(this.context,d),kA(d,4)&&(this.flags|=16)}return f}(),OA="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",ya="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lA=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),Ws=0;Ws<ya.length;Ws++)lA[ya.charCodeAt(Ws)]=Ws;for(var uA=function(f){var u=f.length*.75,d=f.length,h,E=0,I,J,de,he;f[f.length-1]==="="&&(u--,f[f.length-2]==="="&&u--);var Pe=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&typeof Uint8Array.prototype.slice!="undefined"?new ArrayBuffer(u):new Array(u),Ve=Array.isArray(Pe)?Pe:new Uint8Array(Pe);for(h=0;h<d;h+=4)I=lA[f.charCodeAt(h)],J=lA[f.charCodeAt(h+1)],de=lA[f.charCodeAt(h+2)],he=lA[f.charCodeAt(h+3)],Ve[E++]=I<<2|J>>4,Ve[E++]=(J&15)<<4|de>>2,Ve[E++]=(de&3)<<6|he&63;return Pe},cu=function(f){for(var u=f.length,d=[],h=0;h<u;h+=2)d.push(f[h+1]<<8|f[h]);return d},fu=function(f){for(var u=f.length,d=[],h=0;h<u;h+=4)d.push(f[h+3]<<24|f[h+2]<<16|f[h+1]<<8|f[h]);return d},bs=5,PA=11,MA=2,hu=PA-bs,NA=65536>>bs,bo=1<<bs,Rs=bo-1,Ba=1024>>bs,du=NA+Ba,gu=du,xo=32,Fo=gu+xo,pu=65536>>PA,mu=1<<hu,So=mu-1,To=function(f,u,d){return f.slice?f.slice(u,d):new Uint16Array(Array.prototype.slice.call(f,u,d))},Ea=function(f,u,d){return f.slice?f.slice(u,d):new Uint32Array(Array.prototype.slice.call(f,u,d))},wa=function(f,u){var d=uA(f),h=Array.isArray(d)?fu(d):new Uint32Array(d),E=Array.isArray(d)?cu(d):new Uint16Array(d),I=24,J=To(E,I/2,h[4]/2),de=h[5]===2?To(E,(I+h[4])/2):Ea(h,Math.ceil((I+h[4])/4));return new gc(h[0],h[1],h[2],h[3],J,de)},gc=function(){function f(u,d,h,E,I,J){this.initialValue=u,this.errorValue=d,this.highStart=h,this.highValueIndex=E,this.index=I,this.data=J}return f.prototype.get=function(u){var d;if(u>=0){if(u<55296||u>56319&&u<=65535)return d=this.index[u>>bs],d=(d<<MA)+(u&Rs),this.data[d];if(u<=65535)return d=this.index[NA+(u-55296>>bs)],d=(d<<MA)+(u&Rs),this.data[d];if(u<this.highStart)return d=Fo-pu+(u>>PA),d=this.index[d],d+=u>>bs&So,d=this.index[d],d=(d<<MA)+(u&Rs),this.data[d];if(u<=1114111)return this.data[this.highValueIndex]}return this.errorValue},f}(),_i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pc=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),HA=0;HA<_i.length;HA++)pc[_i.charCodeAt(HA)]=HA;var ts=1,Ca=2,ba=3,Io=4,Zi=5,Do=7,xa=8,Fa=9,Sa=10,Lo=11,Uo=12,Ro=13,Qo=14,Ta=15,ko=function(f){for(var u=[],d=0,h=f.length;d<h;){var E=f.charCodeAt(d++);if(E>=55296&&E<=56319&&d<h){var I=f.charCodeAt(d++);(I&64512)===56320?u.push(((E&1023)<<10)+(I&1023)+65536):(u.push(E),d--)}else u.push(E)}return u},_u=function(){for(var f=[],u=0;u<arguments.length;u++)f[u]=arguments[u];if(String.fromCodePoint)return String.fromCodePoint.apply(String,f);var d=f.length;if(!d)return"";for(var h=[],E=-1,I="";++E<d;){var J=f[E];J<=65535?h.push(J):(J-=65536,h.push((J>>10)+55296,J%1024+56320)),(E+1===d||h.length>16384)&&(I+=String.fromCharCode.apply(String,h),h.length=0)}return I},Oo=wa(OA),Ni="\xD7",Ia="\xF7",vu=function(f){return Oo.get(f)},yu=function(f,u,d){var h=d-2,E=u[h],I=u[d-1],J=u[d];if(I===Ca&&J===ba)return Ni;if(I===Ca||I===ba||I===Io||J===Ca||J===ba||J===Io)return Ia;if(I===xa&&[xa,Fa,Lo,Uo].indexOf(J)!==-1||(I===Lo||I===Fa)&&(J===Fa||J===Sa)||(I===Uo||I===Sa)&&J===Sa||J===Ro||J===Zi||J===Do||I===ts)return Ni;if(I===Ro&&J===Qo){for(;E===Zi;)E=u[--h];if(E===Qo)return Ni}if(I===Ta&&J===Ta){for(var de=0;E===Ta;)de++,E=u[--h];if(de%2===0)return Ni}return Ia},Bu=function(f){var u=ko(f),d=u.length,h=0,E=0,I=u.map(vu);return{next:function(){if(h>=d)return{done:!0,value:null};for(var J=Ni;h<d&&(J=yu(u,I,++h))===Ni;);if(J!==Ni||h===d){var de=_u.apply(null,u.slice(E,h));return E=h,{value:de,done:!1}}return{done:!0,value:null}}}},Eu=function(f){for(var u=Bu(f),d=[],h;!(h=u.next()).done;)h.value&&d.push(h.value.slice());return d},wu=function(f){var u=123;if(f.createRange){var d=f.createRange();if(d.getBoundingClientRect){var h=f.createElement("boundtest");h.style.height=u+"px",h.style.display="block",f.body.appendChild(h),d.selectNode(h);var E=d.getBoundingClientRect(),I=Math.round(E.height);if(f.body.removeChild(h),I===u)return!0}}return!1},Po=function(f){var u=f.createElement("boundtest");u.style.width="50px",u.style.display="block",u.style.fontSize="12px",u.style.letterSpacing="0px",u.style.wordSpacing="0px",f.body.appendChild(u);var d=f.createRange();u.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var h=u.firstChild,E=H(h.data).map(function(he){return o(he)}),I=0,J={},de=E.every(function(he,Pe){d.setStart(h,I),d.setEnd(h,I+he.length);var Ve=d.getBoundingClientRect();I+=he.length;var et=Ve.x>J.x||Ve.y>J.y;return J=Ve,Pe===0?!0:et});return f.body.removeChild(u),de},Da=function(){return typeof new Image().crossOrigin!="undefined"},Cu=function(){return typeof new XMLHttpRequest().responseType=="string"},La=function(f){var u=new Image,d=f.createElement("canvas"),h=d.getContext("2d");if(!h)return!1;u.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{h.drawImage(u,0,0),d.toDataURL()}catch(E){return!1}return!0},KA=function(f){return f[0]===0&&f[1]===255&&f[2]===0&&f[3]===255},Mo=function(f){var u=f.createElement("canvas"),d=100;u.width=d,u.height=d;var h=u.getContext("2d");if(!h)return Promise.reject(!1);h.fillStyle="rgb(0, 255, 0)",h.fillRect(0,0,d,d);var E=new Image,I=u.toDataURL();E.src=I;var J=Ua(d,d,0,0,E);return h.fillStyle="red",h.fillRect(0,0,d,d),No(J).then(function(de){h.drawImage(de,0,0);var he=h.getImageData(0,0,d,d).data;h.fillStyle="red",h.fillRect(0,0,d,d);var Pe=f.createElement("div");return Pe.style.backgroundImage="url("+I+")",Pe.style.height=d+"px",KA(he)?No(Ua(d,d,0,0,Pe)):Promise.reject(!1)}).then(function(de){return h.drawImage(de,0,0),KA(h.getImageData(0,0,d,d).data)}).catch(function(){return!1})},Ua=function(f,u,d,h,E){var I="http://www.w3.org/2000/svg",J=document.createElementNS(I,"svg"),de=document.createElementNS(I,"foreignObject");return J.setAttributeNS(null,"width",f.toString()),J.setAttributeNS(null,"height",u.toString()),de.setAttributeNS(null,"width","100%"),de.setAttributeNS(null,"height","100%"),de.setAttributeNS(null,"x",d.toString()),de.setAttributeNS(null,"y",h.toString()),de.setAttributeNS(null,"externalResourcesRequired","true"),J.appendChild(de),de.appendChild(E),J},No=function(f){return new Promise(function(u,d){var h=new Image;h.onload=function(){return u(h)},h.onerror=d,h.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(f))})},oi={get SUPPORT_RANGE_BOUNDS(){var f=wu(document);return Object.defineProperty(oi,"SUPPORT_RANGE_BOUNDS",{value:f}),f},get SUPPORT_WORD_BREAKING(){var f=oi.SUPPORT_RANGE_BOUNDS&&Po(document);return Object.defineProperty(oi,"SUPPORT_WORD_BREAKING",{value:f}),f},get SUPPORT_SVG_DRAWING(){var f=La(document);return Object.defineProperty(oi,"SUPPORT_SVG_DRAWING",{value:f}),f},get SUPPORT_FOREIGNOBJECT_DRAWING(){var f=typeof Array.from=="function"&&typeof window.fetch=="function"?Mo(document):Promise.resolve(!1);return Object.defineProperty(oi,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:f}),f},get SUPPORT_CORS_IMAGES(){var f=Da();return Object.defineProperty(oi,"SUPPORT_CORS_IMAGES",{value:f}),f},get SUPPORT_RESPONSE_TYPE(){var f=Cu();return Object.defineProperty(oi,"SUPPORT_RESPONSE_TYPE",{value:f}),f},get SUPPORT_CORS_XHR(){var f="withCredentials"in new XMLHttpRequest;return Object.defineProperty(oi,"SUPPORT_CORS_XHR",{value:f}),f},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var f=!!(typeof Intl!="undefined"&&Intl.Segmenter);return Object.defineProperty(oi,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:f}),f}},bi=function(){function f(u,d){this.text=u,this.bounds=d}return f}(),Yn=function(f,u,d,h){var E=xu(u,d),I=[],J=0;return E.forEach(function(de){if(d.textDecorationLine.length||de.trim().length>0)if(oi.SUPPORT_RANGE_BOUNDS){var he=fs(h,J,de.length).getClientRects();if(he.length>1){var Pe=Ra(de),Ve=0;Pe.forEach(function(xt){I.push(new bi(xt,Y.fromDOMRectList(f,fs(h,Ve+J,xt.length).getClientRects()))),Ve+=xt.length})}else I.push(new bi(de,Y.fromDOMRectList(f,he)))}else{var et=h.splitText(de.length);I.push(new bi(de,Qs(f,h))),h=et}else oi.SUPPORT_RANGE_BOUNDS||(h=h.splitText(de.length));J+=de.length}),I},Qs=function(f,u){var d=u.ownerDocument;if(d){var h=d.createElement("html2canvaswrapper");h.appendChild(u.cloneNode(!0));var E=u.parentNode;if(E){E.replaceChild(h,u);var I=_(f,h);return h.firstChild&&E.replaceChild(h.firstChild,h),I}}return Y.EMPTY},fs=function(f,u,d){var h=f.ownerDocument;if(!h)throw new Error("Node has no owner document");var E=h.createRange();return E.setStart(f,u),E.setEnd(f,u+d),E},Ra=function(f){if(oi.SUPPORT_NATIVE_TEXT_SEGMENTATION){var u=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(u.segment(f)).map(function(d){return d.segment})}return Eu(f)},bu=function(f,u){if(oi.SUPPORT_NATIVE_TEXT_SEGMENTATION){var d=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(d.segment(f)).map(function(h){return h.segment})}return Su(f,u)},xu=function(f,u){return u.letterSpacing!==0?Ra(f):bu(f,u)},Fu=[32,160,4961,65792,65793,4153,4241],Su=function(f,u){for(var d=Mr(f,{lineBreak:u.lineBreak,wordBreak:u.overflowWrap==="break-word"?"break-word":u.wordBreak}),h=[],E,I=function(){if(E.value){var J=E.value.slice(),de=H(J),he="";de.forEach(function(Pe){Fu.indexOf(Pe)===-1?he+=o(Pe):(he.length&&h.push(he),h.push(o(Pe)),he="")}),he.length&&h.push(he)}};!(E=d.next()).done;)I();return h},Tu=function(){function f(u,d,h){this.text=Ho(d.data,h.textTransform),this.textBounds=Yn(u,this.text,h,d)}return f}(),Ho=function(f,u){switch(u){case 1:return f.toLowerCase();case 3:return f.replace(Iu,$A);case 2:return f.toUpperCase();default:return f}},Iu=/(^|\s|:|-|\(|\))([a-z])/g,$A=function(f,u,d){return f.length>0?u+d.toUpperCase():f},GA=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this;return E.src=h.currentSrc||h.src,E.intrinsicWidth=h.naturalWidth,E.intrinsicHeight=h.naturalHeight,E.context.cache.addImage(E.src),E}return u}(ai),cA=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this;return E.canvas=h,E.intrinsicWidth=h.width,E.intrinsicHeight=h.height,E}return u}(ai),Du=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this,I=new XMLSerializer,J=_(d,h);return h.setAttribute("width",J.width+"px"),h.setAttribute("height",J.height+"px"),E.svg="data:image/svg+xml,"+encodeURIComponent(I.serializeToString(h)),E.intrinsicWidth=h.width.baseVal.value,E.intrinsicHeight=h.height.baseVal.value,E.context.cache.addImage(E.svg),E}return u}(ai),Ko=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this;return E.value=h.value,E}return u}(ai),VA=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this;return E.start=h.start,E.reversed=typeof h.reversed=="boolean"&&h.reversed===!0,E}return u}(ai),$o=[{type:15,flags:0,unit:"px",number:3}],Qa=[{type:16,flags:0,number:50}],Lu=function(f){return f.width>f.height?new Y(f.left+(f.width-f.height)/2,f.top,f.height,f.height):f.width<f.height?new Y(f.left,f.top+(f.height-f.width)/2,f.width,f.width):f},Uu=function(f){var u=f.type===Go?new Array(f.value.length+1).join("\u2022"):f.value;return u.length===0?f.placeholder||"":u},ks="checkbox",WA="radio",Go="password",Vo=707406591,ka=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this;switch(E.type=h.type.toLowerCase(),E.checked=h.checked,E.value=Uu(h),(E.type===ks||E.type===WA)&&(E.styles.backgroundColor=3739148031,E.styles.borderTopColor=E.styles.borderRightColor=E.styles.borderBottomColor=E.styles.borderLeftColor=2779096575,E.styles.borderTopWidth=E.styles.borderRightWidth=E.styles.borderBottomWidth=E.styles.borderLeftWidth=1,E.styles.borderTopStyle=E.styles.borderRightStyle=E.styles.borderBottomStyle=E.styles.borderLeftStyle=1,E.styles.backgroundClip=[0],E.styles.backgroundOrigin=[0],E.bounds=Lu(E.bounds)),E.type){case ks:E.styles.borderTopRightRadius=E.styles.borderTopLeftRadius=E.styles.borderBottomRightRadius=E.styles.borderBottomLeftRadius=$o;break;case WA:E.styles.borderTopRightRadius=E.styles.borderTopLeftRadius=E.styles.borderBottomRightRadius=E.styles.borderBottomLeftRadius=Qa;break}return E}return u}(ai),Wo=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this,I=h.options[h.selectedIndex||0];return E.value=I&&I.text||"",E}return u}(ai),Zo=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this;return E.value=h.value,E}return u}(ai),zo=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this;E.src=h.src,E.width=parseInt(h.width,10)||0,E.height=parseInt(h.height,10)||0,E.backgroundColor=E.styles.backgroundColor;try{if(h.contentWindow&&h.contentWindow.document&&h.contentWindow.document.documentElement){E.tree=Yo(d,h.contentWindow.document.documentElement);var I=h.contentWindow.document.documentElement?os(d,getComputedStyle(h.contentWindow.document.documentElement).backgroundColor):Pi.TRANSPARENT,J=h.contentWindow.document.body?os(d,getComputedStyle(h.contentWindow.document.body).backgroundColor):Pi.TRANSPARENT;E.backgroundColor=Li(I)?Li(J)?E.styles.backgroundColor:J:I}}catch(de){}return E}return u}(ai),Ru=["OL","UL","MENU"],fA=function(f,u,d,h){for(var E=u.firstChild,I=void 0;E;E=I)if(I=E.nextSibling,Xo(E)&&E.data.trim().length>0)d.textNodes.push(new Tu(f,E,d.styles));else if(Zs(E))if(tl(E)&&E.assignedNodes)E.assignedNodes().forEach(function(de){return fA(f,de,d,h)});else{var J=jo(f,E);J.styles.isVisible()&&(Qu(E,J,h)?J.flags|=4:ku(J.styles)&&(J.flags|=2),Ru.indexOf(E.tagName)!==-1&&(J.flags|=8),d.elements.push(J),E.slot,E.shadowRoot?fA(f,E.shadowRoot,J,h):!hs(E)&&!Oa(E)&&!zs(E)&&fA(f,E,J,h))}},jo=function(f,u){return xi(u)?new GA(f,u):Ri(u)?new cA(f,u):Oa(u)?new Du(f,u):Ou(u)?new Ko(f,u):Pu(u)?new VA(f,u):Mu(u)?new ka(f,u):zs(u)?new Wo(f,u):hs(u)?new Zo(f,u):qo(u)?new zo(f,u):new ai(f,u)},Yo=function(f,u){var d=jo(f,u);return d.flags|=4,fA(f,u,d,d),d},Qu=function(f,u,d){return u.styles.isPositionedWithZIndex()||u.styles.opacity<1||u.styles.isTransformed()||vi(f)&&d.styles.isTransparent()},ku=function(f){return f.isPositioned()||f.isFloating()},Xo=function(f){return f.nodeType===Node.TEXT_NODE},Zs=function(f){return f.nodeType===Node.ELEMENT_NODE},ZA=function(f){return Zs(f)&&typeof f.style!="undefined"&&!zA(f)},zA=function(f){return typeof f.className=="object"},Ou=function(f){return f.tagName==="LI"},Pu=function(f){return f.tagName==="OL"},Mu=function(f){return f.tagName==="INPUT"},Jo=function(f){return f.tagName==="HTML"},Oa=function(f){return f.tagName==="svg"},vi=function(f){return f.tagName==="BODY"},Ri=function(f){return f.tagName==="CANVAS"},Os=function(f){return f.tagName==="VIDEO"},xi=function(f){return f.tagName==="IMG"},qo=function(f){return f.tagName==="IFRAME"},Pa=function(f){return f.tagName==="STYLE"},el=function(f){return f.tagName==="SCRIPT"},hs=function(f){return f.tagName==="TEXTAREA"},zs=function(f){return f.tagName==="SELECT"},tl=function(f){return f.tagName==="SLOT"},rl=function(f){return f.tagName.indexOf("-")>0},jA=function(){function f(){this.counters={}}return f.prototype.getCounterValue=function(u){var d=this.counters[u];return d&&d.length?d[d.length-1]:1},f.prototype.getCounterValues=function(u){var d=this.counters[u];return d||[]},f.prototype.pop=function(u){var d=this;u.forEach(function(h){return d.counters[h].pop()})},f.prototype.parse=function(u){var d=this,h=u.counterIncrement,E=u.counterReset,I=!0;h!==null&&h.forEach(function(de){var he=d.counters[de.counter];he&&de.increment!==0&&(I=!1,he.length||he.push(1),he[Math.max(0,he.length-1)]+=de.increment)});var J=[];return I&&E.forEach(function(de){var he=d.counters[de.counter];J.push(de.counter),he||(he=d.counters[de.counter]=[]),he.push(de.reset)}),J},f}(),nl={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},il={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054F","\u054E","\u054D","\u054C","\u054B","\u054A","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053F","\u053E","\u053D","\u053C","\u053B","\u053A","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},hA={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05D9\u05F3","\u05D8\u05F3","\u05D7\u05F3","\u05D6\u05F3","\u05D5\u05F3","\u05D4\u05F3","\u05D3\u05F3","\u05D2\u05F3","\u05D1\u05F3","\u05D0\u05F3","\u05EA","\u05E9","\u05E8","\u05E7","\u05E6","\u05E4","\u05E2","\u05E1","\u05E0","\u05DE","\u05DC","\u05DB","\u05D9\u05D8","\u05D9\u05D7","\u05D9\u05D6","\u05D8\u05D6","\u05D8\u05D5","\u05D9","\u05D8","\u05D7","\u05D6","\u05D5","\u05D4","\u05D3","\u05D2","\u05D1","\u05D0"]},js={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10F5","\u10F0","\u10EF","\u10F4","\u10EE","\u10ED","\u10EC","\u10EB","\u10EA","\u10E9","\u10E8","\u10E7","\u10E6","\u10E5","\u10E4","\u10F3","\u10E2","\u10E1","\u10E0","\u10DF","\u10DE","\u10DD","\u10F2","\u10DC","\u10DB","\u10DA","\u10D9","\u10D8","\u10D7","\u10F1","\u10D6","\u10D5","\u10D4","\u10D3","\u10D2","\u10D1","\u10D0"]},ds=function(f,u,d,h,E,I){return f<u||f>d?Ys(f,E,I.length>0):h.integers.reduce(function(J,de,he){for(;f>=de;)f-=de,J+=h.values[he];return J},"")+I},sl=function(f,u,d,h){var E="";do d||f--,E=h(f)+E,f/=u;while(f*u>=u);return E},qn=function(f,u,d,h,E){var I=d-u+1;return(f<0?"-":"")+(sl(Math.abs(f),I,h,function(J){return o(Math.floor(J%I)+u)})+E)},gs=function(f,u,d){d===void 0&&(d=". ");var h=u.length;return sl(Math.abs(f),h,!1,function(E){return u[Math.floor(E%h)]})+d},Ps=1,rs=2,xs=4,ns=8,ps=function(f,u,d,h,E,I){if(f<-9999||f>9999)return Ys(f,4,E.length>0);var J=Math.abs(f),de=E;if(J===0)return u[0]+de;for(var he=0;J>0&&he<=4;he++){var Pe=J%10;Pe===0&&Gn(I,Ps)&&de!==""?de=u[Pe]+de:Pe>1||Pe===1&&he===0||Pe===1&&he===1&&Gn(I,rs)||Pe===1&&he===1&&Gn(I,xs)&&f>100||Pe===1&&he>1&&Gn(I,ns)?de=u[Pe]+(he>0?d[he-1]:"")+de:Pe===1&&he>0&&(de=d[he-1]+de),J=Math.floor(J/10)}return(f<0?h:"")+de},Ma="\u5341\u767E\u5343\u842C",Al="\u62FE\u4F70\u4EDF\u842C",ms="\u30DE\u30A4\u30CA\u30B9",Na="\uB9C8\uC774\uB108\uC2A4",Ys=function(f,u,d){var h=d?". ":"",E=d?"\u3001":"",I=d?", ":"",J=d?" ":"";switch(u){case 0:return"\u2022"+J;case 1:return"\u25E6"+J;case 2:return"\u25FE"+J;case 5:var de=qn(f,48,57,!0,h);return de.length<4?"0"+de:de;case 4:return gs(f,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",E);case 6:return ds(f,1,3999,nl,3,h).toLowerCase();case 7:return ds(f,1,3999,nl,3,h);case 8:return qn(f,945,969,!1,h);case 9:return qn(f,97,122,!1,h);case 10:return qn(f,65,90,!1,h);case 11:return qn(f,1632,1641,!0,h);case 12:case 49:return ds(f,1,9999,il,3,h);case 35:return ds(f,1,9999,il,3,h).toLowerCase();case 13:return qn(f,2534,2543,!0,h);case 14:case 30:return qn(f,6112,6121,!0,h);case 15:return gs(f,"\u5B50\u4E11\u5BC5\u536F\u8FB0\u5DF3\u5348\u672A\u7533\u9149\u620C\u4EA5",E);case 16:return gs(f,"\u7532\u4E59\u4E19\u4E01\u620A\u5DF1\u5E9A\u8F9B\u58EC\u7678",E);case 17:case 48:return ps(f,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",Ma,"\u8CA0",E,rs|xs|ns);case 47:return ps(f,"\u96F6\u58F9\u8CB3\u53C3\u8086\u4F0D\u9678\u67D2\u634C\u7396",Al,"\u8CA0",E,Ps|rs|xs|ns);case 42:return ps(f,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",Ma,"\u8D1F",E,rs|xs|ns);case 41:return ps(f,"\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396",Al,"\u8D1F",E,Ps|rs|xs|ns);case 26:return ps(f,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u4E07",ms,E,0);case 25:return ps(f,"\u96F6\u58F1\u5F10\u53C2\u56DB\u4F0D\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343\u4E07",ms,E,Ps|rs|xs);case 31:return ps(f,"\uC601\uC77C\uC774\uC0BC\uC0AC\uC624\uC721\uCE60\uD314\uAD6C","\uC2ED\uBC31\uCC9C\uB9CC",Na,I,Ps|rs|xs);case 33:return ps(f,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u842C",Na,I,0);case 32:return ps(f,"\u96F6\u58F9\u8CB3\u53C3\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343",Na,I,Ps|rs|xs);case 18:return qn(f,2406,2415,!0,h);case 20:return ds(f,1,19999,js,3,h);case 21:return qn(f,2790,2799,!0,h);case 22:return qn(f,2662,2671,!0,h);case 22:return ds(f,1,10999,hA,3,h);case 23:return gs(f,"\u3042\u3044\u3046\u3048\u304A\u304B\u304D\u304F\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061\u3064\u3066\u3068\u306A\u306B\u306C\u306D\u306E\u306F\u3072\u3075\u3078\u307B\u307E\u307F\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308A\u308B\u308C\u308D\u308F\u3090\u3091\u3092\u3093");case 24:return gs(f,"\u3044\u308D\u306F\u306B\u307B\u3078\u3068\u3061\u308A\u306C\u308B\u3092\u308F\u304B\u3088\u305F\u308C\u305D\u3064\u306D\u306A\u3089\u3080\u3046\u3090\u306E\u304A\u304F\u3084\u307E\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304D\u3086\u3081\u307F\u3057\u3091\u3072\u3082\u305B\u3059");case 27:return qn(f,3302,3311,!0,h);case 28:return gs(f,"\u30A2\u30A4\u30A6\u30A8\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EF\u30F0\u30F1\u30F2\u30F3",E);case 29:return gs(f,"\u30A4\u30ED\u30CF\u30CB\u30DB\u30D8\u30C8\u30C1\u30EA\u30CC\u30EB\u30F2\u30EF\u30AB\u30E8\u30BF\u30EC\u30BD\u30C4\u30CD\u30CA\u30E9\u30E0\u30A6\u30F0\u30CE\u30AA\u30AF\u30E4\u30DE\u30B1\u30D5\u30B3\u30A8\u30C6\u30A2\u30B5\u30AD\u30E6\u30E1\u30DF\u30B7\u30F1\u30D2\u30E2\u30BB\u30B9",E);case 34:return qn(f,3792,3801,!0,h);case 37:return qn(f,6160,6169,!0,h);case 38:return qn(f,4160,4169,!0,h);case 39:return qn(f,2918,2927,!0,h);case 40:return qn(f,1776,1785,!0,h);case 43:return qn(f,3046,3055,!0,h);case 44:return qn(f,3174,3183,!0,h);case 45:return qn(f,3664,3673,!0,h);case 46:return qn(f,3872,3881,!0,h);case 3:default:return qn(f,48,57,!0,h)}},al="data-html2canvas-ignore",Ha=function(){function f(u,d,h){if(this.context=u,this.options=h,this.scrolledElements=[],this.referenceElement=d,this.counters=new jA,this.quoteDepth=0,!d.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(d.ownerDocument.documentElement,!1)}return f.prototype.toIFrame=function(u,d){var h=this,E=Nu(u,d);if(!E.contentWindow)return Promise.reject("Unable to find iframe window");var I=u.defaultView.pageXOffset,J=u.defaultView.pageYOffset,de=E.contentWindow,he=de.document,Pe=zi(E).then(function(){return we(h,void 0,void 0,function(){var Ve,et;return Ue(this,function(xt){switch(xt.label){case 0:return this.scrolledElements.forEach(Gu),de&&(de.scrollTo(d.left,d.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(de.scrollY!==d.top||de.scrollX!==d.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(de.scrollX-d.left,de.scrollY-d.top,0,0))),Ve=this.options.onclone,et=this.clonedReferenceElement,typeof et=="undefined"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:he.fonts&&he.fonts.ready?[4,he.fonts.ready]:[3,2];case 1:xt.sent(),xt.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,ol(he)]:[3,4];case 3:xt.sent(),xt.label=4;case 4:return typeof Ve=="function"?[2,Promise.resolve().then(function(){return Ve(he,et)}).then(function(){return E})]:[2,E]}})})});return he.open(),he.write(Ku(document.doctype)+"<html></html>"),$u(this.referenceElement.ownerDocument,I,J),he.replaceChild(he.adoptNode(this.documentElement),he.documentElement),he.close(),Pe},f.prototype.createElementClone=function(u){if(kA(u,2))debugger;if(Ri(u))return this.createCanvasClone(u);if(Os(u))return this.createVideoClone(u);if(Pa(u))return this.createStyleClone(u);var d=u.cloneNode(!1);return xi(d)&&(xi(u)&&u.currentSrc&&u.currentSrc!==u.src&&(d.src=u.currentSrc,d.srcset=""),d.loading==="lazy"&&(d.loading="eager")),rl(d)?this.createCustomElementClone(d):d},f.prototype.createCustomElementClone=function(u){var d=document.createElement("html2canvascustomelement");return Ka(u.style,d),d},f.prototype.createStyleClone=function(u){try{var d=u.sheet;if(d&&d.cssRules){var h=[].slice.call(d.cssRules,0).reduce(function(I,J){return J&&typeof J.cssText=="string"?I+J.cssText:I},""),E=u.cloneNode(!1);return E.textContent=h,E}}catch(I){if(this.context.logger.error("Unable to access cssRules property",I),I.name!=="SecurityError")throw I}return u.cloneNode(!1)},f.prototype.createCanvasClone=function(u){var d;if(this.options.inlineImages&&u.ownerDocument){var h=u.ownerDocument.createElement("img");try{return h.src=u.toDataURL(),h}catch(Pe){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",u)}}var E=u.cloneNode(!1);try{E.width=u.width,E.height=u.height;var I=u.getContext("2d"),J=E.getContext("2d");if(J)if(!this.options.allowTaint&&I)J.putImageData(I.getImageData(0,0,u.width,u.height),0,0);else{var de=(d=u.getContext("webgl2"))!==null&&d!==void 0?d:u.getContext("webgl");if(de){var he=de.getContextAttributes();(he==null?void 0:he.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",u)}J.drawImage(u,0,0)}return E}catch(Pe){this.context.logger.info("Unable to clone canvas as it is tainted",u)}return E},f.prototype.createVideoClone=function(u){var d=u.ownerDocument.createElement("canvas");d.width=u.offsetWidth,d.height=u.offsetHeight;var h=d.getContext("2d");try{return h&&(h.drawImage(u,0,0,d.width,d.height),this.options.allowTaint||h.getImageData(0,0,d.width,d.height)),d}catch(I){this.context.logger.info("Unable to clone video as it is tainted",u)}var E=u.ownerDocument.createElement("canvas");return E.width=u.offsetWidth,E.height=u.offsetHeight,E},f.prototype.appendChildNode=function(u,d,h){(!Zs(d)||!el(d)&&!d.hasAttribute(al)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(d)))&&(!this.options.copyStyles||!Zs(d)||!Pa(d))&&u.appendChild(this.cloneNode(d,h))},f.prototype.cloneChildNodes=function(u,d,h){for(var E=this,I=u.shadowRoot?u.shadowRoot.firstChild:u.firstChild;I;I=I.nextSibling)if(Zs(I)&&tl(I)&&typeof I.assignedNodes=="function"){var J=I.assignedNodes();J.length&&J.forEach(function(de){return E.appendChildNode(d,de,h)})}else this.appendChildNode(d,I,h)},f.prototype.cloneNode=function(u,d){if(Xo(u))return document.createTextNode(u.data);if(!u.ownerDocument)return u.cloneNode(!1);var h=u.ownerDocument.defaultView;if(h&&Zs(u)&&(ZA(u)||zA(u))){var E=this.createElementClone(u);E.style.transitionProperty="none";var I=h.getComputedStyle(u),J=h.getComputedStyle(u,":before"),de=h.getComputedStyle(u,":after");this.referenceElement===u&&ZA(E)&&(this.clonedReferenceElement=E),vi(E)&&Zu(E);var he=this.counters.parse(new va(this.context,I)),Pe=this.resolvePseudoContent(u,E,J,dA.BEFORE);rl(u)&&(d=!0),Os(u)||this.cloneChildNodes(u,E,d),Pe&&E.insertBefore(Pe,E.firstChild);var Ve=this.resolvePseudoContent(u,E,de,dA.AFTER);return Ve&&E.appendChild(Ve),this.counters.pop(he),(I&&(this.options.copyStyles||zA(u))&&!qo(u)||d)&&Ka(I,E),(u.scrollTop!==0||u.scrollLeft!==0)&&this.scrolledElements.push([E,u.scrollLeft,u.scrollTop]),(hs(u)||zs(u))&&(hs(E)||zs(E))&&(E.value=u.value),E}return u.cloneNode(!1)},f.prototype.resolvePseudoContent=function(u,d,h,E){var I=this;if(h){var J=h.content,de=d.ownerDocument;if(!(!de||!J||J==="none"||J==="-moz-alt-content"||h.display==="none")){this.counters.parse(new va(this.context,h));var he=new Co(this.context,h),Pe=de.createElement("html2canvaspseudoelement");Ka(h,Pe),he.content.forEach(function(et){if(et.type===0)Pe.appendChild(de.createTextNode(et.value));else if(et.type===22){var xt=de.createElement("img");xt.src=et.value,xt.style.opacity="1",Pe.appendChild(xt)}else if(et.type===18){if(et.name==="attr"){var gr=et.values.filter(Bn);gr.length&&Pe.appendChild(de.createTextNode(u.getAttribute(gr[0].value)||""))}else if(et.name==="counter"){var Xt=et.values.filter(xn),cr=Xt[0],nn=Xt[1];if(cr&&Bn(cr)){var Fr=I.counters.getCounterValue(cr.value),Cr=nn&&Bn(nn)?da.parse(I.context,nn.value):3;Pe.appendChild(de.createTextNode(Ys(Fr,Cr,!1)))}}else if(et.name==="counters"){var on=et.values.filter(xn),cr=on[0],A=on[1],nn=on[2];if(cr&&Bn(cr)){var e=I.counters.getCounterValues(cr.value),t=nn&&Bn(nn)?da.parse(I.context,nn.value):3,r=A&&A.type===0?A.value:"",n=e.map(function(a){return Ys(a,t,!1)}).join(r);Pe.appendChild(de.createTextNode(n))}}}else if(et.type===20)switch(et.value){case"open-quote":Pe.appendChild(de.createTextNode(Us(he.quotes,I.quoteDepth++,!0)));break;case"close-quote":Pe.appendChild(de.createTextNode(Us(he.quotes,--I.quoteDepth,!1)));break;default:Pe.appendChild(de.createTextNode(et.value))}}),Pe.className=vs+" "+YA;var Ve=E===dA.BEFORE?" "+vs:" "+YA;return zA(d)?d.className.baseValue+=Ve:d.className+=Ve,Pe}}},f.destroy=function(u){return u.parentNode?(u.parentNode.removeChild(u),!0):!1},f}(),dA;(function(f){f[f.BEFORE=0]="BEFORE",f[f.AFTER=1]="AFTER"})(dA||(dA={}));var Nu=function(f,u){var d=f.createElement("iframe");return d.className="html2canvas-container",d.style.visibility="hidden",d.style.position="fixed",d.style.left="-10000px",d.style.top="0px",d.style.border="0",d.width=u.width.toString(),d.height=u.height.toString(),d.scrolling="no",d.setAttribute(al,"true"),f.body.appendChild(d),d},Hu=function(f){return new Promise(function(u){if(f.complete){u();return}if(!f.src){u();return}f.onload=u,f.onerror=u})},ol=function(f){return Promise.all([].slice.call(f.images,0).map(Hu))},zi=function(f){return new Promise(function(u,d){var h=f.contentWindow;if(!h)return d("No window assigned for iframe");var E=h.document;h.onload=f.onload=function(){h.onload=f.onload=null;var I=setInterval(function(){E.body.childNodes.length>0&&E.readyState==="complete"&&(clearInterval(I),u(f))},50)}})},_s=["all","d","content"],Ka=function(f,u){for(var d=f.length-1;d>=0;d--){var h=f.item(d);_s.indexOf(h)===-1&&u.style.setProperty(h,f.getPropertyValue(h))}return u},Ku=function(f){var u="";return f&&(u+="<!DOCTYPE ",f.name&&(u+=f.name),f.internalSubset&&(u+=f.internalSubset),f.publicId&&(u+='"'+f.publicId+'"'),f.systemId&&(u+='"'+f.systemId+'"'),u+=">"),u},$u=function(f,u,d){f&&f.defaultView&&(u!==f.defaultView.pageXOffset||d!==f.defaultView.pageYOffset)&&f.defaultView.scrollTo(u,d)},Gu=function(f){var u=f[0],d=f[1],h=f[2];u.scrollLeft=d,u.scrollTop=h},Vu=":before",Wu=":after",vs="___html2canvas___pseudoelement_before",YA="___html2canvas___pseudoelement_after",ll=`{
content: "" !important;
display: none !important;
}`,Zu=function(f){$a(f,"."+vs+Vu+ll+`
.`+YA+Wu+ll)},$a=function(f,u){var d=f.ownerDocument;if(d){var h=d.createElement("style");h.textContent=u,f.appendChild(h)}},Ga=function(){function f(){}return f.getOrigin=function(u){var d=f._link;return d?(d.href=u,d.href=d.href,d.protocol+d.hostname+d.port):"about:blank"},f.isSameOrigin=function(u){return f.getOrigin(u)===f._origin},f.setContext=function(u){f._link=u.document.createElement("a"),f._origin=f.getOrigin(u.location.href)},f._origin="about:blank",f}(),ul=function(){function f(u,d){this.context=u,this._options=d,this._cache={}}return f.prototype.addImage=function(u){var d=Promise.resolve();return this.has(u)||(Za(u)||Va(u))&&(this._cache[u]=this.loadImage(u)).catch(function(){}),d},f.prototype.match=function(u){return this._cache[u]},f.prototype.loadImage=function(u){return we(this,void 0,void 0,function(){var d,h,E,I,J=this;return Ue(this,function(de){switch(de.label){case 0:return d=Ga.isSameOrigin(u),h=!Wa(u)&&this._options.useCORS===!0&&oi.SUPPORT_CORS_IMAGES&&!d,E=!Wa(u)&&!d&&!Za(u)&&typeof this._options.proxy=="string"&&oi.SUPPORT_CORS_XHR&&!h,!d&&this._options.allowTaint===!1&&!Wa(u)&&!Za(u)&&!E&&!h?[2]:(I=u,E?[4,this.proxy(I)]:[3,2]);case 1:I=de.sent(),de.label=2;case 2:return this.context.logger.debug("Added image "+u.substring(0,256)),[4,new Promise(function(he,Pe){var Ve=new Image;Ve.onload=function(){return he(Ve)},Ve.onerror=Pe,(cl(I)||h)&&(Ve.crossOrigin="anonymous"),Ve.src=I,Ve.complete===!0&&setTimeout(function(){return he(Ve)},500),J._options.imageTimeout>0&&setTimeout(function(){return Pe("Timed out ("+J._options.imageTimeout+"ms) loading image")},J._options.imageTimeout)})];case 3:return[2,de.sent()]}})})},f.prototype.has=function(u){return typeof this._cache[u]!="undefined"},f.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},f.prototype.proxy=function(u){var d=this,h=this._options.proxy;if(!h)throw new Error("No proxy defined");var E=u.substring(0,256);return new Promise(function(I,J){var de=oi.SUPPORT_RESPONSE_TYPE?"blob":"text",he=new XMLHttpRequest;he.onload=function(){if(he.status===200)if(de==="text")I(he.response);else{var et=new FileReader;et.addEventListener("load",function(){return I(et.result)},!1),et.addEventListener("error",function(xt){return J(xt)},!1),et.readAsDataURL(he.response)}else J("Failed to proxy resource "+E+" with status code "+he.status)},he.onerror=J;var Pe=h.indexOf("?")>-1?"&":"?";if(he.open("GET",""+h+Pe+"url="+encodeURIComponent(u)+"&responseType="+de),de!=="text"&&he instanceof XMLHttpRequest&&(he.responseType=de),d._options.imageTimeout){var Ve=d._options.imageTimeout;he.timeout=Ve,he.ontimeout=function(){return J("Timed out ("+Ve+"ms) proxying "+E)}}he.send()})},f}(),XA=/^data:image\/svg\+xml/i,zu=/^data:image\/.*;base64,/i,ju=/^data:image\/.*/i,Va=function(f){return oi.SUPPORT_SVG_DRAWING||!fl(f)},Wa=function(f){return ju.test(f)},cl=function(f){return zu.test(f)},Za=function(f){return f.substr(0,4)==="blob"},fl=function(f){return f.substr(-3).toLowerCase()==="svg"||XA.test(f)},fr=function(){function f(u,d){this.type=0,this.x=u,this.y=d}return f.prototype.add=function(u,d){return new f(this.x+u,this.y+d)},f}(),ys=function(f,u,d){return new fr(f.x+(u.x-f.x)*d,f.y+(u.y-f.y)*d)},JA=function(){function f(u,d,h,E){this.type=1,this.start=u,this.startControl=d,this.endControl=h,this.end=E}return f.prototype.subdivide=function(u,d){var h=ys(this.start,this.startControl,u),E=ys(this.startControl,this.endControl,u),I=ys(this.endControl,this.end,u),J=ys(h,E,u),de=ys(E,I,u),he=ys(J,de,u);return d?new f(this.start,h,J,he):new f(he,de,I,this.end)},f.prototype.add=function(u,d){return new f(this.start.add(u,d),this.startControl.add(u,d),this.endControl.add(u,d),this.end.add(u,d))},f.prototype.reverse=function(){return new f(this.end,this.endControl,this.startControl,this.start)},f}(),Qi=function(f){return f.type===1},Yu=function(){function f(u){var d=u.styles,h=u.bounds,E=Ss(d.borderTopLeftRadius,h.width,h.height),I=E[0],J=E[1],de=Ss(d.borderTopRightRadius,h.width,h.height),he=de[0],Pe=de[1],Ve=Ss(d.borderBottomRightRadius,h.width,h.height),et=Ve[0],xt=Ve[1],gr=Ss(d.borderBottomLeftRadius,h.width,h.height),Xt=gr[0],cr=gr[1],nn=[];nn.push((I+he)/h.width),nn.push((Xt+et)/h.width),nn.push((J+cr)/h.height),nn.push((Pe+xt)/h.height);var Fr=Math.max.apply(Math,nn);Fr>1&&(I/=Fr,J/=Fr,he/=Fr,Pe/=Fr,et/=Fr,xt/=Fr,Xt/=Fr,cr/=Fr);var Cr=h.width-he,on=h.height-xt,A=h.width-et,e=h.height-cr,t=d.borderTopWidth,r=d.borderRightWidth,n=d.borderBottomWidth,i=d.borderLeftWidth,s=Dn(d.paddingTop,u.bounds.width),a=Dn(d.paddingRight,u.bounds.width),c=Dn(d.paddingBottom,u.bounds.width),l=Dn(d.paddingLeft,u.bounds.width);this.topLeftBorderDoubleOuterBox=I>0||J>0?Mn(h.left+i/3,h.top+t/3,I-i/3,J-t/3,Ln.TOP_LEFT):new fr(h.left+i/3,h.top+t/3),this.topRightBorderDoubleOuterBox=I>0||J>0?Mn(h.left+Cr,h.top+t/3,he-r/3,Pe-t/3,Ln.TOP_RIGHT):new fr(h.left+h.width-r/3,h.top+t/3),this.bottomRightBorderDoubleOuterBox=et>0||xt>0?Mn(h.left+A,h.top+on,et-r/3,xt-n/3,Ln.BOTTOM_RIGHT):new fr(h.left+h.width-r/3,h.top+h.height-n/3),this.bottomLeftBorderDoubleOuterBox=Xt>0||cr>0?Mn(h.left+i/3,h.top+e,Xt-i/3,cr-n/3,Ln.BOTTOM_LEFT):new fr(h.left+i/3,h.top+h.height-n/3),this.topLeftBorderDoubleInnerBox=I>0||J>0?Mn(h.left+i*2/3,h.top+t*2/3,I-i*2/3,J-t*2/3,Ln.TOP_LEFT):new fr(h.left+i*2/3,h.top+t*2/3),this.topRightBorderDoubleInnerBox=I>0||J>0?Mn(h.left+Cr,h.top+t*2/3,he-r*2/3,Pe-t*2/3,Ln.TOP_RIGHT):new fr(h.left+h.width-r*2/3,h.top+t*2/3),this.bottomRightBorderDoubleInnerBox=et>0||xt>0?Mn(h.left+A,h.top+on,et-r*2/3,xt-n*2/3,Ln.BOTTOM_RIGHT):new fr(h.left+h.width-r*2/3,h.top+h.height-n*2/3),this.bottomLeftBorderDoubleInnerBox=Xt>0||cr>0?Mn(h.left+i*2/3,h.top+e,Xt-i*2/3,cr-n*2/3,Ln.BOTTOM_LEFT):new fr(h.left+i*2/3,h.top+h.height-n*2/3),this.topLeftBorderStroke=I>0||J>0?Mn(h.left+i/2,h.top+t/2,I-i/2,J-t/2,Ln.TOP_LEFT):new fr(h.left+i/2,h.top+t/2),this.topRightBorderStroke=I>0||J>0?Mn(h.left+Cr,h.top+t/2,he-r/2,Pe-t/2,Ln.TOP_RIGHT):new fr(h.left+h.width-r/2,h.top+t/2),this.bottomRightBorderStroke=et>0||xt>0?Mn(h.left+A,h.top+on,et-r/2,xt-n/2,Ln.BOTTOM_RIGHT):new fr(h.left+h.width-r/2,h.top+h.height-n/2),this.bottomLeftBorderStroke=Xt>0||cr>0?Mn(h.left+i/2,h.top+e,Xt-i/2,cr-n/2,Ln.BOTTOM_LEFT):new fr(h.left+i/2,h.top+h.height-n/2),this.topLeftBorderBox=I>0||J>0?Mn(h.left,h.top,I,J,Ln.TOP_LEFT):new fr(h.left,h.top),this.topRightBorderBox=he>0||Pe>0?Mn(h.left+Cr,h.top,he,Pe,Ln.TOP_RIGHT):new fr(h.left+h.width,h.top),this.bottomRightBorderBox=et>0||xt>0?Mn(h.left+A,h.top+on,et,xt,Ln.BOTTOM_RIGHT):new fr(h.left+h.width,h.top+h.height),this.bottomLeftBorderBox=Xt>0||cr>0?Mn(h.left,h.top+e,Xt,cr,Ln.BOTTOM_LEFT):new fr(h.left,h.top+h.height),this.topLeftPaddingBox=I>0||J>0?Mn(h.left+i,h.top+t,Math.max(0,I-i),Math.max(0,J-t),Ln.TOP_LEFT):new fr(h.left+i,h.top+t),this.topRightPaddingBox=he>0||Pe>0?Mn(h.left+Math.min(Cr,h.width-r),h.top+t,Cr>h.width+r?0:Math.max(0,he-r),Math.max(0,Pe-t),Ln.TOP_RIGHT):new fr(h.left+h.width-r,h.top+t),this.bottomRightPaddingBox=et>0||xt>0?Mn(h.left+Math.min(A,h.width-i),h.top+Math.min(on,h.height-n),Math.max(0,et-r),Math.max(0,xt-n),Ln.BOTTOM_RIGHT):new fr(h.left+h.width-r,h.top+h.height-n),this.bottomLeftPaddingBox=Xt>0||cr>0?Mn(h.left+i,h.top+Math.min(e,h.height-n),Math.max(0,Xt-i),Math.max(0,cr-n),Ln.BOTTOM_LEFT):new fr(h.left+i,h.top+h.height-n),this.topLeftContentBox=I>0||J>0?Mn(h.left+i+l,h.top+t+s,Math.max(0,I-(i+l)),Math.max(0,J-(t+s)),Ln.TOP_LEFT):new fr(h.left+i+l,h.top+t+s),this.topRightContentBox=he>0||Pe>0?Mn(h.left+Math.min(Cr,h.width+i+l),h.top+t+s,Cr>h.width+i+l?0:he-i+l,Pe-(t+s),Ln.TOP_RIGHT):new fr(h.left+h.width-(r+a),h.top+t+s),this.bottomRightContentBox=et>0||xt>0?Mn(h.left+Math.min(A,h.width-(i+l)),h.top+Math.min(on,h.height+t+s),Math.max(0,et-(r+a)),xt-(n+c),Ln.BOTTOM_RIGHT):new fr(h.left+h.width-(r+a),h.top+h.height-(n+c)),this.bottomLeftContentBox=Xt>0||cr>0?Mn(h.left+i+l,h.top+e,Math.max(0,Xt-(i+l)),cr-(n+c),Ln.BOTTOM_LEFT):new fr(h.left+i+l,h.top+h.height-(n+c))}return f}(),Ln;(function(f){f[f.TOP_LEFT=0]="TOP_LEFT",f[f.TOP_RIGHT=1]="TOP_RIGHT",f[f.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",f[f.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Ln||(Ln={}));var Mn=function(f,u,d,h,E){var I=4*((Math.sqrt(2)-1)/3),J=d*I,de=h*I,he=f+d,Pe=u+h;switch(E){case Ln.TOP_LEFT:return new JA(new fr(f,Pe),new fr(f,Pe-de),new fr(he-J,u),new fr(he,u));case Ln.TOP_RIGHT:return new JA(new fr(f,u),new fr(f+J,u),new fr(he,Pe-de),new fr(he,Pe));case Ln.BOTTOM_RIGHT:return new JA(new fr(he,u),new fr(he,u+de),new fr(f+J,Pe),new fr(f,Pe));case Ln.BOTTOM_LEFT:default:return new JA(new fr(he,Pe),new fr(he-J,Pe),new fr(f,u+de),new fr(f,u))}},qA=function(f){return[f.topLeftBorderBox,f.topRightBorderBox,f.bottomRightBorderBox,f.bottomLeftBorderBox]},za=function(f){return[f.topLeftContentBox,f.topRightContentBox,f.bottomRightContentBox,f.bottomLeftContentBox]},ea=function(f){return[f.topLeftPaddingBox,f.topRightPaddingBox,f.bottomRightPaddingBox,f.bottomLeftPaddingBox]},Xu=function(){function f(u,d,h){this.offsetX=u,this.offsetY=d,this.matrix=h,this.type=0,this.target=6}return f}(),Xs=function(){function f(u,d){this.path=u,this.target=d,this.type=1}return f}(),hl=function(){function f(u){this.opacity=u,this.type=2,this.target=6}return f}(),dl=function(f){return f.type===0},gl=function(f){return f.type===1},pl=function(f){return f.type===2},ml=function(f,u){return f.length===u.length?f.some(function(d,h){return d===u[h]}):!1},ja=function(f,u,d,h,E){return f.map(function(I,J){switch(J){case 0:return I.add(u,d);case 1:return I.add(u+h,d);case 2:return I.add(u+h,d+E);case 3:return I.add(u,d+E)}return I})},Ya=function(){function f(u){this.element=u,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return f}(),Xa=function(){function f(u,d){if(this.container=u,this.parent=d,this.effects=[],this.curves=new Yu(this.container),this.container.styles.opacity<1&&this.effects.push(new hl(this.container.styles.opacity)),this.container.styles.transform!==null){var h=this.container.bounds.left+this.container.styles.transformOrigin[0].number,E=this.container.bounds.top+this.container.styles.transformOrigin[1].number,I=this.container.styles.transform;this.effects.push(new Xu(h,E,I))}if(this.container.styles.overflowX!==0){var J=qA(this.curves),de=ea(this.curves);ml(J,de)?this.effects.push(new Xs(J,6)):(this.effects.push(new Xs(J,2)),this.effects.push(new Xs(de,4)))}}return f.prototype.getEffects=function(u){for(var d=[2,3].indexOf(this.container.styles.position)===-1,h=this.parent,E=this.effects.slice(0);h;){var I=h.effects.filter(function(he){return!gl(he)});if(d||h.container.styles.position!==0||!h.parent){if(E.unshift.apply(E,I),d=[2,3].indexOf(h.container.styles.position)===-1,h.container.styles.overflowX!==0){var J=qA(h.curves),de=ea(h.curves);ml(J,de)||E.unshift(new Xs(de,6))}}else E.unshift.apply(E,I);h=h.parent}return E.filter(function(he){return Gn(he.target,u)})},f}(),Ja=function(f,u,d,h){f.container.elements.forEach(function(E){var I=Gn(E.flags,4),J=Gn(E.flags,2),de=new Xa(E,f);Gn(E.styles.display,2048)&&h.push(de);var he=Gn(E.flags,8)?[]:h;if(I||J){var Pe=I||E.styles.isPositioned()?d:u,Ve=new Ya(de);if(E.styles.isPositioned()||E.styles.opacity<1||E.styles.isTransformed()){var et=E.styles.zIndex.order;if(et<0){var xt=0;Pe.negativeZIndex.some(function(Xt,cr){return et>Xt.element.container.styles.zIndex.order?(xt=cr,!1):xt>0}),Pe.negativeZIndex.splice(xt,0,Ve)}else if(et>0){var gr=0;Pe.positiveZIndex.some(function(Xt,cr){return et>=Xt.element.container.styles.zIndex.order?(gr=cr+1,!1):gr>0}),Pe.positiveZIndex.splice(gr,0,Ve)}else Pe.zeroOrAutoZIndexOrTransformedOrOpacity.push(Ve)}else E.styles.isFloating()?Pe.nonPositionedFloats.push(Ve):Pe.nonPositionedInlineLevel.push(Ve);Ja(de,Ve,I?Ve:d,he)}else E.styles.isInlineLevel()?u.inlineLevel.push(de):u.nonInlineLevel.push(de),Ja(de,u,d,he);Gn(E.flags,8)&&ta(E,he)})},ta=function(f,u){for(var d=f instanceof VA?f.start:1,h=f instanceof VA?f.reversed:!1,E=0;E<u.length;E++){var I=u[E];I.container instanceof Ko&&typeof I.container.value=="number"&&I.container.value!==0&&(d=I.container.value),I.listValue=Ys(d,I.container.styles.listStyleType,!0),d+=h?-1:1}},_l=function(f){var u=new Xa(f,null),d=new Ya(u),h=[];return Ja(u,d,d,h),ta(u.container,h),d},ra=function(f,u){switch(u){case 0:return ki(f.topLeftBorderBox,f.topLeftPaddingBox,f.topRightBorderBox,f.topRightPaddingBox);case 1:return ki(f.topRightBorderBox,f.topRightPaddingBox,f.bottomRightBorderBox,f.bottomRightPaddingBox);case 2:return ki(f.bottomRightBorderBox,f.bottomRightPaddingBox,f.bottomLeftBorderBox,f.bottomLeftPaddingBox);case 3:default:return ki(f.bottomLeftBorderBox,f.bottomLeftPaddingBox,f.topLeftBorderBox,f.topLeftPaddingBox)}},Ju=function(f,u){switch(u){case 0:return ki(f.topLeftBorderBox,f.topLeftBorderDoubleOuterBox,f.topRightBorderBox,f.topRightBorderDoubleOuterBox);case 1:return ki(f.topRightBorderBox,f.topRightBorderDoubleOuterBox,f.bottomRightBorderBox,f.bottomRightBorderDoubleOuterBox);case 2:return ki(f.bottomRightBorderBox,f.bottomRightBorderDoubleOuterBox,f.bottomLeftBorderBox,f.bottomLeftBorderDoubleOuterBox);case 3:default:return ki(f.bottomLeftBorderBox,f.bottomLeftBorderDoubleOuterBox,f.topLeftBorderBox,f.topLeftBorderDoubleOuterBox)}},qu=function(f,u){switch(u){case 0:return ki(f.topLeftBorderDoubleInnerBox,f.topLeftPaddingBox,f.topRightBorderDoubleInnerBox,f.topRightPaddingBox);case 1:return ki(f.topRightBorderDoubleInnerBox,f.topRightPaddingBox,f.bottomRightBorderDoubleInnerBox,f.bottomRightPaddingBox);case 2:return ki(f.bottomRightBorderDoubleInnerBox,f.bottomRightPaddingBox,f.bottomLeftBorderDoubleInnerBox,f.bottomLeftPaddingBox);case 3:default:return ki(f.bottomLeftBorderDoubleInnerBox,f.bottomLeftPaddingBox,f.topLeftBorderDoubleInnerBox,f.topLeftPaddingBox)}},na=function(f,u){switch(u){case 0:return ia(f.topLeftBorderStroke,f.topRightBorderStroke);case 1:return ia(f.topRightBorderStroke,f.bottomRightBorderStroke);case 2:return ia(f.bottomRightBorderStroke,f.bottomLeftBorderStroke);case 3:default:return ia(f.bottomLeftBorderStroke,f.topLeftBorderStroke)}},ia=function(f,u){var d=[];return Qi(f)?d.push(f.subdivide(.5,!1)):d.push(f),Qi(u)?d.push(u.subdivide(.5,!0)):d.push(u),d},ki=function(f,u,d,h){var E=[];return Qi(f)?E.push(f.subdivide(.5,!1)):E.push(f),Qi(d)?E.push(d.subdivide(.5,!0)):E.push(d),Qi(h)?E.push(h.subdivide(.5,!0).reverse()):E.push(h),Qi(u)?E.push(u.subdivide(.5,!1).reverse()):E.push(u),E},qa=function(f){var u=f.bounds,d=f.styles;return u.add(d.borderLeftWidth,d.borderTopWidth,-(d.borderRightWidth+d.borderLeftWidth),-(d.borderTopWidth+d.borderBottomWidth))},sa=function(f){var u=f.styles,d=f.bounds,h=Dn(u.paddingLeft,d.width),E=Dn(u.paddingRight,d.width),I=Dn(u.paddingTop,d.width),J=Dn(u.paddingBottom,d.width);return d.add(h+u.borderLeftWidth,I+u.borderTopWidth,-(u.borderRightWidth+u.borderLeftWidth+h+E),-(u.borderTopWidth+u.borderBottomWidth+I+J))},vl=function(f,u){return f===0?u.bounds:f===2?sa(u):qa(u)},ec=function(f,u){return f===0?u.bounds:f===2?sa(u):qa(u)},eo=function(f,u,d){var h=vl(qs(f.styles.backgroundOrigin,u),f),E=ec(qs(f.styles.backgroundClip,u),f),I=yl(qs(f.styles.backgroundSize,u),d,h),J=I[0],de=I[1],he=Ss(qs(f.styles.backgroundPosition,u),h.width-J,h.height-de),Pe=tc(qs(f.styles.backgroundRepeat,u),he,I,h,E),Ve=Math.round(h.left+he[0]),et=Math.round(h.top+he[1]);return[Pe,Ve,et,J,de]},Js=function(f){return Bn(f)&&f.value===Ks.AUTO},Aa=function(f){return typeof f=="number"},yl=function(f,u,d){var h=u[0],E=u[1],I=u[2],J=f[0],de=f[1];if(!J)return[0,0];if(Kn(J)&&de&&Kn(de))return[Dn(J,d.width),Dn(de,d.height)];var he=Aa(I);if(Bn(J)&&(J.value===Ks.CONTAIN||J.value===Ks.COVER)){if(Aa(I)){var Pe=d.width/d.height;return Pe<I!=(J.value===Ks.COVER)?[d.width,d.width/I]:[d.height*I,d.height]}return[d.width,d.height]}var Ve=Aa(h),et=Aa(E),xt=Ve||et;if(Js(J)&&(!de||Js(de))){if(Ve&&et)return[h,E];if(!he&&!xt)return[d.width,d.height];if(xt&&he){var gr=Ve?h:E*I,Xt=et?E:h/I;return[gr,Xt]}var cr=Ve?h:d.width,nn=et?E:d.height;return[cr,nn]}if(he){var Fr=0,Cr=0;return Kn(J)?Fr=Dn(J,d.width):Kn(de)&&(Cr=Dn(de,d.height)),Js(J)?Fr=Cr*I:(!de||Js(de))&&(Cr=Fr/I),[Fr,Cr]}var on=null,A=null;if(Kn(J)?on=Dn(J,d.width):de&&Kn(de)&&(A=Dn(de,d.height)),on!==null&&(!de||Js(de))&&(A=Ve&&et?on/h*E:d.height),A!==null&&Js(J)&&(on=Ve&&et?A/E*h:d.width),on!==null&&A!==null)return[on,A];throw new Error("Unable to calculate background-size for element")},qs=function(f,u){var d=f[u];return typeof d=="undefined"?f[0]:d},tc=function(f,u,d,h,E){var I=u[0],J=u[1],de=d[0],he=d[1];switch(f){case 2:return[new fr(Math.round(h.left),Math.round(h.top+J)),new fr(Math.round(h.left+h.width),Math.round(h.top+J)),new fr(Math.round(h.left+h.width),Math.round(he+h.top+J)),new fr(Math.round(h.left),Math.round(he+h.top+J))];case 3:return[new fr(Math.round(h.left+I),Math.round(h.top)),new fr(Math.round(h.left+I+de),Math.round(h.top)),new fr(Math.round(h.left+I+de),Math.round(h.height+h.top)),new fr(Math.round(h.left+I),Math.round(h.height+h.top))];case 1:return[new fr(Math.round(h.left+I),Math.round(h.top+J)),new fr(Math.round(h.left+I+de),Math.round(h.top+J)),new fr(Math.round(h.left+I+de),Math.round(h.top+J+he)),new fr(Math.round(h.left+I),Math.round(h.top+J+he))];default:return[new fr(Math.round(E.left),Math.round(E.top)),new fr(Math.round(E.left+E.width),Math.round(E.top)),new fr(Math.round(E.left+E.width),Math.round(E.height+E.top)),new fr(Math.round(E.left),Math.round(E.height+E.top))]}},rc="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Bl="Hidden Text",nc=function(){function f(u){this._data={},this._document=u}return f.prototype.parseMetrics=function(u,d){var h=this._document.createElement("div"),E=this._document.createElement("img"),I=this._document.createElement("span"),J=this._document.body;h.style.visibility="hidden",h.style.fontFamily=u,h.style.fontSize=d,h.style.margin="0",h.style.padding="0",h.style.whiteSpace="nowrap",J.appendChild(h),E.src=rc,E.width=1,E.height=1,E.style.margin="0",E.style.padding="0",E.style.verticalAlign="baseline",I.style.fontFamily=u,I.style.fontSize=d,I.style.margin="0",I.style.padding="0",I.appendChild(this._document.createTextNode(Bl)),h.appendChild(I),h.appendChild(E);var de=E.offsetTop-I.offsetTop+2;h.removeChild(I),h.appendChild(this._document.createTextNode(Bl)),h.style.lineHeight="normal",E.style.verticalAlign="super";var he=E.offsetTop-h.offsetTop+2;return J.removeChild(h),{baseline:de,middle:he}},f.prototype.getMetrics=function(u,d){var h=u+" "+d;return typeof this._data[h]=="undefined"&&(this._data[h]=this.parseMetrics(u,d)),this._data[h]},f}(),El=function(){function f(u,d){this.context=u,this.options=d}return f}(),wl=1e4,ic=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this;return E._activeEffects=[],E.canvas=h.canvas?h.canvas:document.createElement("canvas"),E.ctx=E.canvas.getContext("2d"),h.canvas||(E.canvas.width=Math.floor(h.width*h.scale),E.canvas.height=Math.floor(h.height*h.scale),E.canvas.style.width=h.width+"px",E.canvas.style.height=h.height+"px"),E.fontMetrics=new nc(document),E.ctx.scale(E.options.scale,E.options.scale),E.ctx.translate(-h.x,-h.y),E.ctx.textBaseline="bottom",E._activeEffects=[],E.context.logger.debug("Canvas renderer initialized ("+h.width+"x"+h.height+") with scale "+h.scale),E}return u.prototype.applyEffects=function(d){for(var h=this;this._activeEffects.length;)this.popEffect();d.forEach(function(E){return h.applyEffect(E)})},u.prototype.applyEffect=function(d){this.ctx.save(),pl(d)&&(this.ctx.globalAlpha=d.opacity),dl(d)&&(this.ctx.translate(d.offsetX,d.offsetY),this.ctx.transform(d.matrix[0],d.matrix[1],d.matrix[2],d.matrix[3],d.matrix[4],d.matrix[5]),this.ctx.translate(-d.offsetX,-d.offsetY)),gl(d)&&(this.path(d.path),this.ctx.clip()),this._activeEffects.push(d)},u.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},u.prototype.renderStack=function(d){return we(this,void 0,void 0,function(){var h;return Ue(this,function(E){switch(E.label){case 0:return h=d.element.container.styles,h.isVisible()?[4,this.renderStackContent(d)]:[3,2];case 1:E.sent(),E.label=2;case 2:return[2]}})})},u.prototype.renderNode=function(d){return we(this,void 0,void 0,function(){return Ue(this,function(h){switch(h.label){case 0:if(Gn(d.container.flags,16))debugger;return d.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(d)]:[3,3];case 1:return h.sent(),[4,this.renderNodeContent(d)];case 2:h.sent(),h.label=3;case 3:return[2]}})})},u.prototype.renderTextWithLetterSpacing=function(d,h,E){var I=this;if(h===0)this.ctx.fillText(d.text,d.bounds.left,d.bounds.top+E);else{var J=Ra(d.text);J.reduce(function(de,he){return I.ctx.fillText(he,de,d.bounds.top+E),de+I.ctx.measureText(he).width},d.bounds.left)}},u.prototype.createFontStyle=function(d){var h=d.fontVariant.filter(function(J){return J==="normal"||J==="small-caps"}).join(""),E=oc(d.fontFamily).join(", "),I=Oi(d.fontSize)?""+d.fontSize.number+d.fontSize.unit:d.fontSize.number+"px";return[[d.fontStyle,h,d.fontWeight,I,E].join(" "),E,I]},u.prototype.renderTextNode=function(d,h){return we(this,void 0,void 0,function(){var E,I,J,de,he,Pe,Ve,et,xt=this;return Ue(this,function(gr){return E=this.createFontStyle(h),I=E[0],J=E[1],de=E[2],this.ctx.font=I,this.ctx.direction=h.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",he=this.fontMetrics.getMetrics(J,de),Pe=he.baseline,Ve=he.middle,et=h.paintOrder,d.textBounds.forEach(function(Xt){et.forEach(function(cr){switch(cr){case 0:xt.ctx.fillStyle=Jn(h.color),xt.renderTextWithLetterSpacing(Xt,h.letterSpacing,Pe);var nn=h.textShadow;nn.length&&Xt.text.trim().length&&(nn.slice(0).reverse().forEach(function(Fr){xt.ctx.shadowColor=Jn(Fr.color),xt.ctx.shadowOffsetX=Fr.offsetX.number*xt.options.scale,xt.ctx.shadowOffsetY=Fr.offsetY.number*xt.options.scale,xt.ctx.shadowBlur=Fr.blur.number,xt.renderTextWithLetterSpacing(Xt,h.letterSpacing,Pe)}),xt.ctx.shadowColor="",xt.ctx.shadowOffsetX=0,xt.ctx.shadowOffsetY=0,xt.ctx.shadowBlur=0),h.textDecorationLine.length&&(xt.ctx.fillStyle=Jn(h.textDecorationColor||h.color),h.textDecorationLine.forEach(function(Fr){switch(Fr){case 1:xt.ctx.fillRect(Xt.bounds.left,Math.round(Xt.bounds.top+Pe),Xt.bounds.width,1);break;case 2:xt.ctx.fillRect(Xt.bounds.left,Math.round(Xt.bounds.top),Xt.bounds.width,1);break;case 3:xt.ctx.fillRect(Xt.bounds.left,Math.ceil(Xt.bounds.top+Ve),Xt.bounds.width,1);break}}));break;case 1:h.webkitTextStrokeWidth&&Xt.text.trim().length&&(xt.ctx.strokeStyle=Jn(h.webkitTextStrokeColor),xt.ctx.lineWidth=h.webkitTextStrokeWidth,xt.ctx.lineJoin=window.chrome?"miter":"round",xt.ctx.strokeText(Xt.text,Xt.bounds.left,Xt.bounds.top+Pe)),xt.ctx.strokeStyle="",xt.ctx.lineWidth=0,xt.ctx.lineJoin="miter";break}})}),[2]})})},u.prototype.renderReplacedElement=function(d,h,E){if(E&&d.intrinsicWidth>0&&d.intrinsicHeight>0){var I=sa(d),J=ea(h);this.path(J),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(E,0,0,d.intrinsicWidth,d.intrinsicHeight,I.left,I.top,I.width,I.height),this.ctx.restore()}},u.prototype.renderNodeContent=function(d){return we(this,void 0,void 0,function(){var h,E,I,J,de,he,Cr,Cr,Pe,Ve,et,xt,A,gr,Xt,e,cr,nn,Fr,Cr,on,A,e;return Ue(this,function(t){switch(t.label){case 0:this.applyEffects(d.getEffects(4)),h=d.container,E=d.curves,I=h.styles,J=0,de=h.textNodes,t.label=1;case 1:return J<de.length?(he=de[J],[4,this.renderTextNode(he,I)]):[3,4];case 2:t.sent(),t.label=3;case 3:return J++,[3,1];case 4:if(!(h instanceof GA))return[3,8];t.label=5;case 5:return t.trys.push([5,7,,8]),[4,this.context.cache.match(h.src)];case 6:return Cr=t.sent(),this.renderReplacedElement(h,E,Cr),[3,8];case 7:return t.sent(),this.context.logger.error("Error loading image "+h.src),[3,8];case 8:if(h instanceof cA&&this.renderReplacedElement(h,E,h.canvas),!(h instanceof Du))return[3,12];t.label=9;case 9:return t.trys.push([9,11,,12]),[4,this.context.cache.match(h.svg)];case 10:return Cr=t.sent(),this.renderReplacedElement(h,E,Cr),[3,12];case 11:return t.sent(),this.context.logger.error("Error loading svg "+h.svg.substring(0,255)),[3,12];case 12:return h instanceof zo&&h.tree?(Pe=new u(this.context,{scale:this.options.scale,backgroundColor:h.backgroundColor,x:0,y:0,width:h.width,height:h.height}),[4,Pe.render(h.tree)]):[3,14];case 13:Ve=t.sent(),h.width&&h.height&&this.ctx.drawImage(Ve,0,0,h.width,h.height,h.bounds.left,h.bounds.top,h.bounds.width,h.bounds.height),t.label=14;case 14:if(h instanceof ka&&(et=Math.min(h.bounds.width,h.bounds.height),h.type===ks?h.checked&&(this.ctx.save(),this.path([new fr(h.bounds.left+et*.39363,h.bounds.top+et*.79),new fr(h.bounds.left+et*.16,h.bounds.top+et*.5549),new fr(h.bounds.left+et*.27347,h.bounds.top+et*.44071),new fr(h.bounds.left+et*.39694,h.bounds.top+et*.5649),new fr(h.bounds.left+et*.72983,h.bounds.top+et*.23),new fr(h.bounds.left+et*.84,h.bounds.top+et*.34085),new fr(h.bounds.left+et*.39363,h.bounds.top+et*.79)]),this.ctx.fillStyle=Jn(Vo),this.ctx.fill(),this.ctx.restore()):h.type===WA&&h.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(h.bounds.left+et/2,h.bounds.top+et/2,et/4,0,Math.PI*2,!0),this.ctx.fillStyle=Jn(Vo),this.ctx.fill(),this.ctx.restore())),sc(h)&&h.value.length){switch(xt=this.createFontStyle(I),A=xt[0],gr=xt[1],Xt=this.fontMetrics.getMetrics(A,gr).baseline,this.ctx.font=A,this.ctx.fillStyle=Jn(I.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=ac(h.styles.textAlign),e=sa(h),cr=0,h.styles.textAlign){case 1:cr+=e.width/2;break;case 2:cr+=e.width;break}nn=e.add(cr,0,0,-e.height/2+1),this.ctx.save(),this.path([new fr(e.left,e.top),new fr(e.left+e.width,e.top),new fr(e.left+e.width,e.top+e.height),new fr(e.left,e.top+e.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new bi(h.value,nn),I.letterSpacing,Xt),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Gn(h.styles.display,2048))return[3,20];if(h.styles.listStyleImage===null)return[3,19];if(Fr=h.styles.listStyleImage,Fr.type!==0)return[3,18];Cr=void 0,on=Fr.url,t.label=15;case 15:return t.trys.push([15,17,,18]),[4,this.context.cache.match(on)];case 16:return Cr=t.sent(),this.ctx.drawImage(Cr,h.bounds.left-(Cr.width+10),h.bounds.top),[3,18];case 17:return t.sent(),this.context.logger.error("Error loading list-style-image "+on),[3,18];case 18:return[3,20];case 19:d.listValue&&h.styles.listStyleType!==-1&&(A=this.createFontStyle(I)[0],this.ctx.font=A,this.ctx.fillStyle=Jn(I.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",e=new Y(h.bounds.left,h.bounds.top+Dn(h.styles.paddingTop,h.bounds.width),h.bounds.width,TA(I.lineHeight,I.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new bi(d.listValue,e),I.letterSpacing,TA(I.lineHeight,I.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),t.label=20;case 20:return[2]}})})},u.prototype.renderStackContent=function(d){return we(this,void 0,void 0,function(){var h,E,Fr,I,J,Fr,de,he,Fr,Pe,Ve,Fr,et,xt,Fr,gr,Xt,Fr,cr,nn,Fr;return Ue(this,function(Cr){switch(Cr.label){case 0:if(Gn(d.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(d.element)];case 1:Cr.sent(),h=0,E=d.negativeZIndex,Cr.label=2;case 2:return h<E.length?(Fr=E[h],[4,this.renderStack(Fr)]):[3,5];case 3:Cr.sent(),Cr.label=4;case 4:return h++,[3,2];case 5:return[4,this.renderNodeContent(d.element)];case 6:Cr.sent(),I=0,J=d.nonInlineLevel,Cr.label=7;case 7:return I<J.length?(Fr=J[I],[4,this.renderNode(Fr)]):[3,10];case 8:Cr.sent(),Cr.label=9;case 9:return I++,[3,7];case 10:de=0,he=d.nonPositionedFloats,Cr.label=11;case 11:return de<he.length?(Fr=he[de],[4,this.renderStack(Fr)]):[3,14];case 12:Cr.sent(),Cr.label=13;case 13:return de++,[3,11];case 14:Pe=0,Ve=d.nonPositionedInlineLevel,Cr.label=15;case 15:return Pe<Ve.length?(Fr=Ve[Pe],[4,this.renderStack(Fr)]):[3,18];case 16:Cr.sent(),Cr.label=17;case 17:return Pe++,[3,15];case 18:et=0,xt=d.inlineLevel,Cr.label=19;case 19:return et<xt.length?(Fr=xt[et],[4,this.renderNode(Fr)]):[3,22];case 20:Cr.sent(),Cr.label=21;case 21:return et++,[3,19];case 22:gr=0,Xt=d.zeroOrAutoZIndexOrTransformedOrOpacity,Cr.label=23;case 23:return gr<Xt.length?(Fr=Xt[gr],[4,this.renderStack(Fr)]):[3,26];case 24:Cr.sent(),Cr.label=25;case 25:return gr++,[3,23];case 26:cr=0,nn=d.positiveZIndex,Cr.label=27;case 27:return cr<nn.length?(Fr=nn[cr],[4,this.renderStack(Fr)]):[3,30];case 28:Cr.sent(),Cr.label=29;case 29:return cr++,[3,27];case 30:return[2]}})})},u.prototype.mask=function(d){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(d.slice(0).reverse()),this.ctx.closePath()},u.prototype.path=function(d){this.ctx.beginPath(),this.formatPath(d),this.ctx.closePath()},u.prototype.formatPath=function(d){var h=this;d.forEach(function(E,I){var J=Qi(E)?E.start:E;I===0?h.ctx.moveTo(J.x,J.y):h.ctx.lineTo(J.x,J.y),Qi(E)&&h.ctx.bezierCurveTo(E.startControl.x,E.startControl.y,E.endControl.x,E.endControl.y,E.end.x,E.end.y)})},u.prototype.renderRepeat=function(d,h,E,I){this.path(d),this.ctx.fillStyle=h,this.ctx.translate(E,I),this.ctx.fill(),this.ctx.translate(-E,-I)},u.prototype.resizeImage=function(d,h,E){var I;if(d.width===h&&d.height===E)return d;var J=(I=this.canvas.ownerDocument)!==null&&I!==void 0?I:document,de=J.createElement("canvas");de.width=Math.max(1,h),de.height=Math.max(1,E);var he=de.getContext("2d");return he.drawImage(d,0,0,d.width,d.height,0,0,h,E),de},u.prototype.renderBackgroundImage=function(d){return we(this,void 0,void 0,function(){var h,E,I,J,de,he;return Ue(this,function(Pe){switch(Pe.label){case 0:h=d.styles.backgroundImage.length-1,E=function(Ve){var et,xt,gr,s,v,x,l,g,n,Xt,s,v,x,l,g,cr,nn,Fr,Cr,on,A,e,t,r,n,i,s,a,c,l,g,p,v,x,S,O,M,ie,Be,_e,Qe,We;return Ue(this,function(_t){switch(_t.label){case 0:if(Ve.type!==0)return[3,5];et=void 0,xt=Ve.url,_t.label=1;case 1:return _t.trys.push([1,3,,4]),[4,I.context.cache.match(xt)];case 2:return et=_t.sent(),[3,4];case 3:return _t.sent(),I.context.logger.error("Error loading background-image "+xt),[3,4];case 4:return et&&(gr=eo(d,h,[et.width,et.height,et.width/et.height]),s=gr[0],v=gr[1],x=gr[2],l=gr[3],g=gr[4],n=I.ctx.createPattern(I.resizeImage(et,l,g),"repeat"),I.renderRepeat(s,n,v,x)),[3,6];case 5:Wi(Ve)?(Xt=eo(d,h,[null,null,null]),s=Xt[0],v=Xt[1],x=Xt[2],l=Xt[3],g=Xt[4],cr=la(Ve.angle,l,g),nn=cr[0],Fr=cr[1],Cr=cr[2],on=cr[3],A=cr[4],e=document.createElement("canvas"),e.width=l,e.height=g,t=e.getContext("2d"),r=t.createLinearGradient(Fr,on,Cr,A),nA(Ve.stops,nn).forEach(function(Ge){return r.addColorStop(Ge.stop,Jn(Ge.color))}),t.fillStyle=r,t.fillRect(0,0,l,g),l>0&&g>0&&(n=I.ctx.createPattern(e,"repeat"),I.renderRepeat(s,n,v,x))):qi(Ve)&&(i=eo(d,h,[null,null,null]),s=i[0],a=i[1],c=i[2],l=i[3],g=i[4],p=Ve.position.length===0?[Ci]:Ve.position,v=Dn(p[0],l),x=Dn(p[p.length-1],g),S=ua(Ve,v,x,l,g),O=S[0],M=S[1],O>0&&M>0&&(ie=I.ctx.createRadialGradient(a+v,c+x,0,a+v,c+x,O),nA(Ve.stops,O*2).forEach(function(Ge){return ie.addColorStop(Ge.stop,Jn(Ge.color))}),I.path(s),I.ctx.fillStyle=ie,O!==M?(Be=d.bounds.left+.5*d.bounds.width,_e=d.bounds.top+.5*d.bounds.height,Qe=M/O,We=1/Qe,I.ctx.save(),I.ctx.translate(Be,_e),I.ctx.transform(1,0,0,Qe,0,0),I.ctx.translate(-Be,-_e),I.ctx.fillRect(a,We*(c-_e)+_e,l,g*We),I.ctx.restore()):I.ctx.fill())),_t.label=6;case 6:return h--,[2]}})},I=this,J=0,de=d.styles.backgroundImage.slice(0).reverse(),Pe.label=1;case 1:return J<de.length?(he=de[J],[5,E(he)]):[3,4];case 2:Pe.sent(),Pe.label=3;case 3:return J++,[3,1];case 4:return[2]}})})},u.prototype.renderSolidBorder=function(d,h,E){return we(this,void 0,void 0,function(){return Ue(this,function(I){return this.path(ra(E,h)),this.ctx.fillStyle=Jn(d),this.ctx.fill(),[2]})})},u.prototype.renderDoubleBorder=function(d,h,E,I){return we(this,void 0,void 0,function(){var J,de;return Ue(this,function(he){switch(he.label){case 0:return h<3?[4,this.renderSolidBorder(d,E,I)]:[3,2];case 1:return he.sent(),[2];case 2:return J=Ju(I,E),this.path(J),this.ctx.fillStyle=Jn(d),this.ctx.fill(),de=qu(I,E),this.path(de),this.ctx.fill(),[2]}})})},u.prototype.renderNodeBackgroundAndBorders=function(d){return we(this,void 0,void 0,function(){var h,E,I,J,de,he,Pe,Ve,et=this;return Ue(this,function(xt){switch(xt.label){case 0:return this.applyEffects(d.getEffects(2)),h=d.container.styles,E=!Li(h.backgroundColor)||h.backgroundImage.length,I=[{style:h.borderTopStyle,color:h.borderTopColor,width:h.borderTopWidth},{style:h.borderRightStyle,color:h.borderRightColor,width:h.borderRightWidth},{style:h.borderBottomStyle,color:h.borderBottomColor,width:h.borderBottomWidth},{style:h.borderLeftStyle,color:h.borderLeftColor,width:h.borderLeftWidth}],J=Ac(qs(h.backgroundClip,0),d.curves),E||h.boxShadow.length?(this.ctx.save(),this.path(J),this.ctx.clip(),Li(h.backgroundColor)||(this.ctx.fillStyle=Jn(h.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(d.container)]):[3,2];case 1:xt.sent(),this.ctx.restore(),h.boxShadow.slice(0).reverse().forEach(function(gr){et.ctx.save();var Xt=qA(d.curves),cr=gr.inset?0:wl,nn=ja(Xt,-cr+(gr.inset?1:-1)*gr.spread.number,(gr.inset?1:-1)*gr.spread.number,gr.spread.number*(gr.inset?-2:2),gr.spread.number*(gr.inset?-2:2));gr.inset?(et.path(Xt),et.ctx.clip(),et.mask(nn)):(et.mask(Xt),et.ctx.clip(),et.path(nn)),et.ctx.shadowOffsetX=gr.offsetX.number+cr,et.ctx.shadowOffsetY=gr.offsetY.number,et.ctx.shadowColor=Jn(gr.color),et.ctx.shadowBlur=gr.blur.number,et.ctx.fillStyle=gr.inset?Jn(gr.color):"rgba(0,0,0,1)",et.ctx.fill(),et.ctx.restore()}),xt.label=2;case 2:de=0,he=0,Pe=I,xt.label=3;case 3:return he<Pe.length?(Ve=Pe[he],Ve.style!==0&&!Li(Ve.color)&&Ve.width>0?Ve.style!==2?[3,5]:[4,this.renderDashedDottedBorder(Ve.color,Ve.width,de,d.curves,2)]:[3,11]):[3,13];case 4:return xt.sent(),[3,11];case 5:return Ve.style!==3?[3,7]:[4,this.renderDashedDottedBorder(Ve.color,Ve.width,de,d.curves,3)];case 6:return xt.sent(),[3,11];case 7:return Ve.style!==4?[3,9]:[4,this.renderDoubleBorder(Ve.color,Ve.width,de,d.curves)];case 8:return xt.sent(),[3,11];case 9:return[4,this.renderSolidBorder(Ve.color,de,d.curves)];case 10:xt.sent(),xt.label=11;case 11:de++,xt.label=12;case 12:return he++,[3,3];case 13:return[2]}})})},u.prototype.renderDashedDottedBorder=function(d,h,E,I,J){return we(this,void 0,void 0,function(){var de,he,Pe,Ve,et,xt,gr,Xt,cr,nn,Fr,Cr,on,A,e,t,e,t;return Ue(this,function(r){return this.ctx.save(),de=na(I,E),he=ra(I,E),J===2&&(this.path(he),this.ctx.clip()),Qi(he[0])?(Pe=he[0].start.x,Ve=he[0].start.y):(Pe=he[0].x,Ve=he[0].y),Qi(he[1])?(et=he[1].end.x,xt=he[1].end.y):(et=he[1].x,xt=he[1].y),E===0||E===2?gr=Math.abs(Pe-et):gr=Math.abs(Ve-xt),this.ctx.beginPath(),J===3?this.formatPath(de):this.formatPath(he.slice(0,2)),Xt=h<3?h*3:h*2,cr=h<3?h*2:h,J===3&&(Xt=h,cr=h),nn=!0,gr<=Xt*2?nn=!1:gr<=Xt*2+cr?(Fr=gr/(2*Xt+cr),Xt*=Fr,cr*=Fr):(Cr=Math.floor((gr+cr)/(Xt+cr)),on=(gr-Cr*Xt)/(Cr-1),A=(gr-(Cr+1)*Xt)/Cr,cr=A<=0||Math.abs(cr-on)<Math.abs(cr-A)?on:A),nn&&(J===3?this.ctx.setLineDash([0,Xt+cr]):this.ctx.setLineDash([Xt,cr])),J===3?(this.ctx.lineCap="round",this.ctx.lineWidth=h):this.ctx.lineWidth=h*2+1.1,this.ctx.strokeStyle=Jn(d),this.ctx.stroke(),this.ctx.setLineDash([]),J===2&&(Qi(he[0])&&(e=he[3],t=he[0],this.ctx.beginPath(),this.formatPath([new fr(e.end.x,e.end.y),new fr(t.start.x,t.start.y)]),this.ctx.stroke()),Qi(he[1])&&(e=he[1],t=he[2],this.ctx.beginPath(),this.formatPath([new fr(e.end.x,e.end.y),new fr(t.start.x,t.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},u.prototype.render=function(d){return we(this,void 0,void 0,function(){var h;return Ue(this,function(E){switch(E.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Jn(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),h=_l(d),[4,this.renderStack(h)];case 1:return E.sent(),this.applyEffects([]),[2,this.canvas]}})})},u}(El),sc=function(f){return f instanceof Zo||f instanceof Wo?!0:f instanceof ka&&f.type!==WA&&f.type!==ks},Ac=function(f,u){switch(f){case 0:return qA(u);case 2:return za(u);case 1:default:return ea(u)}},ac=function(f){switch(f){case 1:return"center";case 2:return"right";case 0:default:return"left"}},to=["-apple-system","system-ui"],oc=function(f){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?f.filter(function(u){return to.indexOf(u)===-1}):f},aa=function(f){Z(u,f);function u(d,h){var E=f.call(this,d,h)||this;return E.canvas=h.canvas?h.canvas:document.createElement("canvas"),E.ctx=E.canvas.getContext("2d"),E.options=h,E.canvas.width=Math.floor(h.width*h.scale),E.canvas.height=Math.floor(h.height*h.scale),E.canvas.style.width=h.width+"px",E.canvas.style.height=h.height+"px",E.ctx.scale(E.options.scale,E.options.scale),E.ctx.translate(-h.x,-h.y),E.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+h.width+"x"+h.height+" at "+h.x+","+h.y+") with scale "+h.scale),E}return u.prototype.render=function(d){return we(this,void 0,void 0,function(){var h,E;return Ue(this,function(I){switch(I.label){case 0:return h=Ua(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,d),[4,lc(h)];case 1:return E=I.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Jn(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(E,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},u}(El),lc=function(f){return new Promise(function(u,d){var h=new Image;h.onload=function(){u(h)},h.onerror=d,h.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(f))})},uc=function(){function f(u){var d=u.id,h=u.enabled;this.id=d,this.enabled=h,this.start=Date.now()}return f.prototype.debug=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];this.enabled&&(typeof window!="undefined"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,ve([this.id,this.getTime()+"ms"],u)):this.info.apply(this,u))},f.prototype.getTime=function(){return Date.now()-this.start},f.prototype.info=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];this.enabled&&typeof window!="undefined"&&window.console&&typeof console.info=="function"&&console.info.apply(console,ve([this.id,this.getTime()+"ms"],u))},f.prototype.warn=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];this.enabled&&(typeof window!="undefined"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,ve([this.id,this.getTime()+"ms"],u)):this.info.apply(this,u))},f.prototype.error=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];this.enabled&&(typeof window!="undefined"&&window.console&&typeof console.error=="function"?console.error.apply(console,ve([this.id,this.getTime()+"ms"],u)):this.info.apply(this,u))},f.instances={},f}(),cc=function(){function f(u,d){var h;this.windowBounds=d,this.instanceName="#"+f.instanceCount++,this.logger=new uc({id:this.instanceName,enabled:u.logging}),this.cache=(h=u.cache)!==null&&h!==void 0?h:new ul(this,u)}return f.instanceCount=1,f}(),fc=function(f,u){return u===void 0&&(u={}),Cl(f,u)};typeof window!="undefined"&&Ga.setContext(window);var Cl=function(f,u){return we(void 0,void 0,void 0,function(){var d,h,E,I,J,de,he,Pe,Ve,et,xt,gr,Xt,cr,nn,Fr,Cr,on,A,e,r,t,r,n,i,s,a,c,l,g,p,v,x,S,O,M,ie,Be,_e,Qe;return Ue(this,function(We){switch(We.label){case 0:if(!f||typeof f!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(d=f.ownerDocument,!d)throw new Error("Element is not attached to a Document");if(h=d.defaultView,!h)throw new Error("Document is not attached to a Window");return E={allowTaint:(n=u.allowTaint)!==null&&n!==void 0?n:!1,imageTimeout:(i=u.imageTimeout)!==null&&i!==void 0?i:15e3,proxy:u.proxy,useCORS:(s=u.useCORS)!==null&&s!==void 0?s:!1},I=z({logging:(a=u.logging)!==null&&a!==void 0?a:!0,cache:u.cache},E),J={windowWidth:(c=u.windowWidth)!==null&&c!==void 0?c:h.innerWidth,windowHeight:(l=u.windowHeight)!==null&&l!==void 0?l:h.innerHeight,scrollX:(g=u.scrollX)!==null&&g!==void 0?g:h.pageXOffset,scrollY:(p=u.scrollY)!==null&&p!==void 0?p:h.pageYOffset},de=new Y(J.scrollX,J.scrollY,J.windowWidth,J.windowHeight),he=new cc(I,de),Pe=(v=u.foreignObjectRendering)!==null&&v!==void 0?v:!1,Ve={allowTaint:(x=u.allowTaint)!==null&&x!==void 0?x:!1,onclone:u.onclone,ignoreElements:u.ignoreElements,inlineImages:Pe,copyStyles:Pe},he.logger.debug("Starting document clone with size "+de.width+"x"+de.height+" scrolled to "+-de.left+","+-de.top),et=new Ha(he,f,Ve),xt=et.clonedReferenceElement,xt?[4,et.toIFrame(d,de)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return gr=We.sent(),Xt=vi(xt)||Jo(xt)?ye(xt.ownerDocument):_(he,xt),cr=Xt.width,nn=Xt.height,Fr=Xt.left,Cr=Xt.top,on=bl(he,xt,u.backgroundColor),A={canvas:u.canvas,backgroundColor:on,scale:(O=(S=u.scale)!==null&&S!==void 0?S:h.devicePixelRatio)!==null&&O!==void 0?O:1,x:((M=u.x)!==null&&M!==void 0?M:0)+Fr,y:((ie=u.y)!==null&&ie!==void 0?ie:0)+Cr,width:(Be=u.width)!==null&&Be!==void 0?Be:Math.ceil(cr),height:(_e=u.height)!==null&&_e!==void 0?_e:Math.ceil(nn)},Pe?(he.logger.debug("Document cloned, using foreign object rendering"),r=new aa(he,A),[4,r.render(xt)]):[3,3];case 2:return e=We.sent(),[3,5];case 3:return he.logger.debug("Document cloned, element located at "+Fr+","+Cr+" with size "+cr+"x"+nn+" using computed rendering"),he.logger.debug("Starting DOM parsing"),t=Yo(he,xt),on===t.styles.backgroundColor&&(t.styles.backgroundColor=Pi.TRANSPARENT),he.logger.debug("Starting renderer for element at "+A.x+","+A.y+" with size "+A.width+"x"+A.height),r=new ic(he,A),[4,r.render(t)];case 4:e=We.sent(),We.label=5;case 5:return(!((Qe=u.removeContainer)!==null&&Qe!==void 0)||Qe)&&(Ha.destroy(gr)||he.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),he.logger.debug("Finished rendering"),[2,e]}})})},bl=function(f,u,d){var h=u.ownerDocument,E=h.documentElement?os(f,getComputedStyle(h.documentElement).backgroundColor):Pi.TRANSPARENT,I=h.body?os(f,getComputedStyle(h.body).backgroundColor):Pi.TRANSPARENT,J=typeof d=="string"?os(f,d):d===null?Pi.TRANSPARENT:4294967295;return u===h.documentElement?Li(E)?Li(I)?J:I:E:J};return fc})},67467:function(Sr,St){St.read=function(Z,z,we,Ue,ve){var Y,_,ye=ve*8-Ue-1,H=(1<<ye)-1,o=H>>1,ne=-7,U=we?ve-1:0,B=we?-1:1,y=Z[z+U];for(U+=B,Y=y&(1<<-ne)-1,y>>=-ne,ne+=ye;ne>0;Y=Y*256+Z[z+U],U+=B,ne-=8);for(_=Y&(1<<-ne)-1,Y>>=-ne,ne+=Ue;ne>0;_=_*256+Z[z+U],U+=B,ne-=8);if(Y===0)Y=1-o;else{if(Y===H)return _?NaN:(y?-1:1)*(1/0);_=_+Math.pow(2,Ue),Y=Y-o}return(y?-1:1)*_*Math.pow(2,Y-Ue)},St.write=function(Z,z,we,Ue,ve,Y){var _,ye,H,o=Y*8-ve-1,ne=(1<<o)-1,U=ne>>1,B=ve===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=Ue?0:Y-1,C=Ue?1:-1,T=z<0||z===0&&1/z<0?1:0;for(z=Math.abs(z),isNaN(z)||z===1/0?(ye=isNaN(z)?1:0,_=ne):(_=Math.floor(Math.log(z)/Math.LN2),z*(H=Math.pow(2,-_))<1&&(_--,H*=2),_+U>=1?z+=B/H:z+=B*Math.pow(2,1-U),z*H>=2&&(_++,H/=2),_+U>=ne?(ye=0,_=ne):_+U>=1?(ye=(z*H-1)*Math.pow(2,ve),_=_+U):(ye=z*Math.pow(2,U-1)*Math.pow(2,ve),_=0));ve>=8;Z[we+y]=ye&255,y+=C,ye/=256,ve-=8);for(_=_<<ve|ye,o+=ve;o>0;Z[we+y]=_&255,y+=C,_/=256,o-=8);Z[we+y-C]|=T*128}},53184:function(Sr,St,Z){"use strict";var z,we;function Ue(ve,Y,_){var ye=function(H,o){return ve.js_beautify(H,o)};return ye.js=ve.js_beautify,ye.css=Y.css_beautify,ye.html=_.html_beautify,ye.js_beautify=ve.js_beautify,ye.css_beautify=Y.css_beautify,ye.html_beautify=_.html_beautify,ye}z=[Z(58553),Z(87804),Z(40998)],we=function(ve,Y,_){return Ue(ve,Y,_)}.apply(St,z),we!==void 0&&(Sr.exports=we)},87804:function(Sr,St){var Z,z;(function(){var we;(function(){"use strict";var ve=[,,function(H){function o(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=[]}o.prototype.clone_empty=function(){var B=new o(this.__parent);return B.set_indent(this.__indent_count,this.__alignment_count),B},o.prototype.item=function(B){return B<0?this.__items[this.__items.length+B]:this.__items[B]},o.prototype.has_match=function(B){for(var y=this.__items.length-1;y>=0;y--)if(this.__items[y].match(B))return!0;return!1},o.prototype.set_indent=function(B,y){this.is_empty()&&(this.__indent_count=B||0,this.__alignment_count=y||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.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)},o.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},o.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},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(B){this.__items.push(B);var y=B.lastIndexOf(`
`);y!==-1?this.__character_count=B.length-y:this.__character_count+=B.length},o.prototype.pop=function(){var B=null;return this.is_empty()||(B=this.__items.pop(),this.__character_count-=B.length),B},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.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 ne(B,y){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)),y=y||"",B.indent_level>0&&(y=new Array(B.indent_level+1).join(this.__indent_string)),this.__base_string=y,this.__base_string_length=y.length}ne.prototype.get_indent_size=function(B,y){var C=this.__base_string_length;return y=y||0,B<0&&(C=0),C+=B*this.__indent_size,C+=y,C},ne.prototype.get_indent_string=function(B,y){var C=this.__base_string;return y=y||0,B<0&&(B=0,C=""),y+=B*this.__indent_size,this.__ensure_cache(y),C+=this.__cache[y],C},ne.prototype.__ensure_cache=function(B){for(;B>=this.__cache.length;)this.__add_column()},ne.prototype.__add_column=function(){var B=this.__cache.length,y=0,C="";this.__indent_size&&B>=this.__indent_size&&(y=Math.floor(B/this.__indent_size),B-=y*this.__indent_size,C=new Array(y+1).join(this.__indent_string)),B&&(C+=new Array(B+1).join(" ")),this.__cache.push(C)};function U(B,y){this.__indent_cache=new ne(B,y),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 o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}U.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},U.prototype.get_line_number=function(){return this.__lines.length},U.prototype.get_indent_string=function(B,y){return this.__indent_cache.get_indent_string(B,y)},U.prototype.get_indent_size=function(B,y){return this.__indent_cache.get_indent_size(B,y)},U.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},U.prototype.add_new_line=function(B){return this.is_empty()||!B&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},U.prototype.get_code=function(B){this.trim(!0);var y=this.current_line.pop();y&&(y[y.length-1]===`
`&&(y=y.replace(/\n+$/g,"")),this.current_line.push(y)),this._end_with_newline&&this.__add_outputline();var C=this.__lines.join(`
`);return B!==`
`&&(C=C.replace(/[\n]/g,B)),C},U.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},U.prototype.set_indent=function(B,y){return B=B||0,y=y||0,this.next_line.set_indent(B,y),this.__lines.length>1?(this.current_line.set_indent(B,y),!0):(this.current_line.set_indent(),!1)},U.prototype.add_raw_token=function(B){for(var y=0;y<B.newlines;y++)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},U.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()},U.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(" "))},U.prototype.remove_indent=function(B){for(var y=this.__lines.length;B<y;)this.__lines[B]._remove_indent(),B++;this.current_line._remove_wrap_indent()},U.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},U.prototype.just_added_newline=function(){return this.current_line.is_empty()},U.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},U.prototype.ensure_empty_line_above=function(B,y){for(var C=this.__lines.length-2;C>=0;){var T=this.__lines[C];if(T.is_empty())break;if(T.item(0).indexOf(B)!==0&&T.item(-1)!==y){this.__lines.splice(C+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}C--}},H.exports.Output=U},,,,function(H){function o(B,y){this.raw_options=ne(B,y),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"])}o.prototype._get_array=function(B,y){var C=this.raw_options[B],T=y||[];return typeof C=="object"?C!==null&&typeof C.concat=="function"&&(T=C.concat()):typeof C=="string"&&(T=C.split(/[^a-zA-Z0-9_\/\-]+/)),T},o.prototype._get_boolean=function(B,y){var C=this.raw_options[B],T=C===void 0?!!y:!!C;return T},o.prototype._get_characters=function(B,y){var C=this.raw_options[B],T=y||"";return typeof C=="string"&&(T=C.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),T},o.prototype._get_number=function(B,y){var C=this.raw_options[B];y=parseInt(y,10),isNaN(y)&&(y=0);var T=parseInt(C,10);return isNaN(T)&&(T=y),T},o.prototype._get_selection=function(B,y,C){var T=this._get_selection_list(B,y,C);if(T.length!==1)throw new Error("Invalid Option Value: The option '"+B+`' can only be one of the following values:
`+y+`
You passed in: '`+this.raw_options[B]+"'");return T[0]},o.prototype._get_selection_list=function(B,y,C){if(!y||y.length===0)throw new Error("Selection list cannot be empty.");if(C=C||[y[0]],!this._is_valid_selection(C,y))throw new Error("Invalid Default Value!");var T=this._get_array(B,C);if(!this._is_valid_selection(T,y))throw new Error("Invalid Option Value: The option '"+B+`' can contain only the following values:
`+y+`
You passed in: '`+this.raw_options[B]+"'");return T},o.prototype._is_valid_selection=function(B,y){return B.length&&y.length&&!B.some(function(C){return y.indexOf(C)===-1})};function ne(B,y){var C={};B=U(B);var T;for(T in B)T!==y&&(C[T]=B[T]);if(y&&B[y])for(T in B[y])C[T]=B[y][T];return C}function U(B){var y={},C;for(C in B){var T=C.replace(/-/g,"_");y[T]=B[C]}return y}H.exports.Options=o,H.exports.normalizeOpts=U,H.exports.mergeOpts=ne},,function(H){var o=RegExp.prototype.hasOwnProperty("sticky");function ne(U){this.__input=U||"",this.__input_length=this.__input.length,this.__position=0}ne.prototype.restart=function(){this.__position=0},ne.prototype.back=function(){this.__position>0&&(this.__position-=1)},ne.prototype.hasNext=function(){return this.__position<this.__input_length},ne.prototype.next=function(){var U=null;return this.hasNext()&&(U=this.__input.charAt(this.__position),this.__position+=1),U},ne.prototype.peek=function(U){var B=null;return U=U||0,U+=this.__position,U>=0&&U<this.__input_length&&(B=this.__input.charAt(U)),B},ne.prototype.__match=function(U,B){U.lastIndex=B;var y=U.exec(this.__input);return y&&!(o&&U.sticky)&&y.index!==B&&(y=null),y},ne.prototype.test=function(U,B){return B=B||0,B+=this.__position,B>=0&&B<this.__input_length?!!this.__match(U,B):!1},ne.prototype.testChar=function(U,B){var y=this.peek(B);return U.lastIndex=0,y!==null&&U.test(y)},ne.prototype.match=function(U){var B=this.__match(U,this.__position);return B?this.__position+=B[0].length:B=null,B},ne.prototype.read=function(U,B,y){var C="",T;return U&&(T=this.match(U),T&&(C+=T[0])),B&&(T||!U)&&(C+=this.readUntil(B,y)),C},ne.prototype.readUntil=function(U,B){var y="",C=this.__position;U.lastIndex=this.__position;var T=U.exec(this.__input);return T?(C=T.index,B&&(C+=T[0].length)):C=this.__input_length,y=this.__input.substring(this.__position,C),this.__position=C,y},ne.prototype.readUntilAfter=function(U){return this.readUntil(U,!0)},ne.prototype.get_regexp=function(U,B){var y=null,C="g";return B&&o&&(C="y"),typeof U=="string"&&U!==""?y=new RegExp(U,C):U&&(y=new RegExp(U.source,C)),y},ne.prototype.get_literal_regexp=function(U){return RegExp(U.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},ne.prototype.peekUntilAfter=function(U){var B=this.__position,y=this.readUntilAfter(U);return this.__position=B,y},ne.prototype.lookBack=function(U){var B=this.__position-1;return B>=U.length&&this.__input.substring(B-U.length,B).toLowerCase()===U},H.exports.InputScanner=ne},,,,,function(H){function o(ne,U){ne=typeof ne=="string"?ne:ne.source,U=typeof U=="string"?U:U.source,this.__directives_block_pattern=new RegExp(ne+/ beautify( \w+[:]\w+)+ /.source+U,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(ne+/\sbeautify\signore:end\s/.source+U,"g")}o.prototype.get_directives=function(ne){if(!ne.match(this.__directives_block_pattern))return null;var U={};this.__directive_pattern.lastIndex=0;for(var B=this.__directive_pattern.exec(ne);B;)U[B[1]]=B[2],B=this.__directive_pattern.exec(ne);return U},o.prototype.readIgnored=function(ne){return ne.readUntilAfter(this.__directives_end_ignore_pattern)},H.exports.Directives=o},,function(H,o,ne){var U=ne(16).Beautifier,B=ne(17).Options;function y(C,T){var ee=new U(C,T);return ee.beautify()}H.exports=y,H.exports.defaultOptions=function(){return new B}},function(H,o,ne){var U=ne(17).Options,B=ne(2).Output,y=ne(8).InputScanner,C=ne(13).Directives,T=new C(/\/\*/,/\*\//),ee=/\r\n|[\r\n]/,G=/\r\n|[\r\n]/g,W=/\s/,k=/(?:\s|\n)+/g,K=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,re=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function me(Ce,Ie){this._source_text=Ce||"",this._options=new U(Ie),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"]}me.prototype.eatString=function(Ce){var Ie="";for(this._ch=this._input.next();this._ch;){if(Ie+=this._ch,this._ch==="\\")Ie+=this._input.next();else if(Ce.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return Ie},me.prototype.eatWhitespace=function(Ce){for(var Ie=W.test(this._input.peek()),le=0;W.test(this._input.peek());)this._ch=this._input.next(),Ce&&this._ch===`
`&&(le===0||le<this._options.max_preserve_newlines)&&(le++,this._output.add_new_line(!0));return Ie},me.prototype.foundNestedPseudoClass=function(){for(var Ce=0,Ie=1,le=this._input.peek(Ie);le;){if(le==="{")return!0;if(le==="(")Ce+=1;else if(le===")"){if(Ce===0)return!1;Ce-=1}else if(le===";"||le==="}")return!1;Ie++,le=this._input.peek(Ie)}return!1},me.prototype.print_string=function(Ce){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(Ce)},me.prototype.preserveSingleSpace=function(Ce){Ce&&(this._output.space_before_token=!0)},me.prototype.indent=function(){this._indentLevel++},me.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},me.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Ce=this._source_text,Ie=this._options.eol;Ie==="auto"&&(Ie=`
`,Ce&&ee.test(Ce||"")&&(Ie=Ce.match(ee)[0])),Ce=Ce.replace(G,`
`);var le=Ce.match(/^[\t ]*/)[0];this._output=new B(this._options,le),this._input=new y(Ce),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var xe=0,Ke=!1,ge=!1,Ze=!1,q=!1,L=!1,j=this._ch,X=!1,ue,ae,w;ue=this._input.read(k),ae=ue!=="",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 b=this._input.read(K),$=T.get_directives(b);$&&$.ignore==="start"&&(b+=T.readIgnored(this._input)),this.print_string(b),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(re)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(ae),this.print_string(this._ch);var fe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);fe.match(/[ :]$/)&&(fe=this.eatString(": ").replace(/\s+$/,""),this.print_string(fe),this._output.space_before_token=!0),xe===0&&fe.indexOf(":")!==-1&&(ge=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(ae),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var $e=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);$e.match(/[ :]$/)&&($e=this.eatString(": ").replace(/\s+$/,""),this.print_string($e),this._output.space_before_token=!0),xe===0&&$e.indexOf(":")!==-1?(ge=!0,this.indent()):$e in this.NESTED_AT_RULE?(this._nestedLevel+=1,$e in this.CONDITIONAL_GROUP_RULE&&(Ze=!0)):xe===0&&!ge&&(q=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(ae),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")ge&&(ge=!1,this.outdent()),q=!1,Ze?(Ze=!1,Ke=this._indentLevel>=this._nestedLevel):Ke=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&Ke&&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),ge&&(this.outdent(),ge=!1),this.print_string(this._ch),Ke=!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 lt=0;lt<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;lt++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[lt])){X=!0;break}(Ke||Ze)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!q&&xe===0?(this.print_string(":"),ge||(ge=!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 Rt=w==='"'||w==="'";this.preserveSingleSpace(Rt||ae),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")X=!1,xe===0?(ge&&(this.outdent(),ge=!1),q=!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(),xe++,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(")")),xe&&(xe--,this.outdent()));else{var Ct=!1;this._input.lookBack("with")&&(Ct=!0),this.preserveSingleSpace(ae||Ct),this.print_string(this._ch),ge&&w==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),L=!0):(this.eatWhitespace(),xe++,this.indent())}else if(this._ch===")")xe&&(xe--,this.outdent()),L&&this._input.peek()===";"&&this._options.selector_separator_newline&&(L=!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&&(!ge||L)&&xe===0&&!q?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!ge&&xe===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&&W.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(ae),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),W.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 Vt=w==='"'||w==="'";this.preserveSingleSpace(Vt||ae),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&X&&this._output.add_new_line()}var Qt=this._output.get_code(Ie);return Qt},H.exports.Beautifier=me},function(H,o,ne){var U=ne(6).Options;function B(y){U.call(this,y,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var C=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||C;var T=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var ee=0;ee<T.length;ee++)T[ee]!=="expand"?this.brace_style="collapse":this.brace_style=T[ee]}B.prototype=new U,H.exports.Options=B}],Y={};function _(H){var o=Y[H];if(o!==void 0)return o.exports;var ne=Y[H]={exports:{}};return ve[H](ne,ne.exports,_),ne.exports}var ye=_(15);we=ye})();var Ue=we;Z=[],z=function(){return{css_beautify:Ue}}.apply(St,Z),z!==void 0&&(Sr.exports=z)})()},40998:function(Sr,St,Z){var z,we;(function(){var Ue;(function(){"use strict";var ye=[,,function(U){function B(T){this.__parent=T,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 T=new B(this.__parent);return T.set_indent(this.__indent_count,this.__alignment_count),T},B.prototype.item=function(T){return T<0?this.__items[this.__items.length+T]:this.__items[T]},B.prototype.has_match=function(T){for(var ee=this.__items.length-1;ee>=0;ee--)if(this.__items[ee].match(T))return!0;return!1},B.prototype.set_indent=function(T,ee){this.is_empty()&&(this.__indent_count=T||0,this.__alignment_count=ee||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 T=this.__parent.current_line;return T.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),T.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),T.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,T.__items[0]===" "&&(T.__items.splice(0,1),T.__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(T){this.__items.push(T);var ee=T.lastIndexOf(`
`);ee!==-1?this.__character_count=T.length-ee:this.__character_count+=T.length},B.prototype.pop=function(){var T=null;return this.is_empty()||(T=this.__items.pop(),this.__character_count-=T.length),T},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 T="";return this.is_empty()?this.__parent.indent_empty_lines&&(T=this.__parent.get_indent_string(this.__indent_count)):(T=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),T+=this.__items.join("")),T};function y(T,ee){this.__cache=[""],this.__indent_size=T.indent_size,this.__indent_string=T.indent_char,T.indent_with_tabs||(this.__indent_string=new Array(T.indent_size+1).join(T.indent_char)),ee=ee||"",T.indent_level>0&&(ee=new Array(T.indent_level+1).join(this.__indent_string)),this.__base_string=ee,this.__base_string_length=ee.length}y.prototype.get_indent_size=function(T,ee){var G=this.__base_string_length;return ee=ee||0,T<0&&(G=0),G+=T*this.__indent_size,G+=ee,G},y.prototype.get_indent_string=function(T,ee){var G=this.__base_string;return ee=ee||0,T<0&&(T=0,G=""),ee+=T*this.__indent_size,this.__ensure_cache(ee),G+=this.__cache[ee],G},y.prototype.__ensure_cache=function(T){for(;T>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var T=this.__cache.length,ee=0,G="";this.__indent_size&&T>=this.__indent_size&&(ee=Math.floor(T/this.__indent_size),T-=ee*this.__indent_size,G=new Array(ee+1).join(this.__indent_string)),T&&(G+=new Array(T+1).join(" ")),this.__cache.push(G)};function C(T,ee){this.__indent_cache=new y(T,ee),this.raw=!1,this._end_with_newline=T.end_with_newline,this.indent_size=T.indent_size,this.wrap_line_length=T.wrap_line_length,this.indent_empty_lines=T.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()}C.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},C.prototype.get_line_number=function(){return this.__lines.length},C.prototype.get_indent_string=function(T,ee){return this.__indent_cache.get_indent_string(T,ee)},C.prototype.get_indent_size=function(T,ee){return this.__indent_cache.get_indent_size(T,ee)},C.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},C.prototype.add_new_line=function(T){return this.is_empty()||!T&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},C.prototype.get_code=function(T){this.trim(!0);var ee=this.current_line.pop();ee&&(ee[ee.length-1]===`
`&&(ee=ee.replace(/\n+$/g,"")),this.current_line.push(ee)),this._end_with_newline&&this.__add_outputline();var G=this.__lines.join(`
`);return T!==`
`&&(G=G.replace(/[\n]/g,T)),G},C.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},C.prototype.set_indent=function(T,ee){return T=T||0,ee=ee||0,this.next_line.set_indent(T,ee),this.__lines.length>1?(this.current_line.set_indent(T,ee),!0):(this.current_line.set_indent(),!1)},C.prototype.add_raw_token=function(T){for(var ee=0;ee<T.newlines;ee++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(T.whitespace_before),this.current_line.push(T.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},C.prototype.add_token=function(T){this.__add_space_before_token(),this.current_line.push(T),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},C.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(" "))},C.prototype.remove_indent=function(T){for(var ee=this.__lines.length;T<ee;)this.__lines[T]._remove_indent(),T++;this.current_line._remove_wrap_indent()},C.prototype.trim=function(T){for(T=T===void 0?!1:T,this.current_line.trim();T&&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},C.prototype.just_added_newline=function(){return this.current_line.is_empty()},C.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},C.prototype.ensure_empty_line_above=function(T,ee){for(var G=this.__lines.length-2;G>=0;){var W=this.__lines[G];if(W.is_empty())break;if(W.item(0).indexOf(T)!==0&&W.item(-1)!==ee){this.__lines.splice(G+1,0,new B(this)),this.previous_line=this.__lines[this.__lines.length-2];break}G--}},U.exports.Output=C},function(U){function B(y,C,T,ee){this.type=y,this.text=C,this.comments_before=null,this.newlines=T||0,this.whitespace_before=ee||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}U.exports.Token=B},,,function(U){function B(T,ee){this.raw_options=y(T,ee),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(T,ee){var G=this.raw_options[T],W=ee||[];return typeof G=="object"?G!==null&&typeof G.concat=="function"&&(W=G.concat()):typeof G=="string"&&(W=G.split(/[^a-zA-Z0-9_\/\-]+/)),W},B.prototype._get_boolean=function(T,ee){var G=this.raw_options[T],W=G===void 0?!!ee:!!G;return W},B.prototype._get_characters=function(T,ee){var G=this.raw_options[T],W=ee||"";return typeof G=="string"&&(W=G.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),W},B.prototype._get_number=function(T,ee){var G=this.raw_options[T];ee=parseInt(ee,10),isNaN(ee)&&(ee=0);var W=parseInt(G,10);return isNaN(W)&&(W=ee),W},B.prototype._get_selection=function(T,ee,G){var W=this._get_selection_list(T,ee,G);if(W.length!==1)throw new Error("Invalid Option Value: The option '"+T+`' can only be one of the following values:
`+ee+`
You passed in: '`+this.raw_options[T]+"'");return W[0]},B.prototype._get_selection_list=function(T,ee,G){if(!ee||ee.length===0)throw new Error("Selection list cannot be empty.");if(G=G||[ee[0]],!this._is_valid_selection(G,ee))throw new Error("Invalid Default Value!");var W=this._get_array(T,G);if(!this._is_valid_selection(W,ee))throw new Error("Invalid Option Value: The option '"+T+`' can contain only the following values:
`+ee+`
You passed in: '`+this.raw_options[T]+"'");return W},B.prototype._is_valid_selection=function(T,ee){return T.length&&ee.length&&!T.some(function(G){return ee.indexOf(G)===-1})};function y(T,ee){var G={};T=C(T);var W;for(W in T)W!==ee&&(G[W]=T[W]);if(ee&&T[ee])for(W in T[ee])G[W]=T[ee][W];return G}function C(T){var ee={},G;for(G in T){var W=G.replace(/-/g,"_");ee[W]=T[G]}return ee}U.exports.Options=B,U.exports.normalizeOpts=C,U.exports.mergeOpts=y},,function(U){var B=RegExp.prototype.hasOwnProperty("sticky");function y(C){this.__input=C||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var C=null;return this.hasNext()&&(C=this.__input.charAt(this.__position),this.__position+=1),C},y.prototype.peek=function(C){var T=null;return C=C||0,C+=this.__position,C>=0&&C<this.__input_length&&(T=this.__input.charAt(C)),T},y.prototype.__match=function(C,T){C.lastIndex=T;var ee=C.exec(this.__input);return ee&&!(B&&C.sticky)&&ee.index!==T&&(ee=null),ee},y.prototype.test=function(C,T){return T=T||0,T+=this.__position,T>=0&&T<this.__input_length?!!this.__match(C,T):!1},y.prototype.testChar=function(C,T){var ee=this.peek(T);return C.lastIndex=0,ee!==null&&C.test(ee)},y.prototype.match=function(C){var T=this.__match(C,this.__position);return T?this.__position+=T[0].length:T=null,T},y.prototype.read=function(C,T,ee){var G="",W;return C&&(W=this.match(C),W&&(G+=W[0])),T&&(W||!C)&&(G+=this.readUntil(T,ee)),G},y.prototype.readUntil=function(C,T){var ee="",G=this.__position;C.lastIndex=this.__position;var W=C.exec(this.__input);return W?(G=W.index,T&&(G+=W[0].length)):G=this.__input_length,ee=this.__input.substring(this.__position,G),this.__position=G,ee},y.prototype.readUntilAfter=function(C){return this.readUntil(C,!0)},y.prototype.get_regexp=function(C,T){var ee=null,G="g";return T&&B&&(G="y"),typeof C=="string"&&C!==""?ee=new RegExp(C,G):C&&(ee=new RegExp(C.source,G)),ee},y.prototype.get_literal_regexp=function(C){return RegExp(C.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(C){var T=this.__position,ee=this.readUntilAfter(C);return this.__position=T,ee},y.prototype.lookBack=function(C){var T=this.__position-1;return T>=C.length&&this.__input.substring(T-C.length,T).toLowerCase()===C},U.exports.InputScanner=y},function(U,B,y){var C=y(8).InputScanner,T=y(3).Token,ee=y(10).TokenStream,G=y(11).WhitespacePattern,W={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},k=function(K,re){this._input=new C(K),this._options=re||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new G(this._input)};k.prototype.tokenize=function(){this._input.restart(),this.__tokens=new ee,this._reset();for(var K,re=new T(W.START,""),me=null,Ce=[],Ie=new ee;re.type!==W.EOF;){for(K=this._get_next_token(re,me);this._is_comment(K);)Ie.add(K),K=this._get_next_token(re,me);Ie.isEmpty()||(K.comments_before=Ie,Ie=new ee),K.parent=me,this._is_opening(K)?(Ce.push(me),me=K):me&&this._is_closing(K,me)&&(K.opened=me,me.closed=K,me=Ce.pop(),K.parent=me),K.previous=re,re.next=K,this.__tokens.add(K),re=K}return this.__tokens},k.prototype._is_first_token=function(){return this.__tokens.isEmpty()},k.prototype._reset=function(){},k.prototype._get_next_token=function(K,re){this._readWhitespace();var me=this._input.read(/.+/g);return me?this._create_token(W.RAW,me):this._create_token(W.EOF,"")},k.prototype._is_comment=function(K){return!1},k.prototype._is_opening=function(K){return!1},k.prototype._is_closing=function(K,re){return!1},k.prototype._create_token=function(K,re){var me=new T(K,re,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return me},k.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},U.exports.Tokenizer=k,U.exports.TOKEN=W},function(U){function B(y){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=y}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 y=null;return this.hasNext()&&(y=this.__tokens[this.__position],this.__position+=1),y},B.prototype.peek=function(y){var C=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(C=this.__tokens[y]),C},B.prototype.add=function(y){this.__parent_token&&(y.parent=this.__parent_token),this.__tokens.push(y),this.__tokens_length+=1},U.exports.TokenStream=B},function(U,B,y){var C=y(12).Pattern;function T(ee,G){C.call(this,ee,G),G?this._line_regexp=this._input.get_regexp(G._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}T.prototype=new C,T.prototype.__set_whitespace_patterns=function(ee,G){ee+="\\t ",G+="\\n\\r",this._match_pattern=this._input.get_regexp("["+ee+G+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+G+"]")},T.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var ee=this._input.read(this._match_pattern);if(ee===" ")this.whitespace_before_token=" ";else if(ee){var G=this.__split(this._newline_regexp,ee);this.newline_count=G.length-1,this.whitespace_before_token=G[this.newline_count]}return ee},T.prototype.matching=function(ee,G){var W=this._create();return W.__set_whitespace_patterns(ee,G),W._update(),W},T.prototype._create=function(){return new T(this._input,this)},T.prototype.__split=function(ee,G){ee.lastIndex=0;for(var W=0,k=[],K=ee.exec(G);K;)k.push(G.substring(W,K.index)),W=K.index+K[0].length,K=ee.exec(G);return W<G.length?k.push(G.substring(W,G.length)):k.push(""),k},U.exports.WhitespacePattern=T},function(U){function B(y,C){this._input=y,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,C&&(this._starting_pattern=this._input.get_regexp(C._starting_pattern,!0),this._match_pattern=this._input.get_regexp(C._match_pattern,!0),this._until_pattern=this._input.get_regexp(C._until_pattern),this._until_after=C._until_after)}B.prototype.read=function(){var y=this._input.read(this._starting_pattern);return(!this._starting_pattern||y)&&(y+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),y},B.prototype.read_match=function(){return this._input.match(this._match_pattern)},B.prototype.until_after=function(y){var C=this._create();return C._until_after=!0,C._until_pattern=this._input.get_regexp(y),C._update(),C},B.prototype.until=function(y){var C=this._create();return C._until_after=!1,C._until_pattern=this._input.get_regexp(y),C._update(),C},B.prototype.starting_with=function(y){var C=this._create();return C._starting_pattern=this._input.get_regexp(y,!0),C._update(),C},B.prototype.matching=function(y){var C=this._create();return C._match_pattern=this._input.get_regexp(y,!0),C._update(),C},B.prototype._create=function(){return new B(this._input,this)},B.prototype._update=function(){},U.exports.Pattern=B},function(U){function B(y,C){y=typeof y=="string"?y:y.source,C=typeof C=="string"?C:C.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+C,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+C,"g")}B.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var C={};this.__directive_pattern.lastIndex=0;for(var T=this.__directive_pattern.exec(y);T;)C[T[1]]=T[2],T=this.__directive_pattern.exec(y);return C},B.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},U.exports.Directives=B},function(U,B,y){var C=y(12).Pattern,T={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function ee(G,W){C.call(this,G,W),this.__template_pattern=null,this._disabled=Object.assign({},T),this._excluded=Object.assign({},T),W&&(this.__template_pattern=this._input.get_regexp(W.__template_pattern),this._excluded=Object.assign(this._excluded,W._excluded),this._disabled=Object.assign(this._disabled,W._disabled));var k=new C(G);this.__patterns={handlebars_comment:k.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:k.starting_with(/{{{/).until_after(/}}}/),handlebars:k.starting_with(/{{/).until_after(/}}/),php:k.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:k.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:k.starting_with(/{%/).until_after(/%}/),django_value:k.starting_with(/{{/).until_after(/}}/),django_comment:k.starting_with(/{#/).until_after(/#}/),smarty:k.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:k.starting_with(/{\*/).until_after(/\*}/),smarty_literal:k.starting_with(/{literal}/).until_after(/{\/literal}/)}}ee.prototype=new C,ee.prototype._create=function(){return new ee(this._input,this)},ee.prototype._update=function(){this.__set_templated_pattern()},ee.prototype.disable=function(G){var W=this._create();return W._disabled[G]=!0,W._update(),W},ee.prototype.read_options=function(G){var W=this._create();for(var k in T)W._disabled[k]=G.templating.indexOf(k)===-1;return W._update(),W},ee.prototype.exclude=function(G){var W=this._create();return W._excluded[G]=!0,W._update(),W},ee.prototype.read=function(){var G="";this._match_pattern?G=this._input.read(this._starting_pattern):G=this._input.read(this._starting_pattern,this.__template_pattern);for(var W=this._read_template();W;)this._match_pattern?W+=this._input.read(this._match_pattern):W+=this._input.readUntil(this.__template_pattern),G+=W,W=this._read_template();return this._until_after&&(G+=this._input.readUntilAfter(this._until_pattern)),G},ee.prototype.__set_templated_pattern=function(){var G=[];this._disabled.php||G.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||G.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||G.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||G.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(G.push(this.__patterns.django._starting_pattern.source),G.push(this.__patterns.django_value._starting_pattern.source),G.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||G.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&G.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+G.join("|")+")")},ee.prototype._read_template=function(){var G="",W=this._input.peek();if(W==="<"){var k=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&k==="?"&&(G=G||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&k==="%"&&(G=G||this.__patterns.erb.read())}else W==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(G=G||this.__patterns.handlebars_comment.read(),G=G||this.__patterns.handlebars_unescaped.read(),G=G||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(G=G||this.__patterns.django_value.read()),this._excluded.django||(G=G||this.__patterns.django_comment.read(),G=G||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(G=G||this.__patterns.smarty_comment.read(),G=G||this.__patterns.smarty_literal.read(),G=G||this.__patterns.smarty.read()));return G},U.exports.TemplatablePattern=ee},,,,function(U,B,y){var C=y(19).Beautifier,T=y(20).Options;function ee(G,W,k,K){var re=new C(G,W,k,K);return re.beautify()}U.exports=ee,U.exports.defaultOptions=function(){return new T}},function(U,B,y){var C=y(20).Options,T=y(2).Output,ee=y(21).Tokenizer,G=y(21).TOKEN,W=/\r\n|[\r\n]/,k=/\r\n|[\r\n]/g,K=function(q,L){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=q.max_preserve_newlines,this.preserve_newlines=q.preserve_newlines,this._output=new T(q,L)};K.prototype.current_line_has_match=function(q){return this._output.current_line.has_match(q)},K.prototype.set_space_before_token=function(q,L){this._output.space_before_token=q,this._output.non_breaking_space=L},K.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},K.prototype.add_raw_token=function(q){this._output.add_raw_token(q)},K.prototype.print_preserved_newlines=function(q){var L=0;q.type!==G.TEXT&&q.previous.type!==G.TEXT&&(L=q.newlines?1:0),this.preserve_newlines&&(L=q.newlines<this.max_preserve_newlines+1?q.newlines:this.max_preserve_newlines+1);for(var j=0;j<L;j++)this.print_newline(j>0);return L!==0},K.prototype.traverse_whitespace=function(q){return q.whitespace_before||q.newlines?(this.print_preserved_newlines(q)||(this._output.space_before_token=!0),!0):!1},K.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},K.prototype.print_newline=function(q){this._output.add_new_line(q)},K.prototype.print_token=function(q){q.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(q.text))},K.prototype.indent=function(){this.indent_level++},K.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},K.prototype.get_full_indent=function(q){return q=this.indent_level+(q||0),q<1?"":this._output.get_indent_string(q)};var re=function(q){for(var L=null,j=q.next;j.type!==G.EOF&&q.closed!==j;){if(j.type===G.ATTRIBUTE&&j.text==="type"){j.next&&j.next.type===G.EQUALS&&j.next.next&&j.next.next.type===G.VALUE&&(L=j.next.next.text);break}j=j.next}return L},me=function(q,L){var j=null,X=null;return L.closed?(q==="script"?j="text/javascript":q==="style"&&(j="text/css"),j=re(L)||j,j.search("text/css")>-1?X="css":j.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?X="javascript":j.search(/(text|application|dojo)\/(x-)?(html)/)>-1?X="html":j.search(/test\/null/)>-1&&(X="null"),X):null};function Ce(q,L){return L.indexOf(q)!==-1}function Ie(q,L,j){this.parent=q||null,this.tag=L?L.tag_name:"",this.indent_level=j||0,this.parser_token=L||null}function le(q){this._printer=q,this._current_frame=null}le.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},le.prototype.record_tag=function(q){var L=new Ie(this._current_frame,q,this._printer.indent_level);this._current_frame=L},le.prototype._try_pop_frame=function(q){var L=null;return q&&(L=q.parser_token,this._printer.indent_level=q.indent_level,this._current_frame=q.parent),L},le.prototype._get_frame=function(q,L){for(var j=this._current_frame;j&&q.indexOf(j.tag)===-1;){if(L&&L.indexOf(j.tag)!==-1){j=null;break}j=j.parent}return j},le.prototype.try_pop=function(q,L){var j=this._get_frame([q],L);return this._try_pop_frame(j)},le.prototype.indent_to_tag=function(q){var L=this._get_frame(q);L&&(this._printer.indent_level=L.indent_level)};function xe(q,L,j,X){this._source_text=q||"",L=L||{},this._js_beautify=j,this._css_beautify=X,this._tag_stack=null;var ue=new C(L,"html");this._options=ue,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"}xe.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var q=this._source_text,L=this._options.eol;this._options.eol==="auto"&&(L=`
`,q&&W.test(q)&&(L=q.match(W)[0])),q=q.replace(k,`
`);var j=q.match(/^[\t ]*/)[0],X={text:"",type:""},ue=new Ke(this._options),ae=new K(this._options,j),w=new ee(q,this._options).tokenize();this._tag_stack=new le(ae);for(var b=null,$=w.next();$.type!==G.EOF;)$.type===G.TAG_OPEN||$.type===G.COMMENT?(b=this._handle_tag_open(ae,$,ue,X,w),ue=b):$.type===G.ATTRIBUTE||$.type===G.EQUALS||$.type===G.VALUE||$.type===G.TEXT&&!ue.tag_complete?b=this._handle_inside_tag(ae,$,ue,X):$.type===G.TAG_CLOSE?b=this._handle_tag_close(ae,$,ue):$.type===G.TEXT?b=this._handle_text(ae,$,ue):$.type===G.CONTROL_FLOW_OPEN?b=this._handle_control_flow_open(ae,$):$.type===G.CONTROL_FLOW_CLOSE?b=this._handle_control_flow_close(ae,$):ae.add_raw_token($),X=b,$=w.next();var fe=ae._output.get_code(L);return fe},xe.prototype._handle_control_flow_open=function(q,L){var j={text:L.text,type:L.type};return q.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),L.newlines?q.print_preserved_newlines(L):q.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),q.print_token(L),q.indent(),j},xe.prototype._handle_control_flow_close=function(q,L){var j={text:L.text,type:L.type};return q.deindent(),L.newlines?q.print_preserved_newlines(L):q.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),q.print_token(L),j},xe.prototype._handle_tag_close=function(q,L,j){var X={text:L.text,type:L.type};return q.alignment_size=0,j.tag_complete=!0,q.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),j.is_unformatted?q.add_raw_token(L):(j.tag_start_char==="<"&&(q.set_space_before_token(L.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&j.has_wrapped_attrs&&q.print_newline(!1)),q.print_token(L)),j.indent_content&&!(j.is_unformatted||j.is_content_unformatted)&&(q.indent(),j.indent_content=!1),!j.is_inline_element&&!(j.is_unformatted||j.is_content_unformatted)&&q.set_wrap_point(),X},xe.prototype._handle_inside_tag=function(q,L,j,X){var ue=j.has_wrapped_attrs,ae={text:L.text,type:L.type};return q.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),j.is_unformatted?q.add_raw_token(L):j.tag_start_char==="{"&&L.type===G.TEXT?q.print_preserved_newlines(L)?(L.newlines=0,q.add_raw_token(L)):q.print_token(L):(L.type===G.ATTRIBUTE?q.set_space_before_token(!0):(L.type===G.EQUALS||L.type===G.VALUE&&L.previous.type===G.EQUALS)&&q.set_space_before_token(!1),L.type===G.ATTRIBUTE&&j.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(q.traverse_whitespace(L),ue=ue||L.newlines!==0),this._is_wrap_attributes_force&&j.attr_count>=this._options.wrap_attributes_min_attrs&&(X.type!==G.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(q.print_newline(!1),ue=!0)),q.print_token(L),ue=ue||q.previous_token_wrapped(),j.has_wrapped_attrs=ue),ae},xe.prototype._handle_text=function(q,L,j){var X={text:L.text,type:"TK_CONTENT"};return j.custom_beautifier_name?this._print_custom_beatifier_text(q,L,j):j.is_unformatted||j.is_content_unformatted?q.add_raw_token(L):(q.traverse_whitespace(L),q.print_token(L)),X},xe.prototype._print_custom_beatifier_text=function(q,L,j){var X=this;if(L.text!==""){var ue=L.text,ae,w=1,b="",$="";j.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?ae=this._js_beautify:j.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?ae=this._css_beautify:j.custom_beautifier_name==="html"&&(ae=function(Vt,Qt){var bt=new xe(Vt,Qt,X._js_beautify,X._css_beautify);return bt.beautify()}),this._options.indent_scripts==="keep"?w=0:this._options.indent_scripts==="separate"&&(w=-q.indent_level);var fe=q.get_full_indent(w);if(ue=ue.replace(/\n[ \t]*$/,""),j.custom_beautifier_name!=="html"&&ue[0]==="<"&&ue.match(/^(<!--|<!\[CDATA\[)/)){var $e=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(ue);if(!$e){q.add_raw_token(L);return}b=fe+$e[1]+`
`,ue=$e[4],$e[5]&&($=fe+$e[5]),ue=ue.replace(/\n[ \t]*$/,""),($e[2]||$e[3].indexOf(`
`)!==-1)&&($e=$e[3].match(/[ \t]+$/),$e&&(L.whitespace_before=$e[0]))}if(ue)if(ae){var lt=function(){this.eol=`
`};lt.prototype=this._options.raw_options;var Rt=new lt;ue=ae(fe+ue,Rt)}else{var Ct=L.whitespace_before;Ct&&(ue=ue.replace(new RegExp(`
(`+Ct+")?","g"),`
`)),ue=fe+ue.replace(/\n/g,`
`+fe)}b&&(ue?ue=b+ue+`
`+$:ue=b+$),q.print_newline(!1),ue&&(L.text=ue,L.whitespace_before="",L.newlines=0,q.add_raw_token(L),q.print_newline(!0))}},xe.prototype._handle_tag_open=function(q,L,j,X,ue){var ae=this._get_tag_open_token(L);if((j.is_unformatted||j.is_content_unformatted)&&!j.is_empty_element&&L.type===G.TAG_OPEN&&!ae.is_start_tag?(q.add_raw_token(L),ae.start_tag_token=this._tag_stack.try_pop(ae.tag_name)):(q.traverse_whitespace(L),this._set_tag_position(q,L,ae,j,X),ae.is_inline_element||q.set_wrap_point(),q.print_token(L)),ae.is_start_tag&&this._is_wrap_attributes_force){var w=0,b;do b=ue.peek(w),b.type===G.ATTRIBUTE&&(ae.attr_count+=1),w+=1;while(b.type!==G.EOF&&b.type!==G.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(ae.alignment_size=L.text.length+1),!ae.tag_complete&&!ae.is_unformatted&&(q.alignment_size=ae.alignment_size),ae};var Ke=function(q,L,j){if(this.parent=L||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 X;this.tag_start_char=j.text[0],this.text=j.text,this.tag_start_char==="<"?(X=j.text.match(/^<([^\s>]*)/),this.tag_check=X?X[1]:""):(X=j.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=X?X[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===G.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 ue=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(ue=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!q.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(ue)))}};xe.prototype._get_tag_open_token=function(q){var L=new Ke(this._options,this._tag_stack.get_parser_token(),q);return L.alignment_size=this._options.wrap_attributes_indent_size,L.is_end_tag=L.is_end_tag||Ce(L.tag_check,this._options.void_elements),L.is_empty_element=L.tag_complete||L.is_start_tag&&L.is_end_tag,L.is_unformatted=!L.tag_complete&&Ce(L.tag_check,this._options.unformatted),L.is_content_unformatted=!L.is_empty_element&&Ce(L.tag_check,this._options.content_unformatted),L.is_inline_element=Ce(L.tag_name,this._options.inline)||this._options.inline_custom_elements&&L.tag_name.includes("-")||L.tag_start_char==="{",L},xe.prototype._set_tag_position=function(q,L,j,X,ue){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||q.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=me(j.tag_check,L)))),Ce(j.tag_check,this._options.extra_liners)&&(q.print_newline(!1),q._output.just_added_blankline()||q.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 ae=q.current_line_has_match(/{{#if/);ae||q.print_newline(!1)}j.tag_name==="!--"&&ue.type===G.TAG_CLOSE&&X.is_end_tag&&j.text.indexOf(`
`)===-1||(j.is_inline_element||j.is_unformatted||q.print_newline(!1),this._calcluate_parent_multiline(q,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&&!(X.is_inline_element||X.is_unformatted)&&!(ue.type===G.TAG_CLOSE&&j.start_tag_token===X)&&ue.type!=="TK_CONTENT",(j.is_content_unformatted||j.is_unformatted)&&(w=!1),w&&q.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)&&(ue.type!=="TK_CONTENT"||j.is_content_unformatted)&&q.print_newline(!1),this._calcluate_parent_multiline(q,j)},xe.prototype._calcluate_parent_multiline=function(q,L){L.parent&&q._output.just_added_newline()&&!((L.is_inline_element||L.is_unformatted)&&L.parent.is_inline_element)&&(L.parent.multiline_content=!0)};var ge=["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"],Ze=["a","audio","del","ins","map","noscript","video"];xe.prototype._do_optional_end_element=function(q){var L=null;if(!(q.is_empty_element||!q.is_start_tag||!q.parent)){if(q.tag_name==="body")L=L||this._tag_stack.try_pop("head");else if(q.tag_name==="li")L=L||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(q.tag_name==="dd"||q.tag_name==="dt")L=L||this._tag_stack.try_pop("dt",["dl"]),L=L||this._tag_stack.try_pop("dd",["dl"]);else if(q.parent.tag_name==="p"&&ge.indexOf(q.tag_name)!==-1){var j=q.parent.parent;(!j||Ze.indexOf(j.tag_name)===-1)&&(L=L||this._tag_stack.try_pop("p"))}else q.tag_name==="rp"||q.tag_name==="rt"?(L=L||this._tag_stack.try_pop("rt",["ruby","rtc"]),L=L||this._tag_stack.try_pop("rp",["ruby","rtc"])):q.tag_name==="optgroup"?L=L||this._tag_stack.try_pop("optgroup",["select"]):q.tag_name==="option"?L=L||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):q.tag_name==="colgroup"?L=L||this._tag_stack.try_pop("caption",["table"]):q.tag_name==="thead"?(L=L||this._tag_stack.try_pop("caption",["table"]),L=L||this._tag_stack.try_pop("colgroup",["table"])):q.tag_name==="tbody"||q.tag_name==="tfoot"?(L=L||this._tag_stack.try_pop("caption",["table"]),L=L||this._tag_stack.try_pop("colgroup",["table"]),L=L||this._tag_stack.try_pop("thead",["table"]),L=L||this._tag_stack.try_pop("tbody",["table"])):q.tag_name==="tr"?(L=L||this._tag_stack.try_pop("caption",["table"]),L=L||this._tag_stack.try_pop("colgroup",["table"]),L=L||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(q.tag_name==="th"||q.tag_name==="td")&&(L=L||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),L=L||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return q.parent=this._tag_stack.get_parser_token(),L}},U.exports.Beautifier=xe},function(U,B,y){var C=y(6).Options;function T(ee){C.call(this,ee,"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"])}T.prototype=new C,U.exports.Options=T},function(U,B,y){var C=y(9).Tokenizer,T=y(9).TOKEN,ee=y(13).Directives,G=y(14).TemplatablePattern,W=y(12).Pattern,k={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:T.START,RAW:T.RAW,EOF:T.EOF},K=new ee(/<\!--/,/-->/),re=function(me,Ce){C.call(this,me,Ce),this._current_tag_name="";var Ie=new G(this._input).read_options(this._options),le=new W(this._input);if(this.__patterns={word:Ie.until(/[\n\r\t <]/),word_control_flow_close_excluded:Ie.until(/[\n\r\t <}]/),single_quote:Ie.until_after(/'/),double_quote:Ie.until_after(/"/),attribute:Ie.until(/[\n\r\t =>]|\/>/),element_name:Ie.until(/[\n\r\t >\/]/),angular_control_flow_start:le.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:le.starting_with(/{{!--/).until_after(/--}}/),handlebars:le.starting_with(/{{/).until_after(/}}/),handlebars_open:le.until(/[\n\r\t }]/),handlebars_raw_close:le.until(/}}/),comment:le.starting_with(/<!--/).until_after(/-->/),cdata:le.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:le.starting_with(/<!\[/).until_after(/]>/),processing:le.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 xe=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=le.matching(xe).until_after(xe)}};re.prototype=new C,re.prototype._is_comment=function(me){return!1},re.prototype._is_opening=function(me){return me.type===k.TAG_OPEN||me.type===k.CONTROL_FLOW_OPEN},re.prototype._is_closing=function(me,Ce){return me.type===k.TAG_CLOSE&&Ce&&((me.text===">"||me.text==="/>")&&Ce.text[0]==="<"||me.text==="}}"&&Ce.text[0]==="{"&&Ce.text[1]==="{")||me.type===k.CONTROL_FLOW_CLOSE&&me.text==="}"&&Ce.text.endsWith("{")},re.prototype._reset=function(){this._current_tag_name=""},re.prototype._get_next_token=function(me,Ce){var Ie=null;this._readWhitespace();var le=this._input.peek();return le===null?this._create_token(k.EOF,""):(Ie=Ie||this._read_open_handlebars(le,Ce),Ie=Ie||this._read_attribute(le,me,Ce),Ie=Ie||this._read_close(le,Ce),Ie=Ie||this._read_script_and_style(le,me),Ie=Ie||this._read_control_flows(le,Ce),Ie=Ie||this._read_raw_content(le,me,Ce),Ie=Ie||this._read_content_word(le,Ce),Ie=Ie||this._read_comment_or_cdata(le),Ie=Ie||this._read_processing(le),Ie=Ie||this._read_open(le,Ce),Ie=Ie||this._create_token(k.UNKNOWN,this._input.next()),Ie)},re.prototype._read_comment_or_cdata=function(me){var Ce=null,Ie=null,le=null;if(me==="<"){var xe=this._input.peek(1);xe==="!"&&(Ie=this.__patterns.comment.read(),Ie?(le=K.get_directives(Ie),le&&le.ignore==="start"&&(Ie+=K.readIgnored(this._input))):Ie=this.__patterns.cdata.read()),Ie&&(Ce=this._create_token(k.COMMENT,Ie),Ce.directives=le)}return Ce},re.prototype._read_processing=function(me){var Ce=null,Ie=null,le=null;if(me==="<"){var xe=this._input.peek(1);(xe==="!"||xe==="?")&&(Ie=this.__patterns.conditional_comment.read(),Ie=Ie||this.__patterns.processing.read()),Ie&&(Ce=this._create_token(k.COMMENT,Ie),Ce.directives=le)}return Ce},re.prototype._read_open=function(me,Ce){var Ie=null,le=null;return(!Ce||Ce.type===k.CONTROL_FLOW_OPEN)&&me==="<"&&(Ie=this._input.next(),this._input.peek()==="/"&&(Ie+=this._input.next()),Ie+=this.__patterns.element_name.read(),le=this._create_token(k.TAG_OPEN,Ie)),le},re.prototype._read_open_handlebars=function(me,Ce){var Ie=null,le=null;return(!Ce||Ce.type===k.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&me==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(Ie=this.__patterns.handlebars_comment.read(),Ie=Ie||this.__patterns.handlebars.read(),le=this._create_token(k.COMMENT,Ie)):(Ie=this.__patterns.handlebars_open.read(),le=this._create_token(k.TAG_OPEN,Ie))),le},re.prototype._read_control_flows=function(me,Ce){var Ie="",le=null;if(!this._options.templating.includes("angular"))return le;if(me==="@"){if(Ie=this.__patterns.angular_control_flow_start.read(),Ie==="")return le;for(var xe=Ie.endsWith("(")?1:0,Ke=0;!(Ie.endsWith("{")&&xe===Ke);){var ge=this._input.next();if(ge===null)break;ge==="("?xe++:ge===")"&&Ke++,Ie+=ge}le=this._create_token(k.CONTROL_FLOW_OPEN,Ie)}else me==="}"&&Ce&&Ce.type===k.CONTROL_FLOW_OPEN&&(Ie=this._input.next(),le=this._create_token(k.CONTROL_FLOW_CLOSE,Ie));return le},re.prototype._read_close=function(me,Ce){var Ie=null,le=null;return Ce&&Ce.type===k.TAG_OPEN&&(Ce.text[0]==="<"&&(me===">"||me==="/"&&this._input.peek(1)===">")?(Ie=this._input.next(),me==="/"&&(Ie+=this._input.next()),le=this._create_token(k.TAG_CLOSE,Ie)):Ce.text[0]==="{"&&me==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),le=this._create_token(k.TAG_CLOSE,"}}"))),le},re.prototype._read_attribute=function(me,Ce,Ie){var le=null,xe="";if(Ie&&Ie.text[0]==="<")if(me==="=")le=this._create_token(k.EQUALS,this._input.next());else if(me==='"'||me==="'"){var Ke=this._input.next();me==='"'?Ke+=this.__patterns.double_quote.read():Ke+=this.__patterns.single_quote.read(),le=this._create_token(k.VALUE,Ke)}else xe=this.__patterns.attribute.read(),xe&&(Ce.type===k.EQUALS?le=this._create_token(k.VALUE,xe):le=this._create_token(k.ATTRIBUTE,xe));return le},re.prototype._is_content_unformatted=function(me){return this._options.void_elements.indexOf(me)===-1&&(this._options.content_unformatted.indexOf(me)!==-1||this._options.unformatted.indexOf(me)!==-1)},re.prototype._read_raw_content=function(me,Ce,Ie){var le="";if(Ie&&Ie.text[0]==="{")le=this.__patterns.handlebars_raw_close.read();else if(Ce.type===k.TAG_CLOSE&&Ce.opened.text[0]==="<"&&Ce.text[0]!=="/"){var xe=Ce.opened.text.substr(1).toLowerCase();this._is_content_unformatted(xe)&&(le=this._input.readUntil(new RegExp("</"+xe+"[\\n\\r\\t ]*?>","ig")))}return le?this._create_token(k.TEXT,le):null},re.prototype._read_script_and_style=function(me,Ce){if(Ce.type===k.TAG_CLOSE&&Ce.opened.text[0]==="<"&&Ce.text[0]!=="/"){var Ie=Ce.opened.text.substr(1).toLowerCase();if(Ie==="script"||Ie==="style"){var le=this._read_comment_or_cdata(me);if(le)return le.type=k.TEXT,le;var xe=this._input.readUntil(new RegExp("</"+Ie+"[\\n\\r\\t ]*?>","ig"));if(xe)return this._create_token(k.TEXT,xe)}}return null},re.prototype._read_content_word=function(me,Ce){var Ie="";return this._options.unformatted_content_delimiter&&me===this._options.unformatted_content_delimiter[0]&&(Ie=this.__patterns.unformatted_content_delimiter.read()),Ie||(Ie=Ce&&Ce.type===k.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),Ie?this._create_token(k.TEXT,Ie):null},U.exports.Tokenizer=re,U.exports.TOKEN=k}],H={};function o(U){var B=H[U];if(B!==void 0)return B.exports;var y=H[U]={exports:{}};return ye[U](y,y.exports,o),y.exports}var ne=o(18);Ue=ne})();var ve=Ue;if(1)z=[Z,Z(58553),Z(87804)],we=function(ye){var H=Z(58553),o=Z(87804);return{html_beautify:function(ne,U){return ve(ne,U,H.js_beautify,o.css_beautify)}}}.apply(St,z),we!==void 0&&(Sr.exports=we);else var Y,_})()},58553:function(Sr,St){var Z,z;(function(){var we;(function(){"use strict";var ve=[function(H,o,ne){var U=ne(1).Beautifier,B=ne(5).Options;function y(C,T){var ee=new U(C,T);return ee.beautify()}H.exports=y,H.exports.defaultOptions=function(){return new B}},function(H,o,ne){var U=ne(2).Output,B=ne(3).Token,y=ne(4),C=ne(5).Options,T=ne(7).Tokenizer,ee=ne(7).line_starters,G=ne(7).positionable_operators,W=ne(7).TOKEN;function k(b,$){return $.indexOf(b)!==-1}function K(b){return b.replace(/^\s+/g,"")}function re(b){for(var $={},fe=0;fe<b.length;fe++)$[b[fe].replace(/-/g,"_")]=b[fe];return $}function me(b,$){return b&&b.type===W.RESERVED&&b.text===$}function Ce(b,$){return b&&b.type===W.RESERVED&&k(b.text,$)}var Ie=["case","return","do","if","throw","else","await","break","continue","async"],le=["before-newline","after-newline","preserve-newline"],xe=re(le),Ke=[xe.before_newline,xe.preserve_newline],ge={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function Ze(b,$){$.multiline_frame||$.mode===ge.ForInitializer||$.mode===ge.Conditional||b.remove_indent($.start_line_index)}function q(b){b=b.replace(y.allLineBreaks,`
`);for(var $=[],fe=b.indexOf(`
`);fe!==-1;)$.push(b.substring(0,fe)),b=b.substring(fe+1),fe=b.indexOf(`
`);return b.length&&$.push(b),$}function L(b){return b===ge.ArrayLiteral}function j(b){return k(b,[ge.Expression,ge.ForInitializer,ge.Conditional])}function X(b,$){for(var fe=0;fe<b.length;fe++){var $e=b[fe].trim();if($e.charAt(0)!==$)return!1}return!0}function ue(b,$){for(var fe=0,$e=b.length,lt;fe<$e;fe++)if(lt=b[fe],lt&&lt.indexOf($)!==0)return!1;return!0}function ae(b,$){$=$||{},this._source_text=b||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new C($)}ae.prototype.create_flags=function(b,$){var fe=0;b&&(fe=b.indentation_level,!this._output.just_added_newline()&&b.line_indent_level>fe&&(fe=b.line_indent_level));var $e={mode:$,parent:b,last_token:b?b.last_token:new B(W.START_BLOCK,""),last_word:b?b.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:fe,alignment:0,line_indent_level:b?b.line_indent_level:fe,start_line_index:this._output.get_line_number(),ternary_depth:0};return $e},ae.prototype._reset=function(b){var $=b.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new U(this._options,$),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(ge.BlockStatement);var fe=new T(b,this._options);return this._tokens=fe.tokenize(),b},ae.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b,$=this._reset(this._source_text),fe=this._options.eol;this._options.eol==="auto"&&(fe=`
`,$&&y.lineBreak.test($||"")&&(fe=$.match(y.lineBreak)[0]));for(var $e=this._tokens.next();$e;)this.handle_token($e),this._last_last_text=this._flags.last_token.text,this._flags.last_token=$e,$e=this._tokens.next();return b=this._output.get_code(fe),b},ae.prototype.handle_token=function(b,$){b.type===W.START_EXPR?this.handle_start_expr(b):b.type===W.END_EXPR?this.handle_end_expr(b):b.type===W.START_BLOCK?this.handle_start_block(b):b.type===W.END_BLOCK?this.handle_end_block(b):b.type===W.WORD?this.handle_word(b):b.type===W.RESERVED?this.handle_word(b):b.type===W.SEMICOLON?this.handle_semicolon(b):b.type===W.STRING?this.handle_string(b):b.type===W.EQUALS?this.handle_equals(b):b.type===W.OPERATOR?this.handle_operator(b):b.type===W.COMMA?this.handle_comma(b):b.type===W.BLOCK_COMMENT?this.handle_block_comment(b,$):b.type===W.COMMENT?this.handle_comment(b,$):b.type===W.DOT?this.handle_dot(b):b.type===W.EOF?this.handle_eof(b):b.type===W.UNKNOWN?this.handle_unknown(b,$):this.handle_unknown(b,$)},ae.prototype.handle_whitespace_and_comments=function(b,$){var fe=b.newlines,$e=this._options.keep_array_indentation&&L(this._flags.mode);if(b.comments_before)for(var lt=b.comments_before.next();lt;)this.handle_whitespace_and_comments(lt,$),this.handle_token(lt,$),lt=b.comments_before.next();if($e)for(var Rt=0;Rt<fe;Rt+=1)this.print_newline(Rt>0,$);else if(this._options.max_preserve_newlines&&fe>this._options.max_preserve_newlines&&(fe=this._options.max_preserve_newlines),this._options.preserve_newlines&&fe>1){this.print_newline(!1,$);for(var Ct=1;Ct<fe;Ct+=1)this.print_newline(!0,$)}};var w=["async","break","continue","return","throw","yield"];ae.prototype.allow_wrap_or_preserved_newline=function(b,$){if($=$===void 0?!1:$,!this._output.just_added_newline()){var fe=this._options.preserve_newlines&&b.newlines||$,$e=k(this._flags.last_token.text,G)||k(b.text,G);if($e){var lt=k(this._flags.last_token.text,G)&&k(this._options.operator_position,Ke)||k(b.text,G);fe=fe&&lt}if(fe)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(Ce(this._flags.last_token,w))return;this._output.set_wrap_point()}}},ae.prototype.print_newline=function(b,$){if(!$&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==W.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var fe=this._tokens.peek();this._flags.mode===ge.Statement&&!(this._flags.if_block&&me(fe,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(b)&&(this._flags.multiline_frame=!0)},ae.prototype.print_token_line_indentation=function(b){this._output.just_added_newline()&&(this._options.keep_array_indentation&&b.newlines&&(b.text==="["||L(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(b.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},ae.prototype.print_token=function(b){if(this._output.raw){this._output.add_raw_token(b);return}if(this._options.comma_first&&b.previous&&b.previous.type===W.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var $=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push($),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(b),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(b),this._output.non_breaking_space=!0,this._output.add_token(b.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},ae.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},ae.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))},ae.prototype.set_mode=function(b){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,b),this._flags=this.create_flags(this._previous_flags,b),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},ae.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===ge.Statement&&Ze(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},ae.prototype.start_of_object_property=function(){return this._flags.parent.mode===ge.ObjectLiteral&&this._flags.mode===ge.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||Ce(this._flags.last_token,["get","set"]))},ae.prototype.start_of_statement=function(b){var $=!1;return $=$||Ce(this._flags.last_token,["var","let","const"])&&b.type===W.WORD,$=$||me(this._flags.last_token,"do"),$=$||!(this._flags.parent.mode===ge.ObjectLiteral&&this._flags.mode===ge.Statement)&&Ce(this._flags.last_token,w)&&!b.newlines,$=$||me(this._flags.last_token,"else")&&!(me(b,"if")&&!b.comments_before),$=$||this._flags.last_token.type===W.END_EXPR&&(this._previous_flags.mode===ge.ForInitializer||this._previous_flags.mode===ge.Conditional),$=$||this._flags.last_token.type===W.WORD&&this._flags.mode===ge.BlockStatement&&!this._flags.in_case&&!(b.text==="--"||b.text==="++")&&this._last_last_text!=="function"&&b.type!==W.WORD&&b.type!==W.RESERVED,$=$||this._flags.mode===ge.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||Ce(this._flags.last_token,["get","set"])),$?(this.set_mode(ge.Statement),this.indent(),this.handle_whitespace_and_comments(b,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b,Ce(b,["do","for","if","while"])),!0):!1},ae.prototype.handle_start_expr=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b);var $=ge.Expression;if(b.text==="["){if(this._flags.last_token.type===W.WORD||this._flags.last_token.text===")"){Ce(this._flags.last_token,ee)&&(this._output.space_before_token=!0),this.print_token(b),this.set_mode($),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}$=ge.ArrayLiteral,L(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()),k(this._flags.last_token.type,[W.START_EXPR,W.END_EXPR,W.WORD,W.OPERATOR,W.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===W.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,$=ge.ForInitializer):k(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,$=ge.Conditional):k(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&b.whitespace_before===""?this._output.space_before_token=!1:(k(this._flags.last_token.text,ee)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===W.EQUALS||this._flags.last_token.type===W.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b);else if(this._flags.last_token.type===W.WORD){this._output.space_before_token=!1;var fe=this._tokens.peek(-3);if(this._options.space_after_named_function&&fe){var $e=this._tokens.peek(-4);Ce(fe,["async","function"])||fe.text==="*"&&Ce($e,["async","function"])?this._output.space_before_token=!0:this._flags.mode===ge.ObjectLiteral?(fe.text==="{"||fe.text===","||fe.text==="*"&&($e.text==="{"||$e.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(b);(this._flags.last_token.type===W.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(k(this._last_last_text,["function","yield"])||this._flags.mode===ge.ObjectLiteral&&k(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===W.START_BLOCK?this.print_newline():(this._flags.last_token.type===W.END_EXPR||this._flags.last_token.type===W.START_EXPR||this._flags.last_token.type===W.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===W.COMMA)&&this.allow_wrap_or_preserved_newline(b,b.newlines),this.print_token(b),this.set_mode($),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},ae.prototype.handle_end_expr=function(b){for(;this._flags.mode===ge.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(b,b.text==="]"&&L(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===W.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(b),this.restore_mode(),Ze(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===ge.Conditional&&(this._previous_flags.mode=ge.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},ae.prototype.handle_start_block=function(b){this.handle_whitespace_and_comments(b);var $=this._tokens.peek(),fe=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===W.END_EXPR?(this.set_mode(ge.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(ge.BlockStatement):fe&&(k(fe.text,[":",","])&&k($.type,[W.STRING,W.WORD,W.RESERVED])||k($.text,["get","set","..."])&&k(fe.type,[W.WORD,W.RESERVED]))?k(this._last_last_text,["class","interface"])&&!k(fe.text,[":",","])?this.set_mode(ge.BlockStatement):this.set_mode(ge.ObjectLiteral):this._flags.last_token.type===W.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(ge.BlockStatement):k(this._flags.last_token.type,[W.EQUALS,W.START_EXPR,W.COMMA,W.OPERATOR])||Ce(this._flags.last_token,["return","throw","import","default"])?this.set_mode(ge.ObjectLiteral):this.set_mode(ge.BlockStatement),this._flags.last_token&&Ce(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var $e=!$.comments_before&&$.text==="}",lt=$e&&this._flags.last_word==="function"&&this._flags.last_token.type===W.END_EXPR;if(this._options.brace_preserve_inline){var Rt=0,Ct=null;this._flags.inline_frame=!0;do if(Rt+=1,Ct=this._tokens.peek(Rt-1),Ct.newlines){this._flags.inline_frame=!1;break}while(Ct.type!==W.EOF&&!(Ct.type===W.END_BLOCK&&Ct.opened===b))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==W.OPERATOR&&(lt||this._flags.last_token.type===W.EQUALS||Ce(this._flags.last_token,Ie)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(L(this._previous_flags.mode)&&(this._flags.last_token.type===W.START_EXPR||this._flags.last_token.type===W.COMMA)&&((this._flags.last_token.type===W.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===W.COMMA||this._flags.last_token.type===W.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(b),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==W.OPERATOR&&this._flags.last_token.type!==W.START_EXPR&&(k(this._flags.last_token.type,[W.START_BLOCK,W.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(b),this.indent(),!$e&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},ae.prototype.handle_end_block=function(b){for(this.handle_whitespace_and_comments(b);this._flags.mode===ge.Statement;)this.restore_mode();var $=this._flags.last_token.type===W.START_BLOCK;this._flags.inline_frame&&!$?this._output.space_before_token=!0:this._options.brace_style==="expand"?$||this.print_newline():$||(L(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(b)},ae.prototype.handle_word=function(b){if(b.type===W.RESERVED){if(k(b.text,["set","get"])&&this._flags.mode!==ge.ObjectLiteral)b.type=W.WORD;else if(b.text==="import"&&k(this._tokens.peek().text,["(","."]))b.type=W.WORD;else if(k(b.text,["as","from"])&&!this._flags.import_block)b.type=W.WORD;else if(this._flags.mode===ge.ObjectLiteral){var $=this._tokens.peek();$.text===":"&&(b.type=W.WORD)}}if(this.start_of_statement(b)?Ce(this._flags.last_token,["var","let","const"])&&b.type===W.WORD&&(this._flags.declaration_statement=!0):b.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==W.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==W.EQUALS&&(this._options.preserve_newlines||!Ce(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(b),this.print_newline()):this.handle_whitespace_and_comments(b),this._flags.do_block&&!this._flags.do_while)if(me(b,"while")){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&me(b,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===ge.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&Ce(b,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(b),this._flags.in_case=!0;return}if((this._flags.last_token.type===W.COMMA||this._flags.last_token.type===W.START_EXPR||this._flags.last_token.type===W.EQUALS||this._flags.last_token.type===W.OPERATOR)&&!this.start_of_object_property()&&!(k(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===ge.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(b),me(b,"function")){(k(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(k(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===W.OPERATOR))&&!this._output.just_added_blankline()&&!b.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===W.RESERVED||this._flags.last_token.type===W.WORD?Ce(this._flags.last_token,["get","set","new","export"])||Ce(this._flags.last_token,w)?this._output.space_before_token=!0:me(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===W.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||L(this._flags.mode))||this.print_newline(),this.print_token(b),this._flags.last_word=b.text;return}var fe="NONE";if(this._flags.last_token.type===W.END_BLOCK?this._previous_flags.inline_frame?fe="SPACE":Ce(b,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines?fe="NEWLINE":(fe="SPACE",this._output.space_before_token=!0):fe="NEWLINE":this._flags.last_token.type===W.SEMICOLON&&this._flags.mode===ge.BlockStatement?fe="NEWLINE":this._flags.last_token.type===W.SEMICOLON&&j(this._flags.mode)?fe="SPACE":this._flags.last_token.type===W.STRING?fe="NEWLINE":this._flags.last_token.type===W.RESERVED||this._flags.last_token.type===W.WORD||this._flags.last_token.text==="*"&&(k(this._last_last_text,["function","yield"])||this._flags.mode===ge.ObjectLiteral&&k(this._last_last_text,["{",","]))?fe="SPACE":this._flags.last_token.type===W.START_BLOCK?this._flags.inline_frame?fe="SPACE":fe="NEWLINE":this._flags.last_token.type===W.END_EXPR&&(this._output.space_before_token=!0,fe="NEWLINE"),Ce(b,ee)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?fe="SPACE":fe="NEWLINE"),Ce(b,["else","catch","finally"]))if((!(this._flags.last_token.type===W.END_BLOCK&&this._previous_flags.mode===ge.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var $e=this._output.current_line;$e.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else fe==="NEWLINE"?Ce(this._flags.last_token,Ie)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&Ce(b,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==W.END_EXPR?(this._flags.last_token.type!==W.START_EXPR||!Ce(b,["var","let","const"]))&&this._flags.last_token.text!==":"&&(me(b,"if")&&me(b.previous,"else")?this._output.space_before_token=!0:this.print_newline()):Ce(b,ee)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&L(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():fe==="SPACE"&&(this._output.space_before_token=!0);b.previous&&(b.previous.type===W.WORD||b.previous.type===W.RESERVED)&&(this._output.space_before_token=!0),this.print_token(b),this._flags.last_word=b.text,b.type===W.RESERVED&&(b.text==="do"?this._flags.do_block=!0:b.text==="if"?this._flags.if_block=!0:b.text==="import"?this._flags.import_block=!0:this._flags.import_block&&me(b,"from")&&(this._flags.import_block=!1))},ae.prototype.handle_semicolon=function(b){this.start_of_statement(b)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(b);for(var $=this._tokens.peek();this._flags.mode===ge.Statement&&!(this._flags.if_block&&me($,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(b)},ae.prototype.handle_string=function(b){b.text.startsWith("`")&&b.newlines===0&&b.whitespace_before===""&&(b.previous.text===")"||this._flags.last_token.type===W.WORD)||(this.start_of_statement(b)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(b),this._flags.last_token.type===W.RESERVED||this._flags.last_token.type===W.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===W.COMMA||this._flags.last_token.type===W.START_EXPR||this._flags.last_token.type===W.EQUALS||this._flags.last_token.type===W.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b):b.text.startsWith("`")&&this._flags.last_token.type===W.END_EXPR&&(b.previous.text==="]"||b.previous.text===")")&&b.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(b)},ae.prototype.handle_equals=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0},ae.prototype.handle_comma=function(b){this.handle_whitespace_and_comments(b,!0),this.print_token(b),this._output.space_before_token=!0,this._flags.declaration_statement?(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(b)):this._flags.mode===ge.ObjectLiteral||this._flags.mode===ge.Statement&&this._flags.parent.mode===ge.ObjectLiteral?(this._flags.mode===ge.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)},ae.prototype.handle_operator=function(b){var $=b.text==="*"&&(Ce(this._flags.last_token,["function","yield"])||k(this._flags.last_token.type,[W.START_BLOCK,W.COMMA,W.END_BLOCK,W.SEMICOLON])),fe=k(b.text,["-","+"])&&(k(this._flags.last_token.type,[W.START_BLOCK,W.START_EXPR,W.EQUALS,W.OPERATOR])||k(this._flags.last_token.text,ee)||this._flags.last_token.text===",");if(!this.start_of_statement(b)){var $e=!$;this.handle_whitespace_and_comments(b,$e)}if(b.text==="*"&&this._flags.last_token.type===W.DOT){this.print_token(b);return}if(b.text==="::"){this.print_token(b);return}if(k(b.text,["-","+"])&&this.start_of_object_property()){this.print_token(b);return}if(this._flags.last_token.type===W.OPERATOR&&k(this._options.operator_position,Ke)&&this.allow_wrap_or_preserved_newline(b),b.text===":"&&this._flags.in_case){this.print_token(b),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==W.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 lt=!0,Rt=!0,Ct=!1;if(b.text===":"?this._flags.ternary_depth===0?lt=!1:(this._flags.ternary_depth-=1,Ct=!0):b.text==="?"&&(this._flags.ternary_depth+=1),!fe&&!$&&this._options.preserve_newlines&&k(b.text,G)){var Vt=b.text===":",Qt=Vt&&Ct,bt=Vt&&!Ct;switch(this._options.operator_position){case xe.before_newline:this._output.space_before_token=!bt,this.print_token(b),(!Vt||Qt)&&this.allow_wrap_or_preserved_newline(b),this._output.space_before_token=!0;return;case xe.after_newline:this._output.space_before_token=!0,!Vt||Qt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(b):this._output.space_before_token=!1,this.print_token(b),this._output.space_before_token=!0;return;case xe.preserve_newline:bt||this.allow_wrap_or_preserved_newline(b),lt=!(this._output.just_added_newline()||bt),this._output.space_before_token=lt,this.print_token(b),this._output.space_before_token=!0;return}}if($){this.allow_wrap_or_preserved_newline(b),lt=!1;var He=this._tokens.peek();Rt=He&&k(He.type,[W.WORD,W.RESERVED])}else if(b.text==="...")this.allow_wrap_or_preserved_newline(b),lt=this._flags.last_token.type===W.START_BLOCK,Rt=!1;else if(k(b.text,["--","++","!","~"])||fe){if((this._flags.last_token.type===W.COMMA||this._flags.last_token.type===W.START_EXPR)&&this.allow_wrap_or_preserved_newline(b),lt=!1,Rt=!1,b.newlines&&(b.text==="--"||b.text==="++"||b.text==="~")){var nt=Ce(this._flags.last_token,Ie)&&b.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)&&(lt=!0),this._flags.last_token.type===W.RESERVED?lt=!0:this._flags.last_token.type===W.END_EXPR?lt=!(this._flags.last_token.text==="]"&&(b.text==="--"||b.text==="++")):this._flags.last_token.type===W.OPERATOR&&(lt=k(b.text,["--","-","++","+"])&&k(this._flags.last_token.text,["--","-","++","+"]),k(b.text,["+","-"])&&k(this._flags.last_token.text,["--","++"])&&(Rt=!0)),(this._flags.mode===ge.BlockStatement&&!this._flags.inline_frame||this._flags.mode===ge.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||lt,this.print_token(b),this._output.space_before_token=Rt},ae.prototype.handle_block_comment=function(b,$){if(this._output.raw){this._output.add_raw_token(b),b.directives&&b.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(b.directives){this.print_newline(!1,$),this.print_token(b),b.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!y.newline.test(b.text)&&!b.newlines){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0;return}else this.print_block_commment(b,$)},ae.prototype.print_block_commment=function(b,$){var fe=q(b.text),$e,lt=!1,Rt=!1,Ct=b.whitespace_before,Vt=Ct.length;if(this.print_newline(!1,$),this.print_token_line_indentation(b),this._output.add_token(fe[0]),this.print_newline(!1,$),fe.length>1){for(fe=fe.slice(1),lt=X(fe,"*"),Rt=ue(fe,Ct),lt&&(this._flags.alignment=1),$e=0;$e<fe.length;$e++)lt?(this.print_token_line_indentation(b),this._output.add_token(K(fe[$e]))):Rt&&fe[$e]?(this.print_token_line_indentation(b),this._output.add_token(fe[$e].substring(Vt))):(this._output.current_line.set_indent(-1),this._output.add_token(fe[$e])),this.print_newline(!1,$);this._flags.alignment=0}},ae.prototype.handle_comment=function(b,$){b.newlines?this.print_newline(!1,$):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(b),this.print_newline(!1,$)},ae.prototype.handle_dot=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),Ce(this._flags.last_token,Ie)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(b,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(b)},ae.prototype.handle_unknown=function(b,$){this.print_token(b),b.text[b.text.length-1]===`
`&&this.print_newline(!1,$)},ae.prototype.handle_eof=function(b){for(;this._flags.mode===ge.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b)},H.exports.Beautifier=ae},function(H){function o(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=[]}o.prototype.clone_empty=function(){var B=new o(this.__parent);return B.set_indent(this.__indent_count,this.__alignment_count),B},o.prototype.item=function(B){return B<0?this.__items[this.__items.length+B]:this.__items[B]},o.prototype.has_match=function(B){for(var y=this.__items.length-1;y>=0;y--)if(this.__items[y].match(B))return!0;return!1},o.prototype.set_indent=function(B,y){this.is_empty()&&(this.__indent_count=B||0,this.__alignment_count=y||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.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)},o.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},o.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},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(B){this.__items.push(B);var y=B.lastIndexOf(`
`);y!==-1?this.__character_count=B.length-y:this.__character_count+=B.length},o.prototype.pop=function(){var B=null;return this.is_empty()||(B=this.__items.pop(),this.__character_count-=B.length),B},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.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 ne(B,y){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)),y=y||"",B.indent_level>0&&(y=new Array(B.indent_level+1).join(this.__indent_string)),this.__base_string=y,this.__base_string_length=y.length}ne.prototype.get_indent_size=function(B,y){var C=this.__base_string_length;return y=y||0,B<0&&(C=0),C+=B*this.__indent_size,C+=y,C},ne.prototype.get_indent_string=function(B,y){var C=this.__base_string;return y=y||0,B<0&&(B=0,C=""),y+=B*this.__indent_size,this.__ensure_cache(y),C+=this.__cache[y],C},ne.prototype.__ensure_cache=function(B){for(;B>=this.__cache.length;)this.__add_column()},ne.prototype.__add_column=function(){var B=this.__cache.length,y=0,C="";this.__indent_size&&B>=this.__indent_size&&(y=Math.floor(B/this.__indent_size),B-=y*this.__indent_size,C=new Array(y+1).join(this.__indent_string)),B&&(C+=new Array(B+1).join(" ")),this.__cache.push(C)};function U(B,y){this.__indent_cache=new ne(B,y),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 o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}U.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},U.prototype.get_line_number=function(){return this.__lines.length},U.prototype.get_indent_string=function(B,y){return this.__indent_cache.get_indent_string(B,y)},U.prototype.get_indent_size=function(B,y){return this.__indent_cache.get_indent_size(B,y)},U.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},U.prototype.add_new_line=function(B){return this.is_empty()||!B&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},U.prototype.get_code=function(B){this.trim(!0);var y=this.current_line.pop();y&&(y[y.length-1]===`
`&&(y=y.replace(/\n+$/g,"")),this.current_line.push(y)),this._end_with_newline&&this.__add_outputline();var C=this.__lines.join(`
`);return B!==`
`&&(C=C.replace(/[\n]/g,B)),C},U.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},U.prototype.set_indent=function(B,y){return B=B||0,y=y||0,this.next_line.set_indent(B,y),this.__lines.length>1?(this.current_line.set_indent(B,y),!0):(this.current_line.set_indent(),!1)},U.prototype.add_raw_token=function(B){for(var y=0;y<B.newlines;y++)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},U.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()},U.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(" "))},U.prototype.remove_indent=function(B){for(var y=this.__lines.length;B<y;)this.__lines[B]._remove_indent(),B++;this.current_line._remove_wrap_indent()},U.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},U.prototype.just_added_newline=function(){return this.current_line.is_empty()},U.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},U.prototype.ensure_empty_line_above=function(B,y){for(var C=this.__lines.length-2;C>=0;){var T=this.__lines[C];if(T.is_empty())break;if(T.item(0).indexOf(B)!==0&&T.item(-1)!==y){this.__lines.splice(C+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}C--}},H.exports.Output=U},function(H){function o(ne,U,B,y){this.type=ne,this.text=U,this.comments_before=null,this.newlines=B||0,this.whitespace_before=y||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}H.exports.Token=o},function(H,o){var ne="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",U="\\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",y="\\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",C="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",T="(?:"+C+"|["+ne+B+"])",ee="(?:"+C+"|["+U+B+y+"])*";o.identifier=new RegExp(T+ee,"g"),o.identifierStart=new RegExp(T),o.identifierMatch=new RegExp("(?:"+C+"|["+U+B+y+"])+");var G=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;o.newline=/[\n\r\u2028\u2029]/,o.lineBreak=new RegExp(`\r
|`+o.newline.source),o.allLineBreaks=new RegExp(o.lineBreak.source,"g")},function(H,o,ne){var U=ne(6).Options,B=["before-newline","after-newline","preserve-newline"];function y(C){U.call(this,C,"js");var T=this.raw_options.brace_style||null;T==="expand-strict"?this.raw_options.brace_style="expand":T==="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 ee=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var G=0;G<ee.length;G++)ee[G]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=ee[G];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)}y.prototype=new U,H.exports.Options=y},function(H){function o(B,y){this.raw_options=ne(B,y),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"])}o.prototype._get_array=function(B,y){var C=this.raw_options[B],T=y||[];return typeof C=="object"?C!==null&&typeof C.concat=="function"&&(T=C.concat()):typeof C=="string"&&(T=C.split(/[^a-zA-Z0-9_\/\-]+/)),T},o.prototype._get_boolean=function(B,y){var C=this.raw_options[B],T=C===void 0?!!y:!!C;return T},o.prototype._get_characters=function(B,y){var C=this.raw_options[B],T=y||"";return typeof C=="string"&&(T=C.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),T},o.prototype._get_number=function(B,y){var C=this.raw_options[B];y=parseInt(y,10),isNaN(y)&&(y=0);var T=parseInt(C,10);return isNaN(T)&&(T=y),T},o.prototype._get_selection=function(B,y,C){var T=this._get_selection_list(B,y,C);if(T.length!==1)throw new Error("Invalid Option Value: The option '"+B+`' can only be one of the following values:
`+y+`
You passed in: '`+this.raw_options[B]+"'");return T[0]},o.prototype._get_selection_list=function(B,y,C){if(!y||y.length===0)throw new Error("Selection list cannot be empty.");if(C=C||[y[0]],!this._is_valid_selection(C,y))throw new Error("Invalid Default Value!");var T=this._get_array(B,C);if(!this._is_valid_selection(T,y))throw new Error("Invalid Option Value: The option '"+B+`' can contain only the following values:
`+y+`
You passed in: '`+this.raw_options[B]+"'");return T},o.prototype._is_valid_selection=function(B,y){return B.length&&y.length&&!B.some(function(C){return y.indexOf(C)===-1})};function ne(B,y){var C={};B=U(B);var T;for(T in B)T!==y&&(C[T]=B[T]);if(y&&B[y])for(T in B[y])C[T]=B[y][T];return C}function U(B){var y={},C;for(C in B){var T=C.replace(/-/g,"_");y[T]=B[C]}return y}H.exports.Options=o,H.exports.normalizeOpts=U,H.exports.mergeOpts=ne},function(H,o,ne){var U=ne(8).InputScanner,B=ne(9).Tokenizer,y=ne(9).TOKEN,C=ne(13).Directives,T=ne(4),ee=ne(12).Pattern,G=ne(14).TemplatablePattern;function W(X,ue){return ue.indexOf(X)!==-1}var k={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:y.START,RAW:y.RAW,EOF:y.EOF},K=new C(/\/\*/,/\*\//),re=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,me=/[0-9]/,Ce=/[^\d\.]/,Ie=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),le=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";le=le.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),le="\\?\\.(?!\\d) "+le,le=le.replace(/ /g,"|");var xe=new RegExp(le),Ke="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),ge=Ke.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),Ze=new RegExp("^(?:"+ge.join("|")+")$"),q,L=function(X,ue){B.call(this,X,ue),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var ae=new ee(this._input),w=new G(this._input).read_options(this._options);this.__patterns={template:w,identifier:w.starting_with(T.identifier).matching(T.identifierMatch),number:ae.matching(re),punct:ae.matching(xe),comment:ae.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:ae.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:ae.matching(/<!--/),html_comment_end:ae.matching(/-->/),include:ae.starting_with(/#include/).until_after(T.lineBreak),shebang:ae.starting_with(/#!/).until_after(T.lineBreak),xml:ae.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(/[`}\\]/)}};L.prototype=new B,L.prototype._is_comment=function(X){return X.type===k.COMMENT||X.type===k.BLOCK_COMMENT||X.type===k.UNKNOWN},L.prototype._is_opening=function(X){return X.type===k.START_BLOCK||X.type===k.START_EXPR},L.prototype._is_closing=function(X,ue){return(X.type===k.END_BLOCK||X.type===k.END_EXPR)&&ue&&(X.text==="]"&&ue.text==="["||X.text===")"&&ue.text==="("||X.text==="}"&&ue.text==="{")},L.prototype._reset=function(){q=!1},L.prototype._get_next_token=function(X,ue){var ae=null;this._readWhitespace();var w=this._input.peek();return w===null?this._create_token(k.EOF,""):(ae=ae||this._read_non_javascript(w),ae=ae||this._read_string(w),ae=ae||this._read_pair(w,this._input.peek(1)),ae=ae||this._read_word(X),ae=ae||this._read_singles(w),ae=ae||this._read_comment(w),ae=ae||this._read_regexp(w,X),ae=ae||this._read_xml(w,X),ae=ae||this._read_punctuation(),ae=ae||this._create_token(k.UNKNOWN,this._input.next()),ae)},L.prototype._read_word=function(X){var ue;if(ue=this.__patterns.identifier.read(),ue!=="")return ue=ue.replace(T.allLineBreaks,`
`),!(X.type===k.DOT||X.type===k.RESERVED&&(X.text==="set"||X.text==="get"))&&Ze.test(ue)?(ue==="in"||ue==="of")&&(X.type===k.WORD||X.type===k.STRING)?this._create_token(k.OPERATOR,ue):this._create_token(k.RESERVED,ue):this._create_token(k.WORD,ue);if(ue=this.__patterns.number.read(),ue!=="")return this._create_token(k.WORD,ue)},L.prototype._read_singles=function(X){var ue=null;return X==="("||X==="["?ue=this._create_token(k.START_EXPR,X):X===")"||X==="]"?ue=this._create_token(k.END_EXPR,X):X==="{"?ue=this._create_token(k.START_BLOCK,X):X==="}"?ue=this._create_token(k.END_BLOCK,X):X===";"?ue=this._create_token(k.SEMICOLON,X):X==="."&&Ce.test(this._input.peek(1))?ue=this._create_token(k.DOT,X):X===","&&(ue=this._create_token(k.COMMA,X)),ue&&this._input.next(),ue},L.prototype._read_pair=function(X,ue){var ae=null;return X==="#"&&ue==="{"&&(ae=this._create_token(k.START_BLOCK,X+ue)),ae&&(this._input.next(),this._input.next()),ae},L.prototype._read_punctuation=function(){var X=this.__patterns.punct.read();if(X!=="")return X==="="?this._create_token(k.EQUALS,X):X==="?."?this._create_token(k.DOT,X):this._create_token(k.OPERATOR,X)},L.prototype._read_non_javascript=function(X){var ue="";if(X==="#"){if(this._is_first_token()&&(ue=this.__patterns.shebang.read(),ue))return this._create_token(k.UNKNOWN,ue.trim()+`
`);if(ue=this.__patterns.include.read(),ue)return this._create_token(k.UNKNOWN,ue.trim()+`
`);X=this._input.next();var ae="#";if(this._input.hasNext()&&this._input.testChar(me)){do X=this._input.next(),ae+=X;while(this._input.hasNext()&&X!=="#"&&X!=="=");return X==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(ae+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(ae+="{}",this._input.next(),this._input.next())),this._create_token(k.WORD,ae)}this._input.back()}else if(X==="<"&&this._is_first_token()){if(ue=this.__patterns.html_comment_start.read(),ue){for(;this._input.hasNext()&&!this._input.testChar(T.newline);)ue+=this._input.next();return q=!0,this._create_token(k.COMMENT,ue)}}else if(q&&X==="-"&&(ue=this.__patterns.html_comment_end.read(),ue))return q=!1,this._create_token(k.COMMENT,ue);return null},L.prototype._read_comment=function(X){var ue=null;if(X==="/"){var ae="";if(this._input.peek(1)==="*"){ae=this.__patterns.block_comment.read();var w=K.get_directives(ae);w&&w.ignore==="start"&&(ae+=K.readIgnored(this._input)),ae=ae.replace(T.allLineBreaks,`
`),ue=this._create_token(k.BLOCK_COMMENT,ae),ue.directives=w}else this._input.peek(1)==="/"&&(ae=this.__patterns.comment.read(),ue=this._create_token(k.COMMENT,ae))}return ue},L.prototype._read_string=function(X){if(X==="`"||X==="'"||X==='"'){var ue=this._input.next();return this.has_char_escapes=!1,X==="`"?ue+=this._read_string_recursive("`",!0,"${"):ue+=this._read_string_recursive(X),this.has_char_escapes&&this._options.unescape_strings&&(ue=j(ue)),this._input.peek()===X&&(ue+=this._input.next()),ue=ue.replace(T.allLineBreaks,`
`),this._create_token(k.STRING,ue)}return null},L.prototype._allow_regexp_or_xml=function(X){return X.type===k.RESERVED&&W(X.text,["return","case","throw","else","do","typeof","yield"])||X.type===k.END_EXPR&&X.text===")"&&X.opened.previous.type===k.RESERVED&&W(X.opened.previous.text,["if","while","for"])||W(X.type,[k.COMMENT,k.START_EXPR,k.START_BLOCK,k.START,k.END_BLOCK,k.OPERATOR,k.EQUALS,k.EOF,k.SEMICOLON,k.COMMA])},L.prototype._read_regexp=function(X,ue){if(X==="/"&&this._allow_regexp_or_xml(ue)){for(var ae=this._input.next(),w=!1,b=!1;this._input.hasNext()&&(w||b||this._input.peek()!==X)&&!this._input.testChar(T.newline);)ae+=this._input.peek(),w?w=!1:(w=this._input.peek()==="\\",this._input.peek()==="["?b=!0:this._input.peek()==="]"&&(b=!1)),this._input.next();return this._input.peek()===X&&(ae+=this._input.next(),ae+=this._input.read(T.identifier)),this._create_token(k.STRING,ae)}return null},L.prototype._read_xml=function(X,ue){if(this._options.e4x&&X==="<"&&this._allow_regexp_or_xml(ue)){var ae="",w=this.__patterns.xml.read_match();if(w){for(var b=w[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),$=b.indexOf("{")===0,fe=0;w;){var $e=!!w[1],lt=w[2],Rt=!!w[w.length-1]||lt.slice(0,8)==="![CDATA[";if(!Rt&&(lt===b||$&&lt.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&($e?--fe:++fe),ae+=w[0],fe<=0)break;w=this.__patterns.xml.read_match()}return w||(ae+=this._input.match(/[\s\S]*/g)[0]),ae=ae.replace(T.allLineBreaks,`
`),this._create_token(k.STRING,ae)}}return null};function j(X){for(var ue="",ae=0,w=new U(X),b=null;w.hasNext();)if(b=w.match(/([\s]|[^\\]|\\\\)+/g),b&&(ue+=b[0]),w.peek()==="\\"){if(w.next(),w.peek()==="x")b=w.match(/x([0-9A-Fa-f]{2})/g);else if(w.peek()==="u")b=w.match(/u([0-9A-Fa-f]{4})/g),b||(b=w.match(/u\{([0-9A-Fa-f]+)\}/g));else{ue+="\\",w.hasNext()&&(ue+=w.next());continue}if(!b||(ae=parseInt(b[1],16),ae>126&&ae<=255&&b[0].indexOf("x")===0))return X;ae>=0&&ae<32||ae>1114111?ue+="\\"+b[0]:ae===34||ae===39||ae===92?ue+="\\"+String.fromCharCode(ae):ue+=String.fromCharCode(ae)}return ue}L.prototype._read_string_recursive=function(X,ue,ae){var w,b;X==="'"?b=this.__patterns.single_quote:X==='"'?b=this.__patterns.double_quote:X==="`"?b=this.__patterns.template_text:X==="}"&&(b=this.__patterns.template_expression);for(var $=b.read(),fe="";this._input.hasNext();){if(fe=this._input.next(),fe===X||!ue&&T.newline.test(fe)){this._input.back();break}else fe==="\\"&&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(),fe+=this._input.next()):ae&&(ae==="${"&&fe==="$"&&this._input.peek()==="{"&&(fe+=this._input.next()),ae===fe&&(X==="`"?fe+=this._read_string_recursive("}",ue,"`"):fe+=this._read_string_recursive("`",ue,"${"),this._input.hasNext()&&(fe+=this._input.next())));fe+=b.read(),$+=fe}return $},H.exports.Tokenizer=L,H.exports.TOKEN=k,H.exports.positionable_operators=Ie.slice(),H.exports.line_starters=Ke.slice()},function(H){var o=RegExp.prototype.hasOwnProperty("sticky");function ne(U){this.__input=U||"",this.__input_length=this.__input.length,this.__position=0}ne.prototype.restart=function(){this.__position=0},ne.prototype.back=function(){this.__position>0&&(this.__position-=1)},ne.prototype.hasNext=function(){return this.__position<this.__input_length},ne.prototype.next=function(){var U=null;return this.hasNext()&&(U=this.__input.charAt(this.__position),this.__position+=1),U},ne.prototype.peek=function(U){var B=null;return U=U||0,U+=this.__position,U>=0&&U<this.__input_length&&(B=this.__input.charAt(U)),B},ne.prototype.__match=function(U,B){U.lastIndex=B;var y=U.exec(this.__input);return y&&!(o&&U.sticky)&&y.index!==B&&(y=null),y},ne.prototype.test=function(U,B){return B=B||0,B+=this.__position,B>=0&&B<this.__input_length?!!this.__match(U,B):!1},ne.prototype.testChar=function(U,B){var y=this.peek(B);return U.lastIndex=0,y!==null&&U.test(y)},ne.prototype.match=function(U){var B=this.__match(U,this.__position);return B?this.__position+=B[0].length:B=null,B},ne.prototype.read=function(U,B,y){var C="",T;return U&&(T=this.match(U),T&&(C+=T[0])),B&&(T||!U)&&(C+=this.readUntil(B,y)),C},ne.prototype.readUntil=function(U,B){var y="",C=this.__position;U.lastIndex=this.__position;var T=U.exec(this.__input);return T?(C=T.index,B&&(C+=T[0].length)):C=this.__input_length,y=this.__input.substring(this.__position,C),this.__position=C,y},ne.prototype.readUntilAfter=function(U){return this.readUntil(U,!0)},ne.prototype.get_regexp=function(U,B){var y=null,C="g";return B&&o&&(C="y"),typeof U=="string"&&U!==""?y=new RegExp(U,C):U&&(y=new RegExp(U.source,C)),y},ne.prototype.get_literal_regexp=function(U){return RegExp(U.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},ne.prototype.peekUntilAfter=function(U){var B=this.__position,y=this.readUntilAfter(U);return this.__position=B,y},ne.prototype.lookBack=function(U){var B=this.__position-1;return B>=U.length&&this.__input.substring(B-U.length,B).toLowerCase()===U},H.exports.InputScanner=ne},function(H,o,ne){var U=ne(8).InputScanner,B=ne(3).Token,y=ne(10).TokenStream,C=ne(11).WhitespacePattern,T={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},ee=function(G,W){this._input=new U(G),this._options=W||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new C(this._input)};ee.prototype.tokenize=function(){this._input.restart(),this.__tokens=new y,this._reset();for(var G,W=new B(T.START,""),k=null,K=[],re=new y;W.type!==T.EOF;){for(G=this._get_next_token(W,k);this._is_comment(G);)re.add(G),G=this._get_next_token(W,k);re.isEmpty()||(G.comments_before=re,re=new y),G.parent=k,this._is_opening(G)?(K.push(k),k=G):k&&this._is_closing(G,k)&&(G.opened=k,k.closed=G,k=K.pop(),G.parent=k),G.previous=W,W.next=G,this.__tokens.add(G),W=G}return this.__tokens},ee.prototype._is_first_token=function(){return this.__tokens.isEmpty()},ee.prototype._reset=function(){},ee.prototype._get_next_token=function(G,W){this._readWhitespace();var k=this._input.read(/.+/g);return k?this._create_token(T.RAW,k):this._create_token(T.EOF,"")},ee.prototype._is_comment=function(G){return!1},ee.prototype._is_opening=function(G){return!1},ee.prototype._is_closing=function(G,W){return!1},ee.prototype._create_token=function(G,W){var k=new B(G,W,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return k},ee.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},H.exports.Tokenizer=ee,H.exports.TOKEN=T},function(H){function o(ne){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=ne}o.prototype.restart=function(){this.__position=0},o.prototype.isEmpty=function(){return this.__tokens_length===0},o.prototype.hasNext=function(){return this.__position<this.__tokens_length},o.prototype.next=function(){var ne=null;return this.hasNext()&&(ne=this.__tokens[this.__position],this.__position+=1),ne},o.prototype.peek=function(ne){var U=null;return ne=ne||0,ne+=this.__position,ne>=0&&ne<this.__tokens_length&&(U=this.__tokens[ne]),U},o.prototype.add=function(ne){this.__parent_token&&(ne.parent=this.__parent_token),this.__tokens.push(ne),this.__tokens_length+=1},H.exports.TokenStream=o},function(H,o,ne){var U=ne(12).Pattern;function B(y,C){U.call(this,y,C),C?this._line_regexp=this._input.get_regexp(C._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}B.prototype=new U,B.prototype.__set_whitespace_patterns=function(y,C){y+="\\t ",C+="\\n\\r",this._match_pattern=this._input.get_regexp("["+y+C+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+C+"]")},B.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var y=this._input.read(this._match_pattern);if(y===" ")this.whitespace_before_token=" ";else if(y){var C=this.__split(this._newline_regexp,y);this.newline_count=C.length-1,this.whitespace_before_token=C[this.newline_count]}return y},B.prototype.matching=function(y,C){var T=this._create();return T.__set_whitespace_patterns(y,C),T._update(),T},B.prototype._create=function(){return new B(this._input,this)},B.prototype.__split=function(y,C){y.lastIndex=0;for(var T=0,ee=[],G=y.exec(C);G;)ee.push(C.substring(T,G.index)),T=G.index+G[0].length,G=y.exec(C);return T<C.length?ee.push(C.substring(T,C.length)):ee.push(""),ee},H.exports.WhitespacePattern=B},function(H){function o(ne,U){this._input=ne,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,U&&(this._starting_pattern=this._input.get_regexp(U._starting_pattern,!0),this._match_pattern=this._input.get_regexp(U._match_pattern,!0),this._until_pattern=this._input.get_regexp(U._until_pattern),this._until_after=U._until_after)}o.prototype.read=function(){var ne=this._input.read(this._starting_pattern);return(!this._starting_pattern||ne)&&(ne+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),ne},o.prototype.read_match=function(){return this._input.match(this._match_pattern)},o.prototype.until_after=function(ne){var U=this._create();return U._until_after=!0,U._until_pattern=this._input.get_regexp(ne),U._update(),U},o.prototype.until=function(ne){var U=this._create();return U._until_after=!1,U._until_pattern=this._input.get_regexp(ne),U._update(),U},o.prototype.starting_with=function(ne){var U=this._create();return U._starting_pattern=this._input.get_regexp(ne,!0),U._update(),U},o.prototype.matching=function(ne){var U=this._create();return U._match_pattern=this._input.get_regexp(ne,!0),U._update(),U},o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){},H.exports.Pattern=o},function(H){function o(ne,U){ne=typeof ne=="string"?ne:ne.source,U=typeof U=="string"?U:U.source,this.__directives_block_pattern=new RegExp(ne+/ beautify( \w+[:]\w+)+ /.source+U,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(ne+/\sbeautify\signore:end\s/.source+U,"g")}o.prototype.get_directives=function(ne){if(!ne.match(this.__directives_block_pattern))return null;var U={};this.__directive_pattern.lastIndex=0;for(var B=this.__directive_pattern.exec(ne);B;)U[B[1]]=B[2],B=this.__directive_pattern.exec(ne);return U},o.prototype.readIgnored=function(ne){return ne.readUntilAfter(this.__directives_end_ignore_pattern)},H.exports.Directives=o},function(H,o,ne){var U=ne(12).Pattern,B={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function y(C,T){U.call(this,C,T),this.__template_pattern=null,this._disabled=Object.assign({},B),this._excluded=Object.assign({},B),T&&(this.__template_pattern=this._input.get_regexp(T.__template_pattern),this._excluded=Object.assign(this._excluded,T._excluded),this._disabled=Object.assign(this._disabled,T._disabled));var ee=new U(C);this.__patterns={handlebars_comment:ee.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:ee.starting_with(/{{{/).until_after(/}}}/),handlebars:ee.starting_with(/{{/).until_after(/}}/),php:ee.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:ee.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:ee.starting_with(/{%/).until_after(/%}/),django_value:ee.starting_with(/{{/).until_after(/}}/),django_comment:ee.starting_with(/{#/).until_after(/#}/),smarty:ee.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:ee.starting_with(/{\*/).until_after(/\*}/),smarty_literal:ee.starting_with(/{literal}/).until_after(/{\/literal}/)}}y.prototype=new U,y.prototype._create=function(){return new y(this._input,this)},y.prototype._update=function(){this.__set_templated_pattern()},y.prototype.disable=function(C){var T=this._create();return T._disabled[C]=!0,T._update(),T},y.prototype.read_options=function(C){var T=this._create();for(var ee in B)T._disabled[ee]=C.templating.indexOf(ee)===-1;return T._update(),T},y.prototype.exclude=function(C){var T=this._create();return T._excluded[C]=!0,T._update(),T},y.prototype.read=function(){var C="";this._match_pattern?C=this._input.read(this._starting_pattern):C=this._input.read(this._starting_pattern,this.__template_pattern);for(var T=this._read_template();T;)this._match_pattern?T+=this._input.read(this._match_pattern):T+=this._input.readUntil(this.__template_pattern),C+=T,T=this._read_template();return this._until_after&&(C+=this._input.readUntilAfter(this._until_pattern)),C},y.prototype.__set_templated_pattern=function(){var C=[];this._disabled.php||C.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||C.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||C.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||C.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(C.push(this.__patterns.django._starting_pattern.source),C.push(this.__patterns.django_value._starting_pattern.source),C.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||C.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&C.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+C.join("|")+")")},y.prototype._read_template=function(){var C="",T=this._input.peek();if(T==="<"){var ee=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&ee==="?"&&(C=C||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&ee==="%"&&(C=C||this.__patterns.erb.read())}else T==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(C=C||this.__patterns.handlebars_comment.read(),C=C||this.__patterns.handlebars_unescaped.read(),C=C||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(C=C||this.__patterns.django_value.read()),this._excluded.django||(C=C||this.__patterns.django_comment.read(),C=C||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(C=C||this.__patterns.smarty_comment.read(),C=C||this.__patterns.smarty_literal.read(),C=C||this.__patterns.smarty.read()));return C},H.exports.TemplatablePattern=y}],Y={};function _(H){var o=Y[H];if(o!==void 0)return o.exports;var ne=Y[H]={exports:{}};return ve[H](ne,ne.exports,_),ne.exports}var ye=_(0);we=ye})();var Ue=we;Z=[],z=function(){return{js_beautify:Ue}}.apply(St,Z),z!==void 0&&(Sr.exports=z)})()},32834:function(Sr){(function(St,Z){Sr.exports=Z()})(this,function(){"use strict";function St(ke,De){for(var Se=0;Se<De.length;Se++){var te=De[Se];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(ke,te.key,te)}}function Z(ke,De,Se){return De&&St(ke.prototype,De),Se&&St(ke,Se),ke}function z(ke,De){if(ke){if(typeof ke=="string")return we(ke,De);var Se=Object.prototype.toString.call(ke).slice(8,-1);if(Se==="Object"&&ke.constructor&&(Se=ke.constructor.name),Se==="Map"||Se==="Set")return Array.from(ke);if(Se==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Se))return we(ke,De)}}function we(ke,De){(De==null||De>ke.length)&&(De=ke.length);for(var Se=0,te=new Array(De);Se<De;Se++)te[Se]=ke[Se];return te}function Ue(ke,De){var Se=typeof Symbol!="undefined"&&ke[Symbol.iterator]||ke["@@iterator"];if(Se)return(Se=Se.call(ke)).next.bind(Se);if(Array.isArray(ke)||(Se=z(ke))||De&&ke&&typeof ke.length=="number"){Se&&(ke=Se);var te=0;return function(){return te>=ke.length?{done:!0}:{done:!1,value:ke[te++]}}}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 ve={exports:{}};function Y(){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 _(ke){ve.exports.defaults=ke}ve.exports={defaults:Y(),getDefaults:Y,changeDefaults:_};var ye=/[&<>"']/,H=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,ne=/[<>"']|&(?!#?\w+;)/g,U={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},B=function(De){return U[De]};function y(ke,De){if(De){if(ye.test(ke))return ke.replace(H,B)}else if(o.test(ke))return ke.replace(ne,B);return ke}var C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function T(ke){return ke.replace(C,function(De,Se){return Se=Se.toLowerCase(),Se==="colon"?":":Se.charAt(0)==="#"?Se.charAt(1)==="x"?String.fromCharCode(parseInt(Se.substring(2),16)):String.fromCharCode(+Se.substring(1)):""})}var ee=/(^|[^\[])\^/g;function G(ke,De){ke=ke.source||ke,De=De||"";var Se={replace:function(se,ce){return ce=ce.source||ce,ce=ce.replace(ee,"$1"),ke=ke.replace(se,ce),Se},getRegex:function(){return new RegExp(ke,De)}};return Se}var W=/[^\w:]/g,k=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function K(ke,De,Se){if(ke){var te;try{te=decodeURIComponent(T(Se)).replace(W,"").toLowerCase()}catch(se){return null}if(te.indexOf("javascript:")===0||te.indexOf("vbscript:")===0||te.indexOf("data:")===0)return null}De&&!k.test(Se)&&(Se=le(De,Se));try{Se=encodeURI(Se).replace(/%25/g,"%")}catch(se){return null}return Se}var re={},me=/^[^:]+:\/*[^/]*$/,Ce=/^([^:]+:)[\s\S]*$/,Ie=/^([^:]+:\/*[^/]*)[\s\S]*$/;function le(ke,De){re[" "+ke]||(me.test(ke)?re[" "+ke]=ke+"/":re[" "+ke]=Ze(ke,"/",!0)),ke=re[" "+ke];var Se=ke.indexOf(":")===-1;return De.substring(0,2)==="//"?Se?De:ke.replace(Ce,"$1")+De:De.charAt(0)==="/"?Se?De:ke.replace(Ie,"$1")+De:ke+De}var xe={exec:function(){}};function Ke(ke){for(var De=1,Se,te;De<arguments.length;De++){Se=arguments[De];for(te in Se)Object.prototype.hasOwnProperty.call(Se,te)&&(ke[te]=Se[te])}return ke}function ge(ke,De){var Se=ke.replace(/\|/g,function(ce,Ee,Te){for(var Et=!1,Ut=Ee;--Ut>=0&&Te[Ut]==="\\";)Et=!Et;return Et?"|":" |"}),te=Se.split(/ \|/),se=0;if(te.length>De)te.splice(De);else for(;te.length<De;)te.push("");for(;se<te.length;se++)te[se]=te[se].trim().replace(/\\\|/g,"|");return te}function Ze(ke,De,Se){var te=ke.length;if(te===0)return"";for(var se=0;se<te;){var ce=ke.charAt(te-se-1);if(ce===De&&!Se)se++;else if(ce!==De&&Se)se++;else break}return ke.substr(0,te-se)}function q(ke,De){if(ke.indexOf(De[1])===-1)return-1;for(var Se=ke.length,te=0,se=0;se<Se;se++)if(ke[se]==="\\")se++;else if(ke[se]===De[0])te++;else if(ke[se]===De[1]&&(te--,te<0))return se;return-1}function L(ke){ke&&ke.sanitize&&!ke.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(ke,De){if(De<1)return"";for(var Se="";De>1;)De&1&&(Se+=ke),De>>=1,ke+=ke;return Se+ke}var X={escape:y,unescape:T,edit:G,cleanUrl:K,resolveUrl:le,noopTest:xe,merge:Ke,splitCells:ge,rtrim:Ze,findClosingBracket:q,checkSanitizeDeprecation:L,repeatString:j},ue=ve.exports.defaults,ae=X.rtrim,w=X.splitCells,b=X.escape,$=X.findClosingBracket;function fe(ke,De,Se){var te=De.href,se=De.title?b(De.title):null,ce=ke[1].replace(/\\([\[\]])/g,"$1");return ke[0].charAt(0)!=="!"?{type:"link",raw:Se,href:te,title:se,text:ce}:{type:"image",raw:Se,href:te,title:se,text:b(ce)}}function $e(ke,De){var Se=ke.match(/^(\s+)(?:```)/);if(Se===null)return De;var te=Se[1];return De.split(`
`).map(function(se){var ce=se.match(/^\s+/);if(ce===null)return se;var Ee=ce[0];return Ee.length>=te.length?se.slice(te.length):se}).join(`
`)}var lt=function(){function ke(Se){this.options=Se||ue}var De=ke.prototype;return De.space=function(te){var se=this.rules.block.newline.exec(te);if(se)return se[0].length>1?{type:"space",raw:se[0]}:{raw:`
`}},De.code=function(te){var se=this.rules.block.code.exec(te);if(se){var ce=se[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:se[0],codeBlockStyle:"indented",text:this.options.pedantic?ce:ae(ce,`
`)}}},De.fences=function(te){var se=this.rules.block.fences.exec(te);if(se){var ce=se[0],Ee=$e(ce,se[3]||"");return{type:"code",raw:ce,lang:se[2]?se[2].trim():se[2],text:Ee}}},De.heading=function(te){var se=this.rules.block.heading.exec(te);if(se){var ce=se[2].trim();if(/#$/.test(ce)){var Ee=ae(ce,"#");(this.options.pedantic||!Ee||/ $/.test(Ee))&&(ce=Ee.trim())}return{type:"heading",raw:se[0],depth:se[1].length,text:ce}}},De.nptable=function(te){var se=this.rules.block.nptable.exec(te);if(se){var ce={type:"table",header:w(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
`):[],raw:se[0]};if(ce.header.length===ce.align.length){var Ee=ce.align.length,Te;for(Te=0;Te<Ee;Te++)/^ *-+: *$/.test(ce.align[Te])?ce.align[Te]="right":/^ *:-+: *$/.test(ce.align[Te])?ce.align[Te]="center":/^ *:-+ *$/.test(ce.align[Te])?ce.align[Te]="left":ce.align[Te]=null;for(Ee=ce.cells.length,Te=0;Te<Ee;Te++)ce.cells[Te]=w(ce.cells[Te],ce.header.length);return ce}}},De.hr=function(te){var se=this.rules.block.hr.exec(te);if(se)return{type:"hr",raw:se[0]}},De.blockquote=function(te){var se=this.rules.block.blockquote.exec(te);if(se){var ce=se[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:se[0],text:ce}}},De.list=function(te){var se=this.rules.block.list.exec(te);if(se){var ce=se[0],Ee=se[2],Te=Ee.length>1,Et={type:"list",raw:ce,ordered:Te,start:Te?+Ee.slice(0,-1):"",loose:!1,items:[]},Ut=se[0].match(this.rules.block.item),Ft=!1,rr,Ir,qr,jt,Yt,$r,fn,Oe,Wr,Pr=Ut.length;qr=this.rules.block.listItemStart.exec(Ut[0]);for(var Mr=0;Mr<Pr;Mr++){if(rr=Ut[Mr],ce=rr,this.options.pedantic||(Wr=rr.match(new RegExp("\\n\\s*\\n {0,"+(qr[0].length-1)+"}\\S")),Wr&&(Yt=rr.length-Wr.index+Ut.slice(Mr+1).join(`
`).length,Et.raw=Et.raw.substring(0,Et.raw.length-Yt),rr=rr.substring(0,Wr.index),ce=rr,Pr=Mr+1)),Mr!==Pr-1){if(jt=this.rules.block.listItemStart.exec(Ut[Mr+1]),this.options.pedantic?jt[1].length>qr[1].length:jt[1].length>=qr[0].length||jt[1].length>3){Ut.splice(Mr,2,Ut[Mr]+(!this.options.pedantic&&jt[1].length<qr[0].length&&!Ut[Mr].match(/\n$/)?"":`
`)+Ut[Mr+1]),Mr--,Pr--;continue}else(!this.options.pedantic||this.options.smartLists?jt[2][jt[2].length-1]!==Ee[Ee.length-1]:Te===(jt[2].length===1))&&(Yt=Ut.slice(Mr+1).join(`
`).length,Et.raw=Et.raw.substring(0,Et.raw.length-Yt),Mr=Pr-1);qr=jt}Ir=rr.length,rr=rr.replace(/^ *([*+-]|\d+[.)]) ?/,""),~rr.indexOf(`
`)&&(Ir-=rr.length,rr=this.options.pedantic?rr.replace(/^ {1,4}/gm,""):rr.replace(new RegExp("^ {1,"+Ir+"}","gm"),"")),rr=ae(rr,`
`),Mr!==Pr-1&&(ce=ce+`
`),$r=Ft||/\n\n(?!\s*$)/.test(ce),Mr!==Pr-1&&(Ft=ce.slice(-2)===`
`,$r||($r=Ft)),$r&&(Et.loose=!0),this.options.gfm&&(fn=/^\[[ xX]\] /.test(rr),Oe=void 0,fn&&(Oe=rr[1]!==" ",rr=rr.replace(/^\[[ xX]\] +/,""))),Et.items.push({type:"list_item",raw:ce,task:fn,checked:Oe,loose:$r,text:rr})}return Et}},De.html=function(te){var se=this.rules.block.html.exec(te);if(se)return{type:this.options.sanitize?"paragraph":"html",raw:se[0],pre:!this.options.sanitizer&&(se[1]==="pre"||se[1]==="script"||se[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):b(se[0]):se[0]}},De.def=function(te){var se=this.rules.block.def.exec(te);if(se){se[3]&&(se[3]=se[3].substring(1,se[3].length-1));var ce=se[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:ce,raw:se[0],href:se[2],title:se[3]}}},De.table=function(te){var se=this.rules.block.table.exec(te);if(se){var ce={type:"table",header:w(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
`):[]};if(ce.header.length===ce.align.length){ce.raw=se[0];var Ee=ce.align.length,Te;for(Te=0;Te<Ee;Te++)/^ *-+: *$/.test(ce.align[Te])?ce.align[Te]="right":/^ *:-+: *$/.test(ce.align[Te])?ce.align[Te]="center":/^ *:-+ *$/.test(ce.align[Te])?ce.align[Te]="left":ce.align[Te]=null;for(Ee=ce.cells.length,Te=0;Te<Ee;Te++)ce.cells[Te]=w(ce.cells[Te].replace(/^ *\| *| *\| *$/g,""),ce.header.length);return ce}}},De.lheading=function(te){var se=this.rules.block.lheading.exec(te);if(se)return{type:"heading",raw:se[0],depth:se[2].charAt(0)==="="?1:2,text:se[1]}},De.paragraph=function(te){var se=this.rules.block.paragraph.exec(te);if(se)return{type:"paragraph",raw:se[0],text:se[1].charAt(se[1].length-1)===`
`?se[1].slice(0,-1):se[1]}},De.text=function(te){var se=this.rules.block.text.exec(te);if(se)return{type:"text",raw:se[0],text:se[0]}},De.escape=function(te){var se=this.rules.inline.escape.exec(te);if(se)return{type:"escape",raw:se[0],text:b(se[1])}},De.tag=function(te,se,ce){var Ee=this.rules.inline.tag.exec(te);if(Ee)return!se&&/^<a /i.test(Ee[0])?se=!0:se&&/^<\/a>/i.test(Ee[0])&&(se=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ee[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ee[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:Ee[0],inLink:se,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):b(Ee[0]):Ee[0]}},De.link=function(te){var se=this.rules.inline.link.exec(te);if(se){var ce=se[2].trim();if(!this.options.pedantic&&/^</.test(ce)){if(!/>$/.test(ce))return;var Ee=ae(ce.slice(0,-1),"\\");if((ce.length-Ee.length)%2===0)return}else{var Te=$(se[2],"()");if(Te>-1){var Et=se[0].indexOf("!")===0?5:4,Ut=Et+se[1].length+Te;se[2]=se[2].substring(0,Te),se[0]=se[0].substring(0,Ut).trim(),se[3]=""}}var Ft=se[2],rr="";if(this.options.pedantic){var Ir=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ft);Ir&&(Ft=Ir[1],rr=Ir[3])}else rr=se[3]?se[3].slice(1,-1):"";return Ft=Ft.trim(),/^</.test(Ft)&&(this.options.pedantic&&!/>$/.test(ce)?Ft=Ft.slice(1):Ft=Ft.slice(1,-1)),fe(se,{href:Ft&&Ft.replace(this.rules.inline._escapes,"$1"),title:rr&&rr.replace(this.rules.inline._escapes,"$1")},se[0])}},De.reflink=function(te,se){var ce;if((ce=this.rules.inline.reflink.exec(te))||(ce=this.rules.inline.nolink.exec(te))){var Ee=(ce[2]||ce[1]).replace(/\s+/g," ");if(Ee=se[Ee.toLowerCase()],!Ee||!Ee.href){var Te=ce[0].charAt(0);return{type:"text",raw:Te,text:Te}}return fe(ce,Ee,ce[0])}},De.emStrong=function(te,se,ce){ce===void 0&&(ce="");var Ee=this.rules.inline.emStrong.lDelim.exec(te);if(Ee&&!(Ee[3]&&ce.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 Te=Ee[1]||Ee[2]||"";if(!Te||Te&&(ce===""||this.rules.inline.punctuation.exec(ce))){var Et=Ee[0].length-1,Ut,Ft,rr=Et,Ir=0,qr=Ee[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(qr.lastIndex=0,se=se.slice(-1*te.length+Et);(Ee=qr.exec(se))!=null;)if(Ut=Ee[1]||Ee[2]||Ee[3]||Ee[4]||Ee[5]||Ee[6],!!Ut){if(Ft=Ut.length,Ee[3]||Ee[4]){rr+=Ft;continue}else if((Ee[5]||Ee[6])&&Et%3&&!((Et+Ft)%3)){Ir+=Ft;continue}if(rr-=Ft,!(rr>0))return Ft=Math.min(Ft,Ft+rr+Ir),Math.min(Et,Ft)%2?{type:"em",raw:te.slice(0,Et+Ee.index+Ft+1),text:te.slice(1,Et+Ee.index+Ft)}:{type:"strong",raw:te.slice(0,Et+Ee.index+Ft+1),text:te.slice(2,Et+Ee.index+Ft-1)}}}}},De.codespan=function(te){var se=this.rules.inline.code.exec(te);if(se){var ce=se[2].replace(/\n/g," "),Ee=/[^ ]/.test(ce),Te=/^ /.test(ce)&&/ $/.test(ce);return Ee&&Te&&(ce=ce.substring(1,ce.length-1)),ce=b(ce,!0),{type:"codespan",raw:se[0],text:ce}}},De.br=function(te){var se=this.rules.inline.br.exec(te);if(se)return{type:"br",raw:se[0]}},De.del=function(te){var se=this.rules.inline.del.exec(te);if(se)return{type:"del",raw:se[0],text:se[2]}},De.autolink=function(te,se){var ce=this.rules.inline.autolink.exec(te);if(ce){var Ee,Te;return ce[2]==="@"?(Ee=b(this.options.mangle?se(ce[1]):ce[1]),Te="mailto:"+Ee):(Ee=b(ce[1]),Te=Ee),{type:"link",raw:ce[0],text:Ee,href:Te,tokens:[{type:"text",raw:Ee,text:Ee}]}}},De.url=function(te,se){var ce;if(ce=this.rules.inline.url.exec(te)){var Ee,Te;if(ce[2]==="@")Ee=b(this.options.mangle?se(ce[0]):ce[0]),Te="mailto:"+Ee;else{var Et;do Et=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(Et!==ce[0]);Ee=b(ce[0]),ce[1]==="www."?Te="http://"+Ee:Te=Ee}return{type:"link",raw:ce[0],text:Ee,href:Te,tokens:[{type:"text",raw:Ee,text:Ee}]}}},De.inlineText=function(te,se,ce){var Ee=this.rules.inline.text.exec(te);if(Ee){var Te;return se?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):b(Ee[0]):Ee[0]:Te=b(this.options.smartypants?ce(Ee[0]):Ee[0]),{type:"text",raw:Ee[0],text:Te}}},ke}(),Rt=X.noopTest,Ct=X.edit,Vt=X.merge,Qt={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:Rt,table:Rt,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};Qt._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Qt._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Qt.def=Ct(Qt.def).replace("label",Qt._label).replace("title",Qt._title).getRegex(),Qt.bullet=/(?:[*+-]|\d{1,9}[.)])/,Qt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Qt.item=Ct(Qt.item,"gm").replace(/bull/g,Qt.bullet).getRegex(),Qt.listItemStart=Ct(/^( *)(bull) */).replace("bull",Qt.bullet).getRegex(),Qt.list=Ct(Qt.list).replace(/bull/g,Qt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Qt.def.source+")").getRegex(),Qt._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",Qt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Qt.html=Ct(Qt.html,"i").replace("comment",Qt._comment).replace("tag",Qt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Qt.paragraph=Ct(Qt._paragraph).replace("hr",Qt.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",Qt._tag).getRegex(),Qt.blockquote=Ct(Qt.blockquote).replace("paragraph",Qt.paragraph).getRegex(),Qt.normal=Vt({},Qt),Qt.gfm=Vt({},Qt.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*|$)"}),Qt.gfm.nptable=Ct(Qt.gfm.nptable).replace("hr",Qt.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",Qt._tag).getRegex(),Qt.gfm.table=Ct(Qt.gfm.table).replace("hr",Qt.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",Qt._tag).getRegex(),Qt.pedantic=Vt({},Qt.normal,{html:Ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qt._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:Rt,paragraph:Ct(Qt.normal._paragraph).replace("hr",Qt.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Qt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var bt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Rt,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:Rt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};bt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",bt.punctuation=Ct(bt.punctuation).replace(/punctuation/g,bt._punctuation).getRegex(),bt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,bt.escapedEmSt=/\\\*|\\_/g,bt._comment=Ct(Qt._comment).replace("(?:-->|$)","-->").getRegex(),bt.emStrong.lDelim=Ct(bt.emStrong.lDelim).replace(/punct/g,bt._punctuation).getRegex(),bt.emStrong.rDelimAst=Ct(bt.emStrong.rDelimAst,"g").replace(/punct/g,bt._punctuation).getRegex(),bt.emStrong.rDelimUnd=Ct(bt.emStrong.rDelimUnd,"g").replace(/punct/g,bt._punctuation).getRegex(),bt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,bt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,bt._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])?)+(?![-_])/,bt.autolink=Ct(bt.autolink).replace("scheme",bt._scheme).replace("email",bt._email).getRegex(),bt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,bt.tag=Ct(bt.tag).replace("comment",bt._comment).replace("attribute",bt._attribute).getRegex(),bt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,bt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,bt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,bt.link=Ct(bt.link).replace("label",bt._label).replace("href",bt._href).replace("title",bt._title).getRegex(),bt.reflink=Ct(bt.reflink).replace("label",bt._label).getRegex(),bt.reflinkSearch=Ct(bt.reflinkSearch,"g").replace("reflink",bt.reflink).replace("nolink",bt.nolink).getRegex(),bt.normal=Vt({},bt),bt.pedantic=Vt({},bt.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:Ct(/^!?\[(label)\]\((.*?)\)/).replace("label",bt._label).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",bt._label).getRegex()}),bt.gfm=Vt({},bt.normal,{escape:Ct(bt.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),bt.gfm.url=Ct(bt.gfm.url,"i").replace("email",bt.gfm._extended_email).getRegex(),bt.breaks=Vt({},bt.gfm,{br:Ct(bt.br).replace("{2,}","*").getRegex(),text:Ct(bt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var He={block:Qt,inline:bt},nt=lt,it=ve.exports.defaults,At=He.block,Ht=He.inline,Fe=X.repeatString;function R(ke){return ke.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 m(ke){var De="",Se,te,se=ke.length;for(Se=0;Se<se;Se++)te=ke.charCodeAt(Se),Math.random()>.5&&(te="x"+te.toString(16)),De+="&#"+te+";";return De}var F=function(){function ke(Se){this.tokens=[],this.tokens.links=Object.create(null),this.options=Se||it,this.options.tokenizer=this.options.tokenizer||new nt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var te={block:At.normal,inline:Ht.normal};this.options.pedantic?(te.block=At.pedantic,te.inline=Ht.pedantic):this.options.gfm&&(te.block=At.gfm,this.options.breaks?te.inline=Ht.breaks:te.inline=Ht.gfm),this.tokenizer.rules=te}ke.lex=function(te,se){var ce=new ke(se);return ce.lex(te)},ke.lexInline=function(te,se){var ce=new ke(se);return ce.inlineTokens(te)};var De=ke.prototype;return De.lex=function(te){return te=te.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(te,this.tokens,!0),this.inline(this.tokens),this.tokens},De.blockTokens=function(te,se,ce){se===void 0&&(se=[]),ce===void 0&&(ce=!0),this.options.pedantic&&(te=te.replace(/^ +$/gm,""));for(var Ee,Te,Et,Ut;te;){if(Ee=this.tokenizer.space(te)){te=te.substring(Ee.raw.length),Ee.type&&se.push(Ee);continue}if(Ee=this.tokenizer.code(te)){te=te.substring(Ee.raw.length),Ut=se[se.length-1],Ut&&Ut.type==="paragraph"?(Ut.raw+=`
`+Ee.raw,Ut.text+=`
`+Ee.text):se.push(Ee);continue}if(Ee=this.tokenizer.fences(te)){te=te.substring(Ee.raw.length),se.push(Ee);continue}if(Ee=this.tokenizer.heading(te)){te=te.substring(Ee.raw.length),se.push(Ee);continue}if(Ee=this.tokenizer.nptable(te)){te=te.substring(Ee.raw.length),se.push(Ee);continue}if(Ee=this.tokenizer.hr(te)){te=te.substring(Ee.raw.length),se.push(Ee);continue}if(Ee=this.tokenizer.blockquote(te)){te=te.substring(Ee.raw.length),Ee.tokens=this.blockTokens(Ee.text,[],ce),se.push(Ee);continue}if(Ee=this.tokenizer.list(te)){for(te=te.substring(Ee.raw.length),Et=Ee.items.length,Te=0;Te<Et;Te++)Ee.items[Te].tokens=this.blockTokens(Ee.items[Te].text,[],!1);se.push(Ee);continue}if(Ee=this.tokenizer.html(te)){te=te.substring(Ee.raw.length),se.push(Ee);continue}if(ce&&(Ee=this.tokenizer.def(te))){te=te.substring(Ee.raw.length),this.tokens.links[Ee.tag]||(this.tokens.links[Ee.tag]={href:Ee.href,title:Ee.title});continue}if(Ee=this.tokenizer.table(te)){te=te.substring(Ee.raw.length),se.push(Ee);continue}if(Ee=this.tokenizer.lheading(te)){te=te.substring(Ee.raw.length),se.push(Ee);continue}if(ce&&(Ee=this.tokenizer.paragraph(te))){te=te.substring(Ee.raw.length),se.push(Ee);continue}if(Ee=this.tokenizer.text(te)){te=te.substring(Ee.raw.length),Ut=se[se.length-1],Ut&&Ut.type==="text"?(Ut.raw+=`
`+Ee.raw,Ut.text+=`
`+Ee.text):se.push(Ee);continue}if(te){var Ft="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(Ft);break}else throw new Error(Ft)}}return se},De.inline=function(te){var se,ce,Ee,Te,Et,Ut,Ft=te.length;for(se=0;se<Ft;se++)switch(Ut=te[se],Ut.type){case"paragraph":case"text":case"heading":{Ut.tokens=[],this.inlineTokens(Ut.text,Ut.tokens);break}case"table":{for(Ut.tokens={header:[],cells:[]},Te=Ut.header.length,ce=0;ce<Te;ce++)Ut.tokens.header[ce]=[],this.inlineTokens(Ut.header[ce],Ut.tokens.header[ce]);for(Te=Ut.cells.length,ce=0;ce<Te;ce++)for(Et=Ut.cells[ce],Ut.tokens.cells[ce]=[],Ee=0;Ee<Et.length;Ee++)Ut.tokens.cells[ce][Ee]=[],this.inlineTokens(Et[Ee],Ut.tokens.cells[ce][Ee]);break}case"blockquote":{this.inline(Ut.tokens);break}case"list":{for(Te=Ut.items.length,ce=0;ce<Te;ce++)this.inline(Ut.items[ce].tokens);break}}return te},De.inlineTokens=function(te,se,ce,Ee){se===void 0&&(se=[]),ce===void 0&&(ce=!1),Ee===void 0&&(Ee=!1);var Te,Et,Ut=te,Ft,rr,Ir;if(this.tokens.links){var qr=Object.keys(this.tokens.links);if(qr.length>0)for(;(Ft=this.tokenizer.rules.inline.reflinkSearch.exec(Ut))!=null;)qr.includes(Ft[0].slice(Ft[0].lastIndexOf("[")+1,-1))&&(Ut=Ut.slice(0,Ft.index)+"["+Fe("a",Ft[0].length-2)+"]"+Ut.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ft=this.tokenizer.rules.inline.blockSkip.exec(Ut))!=null;)Ut=Ut.slice(0,Ft.index)+"["+Fe("a",Ft[0].length-2)+"]"+Ut.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Ft=this.tokenizer.rules.inline.escapedEmSt.exec(Ut))!=null;)Ut=Ut.slice(0,Ft.index)+"++"+Ut.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;te;){if(rr||(Ir=""),rr=!1,Te=this.tokenizer.escape(te)){te=te.substring(Te.raw.length),se.push(Te);continue}if(Te=this.tokenizer.tag(te,ce,Ee)){te=te.substring(Te.raw.length),ce=Te.inLink,Ee=Te.inRawBlock;var jt=se[se.length-1];jt&&Te.type==="text"&&jt.type==="text"?(jt.raw+=Te.raw,jt.text+=Te.text):se.push(Te);continue}if(Te=this.tokenizer.link(te)){te=te.substring(Te.raw.length),Te.type==="link"&&(Te.tokens=this.inlineTokens(Te.text,[],!0,Ee)),se.push(Te);continue}if(Te=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(Te.raw.length);var Yt=se[se.length-1];Te.type==="link"?(Te.tokens=this.inlineTokens(Te.text,[],!0,Ee),se.push(Te)):Yt&&Te.type==="text"&&Yt.type==="text"?(Yt.raw+=Te.raw,Yt.text+=Te.text):se.push(Te);continue}if(Te=this.tokenizer.emStrong(te,Ut,Ir)){te=te.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],ce,Ee),se.push(Te);continue}if(Te=this.tokenizer.codespan(te)){te=te.substring(Te.raw.length),se.push(Te);continue}if(Te=this.tokenizer.br(te)){te=te.substring(Te.raw.length),se.push(Te);continue}if(Te=this.tokenizer.del(te)){te=te.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],ce,Ee),se.push(Te);continue}if(Te=this.tokenizer.autolink(te,m)){te=te.substring(Te.raw.length),se.push(Te);continue}if(!ce&&(Te=this.tokenizer.url(te,m))){te=te.substring(Te.raw.length),se.push(Te);continue}if(Te=this.tokenizer.inlineText(te,Ee,R)){te=te.substring(Te.raw.length),Te.raw.slice(-1)!=="_"&&(Ir=Te.raw.slice(-1)),rr=!0,Et=se[se.length-1],Et&&Et.type==="text"?(Et.raw+=Te.raw,Et.text+=Te.text):se.push(Te);continue}if(te){var $r="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error($r);break}else throw new Error($r)}}return se},Z(ke,null,[{key:"rules",get:function(){return{block:At,inline:Ht}}}]),ke}(),V=ve.exports.defaults,D=X.cleanUrl,N=X.escape,Ae=function(){function ke(Se){this.options=Se||V}var De=ke.prototype;return De.code=function(te,se,ce){var Ee=(se||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(te,Ee);Te!=null&&Te!==te&&(ce=!0,te=Te)}return te=te.replace(/\n$/,"")+`
`,Ee?'<pre><code class="'+this.options.langPrefix+N(Ee,!0)+'">'+(ce?te:N(te,!0))+`</code></pre>
`:"<pre><code>"+(ce?te:N(te,!0))+`</code></pre>
`},De.blockquote=function(te){return`<blockquote>
`+te+`</blockquote>
`},De.html=function(te){return te},De.heading=function(te,se,ce,Ee){return this.options.headerIds?"<h"+se+' id="'+this.options.headerPrefix+Ee.slug(ce)+'">'+te+"</h"+se+`>
`:"<h"+se+">"+te+"</h"+se+`>
`},De.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},De.list=function(te,se,ce){var Ee=se?"ol":"ul",Te=se&&ce!==1?' start="'+ce+'"':"";return"<"+Ee+Te+`>
`+te+"</"+Ee+`>
`},De.listitem=function(te){return"<li>"+te+`</li>
`},De.checkbox=function(te){return"<input "+(te?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},De.paragraph=function(te){return"<p>"+te+`</p>
`},De.table=function(te,se){return se&&(se="<tbody>"+se+"</tbody>"),`<table>
<thead>
`+te+`</thead>
`+se+`</table>
`},De.tablerow=function(te){return`<tr>
`+te+`</tr>
`},De.tablecell=function(te,se){var ce=se.header?"th":"td",Ee=se.align?"<"+ce+' align="'+se.align+'">':"<"+ce+">";return Ee+te+"</"+ce+`>
`},De.strong=function(te){return"<strong>"+te+"</strong>"},De.em=function(te){return"<em>"+te+"</em>"},De.codespan=function(te){return"<code>"+te+"</code>"},De.br=function(){return this.options.xhtml?"<br/>":"<br>"},De.del=function(te){return"<del>"+te+"</del>"},De.link=function(te,se,ce){if(te=D(this.options.sanitize,this.options.baseUrl,te),te===null)return ce;var Ee='<a href="'+N(te)+'"';return se&&(Ee+=' title="'+se+'"'),Ee+=">"+ce+"</a>",Ee},De.image=function(te,se,ce){if(te=D(this.options.sanitize,this.options.baseUrl,te),te===null)return ce;var Ee='<img src="'+te+'" alt="'+ce+'"';return se&&(Ee+=' title="'+se+'"'),Ee+=this.options.xhtml?"/>":">",Ee},De.text=function(te){return te},ke}(),Le=function(){function ke(){}var De=ke.prototype;return De.strong=function(te){return te},De.em=function(te){return te},De.codespan=function(te){return te},De.del=function(te){return te},De.html=function(te){return te},De.text=function(te){return te},De.link=function(te,se,ce){return""+ce},De.image=function(te,se,ce){return""+ce},De.br=function(){return""},ke}(),Me=function(){function ke(){this.seen={}}var De=ke.prototype;return De.serialize=function(te){return te.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},De.getNextSafeSlug=function(te,se){var ce=te,Ee=0;if(this.seen.hasOwnProperty(ce)){Ee=this.seen[te];do Ee++,ce=te+"-"+Ee;while(this.seen.hasOwnProperty(ce))}return se||(this.seen[te]=Ee,this.seen[ce]=0),ce},De.slug=function(te,se){se===void 0&&(se={});var ce=this.serialize(te);return this.getNextSafeSlug(ce,se.dryrun)},ke}(),Xe=Ae,qe=Le,Pt=Me,ot=ve.exports.defaults,Bt=X.unescape,ut=function(){function ke(Se){this.options=Se||ot,this.options.renderer=this.options.renderer||new Xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qe,this.slugger=new Pt}ke.parse=function(te,se){var ce=new ke(se);return ce.parse(te)},ke.parseInline=function(te,se){var ce=new ke(se);return ce.parseInline(te)};var De=ke.prototype;return De.parse=function(te,se){se===void 0&&(se=!0);var ce="",Ee,Te,Et,Ut,Ft,rr,Ir,qr,jt,Yt,$r,fn,Oe,Wr,Pr,Mr,In,en,Fn=te.length;for(Ee=0;Ee<Fn;Ee++)switch(Yt=te[Ee],Yt.type){case"space":continue;case"hr":{ce+=this.renderer.hr();continue}case"heading":{ce+=this.renderer.heading(this.parseInline(Yt.tokens),Yt.depth,Bt(this.parseInline(Yt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ce+=this.renderer.code(Yt.text,Yt.lang,Yt.escaped);continue}case"table":{for(qr="",Ir="",Ut=Yt.header.length,Te=0;Te<Ut;Te++)Ir+=this.renderer.tablecell(this.parseInline(Yt.tokens.header[Te]),{header:!0,align:Yt.align[Te]});for(qr+=this.renderer.tablerow(Ir),jt="",Ut=Yt.cells.length,Te=0;Te<Ut;Te++){for(rr=Yt.tokens.cells[Te],Ir="",Ft=rr.length,Et=0;Et<Ft;Et++)Ir+=this.renderer.tablecell(this.parseInline(rr[Et]),{header:!1,align:Yt.align[Et]});jt+=this.renderer.tablerow(Ir)}ce+=this.renderer.table(qr,jt);continue}case"blockquote":{jt=this.parse(Yt.tokens),ce+=this.renderer.blockquote(jt);continue}case"list":{for($r=Yt.ordered,fn=Yt.start,Oe=Yt.loose,Ut=Yt.items.length,jt="",Te=0;Te<Ut;Te++)Pr=Yt.items[Te],Mr=Pr.checked,In=Pr.task,Wr="",Pr.task&&(en=this.renderer.checkbox(Mr),Oe?Pr.tokens.length>0&&Pr.tokens[0].type==="text"?(Pr.tokens[0].text=en+" "+Pr.tokens[0].text,Pr.tokens[0].tokens&&Pr.tokens[0].tokens.length>0&&Pr.tokens[0].tokens[0].type==="text"&&(Pr.tokens[0].tokens[0].text=en+" "+Pr.tokens[0].tokens[0].text)):Pr.tokens.unshift({type:"text",text:en}):Wr+=en),Wr+=this.parse(Pr.tokens,Oe),jt+=this.renderer.listitem(Wr,In,Mr);ce+=this.renderer.list(jt,$r,fn);continue}case"html":{ce+=this.renderer.html(Yt.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(Yt.tokens));continue}case"text":{for(jt=Yt.tokens?this.parseInline(Yt.tokens):Yt.text;Ee+1<Fn&&te[Ee+1].type==="text";)Yt=te[++Ee],jt+=`
`+(Yt.tokens?this.parseInline(Yt.tokens):Yt.text);ce+=se?this.renderer.paragraph(jt):jt;continue}default:{var mn='Token with "'+Yt.type+'" type was not found.';if(this.options.silent){console.error(mn);return}else throw new Error(mn)}}return ce},De.parseInline=function(te,se){se=se||this.renderer;var ce="",Ee,Te,Et=te.length;for(Ee=0;Ee<Et;Ee++)switch(Te=te[Ee],Te.type){case"escape":{ce+=se.text(Te.text);break}case"html":{ce+=se.html(Te.text);break}case"link":{ce+=se.link(Te.href,Te.title,this.parseInline(Te.tokens,se));break}case"image":{ce+=se.image(Te.href,Te.title,Te.text);break}case"strong":{ce+=se.strong(this.parseInline(Te.tokens,se));break}case"em":{ce+=se.em(this.parseInline(Te.tokens,se));break}case"codespan":{ce+=se.codespan(Te.text);break}case"br":{ce+=se.br();break}case"del":{ce+=se.del(this.parseInline(Te.tokens,se));break}case"text":{ce+=se.text(Te.text);break}default:{var Ut='Token with "'+Te.type+'" type was not found.';if(this.options.silent){console.error(Ut);return}else throw new Error(Ut)}}return ce},ke}(),gt=F,Ye=ut,rt=lt,yt=Ae,It=Le,zt=Me,kt=X.merge,tr=X.checkSanitizeDeprecation,Wt=X.escape,ir=ve.exports.getDefaults,Er=ve.exports.changeDefaults,zr=ve.exports.defaults;function Nt(ke,De,Se){if(typeof ke=="undefined"||ke===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ke!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ke)+", string expected");if(typeof De=="function"&&(Se=De,De=null),De=kt({},Nt.defaults,De||{}),tr(De),Se){var te=De.highlight,se;try{se=gt.lex(ke,De)}catch(Et){return Se(Et)}var ce=function(Ut){var Ft;if(!Ut)try{De.walkTokens&&Nt.walkTokens(se,De.walkTokens),Ft=Ye.parse(se,De)}catch(rr){Ut=rr}return De.highlight=te,Ut?Se(Ut):Se(null,Ft)};if(!te||te.length<3||(delete De.highlight,!se.length))return ce();var Ee=0;Nt.walkTokens(se,function(Et){Et.type==="code"&&(Ee++,setTimeout(function(){te(Et.text,Et.lang,function(Ut,Ft){if(Ut)return ce(Ut);Ft!=null&&Ft!==Et.text&&(Et.text=Ft,Et.escaped=!0),Ee--,Ee===0&&ce()})},0))}),Ee===0&&ce();return}try{var Te=gt.lex(ke,De);return De.walkTokens&&Nt.walkTokens(Te,De.walkTokens),Ye.parse(Te,De)}catch(Et){if(Et.message+=`
Please report this to https://github.com/markedjs/marked.`,De.silent)return"<p>An error occurred:</p><pre>"+Wt(Et.message+"",!0)+"</pre>";throw Et}}Nt.options=Nt.setOptions=function(ke){return kt(Nt.defaults,ke),Er(Nt.defaults),Nt},Nt.getDefaults=ir,Nt.defaults=zr,Nt.use=function(ke){var De=kt({},ke);if(ke.renderer&&function(){var te=Nt.defaults.renderer||new yt,se=function(Te){var Et=te[Te];te[Te]=function(){for(var Ut=arguments.length,Ft=new Array(Ut),rr=0;rr<Ut;rr++)Ft[rr]=arguments[rr];var Ir=ke.renderer[Te].apply(te,Ft);return Ir===!1&&(Ir=Et.apply(te,Ft)),Ir}};for(var ce in ke.renderer)se(ce);De.renderer=te}(),ke.tokenizer&&function(){var te=Nt.defaults.tokenizer||new rt,se=function(Te){var Et=te[Te];te[Te]=function(){for(var Ut=arguments.length,Ft=new Array(Ut),rr=0;rr<Ut;rr++)Ft[rr]=arguments[rr];var Ir=ke.tokenizer[Te].apply(te,Ft);return Ir===!1&&(Ir=Et.apply(te,Ft)),Ir}};for(var ce in ke.tokenizer)se(ce);De.tokenizer=te}(),ke.walkTokens){var Se=Nt.defaults.walkTokens;De.walkTokens=function(te){ke.walkTokens(te),Se&&Se(te)}}Nt.setOptions(De)},Nt.walkTokens=function(ke,De){for(var Se=Ue(ke),te;!(te=Se()).done;){var se=te.value;switch(De(se),se.type){case"table":{for(var ce=Ue(se.tokens.header),Ee;!(Ee=ce()).done;){var Te=Ee.value;Nt.walkTokens(Te,De)}for(var Et=Ue(se.tokens.cells),Ut;!(Ut=Et()).done;)for(var Ft=Ut.value,rr=Ue(Ft),Ir;!(Ir=rr()).done;){var qr=Ir.value;Nt.walkTokens(qr,De)}break}case"list":{Nt.walkTokens(se.items,De);break}default:se.tokens&&Nt.walkTokens(se.tokens,De)}}},Nt.parseInline=function(ke,De){if(typeof ke=="undefined"||ke===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof ke!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(ke)+", string expected");De=kt({},Nt.defaults,De||{}),tr(De);try{var Se=gt.lexInline(ke,De);return De.walkTokens&&Nt.walkTokens(Se,De.walkTokens),Ye.parseInline(Se,De)}catch(te){if(te.message+=`
Please report this to https://github.com/markedjs/marked.`,De.silent)return"<p>An error occurred:</p><pre>"+Wt(te.message+"",!0)+"</pre>";throw te}},Nt.Parser=Ye,Nt.parser=Ye.parse,Nt.Renderer=yt,Nt.TextRenderer=It,Nt.Lexer=gt,Nt.lexer=gt.lex,Nt.Tokenizer=rt,Nt.Slugger=zt,Nt.parse=Nt;var ur=Nt;return ur})},11690:function(Sr){const St=/[&<>"']/,Z=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,we=/[<>"']|&(?!#?\w+;)/g,Ue={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ve=le=>Ue[le];function Y(le,xe){if(xe){if(St.test(le))return le.replace(Z,ve)}else if(z.test(le))return le.replace(we,ve);return le}const _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ye(le){return le.replace(_,(xe,Ke)=>(Ke=Ke.toLowerCase(),Ke==="colon"?":":Ke.charAt(0)==="#"?Ke.charAt(1)==="x"?String.fromCharCode(parseInt(Ke.substring(2),16)):String.fromCharCode(+Ke.substring(1)):""))}const H=/(^|[^\[])\^/g;function o(le,xe){le=le.source||le,xe=xe||"";const Ke={replace:(ge,Ze)=>(Ze=Ze.source||Ze,Ze=Ze.replace(H,"$1"),le=le.replace(ge,Ze),Ke),getRegex:()=>new RegExp(le,xe)};return Ke}const ne=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function B(le,xe,Ke){if(le){let ge;try{ge=decodeURIComponent(ye(Ke)).replace(ne,"").toLowerCase()}catch(Ze){return null}if(ge.indexOf("javascript:")===0||ge.indexOf("vbscript:")===0||ge.indexOf("data:")===0)return null}xe&&!U.test(Ke)&&(Ke=G(xe,Ke));try{Ke=encodeURI(Ke).replace(/%25/g,"%")}catch(ge){return null}return Ke}const y={},C=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,ee=/^([^:]+:\/*[^/]*)[\s\S]*$/;function G(le,xe){y[" "+le]||(C.test(le)?y[" "+le]=le+"/":y[" "+le]=re(le,"/",!0)),le=y[" "+le];const Ke=le.indexOf(":")===-1;return xe.substring(0,2)==="//"?Ke?xe:le.replace(T,"$1")+xe:xe.charAt(0)==="/"?Ke?xe:le.replace(ee,"$1")+xe:le+xe}const W={exec:function(){}};function k(le){let xe=1,Ke,ge;for(;xe<arguments.length;xe++){Ke=arguments[xe];for(ge in Ke)Object.prototype.hasOwnProperty.call(Ke,ge)&&(le[ge]=Ke[ge])}return le}function K(le,xe){const Ke=le.replace(/\|/g,(q,L,j)=>{let X=!1,ue=L;for(;--ue>=0&&j[ue]==="\\";)X=!X;return X?"|":" |"}),ge=Ke.split(/ \|/);let Ze=0;if(ge.length>xe)ge.splice(xe);else for(;ge.length<xe;)ge.push("");for(;Ze<ge.length;Ze++)ge[Ze]=ge[Ze].trim().replace(/\\\|/g,"|");return ge}function re(le,xe,Ke){const ge=le.length;if(ge===0)return"";let Ze=0;for(;Ze<ge;){const q=le.charAt(ge-Ze-1);if(q===xe&&!Ke)Ze++;else if(q!==xe&&Ke)Ze++;else break}return le.substr(0,ge-Ze)}function me(le,xe){if(le.indexOf(xe[1])===-1)return-1;const Ke=le.length;let ge=0,Ze=0;for(;Ze<Ke;Ze++)if(le[Ze]==="\\")Ze++;else if(le[Ze]===xe[0])ge++;else if(le[Ze]===xe[1]&&(ge--,ge<0))return Ze;return-1}function Ce(le){le&&le.sanitize&&!le.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 Ie(le,xe){if(xe<1)return"";let Ke="";for(;xe>1;)xe&1&&(Ke+=le),xe>>=1,le+=le;return Ke+le}Sr.exports={escape:Y,unescape:ye,edit:o,cleanUrl:B,resolveUrl:G,noopTest:W,merge:k,splitCells:K,rtrim:re,findClosingBracket:me,checkSanitizeDeprecation:Ce,repeatString:Ie}},75918:function(Sr,St,Z){"use strict";Z.d(St,{Wi:function(){return _},Z0:function(){return ye},aU:function(){return Y},eZ:function(){return o},wY:function(){return H}});var z=Z(4348),we=Z(69323),Ue=Z(13268),ve=function(ne,U,B,y){function C(T){return T instanceof B?T:new B(function(ee){ee(T)})}return new(B||(B=Promise))(function(T,ee){function G(K){try{k(y.next(K))}catch(re){ee(re)}}function W(K){try{k(y.throw(K))}catch(re){ee(re)}}function k(K){K.done?T(K.value):C(K.value).then(G,W)}k((y=y.apply(ne,U||[])).next())})};class Y extends we.JT{constructor(U,B="",y="",C=!0,T){super(),this._onDidChange=this._register(new z.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=U,this._label=B,this._cssClass=y,this._enabled=C,this._actionCallback=T}get id(){return this._id}get label(){return this._label}set label(U){this._setLabel(U)}_setLabel(U){this._label!==U&&(this._label=U,this._onDidChange.fire({label:U}))}get tooltip(){return this._tooltip||""}set tooltip(U){this._setTooltip(U)}_setTooltip(U){this._tooltip!==U&&(this._tooltip=U,this._onDidChange.fire({tooltip:U}))}get class(){return this._cssClass}set class(U){this._setClass(U)}_setClass(U){this._cssClass!==U&&(this._cssClass=U,this._onDidChange.fire({class:U}))}get enabled(){return this._enabled}set enabled(U){this._setEnabled(U)}_setEnabled(U){this._enabled!==U&&(this._enabled=U,this._onDidChange.fire({enabled:U}))}get checked(){return this._checked}set checked(U){this._setChecked(U)}_setChecked(U){this._checked!==U&&(this._checked=U,this._onDidChange.fire({checked:U}))}run(U,B){return ve(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(U))})}}class _ extends we.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new z.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new z.Q5),this.onDidRun=this._onDidRun.event}run(U,B){return ve(this,void 0,void 0,function*(){if(!U.enabled)return;this._onBeforeRun.fire({action:U});let y;try{yield this.runAction(U,B)}catch(C){y=C}this._onDidRun.fire({action:U,error:y})})}runAction(U,B){return ve(this,void 0,void 0,function*(){yield U.run(B)})}}class ye extends Y{constructor(U){super(ye.ID,U,U?"separator text":"separator"),this.checked=!1,this.enabled=!1}}ye.ID="vs.actions.separator";class H{constructor(U,B,y,C){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=U,this.label=B,this.class=C,this._actions=y}get actions(){return this._actions}dispose(){}run(){return ve(this,void 0,void 0,function*(){})}}class o extends Y{constructor(){super(o.ID,Ue.N("submenu.empty","(empty)"),void 0,!1)}}o.ID="vs.actions.empty"},76068:function(Sr,St,Z){"use strict";Z.d(St,{ok:function(){return z}});function z(we,Ue){if(!we)throw new Error(Ue?`Assertion failed (${Ue})`:"Assertion Failed")}},52615:function(Sr,St,Z){"use strict";Z.d(St,{CM:function(){return Y},JL:function(){return _},dT:function(){return H},fK:function(){return ve},lA:function(){return ye}});var z=Z(4348);class we{constructor(){this._icons=new Map,this._onDidRegister=new z.Q5}add(ne){const U=this._icons.get(ne.id);U?ne.description?U.description=ne.description:console.error(`Duplicate registration of codicon ${ne.id}`):(this._icons.set(ne.id,ne),this._onDidRegister.fire(ne))}get(ne){return this._icons.get(ne)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const Ue=new we,ve=Ue;function Y(o,ne){return new ye(o,ne)}function _(o){return o?o.replace(/\$\((.*?)\)/g,(ne,U)=>` ${U} `).trim():""}class ye{constructor(ne,U,B){this.id=ne,this.definition=U,this.description=B,Ue.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var H;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9\\-]+",o.iconModifierExpression="~[A-Za-z]+";const ne=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function U(C){if(C instanceof ye)return["codicon","codicon-"+C.id];const T=ne.exec(C.id);if(!T)return U(ye.error);let[,ee,G]=T;const W=["codicon","codicon-"+ee];return G&&W.push("codicon-modifier-"+G.substr(1)),W}o.asClassNameArray=U;function B(C){return U(C).join(" ")}o.asClassName=B;function y(C){return"."+U(C).join(".")}o.asCSSSelector=y})(H||(H={})),function(o){o.add=new o("add",{fontCharacter:"\\ea60"}),o.plus=new o("plus",o.add.definition),o.gistNew=new o("gist-new",o.add.definition),o.repoCreate=new o("repo-create",o.add.definition),o.lightbulb=new o("lightbulb",{fontCharacter:"\\ea61"}),o.lightBulb=new o("light-bulb",{fontCharacter:"\\ea61"}),o.repo=new o("repo",{fontCharacter:"\\ea62"}),o.repoDelete=new o("repo-delete",{fontCharacter:"\\ea62"}),o.gistFork=new o("gist-fork",{fontCharacter:"\\ea63"}),o.repoForked=new o("repo-forked",{fontCharacter:"\\ea63"}),o.gitPullRequest=new o("git-pull-request",{fontCharacter:"\\ea64"}),o.gitPullRequestAbandoned=new o("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),o.recordKeys=new o("record-keys",{fontCharacter:"\\ea65"}),o.keyboard=new o("keyboard",{fontCharacter:"\\ea65"}),o.tag=new o("tag",{fontCharacter:"\\ea66"}),o.tagAdd=new o("tag-add",{fontCharacter:"\\ea66"}),o.tagRemove=new o("tag-remove",{fontCharacter:"\\ea66"}),o.person=new o("person",{fontCharacter:"\\ea67"}),o.personFollow=new o("person-follow",{fontCharacter:"\\ea67"}),o.personOutline=new o("person-outline",{fontCharacter:"\\ea67"}),o.personFilled=new o("person-filled",{fontCharacter:"\\ea67"}),o.gitBranch=new o("git-branch",{fontCharacter:"\\ea68"}),o.gitBranchCreate=new o("git-branch-create",{fontCharacter:"\\ea68"}),o.gitBranchDelete=new o("git-branch-delete",{fontCharacter:"\\ea68"}),o.sourceControl=new o("source-control",{fontCharacter:"\\ea68"}),o.mirror=new o("mirror",{fontCharacter:"\\ea69"}),o.mirrorPublic=new o("mirror-public",{fontCharacter:"\\ea69"}),o.star=new o("star",{fontCharacter:"\\ea6a"}),o.starAdd=new o("star-add",{fontCharacter:"\\ea6a"}),o.starDelete=new o("star-delete",{fontCharacter:"\\ea6a"}),o.starEmpty=new o("star-empty",{fontCharacter:"\\ea6a"}),o.comment=new o("comment",{fontCharacter:"\\ea6b"}),o.commentAdd=new o("comment-add",{fontCharacter:"\\ea6b"}),o.alert=new o("alert",{fontCharacter:"\\ea6c"}),o.warning=new o("warning",{fontCharacter:"\\ea6c"}),o.search=new o("search",{fontCharacter:"\\ea6d"}),o.searchSave=new o("search-save",{fontCharacter:"\\ea6d"}),o.logOut=new o("log-out",{fontCharacter:"\\ea6e"}),o.signOut=new o("sign-out",{fontCharacter:"\\ea6e"}),o.logIn=new o("log-in",{fontCharacter:"\\ea6f"}),o.signIn=new o("sign-in",{fontCharacter:"\\ea6f"}),o.eye=new o("eye",{fontCharacter:"\\ea70"}),o.eyeUnwatch=new o("eye-unwatch",{fontCharacter:"\\ea70"}),o.eyeWatch=new o("eye-watch",{fontCharacter:"\\ea70"}),o.circleFilled=new o("circle-filled",{fontCharacter:"\\ea71"}),o.primitiveDot=new o("primitive-dot",{fontCharacter:"\\ea71"}),o.closeDirty=new o("close-dirty",{fontCharacter:"\\ea71"}),o.debugBreakpoint=new o("debug-breakpoint",{fontCharacter:"\\ea71"}),o.debugBreakpointDisabled=new o("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),o.debugHint=new o("debug-hint",{fontCharacter:"\\ea71"}),o.primitiveSquare=new o("primitive-square",{fontCharacter:"\\ea72"}),o.edit=new o("edit",{fontCharacter:"\\ea73"}),o.pencil=new o("pencil",{fontCharacter:"\\ea73"}),o.info=new o("info",{fontCharacter:"\\ea74"}),o.issueOpened=new o("issue-opened",{fontCharacter:"\\ea74"}),o.gistPrivate=new o("gist-private",{fontCharacter:"\\ea75"}),o.gitForkPrivate=new o("git-fork-private",{fontCharacter:"\\ea75"}),o.lock=new o("lock",{fontCharacter:"\\ea75"}),o.mirrorPrivate=new o("mirror-private",{fontCharacter:"\\ea75"}),o.close=new o("close",{fontCharacter:"\\ea76"}),o.removeClose=new o("remove-close",{fontCharacter:"\\ea76"}),o.x=new o("x",{fontCharacter:"\\ea76"}),o.repoSync=new o("repo-sync",{fontCharacter:"\\ea77"}),o.sync=new o("sync",{fontCharacter:"\\ea77"}),o.clone=new o("clone",{fontCharacter:"\\ea78"}),o.desktopDownload=new o("desktop-download",{fontCharacter:"\\ea78"}),o.beaker=new o("beaker",{fontCharacter:"\\ea79"}),o.microscope=new o("microscope",{fontCharacter:"\\ea79"}),o.vm=new o("vm",{fontCharacter:"\\ea7a"}),o.deviceDesktop=new o("device-desktop",{fontCharacter:"\\ea7a"}),o.file=new o("file",{fontCharacter:"\\ea7b"}),o.fileText=new o("file-text",{fontCharacter:"\\ea7b"}),o.more=new o("more",{fontCharacter:"\\ea7c"}),o.ellipsis=new o("ellipsis",{fontCharacter:"\\ea7c"}),o.kebabHorizontal=new o("kebab-horizontal",{fontCharacter:"\\ea7c"}),o.mailReply=new o("mail-reply",{fontCharacter:"\\ea7d"}),o.reply=new o("reply",{fontCharacter:"\\ea7d"}),o.organization=new o("organization",{fontCharacter:"\\ea7e"}),o.organizationFilled=new o("organization-filled",{fontCharacter:"\\ea7e"}),o.organizationOutline=new o("organization-outline",{fontCharacter:"\\ea7e"}),o.newFile=new o("new-file",{fontCharacter:"\\ea7f"}),o.fileAdd=new o("file-add",{fontCharacter:"\\ea7f"}),o.newFolder=new o("new-folder",{fontCharacter:"\\ea80"}),o.fileDirectoryCreate=new o("file-directory-create",{fontCharacter:"\\ea80"}),o.trash=new o("trash",{fontCharacter:"\\ea81"}),o.trashcan=new o("trashcan",{fontCharacter:"\\ea81"}),o.history=new o("history",{fontCharacter:"\\ea82"}),o.clock=new o("clock",{fontCharacter:"\\ea82"}),o.folder=new o("folder",{fontCharacter:"\\ea83"}),o.fileDirectory=new o("file-directory",{fontCharacter:"\\ea83"}),o.symbolFolder=new o("symbol-folder",{fontCharacter:"\\ea83"}),o.logoGithub=new o("logo-github",{fontCharacter:"\\ea84"}),o.markGithub=new o("mark-github",{fontCharacter:"\\ea84"}),o.github=new o("github",{fontCharacter:"\\ea84"}),o.terminal=new o("terminal",{fontCharacter:"\\ea85"}),o.console=new o("console",{fontCharacter:"\\ea85"}),o.repl=new o("repl",{fontCharacter:"\\ea85"}),o.zap=new o("zap",{fontCharacter:"\\ea86"}),o.symbolEvent=new o("symbol-event",{fontCharacter:"\\ea86"}),o.error=new o("error",{fontCharacter:"\\ea87"}),o.stop=new o("stop",{fontCharacter:"\\ea87"}),o.variable=new o("variable",{fontCharacter:"\\ea88"}),o.symbolVariable=new o("symbol-variable",{fontCharacter:"\\ea88"}),o.array=new o("array",{fontCharacter:"\\ea8a"}),o.symbolArray=new o("symbol-array",{fontCharacter:"\\ea8a"}),o.symbolModule=new o("symbol-module",{fontCharacter:"\\ea8b"}),o.symbolPackage=new o("symbol-package",{fontCharacter:"\\ea8b"}),o.symbolNamespace=new o("symbol-namespace",{fontCharacter:"\\ea8b"}),o.symbolObject=new o("symbol-object",{fontCharacter:"\\ea8b"}),o.symbolMethod=new o("symbol-method",{fontCharacter:"\\ea8c"}),o.symbolFunction=new o("symbol-function",{fontCharacter:"\\ea8c"}),o.symbolConstructor=new o("symbol-constructor",{fontCharacter:"\\ea8c"}),o.symbolBoolean=new o("symbol-boolean",{fontCharacter:"\\ea8f"}),o.symbolNull=new o("symbol-null",{fontCharacter:"\\ea8f"}),o.symbolNumeric=new o("symbol-numeric",{fontCharacter:"\\ea90"}),o.symbolNumber=new o("symbol-number",{fontCharacter:"\\ea90"}),o.symbolStructure=new o("symbol-structure",{fontCharacter:"\\ea91"}),o.symbolStruct=new o("symbol-struct",{fontCharacter:"\\ea91"}),o.symbolParameter=new o("symbol-parameter",{fontCharacter:"\\ea92"}),o.symbolTypeParameter=new o("symbol-type-parameter",{fontCharacter:"\\ea92"}),o.symbolKey=new o("symbol-key",{fontCharacter:"\\ea93"}),o.symbolText=new o("symbol-text",{fontCharacter:"\\ea93"}),o.symbolReference=new o("symbol-reference",{fontCharacter:"\\ea94"}),o.goToFile=new o("go-to-file",{fontCharacter:"\\ea94"}),o.symbolEnum=new o("symbol-enum",{fontCharacter:"\\ea95"}),o.symbolValue=new o("symbol-value",{fontCharacter:"\\ea95"}),o.symbolRuler=new o("symbol-ruler",{fontCharacter:"\\ea96"}),o.symbolUnit=new o("symbol-unit",{fontCharacter:"\\ea96"}),o.activateBreakpoints=new o("activate-breakpoints",{fontCharacter:"\\ea97"}),o.archive=new o("archive",{fontCharacter:"\\ea98"}),o.arrowBoth=new o("arrow-both",{fontCharacter:"\\ea99"}),o.arrowDown=new o("arrow-down",{fontCharacter:"\\ea9a"}),o.arrowLeft=new o("arrow-left",{fontCharacter:"\\ea9b"}),o.arrowRight=new o("arrow-right",{fontCharacter:"\\ea9c"}),o.arrowSmallDown=new o("arrow-small-down",{fontCharacter:"\\ea9d"}),o.arrowSmallLeft=new o("arrow-small-left",{fontCharacter:"\\ea9e"}),o.arrowSmallRight=new o("arrow-small-right",{fontCharacter:"\\ea9f"}),o.arrowSmallUp=new o("arrow-small-up",{fontCharacter:"\\eaa0"}),o.arrowUp=new o("arrow-up",{fontCharacter:"\\eaa1"}),o.bell=new o("bell",{fontCharacter:"\\eaa2"}),o.bold=new o("bold",{fontCharacter:"\\eaa3"}),o.book=new o("book",{fontCharacter:"\\eaa4"}),o.bookmark=new o("bookmark",{fontCharacter:"\\eaa5"}),o.debugBreakpointConditionalUnverified=new o("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),o.debugBreakpointConditional=new o("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),o.debugBreakpointConditionalDisabled=new o("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),o.debugBreakpointDataUnverified=new o("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),o.debugBreakpointData=new o("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),o.debugBreakpointDataDisabled=new o("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),o.debugBreakpointLogUnverified=new o("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),o.debugBreakpointLog=new o("debug-breakpoint-log",{fontCharacter:"\\eaab"}),o.debugBreakpointLogDisabled=new o("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),o.briefcase=new o("briefcase",{fontCharacter:"\\eaac"}),o.broadcast=new o("broadcast",{fontCharacter:"\\eaad"}),o.browser=new o("browser",{fontCharacter:"\\eaae"}),o.bug=new o("bug",{fontCharacter:"\\eaaf"}),o.calendar=new o("calendar",{fontCharacter:"\\eab0"}),o.caseSensitive=new o("case-sensitive",{fontCharacter:"\\eab1"}),o.check=new o("check",{fontCharacter:"\\eab2"}),o.checklist=new o("checklist",{fontCharacter:"\\eab3"}),o.chevronDown=new o("chevron-down",{fontCharacter:"\\eab4"}),o.dropDownButton=new o("drop-down-button",o.chevronDown.definition),o.chevronLeft=new o("chevron-left",{fontCharacter:"\\eab5"}),o.chevronRight=new o("chevron-right",{fontCharacter:"\\eab6"}),o.chevronUp=new o("chevron-up",{fontCharacter:"\\eab7"}),o.chromeClose=new o("chrome-close",{fontCharacter:"\\eab8"}),o.chromeMaximize=new o("chrome-maximize",{fontCharacter:"\\eab9"}),o.chromeMinimize=new o("chrome-minimize",{fontCharacter:"\\eaba"}),o.chromeRestore=new o("chrome-restore",{fontCharacter:"\\eabb"}),o.circleOutline=new o("circle-outline",{fontCharacter:"\\eabc"}),o.debugBreakpointUnverified=new o("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),o.circleSlash=new o("circle-slash",{fontCharacter:"\\eabd"}),o.circuitBoard=new o("circuit-board",{fontCharacter:"\\eabe"}),o.clearAll=new o("clear-all",{fontCharacter:"\\eabf"}),o.clippy=new o("clippy",{fontCharacter:"\\eac0"}),o.closeAll=new o("close-all",{fontCharacter:"\\eac1"}),o.cloudDownload=new o("cloud-download",{fontCharacter:"\\eac2"}),o.cloudUpload=new o("cloud-upload",{fontCharacter:"\\eac3"}),o.code=new o("code",{fontCharacter:"\\eac4"}),o.collapseAll=new o("collapse-all",{fontCharacter:"\\eac5"}),o.colorMode=new o("color-mode",{fontCharacter:"\\eac6"}),o.commentDiscussion=new o("comment-discussion",{fontCharacter:"\\eac7"}),o.compareChanges=new o("compare-changes",{fontCharacter:"\\eafd"}),o.creditCard=new o("credit-card",{fontCharacter:"\\eac9"}),o.dash=new o("dash",{fontCharacter:"\\eacc"}),o.dashboard=new o("dashboard",{fontCharacter:"\\eacd"}),o.database=new o("database",{fontCharacter:"\\eace"}),o.debugContinue=new o("debug-continue",{fontCharacter:"\\eacf"}),o.debugDisconnect=new o("debug-disconnect",{fontCharacter:"\\ead0"}),o.debugPause=new o("debug-pause",{fontCharacter:"\\ead1"}),o.debugRestart=new o("debug-restart",{fontCharacter:"\\ead2"}),o.debugStart=new o("debug-start",{fontCharacter:"\\ead3"}),o.debugStepInto=new o("debug-step-into",{fontCharacter:"\\ead4"}),o.debugStepOut=new o("debug-step-out",{fontCharacter:"\\ead5"}),o.debugStepOver=new o("debug-step-over",{fontCharacter:"\\ead6"}),o.debugStop=new o("debug-stop",{fontCharacter:"\\ead7"}),o.debug=new o("debug",{fontCharacter:"\\ead8"}),o.deviceCameraVideo=new o("device-camera-video",{fontCharacter:"\\ead9"}),o.deviceCamera=new o("device-camera",{fontCharacter:"\\eada"}),o.deviceMobile=new o("device-mobile",{fontCharacter:"\\eadb"}),o.diffAdded=new o("diff-added",{fontCharacter:"\\eadc"}),o.diffIgnored=new o("diff-ignored",{fontCharacter:"\\eadd"}),o.diffModified=new o("diff-modified",{fontCharacter:"\\eade"}),o.diffRemoved=new o("diff-removed",{fontCharacter:"\\eadf"}),o.diffRenamed=new o("diff-renamed",{fontCharacter:"\\eae0"}),o.diff=new o("diff",{fontCharacter:"\\eae1"}),o.discard=new o("discard",{fontCharacter:"\\eae2"}),o.editorLayout=new o("editor-layout",{fontCharacter:"\\eae3"}),o.emptyWindow=new o("empty-window",{fontCharacter:"\\eae4"}),o.exclude=new o("exclude",{fontCharacter:"\\eae5"}),o.extensions=new o("extensions",{fontCharacter:"\\eae6"}),o.eyeClosed=new o("eye-closed",{fontCharacter:"\\eae7"}),o.fileBinary=new o("file-binary",{fontCharacter:"\\eae8"}),o.fileCode=new o("file-code",{fontCharacter:"\\eae9"}),o.fileMedia=new o("file-media",{fontCharacter:"\\eaea"}),o.filePdf=new o("file-pdf",{fontCharacter:"\\eaeb"}),o.fileSubmodule=new o("file-submodule",{fontCharacter:"\\eaec"}),o.fileSymlinkDirectory=new o("file-symlink-directory",{fontCharacter:"\\eaed"}),o.fileSymlinkFile=new o("file-symlink-file",{fontCharacter:"\\eaee"}),o.fileZip=new o("file-zip",{fontCharacter:"\\eaef"}),o.files=new o("files",{fontCharacter:"\\eaf0"}),o.filter=new o("filter",{fontCharacter:"\\eaf1"}),o.flame=new o("flame",{fontCharacter:"\\eaf2"}),o.foldDown=new o("fold-down",{fontCharacter:"\\eaf3"}),o.foldUp=new o("fold-up",{fontCharacter:"\\eaf4"}),o.fold=new o("fold",{fontCharacter:"\\eaf5"}),o.folderActive=new o("folder-active",{fontCharacter:"\\eaf6"}),o.folderOpened=new o("folder-opened",{fontCharacter:"\\eaf7"}),o.gear=new o("gear",{fontCharacter:"\\eaf8"}),o.gift=new o("gift",{fontCharacter:"\\eaf9"}),o.gistSecret=new o("gist-secret",{fontCharacter:"\\eafa"}),o.gist=new o("gist",{fontCharacter:"\\eafb"}),o.gitCommit=new o("git-commit",{fontCharacter:"\\eafc"}),o.gitCompare=new o("git-compare",{fontCharacter:"\\eafd"}),o.gitMerge=new o("git-merge",{fontCharacter:"\\eafe"}),o.githubAction=new o("github-action",{fontCharacter:"\\eaff"}),o.githubAlt=new o("github-alt",{fontCharacter:"\\eb00"}),o.globe=new o("globe",{fontCharacter:"\\eb01"}),o.grabber=new o("grabber",{fontCharacter:"\\eb02"}),o.graph=new o("graph",{fontCharacter:"\\eb03"}),o.gripper=new o("gripper",{fontCharacter:"\\eb04"}),o.heart=new o("heart",{fontCharacter:"\\eb05"}),o.home=new o("home",{fontCharacter:"\\eb06"}),o.horizontalRule=new o("horizontal-rule",{fontCharacter:"\\eb07"}),o.hubot=new o("hubot",{fontCharacter:"\\eb08"}),o.inbox=new o("inbox",{fontCharacter:"\\eb09"}),o.issueClosed=new o("issue-closed",{fontCharacter:"\\eba4"}),o.issueReopened=new o("issue-reopened",{fontCharacter:"\\eb0b"}),o.issues=new o("issues",{fontCharacter:"\\eb0c"}),o.italic=new o("italic",{fontCharacter:"\\eb0d"}),o.jersey=new o("jersey",{fontCharacter:"\\eb0e"}),o.json=new o("json",{fontCharacter:"\\eb0f"}),o.kebabVertical=new o("kebab-vertical",{fontCharacter:"\\eb10"}),o.key=new o("key",{fontCharacter:"\\eb11"}),o.law=new o("law",{fontCharacter:"\\eb12"}),o.lightbulbAutofix=new o("lightbulb-autofix",{fontCharacter:"\\eb13"}),o.linkExternal=new o("link-external",{fontCharacter:"\\eb14"}),o.link=new o("link",{fontCharacter:"\\eb15"}),o.listOrdered=new o("list-ordered",{fontCharacter:"\\eb16"}),o.listUnordered=new o("list-unordered",{fontCharacter:"\\eb17"}),o.liveShare=new o("live-share",{fontCharacter:"\\eb18"}),o.loading=new o("loading",{fontCharacter:"\\eb19"}),o.location=new o("location",{fontCharacter:"\\eb1a"}),o.mailRead=new o("mail-read",{fontCharacter:"\\eb1b"}),o.mail=new o("mail",{fontCharacter:"\\eb1c"}),o.markdown=new o("markdown",{fontCharacter:"\\eb1d"}),o.megaphone=new o("megaphone",{fontCharacter:"\\eb1e"}),o.mention=new o("mention",{fontCharacter:"\\eb1f"}),o.milestone=new o("milestone",{fontCharacter:"\\eb20"}),o.mortarBoard=new o("mortar-board",{fontCharacter:"\\eb21"}),o.move=new o("move",{fontCharacter:"\\eb22"}),o.multipleWindows=new o("multiple-windows",{fontCharacter:"\\eb23"}),o.mute=new o("mute",{fontCharacter:"\\eb24"}),o.noNewline=new o("no-newline",{fontCharacter:"\\eb25"}),o.note=new o("note",{fontCharacter:"\\eb26"}),o.octoface=new o("octoface",{fontCharacter:"\\eb27"}),o.openPreview=new o("open-preview",{fontCharacter:"\\eb28"}),o.package_=new o("package",{fontCharacter:"\\eb29"}),o.paintcan=new o("paintcan",{fontCharacter:"\\eb2a"}),o.pin=new o("pin",{fontCharacter:"\\eb2b"}),o.play=new o("play",{fontCharacter:"\\eb2c"}),o.run=new o("run",{fontCharacter:"\\eb2c"}),o.plug=new o("plug",{fontCharacter:"\\eb2d"}),o.preserveCase=new o("preserve-case",{fontCharacter:"\\eb2e"}),o.preview=new o("preview",{fontCharacter:"\\eb2f"}),o.project=new o("project",{fontCharacter:"\\eb30"}),o.pulse=new o("pulse",{fontCharacter:"\\eb31"}),o.question=new o("question",{fontCharacter:"\\eb32"}),o.quote=new o("quote",{fontCharacter:"\\eb33"}),o.radioTower=new o("radio-tower",{fontCharacter:"\\eb34"}),o.reactions=new o("reactions",{fontCharacter:"\\eb35"}),o.references=new o("references",{fontCharacter:"\\eb36"}),o.refresh=new o("refresh",{fontCharacter:"\\eb37"}),o.regex=new o("regex",{fontCharacter:"\\eb38"}),o.remoteExplorer=new o("remote-explorer",{fontCharacter:"\\eb39"}),o.remote=new o("remote",{fontCharacter:"\\eb3a"}),o.remove=new o("remove",{fontCharacter:"\\eb3b"}),o.replaceAll=new o("replace-all",{fontCharacter:"\\eb3c"}),o.replace=new o("replace",{fontCharacter:"\\eb3d"}),o.repoClone=new o("repo-clone",{fontCharacter:"\\eb3e"}),o.repoForcePush=new o("repo-force-push",{fontCharacter:"\\eb3f"}),o.repoPull=new o("repo-pull",{fontCharacter:"\\eb40"}),o.repoPush=new o("repo-push",{fontCharacter:"\\eb41"}),o.report=new o("report",{fontCharacter:"\\eb42"}),o.requestChanges=new o("request-changes",{fontCharacter:"\\eb43"}),o.rocket=new o("rocket",{fontCharacter:"\\eb44"}),o.rootFolderOpened=new o("root-folder-opened",{fontCharacter:"\\eb45"}),o.rootFolder=new o("root-folder",{fontCharacter:"\\eb46"}),o.rss=new o("rss",{fontCharacter:"\\eb47"}),o.ruby=new o("ruby",{fontCharacter:"\\eb48"}),o.saveAll=new o("save-all",{fontCharacter:"\\eb49"}),o.saveAs=new o("save-as",{fontCharacter:"\\eb4a"}),o.save=new o("save",{fontCharacter:"\\eb4b"}),o.screenFull=new o("screen-full",{fontCharacter:"\\eb4c"}),o.screenNormal=new o("screen-normal",{fontCharacter:"\\eb4d"}),o.searchStop=new o("search-stop",{fontCharacter:"\\eb4e"}),o.server=new o("server",{fontCharacter:"\\eb50"}),o.settingsGear=new o("settings-gear",{fontCharacter:"\\eb51"}),o.settings=new o("settings",{fontCharacter:"\\eb52"}),o.shield=new o("shield",{fontCharacter:"\\eb53"}),o.smiley=new o("smiley",{fontCharacter:"\\eb54"}),o.sortPrecedence=new o("sort-precedence",{fontCharacter:"\\eb55"}),o.splitHorizontal=new o("split-horizontal",{fontCharacter:"\\eb56"}),o.splitVertical=new o("split-vertical",{fontCharacter:"\\eb57"}),o.squirrel=new o("squirrel",{fontCharacter:"\\eb58"}),o.starFull=new o("star-full",{fontCharacter:"\\eb59"}),o.starHalf=new o("star-half",{fontCharacter:"\\eb5a"}),o.symbolClass=new o("symbol-class",{fontCharacter:"\\eb5b"}),o.symbolColor=new o("symbol-color",{fontCharacter:"\\eb5c"}),o.symbolConstant=new o("symbol-constant",{fontCharacter:"\\eb5d"}),o.symbolEnumMember=new o("symbol-enum-member",{fontCharacter:"\\eb5e"}),o.symbolField=new o("symbol-field",{fontCharacter:"\\eb5f"}),o.symbolFile=new o("symbol-file",{fontCharacter:"\\eb60"}),o.symbolInterface=new o("symbol-interface",{fontCharacter:"\\eb61"}),o.symbolKeyword=new o("symbol-keyword",{fontCharacter:"\\eb62"}),o.symbolMisc=new o("symbol-misc",{fontCharacter:"\\eb63"}),o.symbolOperator=new o("symbol-operator",{fontCharacter:"\\eb64"}),o.symbolProperty=new o("symbol-property",{fontCharacter:"\\eb65"}),o.wrench=new o("wrench",{fontCharacter:"\\eb65"}),o.wrenchSubaction=new o("wrench-subaction",{fontCharacter:"\\eb65"}),o.symbolSnippet=new o("symbol-snippet",{fontCharacter:"\\eb66"}),o.tasklist=new o("tasklist",{fontCharacter:"\\eb67"}),o.telescope=new o("telescope",{fontCharacter:"\\eb68"}),o.textSize=new o("text-size",{fontCharacter:"\\eb69"}),o.threeBars=new o("three-bars",{fontCharacter:"\\eb6a"}),o.thumbsdown=new o("thumbsdown",{fontCharacter:"\\eb6b"}),o.thumbsup=new o("thumbsup",{fontCharacter:"\\eb6c"}),o.tools=new o("tools",{fontCharacter:"\\eb6d"}),o.triangleDown=new o("triangle-down",{fontCharacter:"\\eb6e"}),o.triangleLeft=new o("triangle-left",{fontCharacter:"\\eb6f"}),o.triangleRight=new o("triangle-right",{fontCharacter:"\\eb70"}),o.triangleUp=new o("triangle-up",{fontCharacter:"\\eb71"}),o.twitter=new o("twitter",{fontCharacter:"\\eb72"}),o.unfold=new o("unfold",{fontCharacter:"\\eb73"}),o.unlock=new o("unlock",{fontCharacter:"\\eb74"}),o.unmute=new o("unmute",{fontCharacter:"\\eb75"}),o.unverified=new o("unverified",{fontCharacter:"\\eb76"}),o.verified=new o("verified",{fontCharacter:"\\eb77"}),o.versions=new o("versions",{fontCharacter:"\\eb78"}),o.vmActive=new o("vm-active",{fontCharacter:"\\eb79"}),o.vmOutline=new o("vm-outline",{fontCharacter:"\\eb7a"}),o.vmRunning=new o("vm-running",{fontCharacter:"\\eb7b"}),o.watch=new o("watch",{fontCharacter:"\\eb7c"}),o.whitespace=new o("whitespace",{fontCharacter:"\\eb7d"}),o.wholeWord=new o("whole-word",{fontCharacter:"\\eb7e"}),o.window=new o("window",{fontCharacter:"\\eb7f"}),o.wordWrap=new o("word-wrap",{fontCharacter:"\\eb80"}),o.zoomIn=new o("zoom-in",{fontCharacter:"\\eb81"}),o.zoomOut=new o("zoom-out",{fontCharacter:"\\eb82"}),o.listFilter=new o("list-filter",{fontCharacter:"\\eb83"}),o.listFlat=new o("list-flat",{fontCharacter:"\\eb84"}),o.listSelection=new o("list-selection",{fontCharacter:"\\eb85"}),o.selection=new o("selection",{fontCharacter:"\\eb85"}),o.listTree=new o("list-tree",{fontCharacter:"\\eb86"}),o.debugBreakpointFunctionUnverified=new o("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),o.debugBreakpointFunction=new o("debug-breakpoint-function",{fontCharacter:"\\eb88"}),o.debugBreakpointFunctionDisabled=new o("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),o.debugStackframeActive=new o("debug-stackframe-active",{fontCharacter:"\\eb89"}),o.debugStackframeDot=new o("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),o.debugStackframe=new o("debug-stackframe",{fontCharacter:"\\eb8b"}),o.debugStackframeFocused=new o("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),o.debugBreakpointUnsupported=new o("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),o.symbolString=new o("symbol-string",{fontCharacter:"\\eb8d"}),o.debugReverseContinue=new o("debug-reverse-continue",{fontCharacter:"\\eb8e"}),o.debugStepBack=new o("debug-step-back",{fontCharacter:"\\eb8f"}),o.debugRestartFrame=new o("debug-restart-frame",{fontCharacter:"\\eb90"}),o.callIncoming=new o("call-incoming",{fontCharacter:"\\eb92"}),o.callOutgoing=new o("call-outgoing",{fontCharacter:"\\eb93"}),o.menu=new o("menu",{fontCharacter:"\\eb94"}),o.expandAll=new o("expand-all",{fontCharacter:"\\eb95"}),o.feedback=new o("feedback",{fontCharacter:"\\eb96"}),o.groupByRefType=new o("group-by-ref-type",{fontCharacter:"\\eb97"}),o.ungroupByRefType=new o("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),o.account=new o("account",{fontCharacter:"\\eb99"}),o.bellDot=new o("bell-dot",{fontCharacter:"\\eb9a"}),o.debugConsole=new o("debug-console",{fontCharacter:"\\eb9b"}),o.library=new o("library",{fontCharacter:"\\eb9c"}),o.output=new o("output",{fontCharacter:"\\eb9d"}),o.runAll=new o("run-all",{fontCharacter:"\\eb9e"}),o.syncIgnored=new o("sync-ignored",{fontCharacter:"\\eb9f"}),o.pinned=new o("pinned",{fontCharacter:"\\eba0"}),o.githubInverted=new o("github-inverted",{fontCharacter:"\\eba1"}),o.debugAlt=new o("debug-alt",{fontCharacter:"\\eb91"}),o.serverProcess=new o("server-process",{fontCharacter:"\\eba2"}),o.serverEnvironment=new o("server-environment",{fontCharacter:"\\eba3"}),o.pass=new o("pass",{fontCharacter:"\\eba4"}),o.stopCircle=new o("stop-circle",{fontCharacter:"\\eba5"}),o.playCircle=new o("play-circle",{fontCharacter:"\\eba6"}),o.record=new o("record",{fontCharacter:"\\eba7"}),o.debugAltSmall=new o("debug-alt-small",{fontCharacter:"\\eba8"}),o.vmConnect=new o("vm-connect",{fontCharacter:"\\eba9"}),o.cloud=new o("cloud",{fontCharacter:"\\ebaa"}),o.merge=new o("merge",{fontCharacter:"\\ebab"}),o.exportIcon=new o("export",{fontCharacter:"\\ebac"}),o.graphLeft=new o("graph-left",{fontCharacter:"\\ebad"}),o.magnet=new o("magnet",{fontCharacter:"\\ebae"}),o.notebook=new o("notebook",{fontCharacter:"\\ebaf"}),o.redo=new o("redo",{fontCharacter:"\\ebb0"}),o.checkAll=new o("check-all",{fontCharacter:"\\ebb1"}),o.pinnedDirty=new o("pinned-dirty",{fontCharacter:"\\ebb2"}),o.passFilled=new o("pass-filled",{fontCharacter:"\\ebb3"}),o.circleLargeFilled=new o("circle-large-filled",{fontCharacter:"\\ebb4"}),o.circleLargeOutline=new o("circle-large-outline",{fontCharacter:"\\ebb5"}),o.combine=new o("combine",{fontCharacter:"\\ebb6"}),o.gather=new o("gather",{fontCharacter:"\\ebb6"}),o.table=new o("table",{fontCharacter:"\\ebb7"}),o.variableGroup=new o("variable-group",{fontCharacter:"\\ebb8"}),o.typeHierarchy=new o("type-hierarchy",{fontCharacter:"\\ebb9"}),o.typeHierarchySub=new o("type-hierarchy-sub",{fontCharacter:"\\ebba"}),o.typeHierarchySuper=new o("type-hierarchy-super",{fontCharacter:"\\ebbb"}),o.gitPullRequestCreate=new o("git-pull-request-create",{fontCharacter:"\\ebbc"}),o.runAbove=new o("run-above",{fontCharacter:"\\ebbd"}),o.runBelow=new o("run-below",{fontCharacter:"\\ebbe"}),o.notebookTemplate=new o("notebook-template",{fontCharacter:"\\ebbf"}),o.debugRerun=new o("debug-rerun",{fontCharacter:"\\ebc0"}),o.workspaceTrusted=new o("workspace-trusted",{fontCharacter:"\\ebc1"}),o.workspaceUntrusted=new o("workspace-untrusted",{fontCharacter:"\\ebc2"}),o.workspaceUnspecified=new o("workspace-unspecified",{fontCharacter:"\\ebc3"}),o.terminalCmd=new o("terminal-cmd",{fontCharacter:"\\ebc4"}),o.terminalDebian=new o("terminal-debian",{fontCharacter:"\\ebc5"}),o.terminalLinux=new o("terminal-linux",{fontCharacter:"\\ebc6"}),o.terminalPowershell=new o("terminal-powershell",{fontCharacter:"\\ebc7"}),o.terminalTmux=new o("terminal-tmux",{fontCharacter:"\\ebc8"}),o.terminalUbuntu=new o("terminal-ubuntu",{fontCharacter:"\\ebc9"}),o.terminalBash=new o("terminal-bash",{fontCharacter:"\\ebca"}),o.arrowSwap=new o("arrow-swap",{fontCharacter:"\\ebcb"}),o.copy=new o("copy",{fontCharacter:"\\ebcc"}),o.personAdd=new o("person-add",{fontCharacter:"\\ebcd"}),o.filterFilled=new o("filter-filled",{fontCharacter:"\\ebce"}),o.wand=new o("wand",{fontCharacter:"\\ebcf"}),o.debugLineByLine=new o("debug-line-by-line",{fontCharacter:"\\ebd0"}),o.inspect=new o("inspect",{fontCharacter:"\\ebd1"}),o.layers=new o("layers",{fontCharacter:"\\ebd2"}),o.layersDot=new o("layers-dot",{fontCharacter:"\\ebd3"}),o.layersActive=new o("layers-active",{fontCharacter:"\\ebd4"}),o.compass=new o("compass",{fontCharacter:"\\ebd5"}),o.compassDot=new o("compass-dot",{fontCharacter:"\\ebd6"}),o.compassActive=new o("compass-active",{fontCharacter:"\\ebd7"}),o.azure=new o("azure",{fontCharacter:"\\ebd8"}),o.issueDraft=new o("issue-draft",{fontCharacter:"\\ebd9"}),o.gitPullRequestClosed=new o("git-pull-request-closed",{fontCharacter:"\\ebda"}),o.gitPullRequestDraft=new o("git-pull-request-draft",{fontCharacter:"\\ebdb"}),o.debugAll=new o("debug-all",{fontCharacter:"\\ebdc"}),o.debugCoverage=new o("debug-coverage",{fontCharacter:"\\ebdd"}),o.runErrors=new o("run-errors",{fontCharacter:"\\ebde"}),o.folderLibrary=new o("folder-library",{fontCharacter:"\\ebdf"}),o.debugContinueSmall=new o("debug-continue-small",{fontCharacter:"\\ebe0"}),o.beakerStop=new o("beaker-stop",{fontCharacter:"\\ebe1"}),o.graphLine=new o("graph-line",{fontCharacter:"\\ebe2"}),o.graphScatter=new o("graph-scatter",{fontCharacter:"\\ebe3"}),o.pieChart=new o("pie-chart",{fontCharacter:"\\ebe4"}),o.bracket=new o("bracket",o.json.definition),o.bracketDot=new o("bracket-dot",{fontCharacter:"\\ebe5"}),o.bracketError=new o("bracket-error",{fontCharacter:"\\ebe6"}),o.lockSmall=new o("lock-small",{fontCharacter:"\\ebe7"}),o.azureDevops=new o("azure-devops",{fontCharacter:"\\ebe8"}),o.verifiedFilled=new o("verified-filled",{fontCharacter:"\\ebe9"})}(ye||(ye={}))},79881:function(Sr,St,Z){"use strict";Z.d(St,{B8:function(){return U},Cp:function(){return ve},F0:function(){return H},L6:function(){return ne},VV:function(){return ye},b1:function(){return o},dL:function(){return Ue},ri:function(){return Y}});class z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(y){setTimeout(()=>{throw y.stack?new Error(y.message+`
`+y.stack):y},0)}}emit(y){this.listeners.forEach(C=>{C(y)})}onUnexpectedError(y){this.unexpectedErrorHandler(y),this.emit(y)}onUnexpectedExternalError(y){this.unexpectedErrorHandler(y)}}const we=new z;function Ue(B){ye(B)||we.onUnexpectedError(B)}function ve(B){ye(B)||we.onUnexpectedExternalError(B)}function Y(B){if(B instanceof Error){let{name:y,message:C}=B;const T=B.stacktrace||B.stack;return{$isError:!0,name:y,message:C,stack:T}}return B}const _="Canceled";function ye(B){return B instanceof Error&&B.name===_&&B.message===_}function H(){const B=new Error(_);return B.name=B.message,B}function o(B){return B?new Error(`Illegal argument: ${B}`):new Error("Illegal argument")}function ne(B){return B?new Error(`Illegal state: ${B}`):new Error("Illegal state")}class U extends Error{constructor(y){super("NotSupported"),y&&(this.message=y)}}},4348:function(Sr,St,Z){"use strict";Z.d(St,{D0:function(){return U},E7:function(){return B},K3:function(){return ne},Q5:function(){return o},ZD:function(){return y},ju:function(){return Y}});var z=Z(79881),we=Z(69323),Ue=Z(34502),ve=Z(95830),Y;(function(C){C.None=()=>we.JT.None;function T(j){return(X,ue=null,ae)=>{let w=!1,b;return b=j($=>{if(!w)return b?b.dispose():w=!0,X.call(ue,$)},null,ae),w&&b.dispose(),b}}C.once=T;function ee(j,X){return me((ue,ae=null,w)=>j(b=>ue.call(ae,X(b)),null,w))}C.map=ee;function G(j,X){return me((ue,ae=null,w)=>j(b=>{X(b),ue.call(ae,b)},null,w))}C.forEach=G;function W(j,X){return me((ue,ae=null,w)=>j(b=>X(b)&&ue.call(ae,b),null,w))}C.filter=W;function k(j){return j}C.signal=k;function K(...j){return(X,ue=null,ae)=>(0,we.F8)(...j.map(w=>w(b=>X.call(ue,b),null,ae)))}C.any=K;function re(j,X,ue){let ae=ue;return ee(j,w=>(ae=X(ae,w),ae))}C.reduce=re;function me(j){let X;const ue=new o({onFirstListenerAdd(){X=j(ue.fire,ue)},onLastListenerRemove(){X.dispose()}});return ue.event}function Ce(j,X,ue=100,ae=!1,w){let b,$,fe,$e=0;const lt=new o({leakWarningThreshold:w,onFirstListenerAdd(){b=j(Rt=>{$e++,$=X($,Rt),ae&&!fe&&(lt.fire($),$=void 0),clearTimeout(fe),fe=setTimeout(()=>{const Ct=$;$=void 0,fe=void 0,(!ae||$e>1)&&lt.fire(Ct),$e=0},ue)})},onLastListenerRemove(){b.dispose()}});return lt.event}C.debounce=Ce;function Ie(j,X=(ue,ae)=>ue===ae){let ue=!0,ae;return W(j,w=>{const b=ue||!X(w,ae);return ue=!1,ae=w,b})}C.latch=Ie;function le(j,X){return[C.filter(j,X),C.filter(j,ue=>!X(ue))]}C.split=le;function xe(j,X=!1,ue=[]){let ae=ue.slice(),w=j(fe=>{ae?ae.push(fe):$.fire(fe)});const b=()=>{ae&&ae.forEach(fe=>$.fire(fe)),ae=null},$=new o({onFirstListenerAdd(){w||(w=j(fe=>$.fire(fe)))},onFirstListenerDidAdd(){ae&&(X?setTimeout(b):b())},onLastListenerRemove(){w&&w.dispose(),w=null}});return $.event}C.buffer=xe;class Ke{constructor(X){this.event=X}map(X){return new Ke(ee(this.event,X))}forEach(X){return new Ke(G(this.event,X))}filter(X){return new Ke(W(this.event,X))}reduce(X,ue){return new Ke(re(this.event,X,ue))}latch(){return new Ke(Ie(this.event))}debounce(X,ue=100,ae=!1,w){return new Ke(Ce(this.event,X,ue,ae,w))}on(X,ue,ae){return this.event(X,ue,ae)}once(X,ue,ae){return T(this.event)(X,ue,ae)}}function ge(j){return new Ke(j)}C.chain=ge;function Ze(j,X,ue=ae=>ae){const ae=(...fe)=>$.fire(ue(...fe)),w=()=>j.on(X,ae),b=()=>j.removeListener(X,ae),$=new o({onFirstListenerAdd:w,onLastListenerRemove:b});return $.event}C.fromNodeEventEmitter=Ze;function q(j,X,ue=ae=>ae){const ae=(...fe)=>$.fire(ue(...fe)),w=()=>j.addEventListener(X,ae),b=()=>j.removeEventListener(X,ae),$=new o({onFirstListenerAdd:w,onLastListenerRemove:b});return $.event}C.fromDOMEventEmitter=q;function L(j){return new Promise(X=>T(j)(X))}C.toPromise=L})(Y||(Y={}));class _{constructor(T){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${T}_${_._idPool++}`}start(T){this._stopWatch=new ve.G(!0),this._listenerCount=T}stop(){if(this._stopWatch){const T=this._stopWatch.elapsed();this._elapsedOverall+=T,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${T.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}_._idPool=0;let ye=-1;class H{constructor(T,ee=Math.random().toString(18).slice(2,5)){this.customThreshold=T,this.name=ee,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(T){let ee=ye;if(typeof this.customThreshold=="number"&&(ee=this.customThreshold),ee<=0||T<ee)return;this._stacks||(this._stacks=new Map);const G=new Error().stack.split(`
`).slice(3).join(`
`),W=this._stacks.get(G)||0;if(this._stacks.set(G,W+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=ee*.5;let k,K=0;for(const[re,me]of this._stacks)(!k||K<me)&&(k=re,K=me);console.warn(`[${this.name}] potential listener LEAK detected, having ${T} listeners already. MOST frequent listener (${K}):`),console.warn(k)}return()=>{const k=this._stacks.get(G)||0;this._stacks.set(G,k-1)}}}class o{constructor(T){var ee;this._disposed=!1,this._options=T,this._leakageMon=ye>0?new H(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((ee=this._options)===null||ee===void 0)&&ee._profName?new _(this._options._profName):void 0}get event(){return this._event||(this._event=(T,ee,G)=>{var W;this._listeners||(this._listeners=new Ue.S);const k=this._listeners.isEmpty();k&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const K=this._listeners.push(ee?[T,ee]:T);k&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,T,ee);const re=(W=this._leakageMon)===null||W===void 0?void 0:W.check(this._listeners.size),me=(0,we.OF)(()=>{re&&re(),this._disposed||(K(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return G instanceof we.SL?G.add(me):Array.isArray(G)&&G.push(me),me}),this._event}fire(T){var ee,G;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Ue.S);for(let W of this._listeners)this._deliveryQueue.push([W,T]);for((ee=this._perfMon)===null||ee===void 0||ee.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[W,k]=this._deliveryQueue.shift();try{typeof W=="function"?W.call(void 0,k):W[0].call(W[1],k)}catch(K){(0,z.dL)(K)}}(G=this._perfMon)===null||G===void 0||G.stop()}}dispose(){var T,ee,G,W,k;this._disposed||(this._disposed=!0,(T=this._listeners)===null||T===void 0||T.clear(),(ee=this._deliveryQueue)===null||ee===void 0||ee.clear(),(W=(G=this._options)===null||G===void 0?void 0:G.onLastListenerRemove)===null||W===void 0||W.call(G),(k=this._leakageMon)===null||k===void 0||k.dispose())}}class ne extends o{constructor(T){super(T),this._isPaused=0,this._eventQueue=new Ue.S,this._mergeFn=T==null?void 0:T.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const T=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(T))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(T){this._listeners&&(this._isPaused!==0?this._eventQueue.push(T):super.fire(T))}}class U extends ne{constructor(T){var ee;super(T),this._delay=(ee=T.delay)!==null&&ee!==void 0?ee:100}fire(T){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(T)}}class B{constructor(){this.buffers=[]}wrapEvent(T){return(ee,G,W)=>T(k=>{const K=this.buffers[this.buffers.length-1];K?K.push(()=>ee.call(G,k)):ee.call(G,k)},void 0,W)}bufferEvents(T){const ee=[];this.buffers.push(ee);const G=T();return this.buffers.pop(),ee.forEach(W=>W()),G}}class y{constructor(){this.listening=!1,this.inputEvent=Y.None,this.inputEventListener=we.JT.None,this.emitter=new o({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(T){this.inputEvent=T,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=T(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(Sr,St,Z){"use strict";Z.d(St,{I:function(){return z}});function z(we){const Ue=this;let ve=!1,Y;return function(){return ve||(ve=!0,Y=we.apply(Ue,arguments)),Y}}},88226:function(Sr,St,Z){"use strict";Z.d(St,{$:function(){return z}});var z;(function(we){function Ue(K){return K&&typeof K=="object"&&typeof K[Symbol.iterator]=="function"}we.is=Ue;const ve=Object.freeze([]);function Y(){return ve}we.empty=Y;function*_(K){yield K}we.single=_;function ye(K){return K||ve}we.from=ye;function H(K){return!K||K[Symbol.iterator]().next().done===!0}we.isEmpty=H;function o(K){return K[Symbol.iterator]().next().value}we.first=o;function ne(K,re){for(const me of K)if(re(me))return!0;return!1}we.some=ne;function U(K,re){for(const me of K)if(re(me))return me}we.find=U;function*B(K,re){for(const me of K)re(me)&&(yield me)}we.filter=B;function*y(K,re){let me=0;for(const Ce of K)yield re(Ce,me++)}we.map=y;function*C(...K){for(const re of K)for(const me of re)yield me}we.concat=C;function*T(K){for(const re of K)for(const me of re)yield me}we.concatNested=T;function ee(K,re,me){let Ce=me;for(const Ie of K)Ce=re(Ce,Ie);return Ce}we.reduce=ee;function*G(K,re,me=K.length){for(re<0&&(re+=K.length),me<0?me+=K.length:me>K.length&&(me=K.length);re<me;re++)yield K[re]}we.slice=G;function W(K,re=Number.POSITIVE_INFINITY){const me=[];if(re===0)return[me,K];const Ce=K[Symbol.iterator]();for(let Ie=0;Ie<re;Ie++){const le=Ce.next();if(le.done)return[me,we.empty()];me.push(le.value)}return[me,{[Symbol.iterator](){return Ce}}]}we.consume=W;function k(K,re,me=(Ce,Ie)=>Ce===Ie){const Ce=K[Symbol.iterator](),Ie=re[Symbol.iterator]();for(;;){const le=Ce.next(),xe=Ie.next();if(le.done!==xe.done)return!1;if(le.done)return!0;if(!me(le.value,xe.value))return!1}}we.equals=k})(z||(z={}))},69323:function(Sr,St,Z){"use strict";Z.d(St,{B9:function(){return y},F8:function(){return C},JT:function(){return G},Jz:function(){return k},OF:function(){return T},SL:function(){return ee},Wf:function(){return B},XK:function(){return W},dk:function(){return ne}});var z=Z(17845),we=Z(88226);const Ue=!1;let ve=null;function Y(K){ve=K}if(Ue){const K="__is_disposable_tracked__";Y(new class{trackDisposable(re){const me=new Error("Potentially leaked disposable").stack;setTimeout(()=>{re[K]||console.log(me)},3e3)}setParent(re,me){if(re&&re!==G.None)try{re[K]=!0}catch(Ce){}}markAsDisposed(re){if(re&&re!==G.None)try{re[K]=!0}catch(me){}}markAsSingleton(re){}})}function _(K){return ve==null||ve.trackDisposable(K),K}function ye(K){ve==null||ve.markAsDisposed(K)}function H(K,re){ve==null||ve.setParent(K,re)}function o(K,re){if(ve)for(const me of K)ve.setParent(me,re)}function ne(K){return ve==null||ve.markAsSingleton(K),K}class U extends Error{constructor(re){super(`Encountered errors while disposing of store. Errors: [${re.join(", ")}]`),this.errors=re}}function B(K){return typeof K.dispose=="function"&&K.dispose.length===0}function y(K){if(we.$.is(K)){let re=[];for(const me of K)if(me)try{me.dispose()}catch(Ce){re.push(Ce)}if(re.length===1)throw re[0];if(re.length>1)throw new U(re);return Array.isArray(K)?[]:K}else if(K)return K.dispose(),K}function C(...K){const re=T(()=>y(K));return o(K,re),re}function T(K){const re=_({dispose:(0,z.I)(()=>{ye(re),K()})});return re}class ee{constructor(){this._toDispose=new Set,this._isDisposed=!1,_(this)}dispose(){this._isDisposed||(ye(this),this._isDisposed=!0,this.clear())}clear(){try{y(this._toDispose.values())}finally{this._toDispose.clear()}}add(re){if(!re)return re;if(re===this)throw new Error("Cannot register a disposable on itself!");return H(re,this),this._isDisposed?ee.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(re),re}}ee.DISABLE_DISPOSED_WARNING=!1;class G{constructor(){this._store=new ee,_(this),H(this._store,this)}dispose(){ye(this),this._store.dispose()}_register(re){if(re===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(re)}}G.None=Object.freeze({dispose(){}});class W{constructor(){this._isDisposed=!1,_(this)}get value(){return this._isDisposed?void 0:this._value}set value(re){var me;this._isDisposed||re===this._value||((me=this._value)===null||me===void 0||me.dispose(),re&&H(re,this),this._value=re)}clear(){this.value=void 0}dispose(){var re;this._isDisposed=!0,ye(this),(re=this._value)===null||re===void 0||re.dispose(),this._value=void 0}clearAndLeak(){const re=this._value;return this._value=void 0,re&&H(re,null),re}}class k{constructor(re){this.object=re}dispose(){}}},34502:function(Sr,St,Z){"use strict";Z.d(St,{S:function(){return we}});class z{constructor(ve){this.element=ve,this.next=z.Undefined,this.prev=z.Undefined}}z.Undefined=new z(void 0);class we{constructor(){this._first=z.Undefined,this._last=z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===z.Undefined}clear(){let ve=this._first;for(;ve!==z.Undefined;){const Y=ve.next;ve.prev=z.Undefined,ve.next=z.Undefined,ve=Y}this._first=z.Undefined,this._last=z.Undefined,this._size=0}unshift(ve){return this._insert(ve,!1)}push(ve){return this._insert(ve,!0)}_insert(ve,Y){const _=new z(ve);if(this._first===z.Undefined)this._first=_,this._last=_;else if(Y){const H=this._last;this._last=_,_.prev=H,H.next=_}else{const H=this._first;this._first=_,_.next=H,H.prev=_}this._size+=1;let ye=!1;return()=>{ye||(ye=!0,this._remove(_))}}shift(){if(this._first!==z.Undefined){const ve=this._first.element;return this._remove(this._first),ve}}pop(){if(this._last!==z.Undefined){const ve=this._last.element;return this._remove(this._last),ve}}_remove(ve){if(ve.prev!==z.Undefined&&ve.next!==z.Undefined){const Y=ve.prev;Y.next=ve.next,ve.next.prev=Y}else ve.prev===z.Undefined&&ve.next===z.Undefined?(this._first=z.Undefined,this._last=z.Undefined):ve.next===z.Undefined?(this._last=this._last.prev,this._last.next=z.Undefined):ve.prev===z.Undefined&&(this._first=this._first.next,this._first.prev=z.Undefined);this._size-=1}*[Symbol.iterator](){let ve=this._first;for(;ve!==z.Undefined;)yield ve.element,ve=ve.next}}},23345:function(Sr,St,Z){"use strict";Z.d(St,{$L:function(){return Ce},ED:function(){return k},IJ:function(){return re},OS:function(){return Ke},WE:function(){return le},dz:function(){return K},gn:function(){return Ie},li:function(){return T},r:function(){return q},tY:function(){return me},xS:function(){return xe}});var z=Z(97671),we;const Ue="en";let ve=!1,Y=!1,_=!1,ye=!1,H=!1,o=!1,ne=!1,U,B=null,y=null,C;const T=typeof self=="object"?self:typeof Z.g=="object"?Z.g:{};let ee;typeof T.vscode!="undefined"&&typeof T.vscode.process!="undefined"?ee=T.vscode.process:typeof z!="undefined"&&(ee=z);const G=typeof((we=ee==null?void 0:ee.versions)===null||we===void 0?void 0:we.electron)=="string"&&ee.type==="renderer";if(typeof navigator=="object"&&!G)C=navigator.userAgent,ve=C.indexOf("Windows")>=0,Y=C.indexOf("Macintosh")>=0,ne=(C.indexOf("Macintosh")>=0||C.indexOf("iPad")>=0||C.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_=C.indexOf("Linux")>=0,o=!0,U=navigator.language,B=U;else if(typeof ee=="object"){ve=ee.platform==="win32",Y=ee.platform==="darwin",_=ee.platform==="linux",ye=_&&!!ee.env.SNAP&&!!ee.env.SNAP_REVISION,U=Ue,B=Ue;const L=ee.env.VSCODE_NLS_CONFIG;if(L)try{const j=JSON.parse(L),X=j.availableLanguages["*"];U=j.locale,B=X||Ue,y=j._translationsConfigFile}catch(j){}H=!0}else console.error("Unable to resolve platform.");let W=0;Y?W=1:ve?W=3:_&&(W=2);const k=ve,K=Y,re=_,me=H,Ce=o,Ie=ne,le=C,xe=function(){if(T.setImmediate)return T.setImmediate.bind(T);if(typeof T.postMessage=="function"&&!T.importScripts){let X=[];T.addEventListener("message",ae=>{if(ae.data&&ae.data.vscodeSetImmediateId)for(let w=0,b=X.length;w<b;w++){const $=X[w];if($.id===ae.data.vscodeSetImmediateId){X.splice(w,1),$.callback();return}}});let ue=0;return ae=>{const w=++ue;X.push({id:w,callback:ae}),T.postMessage({vscodeSetImmediateId:w},"*")}}if(typeof(ee==null?void 0:ee.nextTick)=="function")return ee.nextTick.bind(ee);const j=Promise.resolve();return X=>j.then(X)}(),Ke=Y||ne?2:ve?1:3;let ge=!0,Ze=!1;function q(){if(!Ze){Ze=!0;const L=new Uint8Array(2);L[0]=1,L[1]=2,ge=new Uint16Array(L.buffer)[0]===513}return ge}},95830:function(Sr,St,Z){"use strict";Z.d(St,{G:function(){return Ue}});var z=Z(23345);const we=z.li.performance&&typeof z.li.performance.now=="function";class Ue{constructor(Y){this._highResolution=we&&Y,this._startTime=this._now(),this._stopTime=-1}static create(Y=!0){return new Ue(Y)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?z.li.performance.now():Date.now()}}},82983:function(Sr,St,Z){"use strict";Z.d(St,{$i:function(){return $e},C8:function(){return Qt},GF:function(){return U},HO:function(){return ue},IO:function(){return B},K7:function(){return Vt},Kw:function(){return nt},LC:function(){return T},Mh:function(){return xe},P1:function(){return Ke},PJ:function(){return it},Qe:function(){return lt},R1:function(){return ne},RP:function(){return $},S6:function(){return At},TT:function(){return k},Ut:function(){return w},V8:function(){return ee},WU:function(){return Ue},YK:function(){return Ze},YU:function(){return ve},ZG:function(){return ge},ZH:function(){return L},ab:function(){return Rt},c1:function(){return bt},df:function(){return Ce},ec:function(){return Y},fi:function(){return Ht},fy:function(){return _},j3:function(){return ye},j_:function(){return re},m5:function(){return z},mK:function(){return me},mr:function(){return y},oH:function(){return m},oL:function(){return H},ok:function(){return le},ow:function(){return G},qq:function(){return Ie},qu:function(){return W},rL:function(){return q},uS:function(){return He},un:function(){return o},uq:function(){return C},vH:function(){return X},xe:function(){return Ct},zY:function(){return K}});function z(N){return!N||typeof N!="string"?!0:N.trim().length===0}const we=/{(\d+)}/g;function Ue(N,...Ae){return Ae.length===0?N:N.replace(we,function(Le,Me){const Xe=parseInt(Me,10);return isNaN(Xe)||Xe<0||Xe>=Ae.length?Le:Ae[Xe]})}function ve(N){return N.replace(/[<>&]/g,function(Ae){switch(Ae){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Ae}})}function Y(N){return N.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function _(N,Ae=" "){const Le=ye(N,Ae);return H(Le,Ae)}function ye(N,Ae){if(!N||!Ae)return N;const Le=Ae.length;if(Le===0||N.length===0)return N;let Me=0;for(;N.indexOf(Ae,Me)===Me;)Me=Me+Le;return N.substring(Me)}function H(N,Ae){if(!N||!Ae)return N;const Le=Ae.length,Me=N.length;if(Le===0||Me===0)return N;let Xe=Me,qe=-1;for(;qe=N.lastIndexOf(Ae,Xe-1),!(qe===-1||qe+Le!==Xe);){if(qe===0)return"";Xe=qe}return N.substring(0,Xe)}function o(N){return N.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function ne(N){return N.replace(/\*/g,"")}function U(N,Ae,Le={}){if(!N)throw new Error("Cannot create regex from empty string");Ae||(N=Y(N)),Le.wholeWord&&(/\B/.test(N.charAt(0))||(N="\\b"+N),/\B/.test(N.charAt(N.length-1))||(N=N+"\\b"));let Me="";return Le.global&&(Me+="g"),Le.matchCase||(Me+="i"),Le.multiline&&(Me+="m"),Le.unicode&&(Me+="u"),new RegExp(N,Me)}function B(N){return N.source==="^"||N.source==="^$"||N.source==="$"||N.source==="^\\s*$"?!1:!!(N.exec("")&&N.lastIndex===0)}function y(N){return(N.global?"g":"")+(N.ignoreCase?"i":"")+(N.multiline?"m":"")+(N.unicode?"u":"")}function C(N){return N.split(/\r\n|\r|\n/)}function T(N){for(let Ae=0,Le=N.length;Ae<Le;Ae++){const Me=N.charCodeAt(Ae);if(Me!==32&&Me!==9)return Ae}return-1}function ee(N,Ae=0,Le=N.length){for(let Me=Ae;Me<Le;Me++){const Xe=N.charCodeAt(Me);if(Xe!==32&&Xe!==9)return N.substring(Ae,Me)}return N.substring(Ae,Le)}function G(N,Ae=N.length-1){for(let Le=Ae;Le>=0;Le--){const Me=N.charCodeAt(Le);if(Me!==32&&Me!==9)return Le}return-1}function W(N,Ae){return N<Ae?-1:N>Ae?1:0}function k(N,Ae,Le=0,Me=N.length,Xe=0,qe=Ae.length){for(;Le<Me&&Xe<qe;Le++,Xe++){let Bt=N.charCodeAt(Le),ut=Ae.charCodeAt(Xe);if(Bt<ut)return-1;if(Bt>ut)return 1}const Pt=Me-Le,ot=qe-Xe;return Pt<ot?-1:Pt>ot?1:0}function K(N,Ae){return re(N,Ae,0,N.length,0,Ae.length)}function re(N,Ae,Le=0,Me=N.length,Xe=0,qe=Ae.length){for(;Le<Me&&Xe<qe;Le++,Xe++){let Bt=N.charCodeAt(Le),ut=Ae.charCodeAt(Xe);if(Bt===ut)continue;if(Bt>=128||ut>=128)return k(N.toLowerCase(),Ae.toLowerCase(),Le,Me,Xe,qe);me(Bt)&&(Bt-=32),me(ut)&&(ut-=32);const gt=Bt-ut;if(gt!==0)return gt}const Pt=Me-Le,ot=qe-Xe;return Pt<ot?-1:Pt>ot?1:0}function me(N){return N>=97&&N<=122}function Ce(N){return N>=65&&N<=90}function Ie(N,Ae){return N.length===Ae.length&&re(N,Ae)===0}function le(N,Ae){const Le=Ae.length;return Ae.length>N.length?!1:re(N,Ae,0,Le)===0}function xe(N,Ae){let Le,Me=Math.min(N.length,Ae.length);for(Le=0;Le<Me;Le++)if(N.charCodeAt(Le)!==Ae.charCodeAt(Le))return Le;return Me}function Ke(N,Ae){let Le,Me=Math.min(N.length,Ae.length);const Xe=N.length-1,qe=Ae.length-1;for(Le=0;Le<Me;Le++)if(N.charCodeAt(Xe-Le)!==Ae.charCodeAt(qe-Le))return Le;return Me}function ge(N){return 55296<=N&&N<=56319}function Ze(N){return 56320<=N&&N<=57343}function q(N,Ae){return(N-55296<<10)+(Ae-56320)+65536}function L(N,Ae,Le){const Me=N.charCodeAt(Le);if(ge(Me)&&Le+1<Ae){const Xe=N.charCodeAt(Le+1);if(Ze(Xe))return q(Me,Xe)}return Me}function j(N,Ae){const Le=N.charCodeAt(Ae-1);if(Ze(Le)&&Ae>1){const Me=N.charCodeAt(Ae-2);if(ge(Me))return q(Me,Le)}return Le}function X(N,Ae){const Le=Fe.getInstance(),Me=Ae,Xe=N.length,qe=L(N,Xe,Ae);Ae+=qe>=65536?2:1;let Pt=Le.getGraphemeBreakType(qe);for(;Ae<Xe;){const ot=L(N,Xe,Ae),Bt=Le.getGraphemeBreakType(ot);if(Ht(Pt,Bt))break;Ae+=ot>=65536?2:1,Pt=Bt}return Ae-Me}function ue(N,Ae){const Le=Fe.getInstance(),Me=Ae,Xe=j(N,Ae);Ae-=Xe>=65536?2:1;let qe=Le.getGraphemeBreakType(Xe);for(;Ae>0;){const Pt=j(N,Ae),ot=Le.getGraphemeBreakType(Pt);if(Ht(ot,qe))break;Ae-=Pt>=65536?2:1,qe=ot}return Me-Ae}const ae=/(?:[\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(N){return ae.test(N)}const b=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function $(N){return b.test(N)}const fe=/^[\t\n\r\x20-\x7E]*$/;function $e(N){return fe.test(N)}const lt=/[\u2028\u2029]/;function Rt(N){return lt.test(N)}function Ct(N){for(let Ae=0,Le=N.length;Ae<Le;Ae++)if(Vt(N.charCodeAt(Ae)))return!0;return!1}function Vt(N){return N=+N,N>=11904&&N<=55215||N>=63744&&N<=64255||N>=65281&&N<=65374}function Qt(N){return N>=127462&&N<=127487||N===8986||N===8987||N===9200||N===9203||N>=9728&&N<=10175||N===11088||N===11093||N>=127744&&N<=128591||N>=128640&&N<=128764||N>=128992&&N<=129003||N>=129280&&N<=129535||N>=129648&&N<=129750}const bt="\uFEFF";function He(N){return!!(N&&N.length>0&&N.charCodeAt(0)===65279)}function nt(N,Ae=!1){return N?(Ae&&(N=N.replace(/\\./g,"")),N.toLowerCase()!==N):!1}function it(N){return N=N%(2*26),N<26?String.fromCharCode(97+N):String.fromCharCode(65+N-26)}function At(N){return Fe.getInstance().getGraphemeBreakType(N)}function Ht(N,Ae){return N===0?Ae!==5&&Ae!==7:N===2&&Ae===3?!1:N===4||N===2||N===3||Ae===4||Ae===2||Ae===3?!0:!(N===8&&(Ae===8||Ae===9||Ae===11||Ae===12)||(N===11||N===9)&&(Ae===9||Ae===10)||(N===12||N===10)&&Ae===10||Ae===5||Ae===13||Ae===7||N===1||N===13&&Ae===14||N===6&&Ae===6)}class Fe{constructor(){this._data=R()}static getInstance(){return Fe._INSTANCE||(Fe._INSTANCE=new Fe),Fe._INSTANCE}getGraphemeBreakType(Ae){if(Ae<32)return Ae===10?3:Ae===13?2:4;if(Ae<127)return 0;const Le=this._data,Me=Le.length/3;let Xe=1;for(;Xe<=Me;)if(Ae<Le[3*Xe])Xe=2*Xe;else if(Ae>Le[3*Xe+1])Xe=2*Xe+1;else return Le[3*Xe+2];return 0}}Fe._INSTANCE=null;function R(){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 m(N,Ae){if(N===0)return 0;const Le=F(N,Ae);if(Le!==void 0)return Le;const Me=j(Ae,N);return N-=V(Me),N}function F(N,Ae){let Le=j(Ae,N);for(N-=V(Le);D(Le)||Le===65039||Le===8419;){if(N===0)return;Le=j(Ae,N),N-=V(Le)}if(Qt(Le)){if(N>=0){const Me=j(Ae,N);Me===8205&&(N-=V(Me))}return N}}function V(N){return N>=65536?2:1}function D(N){return 127995<=N&&N<=127999}},72999:function(Sr,St,Z){"use strict";Z.d(St,{$E:function(){return T},$K:function(){return ye},D8:function(){return B},HD:function(){return we},IU:function(){return ee},Jp:function(){return H},Kn:function(){return Ue},cW:function(){return ne},f6:function(){return G},hj:function(){return ve},jn:function(){return Y},kJ:function(){return z},mf:function(){return U},o8:function(){return _},p_:function(){return o},vE:function(){return W}});function z(k){return Array.isArray(k)}function we(k){return typeof k=="string"}function Ue(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)&&!(k instanceof RegExp)&&!(k instanceof Date)}function ve(k){return typeof k=="number"&&!isNaN(k)}function Y(k){return k===!0||k===!1}function _(k){return typeof k=="undefined"}function ye(k){return!H(k)}function H(k){return _(k)||k===null}function o(k,K){if(!k)throw new Error(K?`Unexpected type, expected '${K}'`:"Unexpected type")}function ne(k){if(H(k))throw new Error("Assertion Failed: argument is undefined or null");return k}function U(k){return typeof k=="function"}function B(k,K){const re=Math.min(k.length,K.length);for(let me=0;me<re;me++)y(k[me],K[me])}function y(k,K){if(we(K)){if(typeof k!==K)throw new Error(`argument does not match constraint: typeof ${K}`)}else if(U(K)){try{if(k instanceof K)return}catch(re){}if(!H(k)&&k.constructor===K||K.length===1&&K.call(void 0,k)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function C(k){let K=[],re=Object.getPrototypeOf(k);for(;Object.prototype!==re;)K=K.concat(Object.getOwnPropertyNames(re)),re=Object.getPrototypeOf(re);return K}function T(k){const K=[];for(const re of C(k))typeof k[re]=="function"&&K.push(re);return K}function ee(k,K){const re=Ce=>function(){const Ie=Array.prototype.slice.call(arguments,0);return K(Ce,Ie)};let me={};for(const Ce of k)me[Ce]=re(Ce);return me}function G(k){return k===null?void 0:k}function W(k,K="Unreachable"){throw new Error(K)}},13268:function(Sr,St,Z){"use strict";Z.d(St,{N:function(){return we}});function z(Ue,ve){let Y;return ve.length===0?Y=Ue:Y=Ue.replace(/\{(\d+)\}/g,function(_,ye){const H=ye[0];return typeof ve[H]!="undefined"?ve[H]:_}),Y}function we(Ue,ve,...Y){return z(ve,Y)}},96236:function(Sr,St,Z){"use strict";Z.d(St,{BH:function(){return ee},NZ:function(){return G},U8:function(){return W},co:function(){return T},eH:function(){return C},vr:function(){return y}});var z=Z(75918),we=Z(52615),Ue=Z(4348),ve=Z(88226),Y=Z(69323),_=Z(34502),ye=Z(35884),H=Z(90689),o=Z(16925),ne=Z(49055),U=function(k,K,re,me){var Ce=arguments.length,Ie=Ce<3?K:me===null?me=Object.getOwnPropertyDescriptor(K,re):me,le;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Ie=Reflect.decorate(k,K,re,me);else for(var xe=k.length-1;xe>=0;xe--)(le=k[xe])&&(Ie=(Ce<3?le(Ie):Ce>3?le(K,re,Ie):le(K,re))||Ie);return Ce>3&&Ie&&Object.defineProperty(K,re,Ie),Ie},B=function(k,K){return function(re,me){K(re,me,k)}};function y(k){return k.command!==void 0}class C{constructor(K){this.id=C._idPool++,this._debugName=K}}C._idPool=0,C.CommandPalette=new C("CommandPalette"),C.EditorContext=new C("EditorContext"),C.SimpleEditorContext=new C("SimpleEditorContext"),C.EditorContextCopy=new C("EditorContextCopy"),C.EditorContextPeek=new C("EditorContextPeek"),C.MenubarEditMenu=new C("MenubarEditMenu"),C.MenubarCopy=new C("MenubarCopy"),C.MenubarGoMenu=new C("MenubarGoMenu"),C.MenubarSelectionMenu=new C("MenubarSelectionMenu"),C.InlineCompletionsActions=new C("InlineCompletionsActions");const T=(0,o.yh)("menuService"),ee=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ue.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:k=>k===C.CommandPalette}}addCommand(k){return this.addCommands(ve.$.single(k))}addCommands(k){for(const K of k)this._commands.set(K.id,K);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,Y.OF)(()=>{let K=!1;for(const re of k)K=this._commands.delete(re.id)||K;K&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(k){return this._commands.get(k)}getCommands(){const k=new Map;return this._commands.forEach((K,re)=>k.set(re,K)),k}appendMenuItem(k,K){return this.appendMenuItems(ve.$.single({id:k,item:K}))}appendMenuItems(k){const K=new Set,re=new _.S;for(const{id:me,item:Ce}of k){let Ie=this._menuItems.get(me);Ie||(Ie=new _.S,this._menuItems.set(me,Ie)),re.push(Ie.push(Ce)),K.add(me)}return this._onDidChangeMenu.fire(K),(0,Y.OF)(()=>{if(re.size>0){for(let me of re)me();this._onDidChangeMenu.fire(K),re.clear()}})}getMenuItems(k){let K;return this._menuItems.has(k)?K=[...this._menuItems.get(k)]:K=[],k===C.CommandPalette&&this._appendImplicitItems(K),K}_appendImplicitItems(k){const K=new Set;for(const re of k)y(re)&&(K.add(re.command.id),re.alt&&K.add(re.alt.id));this._commands.forEach((re,me)=>{K.has(me)||k.push({command:re})})}};class G extends z.wY{constructor(K,re,me,Ce){super(`submenuitem.${K.submenu.id}`,typeof K.title=="string"?K.title:K.title.value,[],"submenu"),this.item=K,this._menuService=re,this._contextKeyService=me,this._options=Ce}get actions(){const K=[],re=this._menuService.createMenu(this.item.submenu,this._contextKeyService),me=re.getActions(this._options);re.dispose();for(const[,Ce]of me)Ce.length>0&&(K.push(...Ce),K.push(new z.Z0));return K.length&&K.pop(),K}}let W=class wc{constructor(K,re,me,Ce,Ie){var le,xe;if(this._commandService=Ie,this.id=K.id,this.label=me!=null&&me.renderShortTitle&&K.shortTitle?typeof K.shortTitle=="string"?K.shortTitle:K.shortTitle.value:typeof K.title=="string"?K.title:K.title.value,this.tooltip=(xe=typeof K.tooltip=="string"?K.tooltip:(le=K.tooltip)===null||le===void 0?void 0:le.value)!==null&&xe!==void 0?xe:"",this.enabled=!K.precondition||Ce.contextMatchesRules(K.precondition),this.checked=void 0,K.toggled){const Ke=K.toggled.condition?K.toggled:{condition:K.toggled};this.checked=Ce.contextMatchesRules(Ke.condition),this.checked&&Ke.tooltip&&(this.tooltip=typeof Ke.tooltip=="string"?Ke.tooltip:Ke.tooltip.value),Ke.title&&(this.label=typeof Ke.title=="string"?Ke.title:Ke.title.value)}this.item=K,this.alt=re?new wc(re,void 0,me,Ce,Ie):void 0,this._options=me,ne.kS.isThemeIcon(K.icon)&&(this.class=we.dT.asClassName(K.icon))}dispose(){}run(...K){var re,me;let Ce=[];return!((re=this._options)===null||re===void 0)&&re.arg&&(Ce=[...Ce,this._options.arg]),!((me=this._options)===null||me===void 0)&&me.shouldForwardArgs&&(Ce=[...Ce,...K]),this._commandService.executeCommand(this.id,...Ce)}};W=U([B(3,H.i6),B(4,ye.H)],W)},35884:function(Sr,St,Z){"use strict";Z.d(St,{H:function(){return ye},P:function(){return H}});var z=Z(4348),we=Z(88226),Ue=Z(69323),ve=Z(34502),Y=Z(72999),_=Z(16925);const ye=(0,_.yh)("commandService"),H=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new z.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,ne){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!ne)throw new Error("invalid command");return this.registerCommand({id:o,handler:ne})}if(o.description){const T=[];for(let G of o.description.args)T.push(G.constraint);const ee=o.handler;o.handler=function(G,...W){return(0,Y.D8)(W,T),ee(G,...W)}}const{id:U}=o;let B=this._commands.get(U);B||(B=new ve.S,this._commands.set(U,B));let y=B.unshift(o),C=(0,Ue.OF)(()=>{y();const T=this._commands.get(U);T!=null&&T.isEmpty()&&this._commands.delete(U)});return this._onDidRegisterCommand.fire(U),C}registerCommandAlias(o,ne){return H.registerCommand(o,(U,...B)=>U.get(ye).executeCommand(ne,...B))}getCommand(o){const ne=this._commands.get(o);if(!(!ne||ne.isEmpty()))return we.$.first(ne)}getCommands(){const o=new Map;for(const ne of this._commands.keys()){const U=this.getCommand(ne);U&&o.set(ne,U)}return o}};H.registerCommand("noop",()=>{})},90689:function(Sr,St,Z){"use strict";Z.d(St,{Ao:function(){return ye},Eq:function(){return q},Fb:function(){return H},K8:function(){return X},i6:function(){return Ze},uy:function(){return ge}});var z=Z(23345),we=Z(82983),Ue=Z(16925);let ve=z.WE||"";const Y=new Map;Y.set("false",!1),Y.set("true",!0),Y.set("isMac",z.dz),Y.set("isLinux",z.IJ),Y.set("isWindows",z.ED),Y.set("isWeb",z.$L),Y.set("isMacNative",z.dz&&!z.$L),Y.set("isEdge",ve.indexOf("Edg/")>=0),Y.set("isFirefox",ve.indexOf("Firefox")>=0),Y.set("isChrome",ve.indexOf("Chrome")>=0),Y.set("isSafari",ve.indexOf("Safari")>=0);const _=Object.prototype.hasOwnProperty;class ye{static has(w){return B.create(w)}static equals(w,b){return y.create(w,b)}static regex(w,b){return Ce.create(w,b)}static not(w){return G.create(w)}static and(...w){return xe.create(w,null)}static or(...w){return Ke.create(w,null,!0)}static deserialize(w,b=!1){if(w)return this._deserializeOrExpression(w,b)}static _deserializeOrExpression(w,b){let $=w.split("||");return Ke.create($.map(fe=>this._deserializeAndExpression(fe,b)),null,!0)}static _deserializeAndExpression(w,b){let $=w.split("&&");return xe.create($.map(fe=>this._deserializeOne(fe,b)),null)}static _deserializeOne(w,b){if(w=w.trim(),w.indexOf("!=")>=0){let $=w.split("!=");return ee.create($[0].trim(),this._deserializeValue($[1],b))}if(w.indexOf("==")>=0){let $=w.split("==");return y.create($[0].trim(),this._deserializeValue($[1],b))}if(w.indexOf("=~")>=0){let $=w.split("=~");return Ce.create($[0].trim(),this._deserializeRegexValue($[1],b))}if(w.indexOf(" in ")>=0){let $=w.split(" in ");return C.create($[0].trim(),$[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(w)){const $=w.split(">=");return K.create($[0].trim(),$[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(w)){const $=w.split(">");return k.create($[0].trim(),$[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(w)){const $=w.split("<=");return me.create($[0].trim(),$[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(w)){const $=w.split("<");return re.create($[0].trim(),$[1].trim())}return/^\!\s*/.test(w)?G.create(w.substr(1).trim()):B.create(w)}static _deserializeValue(w,b){if(w=w.trim(),w==="true")return!0;if(w==="false")return!1;let $=/^'([^']*)'$/.exec(w);return $?$[1].trim():w}static _deserializeRegexValue(w,b){if((0,we.m5)(w)){if(b)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let $=w.indexOf("/"),fe=w.lastIndexOf("/");if($===fe||$<0){if(b)throw new Error(`bad regexp-value '${w}', missing /-enclosure`);return console.warn(`bad regexp-value '${w}', missing /-enclosure`),null}let $e=w.slice($+1,fe),lt=w[fe+1]==="i"?"i":"";try{return new RegExp($e,lt)}catch(Rt){if(b)throw new Error(`bad regexp-value '${w}', parse error: ${Rt}`);return console.warn(`bad regexp-value '${w}', parse error: ${Rt}`),null}}}function H(ae,w){const b=ae?ae.substituteConstants():void 0,$=w?w.substituteConstants():void 0;return!b&&!$?!0:!b||!$?!1:b.equals($)}function o(ae,w){return ae.cmp(w)}class ne{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 U.INSTANCE}}ne.INSTANCE=new ne;class U{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 ne.INSTANCE}}U.INSTANCE=new U;class B{constructor(w,b){this.key=w,this.negated=b,this.type=2}static create(w,b=null){const $=Y.get(w);return typeof $=="boolean"?$?U.INSTANCE:ne.INSTANCE:new B(w,b)}cmp(w){return w.type!==this.type?this.type-w.type:L(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=Y.get(this.key);return typeof w=="boolean"?w?U.INSTANCE:ne.INSTANCE:this}evaluate(w){return!!w.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=G.create(this.key,this)),this.negated}}class y{constructor(w,b,$){this.key=w,this.value=b,this.negated=$,this.type=4}static create(w,b,$=null){if(typeof b=="boolean")return b?B.create(w,$):G.create(w,$);const fe=Y.get(w);return typeof fe=="boolean"?b===(fe?"true":"false")?U.INSTANCE:ne.INSTANCE:new y(w,b,$)}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=Y.get(this.key);if(typeof w=="boolean"){const b=w?"true":"false";return this.value===b?U.INSTANCE:ne.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=ee.create(this.key,this.value,this)),this.negated}}class C{constructor(w,b){this.key=w,this.valueKey=b,this.type=10,this.negated=null}static create(w,b){return new C(w,b)}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 b=w.getValue(this.valueKey),$=w.getValue(this.key);return Array.isArray(b)?b.indexOf($)>=0:typeof $=="string"&&typeof b=="object"&&b!==null?_.call(b,$):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=T.create(this)),this.negated}}class T{constructor(w){this._actual=w,this.type=11}static create(w){return new T(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 ee{constructor(w,b,$){this.key=w,this.value=b,this.negated=$,this.type=5}static create(w,b,$=null){if(typeof b=="boolean")return b?G.create(w,$):B.create(w,$);const fe=Y.get(w);return typeof fe=="boolean"?b===(fe?"true":"false")?ne.INSTANCE:U.INSTANCE:new ee(w,b,$)}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=Y.get(this.key);if(typeof w=="boolean"){const b=w?"true":"false";return this.value===b?ne.INSTANCE:U.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=y.create(this.key,this.value,this)),this.negated}}class G{constructor(w,b){this.key=w,this.negated=b,this.type=3}static create(w,b=null){const $=Y.get(w);return typeof $=="boolean"?$?ne.INSTANCE:U.INSTANCE:new G(w,b)}cmp(w){return w.type!==this.type?this.type-w.type:L(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=Y.get(this.key);return typeof w=="boolean"?w?ne.INSTANCE:U.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 W(ae,w){if(typeof ae=="string"){const b=parseFloat(ae);isNaN(b)||(ae=b)}return typeof ae=="string"||typeof ae=="number"?w(ae):ne.INSTANCE}class k{constructor(w,b,$){this.key=w,this.value=b,this.negated=$,this.type=12}static create(w,b,$=null){return W(b,fe=>new k(w,fe,$))}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=me.create(this.key,this.value,this)),this.negated}}class K{constructor(w,b,$){this.key=w,this.value=b,this.negated=$,this.type=13}static create(w,b,$=null){return W(b,fe=>new K(w,fe,$))}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=re.create(this.key,this.value,this)),this.negated}}class re{constructor(w,b,$){this.key=w,this.value=b,this.negated=$,this.type=14}static create(w,b,$=null){return W(b,fe=>new re(w,fe,$))}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=K.create(this.key,this.value,this)),this.negated}}class me{constructor(w,b,$){this.key=w,this.value=b,this.negated=$,this.type=15}static create(w,b,$=null){return W(b,fe=>new me(w,fe,$))}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=k.create(this.key,this.value,this)),this.negated}}class Ce{constructor(w,b){this.key=w,this.regexp=b,this.type=7,this.negated=null}static create(w,b){return new Ce(w,b)}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 b=this.regexp?this.regexp.source:"",$=w.regexp?w.regexp.source:"";return b<$?-1:b>$?1:0}equals(w){if(w.type===this.type){const b=this.regexp?this.regexp.source:"",$=w.regexp?w.regexp.source:"";return this.key===w.key&&b===$}return!1}substituteConstants(){return this}evaluate(w){let b=w.getValue(this.key);return this.regexp?this.regexp.test(b):!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=Ie.create(this)),this.negated}}class Ie{constructor(w){this._actual=w,this.type=8}static create(w){return new Ie(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 le(ae){let w=null;for(let b=0,$=ae.length;b<$;b++){const fe=ae[b].substituteConstants();if(ae[b]!==fe&&w===null){w=[];for(let $e=0;$e<b;$e++)w[$e]=ae[$e]}w!==null&&(w[b]=fe)}return w===null?ae:w}class xe{constructor(w,b){this.expr=w,this.negated=b,this.type=6}static create(w,b){return xe._normalizeArr(w,b)}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 b=0,$=this.expr.length;b<$;b++){const fe=o(this.expr[b],w.expr[b]);if(fe!==0)return fe}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let b=0,$=this.expr.length;b<$;b++)if(!this.expr[b].equals(w.expr[b]))return!1;return!0}return!1}substituteConstants(){const w=le(this.expr);return w===this.expr?this:xe.create(w,this.negated)}evaluate(w){for(let b=0,$=this.expr.length;b<$;b++)if(!this.expr[b].evaluate(w))return!1;return!0}static _normalizeArr(w,b){const $=[];let fe=!1;for(const $e of w)if($e){if($e.type===1){fe=!0;continue}if($e.type===0)return ne.INSTANCE;if($e.type===6){$.push(...$e.expr);continue}$.push($e)}if($.length===0&&fe)return U.INSTANCE;if($.length!==0){if($.length===1)return $[0];$.sort(o);for(let $e=1;$e<$.length;$e++)$[$e-1].equals($[$e])&&($.splice($e,1),$e--);if($.length===1)return $[0];for(;$.length>1;){const $e=$[$.length-1];if($e.type!==9)break;$.pop();const lt=$.pop(),Rt=$.length===0,Ct=Ke.create($e.expr.map(Vt=>xe.create([Vt,lt],null)),null,Rt);Ct&&($.push(Ct),$.sort(o))}return $.length===1?$[0]:new xe($,b)}}serialize(){return this.expr.map(w=>w.serialize()).join(" && ")}keys(){const w=[];for(let b of this.expr)w.push(...b.keys());return w}negate(){if(!this.negated){const w=[];for(let b of this.expr)w.push(b.negate());this.negated=Ke.create(w,this,!0)}return this.negated}}class Ke{constructor(w,b){this.expr=w,this.negated=b,this.type=9}static create(w,b,$){return Ke._normalizeArr(w,b,$)}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 b=0,$=this.expr.length;b<$;b++){const fe=o(this.expr[b],w.expr[b]);if(fe!==0)return fe}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let b=0,$=this.expr.length;b<$;b++)if(!this.expr[b].equals(w.expr[b]))return!1;return!0}return!1}substituteConstants(){const w=le(this.expr);return w===this.expr?this:Ke.create(w,this.negated,!1)}evaluate(w){for(let b=0,$=this.expr.length;b<$;b++)if(this.expr[b].evaluate(w))return!0;return!1}static _normalizeArr(w,b,$){let fe=[],$e=!1;if(w){for(let lt=0,Rt=w.length;lt<Rt;lt++){const Ct=w[lt];if(Ct){if(Ct.type===0){$e=!0;continue}if(Ct.type===1)return U.INSTANCE;if(Ct.type===9){fe=fe.concat(Ct.expr);continue}fe.push(Ct)}}if(fe.length===0&&$e)return ne.INSTANCE;fe.sort(o)}if(fe.length!==0){if(fe.length===1)return fe[0];for(let lt=1;lt<fe.length;lt++)fe[lt-1].equals(fe[lt])&&(fe.splice(lt,1),lt--);if(fe.length===1)return fe[0];if($){for(let lt=0;lt<fe.length;lt++)for(let Rt=lt+1;Rt<fe.length;Rt++)X(fe[lt],fe[Rt])&&(fe.splice(Rt,1),Rt--);if(fe.length===1)return fe[0]}return new Ke(fe,b)}}serialize(){return this.expr.map(w=>w.serialize()).join(" || ")}keys(){const w=[];for(let b of this.expr)w.push(...b.keys());return w}negate(){if(!this.negated){let w=[];for(let b of this.expr)w.push(b.negate());for(;w.length>1;){const b=w.shift(),$=w.shift(),fe=[];for(const lt of ue(b))for(const Rt of ue($))fe.push(xe.create([lt,Rt],null));const $e=w.length===0;w.unshift(Ke.create(fe,null,$e))}this.negated=w[0]}return this.negated}}class ge extends B{constructor(w,b,$){super(w,null),this._defaultValue=b,typeof $=="object"?ge._info.push(Object.assign(Object.assign({},$),{key:w})):$!==!0&&ge._info.push({key:w,description:$,type:b!=null?typeof b:void 0})}static all(){return ge._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 y.create(this.key,w)}}ge._info=[];const Ze=(0,Ue.yh)("contextKeyService"),q="setContext";function L(ae,w){return ae<w?-1:ae>w?1:0}function j(ae,w,b,$){return ae<b?-1:ae>b?1:w<$?-1:w>$?1:0}function X(ae,w){if(w.type===6&&ae.type!==9&&ae.type!==6){for(const fe of w.expr)if(ae.equals(fe))return!0}const b=ae.negate(),$=ue(b).concat(ue(w));$.sort(o);for(let fe=0;fe<$.length;fe++){const lt=$[fe].negate();for(let Rt=fe+1;Rt<$.length;Rt++){const Ct=$[Rt];if(lt.equals(Ct))return!0}}return!1}function ue(ae){return ae.type===9?ae.expr:[ae]}},16925:function(Sr,St,Z){"use strict";Z.d(St,{I8:function(){return z},TG:function(){return we},jt:function(){return Y},yh:function(){return ve}});var z;(function(_){_.serviceIds=new Map,_.DI_TARGET="$di$target",_.DI_DEPENDENCIES="$di$dependencies";function ye(H){return H[_.DI_DEPENDENCIES]||[]}_.getServiceDependencies=ye})(z||(z={}));const we=ve("instantiationService");function Ue(_,ye,H,o){ye[z.DI_TARGET]===ye?ye[z.DI_DEPENDENCIES].push({id:_,index:H,optional:o}):(ye[z.DI_DEPENDENCIES]=[{id:_,index:H,optional:o}],ye[z.DI_TARGET]=ye)}function ve(_){if(z.serviceIds.has(_))return z.serviceIds.get(_);const ye=function(H,o,ne){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ue(ye,H,ne,!1)};return ye.toString=()=>_,z.serviceIds.set(_,ye),ye}function Y(_){return function(ye,H,o){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Ue(_,ye,o,!0)}}},44650:function(Sr,St,Z){"use strict";Z.d(St,{B:function(){return ve}});var z=Z(76068),we=Z(72999);class Ue{constructor(){this.data=new Map}add(_,ye){z.ok(we.HD(_)),z.ok(we.Kn(ye)),z.ok(!this.data.has(_),"There is already an extension with this id"),this.data.set(_,ye)}as(_){return this.data.get(_)||null}}const ve=new Ue},66213:function(Sr,St,Z){"use strict";Z.d(St,{e:function(){return z}});var z;(function(we){we.DARK="dark",we.LIGHT="light",we.HIGH_CONTRAST="hc"})(z||(z={}))},49055:function(Sr,St,Z){"use strict";Z.d(St,{EN:function(){return o},IP:function(){return B},Ic:function(){return T},XE:function(){return ye},bB:function(){return ee},kS:function(){return ne},m6:function(){return U}});var z=Z(52615),we=Z(4348),Ue=Z(69323),ve=Z(16925),Y=Z(44650),_=Z(66213);const ye=(0,ve.yh)("themeService");var H;(function(G){function W(k){return k&&typeof k=="object"&&typeof k.id=="string"}G.isThemeColor=W})(H||(H={}));function o(G){return{id:G}}var ne;(function(G){function W(Ie){return Ie&&typeof Ie=="object"&&typeof Ie.id=="string"&&(typeof Ie.color=="undefined"||H.isThemeColor(Ie.color))}G.isThemeIcon=W;const k=new RegExp(`^\\$\\((${z.dT.iconNameExpression}(?:${z.dT.iconModifierExpression})?)\\)$`);function K(Ie){const le=k.exec(Ie);if(!le)return;let[,xe]=le;return{id:xe}}G.fromString=K;function re(Ie,le){let xe=Ie.id;const Ke=xe.lastIndexOf("~");return Ke!==-1&&(xe=xe.substring(0,Ke)),le&&(xe=`${xe}~${le}`),{id:xe}}G.modify=re;function me(Ie,le){var xe,Ke;return Ie.id===le.id&&((xe=Ie.color)===null||xe===void 0?void 0:xe.id)===((Ke=le.color)===null||Ke===void 0?void 0:Ke.id)}G.isEqual=me;function Ce(Ie,le){return{id:Ie.id,color:le?o(le):void 0}}G.asThemeIcon=Ce,G.asClassNameArray=z.dT.asClassNameArray,G.asClassName=z.dT.asClassName,G.asCSSSelector=z.dT.asCSSSelector})(ne||(ne={}));function U(G){switch(G){case _.e.DARK:return"vs-dark";case _.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const B={ThemingContribution:"base.contributions.theming"};class y{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new we.Q5}onColorThemeChange(W){return this.themingParticipants.push(W),this.onThemingParticipantAddedEmitter.fire(W),(0,Ue.OF)(()=>{const k=this.themingParticipants.indexOf(W);this.themingParticipants.splice(k,1)})}getThemingParticipants(){return this.themingParticipants}}let C=new y;Y.B.add(B.ThemingContribution,C);function T(G){return C.onColorThemeChange(G)}class ee extends Ue.JT{constructor(W){super(),this.themeService=W,this.theme=W.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(k=>this.onThemeChange(k)))}onThemeChange(W){this.theme=W,this.updateStyles()}updateStyles(){}}},16632:function(Sr,St,Z){"use strict";var z=Z(67711),we=Z(98506),Ue=Z(52873),ve=Z(16886),Y=Z(33346),_=Z(92310),ye=Z.n(_),H=Z(18929),o=Z(59301),ne=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],U=(0,o.forwardRef)(function(B,y){var C=B.prefixCls,T=C===void 0?"rc-checkbox":C,ee=B.className,G=B.style,W=B.checked,k=B.disabled,K=B.defaultChecked,re=K===void 0?!1:K,me=B.type,Ce=me===void 0?"checkbox":me,Ie=B.title,le=B.onChange,xe=(0,Y.Z)(B,ne),Ke=(0,o.useRef)(null),ge=(0,o.useRef)(null),Ze=(0,H.Z)(re,{value:W}),q=(0,ve.Z)(Ze,2),L=q[0],j=q[1];(0,o.useImperativeHandle)(y,function(){return{focus:function(w){var b;(b=Ke.current)===null||b===void 0||b.focus(w)},blur:function(){var w;(w=Ke.current)===null||w===void 0||w.blur()},input:Ke.current,nativeElement:ge.current}});var X=ye()(T,ee,(0,Ue.Z)((0,Ue.Z)({},"".concat(T,"-checked"),L),"".concat(T,"-disabled"),k)),ue=function(w){k||("checked"in B||j(w.target.checked),le==null||le({target:(0,we.Z)((0,we.Z)({},B),{},{type:Ce,checked:w.target.checked}),stopPropagation:function(){w.stopPropagation()},preventDefault:function(){w.preventDefault()},nativeEvent:w.nativeEvent}))};return o.createElement("span",{className:X,title:Ie,style:G,ref:ge},o.createElement("input",(0,z.Z)({},xe,{className:"".concat(T,"-input"),ref:Ke,onChange:ue,disabled:k,checked:!!L,type:Ce})),o.createElement("span",{className:"".concat(T,"-inner")}))});St.Z=U},96478:function(Sr,St,Z){"use strict";Z.d(St,{Z:function(){return Ie}});var z=Z(67711),we=Z(52873),Ue=Z(16886),ve=Z(33346),Y=Z(65030),_=Z(92310),ye=Z.n(_),H=Z(8654),o=Z(59301),ne=Z(10228),U=Z(16089),B=ne.Z.ESC,y=ne.Z.TAB;function C(le){var xe=le.visible,Ke=le.triggerRef,ge=le.onVisibleChange,Ze=le.autoFocus,q=le.overlayRef,L=o.useRef(!1),j=function(){if(xe){var w,b;(w=Ke.current)===null||w===void 0||(b=w.focus)===null||b===void 0||b.call(w),ge==null||ge(!1)}},X=function(){var w;return(w=q.current)!==null&&w!==void 0&&w.focus?(q.current.focus(),L.current=!0,!0):!1},ue=function(w){switch(w.keyCode){case B:j();break;case y:{var b=!1;L.current||(b=X()),b?w.preventDefault():j();break}}};o.useEffect(function(){return xe?(window.addEventListener("keydown",ue),Ze&&(0,U.Z)(X,3),function(){window.removeEventListener("keydown",ue),L.current=!1}):function(){L.current=!1}},[xe])}var T=(0,o.forwardRef)(function(le,xe){var Ke=le.overlay,ge=le.arrow,Ze=le.prefixCls,q=(0,o.useMemo)(function(){var j;return typeof Ke=="function"?j=Ke():j=Ke,j},[Ke]),L=(0,H.sQ)(xe,(0,H.C4)(q));return o.createElement(o.Fragment,null,ge&&o.createElement("div",{className:"".concat(Ze,"-arrow")}),o.cloneElement(q,{ref:(0,H.Yr)(q)?L:void 0}))}),ee=T,G={adjustX:1,adjustY:1},W=[0,0],k={topLeft:{points:["bl","tl"],overflow:G,offset:[0,-4],targetOffset:W},top:{points:["bc","tc"],overflow:G,offset:[0,-4],targetOffset:W},topRight:{points:["br","tr"],overflow:G,offset:[0,-4],targetOffset:W},bottomLeft:{points:["tl","bl"],overflow:G,offset:[0,4],targetOffset:W},bottom:{points:["tc","bc"],overflow:G,offset:[0,4],targetOffset:W},bottomRight:{points:["tr","br"],overflow:G,offset:[0,4],targetOffset:W}},K=k,re=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function me(le,xe){var Ke,ge=le.arrow,Ze=ge===void 0?!1:ge,q=le.prefixCls,L=q===void 0?"rc-dropdown":q,j=le.transitionName,X=le.animation,ue=le.align,ae=le.placement,w=ae===void 0?"bottomLeft":ae,b=le.placements,$=b===void 0?K:b,fe=le.getPopupContainer,$e=le.showAction,lt=le.hideAction,Rt=le.overlayClassName,Ct=le.overlayStyle,Vt=le.visible,Qt=le.trigger,bt=Qt===void 0?["hover"]:Qt,He=le.autoFocus,nt=le.overlay,it=le.children,At=le.onVisibleChange,Ht=(0,ve.Z)(le,re),Fe=o.useState(),R=(0,Ue.Z)(Fe,2),m=R[0],F=R[1],V="visible"in le?Vt:m,D=o.useRef(null),N=o.useRef(null),Ae=o.useRef(null);o.useImperativeHandle(xe,function(){return D.current});var Le=function(Ye){F(Ye),At==null||At(Ye)};C({visible:V,triggerRef:Ae,onVisibleChange:Le,autoFocus:He,overlayRef:N});var Me=function(Ye){var rt=le.onOverlayClick;F(!1),rt&&rt(Ye)},Xe=function(){return o.createElement(ee,{ref:N,overlay:nt,prefixCls:L,arrow:Ze})},qe=function(){return typeof nt=="function"?Xe:Xe()},Pt=function(){var Ye=le.minOverlayWidthMatchTrigger,rt=le.alignPoint;return"minOverlayWidthMatchTrigger"in le?Ye:!rt},ot=function(){var Ye=le.openClassName;return Ye!==void 0?Ye:"".concat(L,"-open")},Bt=o.cloneElement(it,{className:ye()((Ke=it.props)===null||Ke===void 0?void 0:Ke.className,V&&ot()),ref:(0,H.Yr)(it)?(0,H.sQ)(Ae,(0,H.C4)(it)):void 0}),ut=lt;return!ut&&bt.indexOf("contextMenu")!==-1&&(ut=["click"]),o.createElement(Y.Z,(0,z.Z)({builtinPlacements:$},Ht,{prefixCls:L,ref:D,popupClassName:ye()(Rt,(0,we.Z)({},"".concat(L,"-show-arrow"),Ze)),popupStyle:Ct,action:bt,showAction:$e,hideAction:ut,popupPlacement:w,popupAlign:ue,popupTransitionName:j,popupAnimation:X,popupVisible:V,stretch:Pt()?"minWidth":"",popup:qe(),onPopupVisibleChange:Le,onPopupClick:Me,getPopupContainer:fe}),Bt)}var Ce=o.forwardRef(me),Ie=Ce},20922:function(Sr,St,Z){"use strict";Z.d(St,{Z:function(){return bt}});var z=Z(67711),we=Z(52873),Ue=Z(26420),ve=Z(16886),Y=Z(33346),_=Z(42573),ye=Z(58698);function H(){return typeof BigInt=="function"}function o(He){return!He&&He!==0&&!Number.isNaN(He)||!String(He).trim()}function ne(He){var nt=He.trim(),it=nt.startsWith("-");it&&(nt=nt.slice(1)),nt=nt.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),nt.startsWith(".")&&(nt="0".concat(nt));var At=nt||"0",Ht=At.split("."),Fe=Ht[0]||"0",R=Ht[1]||"0";Fe==="0"&&R==="0"&&(it=!1);var m=it?"-":"";return{negative:it,negativeStr:m,trimStr:At,integerStr:Fe,decimalStr:R,fullStr:"".concat(m).concat(At)}}function U(He){var nt=String(He);return!Number.isNaN(Number(nt))&&nt.includes("e")}function B(He){var nt=String(He);if(U(He)){var it=Number(nt.slice(nt.indexOf("e-")+2)),At=nt.match(/\.(\d+)/);return At!=null&&At[1]&&(it+=At[1].length),it}return nt.includes(".")&&C(nt)?nt.length-nt.indexOf(".")-1:0}function y(He){var nt=String(He);if(U(He)){if(He>Number.MAX_SAFE_INTEGER)return String(H()?BigInt(He).toString():Number.MAX_SAFE_INTEGER);if(He<Number.MIN_SAFE_INTEGER)return String(H()?BigInt(He).toString():Number.MIN_SAFE_INTEGER);nt=He.toFixed(B(nt))}return ne(nt).fullStr}function C(He){return typeof He=="number"?!Number.isNaN(He):He?/^\s*-?\d+(\.\d+)?\s*$/.test(He)||/^\s*-?\d+\.\s*$/.test(He)||/^\s*-?\.\d+\s*$/.test(He):!1}var T=function(){function He(nt){if((0,_.Z)(this,He),(0,we.Z)(this,"origin",""),(0,we.Z)(this,"negative",void 0),(0,we.Z)(this,"integer",void 0),(0,we.Z)(this,"decimal",void 0),(0,we.Z)(this,"decimalLen",void 0),(0,we.Z)(this,"empty",void 0),(0,we.Z)(this,"nan",void 0),o(nt)){this.empty=!0;return}if(this.origin=String(nt),nt==="-"||Number.isNaN(nt)){this.nan=!0;return}var it=nt;if(U(it)&&(it=Number(it)),it=typeof it=="string"?it:y(it),C(it)){var At=ne(it);this.negative=At.negative;var Ht=At.trimStr.split(".");this.integer=BigInt(Ht[0]);var Fe=Ht[1]||"0";this.decimal=BigInt(Fe),this.decimalLen=Fe.length}else this.nan=!0}return(0,ye.Z)(He,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(it){var At="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(it,"0"));return BigInt(At)}},{key:"negate",value:function(){var it=new He(this.toString());return it.negative=!it.negative,it}},{key:"cal",value:function(it,At,Ht){var Fe=Math.max(this.getDecimalStr().length,it.getDecimalStr().length),R=this.alignDecimal(Fe),m=it.alignDecimal(Fe),F=At(R,m).toString(),V=Ht(Fe),D=ne(F),N=D.negativeStr,Ae=D.trimStr,Le="".concat(N).concat(Ae.padStart(V+1,"0"));return new He("".concat(Le.slice(0,-V),".").concat(Le.slice(-V)))}},{key:"add",value:function(it){if(this.isInvalidate())return new He(it);var At=new He(it);return At.isInvalidate()?this:this.cal(At,function(Ht,Fe){return Ht+Fe},function(Ht){return Ht})}},{key:"multi",value:function(it){var At=new He(it);return this.isInvalidate()||At.isInvalidate()?new He(NaN):this.cal(At,function(Ht,Fe){return Ht*Fe},function(Ht){return Ht*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(it){return this.toString()===(it==null?void 0:it.toString())}},{key:"lessEquals",value:function(it){return this.add(it.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var it=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return it?this.isInvalidate()?"":ne("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),He}(),ee=function(){function He(nt){if((0,_.Z)(this,He),(0,we.Z)(this,"origin",""),(0,we.Z)(this,"number",void 0),(0,we.Z)(this,"empty",void 0),o(nt)){this.empty=!0;return}this.origin=String(nt),this.number=Number(nt)}return(0,ye.Z)(He,[{key:"negate",value:function(){return new He(-this.toNumber())}},{key:"add",value:function(it){if(this.isInvalidate())return new He(it);var At=Number(it);if(Number.isNaN(At))return this;var Ht=this.number+At;if(Ht>Number.MAX_SAFE_INTEGER)return new He(Number.MAX_SAFE_INTEGER);if(Ht<Number.MIN_SAFE_INTEGER)return new He(Number.MIN_SAFE_INTEGER);var Fe=Math.max(B(this.number),B(At));return new He(Ht.toFixed(Fe))}},{key:"multi",value:function(it){var At=Number(it);if(this.isInvalidate()||Number.isNaN(At))return new He(NaN);var Ht=this.number*At;if(Ht>Number.MAX_SAFE_INTEGER)return new He(Number.MAX_SAFE_INTEGER);if(Ht<Number.MIN_SAFE_INTEGER)return new He(Number.MIN_SAFE_INTEGER);var Fe=Math.max(B(this.number),B(At));return new He(Ht.toFixed(Fe))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(it){return this.toNumber()===(it==null?void 0:it.toNumber())}},{key:"lessEquals",value:function(it){return this.add(it.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var it=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return it?this.isInvalidate()?"":y(this.number):this.origin}}]),He}();function G(He){return H()?new T(He):new ee(He)}function W(He,nt,it){var At=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(He==="")return"";var Ht=ne(He),Fe=Ht.negativeStr,R=Ht.integerStr,m=Ht.decimalStr,F="".concat(nt).concat(m),V="".concat(Fe).concat(R);if(it>=0){var D=Number(m[it]);if(D>=5&&!At){var N=G(He).add("".concat(Fe,"0.").concat("0".repeat(it)).concat(10-D));return W(N.toString(),nt,it,At)}return it===0?V:"".concat(V).concat(nt).concat(m.padEnd(it,"0").slice(0,it))}return F===".0"?V:"".concat(V).concat(F)}var k=G,K=Z(92310),re=Z.n(K),me=Z(36901),Ce=Z(34280);function Ie(He,nt){return typeof Proxy!="undefined"&&He?new Proxy(He,{get:function(At,Ht){if(nt[Ht])return nt[Ht];var Fe=At[Ht];return typeof Fe=="function"?Fe.bind(At):Fe}}):He}var le=Z(8654),xe=Z(59301),Ke=Z(48736);function ge(He,nt){var it=(0,xe.useRef)(null);function At(){try{var Fe=He.selectionStart,R=He.selectionEnd,m=He.value,F=m.substring(0,Fe),V=m.substring(R);it.current={start:Fe,end:R,value:m,beforeTxt:F,afterTxt:V}}catch(D){}}function Ht(){if(He&&it.current&&nt)try{var Fe=He.value,R=it.current,m=R.beforeTxt,F=R.afterTxt,V=R.start,D=Fe.length;if(Fe.startsWith(m))D=m.length;else if(Fe.endsWith(F))D=Fe.length-it.current.afterTxt.length;else{var N=m[V-1],Ae=Fe.indexOf(N,V-1);Ae!==-1&&(D=Ae+1)}He.setSelectionRange(D,D)}catch(Le){(0,Ke.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(Le.message))}}return[At,Ht]}var Ze=Z(49658),q=function(){var nt=(0,xe.useState)(!1),it=(0,ve.Z)(nt,2),At=it[0],Ht=it[1];return(0,Ce.Z)(function(){Ht((0,Ze.Z)())},[]),At},L=q,j=Z(16089),X=200,ue=600;function ae(He){var nt=He.prefixCls,it=He.upNode,At=He.downNode,Ht=He.upDisabled,Fe=He.downDisabled,R=He.onStep,m=xe.useRef(),F=xe.useRef([]),V=xe.useRef();V.current=R;var D=function(){clearTimeout(m.current)},N=function(Bt,ut){Bt.preventDefault(),D(),V.current(ut);function gt(){V.current(ut),m.current=setTimeout(gt,X)}m.current=setTimeout(gt,ue)};xe.useEffect(function(){return function(){D(),F.current.forEach(function(ot){return j.Z.cancel(ot)})}},[]);var Ae=L();if(Ae)return null;var Le="".concat(nt,"-handler"),Me=re()(Le,"".concat(Le,"-up"),(0,we.Z)({},"".concat(Le,"-up-disabled"),Ht)),Xe=re()(Le,"".concat(Le,"-down"),(0,we.Z)({},"".concat(Le,"-down-disabled"),Fe)),qe=function(){return F.current.push((0,j.Z)(D))},Pt={unselectable:"on",role:"button",onMouseUp:qe,onMouseLeave:qe};return xe.createElement("div",{className:"".concat(Le,"-wrap")},xe.createElement("span",(0,z.Z)({},Pt,{onMouseDown:function(Bt){N(Bt,!0)},"aria-label":"Increase Value","aria-disabled":Ht,className:Me}),it||xe.createElement("span",{unselectable:"on",className:"".concat(nt,"-handler-up-inner")})),xe.createElement("span",(0,z.Z)({},Pt,{onMouseDown:function(Bt){N(Bt,!1)},"aria-label":"Decrease Value","aria-disabled":Fe,className:Xe}),At||xe.createElement("span",{unselectable:"on",className:"".concat(nt,"-handler-down-inner")})))}function w(He){var nt=typeof He=="number"?y(He):ne(He).fullStr,it=nt.includes(".");return it?ne(nt.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:He+"0"}var b=Z(30292),$=function(){var He=(0,xe.useRef)(0),nt=function(){j.Z.cancel(He.current)};return(0,xe.useEffect)(function(){return nt},[]),function(it){nt(),He.current=(0,j.Z)(function(){it()})}},fe=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur","domRef"],$e=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],lt=function(nt,it){return nt||it.isEmpty()?it.toString():it.toNumber()},Rt=function(nt){var it=k(nt);return it.isInvalidate()?null:it},Ct=xe.forwardRef(function(He,nt){var it=He.prefixCls,At=He.className,Ht=He.style,Fe=He.min,R=He.max,m=He.step,F=m===void 0?1:m,V=He.defaultValue,D=He.value,N=He.disabled,Ae=He.readOnly,Le=He.upHandler,Me=He.downHandler,Xe=He.keyboard,qe=He.changeOnWheel,Pt=qe===void 0?!1:qe,ot=He.controls,Bt=ot===void 0?!0:ot,ut=He.classNames,gt=He.stringMode,Ye=He.parser,rt=He.formatter,yt=He.precision,It=He.decimalSeparator,zt=He.onChange,kt=He.onInput,tr=He.onPressEnter,Wt=He.onStep,ir=He.changeOnBlur,Er=ir===void 0?!0:ir,zr=He.domRef,Nt=(0,Y.Z)(He,fe),ur="".concat(it,"-input"),ke=xe.useRef(null),De=xe.useState(!1),Se=(0,ve.Z)(De,2),te=Se[0],se=Se[1],ce=xe.useRef(!1),Ee=xe.useRef(!1),Te=xe.useRef(!1),Et=xe.useState(function(){return k(D!=null?D:V)}),Ut=(0,ve.Z)(Et,2),Ft=Ut[0],rr=Ut[1];function Ir(ht){D===void 0&&rr(ht)}var qr=xe.useCallback(function(ht,vt){if(!vt)return yt>=0?yt:Math.max(B(ht),B(F))},[yt,F]),jt=xe.useCallback(function(ht){var vt=String(ht);if(Ye)return Ye(vt);var Gt=vt;return It&&(Gt=Gt.replace(It,".")),Gt.replace(/[^\w.-]+/g,"")},[Ye,It]),Yt=xe.useRef(""),$r=xe.useCallback(function(ht,vt){if(rt)return rt(ht,{userTyping:vt,input:String(Yt.current)});var Gt=typeof ht=="number"?y(ht):ht;if(!vt){var qt=qr(Gt,vt);if(C(Gt)&&(It||qt>=0)){var yr=It||".";Gt=W(Gt,yr,qt)}}return Gt},[rt,qr,It]),fn=xe.useState(function(){var ht=V!=null?V:D;return Ft.isInvalidate()&&["string","number"].includes((0,Ue.Z)(ht))?Number.isNaN(ht)?"":ht:$r(Ft.toString(),!1)}),Oe=(0,ve.Z)(fn,2),Wr=Oe[0],Pr=Oe[1];Yt.current=Wr;function Mr(ht,vt){Pr($r(ht.isInvalidate()?ht.toString(!1):ht.toString(!vt),vt))}var In=xe.useMemo(function(){return Rt(R)},[R,yt]),en=xe.useMemo(function(){return Rt(Fe)},[Fe,yt]),Fn=xe.useMemo(function(){return!In||!Ft||Ft.isInvalidate()?!1:In.lessEquals(Ft)},[In,Ft]),mn=xe.useMemo(function(){return!en||!Ft||Ft.isInvalidate()?!1:Ft.lessEquals(en)},[en,Ft]),Nn=ge(ke.current,te),Rn=(0,ve.Z)(Nn,2),Hn=Rn[0],ei=Rn[1],tn=function(vt){return In&&!vt.lessEquals(In)?In:en&&!en.lessEquals(vt)?en:null},an=function(vt){return!tn(vt)},gn=function(vt,Gt){var qt=vt,yr=an(qt)||qt.isEmpty();if(!qt.isEmpty()&&!Gt&&(qt=tn(qt)||qt,yr=!0),!Ae&&!N&&yr){var Zr=qt.toString(),Rr=qr(Zr,Gt);return Rr>=0&&(qt=k(W(Zr,".",Rr)),an(qt)||(qt=k(W(Zr,".",Rr,!0)))),qt.equals(Ft)||(Ir(qt),zt==null||zt(qt.isEmpty()?null:lt(gt,qt)),D===void 0&&Mr(qt,Gt)),qt}return Ft},ii=$(),Hr=function ht(vt){if(Hn(),Yt.current=vt,Pr(vt),!Ee.current){var Gt=jt(vt),qt=k(Gt);qt.isNaN()||gn(qt,!0)}kt==null||kt(vt),ii(function(){var yr=vt;Ye||(yr=vt.replace(/。/g,".")),yr!==vt&&ht(yr)})},ti=function(){Ee.current=!0},Cn=function(){Ee.current=!1,Hr(ke.current.value)},wr=function(vt){Hr(vt.target.value)},kr=function(vt){var Gt;if(!(vt&&Fn||!vt&&mn)){ce.current=!1;var qt=k(Te.current?w(F):F);vt||(qt=qt.negate());var yr=(Ft||k(0)).add(qt.toString()),Zr=gn(yr,!1);Wt==null||Wt(lt(gt,Zr),{offset:Te.current?w(F):F,type:vt?"up":"down"}),(Gt=ke.current)===null||Gt===void 0||Gt.focus()}},Ne=function(vt){var Gt=k(jt(Wr)),qt;Gt.isNaN()?qt=gn(Ft,vt):qt=gn(Gt,vt),D!==void 0?Mr(Ft,!1):qt.isNaN()||Mr(qt,!1)},tt=function(){ce.current=!0},wt=function(vt){var Gt=vt.key,qt=vt.shiftKey;ce.current=!0,Te.current=qt,Gt==="Enter"&&(Ee.current||(ce.current=!1),Ne(!1),tr==null||tr(vt)),Xe!==!1&&!Ee.current&&["Up","ArrowUp","Down","ArrowDown"].includes(Gt)&&(kr(Gt==="Up"||Gt==="ArrowUp"),vt.preventDefault())},mt=function(){ce.current=!1,Te.current=!1};xe.useEffect(function(){if(Pt&&te){var ht=function(qt){kr(qt.deltaY<0),qt.preventDefault()},vt=ke.current;if(vt)return vt.addEventListener("wheel",ht,{passive:!1}),function(){return vt.removeEventListener("wheel",ht)}}});var Mt=function(){Er&&Ne(!1),se(!1),ce.current=!1};return(0,Ce.o)(function(){Ft.isInvalidate()||Mr(Ft,!1)},[yt,rt]),(0,Ce.o)(function(){var ht=k(D);rr(ht);var vt=k(jt(Wr));(!ht.equals(vt)||!ce.current||rt)&&Mr(ht,ce.current)},[D]),(0,Ce.o)(function(){rt&&ei()},[Wr]),xe.createElement("div",{ref:zr,className:re()(it,At,(0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)({},"".concat(it,"-focused"),te),"".concat(it,"-disabled"),N),"".concat(it,"-readonly"),Ae),"".concat(it,"-not-a-number"),Ft.isNaN()),"".concat(it,"-out-of-range"),!Ft.isInvalidate()&&!an(Ft))),style:Ht,onFocus:function(){se(!0)},onBlur:Mt,onKeyDown:wt,onKeyUp:mt,onCompositionStart:ti,onCompositionEnd:Cn,onBeforeInput:tt},Bt&&xe.createElement(ae,{prefixCls:it,upNode:Le,downNode:Me,upDisabled:Fn,downDisabled:mn,onStep:kr}),xe.createElement("div",{className:"".concat(ur,"-wrap")},xe.createElement("input",(0,z.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":Fe,"aria-valuemax":R,"aria-valuenow":Ft.isInvalidate()?null:Ft.toString(),step:F},Nt,{ref:(0,le.sQ)(ke,nt),className:ur,value:Wr,onChange:wr,disabled:N,readOnly:Ae}))))}),Vt=xe.forwardRef(function(He,nt){var it=He.disabled,At=He.style,Ht=He.prefixCls,Fe=Ht===void 0?"rc-input-number":Ht,R=He.value,m=He.prefix,F=He.suffix,V=He.addonBefore,D=He.addonAfter,N=He.className,Ae=He.classNames,Le=(0,Y.Z)(He,$e),Me=xe.useRef(null),Xe=xe.useRef(null),qe=xe.useRef(null),Pt=function(Bt){qe.current&&(0,b.nH)(qe.current,Bt)};return xe.useImperativeHandle(nt,function(){return Ie(qe.current,{focus:Pt,nativeElement:Me.current.nativeElement||Xe.current})}),xe.createElement(me.BaseInput,{className:N,triggerFocus:Pt,prefixCls:Fe,value:R,disabled:it,style:At,prefix:m,suffix:F,addonAfter:D,addonBefore:V,classNames:Ae,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"},ref:Me},xe.createElement(Ct,(0,z.Z)({prefixCls:Fe,disabled:it,ref:qe,domRef:Xe,className:Ae==null?void 0:Ae.input},Le)))}),Qt=Vt,bt=Qt},66003:function(Sr,St,Z){"use strict";Z.d(St,{Z:function(){return ye}});var z=Z(33346),we=Z(98506),Ue=Z(26420),ve=Z(59301),Y=["show"];function _(H,o){if(!o.max)return!0;var ne=o.strategy(H);return ne<=o.max}function ye(H,o){return ve.useMemo(function(){var ne={};o&&(ne.show=(0,Ue.Z)(o)==="object"&&o.formatter?o.formatter:!!o),ne=(0,we.Z)((0,we.Z)({},ne),H);var U=ne,B=U.show,y=(0,z.Z)(U,Y);return(0,we.Z)((0,we.Z)({},y),{},{show:!!B,showFormatter:typeof B=="function"?B:void 0,strategy:y.strategy||function(C){return C.length}})},[H,o])}},36901:function(Sr,St,Z){"use strict";Z.r(St),Z.d(St,{BaseInput:function(){return ne},default:function(){return K}});var z=Z(98506),we=Z(67711),Ue=Z(52873),ve=Z(26420),Y=Z(92310),_=Z.n(Y),ye=Z(59301),H=Z(30292),o=ye.forwardRef(function(re,me){var Ce,Ie,le,xe=re.inputElement,Ke=re.children,ge=re.prefixCls,Ze=re.prefix,q=re.suffix,L=re.addonBefore,j=re.addonAfter,X=re.className,ue=re.style,ae=re.disabled,w=re.readOnly,b=re.focused,$=re.triggerFocus,fe=re.allowClear,$e=re.value,lt=re.handleReset,Rt=re.hidden,Ct=re.classes,Vt=re.classNames,Qt=re.dataAttrs,bt=re.styles,He=re.components,nt=re.onClear,it=Ke!=null?Ke:xe,At=(He==null?void 0:He.affixWrapper)||"span",Ht=(He==null?void 0:He.groupWrapper)||"span",Fe=(He==null?void 0:He.wrapper)||"span",R=(He==null?void 0:He.groupAddon)||"span",m=(0,ye.useRef)(null),F=function(It){var zt;(zt=m.current)!==null&&zt!==void 0&&zt.contains(It.target)&&($==null||$())},V=(0,H.X3)(re),D=(0,ye.cloneElement)(it,{value:$e,className:_()((Ce=it.props)===null||Ce===void 0?void 0:Ce.className,!V&&(Vt==null?void 0:Vt.variant))||null}),N=(0,ye.useRef)(null);if(ye.useImperativeHandle(me,function(){return{nativeElement:N.current||m.current}}),V){var Ae=null;if(fe){var Le=!ae&&!w&&$e,Me="".concat(ge,"-clear-icon"),Xe=(0,ve.Z)(fe)==="object"&&fe!==null&&fe!==void 0&&fe.clearIcon?fe.clearIcon:"\u2716";Ae=ye.createElement("button",{type:"button",tabIndex:-1,onClick:function(It){lt==null||lt(It),nt==null||nt()},onMouseDown:function(It){return It.preventDefault()},className:_()(Me,(0,Ue.Z)((0,Ue.Z)({},"".concat(Me,"-hidden"),!Le),"".concat(Me,"-has-suffix"),!!q))},Xe)}var qe="".concat(ge,"-affix-wrapper"),Pt=_()(qe,(0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)({},"".concat(ge,"-disabled"),ae),"".concat(qe,"-disabled"),ae),"".concat(qe,"-focused"),b),"".concat(qe,"-readonly"),w),"".concat(qe,"-input-with-clear-btn"),q&&fe&&$e),Ct==null?void 0:Ct.affixWrapper,Vt==null?void 0:Vt.affixWrapper,Vt==null?void 0:Vt.variant),ot=(q||fe)&&ye.createElement("span",{className:_()("".concat(ge,"-suffix"),Vt==null?void 0:Vt.suffix),style:bt==null?void 0:bt.suffix},Ae,q);D=ye.createElement(At,(0,we.Z)({className:Pt,style:bt==null?void 0:bt.affixWrapper,onClick:F},Qt==null?void 0:Qt.affixWrapper,{ref:m}),Ze&&ye.createElement("span",{className:_()("".concat(ge,"-prefix"),Vt==null?void 0:Vt.prefix),style:bt==null?void 0:bt.prefix},Ze),D,ot)}if((0,H.He)(re)){var Bt="".concat(ge,"-group"),ut="".concat(Bt,"-addon"),gt="".concat(Bt,"-wrapper"),Ye=_()("".concat(ge,"-wrapper"),Bt,Ct==null?void 0:Ct.wrapper,Vt==null?void 0:Vt.wrapper),rt=_()(gt,(0,Ue.Z)({},"".concat(gt,"-disabled"),ae),Ct==null?void 0:Ct.group,Vt==null?void 0:Vt.groupWrapper);D=ye.createElement(Ht,{className:rt,ref:N},ye.createElement(Fe,{className:Ye},L&&ye.createElement(R,{className:ut},L),D,j&&ye.createElement(R,{className:ut},j)))}return ye.cloneElement(D,{className:_()((Ie=D.props)===null||Ie===void 0?void 0:Ie.className,X)||null,style:(0,z.Z)((0,z.Z)({},(le=D.props)===null||le===void 0?void 0:le.style),ue),hidden:Rt})}),ne=o,U=Z(15142),B=Z(16886),y=Z(33346),C=Z(18929),T=Z(2738),ee=Z(66003),G=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],W=(0,ye.forwardRef)(function(re,me){var Ce=re.autoComplete,Ie=re.onChange,le=re.onFocus,xe=re.onBlur,Ke=re.onPressEnter,ge=re.onKeyDown,Ze=re.onKeyUp,q=re.prefixCls,L=q===void 0?"rc-input":q,j=re.disabled,X=re.htmlSize,ue=re.className,ae=re.maxLength,w=re.suffix,b=re.showCount,$=re.count,fe=re.type,$e=fe===void 0?"text":fe,lt=re.classes,Rt=re.classNames,Ct=re.styles,Vt=re.onCompositionStart,Qt=re.onCompositionEnd,bt=(0,y.Z)(re,G),He=(0,ye.useState)(!1),nt=(0,B.Z)(He,2),it=nt[0],At=nt[1],Ht=(0,ye.useRef)(!1),Fe=(0,ye.useRef)(!1),R=(0,ye.useRef)(null),m=(0,ye.useRef)(null),F=function(ur){R.current&&(0,H.nH)(R.current,ur)},V=(0,C.Z)(re.defaultValue,{value:re.value}),D=(0,B.Z)(V,2),N=D[0],Ae=D[1],Le=N==null?"":String(N),Me=(0,ye.useState)(null),Xe=(0,B.Z)(Me,2),qe=Xe[0],Pt=Xe[1],ot=(0,ee.Z)($,b),Bt=ot.max||ae,ut=ot.strategy(Le),gt=!!Bt&&ut>Bt;(0,ye.useImperativeHandle)(me,function(){var Nt;return{focus:F,blur:function(){var ke;(ke=R.current)===null||ke===void 0||ke.blur()},setSelectionRange:function(ke,De,Se){var te;(te=R.current)===null||te===void 0||te.setSelectionRange(ke,De,Se)},select:function(){var ke;(ke=R.current)===null||ke===void 0||ke.select()},input:R.current,nativeElement:((Nt=m.current)===null||Nt===void 0?void 0:Nt.nativeElement)||R.current}}),(0,ye.useEffect)(function(){Fe.current&&(Fe.current=!1),At(function(Nt){return Nt&&j?!1:Nt})},[j]);var Ye=function(ur,ke,De){var Se=ke;if(!Ht.current&&ot.exceedFormatter&&ot.max&&ot.strategy(ke)>ot.max){if(Se=ot.exceedFormatter(ke,{max:ot.max}),ke!==Se){var te,se;Pt([((te=R.current)===null||te===void 0?void 0:te.selectionStart)||0,((se=R.current)===null||se===void 0?void 0:se.selectionEnd)||0])}}else if(De.source==="compositionEnd")return;Ae(Se),R.current&&(0,H.rJ)(R.current,ur,Ie,Se)};(0,ye.useEffect)(function(){if(qe){var Nt;(Nt=R.current)===null||Nt===void 0||Nt.setSelectionRange.apply(Nt,(0,U.Z)(qe))}},[qe]);var rt=function(ur){Ye(ur,ur.target.value,{source:"change"})},yt=function(ur){Ht.current=!1,Ye(ur,ur.currentTarget.value,{source:"compositionEnd"}),Qt==null||Qt(ur)},It=function(ur){Ke&&ur.key==="Enter"&&!Fe.current&&(Fe.current=!0,Ke(ur)),ge==null||ge(ur)},zt=function(ur){ur.key==="Enter"&&(Fe.current=!1),Ze==null||Ze(ur)},kt=function(ur){At(!0),le==null||le(ur)},tr=function(ur){Fe.current&&(Fe.current=!1),At(!1),xe==null||xe(ur)},Wt=function(ur){Ae(""),F(),R.current&&(0,H.rJ)(R.current,ur,Ie)},ir=gt&&"".concat(L,"-out-of-range"),Er=function(){var ur=(0,T.Z)(re,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return ye.createElement("input",(0,we.Z)({autoComplete:Ce},ur,{onChange:rt,onFocus:kt,onBlur:tr,onKeyDown:It,onKeyUp:zt,className:_()(L,(0,Ue.Z)({},"".concat(L,"-disabled"),j),Rt==null?void 0:Rt.input),style:Ct==null?void 0:Ct.input,ref:R,size:X,type:$e,onCompositionStart:function(De){Ht.current=!0,Vt==null||Vt(De)},onCompositionEnd:yt}))},zr=function(){var ur=Number(Bt)>0;if(w||ot.show){var ke=ot.showFormatter?ot.showFormatter({value:Le,count:ut,maxLength:Bt}):"".concat(ut).concat(ur?" / ".concat(Bt):"");return ye.createElement(ye.Fragment,null,ot.show&&ye.createElement("span",{className:_()("".concat(L,"-show-count-suffix"),(0,Ue.Z)({},"".concat(L,"-show-count-has-suffix"),!!w),Rt==null?void 0:Rt.count),style:(0,z.Z)({},Ct==null?void 0:Ct.count)},ke),w)}return null};return ye.createElement(ne,(0,we.Z)({},bt,{prefixCls:L,className:_()(ue,ir),handleReset:Wt,value:Le,focused:it,triggerFocus:F,suffix:zr(),disabled:j,classes:lt,classNames:Rt,styles:Ct}),Er())}),k=W,K=k},30292:function(Sr,St,Z){"use strict";Z.d(St,{He:function(){return z},X3:function(){return we},nH:function(){return Y},rJ:function(){return ve}});function z(_){return!!(_.addonBefore||_.addonAfter)}function we(_){return!!(_.prefix||_.suffix||_.allowClear)}function Ue(_,ye,H){var o=ye.cloneNode(!0),ne=Object.create(_,{target:{value:o},currentTarget:{value:o}});return o.value=H,typeof ye.selectionStart=="number"&&typeof ye.selectionEnd=="number"&&(o.selectionStart=ye.selectionStart,o.selectionEnd=ye.selectionEnd),o.setSelectionRange=function(){ye.setSelectionRange.apply(ye,arguments)},ne}function ve(_,ye,H,o){if(H){var ne=ye;if(ye.type==="click"){ne=Ue(ye,_,""),H(ne);return}if(_.type!=="file"&&o!==void 0){ne=Ue(ye,_,o),H(ne);return}H(ne)}}function Y(_,ye){if(_){_.focus(ye);var H=ye||{},o=H.cursor;if(o){var ne=_.value.length;switch(o){case"start":_.setSelectionRange(0,0);break;case"end":_.setSelectionRange(ne,ne);break;default:_.setSelectionRange(0,ne)}}}}},28321:function(Sr,St,Z){"use strict";Z.d(St,{iz:function(){return mn},ck:function(){return Se},BW:function(){return ei},sN:function(){return Se},Wd:function(){return en},ZP:function(){return kr},Xl:function(){return Ke}});var z=Z(67711),we=Z(52873),Ue=Z(98506),ve=Z(15142),Y=Z(16886),_=Z(33346),ye=Z(92310),H=Z.n(ye),o=Z(11780),ne=Z(18929),U=Z(13697),B=Z(48736),y=Z(59301),C=Z(4676),T=y.createContext(null);function ee(Ne,tt){return Ne===void 0?null:"".concat(Ne,"-").concat(tt)}function G(Ne){var tt=y.useContext(T);return ee(tt,Ne)}var W=Z(80547),k=["children","locked"],K=y.createContext(null);function re(Ne,tt){var wt=(0,Ue.Z)({},Ne);return Object.keys(tt).forEach(function(mt){var Mt=tt[mt];Mt!==void 0&&(wt[mt]=Mt)}),wt}function me(Ne){var tt=Ne.children,wt=Ne.locked,mt=(0,_.Z)(Ne,k),Mt=y.useContext(K),ht=(0,W.Z)(function(){return re(Mt,mt)},[Mt,mt],function(vt,Gt){return!wt&&(vt[0]!==Gt[0]||!(0,U.Z)(vt[1],Gt[1],!0))});return y.createElement(K.Provider,{value:ht},tt)}var Ce=[],Ie=y.createContext(null);function le(){return y.useContext(Ie)}var xe=y.createContext(Ce);function Ke(Ne){var tt=y.useContext(xe);return y.useMemo(function(){return Ne!==void 0?[].concat((0,ve.Z)(tt),[Ne]):tt},[tt,Ne])}var ge=y.createContext(null),Ze=y.createContext({}),q=Ze,L=Z(29194);function j(Ne){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,L.Z)(Ne)){var wt=Ne.nodeName.toLowerCase(),mt=["input","select","textarea","button"].includes(wt)||Ne.isContentEditable||wt==="a"&&!!Ne.getAttribute("href"),Mt=Ne.getAttribute("tabindex"),ht=Number(Mt),vt=null;return Mt&&!Number.isNaN(ht)?vt=ht:mt&&vt===null&&(vt=0),mt&&Ne.disabled&&(vt=null),vt!==null&&(vt>=0||tt&&vt<0)}return!1}function X(Ne){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,wt=(0,ve.Z)(Ne.querySelectorAll("*")).filter(function(mt){return j(mt,tt)});return j(Ne,tt)&&wt.unshift(Ne),wt}var ue=null;function ae(){ue=document.activeElement}function w(){ue=null}function b(){if(ue)try{ue.focus()}catch(Ne){}}function $(Ne,tt){if(tt.keyCode===9){var wt=X(Ne),mt=wt[tt.shiftKey?0:wt.length-1],Mt=mt===document.activeElement||Ne===document.activeElement;if(Mt){var ht=wt[tt.shiftKey?wt.length-1:0];ht.focus(),tt.preventDefault()}}}var fe=Z(10228),$e=Z(16089),lt=fe.Z.LEFT,Rt=fe.Z.RIGHT,Ct=fe.Z.UP,Vt=fe.Z.DOWN,Qt=fe.Z.ENTER,bt=fe.Z.ESC,He=fe.Z.HOME,nt=fe.Z.END,it=[Ct,Vt,lt,Rt];function At(Ne,tt,wt,mt){var Mt,ht="prev",vt="next",Gt="children",qt="parent";if(Ne==="inline"&&mt===Qt)return{inlineTrigger:!0};var yr=(0,we.Z)((0,we.Z)({},Ct,ht),Vt,vt),Zr=(0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)({},lt,wt?vt:ht),Rt,wt?ht:vt),Vt,Gt),Qt,Gt),Rr=(0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)({},Ct,ht),Vt,vt),Qt,Gt),bt,qt),lt,wt?Gt:qt),Rt,wt?qt:Gt),Dr={inline:yr,horizontal:Zr,vertical:Rr,inlineSub:yr,horizontalSub:Rr,verticalSub:Rr},Q=(Mt=Dr["".concat(Ne).concat(tt?"":"Sub")])===null||Mt===void 0?void 0:Mt[mt];switch(Q){case ht:return{offset:-1,sibling:!0};case vt:return{offset:1,sibling:!0};case qt:return{offset:-1,sibling:!1};case Gt:return{offset:1,sibling:!1};default:return null}}function Ht(Ne){for(var tt=Ne;tt;){if(tt.getAttribute("data-menu-list"))return tt;tt=tt.parentElement}return null}function Fe(Ne,tt){for(var wt=Ne||document.activeElement;wt;){if(tt.has(wt))return wt;wt=wt.parentElement}return null}function R(Ne,tt){var wt=X(Ne,!0);return wt.filter(function(mt){return tt.has(mt)})}function m(Ne,tt,wt){var mt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Ne)return null;var Mt=R(Ne,tt),ht=Mt.length,vt=Mt.findIndex(function(Gt){return wt===Gt});return mt<0?vt===-1?vt=ht-1:vt-=1:mt>0&&(vt+=1),vt=(vt+ht)%ht,Mt[vt]}var F=function(tt,wt){var mt=new Set,Mt=new Map,ht=new Map;return tt.forEach(function(vt){var Gt=document.querySelector("[data-menu-id='".concat(ee(wt,vt),"']"));Gt&&(mt.add(Gt),ht.set(Gt,vt),Mt.set(vt,Gt))}),{elements:mt,key2element:Mt,element2key:ht}};function V(Ne,tt,wt,mt,Mt,ht,vt,Gt,qt,yr){var Zr=y.useRef(),Rr=y.useRef();Rr.current=tt;var Dr=function(){$e.Z.cancel(Zr.current)};return y.useEffect(function(){return function(){Dr()}},[]),function(Q){var P=Q.which;if([].concat(it,[Qt,bt,He,nt]).includes(P)){var oe=ht(),pe=F(oe,mt),Re=pe,je=Re.elements,ct=Re.key2element,dt=Re.element2key,Ot=ct.get(tt),Dt=Fe(Ot,je),be=dt.get(Dt),st=At(Ne,vt(be,!0).length===1,wt,P);if(!st&&P!==He&&P!==nt)return;(it.includes(P)||[He,nt].includes(P))&&Q.preventDefault();var Tt=function(er){if(er){var Ur=er,Lr=er.querySelector("a");Lr!=null&&Lr.getAttribute("href")&&(Ur=Lr);var Gr=dt.get(er);Gt(Gr),Dr(),Zr.current=(0,$e.Z)(function(){Rr.current===Gr&&Ur.focus()})}};if([He,nt].includes(P)||st.sibling||!Dt){var Jt;!Dt||Ne==="inline"?Jt=Mt.current:Jt=Ht(Dt);var Kt,$t=R(Jt,je);P===He?Kt=$t[0]:P===nt?Kt=$t[$t.length-1]:Kt=m(Jt,je,Dt,st.offset),Tt(Kt)}else if(st.inlineTrigger)qt(be);else if(st.offset>0)qt(be,!0),Dr(),Zr.current=(0,$e.Z)(function(){pe=F(oe,mt);var or=Dt.getAttribute("aria-controls"),er=document.getElementById(or),Ur=m(er,pe.elements);Tt(Ur)},5);else if(st.offset<0){var Zt=vt(be,!0),nr=Zt[Zt.length-2],xr=ct.get(nr);qt(nr,!1),Tt(xr)}}yr==null||yr(Q)}}function D(Ne){Promise.resolve().then(Ne)}var N="__RC_UTIL_PATH_SPLIT__",Ae=function(tt){return tt.join(N)},Le=function(tt){return tt.split(N)},Me="rc-menu-more";function Xe(){var Ne=y.useState({}),tt=(0,Y.Z)(Ne,2),wt=tt[1],mt=(0,y.useRef)(new Map),Mt=(0,y.useRef)(new Map),ht=y.useState([]),vt=(0,Y.Z)(ht,2),Gt=vt[0],qt=vt[1],yr=(0,y.useRef)(0),Zr=(0,y.useRef)(!1),Rr=function(){Zr.current||wt({})},Dr=(0,y.useCallback)(function(ct,dt){var Ot=Ae(dt);Mt.current.set(Ot,ct),mt.current.set(ct,Ot),yr.current+=1;var Dt=yr.current;D(function(){Dt===yr.current&&Rr()})},[]),Q=(0,y.useCallback)(function(ct,dt){var Ot=Ae(dt);Mt.current.delete(Ot),mt.current.delete(ct)},[]),P=(0,y.useCallback)(function(ct){qt(ct)},[]),oe=(0,y.useCallback)(function(ct,dt){var Ot=mt.current.get(ct)||"",Dt=Le(Ot);return dt&&Gt.includes(Dt[0])&&Dt.unshift(Me),Dt},[Gt]),pe=(0,y.useCallback)(function(ct,dt){return ct.filter(function(Ot){return Ot!==void 0}).some(function(Ot){var Dt=oe(Ot,!0);return Dt.includes(dt)})},[oe]),Re=function(){var dt=(0,ve.Z)(mt.current.keys());return Gt.length&&dt.push(Me),dt},je=(0,y.useCallback)(function(ct){var dt="".concat(mt.current.get(ct)).concat(N),Ot=new Set;return(0,ve.Z)(Mt.current.keys()).forEach(function(Dt){Dt.startsWith(dt)&&Ot.add(Mt.current.get(Dt))}),Ot},[]);return y.useEffect(function(){return function(){Zr.current=!0}},[]),{registerPath:Dr,unregisterPath:Q,refreshOverflowKeys:P,isSubPathKey:pe,getKeyPath:oe,getKeys:Re,getSubPathKeys:je}}function qe(Ne){var tt=y.useRef(Ne);tt.current=Ne;var wt=y.useCallback(function(){for(var mt,Mt=arguments.length,ht=new Array(Mt),vt=0;vt<Mt;vt++)ht[vt]=arguments[vt];return(mt=tt.current)===null||mt===void 0?void 0:mt.call.apply(mt,[tt].concat(ht))},[]);return Ne?wt:void 0}var Pt=Math.random().toFixed(5).toString().slice(2),ot=0;function Bt(Ne){var tt=(0,ne.Z)(Ne,{value:Ne}),wt=(0,Y.Z)(tt,2),mt=wt[0],Mt=wt[1];return y.useEffect(function(){ot+=1;var ht="".concat(Pt,"-").concat(ot);Mt("rc-menu-uuid-".concat(ht))},[]),mt}var ut=Z(42573),gt=Z(58698),Ye=Z(74700),rt=Z(45080),yt=Z(2738),It=Z(8654);function zt(Ne,tt,wt,mt){var Mt=y.useContext(K),ht=Mt.activeKey,vt=Mt.onActive,Gt=Mt.onInactive,qt={active:ht===Ne};return tt||(qt.onMouseEnter=function(yr){wt==null||wt({key:Ne,domEvent:yr}),vt(Ne)},qt.onMouseLeave=function(yr){mt==null||mt({key:Ne,domEvent:yr}),Gt(Ne)}),qt}function kt(Ne){var tt=y.useContext(K),wt=tt.mode,mt=tt.rtl,Mt=tt.inlineIndent;if(wt!=="inline")return null;var ht=Ne;return mt?{paddingRight:ht*Mt}:{paddingLeft:ht*Mt}}function tr(Ne){var tt=Ne.icon,wt=Ne.props,mt=Ne.children,Mt;return tt===null||tt===!1?null:(typeof tt=="function"?Mt=y.createElement(tt,(0,Ue.Z)({},wt)):typeof tt!="boolean"&&(Mt=tt),Mt||mt||null)}var Wt=["item"];function ir(Ne){var tt=Ne.item,wt=(0,_.Z)(Ne,Wt);return Object.defineProperty(wt,"item",{get:function(){return(0,B.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),tt}}),wt}var Er=["title","attribute","elementRef"],zr=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Nt=["active"],ur=function(Ne){(0,Ye.Z)(wt,Ne);var tt=(0,rt.Z)(wt);function wt(){return(0,ut.Z)(this,wt),tt.apply(this,arguments)}return(0,gt.Z)(wt,[{key:"render",value:function(){var Mt=this.props,ht=Mt.title,vt=Mt.attribute,Gt=Mt.elementRef,qt=(0,_.Z)(Mt,Er),yr=(0,yt.Z)(qt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,B.ZP)(!vt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),y.createElement(o.Z.Item,(0,z.Z)({},vt,{title:typeof ht=="string"?ht:void 0},yr,{ref:Gt}))}}]),wt}(y.Component),ke=y.forwardRef(function(Ne,tt){var wt=Ne.style,mt=Ne.className,Mt=Ne.eventKey,ht=Ne.warnKey,vt=Ne.disabled,Gt=Ne.itemIcon,qt=Ne.children,yr=Ne.role,Zr=Ne.onMouseEnter,Rr=Ne.onMouseLeave,Dr=Ne.onClick,Q=Ne.onKeyDown,P=Ne.onFocus,oe=(0,_.Z)(Ne,zr),pe=G(Mt),Re=y.useContext(K),je=Re.prefixCls,ct=Re.onItemClick,dt=Re.disabled,Ot=Re.overflowDisabled,Dt=Re.itemIcon,be=Re.selectedKeys,st=Re.onActive,Tt=y.useContext(q),Jt=Tt._internalRenderMenuItem,Kt="".concat(je,"-item"),$t=y.useRef(),Zt=y.useRef(),nr=dt||vt,xr=(0,It.x1)(tt,Zt),or=Ke(Mt),er=function(Vr){return{key:Mt,keyPath:(0,ve.Z)(or).reverse(),item:$t.current,domEvent:Vr}},Ur=Gt||Dt,Lr=zt(Mt,nr,Zr,Rr),Gr=Lr.active,Tr=(0,_.Z)(Lr,Nt),Br=be.includes(Mt),Yr=kt(or.length),Qr=function(Vr){if(!nr){var sn=er(Vr);Dr==null||Dr(ir(sn)),ct(sn)}},Xr=function(Vr){if(Q==null||Q(Vr),Vr.which===fe.Z.ENTER){var sn=er(Vr);Dr==null||Dr(ir(sn)),ct(sn)}},ln=function(Vr){st(Mt),P==null||P(Vr)},_n={};Ne.role==="option"&&(_n["aria-selected"]=Br);var un=y.createElement(ur,(0,z.Z)({ref:$t,elementRef:xr,role:yr===null?"none":yr||"menuitem",tabIndex:vt?null:-1,"data-menu-id":Ot&&pe?null:pe},(0,yt.Z)(oe,["extra"]),Tr,_n,{component:"li","aria-disabled":vt,style:(0,Ue.Z)((0,Ue.Z)({},Yr),wt),className:H()(Kt,(0,we.Z)((0,we.Z)((0,we.Z)({},"".concat(Kt,"-active"),Gr),"".concat(Kt,"-selected"),Br),"".concat(Kt,"-disabled"),nr),mt),onClick:Qr,onKeyDown:Xr,onFocus:ln}),qt,y.createElement(tr,{props:(0,Ue.Z)((0,Ue.Z)({},Ne),{},{isSelected:Br}),icon:Ur}));return Jt&&(un=Jt(un,Ne,{selected:Br})),un});function De(Ne,tt){var wt=Ne.eventKey,mt=le(),Mt=Ke(wt);return y.useEffect(function(){if(mt)return mt.registerPath(wt,Mt),function(){mt.unregisterPath(wt,Mt)}},[Mt]),mt?null:y.createElement(ke,(0,z.Z)({},Ne,{ref:tt}))}var Se=y.forwardRef(De),te=["className","children"],se=function(tt,wt){var mt=tt.className,Mt=tt.children,ht=(0,_.Z)(tt,te),vt=y.useContext(K),Gt=vt.prefixCls,qt=vt.mode,yr=vt.rtl;return y.createElement("ul",(0,z.Z)({className:H()(Gt,yr&&"".concat(Gt,"-rtl"),"".concat(Gt,"-sub"),"".concat(Gt,"-").concat(qt==="inline"?"inline":"vertical"),mt),role:"menu"},ht,{"data-menu-list":!0,ref:wt}),Mt)},ce=y.forwardRef(se);ce.displayName="SubMenuList";var Ee=ce,Te=Z(11592);function Et(Ne,tt){return(0,Te.Z)(Ne).map(function(wt,mt){if(y.isValidElement(wt)){var Mt,ht,vt=wt.key,Gt=(Mt=(ht=wt.props)===null||ht===void 0?void 0:ht.eventKey)!==null&&Mt!==void 0?Mt:vt,qt=Gt==null;qt&&(Gt="tmp_key-".concat([].concat((0,ve.Z)(tt),[mt]).join("-")));var yr={key:Gt,eventKey:Gt};return y.cloneElement(wt,yr)}return wt})}var Ut=Z(65030),Ft={adjustX:1,adjustY:1},rr={topLeft:{points:["bl","tl"],overflow:Ft},topRight:{points:["br","tr"],overflow:Ft},bottomLeft:{points:["tl","bl"],overflow:Ft},bottomRight:{points:["tr","br"],overflow:Ft},leftTop:{points:["tr","tl"],overflow:Ft},leftBottom:{points:["br","bl"],overflow:Ft},rightTop:{points:["tl","tr"],overflow:Ft},rightBottom:{points:["bl","br"],overflow:Ft}},Ir={topLeft:{points:["bl","tl"],overflow:Ft},topRight:{points:["br","tr"],overflow:Ft},bottomLeft:{points:["tl","bl"],overflow:Ft},bottomRight:{points:["tr","br"],overflow:Ft},rightTop:{points:["tr","tl"],overflow:Ft},rightBottom:{points:["br","bl"],overflow:Ft},leftTop:{points:["tl","tr"],overflow:Ft},leftBottom:{points:["bl","br"],overflow:Ft}},qr=null;function jt(Ne,tt,wt){if(tt)return tt;if(wt)return wt[Ne]||wt.other}var Yt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function $r(Ne){var tt=Ne.prefixCls,wt=Ne.visible,mt=Ne.children,Mt=Ne.popup,ht=Ne.popupStyle,vt=Ne.popupClassName,Gt=Ne.popupOffset,qt=Ne.disabled,yr=Ne.mode,Zr=Ne.onVisibleChange,Rr=y.useContext(K),Dr=Rr.getPopupContainer,Q=Rr.rtl,P=Rr.subMenuOpenDelay,oe=Rr.subMenuCloseDelay,pe=Rr.builtinPlacements,Re=Rr.triggerSubMenuAction,je=Rr.forceSubMenuRender,ct=Rr.rootClassName,dt=Rr.motion,Ot=Rr.defaultMotions,Dt=y.useState(!1),be=(0,Y.Z)(Dt,2),st=be[0],Tt=be[1],Jt=Q?(0,Ue.Z)((0,Ue.Z)({},Ir),pe):(0,Ue.Z)((0,Ue.Z)({},rr),pe),Kt=Yt[yr],$t=jt(yr,dt,Ot),Zt=y.useRef($t);yr!=="inline"&&(Zt.current=$t);var nr=(0,Ue.Z)((0,Ue.Z)({},Zt.current),{},{leavedClassName:"".concat(tt,"-hidden"),removeOnLeave:!1,motionAppear:!0}),xr=y.useRef();return y.useEffect(function(){return xr.current=(0,$e.Z)(function(){Tt(wt)}),function(){$e.Z.cancel(xr.current)}},[wt]),y.createElement(Ut.Z,{prefixCls:tt,popupClassName:H()("".concat(tt,"-popup"),(0,we.Z)({},"".concat(tt,"-rtl"),Q),vt,ct),stretch:yr==="horizontal"?"minWidth":null,getPopupContainer:Dr,builtinPlacements:Jt,popupPlacement:Kt,popupVisible:st,popup:Mt,popupStyle:ht,popupAlign:Gt&&{offset:Gt},action:qt?[]:[Re],mouseEnterDelay:P,mouseLeaveDelay:oe,onPopupVisibleChange:Zr,forceRender:je,popupMotion:nr,fresh:!0},mt)}var fn=Z(77900);function Oe(Ne){var tt=Ne.id,wt=Ne.open,mt=Ne.keyPath,Mt=Ne.children,ht="inline",vt=y.useContext(K),Gt=vt.prefixCls,qt=vt.forceSubMenuRender,yr=vt.motion,Zr=vt.defaultMotions,Rr=vt.mode,Dr=y.useRef(!1);Dr.current=Rr===ht;var Q=y.useState(!Dr.current),P=(0,Y.Z)(Q,2),oe=P[0],pe=P[1],Re=Dr.current?wt:!1;y.useEffect(function(){Dr.current&&pe(!1)},[Rr]);var je=(0,Ue.Z)({},jt(ht,yr,Zr));mt.length>1&&(je.motionAppear=!1);var ct=je.onVisibleChanged;return je.onVisibleChanged=function(dt){return!Dr.current&&!dt&&pe(!0),ct==null?void 0:ct(dt)},oe?null:y.createElement(me,{mode:ht,locked:!Dr.current},y.createElement(fn.default,(0,z.Z)({visible:Re},je,{forceRender:qt,removeOnLeave:!1,leavedClassName:"".concat(Gt,"-hidden")}),function(dt){var Ot=dt.className,Dt=dt.style;return y.createElement(Ee,{id:tt,className:Ot,style:Dt},Mt)}))}var Wr=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Pr=["active"],Mr=y.forwardRef(function(Ne,tt){var wt=Ne.style,mt=Ne.className,Mt=Ne.title,ht=Ne.eventKey,vt=Ne.warnKey,Gt=Ne.disabled,qt=Ne.internalPopupClose,yr=Ne.children,Zr=Ne.itemIcon,Rr=Ne.expandIcon,Dr=Ne.popupClassName,Q=Ne.popupOffset,P=Ne.popupStyle,oe=Ne.onClick,pe=Ne.onMouseEnter,Re=Ne.onMouseLeave,je=Ne.onTitleClick,ct=Ne.onTitleMouseEnter,dt=Ne.onTitleMouseLeave,Ot=(0,_.Z)(Ne,Wr),Dt=G(ht),be=y.useContext(K),st=be.prefixCls,Tt=be.mode,Jt=be.openKeys,Kt=be.disabled,$t=be.overflowDisabled,Zt=be.activeKey,nr=be.selectedKeys,xr=be.itemIcon,or=be.expandIcon,er=be.onItemClick,Ur=be.onOpenChange,Lr=be.onActive,Gr=y.useContext(q),Tr=Gr._internalRenderSubMenuItem,Br=y.useContext(ge),Yr=Br.isSubPathKey,Qr=Ke(),Xr="".concat(st,"-submenu"),ln=Kt||Gt,_n=y.useRef(),un=y.useRef(),jr=Zr!=null?Zr:xr,Vr=Rr!=null?Rr:or,sn=Jt.includes(ht),rn=!$t&&sn,Vn=Yr(nr,ht),sr=zt(ht,ln,ct,dt),pn=sr.active,bn=(0,_.Z)(sr,Pr),Sn=y.useState(!1),vn=(0,Y.Z)(Sn,2),Wn=vn[0],si=vn[1],ri=function(An){ln||si(An)},hn=function(An){ri(!0),pe==null||pe({key:ht,domEvent:An})},Bi=function(An){ri(!1),Re==null||Re({key:ht,domEvent:An})},li=y.useMemo(function(){return pn||(Tt!=="inline"?Wn||Yr([Zt],ht):!1)},[Tt,pn,Zt,Wn,ht,Yr]),Zn=kt(Qr.length),ui=function(An){ln||(je==null||je({key:ht,domEvent:An}),Tt==="inline"&&Ur(ht,!sn))},Ti=qe(function(Qn){oe==null||oe(ir(Qn)),er(Qn)}),Hi=function(An){Tt!=="inline"&&Ur(ht,An)},gi=function(){Lr(ht)},hi=Dt&&"".concat(Dt,"-popup"),Ei=y.useMemo(function(){return y.createElement(tr,{icon:Tt!=="horizontal"?Vr:void 0,props:(0,Ue.Z)((0,Ue.Z)({},Ne),{},{isOpen:rn,isSubMenu:!0})},y.createElement("i",{className:"".concat(Xr,"-arrow")}))},[Tt,Vr,Ne,rn,Xr]),zn=y.createElement("div",(0,z.Z)({role:"menuitem",style:Zn,className:"".concat(Xr,"-title"),tabIndex:ln?null:-1,ref:_n,title:typeof Mt=="string"?Mt:null,"data-menu-id":$t&&Dt?null:Dt,"aria-expanded":rn,"aria-haspopup":!0,"aria-controls":hi,"aria-disabled":ln,onClick:ui,onFocus:gi},bn),Mt,Ei),pi=y.useRef(Tt);if(Tt!=="inline"&&Qr.length>1?pi.current="vertical":pi.current=Tt,!$t){var Ki=pi.current;zn=y.createElement($r,{mode:Ki,prefixCls:Xr,visible:!qt&&rn&&Tt!=="inline",popupClassName:Dr,popupOffset:Q,popupStyle:P,popup:y.createElement(me,{mode:Ki==="horizontal"?"vertical":Ki},y.createElement(Ee,{id:hi,ref:un},yr)),disabled:ln,onVisibleChange:Hi},zn)}var Xn=y.createElement(o.Z.Item,(0,z.Z)({ref:tt,role:"none"},Ot,{component:"li",style:wt,className:H()(Xr,"".concat(Xr,"-").concat(Tt),mt,(0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)({},"".concat(Xr,"-open"),rn),"".concat(Xr,"-active"),li),"".concat(Xr,"-selected"),Vn),"".concat(Xr,"-disabled"),ln)),onMouseEnter:hn,onMouseLeave:Bi}),zn,!$t&&y.createElement(Oe,{id:hi,open:rn,keyPath:Qr},yr));return Tr&&(Xn=Tr(Xn,Ne,{selected:Vn,active:li,open:rn,disabled:ln})),y.createElement(me,{onItemClick:Ti,mode:Tt==="horizontal"?"vertical":Tt,itemIcon:jr,expandIcon:Vr},Xn)}),In=y.forwardRef(function(Ne,tt){var wt=Ne.eventKey,mt=Ne.children,Mt=Ke(wt),ht=Et(mt,Mt),vt=le();y.useEffect(function(){if(vt)return vt.registerPath(wt,Mt),function(){vt.unregisterPath(wt,Mt)}},[Mt]);var Gt;return vt?Gt=ht:Gt=y.createElement(Mr,(0,z.Z)({ref:tt},Ne),ht),y.createElement(xe.Provider,{value:Mt},Gt)}),en=In,Fn=Z(26420);function mn(Ne){var tt=Ne.className,wt=Ne.style,mt=y.useContext(K),Mt=mt.prefixCls,ht=le();return ht?null:y.createElement("li",{role:"separator",className:H()("".concat(Mt,"-item-divider"),tt),style:wt})}var Nn=["className","title","eventKey","children"],Rn=y.forwardRef(function(Ne,tt){var wt=Ne.className,mt=Ne.title,Mt=Ne.eventKey,ht=Ne.children,vt=(0,_.Z)(Ne,Nn),Gt=y.useContext(K),qt=Gt.prefixCls,yr="".concat(qt,"-item-group");return y.createElement("li",(0,z.Z)({ref:tt,role:"presentation"},vt,{onClick:function(Rr){return Rr.stopPropagation()},className:H()(yr,wt)}),y.createElement("div",{role:"presentation",className:"".concat(yr,"-title"),title:typeof mt=="string"?mt:void 0},mt),y.createElement("ul",{role:"group",className:"".concat(yr,"-list")},ht))}),Hn=y.forwardRef(function(Ne,tt){var wt=Ne.eventKey,mt=Ne.children,Mt=Ke(wt),ht=Et(mt,Mt),vt=le();return vt?ht:y.createElement(Rn,(0,z.Z)({ref:tt},(0,yt.Z)(Ne,["warnKey"])),ht)}),ei=Hn,tn=["label","children","key","type","extra"];function an(Ne,tt,wt){var mt=tt.item,Mt=tt.group,ht=tt.submenu,vt=tt.divider;return(Ne||[]).map(function(Gt,qt){if(Gt&&(0,Fn.Z)(Gt)==="object"){var yr=Gt,Zr=yr.label,Rr=yr.children,Dr=yr.key,Q=yr.type,P=yr.extra,oe=(0,_.Z)(yr,tn),pe=Dr!=null?Dr:"tmp-".concat(qt);return Rr||Q==="group"?Q==="group"?y.createElement(Mt,(0,z.Z)({key:pe},oe,{title:Zr}),an(Rr,tt,wt)):y.createElement(ht,(0,z.Z)({key:pe},oe,{title:Zr}),an(Rr,tt,wt)):Q==="divider"?y.createElement(vt,(0,z.Z)({key:pe},oe)):y.createElement(mt,(0,z.Z)({key:pe},oe,{extra:P}),Zr,(!!P||P===0)&&y.createElement("span",{className:"".concat(wt,"-item-extra")},P))}return null}).filter(function(Gt){return Gt})}function gn(Ne,tt,wt,mt,Mt){var ht=Ne,vt=(0,Ue.Z)({divider:mn,item:Se,group:ei,submenu:en},mt);return tt&&(ht=an(tt,vt,Mt)),Et(ht,wt)}var ii=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],Hr=[],ti=y.forwardRef(function(Ne,tt){var wt,mt=Ne,Mt=mt.prefixCls,ht=Mt===void 0?"rc-menu":Mt,vt=mt.rootClassName,Gt=mt.style,qt=mt.className,yr=mt.tabIndex,Zr=yr===void 0?0:yr,Rr=mt.items,Dr=mt.children,Q=mt.direction,P=mt.id,oe=mt.mode,pe=oe===void 0?"vertical":oe,Re=mt.inlineCollapsed,je=mt.disabled,ct=mt.disabledOverflow,dt=mt.subMenuOpenDelay,Ot=dt===void 0?.1:dt,Dt=mt.subMenuCloseDelay,be=Dt===void 0?.1:Dt,st=mt.forceSubMenuRender,Tt=mt.defaultOpenKeys,Jt=mt.openKeys,Kt=mt.activeKey,$t=mt.defaultActiveFirst,Zt=mt.selectable,nr=Zt===void 0?!0:Zt,xr=mt.multiple,or=xr===void 0?!1:xr,er=mt.defaultSelectedKeys,Ur=mt.selectedKeys,Lr=mt.onSelect,Gr=mt.onDeselect,Tr=mt.inlineIndent,Br=Tr===void 0?24:Tr,Yr=mt.motion,Qr=mt.defaultMotions,Xr=mt.triggerSubMenuAction,ln=Xr===void 0?"hover":Xr,_n=mt.builtinPlacements,un=mt.itemIcon,jr=mt.expandIcon,Vr=mt.overflowedIndicator,sn=Vr===void 0?"...":Vr,rn=mt.overflowedIndicatorPopupClassName,Vn=mt.getPopupContainer,sr=mt.onClick,pn=mt.onOpenChange,bn=mt.onKeyDown,Sn=mt.openAnimation,vn=mt.openTransitionName,Wn=mt._internalRenderMenuItem,si=mt._internalRenderSubMenuItem,ri=mt._internalComponents,hn=(0,_.Z)(mt,ii),Bi=y.useMemo(function(){return[gn(Dr,Rr,Hr,ri,ht),gn(Dr,Rr,Hr,{},ht)]},[Dr,Rr,ri]),li=(0,Y.Z)(Bi,2),Zn=li[0],ui=li[1],Ti=y.useState(!1),Hi=(0,Y.Z)(Ti,2),gi=Hi[0],hi=Hi[1],Ei=y.useRef(),zn=Bt(P),pi=Q==="rtl",Ki=(0,ne.Z)(Tt,{value:Jt,postState:function(wn){return wn||Hr}}),Xn=(0,Y.Z)(Ki,2),Qn=Xn[0],An=Xn[1],kn=function(wn){var On=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function fi(){An(wn),pn==null||pn(wn)}On?(0,C.flushSync)(fi):fi()},ci=y.useState(Qn),Ii=(0,Y.Z)(ci,2),Di=Ii[0],Oi=Ii[1],wi=y.useRef(!1),Bn=y.useMemo(function(){return(pe==="inline"||pe==="vertical")&&Re?["vertical",Re]:[pe,!1]},[pe,Re]),pr=(0,Y.Z)(Bn,2),Nr=pr[0],En=pr[1],xn=Nr==="inline",yn=y.useState(Nr),ji=(0,Y.Z)(yn,2),jn=ji[0],Kn=ji[1],$i=y.useState(En),ni=(0,Y.Z)($i,2),Ci=ni[0],Gi=ni[1];y.useEffect(function(){Kn(Nr),Gi(En),wi.current&&(xn?An(Di):kn(Hr))},[Nr,En]);var Ss=y.useState(0),Dn=(0,Y.Z)(Ss,2),Es=Dn[0],eA=Dn[1],Ts=Es>=Zn.length-1||jn!=="horizontal"||ct;y.useEffect(function(){xn&&Oi(Qn)},[Qn]),y.useEffect(function(){return wi.current=!0,function(){wi.current=!1}},[]);var Yi=Xe(),As=Yi.registerPath,Ms=Yi.unregisterPath,tA=Yi.refreshOverflowKeys,$n=Yi.isSubPathKey,Vi=Yi.getKeyPath,Li=Yi.getKeys,Jn=Yi.getSubPathKeys,Xi=y.useMemo(function(){return{registerPath:As,unregisterPath:Ms}},[As,Ms]),_A=y.useMemo(function(){return{isSubPathKey:$n}},[$n]);y.useEffect(function(){tA(Ts?Hr:Zn.slice(Es+1).map(function(pt){return pt.key}))},[Es,Ts]);var vA=(0,ne.Z)(Kt||$t&&((wt=Zn[0])===null||wt===void 0?void 0:wt.key),{value:Kt}),Ns=(0,Y.Z)(vA,2),as=Ns[0],Hs=Ns[1],os=qe(function(pt){Hs(pt)}),Pi=qe(function(){Hs(void 0)});(0,y.useImperativeHandle)(tt,function(){return{list:Ei.current,focus:function(wn){var On,fi=Li(),di=F(fi,zn),us=di.elements,Ds=di.key2element,EA=di.element2key,wA=R(Ei.current,us),cs=as!=null?as:wA[0]?EA.get(wA[0]):(On=Zn.find(function(sA){return!sA.props.disabled}))===null||On===void 0?void 0:On.key,Wi=Ds.get(cs);if(cs&&Wi){var qi;Wi==null||(qi=Wi.focus)===null||qi===void 0||qi.call(Wi,wn)}}}});var yA=(0,ne.Z)(er||[],{value:Ur,postState:function(wn){return Array.isArray(wn)?wn:wn==null?Hr:[wn]}}),rA=(0,Y.Z)(yA,2),Ji=rA[0],nA=rA[1],Is=function(wn){if(nr){var On=wn.key,fi=Ji.includes(On),di;or?fi?di=Ji.filter(function(Ds){return Ds!==On}):di=[].concat((0,ve.Z)(Ji),[On]):di=[On],nA(di);var us=(0,Ue.Z)((0,Ue.Z)({},wn),{},{selectedKeys:di});fi?Gr==null||Gr(us):Lr==null||Lr(us)}!or&&Qn.length&&jn!=="inline"&&kn(Hr)},la=qe(function(pt){sr==null||sr(ir(pt)),Is(pt)}),mi=qe(function(pt,wn){var On=Qn.filter(function(di){return di!==pt});if(wn)On.push(pt);else if(jn!=="inline"){var fi=Jn(pt);On=On.filter(function(di){return!fi.has(di)})}(0,U.Z)(Qn,On,!0)||kn(On,!0)}),iA=function(wn,On){var fi=On!=null?On:!Qn.includes(wn);mi(wn,fi)},ua=V(jn,as,pi,zn,Ei,Li,Vi,Hs,iA,bn);y.useEffect(function(){hi(!0)},[]);var BA=y.useMemo(function(){return{_internalRenderMenuItem:Wn,_internalRenderSubMenuItem:si}},[Wn,si]),ls=jn!=="horizontal"||ct?Zn:Zn.map(function(pt,wn){return y.createElement(me,{key:pt.key,overflowDisabled:wn>Es},pt)}),ca=y.createElement(o.Z,(0,z.Z)({id:P,ref:Ei,prefixCls:"".concat(ht,"-overflow"),component:"ul",itemComponent:Se,className:H()(ht,"".concat(ht,"-root"),"".concat(ht,"-").concat(jn),qt,(0,we.Z)((0,we.Z)({},"".concat(ht,"-inline-collapsed"),Ci),"".concat(ht,"-rtl"),pi),vt),dir:Q,style:Gt,role:"menu",tabIndex:Zr,data:ls,renderRawItem:function(wn){return wn},renderRawRest:function(wn){var On=wn.length,fi=On?Zn.slice(-On):null;return y.createElement(en,{eventKey:Me,title:sn,disabled:Ts,internalPopupClose:On===0,popupClassName:rn},fi)},maxCount:jn!=="horizontal"||ct?o.Z.INVALIDATE:o.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(wn){eA(wn)},onKeyDown:ua},hn));return y.createElement(q.Provider,{value:BA},y.createElement(T.Provider,{value:zn},y.createElement(me,{prefixCls:ht,rootClassName:vt,mode:jn,openKeys:Qn,rtl:pi,disabled:je,motion:gi?Yr:null,defaultMotions:gi?Qr:null,activeKey:as,onActive:os,onInactive:Pi,selectedKeys:Ji,inlineIndent:Br,subMenuOpenDelay:Ot,subMenuCloseDelay:be,forceSubMenuRender:st,builtinPlacements:_n,triggerSubMenuAction:ln,getPopupContainer:Vn,itemIcon:un,expandIcon:jr,onItemClick:la,onOpenChange:mi},y.createElement(ge.Provider,{value:_A},ca),y.createElement("div",{style:{display:"none"},"aria-hidden":!0},y.createElement(Ie.Provider,{value:Xi},ui)))))}),Cn=ti,wr=Cn;wr.Item=Se,wr.SubMenu=en,wr.ItemGroup=ei,wr.Divider=mn;var kr=wr},11780:function(Sr,St,Z){"use strict";Z.d(St,{Z:function(){return ae}});var z=Z(67711),we=Z(98506),Ue=Z(16886),ve=Z(33346),Y=Z(59301),_=Z(92310),ye=Z.n(_),H=Z(29301),o=Z(34280),ne=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],U=void 0;function B(w,b){var $=w.prefixCls,fe=w.invalidate,$e=w.item,lt=w.renderItem,Rt=w.responsive,Ct=w.responsiveDisabled,Vt=w.registerSize,Qt=w.itemKey,bt=w.className,He=w.style,nt=w.children,it=w.display,At=w.order,Ht=w.component,Fe=Ht===void 0?"div":Ht,R=(0,ve.Z)(w,ne),m=Rt&&!it;function F(Le){Vt(Qt,Le)}Y.useEffect(function(){return function(){F(null)}},[]);var V=lt&&$e!==U?lt($e,{index:At}):nt,D;fe||(D={opacity:m?0:1,height:m?0:U,overflowY:m?"hidden":U,order:Rt?At:U,pointerEvents:m?"none":U,position:m?"absolute":U});var N={};m&&(N["aria-hidden"]=!0);var Ae=Y.createElement(Fe,(0,z.Z)({className:ye()(!fe&&$,bt),style:(0,we.Z)((0,we.Z)({},D),He)},N,R,{ref:b}),V);return Rt&&(Ae=Y.createElement(H.Z,{onResize:function(Me){var Xe=Me.offsetWidth;F(Xe)},disabled:Ct},Ae)),Ae}var y=Y.forwardRef(B);y.displayName="Item";var C=y,T=Z(6089),ee=Z(4676),G=Z(16089);function W(w){if(typeof MessageChannel=="undefined")(0,G.Z)(w);else{var b=new MessageChannel;b.port1.onmessage=function(){return w()},b.port2.postMessage(void 0)}}function k(){var w=Y.useRef(null),b=function(fe){w.current||(w.current=[],W(function(){(0,ee.unstable_batchedUpdates)(function(){w.current.forEach(function($e){$e()}),w.current=null})})),w.current.push(fe)};return b}function K(w,b){var $=Y.useState(b),fe=(0,Ue.Z)($,2),$e=fe[0],lt=fe[1],Rt=(0,T.Z)(function(Ct){w(function(){lt(Ct)})});return[$e,Rt]}var re=Y.createContext(null),me=["component"],Ce=["className"],Ie=["className"],le=function(b,$){var fe=Y.useContext(re);if(!fe){var $e=b.component,lt=$e===void 0?"div":$e,Rt=(0,ve.Z)(b,me);return Y.createElement(lt,(0,z.Z)({},Rt,{ref:$}))}var Ct=fe.className,Vt=(0,ve.Z)(fe,Ce),Qt=b.className,bt=(0,ve.Z)(b,Ie);return Y.createElement(re.Provider,{value:null},Y.createElement(C,(0,z.Z)({ref:$,className:ye()(Ct,Qt)},Vt,bt)))},xe=Y.forwardRef(le);xe.displayName="RawItem";var Ke=xe,ge=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Ze="responsive",q="invalidate";function L(w){return"+ ".concat(w.length," ...")}function j(w,b){var $=w.prefixCls,fe=$===void 0?"rc-overflow":$,$e=w.data,lt=$e===void 0?[]:$e,Rt=w.renderItem,Ct=w.renderRawItem,Vt=w.itemKey,Qt=w.itemWidth,bt=Qt===void 0?10:Qt,He=w.ssr,nt=w.style,it=w.className,At=w.maxCount,Ht=w.renderRest,Fe=w.renderRawRest,R=w.suffix,m=w.component,F=m===void 0?"div":m,V=w.itemComponent,D=w.onVisibleChange,N=(0,ve.Z)(w,ge),Ae=He==="full",Le=k(),Me=K(Le,null),Xe=(0,Ue.Z)(Me,2),qe=Xe[0],Pt=Xe[1],ot=qe||0,Bt=K(Le,new Map),ut=(0,Ue.Z)(Bt,2),gt=ut[0],Ye=ut[1],rt=K(Le,0),yt=(0,Ue.Z)(rt,2),It=yt[0],zt=yt[1],kt=K(Le,0),tr=(0,Ue.Z)(kt,2),Wt=tr[0],ir=tr[1],Er=K(Le,0),zr=(0,Ue.Z)(Er,2),Nt=zr[0],ur=zr[1],ke=(0,Y.useState)(null),De=(0,Ue.Z)(ke,2),Se=De[0],te=De[1],se=(0,Y.useState)(null),ce=(0,Ue.Z)(se,2),Ee=ce[0],Te=ce[1],Et=Y.useMemo(function(){return Ee===null&&Ae?Number.MAX_SAFE_INTEGER:Ee||0},[Ee,qe]),Ut=(0,Y.useState)(!1),Ft=(0,Ue.Z)(Ut,2),rr=Ft[0],Ir=Ft[1],qr="".concat(fe,"-item"),jt=Math.max(It,Wt),Yt=At===Ze,$r=lt.length&&Yt,fn=At===q,Oe=$r||typeof At=="number"&&lt.length>At,Wr=(0,Y.useMemo)(function(){var wr=lt;return $r?qe===null&&Ae?wr=lt:wr=lt.slice(0,Math.min(lt.length,ot/bt)):typeof At=="number"&&(wr=lt.slice(0,At)),wr},[lt,bt,qe,At,$r]),Pr=(0,Y.useMemo)(function(){return $r?lt.slice(Et+1):lt.slice(Wr.length)},[lt,Wr,$r,Et]),Mr=(0,Y.useCallback)(function(wr,kr){var Ne;return typeof Vt=="function"?Vt(wr):(Ne=Vt&&(wr==null?void 0:wr[Vt]))!==null&&Ne!==void 0?Ne:kr},[Vt]),In=(0,Y.useCallback)(Rt||function(wr){return wr},[Rt]);function en(wr,kr,Ne){Ee===wr&&(kr===void 0||kr===Se)||(Te(wr),Ne||(Ir(wr<lt.length-1),D==null||D(wr)),kr!==void 0&&te(kr))}function Fn(wr,kr){Pt(kr.clientWidth)}function mn(wr,kr){Ye(function(Ne){var tt=new Map(Ne);return kr===null?tt.delete(wr):tt.set(wr,kr),tt})}function Nn(wr,kr){ir(kr),zt(Wt)}function Rn(wr,kr){ur(kr)}function Hn(wr){return gt.get(Mr(Wr[wr],wr))}(0,o.Z)(function(){if(ot&&typeof jt=="number"&&Wr){var wr=Nt,kr=Wr.length,Ne=kr-1;if(!kr){en(0,null);return}for(var tt=0;tt<kr;tt+=1){var wt=Hn(tt);if(Ae&&(wt=wt||0),wt===void 0){en(tt-1,void 0,!0);break}if(wr+=wt,Ne===0&&wr<=ot||tt===Ne-1&&wr+Hn(Ne)<=ot){en(Ne,null);break}else if(wr+jt>ot){en(tt-1,wr-wt-Nt+Wt);break}}R&&Hn(0)+Nt>ot&&te(null)}},[ot,gt,Wt,Nt,Mr,Wr]);var ei=rr&&!!Pr.length,tn={};Se!==null&&$r&&(tn={position:"absolute",left:Se,top:0});var an={prefixCls:qr,responsive:$r,component:V,invalidate:fn},gn=Ct?function(wr,kr){var Ne=Mr(wr,kr);return Y.createElement(re.Provider,{key:Ne,value:(0,we.Z)((0,we.Z)({},an),{},{order:kr,item:wr,itemKey:Ne,registerSize:mn,display:kr<=Et})},Ct(wr,kr))}:function(wr,kr){var Ne=Mr(wr,kr);return Y.createElement(C,(0,z.Z)({},an,{order:kr,key:Ne,item:wr,renderItem:In,itemKey:Ne,registerSize:mn,display:kr<=Et}))},ii={order:ei?Et:Number.MAX_SAFE_INTEGER,className:"".concat(qr,"-rest"),registerSize:Nn,display:ei},Hr=Ht||L,ti=Fe?Y.createElement(re.Provider,{value:(0,we.Z)((0,we.Z)({},an),ii)},Fe(Pr)):Y.createElement(C,(0,z.Z)({},an,ii),typeof Hr=="function"?Hr(Pr):Hr),Cn=Y.createElement(F,(0,z.Z)({className:ye()(!fn&&fe,it),style:nt,ref:b},N),Wr.map(gn),Oe?ti:null,R&&Y.createElement(C,(0,z.Z)({},an,{responsive:Yt,responsiveDisabled:!$r,order:Et,className:"".concat(qr,"-suffix"),registerSize:Rn,display:!0,style:tn}),R));return Yt?Y.createElement(H.Z,{onResize:Fn,disabled:!$r},Cn):Cn}var X=Y.forwardRef(j);X.displayName="Overflow",X.Item=Ke,X.RESPONSIVE=Ze,X.INVALIDATE=q;var ue=X,ae=ue},29301:function(Sr,St,Z){"use strict";Z.d(St,{Z:function(){return q}});var z=Z(67711),we=Z(59301),Ue=Z(11592),ve=Z(48736),Y=Z(98506),_=Z(26420),ye=Z(76846),H=Z(8654),o=we.createContext(null);function ne(L){var j=L.children,X=L.onBatchResize,ue=we.useRef(0),ae=we.useRef([]),w=we.useContext(o),b=we.useCallback(function($,fe,$e){ue.current+=1;var lt=ue.current;ae.current.push({size:$,element:fe,data:$e}),Promise.resolve().then(function(){lt===ue.current&&(X==null||X(ae.current),ae.current=[])}),w==null||w($,fe,$e)},[X,w]);return we.createElement(o.Provider,{value:b},j)}var U=Z(76374),B=new Map;function y(L){L.forEach(function(j){var X,ue=j.target;(X=B.get(ue))===null||X===void 0||X.forEach(function(ae){return ae(ue)})})}var C=new U.Z(y),T=null,ee=null;function G(L,j){B.has(L)||(B.set(L,new Set),C.observe(L)),B.get(L).add(j)}function W(L,j){B.has(L)&&(B.get(L).delete(j),B.get(L).size||(C.unobserve(L),B.delete(L)))}var k=Z(42573),K=Z(58698),re=Z(74700),me=Z(45080),Ce=function(L){(0,re.Z)(X,L);var j=(0,me.Z)(X);function X(){return(0,k.Z)(this,X),j.apply(this,arguments)}return(0,K.Z)(X,[{key:"render",value:function(){return this.props.children}}]),X}(we.Component);function Ie(L,j){var X=L.children,ue=L.disabled,ae=we.useRef(null),w=we.useRef(null),b=we.useContext(o),$=typeof X=="function",fe=$?X(ae):X,$e=we.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),lt=!$&&we.isValidElement(fe)&&(0,H.Yr)(fe),Rt=lt?(0,H.C4)(fe):null,Ct=(0,H.x1)(Rt,ae),Vt=function(){var nt;return(0,ye.ZP)(ae.current)||(ae.current&&(0,_.Z)(ae.current)==="object"?(0,ye.ZP)((nt=ae.current)===null||nt===void 0?void 0:nt.nativeElement):null)||(0,ye.ZP)(w.current)};we.useImperativeHandle(j,function(){return Vt()});var Qt=we.useRef(L);Qt.current=L;var bt=we.useCallback(function(He){var nt=Qt.current,it=nt.onResize,At=nt.data,Ht=He.getBoundingClientRect(),Fe=Ht.width,R=Ht.height,m=He.offsetWidth,F=He.offsetHeight,V=Math.floor(Fe),D=Math.floor(R);if($e.current.width!==V||$e.current.height!==D||$e.current.offsetWidth!==m||$e.current.offsetHeight!==F){var N={width:V,height:D,offsetWidth:m,offsetHeight:F};$e.current=N;var Ae=m===Math.round(Fe)?Fe:m,Le=F===Math.round(R)?R:F,Me=(0,Y.Z)((0,Y.Z)({},N),{},{offsetWidth:Ae,offsetHeight:Le});b==null||b(Me,He,At),it&&Promise.resolve().then(function(){it(Me,He)})}},[]);return we.useEffect(function(){var He=Vt();return He&&!ue&&G(He,bt),function(){return W(He,bt)}},[ae.current,ue]),we.createElement(Ce,{ref:w},lt?we.cloneElement(fe,{ref:Ct}):fe)}var le=we.forwardRef(Ie),xe=le,Ke="rc-observer-key";function ge(L,j){var X=L.children,ue=typeof X=="function"?[X]:(0,Ue.Z)(X);return ue.map(function(ae,w){var b=(ae==null?void 0:ae.key)||"".concat(Ke,"-").concat(w);return we.createElement(xe,(0,z.Z)({},L,{key:b,ref:w===0?j:void 0}),ae)})}var Ze=we.forwardRef(ge);Ze.Collection=ne;var q=Ze},29125:function(Sr,St,Z){"use strict";Z.d(St,{G:function(){return ve},Z:function(){return W}});var z=Z(92310),we=Z.n(z),Ue=Z(59301);function ve(k){var K=k.children,re=k.prefixCls,me=k.id,Ce=k.overlayInnerStyle,Ie=k.bodyClassName,le=k.className,xe=k.style;return Ue.createElement("div",{className:we()("".concat(re,"-content"),le),style:xe},Ue.createElement("div",{className:we()("".concat(re,"-inner"),Ie),id:me,role:"tooltip",style:Ce},typeof K=="function"?K():K))}var Y=Z(67711),_=Z(98506),ye=Z(33346),H=Z(65030),o={shiftX:64,adjustY:1},ne={adjustX:1,shiftY:!0},U=[0,0],B={left:{points:["cr","cl"],overflow:ne,offset:[-4,0],targetOffset:U},right:{points:["cl","cr"],overflow:ne,offset:[4,0],targetOffset:U},top:{points:["bc","tc"],overflow:o,offset:[0,-4],targetOffset:U},bottom:{points:["tc","bc"],overflow:o,offset:[0,4],targetOffset:U},topLeft:{points:["bl","tl"],overflow:o,offset:[0,-4],targetOffset:U},leftTop:{points:["tr","tl"],overflow:ne,offset:[-4,0],targetOffset:U},topRight:{points:["br","tr"],overflow:o,offset:[0,-4],targetOffset:U},rightTop:{points:["tl","tr"],overflow:ne,offset:[4,0],targetOffset:U},bottomRight:{points:["tr","br"],overflow:o,offset:[0,4],targetOffset:U},rightBottom:{points:["bl","br"],overflow:ne,offset:[4,0],targetOffset:U},bottomLeft:{points:["tl","bl"],overflow:o,offset:[0,4],targetOffset:U},leftBottom:{points:["br","bl"],overflow:ne,offset:[-4,0],targetOffset:U}},y=null,C=Z(80402),T=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],ee=function(K,re){var me=K.overlayClassName,Ce=K.trigger,Ie=Ce===void 0?["hover"]:Ce,le=K.mouseEnterDelay,xe=le===void 0?0:le,Ke=K.mouseLeaveDelay,ge=Ke===void 0?.1:Ke,Ze=K.overlayStyle,q=K.prefixCls,L=q===void 0?"rc-tooltip":q,j=K.children,X=K.onVisibleChange,ue=K.afterVisibleChange,ae=K.transitionName,w=K.animation,b=K.motion,$=K.placement,fe=$===void 0?"right":$,$e=K.align,lt=$e===void 0?{}:$e,Rt=K.destroyTooltipOnHide,Ct=Rt===void 0?!1:Rt,Vt=K.defaultVisible,Qt=K.getTooltipContainer,bt=K.overlayInnerStyle,He=K.arrowContent,nt=K.overlay,it=K.id,At=K.showArrow,Ht=At===void 0?!0:At,Fe=K.classNames,R=K.styles,m=(0,ye.Z)(K,T),F=(0,C.Z)(it),V=(0,Ue.useRef)(null);(0,Ue.useImperativeHandle)(re,function(){return V.current});var D=(0,_.Z)({},m);"visible"in K&&(D.popupVisible=K.visible);var N=function(){return Ue.createElement(ve,{key:"content",prefixCls:L,id:F,bodyClassName:Fe==null?void 0:Fe.body,overlayInnerStyle:(0,_.Z)((0,_.Z)({},bt),R==null?void 0:R.body)},nt)},Ae=function(){var Me=Ue.Children.only(j),Xe=(Me==null?void 0:Me.props)||{},qe=(0,_.Z)((0,_.Z)({},Xe),{},{"aria-describedby":nt?F:null});return Ue.cloneElement(j,qe)};return Ue.createElement(H.Z,(0,Y.Z)({popupClassName:we()(me,Fe==null?void 0:Fe.root),prefixCls:L,popup:N,action:Ie,builtinPlacements:B,popupPlacement:fe,ref:V,popupAlign:lt,getPopupContainer:Qt,onPopupVisibleChange:X,afterPopupVisibleChange:ue,popupTransitionName:ae,popupAnimation:w,popupMotion:b,defaultPopupVisible:Vt,autoDestroy:Ct,mouseLeaveDelay:ge,popupStyle:(0,_.Z)((0,_.Z)({},Ze),R==null?void 0:R.root),mouseEnterDelay:xe,arrow:Ht},D),Ae())},G=(0,Ue.forwardRef)(ee),W=G},49658:function(Sr,St){"use strict";St.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Z=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(Z)||/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(Z==null?void 0:Z.substr(0,4))}},83145:function(Sr,St,Z){"use strict";Object.defineProperty(St,"__esModule",{value:!0}),St.CopyToClipboard=void 0;var z=Ue(Z(59301)),we=Ue(Z(25769));function Ue(k){return k&&k.__esModule?k:{default:k}}function ve(k){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ve=function(re){return typeof re}:ve=function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},ve(k)}function Y(k,K){var re=Object.keys(k);if(Object.getOwnPropertySymbols){var me=Object.getOwnPropertySymbols(k);K&&(me=me.filter(function(Ce){return Object.getOwnPropertyDescriptor(k,Ce).enumerable})),re.push.apply(re,me)}return re}function _(k){for(var K=1;K<arguments.length;K++){var re=arguments[K]!=null?arguments[K]:{};K%2?Y(re,!0).forEach(function(me){G(k,me,re[me])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(re)):Y(re).forEach(function(me){Object.defineProperty(k,me,Object.getOwnPropertyDescriptor(re,me))})}return k}function ye(k,K){if(k==null)return{};var re=H(k,K),me,Ce;if(Object.getOwnPropertySymbols){var Ie=Object.getOwnPropertySymbols(k);for(Ce=0;Ce<Ie.length;Ce++)me=Ie[Ce],!(K.indexOf(me)>=0)&&Object.prototype.propertyIsEnumerable.call(k,me)&&(re[me]=k[me])}return re}function H(k,K){if(k==null)return{};var re={},me=Object.keys(k),Ce,Ie;for(Ie=0;Ie<me.length;Ie++)Ce=me[Ie],!(K.indexOf(Ce)>=0)&&(re[Ce]=k[Ce]);return re}function o(k,K){if(!(k instanceof K))throw new TypeError("Cannot call a class as a function")}function ne(k,K){for(var re=0;re<K.length;re++){var me=K[re];me.enumerable=me.enumerable||!1,me.configurable=!0,"value"in me&&(me.writable=!0),Object.defineProperty(k,me.key,me)}}function U(k,K,re){return K&&ne(k.prototype,K),re&&ne(k,re),k}function B(k,K){return K&&(ve(K)==="object"||typeof K=="function")?K:C(k)}function y(k){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(re){return re.__proto__||Object.getPrototypeOf(re)},y(k)}function C(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function T(k,K){if(typeof K!="function"&&K!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(K&&K.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),K&&ee(k,K)}function ee(k,K){return ee=Object.setPrototypeOf||function(me,Ce){return me.__proto__=Ce,me},ee(k,K)}function G(k,K,re){return K in k?Object.defineProperty(k,K,{value:re,enumerable:!0,configurable:!0,writable:!0}):k[K]=re,k}var W=function(k){T(K,k);function K(){var re,me;o(this,K);for(var Ce=arguments.length,Ie=new Array(Ce),le=0;le<Ce;le++)Ie[le]=arguments[le];return me=B(this,(re=y(K)).call.apply(re,[this].concat(Ie))),G(C(me),"onClick",function(xe){var Ke=me.props,ge=Ke.text,Ze=Ke.onCopy,q=Ke.children,L=Ke.options,j=z.default.Children.only(q),X=(0,we.default)(ge,L);Ze&&Ze(ge,X),j&&j.props&&typeof j.props.onClick=="function"&&j.props.onClick(xe)}),me}return U(K,[{key:"render",value:function(){var me=this.props,Ce=me.text,Ie=me.onCopy,le=me.options,xe=me.children,Ke=ye(me,["text","onCopy","options","children"]),ge=z.default.Children.only(xe);return z.default.cloneElement(ge,_({},Ke,{onClick:this.onClick}))}}]),K}(z.default.PureComponent);St.CopyToClipboard=W,G(W,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Sr,St,Z){"use strict";var z=Z(83145),we=z.CopyToClipboard;we.CopyToClipboard=we,Sr.exports=we},76374:function(Sr,St,Z){"use strict";var z=function(){if(typeof Map!="undefined")return Map;function q(L,j){var X=-1;return L.some(function(ue,ae){return ue[0]===j?(X=ae,!0):!1}),X}return function(){function L(){this.__entries__=[]}return Object.defineProperty(L.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),L.prototype.get=function(j){var X=q(this.__entries__,j),ue=this.__entries__[X];return ue&&ue[1]},L.prototype.set=function(j,X){var ue=q(this.__entries__,j);~ue?this.__entries__[ue][1]=X:this.__entries__.push([j,X])},L.prototype.delete=function(j){var X=this.__entries__,ue=q(X,j);~ue&&X.splice(ue,1)},L.prototype.has=function(j){return!!~q(this.__entries__,j)},L.prototype.clear=function(){this.__entries__.splice(0)},L.prototype.forEach=function(j,X){X===void 0&&(X=null);for(var ue=0,ae=this.__entries__;ue<ae.length;ue++){var w=ae[ue];j.call(X,w[1],w[0])}},L}()}(),we=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Ue=function(){return typeof Z.g!="undefined"&&Z.g.Math===Math?Z.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ve=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ue):function(q){return setTimeout(function(){return q(Date.now())},1e3/60)}}(),Y=2;function _(q,L){var j=!1,X=!1,ue=0;function ae(){j&&(j=!1,q()),X&&b()}function w(){ve(ae)}function b(){var $=Date.now();if(j){if($-ue<Y)return;X=!0}else j=!0,X=!1,setTimeout(w,L);ue=$}return b}var ye=20,H=["top","right","bottom","left","width","height","size","weight"],o=typeof MutationObserver!="undefined",ne=function(){function q(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=_(this.refresh.bind(this),ye)}return q.prototype.addObserver=function(L){~this.observers_.indexOf(L)||this.observers_.push(L),this.connected_||this.connect_()},q.prototype.removeObserver=function(L){var j=this.observers_,X=j.indexOf(L);~X&&j.splice(X,1),!j.length&&this.connected_&&this.disconnect_()},q.prototype.refresh=function(){var L=this.updateObservers_();L&&this.refresh()},q.prototype.updateObservers_=function(){var L=this.observers_.filter(function(j){return j.gatherActive(),j.hasActive()});return L.forEach(function(j){return j.broadcastActive()}),L.length>0},q.prototype.connect_=function(){!we||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),o?(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)},q.prototype.disconnect_=function(){!we||!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)},q.prototype.onTransitionEnd_=function(L){var j=L.propertyName,X=j===void 0?"":j,ue=H.some(function(ae){return!!~X.indexOf(ae)});ue&&this.refresh()},q.getInstance=function(){return this.instance_||(this.instance_=new q),this.instance_},q.instance_=null,q}(),U=function(q,L){for(var j=0,X=Object.keys(L);j<X.length;j++){var ue=X[j];Object.defineProperty(q,ue,{value:L[ue],enumerable:!1,writable:!1,configurable:!0})}return q},B=function(q){var L=q&&q.ownerDocument&&q.ownerDocument.defaultView;return L||Ue},y=Ce(0,0,0,0);function C(q){return parseFloat(q)||0}function T(q){for(var L=[],j=1;j<arguments.length;j++)L[j-1]=arguments[j];return L.reduce(function(X,ue){var ae=q["border-"+ue+"-width"];return X+C(ae)},0)}function ee(q){for(var L=["top","right","bottom","left"],j={},X=0,ue=L;X<ue.length;X++){var ae=ue[X],w=q["padding-"+ae];j[ae]=C(w)}return j}function G(q){var L=q.getBBox();return Ce(0,0,L.width,L.height)}function W(q){var L=q.clientWidth,j=q.clientHeight;if(!L&&!j)return y;var X=B(q).getComputedStyle(q),ue=ee(X),ae=ue.left+ue.right,w=ue.top+ue.bottom,b=C(X.width),$=C(X.height);if(X.boxSizing==="border-box"&&(Math.round(b+ae)!==L&&(b-=T(X,"left","right")+ae),Math.round($+w)!==j&&($-=T(X,"top","bottom")+w)),!K(q)){var fe=Math.round(b+ae)-L,$e=Math.round($+w)-j;Math.abs(fe)!==1&&(b-=fe),Math.abs($e)!==1&&($-=$e)}return Ce(ue.left,ue.top,b,$)}var k=function(){return typeof SVGGraphicsElement!="undefined"?function(q){return q instanceof B(q).SVGGraphicsElement}:function(q){return q instanceof B(q).SVGElement&&typeof q.getBBox=="function"}}();function K(q){return q===B(q).document.documentElement}function re(q){return we?k(q)?G(q):W(q):y}function me(q){var L=q.x,j=q.y,X=q.width,ue=q.height,ae=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,w=Object.create(ae.prototype);return U(w,{x:L,y:j,width:X,height:ue,top:j,right:L+X,bottom:ue+j,left:L}),w}function Ce(q,L,j,X){return{x:q,y:L,width:j,height:X}}var Ie=function(){function q(L){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ce(0,0,0,0),this.target=L}return q.prototype.isActive=function(){var L=re(this.target);return this.contentRect_=L,L.width!==this.broadcastWidth||L.height!==this.broadcastHeight},q.prototype.broadcastRect=function(){var L=this.contentRect_;return this.broadcastWidth=L.width,this.broadcastHeight=L.height,L},q}(),le=function(){function q(L,j){var X=me(j);U(this,{target:L,contentRect:X})}return q}(),xe=function(){function q(L,j,X){if(this.activeObservations_=[],this.observations_=new z,typeof L!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=L,this.controller_=j,this.callbackCtx_=X}return q.prototype.observe=function(L){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(L instanceof B(L).Element))throw new TypeError('parameter 1 is not of type "Element".');var j=this.observations_;j.has(L)||(j.set(L,new Ie(L)),this.controller_.addObserver(this),this.controller_.refresh())}},q.prototype.unobserve=function(L){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(L instanceof B(L).Element))throw new TypeError('parameter 1 is not of type "Element".');var j=this.observations_;j.has(L)&&(j.delete(L),j.size||this.controller_.removeObserver(this))}},q.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},q.prototype.gatherActive=function(){var L=this;this.clearActive(),this.observations_.forEach(function(j){j.isActive()&&L.activeObservations_.push(j)})},q.prototype.broadcastActive=function(){if(this.hasActive()){var L=this.callbackCtx_,j=this.activeObservations_.map(function(X){return new le(X.target,X.broadcastRect())});this.callback_.call(L,j,L),this.clearActive()}},q.prototype.clearActive=function(){this.activeObservations_.splice(0)},q.prototype.hasActive=function(){return this.activeObservations_.length>0},q}(),Ke=typeof WeakMap!="undefined"?new WeakMap:new z,ge=function(){function q(L){if(!(this instanceof q))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=ne.getInstance(),X=new xe(L,j,this);Ke.set(this,X)}return q}();["observe","unobserve","disconnect"].forEach(function(q){ge.prototype[q]=function(){var L;return(L=Ke.get(this))[q].apply(L,arguments)}});var Ze=function(){return typeof Ue.ResizeObserver!="undefined"?Ue.ResizeObserver:ge}();St.Z=Ze},98040:function(Sr){Sr.exports=function(){var St=document.getSelection();if(!St.rangeCount)return function(){};for(var Z=document.activeElement,z=[],we=0;we<St.rangeCount;we++)z.push(St.getRangeAt(we));switch(Z.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":Z.blur();break;default:Z=null;break}return St.removeAllRanges(),function(){St.type==="Caret"&&St.removeAllRanges(),St.rangeCount||z.forEach(function(Ue){St.addRange(Ue)}),Z&&Z.focus()}}},78666:function(Sr,St,Z){"use strict";Z.d(St,{ZP:function(){return on}});const z=Number.isFinite||function(A){return typeof A=="number"&&isFinite(A)},we=Number.isSafeInteger||function(A){return typeof A=="number"&&Math.abs(A)<=Ue},Ue=Number.MAX_SAFE_INTEGER||9007199254740991;let ve=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}({}),Y=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 ye={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},H={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class o{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 ne{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 o(e),this.fast_=new o(t),this.defaultTTFB_=n,this.ttfb_=new o(e)}update(e,t){const{slow_:r,fast_:n,ttfb_:i}=this;r.halfLife!==e&&(this.slow_=new o(e,r.getEstimate(),r.getTotalWeight())),n.halfLife!==t&&(this.fast_=new o(t,n.getEstimate(),n.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new o(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 U(A,e,t){return(e=ee(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 y(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 C(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?y(Object(t),!0).forEach(function(r){U(A,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):y(Object(t)).forEach(function(r){Object.defineProperty(A,r,Object.getOwnPropertyDescriptor(t,r))})}return A}function T(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 ee(A){var e=T(A,"string");return typeof e=="symbol"?e:e+""}class G{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=W,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 W=function(){},k={trace:W,debug:W,log:W,warn:W,info:W,error:W};function K(){return B({},k)}function re(A,e){const t=self.console[A];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${A}] >`):W}function me(A,e,t){return e[A]?e[A].bind(e):re(A,t)}const Ce=K();function Ie(A,e,t){const r=K();if(typeof console=="object"&&A===!0||typeof A=="object"){const n=["debug","log","info","warn","error"];n.forEach(i=>{r[i]=me(i,A,t)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.8`)}catch(i){return K()}n.forEach(i=>{Ce[i]=me(i,A)})}else B(Ce,r);return r}const le=Ce;function xe(A=!0){return typeof self=="undefined"?void 0:(A||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Ke(A){return typeof self!="undefined"&&A===self.ManagedMediaSource}function ge(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 Ze(A,e=!1){if(typeof TextDecoder!="undefined"){const l=new TextDecoder("utf-8").decode(A);if(e){const g=l.indexOf("\0");return g!==-1?l.substring(0,g):l}return l.replace(/\0/g,"")}const t=A.length;let r,n,i,s="",a=0;for(;a<t;){if(r=A[a++],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[a++],s+=String.fromCharCode((r&31)<<6|n&63);break;case 14:n=A[a++],i=A[a++],s+=String.fromCharCode((r&15)<<12|(n&63)<<6|(i&63)<<0);break}}return s}const q={hexDump:function(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 L(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 X={exports:{}},ue;function ae(){return ue||(ue=1,function(A,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(c,l,g){if(g=g||{},c=c.trim(),l=l.trim(),!l){if(!g.alwaysNormalize)return c;var p=a.parseURL(c);if(!p)throw new Error("Error trying to parse base URL.");return p.path=a.normalizePath(p.path),a.buildURLFromParts(p)}var v=a.parseURL(l);if(!v)throw new Error("Error trying to parse relative URL.");if(v.scheme)return g.alwaysNormalize?(v.path=a.normalizePath(v.path),a.buildURLFromParts(v)):l;var x=a.parseURL(c);if(!x)throw new Error("Error trying to parse base URL.");if(!x.netLoc&&x.path&&x.path[0]!=="/"){var S=n.exec(x.path);x.netLoc=S[1],x.path=S[2]}x.netLoc&&!x.path&&(x.path="/");var O={scheme:x.scheme,netLoc:v.netLoc,path:null,params:v.params,query:v.query,fragment:v.fragment};if(!v.netLoc&&(O.netLoc=x.netLoc,v.path[0]!=="/"))if(!v.path)O.path=x.path,v.params||(O.params=x.params,v.query||(O.query=x.query));else{var M=x.path,ie=M.substring(0,M.lastIndexOf("/")+1)+v.path;O.path=a.normalizePath(ie)}return O.path===null&&(O.path=g.alwaysNormalize?a.normalizePath(v.path):v.path),a.buildURLFromParts(O)},parseURL:function(c){var l=r.exec(c);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[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=a})()}(X)),X.exports}var w=ae();class b{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 $={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class fe{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,Vt(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={[$.AUDIO]:null,[$.VIDEO]:null,[$.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 b),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[$.AUDIO]=null,e[$.VIDEO]=null,e[$.AUDIOVIDEO]=null}}function $e(A){return A.sn!=="initSegment"}class lt extends fe{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(z(e)&&z(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(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const r=Object.keys(this.levelkeys);if(r.length===1){const n=this._decryptdata=this.levelkeys[r[0]]||null;if(n)return n.getDecryptData(this.sn)}}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=z(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(!z(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return $e(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){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}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:a}=this,c=a[e];if(!c){a[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 Rt extends fe{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 Ct(A,e){const t=Object.getPrototypeOf(A);if(t){const r=Object.getOwnPropertyDescriptor(t,e);return r||Ct(t,e)}}function Vt(A,e){const t=Ct(A,e);t&&(t.enumerable=!0,Object.defineProperty(A,e,t))}const Qt=Math.pow(2,32)-1,bt=[].push,He={video:1,audio:2,id3:3,text:4};function nt(A){return String.fromCharCode.apply(null,A)}function it(A,e){const t=A[e]<<8|A[e+1];return t<0?65536+t:t}function At(A,e){const t=Fe(A,e);return t<0?4294967296+t:t}function Ht(A,e){let t=At(A,e);return t*=Math.pow(2,32),t+=At(A,e+4),t}function Fe(A,e){return A[e]<<24|A[e+1]<<16|A[e+2]<<8|A[e+3]}function R(A){const e=A.byteLength;for(let t=0;t<e;){const r=At(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 m(A,e){const t=[];if(!e.length)return t;const r=A.byteLength;for(let n=0;n<r;){const i=At(A,n),s=nt(A.subarray(n+4,n+8)),a=i>1?n+i:r;if(s===e[0])if(e.length===1)t.push(A.subarray(n+8,a));else{const c=m(A.subarray(n+8,a),e.slice(1));c.length&&bt.apply(t,c)}n=a}return t}function F(A){const e=[],t=A[0];let r=8;const n=At(A,r);r+=4;let i=0,s=0;t===0?(i=At(A,r),s=At(A,r+4),r+=8):(i=Ht(A,r),s=Ht(A,r+8),r+=16),r+=2;let a=A.length+s;const c=it(A,r);r+=2;for(let l=0;l<c;l++){let g=r;const p=At(A,g);g+=4;const v=p&2147483647;if((p&2147483648)>>>31===1)return le.warn("SIDX has hierarchical references (not supported)"),null;const S=At(A,g);g+=4,e.push({referenceSize:v,subsegmentDuration:S,info:{duration:S/n,start:a,end:a+v-1}}),a+=v,g+=4,r=g}return{earliestPresentationTime:i,timescale:n,version:t,referencesCount:c,references:e}}function V(A){const e=[],t=m(A,["moov","trak"]);for(let n=0;n<t.length;n++){const i=t[n],s=m(i,["tkhd"])[0];if(s){let a=s[0];const c=At(s,a===0?12:20),l=m(i,["mdia","mdhd"])[0];if(l){a=l[0];const g=At(l,a===0?12:20),p=m(i,["mdia","hdlr"])[0];if(p){const v=nt(p.subarray(8,12)),x={soun:$.AUDIO,vide:$.VIDEO}[v],S=m(i,["mdia","minf","stbl","stsd"])[0],O=D(S);x?(e[c]={timescale:g,type:x,stsd:O},e[x]=C({timescale:g,id:c},O)):e[c]={timescale:g,type:v,stsd:O}}}}}return m(A,["moov","mvex","trex"]).forEach(n=>{const i=At(n,4),s=e[i];s&&(s.default={duration:At(n,12),flags:At(n,20)})}),e}function D(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 l=m(e,[r])[0].subarray(r==="enca"?28:78);m(l,["sinf"]).forEach(p=>{const v=m(p,["schm"])[0];if(v){const x=nt(v.subarray(4,8));if(x==="cbcs"||x==="cenc"){const S=m(p,["frma"])[0];S&&(n=nt(S))}}})}const a=n;switch(n){case"avc1":case"avc2":case"avc3":case"avc4":{const c=m(t,["avcC"])[0];c&&c.length>3&&(n+="."+Me(c[1])+Me(c[2])+Me(c[3]),i=N(a==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=m(e,[r])[0],l=m(c.subarray(28),["esds"])[0];if(l&&l.length>7){let g=4;if(l[g++]!==3)break;g=Le(l,g),g+=2;const p=l[g++];if(p&128&&(g+=2),p&64&&(g+=l[g++]),l[g++]!==4)break;g=Le(l,g);const v=l[g++];if(v===64)n+="."+Me(v);else break;if(g+=12,l[g++]!==5)break;g=Le(l,g);const x=l[g++];let S=(x&248)>>3;S===31&&(S+=1+((x&7)<<3)+((l[g]&224)>>5)),n+="."+S}break}case"hvc1":case"hev1":{const c=m(t,["hvcC"])[0];if(c&&c.length>12){const l=c[1],g=["","A","B","C"][l>>6],p=l&31,v=At(c,2),x=(l&32)>>5?"H":"L",S=c[12],O=c.subarray(6,12);n+="."+g+p,n+="."+Ae(v).toString(16).toUpperCase(),n+="."+x+S;let M="";for(let ie=O.length;ie--;){const Be=O[ie];(Be||M)&&(M="."+Be.toString(16).toUpperCase()+M)}n+=M}i=N(a=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{n=N(n,t)||n;break}case"vp09":{const c=m(t,["vpcC"])[0];if(c&&c.length>6){const l=c[4],g=c[5],p=c[6]>>4&15;n+="."+Xe(l)+"."+Xe(g)+"."+Xe(p)}break}case"av01":{const c=m(t,["av1C"])[0];if(c&&c.length>2){const l=c[1]>>>5,g=c[1]&31,p=c[2]>>>7?"H":"M",v=(c[2]&64)>>6,x=(c[2]&32)>>5,S=l===2&&v?x?12:10:v?10:8,O=(c[2]&16)>>4,M=(c[2]&8)>>3,ie=(c[2]&4)>>2,Be=c[2]&3;n+="."+l+"."+Xe(g)+p+"."+Xe(S)+"."+O+"."+M+ie+Be+"."+Xe(1)+"."+Xe(1)+"."+Xe(1)+"."+0,i=N("dav1",t)}break}}return{codec:n,encrypted:s,supplemental:i}}function N(A,e){const t=m(e,["dvvC"]),r=t.length?t[0]:m(e,["dvcC"])[0];if(r){const n=r[2]>>1&127,i=r[2]<<5&32|r[3]>>3&31;return A+"."+Xe(n)+"."+Xe(i)}}function Ae(A){let e=0;for(let t=0;t<32;t++)e|=(A>>t&1)<<31-t;return e>>>0}function Le(A,e){const t=e+5;for(;A[e++]&128&&e<t;);return e}function Me(A){return("0"+A.toString(16).toUpperCase()).slice(-2)}function Xe(A){return(A<10?"0":"")+A}function qe(A,e){if(!A||!e)return A;const t=e.keyId;return t&&e.isCommonEncryption&&m(A,["moov","trak"]).forEach(n=>{const s=m(n,["mdia","minf","stbl","stsd"])[0].subarray(8);let a=m(s,["enca"]);const c=a.length>0;c||(a=m(s,["encv"])),a.forEach(l=>{const g=c?l.subarray(28):l.subarray(78);m(g,["sinf"]).forEach(v=>{const x=Pt(v);if(x){const S=x.subarray(8,24);S.some(O=>O!==0)||(le.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${q.hexDump(S)} -> ${q.hexDump(t)}`),x.set(t,8))}})})}),A}function Pt(A){const e=m(A,["schm"])[0];if(e){const t=nt(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return m(A,["schi","tenc"])[0]}return null}function ot(A,e,t){const r={},n=m(A,["moof","traf"]);for(let i=0;i<n.length;i++){const s=n[i],a=m(s,["tfhd"])[0],c=At(a,4),l=e[c];if(!l)continue;const g=r[c]||(r[c]={start:NaN,duration:0,sampleCount:0,timescale:l.timescale,type:l.type}),p=m(s,["tfdt"])[0];if(p){const _e=p[0];let Qe=At(p,4);_e===1&&(Qe===Qt?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(Qe*=Qt+1,Qe+=At(p,8))),z(Qe)&&(!z(g.start)||Qe<g.start)&&(g.start=Qe)}const v=l.default,x=At(a,0)|(v==null?void 0:v.flags);let S=(v==null?void 0:v.duration)||0;x&8&&(x&2?S=At(a,12):S=At(a,8));const O=m(s,["trun"]);let M=g.start||0,ie=0,Be=S;for(let _e=0;_e<O.length;_e++){const Qe=O[_e],We=At(Qe,4),_t=g.sampleCount;g.sampleCount+=We;const Ge=Qe[3]&1,at=Qe[3]&4,ft=Qe[2]&1,ze=Qe[2]&2,Lt=Qe[2]&4,lr=Qe[2]&8;let br=8,Or=We;for(Ge&&(br+=4),at&&We&&(!(Qe[br+1]&1)&&g.keyFrameIndex===void 0&&(g.keyFrameIndex=_t),br+=4,ft?(Be=At(Qe,br),br+=4):Be=S,ze&&(br+=4),lr&&(br+=4),M+=Be,ie+=Be,Or--);Or--;)ft?(Be=At(Qe,br),br+=4):Be=S,ze&&(br+=4),Lt&&(Qe[br+1]&1||g.keyFrameIndex===void 0&&(g.keyFrameIndex=g.sampleCount-(Or+1),g.keyFrameStart=M),br+=4),lr&&(br+=4),M+=Be,ie+=Be;!ie&&S&&(ie+=S*We)}g.duration+=ie}if(!Object.keys(r).some(i=>r[i].duration)){let i=1/0,s=0;const a=m(A,["sidx"]);for(let c=0;c<a.length;c++){const l=F(a[c]);if(l!=null&&l.references){i=Math.min(i,l.earliestPresentationTime/l.timescale);const g=l.references.reduce((p,v)=>p+v.info.duration||0,0);s=Math.max(s,g+l.earliestPresentationTime/l.timescale)}}s&&z(s)&&Object.keys(r).forEach(c=>{r[c].duration||(r[c].duration=s*r[c].timescale-r[c].start)})}return r}function Bt(A){const e={valid:null,remainder:null},t=m(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 ut(A,e){const t=new Uint8Array(A.length+e.length);return t.set(A),t.set(e,A.length),t}function gt(A,e){const t=[],r=e.samples,n=e.timescale,i=e.id;let s=!1;return m(r,["moof"]).map(c=>{const l=c.byteOffset-8;m(c,["traf"]).map(p=>{const v=m(p,["tfdt"]).map(x=>{const S=x[0];let O=At(x,4);return S===1&&(O*=Math.pow(2,32),O+=At(x,8)),O/n})[0];return v!==void 0&&(A=v),m(p,["tfhd"]).map(x=>{const S=At(x,4),O=At(x,0)&16777215,M=(O&1)!==0,ie=(O&2)!==0,Be=(O&8)!==0;let _e=0;const Qe=(O&16)!==0;let We=0;const _t=(O&32)!==0;let Ge=8;S===i&&(M&&(Ge+=8),ie&&(Ge+=4),Be&&(_e=At(x,Ge),Ge+=4),Qe&&(We=At(x,Ge),Ge+=4),_t&&(Ge+=4),e.type==="video"&&(s=Ye(e.codec)),m(p,["trun"]).map(at=>{const ft=at[0],ze=At(at,0)&16777215,Lt=(ze&1)!==0;let lr=0;const br=(ze&4)!==0,Or=(ze&256)!==0;let dr=0;const hr=(ze&512)!==0;let _r=0;const vr=(ze&1024)!==0,Kr=(ze&2048)!==0;let Jr=0;const Ar=At(at,4);let ar=8;Lt&&(lr=At(at,ar),ar+=4),br&&(ar+=4);let cn=lr+l;for(let Pn=0;Pn<Ar;Pn++){if(Or?(dr=At(at,ar),ar+=4):dr=_e,hr?(_r=At(at,ar),ar+=4):_r=We,vr&&(ar+=4),Kr&&(ft===0?Jr=At(at,ar):Jr=Fe(at,ar),ar+=4),e.type===$.VIDEO){let dn=0;for(;dn<_r;){const Tn=At(r,cn);if(cn+=4,rt(s,r[cn])){const Fi=r.subarray(cn,cn+Tn);yt(Fi,s?2:1,A+Jr/n,t)}cn+=Tn,dn+=Tn+4}}A+=dr/n}}))})})}),t}function Ye(A){if(!A)return!1;const e=A.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function rt(A,e){if(A){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function yt(A,e,t,r){const n=It(A);let i=0;i+=e;let s=0,a=0,c=0;for(;i<n.length;){s=0;do{if(i>=n.length)break;c=n[i++],s+=c}while(c===255);a=0;do{if(i>=n.length)break;c=n[i++],a+=c}while(c===255);const l=n.length-i;let g=i;if(a<l)i+=a;else if(a>l){le.error(`Malformed SEI payload. ${a} is too small, only ${l} bytes left to parse.`);break}if(s===4){if(n[g++]===181){const v=it(n,g);if(g+=2,v===49){const x=At(n,g);if(g+=4,x===1195456820){const S=n[g++];if(S===3){const O=n[g++],M=31&O,ie=64&O,Be=ie?2+M*3:0,_e=new Uint8Array(Be);if(ie){_e[0]=O;for(let Qe=1;Qe<Be;Qe++)_e[Qe]=n[g++]}r.push({type:S,payloadType:s,pts:t,bytes:_e})}}}}}else if(s===5&&a>16){const p=[];for(let S=0;S<16;S++){const O=n[g++].toString(16);p.push(O.length==1?"0"+O:O),(S===3||S===5||S===7||S===9)&&p.push("-")}const v=a-16,x=new Uint8Array(v);for(let S=0;S<v;S++)x[S]=n[g++];r.push({payloadType:s,pts:t,uuid:p.join(""),userData:Ze(x),userDataBytes:x})}}}function It(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 zt(A){const e=A[0];let t="",r="",n=0,i=0,s=0,a=0,c=0,l=0;if(e===0){for(;nt(A.subarray(l,l+1))!=="\0";)t+=nt(A.subarray(l,l+1)),l+=1;for(t+=nt(A.subarray(l,l+1)),l+=1;nt(A.subarray(l,l+1))!=="\0";)r+=nt(A.subarray(l,l+1)),l+=1;r+=nt(A.subarray(l,l+1)),l+=1,n=At(A,12),i=At(A,16),a=At(A,20),c=At(A,24),l=28}else if(e===1){l+=4,n=At(A,l),l+=4;const p=At(A,l);l+=4;const v=At(A,l);for(l+=4,s=Ec(2,32)*p+v,we(s)||(s=Number.MAX_SAFE_INTEGER,le.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),a=At(A,l),l+=4,c=At(A,l),l+=4;nt(A.subarray(l,l+1))!=="\0";)t+=nt(A.subarray(l,l+1)),l+=1;for(t+=nt(A.subarray(l,l+1)),l+=1;nt(A.subarray(l,l+1))!=="\0";)r+=nt(A.subarray(l,l+1)),l+=1;r+=nt(A.subarray(l,l+1)),l+=1}const g=A.subarray(l,A.byteLength);return{schemeIdUri:t,value:r,timeScale:n,presentationTime:s,presentationTimeDelta:i,eventDuration:a,id:c,payload:g}}function kt(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 tr(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&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),kt([112,115,115,104],new Uint8Array([r,0,0,0]),A,i,n,s,t||new Uint8Array)}const Wt=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),ir={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 Er(A,e){const t=ir[e];return!!t&&!!t[A.slice(0,4)]}function zr(A,e,t=!0){return!A.split(",").some(r=>!Nt(r,e,t))}function Nt(A,e,t=!0){var r;const n=xe(t);return(r=n==null?void 0:n.isTypeSupported(ur(A,e)))!=null?r:!1}function ur(A,e){return`${e}/mp4;codecs=${A}`}function ke(A){if(A){const e=A.substring(0,4);return ir.video[e]}return 2}function De(A){const e=Wt();return A.split(",").reduce((t,r)=>{const i=e&&Ye(r)?9:ir.video[r];return i?(i*2+t)/(t?3:2):(ir.audio[r]+t)/(t?2:1)},0)}const Se={};function te(A,e=!0){if(Se[A])return Se[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(Nt(t[n],"audio",e))return Se[A]=t[n],t[n];if(t[n]==="mp3"&&(r=xe(e))!=null&&r.isTypeSupported("audio/mpeg"))return""}return A}const se=/flac|opus|mp4a\.40\.34/i;function ce(A,e=!0){return A.replace(se,t=>te(t.toLowerCase(),e))}function Ee(A,e){const t=[];if(A){const r=A.split(",");for(let n=0;n<r.length;n++)Er(r[n],"video")||t.push(r[n])}return e&&t.push(e),t.join(",")}function Te(A,e){if(A&&(A.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(A)!==-1)&&(Et(A,"audio")||Et(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 Et(A,e){return Er(A,e)&&Nt(A,e)}function Ut(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 Ft(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 rr(A){const e=xe(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 Ir(A){return A.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const qr={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function jt(A,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:A}}function Yt(A,e,t,r,n,i){const s=A.videoCodec,a=A.audioCodec?A.audioGroups:null,c=i==null?void 0:i.audioCodec,l=i==null?void 0:i.channels,g=l?parseInt(l):c?1/0:2;let p=null;if(a!=null&&a.length)try{a.length===1&&a[0]?p=e.groups[a[0]].channels:p=a.reduce((v,x)=>{if(x){const S=e.groups[x];if(!S)throw new Error(`Audio track group ${x} not found`);Object.keys(S.channels).forEach(O=>{v[O]=(v[O]||0)+S.channels[O]})}return v},{2:0})}catch(v){return!0}return s!==void 0&&(s.split(",").some(v=>Ye(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))||!!p&&z(g)&&Object.keys(p).some(v=>parseInt(v)>g)}function $r(A,e,t,r={}){const n=A.videoCodec;if(!n&&!A.audioCodec||!t)return Promise.resolve(qr);const i=[],s=fn(A),a=s.length,c=Oe(A,e,a>0),l=c.length;for(let g=a||1*l||1;g--;){const p={type:"media-source"};if(a&&(p.video=s[g%a]),l){p.audio=c[g%l];const v=p.audio.bitrate;p.video&&v&&(p.video.bitrate-=v)}i.push(p)}if(n){const g=navigator.userAgent;if(n.split(",").some(p=>Ye(p))&&Wt())return Promise.resolve(jt(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${g})`),i))}return Promise.all(i.map(g=>{const p=Mr(g);return r[p]||(r[p]=t.decodingInfo(g))})).then(g=>({supported:!g.some(p=>!p.supported),configurations:i,decodingInfoResults:g})).catch(g=>({supported:!1,configurations:i,decodingInfoResults:[],error:g}))}function fn(A){var e;const t=(e=A.videoCodec)==null?void 0:e.split(","),r=Pr(A),n=A.width||640,i=A.height||480,s=A.frameRate||30,a=A.videoRange.toLowerCase();return t?t.map(c=>{const l={contentType:ur(Ft(c),"video"),width:n,height:i,bitrate:r,framerate:s};return a!=="sdr"&&(l.transferFunction=a),l}):[]}function Oe(A,e,t){var r;const n=(r=A.audioCodec)==null?void 0:r.split(","),i=Pr(A);return n&&A.audioGroups?A.audioGroups.reduce((s,a)=>{var c;const l=a?(c=e.groups[a])==null?void 0:c.tracks:null;return l?l.reduce((g,p)=>{if(p.groupId===a){const v=parseFloat(p.channels||"");n.forEach(x=>{const S={contentType:ur(x,"audio"),bitrate:t?Wr(x,i):i};v&&(S.channels=""+v),g.push(S)})}return g},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 Pr(A){return Math.ceil(Math.max(A.bitrate*.9,A.averageBitrate)/1e3)*1e3||1}function Mr(A){let e="";const{audio:t,video:r}=A;if(r){const n=Ir(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=Ir(t.contentType);e+=`${r?"_":""}${n}_c${t.channels}`}return e}const In=["NONE","TYPE-0","TYPE-1",null];function en(A){return In.indexOf(A)>-1}const Fn=["SDR","PQ","HLG"];function mn(A){return!!A&&Fn.indexOf(A)>-1}var Nn={No:"",Yes:"YES",v2:"v2"};function Rn(A){const{canSkipUntil:e,canSkipDateRanges:t,age:r}=A,n=r<e/2;return e&&n?t?Nn.v2:Nn.Yes:Nn.No}class Hn{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 ei{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 tn(this._audioGroups,e)}hasSubtitleGroup(e){return tn(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 tn(A,e){return!e||!A?!1:A.indexOf(e)!==-1}function an(){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 gn(A,e){let t=!1,r=[];if(A&&(t=A!=="SDR",r=[A]),e){r=e.allowedVideoRanges||Fn.slice(0);const n=r.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:n&&an(),t||(r=["SDR"])}return{preferHDR:t,allowedVideoRanges:r}}const ii=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}},Hr=(A,e)=>JSON.stringify(A,ii(e));function ti(A,e,t,r,n){const i=Object.keys(A),s=r==null?void 0:r.channels,a=r==null?void 0:r.audioCodec,c=n==null?void 0:n.videoCodec,l=s&&parseInt(s)===2;let g=!1,p=!1,v=1/0,x=1/0,S=1/0,O=1/0,M=0,ie=[];const{preferHDR:Be,allowedVideoRanges:_e}=gn(e,n);for(let at=i.length;at--;){const ft=A[i[at]];g||(g=ft.channels[2]>0),v=Math.min(v,ft.minHeight),x=Math.min(x,ft.minFramerate),S=Math.min(S,ft.minBitrate),_e.filter(Lt=>ft.videoRanges[Lt]>0).length>0&&(p=!0)}v=z(v)?v:0,x=z(x)?x:0;const Qe=Math.max(1080,v),We=Math.max(30,x);S=z(S)?S:t,t=Math.max(S,t),p||(e=void 0);const _t=i.length>1;return{codecSet:i.reduce((at,ft)=>{const ze=A[ft];if(ft===at)return at;if(ie=p?_e.filter(Lt=>ze.videoRanges[Lt]>0):[],_t){if(ze.minBitrate>t)return Cn(ft,`min bitrate of ${ze.minBitrate} > current estimate of ${t}`),at;if(!ze.hasDefaultAudio)return Cn(ft,"no renditions with default or auto-select sound found"),at;if(a&&ft.indexOf(a.substring(0,4))%5!==0)return Cn(ft,`audio codec preference "${a}" not found`),at;if(s&&!l){if(!ze.channels[s])return Cn(ft,`no renditions with ${s} channel sound found (channels options: ${Object.keys(ze.channels)})`),at}else if((!a||l)&&g&&ze.channels[2]===0)return Cn(ft,"no renditions with stereo sound found"),at;if(ze.minHeight>Qe)return Cn(ft,`min resolution of ${ze.minHeight} > maximum of ${Qe}`),at;if(ze.minFramerate>We)return Cn(ft,`min framerate of ${ze.minFramerate} > maximum of ${We}`),at;if(!ie.some(Lt=>ze.videoRanges[Lt]>0))return Cn(ft,`no variants with VIDEO-RANGE of ${Hr(ie)} found`),at;if(c&&ft.indexOf(c.substring(0,4))%5!==0)return Cn(ft,`video codec preference "${c}" not found`),at;if(ze.maxScore<M)return Cn(ft,`max score of ${ze.maxScore} < selected max of ${M}`),at}return at&&(De(ft)>=De(at)||ze.fragmentError>A[at].fragmentError)?at:(O=ze.minIndex,M=ze.maxScore,ft)},void 0),videoRanges:ie,preferHDR:Be,minFramerate:x,minBitrate:S,minIndex:O}}function Cn(A,e){le.log(`[abr] start candidates with "${A}" ignored because ${e}`)}function wr(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 kr(A,e,t,r){return A.slice(t,r+1).reduce((n,i,s)=>{if(!i.codecSet)return n;const a=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:!a,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,i.bitrate);const l=Math.min(i.height,i.width);return c.minHeight=Math.min(c.minHeight,l),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,a&&a.forEach(g=>{if(!g)return;const p=e.groups[g];p&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?p.hasDefault:p.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(p.channels).forEach(v=>{c.channels[v]=(c.channels[v]||0)+p.channels[v]}))}),n},{})}function Ne(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 tt(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(wt(A,n,t))return r}return-1}function wt(A,e,t){const{groupId:r,name:n,lang:i,assocLang:s,default:a}=A,c=A.forced;return(r===void 0||e.groupId===r)&&(n===void 0||e.name===n)&&(i===void 0||mt(i,e.lang))&&(i===void 0||e.assocLang===s)&&(a===void 0||e.default===a)&&(c===void 0||e.forced===c)&&(!("characteristics"in A)||Mt(A.characteristics||"",e.characteristics))&&(t===void 0||t(A,e))}function mt(A,e="--"){return A.length===e.length?A===e:A.startsWith(e)||e.startsWith(A)}function Mt(A,e=""){const t=A.split(","),r=e.split(",");return t.length===r.length&&!t.some(n=>r.indexOf(n)===-1)}function ht(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 vt(A,e,t,r,n){const i=e[r],a=e.reduce((v,x,S)=>{const O=x.uri;return(v[O]||(v[O]=[])).push(S),v},{})[i.uri];a.length>1&&(r=Math.max.apply(Math,a));const c=i.videoRange,l=i.frameRate,g=i.codecSet.substring(0,4),p=Gt(e,r,v=>{if(v.videoRange!==c||v.frameRate!==l||v.codecSet.substring(0,4)!==g)return!1;const x=v.audioGroups,S=t.filter(O=>!x||x.indexOf(O.groupId)!==-1);return tt(A,S,n)>-1});return p>-1?p:Gt(e,r,v=>{const x=v.audioGroups,S=t.filter(O=>!x||x.indexOf(O.groupId)!==-1);return tt(A,S,n)>-1})}function Gt(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 qt(A,e){var t;return!!A&&A!==((t=e.loadLevelObj)==null?void 0:t.uri)}class yr extends G{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:a,media:c}=s;if(!n||!c)return;const l=performance.now(),g=i?i.stats:n.stats,p=i?i.duration:n.duration,v=l-g.loading.start,x=s.minAutoLevel,S=n.level,O=this._nextAutoLevel;if(g.aborted||g.loaded&&g.loaded===g.total||S<=x){this.clearTimer(),this._nextAutoLevel=-1;return}if(!a)return;const M=O>-1&&O!==S,ie=!!t||M;if(!ie&&(c.paused||!c.playbackRate||!c.readyState))return;const Be=s.mainForwardBufferInfo;if(!ie&&Be===null)return;const _e=this.bwEstimator.getEstimateTTFB(),Qe=Math.abs(c.playbackRate);if(v<=Math.max(_e,1e3*(p/(Qe*2))))return;const We=Be?Be.len/Qe:0,_t=g.loading.first?g.loading.first-g.loading.start:-1,Ge=g.loaded&&_t>-1,at=this.getBwEstimate(),ft=s.levels,ze=ft[S],Lt=Math.max(g.loaded,Math.round(p*(n.bitrate||ze.averageBitrate)/8));let lr=Ge?v-_t:v;lr<1&&Ge&&(lr=Math.min(v,g.loaded*8/at));const br=Ge?g.loaded*1e3/lr:0,Or=_e/1e3,dr=br?(Lt-g.loaded)/br:Lt*8/at+Or;if(dr<=We)return;const hr=br?br*8:at,_r=((r=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:r.live)===!0,vr=this.hls.config.abrBandWidthUpFactor;let Kr=Number.POSITIVE_INFINITY,Jr;for(Jr=S-1;Jr>x;Jr--){const Pn=ft[Jr].maxBitrate,dn=!ft[Jr].details||_r;if(Kr=this.getTimeToLoadFrag(Or,hr,p*Pn,dn),Kr<Math.min(We,p+Or))break}if(Kr>=dr||Kr>p*10)return;Ge?this.bwEstimator.sample(v-Math.min(_e,_t),g.loaded):this.bwEstimator.sampleTTFB(v);const Ar=ft[Jr].maxBitrate;this.getBwEstimate()*vr>Ar&&this.resetEstimator(Ar);const ar=this.findBestLevel(Ar,x,Jr,0,We,1,1);ar>-1&&(Jr=ar),this.warn(`Fragment ${n.sn}${i?" part "+i.index:""} of level ${S} is loading too slowly;
Fragment duration: ${n.duration.toFixed(3)}
Time to underbuffer: ${We.toFixed(3)} s
Estimated load time for current fragment: ${dr.toFixed(3)} s
Estimated load time for down switch fragment: ${Kr.toFixed(3)} s
TTFB estimate: ${_t|0} ms
Current BW estimate: ${z(at)?at|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${Jr} @ ${Ar|0} bps`),s.nextLoadLevel=s.nextAutoLevel=Jr,this.clearTimer();const cn=()=>{if(this.clearTimer(),this.fragCurrent===n&&this.hls.loadLevel===Jr&&Jr>0){const Pn=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Jr>0?"and switching down":""}
Fragment duration: ${n.duration.toFixed(3)} s
Time to underbuffer: ${Pn.toFixed(3)} s`),n.abortRequests(),this.fragCurrent=this.partCurrent=null,Jr>x){let dn=this.findBestLevel(this.hls.levels[x].bitrate,x,Jr,0,Pn,1,1);dn===-1&&(dn=x),this.hls.nextLoadLevel=this.hls.nextAutoLevel=dn,this.resetEstimator(this.hls.levels[dn].bitrate)}}};M||dr>Kr*2?cn():this.timer=self.setInterval(cn,Kr*1e3),s.trigger(_.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:i,stats:g})},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 ne(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 Y.BUFFER_ADD_CODEC_ERROR:case Y.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case Y.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(),a=i?i.stats:r.stats,c=s-a.loading.start,l=a.loading.first?a.loading.first-a.loading.start:-1;if(a.loaded&&l>-1){const p=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(p,l),a.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;z(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===H.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],a=(s.loaded?s.loaded.bytes:0)+n.loaded,c=(s.loaded?s.loaded.duration:0)+i;s.loaded={bytes:a,duration:c},s.realBitrate=Math.round(8*a/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!==H.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,a=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 ${a}`),a}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,a=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),l=this.getStarvationDelay();let g=i.abrBandWidthFactor,p=i.abrBandWidthUpFactor;if(l){const M=this.findBestLevel(c,s,n,l,0,g,p);if(M>=0)return this.rebufferNotice=-1,M}let v=a?Math.min(a,i.maxStarvationDelay):i.maxStarvationDelay;if(!l){const M=this.bitrateTestDelay;M&&(v=(a?Math.min(a,i.maxLoadingDelay):i.maxLoadingDelay)-M,this.info(`bitrate test took ${Math.round(1e3*M)}ms, set first fragment max fetchDuration to ${Math.round(1e3*v)} ms`),g=p=1)}const x=this.findBestLevel(c,s,n,l,v,g,p);if(this.rebufferNotice!==x&&(this.rebufferNotice=x,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${x}`)),x>-1)return x;const S=r.levels[s],O=r.loadLevelObj;return O&&(S==null?void 0:S.bitrate)<O.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,a){var c;const l=n+i,g=this.lastLoadedFragLevel,p=g===-1?this.hls.firstLevel:g,{fragCurrent:v,partCurrent:x}=this,{levels:S,allAudioTracks:O,loadLevel:M,config:ie}=this.hls;if(S.length===1)return 0;const Be=S[p],_e=!!((c=this.hls.latestLevelDetails)!=null&&c.live),Qe=M===-1||g===-1;let We,_t="SDR",Ge=(Be==null?void 0:Be.frameRate)||0;const{audioPreference:at,videoPreference:ft}=ie,ze=this.audioTracksByGroup||(this.audioTracksByGroup=wr(O));let Lt=-1;if(Qe){if(this.firstSelection!==-1)return this.firstSelection;const hr=this.codecTiers||(this.codecTiers=kr(S,ze,t,r)),_r=ti(hr,_t,e,at,ft),{codecSet:vr,videoRanges:Kr,minFramerate:Jr,minBitrate:Ar,minIndex:ar,preferHDR:cn}=_r;Lt=ar,We=vr,_t=cn?Kr[Kr.length-1]:Kr[0],Ge=Jr,e=Math.max(e,Ar),this.log(`picked start tier ${Hr(_r)}`)}else We=Be==null?void 0:Be.codecSet,_t=Be==null?void 0:Be.videoRange;const lr=x?x.duration:v?v.duration:0,br=this.bwEstimator.getEstimateTTFB()/1e3,Or=[];for(let hr=r;hr>=t;hr--){var dr;const _r=S[hr],vr=hr>p;if(!_r)continue;if(ie.useMediaCapabilities&&!_r.supportedResult&&!_r.supportedPromise){const dn=navigator.mediaCapabilities;typeof(dn==null?void 0:dn.decodingInfo)=="function"&&Yt(_r,ze,_t,Ge,e,at)?(_r.supportedPromise=$r(_r,ze,dn,this.supportedCache),_r.supportedPromise.then(Tn=>{if(!this.hls)return;_r.supportedResult=Tn;const Fi=this.hls.levels,yi=Fi.indexOf(_r);Tn.error?this.warn(`MediaCapabilities decodingInfo error: "${Tn.error}" for level ${yi} ${Hr(Tn)}`):Tn.supported?Tn.decodingInfoResults.some(is=>is.smooth===!1||is.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${yi} not smooth or powerEfficient: ${Hr(Tn)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${yi} ${Hr(Tn)}`),yi>-1&&Fi.length>1&&(this.log(`Removing unsupported level ${yi}`),this.hls.removeLevel(yi),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):_r.supportedResult=qr}if((We&&_r.codecSet!==We||_t&&_r.videoRange!==_t||vr&&Ge>_r.frameRate||!vr&&Ge>0&&Ge<_r.frameRate||(dr=_r.supportedResult)!=null&&(dr=dr.decodingInfoResults)!=null&&dr.some(dn=>dn.smooth===!1))&&(!Qe||hr!==Lt)){Or.push(hr);continue}const Kr=_r.details,Jr=(x?Kr==null?void 0:Kr.partTarget:Kr==null?void 0:Kr.averagetargetduration)||lr;let Ar;vr?Ar=a*e:Ar=s*e;const ar=lr&&n>=lr*2&&i===0?_r.averageBitrate:_r.maxBitrate,cn=this.getTimeToLoadFrag(br,Ar,ar*Jr,Kr===void 0);if(Ar>=ar&&(hr===g||_r.loadError===0&&_r.fragmentError===0)&&(cn<=br||!z(cn)||_e&&!this.bitrateTestDelay||cn<l)){const dn=this.forcedAutoLevel;return hr!==M&&(dn===-1||dn!==M)&&(Or.length&&this.trace(`Skipped level(s) ${Or.join(",")} of ${r} max with CODECS and VIDEO-RANGE:"${S[Or[0]].codecs}" ${S[Or[0]].videoRange}; not compatible with "${We}" ${_t}`),this.info(`switch candidate:${p}->${hr} adjustedbw(${Math.round(Ar)})-bitrate=${Math.round(Ar-ar)} ttfb:${br.toFixed(1)} avgDuration:${Jr.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${cn.toFixed(1)} firstSelection:${Qe} codecSet:${_r.codecSet} videoRange:${_r.videoRange} hls.loadLevel:${M}`)),Qe&&(this.firstSelection=hr),hr}}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 Zr={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 Rr(A,e,t){if(e===null||!Array.isArray(A)||!A.length||!z(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(oe(e,t,s))return s}return null}function Dr(A,e,t=0,r=0,n=.005){let i=null;if(A){i=e[1+A.sn-e[0].sn]||null;const a=A.endDTS-t;a>0&&a<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)&&P(t,r,i)===0||Q(i,A,Math.min(n,r))))return i;const s=Zr.search(e,P.bind(null,t,r));return s&&(s!==A||!i)?s:i}function Q(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 P(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 oe(A,e,t){const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-r>A}function pe(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 Zr.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 Re(A){switch(A.details){case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_TIMEOUT:case Y.LEVEL_LOAD_TIMEOUT:case Y.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function je(A,e){const t=Re(e);return A.default[`${t?"timeout":"error"}Retry`]}function ct(A,e){const t=A.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*A.retryDelayMs,A.maxRetryDelayMs)}function dt(A){return C(C({},A),{errorRetry:null,timeoutRetry:null})}function Ot(A,e,t,r){if(!A)return!1;const n=r==null?void 0:r.code,i=e<A.maxNumRetry&&(Dt(n)||!!t);return A.shouldRetry?A.shouldRetry(A,e,t,r,i):i}function Dt(A){return A===0&&navigator.onLine===!1||!!A&&(A<400||A>499)}var be={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},st={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Tt extends G{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},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,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===H.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var r;if(t.fatal)return;const n=this.hls,i=t.context;switch(t.details){case Y.FRAG_LOAD_ERROR:case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_ERROR:case Y.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case Y.FRAG_PARSING_ERROR:if((r=t.frag)!=null&&r.gap){t.errorAction=Jt();return}case Y.FRAG_GAP:case Y.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=be.SendAlternateToPenaltyBox;return}case Y.LEVEL_EMPTY_ERROR:case Y.LEVEL_PARSING_ERROR:{var s;const c=t.parent===H.MAIN?t.level:n.loadLevel;t.details===Y.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 Y.LEVEL_LOAD_ERROR:case Y.LEVEL_LOAD_TIMEOUT:typeof(i==null?void 0:i.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level));return;case Y.AUDIO_TRACK_LOAD_ERROR:case Y.AUDIO_TRACK_LOAD_TIMEOUT:case Y.SUBTITLE_LOAD_ERROR:case Y.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){const c=n.loadLevelObj;if(c&&(i.type===ye.AUDIO_TRACK&&c.hasAudioGroup(i.groupId)||i.type===ye.SUBTITLE_TRACK&&c.hasSubtitleGroup(i.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=be.SendAlternateToPenaltyBox,t.errorAction.flags=st.MoveAllAlternatesMatchingHost;return}}return;case Y.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=n.loadLevelObj,l=c==null?void 0:c.attrs["HDCP-LEVEL"];l?t.errorAction={action:be.SendAlternateToPenaltyBox,flags:st.MoveAllAlternatesMatchingHDCP,hdcpLevel:l}:this.keySystemError(t)}return;case Y.BUFFER_ADD_CODEC_ERROR:case Y.REMUX_ALLOC_ERROR:case Y.BUFFER_APPEND_ERROR:if(!t.errorAction){var a;t.errorAction=this.getLevelSwitchAction(t,(a=t.level)!=null?a:n.loadLevel)}return;case Y.INTERNAL_EXCEPTION:case Y.BUFFER_APPENDING_ERROR:case Y.BUFFER_FULL_ERROR:case Y.LEVEL_SWITCH_ERROR:case Y.BUFFER_STALLED_ERROR:case Y.BUFFER_SEEK_OVER_HOLE:case Y.BUFFER_NUDGE_ON_STALL:t.errorAction=Jt();return}t.type===ve.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const r=this.hls,n=je(r.config.playlistLoadPolicy,e),i=this.playlistError++;if(Ot(n,i,Re(e),e.response))return{action:be.RetryRequest,flags:st.None,retryConfig:n,retryCount:i};const a=this.getLevelSwitchAction(e,t);return n&&(a.retryConfig=n,a.retryCount=i),a}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),n=t.levels[r],{fragLoadPolicy:i,keyLoadPolicy:s}=t.config,a=je(e.details.startsWith("key")?s:i,e),c=t.levels.reduce((g,p)=>g+p.fragmentError,0);if(n&&(e.details!==Y.FRAG_GAP&&n.fragmentError++,Ot(a,c,Re(e),e.response)))return{action:be.RetryRequest,flags:st.None,retryConfig:a,retryCount:c};const l=this.getLevelSwitchAction(e,r);return a&&(l.retryConfig=a,l.retryCount=c),l}getLevelSwitchAction(e,t){const r=this.hls;t==null&&(t=r.loadLevel);const n=this.hls.levels[t];if(n){var i,s;const l=e.details;n.loadError++,l===Y.BUFFER_APPEND_ERROR&&n.fragmentError++;let g=-1;const{levels:p,loadLevel:v,minAutoLevel:x,maxAutoLevel:S}=r;!r.autoLevelEnabled&&!r.config.preserveManualLevelOnError&&(r.loadLevel=-1);const O=(i=e.frag)==null?void 0:i.type,ie=(O===H.AUDIO&&l===Y.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(l===Y.BUFFER_ADD_CODEC_ERROR||l===Y.BUFFER_APPEND_ERROR))&&p.some(({audioCodec:_t})=>n.audioCodec!==_t),_e=e.sourceBufferName==="video"&&(l===Y.BUFFER_ADD_CODEC_ERROR||l===Y.BUFFER_APPEND_ERROR)&&p.some(({codecSet:_t,audioCodec:Ge})=>n.codecSet!==_t&&n.audioCodec===Ge),{type:Qe,groupId:We}=(s=e.context)!=null?s:{};for(let _t=p.length;_t--;){const Ge=(_t+v)%p.length;if(Ge!==v&&Ge>=x&&Ge<=S&&p[Ge].loadError===0){var a,c;const at=p[Ge];if(l===Y.FRAG_GAP&&O===H.MAIN&&e.frag){const ft=p[Ge].details;if(ft){const ze=Dr(e.frag,ft.fragments,e.frag.start);if(ze!=null&&ze.gap)continue}}else{if(Qe===ye.AUDIO_TRACK&&at.hasAudioGroup(We)||Qe===ye.SUBTITLE_TRACK&&at.hasSubtitleGroup(We))continue;if(O===H.AUDIO&&(a=n.audioGroups)!=null&&a.some(ft=>at.hasAudioGroup(ft))||O===H.SUBTITLE&&(c=n.subtitleGroups)!=null&&c.some(ft=>at.hasSubtitleGroup(ft))||ie&&n.audioCodec===at.audioCodec||!ie&&n.audioCodec!==at.audioCodec||_e&&n.codecSet===at.codecSet)continue}g=Ge;break}}if(g>-1&&r.loadLevel!==g)return e.levelRetry=!0,this.playlistError=0,{action:be.SendAlternateToPenaltyBox,flags:st.None,nextAutoLevel:g}}return{action:be.SendAlternateToPenaltyBox,flags:st.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var r;switch((r=t.errorAction)==null?void 0:r.action){case be.DoNothing:break;case be.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==Y.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 be.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:n,hdcpLevel:i,nextAutoLevel:s}=r;switch(n){case st.None:this.switchLevel(e,s);break;case st.MoveAllAlternatesMatchingHDCP:i&&(t.maxHdcpLevel=In[In.indexOf(i)-1],r.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}r.resolved||this.switchLevel(e,s)}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===Y.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const r=Ir(e.mimeType),n=this.hls.levels;for(let i=n.length;i--;)n[i][`${e.sourceBufferName}Codec`]===r&&this.hls.removeLevel(i)}}}function Jt(A){const e={action:be.DoNothing,flags:st.None};return A&&(e.resolved=!0),e}var Kt={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class $t{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 a=n[i[s]];if((a==null?void 0:a.body.type)===t&&(!r||a.buffered)){const c=a.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(a=>{const c=this.fragments[a];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||i)){c.body.type===r&&this.removeFragment(c.body);return}const l=c.range[e];if(l){if(l.time.length===0){this.removeFragment(c.body);return}l.time.some(g=>{const p=!this.isTimeBuffered(g.startPTS,g.endPTS,t);return p&&this.removeFragment(c.body),p})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const r=e.frag,n=nr(r),i=this.fragments[n];if(!i||i.buffered&&r.gap)return;const s=!r.relurl;Object.keys(t).forEach(a=>{const c=r.elementaryStreams[a];if(!c)return;const l=t[a],g=s||c.partial===!0;i.range[a]=this.getBufferedTimes(r,e.part,g,l)}),i.loaded=null,Object.keys(i.range).length?(i.buffered=!0,(i.body.endList=r.endList||i.body.endList)&&(this.endListFragments[i.body.type]=i),Zt(i)||this.removeParts(r.sn-1,r.type)):this.removeFragment(i.body)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=xr(r,n=>n.fragment.sn>=e))}fragBuffered(e,t){const r=nr(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,n.buffered=!0)}getBufferedTimes(e,t,r,n){const i={time:[],partial:r},s=e.start,a=e.end,c=e.minEndPTS||a,l=e.maxStartPTS||s;for(let g=0;g<n.length;g++){const p=n.start(g)-this.bufferPadding,v=n.end(g)+this.bufferPadding;if(l>=p&&c<=v){i.time.push({startPTS:Math.max(s,n.start(g)),endPTS:Math.min(a,n.end(g))});break}else if(s<v&&a>p){const x=Math.max(s,n.start(g)),S=Math.min(a,n.end(g));S>x&&(i.partial=!0,i.time.push({startPTS:x,endPTS:S}))}else if(a<=p)break}return i}getPartialFragment(e){let t=null,r,n,i,s=0;const{bufferPadding:a,fragments:c}=this;return Object.keys(c).forEach(l=>{const g=c[l];g&&Zt(g)&&(n=g.body.start-a,i=g.body.end+a,e>=n&&e<=i&&(r=Math.min(e-n,i-e),s<=r&&(t=g.body,s=r)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Zt(t))}getState(e){const t=nr(e),r=this.fragments[t];return r?r.buffered?Zt(r)?Kt.PARTIAL:Kt.OK:Kt.APPENDING:Kt.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=nr(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 a=r.type;if(n){let l=this.activePartLists[a];l||(this.activePartLists[a]=l=[]),l.push(n)}this.timeRanges=i;const c=i[s];this.detectEvictedFragments(s,c,a,n)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=nr(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 a=this.fragments[s];if(!a)return;const c=a.body;c.type!==r||n&&!c.gap||c.start<t&&c.end>e&&(a.buffered||i)&&this.removeFragment(c)})}removeFragment(e){const t=nr(e);e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const n=e.sn;this.activePartLists[e.type]=xr(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 Zt(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 nr(A){return`${A.type}_${A.level}_${A.sn}`}function xr(A,e){return A.filter(t=>{const r=e(t);return r||t.clearElementaryStreamInfo(),r})}var or={cbc:0,ctr:1};class er{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 or.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case or.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 Ur(A){const e=A.byteLength,t=e&&new DataView(A.buffer).getUint8(e-1);return t?A.slice(0,e-t):A}class Lr{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],a=r[3],c=this.invSubMix,l=c[0],g=c[1],p=c[2],v=c[3],x=new Uint32Array(256);let S=0,O=0,M=0;for(M=0;M<256;M++)M<128?x[M]=M<<1:x[M]=M<<1^283;for(M=0;M<256;M++){let ie=O^O<<1^O<<2^O<<3^O<<4;ie=ie>>>8^ie&255^99,e[S]=ie,t[ie]=S;const Be=x[S],_e=x[Be],Qe=x[_e];let We=x[ie]*257^ie*16843008;n[S]=We<<24|We>>>8,i[S]=We<<16|We>>>16,s[S]=We<<8|We>>>24,a[S]=We,We=Qe*16843009^_e*65537^Be*257^S*16843008,l[ie]=We<<24|We>>>8,g[ie]=We<<16|We>>>16,p[ie]=We<<8|We>>>24,v[ie]=We,S?(S=Be^x[x[x[Qe^Be]]],O^=x[x[O]]):S=O=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 a,c;const l=this.keySchedule=new Uint32Array(s),g=this.invKeySchedule=new Uint32Array(s),p=this.sBox,v=this.rcon,x=this.invSubMix,S=x[0],O=x[1],M=x[2],ie=x[3];let Be,_e;for(a=0;a<s;a++){if(a<i){Be=l[a]=t[a];continue}_e=Be,a%i===0?(_e=_e<<8|_e>>>24,_e=p[_e>>>24]<<24|p[_e>>>16&255]<<16|p[_e>>>8&255]<<8|p[_e&255],_e^=v[a/i|0]<<24):i>6&&a%i===4&&(_e=p[_e>>>24]<<24|p[_e>>>16&255]<<16|p[_e>>>8&255]<<8|p[_e&255]),l[a]=Be=(l[a-i]^_e)>>>0}for(c=0;c<s;c++)a=s-c,c&3?_e=l[a]:_e=l[a-4],c<4||a<=4?g[c]=_e:g[c]=S[p[_e>>>24]]^O[p[_e>>>16&255]]^M[p[_e>>>8&255]]^ie[p[_e&255]],g[c]=g[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,a=this.invSubMix,c=a[0],l=a[1],g=a[2],p=a[3],v=this.uint8ArrayToUint32Array_(r);let x=v[0],S=v[1],O=v[2],M=v[3];const ie=new Int32Array(e),Be=new Int32Array(ie.length);let _e,Qe,We,_t,Ge,at,ft,ze,Lt,lr,br,Or,dr,hr;const _r=this.networkToHostOrderSwap;for(;t<ie.length;){for(Lt=_r(ie[t]),lr=_r(ie[t+1]),br=_r(ie[t+2]),Or=_r(ie[t+3]),Ge=Lt^i[0],at=Or^i[1],ft=br^i[2],ze=lr^i[3],dr=4,hr=1;hr<n;hr++)_e=c[Ge>>>24]^l[at>>16&255]^g[ft>>8&255]^p[ze&255]^i[dr],Qe=c[at>>>24]^l[ft>>16&255]^g[ze>>8&255]^p[Ge&255]^i[dr+1],We=c[ft>>>24]^l[ze>>16&255]^g[Ge>>8&255]^p[at&255]^i[dr+2],_t=c[ze>>>24]^l[Ge>>16&255]^g[at>>8&255]^p[ft&255]^i[dr+3],Ge=_e,at=Qe,ft=We,ze=_t,dr=dr+4;_e=s[Ge>>>24]<<24^s[at>>16&255]<<16^s[ft>>8&255]<<8^s[ze&255]^i[dr],Qe=s[at>>>24]<<24^s[ft>>16&255]<<16^s[ze>>8&255]<<8^s[Ge&255]^i[dr+1],We=s[ft>>>24]<<24^s[ze>>16&255]<<16^s[Ge>>8&255]<<8^s[at&255]^i[dr+2],_t=s[ze>>>24]<<24^s[Ge>>16&255]<<16^s[at>>8&255]<<8^s[ft&255]^i[dr+3],Be[t]=_r(_e^x),Be[t+1]=_r(_t^S),Be[t+2]=_r(We^O),Be[t+3]=_r(Qe^M),x=Lt,S=lr,O=br,M=Or,t=t+4}return Be.buffer}}class Gr{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=Tr(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Tr(A){switch(A){case or.cbc:return"AES-CBC";case or.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${A}`)}}const Br=16;class Yr{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?Ur(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 a=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(a,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:a}=this;if(n!==or.cbc||t.byteLength!==16)return le.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),a&&(e=ut(a,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;i&&(r=i);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new Lr),l.expandKey(t);const g=s;return this.currentResult=l.decrypt(c.buffer,0,r),this.currentIV=c.slice(-16).buffer,g||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 Gr(this.subtle,t,n)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new er(this.subtle,new Uint8Array(r),n).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(le.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%Br;return r!==e.length&&(t=e.slice(0,r),this.remainderData=e.slice(r)),t}logOnce(e){this.logEnabled&&(le.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Qr=Math.pow(2,17);class Xr{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 jr({type:ve.NETWORK_ERROR,details:Y.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((a,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(S=>S[0]==="GAP")){c(_n(e));return}else e.gap=!1;const l=this.loader=i?new i(n):new s(n),g=ln(e);e.loader=l;const p=dt(n.fragLoadPolicy.default),v={loadPolicy:p,timeout:p.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Qr};e.stats=l.stats;const x={onSuccess:(S,O,M,ie)=>{this.resetLoader(e,l);let Be=S.data;M.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(Be.slice(0,16)),Be=Be.slice(16)),a({frag:e,part:null,payload:Be,networkDetails:ie})},onError:(S,O,M,ie)=>{this.resetLoader(e,l),c(new jr({type:ve.NETWORK_ERROR,details:Y.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:C({url:r,data:void 0},S),error:new Error(`HTTP Error ${S.code} ${S.text}`),networkDetails:M,stats:ie}))},onAbort:(S,O,M)=>{this.resetLoader(e,l),c(new jr({type:ve.NETWORK_ERROR,details:Y.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:M,stats:S}))},onTimeout:(S,O,M)=>{this.resetLoader(e,l),c(new jr({type:ve.NETWORK_ERROR,details:Y.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:M,stats:S}))}};t&&(x.onProgress=(S,O,M,ie)=>t({frag:e,part:null,payload:M,networkDetails:ie})),l.load(g,v,x)})}loadPart(e,t,r){this.abort();const n=this.config,i=n.fLoader,s=n.loader;return new Promise((a,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(_n(e,t));return}const l=this.loader=i?new i(n):new s(n),g=ln(e,t);e.loader=l;const p=dt(n.fragLoadPolicy.default),v={loadPolicy:p,timeout:p.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Qr};t.stats=l.stats,l.load(g,v,{onSuccess:(x,S,O,M)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const ie={frag:e,part:t,payload:x.data,networkDetails:M};r(ie),a(ie)},onError:(x,S,O,M)=>{this.resetLoader(e,l),c(new jr({type:ve.NETWORK_ERROR,details:Y.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:C({url:g.url,data:void 0},x),error:new Error(`HTTP Error ${x.code} ${x.text}`),networkDetails:O,stats:M}))},onAbort:(x,S,O)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),c(new jr({type:ve.NETWORK_ERROR,details:Y.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:O,stats:x}))},onTimeout:(x,S,O)=>{this.resetLoader(e,l),c(new jr({type:ve.NETWORK_ERROR,details:Y.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:O,stats:x}))}})})}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),l=Math.min(Math.round(r.loaded/i),c),p=(c-l)*Math.round(r.loaded/l);r.total=r.loaded+p}else r.total=Math.max(r.loaded,r.total);const s=r.loading,a=n.loading;s.start?s.first+=a.first-a.start:(s.start=a.start,s.first=a.first),s.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function ln(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(z(n)&&z(i)){var s;let a=n,c=i;if(A.sn==="initSegment"&&un((s=A.decryptdata)==null?void 0:s.method)){const l=i-n;l%16&&(c=i+(16-l%16)),n!==0&&(r.resetIV=!0,a=n-16)}r.rangeStart=a,r.rangeEnd=c}return r}function _n(A,e){const t=new Error(`GAP ${A.gap?"tag":"attribute"} found`),r={type:ve.MEDIA_ERROR,details:Y.FRAG_GAP,fatal:!1,frag:A,error:t,networkDetails:null};return e&&(r.part=e),(e||A).stats.aborted=!0,new jr(r)}function un(A){return A==="AES-128"||A==="AES-256"}class jr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Vr extends G{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 sn{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=rn(),this.buffering={audio:rn(),video:rn(),audiovideo:rn()},this.level=e,this.sn=t,this.id=r,this.size=n,this.part=i,this.partial=s}}function rn(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Vn={length:0,start:()=>0,end:()=>0};class sr{static isBuffered(e,t){if(e){const r=sr.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=sr.getBuffered(e);return sr.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=sr.bufferedRanges(e);if(n.length)return sr.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((g,p)=>g.start-p.start||p.end-g.end);let n=-1,i=[];if(r)for(let g=0;g<e.length;g++){t>=e[g].start&&t<=e[g].end&&(n=g);const p=i.length;if(p){const v=i[p-1].end;e[g].start-v<r?e[g].end>v&&(i[p-1].end=e[g].end):i.push(e[g])}else i.push(e[g])}else i=e;let s=0,a,c=t,l=t;for(let g=0;g<i.length;g++){const p=i[g].start,v=i[g].end;if(n===-1&&t>=p&&t<=v&&(n=g),t+r>=p&&t<v)c=p,l=v,s=l-t;else if(t+r<p){a=p;break}}return{len:s,start:c||0,end:l||0,nextStart:a,buffered:e,bufferedIndex:n}}static getBuffered(e){try{return e.buffered||Vn}catch(t){return le.log("failed to get media.buffered",t),Vn}}}const pn=/\{\$([a-zA-Z0-9-_]+)\}/g;function bn(A){return pn.test(A)}function Sn(A,e){if(A.variableList!==null||A.hasVariableRefs){const t=A.variableList;return e.replace(pn,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 vn(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 Wn(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 si=/^(\d+)x(\d+)$/,ri=/(.+?)=(".*?"|.*?)(?:,|$)/g;class hn{constructor(e,t){typeof e=="string"&&(e=hn.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=si.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(ri.lastIndex=0;(r=ri.exec(e))!==null;){const s=r[1].trim();let a=r[2];const c=a.indexOf(i)===0&&a.lastIndexOf(i)===a.length-1;let l=!1;if(c)a=a.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":l=!0}if(t&&(c||l))a=Sn(t,a);else if(!l&&!c)switch(s){case"CLOSED-CAPTIONS":if(a==="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":le.warn(`${e}: attribute ${s} is missing quotes`)}n[s]=a}return n}}const Bi="com.apple.hls.interstitial";function li(A){return A!=="ID"&&A!=="CLASS"&&A!=="CUE"&&A!=="START-DATE"&&A!=="DURATION"&&A!=="END-DATE"&&A!=="END-ON-NEXT"}function Zn(A){return A==="SCTE35-OUT"||A==="SCTE35-IN"||A==="SCTE35-CMD"}class ui{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]){le.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=B(new hn({}),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"]);z(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?(le.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(z(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===Bi}get isValid(){return!!this.id&&!this._badValueForSameId&&z(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 Ti=10;class Hi{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}get hasProgramDateTime(){return this.fragments.length?z(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Ti}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(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var e;return(e=this.fragments)!=null&&e.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 gi(A){return A==="AES-128"||A==="AES-256"||A==="AES-256-CTR"}function hi(A){switch(A){case"AES-128":case"AES-256":return or.cbc;case"AES-256-CTR":return or.ctr;default:throw new Error(`invalid full segment method ${A}`)}}function Ei(A){return Uint8Array.from(atob(A),e=>e.charCodeAt(0))}function zn(A){return Uint8Array.from(unescape(encodeURIComponent(A)),e=>e.charCodeAt(0))}function pi(A){const e=zn(A).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Ki(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 Xn(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=Ei(s)):t=pi(s)}}return t}const Qn=typeof self!="undefined"?self:void 0;var An={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},kn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function ci(A){switch(A){case kn.FAIRPLAY:return An.FAIRPLAY;case kn.PLAYREADY:return An.PLAYREADY;case kn.WIDEVINE:return An.WIDEVINE;case kn.CLEARKEY:return An.CLEARKEY}}function Ii(A){switch(A){case An.FAIRPLAY:return kn.FAIRPLAY;case An.PLAYREADY:return kn.PLAYREADY;case An.WIDEVINE:return kn.WIDEVINE;case An.CLEARKEY:return kn.CLEARKEY}}function Di(A){const{drmSystems:e,widevineLicenseUrl:t}=A,r=e?[An.FAIRPLAY,An.WIDEVINE,An.PLAYREADY,An.CLEARKEY].filter(n=>!!e[n]):[];return!r[An.WIDEVINE]&&t&&r.push(An.WIDEVINE),r}const Oi=function(A){return Qn!=null&&(A=Qn.navigator)!=null&&A.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function wi(A,e,t,r){let n;switch(A){case An.FAIRPLAY:n=["cenc","sinf"];break;case An.WIDEVINE:case An.PLAYREADY:n=["cenc"];break;case An.CLEARKEY:n=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${A}`)}return Bn(n,e,t,r)}function Bn(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 pr(A){var e;return A.sessionType==="persistent-license"||!!((e=A.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function Nr(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 a=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(a){const c=Ei(a).subarray(0,16);return Ki(c),c}}return null}let En={};class xn{static clearKeyUriToKeyIdMap(){En={}}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&&!gi(e),s!=null&&s.startsWith("0x")&&(this.keyId=new Uint8Array(L(s)))}matches(e){var t,r;return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&e.keyFormatVersions.join(",")===this.keyFormatVersions.join(",")&&((t=e.iv)==null?void 0:t.join(","))===((r=this.iv)==null?void 0:r.join(","))}isSupported(){if(this.method){if(gi(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case kn.FAIRPLAY:case kn.WIDEVINE:case kn.PLAYREADY:case kn.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(gi(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(le.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const r=yn(e);return new xn(this.method,this.uri,"identity",this.keyFormatVersions,r)}if(this.pssh&&this.keyId)return this;const t=Xn(this.uri);if(t)switch(this.keyFormat){case kn.WIDEVINE:if(this.pssh=t,!this.keyId&&t.length>=22){const r=t.length-22;this.keyId=t.subarray(r,r+16)}break;case kn.PLAYREADY:{const r=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=tr(r,null,t),this.keyId=Nr(t);break}default:{let r=t.subarray(0,16);if(r.length!==16){const n=new Uint8Array(16);n.set(r,16-r.length),r=n}this.keyId=r;break}}if(!this.keyId||this.keyId.byteLength!==16){let r=En[this.uri];if(!r){const n=Object.keys(En).length%Number.MAX_SAFE_INTEGER;r=new Uint8Array(16),new DataView(r.buffer,12,4).setUint32(0,n),En[this.uri]=r}this.keyId=r}return this}}function yn(A){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=A>>8*(15-t)&255;return e}const ji=/#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,jn=/#EXT-X-MEDIA:(.*)/g,Kn=/^#EXT(?:INF|-X-TARGETDURATION):/m,$i=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),ni=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 Ci{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 Kn.test(e)}static parseMasterPlaylist(e,t){const r=bn(e),n={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:r},i=[];ji.lastIndex=0;let s;for(;(s=ji.exec(e))!=null;)if(s[1]){var a;const l=new hn(s[1],n),g=Sn(n,s[2]),p={attrs:l,bitrate:l.decimalInteger("BANDWIDTH")||l.decimalInteger("AVERAGE-BANDWIDTH"),name:l.NAME,url:Ci.resolve(g,t)},v=l.decimalResolution("RESOLUTION");v&&(p.width=v.width,p.height=v.height),eA(l.CODECS,p);const x=l["SUPPLEMENTAL-CODECS"];x&&(p.supplemental={},eA(x,p.supplemental)),(a=p.unknownCodecs)!=null&&a.length||i.push(p),n.levels.push(p)}else if(s[3]){const l=s[3],g=s[4];switch(l){case"SESSION-DATA":{const p=new hn(g,n),v=p["DATA-ID"];v&&(n.sessionData===null&&(n.sessionData={}),n.sessionData[v]=p);break}case"SESSION-KEY":{const p=Dn(g,t,n);p.encrypted&&p.isSupported()?(n.sessionKeys===null&&(n.sessionKeys=[]),n.sessionKeys.push(p)):le.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${g}"`);break}case"DEFINE":{{const p=new hn(g,n);vn(n,p,t)}break}case"CONTENT-STEERING":{const p=new hn(g,n);n.contentSteering={uri:Ci.resolve(p["SERVER-URI"],t),pathwayId:p["PATHWAY-ID"]||"."};break}case"START":{n.startTimeOffset=Es(g);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,a={AUDIO:s.map(l=>({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:s.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(jn.lastIndex=0;(n=jn.exec(e))!==null;){const l=new hn(n[1],r),g=l.TYPE;if(g){const p=a[g],v=i[g]||[];i[g]=v;const x=l.LANGUAGE,S=l["ASSOC-LANGUAGE"],O=l.CHANNELS,M=l.CHARACTERISTICS,ie=l["INSTREAM-ID"],Be={attrs:l,bitrate:0,id:c++,groupId:l["GROUP-ID"]||"",name:l.NAME||x||"",type:g,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:x,url:l.URI?Ci.resolve(l.URI,t):""};if(S&&(Be.assocLang=S),O&&(Be.channels=O),M&&(Be.characteristics=M),ie&&(Be.instreamId=ie),p!=null&&p.length){const _e=Ci.findGroup(p,Be.groupId)||p[0];Ts(Be,_e,"audioCodec"),Ts(Be,_e,"textCodec")}v.push(Be)}}return i}static parseLevelPlaylist(e,t,r,n,i,s){var a;const c={url:t},l=new Hi(t),g=l.fragments,p=[];let v=null,x=0,S=0,O=0,M=0,ie=0,Be=null,_e=new lt(n,c),Qe,We,_t,Ge=-1,at=!1,ft=null,ze;if($i.lastIndex=0,l.m3u8=e,l.hasVariableRefs=bn(e),((a=$i.exec(e))==null?void 0:a[0])!=="#EXTM3U")return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;(Qe=$i.exec(e))!==null;){at&&(at=!1,_e=new lt(n,c),_e.playlistOffset=O,_e.setStart(O),_e.sn=x,_e.cc=M,ie&&(_e.bitrate=ie),_e.level=r,v&&(_e.initSegment=v,v.rawProgramDateTime&&(_e.rawProgramDateTime=v.rawProgramDateTime,v.rawProgramDateTime=null),ft&&(_e.setByteRange(ft),ft=null)));const Or=Qe[1];if(Or){_e.duration=parseFloat(Or);const dr=(" "+Qe[2]).slice(1);_e.title=dr||null,_e.tagList.push(dr?["INF",Or,dr]:["INF",Or])}else if(Qe[3]){if(z(_e.duration)){_e.playlistOffset=O,_e.setStart(O),_t&&tA(_e,_t,l),_e.sn=x,_e.level=r,_e.cc=M,g.push(_e);const dr=(" "+Qe[3]).slice(1);_e.relurl=Sn(l,dr),As(_e,Be,p),Be=_e,O+=_e.duration,x++,S=0,at=!0}}else{if(Qe=Qe[0].match(ni),!Qe){le.warn("No matches on slow regex match for level playlist!");continue}for(We=1;We<Qe.length&&Qe[We]===void 0;We++);const dr=(" "+Qe[We]).slice(1),hr=(" "+Qe[We+1]).slice(1),_r=Qe[We+2]?(" "+Qe[We+2]).slice(1):null;switch(dr){case"BYTERANGE":Be?_e.setByteRange(hr,Be):_e.setByteRange(hr);break;case"PROGRAM-DATE-TIME":_e.rawProgramDateTime=hr,_e.tagList.push(["PROGRAM-DATE-TIME",hr]),Ge===-1&&(Ge=g.length);break;case"PLAYLIST-TYPE":l.type&&$n(l,dr,Qe),l.type=hr.toUpperCase();break;case"MEDIA-SEQUENCE":l.startSN!==0?$n(l,dr,Qe):g.length>0&&Vi(l,dr,Qe),x=l.startSN=parseInt(hr);break;case"SKIP":{l.skippedSegments&&$n(l,dr,Qe);const vr=new hn(hr,l),Kr=vr.decimalInteger("SKIPPED-SEGMENTS");if(z(Kr)){l.skippedSegments+=Kr;for(let Ar=Kr;Ar--;)g.push(null);x+=Kr}const Jr=vr.enumeratedString("RECENTLY-REMOVED-DATERANGES");Jr&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(Jr.split(" ")));break}case"TARGETDURATION":l.targetduration!==0&&$n(l,dr,Qe),l.targetduration=Math.max(parseInt(hr),1);break;case"VERSION":l.version!==null&&$n(l,dr,Qe),l.version=parseInt(hr);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||$n(l,dr,Qe),l.live=!1;break;case"#":(hr||_r)&&_e.tagList.push(_r?[hr,_r]:[hr]);break;case"DISCONTINUITY":M++,_e.tagList.push(["DIS"]);break;case"GAP":_e.gap=!0,_e.tagList.push([dr]);break;case"BITRATE":_e.tagList.push([dr,hr]),ie=parseInt(hr)*1e3,z(ie)?_e.bitrate=ie:ie=0;break;case"DATERANGE":{const vr=new hn(hr,l),Kr=new ui(vr,l.dateRanges[vr.ID],l.dateRangeTagCount);l.dateRangeTagCount++,Kr.isValid||l.skippedSegments?l.dateRanges[Kr.id]=Kr:le.warn(`Ignoring invalid DATERANGE tag: "${hr}"`),_e.tagList.push(["EXT-X-DATERANGE",hr]);break}case"DEFINE":{{const vr=new hn(hr,l);"IMPORT"in vr?Wn(l,vr,s):vn(l,vr,t)}break}case"DISCONTINUITY-SEQUENCE":l.startCC!==0?$n(l,dr,Qe):g.length>0&&Vi(l,dr,Qe),l.startCC=M=parseInt(hr);break;case"KEY":{const vr=Dn(hr,t,l);if(vr.isSupported()){if(vr.method==="NONE"){_t=void 0;break}_t||(_t={});const Kr=_t[vr.keyFormat];Kr!=null&&Kr.matches(vr)||(Kr&&(_t=B({},_t)),_t[vr.keyFormat]=vr)}else le.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${hr}"`);break}case"START":l.startTimeOffset=Es(hr);break;case"MAP":{const vr=new hn(hr,l);if(_e.duration){const Kr=new lt(n,c);Ms(Kr,vr,r,_t),v=Kr,_e.initSegment=v,v.rawProgramDateTime&&!_e.rawProgramDateTime&&(_e.rawProgramDateTime=v.rawProgramDateTime)}else{const Kr=_e.byteRangeEndOffset;if(Kr){const Jr=_e.byteRangeStartOffset;ft=`${Kr-Jr}@${Jr}`}else ft=null;Ms(_e,vr,r,_t),v=_e,at=!0}v.cc=M;break}case"SERVER-CONTROL":{ze&&$n(l,dr,Qe),ze=new hn(hr),l.canBlockReload=ze.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=ze.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&ze.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=ze.optionalFloat("PART-HOLD-BACK",0),l.holdBack=ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{l.partTarget&&$n(l,dr,Qe);const vr=new hn(hr);l.partTarget=vr.decimalFloatingPoint("PART-TARGET");break}case"PART":{let vr=l.partList;vr||(vr=l.partList=[]);const Kr=S>0?vr[vr.length-1]:void 0,Jr=S++,Ar=new hn(hr,l),ar=new Rt(Ar,_e,c,Jr,Kr);vr.push(ar),_e.duration+=ar.duration;break}case"PRELOAD-HINT":{const vr=new hn(hr,l);l.preloadHint=vr;break}case"RENDITION-REPORT":{const vr=new hn(hr,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(vr);break}default:le.warn(`line parsed but not handled: ${Qe}`);break}}}Be&&!Be.relurl?(g.pop(),O-=Be.duration,l.partList&&(l.fragmentHint=Be)):l.partList&&(As(_e,Be,p),_e.cc=M,l.fragmentHint=_e,_t&&tA(_e,_t,l)),l.targetduration||(l.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const Lt=g.length,lr=g[0],br=g[Lt-1];if(O+=l.skippedSegments*l.targetduration,O>0&&Lt&&br){l.averagetargetduration=O/Lt;const Or=br.sn;l.endSN=Or!=="initSegment"?Or:0,l.live||(br.endList=!0),Ge>0&&(Yi(g,Ge),lr&&p.unshift(lr))}return l.fragmentHint&&(O+=l.fragmentHint.duration),l.totalduration=O,p.length&&l.dateRangeTagCount&&lr&&Gi(p,l),l.endCC=M,l}}function Gi(A,e){const t=A.length;if(!t)return;const r=A[t-1],n=e.live?1/0:e.totalduration,i=Object.keys(e.dateRanges);for(let s=i.length;s--;){const a=e.dateRanges[i[s]],c=a.startDate.getTime();a.tagAnchor=r.ref;for(let l=t;l--;){const g=Ss(e,c,A,l,n);if(g!==-1){a.tagAnchor=e.fragments[g].ref;break}}}}function Ss(A,e,t,r,n){const i=t[r];if(i){const a=i.programDateTime;if(e>=a||r===0){var s;const c=(((s=t[r+1])==null?void 0:s.start)||n)-i.start;if(e<=a+c*1e3){const l=t[r].sn-A.startSN,g=A.fragments;if(g.length>t.length){const v=(t[r+1]||g[g.length-1]).sn-A.startSN;for(let x=v;x>l;x--){const S=g[x].programDateTime;if(e>=S&&e<S+g[x].duration*1e3)return x}}return l}}}return-1}function Dn(A,e,t){var r,n;const i=new hn(A,t),s=(r=i.METHOD)!=null?r:"",a=i.URI,c=i.hexadecimalInteger("IV"),l=i.KEYFORMATVERSIONS,g=(n=i.KEYFORMAT)!=null?n:"identity";a&&i.IV&&!c&&le.error(`Invalid IV: ${i.IV}`);const p=a?Ci.resolve(a,e):"",v=(l||"1").split("/").map(Number).filter(Number.isFinite);return new xn(s,p,g,v,c,i.KEYID)}function Es(A){const t=new hn(A).decimalFloatingPoint("TIME-OFFSET");return z(t)?t:null}function eA(A,e){let t=(A||"").split(/[ ,]+/).filter(r=>r);["video","audio","text"].forEach(r=>{const n=t.filter(i=>Er(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 Ts(A,e,t){const r=e[t];r&&(A[t]=r)}function Yi(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 As(A,e,t){A.rawProgramDateTime?t.push(A):e!=null&&e.programDateTime&&(A.programDateTime=e.endProgramDateTime)}function Ms(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 tA(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 $n(A,e,t){A.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function Vi(A,e,t){A.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Li(A,e){const t=e.startPTS;if(z(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 Jn(A,e,t,r,n,i){r-t<=0&&(le.warn("Fragment should have a positive duration",e),r=t+e.duration,i=n+e.duration);let a=t,c=r;const l=e.startPTS,g=e.endPTS;if(z(l)){const M=Math.abs(l-t);z(e.deltaPTS)?e.deltaPTS=Math.max(M,e.deltaPTS):e.deltaPTS=M,a=Math.max(t,l),t=Math.min(t,l),n=Math.min(n,e.startDTS),c=Math.min(r,g),r=Math.max(r,g),i=Math.max(i,e.endDTS)}const p=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(r-e.start),e.startPTS=t,e.maxStartPTS=a,e.startDTS=n,e.endPTS=r,e.minEndPTS=c,e.endDTS=i;const v=e.sn;if(!A||v<A.startSN||v>A.endSN)return 0;let x;const S=v-A.startSN,O=A.fragments;for(O[S]=e,x=S;x>0;x--)Li(O[x],O[x-1]);for(x=S;x<O.length-1;x++)Li(O[x],O[x+1]);return A.fragmentHint&&Li(O[O.length-1],A.fragmentHint),A.PTSKnown=A.alignedSliding=!0,p}function Xi(A,e){if(A===e)return;let t=null;const r=A.fragments;for(let l=r.length-1;l>=0;l--){const g=r[l].initSegment;if(g){t=g;break}}A.fragmentHint&&delete A.fragmentHint.endPTS;let n;Ns(A,e,(l,g,p,v)=>{if((!e.startCC||e.skippedSegments)&&g.cc!==l.cc){const x=l.cc-g.cc;for(let S=p;S<v.length;S++)v[S].cc+=x;e.endCC=v[v.length-1].cc}z(l.startPTS)&&z(l.endPTS)&&(g.setStart(g.startPTS=l.startPTS),g.startDTS=l.startDTS,g.maxStartPTS=l.maxStartPTS,g.endPTS=l.endPTS,g.endDTS=l.endDTS,g.minEndPTS=l.minEndPTS,g.setDuration(l.endPTS-l.startPTS),g.duration&&(n=g),e.PTSKnown=e.alignedSliding=!0),l.hasStreams&&(g.elementaryStreams=l.elementaryStreams),g.loader=l.loader,l.hasStats&&(g.stats=l.stats),l.initSegment&&(g.initSegment=l.initSegment,t=l.initSegment)});const i=e.fragments,s=e.fragmentHint?i.concat(e.fragmentHint):i;if(t&&s.forEach(l=>{var g;l&&(!l.initSegment||l.initSegment.relurl===((g=t)==null?void 0:g.relurl))&&(l.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=i.some(l=>!l),e.deltaUpdateFailed){le.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)i.shift();e.startSN=i[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=_A(A.dateRanges,e));const l=A.fragments.filter(g=>g.rawProgramDateTime);if(A.hasProgramDateTime&&!e.hasProgramDateTime)for(let g=1;g<s.length;g++)s[g].programDateTime===null&&As(s[g],s[g-1],l);Gi(l,e)}e.endCC=i[i.length-1].cc}if(!e.startCC){var a;const l=yA(A,e.startSN-1);e.startCC=(a=l==null?void 0:l.cc)!=null?a:i[0].cc}vA(A.partList,e.partList,(l,g)=>{g.elementaryStreams=l.elementaryStreams,g.stats=l.stats}),n?Jn(e,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS):Hs(A,e),i.length&&(e.totalduration=e.edge-i[0].start),e.driftStartTime=A.driftStartTime,e.driftStart=A.driftStart;const c=e.advancedDateTime;if(e.advanced&&c){const l=e.edge;e.driftStart||(e.driftStartTime=c,e.driftStart=l),e.driftEndTime=c,e.driftEnd=l}else e.driftEndTime=A.driftEndTime,e.driftEnd=A.driftEnd,e.advancedDateTime=A.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=A.requestScheduled)}function _A(A,e){const{dateRanges:t,recentlyRemovedDateranges:r}=e,n=B({},A);r&&r.forEach(a=>{delete n[a]});const s=Object.keys(n).length;return s&&Object.keys(t).forEach(a=>{const c=n[a],l=new ui(t[a].attr,c);l.isValid?(n[a]=l,c||(l.tagOrder+=s)):le.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Hr(t[a].attr)}"`)}),n}function vA(A,e,t){if(A&&e){let r=0;for(let n=0,i=A.length;n<=i;n++){const s=A[n],a=e[n+r];s&&a&&s.index===a.index&&s.fragment.sn===a.fragment.sn?t(s,a):r--}}}function Ns(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,a=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=A.fragmentHint?A.fragments.concat(A.fragmentHint):A.fragments;for(let l=n;l<=i;l++){const g=c[s+l];let p=a[l];if(r&&!p&&g&&(p=e.fragments[l]=g),g&&p){if(t(g,p,l,a),g.url&&g.url!==p.url){e.playlistParsingError=as(`media sequence mismatch ${p.sn}:`,A,e,g,p);return}else if(g.cc!==p.cc){e.playlistParsingError=as(`discontinuity sequence mismatch (${g.cc}!=${p.cc})`,A,e,g,p);return}}}}function as(A,e,t,r,n){return new Error(`${A} ${n.url}
Playlist starting @${e.startSN}
${e.m3u8}
Playlist starting @${t.startSN}
${t.m3u8}`)}function Hs(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;os(e,s)}function os(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 Pi(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 yA(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 rA(A,e,t){return A?Ji(A.partList,e,t):null}function Ji(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 nA(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 Is(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 la(A,e){return!!(A&&e.startCC<A.endCC&&e.endCC>A.startCC)}function mi(A,e){const t=A.start+e;A.startPTS=t,A.setStart(t),A.endPTS=t+A.duration}function iA(A,e){const t=e.fragments;for(let r=0,n=t.length;r<n;r++)mi(t[r],A);e.fragmentHint&&mi(e.fragmentHint,A),e.alignedSliding=!0}function ua(A,e){A&&(BA(e,A),e.alignedSliding||ls(e,A),!e.alignedSliding&&!e.skippedSegments&&Hs(A,e,!1))}function BA(A,e){if(!la(e,A))return;const t=Math.min(e.endCC,A.endCC),r=Is(e.fragments,t),n=Is(A.fragments,t);if(!r||!n)return;le.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const i=r.start-n.start;iA(i,A)}function ls(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=Is(r,s),i=Is(t,s)),(!n||!i)&&(n=r[Math.floor(r.length/2)],i=Is(t,n.cc)||t[Math.floor(t.length/2)]);const a=n.programDateTime,c=i.programDateTime;if(!a||!c)return;const l=(c-a)/1e3-(i.start-n.start);iA(l,A)}const ca={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}},pt={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 wn extends Vr{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=pt.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:a,media:c,mediaBuffer:l,state:g}=this,p=c?c.currentTime:0,v=sr.bufferInfo(l||c,p,s.maxBufferHole),x=!v.len;if(this.log(`Media seeking to ${z(p)?p.toFixed(3):p}, state: ${g}, ${x?"out of":"in"} buffer`),this.state===pt.ENDED)this.resetLoadingState();else if(a){const S=s.maxFragLookUpTolerance,O=a.start-S,M=a.start+a.duration+S;if(x||M<v.start||O>v.end){const ie=p>M;(p<O||ie)&&(ie&&a.loader&&(this.log(`Cancelling fragment load for seek (sn: ${a.sn})`),a.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(p,1/0,this.playlistType,!0);const S=this.lastCurrentTime;if(p>S&&(this.lastCurrentTime=p),!this.loadingParts){const O=Math.max(v.end,p),M=this.shouldLoadParts(this.getLevelDetails(),O);M&&(this.log(`LL-Part loading ON after seeking to ${p.toFixed(2)} with buffer @${O.toFixed(2)}`),this.loadingParts=M)}}this.hls.hasEnoughToStart||(this.log(`Setting ${x?"startPosition":"nextLoadPosition"} to ${p} for seek without enough to start`),this.nextLoadPosition=p,x&&(this.startPosition=p)),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 Xr(e.config),this.keyLoader=r,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Yr(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===pt.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=pt.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=sr.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 g=c[c.length-1];return sr.isBuffered(this.media,g.start+g.duration/2)}const l=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(l)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.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;r.removeEventListener("seeking",this.onMediaSeeking),r.removeEventListener("ended",this.onMediaEnded),r.addEventListener("seeking",this.onMediaSeeking),r.addEventListener("ended",this.onMediaEnded);const n=this.config;this.levels&&n.autoStartLoad&&this.state===pt.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),n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("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=pt.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,a=i.frag;if(this.fragContextChanged(a)){(s===pt.FRAG_LOADING||!this.fragCurrent&&s===pt.PARSING)&&(this.fragmentTracker.removeFragment(a),this.state=pt.IDLE);return}"payload"in i&&(this.log(`Loaded ${a.type} sn: ${a.sn} of ${this.playlistLabel()} ${a.level}`),this.hls.trigger(_.FRAG_LOADED,i)),this._handleFragmentLoadComplete(i)}).catch(i=>{this.state===pt.STOPPED||this.state===pt.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)===Kt.APPENDING){const i=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,i),a=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(a,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)===Kt.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,a=i.decryptdata;if(s&&s.byteLength>0&&a!=null&&a.key&&a.iv&&gi(a.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),a.key.buffer,a.iv.buffer,hi(a.method)).catch(l=>{throw n.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:i}),l}).then(l=>{const g=self.performance.now();return n.trigger(_.FRAG_DECRYPTED,{frag:i,payload:l,stats:{tstart:c,tdecrypt:g}}),r.payload=l,this.completeInitSegmentLoad(r)})}return this.completeInitSegmentLoad(r)}).catch(r=>{this.state===pt.STOPPED||this.state===pt.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!==pt.STOPPED&&(this.state=pt.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()}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?ca.toString(sr.getBuffered(r)):"(detached)"})`),$e(e)){var n;if(e.type!==H.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(a=>!!s[a])){this.state=pt.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=pt.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),a=new sn(r.level,r.sn,r.stats.chunkCount+1,0,n?n.index:-1,!s);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,n){var i;this.fragCurrent=e;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let a=null;e.encrypted&&!((i=e.decryptdata)!=null&&i.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=pt.KEY_LOADING,this.fragCurrent=e,a=this.keyLoader.load(e).then(v=>{if(!this.fragContextChanged(v.frag))return this.hls.trigger(_.KEY_LOADED,v),this.state===pt.KEY_LOADING&&(this.state=pt.IDLE),v}),this.hls.trigger(_.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):e.encrypted||(a=this.keyLoader.loadClear(e,s.encryptedFragments,this.startFragRequested),a&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if($e(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&&$e(e)){const v=s.partList;if(v&&n){r>e.end&&s.fragmentHint&&(e=s.fragmentHint);const x=this.getNextPart(v,e,r);if(x>-1){const S=v[x];e=this.fragCurrent=S.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${S.index} (${x}/${v.length-1}) of ${this.fragInfo(e,!1,S)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=S.start+S.duration,this.state=pt.FRAG_LOADING;let O;return a?O=a.then(M=>!M||this.fragContextChanged(M.frag)?null:this.doFragPartsLoad(e,S,t,n)).catch(M=>this.handleFragLoadError(M)):O=this.doFragPartsLoad(e,S,t,n).catch(M=>this.handleFragLoadError(M)),this.hls.trigger(_.FRAG_LOADING,{frag:e,part:S,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):O}else if(!e.url||this.loadedEndOfParts(v,r))return Promise.resolve(null)}}if($e(e)&&this.loadingParts){var l;this.log(`LL-Part loading OFF after next part miss @${r.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(l=s.partList)==null?void 0:l.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?"["+s.startSN+"-"+s.endSN+"]":""}, target: ${parseFloat(r.toFixed(3))}`),z(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=pt.FRAG_LOADING;const g=this.config.progressive;let p;return g&&a?p=a.then(v=>!v||this.fragContextChanged(v==null?void 0:v.frag)?null:this.fragmentLoader.load(e,n)).catch(v=>this.handleFragLoadError(v)):p=Promise.all([this.fragmentLoader.load(e,g?n:void 0),a]).then(([v])=>(!g&&v&&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")):p}doFragPartsLoad(e,t,r,n){return new Promise((i,s)=>{var a;const c=[],l=(a=r.details)==null?void 0:a.partList,g=p=>{this.fragmentLoader.loadPart(e,p,n).then(v=>{c[p.index]=v;const x=v.part;this.hls.trigger(_.FRAG_LOADED,v);const S=rA(r.details,e.sn,p.index+1)||Ji(l,e.sn,p.index+1);if(S)g(S);else return i({frag:e,part:x,partsLoaded:c})}).catch(s)};g(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===Y.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(_.ERROR,t)}else this.hls.trigger(_.ERROR,{type:ve.OTHER_ERROR,details:Y.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==pt.PARSING){!this.fragCurrent&&this.state!==pt.STOPPED&&this.state!==pt.ERROR&&(this.state=pt.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 a=this.getLevelDetails(),l=a&&r.sn>a.endSN||this.shouldLoadParts(a,r.end);l!==this.loadingParts&&(this.log(`LL-Part loading ${l?"ON":"OFF"} after parsing segment ending @${r.end.toFixed(2)}`),this.loadingParts=l),this.updateLevelTiming(r,n,i,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var r;const i=e.partList[0],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 a=t[n],c=a.details,l=s>-1?rA(c,i,s):null,g=l?l.fragment:yA(c,i,r);return g?(r&&r!==g&&(g.stats=r.stats),{frag:g,part:l,level:a}):null}bufferFragmentData(e,t,r,n,i){var s;if(!e||this.state!==pt.PARSING)return;const{data1:a,data2:c}=e;let l=a;if(a&&c&&(l=ut(a,c)),!((s=l)!=null&&s.length))return;const g=this.initPTS[t.cc],p=g?-g.baseTime/g.timescale:void 0,v={type:e.type,frag:t,part:r,chunkMeta:n,offset:p,parent:t.type,data:l};if(this.hls.trigger(_.BUFFER_APPENDING,v),e.dropped&&e.independent&&!r){if(i)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!sr.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const r=t.currentTime,n=sr.bufferInfo(t,r,0),i=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,i*.25),a=Math.max(Math.min(e.start-s,n.end-s),r+s);e.start-a>s&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){var r;const n=this.getLoadPosition();if(!z(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=sr.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 a=Math.max(Math.min(i.nextStart,s.end)-t,n);return sr.bufferInfo(e,t,a)}}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=H.MAIN){var r;const n=(r=this.fragmentTracker)==null?void 0:r.getAppendedFrag(e,t);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const r=t.fragments,n=r.length;if(!n)return null;const{config:i}=this,s=r[0].start,a=i.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const p=i.initialLiveManifestSize;if(n<p)return this.warn(`Not enough fragments to start playback (have: ${n}, need: ${p})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var l;a&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t);const v=this.hls.startPosition,x=this.hls.liveSyncPosition,S=c?(v!==-1&&v>=s?v:x)||c.start:e;this.log(`Setting startPosition to ${S} to match start frag at live edge. mainStart: ${v} liveSyncPosition: ${x} frag.start: ${(l=c)==null?void 0:l.start}`),this.startPosition=this.nextLoadPosition=S}}else e<=s&&(c=r[0]);if(!c){const p=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,p,t)}let g=this.filterReplacedPrimary(c,t);if(!g&&c){const p=c.sn-t.startSN;g=this.filterReplacedPrimary(r[p+1]||null,t)}return this.mapToInitFragWhenRequired(g)}isLoopLoading(e,t){const r=this.fragmentTracker.getState(e);return(r===Kt.OK||r===Kt.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 a=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,n,0);if(a!==null&&r.len+a.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(On(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(On(this.config)&&e.type!==H.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 a=i[s].interstitial;if(a.appendInPlace&&e.start>=a.startTime&&e.end<=a.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,r){let n=-1,i=!1,s=!0;for(let a=0,c=e.length;a<c;a++){const l=e[a];if(s=s&&!l.independent,n>-1&&r<l.start)break;const g=l.loaded;g?n=-1:(i||(l.independent||s)&&l.fragment===t)&&(l.fragment!==t&&this.warn(`Need buffer at ${r} but next unloaded part starts at ${l.start}`),n=a),i=g}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=Rr(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=pe(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:a}=r;const{fragmentHint:c}=r,{maxFragLookUpTolerance:l}=n,g=r.partList,p=!!(this.loadingParts&&g!=null&&g.length&&c);p&&c&&!this.bitrateTest&&g[g.length-1].fragment.sn===c.sn&&(s=s.concat(c),a=c.sn);let v;if(e<t){var x;const O=e<this.lastCurrentTime||e>t-l||(x=this.media)!=null&&x.paused||!this.startFragRequested?0:l;v=Dr(i,s,e,O)}else v=s[s.length-1];if(v){const S=v.sn-r.startSN,O=this.fragmentTracker.getState(v);if((O===Kt.OK||O===Kt.PARTIAL&&v.gap)&&(i=v),i&&v.sn===i.sn&&(!p||g[0].fragment.sn>v.sn||!r.live&&!p)&&i&&v.level===i.level){const ie=s[S+1];v.sn<a&&this.fragmentTracker.getState(ie)!==Kt.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,a=e.alignedSliding&&z(i);if(s||!a&&!i){ua(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&&z(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&&$e(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!==pt.FRAG_LOADING_WAITING_RETRY)&&(this.state=pt.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const S=this.getCurrentContext(t.chunkMeta);S&&(t.frag=S.frag)}const r=t.frag;if(!r||r.type!==e||!this.levels)return;if(this.fragContextChanged(r)){var n;this.warn(`Frag load error must match current frag to retry ${r.url} > ${(n=this.fragCurrent)==null?void 0:n.url}`);return}const i=t.details===Y.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(r,!0);const s=t.errorAction,{action:a,flags:c,retryCount:l=0,retryConfig:g}=s||{},p=!!s&&!!g,v=p&&a===be.RetryRequest,x=p&&!s.resolved&&c===st.MoveAllAlternatesMatchingHost;if(!v&&x&&$e(r)&&!r.endList)this.resetFragmentErrors(e),this.treatAsGap(r),s.resolved=!0;else if((v||x)&&l<g.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const S=ct(g,l);this.warn(`Fragment ${r.sn} of ${e} ${r.level} errored with ${t.details}, retrying loading ${l+1}/${g.maxNumRetry} in ${S}ms`),s.resolved=!0,this.retryDate=self.performance.now()+S,this.state=pt.FRAG_LOADING_WAITING_RETRY}else if(g&&s)if(this.resetFragmentErrors(e),l<g.maxNumRetry)!i&&a!==be.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${l})`);return}else a===be.SendAlternateToPenaltyBox?this.state=pt.WAITING_LEVEL:this.state=pt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===pt.PARSING||this.state===pt.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===H.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==pt.STOPPED&&(this.state=pt.IDLE)}afterBufferFlushed(e,t,r){if(!e)return;const n=sr.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,n,r),this.state===pt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==pt.STOPPED&&(this.state=pt.IDLE)}resetStartWhenNotLoaded(e){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const 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.warn(`The loading context changed while buffering fragment ${e.sn} of ${this.playlistLabel()} ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),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,l)=>{const g=e.elementaryStreams[l];if(g){const p=g.endPTS-g.startPTS;if(p<=0)return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${p})`),c||!1;const v=n?0:Jn(i,e,g.startPTS,g.endPTS,g.startDTS,g.endDTS);return this.hls.trigger(_.LEVEL_PTS_UPDATED,{details:i,level:r,drift:v,type:l,frag:e,start:g.startPTS,end:g.endPTS}),!0}return c},!1)){var a;if(r.fragmentError===0&&this.treatAsGap(e,r),((a=this.transmuxer)==null?void 0:a.error)===null){const c=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=pt.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===H.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.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function On(A){return!!A.interstitialsController&&A.enableInterstitialPlayback!==!1}class fi{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=di(e,t);else return new Uint8Array(0);return this.reset(),r}reset(){this.chunks.length=0,this.dataLength=0}}function di(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 us={exports:{}},Ds;function EA(){return Ds||(Ds=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,l,g){this.fn=c,this.context=l,this.once=g||!1}function i(c,l,g,p,v){if(typeof g!="function")throw new TypeError("The listener must be a function");var x=new n(g,p||c,v),S=t?t+l:l;return c._events[S]?c._events[S].fn?c._events[S]=[c._events[S],x]:c._events[S].push(x):(c._events[S]=x,c._eventsCount++),c}function s(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],g,p;if(this._eventsCount===0)return l;for(p in g=this._events)e.call(g,p)&&l.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(g)):l},a.prototype.listeners=function(l){var g=t?t+l:l,p=this._events[g];if(!p)return[];if(p.fn)return[p.fn];for(var v=0,x=p.length,S=new Array(x);v<x;v++)S[v]=p[v].fn;return S},a.prototype.listenerCount=function(l){var g=t?t+l:l,p=this._events[g];return p?p.fn?1:p.length:0},a.prototype.emit=function(l,g,p,v,x,S){var O=t?t+l:l;if(!this._events[O])return!1;var M=this._events[O],ie=arguments.length,Be,_e;if(M.fn){switch(M.once&&this.removeListener(l,M.fn,void 0,!0),ie){case 1:return M.fn.call(M.context),!0;case 2:return M.fn.call(M.context,g),!0;case 3:return M.fn.call(M.context,g,p),!0;case 4:return M.fn.call(M.context,g,p,v),!0;case 5:return M.fn.call(M.context,g,p,v,x),!0;case 6:return M.fn.call(M.context,g,p,v,x,S),!0}for(_e=1,Be=new Array(ie-1);_e<ie;_e++)Be[_e-1]=arguments[_e];M.fn.apply(M.context,Be)}else{var Qe=M.length,We;for(_e=0;_e<Qe;_e++)switch(M[_e].once&&this.removeListener(l,M[_e].fn,void 0,!0),ie){case 1:M[_e].fn.call(M[_e].context);break;case 2:M[_e].fn.call(M[_e].context,g);break;case 3:M[_e].fn.call(M[_e].context,g,p);break;case 4:M[_e].fn.call(M[_e].context,g,p,v);break;default:if(!Be)for(We=1,Be=new Array(ie-1);We<ie;We++)Be[We-1]=arguments[We];M[_e].fn.apply(M[_e].context,Be)}}return!0},a.prototype.on=function(l,g,p){return i(this,l,g,p,!1)},a.prototype.once=function(l,g,p){return i(this,l,g,p,!0)},a.prototype.removeListener=function(l,g,p,v){var x=t?t+l:l;if(!this._events[x])return this;if(!g)return s(this,x),this;var S=this._events[x];if(S.fn)S.fn===g&&(!v||S.once)&&(!p||S.context===p)&&s(this,x);else{for(var O=0,M=[],ie=S.length;O<ie;O++)(S[O].fn!==g||v&&!S[O].once||p&&S[O].context!==p)&&M.push(S[O]);M.length?this._events[x]=M.length===1?M[0]:M:s(this,x)}return this},a.prototype.removeAllListeners=function(l){var g;return l?(g=t?t+l:l,this._events[g]&&s(this,g)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,A.exports=a}(us)),us.exports}var wA=EA(),cs=j(wA);const Wi="1.6.8",qi={};function sA(){return typeof __HLS_WORKER_BUNDLE__=="function"}function Fl(){const A=qi[Wi];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 qi[Wi]=n,n}function io(A){const e=qi[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 qi[A]=n,n}function Sl(A){const e=qi[A||Wi];if(e&&e.clientCount--===1){const{worker:r,objectURL:n}=e;delete qi[A||Wi],n&&self.URL.revokeObjectURL(n),r.terminate()}}function so(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 fa(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 CA(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 AA(A,e){const t=e;let r=0;for(;fa(A,e);){r+=10;const n=CA(A,e+6);r+=n,so(A,e+10)&&(r+=10),e+=r}if(r>0)return A.subarray(t,t+r)}function Ks(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 x=new Error(`invalid ADTS sampling index:${s}`);A.emit(_.ERROR,_.ERROR,{type:ve.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!0,error:x,reason:x.message});return}const a=(i>>6&3)+1,c=e[t+3]>>6&3|(i&1)<<2,l="mp4a.40."+a,g=n[s];let p=s;(a===5||a===29)&&(p-=3);const v=[a<<3|(p&14)>>1,(p&1)<<7|c<<3];return le.log(`manifest codec:${r}, parsed codec:${l}, channels:${c}, rate:${g} (ADTS object type:${a} sampling index:${s})`),{config:v,samplerate:g,channelCount:c,codec:l,parsedCodec:l,manifestCodec:r}}function Ao(A,e){return A[e]===255&&(A[e+1]&246)===240}function ao(A,e){return A[e+1]&1?7:9}function $s(A,e){return(A[e+3]&3)<<11|A[e+4]<<3|(A[e+5]&224)>>>5}function Tl(A,e){return e+5<A.length}function bA(A,e){return e+1<A.length&&Ao(A,e)}function Il(A,e){return Tl(A,e)&&Ao(A,e)&&$s(A,e)<=A.length-e}function Dl(A,e){if(bA(A,e)){const t=ao(A,e);if(e+t>=A.length)return!1;const r=$s(A,e);if(r<=t)return!1;const n=e+r;return n===A.length||bA(A,n)}return!1}function aA(A,e,t,r,n){if(!A.samplerate){const i=Ks(e,t,r,n);if(!i)return;B(A,i)}}function oo(A){return 1024*9e4/A}function Ll(A,e){const t=ao(A,e);if(e+t<=A.length){const r=$s(A,e)-t;if(r>0)return{headerLength:t,frameLength:r}}}function lo(A,e,t,r,n){const i=oo(A.samplerate),s=r+n*i,a=Ll(e,t);let c;if(a){const{frameLength:p,headerLength:v}=a,x=v+p,S=Math.max(0,t+x-e.length);S?(c=new Uint8Array(x-v),c.set(e.subarray(t+v,e.length),0)):c=e.subarray(t+v,t+x);const O={unit:c,pts:s};return S||A.samples.push(O),{sample:O,length:x,missing:S}}const l=e.length-t;return c=new Uint8Array(l),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:l,missing:-1}}function Ul(A,e){return fa(A,e)&&CA(A,e+6)+10<=A.length-e}function xA(A){return A instanceof ArrayBuffer?A:A.byteOffset==0&&A.byteLength==A.buffer.byteLength?A.buffer:new Uint8Array(A).buffer}function ha(A,e=0,t=1/0){return Rl(A,e,t,Uint8Array)}function Rl(A,e,t,r){const n=Ql(A);let i=1;"BYTES_PER_ELEMENT"in r&&(i=r.BYTES_PER_ELEMENT);const s=kl(A)?A.byteOffset:0,a=(s+A.byteLength)/i,c=(s+e)/i,l=Math.floor(Math.max(0,Math.min(c,a))),g=Math.floor(Math.min(l+Math.max(t,0),a));return new r(n,l,g-l)}function Ql(A){return A instanceof ArrayBuffer?A:A.buffer}function kl(A){return A&&A.buffer instanceof ArrayBuffer&&A.byteLength!==void 0&&A.byteOffset!==void 0}function FA(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=Ze(ha(A.data,1,r)),i=A.data[2+r],s=A.data.subarray(3+r).indexOf(0);if(s===-1)return;const a=Ze(ha(A.data,3+r,s));let c;return n==="-->"?c=Ze(ha(A.data,4+r+s)):c=xA(A.data.subarray(4+r+s)),e.mimeType=n,e.pictureType=i,e.description=a,e.data=c,e}function Ol(A){if(A.size<2)return;const e=Ze(A.data,!0),t=new Uint8Array(A.data.subarray(e.length+1));return{key:A.type,info:e,data:t.buffer}}function Pl(A){if(A.size<2)return;if(A.type==="TXXX"){let t=1;const r=Ze(A.data.subarray(t),!0);t+=r.length+1;const n=Ze(A.data.subarray(t));return{key:A.type,info:r,data:n}}const e=Ze(A.data.subarray(1));return{key:A.type,info:"",data:e}}function Ml(A){if(A.type==="WXXX"){if(A.size<2)return;let t=1;const r=Ze(A.data.subarray(t),!0);t+=r.length+1;const n=Ze(A.data.subarray(t));return{key:A.type,info:r,data:n}}const e=Ze(A.data);return{key:A.type,info:"",data:e}}function Nl(A){return A.type==="PRIV"?Ol(A):A.type[0]==="W"?Ml(A):A.type==="APIC"?FA(A):Pl(A)}function Hl(A){const e=String.fromCharCode(A[0],A[1],A[2],A[3]),t=CA(A,4),r=10;return{type:e,size:t,data:A.subarray(r,r+t)}}const SA=10,Kl=10;function uo(A){let e=0;const t=[];for(;fa(A,e);){const r=CA(A,e+6);A[e+5]>>6&1&&(e+=SA),e+=SA;const n=e+r;for(;e+Kl<n;){const i=Hl(A.subarray(e)),s=Nl(i);s&&t.push(s),e+=i.size+SA}so(A,e)&&(e+=SA)}return t}function co(A){return A&&A.key==="PRIV"&&A.info==="com.apple.streaming.transportStreamTimestamp"}function $l(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 Gs(A){const e=uo(A);for(let t=0;t<e.length;t++){const r=e[t];if(co(r))return $l(r)}}let Ui=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 es(A="",e=9e4){return{type:A,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class TA{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=ut(this.cachedData,e),this.cachedData=null);let r=AA(e,0),n=r?r.length:0,i;const s=this._audioTrack,a=this._id3Track,c=r?Gs(r):void 0,l=e.length;for((this.basePTS===null||this.frameIndex===0&&z(c))&&(this.basePTS=Gl(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),r&&r.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:Ui.audioId3,duration:Number.POSITIVE_INFINITY});n<l;){if(this.canParse(e,n)){const g=this.appendFrame(s,e,n);g?(this.frameIndex++,this.lastPTS=g.sample.pts,n+=g.length,i=n):n=l}else Ul(e,n)?(r=AA(e,n),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:Ui.audioId3,duration:Number.POSITIVE_INFINITY}),n+=r.length,i=n):n++;if(n===l&&i!==l){const g=e.slice(i);this.cachedData?this.cachedData=ut(this.cachedData,g):this.cachedData=g}}return{audioTrack:s,videoTrack:es(),id3Track:a,textTrack:es()}}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:es(),id3Track:this._id3Track,textTrack:es()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Gl=(A,e,t)=>{if(z(A))return A*90;const r=t?t.baseTime*9e4/t.timescale:0;return e*9e4+r};let IA=null;const da=[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],DA=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Vl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Wl=[0,1,1,4];function fo(A,e,t,r,n){if(t+24>e.length)return;const i=ho(e,t);if(i&&t+i.frameLength<=e.length){const s=i.samplesPerFrame*9e4/i.sampleRate,a=r+n*s,c={unit:e.subarray(t,t+i.frameLength),pts:a,dts:a};return A.config=[],A.channelCount=i.channelCount,A.samplerate=i.sampleRate,A.samples.push(c),{sample:c,length:i.frameLength,missing:0}}}function ho(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,a=A[e+3]>>6,c=t===3?3-r:r===3?3:4,l=da[c*14+n-1]*1e3,p=DA[(t===3?0:t===2?1:2)*3+i],v=a===3?1:2,x=Vl[t][r],S=Wl[r],O=x*8*S,M=Math.floor(x*l/p+s)*S;if(IA===null){const _e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);IA=_e?parseInt(_e[1]):0}return!!IA&&IA<=87&&r===2&&l>=224e3&&a===0&&(A[e+3]=A[e+3]|128),{sampleRate:p,channelCount:v,frameLength:M,samplesPerFrame:O}}}function ga(A,e){return A[e]===255&&(A[e+1]&224)===224&&(A[e+1]&6)!==0}function go(A,e){return e+1<A.length&&ga(A,e)}function LA(A,e){return ga(A,e)&&4<=A.length-e}function po(A,e){if(e+1<A.length&&ga(A,e)){const r=ho(A,e);let n=4;r!=null&&r.frameLength&&(n=r.frameLength);const i=e+n;return i===A.length||go(A,i)}return!1}class Zl extends TA{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=AA(e,0);let n=(r==null?void 0:r.length)||0;if(po(e,n))return!1;for(let i=e.length;n<i;n++)if(Dl(e,n))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return Il(e,t)}appendFrame(e,t,r){aA(e,this.observer,t,r,e.manifestCodec);const n=lo(e,t,r,this.basePTS,this.frameIndex);if(n&&n.missing===0)return n}}const mo=(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 a=Math.min(r,8),c=8-a;i[0]=4278190080>>>24+c<<c,n[0]=(s[0]&i[0])>>c,t=t?t<<a|n[0]:n[0],e+=1,r-=a}return t};class zl extends TA{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=_o(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=AA(e,0);if(!t)return!1;const r=t.length;return e[r]===11&&e[r+1]===119&&Gs(t)!==void 0&&mo(e,r)<16}}function _o(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 a=[48e3,44100,32e3][i],c=e[t+4]&63,g=[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+g>e.length)return-1;const p=e[t+6]>>5;let v=0;p===2?v+=2:(p&1&&p!==1&&(v+=2),p&4&&(v+=2));const x=(e[t+6]<<8|e[t+7])>>12-v&1,O=[2,1,2,3,3,4,4,5][p]+x,M=e[t+5]>>3,ie=e[t+5]&7,Be=new Uint8Array([i<<6|M<<1|ie>>2,(ie&3)<<6|p<<3|x<<2|c>>4,c<<4&224]),_e=1536/a*9e4,Qe=r+n*_e,We=e.subarray(t,t+g);return A.config=Be,A.channelCount=O,A.samplerate=a,A.samples.push({unit:We,pts:Qe}),g}class jl extends TA{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=AA(e,0);let r=(t==null?void 0:t.length)||0;if(t&&e[r]===11&&e[r+1]===119&&Gs(t)!==void 0&&mo(e,r)<=16)return!1;for(let n=e.length;r<n;r++)if(po(e,r))return le.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return LA(e,t)}appendFrame(e,t,r){if(this.basePTS!==null)return fo(e,t,r,this.basePTS,this.frameIndex)}}const Yl=/\/emsg[-/]ID3/i;class Xl{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=es("video",1),s=this.audioTrack=es("audio",1),a=this.txtTrack=es("text",1);if(this.id3Track=es("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=V(e);if(c.video){const{id:l,timescale:g,codec:p,supplemental:v}=c.video;i.id=l,i.timescale=a.timescale=g,i.codec=p,i.supplemental=v}if(c.audio){const{id:l,timescale:g,codec:p}=c.audio;s.id=l,s.timescale=g,s.codec=p}a.id=He.text,i.sampleDuration=0,i.duration=s.duration=n}resetContiguity(){this.remainderData=null}static probe(e){return R(e)}demux(e,t){this.timeOffset=t;let r=e;const n=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=ut(this.remainderData,e));const a=Bt(r);this.remainderData=a.remainder,n.samples=a.valid||new Uint8Array}else n.samples=r;const s=this.extractID3Track(n,t);return i.samples=gt(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=gt(e,t),{videoTrack:t,audioTrack:es(),id3Track:n,textTrack:es()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const n=m(e.samples,["emsg"]);n&&n.forEach(i=>{const s=zt(i);if(Yl.test(s.schemeIdUri)){const a=vo(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const l=s.payload;r.samples.push({data:l,len:l.byteLength,dts:a,pts:a,type:Ui.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const a=vo(s,t);r.samples.push({data:s.payload,len:s.payload.byteLength,dts:a,pts:a,type:Ui.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 vo(A,e){return z(A.presentationTime)?A.presentationTime/A.timeScale:e+A.presentationTimeDelta/A.timeScale}class Jl{constructor(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new Yr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,or.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(a=>{const c=new Uint8Array(a);n.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,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=It(i.data),a=this.getAvcEncryptedData(s);this.decryptBuffer(a.buffer).then(c=>{i.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,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 yo{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,a=[];let c=0,l,g,p,v=-1,x=0;for(i===-1&&(v=0,x=this.getNALuType(t,0),i=0,c=1);c<n;){if(l=t[c++],!i){i=l?0:1;continue}if(i===1){i=l?0:2;continue}if(!l)i=3;else if(l===1){if(g=c-i-1,v>=0){const S={data:t.subarray(v,g),type:x};a.push(S)}else{const S=this.getLastNalUnit(e.samples);S&&(s&&c<=4-s&&S.state&&(S.data=S.data.subarray(0,S.data.byteLength-s)),g>0&&(S.data=ut(S.data,t.subarray(0,g)),S.state=0))}c<n?(p=this.getNALuType(t,c),v=c,x=p,i=0):i=-1}else i=0}if(v>=0&&i>=0){const S={data:t.subarray(v,n),type:x,state:i};a.push(S)}if(a.length===0){const S=this.getLastNalUnit(e.samples);S&&(S.data=ut(S.data,t))}return e.naluState=i,a}}class oA{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&&le.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 Bo extends yo{parsePES(e,t,r,n){const i=this.parseNALu(e,r.data,n);let s=this.VideoSample,a,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(l=>{var g,p;switch(l.type){case 1:{let O=!1;a=!0;const M=l.data;if(c&&M.length>4){const ie=this.readSliceType(M);(ie===2||ie===4||ie===7||ie===9)&&(O=!0)}if(O){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=O;break}case 5:a=!0,(g=s)!=null&&g.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:{a=!0,yt(l.data,1,r.pts,t.samples);break}case 7:{var x,S;a=!0,c=!0;const O=l.data,M=this.readSPS(O);if(!e.sps||e.width!==M.width||e.height!==M.height||((x=e.pixelRatio)==null?void 0:x[0])!==M.pixelRatio[0]||((S=e.pixelRatio)==null?void 0:S[1])!==M.pixelRatio[1]){e.width=M.width,e.height=M.height,e.pixelRatio=M.pixelRatio,e.sps=[O];const ie=O.subarray(1,4);let Be="avc1.";for(let _e=0;_e<3;_e++){let Qe=ie[_e].toString(16);Qe.length<2&&(Qe="0"+Qe),Be+=Qe}e.codec=Be}break}case 8:a=!0,e.pps=[l.data];break;case 9:a=!0,e.audFound=!0,(p=s)!=null&&p.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;case 12:a=!0;break;default:a=!1;break}s&&a&&s.units.push(l)}),n&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new oA(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 oA(e);let r=0,n=0,i=0,s=0,a,c,l;const g=t.readUByte.bind(t),p=t.readBits.bind(t),v=t.readUEG.bind(t),x=t.readBoolean.bind(t),S=t.skipBits.bind(t),O=t.skipEG.bind(t),M=t.skipUEG.bind(t),ie=this.skipScalingList.bind(this);g();const Be=g();if(p(5),S(3),g(),M(),Be===100||Be===110||Be===122||Be===244||Be===44||Be===83||Be===86||Be===118||Be===128){const at=v();if(at===3&&S(1),M(),M(),S(1),x())for(c=at!==3?8:12,l=0;l<c;l++)x()&&(l<6?ie(16,t):ie(64,t))}M();const _e=v();if(_e===0)v();else if(_e===1)for(S(1),O(),O(),a=v(),l=0;l<a;l++)O();M(),S(1);const Qe=v(),We=v(),_t=p(1);_t===0&&S(1),S(1),x()&&(r=v(),n=v(),i=v(),s=v());let Ge=[1,1];if(x()&&x())switch(g()){case 1:Ge=[1,1];break;case 2:Ge=[12,11];break;case 3:Ge=[10,11];break;case 4:Ge=[16,11];break;case 5:Ge=[40,33];break;case 6:Ge=[24,11];break;case 7:Ge=[20,11];break;case 8:Ge=[32,11];break;case 9:Ge=[80,33];break;case 10:Ge=[18,11];break;case 11:Ge=[15,11];break;case 12:Ge=[64,33];break;case 13:Ge=[160,99];break;case 14:Ge=[4,3];break;case 15:Ge=[3,2];break;case 16:Ge=[2,1];break;case 255:{Ge=[g()<<8|g(),g()<<8|g()];break}}return{width:Math.ceil((Qe+1)*16-r*2-n*2),height:(2-_t)*(We+1)*16-(_t?2:4)*(i+s),pixelRatio:Ge}}}class ql extends yo{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,r,n){const i=this.parseNALu(e,r.data,n);let s=this.VideoSample,a,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(l=>{var g,p;switch(l.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,a=!0;break;case 16:case 17:case 18:case 21:if(a=!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:a=!0,(g=s)!=null&&g.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:a=!0,yt(l.data,2,r.pts,t.samples);break;case 32:a=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=B(e.params,this.readVPS(l.data)),this.initVPS=l.data),e.vps=[l.data];break;case 33:if(a=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],l.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const x=this.readSPS(l.data);e.width=x.width,e.height=x.height,e.pixelRatio=x.pixelRatio,e.codec=x.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const S in x.params)e.params[S]=x.params[S]}this.pushParameterSet(e.sps,l.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0;break;case 34:if(a=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const x=this.readPPS(l.data);for(const S in x)e.params[S]=x[S]}this.pushParameterSet(e.pps,l.data,e.vps)}break;case 35:a=!0,e.audFound=!0,(p=s)!=null&&p.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;default:a=!1;break}s&&a&&s.units.push(l)}),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 oA(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 oA(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),a=t.readUByte(),c=t.readUByte(),l=t.readUByte(),g=t.readUByte(),p=t.readUByte(),v=t.readUByte(),x=t.readUByte(),S=t.readUByte(),O=t.readUByte(),M=t.readUByte(),ie=t.readUByte(),Be=[],_e=[];for(let Un=0;Un<r;Un++)Be.push(t.readBoolean()),_e.push(t.readBoolean());if(r>0)for(let Un=r;Un<8;Un++)t.readBits(2);for(let Un=0;Un<r;Un++)Be[Un]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),_e[Un]&&t.readUByte();t.readUEG();const Qe=t.readUEG();Qe==3&&t.skipBits(1);const We=t.readUEG(),_t=t.readUEG(),Ge=t.readBoolean();let at=0,ft=0,ze=0,Lt=0;Ge&&(at+=t.readUEG(),ft+=t.readUEG(),ze+=t.readUEG(),Lt+=t.readUEG());const lr=t.readUEG(),br=t.readUEG(),Or=t.readUEG(),dr=t.readBoolean();for(let Un=dr?0:r;Un<=r;Un++)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 Si=0;Si<4;Si++)for(let ss=0;ss<(Si===3?2:6);ss++)if(!t.readBoolean())t.readUEG();else{const Bs=Math.min(64,1<<4+(Si<<1));Si>1&&t.readEG();for(let oa=0;oa<Bs;oa++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const vr=t.readUEG();let Kr=0;for(let Un=0;Un<vr;Un++){let Si=!1;if(Un!==0&&(Si=t.readBoolean()),Si){Un===vr&&t.readUEG(),t.readBoolean(),t.readUEG();let ss=0;for(let pA=0;pA<=Kr;pA++){const Bs=t.readBoolean();let oa=!1;Bs||(oa=t.readBoolean()),(Bs||oa)&&ss++}Kr=ss}else{const ss=t.readUEG(),pA=t.readUEG();Kr=ss+pA;for(let Bs=0;Bs<ss;Bs++)t.readUEG(),t.readBoolean();for(let Bs=0;Bs<pA;Bs++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const Un=t.readUEG();for(let Si=0;Si<Un;Si++){for(let ss=0;ss<Or+4;ss++)t.readBits(1);t.readBits(1)}}let Ar=0,ar=1,cn=1,Pn=!0,dn=1,Tn=0;t.readBoolean(),t.readBoolean();let Fi=!1;if(t.readBoolean()){if(t.readBoolean()){const mA=t.readUByte(),mc=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],xl=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];mA>0&&mA<16?(ar=mc[mA-1],cn=xl[mA-1]):mA===255&&(ar=t.readBits(16),cn=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(),Fi=t.readBoolean(),Fi&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(dn=t.readBits(32),Tn=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const xl=t.readBoolean(),_c=t.readBoolean();let ro=!1;(xl||_c)&&(ro=t.readBoolean(),ro&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),ro&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let vc=0;vc<=r;vc++){Pn=t.readBoolean();const bc=Pn||t.readBoolean();let yc=!1;bc?t.readEG():yc=t.readBoolean();const Bc=yc?1:t.readUEG()+1;if(xl)for(let no=0;no<Bc;no++)t.readUEG(),t.readUEG(),ro&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(_c)for(let no=0;no<Bc;no++)t.readUEG(),t.readUEG(),ro&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),Ar=t.readUEG())}let is=We,Fs=_t;if(Ge){let Un=1,Si=1;Qe===1?Un=Si=2:Qe==2&&(Un=2),is=We-Un*ft-Un*at,Fs=_t-Si*Lt-Si*ze}const gA=n?["A","B","C"][n]:"",Cc=a<<24|c<<16|l<<8|g;let hc=0;for(let Un=0;Un<32;Un++)hc=(hc|(Cc>>Un&1)<<31-Un)>>>0;let dc=hc.toString(16);return s===1&&dc==="2"&&(dc="6"),{codecString:`hvc1.${gA}${s}.${dc}.${i?"H":"L"}${ie}.B0`,params:{general_tier_flag:i,general_profile_idc:s,general_profile_space:n,general_profile_compatibility_flags:[a,c,l,g],general_constraint_indicator_flags:[p,v,x,S,O,M],general_level_idc:ie,bit_depth:lr+8,bit_depth_luma_minus8:lr,bit_depth_chroma_minus8:br,min_spatial_segmentation_idc:Ar,chroma_format_idc:Qe,frame_rate:{fixed:Pn,fps:Tn/dn}},width:is,height:Fs,pixelRatio:[ar,cn]}}readPPS(e){const t=new oA(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 Ai=188;class ws{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=ws.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(Ai*5,t-Ai)+1,n=0;for(;n<r;){let i=!1,s=-1,a=0;for(let c=n;c<t;c+=Ai)if(e[c]===71&&(t-c===Ai||e[c+Ai]===71)){if(a++,s===-1&&(s=c,s!==0&&(r=Math.min(s+Ai*99,e.length-Ai)+1)),i||(i=Ls(e,c)===0),i&&a>1&&(s===0&&a>2||c+Ai>r))return s}else{if(a)return-1;break}n++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:He[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=ws.createTrack("video"),this._videoTrack.duration=n,this._audioTrack=ws.createTrack("audio",n),this._id3Track=ws.createTrack("id3"),this._txtTrack=ws.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,a=this._audioTrack,c=this._id3Track,l=this._txtTrack;let g=s.pid,p=s.pesData,v=a.pid,x=c.pid,S=a.pesData,O=c.pesData,M=null,ie=this.pmtParsed,Be=this._pmtId,_e=e.length;if(this.remainderData&&(e=ut(this.remainderData,e),_e=e.length,this.remainderData=null),_e<Ai&&!n)return this.remainderData=e,{audioTrack:a,videoTrack:s,id3Track:c,textTrack:l};const Qe=Math.max(0,ws.syncOffset(e));_e-=(_e-Qe)%Ai,_e<e.byteLength&&!n&&(this.remainderData=new Uint8Array(e.buffer,_e,e.buffer.byteLength-_e));let We=0;for(let Ge=Qe;Ge<_e;Ge+=Ai)if(e[Ge]===71){const at=!!(e[Ge+1]&64),ft=Ls(e,Ge),ze=(e[Ge+3]&48)>>4;let Lt;if(ze>1){if(Lt=Ge+5+e[Ge+4],Lt===Ge+Ai)continue}else Lt=Ge+4;switch(ft){case g:at&&(p&&(i=Vs(p,this.logger))&&(this.readyVideoParser(s.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(s,l,i,!1)),p={data:[],size:0}),p&&(p.data.push(e.subarray(Lt,Ge+Ai)),p.size+=Ge+Ai-Lt);break;case v:if(at){if(S&&(i=Vs(S,this.logger)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,i);break;case"mp3":this.parseMPEGPES(a,i);break;case"ac3":this.parseAC3PES(a,i);break}S={data:[],size:0}}S&&(S.data.push(e.subarray(Lt,Ge+Ai)),S.size+=Ge+Ai-Lt);break;case x:at&&(O&&(i=Vs(O,this.logger))&&this.parseID3PES(c,i),O={data:[],size:0}),O&&(O.data.push(e.subarray(Lt,Ge+Ai)),O.size+=Ge+Ai-Lt);break;case 0:at&&(Lt+=e[Lt]+1),Be=this._pmtId=eu(e,Lt);break;case Be:{at&&(Lt+=e[Lt]+1);const lr=tu(e,Lt,this.typeSupported,r,this.observer,this.logger);g=lr.videoPid,g>0&&(s.pid=g,s.segmentCodec=lr.segmentVideoCodec),v=lr.audioPid,v>0&&(a.pid=v,a.segmentCodec=lr.segmentAudioCodec),x=lr.id3Pid,x>0&&(c.pid=x),M!==null&&!ie&&(this.logger.warn(`MPEG-TS PMT found at ${Ge} after unknown PID '${M}'. Backtracking to sync byte @${Qe} to parse all TS packets.`),M=null,Ge=Qe-188),ie=this.pmtParsed=!0;break}case 17:case 8191:break;default:M=ft;break}}else We++;We>0&&UA(this.observer,new Error(`Found ${We} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=p,a.pesData=S,c.pesData=O;const _t={audioTrack:a,videoTrack:s,id3Track:c,textTrack:l};return n&&this.extractRemainingSamples(_t),_t}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,a=t.pesData,c=n.pesData;let l;if(s&&(l=Vs(s,this.logger))?(this.readyVideoParser(r.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(r,i,l,!0),r.pesData=null)):r.pesData=s,a&&(l=Vs(a,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l);break}t.pesData=null}else a!=null&&a.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;c&&(l=Vs(c,this.logger))?(this.parseID3PES(n,l),n.pesData=null):n.pesData=c}demuxSampleAes(e,t,r){const n=this.demux(e,r,!0,!this.config.progressive),i=this.sampleAes=new Jl(this.observer,this.config,t);return this.decrypt(n,i)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new Bo:e==="hevc"&&(this.videoParser=new ql))}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 p=n.missing,v=n.sample.unit.byteLength;if(p===-1)i=ut(n.sample.unit,i);else{const x=v-p;n.sample.unit.set(i.subarray(0,p),x),e.samples.push(n.sample),r=n.missing}}let s,a;for(s=r,a=i.length;s<a-1&&!bA(i,s);s++);if(s!==r){let p;const v=s<a-1;if(v?p=`AAC PES did not start with ADTS header,offset:${s}`:p="No ADTS header found in AAC PES",UA(this.observer,new Error(p),v,this.logger),!v)return}aA(e,this.observer,i,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(n){const p=oo(e.samplerate);c=n.sample.pts+p}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let l=0,g;for(;s<a;)if(g=lo(e,i,s,c,l),s+=g.length,g.missing){this.aacOverFlow=g;break}else for(l++;s<a-1&&!bA(i,s);s++);}parseMPEGPES(e,t){const r=t.data,n=r.length;let i=0,s=0;const a=t.pts;if(a===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<n;)if(go(r,s)){const c=fo(e,r,s,a,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,a=0,c;for(;a<i&&(c=_o(e,r,a,n,s++))>0;)a+=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?Ui.emsg:Ui.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(r)}}function Ls(A,e){return((A[e+1]&31)<<8)+A[e+2]}function eu(A,e){return(A[e+10]&31)<<8|A[e+11]}function tu(A,e,t,r,n,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},a=(A[e+1]&15)<<8|A[e+2],c=e+3+a-4,l=(A[e+10]&15)<<8|A[e+11];for(e+=12+l;e<c;){const g=Ls(A,e),p=(A[e+3]&15)<<8|A[e+4];switch(A[e]){case 207:if(!r){pa("ADTS AAC",i);break}case 15:s.audioPid===-1&&(s.audioPid=g);break;case 21:s.id3Pid===-1&&(s.id3Pid=g);break;case 219:if(!r){pa("H.264",i);break}case 27:s.videoPid===-1&&(s.videoPid=g);break;case 3:case 4:!t.mpeg&&!t.mp3?i.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=g,s.segmentAudioCodec="mp3");break;case 193:if(!r){pa("AC-3",i);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=g,s.segmentAudioCodec="ac3"):i.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&p>0){let v=e+5,x=p;for(;x>2;){switch(A[v]){case 106:t.ac3!==!0?i.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=g,s.segmentAudioCodec="ac3");break}const O=A[v+1]+2;v+=O,x-=O}}break;case 194:case 135:return UA(n,new Error("Unsupported EC-3 in M2TS found"),void 0,i),s;case 36:s.videoPid===-1&&(s.videoPid=g,s.segmentVideoCodec="hevc",i.log("HEVC in M2TS found"));break}e+=p+5}return s}function UA(A,e,t,r){r.warn(`parsing error: ${e.message}`),A.emit(_.ERROR,_.ERROR,{type:ve.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function pa(A,e){e.log(`${A} with AES-128-CBC encryption found in unencrypted stream`)}function Vs(A,e){let t=0,r,n,i,s,a;const c=A.data;if(!A||A.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=ut(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 g=r[7];g&192&&(s=(r[9]&14)*536870912+(r[10]&255)*4194304+(r[11]&254)*16384+(r[12]&255)*128+(r[13]&254)/2,g&64?(a=(r[14]&14)*536870912+(r[15]&255)*4194304+(r[16]&254)*16384+(r[17]&255)*128+(r[18]&254)/2,s-a>60*9e4&&(e.warn(`${Math.round((s-a)/9e4)}s delta between PTS and DTS, align them`),s=a)):a=s),i=r[8];let p=i+9;if(A.size<=p)return null;A.size-=p;const v=new Uint8Array(A.size);for(let x=0,S=c.length;x<S;x++){r=c[x];let O=r.byteLength;if(p)if(p>O){p-=O;continue}else r=r.subarray(p),O-=p,p=0;v.set(r,t),t+=O}return n&&(n-=i+3),{data:v,pts:s,dts:a,len:n}}return null}class ru{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 Cs=Math.pow(2,32)-1;class Je{static init(){Je.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 Je.types)Je.types.hasOwnProperty(e)&&(Je.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]);Je.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]);Je.STTS=Je.STSC=Je.STCO=i,Je.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Je.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Je.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Je.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);Je.FTYP=Je.box(Je.types.ftyp,s,c,s,a),Je.DINF=Je.box(Je.types.dinf,Je.box(Je.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 Je.box(Je.types.hdlr,Je.HDLR_TYPES[e])}static mdat(e){return Je.box(Je.types.mdat,e)}static mdhd(e,t){t*=e;const r=Math.floor(t/(Cs+1)),n=Math.floor(t%(Cs+1));return Je.box(Je.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 Je.box(Je.types.mdia,Je.mdhd(e.timescale||0,e.duration||0),Je.hdlr(e.type),Je.minf(e))}static mfhd(e){return Je.box(Je.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"?Je.box(Je.types.minf,Je.box(Je.types.smhd,Je.SMHD),Je.DINF,Je.stbl(e)):Je.box(Je.types.minf,Je.box(Je.types.vmhd,Je.VMHD),Je.DINF,Je.stbl(e))}static moof(e,t,r){return Je.box(Je.types.moof,Je.mfhd(e),Je.traf(r,t))}static moov(e){let t=e.length;const r=[];for(;t--;)r[t]=Je.trak(e[t]);return Je.box.apply(null,[Je.types.moov,Je.mvhd(e[0].timescale||0,e[0].duration||0)].concat(r).concat(Je.mvex(e)))}static mvex(e){let t=e.length;const r=[];for(;t--;)r[t]=Je.trex(e[t]);return Je.box.apply(null,[Je.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(Cs+1)),n=Math.floor(t%(Cs+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 Je.box(Je.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 Je.box(Je.types.sdtp,r)}static stbl(e){return Je.box(Je.types.stbl,Je.stsd(e),Je.box(Je.types.stts,Je.STTS),Je.box(Je.types.stsc,Je.STSC),Je.box(Je.types.stsz,Je.STSZ),Je.box(Je.types.stco,Je.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 a=Je.box(Je.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,l=e.height,g=e.pixelRatio[0],p=e.pixelRatio[1];return Je.box(Je.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,l>>8&255,l&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]),a,Je.box(Je.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Je.box(Je.types.pasp,new Uint8Array([g>>24,g>>16&255,g>>8&255,g&255,p>>24,p>>16&255,p>>8&255,p&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 Je.box(Je.types.mp4a,Je.audioStsd(e),Je.box(Je.types.esds,Je.esds(e)))}static mp3(e){return Je.box(Je.types[".mp3"],Je.audioStsd(e))}static ac3(e){return Je.box(Je.types["ac-3"],Je.audioStsd(e),Je.box(Je.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return Je.box(Je.types.stsd,Je.STSD,Je.mp4a(e));if(t==="ac3"&&e.config)return Je.box(Je.types.stsd,Je.STSD,Je.ac3(e));if(t==="mp3"&&e.codec==="mp3")return Je.box(Je.types.stsd,Je.STSD,Je.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return Je.box(Je.types.stsd,Je.STSD,Je.avc1(e));if(t==="hevc"&&e.vps)return Je.box(Je.types.stsd,Je.STSD,Je.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/(Cs+1)),a=Math.floor(r%(Cs+1));return Je.box(Je.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,a>>24,a>>16&255,a>>8&255,a&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=Je.sdtp(e),n=e.id,i=Math.floor(t/(Cs+1)),s=Math.floor(t%(Cs+1));return Je.box(Je.types.traf,Je.box(Je.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255])),Je.box(Je.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])),Je.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,Je.box(Je.types.trak,Je.tkhd(e),Je.mdia(e))}static trex(e){const t=e.id;return Je.box(Je.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 a,c,l,g,p,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),a=0;a<n;a++)c=r[a],l=c.duration,g=c.size,p=c.flags,v=c.cts,s.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,g>>>24&255,g>>>16&255,g>>>8&255,g&255,p.isLeading<<2|p.dependsOn,p.isDependedOn<<6|p.hasRedundancy<<4|p.paddingValue<<1|p.isNonSync,p.degradPrio&61440,p.degradPrio&15,v>>>24&255,v>>>16&255,v>>>8&255,v&255],12+16*a);return Je.box(Je.types.trun,s)}static initSegment(e){Je.types||Je.init();const t=Je.moov(e);return ut(Je.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 S=0;S<r.length;S+=1){s+=3;for(let O=0;O<r[S].length;O+=1)s+=2+r[S][O].length}const a=new Uint8Array(s);a.set(i,0),s=i.length;const c=r.length-1;for(let S=0;S<r.length;S+=1){a.set(new Uint8Array([32+S|(S===c?128:0),0,r[S].length]),s),s+=3;for(let O=0;O<r[S].length;O+=1)a.set(new Uint8Array([r[S][O].length>>8,r[S][O].length&255]),s),s+=2,a.set(r[S][O],s),s+=r[S][O].length}const l=Je.box(Je.types.hvcC,a),g=e.width,p=e.height,v=e.pixelRatio[0],x=e.pixelRatio[1];return Je.box(Je.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,g>>8&255,g&255,p>>8&255,p&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]),l,Je.box(Je.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Je.box(Je.types.pasp,new Uint8Array([v>>24,v>>16&255,v>>8&255,v&255,x>>24,x>>16&255,x>>8&255,x&255])))}}Je.types=void 0,Je.HDLR_TYPES=void 0,Je.STTS=void 0,Je.STSC=void 0,Je.STCO=void 0,Je.STSZ=void 0,Je.VMHD=void 0,Je.SMHD=void 0,Je.STSD=void 0,Je.FTYP=void 0,Je.DINF=void 0;const Eo=9e4;function ma(A,e,t=1,r=!1){const n=A*e*t;return r?Math.round(n):n}function nu(A,e,t=1,r=!1){return ma(A,e,1/t,r)}function Gn(A,e=!1){return ma(A,1e3,1/Eo,e)}function iu(A,e=1){return ma(A,Eo,1/e)}const su=10*1e3,Au=1024,au=1152,ou=1536;let Us=null,_a=null;function wo(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 RA extends G{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,Us===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Us=s?parseInt(s[1]):0}if(_a===null){const i=navigator.userAgent.match(/Safari\/(\d+)/i);_a=i?parseInt(i[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.log("initPTS & initDTS reset"),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 a=s.pts,c=a-i;return c<-4294967296&&(t=!0,a=Mi(a,r),c=a-i),c>0?i:a},r);return t&&this.debug("PTS rollover detected"),n}remux(e,t,r,n,i,s,a,c){let l,g,p,v,x,S,O=i,M=i;const ie=e.pid>-1,Be=t.pid>-1,_e=t.samples.length,Qe=e.samples.length>0,We=a&&_e>0||_e>1;if((!ie||Qe)&&(!Be||We)||this.ISGenerated||a){if(this.ISGenerated){var Ge,at,ft,ze;const Or=this.videoTrackConfig;(Or&&(t.width!==Or.width||t.height!==Or.height||((Ge=t.pixelRatio)==null?void 0:Ge[0])!==((at=Or.pixelRatio)==null?void 0:at[0])||((ft=t.pixelRatio)==null?void 0:ft[1])!==((ze=Or.pixelRatio)==null?void 0:ze[1]))||!Or&&We||this.nextAudioTs===null&&Qe)&&this.resetInitSegment()}this.ISGenerated||(p=this.generateIS(e,t,i,s));const Lt=this.isVideoContiguous;let lr=-1,br;if(We&&(lr=lu(t.samples),!Lt&&this.config.forceKeyFrameOnDiscontinuity))if(S=!0,lr>0){this.warn(`Dropped ${lr} out of ${_e} video samples due to a missing keyframe`);const Or=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(lr),t.dropped+=lr,M+=(t.samples[0].pts-Or)/t.inputTimeScale,br=M}else lr===-1&&(this.warn(`No keyframe found out of ${_e} video samples`),S=!1);if(this.ISGenerated){if(Qe&&We){const Or=this.getVideoStartPts(t.samples),hr=(Mi(e.samples[0].pts,Or)-Or)/t.inputTimeScale;O+=Math.max(0,hr),M+=Math.max(0,-hr)}if(Qe){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),p=this.generateIS(e,t,i,s)),g=this.remuxAudio(e,O,this.isAudioContiguous,s,Be||We||c===H.AUDIO?M:void 0),We){const Or=g?g.endPTS-g.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),p=this.generateIS(e,t,i,s)),l=this.remuxVideo(t,M,Lt,Or)}}else We&&(l=this.remuxVideo(t,M,Lt,0));l&&(l.firstKeyFrame=lr,l.independent=lr!==-1,l.firstKeyFramePTS=br)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(x=Co(r,i,this._initPTS,this._initDTS)),n.samples.length&&(v=va(n,i,this._initPTS))),{audio:g,video:l,initSegment:p,independent:S,text:v,id3:x}}generateIS(e,t,r,n){const i=e.samples,s=t.samples,a=this.typeSupported,c={},l=this._initPTS;let g=!l||n,p="audio/mp4",v,x,S,O=-1;if(g&&(v=x=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(p="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:p,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&a.mpeg?new Uint8Array(0):Je.initSegment([e]),metadata:{channelCount:e.channelCount}},g&&(O=e.id,S=e.inputTimeScale,!l||S!==l.timescale?v=x=i[0].pts-Math.round(S*r):g=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Je.initSegment([t]),metadata:{width:t.width,height:t.height}},g)if(O=t.id,S=t.inputTimeScale,!l||S!==l.timescale){const M=this.getVideoStartPts(s),ie=Math.round(S*r);x=Math.min(x,Mi(s[0].dts,M)-ie),v=Math.min(v,M-ie)}else g=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,g?(l&&this.warn(`Timestamps at playlist time: ${n?"":"~"}${r} ${v/S} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${v/S} (${v}/${S}) trackId: ${O}`),this._initPTS={baseTime:v,timescale:S,trackId:O},this._initDTS={baseTime:x,timescale:S,trackId:O}):v=S=void 0,{tracks:c,initPTS:v,timescale:S,trackId:O}}remuxVideo(e,t,r,n){const i=e.inputTimeScale,s=e.samples,a=[],c=s.length,l=this._initPTS,g=l.baseTime*i/l.timescale;let p=this.nextVideoTs,v=8,x=this.videoSampleDuration,S,O,M=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,Be=!1;if(!r||p===null){const Ar=g+t*i,ar=s[0].pts-Mi(s[0].dts,s[0].pts);Us&&p!==null&&Math.abs(Ar-ar-(p+g))<15e3?r=!0:p=Ar-ar-g}const _e=p+g;for(let Ar=0;Ar<c;Ar++){const ar=s[Ar];ar.pts=Mi(ar.pts,_e),ar.dts=Mi(ar.dts,_e),ar.dts<s[Ar>0?Ar-1:Ar].dts&&(Be=!0)}Be&&s.sort(function(Ar,ar){const cn=Ar.dts-ar.dts,Pn=Ar.pts-ar.pts;return cn||Pn}),S=s[0].dts,O=s[s.length-1].dts;const Qe=O-S,We=Qe?Math.round(Qe/(c-1)):x||e.inputTimeScale/30;if(r){const Ar=S-_e,ar=Ar>We,cn=Ar<-1;if((ar||cn)&&(ar?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Gn(Ar,!0)} ms (${Ar}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Gn(-Ar,!0)} ms (${Ar}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!cn||_e>=s[0].pts||Us)){S=_e;const Pn=s[0].pts-Ar;if(ar)s[0].dts=S,s[0].pts=Pn;else{let dn=!0;for(let Tn=0;Tn<s.length&&!(s[Tn].dts>Pn&&dn);Tn++){const Fi=s[Tn].pts;if(s[Tn].dts-=Ar,s[Tn].pts-=Ar,Tn<s.length-1){const yi=s[Tn+1].pts,is=s[Tn].pts,Fs=yi<=is,gA=yi<=Fi;dn=Fs==gA}}}this.log(`Video: Initial PTS/DTS adjusted: ${Gn(Pn,!0)}/${Gn(S,!0)}, delta: ${Gn(Ar,!0)} ms`)}}S=Math.max(0,S);let _t=0,Ge=0,at=S;for(let Ar=0;Ar<c;Ar++){const ar=s[Ar],cn=ar.units,Pn=cn.length;let dn=0;for(let Tn=0;Tn<Pn;Tn++)dn+=cn[Tn].data.length;Ge+=dn,_t+=Pn,ar.length=dn,ar.dts<at?(ar.dts=at,at+=We/4|0||1):at=ar.dts,M=Math.min(ar.pts,M),ie=Math.max(ar.pts,ie)}O=s[c-1].dts;const ft=Ge+4*_t+8;let ze;try{ze=new Uint8Array(ft)}catch(Ar){this.observer.emit(_.ERROR,_.ERROR,{type:ve.MUX_ERROR,details:Y.REMUX_ALLOC_ERROR,fatal:!1,error:Ar,bytes:ft,reason:`fail allocating video mdat ${ft}`});return}const Lt=new DataView(ze.buffer);Lt.setUint32(0,ft),ze.set(Je.types.mdat,4);let lr=!1,br=Number.POSITIVE_INFINITY,Or=Number.POSITIVE_INFINITY,dr=Number.NEGATIVE_INFINITY,hr=Number.NEGATIVE_INFINITY;for(let Ar=0;Ar<c;Ar++){const ar=s[Ar],cn=ar.units;let Pn=0;for(let Fi=0,yi=cn.length;Fi<yi;Fi++){const is=cn[Fi],Fs=is.data,gA=is.data.byteLength;Lt.setUint32(v,gA),v+=4,ze.set(Fs,v),v+=gA,Pn+=4+gA}let dn;if(Ar<c-1)x=s[Ar+1].dts-ar.dts,dn=s[Ar+1].pts-ar.pts;else{const Fi=this.config,yi=Ar>0?ar.dts-s[Ar-1].dts:We;if(dn=Ar>0?ar.pts-s[Ar-1].pts:We,Fi.stretchShortVideoTrack&&this.nextAudioTs!==null){const is=Math.floor(Fi.maxBufferHole*i),Fs=(n?M+n*i:this.nextAudioTs+g)-ar.pts;Fs>is?(x=Fs-yi,x<0?x=yi:lr=!0,this.log(`It is approximately ${Fs/90} ms to the next segment; using duration ${x/90} ms for the last video frame.`)):x=yi}else x=yi}const Tn=Math.round(ar.pts-ar.dts);br=Math.min(br,x),dr=Math.max(dr,x),Or=Math.min(Or,dn),hr=Math.max(hr,dn),a.push(wo(ar.key,x,Pn,Tn))}if(a.length){if(Us){if(Us<70){const Ar=a[0].flags;Ar.dependsOn=2,Ar.isNonSync=0}}else if(_a&&hr-Or<dr-br&&We/dr<.025&&a[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Ar=S;for(let ar=0,cn=a.length;ar<cn;ar++){const Pn=Ar+a[ar].duration,dn=Ar+a[ar].cts;if(ar<cn-1){const Tn=Pn+a[ar+1].cts;a[ar].duration=Tn-dn}else a[ar].duration=ar?a[ar-1].duration:We;a[ar].cts=0,Ar=Pn}}}x=lr||!x?We:x;const _r=O+x;this.nextVideoTs=p=_r-g,this.videoSampleDuration=x,this.isVideoContiguous=!0;const Jr={data1:Je.moof(e.sequenceNumber++,S,B(e,{samples:a})),data2:ze,startPTS:(M-g)/i,endPTS:(ie+x-g)/i,startDTS:(S-g)/i,endDTS:p/i,type:"video",hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,Jr}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return au;case"ac3":return ou;default:return Au}}remuxAudio(e,t,r,n,i){const s=e.inputTimeScale,a=e.samplerate?e.samplerate:s,c=s/a,l=this.getSamplesPerFrame(e),g=l*c,p=this._initPTS,v=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,x=[],S=i!==void 0;let O=e.samples,M=v?0:8,ie=this.nextAudioTs||-1;const Be=p.baseTime*s/p.timescale,_e=Be+t*s;if(this.isAudioContiguous=r=r||O.length&&ie>0&&(n&&Math.abs(_e-(ie+Be))<9e3||Math.abs(Mi(O[0].pts,_e)-(ie+Be))<20*g),O.forEach(function(hr){hr.pts=Mi(hr.pts,_e)}),!r||ie<0){if(O=O.filter(hr=>hr.pts>=0),!O.length)return;i===0?ie=0:n&&!S?ie=Math.max(0,_e-Be):ie=O[0].pts-Be}if(e.segmentCodec==="aac"){const hr=this.config.maxAudioFramesDrift;for(let _r=0,vr=ie+Be;_r<O.length;_r++){const Kr=O[_r],Jr=Kr.pts,Ar=Jr-vr,ar=Math.abs(1e3*Ar/s);if(Ar<=-hr*g&&S)_r===0&&(this.warn(`Audio frame @ ${(Jr/s).toFixed(3)}s overlaps marker by ${Math.round(1e3*Ar/s)} ms.`),this.nextAudioTs=ie=Jr-Be,vr=Jr);else if(Ar>=hr*g&&ar<su&&S){let cn=Math.round(Ar/g);for(vr=Jr-cn*g;vr<0&&cn&&g;)cn--,vr+=g;_r===0&&(this.nextAudioTs=ie=vr-Be),this.warn(`Injecting ${cn} audio frames @ ${((vr-Be)/s).toFixed(3)}s due to ${Math.round(1e3*Ar/s)} ms gap.`);for(let Pn=0;Pn<cn;Pn++){let dn=ru.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);dn||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),dn=Kr.unit.subarray()),O.splice(_r,0,{unit:dn,pts:vr}),vr+=g,_r++}}Kr.pts=vr,vr+=g}}let Qe=null,We=null,_t,Ge=0,at=O.length;for(;at--;)Ge+=O[at].unit.byteLength;for(let hr=0,_r=O.length;hr<_r;hr++){const vr=O[hr],Kr=vr.unit;let Jr=vr.pts;if(We!==null){const ar=x[hr-1];ar.duration=Math.round((Jr-We)/c)}else if(r&&e.segmentCodec==="aac"&&(Jr=ie+Be),Qe=Jr,Ge>0){Ge+=M;try{_t=new Uint8Array(Ge)}catch(ar){this.observer.emit(_.ERROR,_.ERROR,{type:ve.MUX_ERROR,details:Y.REMUX_ALLOC_ERROR,fatal:!1,error:ar,bytes:Ge,reason:`fail allocating audio mdat ${Ge}`});return}v||(new DataView(_t.buffer).setUint32(0,Ge),_t.set(Je.types.mdat,4))}else return;_t.set(Kr,M);const Ar=Kr.byteLength;M+=Ar,x.push(wo(!0,l,Ar,0)),We=Jr}const ft=x.length;if(!ft)return;const ze=x[x.length-1];ie=We-Be,this.nextAudioTs=ie+c*ze.duration;const Lt=v?new Uint8Array(0):Je.moof(e.sequenceNumber++,Qe/c,B({},e,{samples:x}));e.samples=[];const lr=(Qe-Be)/s,br=ie/s,dr={data1:Lt,data2:_t,startPTS:lr,endPTS:br,startDTS:lr,endDTS:br,type:"audio",hasAudio:!0,hasVideo:!1,nb:ft};return this.isAudioContiguous=!0,dr}}function Mi(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 lu(A){for(let e=0;e<A.length;e++)if(A[e].key)return e;return-1}function Co(A,e,t,r){const n=A.samples.length;if(!n)return;const i=A.inputTimeScale;for(let a=0;a<n;a++){const c=A.samples[a];c.pts=Mi(c.pts-t.baseTime*i/t.timescale,e*i)/i,c.dts=Mi(c.dts-r.baseTime*i/r.timescale,e*i)/i}const s=A.samples;return A.samples=[],{samples:s}}function va(A,e,t){const r=A.samples.length;if(!r)return;const n=A.inputTimeScale;for(let s=0;s<r;s++){const a=A.samples[s];a.pts=Mi(a.pts-t.baseTime*n/t.timescale,e*n)/n}A.samples.sort((s,a)=>s.pts-a.pts);const i=A.samples;return A.samples=[],{samples:i}}class mr extends G{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(qe(e,n)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:r}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const n=this.initData=V(e);n.audio&&(t=kA(n.audio,$.AUDIO,this)),n.video&&(r=kA(n.video,$.VIDEO,this));const i={};n.audio&&n.video?i.audiovideo={container:"video/mp4",codec:t+","+r,supplemental:n.video.supplemental,initSegment:e,id:"main"}:n.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:n.video?i.video={container:"video/mp4",codec:r,supplemental:n.video.supplemental,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=i}remux(e,t,r,n,i,s){var a,c;let{initPTS:l,lastEndTime:g}=this;const p={audio:void 0,video:void 0,text:n,id3:r,initSegment:void 0};z(g)||(g=this.lastEndTime=i||0);const v=t.samples;if(!(v!=null&&v.length))return p;const x={initPTS:void 0,timescale:void 0,trackId:void 0};let S=this.initData;if((a=S)!=null&&a.length||(this.generateInitSegment(v),S=this.initData),!((c=S)!=null&&c.length))return this.warn("Failed to generate initSegment."),p;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1);const O=ot(v,S,this),M=S.audio?O[S.audio.id]:null,ie=S.video?O[S.video.id]:null,Be=QA(ie,1/0),_e=QA(M,1/0),Qe=QA(ie,0,!0),We=QA(M,0,!0);let _t=i,Ge=0;const at=M&&(!ie||!l&&_e<Be||l&&l.trackId===S.audio.id),ft=at?M:ie;if(ft){const _r=ft.timescale,vr=ft.start-i*_r,Kr=at?S.audio.id:S.video.id;_t=ft.start/_r,Ge=at?We-_e:Qe-Be,(s||!l)&&(uu(l,_t,i,Ge)||_r!==l.timescale)&&(l&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${i} ${vr/_r} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${i} offset: ${_t-i} (${vr}/${_r}) trackId: ${Kr}`),l=null,x.initPTS=vr,x.timescale=_r,x.trackId=Kr)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${i}`);l?(x.initPTS=l.baseTime,x.timescale=l.timescale,x.trackId=l.trackId):((!x.timescale||x.trackId===void 0||x.initPTS===void 0)&&(this.warn("Could not set initPTS"),x.initPTS=_t,x.timescale=1,x.trackId=-1),this.initPTS=l={baseTime:x.initPTS,timescale:x.timescale,trackId:x.trackId});const ze=e?_t-l.baseTime/l.timescale:g,Lt=ze+Ge;Ge>0?this.lastEndTime=Lt:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const lr=!!S.audio,br=!!S.video;let Or="";lr&&(Or+="audio"),br&&(Or+="video");const dr={data1:v,startPTS:ze,startDTS:ze,endPTS:Lt,endDTS:Lt,type:Or,hasAudio:lr,hasVideo:br,nb:1,dropped:0};p.audio=lr&&!br?dr:void 0,p.video=br?dr:void 0;const hr=ie==null?void 0:ie.sampleCount;if(hr){const _r=ie.keyFrameIndex,vr=_r!==-1;dr.nb=hr,dr.dropped=_r===0||this.isVideoContiguous?0:vr?_r:hr,dr.independent=vr,dr.firstKeyFrame=_r,vr&&ie.keyFrameStart&&(dr.firstKeyFramePTS=(ie.keyFrameStart-l.baseTime)/l.timescale),this.isVideoContiguous||(p.independent=vr),this.isVideoContiguous||(this.isVideoContiguous=vr),dr.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${_r}/${hr} dropped: ${dr.dropped} start: ${dr.firstKeyFramePTS||"NA"}`)}return p.initSegment=x,p.id3=Co(r,i,l,l),n.samples.length&&(p.text=va(n,i,l)),p}}function QA(A,e,t=!1){return(A==null?void 0:A.start)!==void 0?(A.start+(t?A.duration:0))/A.timescale:e}function uu(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 kA(A,e,t){const r=A==null?void 0:A.codec;return r&&r.length>4?r:e===$.AUDIO?r==="ec-3"||r==="ac-3"||r==="alac"?r:r==="fLaC"||r==="Opus"?ce(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 ai;try{ai=self.performance.now.bind(self.performance)}catch(A){ai=Date.now}const OA=[{demux:Xl,remux:mr},{demux:ws,remux:RA},{demux:Zl,remux:RA},{demux:jl,remux:RA}];OA.splice(2,0,{demux:zl,remux:RA});class ya{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=ai();let s=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:c}=this;n&&(this.currentTransmuxState=n);const{contiguous:l,discontinuity:g,trackSwitch:p,accurateTimeOffset:v,timeOffset:x,initSegmentChange:S}=n||a,{audioCodec:O,videoCodec:M,defaultInitPts:ie,duration:Be,initSegmentData:_e}=c,Qe=lA(s,t);if(Qe&&gi(Qe.method)){const at=this.getDecrypter(),ft=hi(Qe.method);if(at.isSync()){let ze=at.softwareDecrypt(s,Qe.key.buffer,Qe.iv.buffer,ft);if(r.part>-1){const lr=at.flush();ze=lr&&lr.buffer}if(!ze)return i.executeEnd=ai(),Ws(r);s=new Uint8Array(ze)}else return this.asyncResult=!0,this.decryptionPromise=at.webCryptoDecrypt(s,Qe.key.buffer,Qe.iv.buffer,ft).then(ze=>{const Lt=this.push(ze,null,r);return this.decryptionPromise=null,Lt}),this.decryptionPromise}const We=this.needsProbing(g,p);if(We){const at=this.configureTransmuxer(s);if(at)return this.logger.warn(`[transmuxer] ${at.message}`),this.observer.emit(_.ERROR,_.ERROR,{type:ve.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,error:at,reason:at.message}),i.executeEnd=ai(),Ws(r)}(g||p||S||We)&&this.resetInitSegment(_e,O,M,Be,t),(g||S||We)&&this.resetInitialTimestamp(ie),l||this.resetContiguity();const _t=this.transmux(s,Qe,x,v,r);this.asyncResult=uA(_t);const Ge=this.currentTransmuxState;return Ge.contiguous=!0,Ge.discontinuity=!1,Ge.trackSwitch=!1,i.executeEnd=ai(),_t}flush(e){const t=e.transmuxing;t.executeStart=ai();const{decrypter:r,currentTransmuxState:n,decryptionPromise:i}=this;if(i)return this.asyncResult=!0,i.then(()=>this.flush(e));const s=[],{timeOffset:a}=n;if(r){const p=r.flush();p&&s.push(this.push(p.buffer,null,e))}const{demuxer:c,remuxer:l}=this;if(!c||!l){t.executeEnd=ai();const p=[Ws(e)];return this.asyncResult?Promise.resolve(p):p}const g=c.flush(a);return uA(g)?(this.asyncResult=!0,g.then(p=>(this.flushRemux(s,p,e),s))):(this.flushRemux(s,g,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,r){const{audioTrack:n,videoTrack:i,id3Track:s,textTrack:a}=t,{accurateTimeOffset:c,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${r.sn}${r.part>-1?" part: "+r.part:""} of ${this.id===H.MAIN?"level":"track"} ${r.level}`);const g=this.remuxer.remux(n,i,s,a,l,c,!0,this.id);e.push({remuxResult:g,chunkMeta:r}),r.transmuxing.executeEnd=ai()}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:a}=this;!s||!a||(s.resetInitSegment(e,t,r,n),a.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:a,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,a,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 p=0,v=OA.length;p<v;p++){var s;if((s=OA[p].demux)!=null&&s.probe(e,this.logger)){i=OA[p];break}}if(!i)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,c=this.remuxer,l=i.remux,g=i.demux;(!c||!(c instanceof l))&&(this.remuxer=new l(r,t,n,this.logger)),(!a||!(a instanceof g))&&(this.demuxer=new g(r,t,n,this.logger),this.probe=g.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Yr(this.config)),e}}function lA(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 Ws=A=>({remuxResult:{},chunkMeta:A});function uA(A){return"then"in A&&A.then instanceof Function}class cu{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 fu{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 bs=0;class PA{constructor(e,t,r,n){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=bs++,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 l=c.data,g=this.hls;if(!(!g||!(l!=null&&l.event)||l.instanceNo!==this.instanceNo))switch(l.event){case"init":{var p;const v=(p=this.workerContext)==null?void 0:p.objectURL;v&&self.URL.revokeObjectURL(v);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}case"workerLog":{g.logger[l.data.logType]&&g.logger[l.data.logType](l.data.message);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.part=this.part,l.data.id=this.id,g.trigger(l.event,l.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const l=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:ve.OTHER_ERROR,details:Y.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:l})};const i=e.config;this.hls=e,this.id=t,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=r,this.onFlush=n;const s=(c,l)=>{l=l||{},l.frag=this.frag||void 0,c===_.ERROR&&(l=l,l.parent=this.id,l.part=this.part,this.error=l.error),this.hls.trigger(c,l)};this.observer=new cs,this.observer.on(_.FRAG_DECRYPTED,s),this.observer.on(_.ERROR,s);const a=rr(i.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(i.workerPath||sA()){try{i.workerPath?(c.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=io(i.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=Fl());const{worker:g}=this.workerContext;g.addEventListener("message",this.onWorkerMessage),g.addEventListener("error",this.onWorkerError),g.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:a,id:t,config:Hr(i)})}catch(g){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,g),this.terminateWorker(),this.error=null,this.transmuxer=new ya(this.observer,a,i,"",t,e.logger)}return}}this.transmuxer=new ya(this.observer,a,i,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=bs++;const t=this.hls.config,r=rr(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:r,id:this.id,config:Hr(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),Sl(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,a,c,l,g){var p,v;l.transmuxing.start=self.performance.now();const{instanceNo:x,transmuxer:S}=this,O=s?s.start:i.start,M=i.decryptdata,ie=this.frag,Be=!(ie&&i.cc===ie.cc),_e=!(ie&&l.level===ie.level),Qe=ie?l.sn-ie.sn:-1,We=this.part?l.part-this.part.index:-1,_t=Qe===0&&l.id>1&&l.id===(ie==null?void 0:ie.stats.chunkCount),Ge=!_e&&(Qe===1||Qe===0&&(We===1||_t&&We<=0)),at=self.performance.now();(_e||Qe||i.stats.parsing.start===0)&&(i.stats.parsing.start=at),s&&(We||!Ge)&&(s.stats.parsing.start=at);const ft=!(ie&&((p=i.initSegment)==null?void 0:p.url)===((v=ie.initSegment)==null?void 0:v.url)),ze=new fu(Be,Ge,c,_e,O,ft);if(!Ge||Be||ft){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${i.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===H.MAIN?"level":"track"}: ${l.level} id: ${l.id}
discontinuity: ${Be}
trackSwitch: ${_e}
contiguous: ${Ge}
accurateTimeOffset: ${c}
timeOffset: ${O}
initSegmentChange: ${ft}`);const Lt=new cu(r,n,t,a,g);this.configureTransmuxer(Lt)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:x,cmd:"demux",data:e,decryptdata:M,chunkMeta:l,state:ze},e instanceof ArrayBuffer?[e]:[]);else if(S){const Lt=S.push(e,M,l,ze);uA(Lt)?Lt.then(lr=>{this.handleTransmuxComplete(lr)}).catch(lr=>{this.transmuxerError(lr,l,"transmuxer-interface push error")}):this.handleTransmuxComplete(Lt)}}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);uA(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:ve.MEDIA_ERROR,details:Y.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 MA=100;class hu extends wn{constructor(e,t,r){super(e,t,r,"audio-stream-controller",H.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===H.MAIN){const a=t.cc,c=this.fragCurrent;if(this.initPTS[a]={baseTime:n,timescale:i,trackId:s},this.log(`InitPTS for cc: ${a} found from main: ${n/i} (${n}/${i}) trackId: ${s}`),this.mainAnchor=t,this.state===pt.WAITING_INIT_PTS){const l=this.waitingData;(!l&&!this.loadingParts||l&&l.frag.cc!==a)&&this.syncWithAnchor(t,l==null?void 0:l.frag)}else!this.hls.hasEnoughToStart&&c&&c.cc!==a?(c.abortRequests(),this.syncWithAnchor(t,c)):this.state===pt.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(),a=this.getLoadPosition(),c=pe(s,i,a);c&&(this.log(`Syncing with main frag at ${c.start} cc ${c.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===pt.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=pt.STOPPED;return}const r=this.lastCurrentTime;this.stopLoad(),this.setInterval(MA),r>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r,this.state=pt.IDLE):this.state=pt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case pt.IDLE:this.doTickIdle();break;case pt.WAITING_TRACK:{const{levels:t,trackId:r}=this,n=t==null?void 0:t[r],i=n==null?void 0:n.details;if(i&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(i))break;this.state=pt.WAITING_INIT_PTS}break}case pt.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),r=this.retryDate;if(!r||t>=r||(e=this.media)!=null&&e.seeking){const{levels:n,trackId:i}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((n==null?void 0:n[i])||null),this.state=pt.IDLE}break}case pt.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:r,part:n,cache:i,complete:s}=t,a=this.mainAnchor;if(this.initPTS[r.cc]!==void 0){this.waitingData=null,this.state=pt.FRAG_LOADING;const c=i.flush().buffer,l={frag:r,part:n,payload:c,networkDetails:null};this._handleFragmentLoadProgress(l),s&&super._handleFragmentLoadComplete(l)}else a&&a.cc!==t.frag.cc&&this.syncWithAnchor(a,t.frag)}else this.state=pt.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 a=r[i],c=a.details;if(!c||this.waitForLive(a)||this.waitForCdnTuneIn(c)){this.state=pt.WAITING_TRACK,this.startFragRequested=!1;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,$.AUDIO,H.AUDIO));const g=this.getFwdBufferInfo(l,H.AUDIO);if(g===null)return;if(!this.switchingTrack&&this._streamEnded(g,c)){t.trigger(_.BUFFER_EOS,{type:"audio"}),this.state=pt.ENDED;return}const p=g.len,v=t.maxBufferLength,x=c.fragments,S=x[0].start,O=this.getLoadPosition(),M=this.flushing?O:g.end;if(this.switchingTrack&&n){const _e=O;c.PTSKnown&&_e<S&&(g.end>S||g.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=S+.05)}if(p>=v&&!this.switchingTrack&&M<x[x.length-1].start)return;let ie=this.getNextFragment(M,c);if(ie&&this.isLoopLoading(ie,M)&&(ie=this.getNextFragmentLoopLoading(ie,c,g,H.MAIN,v)),!ie){this.bufferFlushed=!0;return}let Be=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&Be&&$e(ie)&&!ie.endList&&(!c.live||!this.loadingParts&&M<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(Be)===Kt.OK&&(this.mainFragLoading=Be=null),Be&&$e(Be))){if(ie.start>Be.end){const Qe=this.fragmentTracker.getFragAtPos(M,H.MAIN);Qe&&Qe.end>Be.end&&(Be=Qe,this.mainFragLoading={frag:Qe,targetBufferTime:null})}if(ie.start>Be.end)return}this.loadFragment(ie,a,M)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(r=>new ei(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!==pt.STOPPED&&(this.setInterval(MA),this.state=pt.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:a,track:c}=t;if(!n){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${a}"`);return}const l=this.mainDetails;if(!l||i.endCC>l.endCC||l.expired){this.cachedTrackLoadedData=t,this.state!==pt.STOPPED&&(this.state=pt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${a}" loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const g=n[s];let p=0;if(i.live||(r=g.details)!=null&&r.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;if(g.details){var v;p=this.alignPlaylists(i,g.details,(v=this.levelLastLoaded)==null?void 0:v.details)}i.alignedSliding||(BA(i,l),i.alignedSliding||ls(i,l),p=i.fragmentStart)}g.details=i,this.levelLastLoaded=g,this.startFragRequested||this.setStartPosition(l,p),this.hls.trigger(_.AUDIO_TRACK_UPDATED,{details:i,id:s,groupId:t.groupId}),this.state===pt.WAITING_TRACK&&!this.waitForCdnTuneIn(i)&&(this.state=pt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:n,payload:i}=e,{config:s,trackId:a,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 l=c[a];if(!l){this.warn("Audio track is undefined on fragment load progress");return}const g=l.details;if(!g){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(r.start);return}const p=s.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let v=this.transmuxer;v||(v=this.transmuxer=new PA(this.hls,H.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const x=this.initPTS[r.cc],S=(t=r.initSegment)==null?void 0:t.data;if(x!==void 0){const M=n?n.index:-1,ie=M!==-1,Be=new sn(r.level,r.sn,r.stats.chunkCount,i.byteLength,M,ie);v.push(i,S,p,"",r,n,g.totalduration,!1,Be,x)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${g.startSN} ,${g.endSN}],track ${a}`);const{cache:O}=this.waitingData=this.waitingData||{frag:r,part:n,cache:new fi,complete:!1};O.push(new Uint8Array(i)),this.state!==pt.STOPPED&&(this.state=pt.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===H.MAIN&&$e(t.frag)&&(this.mainFragLoading=t,this.state===pt.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:r,part:n}=t;if(r.type!==H.AUDIO){!this.audioOnly&&r.type===H.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($e(r)){this.fragPrevious=r;const i=this.switchingTrack;i&&(this.bufferedTrack=i,this.switchingTrack=null,this.hls.trigger(_.AUDIO_TRACK_SWITCHED,C({},i)))}this.fragBufferedComplete(r,n),this.media&&this.tick()}onError(e,t){var r;if(t.fatal){this.state=pt.ERROR;return}switch(t.details){case Y.FRAG_GAP:case Y.FRAG_PARSING_ERROR:case Y.FRAG_DECRYPT_ERROR:case Y.FRAG_LOAD_ERROR:case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_ERROR:case Y.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(H.AUDIO,t);break;case Y.AUDIO_TRACK_LOAD_ERROR:case Y.AUDIO_TRACK_LOAD_TIMEOUT:case Y.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===pt.WAITING_TRACK&&((r=t.context)==null?void 0:r.type)===ye.AUDIO_TRACK&&(this.state=pt.IDLE);break;case Y.BUFFER_ADD_CODEC_ERROR:case Y.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case Y.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case Y.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==$.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==$.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===pt.ENDED&&(this.state=pt.IDLE);const r=this.mediaBuffer||this.media;r&&(this.afterBufferFlushed(r,t,H.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const r="audio",{hls:n}=this,{remuxResult:i,chunkMeta:s}=e,a=this.getCurrentContext(s);if(!a){this.resetWhenMissingContext(s);return}const{frag:c,part:l,level:g}=a,{details:p}=g,{audio:v,text:x,id3:S,initSegment:O}=i;if(this.fragContextChanged(c)||!p){this.fragmentTracker.removeFragment(c);return}if(this.state=pt.PARSING,this.switchingTrack&&v&&this.completeAudioSwitch(this.switchingTrack),O!=null&&O.tracks){const M=c.initSegment||c;this._bufferInitSegment(g,O.tracks,M,s),n.trigger(_.FRAG_PARSING_INIT_SEGMENT,{frag:M,id:r,tracks:O.tracks})}if(v){const{startPTS:M,endPTS:ie,startDTS:Be,endDTS:_e}=v;l&&(l.elementaryStreams[$.AUDIO]={startPTS:M,endPTS:ie,startDTS:Be,endDTS:_e}),c.setElementaryStreamInfo($.AUDIO,M,ie,Be,_e),this.bufferFragmentData(v,c,l,s)}if(S!=null&&(t=S.samples)!=null&&t.length){const M=B({id:r,frag:c,details:p},S);n.trigger(_.FRAG_PARSING_METADATA,M)}if(x){const M=B({id:r,frag:c,details:p},x);n.trigger(_.FRAG_PARSING_USERDATA,M)}}_bufferInitSegment(e,t,r,n){if(this.state!==pt.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const i=t.audio;i.id=H.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 a=i.initSegment;if(a!=null&&a.byteLength){const c={type:"audio",frag:r,part:null,chunkMeta:n,parent:r.type,data:a};this.hls.trigger(_.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);if(this.switchingTrack||n===Kt.NOT_LOADED||n===Kt.PARTIAL){var i;if(!$e(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=pt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&ls(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:a}=this.bufferedTrack;wt({name:t,lang:r,assocLang:n,characteristics:i,audioCodec:s,channels:a},e,ht)||(qt(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,C({},e))}}class NA extends G{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 a=n[s];let c;try{c=new self.URL(a.URI,t.url).href}catch(l){this.warn(`Could not construct new URL for Rendition Report: ${l}`),c=a.URI||""}if(c===e){i=s;break}else c===e.substring(0,c.length)&&(i=s)}if(i!==-1){const s=n[i],a=parseInt(s["LAST-MSN"])||t.lastPartSn;let c=parseInt(s["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const g=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&g>t.partTarget&&(c+=1)}const l=r&&Rn(r);return new Hn(a,c>=0?c:void 0,l)}}}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(),a=i.loading.first?Math.max(0,s-i.loading.first):0;n.advancedDateTime=Date.now()-a;const c=this.hls.config.timelineOffset;if(c!==n.appliedTimelineOffset){const g=Math.max(c||0,0);n.appliedTimelineOffset=g,n.fragments.forEach(p=>{p.setStart(p.playlistOffset+g)})}if(n.live||r!=null&&r.live){const g="levelInfo"in t?t.levelInfo:t.track;if(n.reloaded(r),r&&n.fragments.length>0){Xi(r,n);const Be=n.playlistParsingError;if(Be){this.warn(Be);const _e=this.hls;if(!_e.config.ignorePlaylistParsingErrors){var l;const{networkDetails:Qe}=t;_e.trigger(_.ERROR,{type:ve.NETWORK_ERROR,details:Y.LEVEL_PARSING_ERROR,fatal:!1,url:n.url,error:Be,reason:Be.message,level:t.level||void 0,parent:(l=n.fragments[0])==null?void 0:l.type,networkDetails:Qe,stats:i});return}n.playlistParsingError=null}}n.requestScheduled===-1&&(n.requestScheduled=i.loading.start);const p=this.hls.mainForwardBufferInfo,v=p?p.end-p.len:0,x=(n.edge-v)*1e3,S=Pi(n,x);if(n.requestScheduled+S<s?n.requestScheduled=s:n.requestScheduled+=S,this.log(`live playlist ${e} ${n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:n.updated?"UPDATED":"MISSED"}`),!this.canLoad||!n.live)return;let O,M,ie;if(n.canBlockReload&&n.endSN&&n.advanced){const Be=this.hls.config.lowLatencyMode,_e=n.lastPartSn,Qe=n.endSN,We=n.lastPartIndex,_t=We!==-1,Ge=_e===Qe;_t?Ge?(M=Qe+1,ie=Be?0:We):(M=_e,ie=Be?We+1:n.maxPartIndex):M=Qe+1;const at=n.age,ft=at+n.ageHeader;let ze=Math.min(ft-n.partTarget,n.targetduration*1.5);if(ze>0){if(ft>n.targetduration*3)this.log(`Playlist last advanced ${at.toFixed(2)}s ago. Omitting segment and part directives.`),M=void 0,ie=void 0;else if(r!=null&&r.tuneInGoal&&ft-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 Lt=Math.floor(ze/n.targetduration);if(M+=Lt,ie!==void 0){const lr=Math.round(ze%n.targetduration/n.partTarget);ie+=lr}this.log(`CDN Tune-in age: ${n.ageHeader}s last advanced ${at.toFixed(2)}s goal: ${ze} skip sn ${Lt} to part ${ie}`)}n.tuneInGoal=ze}if(O=this.getDeliveryDirectives(n,t.deliveryDirectives,M,ie),Be||!Ge){n.requestScheduled=s,this.loadingPlaylist(g,O);return}}else(n.canBlockReload||n.canSkipUntil)&&(O=this.getDeliveryDirectives(n,t.deliveryDirectives,M,ie));O&&M!==void 0&&n.canBlockReload&&(n.requestScheduled=i.loading.first+Math.max(S-a*2,S/2)),this.scheduleLoading(g,O,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 a=s-i;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(a)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),a)}getDeliveryDirectives(e,t,r,n){let i=Rn(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,n=t.part,i=Nn.No),new Hn(r,n,i)}checkRetry(e){const t=e.details,r=Re(e),n=e.errorAction,{action:i,retryCount:s=0,retryConfig:a}=n||{},c=!!n&&!!a&&(i===be.RetryRequest||!n.resolved&&i===be.SendAlternateToPenaltyBox);if(c){var l;if(s>=a.maxNumRetry)return!1;if(r&&(l=e.context)!=null&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const g=ct(a,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),g),this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" in ${g}ms`)}e.levelRetry=!0,n.resolved=!0}return c}}function bo(A,e){if(A.length!==e.length)return!1;for(let t=0;t<A.length;t++)if(!Rs(A[t].attrs,e[t].attrs))return!1;return!0}function Rs(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 Ba(A,e){return e.label.toLowerCase()===A.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(A.lang||"").toLowerCase())}class du extends NA{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 a=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,a)}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(a=>(n==null?void 0:n.indexOf(a))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const a=this.tracks.filter(v=>!r||r.indexOf(v.groupId)!==-1);if(a.length)this.selectDefaultTrack&&!a.some(v=>v.default)&&(this.selectDefaultTrack=!1),a.forEach((v,x)=>{v.id=x});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=a;const c=this.hls.config.audioPreference;if(!i&&c){const v=tt(c,a,ht);if(v>-1)i=a[v];else{const x=tt(c,this.tracks);i=this.tracks[x]}}let l=this.findTrackId(i);l===-1&&i&&(l=this.findTrackId(null));const g={audioTracks:a};this.log(`Updating audio tracks, ${a.length} track(s) found in group(s): ${r==null?void 0:r.join(",")}`),this.hls.trigger(_.AUDIO_TRACKS_UPDATED,g);const p=this.trackId;if(l!==-1&&p===-1)this.setAudioTrack(l);else if(a.length&&p===-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: ${a.length}`);this.warn(v.message),this.hls.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:v})}}}onError(e,t){t.fatal||!t.context||t.context.type===ye.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&&wt(e,n,ht))return n;const i=tt(e,this.tracksInGroup,ht);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 a=vt(e,t.levels,r,s,ht);if(a===-1)return null;t.nextLoadLevel=a}if(e.channels||e.audioCodec){const s=tt(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,C({},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||wt(e,n,ht)))return r}if(e){const{name:r,lang:n,assocLang:i,characteristics:s,audioCodec:a,channels:c}=e;for(let l=0;l<t.length;l++){const g=t[l];if(wt({name:r,lang:n,assocLang:i,characteristics:s,audioCodec:a,channels:c},g,ht))return l}for(let l=0;l<t.length;l++){const g=t[l];if(Rs(e.attrs,g.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return l}for(let l=0;l<t.length;l++){const g=t[l];if(Rs(e.attrs,g.attrs,["LANGUAGE"]))return l}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&qt(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,a=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:""}${a&&s.live?" age "+a.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 gu{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 xo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,Fo="HlsJsTrackRemovedError";class pu extends Error{constructor(e){super(e),this.name=Fo}}class mu extends G{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=Ke(xe(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=xe(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 a=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,So(r),To(r,a),r.load()}catch(c){r.src=a}else r.src=a}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,a=()=>{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: ${Hr(r,(c,l)=>c==="initSegment"?void 0:l)};
transfer tracks: ${Hr(n,(c,l)=>c==="initSegment"?void 0:l)}}`),!ge(n,r)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,l=this.details,g=Math.max(c,(l==null?void 0:l.fragments[0].start)||0);if(g-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${g}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(n)}"->"${Object.keys(r)}") start time: ${g} currentTime: ${c}`),this.onMediaDetaching(_.MEDIA_DETACHING,{}),this.onMediaAttaching(_.MEDIA_ATTACHING,t),e.currentTime=g;return}this.transferData=void 0,i.forEach(c=>{const l=c,g=n[l];if(g){const p=g.buffer;if(p){const v=this.fragmentTracker,x=g.id;if(v.hasFragments(x)||v.hasParts(x)){const M=sr.getBuffered(p);v.detectEvictedFragments(l,M,x,null,!0)}const S=Ea(l),O=[l,p];this.sourceBuffers[S]=O,p.updating&&this.operationQueue&&this.operationQueue.prependBlocker(l),this.trackSourceBuffer(l,g)}}}),a(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),a()}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(([a])=>{a&&this.removeBuffer(a)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const a=i.readyState==="open";try{const c=i.sourceBuffers;for(let l=c.length;l--;)a&&c[l].abort(),i.removeSourceBuffer(c[l]);a&&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&&So(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[Ea(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new gu(this.tracks)}onBufferCodecs(e,t){const r=this.tracks,n=Object.keys(t);this.log(`BUFFER_CODECS: "${n}" (current SB count ${this.sourceBufferCount})`);const i="audiovideo"in t&&(r.audio||r.video)||r.audiovideo&&("audio"in t||"video"in t),s=!i&&this.sourceBufferCount&&this.media&&n.some(a=>!r[a]);if(i||s){this.warn(`Unsupported transition between "${Object.keys(r)}" and "${n}" SourceBuffers`);return}n.forEach(a=>{var c,l;const g=t[a],{id:p,codec:v,levelCodec:x,container:S,metadata:O,supplemental:M}=g;let ie=r[a];const Be=(c=this.transferData)==null||(c=c.tracks)==null?void 0:c[a],_e=Be!=null&&Be.buffer?Be:ie,Qe=(_e==null?void 0:_e.pendingCodec)||(_e==null?void 0:_e.codec),We=_e==null?void 0:_e.levelCodec;ie||(ie=r[a]={buffer:void 0,listeners:[],codec:v,supplemental:M,container:S,levelCodec:x,metadata:O,id:p});const _t=Te(Qe,We),Ge=_t==null?void 0:_t.replace(xo,"$1");let at=Te(v,x);const ft=(l=at)==null?void 0:l.replace(xo,"$1");at&&_t&&Ge!==ft&&(a.slice(0,5)==="audio"&&(at=ce(at,this.appendSource)),this.log(`switching codec ${Qe} to ${at}`),at!==(ie.pendingCodec||ie.codec)&&(ie.pendingCodec=at),ie.container=S,this.appendChangeType(a,S,at))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&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 a=s.buffer;a!=null&&a.changeType&&(this.log(`changing ${e} sourceBuffer type to ${n}`),a.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,H.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var a;const c=this.tracks.video;(this.lastVideoAppendEnd>n||c!=null&&c.buffer&&sr.isBuffered(c.buffer,n)||((a=this.fragmentTracker.getAppendedFrag(n,H.MAIN))==null?void 0:a.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:a=>{this.warn("Error executing block-audio operation",a)}};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:a,part:c,chunkMeta:l,offset:g}=t,p=l.buffering[i],{sn:v,cc:x}=a,S=self.performance.now();p.start=S;const O=a.stats.buffering,M=c?c.stats.buffering:null;O.start===0&&(O.start=S),M&&M.start===0&&(M.start=S);const ie=r.audio;let Be=!1;i==="audio"&&(ie==null?void 0:ie.container)==="audio/mpeg"&&(Be=!this.lastMpegAudioChunk||l.id===1||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);const _e=r.video,Qe=_e==null?void 0:_e.buffer;if(Qe&&v!=="initSegment"){const Ge=c||a,at=this.blockedAudioAppend;if(i==="audio"&&s!=="main"&&!this.blockedAudioAppend&&!(_e.ending||_e.ended)){const ze=Ge.start+Ge.duration*.05,Lt=Qe.buffered,lr=this.currentOp("video");!Lt.length&&!lr?this.blockAudio(Ge):!lr&&!sr.isBuffered(Qe,ze)&&this.lastVideoAppendEnd<ze&&this.blockAudio(Ge)}else if(i==="video"){const ft=Ge.end;if(at){const ze=at.frag.start;(ft>ze||ft<this.lastVideoAppendEnd||sr.isBuffered(Qe,ze))&&this.unblockAudio()}this.lastVideoAppendEnd=ft}}const We=(c||a).start,_t={label:`append-${i}`,execute:()=>{var Ge;p.executeStart=self.performance.now();const at=(Ge=this.tracks[i])==null?void 0:Ge.buffer;at&&(Be?this.updateTimestampOffset(at,We,.1,i,v,x):g!==void 0&&z(g)&&this.updateTimestampOffset(at,g,1e-6,i,v,x)),this.appendExecutor(n,i)},onStart:()=>{},onComplete:()=>{const Ge=self.performance.now();p.executeEnd=p.end=Ge,O.first===0&&(O.first=Ge),M&&M.first===0&&(M.first=Ge);const at={};this.sourceBuffers.forEach(([ft,ze])=>{ft&&(at[ft]=sr.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:a,part:c,chunkMeta:l,parent:a.type,timeRanges:at})},onError:Ge=>{var at;const ft={type:ve.MEDIA_ERROR,parent:a.type,details:Y.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:a,part:c,chunkMeta:l,error:Ge,err:Ge,fatal:!1},ze=(at=this.media)==null?void 0:at.error;if(Ge.code===DOMException.QUOTA_EXCEEDED_ERR||Ge.name=="QuotaExceededError"||"quota"in Ge)ft.details=Y.BUFFER_FULL_ERROR;else if(Ge.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!ze)ft.errorAction=Jt(!0);else if(Ge.name===Fo&&this.sourceBufferCount===0)ft.errorAction=Jt(!0);else{const Lt=++this.appendErrors[i];this.warn(`Failed ${Lt}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${i}" sourceBuffer (${ze||"no media error"})`),(Lt>=this.hls.config.appendErrorMaxRetry||ze)&&(ft.fatal=!0)}this.hls.trigger(_.ERROR,ft)}};this.append(_t,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[$.AUDIOVIDEO]?i.push("audiovideo"):(s[$.AUDIO]&&i.push("audio"),s[$.VIDEO]&&i.push("video"));const a=()=>{const c=self.performance.now();r.stats.buffering.end=c,n&&(n.stats.buffering.end=c);const l=n?n.stats:r.stats;this.hls.trigger(_.FRAG_BUFFERED,{frag:r,part:n,stats:l,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(a,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 a=this.tracks[s];(!t.type||t.type===s)&&(a.ending=!0,a.ended||(a.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 a;return s&&!((a=this.tracks[s])!=null&&a.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===Y.BUFFER_APPEND_ERROR&&t.frag){var r;const n=(r=t.errorAction)==null?void 0:r.nextAutoLevel;z(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,a=t.live&&n.liveBackBufferLength!==null?n.liveBackBufferLength:n.backBufferLength;if(z(a)&&a>=0){const l=Math.max(a,s),g=Math.floor(i/s)*s-l;this.flushBackBuffer(i,s,g)}const c=n.frontBufferFlushThreshold;if(z(c)&&c>0){const l=Math.max(n.maxBufferLength,c),g=Math.max(l,s),p=Math.floor(i/s)*s+g;this.flushFrontBuffer(i,s,p)}}flushBackBuffer(e,t,r){this.sourceBuffers.forEach(([n,i])=>{if(i){const a=sr.getBuffered(i);if(a.length>0&&r>a.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=sr.getBuffered(i),a=s.length;if(a<2)return;const c=s.start(a-1),l=s.end(a-1);if(r>c||e>=c&&e<=l)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 l=Math.max(0,t.fragmentStart),g=Math.max(l,n);return{duration:1/0,start:l,end:g}}return{duration:1/0}}const i=(e=this.overrides)==null?void 0:e.duration;if(i)return z(i)?{duration:i}:null;const s=this.media.duration,a=z(r.duration)?r.duration:0;return n>a&&n>s||!z(s)?{duration:n}:null}updateMediaSource({duration:e,start:t,end:r}){const n=this.mediaSource;!this.media||!n||n.readyState!=="open"||(n.duration!==e&&(z(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}) ${Hr(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:ve.MEDIA_ERROR,details:Y.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,a=e[s];if(this.isPending(a)){const c=this.getTrackCodec(a,s),l=`${a.container};codecs=${c}`;a.codec=c,this.log(`creating sourceBuffer(${l})${this.currentOp(s)?" Queued":""} ${Hr(a)}`);try{const g=r.addSourceBuffer(l),p=Ea(s),v=[s,g];t[p]=v,a.buffer=g}catch(g){var n;this.error(`error while trying to add sourceBuffer: ${g.message}`),this.shiftAndExecuteNext(s),(n=this.operationQueue)==null||n.removeBlockers(),delete this.tracks[s],this.hls.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:g,sourceBufferName:s,mimeType:l,parent:a.id});return}this.trackSourceBuffer(s,a)}}this.bufferCreated()}getTrackCodec(e,t){const r=e.supplemental;let n=e.codec;r&&(t==="video"||t==="audiovideo")&&zr(r,"video")&&(n=Ee(n,r));const i=Te(n,e.levelCodec);return i?t.slice(0,5)==="audio"?ce(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 a=s.removedRanges;a!=null&&a.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:ve.MEDIA_ERROR,details:Y.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 a=t-e.timestampOffset;Math.abs(a)>=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],a=s==null?void 0:s.buffer;if(!n||!i||!a){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=z(n.duration)?n.duration:1/0,l=z(i.duration)?i.duration:1/0,g=Math.max(0,t),p=Math.min(r,c,l);p>g&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${g},${p}] from the ${e} SourceBuffer`),a.remove(g,p)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const r=this.tracks[t],n=r==null?void 0:r.buffer;if(!n)throw new pu(`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 So(A){const e=A.querySelectorAll("source");[].slice.call(e).forEach(t=>{A.removeChild(t)})}function To(A,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,A.appendChild(t)}function Ea(A){return A==="audio"?1:0}class wa{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&&z(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,wa.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=(a,c)=>c?a.width!==c.width||a.height!==c.height:!0;let i=e.length-1;const s=Math.max(t,r);for(let a=0;a<e.length;a+=1){const c=e[a];if((c.width>=s||c.height>=s)&&n(c,e[a+1])){i=a;break}}return i}}const _i={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},HA={HLS:"h"};class ts{constructor(e,t){Array.isArray(e)&&(e=e.map(r=>r instanceof ts?r:new ts(r))),this.value=e,this.params=t}}const Ca="Dict";function ba(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 Io(A,e,t,r){return new Error(`failed to ${A} "${ba(e)}" as ${t}`,{cause:r})}function Zi(A,e,t){return Io("serialize",A,e,t)}class Do{constructor(e){this.description=e}}const xa="Bare Item",Fa="Boolean";function Sa(A){if(typeof A!="boolean")throw Zi(A,Fa);return A?"?1":"?0"}function Lo(A){return btoa(String.fromCharCode(...A))}const Uo="Byte Sequence";function Ro(A){if(ArrayBuffer.isView(A)===!1)throw Zi(A,Uo);return`:${Lo(A)}:`}const Qo="Integer";function Ta(A){return A<-999999999999999||999999999999999<A}function ko(A){if(Ta(A))throw Zi(A,Qo);return A.toString()}function _u(A){return`@${ko(A.getTime()/1e3)}`}function Oo(A,e){if(A<0)return-Oo(-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 Ni="Decimal";function Ia(A){const e=Oo(A,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Zi(A,Ni);const t=e.toString();return t.includes(".")?t:`${t}.0`}const vu="String",yu=/[\x00-\x1f\x7f]+/;function Bu(A){if(yu.test(A))throw Zi(A,vu);return`"${A.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Eu(A){return A.description||A.toString().slice(7,-1)}const wu="Token";function Po(A){const e=Eu(A);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Zi(e,wu);return e}function Da(A){switch(typeof A){case"number":if(!z(A))throw Zi(A,xa);return Number.isInteger(A)?ko(A):Ia(A);case"string":return Bu(A);case"symbol":return Po(A);case"boolean":return Sa(A);case"object":if(A instanceof Date)return _u(A);if(A instanceof Uint8Array)return Ro(A);if(A instanceof Do)return Po(A);default:throw Zi(A,xa)}}const Cu="Key";function La(A){if(/^[a-z*][a-z0-9\-_.*]*$/.test(A)===!1)throw Zi(A,Cu);return A}function KA(A){return A==null?"":Object.entries(A).map(([e,t])=>t===!0?`;${La(e)}`:`;${La(e)}=${Da(t)}`).join("")}function Mo(A){return A instanceof ts?`${Da(A.value)}${KA(A.params)}`:Da(A)}function Ua(A){return`(${A.value.map(Mo).join(" ")})${KA(A.params)}`}function No(A,e={whitespace:!0}){if(typeof A!="object"||A==null)throw Zi(A,Ca);const t=A instanceof Map?A.entries():Object.entries(A),r=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([n,i])=>{i instanceof ts||(i=new ts(i));let s=La(n);return i.value===!0?s+=KA(i.params):(s+="=",Array.isArray(i.value)?s+=Ua(i):s+=Mo(i)),s}).join(`,${r}`)}function oi(A,e){return No(A,e)}const bi="CMCD-Object",Yn="CMCD-Request",Qs="CMCD-Session",fs="CMCD-Status",Ra={br:bi,ab:bi,d:bi,ot:bi,tb:bi,tpb:bi,lb:bi,tab:bi,lab:bi,url:bi,pb:Yn,bl:Yn,tbl:Yn,dl:Yn,ltc:Yn,mtp:Yn,nor:Yn,nrr:Yn,rc:Yn,sn:Yn,sta:Yn,su:Yn,ttfb:Yn,ttfbb:Yn,ttlb:Yn,cmsdd:Yn,cmsds:Yn,smrt:Yn,df:Yn,cs:Yn,ts:Yn,cid:Qs,pr:Qs,sf:Qs,sid:Qs,st:Qs,v:Qs,msd:Qs,bs:fs,bsd:fs,cdn:fs,rtp:fs,bg:fs,pt:fs,ec:fs,e:fs},bu={REQUEST:Yn};function xu(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 Fu(A,e){const t={};if(!A)return t;const r=Object.keys(A),n=e?xu(e):{};return r.reduce((i,s)=>{var a;const c=Ra[s]||n[s]||bu.REQUEST,l=(a=i[c])!==null&&a!==void 0?a:i[c]={};return l[s]=A[s],i},t)}function Su(A){return["ot","sf","st","e","sta"].includes(A)}function Tu(A){return typeof A=="number"?z(A):A!=null&&A!==""&&A!==!1}const Ho="event";function Iu(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 $A=A=>Math.round(A),GA=(A,e)=>Array.isArray(A)?A.map(t=>GA(t,e)):A instanceof ts&&typeof A.value=="string"?new ts(GA(A.value,e),A.params):(e.baseUrl&&(A=Iu(A,e.baseUrl)),e.version===1?encodeURIComponent(A):A),cA=A=>$A(A/100)*100,Ko={br:$A,d:$A,bl:cA,dl:cA,mtp:cA,nor:(A,e)=>{let t=A;return e.version>=2&&(A instanceof ts&&typeof A.value=="string"?t=new ts([A]):typeof A=="string"&&(t=[A])),GA(t,e)},rtp:cA,tb:$A},VA="request",$o="response",Qa=["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"],Lu=["e"],Uu=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function ks(A){return Uu.test(A)}function WA(A){return Qa.includes(A)||Lu.includes(A)||ks(A)}const Go=["d","dl","nor","ot","rtp","su"];function Vo(A){return Qa.includes(A)||Go.includes(A)||ks(A)}const ka=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function Wo(A){return Qa.includes(A)||Go.includes(A)||ka.includes(A)||ks(A)}const Zo=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function zo(A){return Zo.includes(A)||ks(A)}const Ru={[$o]:Wo,[Ho]:WA,[VA]:Vo};function fA(A,e={}){const t={};if(A==null||typeof A!="object")return t;const r=e.version||A.v||1,n=e.reportingMode||VA,i=r===1?zo:Ru[n];let s=Object.keys(A).filter(i);const a=e.filter;typeof a=="function"&&(s=s.filter(a));const c=n===$o||n===Ho;c&&!s.includes("ts")&&s.push("ts"),r>1&&!s.includes("v")&&s.push("v");const l=B({},Ko,e.formatters),g={version:r,reportingMode:n,baseUrl:e.baseUrl};return s.sort().forEach(p=>{let v=A[p];const x=l[p];if(typeof x=="function"&&(v=x(v,g)),p==="v"){if(r===1)return;v=r}p=="pr"&&v===1||(c&&p==="ts"&&!z(v)&&(v=Date.now()),Tu(v)&&(Su(p)&&typeof v=="string"&&(v=new Do(v)),t[p]=v))}),t}function jo(A,e={}){const t={};if(!A)return t;const r=fA(A,e),n=Fu(r,e==null?void 0:e.customHeaderMap);return Object.entries(n).reduce((i,[s,a])=>{const c=oi(a,{whitespace:!1});return c&&(i[s]=c),i},t)}function Yo(A,e,t){return B(A,jo(e,t))}const Qu="CMCD";function ku(A,e={}){return A?oi(fA(A,e),{whitespace:!1}):""}function Xo(A,e={}){if(!A)return"";const t=ku(A,e);return encodeURIComponent(t)}function Zs(A,e={}){if(!A)return"";const t=Xo(A,e);return`${Qu}=${t}`}const ZA=/CMCD=[^&#]+/;function zA(A,e,t){const r=Zs(e,t);if(!r)return A;if(ZA.test(A))return A.replace(ZA,r);const n=A.includes("?")?"&":"?";return`${A}${n}${r}`}class Ou{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:_i.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,a=this.hls.levels[i.level],c=this.getObjectType(i),l={d:(s||i).duration*1e3,ot:c};(c===_i.VIDEO||c===_i.AUDIO||c==_i.MUXED)&&(l.br=a.bitrate/1e3,l.tb=this.getTopBandwidth(c)/1e3,l.bl=this.getBufferLength(c));const g=s?this.getNextPart(s):this.getNextFrag(i);g!=null&&g.url&&g.url!==i.url&&(l.nor=g.url),this.apply(n,l)}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:HA.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===_i.INIT||t.ot===_i.VIDEO||t.ot===_i.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,a)=>(n.includes(a)&&(s[a]=t[a]),s),{}));const i={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),Yo(e.headers,t,i)):e.url=zA(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 a=i.length-1;a>=0;a--){const c=i[a];if(c.index===r&&c.fragment.sn===s)return i[a+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return _i.TIMED_TEXT;if(e.sn==="initSegment")return _i.INIT;if(t==="audio")return _i.AUDIO;if(t==="main")return this.hls.audioTracks.length?_i.VIDEO:_i.MUXED}getTopBandwidth(e){let t=0,r;const n=this.hls;if(e===_i.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===_i.AUDIO?this.audioBuffer:this.videoBuffer;return!r||!t?NaN:sr.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,a){t(i),this.loader.load(i,s,a)}}}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,a){t(i),this.loader.load(i,s,a)}}}}const Pu=3e5;class Mu extends G{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)===be.SendAlternateToPenaltyBox&&r.flags===st.MoveAllAlternatesMatchingHost){const n=this.levels;let i=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:a,pathwayId:c,type:l}=t.context;a&&n?s=this.getPathwayForGroupId(a,l,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===Y.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: ${Hr(i)} penalized: ${Hr(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]>Pu&&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 a=this.hls.nextLoadLevel,c=this.hls.levels[a];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,nA(t),this.hls.trigger(_.LEVELS_UPDATED,{levels:t});const l=this.hls.levels[a];c&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${l.bitrate}`),this.hls.nextLoadLevel=a);break}}}getPathwayForGroupId(e,t,r){const n=this.getLevelsForPathway(r).concat(this.levels||[]);for(let i=0;i<n.length;i++)if(t===ye.AUDIO_TRACK&&n[i].hasAudioGroup(e)||t===ye.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":a,"URI-REPLACEMENT":c}=i;if(t.some(g=>g.pathwayId===s))return;const l=this.getLevelsForPathway(a).map(g=>{const p=new hn(g.attrs);p["PATHWAY-ID"]=s;const v=p.AUDIO&&`${p.AUDIO}_clone_${s}`,x=p.SUBTITLES&&`${p.SUBTITLES}_clone_${s}`;v&&(r[p.AUDIO]=v,p.AUDIO=v),x&&(n[p.SUBTITLES]=x,p.SUBTITLES=x);const S=Oa(g.uri,p["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),O=new ei({attrs:p,audioCodec:g.audioCodec,bitrate:g.bitrate,height:g.height,name:g.name,url:S,videoCodec:g.videoCodec,width:g.width});if(g.audioGroups)for(let M=1;M<g.audioGroups.length;M++)O.addGroupId("audio",`${g.audioGroups[M]}_clone_${s}`);if(g.subtitleGroups)for(let M=1;M<g.subtitleGroups.length;M++)O.addGroupId("text",`${g.subtitleGroups[M]}_clone_${s}`);return O});t.push(...l),Jo(this.audioTracks,r,c,s),Jo(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(g){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(n.protocol!=="data:"){const g=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;n.searchParams.set("_HLS_pathway",this.pathwayId),n.searchParams.set("_HLS_throughput",""+g)}const i={responseType:"json",url:n.href},s=t.steeringManifestLoadPolicy.default,a=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(g,p,v,x)=>{this.log(`Loaded steering manifest: "${n}"`);const S=g.data;if((S==null?void 0:S.VERSION)!==1){this.log(`Steering VERSION ${S.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=S.TTL;const{"RELOAD-URI":O,"PATHWAY-CLONES":M,"PATHWAY-PRIORITY":ie}=S;if(O)try{this.uri=new self.URL(O,n).href}catch(_e){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${O}`);return}this.scheduleRefresh(this.uri||v.url),M&&this.clonePathways(M);const Be={steeringManifest:S,url:n.toString()};this.hls.trigger(_.STEERING_MANIFEST_LOADED,Be),ie&&this.updatePathwayPriority(ie)},onError:(g,p,v,x)=>{if(this.log(`Error loading steering manifest: ${g.code} ${g.text} (${p.url})`),this.stopLoad(),g.code===410){this.enabled=!1,this.log(`Steering manifest ${p.url} no longer available`);return}let S=this.timeToLoad*1e3;if(g.code===429){const O=this.loader;if(typeof(O==null?void 0:O.getResponseHeader)=="function"){const M=O.getResponseHeader("Retry-After");M&&(S=parseFloat(M)*1e3)}this.log(`Steering manifest ${p.url} rate limited`);return}this.scheduleRefresh(this.uri||p.url,S)},onTimeout:(g,p,v)=>{this.log(`Timeout loading steering manifest (${p.url})`),this.scheduleRefresh(this.uri||p.url)}};this.log(`Requesting steering manifest: ${n}`),this.loader.load(i,c,l)}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 Jo(A,e,t,r){A&&Object.keys(e).forEach(n=>{const i=A.filter(s=>s.groupId===n).map(s=>{const a=B({},s);return a.details=void 0,a.attrs=new hn(a.attrs),a.url=a.attrs.URI=Oa(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),a.groupId=a.attrs["GROUP-ID"]=e[n],a.attrs["PATHWAY-ID"]=r,a});A.push(...i)})}function Oa(A,e,t,r){const{HOST:n,PARAMS:i,[t]:s}=r;let a;e&&(a=s==null?void 0:s[e],a&&(A=a));const c=new self.URL(A);return n&&!a&&(c.host=n),i&&Object.keys(i).sort().forEach(l=>{l&&c.searchParams.set(l,i[l])}),c.href}function vi(A,e,t){Ri(A,e,t),A.addEventListener(e,t)}function Ri(A,e,t){A.removeEventListener(e,t)}class Os extends G{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=Os.CDMCleanupPromise?[Os.CDMCleanupPromise]:[],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=Di(this.config));const a=s.map(Ii).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(a)}this.keyFormatPromise.then(s=>{const a=ci(s);if(r!=="sinf"||a!==An.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${r}" for selected key-system ${a}`);return}let c;try{const x=nt(new Uint8Array(n)),S=Ei(JSON.parse(x).sinf),O=Pt(S);if(!O)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(O.subarray(8,24))}catch(x){this.warn(`${i} Failed to parse sinf: ${x}`);return}const l=q.hexDump(c),{keyIdToKeySessionPromise:g,mediaKeySessions:p}=this;let v=g[l];for(let x=0;x<p.length;x++){const S=p[x],O=S.decryptdata;if(!O.keyId)continue;const M=q.hexDump(O.keyId);if(l===M||O.uri.replace(/-/g,"").indexOf(l)!==-1){if(v=g[M],!v)continue;if(O.pssh)break;delete g[M],O.pssh=new Uint8Array(n),O.keyId=c,v=g[l]=v.then(()=>this.generateRequestWithPreferredKeySession(S,r,n,"encrypted-event-key-match")),v.catch(ie=>this.handleError(ie));break}}v||this.handleError(new Error(`Key ID ${l} not encountered in playlist. Key-system sessions ${p.length}.`))})}},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.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[e];if(n)return n.licenseUrl;if(e===An.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[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(s,a,c)=>!!s&&c.indexOf(s)===a,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,a)=>{const c=l=>{const g=l.shift();this.getMediaKeysPromise(g,n,i).then(p=>s({keySystem:g,mediaKeys:p})).catch(p=>{l.length?c(l):p instanceof xi?a(p):a(new xi({type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_ACCESS,error:p,fatal:!0},p.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 Oi===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){const n=wi(e,t,r,this.config.drmSystemOptions),i=this.keySystemAccessPromises[e];let s=i==null?void 0:i.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${Hr(n)}`),s=this.requestMediaKeySystemAccess(e,n);const a=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const l=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),a.mediaKeys=c.createMediaKeys().then(g=>(this.log(`Media-keys created for "${e}"`),a.hasMediaKeys=!0,l.then(p=>p?this.setMediaKeysServerCertificate(g,e,p):g))),a.mediaKeys.catch(g=>{this.error(`Failed to create media-keys for "${e}"}: ${g}`)}),a.mediaKeys})}return s.then(()=>i.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${q.hexDump(e.keyId||[])}`);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=this.getKeyIdString(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)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return q.hexDump(e.keyId)}updateKeySession(e,t){var r;const n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyID ${q.hexDump(((r=e.decryptdata)==null?void 0:r.keyId)||[])}
} (data length: ${t&&t.byteLength})`),n.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>Ii(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=Ii(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=Di(this.config),r=e.map(ci).filter(n=>!!n&&t.indexOf(n)!==-1);return this.selectKeySystem(r)}loadKey(e){const t=e.keyInfo.decryptdata,r=this.getKeyIdString(t),n=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${n}`);let i=this.keyIdToKeySessionPromise[r];return i||(i=this.getKeySystemForKeyPromise(t).then(({keySystem:a,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${n}`),this.attemptSetMediaKeys(a,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:a,mediaKeys:c,decryptdata:t}))))),(this.keyIdToKeySessionPromise[r]=i.then(a=>{const c="cenc",l=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(a,c,l,"playlist-key")})).catch(a=>this.handleError(a))),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof xi?this.hls.trigger(_.ERROR,e.data):this.hls.trigger(_.ERROR,{type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),r=this.keyIdToKeySessionPromise[t];if(!r){const n=ci(e.keyFormat),i=n?[n]:Di(this.config);return this.attemptKeySystemAccess(i)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=Di(this.config)),e.length===0)throw new xi({type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Hr({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const n=Promise.all(r).then(()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});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 x=s.call(this.hls,t,r,e);if(!x)throw new Error("Invalid response from configured generateRequest filter");t=x.initDataType,r=x.initData?x.initData:null,e.decryptdata.pssh=r?new Uint8Array(r):null}catch(x){var a;if(this.warn(x.message),(a=this.hls)!=null&&a.config.debug)throw x}if(r===null)return this.log(`Skipping key-session request for "${n}" (no initData)`),Promise.resolve(e);const c=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${n}": ${c} (init data type: ${t} length: ${r?r.byteLength:null})`);const l=new cs,g=e._onmessage=x=>{const S=e.mediaKeysSession;if(!S){l.emit("error",new Error("invalid state"));return}const{messageType:O,message:M}=x;this.log(`"${O}" message event for session "${S.sessionId}" message size: ${M.byteLength}`),O==="license-request"||O==="license-renewal"?this.renewLicense(e,M).catch(ie=>{l.eventNames().length?l.emit("error",ie):this.handleError(ie)}):O==="license-release"?e.keySystem===An.FAIRPLAY&&(this.updateKeySession(e,zn("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${O}"`)},p=e._onkeystatuseschange=x=>{if(!e.mediaKeysSession){l.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const O=e.keyStatus;l.emit("keyStatus",O),O==="expired"&&(this.warn(`${e.keySystem} expired for key ${c}`),this.renewKeySession(e))};vi(e.mediaKeysSession,"message",g),vi(e.mediaKeysSession,"keystatuseschange",p);const v=new Promise((x,S)=>{l.on("error",S),l.on("keyStatus",O=>{O.startsWith("usable")?x():O==="output-restricted"?S(new xi({type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):O==="internal-error"?S(new xi({type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${O}"`)):O==="expired"?S(new Error("key expired while generating request")):this.warn(`unhandled key status change "${O}"`)})});return e.mediaKeysSession.generateRequest(t,r).then(()=>{var x;this.log(`Request generated for key-session "${(x=e.mediaKeysSession)==null?void 0:x.sessionId}" keyId: ${c}`)}).catch(x=>{throw new xi({type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_SESSION,error:x,fatal:!1},`Error generating key-session request: ${x}`)}).then(()=>v).catch(x=>{throw l.removeAllListeners(),this.removeSession(e),x}).then(()=>(l.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,r)=>{if(typeof r=="string"&&typeof t=="object"){const n=r;r=t,t=n}this.log(`key status change "${t}" for keyStatuses keyId: ${q.hexDump("buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r))} session keyId: ${q.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=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,a)=>{const c={responseType:"arraybuffer",url:i},l=t.certLoadPolicy.default,g={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},p={onSuccess:(v,x,S,O)=>{s(v.data)},onError:(v,x,S,O)=>{a(new xi({type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:S,response:C({url:c.url,data:void 0},v)},`"${e}" certificate request failed (${i}). Status: ${v.code} (${v.text})`))},onTimeout:(v,x,S)=>{a(new xi({type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:S,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(v,x,S)=>{a(new Error("aborted"))}};n.load(c,g,p)})):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==null?void 0:r.byteLength}) on "${t}"`),n(e)}).catch(s=>{i(new xi({type:ve.KEY_SYSTEM_ERROR,details:Y.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 xi({type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:n,fatal:!0},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 g;for(let p=0,v=i.length;p<v;p++){var s,a;g=i[p];const x=(s=g.querySelector("name"))==null?void 0:s.textContent,S=(a=g.querySelector("value"))==null?void 0:a.textContent;x&&S&&e.setRequestHeader(x,S)}}const c=n.querySelector("Challenge"),l=c==null?void 0:c.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return zn(atob(l))}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 a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(a.readyState===4)if(a.status===200){this._requestLicenseFailureCount=0;let c=a.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const l=this.config.licenseResponseCallback;if(l)try{c=l.call(this.hls,a,s,e)}catch(g){this.error(g)}n(c)}else{const c=r.errorRetry,l=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)i(new xi({type:ve.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:s,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${s}). Status: ${a.status} (${a.statusText})`));else{const g=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${g} attempts left`),this.requestLicense(e,t).then(n,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,s,e,t).then(({xhr:c,licenseChallenge:l})=>{e.keySystem==An.PLAYREADY&&(l=this.unpackPlayReadyKeyMessage(c,l)),c.send(l)})})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,vi(r,"encrypted",this.onMediaEncrypted),vi(r,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(Ri(e,"encrypted",this.onMediaEncrypted),Ri(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const t=this.media,r=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,xn.clearKeyUriToKeyIdMap();const n=r.length;Os.CDMCleanupPromise=Promise.all(r.map(i=>this.removeSession(i)).concat(t==null||(e=t.setMediaKeys(null))==null?void 0:e.catch(i=>{var s;this.log(`Could not clear media keys: ${i}`),(s=this.hls)==null||s.trigger(_.ERROR,{type:ve.OTHER_ERROR,details:Y.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${i}`)})}))).catch(i=>{var s;this.log(`Could not close sessions and clear media keys: ${i}`),(s=this.hls)==null||s.trigger(_.ERROR,{type:ve.OTHER_ERROR,details:Y.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${i}`)})}).then(()=>{n&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this.keyFormatPromise=null}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}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),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 n=this.mediaKeySessions.indexOf(e);n>-1&&this.mediaKeySessions.splice(n,1);const{drmSystemOptions:i}=this.config;return(pr(i)?new Promise((a,c)=>{self.setTimeout(()=>c(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(a)}):Promise.resolve()).catch(a=>{var c;this.log(`Could not remove session: ${a}`),(c=this.hls)==null||c.trigger(_.ERROR,{type:ve.OTHER_ERROR,details:Y.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${a}`)})}).then(()=>t.close()).catch(a=>{var c;this.log(`Could not close session: ${a}`),(c=this.hls)==null||c.trigger(_.ERROR,{type:ve.OTHER_ERROR,details:Y.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${a}`)})})}}}Os.CDMCleanupPromise=void 0;class xi 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}}class qo{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,a=t-this.lastDecodedFrames,c=1e3*s/i,l=this.hls;if(l.trigger(_.FPS_DROP,{currentDropped:s,currentDecoded:a,totalDroppedFrames:r}),c>0&&s>l.config.fpsDroppedMonitoringThreshold*a){let g=l.currentLevel;l.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+g),g>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=g)&&(g=g-1,l.trigger(_.FPS_DROP_LEVEL_CAPPING,{level:g,droppedLevel:l.currentLevel}),l.autoLevelCapping=g,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 Pa(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 el(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){le.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){le.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 zs(A,e,t,r){const n=A.mode;if(n==="disabled"&&(A.mode="hidden"),A.cues&&A.cues.length>0){const i=rl(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 tl(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 rl(A,e,t){const r=[],n=tl(A,e);if(n>-1)for(let i=n,s=A.length;i<s;i++){const a=A[i];if(a.startTime>=e&&a.endTime<=t)r.push(a);else if(a.startTime>t)return r}return r}function jA(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 nl extends NA{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=jA(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;jA(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 a=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,a)}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(g=>!r||r.indexOf(g.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(g=>g.default)&&(this.selectDefaultTrack=!1),s.forEach((g,p)=>{g.id=p});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const a=this.hls.config.subtitlePreference;if(!i&&a){this.selectDefaultTrack=!1;const g=tt(a,s);if(g>-1)i=s[g];else{const p=tt(a,this.tracks);i=this.tracks[p]}}let c=this.findTrackId(i);c===-1&&i&&(c=this.findTrackId(null));const l={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,l),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||wt(i,e)))return n}if(e){for(let n=0;n<t.length;n++){const i=t[n];if(Rs(e.attrs,i.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<t.length;n++){const i=t[n];if(Rs(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(Ba(n,e))return r}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===ye.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&&wt(e,r))return r;const n=tt(e,this.tracksInGroup);if(n>-1){const i=this.tracksInGroup[n];return this.setSubtitleTrack(n),i}else{if(r)return null;{const i=tt(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,a=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:""}${a&&s.live?" age "+a.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=jA(e.textTracks),r=this.currentTrack;let n;if(r&&(n=t.filter(i=>Ba(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||!z(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:a="",name:c,type:l,url:g}=n;this.hls.trigger(_.SUBTITLE_TRACK_SWITCH,{id:s,groupId:a,name:c,type:l,url:g});const p=this.switchParams(n.url,r==null?void 0:r.details,n.details);this.loadPlaylist(p)}}function il(){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 hA(A){let e=5381,t=A.length;for(;t;)e=e*33^A.charCodeAt(--t);return(e>>>0).toString()}const js=.025;let ds=function(A){return A[A.Point=0]="Point",A[A.Range=1]="Range",A}({});function sl(A,e,t){return`${A.identifier}-${t+1}-${hA(e)}`}class qn{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 gs(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=gs(t,e);return t-r<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=z(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 gs(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"?ds.Range:ds.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 xs(this)}}function gs(A,e){return A-e.start<e.duration/2&&!(Math.abs(A-(e.start+e.duration))<js)?e.start:e.start+e.duration}function Ps(A,e,t){const r=new self.URL(A,t);return r.protocol!=="data:"&&r.searchParams.set("_HLS_primary_id",e),r}function rs(A,e){for(;(t=A.assetList[++e])!=null&&t.error;)var t;return e}function xs(A){return`["${A.identifier}" ${A.cue.pre?"<pre>":A.cue.post?"<post>":""}${A.timelineStart.toFixed(2)}-${A.resumeTime.toFixed(2)}]`}function ns(A){const e=A.timelineStart,t=A.duration||0;return`["${A.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class ps{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,(a,{media:c})=>{this.removeMediaListeners(),this.mediaAttached=c,this.interstitial.playoutLimit&&(c.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&i.on(_.BUFFER_APPENDED,()=>{const g=this.bufferedEnd;this.reachedPlayout(g)&&(this._bufferedEosTime=g,i.trigger(_.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e&&!e.url){let t=this.assetItem.uri;try{t=Ps(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=this._bufferedEosTime||this.duration,n=this.timelineOffset,i=sr.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=sr.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;return e||0}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: ${ns(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const Ma=.033;class Al extends G{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 a=s.timelineStart;if(t===a||t>a&&(t<a+(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),a=Object.keys(n),c=i?i.filter(l=>!a.includes(l.identifier)):[];s.length&&s.sort((l,g)=>{const p=l.cue.pre,v=l.cue.post,x=g.cue.pre,S=g.cue.post;if(p&&!x)return-1;if(x&&!p||v&&!S)return 1;if(S&&!v)return-1;if(!p&&!x&&!v&&!S){const O=l.startTime,M=g.startTime;if(O!==M)return O-M}return l.dateRange.tagOrder-g.dateRange.tagOrder}),this.events=s,c.forEach(l=>{this.removeEvent(l)}),this.updateSchedule(e,c)}updateSchedule(e,t=[]){const r=this.events||[];if(r.length||t.length||this.length<2){const n=this.items,i=this.parseSchedule(r,e);(t.length||(n==null?void 0:n.length)!==i.length||i.some((a,c)=>Math.abs(a.playout.start-n[c].playout.start)>.005||Math.abs(a.playout.end-n[c].playout.end)>.005))&&(this.items=i,this.onScheduleUpdate(t,n))}}parseDateRanges(e,t,r){const n=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const a=i[s],c=e[a];if(c.isInterstitial){let l=this.eventMap[a];l?l.setDateRange(c):(l=new qn(c,t),this.eventMap[a]=l,r===!1&&(l.appendInPlace=r)),n.push(l)}}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,l=0;if(e.forEach((g,p)=>{const v=g.cue.pre,x=g.cue.post,S=e[p-1]||null,O=g.appendInPlace,M=x?i:g.startOffset,ie=g.duration,Be=g.timelineOccupancy===ds.Range?ie:0,_e=g.resumptionOffset,Qe=(S==null?void 0:S.startTime)===M,We=M+g.cumulativeDuration;let _t=O?We+ie:M+_e;if(v||!x&&M<=0){const at=l;l+=Be,g.timelineStart=We;const ft=s;s+=ie,r.push({event:g,start:We,end:_t,playout:{start:ft,end:s},integrated:{start:at,end:l}})}else if(M<=i){if(!Qe){const ze=M-c;if(ze>Ma){const Lt=c,lr=l;l+=ze;const br=s;s+=ze;const Or={previousEvent:e[p-1]||null,nextEvent:g,start:Lt,end:Lt+ze,playout:{start:br,end:s},integrated:{start:lr,end:l}};r.push(Or)}else ze>0&&S&&(S.cumulativeDuration+=ze,r[r.length-1].end=M)}x&&(_t=We),g.timelineStart=We;const at=l;l+=Be;const ft=s;s+=ie,r.push({event:g,start:We,end:_t,playout:{start:ft,end:s},integrated:{start:at,end:l}})}else return;const Ge=g.resumeTime;x||Ge>i?c=i:c=Ge}),c<i){var a;const g=c,p=l,v=i-c;l+=v;const x=s;s+=v,r.push({previousEvent:((a=r[r.length-1])==null?void 0:a.event)||null,nextEvent:null,start:c,end:g+v,playout:{start:x,end:s},integrated:{start:p,end:l}})}this.setDurations(i,s,l)}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((a,c)=>{const l=a.cue.pre,g=a.cue.post,p=l?0:g?n:a.startTime;this.updateAssetDurations(a),s===p?a.cumulativeDuration=i:(i=0,s=p),!g&&a.snapOptions.in&&(a.resumeAnchor=Dr(null,r.fragments,a.startOffset+a.resumptionOffset,0,0)||void 0),a.appendInPlace&&!a.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(a,t)||(a.appendInPlace=!1)),!a.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<Ma&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${a}`));const x=z(a.resumeOffset)?a.resumeOffset:a.duration;i+=x})}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):t?!Object.keys(t).some(s=>{const a=t[s].details,c=a.edge;if(r>=c)return this.log(`"${e.identifier}" resumption ${r} past ${s} playlist end ${c}`),!1;const l=Dr(null,a.fragments,r);if(!l)return this.log(`"${e.identifier}" resumption ${r} does not align with any fragments in ${s} playlist (${a.fragStart}-${a.fragmentEnd})`),!0;const g=s==="audio"?.175:0;return Math.abs(l.start-r)<js+g||Math.abs(l.end-r)<js+g?!1:(this.log(`"${e.identifier}" resumption ${r} not aligned with ${s} fragment bounds (${l.start}-${l.end} sn: ${l.sn} cc: ${l.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${r} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let r=0,n=!1,i=!1;e.assetList.forEach((s,a)=>{const c=t+r;s.startOffset=r,s.timelineStart=c,n||(n=s.duration===null),i||(i=!!s.error);const l=s.error?0:s.duration||0;r+=l}),n&&!i?e.duration=Math.max(r,e.duration):e.duration=r}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function ms(A){return`[${A.event?'"'+A.event.identifier+'"':"primary"}: ${A.start.toFixed(2)}-${A.end.toFixed(2)}]`}class Na{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const r=e.assetListUrl;let n;try{n=Ps(r,this.hls.sessionId,e.baseUrl)}catch(v){const x=this.assignAssetListError(e,Y.ASSET_LIST_LOAD_ERROR,v,r);this.hls.trigger(_.ERROR,x);return}t&&n.protocol!=="data:"&&n.searchParams.set("_HLS_start_offset",""+t);const i=this.hls.config,s=i.loader,a=new s(i),c={responseType:"json",url:n.href},l=i.interstitialAssetListLoadPolicy.default,g={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},p={onSuccess:(v,x,S,O)=>{const M=v.data,ie=M==null?void 0:M.ASSETS;if(!Array.isArray(ie)){const Be=this.assignAssetListError(e,Y.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),S.url,x,O);this.hls.trigger(_.ERROR,Be);return}e.assetListResponse=M,this.hls.trigger(_.ASSET_LIST_LOADED,{event:e,assetListResponse:M,networkDetails:O})},onError:(v,x,S,O)=>{const M=this.assignAssetListError(e,Y.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${v.code} ${v.text} (${x.url})`),x.url,O,S);this.hls.trigger(_.ERROR,M)},onTimeout:(v,x,S)=>{const O=this.assignAssetListError(e,Y.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${x.url})`),x.url,v,S);this.hls.trigger(_.ERROR,O)}};return a.load(c,g,p),this.hls.trigger(_.ASSET_LIST_LOADING,{event:e}),a}assignAssetListError(e,t,r,n,i,s){return e.error=r,{type:ve.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:n,error:r,networkDetails:s,stats:i}}}function Ys(A){A==null||A.play().catch(()=>{})}class al extends G{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 a=this.playingItem;if(!a){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(r,r-n)&&this.updateSchedule(),this.checkBuffer(),s&&r<a.start||r>=a.end){var c;const v=this.findItemIndex(a);let x=this.schedule.findItemIndexAtTime(r);if(x===-1&&(x=v+(s?-1:1),this.log(`seeked ${s?"back ":""}to position not covered by schedule ${r} (resolving from ${v} to ${x})`)),!this.isInterstitial(a)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s&&x>v){const S=this.schedule.findJumpRestrictedIndex(v+1,x);if(S>v){this.setSchedulePosition(S);return}}this.setSchedulePosition(x);return}const l=this.playingAsset;if(!l){if(this.playingLastItem&&this.isInterstitial(a)){const v=a.event.assetList[0];v&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(r,v))}return}const g=l.timelineStart,p=l.duration||0;(s&&r<g||r>=g+p)&&this.setScheduleToAssetAtTime(r,l)},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 a=this.findItemIndex(n);this.setSchedulePosition(a+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,a=i.events||[],c=i.items||[],l=i.durations,g=r.map(O=>O.identifier),p=!!(a.length||g.length);(p||n)&&this.log(`INTERSTITIALS_UPDATED (${a.length}): ${a}
Schedule: ${c.map(O=>ms(O))} pos: ${this.timelinePos}`),g.length&&this.log(`Removed events ${g}`);let v=null,x=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 S=this.bufferingItem;if(S&&(x=this.updateItem(S,this.bufferedPos),this.itemsMatch(S,x)?this.bufferingItem=x:S.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(S.event,null))),r.forEach(O=>{O.assetList.forEach(M=>{this.clearAssetPlayer(M.identifier,null)})}),this.playerQueue.forEach(O=>{if(O.interstitial.appendInPlace){const M=O.assetItem.timelineStart,ie=O.timelineOffset-M;if(ie)try{O.timelineOffset=M}catch(Be){Math.abs(ie)>js&&this.warn(`${Be} ("${O.assetId}" ${O.timelineOffset}->${M})`)}}}),p||n){if(this.hls.trigger(_.INTERSTITIALS_UPDATED,{events:a.slice(0),schedule:c.slice(0),durations:l,removedIds:g}),this.isInterstitial(s)&&g.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}s&&this.trimInPlace(v,s),S&&this.trimInPlace(x,S),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Na(e),this.schedule=new Al(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){Ri(e,"play",this.onPlay),Ri(e,"pause",this.onPause),Ri(e,"seeking",this.onSeeking),Ri(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const r=this.media=t.media;vi(r,"seeking",this.onSeeking),vi(r,"timeupdate",this.onTimeupdate),vi(r,"play",this.onPlay),vi(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.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.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=p=>p&&e.getAssetPlayer(p.identifier),n=(p,v,x,S,O)=>{if(p){let M=p[v].start;const ie=p.event;if(ie){if(v==="playout"||ie.timelineOccupancy!==ds.Point){const Be=r(x);(Be==null?void 0:Be.interstitial)===ie&&(M+=Be.assetItem.startOffset+Be[O])}}else{const Be=S==="bufferedPos"?s():e[S];M+=Be-p.start}return M}return 0},i=(p,v)=>{var x;if(p!==0&&v!=="primary"&&(x=e.schedule)!=null&&x.length){var S;const O=e.schedule.findItemIndexAtTime(p),M=(S=e.schedule.items)==null?void 0:S[O];if(M){const ie=M[v].start-M.start;return p+ie}}return p},s=()=>{const p=e.bufferedPos;return p===Number.MAX_VALUE?a("primary"):Math.max(p,0)},a=p=>{var v,x;return(v=e.primaryDetails)!=null&&v.live?e.primaryDetails.edge:((x=e.schedule)==null?void 0:x.durations[p])||0},c=(p,v)=>{var x,S;const O=e.effectivePlayingItem;if(O!=null&&(x=O.event)!=null&&x.restrictions.skip||!e.schedule)return;e.log(`seek to ${p} "${v}"`);const M=e.effectivePlayingItem,ie=e.schedule.findItemIndexAtTime(p,v),Be=(S=e.schedule.items)==null?void 0:S[ie],_e=e.getBufferingPlayer(),Qe=_e==null?void 0:_e.interstitial,We=Qe==null?void 0:Qe.appendInPlace,_t=M&&e.itemsMatch(M,Be);if(M&&(We||_t)){const Ge=r(e.playingAsset),at=(Ge==null?void 0:Ge.media)||e.primaryMedia;if(at){const ft=v==="primary"?at.currentTime:n(M,v,e.playingAsset,"timelinePos","currentTime"),ze=p-ft,Lt=(We?ft:at.currentTime)+ze;if(Lt>=0&&(!Ge||We||Lt<=Ge.duration)){at.currentTime=Lt;return}}}if(Be){let Ge=p;if(v!=="primary"){const ft=Be[v].start,ze=p-ft;Ge=Be.start+ze}const at=!e.isInterstitial(Be);if((!e.isInterstitial(M)||M.event.appendInPlace)&&(at||Be.event.appendInPlace)){const ft=e.media||(We?_e==null?void 0:_e.media:null);ft&&(ft.currentTime=Ge)}else if(M){const ft=e.findItemIndex(M);if(ie>ft){const Lt=e.schedule.findJumpRestrictedIndex(ft+1,ie);if(Lt>ft){e.setSchedulePosition(Lt);return}}let ze=0;if(at)e.timelinePos=Ge,e.checkBuffer();else{const Lt=Be.event.assetList,lr=p-(Be[v]||Be).start;for(let br=Lt.length;br--;){const Or=Lt[br];if(Or.duration&&lr>=Or.startOffset&&lr<Or.startOffset+Or.duration){ze=br;break}}}e.setSchedulePosition(ie,ze)}}},l=()=>{const p=e.effectivePlayingItem;if(e.isInterstitial(p))return p;const v=t();return e.isInterstitial(v)?v:null},g={get bufferedEnd(){const p=t(),v=e.bufferingItem;if(v&&v===p){var x;return n(v,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-v.playout.start||((x=e.bufferingAsset)==null?void 0:x.startOffset)||0}return 0},get currentTime(){const p=l(),v=e.effectivePlayingItem;return v&&v===p?n(v,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-v.playout.start:0},set currentTime(p){const v=l(),x=e.effectivePlayingItem;x&&x===v&&c(p+x.playout.start,"playout")},get duration(){const p=l();return p?p.playout.end-p.playout.start:0},get assetPlayers(){var p;const v=(p=l())==null?void 0:p.event.assetList;return v?v.map(x=>e.getAssetPlayer(x.identifier)):[]},get playingIndex(){var p;const v=(p=l())==null?void 0:p.event;return v&&e.effectivePlayingAsset?v.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return l()}};return this.manager={get events(){var p;return((p=e.schedule)==null||(p=p.events)==null?void 0:p.slice(0))||[]},get schedule(){var p;return((p=e.schedule)==null||(p=p.items)==null?void 0:p.slice(0))||[]},get interstitialPlayer(){return l()?g:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const p=t();return e.findItemIndex(p)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const p=e.effectivePlayingItem;return e.findItemIndex(p)},primary:{get bufferedEnd(){return s()},get currentTime(){const p=e.timelinePos;return p>0?p:0},set currentTime(p){c(p,"primary")},get duration(){return a("primary")},get seekableStart(){var p;return((p=e.primaryDetails)==null?void 0:p.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(p){c(p,"integrated")},get duration(){return a("integrated")},get seekableStart(){var p;return i(((p=e.primaryDetails)==null?void 0:p.fragmentStart)||0,"integrated")}},skip:()=>{const p=e.effectivePlayingItem,v=p==null?void 0:p.event;if(v&&!v.restrictions.skip){const x=e.findItemIndex(p);if(v.appendInPlace){const S=p.playout.start+p.event.duration;c(S+.001,"playout")}else e.advanceAfterAssetEnded(v,x,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||!z(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} ${Hr(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,a=e!==s,c=a&&e.interstitial.appendInPlace,l=(r=this.detachedData)==null?void 0:r.mediaSource;let g;if(s.media)c&&(i=s.transferMedia(),this.detachedData=i),g="Primary";else if(l){const S=this.getBufferingPlayer();S?(i=S.transferMedia(),g=`${S}`):g="detached MediaSource"}else g="detached media";if(!i){if(l)i=this.detachedData,this.log(`using detachedData: MediaSource ${Hr(i)}`);else if(!this.detachedData||s.media===t){const S=this.playerQueue;S.length>1&&S.forEach(O=>{if(a&&O.interstitial.appendInPlace!==c){const M=O.interstitial;this.clearInterstitial(O.interstitial,null),M.appendInPlace=!1,M.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${M}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const p=i&&"mediaSource"in i&&((n=i.mediaSource)==null?void 0:n.readyState)!=="closed",v=p&&i?i:t;this.log(`${p?"transfering MediaSource":"attaching media"} to ${a?e:"Primary"} from ${g} (media.currentTime: ${t.currentTime})`);const x=this.schedule;if(v===i&&x){const S=a&&e.assetId===x.assetIdAtEnd;v.overrides={duration:x.duration,endOfStream:!a||S,cueRemoval:!a}}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.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,a=e.findItemIndexAtTime(s);this.setSchedulePosition(a)}}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=rs(r,n);if(!r.isAssetPastPlayoutLimit(i))this.bufferedToEvent(e,i);else if(this.schedule){var s;const a=(s=this.schedule.items)==null?void 0:s[this.findItemIndex(e)+1];a&&this.bufferedToItem(a)}}advanceAfterAssetEnded(e,t,r){const n=rs(e,r);if(e.isAssetPastPlayoutLimit(n)){if(this.schedule){const i=this.schedule.items;if(i){const s=t+1,a=i.length;if(s>=a){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<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),a=r.findAssetIndex(i,e);this.advanceAfterAssetEnded(i,s,a-1)}}setSchedulePosition(e,t){var r;const n=(r=this.schedule)==null?void 0:r.items;if(!n||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const i=e>=0?n[e]:null,s=this.waitingItem||this.playingItem,a=this.playingLastItem;if(this.isInterstitial(s)){const g=s.event,p=this.playingAsset,v=p==null?void 0:p.identifier,x=v?this.getAssetPlayer(v):null;if(x&&v&&(!this.eventItemsMatch(s,i)||t!==void 0&&v!==g.assetList[t].identifier)){var c;const S=g.findAssetIndex(p);if(this.log(`INTERSTITIAL_ASSET_ENDED ${S+1}/${g.assetList.length} ${ns(p)}`),this.endedAsset=p,this.playingAsset=null,this.hls.trigger(_.INTERSTITIAL_ASSET_ENDED,{asset:p,assetListIndex:S,event:g,schedule:n.slice(0),scheduleIndex:e,player:x}),s!==this.playingItem){this.itemsMatch(s,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(g,this.findItemIndex(this.playingItem),S);return}this.retreiveMediaSource(v,i),x.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&x.detachMedia()}if(!this.eventItemsMatch(s,i)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${g} ${ms(s)}`),g.hasPlayed=!0,this.hls.trigger(_.INTERSTITIAL_ENDED,{event:g,schedule:n.slice(0),scheduleIndex:e}),g.cue.once)){var l;this.updateSchedule();const S=(l=this.schedule)==null?void 0:l.items;if(i&&S){const O=this.findItemIndex(i);this.advanceSchedule(O,S,t,s,a)}return}}this.advanceSchedule(e,n,t,s,a)}advanceSchedule(e,t,r,n,i){const s=this.schedule;if(!s)return;const a=e>=0?t[e]:null,c=this.primaryMedia,l=this.playerQueue;if(l.length&&l.forEach(g=>{const p=g.interstitial,v=s.findEventIndex(p.identifier);(v<e||v>e+1)&&this.clearInterstitial(p,a)}),this.isInterstitial(a)){this.timelinePos=Math.min(Math.max(this.timelinePos,a.start),a.end);const g=a.event;if(r===void 0){r=s.findAssetIndex(g,this.timelinePos);const S=rs(g,r-1);if(g.isAssetPastPlayoutLimit(S)||g.appendInPlace&&this.timelinePos===a.end){this.advanceAfterAssetEnded(g,e,r);return}r=S}const p=this.waitingItem;this.assetsBuffered(a,c)||this.setBufferingItem(a);let v=this.preloadAssets(g,r);if(this.eventItemsMatch(a,p||n)||(this.waitingItem=a,this.log(`INTERSTITIAL_STARTED ${ms(a)} ${g.appendInPlace?"append in place":""}`),this.hls.trigger(_.INTERSTITIAL_STARTED,{event:g,schedule:t.slice(0),scheduleIndex:e})),!g.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${g}`);return}if(g.assetListLoader&&(g.assetListLoader.destroy(),g.assetListLoader=void 0),!c){this.log(`Waiting for attachMedia to start Interstitial ${g}`);return}this.waitingItem=this.endedItem=null,this.playingItem=a;const x=g.assetList[r];if(!x){this.advanceAfterAssetEnded(g,e,r||0);return}if(v||(v=this.getAssetPlayer(x.identifier)),v===null||v.destroyed){const S=g.assetList.length;this.warn(`asset ${r+1}/${S} player destroyed ${g}`),v=this.createAssetPlayer(g,x,r),v.loadSource()}if(!this.eventItemsMatch(a,this.bufferingItem)&&g.appendInPlace&&this.isAssetBuffered(x))return;this.startAssetPlayer(v,r,t,e,c),this.shouldPlay&&Ys(v.media)}else a!==null?(this.resumePrimary(a,e,n),this.shouldPlay&&Ys(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 ${ms(e)}`),!((n=this.detachedData)!=null&&n.mediaSource)){let a=this.timelinePos;(a<e.start||a>=e.end)&&(a=this.getPrimaryResumption(e,t),this.timelinePos=a),this.attachPrimary(a,e)}if(!r)return;const s=(i=this.schedule)==null?void 0:i.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${ms(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:sr.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.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],n=C(C({},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=C(C({},this.altSelection),{},{audio:r});return}const i=C(C({},n),{},{audio:r});this.mediaSelection=i}onSubtitleTrackUpdated(e,t){const r=this.hls.subtitleTracks[t.id],n=this.mediaSelection;if(!n){this.altSelection=C(C({},this.altSelection),{},{subtitles:r});return}const i=C(C({},n),{},{subtitles:r});this.mediaSelection=i}onAudioTrackSwitching(e,t){const r=Ne(t);this.playerQueue.forEach(({hls:n})=>n&&(n.setAudioOption(t)||n.setAudioOption(r)))}onSubtitleTrackSwitch(e,t){const r=Ne(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),a=(r=this.schedule.items)==null?void 0:r[s];this.isInterstitial(a)&&this.eventItemsMatch(a,this.bufferingItem)&&this.bufferedToItem(a,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=sr.bufferInfo(this.primaryMedia,r,0);(n.end>r||(n.nextStart||0)>r)&&(this.attachPrimary(r,null),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(){var e;const t=this.mediaSelection;t&&((e=this.schedule)==null||e.updateSchedule(t,[]))}checkBuffer(e){var t;const r=(t=this.schedule)==null?void 0:t.items;if(!r)return;const n=sr.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,a=this.findItemIndex(s);let c=n.findItemIndexAtTime(e);if(this.bufferedPos<e){var l;const g=this.findItemIndex(i),p=Math.min(g+1,t.length-1),v=t[p];if((c===-1&&i&&e>=i.end||(l=v.event)!=null&&l.appendInPlace&&e+.01>=v.start)&&(c=p),this.isInterstitial(i)){const x=i.event;if(p-a>1&&x.appendInPlace===!1||x.assetList.length===0&&x.assetListLoader)return}if(this.bufferedPos=e,c>g&&c>a)this.bufferedToItem(v);else{const x=this.primaryDetails;this.primaryLive&&x&&e>x.edge-x.targetduration&&v.start<x.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(v)&&this.preloadAssets(v.event,0)}}else r&&s&&!this.itemsMatch(s,i)&&(c===a?this.bufferedToItem(s):c===a+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),a=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=a?a.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${ms(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(s){const l=r.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((g,p)=>{const v=this.getAssetPlayer(g.identifier);v&&(p===l&&v.loadSource(),v.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(l=>l.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 a=this.primaryMedia;a&&this.bufferAssetPlayer(s,a)}}}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 a;const v=this.playingItem;!this.isInterstitial(v)&&(v==null||(a=v.nextEvent)==null?void 0:a.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let l,g=0;if(!this.playingItem&&this.primaryLive&&(g=this.hls.startPosition,g===-1&&(g=this.hls.liveSyncPosition||0)),g&&!(e.cue.pre||e.cue.post)){const v=g-c;v>0&&(l=Math.round(v*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${r?1:n} ${e}${l?` live-start: ${g} start-offset: ${l}`:""}`),r)return this.createAsset(e,0,0,c,e.duration,r);const p=this.assetListLoader.loadAssetList(e,l);p&&(e.assetListLoader=p)}else if(!s&&n){for(let l=t;l<n;l++){const g=e.assetList[l],p=this.getAssetPlayerQueueIndex(g.identifier);(p===-1||this.playerQueue[p].destroyed)&&!g.error&&this.createAssetPlayer(e,g,l)}const c=e.assetList[t];if(c){const l=this.getAssetPlayer(c.identifier);return l&&l.loadSource(),l}}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 a={parentIdentifier:e.identifier,identifier:sl(e,s,t),duration:i,startOffset:r,timelineStart:n,uri:s};return this.createAssetPlayer(e,a,t)}createAssetPlayer(e,t,r){const n=this.hls,i=n.userConfig;let s=i.videoPreference;const a=n.loadLevelObj||n.levels[n.currentLevel];(s||a)&&(s=B({},s),a.videoCodec&&(s.videoCodec=a.videoCodec),a.videoRange&&(s.allowedVideoRanges=[a.videoRange]));const c=n.audioTracks[n.audioTrack],l=n.subtitleTracks[n.subtitleTrack];let g=0;if(this.primaryLive||e.appendInPlace){const Qe=this.timelinePos-t.timelineStart;if(Qe>1){const We=t.duration;We&&Qe<We&&(g=Qe)}}const p=t.identifier,v=C(C({},i),{},{maxMaxBufferLength:Math.min(180,n.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:n.sessionId,assetPlayerId:p,abrEwmaDefaultEstimate:n.bandwidthEstimate,interstitialsController:void 0,startPosition:g,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||i.audioPreference,subtitlePreference:l||i.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(v.timelineOffset=t.timelineStart));const x=v.cmcd;x!=null&&x.sessionId&&x.contentId&&(v.cmcd=B({},x,{contentId:hA(t.uri)})),this.getAssetPlayer(p)&&this.warn(`Duplicate date range identifier ${e} and asset ${p}`);const S=new ps(this.HlsPlayerClass,v,e,t);this.playerQueue.push(S),e.assetList[r]=t;let O=!0;const M=Qe=>{if(Qe.live){var We;const at=new Error(`Interstitials MUST be VOD assets ${e}`),ft={fatal:!0,type:ve.OTHER_ERROR,details:Y.INTERSTITIAL_ASSET_ITEM_ERROR,error:at},ze=((We=this.schedule)==null?void 0:We.findEventIndex(e.identifier))||-1;this.handleAssetItemError(ft,e,ze,r,at.message);return}const _t=Qe.edge-Qe.fragmentStart,Ge=t.duration;(O||Ge===null||_t>Ge)&&(O=!1,this.log(`Interstitial asset "${p}" duration change ${Ge} > ${_t}`),t.duration=_t,this.updateSchedule())};S.on(_.LEVEL_UPDATED,(Qe,{details:We})=>M(We)),S.on(_.LEVEL_PTS_UPDATED,(Qe,{details:We})=>M(We)),S.on(_.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const ie=(Qe,We)=>{const _t=this.getAssetPlayer(p);if(_t&&We.tracks){_t.off(_.BUFFER_CODECS,ie),_t.tracks=We.tracks;const Ge=this.primaryMedia;this.bufferingAsset===_t.assetItem&&Ge&&!_t.media&&this.bufferAssetPlayer(_t,Ge)}};S.on(_.BUFFER_CODECS,ie);const Be=()=>{var Qe;const We=this.getAssetPlayer(p);if(this.log(`buffered to end of asset ${We}`),!We||!this.schedule)return;const _t=this.schedule.findEventIndex(e.identifier),Ge=(Qe=this.schedule.items)==null?void 0:Qe[_t];this.isInterstitial(Ge)&&this.advanceAssetBuffering(Ge,t)};S.on(_.BUFFERED_TO_END,Be);const _e=Qe=>()=>{if(!this.getAssetPlayer(p)||!this.schedule)return;this.shouldPlay=!0;const _t=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,_t,Qe)};return S.once(_.MEDIA_ENDED,_e(r)),S.once(_.PLAYOUT_LIMIT_REACHED,_e(1/0)),S.on(_.ERROR,(Qe,We)=>{if(!this.schedule)return;const _t=this.getAssetPlayer(p);if(We.details===Y.BUFFER_STALLED_ERROR){if(_t!=null&&_t.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(We,e,this.schedule.findEventIndex(e.identifier),r,`Asset player error ${We.error} ${e}`)}),S.on(_.DESTROYING,()=>{if(!this.getAssetPlayer(p)||!this.schedule)return;const We=new Error(`Asset player destroyed unexpectedly ${p}`),_t={fatal:!0,type:ve.OTHER_ERROR,details:Y.INTERSTITIAL_ASSET_ITEM_ERROR,error:We};this.handleAssetItemError(_t,e,this.schedule.findEventIndex(e.identifier),r,We.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${ns(t)}`),this.hls.trigger(_.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:r,event:e,player:S}),S}clearInterstitial(e,t){e.assetList.forEach(r=>{this.clearAssetPlayer(r.identifier,t)}),e.reset()}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){this.log(`clear asset player "${e}" toSegment: ${t&&ms(t)}`);const n=this.playerQueue[r];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:a,assetId:c}=e,l=s.assetList.length,g=this.playingAsset;this.endedAsset=null,this.playingAsset=a,(!g||g.identifier!==c)&&(g&&(this.clearAssetPlayer(g.identifier,r[n]),delete g.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${l} ${ns(a)}`),this.hls.trigger(_.INTERSTITIAL_ASSET_STARTED,{asset:a,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,a=this.schedule.findEventIndex(i.identifier),c=(r=this.schedule.items)==null?void 0:r[a];if(!c)return;e.loadSource(),this.setBufferingItem(c),this.bufferingAsset=s;const l=this.getBufferingPlayer();if(l===e)return;const g=i.appendInPlace;if(g&&(l==null?void 0:l.interstitial.appendInPlace)===!1)return;const p=(l==null?void 0:l.tracks)||((n=this.detachedData)==null?void 0:n.tracks)||this.requiredTracks;if(g&&s!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(p&&!ge(p,e.tracks)){const v=new Error(`Asset ${ns(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(p)}')`),x={fatal:!0,type:ve.OTHER_ERROR,details:Y.INTERSTITIAL_ASSET_ITEM_ERROR,error:v},S=i.findAssetIndex(s);this.handleAssetItemError(x,i,a,S,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 a=this.getAssetPlayer(s.identifier);if(a){const c=a.currentTime||n-s.timelineStart,l=a.duration-c;if(this.warn(`Stalled at ${c} of ${c+l} in ${a} ${e} (media.currentTime: ${n})`),c&&(l/r.playbackRate<.5||a.bufferedInPlaceToEnd(r))&&a.hls){const g=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,g,i)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,r,n,i){if(e.details===Y.BUFFER_STALLED_ERROR)return;const s=t.assetList[n]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${s&&ns(s)} ${e.error}`),!this.schedule)return;const a=(s==null?void 0:s.identifier)||"",c=this.getAssetPlayerQueueIndex(a),l=this.playerQueue[c]||null,g=this.schedule.items,p=B({},e,{fatal:!1,errorAction:Jt(!0),asset:s,assetListIndex:n,event:t,schedule:g,scheduleIndex:r,player:l});if(this.hls.trigger(_.INTERSTITIAL_ASSET_ERROR,p),!e.fatal)return;const v=this.playingAsset,x=this.bufferingAsset,S=new Error(i);if(s&&(this.clearAssetPlayer(a,null),s.error=S),!t.assetList.some(O=>!O.error))t.error=S;else{for(let O=n;O<t.assetList.length;O++)this.resetAssetPlayer(t.assetList[O].identifier);this.updateSchedule()}t.error?this.primaryFallback(t):v&&v.identifier===a?this.advanceAfterAssetEnded(t,r,n):x&&x.identifier===a&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,x)}primaryFallback(e){const t=e.timelineStart,r=this.effectivePlayingItem;if(this.updateSchedule(),r){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${ms(r)} error: ${e.error}`);let n=this.timelinePos;n===-1&&(n=this.hls.startPosition);const i=this.updateItem(r,n);if(this.itemsMatch(r,i)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t)),!this.schedule)return;const s=this.schedule.findItemIndexAtTime(n);this.setSchedulePosition(s)}else this.checkStart()}onAssetListLoaded(e,t){var r,n;const i=t.event,s=i.identifier,a=t.assetListResponse.ASSETS;if(!((r=this.schedule)!=null&&r.hasEvent(s)))return;const c=i.timelineStart,l=i.duration;let g=0;a.forEach((O,M)=>{const ie=parseFloat(O.DURATION);this.createAsset(i,M,g,c+g,ie,O.URI),g+=ie}),i.duration=g,this.log(`Loaded asset-list with duration: ${g} (was: ${l}) ${i}`);const p=this.waitingItem,v=(p==null?void 0:p.event.identifier)===s;this.updateSchedule();const x=(n=this.bufferingItem)==null?void 0:n.event;if(v){var S;const O=this.schedule.findEventIndex(s),M=(S=this.schedule.items)==null?void 0:S[O];if(M){if(!this.playingItem&&this.timelinePos>M.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==O){i.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`),this.primaryFallback(i);return}this.setBufferingItem(M)}this.setSchedulePosition(O)}else if((x==null?void 0:x.identifier)===s){const O=i.assetList[0];if(O){const M=this.getAssetPlayer(O.identifier);if(x.appendInPlace){const ie=this.primaryMedia;M&&ie&&this.bufferAssetPlayer(M,ie)}else M&&M.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case Y.ASSET_LIST_PARSING_ERROR:case Y.ASSET_LIST_LOAD_ERROR:case Y.ASSET_LIST_LOAD_TIMEOUT:{const r=t.interstitial;r&&this.primaryFallback(r);break}case Y.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 Ha=500;class dA extends wn{constructor(e,t,r){super(e,t,r,"subtitle-stream-controller",H.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=pt.IDLE,this.setInterval(Ha),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)||($e(r)&&(this.fragPrevious=r),this.state=pt.IDLE),!n)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let s;const a=r.start;for(let l=0;l<i.length;l++)if(a>=i[l].start&&a<=i[l].end){s=i[l];break}const c=r.start+r.duration;s?s.end=c:(s={start:a,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 a=0;a<s.length;){if(s[a].end<=i){s.shift();continue}else if(s[a].start<i)s[a].start=i;else break;a++}}),this.fragmentTracker.removeFragmentsInRange(r,i,H.SUBTITLE)}}onError(e,t){const r=t.frag;(r==null?void 0:r.type)===H.SUBTITLE&&(t.details===Y.FRAG_GAP&&this.fragmentTracker.fragBuffered(r,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==pt.STOPPED&&(this.state=pt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&bo(this.levels,t)){this.levels=t.map(r=>new ei(r));return}this.tracksBuffered=[],this.levels=t.map(r=>{const n=new ei(r);return this.tracksBuffered[n.id]=[],n}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,H.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!==pt.STOPPED&&this.setInterval(Ha)}onSubtitleTrackLoaded(e,t){var r;const{currentTrackId:n,levels:i}=this,{details:s,id:a}=t;if(!i){this.warn(`Subtitle tracks were reset while loading level ${a}`);return}const c=i[a];if(a>=i.length||!c)return;this.log(`Subtitle track ${a} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(s.live||(r=c.details)!=null&&r.live){if(s.deltaUpdateFailed)return;const p=this.mainDetails;if(!p){this.startFragRequested=!1;return}const v=p.fragments[0];if(!c.details)s.hasProgramDateTime&&p.hasProgramDateTime?(ls(s,p),l=s.fragmentStart):v&&(l=v.start,os(s,l));else{var g;l=this.alignPlaylists(s,c.details,(g=this.levelLastLoaded)==null?void 0:g.details),l===0&&v&&(l=v.start,os(s,l))}p&&!this.startFragRequested&&this.setStartPosition(p,l)}c.details=s,this.levelLastLoaded=c,a===n&&(this.hls.trigger(_.SUBTITLE_TRACK_UPDATED,{details:s,id:a,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===pt.IDLE&&(Dr(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&&gi(n.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer,hi(n.method)).catch(a=>{throw i.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.FRAG_DECRYPT_ERROR,fatal:!1,error:a,reason:a.message,frag:t}),a}).then(a=>{const c=performance.now();i.trigger(_.FRAG_DECRYPTED,{frag:t,payload:a,stats:{tstart:s,tdecrypt:c}})}).catch(a=>{this.warn(`${a.name}: ${a.message}`),this.state=pt.IDLE})}}doTick(){if(!this.media){this.state=pt.IDLE;return}if(this.state===pt.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=sr.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,n.maxBufferHole),{end:a,len:c}=s,l=r.details,g=this.hls.maxBufferLength+l.levelTargetDuration;if(c>g)return;const p=l.fragments,v=p.length,x=l.edge;let S=null;const O=this.fragPrevious;if(a<x){const Be=n.maxFragLookUpTolerance,_e=a>x-Be?0:Be;S=Dr(O,p,Math.max(p[0].start,a),_e),!S&&O&&O.start<p[0].start&&(S=p[0])}else S=p[v-1];if(S=this.filterReplacedPrimary(S,r.details),!S)return;const M=S.sn-l.startSN,ie=p[M-1];if(ie&&ie.cc===S.cc&&this.fragmentTracker.getState(ie)===Kt.NOT_LOADED&&(S=ie),this.fragmentTracker.getState(S)===Kt.NOT_LOADED){const Be=this.mapToInitFragWhenRequired(S);Be&&this.loadFragment(Be,r,a)}}}loadFragment(e,t,r){$e(e)?super.loadFragment(e,t,r):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Nu(this.tracksBuffered[this.currentTrackId]||[])}}class Nu{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 Hu={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},ol=A=>String.fromCharCode(Hu[A]||A),zi=15,_s=100,Ka={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ku={17:2,18:4,21:6,22:8,23:10,19:13,20:15},$u={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Gu={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Vu=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Wu{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r=typeof t=="function"?t():t;le.log(`${this.time} [${e}] ${r}`)}}}const vs=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].toString(16));return t};class YA{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 ll{constructor(){this.uchar=" ",this.penState=new YA}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 Zu{constructor(e){this.chars=[],this.pos=0,this.currPenState=new YA,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<_s;t++)this.chars.push(new ll);this.logger=e}equals(e){for(let t=0;t<_s;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<_s;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<_s;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>_s&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=_s)}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=ol(e);if(this.pos>=_s){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<_s;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<_s;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 $a{constructor(e){this.rows=[],this.currRow=zi-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<zi;t++)this.rows.push(new Zu(e));this.logger=e}reset(){for(let e=0;e<zi;e++)this.rows[e].clear();this.currRow=zi-1}equals(e){let t=!0;for(let r=0;r<zi;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}copy(e){for(let t=0;t<zi;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<zi;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 = "+Hr(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let a=0;a<zi;a++)this.rows[a].clear();const i=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const a=s.rows[i].cueStartTime,c=this.logger.time;if(a!==null&&c!==null&&a<c)for(let l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(s.rows[i+l])}}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 = "+Hr(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<zi;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 Ga{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 $a(r),this.nonDisplayedMemory=new $a(r),this.lastOutputScreen=new $a(r),this.currRollUpRow=this.displayedMemory.rows[zi-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[zi-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: "+Hr(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 ul{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=ju(),this.logger=void 0;const n=this.logger=new Wu;this.channels=[null,new Ga(e,t,n),new Ga(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,a=null;if(n===0&&i===0)continue;this.logger.log(3,()=>"["+vs([t[r],t[r+1]])+"] -> ("+vs([n,i])+")");const c=this.cmdHistory;if(n>=16&&n<=31){if(zu(n,i,c)){XA(null,null,c),this.logger.log(3,()=>"Repeated command ("+vs([n,i])+") is dropped");continue}XA(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 XA(null,null,c);if(!s&&(a=this.parseChars(n,i),a)){const g=this.currentChannel;g&&g>0?this.channels[g].insertChars(a):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!a&&this.logger.log(2,()=>"Couldn't parse cleaned data "+vs([n,i])+" orig: "+vs([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 ("+vs([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?Ka[e]:$u[e]:r=s===1?Ku[e]:Gu[e];const a=this.channels[s];return a?(a.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 '"+ol(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 = "+vs(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=Vu[i],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const a=e<=23?1:2;return this.channels[a].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}XA(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 XA(A,e,t){t.a=A,t.b=e}function zu(A,e,t){return t.a===A&&t.b===e}function ju(){return{a:null,b:null}}var Va=function(){if(Qn!=null&&Qn.VTTCue)return self.VTTCue;const A=["","lr","rl"],e=["start","middle","end","left","right"];function t(a,c){if(typeof c!="string"||!Array.isArray(a))return!1;const l=c.toLowerCase();return~a.indexOf(l)?l:!1}function r(a){return t(A,a)}function n(a){return t(e,a)}function i(a,...c){let l=1;for(;l<arguments.length;l++){const g=arguments[l];for(const p in g)a[p]=g[p]}return a}function s(a,c,l){const g=this,p={enumerable:!0};g.hasBeenReset=!1;let v="",x=!1,S=a,O=c,M=l,ie=null,Be="",_e=!0,Qe="auto",We="start",_t=50,Ge="middle",at=50,ft="middle";Object.defineProperty(g,"id",i({},p,{get:function(){return v},set:function(ze){v=""+ze}})),Object.defineProperty(g,"pauseOnExit",i({},p,{get:function(){return x},set:function(ze){x=!!ze}})),Object.defineProperty(g,"startTime",i({},p,{get:function(){return S},set:function(ze){if(typeof ze!="number")throw new TypeError("Start time must be set to a number.");S=ze,this.hasBeenReset=!0}})),Object.defineProperty(g,"endTime",i({},p,{get:function(){return O},set:function(ze){if(typeof ze!="number")throw new TypeError("End time must be set to a number.");O=ze,this.hasBeenReset=!0}})),Object.defineProperty(g,"text",i({},p,{get:function(){return M},set:function(ze){M=""+ze,this.hasBeenReset=!0}})),Object.defineProperty(g,"region",i({},p,{get:function(){return ie},set:function(ze){ie=ze,this.hasBeenReset=!0}})),Object.defineProperty(g,"vertical",i({},p,{get:function(){return Be},set:function(ze){const Lt=r(ze);if(Lt===!1)throw new SyntaxError("An invalid or illegal string was specified.");Be=Lt,this.hasBeenReset=!0}})),Object.defineProperty(g,"snapToLines",i({},p,{get:function(){return _e},set:function(ze){_e=!!ze,this.hasBeenReset=!0}})),Object.defineProperty(g,"line",i({},p,{get:function(){return Qe},set:function(ze){if(typeof ze!="number"&&ze!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Qe=ze,this.hasBeenReset=!0}})),Object.defineProperty(g,"lineAlign",i({},p,{get:function(){return We},set:function(ze){const Lt=n(ze);if(!Lt)throw new SyntaxError("An invalid or illegal string was specified.");We=Lt,this.hasBeenReset=!0}})),Object.defineProperty(g,"position",i({},p,{get:function(){return _t},set:function(ze){if(ze<0||ze>100)throw new Error("Position must be between 0 and 100.");_t=ze,this.hasBeenReset=!0}})),Object.defineProperty(g,"positionAlign",i({},p,{get:function(){return Ge},set:function(ze){const Lt=n(ze);if(!Lt)throw new SyntaxError("An invalid or illegal string was specified.");Ge=Lt,this.hasBeenReset=!0}})),Object.defineProperty(g,"size",i({},p,{get:function(){return at},set:function(ze){if(ze<0||ze>100)throw new Error("Size must be between 0 and 100.");at=ze,this.hasBeenReset=!0}})),Object.defineProperty(g,"align",i({},p,{get:function(){return ft},set:function(ze){const Lt=n(ze);if(!Lt)throw new SyntaxError("An invalid or illegal string was specified.");ft=Lt,this.hasBeenReset=!0}})),g.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class Wa{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function cl(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 Za{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 fl(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 a=s[0],c=s[1];e(a,c)}}const fr=new Va(0,0,""),ys=fr.align==="middle"?"middle":"center";function JA(A,e,t){const r=A;function n(){const a=cl(A);if(a===null)throw new Error("Malformed timestamp: "+r);return A=A.replace(/^[^\sa-zA-Z-]+/,""),a}function i(a,c){const l=new Za;fl(a,function(v,x){let S;switch(v){case"region":for(let O=t.length-1;O>=0;O--)if(t[O].id===x){l.set(v,t[O].region);break}break;case"vertical":l.alt(v,x,["rl","lr"]);break;case"line":S=x.split(","),l.integer(v,S[0]),l.percent(v,S[0])&&l.set("snapToLines",!1),l.alt(v,S[0],["auto"]),S.length===2&&l.alt("lineAlign",S[1],["start",ys,"end"]);break;case"position":S=x.split(","),l.percent(v,S[0]),S.length===2&&l.alt("positionAlign",S[1],["start",ys,"end","line-left","line-right","auto"]);break;case"size":l.percent(v,x);break;case"align":l.alt(v,x,["start",ys,"end","left","right"]);break}},/:/,/\s/),c.region=l.get("region",null),c.vertical=l.get("vertical","");let g=l.get("line","auto");g==="auto"&&fr.line===-1&&(g=-1),c.line=g,c.lineAlign=l.get("lineAlign","start"),c.snapToLines=l.get("snapToLines",!0),c.size=l.get("size",100),c.align=l.get("align",ys);let p=l.get("position","auto");p==="auto"&&fr.position===50&&(p=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=p}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 Qi(A){return A.replace(/<br(?: \/)?>/gi,`
`)}class Yu{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Wa,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=Qi(i);s<i.length&&i[s]!=="\r"&&i[s]!==`
`;)++s;const a=i.slice(0,s);return i[s]==="\r"&&++s,i[s]===`
`&&++s,t.buffer=i.slice(s),a}function n(i){fl(i,function(s,a){},/:/)}try{let i="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;i=r();const a=i.match(/^()?WEBVTT([ \t].*)?$/);if(!(a!=null&&a[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 Va(0,0,""),t.state="CUE",i.indexOf("-->")===-1){t.cue.id=i;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{JA(i,t.cue,t.regionList)}catch(a){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const a=i.indexOf("-->")!==-1;if(!i||a&&(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 Ln=/\r\n|\n\r|\n|\r/g,Mn=function(e,t,r=0){return e.slice(r,r+t.length)===t},qA=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(!z(t)||!z(r)||!z(n)||!z(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*r,t+=60*1e3*n,t+=60*60*1e3*i,t};function za(A,e,t){return hA(A.toString())+hA(e.toString())+hA(t)}const ea=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 Xu(A,e,t,r,n,i,s){const a=new Yu,c=Ze(new Uint8Array(A)).trim().replace(Ln,`
`).split(`
`),l=[],g=e?iu(e.baseTime,e.timescale):0;let p="00:00.000",v=0,x=0,S,O=!0;a.oncue=function(M){const ie=t[r];let Be=t.ccOffset;const _e=(v-g)/9e4;if(ie!=null&&ie.new&&(x!==void 0?Be=t.ccOffset=ie.start:ea(t,r,_e)),_e){if(!e){S=new Error("Missing initPTS for VTT MPEGTS");return}Be=_e-t.presentationOffset}const Qe=M.endTime-M.startTime,We=Mi((M.startTime+Be-x)*9e4,n*9e4)/9e4;M.startTime=Math.max(We,0),M.endTime=Math.max(We+Qe,0);const _t=M.text.trim();M.text=decodeURIComponent(encodeURIComponent(_t)),M.id||(M.id=za(M.startTime,M.endTime,_t)),M.endTime>0&&l.push(M)},a.onparsingerror=function(M){S=M},a.onflush=function(){if(S){s(S);return}i(l)},c.forEach(M=>{if(O)if(Mn(M,"X-TIMESTAMP-MAP=")){O=!1,M.slice(16).split(",").forEach(ie=>{Mn(ie,"LOCAL:")?p=ie.slice(6):Mn(ie,"MPEGTS:")&&(v=parseInt(ie.slice(7)))});try{x=qA(p)/1e3}catch(ie){S=ie}return}else M===""&&(O=!1);a.parse(M+`
`)}),a.flush()}const Xs="stpp.ttml.im1t",hl=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,dl=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,gl={left:"start",center:"center",right:"end",start:"start",end:"end"};function pl(A,e,t,r){const n=m(new Uint8Array(A),["mdat"]);if(n.length===0){r(new Error("Could not parse IMSC1 mdat"));return}const i=n.map(a=>Ze(a)),s=nu(e.baseTime,1,e.timescale);try{i.forEach(a=>t(ml(a,s)))}catch(a){r(a)}}function ml(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((p,v)=>(p[v]=n.getAttribute(`ttp:${v}`)||i[v],p),{}),a=n.getAttribute("xml:space")!=="preserve",c=Ya(ja(n,"styling","style")),l=Ya(ja(n,"layout","region")),g=ja(n,"body","[begin]");return[].map.call(g,p=>{const v=Xa(p,a);if(!v||!p.hasAttribute("begin"))return null;const x=ra(p.getAttribute("begin"),s),S=ra(p.getAttribute("dur"),s);let O=ra(p.getAttribute("end"),s);if(x===null)throw _l(p);if(O===null){if(S===null)throw _l(p);O=x+S}const M=new Va(x-e,O-e,v);M.id=za(M.startTime,M.endTime,M.text);const ie=l[p.getAttribute("region")],Be=c[p.getAttribute("style")],_e=Ja(ie,Be,c),{textAlign:Qe}=_e;if(Qe){const We=gl[Qe];We&&(M.lineAlign=We),M.align=Qe}return B(M,_e),M}).filter(p=>p!==null)}function ja(A,e,t){const r=A.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(t)):[]}function Ya(A){return A.reduce((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function Xa(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?Xa(r,e):e?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent},"")}function Ja(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((a,c)=>{const l=ta(e,r,c)||ta(A,r,c)||ta(n,r,c);return l&&(a[c]=l),a},{})}function ta(A,e,t){return A&&A.hasAttributeNS(e,t)?A.getAttributeNS(e,t):null}function _l(A){return new Error(`Could not parse ttml timestamp ${A}`)}function ra(A,e){if(!A)return null;let t=cl(A);return t===null&&(hl.test(A)?t=Ju(A,e):dl.test(A)&&(t=qu(A,e))),t}function Ju(A,e){const t=hl.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 qu(A,e){const t=dl.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 na{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 ia{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=vl(),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 na(this,"textTrack1"),t=new na(this,"textTrack2"),r=new na(this,"textTrack3"),n=new na(this,"textTrack4");this.cea608Parser1=new ul(1,e,t),this.cea608Parser2=new ul(3,r,n)}addCues(e,t,r,n,i){let s=!1;for(let a=i.length;a--;){const c=i[a],l=sa(c[0],c[1],t,r);if(l>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],r),s=!0,l/(r-t)>.5))return}if(s||i.push([t,r]),this.config.renderTextTracksNatively){const a=this.captionsTracks[e];this.Cues.newCue(a,t,r,n)}else{const a=this.Cues.newCue(null,t,r,n);this.hls.trigger(_.CUES_PARSED,{type:"captions",cues:a,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:n,timescale:i,trackId:s}){const{unparsedVttFrags:a}=this;r===H.MAIN&&(this.initPTS[t.cc]={baseTime:n,timescale:i,trackId:s}),a.length&&(this.unparsedVttFrags=[],a.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(qa(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],a=this.getExistingTrack(i,s);if(a)r[e]=a,hs(r[e]),Pa(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=vl(),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===Xs);if(this.config.enableWebVTT||n&&this.config.enableIMSC1){if(bo(this.tracks,r)){this.tracks=r;return}if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const s=this.media,a=s?jA(s.textTracks):null;if(this.tracks.forEach((c,l)=>{let g;if(a){let p=null;for(let v=0;v<a.length;v++)if(a[v]&&qa(a[v],c)){p=a[v],a[v]=null;break}p&&(g=p)}if(g)hs(g);else{const p=ki(c);g=this.createTextTrack(p,c.name,c.lang),g&&(g.mode="disabled")}g&&this.textTracks.push(g)}),a!=null&&a.length){const c=a.filter(l=>l!==null).map(l=>l.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(a=>({label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}));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===H.MAIN){var r,n;const{cea608Parser1:i,cea608Parser2:s,lastSn:a}=this,{cc:c,sn:l}=t.frag,g=(r=(n=t.part)==null?void 0:n.index)!=null?r:-1;i&&s&&(l!==a+1||l===a&&g!==this.lastPartIndex+1||c!==this.lastCc)&&(i.reset(),s.reset()),this.lastCc=c,this.lastSn=l,this.lastPartIndex=g}}onFragLoaded(e,t){const{frag:r,payload:n}=t;if(r.type===H.SUBTITLE)if(n.byteLength){const i=r.decryptdata,s="stats"in t;if(i==null||!i.encrypted||s){const a=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),a&&a.textCodec===Xs?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;pl(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,a=i.length-1;if(!i[r.cc]&&a===-1){s.push(e);return}const c=this.hls,l=(t=r.initSegment)!=null&&t.data?ut(r.initSegment.data,new Uint8Array(n)).buffer:n;Xu(l,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,g=>{this._appendCues(g,r.level),c.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},g=>{const p=g.message==="Missing initPTS for VTT MPEGTS";p?s.push(e):this._fallbackToIMSC1(r,n),c.logger.log(`Failed to parse VTT cue: ${g}`),!(p&&a>r.cc)&&c.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:g})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||pl(t,this.initPTS[e.cc],()=>{r.textCodec=Xs,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=>el(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===H.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===H.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 a=this.extractCea608Data(s);this.cea608Parser1.addData(n[i].pts,a[0]),this.cea608Parser2.addData(n[i].pts,a[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:a}=this;Object.keys(a).forEach(c=>zs(a[c],t,r))}if(this.config.renderTextTracksNatively&&t===0&&n!==void 0){const{textTracks:a}=this;Object.keys(a).forEach(c=>zs(a[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++],a=127&e[n++],c=127&e[n++];if(a===0&&c===0)continue;if((4&s)!==0){const g=3&s;(g===0||g===1)&&(t[g].push(a),t[g].push(c))}}return t}}function ki(A){return A.characteristics&&/transcribes-spoken-dialog/gi.test(A.characteristics)&&/describes-music-and-sound/gi.test(A.characteristics)?"captions":"subtitles"}function qa(A,e){return!!A&&A.kind===ki(e)&&Ba(e,A)}function sa(A,e,t,r){return Math.min(e,r)-Math.max(A,t)}function vl(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const ec=/\s/,eo={newCue(A,e,t,r){const n=[];let i,s,a,c,l;const g=self.VTTCue||self.TextTrackCue;for(let v=0;v<r.rows.length;v++)if(i=r.rows[v],a=!0,c=0,l="",!i.isEmpty()){var p;for(let O=0;O<i.chars.length;O++)ec.test(i.chars[O].uchar)&&a?c++:(l+=i.chars[O].uchar,a=!1);i.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const x=Qi(l.trim()),S=za(e,t,x);A!=null&&(p=A.cues)!=null&&p.getCueById(S)||(s=new g(e,t,x),s.id=S,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,x)=>v.line==="auto"||x.line==="auto"?0:v.line>8&&x.line>8?x.line-v.line:v.line-x.line),n.forEach(v=>el(A,v))),n}};function Js(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(A){}return!1}const Aa=/(\d+)-(\d+)\/(\d+)/;class yl{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||Bl,this.controller=new self.AbortController,this.stats=new b}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=qs(e,this.controller.signal),s=e.responseType==="arraybuffer",a=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:l}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=c&&z(c)?c:l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(n,e,this.response))},t.timeout),(uA(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(p=>{var v;this.response=this.loader=p;const x=Math.max(self.performance.now(),n.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(n,e,this.response))},l-(x-n.loading.start)),!p.ok){const{status:O,statusText:M}=p;throw new nc(M||"fetch, bad network response",O,p)}n.loading.first=x,n.total=rc(p.headers)||n.total;const S=(v=this.callbacks)==null?void 0:v.onProgress;return S&&z(t.highWaterMark)?this.loadProgressively(p,n,e,t.highWaterMark,S):s?p.arrayBuffer():e.responseType==="json"?p.json():p.text()}).then(p=>{var v,x;const S=this.response;if(!S)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),n.loading.end=Math.max(self.performance.now(),n.loading.first);const O=p[a];O&&(n.loaded=n.total=O);const M={url:S.url,data:p,code:S.status},ie=(v=this.callbacks)==null?void 0:v.onProgress;ie&&!z(t.highWaterMark)&&ie(n,e,p,S),(x=this.callbacks)==null||x.onSuccess(M,n,e,S)}).catch(p=>{var v;if(self.clearTimeout(this.requestTimeout),n.aborted)return;const x=p&&p.code||0,S=p?p.message:null;(v=this.callbacks)==null||v.onError({code:x,text:S},e,p?p.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 fi,a=e.body.getReader(),c=()=>a.read().then(l=>{if(l.done)return s.dataLength&&i(t,r,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const g=l.value,p=g.length;return t.loaded+=p,p<n||s.dataLength?(s.push(g),s.dataLength>=n&&i(t,r,s.flush().buffer,e)):i(t,r,g.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function qs(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 tc(A){const e=Aa.exec(A);if(e)return parseInt(e[2])-parseInt(e[1])+1}function rc(A){const e=A.get("Content-Range");if(e){const r=tc(e);if(z(r))return r}const t=A.get("Content-Length");if(t)return parseInt(t)}function Bl(A,e){return new self.Request(A.url,e)}class nc extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const El=/^age:\s*[\d.]+\s*$/im;class wl{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 b,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 a;(a=this.callbacks)==null||a.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 a in n)e.setRequestHeader(a,n[a]);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&&z(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 l=t.status,g=t.responseType==="text"?t.responseText:null;if(l>=200&&l<300){const S=g!=null?g:t.response;if(S!=null){var s,a;r.loading.end=Math.max(self.performance.now(),r.loading.first);const O=t.responseType==="arraybuffer"?S.byteLength:S.length;r.loaded=r.total=O,r.bwEstimate=r.total*8e3/(r.loading.end-r.loading.first);const M=(s=this.callbacks)==null?void 0:s.onProgress;M&&M(r,e,S,t);const ie={url:t.responseURL,data:S,code:l};(a=this.callbacks)==null||a.onSuccess(ie,r,e,t);return}}const p=i.loadPolicy.errorRetry,v=r.retry,x={url:e.url,data:void 0,code:l};if(Ot(p,v,!1,x))this.retry(p);else{var c;le.error(`${l} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:l,text:t.statusText},e,t,r)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Ot(e,t,!0))this.retry(e);else{var r;le.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=ct(e,r.retry),r.retry++,le.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&&El.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 ic={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},sc=C(C({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:wl,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:yr,bufferController:mu,capLevelController:wa,errorController:Tt,fpsController:qo,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:Oi,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:ic},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},Ac()),{},{subtitleStreamController:dA,subtitleTrackController:nl,timelineController:ia,audioStreamController:hu,audioTrackController:du,emeController:Os,cmcdController:Ou,contentSteeringController:Mu,interstitialsController:al});function Ac(){return{cueHandler:eo,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 ac(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=to(A),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(s=>{const a=`${s==="level"?"playlist":s}LoadPolicy`,c=e[a]===void 0,l=[];i.forEach(g=>{const p=`${s}Loading${g}`,v=e[p];if(v!==void 0&&c){l.push(p);const x=r[a].default;switch(e[a]={default:x},g){case"TimeOut":x.maxLoadTimeMs=v,x.maxTimeToFirstByteMs=v;break;case"MaxRetry":x.errorRetry.maxNumRetry=v,x.timeoutRetry.maxNumRetry=v;break;case"RetryDelay":x.errorRetry.retryDelayMs=v,x.timeoutRetry.retryDelayMs=v;break;case"MaxRetryTimeout":x.errorRetry.maxRetryDelayMs=v,x.timeoutRetry.maxRetryDelayMs=v;break}}}),l.length&&t.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${a}": ${Hr(e[a])}`)}),C(C({},r),e)}function to(A){return A&&typeof A=="object"?Array.isArray(A)?A.map(to):Object.keys(A).reduce((e,t)=>(e[t]=to(A[t]),e),{}):A}function oc(A,e){const t=A.loader;t!==yl&&t!==wl?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),A.progressive=!1):Js()&&(A.loader=yl,A.progressive=!0,A.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const aa=2,lc=.1,uc=.05,cc=100;class fc extends Vr{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(cc),this.mediaSource=t.mediaSource;const r=this.media=t.media;vi(r,"playing",this.onMediaPlaying),vi(r,"waiting",this.onMediaWaiting),vi(r,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:r}=this;r&&(Ri(r,"playing",this.onMediaPlaying),Ri(r,"waiting",this.onMediaWaiting),Ri(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:a}=s,c=this.seeking&&!a,l=!this.seeking&&a,g=s.paused&&!a||s.ended||s.playbackRate===0;if(this.seeking=a,e!==t){t&&(this.ended=0),this.moved=!0,a||(this.nudgeRetry=0,i.nudgeOnVideoHole&&!g&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(l||c){c&&this.stallResolved(e);return}if(g){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(!sr.getBuffered(s).length){this.nudgeRetry=0;return}const p=sr.bufferInfo(s,e,0),v=p.nextStart||0,x=this.fragmentTracker;if(a&&x&&this.hls){const _t=Cl(this.hls.inFlightFragments,e),Ge=p.len>aa,at=!v||_t||v-e>aa&&!x.getPartialFragment(e);if(Ge||at)return;this.moved=!1}const S=(n=this.hls)==null?void 0:n.latestLevelDetails;if(!this.moved&&this.stalled!==null&&x){if(!(p.len>0)&&!v)return;const Ge=Math.max(v,p.start||0)-e,ft=!!(S!=null&&S.live)?S.targetduration*2:aa,ze=f(e,x);if(Ge>0&&(Ge<=ft||ze)){s.paused||this._trySkipBufferHole(ze);return}}const O=i.detectStallWithCurrentTimeMs,M=self.performance.now(),ie=this.waiting;let Be=this.stalled;if(Be===null)if(ie>0&&M-ie<O)Be=this.stalled=ie;else{this.stalled=M;return}const _e=M-Be;if(!a&&(_e>=O||ie)&&this.hls){var Qe;if(((Qe=this.mediaSource)==null?void 0:Qe.readyState)==="ended"&&!(S!=null&&S.live)&&Math.abs(e-((S==null?void 0:S.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(p),!this.media||!this.hls)return}const We=sr.bufferInfo(s,e,i.maxBufferHole);this._tryFixBufferStall(We,_e,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=sr.bufferedInfo(sr.timeRangesToArray(this.buffered.audio),e,0);if(i.len>1&&t>=i.start){const s=sr.timeRangesToArray(n),a=sr.bufferedInfo(s,t,0).bufferedIndex;if(a>-1&&a<s.length-1){const c=sr.bufferedInfo(s,e,0).bufferedIndex,l=s[a].end,g=s[a+1].start;if((c===-1||c>a)&&g-l<1&&e-l<2){const p=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${l} -> ${g} buffered index: ${c}`);this.warn(p.message),this.media.currentTime+=1e-6;let v=f(e,this.fragmentTracker);v&&"fragment"in v?v=v.fragment:v||(v=void 0);const x=sr.bufferInfo(this.media,e,0);this.hls.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:p,reason:p.message,frag:v,buffer:x.len,bufferInfo:x})}}}}}_tryFixBufferStall(e,t,r){var n,i;const{fragmentTracker:s,media:a}=this,c=(n=this.hls)==null?void 0:n.config;if(!a||!s||!c)return;const l=(i=this.hls)==null?void 0:i.latestLevelDetails,g=f(r,s);if((g||l!=null&&l.live&&r<l.fragmentStart)&&(this._trySkipBufferHole(g)||!this.media))return;const p=e.buffered,v=this.adjacentTraversal(e,r);(p&&p.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,H.MAIN),s=r.getFragAtPos(n,H.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 (${Hr(e)})`);this.warn(s.message),t.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.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,a=sr.bufferInfo(n,s,0),c=s<a.start?a.start:a.nextStart;if(c&&this.hls){const g=a.len<=i.maxBufferHole,p=a.len>0&&a.len<1&&n.readyState<3,v=c-s;if(v>0&&(g||p)){if(v>i.maxBufferHole){let S=!1;if(s===0){const O=r.getAppendedFrag(0,H.MAIN);O&&c<O.end&&(S=!0)}if(!S&&e){var l;if(!((l=this.hls.loadLevelObj)!=null&&l.details)||Cl(this.hls.inFlightFragments,c))return 0;let M=!1,ie=e.end;for(;ie<c;){const Be=f(ie,r);if(Be)ie+=Be.duration;else{M=!0;break}}if(M)return 0}}const x=Math.max(c+uc,s+lc);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${x}`),this.moved=!0,n.currentTime=x,!(e!=null&&e.gap)){const S=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${x}`),O={type:ve.MEDIA_ERROR,details:Y.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:S,reason:S.message,buffer:a.len,bufferInfo:a};e&&("fragment"in e?O.part=e:O.frag=e),this.hls.trigger(_.ERROR,O)}return x}}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 a=s+(n+1)*i.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${a}`);this.warn(c.message),r.currentTime=a,t.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const a=new Error(`Playhead still not moving while enough data buffered @${s} after ${i.nudgeMaxRetry} nudges`);this.error(a.message),t.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.BUFFER_STALLED_ERROR,error:a,fatal:!0,buffer:e.len,bufferInfo:e})}}}function Cl(A,e){const t=bl(A.main);if(t&&t.start<=e)return t;const r=bl(A.audio);return r&&r.start<=e?r:null}function bl(A){if(!A)return null;switch(A.state){case pt.IDLE:case pt.STOPPED:case pt.ENDED:case pt.ERROR:return null}return A.frag}function f(A,e){return e.getAppendedFrag(A,H.MAIN)||e.getPartialFragment(A)}const u=.25;function d(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function h(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,Hr(n?C({type:n},r):r))}return i}const E=(()=>{const A=d();try{A&&new A(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class I{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 Pa(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=d();if(s)for(let a=0;a<i.length;a++){const c=i[a].type;if(c===Ui.emsg&&!r||!n)continue;const l=uo(i[a].data),g=i[a].pts;let p=g+i[a].duration;p>E&&(p=E),p-g<=0&&(p=g+u);for(let x=0;x<l.length;x++){const S=l[x];if(!co(S)){this.updateId3CueEnds(g,c);const O=h(s,g,p,S,c);O&&this.id3Track.addCue(O)}}}}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===E&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:r,type:n}){const{id3Track:i,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:c}}=s;if(i&&(a||c)){let l;n==="audio"?l=g=>g.type===Ui.audioId3&&c:n==="video"?l=g=>g.type===Ui.emsg&&a:l=g=>g.type===Ui.audioId3&&c||g.type===Ui.emsg&&a,zs(i,t,r,l)}}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 a=d();if(r&&n&&!s){const{fragmentStart:O,fragmentEnd:M}=e;let ie=this.assetCue;ie?(ie.startTime=O,ie.endTime=M):a&&(ie=this.assetCue=h(a,O,M,{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:l}=e,g=Object.keys(l);let p=this.dateRangeCuesAppended;if(c&&t){var v;if((v=c.cues)!=null&&v.length){const O=Object.keys(p).filter(M=>!g.includes(M));for(let M=O.length;M--;){var x;const ie=O[M],Be=(x=p[ie])==null?void 0:x.cues;delete p[ie],Be&&Object.keys(Be).forEach(_e=>{const Qe=Be[_e];if(Qe){Qe.removeEventListener("enter",this.onEventCueEnter);try{c.removeCue(Qe)}catch(We){}}})}}else p=this.dateRangeCuesAppended={}}const S=e.fragments[e.fragments.length-1];if(!(g.length===0||!z(S==null?void 0:S.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let O=0;O<g.length;O++){const M=g[O],ie=l[M],Be=ie.startTime,_e=p[M],Qe=(_e==null?void 0:_e.cues)||{};let We=(_e==null?void 0:_e.durationKnown)||!1,_t=E;const{duration:Ge,endDate:at}=ie;if(at&&Ge!==null)_t=Be+Ge,We=!0;else if(ie.endOnNext&&!We){const ze=g.reduce((Lt,lr)=>{if(lr!==ie.id){const br=l[lr];if(br.class===ie.class&&br.startDate>ie.startDate&&(!Lt||ie.startDate<Lt.startDate))return br}return Lt},null);ze&&(_t=ze.startTime,We=!0)}const ft=Object.keys(ie.attr);for(let ze=0;ze<ft.length;ze++){const Lt=ft[ze];if(!li(Lt))continue;const lr=Qe[Lt];if(lr)We&&!(_e!=null&&_e.durationKnown)?lr.endTime=_t:Math.abs(lr.startTime-Be)>.01&&(lr.startTime=Be,lr.endTime=_t);else if(a){let br=ie.attr[Lt];Zn(Lt)&&(br=L(br));const dr=h(a,Be,_t,{key:Lt,data:br},Ui.dateRange);dr&&(dr.id=M,this.id3Track.addCue(dr),Qe[Lt]=dr,s&&(Lt==="X-ASSET-LIST"||Lt==="X-ASSET-URL")&&dr.addEventListener("enter",this.onEventCueEnter))}}p[M]={cues:Qe,dateRange:ie,durationKnown:We}}}}}class J{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 a=this.targetLatency;if(a===null)return;const c=n-a,l=Math.min(this.maxLatency,a+r.targetduration);if(c<l&&c>.05&&this.forwardBufferLength>1){const p=Math.min(2,Math.max(1,s)),v=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,x=Math.min(p,Math.max(1,v));this.changeMediaPlaybackRate(t,x)}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:a}=this.config,c=this.hls.userConfig;let l=a&&r||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||l===0)&&(l=i!==void 0?i:s*n);const g=n;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,g)}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,a=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(s,i),a)}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===Y.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 de extends NA{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 a=!1,c=!1,l=!1;t.levels.forEach(g=>{const p=g.attrs;let{audioCodec:v,videoCodec:x}=g;v&&(g.audioCodec=v=ce(v,r)||void 0),x&&(x=g.videoCodec=Ut(x));const{width:S,height:O,unknownCodecs:M}=g;let ie=M?M.length:0;if(M)for(let ze=ie;ze--;){const Lt=M[ze];this.isAudioSupported(Lt)?(g.audioCodec=v=v?`${v},${Lt}`:Lt,ie--,ir.audio[v.substring(0,4)]=2):this.isVideoSupported(Lt)&&(g.videoCodec=x=x?`${x},${Lt}`:Lt,ie--,ir.video[x.substring(0,4)]=2)}if(a||(a=!!(S&&O)),c||(c=!!x),l||(l=!!v),ie||v&&!this.isAudioSupported(v)||x&&!this.isVideoSupported(x)){this.log(`Some or all CODECS not supported "${p.CODECS}"`);return}const{CODECS:Be,"FRAME-RATE":_e,"HDCP-LEVEL":Qe,"PATHWAY-ID":We,RESOLUTION:_t,"VIDEO-RANGE":Ge}=p,ft=`${`${We||"."}-`}${g.bitrate}-${_t}-${_e}-${Be}-${Ge}-${Qe}`;if(i[ft])if(i[ft].uri!==g.url&&!g.attrs["PATHWAY-ID"]){const ze=s[ft]+=1;g.attrs["PATHWAY-ID"]=new Array(ze+1).join(".");const Lt=this.createLevel(g);i[ft]=Lt,n.push(Lt)}else i[ft].addGroupId("audio",p.AUDIO),i[ft].addGroupId("text",p.SUBTITLES);else{const ze=this.createLevel(g);i[ft]=ze,s[ft]=1,n.push(ze)}}),this.filterAndSortMediaOptions(n,t,a,c,l)}createLevel(e){const t=new ei(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=jt(n,[])}return t}isAudioSupported(e){return zr(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return zr(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,r,n,i){let s=[],a=[],c=e;if((r||n)&&i&&(c=c.filter(({videoCodec:M,videoRange:ie,width:Be,height:_e})=>(!!M||!!(Be&&_e))&&mn(ie))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let M="no level with compatible codecs found in manifest",ie=M;t.levels.length&&(ie=`one or more CODECS in variant not supported: ${Hr(t.levels.map(_e=>_e.attrs.CODECS).filter((_e,Qe,We)=>We.indexOf(_e)===Qe))}`,this.warn(ie),M+=` (${ie})`);const Be=new Error(M);this.hls.trigger(_.ERROR,{type:ve.MEDIA_ERROR,details:Y.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:Be,reason:ie})}});return}t.audioTracks&&(s=t.audioTracks.filter(M=>!M.audioCodec||this.isAudioSupported(M.audioCodec)),he(s)),t.subtitles&&(a=t.subtitles,he(a));const l=c.slice(0);c.sort((M,ie)=>{if(M.attrs["HDCP-LEVEL"]!==ie.attrs["HDCP-LEVEL"])return(M.attrs["HDCP-LEVEL"]||"")>(ie.attrs["HDCP-LEVEL"]||"")?1:-1;if(r&&M.height!==ie.height)return M.height-ie.height;if(M.frameRate!==ie.frameRate)return M.frameRate-ie.frameRate;if(M.videoRange!==ie.videoRange)return Fn.indexOf(M.videoRange)-Fn.indexOf(ie.videoRange);if(M.videoCodec!==ie.videoCodec){const Be=ke(M.videoCodec),_e=ke(ie.videoCodec);if(Be!==_e)return _e-Be}if(M.uri===ie.uri&&M.codecSet!==ie.codecSet){const Be=De(M.codecSet),_e=De(ie.codecSet);if(Be!==_e)return _e-Be}return M.averageBitrate!==ie.averageBitrate?M.averageBitrate-ie.averageBitrate:0});let g=l[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==l.length)){for(let M=0;M<l.length;M++)if(l[M].pathwayId===c[0].pathwayId){g=l[M];break}}this._levels=c;for(let M=0;M<c.length;M++)if(c[M]===g){var p;this._firstLevel=M;const ie=g.bitrate,Be=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${ie}`),((p=this.hls.userConfig)==null?void 0:p.abrEwmaDefaultEstimate)===void 0){const _e=Math.min(ie,this.hls.config.abrEwmaDefaultEstimateMax);_e>Be&&Be===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=_e)}break}const v=i&&!n,x=this.hls.config,S=!!(x.audioStreamController&&x.audioTrackController),O={levels:c,audioTracks:s,subtitleTracks:a,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:n,altAudio:S&&!v&&s.some(M=>!!M.url)};this.hls.trigger(_.MANIFEST_PARSED,O)}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 g=new Error("invalid level idx"),p=e<0;if(this.hls.trigger(_.ERROR,{type:ve.OTHER_ERROR,details:Y.LEVEL_SWITCH_ERROR,level:e,fatal:p,error:g,reason:g.message}),p)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],a=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,r===e&&n&&i===a)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${a?" with Pathway "+a:""} 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 l=s.details;if(!l||l.live){const g=this.switchParams(s.uri,n==null?void 0:n.details,l);this.loadPlaylist(g)}}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===ye.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===H.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 a;this.warn(`Invalid level index ${n}`),(a=t.deliveryDirectives)!=null&&a.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,a=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:""}${a&&s.live?" age "+a.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(a=>a.level=-1)),!1));nA(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 he(A){const e={};A.forEach(t=>{const r=t.groupId||"";t.id=e[r]=e[r]||0,e[r]++})}function Pe(){return self.SourceBuffer||self.WebKitSourceBuffer}function Ve(){if(!xe())return!1;const e=Pe();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function et(){if(!Ve())return!1;const A=xe();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(ur(e,"video")))||["mp4a.40.2","fLaC"].some(e=>A.isTypeSupported(ur(e,"audio"))))}function xt(){var A;const e=Pe();return typeof(e==null||(A=e.prototype)==null?void 0:A.changeType)=="function"}const gr=100;class Xt extends wn{constructor(e,t,r){super(e,t,r,"stream-controller",H.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||!z(i)||(this.log(`Media seeked to ${i.toFixed(3)}`),!this.getBufferedFrag(i)))return;const s=this.getFwdBufferInfoAtPos(n,i,H.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(gr),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=pt.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=pt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case pt.WAITING_LEVEL:{const{levels:t,level:r}=this,n=t==null?void 0:t[r],i=n==null?void 0:n.details;if(i&&(!i.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(i))break;this.state=pt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=pt.IDLE;break}break}case pt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),r=this.retryDate;if(!r||t>=r||(e=this.media)!=null&&e.seeking){const{levels:n,level:i}=this,s=n==null?void 0:n[i];this.resetStartWhenNotLoaded(s||null),this.state=pt.IDLE}}break}this.state===pt.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],a=this.getMainFwdBufferInfo();if(a===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(a,c)){const O={};this.altAudio===2&&(O.type="video"),this.hls.trigger(_.BUFFER_EOS,O),this.state=pt.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 l=s.details;if(!l||this.state===pt.WAITING_LEVEL||this.waitForLive(s)){this.level=i,this.state=pt.WAITING_LEVEL,this.startFragRequested=!1;return}const g=a.len,p=this.getMaxBufferLength(s.maxBitrate);if(g>=p)return;this.backtrackFragment&&this.backtrackFragment.start>a.end&&(this.backtrackFragment=null);const v=this.backtrackFragment?this.backtrackFragment.start:a.end;let x=this.getNextFragment(v,l);if(this.couldBacktrack&&!this.fragPrevious&&x&&$e(x)&&this.fragmentTracker.getState(x)!==Kt.OK){var S;const M=((S=this.backtrackFragment)!=null?S:x).sn-l.startSN,ie=l.fragments[M-1];ie&&x.cc===ie.cc&&(x=ie,this.fragmentTracker.removeFragment(ie))}else this.backtrackFragment&&a.len&&(this.backtrackFragment=null);if(x&&this.isLoopLoading(x,v)){if(!x.gap){const M=this.audioOnly&&!this.altAudio?$.AUDIO:$.VIDEO,ie=(M===$.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;ie&&this.afterBufferFlushed(ie,M,H.MAIN)}x=this.getNextFragmentLoopLoading(x,l,a,H.MAIN,p)}x&&(x.initSegment&&!x.initSegment.data&&!this.bitrateTest&&(x=x.initSegment),this.loadFragment(x,s,v))}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);n===Kt.NOT_LOADED||n===Kt.PARTIAL?$e(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,H.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 a=this.getMainFwdBufferInfo();if(!a||a.len<i.targetduration*2)return}if(!t.paused&&e){const a=this.hls.nextLoadLevel,c=e[a],l=this.fragLastKbps;l&&this.fragCurrent?r=this.fragCurrent.duration*c.maxBitrate/(1e3*l)+1:r=0}else r=0;const s=this.getBufferedFrag(t.currentTime+r);if(s){const a=this.followingBufferedFrag(s);if(a){this.abortCurrentFrag();const c=a.maxStartPTS?a.maxStartPTS:a.start,l=a.duration,g=Math.max(s.end,c+Math.min(Math.max(l-this.config.maxFragLookUpTolerance,l*(this.couldBacktrack?.5:.125)),l*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(g,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 pt.KEY_LOADING:case pt.FRAG_LOADING:case pt.FRAG_LOADING_WAITING_RETRY:case pt.PARSING:case pt.PARSED:this.state=pt.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;vi(r,"playing",this.onMediaPlaying),vi(r,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:r}=this;r&&(Ri(r,"playing",this.onMediaPlaying),Ri(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;t.levels.forEach(i=>{const s=i.audioCodec;s&&(r=r||s.indexOf("mp4a.40.2")!==-1,n=n||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=r&&n&&!xt(),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!==pt.IDLE)return;const n=t.levelInfo;(!n.details||n.details.live&&(this.levelLastLoaded!==n||n.details.expired)||this.waitForCdnTuneIn(n.details))&&(this.state=pt.WAITING_LEVEL)}onLevelLoaded(e,t){var r;const{levels:n,startFragRequested:i}=this,s=t.level,a=t.details,c=a.totalduration;if(!n){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""}, cc [${a.startCC}, ${a.endCC}] duration:${c}`);const l=t.levelInfo,g=this.fragCurrent;g&&(this.state===pt.FRAG_LOADING||this.state===pt.FRAG_LOADING_WAITING_RETRY)&&g.level!==t.level&&g.loader&&this.abortCurrentFrag();let p=0;if(a.live||(r=l.details)!=null&&r.live){var v;if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;p=this.alignPlaylists(a,l.details,(v=this.levelLastLoaded)==null?void 0:v.details)}if(l.details=a,this.levelLastLoaded=l,i||this.setStartPosition(a,p),this.hls.trigger(_.LEVEL_UPDATED,{details:a,level:s}),this.state===pt.WAITING_LEVEL){if(this.waitForCdnTuneIn(a))return;this.state=pt.IDLE}i&&a.live&&this.synchronizeToLiveEdge(a),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:r}=this;if(!r)return;const n=this.hls.liveSyncPosition,i=this.getLoadPosition(),s=e.fragmentStart,a=e.edge,c=i>=s-t.maxFragLookUpTolerance&&i<=a;if(n!==null&&r.duration>n&&(i<n||!c)){const g=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&r.readyState<4||i<a-g)&&(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: ${a}, reset currentTime to : ${n.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var l;const p=sr.bufferInfo(r,n,0);if(!(p!=null&&(l=p.buffered)!=null&&l.length)){r.currentTime=n;return}if(p.start<=i){r.currentTime=n;return}const{nextStart:x}=sr.bufferedInfo(p.buffered,i,0);x&&(r.currentTime=x)}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 a=s[r.level];if(!a){this.warn(`Level ${r.level} not found on progress`);return}const c=a.details;if(!c){this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),this.fragmentTracker.removeFragment(r);return}const l=a.videoCodec,g=c.PTSKnown||!c.live,p=(t=r.initSegment)==null?void 0:t.data,v=this._getAudioCodec(a),x=this.transmuxer=this.transmuxer||new PA(this.hls,H.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),S=n?n.index:-1,O=S!==-1,M=new sn(r.level,r.sn,r.stats.chunkCount,i.byteLength,S,O),ie=this.initPTS[r.cc];x.push(i,p,v,l,r,n,c.totalduration,g,M,ie)}onAudioTrackSwitching(e,t){const r=this.hls,n=this.altAudio===2;if(qt(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.fragmentTracker.removeAllFragments(),r.once(_.BUFFER_FLUSHED,()=>{var s;(s=this.hls)==null||s.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=qt(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 a in r){const c=r[a];if(c.id==="main"){if(i=a,n=c,a==="video"){const l=r[a];l&&(this.videoBuffer=l.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===H.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===pt.PARSED&&(this.state=pt.IDLE);return}const a=n?n.stats:r.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),$e(r)&&(this.fragPrevious=r),this.fragBufferedComplete(r,n)}const s=this.media;s&&(!this._hasEnoughToStart&&sr.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=pt.ERROR;return}switch(t.details){case Y.FRAG_GAP:case Y.FRAG_PARSING_ERROR:case Y.FRAG_DECRYPT_ERROR:case Y.FRAG_LOAD_ERROR:case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_ERROR:case Y.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(H.MAIN,t);break;case Y.LEVEL_LOAD_ERROR:case Y.LEVEL_LOAD_TIMEOUT:case Y.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===pt.WAITING_LEVEL&&((r=t.context)==null?void 0:r.type)===ye.LEVEL&&(this.state=pt.IDLE);break;case Y.BUFFER_ADD_CODEC_ERROR:case Y.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case Y.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 Y.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=pt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==$.AUDIO||!this.altAudio){const r=(t===$.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;r&&(this.afterBufferFlushed(r,t,H.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=sr.getBuffered(e),a=s.length?s.start(0):0,c=a-r,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<l||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 ${a}`),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=pt.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})}_handleTransmuxComplete(e){var t;const r=this.playlistType,{hls:n}=this,{remuxResult:i,chunkMeta:s}=e,a=this.getCurrentContext(s);if(!a){this.resetWhenMissingContext(s);return}const{frag:c,part:l,level:g}=a,{video:p,text:v,id3:x,initSegment:S}=i,{details:O}=g,M=this.altAudio?void 0:i.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=pt.PARSING,S){if(S!=null&&S.tracks){const Qe=c.initSegment||c;this._bufferInitSegment(g,S.tracks,Qe,s),n.trigger(_.FRAG_PARSING_INIT_SEGMENT,{frag:Qe,id:r,tracks:S.tracks})}const ie=S.initPTS,Be=S.timescale,_e=this.initPTS[c.cc];if(z(ie)&&(!_e||_e.baseTime!==ie||_e.timescale!==Be)){const Qe=S.trackId;this.initPTS[c.cc]={baseTime:ie,timescale:Be,trackId:Qe},n.trigger(_.INIT_PTS_FOUND,{frag:c,id:r,initPTS:ie,timescale:Be,trackId:Qe})}}if(p&&O){M&&p.type==="audiovideo"&&this.logMuxedErr(c);const ie=O.fragments[c.sn-1-O.startSN],Be=c.sn===O.startSN,_e=!ie||c.cc>ie.cc;if(i.independent!==!1){const{startPTS:Qe,endPTS:We,startDTS:_t,endDTS:Ge}=p;if(l)l.elementaryStreams[p.type]={startPTS:Qe,endPTS:We,startDTS:_t,endDTS:Ge};else if(p.firstKeyFrame&&p.independent&&s.id===1&&!_e&&(this.couldBacktrack=!0),p.dropped&&p.independent){const at=this.getMainFwdBufferInfo(),ft=(at?at.end:this.getLoadPosition())+this.config.maxBufferHole,ze=p.firstKeyFramePTS?p.firstKeyFramePTS:Qe;if(!Be&&ft<ze-this.config.maxBufferHole&&!_e){this.backtrack(c);return}else _e&&(c.gap=!0);c.setElementaryStreamInfo(p.type,c.start,We,c.start,Ge,!0)}else Be&&Qe-(O.appliedTimelineOffset||0)>aa&&(c.gap=!0);c.setElementaryStreamInfo(p.type,Qe,We,_t,Ge),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(p,c,l,s,Be||_e)}else if(Be||_e)c.gap=!0;else{this.backtrack(c);return}}if(M){const{startPTS:ie,endPTS:Be,startDTS:_e,endDTS:Qe}=M;l&&(l.elementaryStreams[$.AUDIO]={startPTS:ie,endPTS:Be,startDTS:_e,endDTS:Qe}),c.setElementaryStreamInfo($.AUDIO,ie,Be,_e,Qe),this.bufferFragmentData(M,c,l,s)}if(O&&x!=null&&(t=x.samples)!=null&&t.length){const ie={id:r,frag:c,details:O,samples:x.samples};n.trigger(_.FRAG_PARSING_METADATA,ie)}if(O&&v){const ie={id:r,frag:c,details:O,samples:v.samples};n.trigger(_.FRAG_PARSING_USERDATA,ie)}}logMuxedErr(e){this.warn(`${$e(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,r,n){if(this.state!==pt.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:a}=t;if(i){const l=e.audioCodec;let g=Te(i.codec,l);g==="mp4a"&&(g="mp4a.40.5");const p=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){g&&(g.indexOf("mp4a.40.5")!==-1?g="mp4a.40.2":g="mp4a.40.5");const v=i.metadata;v&&"channelCount"in v&&(v.channelCount||1)!==1&&p.indexOf("firefox")===-1&&(g="mp4a.40.5")}g&&g.indexOf("mp4a.40.5")!==-1&&p.indexOf("android")!==-1&&i.container!=="audio/mpeg"&&(g="mp4a.40.2",this.log(`Android: force audio codec to ${g}`)),l&&l!==g&&this.log(`Swapping manifest audio codec "${l}" for "${g}"`),i.levelCodec=g,i.id=H.MAIN,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${g||""}/${l||""}/${i.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=H.MAIN;const l=s.codec;if((l==null?void 0:l.length)===4)switch(l){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||""}/${l}]${s.codec!==l?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}a&&(this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.codecs}/${a.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(l=>{const p=t[l].initSegment;p!=null&&p.byteLength&&this.hls.trigger(_.BUFFER_APPENDING,{type:l,data:p,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,H.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=pt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const r=e.currentTime;if(sr.isBuffered(e,r)?t=this.getAppendedFrag(r):sr.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 z(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(z(t)){const r=this.getLevelDetails(),n=this.currentFrag||(r?Dr(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 cr{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const r in this.keyUriToKeyInfo){const n=this.keyUriToKeyInfo[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.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=Y.KEY_LOAD_ERROR,r,n,i){return new jr({type:ve.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&&(!$e(e)||!$e(s)||e.sn<s.sn)||!r&&n==i-1)return this.emeController.selectKeySystemFormat(s).then(a=>{if(!this.emeController)return;s.setKeyFormat(a);const c=ci(a);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const n=Di(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 l=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,Y.KEY_LOAD_ERROR,l))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,Y.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let a=this.keyUriToKeyInfo[s];if((r=a)!=null&&r.decryptdata.key)return i.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});if((n=a)!=null&&n.keyLoadPromise){var c;switch((c=a.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then(l=>(i.key=l.keyInfo.decryptdata.key,{frag:e,keyInfo:a}))}}switch(a=this.keyUriToKeyInfo[s]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return i.keyFormat==="identity"?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,Y.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){const n=this.emeController.loadKey(r);if(n)return(e.keyLoadPromise=n.then(i=>(e.mediaKeySessionContext=i,r))).catch(i=>{throw e.keyLoadPromise=null,i})}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,a)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=r.keyLoadPolicy.default,g={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},p={onSuccess:(v,x,S,O)=>{const{frag:M,keyInfo:ie,url:Be}=S;if(!M.decryptdata||ie!==this.keyUriToKeyInfo[Be])return a(this.createKeyLoadError(M,Y.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),O));ie.decryptdata.key=M.decryptdata.key=new Uint8Array(v.data),M.keyLoader=null,ie.loader=null,s({frag:M,keyInfo:ie})},onError:(v,x,S,O)=>{this.resetLoader(x),a(this.createKeyLoadError(t,Y.KEY_LOAD_ERROR,new Error(`HTTP Error ${v.code} loading key ${v.text}`),S,C({url:c.url,data:void 0},v)))},onTimeout:(v,x,S)=>{this.resetLoader(x),a(this.createKeyLoadError(t,Y.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),S))},onAbort:(v,x,S)=>{this.resetLoader(x),a(this.createKeyLoadError(t,Y.INTERNAL_ABORTED,new Error("key loading aborted"),S))}};i.load(c,g,p)})}resetLoader(e){const{frag:t,keyInfo:r,url:n}=e,i=r.loader;t.keyLoader===i&&(t.keyLoader=null,r.loader=null),delete this.keyUriToKeyInfo[n],i&&i.destroy()}}function nn(A){const{type:e}=A;switch(e){case ye.AUDIO_TRACK:return H.AUDIO;case ye.SUBTITLE_TRACK:return H.SUBTITLE;default:return H.MAIN}}function Fr(A,e){let t=A.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Cr{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:ye.MANIFEST,url:r,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:r,level:n,pathwayId:i,url:s,deliveryDirectives:a,levelInfo:c}=t;this.load({id:r,level:n,pathwayId:i,responseType:"text",type:ye.LEVEL,url:s,deliveryDirectives:a,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s,track:a}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:ye.AUDIO_TRACK,url:i,deliveryDirectives:s,levelOrTrack:a})}onSubtitleTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s,track:a}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:ye.SUBTITLE_TRACK,url:i,deliveryDirectives:s,levelOrTrack:a})}onLevelsUpdated(e,t){const r=this.loaders[ye.LEVEL];if(r){const n=r.context;n&&!t.levels.some(i=>i===n.levelOrTrack)&&(r.abort(),delete this.loaders[ye.LEVEL])}}load(e){var t;const r=this.hls.config;let n=this.getInternalLoader(e);if(n){const l=this.hls.logger,g=n.context;if(g&&g.levelOrTrack===e.levelOrTrack&&(g.url===e.url||g.deliveryDirectives&&!e.deliveryDirectives)){g.url===e.url?l.log(`[playlist-loader]: ignore ${e.url} ongoing request`):l.log(`[playlist-loader]: ignore ${e.url} in favor of ${g.url}`);return}l.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),n.abort()}let i;if(e.type===ye.MANIFEST?i=r.manifestLoadPolicy.default:i=B({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),n=this.createInternalLoader(e),z((t=e.deliveryDirectives)==null?void 0:t.part)){let l;if(e.type===ye.LEVEL&&e.level!==null?l=this.hls.levels[e.level].details:e.type===ye.AUDIO_TRACK&&e.id!==null?l=this.hls.audioTracks[e.id].details:e.type===ye.SUBTITLE_TRACK&&e.id!==null&&(l=this.hls.subtitleTracks[e.id].details),l){const g=l.partTarget,p=l.targetduration;if(g&&p){const v=Math.max(g*3,p*.8)*1e3;i=B({},i,{maxTimeToFirstByteMs:Math.min(v,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(v,i.maxTimeToFirstByteMs)})}}}const s=i.errorRetry||i.timeoutRetry||{},a={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(l,g,p,v)=>{const x=this.getInternalLoader(p);this.resetInternalLoader(p.type);const S=l.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,p,new Error("no EXTM3U delimiter"),v||null,g);return}g.parsing.start=performance.now(),Ci.isMediaPlaylist(S)||p.type!==ye.MANIFEST?this.handleTrackOrLevelPlaylist(l,g,p,v||null,x):this.handleMasterPlaylist(l,g,p,v)},onError:(l,g,p,v)=>{this.handleNetworkError(g,p,!1,l,v)},onTimeout:(l,g,p)=>{this.handleNetworkError(g,p,!0,void 0,l)}};n.load(e,a,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,a=Fr(e,r),c=Ci.parseMasterPlaylist(s,a);if(c.playlistParsingError){this.handleManifestParsingError(e,r,c.playlistParsingError,n,t);return}const{contentSteering:l,levels:g,sessionData:p,sessionKeys:v,startTimeOffset:x,variableList:S}=c;this.variableList=S;const{AUDIO:O=[],SUBTITLES:M,"CLOSED-CAPTIONS":ie}=Ci.parseMasterPlaylistMedia(s,a,c);O.length&&!O.some(_e=>!_e.url)&&g[0].audioCodec&&!g[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),O.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new hn({}),bitrate:0,url:""})),i.trigger(_.MANIFEST_LOADED,{levels:g,audioTracks:O,subtitles:M,captions:ie,contentSteering:l,url:a,stats:t,networkDetails:n,sessionData:p,sessionKeys:v,startTimeOffset:x,variableList:S})}handleTrackOrLevelPlaylist(e,t,r,n,i){const s=this.hls,{id:a,level:c,type:l}=r,g=Fr(e,r),p=z(c)?c:z(a)?a:0,v=nn(r),x=Ci.parseLevelPlaylist(e.data,g,p,v,0,this.variableList);if(l===ye.MANIFEST){const S={attrs:new hn({}),bitrate:0,details:x,name:"",url:g};x.requestScheduled=t.loading.start+Pi(x,0),s.trigger(_.MANIFEST_LOADED,{levels:[S],audioTracks:[],url:g,stats:t,networkDetails:n,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=x,this.handlePlaylistLoaded(x,e,t,r,n,i)}handleManifestParsingError(e,t,r,n,i){this.hls.trigger(_.ERROR,{type:ve.NETWORK_ERROR,details:Y.MANIFEST_PARSING_ERROR,fatal:t.type===ye.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===ye.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===ye.AUDIO_TRACK||e.type===ye.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=Y.UNKNOWN,l=!1;const g=this.getInternalLoader(e);switch(e.type){case ye.MANIFEST:c=r?Y.MANIFEST_LOAD_TIMEOUT:Y.MANIFEST_LOAD_ERROR,l=!0;break;case ye.LEVEL:c=r?Y.LEVEL_LOAD_TIMEOUT:Y.LEVEL_LOAD_ERROR,l=!1;break;case ye.AUDIO_TRACK:c=r?Y.AUDIO_TRACK_LOAD_TIMEOUT:Y.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case ye.SUBTITLE_TRACK:c=r?Y.SUBTITLE_TRACK_LOAD_TIMEOUT:Y.SUBTITLE_LOAD_ERROR,l=!1;break}g&&this.resetInternalLoader(e.type);const p={type:ve.NETWORK_ERROR,details:c,fatal:l,url:e.url,loader:g,context:e,error:a,networkDetails:t,stats:i};if(n){const v=(t==null?void 0:t.url)||e.url;p.response=C({url:v,data:void 0},n)}this.hls.trigger(_.ERROR,p)}handlePlaylistLoaded(e,t,r,n,i,s){const a=this.hls,{type:c,level:l,id:g,groupId:p,deliveryDirectives:v}=n,x=Fr(t,n),S=nn(n),O=typeof n.level=="number"&&S===H.MAIN?l:void 0;if(!e.fragments.length){const ie=e.playlistParsingError=new Error("No Segments found in Playlist");a.trigger(_.ERROR,{type:ve.NETWORK_ERROR,details:Y.LEVEL_EMPTY_ERROR,fatal:!1,url:x,error:ie,reason:ie.message,response:t,context:n,level:O,parent:S,networkDetails:i,stats:r});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const M=e.playlistParsingError;if(M){if(this.hls.logger.warn(`${M} ${e.url}`),!a.config.ignorePlaylistParsingErrors){a.trigger(_.ERROR,{type:ve.NETWORK_ERROR,details:Y.LEVEL_PARSING_ERROR,fatal:!1,url:x,error:M,reason:M.message,response:t,context:n,level:O,parent:S,networkDetails:i,stats:r});return}e.playlistParsingError=null}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case ye.MANIFEST:case ye.LEVEL:a.trigger(_.LEVEL_LOADED,{details:e,levelInfo:n.levelOrTrack||a.levels[0],level:O||0,id:g||0,stats:r,networkDetails:i,deliveryDirectives:v,withoutMultiVariant:c===ye.MANIFEST});break;case ye.AUDIO_TRACK:a.trigger(_.AUDIO_TRACK_LOADED,{details:e,track:n.levelOrTrack,id:g||0,groupId:p||"",stats:r,networkDetails:i,deliveryDirectives:v});break;case ye.SUBTITLE_TRACK:a.trigger(_.SUBTITLE_TRACK_LOADED,{details:e,track:n.levelOrTrack,id:g||0,groupId:p||"",stats:r,networkDetails:i,deliveryDirectives:v});break}}}class on{static get version(){return Wi}static isMSESupported(){return Ve()}static isSupported(){return et()}static getMediaSource(){return xe()}static get Events(){return _}static get MetadataSchema(){return Ui}static get ErrorTypes(){return ve}static get ErrorDetails(){return Y}static get DefaultConfig(){return on.defaultConfig?on.defaultConfig:sc}static set DefaultConfig(e){on.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 cs,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=Ie(e.debug||!1,"Hls instance",e.assetPlayerId),r=this.config=ac(on.DefaultConfig,e,t);this.userConfig=e,r.progressive&&oc(r,t);const{abrController:n,bufferController:i,capLevelController:s,errorController:a,fpsController:c}=r,l=new a(this),g=this.abrController=new n(this),p=new $t(this),v=r.interstitialsController,x=v?this.interstitialsController=new v(this,on):null,S=this.bufferController=new i(this,p),O=this.capLevelController=new s(this),M=new c(this),ie=new Cr(this),Be=r.contentSteeringController,_e=Be?new Be(this):null,Qe=this.levelController=new de(this,_e),We=new I(this),_t=new cr(this.config),Ge=this.streamController=new Xt(this,p,_t),at=this.gapController=new fc(this,p);O.setStreamController(Ge),M.setStreamController(Ge);const ft=[ie,Qe,Ge];x&&ft.splice(1,0,x),_e&&ft.splice(1,0,_e),this.networkControllers=ft;const ze=[g,S,at,O,M,We,p];this.audioTrackController=this.createController(r.audioTrackController,ft);const Lt=r.audioStreamController;Lt&&ft.push(this.audioStreamController=new Lt(this,p,_t)),this.subtitleTrackController=this.createController(r.subtitleTrackController,ft);const lr=r.subtitleStreamController;lr&&ft.push(this.subtititleStreamController=new lr(this,p,_t)),this.createController(r.timelineController,ze),_t.emeController=this.emeController=this.createController(r.emeController,ze),this.cmcdController=this.createController(r.cmcdController,ze),this.latencyController=this.createController(J,ze),this.coreComponents=ze,ft.push(l);const br=l.onErrorOut;typeof br=="function"&&this.on(_.ERROR,br,l),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:ve.OTHER_ERROR,details:Y.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:ve.OTHER_ERROR,details:Y.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={[H.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[H.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[H.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=il()),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){en(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=wr(t);return $r(e,r,navigator.mediaCapabilities)}}on.defaultConfig=void 0}}]);
}());